feat(v3): chat rooms primitive — daemon RPCs + CLI + client wrappers#33
Open
Codename-11 wants to merge 1 commit into
Open
feat(v3): chat rooms primitive — daemon RPCs + CLI + client wrappers#33Codename-11 wants to merge 1 commit into
Codename-11 wants to merge 1 commit into
Conversation
Ships `arc chat rooms create/list`, `arc chat post`, `arc chat read`, and `arc chat wait` on top of the v3 daemon's `chat_rooms` + `chat_messages` tables. Messages auto-extract `@mentions` on post, support threading via `--reply-to`, and `chat.wait` blocks on room subscribers until a matching message arrives or the timeout elapses. Protocol v1 additions (all new fields optional): - chat.create, chat.list, chat.post, chat.read, chat.wait - Schemas in packages/client/src/protocol-chat.ts Hub gains a `subscribeRaw` API for in-process RPC handlers to await topic events without going through the WebSocket encoder — used by chat.wait. External WebSocket subscribers continue to work unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Ships the v3 chat-rooms primitive across the stack:
chat.create,chat.list,chat.post,chat.read,chat.wait— schemas inpackages/client/src/protocol-chat.ts.packages/daemon/src/rpc/chat.ts) — backed by the existingchat_rooms+chat_messagesSQLite tables. Messages auto-extract@mentionson post; replies validatereply_tostays in-room; post fans out tochat:<roomId>topic via the Hub.packages/daemon/src/hub.ts) — addssubscribeRaw/unsubscribeRawso in-process handlers (likechat.wait) can await topic events without going through the WebSocket encoder. External WS subscribers unchanged.packages/client/src/client.ts) — adds typedclient.chat.{create, list, post, read, wait}wrappers.arc chatwithrooms create/list,post,read(--since,--mentions-only,--mentioning,--limit,--json), andwait(--mentioning,--timeout). The existingarc chatREPL is untouched.Test plan
npx tsc --noEmit— passesnpx vitest run tests/chat-rooms.test.ts— 10/10 pass (mention extraction, room CRUD, threading, sinceMs, mentions-only, mentioning filter, wait-with-bg-post, wait-timeout, cross-room reply_to rejection, unknown-room)npx vitest run packages/daemon/tests/daemon.test.ts— still passes (4/4)chat rooms create standup→chat post standup "hello @agent-1"→chat read standup→chat wait --mentioning meresolves when a bg shell posts"yo @me")Notes
agent.tshook forARC_AGENT_IDenv injection is intentionally not touched to avoid conflicting with the parallel Unit 2 (agent-lifecycle) PR. The chat RPCs ship independently; agent-id plumbing can land alongside Unit 2.arc chatremains backwards-compatible: top-level REPL action still works; subcommands are additive.🤖 Generated with Claude Code