@floh-solutions/pharos-cli 0.29.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +33 -0
  2. package/dist/capabilities.d.ts +7 -0
  3. package/dist/capabilities.d.ts.map +1 -1
  4. package/dist/capabilities.js +25 -0
  5. package/dist/capabilities.js.map +1 -1
  6. package/dist/cli.d.ts +18 -1
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +178 -86
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/delegate.d.ts +143 -0
  11. package/dist/commands/delegate.d.ts.map +1 -0
  12. package/dist/commands/delegate.js +364 -0
  13. package/dist/commands/delegate.js.map +1 -0
  14. package/dist/commands/doctor.d.ts +8 -0
  15. package/dist/commands/doctor.d.ts.map +1 -1
  16. package/dist/commands/doctor.js +179 -4
  17. package/dist/commands/doctor.js.map +1 -1
  18. package/dist/commands/setup.d.ts.map +1 -1
  19. package/dist/commands/setup.js +7 -3
  20. package/dist/commands/setup.js.map +1 -1
  21. package/dist/delegate/hosts.d.ts +83 -0
  22. package/dist/delegate/hosts.d.ts.map +1 -0
  23. package/dist/delegate/hosts.js +154 -0
  24. package/dist/delegate/hosts.js.map +1 -0
  25. package/dist/delegate/quote.d.ts +78 -0
  26. package/dist/delegate/quote.d.ts.map +1 -0
  27. package/dist/delegate/quote.js +134 -0
  28. package/dist/delegate/quote.js.map +1 -0
  29. package/dist/delegate/sessions.d.ts +113 -0
  30. package/dist/delegate/sessions.d.ts.map +1 -0
  31. package/dist/delegate/sessions.js +220 -0
  32. package/dist/delegate/sessions.js.map +1 -0
  33. package/dist/delegate/vsix.d.ts +122 -0
  34. package/dist/delegate/vsix.d.ts.map +1 -0
  35. package/dist/delegate/vsix.js +329 -0
  36. package/dist/delegate/vsix.js.map +1 -0
  37. package/package.json +3 -2
  38. package/skill/SKILL.md +41 -0
  39. package/vscode/README.md +30 -0
  40. package/vscode/pharos-bridge.json +10 -0
  41. package/vscode/pharos-bridge.vsix +0 -0
  42. package/dist/commands/pr.d.ts +0 -56
  43. package/dist/commands/pr.d.ts.map +0 -1
  44. package/dist/commands/pr.js +0 -202
  45. package/dist/commands/pr.js.map +0 -1
package/README.md CHANGED
@@ -549,6 +549,39 @@ connectivity fault worded as a credential fault. `gh-auth` therefore never tells
549
549
  you that you are signed out; it reports both causes, because from here they are
550
550
  genuinely indistinguishable.
551
551
 
