github-router 0.3.275 → 0.3.282

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 (106) hide show
  1. package/dist/{attribution-settings-ZOaCUrYY.js → attribution-settings-srL3gBR9.js} +60 -57
  2. package/dist/attribution-settings-srL3gBR9.js.map +1 -0
  3. package/dist/{auth-Q1tfmfCT.js → auth-VUL2Zxvw.js} +3 -3
  4. package/dist/{auth-Q1tfmfCT.js.map → auth-VUL2Zxvw.js.map} +1 -1
  5. package/dist/browser-ext/manifest.json +1 -1
  6. package/dist/{check-usage-CHLz4tU_.js → check-usage-CcLdFPGr.js} +4 -4
  7. package/dist/{check-usage-CHLz4tU_.js.map → check-usage-CcLdFPGr.js.map} +1 -1
  8. package/dist/{claude-Cl4gYoOZ.js → claude-DJQjA5oQ.js} +57 -30
  9. package/dist/claude-DJQjA5oQ.js.map +1 -0
  10. package/dist/{codex-D_IXUgKf.js → codex-BAXemWpJ.js} +5 -5
  11. package/dist/{codex-D_IXUgKf.js.map → codex-BAXemWpJ.js.map} +1 -1
  12. package/dist/{debug-CuuxCk_J.js → debug-CtzYWxpJ.js} +2 -2
  13. package/dist/{debug-CuuxCk_J.js.map → debug-CtzYWxpJ.js.map} +1 -1
  14. package/dist/engine-BvLgh1QI.js +2 -0
  15. package/dist/{gate-discovery-Br448Md6.js → gate-discovery-BwtiYKvW.js} +5 -5
  16. package/dist/{gate-discovery-Br448Md6.js.map → gate-discovery-BwtiYKvW.js.map} +1 -1
  17. package/dist/{get-copilot-usage-BRN18uMJ.js → get-copilot-usage-B-EDAqQb.js} +2 -2
  18. package/dist/{get-copilot-usage-BRN18uMJ.js.map → get-copilot-usage-B-EDAqQb.js.map} +1 -1
  19. package/dist/hooks.mjs +37870 -0
  20. package/dist/hooks.sha256 +1 -0
  21. package/dist/{internal-artifact-open-CDqPfegE.js → internal-artifact-open-Dj5Nlq0L.js} +2 -2
  22. package/dist/{internal-artifact-open-CDqPfegE.js.map → internal-artifact-open-Dj5Nlq0L.js.map} +1 -1
  23. package/dist/{internal-first-mate-guard-7v2CtMA6.js → internal-first-mate-guard-CQdXWjNz.js} +1 -1
  24. package/dist/{internal-first-mate-guard-La0tIjTU.js → internal-first-mate-guard-DMgHg2s6.js} +5 -4
  25. package/dist/{internal-first-mate-guard-La0tIjTU.js.map → internal-first-mate-guard-DMgHg2s6.js.map} +1 -1
  26. package/dist/{internal-plan-review-CH9qTHoZ.js → internal-plan-review-DRFHET_B.js} +11 -4
  27. package/dist/internal-plan-review-DRFHET_B.js.map +1 -0
  28. package/dist/{internal-prompt-submit-Bve1s4z_.js → internal-prompt-submit-f1LR2P2G.js} +4 -4
  29. package/dist/{internal-prompt-submit-Bve1s4z_.js.map → internal-prompt-submit-f1LR2P2G.js.map} +1 -1
  30. package/dist/{internal-session-bind-Cc8bMXHK.js → internal-session-bind-DhZhxJ3T.js} +2 -2
  31. package/dist/{internal-session-bind-Cc8bMXHK.js.map → internal-session-bind-DhZhxJ3T.js.map} +1 -1
  32. package/dist/{internal-stop-hook-DMLQ8vRZ.js → internal-stop-hook-514RJeHO.js} +68 -20
  33. package/dist/internal-stop-hook-514RJeHO.js.map +1 -0
  34. package/dist/{internal-stop-review-CWE7_QVv.js → internal-stop-review-BBsLcbPG.js} +2 -2
  35. package/dist/{internal-stop-review-CWE7_QVv.js.map → internal-stop-review-BBsLcbPG.js.map} +1 -1
  36. package/dist/{internal-worker-guard-Lu8VHj5k.js → internal-worker-guard-VucpClSi.js} +2 -2
  37. package/dist/{internal-worker-guard-Lu8VHj5k.js.map → internal-worker-guard-VucpClSi.js.map} +1 -1
  38. package/dist/{internal-workspace-header-BRMz0Yql.js → internal-workspace-header-OYgHEnFt.js} +2 -2
  39. package/dist/{internal-workspace-header-BRMz0Yql.js.map → internal-workspace-header-OYgHEnFt.js.map} +1 -1
  40. package/dist/lib/tree-sitter-pool/lifecycle-C7W8D2lx.js +165 -0
  41. package/dist/lib/tree-sitter-pool/lifecycle-Dx0SnP7Z.js +157 -0
  42. package/dist/lib/tree-sitter-pool/worker.js +287 -14
  43. package/dist/{lifecycle-0XrazT05.js → lifecycle-B7CHqKlF.js} +2 -2
  44. package/dist/{lifecycle-0XrazT05.js.map → lifecycle-B7CHqKlF.js.map} +1 -1
  45. package/dist/lifecycle-CbmHMMSD.js +2 -0
  46. package/dist/{lifecycle-AgNOtFRv.js → lifecycle-D-rL81tT.js} +2 -2
  47. package/dist/{lifecycle-AgNOtFRv.js.map → lifecycle-D-rL81tT.js.map} +1 -1
  48. package/dist/lifecycle-DTcZwa7U.js +2 -0
  49. package/dist/lifecycle-K9oVtGde.mjs +16 -0
  50. package/dist/main.js +18 -18
  51. package/dist/{mcp-workspace-header-CGJbNeHb.js → mcp-workspace-header-ucs2SDST.js} +5 -6
  52. package/dist/mcp-workspace-header-ucs2SDST.js.map +1 -0
  53. package/dist/{models-d0gkuYGy.js → models-C16mBK2M.js} +3 -3
  54. package/dist/{models-d0gkuYGy.js.map → models-C16mBK2M.js.map} +1 -1
  55. package/dist/{orchestration-B_Q3ncXI.js → orchestration-CtM6FYNx.js} +2 -2
  56. package/dist/{orchestration-B_Q3ncXI.js.map → orchestration-CtM6FYNx.js.map} +1 -1
  57. package/dist/package-root-B-osctCk.js +29 -0
  58. package/dist/package-root-B-osctCk.js.map +1 -0
  59. package/dist/paths-CV9K7Xqm.js +2 -0
  60. package/dist/{paths-Bg1_DWhi.js → paths-wLC0InjX.js} +28 -4
  61. package/dist/paths-wLC0InjX.js.map +1 -0
  62. package/dist/{peer-mcp-personas-TMOZJhfy.js → peer-mcp-personas-l4P4s1fK.js} +497 -133
  63. package/dist/peer-mcp-personas-l4P4s1fK.js.map +1 -0
  64. package/dist/{plan-review-hook-BKOcW5s4.js → plan-review-hook-Lf9ISdF6.js} +5 -6
  65. package/dist/plan-review-hook-Lf9ISdF6.js.map +1 -0
  66. package/dist/{prompt-submit-hook-F7Zih_au.js → prompt-submit-hook-BlijaOn7.js} +6 -11
  67. package/dist/prompt-submit-hook-BlijaOn7.js.map +1 -0
  68. package/dist/{provision-BJ5vUpmp.js → provision-DlT34zcf.js} +4 -4
  69. package/dist/{provision-BJ5vUpmp.js.map → provision-DlT34zcf.js.map} +1 -1
  70. package/dist/self-invocation-CKMjcA5F.js +380 -0
  71. package/dist/self-invocation-CKMjcA5F.js.map +1 -0
  72. package/dist/{serve-DMA82DFJ.js → serve-orGUartp.js} +34 -18
  73. package/dist/serve-orGUartp.js.map +1 -0
  74. package/dist/{server-setup-CVfqSkh_.js → server-setup-BRBe8gW4.js} +63 -7
  75. package/dist/{server-setup-CVfqSkh_.js.map → server-setup-BRBe8gW4.js.map} +1 -1
  76. package/dist/{start-BGze5TnZ.js → start-sutbbkwc.js} +3 -3
  77. package/dist/{start-BGze5TnZ.js.map → start-sutbbkwc.js.map} +1 -1
  78. package/dist/{stop-gate-hook-BqpumJtl.js → stop-gate-hook-DgJ6sW8N.js} +100 -52
  79. package/dist/stop-gate-hook-DgJ6sW8N.js.map +1 -0
  80. package/dist/{stop-gate-policy-C0XOBZhB.js → stop-gate-policy-DG5yYWGn.js} +2 -2
  81. package/dist/{stop-gate-policy-C0XOBZhB.js.map → stop-gate-policy-DG5yYWGn.js.map} +1 -1
  82. package/dist/{token-Bz6HoH2H.js → token-CnlB0884.js} +2 -2
  83. package/dist/token-CnlB0884.js.map +1 -0
  84. package/dist/{version-_Q1WpsQp.js → version-C8x2hQrZ.js} +14 -2
  85. package/dist/version-C8x2hQrZ.js.map +1 -0
  86. package/dist/{worker-dispatch-Bj1uYyG9.js → worker-dispatch-4O3IWtP0.js} +4 -4
  87. package/dist/worker-dispatch-4O3IWtP0.js.map +1 -0
  88. package/package.json +2 -2
  89. package/dist/attribution-settings-ZOaCUrYY.js.map +0 -1
  90. package/dist/claude-Cl4gYoOZ.js.map +0 -1
  91. package/dist/engine-Drs3cxLW.js +0 -2
  92. package/dist/internal-plan-review-CH9qTHoZ.js.map +0 -1
  93. package/dist/internal-stop-hook-DMLQ8vRZ.js.map +0 -1
  94. package/dist/lifecycle-2M0IThRr.js +0 -2
  95. package/dist/lifecycle-C8kFsAj-.js +0 -2
  96. package/dist/mcp-workspace-header-CGJbNeHb.js.map +0 -1
  97. package/dist/paths-BbHtQAOs.js +0 -2
  98. package/dist/paths-Bg1_DWhi.js.map +0 -1
  99. package/dist/peer-mcp-personas-TMOZJhfy.js.map +0 -1
  100. package/dist/plan-review-hook-BKOcW5s4.js.map +0 -1
  101. package/dist/prompt-submit-hook-F7Zih_au.js.map +0 -1
  102. package/dist/serve-DMA82DFJ.js.map +0 -1
  103. package/dist/stop-gate-hook-BqpumJtl.js.map +0 -1
  104. package/dist/token-Bz6HoH2H.js.map +0 -1
  105. package/dist/version-_Q1WpsQp.js.map +0 -1
  106. package/dist/worker-dispatch-Bj1uYyG9.js.map +0 -1
