github-router 0.3.305 → 0.3.308

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 (103) hide show
  1. package/dist/{attribution-settings-Chqw6VeK.js → attribution-settings-C_ZLSCQ4.js} +60 -61
  2. package/dist/attribution-settings-C_ZLSCQ4.js.map +1 -0
  3. package/dist/{auth-CpjOjoUG.js → auth-O_UG1ABO.js} +3 -3
  4. package/dist/{auth-CpjOjoUG.js.map → auth-O_UG1ABO.js.map} +1 -1
  5. package/dist/browser-ext/manifest.json +1 -1
  6. package/dist/{check-usage-BsN3S4Fu.js → check-usage-dicJOWML.js} +4 -4
  7. package/dist/{check-usage-BsN3S4Fu.js.map → check-usage-dicJOWML.js.map} +1 -1
  8. package/dist/{claude-C3LWG_3H.js → claude-CyiXTFxe.js} +33 -30
  9. package/dist/claude-CyiXTFxe.js.map +1 -0
  10. package/dist/{codex-DdhBGec4.js → codex-BV4Tvt0q.js} +5 -5
  11. package/dist/{codex-DdhBGec4.js.map → codex-BV4Tvt0q.js.map} +1 -1
  12. package/dist/{debug-BXRPyeqO.js → debug-2PgImRnr.js} +2 -2
  13. package/dist/{debug-BXRPyeqO.js.map → debug-2PgImRnr.js.map} +1 -1
  14. package/dist/engine-Cv4SNuzn.js +2 -0
  15. package/dist/{fast-profile-contract-OuZQaGif.js → fast-profile-contract-BWCJy6iL.js} +6 -4
  16. package/dist/fast-profile-contract-BWCJy6iL.js.map +1 -0
  17. package/dist/{gate-discovery-C6jB3bBG.js → gate-discovery-CLV0ft3G.js} +5 -5
  18. package/dist/{gate-discovery-C6jB3bBG.js.map → gate-discovery-CLV0ft3G.js.map} +1 -1
  19. package/dist/{get-copilot-usage-ByjQqhdi.js → get-copilot-usage-Cjy8TiFf.js} +2 -2
  20. package/dist/{get-copilot-usage-ByjQqhdi.js.map → get-copilot-usage-Cjy8TiFf.js.map} +1 -1
  21. package/dist/hooks.mjs +28 -12
  22. package/dist/hooks.sha256 +1 -1
  23. package/dist/{internal-artifact-open-DRSxShAW.js → internal-artifact-open-CxeIfsW_.js} +2 -2
  24. package/dist/{internal-artifact-open-DRSxShAW.js.map → internal-artifact-open-CxeIfsW_.js.map} +1 -1
  25. package/dist/{internal-fast-dispatch-guard-ByzwIsxA.js → internal-fast-dispatch-guard-CrsZI0pO.js} +1 -1
  26. package/dist/{internal-fast-dispatch-guard-BaUB-F8o.js → internal-fast-dispatch-guard-kzSKB0yV.js} +3 -3
  27. package/dist/{internal-fast-dispatch-guard-BaUB-F8o.js.map → internal-fast-dispatch-guard-kzSKB0yV.js.map} +1 -1
  28. package/dist/{internal-first-mate-guard-Bcb5JwiO.js → internal-first-mate-guard-BuweUgjb.js} +3 -3
  29. package/dist/{internal-first-mate-guard-Bcb5JwiO.js.map → internal-first-mate-guard-BuweUgjb.js.map} +1 -1
  30. package/dist/{internal-first-mate-guard-Brh_uois.js → internal-first-mate-guard-Nf1H0mCK.js} +1 -1
  31. package/dist/{internal-max-dispatch-guard-Sb6ACr_0.js → internal-max-dispatch-guard-DF-f8VwE.js} +1 -1
  32. package/dist/{internal-max-dispatch-guard-CXRB-4a3.js → internal-max-dispatch-guard-lS4usOV5.js} +12 -5
  33. package/dist/internal-max-dispatch-guard-lS4usOV5.js.map +1 -0
  34. package/dist/{internal-plan-review-DVY-iV2x.js → internal-plan-review-DLduDz41.js} +3 -3
  35. package/dist/{internal-plan-review-DVY-iV2x.js.map → internal-plan-review-DLduDz41.js.map} +1 -1
  36. package/dist/{internal-prompt-submit-BTqRn4FW.js → internal-prompt-submit-DG94f8E-.js} +4 -4
  37. package/dist/{internal-prompt-submit-BTqRn4FW.js.map → internal-prompt-submit-DG94f8E-.js.map} +1 -1
  38. package/dist/{internal-session-bind-YfH656lt.js → internal-session-bind-D6Hpl-84.js} +2 -2
  39. package/dist/{internal-session-bind-YfH656lt.js.map → internal-session-bind-D6Hpl-84.js.map} +1 -1
  40. package/dist/{internal-stop-hook-EPAu3tkg.js → internal-stop-hook-B8Z1k6xC.js} +5 -5
  41. package/dist/{internal-stop-hook-EPAu3tkg.js.map → internal-stop-hook-B8Z1k6xC.js.map} +1 -1
  42. package/dist/{internal-stop-review-B8MmEyQ1.js → internal-stop-review-DlKzZgFm.js} +2 -2
  43. package/dist/{internal-stop-review-B8MmEyQ1.js.map → internal-stop-review-DlKzZgFm.js.map} +1 -1
  44. package/dist/{internal-worker-guard-Dr6W83TC.js → internal-worker-guard-D7sfByyo.js} +2 -2
  45. package/dist/{internal-worker-guard-Dr6W83TC.js.map → internal-worker-guard-D7sfByyo.js.map} +1 -1
  46. package/dist/{internal-workspace-header-Cep0WSIb.js → internal-workspace-header-CU5OjLCB.js} +2 -2
  47. package/dist/{internal-workspace-header-Cep0WSIb.js.map → internal-workspace-header-CU5OjLCB.js.map} +1 -1
  48. package/dist/lifecycle-B0USSJvd.js +2 -0
  49. package/dist/{lifecycle-DgsJ_8Am.js → lifecycle-BCnarXJV.js} +2 -2
  50. package/dist/{lifecycle-DgsJ_8Am.js.map → lifecycle-BCnarXJV.js.map} +1 -1
  51. package/dist/lifecycle-CQFjaQc0.js +2 -0
  52. package/dist/{lifecycle-CmPJ6e_6.js → lifecycle-CtRA3Y7p.js} +2 -2
  53. package/dist/{lifecycle-CmPJ6e_6.js.map → lifecycle-CtRA3Y7p.js.map} +1 -1
  54. package/dist/main.js +19 -19
  55. package/dist/max-profile-contract-v2Q6eN5w.js +355 -0
  56. package/dist/max-profile-contract-v2Q6eN5w.js.map +1 -0
  57. package/dist/{mcp-workspace-header-NzFD0Wgd.js → mcp-workspace-header-B60WSR1Y.js} +2 -2
  58. package/dist/{mcp-workspace-header-NzFD0Wgd.js.map → mcp-workspace-header-B60WSR1Y.js.map} +1 -1
  59. package/dist/{models-1KwEUgzd.js → models-COuMOfM6.js} +3 -3
  60. package/dist/{models-1KwEUgzd.js.map → models-COuMOfM6.js.map} +1 -1
  61. package/dist/{orchestration-CYyp9w-t.js → orchestration-DjLA-lxB.js} +2 -2
  62. package/dist/{orchestration-CYyp9w-t.js.map → orchestration-DjLA-lxB.js.map} +1 -1
  63. package/dist/{paths-IcZW8gZx.js → paths-De1Qh9Q9.js} +235 -4
  64. package/dist/paths-De1Qh9Q9.js.map +1 -0
  65. package/dist/paths-DyX6SEnd.js +2 -0
  66. package/dist/{peer-mcp-personas-C9fDtu69.js → peer-mcp-personas-DAd076hn.js} +112 -352
  67. package/dist/peer-mcp-personas-DAd076hn.js.map +1 -0
  68. package/dist/{plan-review-hook-szSNt6uU.js → plan-review-hook-vL6BYmA8.js} +3 -3
  69. package/dist/{plan-review-hook-szSNt6uU.js.map → plan-review-hook-vL6BYmA8.js.map} +1 -1
  70. package/dist/{prompt-submit-hook-ZUxo_jEl.js → prompt-submit-hook-DfqufWC1.js} +3 -3
  71. package/dist/{prompt-submit-hook-ZUxo_jEl.js.map → prompt-submit-hook-DfqufWC1.js.map} +1 -1
  72. package/dist/{provision-Bn4FOzR4.js → provision-Xcr-fJii.js} +4 -4
  73. package/dist/{provision-Bn4FOzR4.js.map → provision-Xcr-fJii.js.map} +1 -1
  74. package/dist/{self-invocation-BJWbA8ka.js → self-invocation-B84JCHps.js} +2 -2
  75. package/dist/{self-invocation-BJWbA8ka.js.map → self-invocation-B84JCHps.js.map} +1 -1
  76. package/dist/{serve-7q23O8hl.js → serve-8tqMuzVi.js} +12 -12
  77. package/dist/{serve-7q23O8hl.js.map → serve-8tqMuzVi.js.map} +1 -1
  78. package/dist/{server-setup-BP_JM0qb.js → server-setup-C7jSESEI.js} +301 -11
  79. package/dist/server-setup-C7jSESEI.js.map +1 -0
  80. package/dist/{start-wa7_DyyG.js → start-CaTinp_s.js} +3 -3
  81. package/dist/{start-wa7_DyyG.js.map → start-CaTinp_s.js.map} +1 -1
  82. package/dist/{stop-gate-hook-CJOk28zd.js → stop-gate-hook-BEU8qQrC.js} +3 -3
  83. package/dist/{stop-gate-hook-CJOk28zd.js.map → stop-gate-hook-BEU8qQrC.js.map} +1 -1
  84. package/dist/{stop-gate-policy-zhzRIj6G.js → stop-gate-policy-qzqXfRxE.js} +2 -2
  85. package/dist/{stop-gate-policy-zhzRIj6G.js.map → stop-gate-policy-qzqXfRxE.js.map} +1 -1
  86. package/dist/{token-CbuFyx-B.js → token-CCg-Ov5q.js} +2 -2
  87. package/dist/{token-CbuFyx-B.js.map → token-CCg-Ov5q.js.map} +1 -1
  88. package/dist/{worker-dispatch-DgP5yT26.js → worker-dispatch-CH-NN5FW.js} +2 -2
  89. package/dist/{worker-dispatch-DgP5yT26.js.map → worker-dispatch-CH-NN5FW.js.map} +1 -1
  90. package/package.json +1 -1
  91. package/dist/attribution-settings-Chqw6VeK.js.map +0 -1
  92. package/dist/claude-C3LWG_3H.js.map +0 -1
  93. package/dist/engine-C7DkYq2g.js +0 -2
  94. package/dist/fast-profile-contract-OuZQaGif.js.map +0 -1
  95. package/dist/internal-max-dispatch-guard-CXRB-4a3.js.map +0 -1
  96. package/dist/lifecycle-4TZrJuAa.js +0 -2
  97. package/dist/lifecycle-O91Vzzb-.js +0 -2
  98. package/dist/max-profile-contract-CiD5wyET.js +0 -276
  99. package/dist/max-profile-contract-CiD5wyET.js.map +0 -1
  100. package/dist/paths-DDAiPVto.js +0 -2
  101. package/dist/paths-IcZW8gZx.js.map +0 -1
  102. package/dist/peer-mcp-personas-C9fDtu69.js.map +0 -1
  103. package/dist/server-setup-BP_JM0qb.js.map +0 -1