552
+ ## Delegating a work item to a coding agent
553
+
554
+ ```bash
555
+ pharos delegate --host vscode-insiders --agent claude \
556
+ --folder ~/Developer/widgets --text "Fetch Azure DevOps work item #4821 …"
557
+ pharos delegate --host terminal --agent codex --folder … --text … --dry-run
558
+ ```
559
+
560
+ Pharos.app's *Ask Agent* is a GUI over this verb, the way its Command line
561
+ wizard is a GUI over `doctor` and `setup`: one detector, one launcher, and the
562
+ app renders the decoded outcome rather than parsing `ps` or speaking
563
+ AppleScript itself. It finds the session already running on that folder in
564
+ that host — `claude agents --json` for Claude, `ps` and `lsof` for Codex, the
565
+ process tree for which application owns it — and types the prompt into it, or
566
+ starts one with the prompt as its first message.
567
+
568
+ | host | how the prompt gets in |
569
+ |---|---|
570
+ | `terminal` | Apple Events: `do script … in` the tab whose tty the session holds, else a new window. macOS asks once whether the calling app may control Terminal. |
571
+ | `vscode`, `vscode-insiders` | a `vscode[-insiders]://floh-solutions.pharos/delegate?…` URI handled by the Pharos bridge extension — `pharos setup --install vscode-bridge`. Nothing else can put a prompt into VS Code from outside; the Claude Code and Codex extensions take none. |
572
+ | `navarch` | refused `unsupported` until the Argus app gains a `delegate` op (#1378). |
573
+
574
+ Success is `{ ok: true, action: "sent" | "launched", session, detail }`. A
575
+ refusal is `{ ok: false, reason, detail }` on stdout with exit 2, `reason`
576
+ being one of `host-not-installed`, `agent-not-installed`,
577
+ `bridge-not-installed`, `automation-denied`, `folder-missing`, `unsupported` —
578
+ stable ids, because the app renders facts. `pharos doctor` carries the rows
579
+ behind them: `terminal`, `vscode`, `vscode-insiders`, `navarch`, `claude`,
580
+ `codex`, and per installed VS Code flavour `<host>-claude-ext`,
581
+ `<host>-codex-ext`, `<host>-bridge`. The agents are reported, never installed:
582
+ a coding agent is the person's login.
583
+
552
584
  ## Requirements
553
585
 
554
586
  Node 22 or later. `gh` for the GitHub bridge, and nothing else is required.
587
+ `pharos delegate` is macOS only: its hosts are macOS applications.
@@ -1,3 +1,4 @@
1
+ import { type BridgeInstallOutcome } from "./delegate/vsix.js";
1
2
  /**
2
3
  * Installing the things pharos TALKS about but does not depend on (#766).
3
4
  *
@@ -45,6 +46,12 @@ export interface CapabilityOutcome {
45
46
  /** The command actually run, so a transcript shows what happened. */
46
47
  command: string | null;
47
48
  detail: string;
49
+ /**
50
+ * `vscode-bridge` only: one entry per VS Code flavour the bridge was
51
+ * installed into, so a wizard can say which editor got it rather than
52
+ * reading the sentence. Absent on every other capability.
53
+ */
54
+ flavours?: BridgeInstallOutcome["flavours"];
48
55
  }
49
56
  export declare const INSTALLABLE: Capability[];
50
57
  /** Install the named capabilities, one at a time, reporting each. */
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,MAAM,WAAW,UAAU;IACzB,mEAAmE;IACnE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,OAAO,CAAC;IACZ,qEAAqE;IACrE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB;AA0CD,eAAO,MAAM,WAAW,EAAE,UAAU,EAsCnC,CAAC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AE,MAAM,KAAK,IAAI,CAAC;IACtC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD,GACL,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA2B9B"}
@@ -2,6 +2,7 @@ import { execFile } from "node:child_process";
2
2
  import { platform } from "node:os";
3
3
  import { promisify } from "node:util";
4
4
  import { installConvert } from "./convert.js";
5
+ import { installBridge } from "./delegate/vsix.js";
5
6
  const run = promisify(execFile);
6
7
  /**
7
8
  * What can be installed, and with what.
@@ -77,6 +78,19 @@ export const INSTALLABLE = [
77
78
  unlocks: "Text out of a PDF, and rendering a scanned one to images.",
78
79
  size: "~20 MB",
79
80
  },
81
+ // **Ours, bundled, no download.** Installed into EVERY VS Code flavour on
82
+ // the machine through each bundle's own `bin/code` — the `code` command is
83
+ // usually not on PATH. One id, not one per flavour: the doctor rows
84
+ // `vscode-bridge` and `vscode-insiders-bridge` both name this as their
85
+ // install, and the outcome's `flavours` says which editor got it.
86
+ {
87
+ id: "vscode-bridge",
88
+ name: "The Pharos bridge for VS Code",
89
+ unlocks: "`pharos delegate --host vscode|vscode-insiders`: a work item handed to Claude or Codex inside "
90
+ + "VS Code, into the session already there or a new integrated terminal. Nothing else can "
91
+ + "put a prompt into VS Code from outside.",
92
+ size: "a few hundred KB, bundled — nothing is downloaded",
93
+ },
80
94
  ];
81
95
  /** Install the named capabilities, one at a time, reporting each. */
