@floh-solutions/pharos-cli 0.29.0 → 0.31.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 +193 -86
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/delegate.d.ts +248 -0
  11. package/dist/commands/delegate.d.ts.map +1 -0
  12. package/dist/commands/delegate.js +582 -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 +121 -0
  30. package/dist/delegate/sessions.d.ts.map +1 -0
  31. package/dist/delegate/sessions.js +229 -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 +5 -4
  38. package/skill/SKILL.md +47 -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;AAojBD;;;;;;;;;;;;;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,43 @@ 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
+ --list what is running on that folder, in the order
599
+ this verb would pick them: {ok:true,
600
+ sessions:[{id,name,agent,host,status,detail,
601
+ recommended}]}, recommended:true on the one a
602
+ plain delegate takes. Sends nothing and needs
603
+ no prompt; none running is exit 0 with []
604
+ --session <id> deliver to exactly that session — an id --list
605
+ printed — or refuse session-gone; never falls
606
+ back to a new one. \`--session new\` is the
607
+ reserved opposite: start a fresh session even
608
+ though live ones exist
609
+ --dry-run detect and report the session it would use;
610
+ send nothing. Carries the --list array too
611
+ Success: {ok:true, action: sent|launched,
612
+ session, detail}. A refusal is {ok:false,
613
+ reason, detail} on stdout, exit 2, reason one
614
+ of host-not-installed | agent-not-installed |
615
+ bridge-not-installed | automation-denied |
616
+ folder-missing | unsupported | session-gone.
617
+ Terminal goes through Apple Events (macOS asks
618
+ once); VS Code through the Pharos bridge —
619
+ \`pharos setup --install vscode-bridge\`;
620
+ navarch waits on the argus side (#1378).
621
+
582
622
  plan <file> [...] Turn an implementation plan into a work item
583
623
  tree. Passed through to plan-to-board verbatim,
584
624
  including its flags and its human output.
@@ -711,102 +751,112 @@ async function dispatch(io, options) {
711
751
  ? { type: { type: "string" } }
712
752
  : command === "doctor"
713
753
  ? { verify: { type: "boolean" } }
714
- : command === "create"
754
+ : command === "delegate"
715
755
  ? {
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 },
756
+ host: { type: "string" },
757
+ agent: { type: "string" },
758
+ mode: { type: "string" },
759
+ folder: { type: "string" },
760
+ list: { type: "boolean" },
761
+ session: { type: "string" },
723
762
  ...CONTENT_OPTIONS,
724
763
  }
725
- : command === "link" || command === "unlink"
764
+ : command === "create"
726
765
  ? {
727
- ...Object.fromEntries(Object.keys(LINK_KINDS).map((kind) => [kind, { type: "string" }])),
728
- "wiki-page": { type: "string" },
729
- comment: { type: "string" },
766
+ title: { type: "string" },
767
+ parent: { type: "string" },
768
+ state: { type: "string" },
769
+ priority: { type: "string" },
770
+ assignee: { type: "string" },
771
+ field: { type: "string", multiple: true },
772
+ tag: { type: "string", multiple: true },
773
+ ...CONTENT_OPTIONS,
730
774
  }
731
- : command === "issue"
775
+ : command === "link" || command === "unlink"
732
776
  ? {
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" },
777
+ ...Object.fromEntries(Object.keys(LINK_KINDS).map((kind) => [kind, { type: "string" }])),
778
+ "wiki-page": { type: "string" },
779
+ comment: { type: "string" },
771
780
  }
772
- : command === "bridge"
781
+ : command === "issue"
773
782
  ? {
783
+ type: { type: "string" },
784
+ title: { type: "string" },
785
+ parent: { type: "string" },
786
+ // `say` is the one issue verb that carries prose, and an
787
+ // explanation written for a reporter is exactly the thing that does
788
+ // not belong on a command line — same reason `comment` has these.
789
+ ...CONTENT_OPTIONS,
790
+ summary: { type: "string" },
791
+ // `drift` and `backfill`. Declared for every issue verb rather than
792
+ // only those two: the option table is built before the subcommand is
793
+ // known, which is the same reason `wiki` declares `--item`.
774
794
  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" },
795
+ limit: { type: "string" },
796
+ wiql: { type: "string" },
797
+ state: { type: "string" },
798
+ // Repeatable, so `--label bug --label crash` is two labels rather
799
+ // than the second silently winning.
800
+ label: { type: "string", multiple: true },
801
+ // `close`. `--to` rather than `--state`, which already means
802
+ // open|closed|all on `backfill` one flag with two meanings across
803
+ // two verbs of one command is the `--wiki` shadowing bug again.
804
+ to: { type: "string" },
805
+ reason: { type: "string" },
806
+ all: { type: "boolean" },
807
+ // `edit`. Repeatable, and named apart from `--label` above on
808
+ // purpose: that one is `backfill`'s FILTER and these are writes.
809
+ "add-label": { type: "string", multiple: true },
810
+ "remove-label": { type: "string", multiple: true },
811
+ "create-label": { type: "boolean" },
812
+ "add-assignee": { type: "string", multiple: true },
813
+ "remove-assignee": { type: "string", multiple: true },
814
+ milestone: { type: "string" },
815
+ // The guard's base. Not `--if-match`: the header of that name is
816
+ // refused by this endpoint with a 400, so borrowing the word would
817
+ // teach the wrong idea about what is being compared.
818
+ "if-title": { type: "string" },
819
+ "if-body": { type: "string" },
820
+ "if-body-file": { type: "string" },
784
821
  }
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"
822
+ : command === "bridge"
823
+ ? {
824
+ repo: { type: "string" },
825
+ // Singular and NOT repeatable, unlike `issue`'s `--label`: this one
826
+ // names exactly one mapping to write or remove.
827
+ label: { type: "string" },
828
+ category: { type: "string" },
829
+ "on-adopt": { type: "boolean" },
830
+ "on-close": { type: "boolean" },
831
+ // The only way to say "no". A boolean flag cannot express false, so
832
+ // without this the digest policy was write-only.
833
+ manual: { type: "boolean" },
834
+ }
835
+ : command === "deleted"
836
+ ? { top: { type: "string" } }
837
+ : command === "history"
838
+ ? { top: { type: "string" }, all: { type: "boolean" } }
839
+ : command === "iterations" || command === "areas"
840
+ ? { depth: { type: "string" } }
841
+ : command === "fields"
842
+ ? { type: { type: "string" }, constrained: { type: "boolean" } }
843
+ : command === "hooks"
800
844
  ? {
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" },
845
+ hub: { type: "string" },
846
+ user: { type: "string" },
847
+ password: { type: "string" },
808
848
  }
809
- : CONTENT_OPTIONS;
849
+ : command === "setup"
850
+ ? {
851
+ print: { type: "boolean" },
852
+ stdin: { type: "boolean" },
853
+ skill: { type: "boolean" },
854
+ convert: { type: "boolean" },
855
+ install: { type: "string" },
856
+ repo: { type: "string" },
857
+ "gh-account": { type: "string" },
858
+ }
859
+ : CONTENT_OPTIONS;
810
860
  const { values, positionals } = parse(options.argv, { ...GLOBAL_OPTIONS, ...extras });
811
861
  if (values["version"] === true)
812
862
  return emitText(io, await version(options.cwd));
@@ -850,6 +900,22 @@ async function dispatch(io, options) {
850
900
  if (command === "doctor") {
851
901
  return runDoctor(io, options.env, { verify: values["verify"] === true }, values["pretty"] === true, await version(options.cwd));
852
902
  }
903
+ // Before the Session too: handing a prompt to a coding agent touches no
904
+ // Azure DevOps at all — the AGENT fetches the work item, with its own
905
+ // credentials — so a machine with no ADO_ORG can still delegate.
906
+ if (command === "delegate") {
907
+ return runDelegate(io, options.env, {
908
+ host: asString(values["host"]),
909
+ agent: asString(values["agent"]),
910
+ mode: asString(values["mode"]),
911
+ folder: asString(values["folder"]),
912
+ text: await content(options, values),
913
+ list: values["list"] === true,
914
+ session: asString(values["session"]),
915
+ dryRun: values["dry-run"] === true,
916
+ pretty: values["pretty"] === true,
917
+ });
918
+ }
853
919
  const session = new Session({
854
920
  env: options.env,
855
921
  organization: asString(values["org"]),
@@ -1083,7 +1149,7 @@ async function plan(options) {
1083
1149
  function parse(argv, optionsConfig) {
1084
1150
  try {
1085
1151
  const parsed = parseArgs({
1086
- args: [...argv],
1152
+ args: joinDashValues([...argv], optionsConfig),
1087
1153
  options: optionsConfig,
1088
1154
  allowPositionals: true,
1089
1155
  strict: true,
@@ -1096,6 +1162,47 @@ function parse(argv, optionsConfig) {
1096
1162
  throw usageError(error instanceof Error ? error.message : String(error));
1097
1163
  }
1098
1164
  }
1165
+ /**
1166
+ * Join a value-taking option to a DASH-LEADING value in the next token.
1167
+ *
1168
+ * **`parseArgs` rejects `--text -foo` as ambiguous** (exit 2): it cannot tell a
1169
+ * value that begins with a dash from a run of short flags. The `--text=-foo`
1170
+ * form is unambiguous, and that is what this rewrites — a prompt like `-please
1171
+ * fix` is a real thing a person types, and the app passes `--text` and the
1172
+ * prompt as two separate argv tokens, so it lands here exactly this way.
1173
+ *
1174
+ * Only the options that actually take a value are joined, and only their exact
1175
+ * long form (`--name`, not `--name=…` which already carries its value). `--`
1176
+ * ends option parsing, so nothing past it is touched, and it is never itself
1177
+ * treated as a value.
1178
+ */
1179
+ export function joinDashValues(argv, optionsConfig) {
1180
+ const takesValue = new Set(Object.entries(optionsConfig)
1181
+ .filter(([, spec]) => spec.type === "string")
1182
+ .map(([name]) => name));
1183
+ const out = [];
1184
+ for (let index = 0; index < argv.length; index += 1) {
1185
+ const token = argv[index];
1186
+ // `--` is the end-of-options marker: copy it and everything after verbatim.
1187
+ if (token === "--") {
1188
+ out.push(...argv.slice(index));
1189
+ break;
1190
+ }
1191
+ const name = /^--([^=]+)$/.exec(token)?.[1];
1192
+ const next = argv[index + 1];
1193
+ if (name !== undefined
1194
+ && takesValue.has(name)
1195
+ && next !== undefined
1196
+ && next !== "--"
1197
+ && next.startsWith("-")) {
1198
+ out.push(`${token}=${next}`);
1199
+ index += 1;
1200
+ continue;
1201
+ }
1202
+ out.push(token);
1203
+ }
1204
+ return out;
1205
+ }
1099
1206
  /** Long text, from a flag, a file, or the pipe. Exactly one source. */
1100
1207
  async function content(options, values) {
1101
1208
  const sources = ["text", "file", "stdin"].filter((key) => values[key] !== undefined);