@@ -1,17 +1,17 @@
1
1
  import { n as explicitPackageRoot } from "./package-root-B-osctCk.js";
2
2
  import { t as getPackageVersion } from "./version-C8x2hQrZ.js";
3
- import { t as PATHS } from "./paths-IcZW8gZx.js";
3
+ import { t as PATHS } from "./paths-De1Qh9Q9.js";
4
4
  import { t as state } from "./state-B8adscCv.js";
5
- import { C as GITHUB_GRAPHQL_URL, D as githubAgentGraphQLHeaders, E as copilotVersion, O as githubAgentHeaders, S as GITHUB_API_BASE_URL, T as copilotHeaders, b as sanitizeTransportText, d as resolveModel, f as sleep$2, g as HTTPError, h as isAllowedCopilotHost, i as tryRefreshAndRetry, v as classifyTransportError, w as copilotBaseUrl, x as withTransientRetry, y as fetchWithTransientRetry } from "./token-CbuFyx-B.js";
5
+ import { C as GITHUB_GRAPHQL_URL, D as githubAgentGraphQLHeaders, E as copilotVersion, O as githubAgentHeaders, S as GITHUB_API_BASE_URL, T as copilotHeaders, b as sanitizeTransportText, d as resolveModel, f as sleep$2, g as HTTPError, h as isAllowedCopilotHost, i as tryRefreshAndRetry, v as classifyTransportError, w as copilotBaseUrl, x as withTransientRetry, y as fetchWithTransientRetry } from "./token-CCg-Ov5q.js";
6
6
  import { a as resolveExecutable, c as runManagedExeCapture, i as parseIntEnv, l as spawnTaskkillBestEffort, r as parseBoolEnv } from "./exec-y8C_MU8A.js";
7
- import { a as FAST_PROFILE_MODELS, c as FAST_PROFILE_NATIVE_MODELS, l as FAST_PROFILE_ORACLE_EFFORT, n as FAST_PROFILE_ADVISOR_EFFORT, o as FAST_PROFILE_NATIVE_AGENT_NAMES, r as FAST_PROFILE_ADVISOR_MODEL, s as FAST_PROFILE_NATIVE_EFFORTS, u as FAST_PROFILE_ORACLE_MODEL } from "./fast-profile-contract-OuZQaGif.js";
8
- import { _ as validateMaxProfilePrerequisites, a as MAX_PROFILE_NATIVE_AGENT_NAMES, b as normalizeTrailingOneMSuffix, f as maxGeminiModel, h as maxProReplacementModel, i as MAX_PROFILE_MODELS, m as maxOpusModel, p as maxGrokModel, r as MAX_PROFILE_LEAD_MODEL, v as fastEndpointForCatalogId, x as stripTrailingOneMSuffix, y as fastEndpointForModel } from "./max-profile-contract-CiD5wyET.js";
9
- import { i as registerExitHandlers$1, n as getInstanceUuid, r as recordWorkerRepo, t as WorktreeRegistry } from "./lifecycle-DgsJ_8Am.js";
10
- import { t as MCP_WORKSPACE_HEADER } from "./mcp-workspace-header-NzFD0Wgd.js";
7
+ import { a as FAST_PROFILE_MODELS, c as FAST_PROFILE_NATIVE_MODELS, l as FAST_PROFILE_ORACLE_EFFORT, n as FAST_PROFILE_ADVISOR_EFFORT, r as FAST_PROFILE_ADVISOR_MODEL, s as FAST_PROFILE_NATIVE_EFFORTS, u as FAST_PROFILE_ORACLE_MODEL } from "./fast-profile-contract-BWCJy6iL.js";
8
+ import { A as normalizeTrailingOneMSuffix, D as maxPeerInstructions, E as maxPeerDescription, O as fastEndpointForCatalogId, b as MAX_ADVISOR_SYSTEM_PROMPT, f as maxCodexReviewerModel, g as maxProReplacementModel, h as maxOpusModel, i as MAX_PROFILE_MODELS, k as fastEndpointForModel, m as maxGrokModel, p as maxGeminiModel, r as MAX_PROFILE_LEAD_MODEL, v as maxSonnetModel } from "./max-profile-contract-v2Q6eN5w.js";
9
+ import { i as registerExitHandlers$1, n as getInstanceUuid, r as recordWorkerRepo, t as WorktreeRegistry } from "./lifecycle-BCnarXJV.js";
10
+ import { t as MCP_WORKSPACE_HEADER } from "./mcp-workspace-header-B60WSR1Y.js";
11
11
  import { n as ArtifactError, r as applyInsecureTls, t as ArtifactClient } from "./client-CQMfroGV.js";
12
- import { n as isPidAlive$1, r as registerColbertExitHandlers, s as trackChild, t as getColbertInstanceUuid } from "./lifecycle-CmPJ6e_6.js";
13
- import { f as resolveSealedGate, m as runGateChecks, p as sealedGateIds } from "./stop-gate-hook-CJOk28zd.js";
14
- import { t as liveExec } from "./orchestration-CYyp9w-t.js";
12
+ import { n as isPidAlive$1, r as registerColbertExitHandlers, s as trackChild, t as getColbertInstanceUuid } from "./lifecycle-CtRA3Y7p.js";
13
+ import { f as resolveSealedGate, m as runGateChecks, p as sealedGateIds } from "./stop-gate-hook-BEU8qQrC.js";
14
+ import { t as liveExec } from "./orchestration-DjLA-lxB.js";
15
15
  import { createRequire } from "node:module";
16
16
  import consola from "consola";
17
17
  import { chmodSync, closeSync, constants, cpSync, existsSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
@@ -99,297 +99,6 @@ async function tryCreateLock(p) {
99
99
  }
100
100
  }
101
101
  //#endregion
