github-router 0.3.353 → 0.3.355

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 (72) hide show
  1. package/dist/ado-tools-B5TCtnlQ.js +1 -0
  2. package/dist/{aic-statusline-settings-LnoxjBPe.js → aic-statusline-settings-EdsV1gzY.js} +6 -4
  3. package/dist/aic-statusline-settings-EdsV1gzY.js.map +1 -0
  4. package/dist/{attribution-settings-7cbLvuiE.js → attribution-settings-N48QlHu2.js} +51 -39
  5. package/dist/{attribution-settings-7cbLvuiE.js.map → attribution-settings-N48QlHu2.js.map} +1 -1
  6. package/dist/balanced-profile-contract-DtnTIBjL.js +105 -0
  7. package/dist/balanced-profile-contract-DtnTIBjL.js.map +1 -0
  8. package/dist/browser-ext/manifest.json +1 -1
  9. package/dist/{claude-CugVz_lo.js → claude-BAKFTVqA.js} +68 -59
  10. package/dist/claude-BAKFTVqA.js.map +1 -0
  11. package/dist/{claude-md-injection-BoXOsg7h.js → claude-md-injection-CDOoGNEJ.js} +20 -15
  12. package/dist/claude-md-injection-CDOoGNEJ.js.map +1 -0
  13. package/dist/{codex-pfFa6vPh.js → codex-CspHNGZA.js} +5 -5
  14. package/dist/{codex-pfFa6vPh.js.map → codex-CspHNGZA.js.map} +1 -1
  15. package/dist/{copilot-discount-C3jfysK-.js → copilot-discount-kpOLluHm.js} +3 -1
  16. package/dist/copilot-discount-kpOLluHm.js.map +1 -0
  17. package/dist/engine-YvnWaTnR.js +1 -0
  18. package/dist/fast-profile-contract-JOnZBgFB.js +61 -0
  19. package/dist/fast-profile-contract-JOnZBgFB.js.map +1 -0
  20. package/dist/{gate-discovery-Cvdko01z.js → gate-discovery-JeKibE14.js} +2 -2
  21. package/dist/{gate-discovery-Cvdko01z.js.map → gate-discovery-JeKibE14.js.map} +1 -1
  22. package/dist/hooks.mjs +193 -12
  23. package/dist/hooks.sha256 +1 -1
  24. package/dist/{internal-aic-status-Dmi2bCsR.js → internal-aic-status-wYPsCG4r.js} +2 -2
  25. package/dist/{internal-aic-status-Dmi2bCsR.js.map → internal-aic-status-wYPsCG4r.js.map} +1 -1
  26. package/dist/{internal-fast-dispatch-guard-Cv7zf0ZI.js → internal-fast-dispatch-guard-A8teEib4.js} +1 -1
  27. package/dist/{internal-fast-dispatch-guard-BQm1MI9d.js → internal-fast-dispatch-guard-D_TCtJhQ.js} +3 -2
  28. package/dist/{internal-fast-dispatch-guard-BQm1MI9d.js.map → internal-fast-dispatch-guard-D_TCtJhQ.js.map} +1 -1
  29. package/dist/{internal-max-dispatch-guard-T-M7DRIW.js → internal-max-dispatch-guard-BM_B15EH.js} +1 -1
  30. package/dist/{internal-max-dispatch-guard-DkJixDmG.js → internal-max-dispatch-guard-D7ByWH4v.js} +2 -2
  31. package/dist/{internal-max-dispatch-guard-DkJixDmG.js.map → internal-max-dispatch-guard-D7ByWH4v.js.map} +1 -1
  32. package/dist/{internal-prompt-submit-B9MJxc3K.js → internal-prompt-submit-C77GnEaW.js} +3 -3
  33. package/dist/internal-prompt-submit-C77GnEaW.js.map +1 -0
  34. package/dist/{internal-prompt-submit-6OXEdQCK.js → internal-prompt-submit-CDTwamkW.js} +2 -2
  35. package/dist/{internal-rebrief-zIdunX3R.js → internal-rebrief-DZygfGHp.js} +6 -6
  36. package/dist/internal-rebrief-DZygfGHp.js.map +1 -0
  37. package/dist/{internal-stop-hook-DGcRVh_2.js → internal-stop-hook-Dz6mdfcL.js} +2 -2
  38. package/dist/{internal-stop-hook-DGcRVh_2.js.map → internal-stop-hook-Dz6mdfcL.js.map} +1 -1
  39. package/dist/main.js +11 -11
  40. package/dist/{max-profile-contract-DQDEDCsR.js → max-profile-contract-CMvzKSsg.js} +2 -2
  41. package/dist/max-profile-contract-CMvzKSsg.js.map +1 -0
  42. package/dist/{peer-mcp-personas-DDMKRFFG.js → peer-mcp-personas-Ch4VWo40.js} +165 -185
  43. package/dist/peer-mcp-personas-Ch4VWo40.js.map +1 -0
  44. package/dist/{pi-BNpaiwEF.js → pi-Cwj383nc.js} +61 -62
  45. package/dist/pi-Cwj383nc.js.map +1 -0
  46. package/dist/{provision-BtYRtvrj.js → provision-PodfFQu-.js} +2 -2
  47. package/dist/{provision-BtYRtvrj.js.map → provision-PodfFQu-.js.map} +1 -1
  48. package/dist/{serve-BQ0spYrs.js → serve-D-OuW7kz.js} +7 -7
  49. package/dist/{serve-BQ0spYrs.js.map → serve-D-OuW7kz.js.map} +1 -1
  50. package/dist/{server-setup-COrhtCdv.js → server-setup-DDZxJgl0.js} +197 -133
  51. package/dist/server-setup-DDZxJgl0.js.map +1 -0
  52. package/dist/{start-Dd7O3bB9.js → start-CZZ0cTV9.js} +3 -3
  53. package/dist/{start-Dd7O3bB9.js.map → start-CZZ0cTV9.js.map} +1 -1
  54. package/dist/{static-context-pack-CyucviRD.js → static-context-pack-BRqt4ajJ.js} +313 -6
  55. package/dist/static-context-pack-BRqt4ajJ.js.map +1 -0
  56. package/docs/azure-mcp.md +28 -24
  57. package/package.json +1 -1
  58. package/dist/ado-tools-xbuVU7YN.js +0 -1
  59. package/dist/aic-statusline-settings-LnoxjBPe.js.map +0 -1
  60. package/dist/balanced-profile-contract-XiIj4O1U.js +0 -127
  61. package/dist/balanced-profile-contract-XiIj4O1U.js.map +0 -1
  62. package/dist/claude-CugVz_lo.js.map +0 -1
  63. package/dist/claude-md-injection-BoXOsg7h.js.map +0 -1
  64. package/dist/copilot-discount-C3jfysK-.js.map +0 -1
  65. package/dist/engine-DwLIk1Zn.js +0 -1
  66. package/dist/internal-prompt-submit-B9MJxc3K.js.map +0 -1
  67. package/dist/internal-rebrief-zIdunX3R.js.map +0 -1
  68. package/dist/max-profile-contract-DQDEDCsR.js.map +0 -1
  69. package/dist/peer-mcp-personas-DDMKRFFG.js.map +0 -1
  70. package/dist/pi-BNpaiwEF.js.map +0 -1
  71. package/dist/server-setup-COrhtCdv.js.map +0 -1
  72. package/dist/static-context-pack-CyucviRD.js.map +0 -1
@@ -6,12 +6,13 @@ import { t as state } from "./state-CfEVoqBM.js";
6
6
  import { C as githubAgentGraphQLHeaders, S as copilotVersion, b as copilotBaseUrl, d as resolveModel, f as sleep$2, g as HTTPError, h as isAllowedCopilotHost, i as tryRefreshAndRetry, v as GITHUB_API_BASE_URL, w as githubAgentHeaders, x as copilotHeaders, y as GITHUB_GRAPHQL_URL } from "./token-CTf5jCmP.js";
7
7
  import { a as withTransientRetry, i as sanitizeTransportText, n as classifyTransportError, r as fetchWithTransientRetry } from "./upstream-retry-i1k1Xai2.js";
8
8
  import { a as parseBoolEnv, d as runManagedExeCapture, o as parseIntEnv, s as resolveExecutable } from "./exec-Bf8g_bIR.js";