@@ -1,8 +1,9 @@
1
- import { Dt as CONDENSED_OPERATING_SEQUENCE, Ht as withOneMSuffix, Ot as DEFINITION_OF_GREATNESS, c as personasFor, i as buildAgentPrompt, n as MCP_GROUPS, t as GROUP_META } from "./peer-mcp-personas-TMOZJhfy.js";
2
- import { a as isUnderClaudeConfigMirror, d as writeRuntimeFileSecure, t as PATHS } from "./paths-Bg1_DWhi.js";
3
- import { a as STRIPPED_AUTH_ROUTING_ENV_KEYS, n as buildCodexProviderConfigFlags } from "./provision-BJ5vUpmp.js";
4
- import { n as buildWorkspaceHeaderHelperCommand } from "./mcp-workspace-header-CGJbNeHb.js";
5
- import { a as dispatcherAgentName, c as dispatcherTools, n as activeDispatchModes, o as dispatcherDescription, s as dispatcherPrompt } from "./worker-dispatch-Bj1uYyG9.js";
1
+ import { Mt as CONDENSED_OPERATING_SEQUENCE, Nt as DEFINITION_OF_GREATNESS, c as personasFor, i as buildAgentPrompt, n as MCP_GROUPS, qt as withOneMSuffix, t as GROUP_META } from "./peer-mcp-personas-l4P4s1fK.js";
2
+ import { a as isUnderClaudeConfigMirror, d as writeRuntimeFileSecure, t as PATHS } from "./paths-wLC0InjX.js";
3
+ import "./self-invocation-CKMjcA5F.js";
4
+ import { a as STRIPPED_AUTH_ROUTING_ENV_KEYS, n as buildCodexProviderConfigFlags } from "./provision-DlT34zcf.js";
5
+ import { n as buildWorkspaceHeaderHelperCommand } from "./mcp-workspace-header-ucs2SDST.js";
6
+ import { a as dispatcherAgentName, c as dispatcherTools, n as activeDispatchModes, o as dispatcherDescription, s as dispatcherPrompt } from "./worker-dispatch-4O3IWtP0.js";
6
7
  import consola from "consola";