102
- //#region src/lib/launch-profile.ts
103
- const STANDARD_PROFILE = Object.freeze({
104
- id: "standard",
105
- hasCoordinator: true
106
- });
107
- /**
108
- * The `-m fast` roster: exactly five native agents (`Explore`, `Plan`,
109
- * `general-purpose`, `implementer`, `reviewer`), the fast-only `oracle` peer
110
- * tool, no coordinator, and `peers`/`search` plus optional browser and
111
- * browse-only worker groups. Core workers, `orchestrate`, `decide`, `fleet`,
112
- * and `first-mate` remain hard denies even when their standard gates pass.
113
- */
114
- const FAST_PROFILE = Object.freeze({
115
- id: "fast",
116
- nativeRoster: new Set(FAST_PROFILE_NATIVE_AGENT_NAMES),
117
- personaAllowlist: /* @__PURE__ */ new Set(["oracle"]),
118
- allowedGroups: /* @__PURE__ */ new Set([
119
- "peers",
120
- "search",
121
- "workers",
122
- "browser"
123
- ]),
124
- hasCoordinator: false
125
- });
126
- /**
127
- * The `-m max` profile: Sol/Luna-led, browse-only workers, and explicit
128
- * cross-lab peer names. The descriptor is a hard projection for bound launch
129
- * requests; unbound/BYO traffic remains standard because it has no registry
130
- * entry carrying this allow-list.
131
- */
132
- const MAX_PROFILE = Object.freeze({
133
- id: "max",
134
- nativeRoster: new Set(MAX_PROFILE_NATIVE_AGENT_NAMES),
135
- personaAllowlist: /* @__PURE__ */ new Set([
136
- "sol_critic",
137
- "luna_reviewer",
138
- "opus_critic",
139
- "gemini_critic",
140
- "gemini_reviewer",
141
- "grok_critic",
142
- "grok_reviewer"
143
- ]),
144
- allowedGroups: /* @__PURE__ */ new Set([
145
- "peers",
146
- "search",
147
- "workers",
148
- "browser",
149
- "decide",
150
- "fleet",
151
- "first-mate"
152
- ]),
153
- hasCoordinator: true
154
- });
155
- function profileDescriptor(id) {
156
- if (id === "fast") return FAST_PROFILE;
157
- if (id === "max") return MAX_PROFILE;
158
- return STANDARD_PROFILE;
159
- }
160
- /**
161
- * Resolve the parsed `-m` argument to a launch profile.
162
- *
163
- * Deliberately keyed on the RAW alias string (trimmed, case-insensitive
164
- * `"fast"`), never on a resolved model id: `resolveLeadSlugArg` maps `fast`
165
- * to `FAST_LEAD_MODEL` (`./port`) before this is of any use to a caller who
166
- * only has the resolved id, so callers that already resolved the lead must
167
- * pass the ORIGINAL `-m` value here, not the resolved one. This is what
168
- * keeps `-m gpt-5.6-luna` (a direct pin of the same underlying model) a
169
- * standard-surface launch — only the literal alias narrows the surface.
170
- */
171
- function resolveLaunchProfile(modelArg) {
172
- const arg = modelArg?.trim().toLowerCase();
173
- if (arg === "fast") return "fast";
174
- if (arg === "max") return "max";
175
- return "standard";
176
- }
177
- function validateMaxProfileLaunch(catalog) {
178
- return validateMaxProfilePrerequisites(catalog);
179
- }
180
- /**
181
- * Router-owned alias id for the fast profile's Sonnet-tier row
182
- * (`ANTHROPIC_DEFAULT_SONNET_MODEL`). Never sent upstream — canonicalized to
183
- * `LUNA_REAL_MODEL_ID` by `canonicalizeAliasModel` before the request
184
- * reaches Copilot.
185
- */
186
- const LUNA_DRIVER_ALIAS_ID = "gh-router-luna-driver-max";
187
- /** Fast Explore alias preserves its high-effort provenance until the
188
- * authenticated request boundary. Bare Luna remains the max-effort lead and
189
- * `general-purpose` model. */
190
- const LUNA_SCOUT_ALIAS_ID = "gh-router-luna-scout-high";
191
- /** Retired Fast aliases remain recognizable only so old running clients fail
192
- * with an explicit stale-alias error instead of silently changing semantics. */
193
- const LUNA_IMPLEMENTER_ALIAS_ID = "gh-router-luna-implementer-max";
194
- const FAST_CRITIC_ALIAS_ID = "gh-router-fast-critic-medium";
195
- const LUNA_SONNET_ALIAS_ID = "gh-router-luna-sonnet-xhigh";
196
- /**
197
- * Router-owned alias id for the fast profile's Haiku-tier row
198
- * (`ANTHROPIC_DEFAULT_HAIKU_MODEL` / `ANTHROPIC_SMALL_FAST_MODEL`).
199
- */
200
- const LUNA_HAIKU_ALIAS_ID = "gh-router-luna-haiku-high";
201
- /** Max-profile aliases are intentionally separate from the fast aliases. They
202
- * preserve the fixed max role effort until the authenticated max request
203
- * boundary and are never valid on standard or fast launches. */
204
- const MAX_LUNA_HIGH_ALIAS_ID = "gh-router-max-luna-high";
205
- const MAX_LUNA_MAX_ALIAS_ID = "gh-router-max-luna-max";
206
- /** The real Copilot catalog id every Luna alias (including the driver
207
- * itself) canonicalizes to. */
208
- const LUNA_REAL_MODEL_ID = FAST_PROFILE_MODELS.luna;
209
- const MAX_ALIAS_IDS = /* @__PURE__ */ new Set([MAX_LUNA_HIGH_ALIAS_ID, MAX_LUNA_MAX_ALIAS_ID]);
210
- function isMaxModelAlias(id) {
211
- return MAX_ALIAS_IDS.has(stripTrailingOneMSuffix(id).base);
212
- }
213
- function maxAliasEffort(id) {
214
- const base = stripTrailingOneMSuffix(id).base;
215
- if (base === "gh-router-max-luna-high") return "high";
216
- if (base === "gh-router-max-luna-max") return "max";
217
- }
218
- function maxAliasModel(id) {
219
- return isMaxModelAlias(id) ? LUNA_REAL_MODEL_ID : void 0;
220
- }
221
- /**
222
- * The full alias table, keyed by `aliasId`. A simpler model-id-only table is
223
- * rejected by design: the driver, the Sonnet tier, and the Haiku tier all
224
- * resolve to the SAME Luna catalog id, while the fast critic alias resolves
225
- * to Gemini. After early canonicalization a table keyed on the real id could
226
- * no longer tell which absent-effort default applies. Alias provenance is the
227
- * minimum discriminator that survives from tier selection through to request
228
- * preprocessing, which is why canonicalization must happen LAST (in the
229
- * `/v1/messages` identity preflight), after the effort default has already
230
- * been read off the alias.
231
- */
232
- const RETIRED_FAST_ALIAS_IDS = /* @__PURE__ */ new Set([LUNA_IMPLEMENTER_ALIAS_ID, FAST_CRITIC_ALIAS_ID]);
233
- const MODEL_ALIAS_TABLE = /* @__PURE__ */ new Map([
234
- [LUNA_DRIVER_ALIAS_ID, {
235
- aliasId: LUNA_DRIVER_ALIAS_ID,
236
- realModel: LUNA_REAL_MODEL_ID,
237
- absentEffortDefault: "max"
238
- }],
239
- [MAX_LUNA_HIGH_ALIAS_ID, {
240
- aliasId: MAX_LUNA_HIGH_ALIAS_ID,
241
- realModel: LUNA_REAL_MODEL_ID,
242
- absentEffortDefault: "high"
243
- }],
244
- [MAX_LUNA_MAX_ALIAS_ID, {
245
- aliasId: MAX_LUNA_MAX_ALIAS_ID,
246
- realModel: LUNA_REAL_MODEL_ID,
247
- absentEffortDefault: "max"
248
- }],
249
- [LUNA_SCOUT_ALIAS_ID, {
250
- aliasId: LUNA_SCOUT_ALIAS_ID,
251
- realModel: LUNA_REAL_MODEL_ID,
252
- absentEffortDefault: "high"
253
- }],
254
- [LUNA_SONNET_ALIAS_ID, {
255
- aliasId: LUNA_SONNET_ALIAS_ID,
256
- realModel: LUNA_REAL_MODEL_ID,
257
- absentEffortDefault: "xhigh"
258
- }],
259
- [LUNA_HAIKU_ALIAS_ID, {
260
- aliasId: LUNA_HAIKU_ALIAS_ID,
261
- realModel: LUNA_REAL_MODEL_ID,
262
- absentEffortDefault: "high"
263
- }]
264
- ]);
265
- /**
266
- * Look up the alias descriptor for a wire-facing model id (with or without
267
- * a trailing `[1m]` bracket — the bracket is stripped before the table
268
- * lookup and is orthogonal to alias identity). Returns undefined for any
269
- * id that isn't one of the registered aliases (including bare `claude-*`
270
- * ids and every other real Copilot catalog id).
271
- */
272
- function resolveModelAlias(id) {
273
- const { base } = stripTrailingOneMSuffix(id);
274
- return MODEL_ALIAS_TABLE.get(base);
275
- }
276
- function isRetiredFastModelAlias(id) {
277
- return RETIRED_FAST_ALIAS_IDS.has(stripTrailingOneMSuffix(id).base);
278
- }
279
- /**
280
- * Strip alias provenance and return the real catalog id to send upstream.
281
- * Idempotent passthrough for any id that isn't a registered alias (a bare
282
- * `claude-*` slug, an already-real Copilot id, or anything else) — this is
283
- * safe to call unconditionally on every `body.model` at the outbound
284
- * boundary. Preserves a trailing `[1m]` bracket: canonicalization only
285
- * erases ALIAS identity, not the 1M-context accounting decoration.
286
- */
287
- function canonicalizeAliasModel(id) {
288
- const { base, hadSuffix } = stripTrailingOneMSuffix(id);
289
- const alias = MODEL_ALIAS_TABLE.get(base);
290
- if (!alias) return normalizeTrailingOneMSuffix(id);
291
- return hadSuffix ? `${alias.realModel}[1m]` : alias.realModel;
292
- }
293
- const FAST_REQUIRED_CONTEXT_TOKENS = 1e6;
294
- function findModel(catalog, id) {
295
- return catalog?.data?.find((m) => m.id === id);
296
- }
297
- function hasToolCalls(model) {
298
- return model?.capabilities?.supports?.tool_calls === true;
299
- }
300
- function hasContextAtLeast(model, tokens) {
301
- return (model?.capabilities?.limits?.max_context_window_tokens ?? 0) >= tokens;
302
- }
303
- function supportsEffort(model, effort) {
304
- const list = model?.capabilities?.supports?.reasoning_effort;
305
- return Array.isArray(list) && list.includes(effort);
306
- }
307
- const FAST_REVIEWER_MIN_PROMPT_TOKENS = 2e5;
308
- function supportsEndpoint(model, endpoint) {
309
- return model !== void 0 && fastEndpointForModel(model) === endpoint;
310
- }
311
- function hasUsablePromptMetadata(model) {
312
- const prompt = model?.capabilities?.limits?.max_prompt_tokens;
313
- return typeof prompt === "number" && Number.isFinite(prompt) && prompt > 0;
314
- }
315
- function hasPromptAtLeast(model, tokens) {
316
- const prompt = model?.capabilities?.limits?.max_prompt_tokens;
317
- return typeof prompt === "number" && Number.isFinite(prompt) && prompt >= tokens;
318
- }
319
- /**
320
- * Validate the live Copilot catalog carries every model the fast profile's
321
- * EXACT roster depends on, with the specific capabilities each assignment
322
- * needs. These are capability-availability PREREQUISITES for constructing
323
- * the roster — not an allowlist of models the user may select later in the
324
- * session — so a partial catalog fails the whole `-m fast` launch rather
325
- * than silently substituting or dropping an agent.
326
- *
327
- * Checks, per the fast-launch-profile design:
328
- * - Luna lead/Explore/general-purpose: tool calls, >=1M, high+max, Responses.
329
- * - Sol Plan: tool calls, >=1M, high, Responses.
330
- * - Grok reviewer: tool calls, medium, Responses, usable prompt metadata.
331
- * - Gemini implementer/Advisor: tool calls, >=1M, high, chat-completions.
332
- * - Opus Oracle: exact Opus 5, >=1M, adaptive/high, Messages, prompt metadata.
333
- *
334
- * Pure over the passed-in catalog snapshot so it's unit-testable without
335
- * `state` — callers pass `state.models` at call time.
336
- */
337
- function validateFastProfilePrerequisites(catalog) {
338
- const missing = [];
339
- const luna = findModel(catalog, LUNA_REAL_MODEL_ID);
340
- if (!luna) missing.push(`${LUNA_REAL_MODEL_ID}: absent from the live catalog`);
341
- else {
342
- if (!hasToolCalls(luna)) missing.push(`${LUNA_REAL_MODEL_ID}: does not advertise tool_calls`);
343
- if (!hasContextAtLeast(luna, FAST_REQUIRED_CONTEXT_TOKENS)) missing.push(`${LUNA_REAL_MODEL_ID}: advertised context window is below 1M`);
344
- if (!supportsEffort(luna, "high") || !supportsEffort(luna, "max")) missing.push(`${LUNA_REAL_MODEL_ID}: does not advertise both "high" and "max" reasoning effort`);
345
- if (!supportsEndpoint(luna, "responses")) missing.push(`${LUNA_REAL_MODEL_ID}: does not advertise a supported Responses endpoint`);
346
- }
347
- const sol = findModel(catalog, FAST_PROFILE_MODELS.plan);
348
- if (!sol) missing.push(`${FAST_PROFILE_MODELS.plan}: absent from the live catalog`);
349
- else {
350
- if (!hasToolCalls(sol)) missing.push(`${FAST_PROFILE_MODELS.plan}: does not advertise tool_calls`);
351
- if (!hasContextAtLeast(sol, FAST_REQUIRED_CONTEXT_TOKENS)) missing.push(`${FAST_PROFILE_MODELS.plan}: advertised context window is below 1M`);
352
- if (!supportsEffort(sol, "high")) missing.push(`${FAST_PROFILE_MODELS.plan}: does not advertise a "high" reasoning effort`);
353
- if (!supportsEndpoint(sol, "responses")) missing.push(`${FAST_PROFILE_MODELS.plan}: does not advertise a supported Responses endpoint`);
354
- }
355
- const grok = findModel(catalog, FAST_PROFILE_MODELS.reviewer);
356
- if (!grok) missing.push(`${FAST_PROFILE_MODELS.reviewer}: absent from the live catalog`);
357
- else {
358
- if (!hasToolCalls(grok)) missing.push(`${FAST_PROFILE_MODELS.reviewer}: does not advertise tool_calls`);
359
- if (!supportsEffort(grok, "medium")) missing.push(`${FAST_PROFILE_MODELS.reviewer}: does not advertise a "medium" reasoning effort`);
360
- if (!hasPromptAtLeast(grok, 2e5)) missing.push(`${FAST_PROFILE_MODELS.reviewer}: advertised max_prompt_tokens is below ${FAST_REVIEWER_MIN_PROMPT_TOKENS}`);
361
- if (!supportsEndpoint(grok, "responses")) missing.push(`${FAST_PROFILE_MODELS.reviewer}: does not advertise a supported Responses endpoint`);
362
- }
363
- const gemini = findModel(catalog, FAST_PROFILE_MODELS.advisor);
364
- if (!gemini) missing.push(`${FAST_PROFILE_MODELS.advisor}: absent from the live catalog`);
365
- else {
366
- if (!hasToolCalls(gemini)) missing.push(`${FAST_PROFILE_MODELS.advisor}: does not advertise tool_calls`);
367
- if (!hasContextAtLeast(gemini, FAST_REQUIRED_CONTEXT_TOKENS)) missing.push(`${FAST_PROFILE_MODELS.advisor}: advertised context window is below 1M`);
368
- if (!supportsEffort(gemini, "high")) missing.push(`${FAST_PROFILE_MODELS.advisor}: does not advertise a "high" reasoning effort`);
369
- if (!supportsEndpoint(gemini, "chat")) missing.push(`${FAST_PROFILE_MODELS.advisor}: does not advertise a supported chat-completions endpoint`);
370
- }
371
- const opus = findModel(catalog, FAST_PROFILE_MODELS.oracle);
372
- if (!opus) missing.push(`${FAST_PROFILE_MODELS.oracle}: absent from the live catalog`);
373
- else {
374
- if (!hasContextAtLeast(opus, FAST_REQUIRED_CONTEXT_TOKENS)) missing.push(`${FAST_PROFILE_MODELS.oracle}: advertised context window is below 1M`);
375
- if (!supportsEffort(opus, "high")) missing.push(`${FAST_PROFILE_MODELS.oracle}: does not advertise a "high" reasoning effort`);
376
- if (opus.capabilities?.supports?.adaptive_thinking !== true) missing.push(`${FAST_PROFILE_MODELS.oracle}: does not advertise adaptive_thinking`);
377
- if (!hasUsablePromptMetadata(opus)) missing.push(`${FAST_PROFILE_MODELS.oracle}: no usable max_prompt_tokens metadata`);
378
- if (!supportsEndpoint(opus, "messages")) missing.push(`${FAST_PROFILE_MODELS.oracle}: does not advertise a supported Messages endpoint`);
379
- }
380
- return {
381
- ok: missing.length === 0,
382
- missing
383
- };
384
- }
385
- /**
386
- * Format `validateFastProfilePrerequisites`'s failure list into the launch
387
- * error message: every missing/invalid model, plus the rollback command.
388
- */
389
- function formatFastPrerequisiteFailure(missing) {
390
- return "github-router claude -m fast requires the following live-catalog capabilities, which this account's catalog does not fully provide:\n" + missing.map((m) => ` - ${m}`).join("\n") + "\n\nFalling back or silently dropping an agent is not supported for the fast profile's exact roster. Run plain `github-router claude` instead.";
391
- }
392
- //#endregion
393
102
  //#region src/lib/one-m-context.ts
