From b346a50c3757b3df6086f11b995847144a5e07e8 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Tue, 23 Jun 2026 03:27:01 +0900 Subject: feat: workspaces — session-orchestrator + transport-http + transport-ws + cli (Wave 2+3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit session-orchestrator: workspaceId on StartTurnInput/EnqueueInput; effective cwd resolution (getCwd → getEffectiveCwd); auto-create workspace on turn start; warm parity (same effective cwd). 93 tests (+8). transport-http: workspace routes (GET/PUT/DELETE /workspaces, title, default-cwd); workspaceId threading on POST /chat + queue; ?workspaceId= filter on GET /conversations; DELETE /conversations/:id/cwd (clears explicit cwd); GET /conversations/:id/lsp uses effective cwd; slug validation. 166 tests. transport-ws: workspaceId threading on chat.send + chat.queue. 32 tests. cli: --workspace/-w flag; ConversationMeta test fakes fixed. 123 tests. Full typecheck EXIT 0, biome clean. 1283 vitest + 199 transport bun pass (1 pre-existing tool-shell failure unrelated to workspaces). --- packages/cli/src/args.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'packages/cli/src/args.ts') diff --git a/packages/cli/src/args.ts b/packages/cli/src/args.ts index ac5dd4a..8a63777 100644 --- a/packages/cli/src/args.ts +++ b/packages/cli/src/args.ts @@ -26,6 +26,7 @@ export type ParsedCommand = readonly reasoningEffort?: ReasoningEffort | undefined; readonly showReasoning: boolean; readonly open: boolean; + readonly workspaceId?: string | undefined; } | { readonly kind: "list"; @@ -46,6 +47,7 @@ export type ParsedCommand = readonly open: boolean; readonly cwd?: string; readonly reasoningEffort?: ReasoningEffort; + readonly workspaceId?: string; } | { readonly kind: "stop"; readonly server: string; readonly conversationId: string } | { readonly kind: "help" } @@ -206,6 +208,7 @@ export function parseArgs(argv: readonly string[], opts: ParseOpts): ParsedComma let open = false; let cwd: string | undefined; let reasoningEffort: ReasoningEffort | undefined; + let workspaceId: string | undefined; for (let i = 1; i < argv.length; i++) { const arg = argv[i] as string; @@ -243,6 +246,12 @@ export function parseArgs(argv: readonly string[], opts: ParseOpts): ParsedComma reasoningEffort = val; break; } + case "--workspace": + case "-w": + if (i + 1 >= argv.length) + return { kind: "error", message: "--workspace requires a value" }; + workspaceId = argv[++i]; + break; default: if (arg.startsWith("--")) return { kind: "error", message: `Unknown flag: ${arg}` }; if (conversationId !== undefined) @@ -267,6 +276,7 @@ export function parseArgs(argv: readonly string[], opts: ParseOpts): ParsedComma open, ...(cwd !== undefined && { cwd }), ...(reasoningEffort !== undefined && { reasoningEffort }), + ...(workspaceId !== undefined && { workspaceId }), }; } @@ -280,6 +290,7 @@ export function parseArgs(argv: readonly string[], opts: ParseOpts): ParsedComma let showReasoning = false; let open = false; let server = opts.defaultServer; + let workspaceId: string | undefined; for (let i = 1; i < argv.length; i++) { const arg = argv[i] as string; @@ -327,6 +338,11 @@ export function parseArgs(argv: readonly string[], opts: ParseOpts): ParsedComma reasoningEffort = val; } break; + case "--workspace": + case "-w": + if (i + 1 >= argv.length) return { kind: "error", message: "--workspace requires a value" }; + workspaceId = argv[++i]; + break; default: return { kind: "error", message: `Unknown flag: ${arg}` }; } @@ -350,5 +366,6 @@ export function parseArgs(argv: readonly string[], opts: ParseOpts): ParsedComma reasoningEffort, showReasoning, open, + ...(workspaceId !== undefined && { workspaceId }), }; } -- cgit v1.2.3