feat(hub): add Agent Hub — cross-agent context sharing via /save, /hu…#46
Open
yuanguangshan wants to merge 1 commit intofastclaw-ai:mainfrom
Open
feat(hub): add Agent Hub — cross-agent context sharing via /save, /hu…#46yuanguangshan wants to merge 1 commit intofastclaw-ai:mainfrom
yuanguangshan wants to merge 1 commit intofastclaw-ai:mainfrom
Conversation
…b, /hub pipe Implements the Agent Hub system: a filesystem-based shared blackboard that lets multiple AI agents collaborate by exchanging intermediate results through a common context store. ## New Commands ### /save — save agent replies to Hub /save <filename> <message> Send to agent, save reply to Hub /save <filename> Save last agent reply directly to Hub /save @claude filename msg Target a specific agent ### /hub — inject shared context into agent /hub List hub files /hub ls Detailed listing with numbered index /hub cat <n> Read file by number /hub <message> Inject all hub context, send to agent /hub <filename> <message> Inject specific file, send to agent /hub clear Delete all hub files ### /hub pipe — chain agents automatically /hub pipe <agent> <message> Default agent → save → target agent /hub pipe <agent> @<n> <message> Use hub file #n as input /hub pipe <agent> @-1 <message> Use latest hub file as input /hub pipe <agent> @<name> <msg> Partial filename match ## Design - Pure Go, zero new dependencies - Storage: ~/.weclaw/hub/shared/ (Markdown + YAML frontmatter) - Thread-safe: sync.RWMutex on Hub struct - Session isolation: hub:<agent>:<userID> conversationID prevents cross-contamination of default chat sessions - Agents are instructed to return raw content, not create files ## Files - hub/hub.go: Hub core — Save, ReadAll, ReadSpecific, List, ListWithInfo, FindByPartialName, Clear, Exists - hub/hub_test.go: 11 unit tests (all passing) - docs/agent-hub-design.md: Architecture design document - messaging/handler.go: /save, /hub, /hub pipe command integration ## Example Workflow /save round1.md Analyze AI agents from a philosophical angle /hub pipe gemini @1 Continue with a technical feasibility critique /hub pipe claude @-1 Synthesize both perspectives
aba3aef to
f479745
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…b, /hub pipe
Implements the Agent Hub system: a filesystem-based shared blackboard that lets multiple AI agents collaborate by exchanging intermediate results through a common context store.
New Commands
/save — save agent replies to Hub
/save Send to agent, save reply to Hub
/save Save last agent reply directly to Hub
/save @claude filename msg Target a specific agent
/hub — inject shared context into agent
/hub List hub files
/hub ls Detailed listing with numbered index
/hub cat Read file by number
/hub Inject all hub context, send to agent
/hub Inject specific file, send to agent
/hub clear Delete all hub files
/hub pipe — chain agents automatically
/hub pipe Default agent → save → target agent
/hub pipe @ Use hub file #n as input
/hub pipe @-1 Use latest hub file as input
/hub pipe @ Partial filename match
Design
Files
ListWithInfo, FindByPartialName, Clear, Exists
Example Workflow
/save round1.md Analyze AI agents from a philosophical angle /hub pipe gemini @1 Continue with a technical feasibility critique /hub pipe claude @-1 Synthesize both perspectives