7
8
  import path from "node:path";
8
9
  import { randomBytes } from "node:crypto";
@@ -130,11 +131,11 @@ function buildCoordinatorAgent(opts) {
130
131
  "The lead's brief will include an artifact (plan, design, diff, or code) and a goal (e.g. 'review before exit-plan', 'review the commit I just made', 'cross-check codex-critic's verdict'). Pick the right peers for the artifact type:",
131
132
  "",
132
133
  "- **Plan / design / architecture choice** → fan out to `codex-critic` (gpt-5.6-sol, strongest reasoning, cross-lab)" + (opts.geminiAvailable ? " AND `gemini-critic` (third-lab triangulation, strong on formal reasoning) in parallel" : "") + ". codex-reviewer is the wrong tool for plans (it's a code-specialist, not an architecture critic).",
133
- "- **Concrete diff or single file** → fan out to `codex-reviewer` (gpt-5.3-codex, line-level code specialist, fastest at ~16s)" + (opts.geminiAvailable ? " AND `gemini-reviewer` (gemini-3.1-pro, second-lab line-level review)" : "") + (opts.geminiAvailable ? " AND `gemini-critic` for cross-lab triangulation" : "") + ". For very small changes (<20 lines), one `codex-reviewer` call is enough.",
134
+ "- **Concrete diff or single file** → fan out to `codex-reviewer` (gpt-5.3-codex, line-level code specialist)" + (opts.geminiAvailable ? " AND `gemini-reviewer` (gemini-3.1-pro, second-lab line-level review)" : "") + (opts.geminiAvailable ? " AND `gemini-critic` for cross-lab triangulation" : "") + ". For very small changes (<20 lines), one `codex-reviewer` call is enough.",
134
135
  "- **Large artifact** → the only peers that take a large artifact WHOLE are `codex-critic` (gpt-5.6-sol, ≈1M-token input window) and `opus-critic` (Opus-4.7-1M, ≈936K-token input on enterprise catalogs; ≈168K otherwise). Route the full artifact to those for cross-lab coverage. `codex-reviewer` (≈272K) and `gemini-critic` (≈136K) have small windows — see Decomposition below: never summarize or downsize the request to squeeze a large artifact into a small-window peer.",
135
136
  "- **Formal reasoning, proofs, or invariants** → prefer `gemini-critic`" + (opts.geminiAvailable ? " (gemini-3.1-pro, strong on math and formally-stated properties)" : " (NOT REGISTERED in this session — gemini-3.x not in catalog)") + ".",
136
137
  "- **Tie-breaker after codex-critic has weighed in** → call `gemini-critic`" + (opts.geminiAvailable ? "" : " (NOT REGISTERED in this session)") + " or `opus-critic` with the artifact AND codex-critic's verdict for cross-check.",
137
- "- **Fast sanity check** → `opus-critic` (~22s, same lab as lead but fresh context — catches confabulation and motivated reasoning).",
138
+ "- **Fast sanity check** → `opus-critic` (same lab as lead but fresh context — catches confabulation and motivated reasoning).",
138
139
  "",
139
140
  "## Decomposition for large artifacts",
140
141
  "",
@@ -303,11 +304,13 @@ function buildPeerAgentDefinitions(opts) {
303
304
  const brainstormModel = nonEmptyModel(opts.brainstormModel);
304
305
  const scoutModel = nonEmptyModel(opts.scoutModel);
305
306
  const scribeModel = nonEmptyModel(opts.scribeModel);
307
+ const implementerFastModel = nonEmptyModel(opts.implementerFastModel);
308
+ const generalPurposeFastModel = nonEmptyModel(opts.generalPurposeFastModel);
306
309
  const modelField = nativeModel ? { model: withOneMSuffix(nativeModel) } : {};
307
310
  const searchKey = opts.groupKeys.search ?? GROUP_META.search.preferredKey;
308
311
  const searchMcp = opts.serverUrl ? { mcpServers: { [searchKey]: httpEntryFor(opts.serverUrl, "search", opts.nonce, opts.workspaceHeaderCmd) } } : {};
309
312
  out.implementer = {
310
- description: nativeModel ? `Bounded implementation subagent running ${nativeModel} (strong non-Claude coder, maximum reasoning). Use proactively for well-scoped coding tasks — edits, small features, fixes — to keep the lead's context focused; runs in its own context. Model is overridable at spawn.` : `Bounded implementation subagent (native tools, runs on the lead's model in its own context). Use proactively for well-scoped coding tasks — edits, small features, fixes — to keep the lead's context focused. Model is overridable at spawn.`,
313
+ description: nativeModel ? `Bounded implementation subagent running ${nativeModel} (strong non-Claude coder, maximum reasoning). Use proactively for coding changes that need judgment or have ambiguous scope — edits, features, fixes — to keep the lead's context focused; use implementer-fast instead for well-specified, mechanical changes. Runs in its own context. Model is overridable at spawn.` : `Bounded implementation subagent (native tools, runs on the lead's model in its own context). Use proactively for coding changes that need judgment or have ambiguous scope — edits, features, fixes — to keep the lead's context focused; use implementer-fast instead for well-specified, mechanical changes. Model is overridable at spawn.`,
311
314
  prompt: "You are a bounded implementation subagent for well-scoped coding tasks. Implement the requested change surgically, matching the surrounding code style and minimizing unrelated churn. " + fileToolSteer("builds") + " Verify with the project's build or tests where applicable. Do the work yourself — do not spawn further subagents. Report exactly what changed and any risks.",
312
315
  ...modelField
313
316
  };
@@ -331,10 +334,21 @@ function buildPeerAgentDefinitions(opts) {
331
334
  ...searchMcp
332
335
  };
333
336
  out.scribe = {
334
- description: scribeModel ? `Documentation subagent running ${scribeModel}. Use proactively for prose that trails the code: docs, ADRs, CLAUDE.md sections, changelog entries, and README updates that have gone stale. Keeps low-glamour upkeep off the lead's context. Model is overridable at spawn.` : `Documentation subagent (runs on the lead's model in its own context). Use proactively for prose that trails the code: docs, ADRs, CLAUDE.md sections, changelog entries, and README updates that have gone stale. Model is overridable at spawn.`,
337
+ description: scribeModel ? `Documentation subagent running ${scribeModel} (the mid tier: documentation is verifiable prose, not frontier reasoning). Use proactively for prose that trails the code: docs, ADRs, CLAUDE.md sections, changelog entries, and README updates that have gone stale. Keeps low-glamour upkeep off the lead's context. Model is overridable at spawn.` : `Documentation subagent (runs on the lead's model in its own context). Use proactively for prose that trails the code: docs, ADRs, CLAUDE.md sections, changelog entries, and README updates that have gone stale. Model is overridable at spawn.`,
335
338
  prompt: "You are a documentation subagent. Write and maintain the prose that trails the code: docs, ADRs, CLAUDE.md sections, changelog entries, README rows. Read the code before describing it — every claim you write must be checkable against the repository as it is now, not as a summary said it was. Match the surrounding document's voice, structure, and level of detail. Prefer updating an existing document over adding a new one, and delete what has become false rather than layering a correction on top of it. " + fileToolSteer("builds") + " Do the work yourself — do not spawn further subagents. Report which documents changed and any claim you could not verify.",
336
339
  ...scribeModel ? { model: withOneMSuffix(scribeModel) } : {}
337
340
  };
341
+ const genericPromptFor = (role) => `You are a general-purpose subagent handling ${role} the lead has delegated to keep its own context free. Work out what the task actually requires, then do it end to end. Verify against the real repository and the real runtime rather than assuming — read the code, run the command, check the exit code. ` + fileToolSteer("builds") + " Do the work yourself — do not spawn further subagents. Report what you did, what you verified, and anything you could not settle.";
342
+ if (implementerFastModel) out["implementer-fast"] = {
343
+ description: `Implementation subagent running ${implementerFastModel} (1M context, ${implementerFastModel === "gpt-5.6-terra" ? "the cheaper, faster implementation tier" : "a non-lead implementation model"}). Use proactively for well-specified, mechanical coding changes; use implementer instead when the change needs judgment or its scope is ambiguous. Full toolset, so it can implement and verify the change end to end in its own context. Model is overridable at spawn.`,
344
+ prompt: genericPromptFor("a well-specified, mechanical coding change"),
345
+ model: withOneMSuffix(implementerFastModel)
346
+ };
347
+ if (generalPurposeFastModel) out["general-purpose-fast"] = {
348
+ description: `Catch-all subagent running ${generalPurposeFastModel} (1.05M context, the lowest-cost model in the catalog and the fastest measured catch-all candidate, with the full reasoning-effort ladder). Use proactively for work no specialist fits when a fast, economical non-lead model can finish it. Full toolset, so it can complete the work rather than only research it. Runs in its own context. Model is overridable at spawn.`,
349
+ prompt: genericPromptFor("work no specialist fits"),
350
+ model: withOneMSuffix(generalPurposeFastModel)
351
+ };
338
352
  if (opts.workerToolsAvailable) {
339
353
  const workersKey = workersKeyOf(opts.groupKeys);
340
354
  const workersMcp = opts.serverUrl ? { mcpServers: { [workersKey]: httpEntryFor(opts.serverUrl, "workers", opts.nonce, opts.workspaceHeaderCmd) } } : {};
@@ -603,7 +617,7 @@ async function injectPeerMcpIntoMirror(serverUrl, opts) {
603
617
  groupKeys: opts.groupKeys,
604
618
  nonce: opts.nonce,
605
619
  codexHome: opts.codexHome ?? PATHS.CODEX_HOME,
606
- workspaceHeaderCmd: buildWorkspaceHeaderHelperCommand(process.execPath, process.argv[1])
620
+ workspaceHeaderCmd: buildWorkspaceHeaderHelperCommand(opts.selfInvocation)
607
621
  });
608
622
  const conflicts = [];
609
623
  for (const name of Object.keys(peerConfig.mcpServers)) if (mcpServers[name] !== void 0) conflicts.push(name);
@@ -662,7 +676,7 @@ async function writePeerMcpRuntimeFiles(serverUrl, opts) {
662
676
  groupKeys: opts.groupKeys,
663
677
  nonce,
664
678
  codexHome,
665
- workspaceHeaderCmd: buildWorkspaceHeaderHelperCommand(process.execPath, process.argv[1])
679
+ workspaceHeaderCmd: buildWorkspaceHeaderHelperCommand(opts.selfInvocation)
666
680
  });
667
681
  const agents = buildPeerAgentDefinitions({
668
682
  codexCli: opts.codexCli,
@@ -675,10 +689,12 @@ async function writePeerMcpRuntimeFiles(serverUrl, opts) {
675
689
  brainstormModel: opts.brainstormModel,
676
690
  scoutModel: opts.scoutModel,
677
691
  scribeModel: opts.scribeModel,
692
+ implementerFastModel: opts.implementerFastModel,
693
+ generalPurposeFastModel: opts.generalPurposeFastModel,
678
694
  nonce,
679
695
  codexHome,
680
696
  serverUrl,
681
- workspaceHeaderCmd: buildWorkspaceHeaderHelperCommand(process.execPath, process.argv[1])
697
+ workspaceHeaderCmd: buildWorkspaceHeaderHelperCommand(opts.selfInvocation)
682
698
  });
683
699
  await fs.unlink(mcpConfigPath).catch(() => {});
684
700
  await fs.unlink(agentsPath).catch(() => {});
@@ -1739,51 +1755,38 @@ You are running inside an ai-or-die tab, so the \`${toolPrefix}*\` tools drive a
1739
1755
  * dashes and does not mention any Claude / Anthropic attribution.
1740
1756
  */
1741
1757
  const STYLE_DIRECTIVE = "Write concisely without losing detail. Use a natural human voice. Avoid em dashes. Do not attribute work to Claude, AI, LLM, or Anthropic anywhere (commits, PRs, issues, code, comments, docs).";
1758
+ /** Oxford-comma join: "a", "a and b", "a, b, and c". */
1759
+ function joinClauses(parts) {
1760
+ if (parts.length <= 1) return parts[0] ?? "";
1761
+ if (parts.length === 2) return `${parts[0]} and ${parts[1]}`;
1762
+ return `${parts.slice(0, -1).join(", ")}, and ${parts[parts.length - 1]}`;
1763
+ }
1764
+ /** The "Reach for X when Y" list, omitting any agent this launch did not emit. */
1765
+ function buildNativeReachClauses(opts) {
1766
+ const clauses = ["`implementer` for coding changes that need judgment or have ambiguous scope"];
1767
+ if (opts.implementerFastAvailable !== false) clauses.push("`implementer-fast` for well-specified, mechanical coding changes");
1768
+ clauses.push("`reviewer` when something exists and you want it assessed (including reproducing and root-causing a failure)", "`brainstorm` when you do not yet know which approach to take");
1769
+ if (opts.scoutAvailable !== false) clauses.push("`scout` to find or understand something in the repo");
1770
+ clauses.push("`scribe` for docs and ADRs that trail the code");
1771
+ if (opts.generalPurposeFastAvailable !== false) clauses.push("`general-purpose-fast` for work no specialist fits");
1772
+ return joinClauses(clauses);
1773
+ }
1742
1774
  /**
1743
- * Operating-defaults directive injected at the TOP of the mirrored CLAUDE.md.
1744
- * The main agent's system prompt (`--append-system-prompt`) gets
1745
- * OPERATING_DEFAULTS_DIGEST instead, with this full statement available through
1746
- * CLAUDE.md. Three defaults, each explicitly overridden by the user's own
1747
- * direction and the domain's standards:
1748
- *
1749
- * 1. Orchestrate (strong default): delegate the heavy / parallel /
1750
- * context-heavy work to the right subagent / worker / model, keeping the
1751
- * main context free to reason and collaborate with the user, while still
1752
- * doing trivial / surgical / last-mile work directly (delegating that
1753
- * would only add relay-fidelity loss + latency).
1754
- * 2. Adversarial review: WHEN a peer critic earns its keep and, equally
1755
- * important, when reaching for one is ritual rather than review. Same
1756
- * failure shape the delegation default had: "consult a critic for
1757
- * non-trivial changes" is unfalsifiable in advance, so it collapses into
1758
- * either never (four of four unprimed agents) or always (worse than
1759
- * never). The discriminator is whether the conclusion still turns on
1760
- * judgment once the direct evidence is in: a consequential recommendation
1761
- * cannot be run, which is exactly where confabulation hides, while a
1762
- * tracing question a search already proved gains nothing from a second
1763
- * model re-deriving it. The roster, the lens-to-artifact match, the
1764
- * advisor-complements-rather-than-substitutes distinction, and the
1765
- * do-not-anchor-the-critic rule live here; the digest carries only the
1766
- * trigger and the ritual exclusion.
1767
- * 3. Excellence lens: the principles stated plainly and concretely (radical
1768
- * simplicity + real-user focus; whole-system first-principles thinking that
1769
- * anticipates scale; work back from the customer outcome). Named exemplars
1770
- * were dropped per the injected-surface review: a named entity is a dense,
1771
- * high-variance vector that pulls in persona mannerisms at top salience, and
1772
- * the guidance favors specific functional framing over comparison, so
1773
- * specificity carries the vividness instead.
1774
- * 4. Engineering excellence: quality / robustness / maintainability over
1775
- * development cost; reproduce a bug end-to-end (as a real user hits it)
1776
- * before fixing so the fix targets the real cause; a pixel-perfect UI bar;
1777
- * and fix any lint error / test failure / flake on sight, whoever caused it,
1778
- * folded into the current work rather than derailing the user's task (the
1779
- * scope guardrail keeps proactive quality from becoming yak-shaving). The
1780
- * digest carries a one-line form; the full statement lives here so it does
1781
- * not cost the context window every turn.
1775
+ * Build the operating-defaults directive for one launch, naming only the
1776
+ * natives that launch actually emitted.
1782
1777
  *
1783
- * Self-referentially compliant with the style directive: no em dashes, no
1784
- * Claude / Anthropic attribution.
1778
+ * Callers must pass the SAME availability booleans they used for the `.md`
1779
+ * generation and `buildPeerAwarenessSnippet`, so the three surfaces cannot
1780
+ * disagree about which agents exist.
1785
1781
  */
1786
- const OPERATING_DEFAULTS_DIRECTIVE = "## Operating defaults (apply when the user has not specified otherwise; the user's explicit direction and the domain's own standards always override)\n\nOrchestrate. Delegate research, implementation, review, and large reads to the right subagent, worker, or model. Reach for `implementer` when you know what to build, `reviewer` when something exists and you want it assessed (including reproducing and root-causing a failure), `brainstorm` when you do not yet know which approach to take, `scout` to find or understand something in the repo, and `scribe` for docs and ADRs that trail the code; worker-* agents for background non-blocking runs; Task subagents for parallel work; peer critics for review. That keeps your own context free to reason and collaborate with the user. Prefer parallel delegation for independent work. Delegation pays when the work is WIDE (many files or sources to sweep) or SLOW, and you need only the conclusion: the main thread is where you think with and respond to the user, and its context window is a finite shared resource. It does NOT pay merely because a sub-question is separable. A narrow, deep question whose whole value is file:line fidelity loses exactly that through a summarization layer, and a sub-question you could answer in one command is cheaper done directly than paying a subagent's startup. Do trivial, surgical, and last-mile work yourself.\n\nAdversarial review. The peer critics (`codex_critic` and `codex_reviewer`, `gemini_critic` and `gemini_reviewer`, `opus_critic`, and the `peer-review-coordinator` that fans out to several of them) are fresh-context models, so what they add is a blind spot that whoever produced the work cannot reach by thinking harder about it; prefer a critic from a different lab than the producer, since blind spots correlate within a lab. The `advisor` is a complement and not a substitute: it sees your transcript, so it catches your own drift and momentum, but it inherits your framing, which is exactly what a fresh-context critic does not. They earn their keep on consequential design choices, recommendations, and hard-to-reverse decisions: the cases where plausible alternatives remain and the conclusion rests on judgment rather than on something you can verify directly. That is where confabulation hides, so budget the wait even under delivery pressure. Always consult one when the change touches auth, user input, database queries, crypto, or serialization. They do NOT pay for read-only tracing, ordinary repository lookup, or a conclusion that a focused test, a direct reproduction, or unambiguous code evidence already settles. Asking a critic to re-derive a proven fact returns a confident answer either way, which is ritual skepticism rather than review, and skipping them there is the right call and not a shortcut. Match the lens to the artifact: a strategic critic for plans and trade-offs, a code reviewer for a concrete diff, the coordinator only when the risk warrants several independent lenses. Give whichever you pick the artifact and the constraints and not your rationale, since justification anchors the review and dulls it.\n\nAim high. Default to radical simplicity and a relentless focus on the user's real experience: design for the person and the job to be done, not the demo. Reason about the whole system from first principles, anticipating scale and the long arc rather than patching the surface. Work backwards from the outcome the user actually needs. Question every assumption and prefer what you can derive, reproduce, or test.\n\nEngineering excellence. When making technical decisions, give little weight to development cost; prefer quality, simplicity, robustness, scalability, and long-term maintainability. Fix a bug by first reproducing it end to end, as close to how a real user hits it as you can, so you solve the real problem and not a symptom. When testing a product end to end, be picky about the UI and obsessed with pixel perfection: if something clearly looks off, even when it is unrelated to your task, get it fixed along the way. Hold that same bar for the codebase itself: a lint error, a failing test, or a flaky test is worth fixing the moment you see it, whoever introduced it. Fold it into your current work rather than letting it derail the task the user actually asked for.";
1782
+ function buildOperatingDefaultsDirective(opts = {}) {
1783
+ return "## Operating defaults (apply when the user has not specified otherwise; the user's explicit direction and the domain's own standards always override)\n\nOrchestrate. Delegate research, implementation, review, and large reads to the right subagent, worker, or model. Reach for " + buildNativeReachClauses(opts) + "; worker-* agents for background non-blocking runs; Task subagents for parallel work; peer critics for review. That keeps your own context free to reason and collaborate with the user. Launch independent agents concurrently in a single message rather than serially. Delegation pays when the work is WIDE (many files or sources to sweep) or SLOW, and you need only the conclusion: the main thread is where you think with and respond to the user, and its context window is a finite shared resource. It does NOT pay merely because a sub-question is separable. A narrow, deep question whose whole value is file:line fidelity loses exactly that through a summarization layer, and a sub-question you could answer in one command is cheaper done directly than paying a subagent's startup. Do trivial, surgical, and last-mile work yourself. A named teammate persists after it reports so you can send it follow-ups, and nothing reaps it for you: its idle notice means available, not finished. Stop it once you are done with it.\n\nAdversarial review. The peer critics (`codex_critic` and `codex_reviewer`, `gemini_critic` and `gemini_reviewer`, `opus_critic`, and the `peer-review-coordinator` that fans out to several of them) are fresh-context models, so what they add is a blind spot that whoever produced the work cannot reach by thinking harder about it; prefer a critic from a different lab than the producer, since blind spots correlate within a lab. The `advisor` is a complement and not a substitute: it sees your transcript, so it catches your own drift and momentum, but it inherits your framing, which is exactly what a fresh-context critic does not. They earn their keep on consequential design choices, recommendations, and hard-to-reverse decisions: the cases where plausible alternatives remain and the conclusion rests on judgment rather than on something you can verify directly. That is where confabulation hides, so budget the wait even under delivery pressure. Always consult one when the change touches auth, user input, database queries, crypto, or serialization. They do NOT pay for read-only tracing, ordinary repository lookup, or a conclusion that a focused test, a direct reproduction, or unambiguous code evidence already settles. Asking a critic to re-derive a proven fact returns a confident answer either way, which is ritual skepticism rather than review, and skipping them there is the right call and not a shortcut. Match the lens to the artifact: a strategic critic for plans and trade-offs, a code reviewer for a concrete diff, the coordinator only when the risk warrants several independent lenses. Give whichever you pick the artifact and the constraints and not your rationale, since justification anchors the review and dulls it.\n\nAim high. Default to radical simplicity and a relentless focus on the user's real experience: design for the person and the job to be done, not the demo. Reason about the whole system from first principles, anticipating scale and the long arc rather than patching the surface. Work backwards from the outcome the user actually needs. Question every assumption and prefer what you can derive, reproduce, or test.\n\nEngineering excellence. When making technical decisions, give little weight to development cost; prefer quality, simplicity, robustness, scalability, and long-term maintainability. Fix a bug by first reproducing it end to end, as close to how a real user hits it as you can, so you solve the real problem and not a symptom. When testing a product end to end, be picky about the UI and obsessed with pixel perfection: if something clearly looks off, even when it is unrelated to your task, get it fixed along the way. Hold that same bar for the codebase itself: a lint error, a failing test, or a flaky test is worth fixing the moment you see it, whoever introduced it. Fold it into your current work rather than letting it derail the task the user actually asked for.";
1784
+ }
1785
+ /** The all-available form of the directive. Prefer
1786
+ * `buildOperatingDefaultsDirective` on any path that knows which natives
1787
+ * resolved; this const is the default for callers and tests that do not model
1788
+ * a thin catalog. */
1789
+ const OPERATING_DEFAULTS_DIRECTIVE = buildOperatingDefaultsDirective();
1787
1790
  /**
1788
1791
  * Condensed digest of OPERATING_DEFAULTS_DIRECTIVE for the spawned session's
1789
1792
  * system prompt (--append-system-prompt). The FULL directive is prepended to
@@ -1800,7 +1803,7 @@ const OPERATING_DEFAULTS_DIRECTIVE = "## Operating defaults (apply when the user
1800
1803
  * the reasoning stay in the directive; the always-resident copy carries only
1801
1804
  * the trigger and the ritual exclusion.
1802
1805
  */
1803
- const OPERATING_DEFAULTS_DIGEST = "## Operating defaults (the user's explicit direction and the domain's standards always override)\n\nDelegate when the work is WIDE (many files or sources to sweep) or SLOW and you need only the conclusion, to protect the main thread's finite context and keep it free for reasoning and interacting with the user; prefer parallel delegation for independent work. Do NOT delegate merely because a sub-question is separable: a narrow, deep question whose value is file:line fidelity loses exactly that through a summarization layer, and one answerable in a single command is cheaper done directly. Do trivial, surgical, and last-mile work yourself.\n\nVerify, do not assert. Run the code, read the file, check the exit code. A claim in prose is worth nothing against state you did not check, and a check that cannot fail proves nothing. Reproduce a bug end to end, the way a real user hits it, before fixing it. Fix a lint error, failing test, or flake the moment you see it, whoever introduced it, without letting it derail the task at hand. Prefer quality and long-term maintainability over development cost.\n\nVerification has a blind spot: a consequential recommendation, a design or trade-off call, or a hard-to-reverse decision that still turns on judgment among plausible alternatives once the direct evidence is in. That is where confabulation hides, so put it past a peer critic before you ship it and budget the wait even under delivery pressure. When a test, a run, a reproduction, or a search would settle the claim, settle it that way instead; a critic asked to re-derive what you can already prove is ritual, not review.\n\nThe agent roster, the tool surface, and the reasoning behind these defaults are in your CLAUDE.md project instructions. Read them when choosing HOW to work; the rules above apply without a lookup.";
1806
+ const OPERATING_DEFAULTS_DIGEST = "## Operating defaults (the user's explicit direction and the domain's standards always override)\n\nDelegate when the work is WIDE (many files or sources to sweep) or SLOW and you need only the conclusion, to protect the main thread's finite context and keep it free for reasoning and interacting with the user; prefer parallel delegation for independent work. Do NOT delegate merely because a sub-question is separable: a narrow, deep question whose value is file:line fidelity loses exactly that through a summarization layer, and one answerable in a single command is cheaper done directly. Do trivial, surgical, and last-mile work yourself. Stop a named teammate once you are done with it: it persists for follow-ups, its idle notice means available rather than finished, and nothing reaps it for you.\n\nVerify, do not assert. Run the code, read the file, check the exit code. A claim in prose is worth nothing against state you did not check, and a check that cannot fail proves nothing. Reproduce a bug end to end, the way a real user hits it, before fixing it. Fix a lint error, failing test, or flake the moment you see it, whoever introduced it, without letting it derail the task at hand. Prefer quality and long-term maintainability over development cost.\n\nVerification has a blind spot: a consequential recommendation, a design or trade-off call, or a hard-to-reverse decision that still turns on judgment among plausible alternatives once the direct evidence is in. That is where confabulation hides, so put it past a peer critic before you ship it and budget the wait even under delivery pressure. When a test, a run, a reproduction, or a search would settle the claim, settle it that way instead; a critic asked to re-derive what you can already prove is ritual, not review.\n\nThe agent roster, the tool surface, and the reasoning behind these defaults are in your CLAUDE.md project instructions. Read them when choosing HOW to work; the rules above apply without a lookup.";
1804
1807
  /**
1805
1808
  * Skip the helper if the user's `~/.claude/CLAUDE.md` (or, equivalently,
1806
1809
  * the would-be post-write file) has grown past this size.
@@ -2342,6 +2345,6 @@ async function injectAttributionSuppressionIntoSettingsFile(settingsPath) {
2342
2345
  return { written: true };
2343
2346
  }
2344
2347
  //#endregion
2345
- export { injectPeerMcpIntoMirror as _, OPERATING_DEFAULTS_DIRECTIVE as a, workersKeyOf as b, prependArtifactPanelDirectiveToMirroredClaudeMd as c, SEAMLESS_BUILTIN_TOOLS as d, configureServeDefaultPermissionMode as f, BUILTIN_SUBAGENT_DEFINITIONS as g, sanitizeServeSettingsEnv as h, OPERATING_DEFAULTS_DIGEST as i, prependOperatingDefaultsToMirroredClaudeMd as l, planModeAllowRules as m, INJECTED_SKILLS as n, appendPeerAwarenessToMirroredClaudeMd as o, injectAllowRules as p, writeInjectedSkill as r, appendToolbeltAwarenessToMirroredClaudeMd as s, injectAttributionSuppressionIntoSettingsFile as t, prependStyleDirectiveToMirroredClaudeMd as u, resolveCodexCliBackend as v, writePeerMcpRuntimeFiles as x, resolveGroupKeysFromMirror as y };
2348
+ export { injectPeerMcpIntoMirror as _, appendPeerAwarenessToMirroredClaudeMd as a, workersKeyOf as b, prependArtifactPanelDirectiveToMirroredClaudeMd as c, SEAMLESS_BUILTIN_TOOLS as d, configureServeDefaultPermissionMode as f, BUILTIN_SUBAGENT_DEFINITIONS as g, sanitizeServeSettingsEnv as h, OPERATING_DEFAULTS_DIGEST as i, prependOperatingDefaultsToMirroredClaudeMd as l, planModeAllowRules as m, INJECTED_SKILLS as n, appendToolbeltAwarenessToMirroredClaudeMd as o, injectAllowRules as p, writeInjectedSkill as r, buildOperatingDefaultsDirective as s, injectAttributionSuppressionIntoSettingsFile as t, prependStyleDirectiveToMirroredClaudeMd as u, resolveCodexCliBackend as v, writePeerMcpRuntimeFiles as x, resolveGroupKeysFromMirror as y };
2346
2349
 
2347
- //# sourceMappingURL=attribution-settings-ZOaCUrYY.js.map
2350
+ //# sourceMappingURL=attribution-settings-srL3gBR9.js.map