9
- import { S as FAST_PROFILE_ORACLE_MODEL, _ as FAST_PROFILE_MODELS, a as BALANCED_PROFILE_NATIVE_EFFORTS, b as FAST_PROFILE_NATIVE_MODELS, c as BALANCED_PROFILE_ORACLE_MODEL, d as FAST_PROFILE_ADVISOR_EFFORT, f as FAST_PROFILE_ADVISOR_MODEL, m as FAST_PROFILE_ASTRA_MODEL, r as BALANCED_PROFILE_MODELS, x as FAST_PROFILE_ORACLE_EFFORT, y as FAST_PROFILE_NATIVE_EFFORTS } from "./balanced-profile-contract-XiIj4O1U.js";
10
- 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-DQDEDCsR.js";
9
+ import { a as FAST_PROFILE_ASTRA_MODEL, c as FAST_PROFILE_MODELS, d as FAST_PROFILE_NATIVE_MODELS, f as FAST_PROFILE_ORACLE_EFFORT, n as FAST_PROFILE_ADVISOR_EFFORT, p as FAST_PROFILE_ORACLE_MODEL, r as FAST_PROFILE_ADVISOR_MODEL, u as FAST_PROFILE_NATIVE_EFFORTS } from "./fast-profile-contract-JOnZBgFB.js";
10
+ import { C as CHEAPEST_PROFILE_ADVISOR_MODEL, D as CHEAPEST_PROFILE_MODELS, E as CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MIN, T as CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MAX, _ as isBalancedFamily, b as CHEAPEST2_PROFILE_MODELS, d as isCheapestRewriteEligible, f as runCheapestRewrite, g as displayModelName, h as cheapestRewriteModelFor, m as cheapestContractFor, p as balancedContractFor, s as isNonTrivialPrompt, t as buildStaticPack, u as isCheapestRewriteDisabledEnv, v as isCheapestFamily, w as CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_DEFAULT, x as BALANCED2_PROFILE_MODELS, y as isPinnedLaunchProfile } from "./static-context-pack-BRqt4ajJ.js";
11
+ import { r as BALANCED_PROFILE_MODELS } from "./balanced-profile-contract-DtnTIBjL.js";
12
+ 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-CMvzKSsg.js";
11
13
  import { i as registerExitHandlers$1, n as getInstanceUuid, r as recordWorkerRepo, t as WorktreeRegistry } from "./lifecycle-aApO0hZW.js";
12
14
  import { t as MCP_WORKSPACE_HEADER } from "./mcp-workspace-header-DBQugQlQ.js";
13
15
  import { n as ArtifactError, r as applyInsecureTls, t as ArtifactClient } from "./client-CQMfroGV.js";
14
- import { d as isCheapestRewriteDisabledEnv, f as isCheapestRewriteEligible, p as runCheapestRewrite, s as isNonTrivialPrompt, t as buildStaticPack } from "./static-context-pack-CyucviRD.js";
15
16
  import { f as stopReviewStateDir, o as fileRewriteFlagStore } from "./stop-gate-policy-FGAfpfc-.js";
16
17
  import { _ as isRecord$3, b as sleep$3, g as RemoteMcpError, h as RemoteMcpClient, l as ensureBluebirdClient, m as describeAzFailure, o as BluebirdError, p as AzCliAccessTokenCache, v as parseRetryAfter, y as sanitizeRemoteDetail } from "./bluebird-client-ltPIiyJU.js";
17
18
  import { r as registerColbertExitHandlers } from "./lifecycle-BJ83L0tz.js";
@@ -121,92 +122,6 @@ Object.freeze({
121
122
  reviewer: Object.freeze([])
122
123
  });
123
124
  //#endregion
124
- //#region src/lib/cheapest-profile-contract.ts
125
- /**
126
- * Fixed identities for the literal `github-router claude -m cheapest` profile.
127
- *
128
- * The cheapest all-200K tier: a `gpt-6-luna`/max LEAD at Claude Code's
129
- * DEFAULT (bare-slug) 200K window, every subagent at the same 200K default,
130
- * a `gpt-5.6-sol`/medium Advisor (bare slug), and a `gpt-5.6-sol`/high
131
- * primary Oracle. Oracle-only peer set (no `astra`) and a three-agent
132
- * surface (`Explore`/`General-Purpose`/`reviewer` — no `Plan`): the lead
133
- * plans directly and reviews the final plan with the Advisor (advisory)
134
- * before presenting it.
135
- *
136
- * "max" on the lead is enforced at two layers: the launcher seeds
137
- * `CLAUDE_CODE_EFFORT_LEVEL=max` (so the client stamps max instead of its
138
- * `high` default on lead requests) and the request preprocessor defaults
139
- * bare-Luna lead traffic to max when no explicit effort is present.
140
- *
141
- * The "200K window" here is enforced client-side by the launcher-seeded
142
- * `CLAUDE_CODE_DISABLE_1M_CONTEXT=1` (see `getClaudeCodeEnvVars`), not by
143
- * the bare slugs alone: every row maps via `behavesAs` onto a known Claude
144
- * model whose client-side profile is native-1M.
145
- *
146
- * This module is deliberately dependency-free, including its own delegation
147
- * graph literal: each pinned profile owns its graph so tuning one roster
148
- * cannot silently retune another.
149
- */
150
- const CHEAPEST_PROFILE_MODELS = Object.freeze({
151
- lead: "gpt-6-luna",
152
- explore: "gpt-6-luna",
153
- "General-Purpose": "gpt-6-luna",
154
- reviewer: "gpt-6-luna",
155
- advisor: "gpt-5.6-sol",
156
- oracle: "gpt-5.6-sol"
157
- });
158
- const CHEAPEST_PROFILE_NATIVE_AGENT_NAMES = [
159
- "Explore",
160
- "General-Purpose",
161
- "reviewer"
162
- ];
163
- const CHEAPEST_PROFILE_NATIVE_MODELS = Object.freeze({
164
- Explore: CHEAPEST_PROFILE_MODELS.explore,
165
- "General-Purpose": CHEAPEST_PROFILE_MODELS["General-Purpose"],
166
- reviewer: CHEAPEST_PROFILE_MODELS.reviewer
167
- });
168
- const CHEAPEST_PROFILE_NATIVE_EFFORTS = Object.freeze({
169
- Explore: "high",
170
- "General-Purpose": "max",
171
- reviewer: "max"
172
- });
173
- /**
174
- * Subagent/peer context window (tokens). Every non-lead role (and the lead
175
- * as well) runs at Claude Code's DEFAULT (bare-slug) budget — 200K.
176
- */
177
- const CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS = 2e5;
178
- const CHEAPEST_PROFILE_ADVISOR_MODEL = CHEAPEST_PROFILE_MODELS.advisor;
179
- /**
180
- * Client-visible Advisor identity for cheapest mode. The BARE Sol slug
181
- * (no `[1m]` bracket): Claude Code budgets the Advisor tool as a 200K-model
182
- * and forwards no more than ~200K of the lead's transcript, and the proxy
183
- * mirrors that with `CHEAPEST_PROFILE_ADVISOR_CONTEXT_TOKENS`.
184
- */
185
- const CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL = CHEAPEST_PROFILE_MODELS.advisor;
186
- /**
187
- * Curated-transcript token budget for the cheapest Advisor (the protégé
188
- * consult). Unlike every other advisor profile, the cheapest lead CURATES the
189
- * window: the proxy renders a small, tool-aware transcript and the lead's
190
- * pre-call brief (`<caller_context>`) leads, so the advisor reads signal
191
- * rather than a 200K dump of raw tool output.
192
- *
193
- * This is deliberately much smaller than the 200K client budget: the point is
194
- * to bound advisor read cost and focus attention, not to maximize context.
195
- * Default 24K, clamped to [16K, 32K], overridable via
196
- * `GH_ROUTER_ADVISOR_TRANSCRIPT_TOKENS` (see `resolveCheapestAdvisorTranscriptTokens`).
197
- */
198
- const CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_DEFAULT = 24e3;
199
- const CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MIN = 16e3;
200
- const CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MAX = 32e3;
201
- const CHEAPEST_PROFILE_ADVISOR_EFFORT = "medium";
202
- const CHEAPEST_PROFILE_ORACLE_MODEL = CHEAPEST_PROFILE_MODELS.oracle;
203
- const CHEAPEST_PROFILE_ORACLE_EFFORT = "high";
204
- Object.freeze({
205
- Explore: Object.freeze([]),
206
- "General-Purpose": Object.freeze(["reviewer"]),
207
- reviewer: Object.freeze([])
208
- });
209
- //#endregion
210
125
  //#region src/lib/one-m-context.ts
211
126
  /**
212
127
  * Context-window threshold at which Claude Code's `[1m]` accounting unlock is
@@ -588,6 +503,16 @@ const CHEAPEST_LEAD_MODEL = CHEAPEST_PROFILE_MODELS.lead;
588
503
  * included, at the default budget.
589
504
  */
590
505
  const BALANCED_LEAD_MODEL = BALANCED_PROFILE_MODELS.lead;