394
103
  /**
395
104
  * Context-window threshold at which Claude Code's `[1m]` accounting unlock is
@@ -747,16 +456,10 @@ const DEFAULT_CLAUDE_MODEL_FALLBACKS = [
747
456
  */
748
457
  const DEFAULT_OPUS_FAMILY = "5";
749
458
  /**
750
- * The lead `-m fast` selects. `gpt-5.6-luna` — a distinct Luna-driven
751
- * profile (see `./launch-profile`), NOT a Claude Sonnet budget lead. This
752
- * REPLACES the earlier `-m fast` → `claude-sonnet-5` mapping: `fast` now
753
- * names a deliberately lean Luna surface (five native agents, one peer
754
- * persona, `peers`/`search` MCP groups only), not "budget Sonnet with the
755
- * full standard surface". `resolveLaunchProfile` in `./launch-profile`
756
- * keys off the same raw `-m` argument this constant is selected by, so the
757
- * two can never disagree about which launches count as "fast".
459
+ * The lead `-m fast` selects. `gemini-3.8-flash` [1m] at high effort — a fast
460
+ * Gemini-driven profile (see `./launch-profile`).
758
461
  */
759
- const FAST_LEAD_MODEL = FAST_PROFILE_MODELS.luna;
462
+ const FAST_LEAD_MODEL = FAST_PROFILE_MODELS.lead;
760
463
  /** Small/fast tier for a budget lead, in the two forms this codebase needs.
761
464
  *
762
465
  * `SLUG` is the Anthropic-published DASHED form and is what goes into
@@ -19255,7 +18958,7 @@ function logAudit$1(record) {
19255
18958
  try {
19256
18959
  const fs = await import("node:fs/promises");
19257
18960
  const path = await import("node:path");
19258
- const { PATHS } = await import("./paths-DDAiPVto.js");
18961
+ const { PATHS } = await import("./paths-DyX6SEnd.js");
19259
18962
  const dir = path.join(PATHS.APP_DIR, "browser-mcp");
19260
18963
  await fs.mkdir(dir, { recursive: true });
19261
18964
  const line = JSON.stringify({
@@ -28089,27 +27792,29 @@ function fastImplementerModel() {
28089
27792
  if (!Array.isArray(efforts) || !efforts.includes(FAST_IMPLEMENTER_EFFORT)) return void 0;
28090
27793
  return found && fastEndpointForModel(found) === "chat" ? id : void 0;
28091
27794
  }
28092
- /** Gate Grok on the prompt limit that actually constrains pasted review input. */
27795
+ /** Sonnet 5 1M xhigh reviewer for Fast profile. */
28093
27796
  function fastReviewerModel() {
28094
27797
  const models = state.models?.data;
28095
27798
  if (!models) return void 0;
28096
27799
  const found = models.find((m) => m.id === FAST_REVIEWER_MODEL);
28097
27800
  if (!found) return void 0;
28098
27801
  if (found.capabilities?.supports?.tool_calls !== true) return void 0;
27802
+ if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < 1e6) return void 0;
28099
27803
  const efforts = found.capabilities?.supports?.reasoning_effort;