82
96
  export async function installCapabilities(ids, options = {}) {
@@ -90,6 +104,17 @@ export async function installCapabilities(ids, options = {}) {
90
104
  outcomes.push(await installSkillPlugin(options));
91
105
  continue;
92
106
  }
107
+ if (id === "vscode-bridge") {
108
+ const bridge = await installBridge(options);
109
+ outcomes.push({
110
+ id,
111
+ ok: bridge.ok,
112
+ command: bridge.command,
113
+ detail: bridge.detail,
114
+ flavours: bridge.flavours,
115
+ });
116
+ continue;
117
+ }
93
118
  outcomes.push(await installPackage(id, options));
94
119
  }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AAE,QAAQ,EAAE,CAAC;YACxC,CAAC,CAAC;gBACE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE;gBAClC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;aACjC,CAAC;IAEV,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC;YACH,MAAM,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;YAChE,OAAO,SAAS,CAAC;QACnB,CAAC;QAAC,MAAM,CAAC;YACP,QAAQ;QACV,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
package/dist/cli.d.ts CHANGED
@@ -1,6 +1,8 @@
1
+ import { type ParseArgsConfig } from "node:util";
1
2
  import type { AdoClient } from "@floh-solutions/ado-core";
2
3
  import type { GitHubClient } from "@floh-solutions/gh-core";
3
4
  import { type ExitCode } from "./output.js";
5
+ export type OptionsConfig = NonNullable<ParseArgsConfig["options"]>;
4
6
  /**
5
7
  * Every command this file dispatches — **one list, used by both the sentence and
6
8
  * the machine-readable field.**
@@ -12,7 +14,7 @@ import { type ExitCode } from "./output.js";
12
14
  * expensive kind of wrong. Anything added to the switch belongs here, and the
13
15
  * test below fails if it does not.
14
16
  */