506
+ /**
507
+ * The lead `-m cheapest2` / `-m balanced2` select. Both are family siblings,
508
+ * so the lead is inherited unchanged from the base contract (Luna for
509
+ * `cheapest2`, which itself swaps only the Sol identities; Sol for
510
+ * `balanced2`, whose lead IS the 6.1 upgrade). Kept as named exports so the
511
+ * resolver below reads one binding per alias and a future lead change only
512
+ * edits the contract.
513
+ */
514
+ const CHEAPEST2_LEAD_MODEL = CHEAPEST2_PROFILE_MODELS.lead;
515
+ const BALANCED2_LEAD_MODEL = BALANCED2_PROFILE_MODELS.lead;
591
516
  /** Small/fast tier for a budget lead, in the two forms this codebase needs.
592
517
  *
593
518
  * `SLUG` is the Anthropic-published DASHED form and is what goes into
@@ -613,15 +538,20 @@ const BUDGET_SMALL_FAST_CATALOG_ID = "claude-haiku-4.5";
613
538
  * - `balanced` → `BALANCED_LEAD_MODEL` BARE (the most-complex-tasks
614
539
  * launch: Sol leader at the 200K DEFAULT window, Grok
615
540
  * Oracle, no astra peer)
541
+ * - `cheapest2` → `CHEAPEST2_LEAD_MODEL` BARE (the `cheapest` sibling with
542
+ * the Sol Advisor/Oracle at `gpt-6.1-sol`; same Luna lead)
543
+ * - `balanced2` → `BALANCED2_LEAD_MODEL` BARE (the `balanced` sibling with
544
+ * the lead/reviewer at `gpt-6.1-sol` and the Grok-4.7 Oracle)
616
545
  * - `N.M` → the best variant of that Opus family, via `pickClaudeDefault`
617
546
  * - a full slug → unchanged, including Copilot slugs a power user pins
618
547
  * - absent → the ordinary default
619
548
  *
620
- * Every branch except `cheap`/`cheapest`/`balanced` is `[1m]`-decorated against the
621
- * live catalog, by `pickClaudeDefault` on the two Opus-family branches and
622
- * by `withOneMSuffixForLead` on the rest — the decoration is catalog-gated
623
- * per model, so a genuinely 200K model (`claude-haiku-4-5`) still comes back
624
- * bare. `cheap`/`cheapest`/`balanced` deliberately skip the decoration entirely because
549
+ * Every branch except the 200K aliases (`cheap`/`cheapest`/`cheapest2`/
550
+ * `balanced`/`balanced2`) is `[1m]`-decorated against the live catalog, by
551
+ * `pickClaudeDefault` on the two Opus-family branches and by
552
+ * `withOneMSuffixForLead` on the rest — the decoration is catalog-gated per
553
+ * model, so a genuinely 200K model (`claude-haiku-4-5`) still comes back
554
+ * bare. The pinned aliases deliberately skip the decoration entirely because
625
555
  * their whole cost lever is the 200K default lead window.
626
556
  *
627
557
  * `fast` resolves to an ordinary slug rather than setting a mode flag —
@@ -648,6 +578,8 @@ function resolveLeadSlugArg(modelArg) {
648
578
  if (arg.toLowerCase() === "cheap") return CHEAP_LEAD_MODEL;
649
579
  if (arg.toLowerCase() === "cheapest") return CHEAPEST_LEAD_MODEL;
650
580
  if (arg.toLowerCase() === "balanced") return BALANCED_LEAD_MODEL;
581
+ if (arg.toLowerCase() === "cheapest2") return CHEAPEST2_LEAD_MODEL;
582
+ if (arg.toLowerCase() === "balanced2") return BALANCED2_LEAD_MODEL;
651
583
  const opusFamilyShorthand = arg.match(/^(\d+\.\d+)$/)?.[1];
652
584
  if (opusFamilyShorthand) return pickClaudeDefault(opusFamilyShorthand);
653
585
  return withOneMSuffixForLead(arg);
@@ -1617,7 +1549,8 @@ async function searchText(query, mode, workspace, signal) {
1617
1549
  /**
1618
1550
  * Produce the cheapest-profile brief for one prompt.
1619
1551
  *
1620
- * `profile` is the launch profile id; only `"cheapest"` is eligible, matching
1552
+ * `profile` is the launch profile id; only the cheapest family
1553
+ * (`cheapest`/`cheapest2`) is eligible, matching
1621
1554
  * the Claude hook exactly (the launcher exports `GH_ROUTER_PROFILE` into the
1622
1555
  * hook process there, and the launch registry carries it here). The one-shot
1623
1556
  * flag is keyed on `sessionId` and marked on ATTEMPT, so a session that spends
@@ -13037,23 +12970,23 @@ function normalizeKustoClusterUri(cluster) {
13037
12970
  * than an option on it. The launch form stays permissive because an operator
13038
12971
  * may legitimately point `--kusto-cluster` at a reverse proxy in front of ADX,
13039
12972
  * and an options bag would let a future caller of the launch form omit the
13040
- * strictness by accident. Here the REQUEST HOST is chosen by a model, so the
13041
- * host must carry ADX's `.kusto.` service label, the shape every public cloud's
13042
- * ADX endpoint has and one that nothing else carries.
13043
- *
13044
- * **This is a shape guard, not an access boundary.** What a call can reach is
13045
- * bounded by AAD, which will not mint a token for a resource the identity
13046
- * cannot use, plus that identity's RBAC at the cluster. The label rule is here
13047
- * so a typo or a hallucinated host fails before a token mint and an outbound
13048
- * request, with the expectation named, instead of as an opaque connect error.
13049
- *
13050
- * The rule is `.kusto.` ANYWHERE but at the start of the host, which is what
13051
- * every public cloud's ADX host has: `*.kusto.windows.net`,
13052
- * `*.kusto.usgovcloudapi.net`, `*.kusto.chinacloudapi.cn`,
13053
- * `*.kusto.azuresynapse.net`, `*.kusto.fabric.microsoft.com`. A host that
13054
- * merely BEGINS with the word (`kusto.<domain>`) is not an ADX endpoint shape
13055
- * and stays rejected; the cost of a false rejection is one actionable message,
13056
- * while the cost of a widened rule is acceptance of hosts that are not ADX.
12973
+ * strictness by accident. For a per-call hostname, require an exact `kusto`
12974
+ * DNS label at the beginning or after a dot, followed by another DNS label.
12975
+ * The suffix is unrestricted.
12976
+ *
12977
+ * **This is only a hostname-shape check, not an ownership allowlist or access
12978
+ * boundary.** The selected origin is both the Azure token audience and the
12979
+ * request destination, so the selected host receives the bearer token. Callers
12980
+ * must choose a trusted host; do not rely on this check or Entra rejecting a
12981
+ * caller-selected host to protect the token. RBAC governs access to data at a
12982
+ * genuine Kusto service, but it does not prevent disclosure of the bearer to an
12983
+ * untrusted endpoint.
12984
+ *
12985
+ * The label check catches a missing or misspelled `kusto` DNS label, not
12986
+ * whether the host belongs to Azure Data Explorer. For example,
12987
+ * `kusto.example.com` and `cluster.kusto.example.com` pass the shape check,
12988
+ * while `notkusto.example.com` does not. The requirement is intentionally
12989
+ * narrow and easy to explain, not a proof that an endpoint is trustworthy.
13057
12990
  *
13058
12991
  * The refusal text avoids a literal `https://` example on purpose: every
13059
12992
  * `KustoError` message passes through `sanitizeRemoteDetail`, which rewrites a
@@ -13062,7 +12995,10 @@ function normalizeKustoClusterUri(cluster) {
13062
12995
  */
13063
12996
  function normalizeKustoCallClusterUri(cluster) {
13064
12997
  const origin = normalizeKustoClusterUri(cluster);
13065
- if (!/\.kusto\./i.test(new URL(origin).hostname)) throw new KustoError("`cluster` must name a Kusto endpoint, whose host carries a `kusto` label such as <name>.<region>.kusto.windows.net. Omit `cluster` to use the host set at launch with --kusto-cluster.", { retriable: false });
12998
+ const labels = new URL(origin).hostname.split(".");
12999
+ const hasKustoLabel = labels.some((label, index) => label.toLowerCase() === "kusto" && index < labels.length - 1);
13000
+ const isValidDnsLabel = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?$/;
13001
+ if (!hasKustoLabel || !labels.every((label) => isValidDnsLabel.test(label))) throw new KustoError("`cluster` hostname must contain a standalone `kusto` DNS label followed by another label (for example `kusto.example.com`). This is a shape check, not host-ownership verification; choose a trusted host because the bearer token is sent there. Omit `cluster` to use the host set at launch with --kusto-cluster.", { retriable: false });
13066
13002
  return origin;
13067
13003
  }