28100
27804
  if (!Array.isArray(efforts) || !efforts.includes(FAST_REVIEWER_EFFORT)) return void 0;
28101
- if ((found.capabilities?.limits?.max_prompt_tokens ?? 0) < 2e5) return void 0;
28102
- if (fastEndpointForModel(found) !== "responses") return void 0;
27805
+ if (found.capabilities?.supports?.adaptive_thinking !== true) return void 0;
27806
+ if (fastEndpointForModel(found) !== "messages") return void 0;
28103
27807
  return FAST_REVIEWER_MODEL;
28104
27808
  }
28105
- /** Dedicated Gemini 3.8 Flash Advisor check. */
27809
+ /** Dedicated GPT-5.6 Sol Advisor check. */
28106
27810
  function fastAdvisorModel() {
28107
27811
  const found = state.models?.data.find((m) => m.id === FAST_ADVISOR_MODEL);
28108
27812
  if (!found) return void 0;
28109
27813
  if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < 1e6) return void 0;
27814
+ if (found.capabilities?.supports?.tool_calls !== true) return void 0;
28110
27815
  const efforts = found.capabilities?.supports?.reasoning_effort;
28111
27816
  if (!Array.isArray(efforts) || !efforts.includes(FAST_ADVISOR_EFFORT)) return void 0;
28112
- if (fastEndpointForModel(found) !== "chat") return void 0;
27817
+ if (fastEndpointForModel(found) !== "responses") return void 0;
28113
27818
  return FAST_ADVISOR_MODEL;
28114
27819
  }
28115
27820
  /** Exact Opus 5 only: the fast Oracle never inherits standard opus_critic's
@@ -28397,7 +28102,8 @@ function resolveOpusCriticModel() {
28397
28102
  function activePersonas(launch) {
28398
28103
  if (launch?.profileId === "max") return maxPersonasFor({
28399
28104
  solModel: MAX_PROFILE_MODELS.sol,
28400
- lunaModel: MAX_PROFILE_MODELS.luna,
28105
+ codexModel: maxCodexReviewerModel(),
28106
+ sonnetModel: maxSonnetModel(),
28401
28107
  opusModel: maxOpusModel(),
28402
28108
  geminiModel: maxGeminiModel(),
28403
28109
  grokModel: maxGrokModel()
@@ -28422,7 +28128,7 @@ function activePersonas(launch) {
28422
28128
  function oracleToolEntry() {
28423
28129
  return {
28424
28130
  name: "oracle",
28425
- description: "Fast-profile last-resort guidance from exact Opus 5 (1M context) at high effort. Available only to the lead and Plan: pass complete context plus one precise consequential question when repository evidence cannot settle it. It is stateless and tool-less; it cannot inspect the repo, execute, merge, or authorize actions.",
28131
+ description: "Fast-profile last-resort consultant (Opus 5 1M context at high effort) available only to the lead and Plan. Stateless and cold-start: it sees only what you paste, with no repo access, tools, or prior history. Use for conceptual, algorithmic, spec/protocol, or architectural tradeoffs when repository evidence cannot settle them. Pass complete context, constraints, minimal code excerpts with path:line, and one precise unresolved question. Not for code discovery, web search, approval, or execution.",
28426
28132
  inputSchema: {
28427
28133
  type: "object",
28428
28134
  required: ["query", "context"],
@@ -28430,11 +28136,11 @@ function oracleToolEntry() {
28430
28136
  properties: {
28431
28137
  query: {
28432
28138
  type: "string",
28433
- description: "One precise unresolved question."
28139
+ description: "One precise, consequential unresolved question."
28434
28140
  },
28435
28141
  context: {
28436
28142
  type: "string",
28437
- description: "Complete evidence and constraints needed to answer cold-start."
28143
+ description: "Complete self-contained evidence, constraints, code excerpts with path:line, and ruled-out alternatives needed to evaluate cold-start."
28438
28144
  }
28439
28145
  }
28440
28146
  }
@@ -30085,16 +29791,16 @@ const ADVISOR_MIN_EFFORT = "high";
30085
29791
  * the decorrelation instrument and are untouched. `GH_ROUTER_ADVISOR_MODEL`
30086
29792
  * keeps a cross-lab advisor one env var away for anyone who wants it back. */
30087
29793
  const ADVISOR_ESCALATION_MODEL = "claude-opus-5";
30088
- /** The Advisor model for an authenticated fast primary lead. Gemini 3.8 Flash
30089
- * is cross-lab from the OpenAI-backed Luna/Sol leads and is selected only when
30090
- * its live catalog entry advertises the required Chat endpoint. Kept distinct
29794
+ /** The Advisor model for an authenticated fast primary lead. GPT-5.6 Sol
29795
+ * is cross-lab from the Google-backed Gemini lead and is selected only when
29796
+ * its live catalog entry advertises the required Responses endpoint. Kept distinct
30091
29797
  * from `ADVISOR_DEFAULT_MODEL` so standard launches remain unchanged. */
30092
29798
  const ADVISOR_FAST_PROFILE_MODEL = FAST_PROFILE_ADVISOR_MODEL;
30093
- /** True only when the live Gemini entry satisfies the fixed fast transport.
29799
+ /** True only when the live entry satisfies the fixed fast transport.
30094
29800
  * An ID-only presence check is insufficient: selecting a model whose catalog
30095
- * row lost Chat support would silently degrade every fast Advisor call. */
29801
+ * row lost Responses support would silently degrade every fast Advisor call. */
30096
29802
  function fastProfileAdvisorAvailable() {
30097
- return fastEndpointForCatalogId(ADVISOR_FAST_PROFILE_MODEL, state.models?.data) === "chat";
29803
+ return fastEndpointForCatalogId(ADVISOR_FAST_PROFILE_MODEL, state.models?.data) === "responses";
30098
29804
  }
30099
29805
  /** Output cap for the Anthropic-branch advisor call when the catalog carries no
30100
29806
  * limits for the resolved model. The value the branch used unconditionally
@@ -30223,7 +29929,7 @@ function normalizeAdvisorPin(pinned) {
30223
29929
  }
30224
29930
  function resolveAdvisorModel(leadModel, fastProfile = false) {
30225
29931
  if (fastProfile) {
30226
- if (!fastProfileAdvisorAvailable()) throw new Error(`fast Advisor invariant failed: ${ADVISOR_FAST_PROFILE_MODEL} must advertise the Chat endpoint`);
29932
+ if (!fastProfileAdvisorAvailable()) throw new Error(`fast Advisor invariant failed: ${ADVISOR_FAST_PROFILE_MODEL} must advertise the Responses endpoint`);
30227
29933
  return {
30228
29934
  model: ADVISOR_FAST_PROFILE_MODEL,
30229
29935
  escalated: false,
@@ -30518,7 +30224,7 @@ function truncateTailToUnits(text, maxUnits, measure) {
30518
30224
  * every result").
30519
30225
  */
30520
30226
  function advisorSystemPrompt(advisorEscalated = false, fastProfile = false, maxProfile = false) {
30521
- if (maxProfile) return "You are a non-binding consultant to the primary lead. The transcript is context for one focused consequential uncertainty, not an invitation to supervise the whole session. Offer a concise recommendation with its assumptions, material risks, credible alternatives, confidence, and any evidence gap that would change it. Cite relevant transcript evidence. Do not approve, veto, dictate, or take ownership; the lead weighs your advice against the user's intent and verified evidence.";
30227
+ if (maxProfile) return MAX_ADVISOR_SYSTEM_PROMPT;
30522
30228
  return "You are an expert advisor reviewing an in-progress Claude Code session. The transcript below is the work-in-progress (turns numbered, with tool calls and results inlined). Read carefully and provide concrete, actionable advice on the next step or course-correction. Be specific — cite the parts of the transcript you're responding to. If the assistant is on the right track, say so explicitly. If they're stuck or off-track, name the specific assumption or step to revisit. Aim for 2-5 paragraphs of substantive guidance." + (fastProfile ? " You are a non-binding consultant to the primary lead. Address the focused uncertainty that prompted this call with a recommendation, its assumptions, material risks, credible alternatives, confidence, and any evidence gap that would change the recommendation. Do not approve, veto, dictate, or take ownership; the lead will weigh your advice against the user's intent and verified evidence." : "") + (advisorEscalated && !fastProfile && !maxProfile ? " The requesting agent is running a lighter, faster model than you. Give a directive recommendation and commit to the decision rather than laying out options for it to weigh." : "");
30523
30229
  }