15
- export declare const COMMANDS: readonly ["setup", "whoami", "query", "search", "task", "types", "history", "iterations", "areas", "links", "fields", "create", "update", "link", "unlink", "delete", "restore", "deleted", "attach", "detach", "download", "image", "people", "wiki", "comment", "hooks", "plan", "doctor", "issue", "bridge"];
17
+ export declare const COMMANDS: readonly ["setup", "whoami", "query", "search", "task", "types", "history", "iterations", "areas", "links", "fields", "create", "update", "link", "unlink", "delete", "restore", "deleted", "attach", "detach", "download", "image", "people", "wiki", "comment", "hooks", "plan", "doctor", "issue", "bridge", "delegate"];
16
18
  export interface RunOptions {
17
19
  argv: string[];
18
20
  cwd: string;
@@ -27,4 +29,19 @@ export interface RunOptions {
27
29
  github?: GitHubClient | undefined;
28
30
  }
29
31
  export declare function run(options: RunOptions): Promise<ExitCode>;
32
+ /**
33
+ * Join a value-taking option to a DASH-LEADING value in the next token.
34
+ *
35
+ * **`parseArgs` rejects `--text -foo` as ambiguous** (exit 2): it cannot tell a
36
+ * value that begins with a dash from a run of short flags. The `--text=-foo`
37
+ * form is unambiguous, and that is what this rewrites — a prompt like `-please
38
+ * fix` is a real thing a person types, and the app passes `--text` and the
39
+ * prompt as two separate argv tokens, so it lands here exactly this way.
40
+ *
41
+ * Only the options that actually take a value are joined, and only their exact
42
+ * long form (`--name`, not `--name=…` which already carries its value). `--`
43
+ * ends option parsing, so nothing past it is touched, and it is never itself
44
+ * treated as a value.
45
+ */
46
+ export declare function joinDashValues(argv: string[], optionsConfig: OptionsConfig): string[];
30
47
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAgC5D,OAAO,EAKL,KAAK,QAAQ,EAEd,MAAM,aAAa,CAAC;AAyBrB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,iTAMX,CAAC;AAoiBX,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,gDAAgD;IAChD,SAAS,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,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O,CAAC,QAAQ,CAAC,CAOhE;AAgjBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,aAAa,GAAG,MAAM,EAAE,CA+BrF"}
package/dist/cli.js CHANGED
@@ -8,6 +8,7 @@ import { runAttach } from "./commands/attach.js";
8
8
  import { runClassification, runFields, runHistory, runLinkTypes, } from "./commands/catalog.js";
9
9
  import { runComment } from "./commands/comment.js";
10
10
  import { runCreate } from "./commands/create.js";
11
+ import { runDelegate } from "./commands/delegate.js";
11
12
  import { runDetach } from "./commands/detach.js";
12
13
  import { runBridge } from "./commands/bridge.js";
13
14
  import { runDoctor } from "./commands/doctor.js";
@@ -64,6 +65,7 @@ export const COMMANDS = [
64
65
  "create", "update", "link", "unlink", "delete", "restore", "deleted",
65
66
  "attach", "detach", "download", "image", "people",
66
67
  "wiki", "comment", "hooks", "plan", "doctor", "issue", "bridge",
68
+ "delegate",
67
69
  ];
68
70
  /** Where long text comes from, for the verbs that take some. */
69
71
  const CONTENT_OPTIONS = {
@@ -96,7 +98,8 @@ START HERE
96
98
  a personal copy SHADOWS the marketplace one.
97
99
  --install <what> the optional capabilities the skill's advice
98
100
  assumes you have — LibreOffice, poppler, the
99
- document converter, the GitHub CLI.
101
+ document converter, the GitHub CLI, the Pharos
102
+ bridge for VS Code (vscode-bridge).
100
103
  ask choose from a list (needs a terminal)
101
104
  all every one of them
102
105
  a,b exactly these, for provisioning
@@ -579,6 +582,32 @@ COMMANDS
579
582
  proves nothing when two accounts can each see a
580
583
  repository of that name.
581
584
 
585
+ delegate Hand a prompt to a coding agent in the app you
586
+ work in: typed into the session already on that
587
+ folder, or a new one started with it. Pharos.app's
588
+ "Ask Agent" is a GUI over this verb.
589
+ --host <h> terminal | vscode | vscode-insiders | navarch
590
+ --agent <a> claude | codex — on your PATH; never installed
591
+ by pharos, an agent is your login
592
+ --mode <m> VS Code hosts only: terminal (default) — an
593
+ integrated terminal — or extension, the Claude
594
+ Code panel. Codex + extension is refused: its
595
+ panel takes no prompt from outside
596
+ --folder <abs> the project folder the session must be in
597
+ --text / --file / --stdin the prompt, already built
598
+ --dry-run detect and report the session it would use;
599
+ send nothing
600
+ Success: {ok:true, action: sent|launched,
601
+ session, detail}. A refusal is {ok:false,
602
+ reason, detail} on stdout, exit 2, reason one
603
+ of host-not-installed | agent-not-installed |
604
+ bridge-not-installed | automation-denied |
605
+ folder-missing | unsupported.
606
+ Terminal goes through Apple Events (macOS asks
607
+ once); VS Code through the Pharos bridge —
608
+ \`pharos setup --install vscode-bridge\`;
609
+ navarch waits on the argus side (#1378).
610
+
582
611
  plan <file> [...] Turn an implementation plan into a work item
583
612
  tree. Passed through to plan-to-board verbatim,
584
613
  including its flags and its human output.
@@ -711,102 +740,110 @@ async function dispatch(io, options) {
711
740
  ? { type: { type: "string" } }
712
741
  : command === "doctor"
713
742
  ? { verify: { type: "boolean" } }
714
- : command === "create"
743
+ : command === "delegate"
715
744
  ? {
716
- title: { type: "string" },
717
- parent: { type: "string" },
718
- state: { type: "string" },
719
- priority: { type: "string" },
720
- assignee: { type: "string" },
721
- field: { type: "string", multiple: true },
722
- tag: { type: "string", multiple: true },
745
+ host: { type: "string" },
746
+ agent: { type: "string" },
747
+ mode: { type: "string" },
748
+ folder: { type: "string" },
723
749
  ...CONTENT_OPTIONS,
724
750
  }
725
- : command === "link" || command === "unlink"
751
+ : command === "create"
726
752
  ? {
727
- ...Object.fromEntries(Object.keys(LINK_KINDS).map((kind) => [kind, { type: "string" }])),
728
- "wiki-page": { type: "string" },
729
- comment: { type: "string" },
753
+ title: { type: "string" },
754
+ parent: { type: "string" },
755
+ state: { type: "string" },
756
+ priority: { type: "string" },
757
+ assignee: { type: "string" },
758
+ field: { type: "string", multiple: true },
759
+ tag: { type: "string", multiple: true },
760
+ ...CONTENT_OPTIONS,
730
761
  }
731
- : command === "issue"
762
+ : command === "link" || command === "unlink"
732
763
  ? {
733
- type: { type: "string" },
734
- title: { type: "string" },
735
- parent: { type: "string" },
736
- // `say` is the one issue verb that carries prose, and an
737
- // explanation written for a reporter is exactly the thing that does
738
- // not belong on a command line — same reason `comment` has these.
739
- ...CONTENT_OPTIONS,
740
- summary: { type: "string" },
741
- // `drift` and `backfill`. Declared for every issue verb rather than
742
- // only those two: the option table is built before the subcommand is
743
- // known, which is the same reason `wiki` declares `--item`.
744
- repo: { type: "string" },
745
- limit: { type: "string" },
746
- wiql: { type: "string" },
747
- state: { type: "string" },
748
- // Repeatable, so `--label bug --label crash` is two labels rather
749
- // than the second silently winning.
750
- label: { type: "string", multiple: true },
751
- // `close`. `--to` rather than `--state`, which already means
752
- // open|closed|all on `backfill` — one flag with two meanings across
753
- // two verbs of one command is the `--wiki` shadowing bug again.
754
- to: { type: "string" },
755
- reason: { type: "string" },
756
- all: { type: "boolean" },
757
- // `edit`. Repeatable, and named apart from `--label` above on
758
- // purpose: that one is `backfill`'s FILTER and these are writes.
759
- "add-label": { type: "string", multiple: true },
760
- "remove-label": { type: "string", multiple: true },
761
- "create-label": { type: "boolean" },
762
- "add-assignee": { type: "string", multiple: true },
763
- "remove-assignee": { type: "string", multiple: true },
764
- milestone: { type: "string" },
765
- // The guard's base. Not `--if-match`: the header of that name is
766
- // refused by this endpoint with a 400, so borrowing the word would
767
- // teach the wrong idea about what is being compared.
768
- "if-title": { type: "string" },
769
- "if-body": { type: "string" },
770
- "if-body-file": { type: "string" },
764
+ ...Object.fromEntries(Object.keys(LINK_KINDS).map((kind) => [kind, { type: "string" }])),
765
+ "wiki-page": { type: "string" },
766
+ comment: { type: "string" },
771
767
  }
772
- : command === "bridge"
768
+ : command === "issue"
773
769
  ? {
770
+ type: { type: "string" },
771
+ title: { type: "string" },
772
+ parent: { type: "string" },
773
+ // `say` is the one issue verb that carries prose, and an
774
+ // explanation written for a reporter is exactly the thing that does
775
+ // not belong on a command line — same reason `comment` has these.
776
+ ...CONTENT_OPTIONS,
777
+ summary: { type: "string" },
778
+ // `drift` and `backfill`. Declared for every issue verb rather than
779
+ // only those two: the option table is built before the subcommand is
780
+ // known, which is the same reason `wiki` declares `--item`.
774
781
  repo: { type: "string" },
775
- // Singular and NOT repeatable, unlike `issue`'s `--label`: this one
776
- // names exactly one mapping to write or remove.
777
- label: { type: "string" },
778
- category: { type: "string" },
779
- "on-adopt": { type: "boolean" },
780
- "on-close": { type: "boolean" },
781
- // The only way to say "no". A boolean flag cannot express false, so
782
- // without this the digest policy was write-only.
783
- manual: { type: "boolean" },
782
+ limit: { type: "string" },
783
+ wiql: { type: "string" },
784
+ state: { type: "string" },
785
+ // Repeatable, so `--label bug --label crash` is two labels rather
786
+ // than the second silently winning.
787
+ label: { type: "string", multiple: true },
788
+ // `close`. `--to` rather than `--state`, which already means
789
+ // open|closed|all on `backfill` one flag with two meanings across
790
+ // two verbs of one command is the `--wiki` shadowing bug again.
791
+ to: { type: "string" },
792
+ reason: { type: "string" },
793
+ all: { type: "boolean" },
794
+ // `edit`. Repeatable, and named apart from `--label` above on
795
+ // purpose: that one is `backfill`'s FILTER and these are writes.
796
+ "add-label": { type: "string", multiple: true },
797
+ "remove-label": { type: "string", multiple: true },
798
+ "create-label": { type: "boolean" },
799
+ "add-assignee": { type: "string", multiple: true },
800
+ "remove-assignee": { type: "string", multiple: true },
801
+ milestone: { type: "string" },
802
+ // The guard's base. Not `--if-match`: the header of that name is
803
+ // refused by this endpoint with a 400, so borrowing the word would
804
+ // teach the wrong idea about what is being compared.
805
+ "if-title": { type: "string" },
806
+ "if-body": { type: "string" },
807
+ "if-body-file": { type: "string" },
784
808
  }
785
- : command === "deleted"
786
- ? { top: { type: "string" } }
787
- : command === "history"
788
- ? { top: { type: "string" }, all: { type: "boolean" } }
789
- : command === "iterations" || command === "areas"
790
- ? { depth: { type: "string" } }
791
- : command === "fields"
792
- ? { type: { type: "string" }, constrained: { type: "boolean" } }
793
- : command === "hooks"
794
- ? {
795
- hub: { type: "string" },
796
- user: { type: "string" },
797
- password: { type: "string" },
798
- }
799
- : command === "setup"
809
+ : command === "bridge"
810
+ ? {
811
+ repo: { type: "string" },
812
+ // Singular and NOT repeatable, unlike `issue`'s `--label`: this one
813
+ // names exactly one mapping to write or remove.
814
+ label: { type: "string" },
815
+ category: { type: "string" },
816
+ "on-adopt": { type: "boolean" },
817
+ "on-close": { type: "boolean" },
818
+ // The only way to say "no". A boolean flag cannot express false, so
819
+ // without this the digest policy was write-only.
820
+ manual: { type: "boolean" },
821
+ }
822
+ : command === "deleted"
823
+ ? { top: { type: "string" } }
824
+ : command === "history"
825
+ ? { top: { type: "string" }, all: { type: "boolean" } }
826
+ : command === "iterations" || command === "areas"
827
+ ? { depth: { type: "string" } }
828
+ : command === "fields"
829
+ ? { type: { type: "string" }, constrained: { type: "boolean" } }
830
+ : command === "hooks"
800
831
  ? {
801
- print: { type: "boolean" },
802
- stdin: { type: "boolean" },
803
- skill: { type: "boolean" },
804
- convert: { type: "boolean" },
805
- install: { type: "string" },
806
- repo: { type: "string" },
807
- "gh-account": { type: "string" },
832
+ hub: { type: "string" },
833
+ user: { type: "string" },
834
+ password: { type: "string" },
808
835
  }
809
- : CONTENT_OPTIONS;
836
+ : command === "setup"
837
+ ? {
838
+ print: { type: "boolean" },
839
+ stdin: { type: "boolean" },
840
+ skill: { type: "boolean" },
841
+ convert: { type: "boolean" },
842
+ install: { type: "string" },
843
+ repo: { type: "string" },
844
+ "gh-account": { type: "string" },
845
+ }
846
+ : CONTENT_OPTIONS;
810
847
  const { values, positionals } = parse(options.argv, { ...GLOBAL_OPTIONS, ...extras });
811
848
  if (values["version"] === true)
812
849
  return emitText(io, await version(options.cwd));
@@ -850,6 +887,20 @@ async function dispatch(io, options) {
850
887
  if (command === "doctor") {
851
888
  return runDoctor(io, options.env, { verify: values["verify"] === true }, values["pretty"] === true, await version(options.cwd));
852
889
  }
890
+ // Before the Session too: handing a prompt to a coding agent touches no
891
+ // Azure DevOps at all — the AGENT fetches the work item, with its own
892
+ // credentials — so a machine with no ADO_ORG can still delegate.
893
+ if (command === "delegate") {
894
+ return runDelegate(io, options.env, {
895
+ host: asString(values["host"]),
896
+ agent: asString(values["agent"]),
897
+ mode: asString(values["mode"]),
898
+ folder: asString(values["folder"]),
899
+ text: await content(options, values),
900
+ dryRun: values["dry-run"] === true,
901
+ pretty: values["pretty"] === true,
902
+ });
903
+ }
853
904
  const session = new Session({
854
905
  env: options.env,
855
906
  organization: asString(values["org"]),
@@ -1083,7 +1134,7 @@ async function plan(options) {
1083
1134
  function parse(argv, optionsConfig) {
1084
1135
  try {
1085
1136
  const parsed = parseArgs({
1086
- args: [...argv],
1137
+ args: joinDashValues([...argv], optionsConfig),
1087
1138
  options: optionsConfig,
1088
1139
  allowPositionals: true,
1089
1140
  strict: true,
@@ -1096,6 +1147,47 @@ function parse(argv, optionsConfig) {
1096
1147
  throw usageError(error instanceof Error ? error.message : String(error));
1097
1148
  }
1098
1149
  }
1150
+ /**
1151
+ * Join a value-taking option to a DASH-LEADING value in the next token.
1152
+ *
1153
+ * **`parseArgs` rejects `--text -foo` as ambiguous** (exit 2): it cannot tell a
1154
+ * value that begins with a dash from a run of short flags. The `--text=-foo`
1155
+ * form is unambiguous, and that is what this rewrites — a prompt like `-please
1156
+ * fix` is a real thing a person types, and the app passes `--text` and the
1157
+ * prompt as two separate argv tokens, so it lands here exactly this way.
1158
+ *
1159
+ * Only the options that actually take a value are joined, and only their exact
1160
+ * long form (`--name`, not `--name=…` which already carries its value). `--`
1161
+ * ends option parsing, so nothing past it is touched, and it is never itself
1162
+ * treated as a value.
1163
+ */
1164
+ export function joinDashValues(argv, optionsConfig) {
1165
+ const takesValue = new Set(Object.entries(optionsConfig)
1166
+ .filter(([, spec]) => spec.type === "string")
1167
+ .map(([name]) => name));
1168
+ const out = [];
1169
+ for (let index = 0; index < argv.length; index += 1) {
1170
+ const token = argv[index];
1171
+ // `--` is the end-of-options marker: copy it and everything after verbatim.
1172
+ if (token === "--") {
1173
+ out.push(...argv.slice(index));
1174
+ break;
1175
+ }
1176
+ const name = /^--([^=]+)$/.exec(token)?.[1];
1177
+ const next = argv[index + 1];
1178
+ if (name !== undefined
1179
+ && takesValue.has(name)
1180
+ && next !== undefined
1181
+ && next !== "--"
1182
+ && next.startsWith("-")) {
1183
+ out.push(`${token}=${next}`);
1184
+ index += 1;
1185
+ continue;
1186
+ }
1187
+ out.push(token);
1188
+ }
1189
+ return out;
1190
+ }
1099
1191
  /** Long text, from a flag, a file, or the pipe. Exactly one source. */
1100
1192
  async function content(options, values) {
1101
1193
  const sources = ["text", "file", "stdin"].filter((key) => values[key] !== undefined);