13068
13004
  /**
@@ -13532,7 +13468,7 @@ function resolveCluster(args) {
13532
13468
  return normalizeKustoCallClusterUri(value);
13533
13469
  }
13534
13470
  const launch = state.kustoCluster;
13535
- if (!launch) throw new KustoError("No Kusto cluster selected. Pass `cluster` (a host such as <name>.<region>.kusto.windows.net, or a full https URI), or launch with `--kusto-cluster <uri>`.", { retriable: false });
13471
+ if (!launch) throw new KustoError("No Kusto cluster selected. Pass `cluster` as an https URI whose hostname has a standalone `kusto` DNS label, or launch with `--kusto-cluster <uri>`. The bearer token is sent to the selected host, so choose a trusted host.", { retriable: false });
13536
13472
  return normalizeKustoClusterUri(launch);
13537
13473
  }
13538
13474
  function kustoClient(clusterUri) {
@@ -13581,7 +13517,7 @@ const DATABASE_PROPERTY = { database: {
13581
13517
  */
13582
13518
  const CLUSTER_PROPERTY = { cluster: {
13583
13519
  type: "string",
13584
- description: "Kusto cluster to query, e.g. https://example.kusto.windows.net. Defaults to the launch's --kusto-cluster, and is required when that was not set."
13520
+ description: "Kusto cluster to query. A caller-supplied hostname must contain a standalone `kusto` DNS label (at the start or after a dot; any suffix, e.g. https://cluster.kusto.example.com). This is only a shape check, not host-ownership verification. The Azure bearer token is sent to the selected host, so use only a trusted host. Defaults to the launch's --kusto-cluster, and is required when that was not set."
13585
13521
  } };
13586
13522
  const READ_ONLY_NOTE = " Read-only: the request runs under service-enforced read-only mode, so a mutating command is refused by Kusto rather than by this proxy.";
