summaryrefslogtreecommitdiffhomepage
path: root/packages/cli/src/args.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-25 18:36:08 +0900
committerAdam Malczewski <[email protected]>2026-06-25 18:36:08 +0900
commitde022cee7ac66c95d7ed6a35d4e00f8e2d92cbbc (patch)
tree041dcb1017e544a405526443cb578baa974bec0e /packages/cli/src/args.ts
parentfc1c3a54c3075990ec0dd0f97901bd46fe142923 (diff)
parent649fc4f66f40f7743683546f81d3320e7394e597 (diff)
downloaddispatch-de022cee7ac66c95d7ed6a35d4e00f8e2d92cbbc.tar.gz
dispatch-de022cee7ac66c95d7ed6a35d4e00f8e2d92cbbc.zip
Merge branch 'dev' into feature/ssh-support
Brings dev's retry-with-backoff (the transient `provider-retry` AgentEvent the web frontend consumes) + the LSP-dead-server per-edit-hang fix into the SSH feature branch, alongside the SSH waves 0-5c. All code files auto-merged cleanly (run-turn.ts, orchestrator.ts, runtime.ts, wire/index.ts, tool-edit-file/extension.ts, run-turn.test.ts — both computerId threading and retry-with-backoff coexist). Only tasks.md conflicted (status section — orchestrator-resolved; both feature sections kept). Verified post-merge: tsc -b EXIT 0, biome clean (391 files), 1730 vitest pass +6 sshd-integration skipped (was 1690; +40 from dev's retry/LSP tests). Wire dist rebuilt so the FE can re-sync the pinned @dispatch/wire dep and pick up BOTH provider-retry AND the SSH Computer/defaultComputerId types. No merge or push (into dev or otherwise).
Diffstat (limited to 'packages/cli/src/args.ts')
-rw-r--r--packages/cli/src/args.ts22
1 files changed, 19 insertions, 3 deletions
diff --git a/packages/cli/src/args.ts b/packages/cli/src/args.ts
index 8a63777..74cc56a 100644
--- a/packages/cli/src/args.ts
+++ b/packages/cli/src/args.ts
@@ -33,6 +33,7 @@ export type ParsedCommand =
readonly server: string;
readonly query?: string;
readonly status?: string;
+ readonly workspaceId?: string;
readonly all: boolean;
}
| { readonly kind: "compact"; readonly server: string; readonly conversationId: string }
@@ -42,7 +43,8 @@ export type ParsedCommand =
readonly kind: "send";
readonly server: string;
readonly conversationId: string;
- readonly text: string;
+ readonly text?: string | undefined;
+ readonly file?: string | undefined;
readonly queue: boolean;
readonly open: boolean;
readonly cwd?: string;
@@ -84,6 +86,7 @@ export function parseArgs(argv: readonly string[], opts: ParseOpts): ParsedComma
let server = opts.defaultServer;
let query: string | undefined;
let status: string | undefined;
+ let workspaceId: string | undefined;
let all = false;
for (let i = 1; i < argv.length; i++) {
const arg = argv[i] as string;
@@ -93,6 +96,9 @@ export function parseArgs(argv: readonly string[], opts: ParseOpts): ParsedComma
} else if (arg === "--status") {
if (i + 1 >= argv.length) return { kind: "error", message: "--status requires a value" };
status = argv[++i];
+ } else if (arg === "--workspace" || arg === "-w") {
+ if (i + 1 >= argv.length) return { kind: "error", message: "--workspace requires a value" };
+ workspaceId = argv[++i];
} else if (arg === "--all") {
all = true;
} else if (arg.startsWith("--")) {
@@ -108,6 +114,7 @@ export function parseArgs(argv: readonly string[], opts: ParseOpts): ParsedComma
server,
...(query !== undefined && { query }),
...(status !== undefined && { status }),
+ ...(workspaceId !== undefined && { workspaceId }),
all,
};
}
@@ -204,6 +211,7 @@ export function parseArgs(argv: readonly string[], opts: ParseOpts): ParsedComma
let server = opts.defaultServer;
let conversationId: string | undefined;
let text: string | undefined;
+ let file: string | undefined;
let queue = false;
let open = false;
let cwd: string | undefined;
@@ -221,6 +229,10 @@ export function parseArgs(argv: readonly string[], opts: ParseOpts): ParsedComma
if (i + 1 >= argv.length) return { kind: "error", message: "--text requires a value" };
text = argv[++i];
break;
+ case "--file":
+ if (i + 1 >= argv.length) return { kind: "error", message: "--file requires a value" };
+ file = argv[++i];
+ break;
case "--queue":
queue = true;
break;
@@ -263,8 +275,11 @@ export function parseArgs(argv: readonly string[], opts: ParseOpts): ParsedComma
if (conversationId === undefined) {
return { kind: "error", message: "'send' requires a conversation id" };
}
- if (text === undefined) {
- return { kind: "error", message: "'send' requires --text" };
+ if (!text && !file) {
+ return {
+ kind: "error",
+ message: "At least one of --text or --file is required for 'send'",
+ };
}
return {
@@ -272,6 +287,7 @@ export function parseArgs(argv: readonly string[], opts: ParseOpts): ParsedComma
server,
conversationId,
text,
+ file,
queue,
open,
...(cwd !== undefined && { cwd }),