30524
30230
  async function runAdvisor(conversation, advisorModel, advisorEffort, signal, advisorEscalated = false, fastProfile = false, maxProfile = false) {
@@ -36069,8 +35775,12 @@ function buildPeerAwarenessSnippet(opts) {
36069
35775
  return [
36070
35776
  "## Peer review and advisor",
36071
35777
  "",
36072
- `Max launch profile. The native roster is a menu of complementary capabilities rather than a required workflow: \`Explore\` for broad discovery, \`brainstorm\` for open design choices, \`Plan\` when sequencing or acceptance criteria benefit from a separate view, \`implementer\` for bounded coding, \`general-purpose\` for mixed work, and \`reviewer\` for repository-aware verification. Their frontmatter models are intentional defaults chosen for role fit and cross-lab diversity; overrides are most useful after a concrete mismatch and remain within the max allowlist. Independent work can run in parallel when it improves context isolation or latency. Fresh-context peers can reduce correlated blind spots where deterministic evidence does not settle the issue; \`peer-review-coordinator\` can combine max-profile \`sol_critic\`, \`luna_reviewer\`, and catalog-present \`opus_critic\`, \`gemini_critic\`/\`gemini_reviewer\`, and \`grok_critic\`/\`grok_reviewer\` when the risk merits several lenses. Small or obvious tasks are often better handled directly, and model output remains evidence to synthesize rather than a vote.`,
36073
- `\`mcp__${searchKey}__code\` provides semantic-first code search and \`mcp__${searchKey}__web\` provides citable web sources. Advisor is optional, non-binding, primary-lead-only counsel for a focused consequential uncertainty that direct evidence, Plan, reviewer, or peers cannot settle. It is not a supervisor, approver, or routine workflow/completion gate; consult again only when materially new evidence creates a different question. It remains available across controlled max lead switches, while native subagents and browse workers do not receive it.${opts.standInAvailable ? " Max stand_in uses Sol + Opus 5 + Grok 4.6/high when available, otherwise Gemini 3.8 Flash 1M/high; it never uses Gemini 3.1 Pro." : ""}${opts.agentToolsAvailable ? " Max first-mate replaces any Gemini 3.1 Pro model choice with the same Grok/high → Gemini 3.8 Flash/high fallback." : ""}${browserClause}${workerClause}${decideClause}${fleetClause}${agentsClause}${artifactClause}`
35778
+ "Max native roster: `Explore` discovers broadly; `Plan` structures cross-boundary changes; `general-purpose` owns bounded mixed execution; `implementer` writes a settled change; `reviewer` verifies against the repository and runtime; `brainstorm` explores materially different approaches; `peer-review-coordinator` synthesizes multiple distinct fresh-context lenses. Configured models are deliberate role defaults.",
35779
+ `Available cold-start peers under \`mcp__${peersKey}__*\`: ${(opts.maxPersonaNames ?? maxPersonasFor({
35780
+ solModel: MAX_PROFILE_MODELS.sol,
35781
+ sonnetModel: MAX_PROFILE_MODELS.sonnet
35782
+ }).map((persona) => persona.toolNameHttp)).map((name) => `\`${name}\``).join(", ") || "none"}. They cannot inspect the repository or transcript and evaluate only the supplied artifact, constraints, and images. Their tool descriptions state the exact lens and boundary. Use the native \`reviewer\` when navigation, commands, tests, or reproduction are required; a peer suits a self-contained artifact. The coordinator has peer tools only and cannot gather missing repository context.`,
35783
+ `\`mcp__${searchKey}__code\` provides semantic-first code search and \`mcp__${searchKey}__web\` provides citable web sources. Advisor is transcript-aware, primary-lead-only, and unavailable to native subagents and browse workers; it can detect framing drift but is not independent verification.${browserClause}${workerClause}${decideClause}${fleetClause}${agentsClause}${artifactClause}`
36074
35784
  ].join("\n");
36075
35785
  }