13587
13523
  const KUSTO_TOOLS = Object.freeze([
@@ -15760,6 +15696,15 @@ function currentInFlight() {
15760
15696
  const MIN_CACHEABLE_PREFIX_BYTES = 4096;
15761
15697
  const CACHE_KEY_NAMESPACE = "ghr-cache-v1";
15762
15698
  const CACHE_DIAGNOSTIC_LIMIT = 128;
15699
+ /**
15700
+ * Membership is an EVIDENCE claim, not a naming pattern: a model belongs here
15701
+ * only if a live probe shows Copilot needs an explicit breakpoint to cache its
15702
+ * prefix. `gpt-6.1-sol` is deliberately ABSENT — measured 2026-10-21 on a
15703
+ * 29,809-char reusable prefix, an unmarked repeat request already reported
15704
+ * `cached_tokens=5454/5457`, and adding the explicit fields changed that to
15705
+ * 5443. Copilot's provider-managed caching already covers it, and explicit
15706
+ * mode would only trade unmarked bytes out of the implicit cache.
15707
+ */
15763
15708
  const GPT56_EXPLICIT_CACHE_MODELS = /* @__PURE__ */ new Set([
15764
15709
  "gpt-6-sol",
15765
15710
  "gpt-5.6-sol",
@@ -20724,6 +20669,10 @@ const FALLBACK_TOKEN_PRICES = Object.freeze({
20724
20669
  in: 200,
20725
20670
  out: 1e3
20726
20671
  },
20672
+ "gpt-6.1-sol": {
20673
+ in: 200,
20674
+ out: 1e3
20675
+ },
20727
20676
  "gpt-5.6-sol": {
20728
20677
  in: 400,
20729
20678
  out: 2e3
@@ -20732,6 +20681,10 @@ const FALLBACK_TOKEN_PRICES = Object.freeze({
20732
20681
  in: 200,
20733
20682
  out: 600
20734
20683
  },
20684
+ "grok-4.7": {
20685
+ in: 200,
20686
+ out: 600
20687
+ },
20735
20688
  "gpt-5.5": {
20736
20689
  in: 500,
20737
20690
  out: 3e3
@@ -20834,8 +20787,10 @@ const INDICATIVE_TOKENS_PER_SECOND = Object.freeze({
20834
20787
  "claude-opus-5.5": 80,
20835
20788
  "claude-opus-5": 80,
20836
20789
  "gpt-6-sol": 75,
20790
+ "gpt-6.1-sol": 75,
20837
20791
  "gpt-5.6-sol": 75,
20838
20792
  "grok-4.5": 70,
20793
+ "grok-4.7": 70,
20839
20794
  "gpt-5.5": 65,
20840
20795
  "gemini-3.8-flash": 91,
20841
20796
  "gemini-3.6-flash": 45,
@@ -24382,38 +24337,43 @@ function cheapReviewerModel() {
24382
24337
  if (fastEndpointForModel(found) !== "responses") return void 0;
24383
24338
  return CHEAP_PROFILE_MODELS.reviewer;
24384
24339
  }
24385
- /** Sol/medium Advisor for the cheapest profile at the 200K default window. */
24386
- function cheapestAdvisorModel() {
24387
- const found = state.models?.data.find((m) => m.id === CHEAPEST_PROFILE_ADVISOR_MODEL);
24340
+ /** Sol Advisor for the cheapest family at the 200K default window. The
24341
+ * `profileId` selects the family contract: `cheapest` gates
24342
+ * `gpt-5.6-sol`/medium, `cheapest2` gates `gpt-6.1-sol`/high. */
24343
+ function cheapestAdvisorModel(profileId) {
24344
+ const contract = cheapestContractFor(profileId);
24345
+ const found = state.models?.data.find((m) => m.id === contract.advisorModel);
24388
24346
  if (!found) return void 0;
24389
- if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < 2e5) return void 0;
24347
+ if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < contract.subagentContextTokens) return void 0;
24390
24348
  if (found.capabilities?.supports?.tool_calls !== true) return void 0;
24391
24349
  const efforts = found.capabilities?.supports?.reasoning_effort;
24392
- if (!Array.isArray(efforts) || !efforts.includes("medium")) return void 0;
24350
+ if (!Array.isArray(efforts) || !efforts.includes(contract.advisorEffort)) return void 0;
24393
24351
  if (fastEndpointForModel(found) !== "responses") return void 0;
24394
- return CHEAPEST_PROFILE_ADVISOR_MODEL;
24352
+ return contract.advisorModel;
24395
24353
  }
24396
- /** Sol/high Oracle for the cheapest profile at the 200K default window. */
24397
- function cheapestOracleModel() {
24398
- const found = state.models?.data.find((m) => m.id === CHEAPEST_PROFILE_ORACLE_MODEL);
24354
+ /** Sol Oracle for the cheapest family at the 200K default window. */
24355
+ function cheapestOracleModel(profileId) {
24356
+ const contract = cheapestContractFor(profileId);
24357
+ const found = state.models?.data.find((m) => m.id === contract.oracleModel);
24399
24358
  if (!found) return void 0;
24400
- if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < 2e5) return void 0;
24359
+ if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < contract.subagentContextTokens) return void 0;
24401
24360
  if ((found.capabilities?.limits?.max_prompt_tokens ?? 0) <= 0) return void 0;
24402
24361
  const efforts = found.capabilities?.supports?.reasoning_effort;
24403
- if (!Array.isArray(efforts) || !efforts.includes("high")) return void 0;
24362
+ if (!Array.isArray(efforts) || !efforts.includes(contract.oracleEffort)) return void 0;
24404
24363
  if (fastEndpointForModel(found) !== "responses") return void 0;
24405
- return CHEAPEST_PROFILE_ORACLE_MODEL;
24364
+ return contract.oracleModel;
24406
24365
  }
24407
- /** Luna/max reviewer for the cheapest profile at the 200K default window. */
24408
- function cheapestReviewerModel() {
24409
- const reviewer = state.models?.data.find((m) => m.id === CHEAPEST_PROFILE_MODELS.reviewer);
24366
+ /** Luna/max reviewer for the cheapest family at the 200K default window. */
24367
+ function cheapestReviewerModel(profileId) {
24368
+ const contract = cheapestContractFor(profileId);
24369
+ const reviewer = state.models?.data.find((m) => m.id === contract.nativeModels.reviewer);
24410
24370
  if (!reviewer) return void 0;
24411
24371
  if (reviewer.capabilities?.supports?.tool_calls !== true) return void 0;
24412
- if ((reviewer.capabilities?.limits?.max_context_window_tokens ?? 0) < 2e5) return void 0;
24372
+ if ((reviewer.capabilities?.limits?.max_context_window_tokens ?? 0) < contract.subagentContextTokens) return void 0;
24413
24373
  const efforts = reviewer.capabilities?.supports?.reasoning_effort;
24414
- if (!Array.isArray(efforts) || !efforts.includes(CHEAPEST_PROFILE_NATIVE_EFFORTS.reviewer)) return void 0;
24374
+ if (!Array.isArray(efforts) || !efforts.includes(contract.nativeEfforts.reviewer)) return void 0;
24415
24375
  if (fastEndpointForModel(reviewer) !== "responses") return void 0;
24416
- return CHEAPEST_PROFILE_MODELS.reviewer;
24376
+ return contract.nativeModels.reviewer;
24417
24377
  }
24418
24378
  /** Exact GPT-6 Astra only: cheap escalation consultant at 200K/medium. */
24419
24379
  function cheapAstraModel() {
@@ -24428,27 +24388,30 @@ function cheapAstraModel() {
24428
24388
  if (fastEndpointForModel(found) !== "responses") return void 0;
24429
24389
  return CHEAP_PROFILE_ASTRA_MODEL;
24430
24390
  }
24431
- /** Exact Grok 4.6 only: the balanced Oracle at 200K/medium, like cheap. */
24432
- function balancedOracleModel() {
24433
- const found = state.models?.data.find((m) => m.id === BALANCED_PROFILE_ORACLE_MODEL);
24391
+ /** Exact Grok only: the balanced-family Oracle at 200K/medium, like cheap.
24392
+ * `balanced` gates `grok-4.6`, `balanced2` gates `grok-4.7`. */
24393
+ function balancedOracleModel(profileId) {
24394
+ const contract = balancedContractFor(profileId);
24395
+ const found = state.models?.data.find((m) => m.id === contract.oracleModel);
24434
24396
  if (!found) return void 0;
24435
- if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < 2e5) return void 0;
24397
+ if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < contract.subagentContextTokens) return void 0;
24436
24398
  if ((found.capabilities?.limits?.max_prompt_tokens ?? 0) <= 0) return void 0;
24437
24399
  const efforts = found.capabilities?.supports?.reasoning_effort;
24438
- if (!Array.isArray(efforts) || !efforts.includes("medium")) return void 0;
24400
+ if (!Array.isArray(efforts) || !efforts.includes(contract.oracleEffort)) return void 0;
24439
24401
  if (fastEndpointForModel(found) !== "responses") return void 0;
24440
- return BALANCED_PROFILE_ORACLE_MODEL;
24402
+ return contract.oracleModel;
24441
24403
  }
24442
- /** Sol/high reviewer for the balanced profile at the 200K default window. */
24443
- function balancedReviewerModel() {
24444
- const found = state.models?.data.find((m) => m.id === BALANCED_PROFILE_MODELS.reviewer);
24404
+ /** Sol reviewer for the balanced family at the 200K default window. */
24405
+ function balancedReviewerModel(profileId) {
24406
+ const contract = balancedContractFor(profileId);
24407
+ const found = state.models?.data.find((m) => m.id === contract.nativeModels.reviewer);
24445
24408
  if (!found) return void 0;
24446
24409
  if (found.capabilities?.supports?.tool_calls !== true) return void 0;
24447
- if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < 2e5) return void 0;
24410
+ if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < contract.subagentContextTokens) return void 0;
24448
24411
  const efforts = found.capabilities?.supports?.reasoning_effort;
24449
- if (!Array.isArray(efforts) || !efforts.includes(BALANCED_PROFILE_NATIVE_EFFORTS.reviewer)) return void 0;
24412
+ if (!Array.isArray(efforts) || !efforts.includes(contract.nativeEfforts.reviewer)) return void 0;
24450
24413
  if (fastEndpointForModel(found) !== "responses") return void 0;
24451
- return BALANCED_PROFILE_MODELS.reviewer;
24414
+ return contract.nativeModels.reviewer;
24452
24415
  }
24453
24416
  /**
24454
24417
  * Gate for the worker tools (`explore`, `review`, `implement`).
@@ -25201,6 +25164,18 @@ function activePersonas(launch) {
25201
25164
  };
25202
25165
  });
25203
25166
  }
25167
+ /** Oracle descriptor derived from the family contract, so a model swap in the
25168
+ * contract renames itself here instead of leaving stale prose behind. */
25169
+ function familyOracleDescriptor(profileId) {
25170
+ if (isCheapestFamily(profileId)) {
25171
+ const contract = cheapestContractFor(profileId);
25172
+ return `${displayModelName(contract.oracleModel)} (200K context, ${contract.oracleEffort} effort)`;
25173
+ }
25174
+ if (isBalancedFamily(profileId)) {
25175
+ const contract = balancedContractFor(profileId);
25176
+ return `${displayModelName(contract.oracleModel)} (200K context, ${contract.oracleEffort} effort)`;
25177
+ }
25178
+ }
25204
25179
  function oracleToolEntry(isCheap = false, astraAvailable = true, oracleDescriptor) {
25205
25180
  return {
25206
25181
  name: "oracle",
@@ -25324,7 +25299,7 @@ function fastToolIsEnabled(tool) {
25324
25299
  }
25325
25300
  /** Shared Fast projection for list and call, including non-persona dispatch kind. */
25326
25301
  function fastAllowsTool(scope, launch, item) {
25327
- if (launch.profileId !== "fast" && launch.profileId !== "cheap" && launch.profileId !== "cheap1m" && launch.profileId !== "cheapest" && launch.profileId !== "balanced") return true;
25302
+ if (!isPinnedLaunchProfile(launch.profileId)) return true;
25328
25303
  if (scope !== "all" && item.group !== scope) return false;
25329
25304
  if (!launch.allowedGroups?.has(item.group)) return false;
25330
25305
  if (item.persona) return false;
@@ -25379,14 +25354,14 @@ function toolEntries(scope, launch, audience = "shared") {
25379
25354
  });
25380
25355
  return [...personaEntries, ...nonPersonaEntries];
25381
25356
  }
25382
- if (launch.profileId === "fast" || launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest" || launch.profileId === "balanced") {
25383
- const isCheap = launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest" || launch.profileId === "balanced";
25384
- const isCheapest = launch.profileId === "cheapest";
25385
- const isBalanced = launch.profileId === "balanced";
25357
+ if (isPinnedLaunchProfile(launch.profileId)) {
25358
+ const isCheapest = isCheapestFamily(launch.profileId);
25359
+ const isBalanced = isBalancedFamily(launch.profileId);
25360
+ const isCheap = launch.profileId === "cheap" || launch.profileId === "cheap1m" || isCheapest || isBalanced;
25386
25361
  const astraWired = launch.profileId === "fast" || launch.profileId === "cheap1m";
25387
25362
  const astraAvailable = astraWired && (isCheap && !isCheapest ? cheapAstraModel() : isCheapest ? void 0 : fastAstraModel()) != null;
25388
- const oracleGate = isCheapest ? cheapestOracleModel() : isBalanced ? balancedOracleModel() : isCheap ? cheapOracleModel() : fastOracleModel();
25389
- const oracleDescriptor = isCheapest ? "GPT-6 Sol (200K context, high effort)" : void 0;
25363
+ const oracleGate = isCheapest ? cheapestOracleModel(launch.profileId) : isBalanced ? balancedOracleModel(launch.profileId) : isCheap ? cheapOracleModel() : fastOracleModel();
25364
+ const oracleDescriptor = familyOracleDescriptor(launch.profileId);
25390
25365
  const entries = [];
25391
25366
  if ((scope === "all" || scope === "peers") && launch.allowedGroups?.has("peers") && launch.allowedPersonas?.has("oracle") && oracleGate) entries.push(oracleToolEntry(isCheap, astraAvailable, oracleDescriptor));
25392
25367
  if ((scope === "all" || scope === "peers") && launch.allowedGroups?.has("peers") && launch.allowedPersonas?.has("astra") && audience === "lead-peers" && astraWired && (isCheap ? cheapAstraModel() : fastAstraModel())) entries.push(astraToolEntry(isCheap));
@@ -25829,7 +25804,7 @@ async function handleToolsCall(body, scope, launch, audience = "shared", session
25829
25804
  tool: maxTool
25830
25805
  }) : false)) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
25831
25806
  }
25832
- if ((launch.profileId === "fast" || launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest" || launch.profileId === "balanced") && name !== "oracle" && name !== "astra") {
25807
+ if (isPinnedLaunchProfile(launch.profileId) && name !== "oracle" && name !== "astra") {
25833
25808
  const fastPersona = activePersonas(launch).find((persona) => persona.toolNameHttp === name);
25834
25809
  const fastTool = allNonPersonaTools().find((tool) => tool.toolNameHttp === name);
25835
25810
  if (!(fastPersona ? fastAllowsTool(scope, launch, {
@@ -25914,14 +25889,15 @@ async function handleToolsCall(body, scope, launch, audience = "shared", session
25914
25889
  release();
25915
25890
  }
25916
25891
  }
25917
- if ((launch.profileId === "fast" || launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest" || launch.profileId === "balanced") && name === "oracle") {
25918
- const isCheapestOracle = launch.profileId === "cheapest";
25919
- const isBalancedOracle = launch.profileId === "balanced";
25892
+ if (isPinnedLaunchProfile(launch.profileId) && name === "oracle") {
25893
+ const isCheapestOracle = isCheapestFamily(launch.profileId);
25894
+ const isBalancedOracle = isBalancedFamily(launch.profileId);
25920
25895
  const isCheapOracle = launch.profileId === "cheap" || launch.profileId === "cheap1m" || isCheapestOracle || isBalancedOracle;
25921
- const oracleModel = isCheapestOracle ? CHEAPEST_PROFILE_ORACLE_MODEL : isCheapOracle ? CHEAP_PROFILE_ORACLE_MODEL : "claude-opus-5.5";
25896
+ const oracleModel = isCheapestOracle ? cheapestContractFor(launch.profileId).oracleModel : isBalancedOracle ? balancedContractFor(launch.profileId).oracleModel : isCheapOracle ? CHEAP_PROFILE_ORACLE_MODEL : "claude-opus-5.5";
25922
25897
  const oracleEndpoint = isCheapOracle ? "/v1/responses" : "/v1/messages";
25923
- const oracleEffort = isCheapestOracle ? CHEAPEST_PROFILE_ORACLE_EFFORT : isCheapOracle ? CHEAP_PROFILE_ORACLE_EFFORT : "high";
25924
- if (scope !== "all" && scope !== "peers" || !launch.allowedGroups?.has("peers") || !launch.allowedPersonas?.has("oracle") || !(isCheapestOracle ? cheapestOracleModel() : isBalancedOracle ? balancedOracleModel() : isCheapOracle ? cheapOracleModel() : fastOracleModel())) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
25898
+ const oracleEffort = isCheapestOracle ? cheapestContractFor(launch.profileId).oracleEffort : isBalancedOracle ? balancedContractFor(launch.profileId).oracleEffort : isCheapOracle ? CHEAP_PROFILE_ORACLE_EFFORT : "high";
25899
+ const oracleGateFn = isCheapestOracle ? () => cheapestOracleModel(launch.profileId) : isBalancedOracle ? () => balancedOracleModel(launch.profileId) : isCheapOracle ? cheapOracleModel : fastOracleModel;
25900
+ if (scope !== "all" && scope !== "peers" || !launch.allowedGroups?.has("peers") || !launch.allowedPersonas?.has("oracle") || !oracleGateFn()) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
25925
25901
  const query = typeof args.query === "string" ? args.query.trim() : "";
25926
25902
  const context = typeof args.context === "string" ? args.context.trim() : "";
25927
25903
  if (!query || !context) return rpcError(body.id, RPC_INVALID_PARAMS, "tools/call: oracle requires non-empty arguments.query and arguments.context");
@@ -25935,7 +25911,7 @@ async function handleToolsCall(body, scope, launch, audience = "shared", session
25935
25911
  model: oracleModel,
25936
25912
  endpoint: oracleEndpoint,
25937
25913
  description: "Fast/cheap-profile Oracle",
25938
- baseInstructions: isCheapestOracle ? "You are Oracle, an expert architectural and technical consultant running on GPT-6 Sol. You have no tools or repository access. Answer from the supplied context and state assumptions explicitly, noting which facts would change the recommendation. Never claim to execute, verify, approve, merge, or authorize an action." : isCheapOracle ? "You are Oracle, an expert architectural and technical consultant running on Grok 4.6. You have no tools or repository access. Answer from the supplied context and state assumptions explicitly, noting which facts would change the recommendation. Never claim to execute, verify, approve, merge, or authorize an action." : "You are Oracle, an expert architectural and technical consultant running on Opus 5. You have no tools or repository access. Answer from the supplied context and state assumptions explicitly, noting which facts would change the recommendation. Never claim to execute, verify, approve, merge, or authorize an action.",
25914
+ baseInstructions: `You are Oracle, an expert architectural and technical consultant running on ${displayModelName(oracleModel)}. You have no tools or repository access. Answer from the supplied context and state assumptions explicitly, noting which facts would change the recommendation. Never claim to execute, verify, approve, merge, or authorize an action.`,
25939
25915
  agentPrompt: "",
25940
25916
  writeCapable: false,
25941
25917
  requiresHttp: true,
@@ -25988,7 +25964,7 @@ async function handleToolsCall(body, scope, launch, audience = "shared", session
25988
25964
  release();
25989
25965
  }
25990
25966
  }
25991
- if ((launch.profileId === "fast" || launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest" || launch.profileId === "balanced") && PERSONAS_READ.some((p) => p.toolNameHttp === name)) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
25967
+ if (isPinnedLaunchProfile(launch.profileId) && PERSONAS_READ.some((p) => p.toolNameHttp === name)) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
25992
25968
  const persona = activePersonas(launch).find((p) => p.toolNameHttp === name);
25993
25969
  const nonPersonaTool = persona ? void 0 : allNonPersonaTools().find((t) => t.toolNameHttp === name);
25994
25970
  if (!persona && !nonPersonaTool) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
@@ -27040,17 +27016,18 @@ function fastProfileAdvisorAvailable() {
27040
27016
  * `gpt-5.6-sol` at medium effort over its Responses endpoint, transcript
27041
27017
  * capped at `CHEAPEST_PROFILE_ADVISOR_CONTEXT_TOKENS` (200K). */
27042
27018
  const ADVISOR_CHEAPEST_PROFILE_MODEL = CHEAPEST_PROFILE_ADVISOR_MODEL;
27043
- /** True only when the live Sol entry satisfies the fixed cheapest
27044
- * transport (Responses). */
27045
- function cheapestProfileAdvisorAvailable() {
27046
- return fastEndpointForCatalogId(ADVISOR_CHEAPEST_PROFILE_MODEL, state.models?.data) === "responses";
27047
- }
27048
- /** Pick the cheapest Advisor model. Throws when the catalog gate fails so
27049
- * the launch prerequisite surface (not a silent downgrade) owns the error. */
27050
- function resolveCheapestAdvisorModel() {
27051
- if (!cheapestProfileAdvisorAvailable()) throw new Error(`cheapest Advisor invariant failed: ${ADVISOR_CHEAPEST_PROFILE_MODEL} must advertise the Responses endpoint`);
27019
+ /** True only when the live family Sol entry satisfies the fixed cheapest
27020
+ * transport (Responses). The family id is supplied by the caller so
27021
+ * `cheapest2`'s `gpt-6.1-sol` goes through the same gate. */
27022
+ function cheapestProfileAdvisorAvailable(model = ADVISOR_CHEAPEST_PROFILE_MODEL) {
27023
+ return fastEndpointForCatalogId(model, state.models?.data) === "responses";
27024
+ }
27025
+ /** Pick the cheapest-family Advisor model. Throws when the catalog gate fails
27026
+ * so the launch prerequisite surface (not a silent downgrade) owns the error. */
27027
+ function resolveCheapestAdvisorModel(model = ADVISOR_CHEAPEST_PROFILE_MODEL) {
27028
+ if (!cheapestProfileAdvisorAvailable(model)) throw new Error(`cheapest Advisor invariant failed: ${displayModelName(model)} (${model}) must advertise the Responses endpoint`);
27052
27029
  return {
27053
- model: ADVISOR_CHEAPEST_PROFILE_MODEL,
27030
+ model,
27054
27031
  escalated: false,
27055
27032
  fastProfile: true
27056
27033
  };
@@ -33188,12 +33165,13 @@ function buildPeerAwarenessSnippet(opts) {
33188
33165
  `\`mcp__${searchKey}__code\` provides ${opts.bluebirdEnabled === true ? "Bluebird semantic + lexical search (failures stay visible with no local fallback)" : opts.semanticSearchAvailable === true ? "local ColBERT semantic-first search with lexical fallback" : "local lexical 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}`
33189
33166
  ].join("\n");
33190
33167
  }
33191
- if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m" || opts.profile === "cheapest" || opts.profile === "balanced") {
33168
+ if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m" || isCheapestFamily(opts.profile) || isBalancedFamily(opts.profile)) {
33192
33169
  const isCheap = opts.profile === "cheap" || opts.profile === "cheap1m";
33193
- const isCheapest = opts.profile === "cheapest";
33194
- const isBalanced = opts.profile === "balanced";
33195
- const profileLabel = isCheapest ? "cheapest" : isCheap ? "cheap" : isBalanced ? "balanced" : "fast";
33196
- const oracleDescriptor = isCheapest ? "GPT-6 Sol (200K/high)" : isCheap || isBalanced ? "Grok 4.6 (200K/medium)" : "exact Opus 5.5 (1M/high)";
33170
+ const isCheapest = isCheapestFamily(opts.profile);
33171
+ const isBalanced = isBalancedFamily(opts.profile);
33172
+ const profileLabel = isCheapest || isBalanced ? opts.profile : isCheap ? "cheap" : "fast";
33173
+ const familyContract = isCheapest ? cheapestContractFor(opts.profile) : isBalanced ? balancedContractFor(opts.profile) : void 0;
33174
+ const oracleDescriptor = familyContract ? `${displayModelName(familyContract.oracleModel)} (200K/${familyContract.oracleEffort})` : isCheap ? "Grok 4.6 (200K/medium)" : "exact Opus 5.5 (1M/high)";
33197
33175
  const astraDescriptor = isCheap && !isCheapest ? "200K/medium" : "200K/high";
33198
33176
  const fastPeersKey = key("peers");
33199
33177
  const fastSearchKey = key("search");
@@ -33276,12 +33254,13 @@ function buildPeerAwarenessSummary(opts) {
33276
33254
  "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.",
33277
33255
  `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.${opts.bluebirdEnabled === true ? " Code search uses Bluebird for semantic and lexical modes with visible no-fallback errors; exact/regex/AST remain local." : opts.semanticSearchAvailable === true ? " Code search uses local ColBERT semantic search with lexical fallback." : " Code search uses local lexical search."} Detailed routing lives in each role or tool description, and the full gated capability inventory lives in CLAUDE.md.`
33278
33256
  ].join("\n");
33279
- if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m" || opts.profile === "cheapest" || opts.profile === "balanced") {
33257
+ if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m" || isCheapestFamily(opts.profile) || isBalancedFamily(opts.profile)) {
33280
33258
  const isCheap = opts.profile === "cheap" || opts.profile === "cheap1m";
33281
- const isCheapest = opts.profile === "cheapest";
33282
- const isBalanced = opts.profile === "balanced";
33283
- const profileLabel = isCheapest ? "Cheapest" : isCheap ? "Cheap" : isBalanced ? "Balanced" : "Fast";
33284
- const oracleDescriptor = isCheapest ? "GPT-6 Sol (200K/high)" : isCheap || isBalanced ? "Grok 4.6 (200K/medium)" : "exact Opus 5.5 (1M/high)";
33259
+ const isCheapest = isCheapestFamily(opts.profile);
33260
+ const isBalanced = isBalancedFamily(opts.profile);
33261
+ const profileLabel = isCheapest || isBalanced ? opts.profile.charAt(0).toUpperCase() + opts.profile.slice(1) : isCheap ? "Cheap" : "Fast";
33262
+ const familyContract = isCheapest ? cheapestContractFor(opts.profile) : isBalanced ? balancedContractFor(opts.profile) : void 0;
33263
+ const oracleDescriptor = familyContract ? `${displayModelName(familyContract.oracleModel)} (200K/${familyContract.oracleEffort})` : isCheap ? "Grok 4.6 (200K/medium)" : "exact Opus 5.5 (1M/high)";
33285
33264
  const astraDescriptor = isCheap && !isCheapest ? "200K/medium" : "200K/high";
33286
33265
  const browserClause = opts.browserToolsAvailable ?? opts.browseAvailable ? ` \`mcp__${key("browser")}__*\` provides the opt-in browser.` : "";
33287
33266
  const workerBrowseClause = opts.browseAvailable ? ` \`worker-browse\` runs delegated browsing tasks through \`mcp__${key("workers")}__browse\`.` : "";
@@ -33826,18 +33805,19 @@ const NON_PERSONA_MCP_TOOLS = Object.freeze([
33826
33805
  isError: true
33827
33806
  };
33828
33807
  try {
33808
+ const profile = ctx?.profileId ?? "standard";
33829
33809
  return { content: [{
33830
33810
  type: "text",
33831
33811
  text: (await runHookPromptBrief({
33832
33812
  prompt,
33833
33813
  sessionId,
33834
33814
  workspace,
33835
- profile: ctx?.profileId ?? "standard",
33815
+ profile,
33836
33816
  searchEnabled: state.searchEnabled === true,
33837
33817
  bluebirdEnabled: state.bluebirdEnabled === true,
33838
33818
  signal,
33839
33819
  infer: (system, user, callSignal) => dispatchModelCall({
33840
- model: "gpt-5.6-sol",
33820
+ model: cheapestRewriteModelFor(profile),
33841
33821
  endpoint: "/v1/responses",
33842
33822
  instructions: system,
33843
33823
  userText: user,
@@ -34851,6 +34831,6 @@ function enumerateInjectedMcpToolNames(groupKeys, opts = {}) {
34851
34831
  return [...new Set(names)];
34852
34832
  }
34853
34833
  //#endregion
34854
- export { readIteratorWithTimeout as $, CHEAP_PROFILE_MODELS as $n, getTokenizerFromModel as $t, TOOLBELT_TOOLS$1 as A, UPSTREAM_INACTIVITY_TIMEOUT_MS as An, fastGeneralPurposeModel as At, injectAdvisorTool as B, withOneMSuffix as Bn, nativeSubagentModel as Bt, runWorkerAgent as C, BUDGET_SMALL_FAST_CATALOG_ID as Cn, cheapOracleModel as Ct, toolbeltEnabled as D, DEFAULT_CODEX_MODEL_FALLBACKS as Dn, cheapestReviewerModel as Dt, buildToolbeltAwareness as E, DEFAULT_CODEX_MODEL as En, cheapestOracleModel as Et, ADVISOR_TOOL_INSTRUCTIONS as F, upstreamAllowH2 as Fn, fleetToolsEnabled as Ft, formatThinkingRepairDecline as G, CHEAPEST_PROFILE_MODELS as Gn, scribeModel as Gt, resolveAdvisorEffort as H, CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL as Hn, reviewerFastModel as Ht, CHEAPEST_ADVISOR_TOOL_INSTRUCTIONS as I, upstreamMaxConnections as In, geminiAvailable as It, repairRejectedThinkingHistory as J, CHEAPEST_PROFILE_NATIVE_MODELS as Jn, shimDefaultsToXhigh as Jt, rememberThinkingHistoryRepair as K, CHEAPEST_PROFILE_NATIVE_AGENT_NAMES as Kn, standInToolEnabled as Kt, CHEAPEST_REVIEWER_ADVISOR_TOOL_INSTRUCTIONS as L, classifyMessagesRoute as Ln, generalPurposeFastModel as Lt, satisfiesMinVersion as M, isBudgetClaudeLead as Mn, fastPlanModel as Mt, searchWeb as N, pickClaudeDefault as Nn, fastReviewerModel as Nt, toolbeltSkipSet as O, DEFAULT_PORT as On, fastAdvisorModel as Ot, ADVISOR_INTERNAL_TOOL_NAME as P, resolveLeadSlugArg as Pn, fastScoutModel as Pt, logStreamError as Q, CHEAP_PROFILE_ADVISOR_CLIENT_MODEL as Qn, getTokenCount as Qt, FAST_ADVISOR_TOOL_INSTRUCTIONS as R, catalogAdvertises1M as Rn, implementerFastModel as Rt, resolveWorkerRunOpts as S, toolbeltPathOverride as Sn, cheapAdvisorModel as St, availableToolCommands as T, DEFAULT_CLAUDE_MODEL_FALLBACKS as Tn, cheapestAdvisorModel as Tt, resolveAdvisorModel as U, CHEAPEST_PROFILE_ADVISOR_EFFORT as Un, reviewerModel as Ut, isAdvisorRequested as V, withOneMSuffixForLead as Vn, resolveGeminiReviewModel as Vt, resolveCheapestAdvisorModel as W, CHEAPEST_PROFILE_ADVISOR_MODEL as Wn, scoutModel as Wt, buildOpenAIErrorEvent as X, CHEAPEST_PROFILE_ORACLE_MODEL as Xn, createMessages as Xt, buildAnthropicErrorEvent as Y, CHEAPEST_PROFILE_ORACLE_EFFORT as Yn, countTokens as Yt, isControllerClosedError as Z, CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS as Zn, getTextTokenCount as Zt, REVIEW_DEFAULT_MODEL as _, colbertDegradedWarning as _n, balancedReviewerModel as _t, buildAgentPrompt as a, resolveMcpToolTimeoutMs as an, handleMcpDelete as at, resolveDefaultModel as b, shouldUseInsecureTls as bn, browserCompoundToolsEnabled as bt, enumerateInjectedMcpToolNames as c, MAX_RESPONSE_BODY_BYTES as cn, buildAdoToolEntries as ct, BROWSE_DEFAULT_MODEL as d, normalizeOpenAIUsage as dn, ADO_DEFAULT_TOOLSETS as dt, findLaunchBySecret as en, CHEAP_PROFILE_NATIVE_AGENT_NAMES as er, relayAnthropicStream as et, DEFAULT_MODEL_CHAIN as f, provisionBrowserAssets as fn, normalizeAdoToolsets as ft, PLAN_DEFAULT_MODEL as g, DEFINITION_OF_GREATNESS as gn, balancedOracleModel as gt, IMPLEMENT_DEFAULT_MODEL as h, CONDENSED_OPERATING_SEQUENCE as hn, artifactToolsEnabled as ht, assertMcpToolSurfaceConsistent as i, warnOnTokenPriceDrift as in, clampEffort as it, assetFor as j, generateRandomPort as jn, fastOracleModel as jt, vscodeRipgrepPath as k, UPSTREAM_FETCH_TIMEOUT_MS as kn, fastAstraModel as kt, maxPersonasFor as l, readResponseBodyCapped as ln, disposeAdoClients as lt, EXPLORE_DEFAULT_THINKING as m, normalizeKustoClusterUri as mn, agentToolsEnabled as mt, MCP_GROUPS as n, unregisterLaunch as nn, CHEAP_PROFILE_NATIVE_MODELS as nr, UNKNOWN_EFFORT_ANCHOR as nt, buildPeerAwarenessSnippet as o, createResponses as on, handleMcpPost as ot, EXPLORE_DEFAULT_MODEL as p, hasSupportedBrowserInstalled as pn, adoToolsEnabled as pt, repairKnownThinkingHistory as q, CHEAPEST_PROFILE_NATIVE_EFFORTS as qn, workerToolsEnabled as qt, agentNamesForToolAllowlist as r, assembleResponsesPayload as rn, CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS as rr, bucketEffort as rt, buildPeerAwarenessSummary as s, createChatCompletions as sn, adoMcpToolEntries as st, GROUP_META as t, registerLaunch as tn, CHEAP_PROFILE_NATIVE_EFFORTS as tr, EFFORT_ORDER as tt, personasFor as u, parseJsonOrDiagnose as un, provisionAdoTools as ut, TEST_DEFAULT_MODEL as v, provisionAndIndexColbert as vn, brainstormModel as vt, buildEnv as w, BUDGET_SMALL_FAST_SLUG as wn, cheapReviewerModel as wt, resolveModeDefaults as x, collapsePathKeys as xn, browserToolsEnabled as xt, appendPlanReminder as y, semanticSearchOptedIn as yn, browseAgentEnabled as yt, buildAdvisorStream as z, oneMContextDisabled as zn, kustoToolsEnabled as zt };
34834
+ export { readIteratorWithTimeout as $, getTokenizerFromModel as $t, TOOLBELT_TOOLS$1 as A, UPSTREAM_INACTIVITY_TIMEOUT_MS as An, fastGeneralPurposeModel as At, injectAdvisorTool as B, withOneMSuffix as Bn, nativeSubagentModel as Bt, runWorkerAgent as C, BUDGET_SMALL_FAST_CATALOG_ID as Cn, cheapOracleModel as Ct, toolbeltEnabled as D, DEFAULT_CODEX_MODEL_FALLBACKS as Dn, cheapestReviewerModel as Dt, buildToolbeltAwareness as E, DEFAULT_CODEX_MODEL as En, cheapestOracleModel as Et, ADVISOR_TOOL_INSTRUCTIONS as F, upstreamAllowH2 as Fn, fleetToolsEnabled as Ft, formatThinkingRepairDecline as G, CHEAP_PROFILE_NATIVE_EFFORTS as Gn, scribeModel as Gt, resolveAdvisorEffort as H, CHEAP_PROFILE_ADVISOR_CLIENT_MODEL as Hn, reviewerFastModel as Ht, CHEAPEST_ADVISOR_TOOL_INSTRUCTIONS as I, upstreamMaxConnections as In, geminiAvailable as It, repairRejectedThinkingHistory as J, shimDefaultsToXhigh as Jt, rememberThinkingHistoryRepair as K, CHEAP_PROFILE_NATIVE_MODELS as Kn, standInToolEnabled as Kt, CHEAPEST_REVIEWER_ADVISOR_TOOL_INSTRUCTIONS as L, classifyMessagesRoute as Ln, generalPurposeFastModel as Lt, satisfiesMinVersion as M, isBudgetClaudeLead as Mn, fastPlanModel as Mt, searchWeb as N, pickClaudeDefault as Nn, fastReviewerModel as Nt, toolbeltSkipSet as O, DEFAULT_PORT as On, fastAdvisorModel as Ot, ADVISOR_INTERNAL_TOOL_NAME as P, resolveLeadSlugArg as Pn, fastScoutModel as Pt, logStreamError as Q, getTokenCount as Qt, FAST_ADVISOR_TOOL_INSTRUCTIONS as R, catalogAdvertises1M as Rn, implementerFastModel as Rt, resolveWorkerRunOpts as S, toolbeltPathOverride as Sn, cheapAdvisorModel as St, availableToolCommands as T, DEFAULT_CLAUDE_MODEL_FALLBACKS as Tn, cheapestAdvisorModel as Tt, resolveAdvisorModel as U, CHEAP_PROFILE_MODELS as Un, reviewerModel as Ut, isAdvisorRequested as V, withOneMSuffixForLead as Vn, resolveGeminiReviewModel as Vt, resolveCheapestAdvisorModel as W, CHEAP_PROFILE_NATIVE_AGENT_NAMES as Wn, scoutModel as Wt, buildOpenAIErrorEvent as X, createMessages as Xt, buildAnthropicErrorEvent as Y, countTokens as Yt, isControllerClosedError as Z, getTextTokenCount as Zt, REVIEW_DEFAULT_MODEL as _, colbertDegradedWarning as _n, balancedReviewerModel as _t, buildAgentPrompt as a, resolveMcpToolTimeoutMs as an, handleMcpDelete as at, resolveDefaultModel as b, shouldUseInsecureTls as bn, browserCompoundToolsEnabled as bt, enumerateInjectedMcpToolNames as c, MAX_RESPONSE_BODY_BYTES as cn, buildAdoToolEntries as ct, BROWSE_DEFAULT_MODEL as d, normalizeOpenAIUsage as dn, ADO_DEFAULT_TOOLSETS as dt, findLaunchBySecret as en, relayAnthropicStream as et, DEFAULT_MODEL_CHAIN as f, provisionBrowserAssets as fn, normalizeAdoToolsets as ft, PLAN_DEFAULT_MODEL as g, DEFINITION_OF_GREATNESS as gn, balancedOracleModel as gt, IMPLEMENT_DEFAULT_MODEL as h, CONDENSED_OPERATING_SEQUENCE as hn, artifactToolsEnabled as ht, assertMcpToolSurfaceConsistent as i, warnOnTokenPriceDrift as in, clampEffort as it, assetFor as j, generateRandomPort as jn, fastOracleModel as jt, vscodeRipgrepPath as k, UPSTREAM_FETCH_TIMEOUT_MS as kn, fastAstraModel as kt, maxPersonasFor as l, readResponseBodyCapped as ln, disposeAdoClients as lt, EXPLORE_DEFAULT_THINKING as m, normalizeKustoClusterUri as mn, agentToolsEnabled as mt, MCP_GROUPS as n, unregisterLaunch as nn, UNKNOWN_EFFORT_ANCHOR as nt, buildPeerAwarenessSnippet as o, createResponses as on, handleMcpPost as ot, EXPLORE_DEFAULT_MODEL as p, hasSupportedBrowserInstalled as pn, adoToolsEnabled as pt, repairKnownThinkingHistory as q, CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS as qn, workerToolsEnabled as qt, agentNamesForToolAllowlist as r, assembleResponsesPayload as rn, bucketEffort as rt, buildPeerAwarenessSummary as s, createChatCompletions as sn, adoMcpToolEntries as st, GROUP_META as t, registerLaunch as tn, EFFORT_ORDER as tt, personasFor as u, parseJsonOrDiagnose as un, provisionAdoTools as ut, TEST_DEFAULT_MODEL as v, provisionAndIndexColbert as vn, brainstormModel as vt, buildEnv as w, BUDGET_SMALL_FAST_SLUG as wn, cheapReviewerModel as wt, resolveModeDefaults as x, collapsePathKeys as xn, browserToolsEnabled as xt, appendPlanReminder as y, semanticSearchOptedIn as yn, browseAgentEnabled as yt, buildAdvisorStream as z, oneMContextDisabled as zn, kustoToolsEnabled as zt };
34855
34835
 
34856
- //# sourceMappingURL=peer-mcp-personas-DDMKRFFG.js.map
34836
+ //# sourceMappingURL=peer-mcp-personas-Ch4VWo40.js.map