From 7ff9f94c41a9870e124a50133cd74b42295ab9ac Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Mon, 22 Jun 2026 00:08:21 +0900 Subject: feat: conversation lifecycle status (active/idle/closed) for tab persistence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement roadmap item 9: tab persistence across devices. Wire (0.10.0): - Add ConversationStatus type (active | idle | closed) - Add status field to ConversationMeta Transport-contract (0.14.0): - Add conversation.statusChanged WS message to WsServerMessage union - Re-export ConversationStatus Conversation-store: - Track status in ConversationMetaRow (default: idle) - getConversationStatus / setConversationStatus methods - listConversations accepts { status: ConversationStatus[] } filter - Old meta rows without status default to idle on read Session-orchestrator: - conversationStatusChanged hook descriptor - Emit on transitions: idle→active (turn start), active→idle (turn settle), →closed (closeConversation) - Persist status to store as fire-and-forget side effect - Declare hook in manifest contributes.hooks Transport-ws: - Subscribe to conversationStatusChanged hook - Broadcast conversation.statusChanged WS message to all clients Transport-http: - GET /conversations?status=active,idle filter (parseStatusFilter pure helper) - POST /conversations/:id/close now sets status to closed CLI: - dispatch list defaults to active,idle (excludes closed) - --status flag to filter by single status - --all flag to include closed FE handoff: frontend-conversation-lifecycle-handoff.md --- packages/cli/src/args.test.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'packages/cli/src/args.test.ts') diff --git a/packages/cli/src/args.test.ts b/packages/cli/src/args.test.ts index 62bcafd..992d09f 100644 --- a/packages/cli/src/args.test.ts +++ b/packages/cli/src/args.test.ts @@ -190,6 +190,7 @@ describe("parseArgs", () => { expect(parseArgs(["list"], { defaultServer })).toEqual({ kind: "list", server: "http://localhost:24203", + all: false, }); }); @@ -198,6 +199,7 @@ describe("parseArgs", () => { kind: "list", server: "http://localhost:24203", query: "abc12345", + all: false, }); }); @@ -206,9 +208,36 @@ describe("parseArgs", () => { kind: "list", server: "http://s", query: "abc", + all: false, }); }); + it("parses 'list' with --status", () => { + expect(parseArgs(["list", "--status", "closed"], { defaultServer })).toEqual({ + kind: "list", + server: "http://localhost:24203", + status: "closed", + all: false, + }); + }); + + it("parses 'list' with --all", () => { + expect(parseArgs(["list", "--all"], { defaultServer })).toEqual({ + kind: "list", + server: "http://localhost:24203", + all: true, + }); + }); + + it("parses 'list' with --status and --all ( --all takes precedence)", () => { + const result = parseArgs(["list", "--status", "active", "--all"], { defaultServer }); + expect(result.kind).toBe("list"); + if (result.kind === "list") { + expect(result.all).toBe(true); + expect(result.status).toBe("active"); + } + }); + it("errors on a second positional argument", () => { const result = parseArgs(["list", "abc", "def"], { defaultServer }); expect(result.kind).toBe("error"); -- cgit v1.2.3