36076
35786
  if (opts.profile === "fast") {
@@ -36143,15 +35853,12 @@ function buildPeerAwarenessSnippet(opts) {
36143
35853
  */
36144
35854
  function buildPeerAwarenessSummary(opts) {
36145
35855
  const key = (g) => opts.groupKeys?.[g] ?? GROUP_META[g].preferredKey;
36146
- if (opts.profile === "max") {
36147
- const directBrowserAvailable = opts.browserToolsAvailable ?? opts.browseAvailable;
36148
- return [
36149
- "## Injected capabilities (summary)",
36150
- "",
36151
- "Max launch profile. The roster offers complementary capabilities: `Explore` for broad discovery, `brainstorm` for open choices, `Plan` for a separate planning view, `implementer` and `general-purpose` for execution, and `reviewer` for repository-aware verification. Small or obvious tasks can be handled directly; independent work can run in parallel. Configured models are the default best fit, and a fresh-context peer or `peer-review-coordinator` can reduce correlated blind spots when risk and uncertainty justify it. Model output is evidence to synthesize, not a vote. Advisor is optional, non-binding, and primary-lead-only counsel for a focused consequential uncertainty the normal evidence and roles cannot settle; it has no approval or workflow authority. The lead decides. On every retained max path, replace Gemini 3.1 Pro with Grok 4.6/high when available, otherwise Gemini 3.8 Flash 1M/high.",
36152
- `\`mcp__${key("search")}__code\` and \`mcp__${key("search")}__web\` provide code and web search.${directBrowserAvailable ? ` \`mcp__${key("browser")}__*\` provides browser control.` : ""}${opts.browseAvailable ? ` \`worker-browse\` dispatches the browse-only worker through \`mcp__${key("workers")}__browse\`.` : ""}${opts.standInAvailable ? ` \`mcp__${key("decide")}__stand_in\` provides deterministic decision tiebreak.` : ""}${opts.fleetAvailable ? ` \`mcp__${key("fleet")}__*\` provides gated remote sessions.` : ""}${opts.agentToolsAvailable ? " First-mate remains available when its own gate passes." : ""}${opts.artifactToolsAvailable ? ` \`mcp__${key("peers")}__artifact_*\` provides human review with plan auto-open.` : ""}`
36153
- ].join("\n");
36154
- }
35856
+ if (opts.profile === "max") return [
35857
+ "## Injected capabilities (summary)",
35858
+ "",
35859
+ "Max native roster: `Explore` for broad discovery; `Plan` for interfaces, sequencing, risks, and acceptance criteria; `general-purpose` for bounded mixed execution; `implementer` for settled coding changes; `reviewer` for repository-aware verification and reproduction; `brainstorm` for materially different open approaches; and `peer-review-coordinator` for several distinct fresh-context review lenses. Configured models are deliberate role defaults.",
35860
+ "Native roles can inspect the repository within their listed tools. Fresh-context peers see only the artifact and constraints supplied to them. Advisor is transcript-aware, optional, non-binding, and primary-lead-only; it can identify framing drift but is not independent verification or an approval gate. Detailed routing lives in each role or tool description, and the full gated capability inventory lives in CLAUDE.md."
35861
+ ].join("\n");
36155
35862
  if (opts.profile === "fast") {
36156
35863
  const browserClause = opts.browserToolsAvailable ?? opts.browseAvailable ? ` \`mcp__${key("browser")}__*\` provides the opt-in browser.` : "";
36157
35864
  const workerBrowseClause = opts.browseAvailable ? ` \`worker-browse\` runs delegated browsing tasks through \`mcp__${key("workers")}__browse\`.` : "";
@@ -36254,14 +35961,19 @@ function personasFor(opts) {
36254
35961
  }
36255
35962
  return result;
36256
35963
  }
36257
- function maxPersona(agentName, toolNameHttp, model, endpoint, description, baseInstructions, allowedEfforts, defaultEffort) {
35964
+ function maxPersona(agentName, toolNameHttp, model, endpoint, copy, allowedEfforts, defaultEffort) {
35965
+ const promptOpts = {
35966
+ ...copy,
35967
+ name: toolNameHttp,
35968
+ model
35969
+ };
36258
35970
  return {
36259
35971
  agentName,
36260
35972
  toolNameHttp,
36261
35973
  model,
36262
35974
  endpoint,
36263
- description,
36264
- baseInstructions,
35975
+ description: maxPeerDescription(promptOpts),
35976
+ baseInstructions: maxPeerInstructions(promptOpts),
36265
35977
  agentPrompt: "",
36266
35978
  writeCapable: false,
36267
35979
  requiresHttp: true,
@@ -36272,40 +35984,88 @@ function maxPersona(agentName, toolNameHttp, model, endpoint, description, baseI
36272
35984
  /** Max-only peer registry. It never changes the standard persona registry. */
36273
35985
  function maxPersonasFor(opts) {
36274
35986
  const sol = opts.solModel ?? MAX_PROFILE_MODELS.sol;
36275
- const luna = opts.lunaModel ?? MAX_PROFILE_MODELS.luna;
35987
+ const codex = opts.codexModel;
35988
+ const sonnet = opts.sonnetModel ?? MAX_PROFILE_MODELS.sonnet;
36276
35989
  const opus = opts.opusModel;
36277
35990
  const gemini = opts.geminiModel;
36278
35991
  const grok = opts.grokModel;
36279
- const result = [maxPersona("sol-critic", "sol_critic", sol, "/v1/responses", `Max-profile strategic critic backed by ${sol} (OpenAI). Reviews plans, designs, tradeoffs, and large artifacts for unsound assumptions and missing failure modes.`, `You are sol_critic, a fresh-context adversarial architecture critic running on ${sol}. Review the complete artifact and constraints, report concrete assumptions and failure modes, and do not invent objections.`, [
35992
+ const result = [maxPersona("sol-critic", "sol_critic", sol, "/v1/responses", {
35993
+ kind: "strategic critic",
35994
+ lens: "architecture, assumptions, alternatives, and system-level failure modes",
35995
+ useWhen: "a self-contained plan or design needs adversarial review before a consequential decision",
35996
+ notFor: "line-level code review or claims a repository check can settle"
35997
+ }, [
35998
+ "low",
35999
+ "medium",
36000
+ "high",
36001
+ "xhigh"
36002
+ ], "xhigh")];
36003
+ if (codex) result.push(maxPersona("codex-reviewer", "codex_reviewer", codex, "/v1/responses", {
36004
+ kind: "line-level reviewer",
36005
+ lens: "correctness, edge cases, security, concurrency, and resource handling",
36006
+ useWhen: "a concrete code excerpt or diff needs a focused implementation review",
36007
+ notFor: "open architecture decisions, repository exploration, or executing tests"
36008
+ }, [
36280
36009
  "low",
36281
36010
  "medium",
36282
36011
  "high",
36283
36012
  "xhigh"
36284
- ], "xhigh"), maxPersona("luna-reviewer", "luna_reviewer", luna, "/v1/responses", `Max-profile line-level reviewer backed by ${luna} (OpenAI). Reviews concrete diffs and files for bugs, edge cases, security, concurrency, and resource issues.`, `You are luna_reviewer, a fresh-context line-level code reviewer running on ${luna}. Cite real file:line locations and report severity-ranked findings with minimal fixes.`, [
36013
+ ], "xhigh"));
36014
+ else if (sonnet) result.push(maxPersona("sonnet-reviewer", "sonnet_reviewer", sonnet, "/v1/messages", {
36015
+ kind: "line-level reviewer",
36016
+ lens: "correctness, edge cases, security, concurrency, and resource handling",
36017
+ useWhen: "a concrete code excerpt or diff needs a focused implementation review",
36018
+ notFor: "open architecture decisions, repository exploration, or executing tests"
36019
+ }, [
36285
36020
  "low",
36286
36021
  "medium",
36287
36022
  "high",
36288
36023
  "xhigh"
36289
- ], "high")];
36290
- if (opus) result.push(maxPersona("opus-critic", "opus_critic", opus, "/v1/messages", `Max-profile same-lab critic backed by ${opus} (Anthropic). Provides a fresh-context sanity check for plans, designs, and code tradeoffs.`, `You are opus_critic, a fresh-context adversarial reviewer running on ${opus}. Find cognitive momentum and unsupported assumptions in the supplied artifact; silence on sound work is valid.`, [
36024
+ ], "xhigh"));
36025
+ if (opus) result.push(maxPersona("opus-critic", "opus_critic", opus, "/v1/messages", {
36026
+ kind: "strategic critic",
36027
+ lens: "coherence, requirement drift, overcomplication, and cognitive momentum",
36028
+ useWhen: "a self-contained design or decision needs a fresh Anthropic-family sanity check",
36029
+ notFor: "independent repository verification or line-level defect discovery"
36030
+ }, [
36291
36031
  "low",
36292
36032
  "medium",
36293
36033
  "high"
36294
36034
  ], "high"));
36295
- if (gemini) result.push(maxPersona("gemini-critic", "gemini_critic", gemini, "/v1/chat/completions", `Max-profile third-lab strategic critic backed by ${gemini} (Google). Reviews plans, invariants, proofs, and formal tradeoffs.`, `You are gemini_critic, a fresh-context strategic critic running on ${gemini}. Review the artifact against its constraints and report only concrete invariant or assumption failures.`, [
36035
+ if (gemini) result.push(maxPersona("gemini-critic", "gemini_critic", gemini, "/v1/chat/completions", {
36036
+ kind: "strategic critic",
36037
+ lens: "invariants, formal consistency, proofs, and constraint violations",
36038
+ useWhen: "a self-contained plan or argument depends on subtle logical invariants",
36039
+ notFor: "line-level implementation review, repository exploration, or executing tests"
36040
+ }, [
36296
36041
  "low",
36297
36042
  "medium",
36298
36043
  "high"
36299
- ], "high"), maxPersona("gemini-reviewer", "gemini_reviewer", gemini, "/v1/chat/completions", `Max-profile line-level reviewer backed by ${gemini} (Google). Provides an independent second-lab review of concrete code.`, `You are gemini_reviewer, a fresh-context line-level code reviewer running on ${gemini}. Cite real file:line locations and report severity-ranked findings.`, [
36044
+ ], "high"), maxPersona("gemini-reviewer", "gemini_reviewer", gemini, "/v1/chat/completions", {
36045
+ kind: "line-level reviewer",
36046
+ lens: "boundary conditions, state transitions, and concrete implementation defects",
36047
+ useWhen: "a supplied code excerpt or diff needs an independent Google-family review",
36048
+ notFor: "architecture ideation, repository exploration, or executing tests"
36049
+ }, [
36300
36050
  "low",
36301
36051
  "medium",
36302
36052
  "high"
36303
36053
  ], "high"));
36304
- if (grok) result.push(maxPersona("grok-critic", "grok_critic", grok, "/v1/responses", `Max-profile strategic critic backed by ${grok} (xAI). Challenges plans, designs, and decisions with a fresh context.`, `You are grok_critic, a fresh-context strategic critic running on ${grok}. Challenge the supplied artifact against its constraints and report concrete findings only.`, [
36054
+ if (grok) result.push(maxPersona("grok-critic", "grok_critic", grok, "/v1/responses", {
36055
+ kind: "strategic critic",
36056
+ lens: "operational counterexamples, hidden assumptions, and alternate strategies",
36057
+ useWhen: "a self-contained plan or decision needs a distinct xAI-family challenge",
36058
+ notFor: "line-level implementation review, repository exploration, or executing tests"
36059
+ }, [
36305
36060
  "low",
36306
36061
  "medium",
36307
36062
  "high"
36308
- ], "medium"), maxPersona("grok-reviewer", "grok_reviewer", grok, "/v1/responses", `Max-profile line-level reviewer backed by ${grok} (xAI). Reviews concrete code and diffs at medium effort.`, `You are grok_reviewer, a fresh-context line-level code reviewer running on ${grok}. Cite real file:line locations and report severity-ranked findings.`, [
36063
+ ], "medium"), maxPersona("grok-reviewer", "grok_reviewer", grok, "/v1/responses", {
36064
+ kind: "line-level reviewer",
36065
+ lens: "runtime behavior, concurrency, resources, and operational edge cases",
36066
+ useWhen: "a supplied code excerpt or diff needs an xAI-family implementation review",
36067
+ notFor: "open design work, repository exploration, or executing tests"
36068
+ }, [
36309
36069
  "low",
36310
36070
  "medium",
36311
36071
  "high"
@@ -37492,6 +37252,6 @@ function enumerateInjectedMcpToolNames(groupKeys, opts = {}) {
37492
37252
  return [...new Set(names)];
37493
37253
  }
37494
37254
  //#endregion
37495
- export { UNKNOWN_EFFORT_ANCHOR as $, warmTreeSitterPool as $t, TOOLBELT_TOOLS$1 as A, MAX_LUNA_HIGH_ALIAS_ID as An, countTokens as At, resolveAdvisorEffort as B, resolveModelAlias as Bn, resolveMcpToolTimeoutMs as Bt, runWorkerAgent as C, withOneMSuffix as Cn, reviewerFastModel as Ct, toolbeltEnabled as D, LUNA_REAL_MODEL_ID as Dn, standInToolEnabled as Dt, buildToolbeltAwareness as E, LUNA_HAIKU_ALIAS_ID as En, scribeModel as Et, ADVISOR_TOOL_INSTRUCTIONS as F, isRetiredFastModelAlias as Fn, findLaunchBySecret as Ft, repairRejectedThinkingHistory as G, parseJsonOrDiagnose as Gt, formatThinkingRepairDecline as H, validateMaxProfileLaunch as Hn, createChatCompletions as Ht, FAST_ADVISOR_TOOL_INSTRUCTIONS as I, maxAliasEffort as In, registerLaunch as It, isControllerClosedError as J, hasSupportedBrowserInstalled as Jt, buildAnthropicErrorEvent as K, normalizeOpenAIUsage as Kt, buildAdvisorStream as L, maxAliasModel as Ln, unregisterLaunch as Lt, satisfiesMinVersion as M, canonicalizeAliasModel as Mn, getTextTokenCount as Mt, searchWeb as N, formatFastPrerequisiteFailure as Nn, getTokenCount as Nt, toolbeltSkipSet as O, LUNA_SCOUT_ALIAS_ID as On, workerToolsEnabled as Ot, ADVISOR_INTERNAL_TOOL_NAME as P, isMaxModelAlias as Pn, getTokenizerFromModel as Pt, EFFORT_ORDER as Q, extractZipMember as Qt, injectAdvisorTool as R, profileDescriptor as Rn, assembleResponsesPayload as Rt, resolveWorkerRunOpts as S, oneMContextDisabled as Sn, resolveGeminiReviewModel as St, availableToolCommands as T, LUNA_DRIVER_ALIAS_ID as Tn, scoutModel as Tt, rememberThinkingHistoryRepair as U, withInstallLock as Un, MAX_RESPONSE_BODY_BYTES as Ut, resolveAdvisorModel as V, validateFastProfilePrerequisites as Vn, createResponses as Vt, repairKnownThinkingHistory as W, readResponseBodyCapped as Wt, readIteratorWithTimeout as X, provisionAndIndexColbert as Xt, logStreamError as Y, colbertDegradedWarning as Yt, relayAnthropicStream as Z, extractTarGzMember as Zt, REVIEW_DEFAULT_MODEL as _, resolveLeadSlugArg as _n, fleetToolsEnabled as _t, buildAgentPrompt as a, toolbeltPathOverride as an, artifactToolsEnabled as at, resolveDefaultModel as b, classifyMessagesRoute as bn, implementerFastModel as bt, enumerateInjectedMcpToolNames as c, DEFAULT_CLAUDE_MODEL_FALLBACKS as cn, browserCompoundToolsEnabled as ct, BROWSE_DEFAULT_MODEL as d, DEFAULT_PORT as dn, fastGeneralPurposeModel as dt, provisionTreeSitterAssets as en, bucketEffort as et, DEFAULT_MODEL_CHAIN as f, UPSTREAM_FETCH_TIMEOUT_MS as fn, fastImplementerModel as ft, PLAN_DEFAULT_MODEL as g, pickClaudeDefault as gn, fastScoutModel as gt, IMPLEMENT_DEFAULT_MODEL as h, isBudgetClaudeLead as hn, fastReviewerModel as ht, assertMcpToolSurfaceConsistent as i, collapsePathKeys as in, agentToolsEnabled as it, assetFor as j, MAX_LUNA_MAX_ALIAS_ID as jn, createMessages as jt, vscodeRipgrepPath as k, LUNA_SONNET_ALIAS_ID as kn, shimDefaultsToXhigh as kt, maxPersonasFor as l, DEFAULT_CODEX_MODEL as ln, browserToolsEnabled as lt, EXPLORE_DEFAULT_THINKING as m, generateRandomPort as mn, fastPlanModel as mt, MCP_GROUPS as n, DEFINITION_OF_GREATNESS as nn, handleMcpDelete as nt, buildPeerAwarenessSnippet as o, BUDGET_SMALL_FAST_CATALOG_ID as on, brainstormModel as ot, EXPLORE_DEFAULT_MODEL as p, UPSTREAM_INACTIVITY_TIMEOUT_MS as pn, fastOracleModel as pt, buildOpenAIErrorEvent as q, provisionBrowserAssets as qt, agentNamesForToolAllowlist as r, shouldUseInsecureTls as rn, handleMcpPost as rt, buildPeerAwarenessSummary as s, BUDGET_SMALL_FAST_SLUG as sn, browseAgentEnabled as st, GROUP_META as t, CONDENSED_OPERATING_SEQUENCE as tn, clampEffort as tt, personasFor as u, DEFAULT_CODEX_MODEL_FALLBACKS as un, fastAdvisorModel as ut, TEST_DEFAULT_MODEL as v, upstreamAllowH2 as vn, geminiAvailable as vt, buildEnv as w, withOneMSuffixForLead as wn, reviewerModel as wt, resolveModeDefaults as x, catalogAdvertises1M as xn, nativeSubagentModel as xt, appendPlanReminder as y, upstreamMaxConnections as yn, generalPurposeFastModel as yt, isAdvisorRequested as z, resolveLaunchProfile as zn, warnOnTokenPriceDrift as zt };
37255
+ export { UNKNOWN_EFFORT_ANCHOR as $, warmTreeSitterPool as $t, TOOLBELT_TOOLS$1 as A, countTokens as At, resolveAdvisorEffort as B, resolveMcpToolTimeoutMs as Bt, runWorkerAgent as C, withOneMSuffix as Cn, reviewerFastModel as Ct, toolbeltEnabled as D, standInToolEnabled as Dt, buildToolbeltAwareness as E, scribeModel as Et, ADVISOR_TOOL_INSTRUCTIONS as F, findLaunchBySecret as Ft, repairRejectedThinkingHistory as G, parseJsonOrDiagnose as Gt, formatThinkingRepairDecline as H, createChatCompletions as Ht, FAST_ADVISOR_TOOL_INSTRUCTIONS as I, registerLaunch as It, isControllerClosedError as J, hasSupportedBrowserInstalled as Jt, buildAnthropicErrorEvent as K, normalizeOpenAIUsage as Kt, buildAdvisorStream as L, unregisterLaunch as Lt, satisfiesMinVersion as M, getTextTokenCount as Mt, searchWeb as N, getTokenCount as Nt, toolbeltSkipSet as O, workerToolsEnabled as Ot, ADVISOR_INTERNAL_TOOL_NAME as P, getTokenizerFromModel as Pt, EFFORT_ORDER as Q, extractZipMember as Qt, injectAdvisorTool as R, assembleResponsesPayload as Rt, resolveWorkerRunOpts as S, oneMContextDisabled as Sn, resolveGeminiReviewModel as St, availableToolCommands as T, withInstallLock as Tn, scoutModel as Tt, rememberThinkingHistoryRepair as U, MAX_RESPONSE_BODY_BYTES as Ut, resolveAdvisorModel as V, createResponses as Vt, repairKnownThinkingHistory as W, readResponseBodyCapped as Wt, readIteratorWithTimeout as X, provisionAndIndexColbert as Xt, logStreamError as Y, colbertDegradedWarning as Yt, relayAnthropicStream as Z, extractTarGzMember as Zt, REVIEW_DEFAULT_MODEL as _, resolveLeadSlugArg as _n, fleetToolsEnabled as _t, buildAgentPrompt as a, toolbeltPathOverride as an, artifactToolsEnabled as at, resolveDefaultModel as b, classifyMessagesRoute as bn, implementerFastModel as bt, enumerateInjectedMcpToolNames as c, DEFAULT_CLAUDE_MODEL_FALLBACKS as cn, browserCompoundToolsEnabled as ct, BROWSE_DEFAULT_MODEL as d, DEFAULT_PORT as dn, fastGeneralPurposeModel as dt, provisionTreeSitterAssets as en, bucketEffort as et, DEFAULT_MODEL_CHAIN as f, UPSTREAM_FETCH_TIMEOUT_MS as fn, fastImplementerModel as ft, PLAN_DEFAULT_MODEL as g, pickClaudeDefault as gn, fastScoutModel as gt, IMPLEMENT_DEFAULT_MODEL as h, isBudgetClaudeLead as hn, fastReviewerModel as ht, assertMcpToolSurfaceConsistent as i, collapsePathKeys as in, agentToolsEnabled as it, assetFor as j, createMessages as jt, vscodeRipgrepPath as k, shimDefaultsToXhigh as kt, maxPersonasFor as l, DEFAULT_CODEX_MODEL as ln, browserToolsEnabled as lt, EXPLORE_DEFAULT_THINKING as m, generateRandomPort as mn, fastPlanModel as mt, MCP_GROUPS as n, DEFINITION_OF_GREATNESS as nn, handleMcpDelete as nt, buildPeerAwarenessSnippet as o, BUDGET_SMALL_FAST_CATALOG_ID as on, brainstormModel as ot, EXPLORE_DEFAULT_MODEL as p, UPSTREAM_INACTIVITY_TIMEOUT_MS as pn, fastOracleModel as pt, buildOpenAIErrorEvent as q, provisionBrowserAssets as qt, agentNamesForToolAllowlist as r, shouldUseInsecureTls as rn, handleMcpPost as rt, buildPeerAwarenessSummary as s, BUDGET_SMALL_FAST_SLUG as sn, browseAgentEnabled as st, GROUP_META as t, CONDENSED_OPERATING_SEQUENCE as tn, clampEffort as tt, personasFor as u, DEFAULT_CODEX_MODEL_FALLBACKS as un, fastAdvisorModel as ut, TEST_DEFAULT_MODEL as v, upstreamAllowH2 as vn, geminiAvailable as vt, buildEnv as w, withOneMSuffixForLead as wn, reviewerModel as wt, resolveModeDefaults as x, catalogAdvertises1M as xn, nativeSubagentModel as xt, appendPlanReminder as y, upstreamMaxConnections as yn, generalPurposeFastModel as yt, isAdvisorRequested as z, warnOnTokenPriceDrift as zt };
37496
37256
 
37497
- //# sourceMappingURL=peer-mcp-personas-C9fDtu69.js.map
37257
+ //# sourceMappingURL=peer-mcp-personas-DAd076hn.js.map