summaryrefslogtreecommitdiffhomepage
path: root/packages/cli/src/args.test.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-23 03:27:01 +0900
committerAdam Malczewski <[email protected]>2026-06-23 03:27:01 +0900
commitb346a50c3757b3df6086f11b995847144a5e07e8 (patch)
tree0119ff2a63e3ef9e9efb0190daeb20707e1c5f7a /packages/cli/src/args.test.ts
parent6d7b3923b40eb4baf3cefadfde236de646990713 (diff)
downloaddispatch-b346a50c3757b3df6086f11b995847144a5e07e8.tar.gz
dispatch-b346a50c3757b3df6086f11b995847144a5e07e8.zip
feat: workspaces — session-orchestrator + transport-http + transport-ws + cli (Wave 2+3)
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).
Diffstat (limited to 'packages/cli/src/args.test.ts')
-rw-r--r--packages/cli/src/args.test.ts33
1 files changed, 33 insertions, 0 deletions
diff --git a/packages/cli/src/args.test.ts b/packages/cli/src/args.test.ts
index 992d09f..3d07c96 100644
--- a/packages/cli/src/args.test.ts
+++ b/packages/cli/src/args.test.ts
@@ -52,6 +52,7 @@ describe("parseArgs", () => {
reasoningEffort: undefined,
showReasoning: false,
open: false,
+ workspaceId: undefined,
});
});
@@ -68,6 +69,7 @@ describe("parseArgs", () => {
reasoningEffort: undefined,
showReasoning: false,
open: false,
+ workspaceId: undefined,
});
});
@@ -103,6 +105,7 @@ describe("parseArgs", () => {
reasoningEffort: undefined,
showReasoning: true,
open: false,
+ workspaceId: undefined,
});
});
@@ -119,6 +122,7 @@ describe("parseArgs", () => {
reasoningEffort: "high",
showReasoning: false,
open: false,
+ workspaceId: undefined,
});
});
@@ -183,6 +187,35 @@ describe("parseArgs", () => {
const result = parseArgs(["m", "--text", "x", "--conversation"], { defaultServer });
expect(result.kind).toBe("error");
});
+
+ it("parses --workspace flag", () => {
+ const result = parseArgs(["m", "--text", "x", "--workspace", "my-work"], { defaultServer });
+ expect(result).toEqual({
+ kind: "chat",
+ server: "http://localhost:24203",
+ modelName: "m",
+ text: "x",
+ file: undefined,
+ cwd: undefined,
+ conversationId: undefined,
+ reasoningEffort: undefined,
+ showReasoning: false,
+ open: false,
+ workspaceId: "my-work",
+ });
+ });
+
+ it("parses -w shorthand", () => {
+ const result = parseArgs(["m", "--text", "x", "-w", "ws"], { defaultServer });
+ expect(result.kind).toBe("chat");
+ if (result.kind === "chat") expect(result.workspaceId).toBe("ws");
+ });
+
+ it("errors when --workspace has no value", () => {
+ const result = parseArgs(["m", "--text", "x", "--workspace"], { defaultServer });
+ expect(result.kind).toBe("error");
+ if (result.kind === "error") expect(result.message).toContain("--workspace requires a value");
+ });
});
describe("list", () => {