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,9 +6,11 @@ import { _ as forwardError, a as cacheCopilotVersion, b as copilotBaseUrl, c as
6
6
  import { r as fetchWithTransientRetry } from "./upstream-retry-i1k1Xai2.js";
7
7
  import { t as getCopilotUsage } from "./get-copilot-usage-0_S8pRWJ.js";
8
8
  import { a as parseBoolEnv, c as runCommandCapture, i as killManagedTree, s as resolveExecutable, u as runCommandVoid } from "./exec-Bf8g_bIR.js";
9
- import { _ as FAST_PROFILE_MODELS, f as FAST_PROFILE_ADVISOR_MODEL, i as BALANCED_PROFILE_NATIVE_AGENT_NAMES, l as BALANCED_PROFILE_SUBAGENT_CONTEXT_TOKENS, n as BALANCED_PROFILE_LEAD_EFFORT, r as BALANCED_PROFILE_MODELS, v as FAST_PROFILE_NATIVE_AGENT_NAMES } from "./balanced-profile-contract-XiIj4O1U.js";
10
- import { $ as readIteratorWithTimeout, $n as CHEAP_PROFILE_MODELS, $t as getTokenizerFromModel, An as UPSTREAM_INACTIVITY_TIMEOUT_MS, B as injectAdvisorTool, Bn as withOneMSuffix, D as toolbeltEnabled, F as ADVISOR_TOOL_INSTRUCTIONS, Fn as upstreamAllowH2, G as formatThinkingRepairDecline, Gn as CHEAPEST_PROFILE_MODELS, H as resolveAdvisorEffort, Hn as CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL, I as CHEAPEST_ADVISOR_TOOL_INSTRUCTIONS, In as upstreamMaxConnections, J as repairRejectedThinkingHistory, Jt as shimDefaultsToXhigh, K as rememberThinkingHistoryRepair, Kn as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, L as CHEAPEST_REVIEWER_ADVISOR_TOOL_INSTRUCTIONS, Ln as classifyMessagesRoute, Mn as isBudgetClaudeLead, N as searchWeb, P as ADVISOR_INTERNAL_TOOL_NAME, Q as logStreamError, Qn as CHEAP_PROFILE_ADVISOR_CLIENT_MODEL, Qt as getTokenCount, R as FAST_ADVISOR_TOOL_INSTRUCTIONS, Rn as catalogAdvertises1M, Sn as toolbeltPathOverride, U as resolveAdvisorModel, V as isAdvisorRequested, Vn as withOneMSuffixForLead, W as resolveCheapestAdvisorModel, X as buildOpenAIErrorEvent, Xt as createMessages, Y as buildAnthropicErrorEvent, Yt as countTokens, Z as isControllerClosedError, Zn as CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS, Zt as getTextTokenCount, an as resolveMcpToolTimeoutMs, at as handleMcpDelete, cn as MAX_RESPONSE_BODY_BYTES, dn as normalizeOpenAIUsage, dt as ADO_DEFAULT_TOOLSETS, en as findLaunchBySecret, er as CHEAP_PROFILE_NATIVE_AGENT_NAMES, et as relayAnthropicStream, ft as normalizeAdoToolsets, i as assertMcpToolSurfaceConsistent, in as warnOnTokenPriceDrift, it as clampEffort, jn as generateRandomPort, kn as UPSTREAM_FETCH_TIMEOUT_MS, ln as readResponseBodyCapped, mn as normalizeKustoClusterUri, mt as agentToolsEnabled, nt as UNKNOWN_EFFORT_ANCHOR, on as createResponses, ot as handleMcpPost, q as repairKnownThinkingHistory, rn as assembleResponsesPayload, rr as CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS, rt as bucketEffort, sn as createChatCompletions, tt as EFFORT_ORDER, un as parseJsonOrDiagnose, ut as provisionAdoTools, wn as BUDGET_SMALL_FAST_SLUG, z as buildAdvisorStream, zn as oneMContextDisabled } from "./peer-mcp-personas-DDMKRFFG.js";
11
- import { A as normalizeTrailingOneMSuffix, a as MAX_PROFILE_NATIVE_AGENT_NAMES, d as maxAdvisorPinIsValid, h as maxOpusModel, i as MAX_PROFILE_MODELS, j as stripTrailingOneMSuffix, k as fastEndpointForModel, l as maxAdvisorEffortForModel, n as MAX_PROFILE_ALLOWED_LEAD_MODEL_IDS, t as MAX_PROFILE_ADVISOR_INSTRUCTIONS, u as maxAdvisorModelFromPin, y as validateMaxProfilePrerequisites } from "./max-profile-contract-DQDEDCsR.js";
9
+ import { c as FAST_PROFILE_MODELS, l as FAST_PROFILE_NATIVE_AGENT_NAMES, r as FAST_PROFILE_ADVISOR_MODEL } from "./fast-profile-contract-JOnZBgFB.js";
10
+ import { $ as readIteratorWithTimeout, $t as getTokenizerFromModel, An as UPSTREAM_INACTIVITY_TIMEOUT_MS, B as injectAdvisorTool, Bn as withOneMSuffix, D as toolbeltEnabled, F as ADVISOR_TOOL_INSTRUCTIONS, Fn as upstreamAllowH2, G as formatThinkingRepairDecline, H as resolveAdvisorEffort, Hn as CHEAP_PROFILE_ADVISOR_CLIENT_MODEL, I as CHEAPEST_ADVISOR_TOOL_INSTRUCTIONS, In as upstreamMaxConnections, J as repairRejectedThinkingHistory, Jt as shimDefaultsToXhigh, K as rememberThinkingHistoryRepair, L as CHEAPEST_REVIEWER_ADVISOR_TOOL_INSTRUCTIONS, Ln as classifyMessagesRoute, Mn as isBudgetClaudeLead, N as searchWeb, P as ADVISOR_INTERNAL_TOOL_NAME, Q as logStreamError, Qt as getTokenCount, R as FAST_ADVISOR_TOOL_INSTRUCTIONS, Rn as catalogAdvertises1M, Sn as toolbeltPathOverride, U as resolveAdvisorModel, Un as CHEAP_PROFILE_MODELS, V as isAdvisorRequested, Vn as withOneMSuffixForLead, W as resolveCheapestAdvisorModel, Wn as CHEAP_PROFILE_NATIVE_AGENT_NAMES, X as buildOpenAIErrorEvent, Xt as createMessages, Y as buildAnthropicErrorEvent, Yt as countTokens, Z as isControllerClosedError, Zt as getTextTokenCount, an as resolveMcpToolTimeoutMs, at as handleMcpDelete, cn as MAX_RESPONSE_BODY_BYTES, dn as normalizeOpenAIUsage, dt as ADO_DEFAULT_TOOLSETS, en as findLaunchBySecret, et as relayAnthropicStream, ft as normalizeAdoToolsets, i as assertMcpToolSurfaceConsistent, in as warnOnTokenPriceDrift, it as clampEffort, jn as generateRandomPort, kn as UPSTREAM_FETCH_TIMEOUT_MS, ln as readResponseBodyCapped, mn as normalizeKustoClusterUri, mt as agentToolsEnabled, nt as UNKNOWN_EFFORT_ANCHOR, on as createResponses, ot as handleMcpPost, q as repairKnownThinkingHistory, qn as CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS, rn as assembleResponsesPayload, rt as bucketEffort, sn as createChatCompletions, tt as EFFORT_ORDER, un as parseJsonOrDiagnose, ut as provisionAdoTools, wn as BUDGET_SMALL_FAST_SLUG, z as buildAdvisorStream, zn as oneMContextDisabled } from "./peer-mcp-personas-Ch4VWo40.js";
11
+ import { D as CHEAPEST_PROFILE_MODELS, O as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, S as CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL, _ as isBalancedFamily, g as displayModelName, m as cheapestContractFor, p as balancedContractFor, v as isCheapestFamily, y as isPinnedLaunchProfile } from "./static-context-pack-BRqt4ajJ.js";
12
+ import { i as BALANCED_PROFILE_NATIVE_AGENT_NAMES, r as BALANCED_PROFILE_MODELS } from "./balanced-profile-contract-DtnTIBjL.js";
13
+ import { A as normalizeTrailingOneMSuffix, a as MAX_PROFILE_NATIVE_AGENT_NAMES, d as maxAdvisorPinIsValid, h as maxOpusModel, i as MAX_PROFILE_MODELS, j as stripTrailingOneMSuffix, k as fastEndpointForModel, l as maxAdvisorEffortForModel, n as MAX_PROFILE_ALLOWED_LEAD_MODEL_IDS, t as MAX_PROFILE_ADVISOR_INSTRUCTIONS, u as maxAdvisorModelFromPin, y as validateMaxProfilePrerequisites } from "./max-profile-contract-CMvzKSsg.js";
12
14
  import { f as getAzureRepoFromGit } from "./bluebird-client-ltPIiyJU.js";
13
15
  import { a as extractAndRecordPricedAic, f as copilotUsageToWire, h as nanoAiuToCredits, i as extractAndRecordAic, l as recordAic, m as formatAic, p as extractCopilotUsage } from "./aic-ledger-BdvCgRmx.js";
14
16
  import consola from "consola";
@@ -490,6 +492,39 @@ const BALANCED_PROFILE = Object.freeze({
490
492
  ]),
491
493
  hasCoordinator: false
492
494
  });
495
+ /** The `-m cheapest2` roster: `cheapest` with the Sol tier at `gpt-6.1-sol`
496
+ * (Advisor and Oracle) and the Advisor at `high`. The roster itself is
497
+ * unchanged, so it comes from the family contract rather than a copy. */
498
+ const CHEAPEST2_PROFILE = Object.freeze({
499
+ id: "cheapest2",
500
+ nativeRoster: new Set(cheapestContractFor("cheapest2").nativeAgentNames),
501
+ personaAllowlist: /* @__PURE__ */ new Set(["oracle"]),
502
+ allowedGroups: /* @__PURE__ */ new Set([
503
+ "peers",
504
+ "search",
505
+ "workers",
506
+ "browser",
507
+ "ado",
508
+ "kusto"
509
+ ]),
510
+ hasCoordinator: false
511
+ });
512
+ /** The `-m balanced2` roster: `balanced` with the Sol lead/reviewer at
513
+ * `gpt-6.1-sol` and the Oracle at `grok-4.7`. Roster unchanged. */
514
+ const BALANCED2_PROFILE = Object.freeze({
515
+ id: "balanced2",
516
+ nativeRoster: new Set(balancedContractFor("balanced2").nativeAgentNames),
517
+ personaAllowlist: /* @__PURE__ */ new Set(["oracle"]),
518
+ allowedGroups: /* @__PURE__ */ new Set([
519
+ "peers",
520
+ "search",
521
+ "workers",
522
+ "browser",
523
+ "ado",
524
+ "kusto"
525
+ ]),
526
+ hasCoordinator: false
527
+ });
493
528
  /**
494
529
  * The `-m max` profile: Sol/Luna-led, browse-only workers, and explicit
495
530
  * cross-lab peer names. The descriptor is a hard projection for bound launch
@@ -528,7 +563,9 @@ function profileDescriptor(id) {
528
563
  if (id === "cheap1m") return CHEAP1M_PROFILE;
529
564
  if (id === "cheap") return CHEAP_PROFILE;
530
565
  if (id === "cheapest") return CHEAPEST_PROFILE;
566
+ if (id === "cheapest2") return CHEAPEST2_PROFILE;
531
567
  if (id === "balanced") return BALANCED_PROFILE;
568
+ if (id === "balanced2") return BALANCED2_PROFILE;
532
569
  return STANDARD_PROFILE;
533
570
  }
534
571
  /**
@@ -549,7 +586,9 @@ function resolveLaunchProfile(modelArg) {
549
586
  if (arg === "cheap1m") return "cheap1m";
550
587
  if (arg === "cheap") return "cheap";
551
588
  if (arg === "cheapest") return "cheapest";
589
+ if (arg === "cheapest2") return "cheapest2";
552
590
  if (arg === "balanced") return "balanced";
591
+ if (arg === "balanced2") return "balanced2";
553
592
  return "standard";
554
593
  }
555
594
  function validateMaxProfileLaunch(catalog) {
@@ -765,7 +804,8 @@ const MODEL_ALIAS_TABLE = /* @__PURE__ */ new Map([
765
804
  [CHEAPEST_REVIEWER_ALIAS_ID, {
766
805
  aliasId: CHEAPEST_REVIEWER_ALIAS_ID,
767
806
  realModel: CHEAPEST_PROFILE_MODELS.reviewer,
768
- absentEffortDefault: "max"
807
+ absentEffortDefault: "max",
808
+ realModelByProfile: { cheapest2: cheapestContractFor("cheapest2").models.reviewer }
769
809
  }],
770
810
  [BALANCED_EXPLORE_ALIAS_ID, {
771
811
  aliasId: BALANCED_EXPLORE_ALIAS_ID,
@@ -780,7 +820,8 @@ const MODEL_ALIAS_TABLE = /* @__PURE__ */ new Map([
780
820
  [BALANCED_REVIEWER_ALIAS_ID, {
781
821
  aliasId: BALANCED_REVIEWER_ALIAS_ID,
782
822
  realModel: BALANCED_PROFILE_MODELS.reviewer,
783
- absentEffortDefault: "high"
823
+ absentEffortDefault: "high",
824
+ realModelByProfile: { balanced2: balancedContractFor("balanced2").models.reviewer }
784
825
  }],
785
826
  [SKILL_GATHER_CONTEXT_LEAD_ALIAS_ID, {
786
827
  aliasId: SKILL_GATHER_CONTEXT_LEAD_ALIAS_ID,
@@ -825,9 +866,15 @@ const MODEL_ALIAS_TABLE = /* @__PURE__ */ new Map([
825
866
  * id that isn't one of the registered aliases (including bare `claude-*`
826
867
  * ids and every other real Copilot catalog id).
827
868
  */
828
- function resolveModelAlias(id) {
869
+ function resolveModelAlias(id, profileId) {
829
870
  const { base } = stripTrailingOneMSuffix(id);
830
- return MODEL_ALIAS_TABLE.get(base);
871
+ const alias = MODEL_ALIAS_TABLE.get(base);
872
+ if (!alias) return void 0;
873
+ const override = profileId ? alias.realModelByProfile?.[profileId] : void 0;
874
+ return override === void 0 || override === alias.realModel ? alias : {
875
+ ...alias,
876
+ realModel: override
877
+ };
831
878
  }
832
879
  function isRetiredFastModelAlias(id) {
833
880
  return RETIRED_FAST_ALIAS_IDS.has(stripTrailingOneMSuffix(id).base);
@@ -840,9 +887,9 @@ function isRetiredFastModelAlias(id) {
840
887
  * boundary. Preserves a trailing `[1m]` bracket: canonicalization only
841
888
  * erases ALIAS identity, not the 1M-context accounting decoration.
842
889
  */
843
- function canonicalizeAliasModel(id) {
844
- const { base, hadSuffix } = stripTrailingOneMSuffix(id);
845
- const alias = MODEL_ALIAS_TABLE.get(base);
890
+ function canonicalizeAliasModel(id, profileId) {
891
+ const { hadSuffix } = stripTrailingOneMSuffix(id);
892
+ const alias = resolveModelAlias(id, profileId);
846
893
  if (!alias) return normalizeTrailingOneMSuffix(id);
847
894
  return hadSuffix ? `${alias.realModel}[1m]` : alias.realModel;
848
895
  }
@@ -1040,47 +1087,50 @@ function formatCheap1mPrerequisiteFailure(missing) {
1040
1087
  function formatCheapPrerequisiteFailure(missing) {
1041
1088
  return "github-router claude -m cheap 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 cheap profile's exact roster. Run plain `github-router claude` instead.";
1042
1089
  }
1043
- /** The subagent window floor: every cheapest role runs at the 200K default. */
1044
- const CHEAPEST_SUBAGENT_MIN_CONTEXT_TOKENS = CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS;
1045
1090
  /**
1046
- * Validate the live Copilot catalog for `-m cheapest`: Luna lead at the 200K
1047
- * default window, Luna Explore/GP roles, a Luna/max reviewer (protege of the
1048
- * Sol Advisor), a Sol/high Oracle, and a Sol/medium Advisor — all at the
1049
- * 200K default with their fixed efforts and supported endpoints. There is no
1050
- * `Plan` role: the lead plans directly.
1091
+ * Validate the live Copilot catalog for the `cheapest` family (`-m cheapest`,
1092
+ * `-m cheapest2`): Luna lead at the 200K default window, Luna Explore/GP
1093
+ * roles, a Luna/max reviewer (protege of the Sol Advisor), a Sol Oracle, and
1094
+ * a Sol Advisor — all at the 200K default with their fixed efforts and
1095
+ * supported endpoints. There is no `Plan` role: the lead plans directly.
1096
+ *
1097
+ * `profileId` selects the family contract, so `-m cheapest2` validates the
1098
+ * same roster against `gpt-6.1-sol` (Advisor and Oracle) with the Advisor at
1099
+ * `high`. Omitting it keeps every pre-existing caller on the base profile.
1051
1100
  *
1052
1101
  * `opts.peers === false` (the Pi `--no-peers` path) validates the LEAD only:
1053
1102
  * no peer or native-role model is used in that launch, so requiring them
1054
1103
  * would fail a session that cannot consume them. Defaults to full-roster
1055
1104
  * validation (every existing caller, including `claude`, is unaffected).
1056
1105
  */
1057
- function validateCheapestProfilePrerequisites(catalog, opts = {}) {
1106
+ function validateCheapestProfilePrerequisites(catalog, opts = {}, profileId = "cheapest") {
1058
1107
  const peers = opts.peers !== false;
1108
+ const contract = cheapestContractFor(profileId);
1059
1109
  const missing = [];
1060
- const luna = findModel(catalog, CHEAPEST_PROFILE_MODELS.lead);
1061
- if (!luna) missing.push(`${CHEAPEST_PROFILE_MODELS.lead}: absent from the live catalog`);
1110
+ const luna = findModel(catalog, contract.models.lead);
1111
+ if (!luna) missing.push(`${contract.models.lead}: absent from the live catalog`);
1062
1112
  else {
1063
- if (!hasToolCalls(luna)) missing.push(`${CHEAPEST_PROFILE_MODELS.lead}: does not advertise tool_calls`);
1064
- if (!hasContextAtLeast(luna, CHEAPEST_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${CHEAPEST_PROFILE_MODELS.lead}: advertised context window is below the 200K subagent floor`);
1065
- if (!supportsEffort(luna, "high") || !supportsEffort(luna, "max") || !supportsEffort(luna, "xhigh")) missing.push(`${CHEAPEST_PROFILE_MODELS.lead}: does not advertise "high", "max", and "xhigh" reasoning effort`);
1066
- if (!supportsEndpoint(luna, "responses")) missing.push(`${CHEAPEST_PROFILE_MODELS.lead}: does not advertise a supported Responses endpoint`);
1113
+ if (!hasToolCalls(luna)) missing.push(`${contract.models.lead}: does not advertise tool_calls`);
1114
+ if (!hasContextAtLeast(luna, contract.subagentContextTokens)) missing.push(`${contract.models.lead}: advertised context window is below the 200K subagent floor`);
1115
+ if (!supportsEffort(luna, "high") || !supportsEffort(luna, "max") || !supportsEffort(luna, "xhigh")) missing.push(`${contract.models.lead}: does not advertise "high", "max", and "xhigh" reasoning effort`);
1116
+ if (!supportsEndpoint(luna, "responses")) missing.push(`${contract.models.lead}: does not advertise a supported Responses endpoint`);
1067
1117
  }
1068
1118
  if (peers) {
1069
- const oracle = findModel(catalog, CHEAPEST_PROFILE_MODELS.oracle);
1070
- if (!oracle) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: absent from the live catalog`);
1119
+ const oracle = findModel(catalog, contract.oracleModel);
1120
+ if (!oracle) missing.push(`${contract.oracleModel}: absent from the live catalog`);
1071
1121
  else {
1072
- if (!hasContextAtLeast(oracle, CHEAPEST_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: advertised context window is below the 200K subagent floor`);
1073
- if (!supportsEffort(oracle, "high")) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: does not advertise a "high" reasoning effort`);
1074
- if (!supportsEndpoint(oracle, "responses")) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: does not advertise a supported Responses endpoint`);
1075
- if (!hasUsablePromptMetadata(oracle)) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: no usable max_prompt_tokens metadata (Oracle brief)`);
1122
+ if (!hasContextAtLeast(oracle, contract.subagentContextTokens)) missing.push(`${contract.oracleModel}: advertised context window is below the 200K subagent floor`);
1123
+ if (!supportsEffort(oracle, contract.oracleEffort)) missing.push(`${contract.oracleModel}: does not advertise a "${contract.oracleEffort}" reasoning effort`);
1124
+ if (!supportsEndpoint(oracle, "responses")) missing.push(`${contract.oracleModel}: does not advertise a supported Responses endpoint`);
1125
+ if (!hasUsablePromptMetadata(oracle)) missing.push(`${contract.oracleModel}: no usable max_prompt_tokens metadata (Oracle brief)`);
1076
1126
  }
1077
- const reviewer = findModel(catalog, CHEAPEST_PROFILE_MODELS.reviewer);
1078
- if (!reviewer) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: absent from the live catalog`);
1127
+ const reviewer = findModel(catalog, contract.models.reviewer);
1128
+ if (!reviewer) missing.push(`${contract.models.reviewer}: absent from the live catalog`);
1079
1129
  else {
1080
- if (!hasToolCalls(reviewer)) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: does not advertise tool_calls`);
1081
- if (!hasContextAtLeast(reviewer, CHEAPEST_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: advertised context window is below the 200K subagent floor`);
1082
- if (!supportsEffort(reviewer, "high")) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: does not advertise a "high" reasoning effort`);
1083
- if (!supportsEndpoint(reviewer, "responses")) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: does not advertise a supported Responses endpoint`);
1130
+ if (!hasToolCalls(reviewer)) missing.push(`${contract.models.reviewer}: does not advertise tool_calls`);
1131
+ if (!hasContextAtLeast(reviewer, contract.subagentContextTokens)) missing.push(`${contract.models.reviewer}: advertised context window is below the 200K subagent floor`);
1132
+ if (!supportsEffort(reviewer, "high")) missing.push(`${contract.models.reviewer}: does not advertise a "high" reasoning effort`);
1133
+ if (!supportsEndpoint(reviewer, "responses")) missing.push(`${contract.models.reviewer}: does not advertise a supported Responses endpoint`);
1084
1134
  }
1085
1135
  }
1086
1136
  return {
@@ -1090,68 +1140,72 @@ function validateCheapestProfilePrerequisites(catalog, opts = {}) {
1090
1140
  }
1091
1141
  /**
1092
1142
  * Format `validateCheapestProfilePrerequisites`'s failure list into the
1093
- * launch error message.
1143
+ * launch error message. `profileId` names the alias the caller actually
1144
+ * typed, so a `cheapest2` failure does not tell the user to retry `cheapest`.
1094
1145
  */
1095
- function formatCheapestPrerequisiteFailure(missing) {
1096
- return "github-router claude -m cheapest 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 cheapest profile's exact roster. Run plain `github-router claude` instead.";
1146
+ function formatCheapestPrerequisiteFailure(missing, profileId = "cheapest") {
1147
+ return `github-router claude -m ${profileId} 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 ${profileId} profile's exact roster. Run plain \`github-router claude\` instead.`;
1097
1148
  }
1098
- /** The subagent window floor: every balanced role runs at the 200K default. */
1099
- const BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS = BALANCED_PROFILE_SUBAGENT_CONTEXT_TOKENS;
1100
1149
  /**
1101
- * Validate the live Copilot catalog for `-m balanced`: Sol lead at the 200K
1102
- * default window, Luna Explore/General-Purpose roles, a Sol/high reviewer,
1103
- * and a Grok Oracle — all at the 200K default with their
1104
- * fixed efforts and supported endpoints. There is no `Plan` role: the lead
1105
- * owns planning directly.
1150
+ * Validate the live Copilot catalog for the `balanced` family (`-m balanced`,
1151
+ * `-m balanced2`): the Sol lead at the 200K default window, Luna Explore/
1152
+ * General-Purpose roles, a Sol/high reviewer, and the Grok Oracle — all at
1153
+ * the 200K default with their fixed efforts and supported endpoints. There is
1154
+ * no `Plan` role: the lead owns planning directly.
1155
+ *
1156
+ * `profileId` selects the family contract, so `-m balanced2` validates
1157
+ * `gpt-6.1-sol` for the lead/reviewer and `grok-4.7` for the Oracle. Omitting
1158
+ * it keeps every pre-existing caller on the base profile.
1106
1159
  *
1107
1160
  * `opts.peers === false` (the Pi `--no-peers` path) validates the LEAD only;
1108
1161
  * see `validateCheapestProfilePrerequisites` for why. Defaults to full-roster
1109
1162
  * validation (every existing caller is unaffected).
1110
1163
  */
1111
- function validateBalancedProfilePrerequisites(catalog, opts = {}) {
1164
+ function validateBalancedProfilePrerequisites(catalog, opts = {}, profileId = "balanced") {
1112
1165
  const peers = opts.peers !== false;
1166
+ const contract = balancedContractFor(profileId);
1113
1167
  const missing = [];
1114
- const sol = findModel(catalog, BALANCED_PROFILE_MODELS.lead);
1115
- if (!sol) missing.push(`${BALANCED_PROFILE_MODELS.lead}: absent from the live catalog`);
1168
+ const sol = findModel(catalog, contract.models.lead);
1169
+ if (!sol) missing.push(`${contract.models.lead}: absent from the live catalog`);
1116
1170
  else {
1117
- if (!hasToolCalls(sol)) missing.push(`${BALANCED_PROFILE_MODELS.lead}: does not advertise tool_calls`);
1118
- if (!hasContextAtLeast(sol, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.lead}: advertised context window is below the 200K subagent floor`);
1119
- if (!supportsEffort(sol, "high")) missing.push(`${BALANCED_PROFILE_MODELS.lead}: does not advertise a "high" reasoning effort`);
1120
- if (!supportsEffort(sol, "medium")) missing.push(`${BALANCED_PROFILE_MODELS.lead}: does not advertise a "${BALANCED_PROFILE_LEAD_EFFORT}" reasoning effort (the contracted lead effort)`);
1121
- if (!supportsEndpoint(sol, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.lead}: does not advertise a supported Responses endpoint`);
1171
+ if (!hasToolCalls(sol)) missing.push(`${contract.models.lead}: does not advertise tool_calls`);
1172
+ if (!hasContextAtLeast(sol, contract.subagentContextTokens)) missing.push(`${contract.models.lead}: advertised context window is below the 200K subagent floor`);
1173
+ if (!supportsEffort(sol, "high")) missing.push(`${contract.models.lead}: does not advertise a "high" reasoning effort`);
1174
+ if (!supportsEffort(sol, contract.leadEffort)) missing.push(`${contract.models.lead}: does not advertise a "${contract.leadEffort}" reasoning effort (the contracted lead effort)`);
1175
+ if (!supportsEndpoint(sol, "responses")) missing.push(`${contract.models.lead}: does not advertise a supported Responses endpoint`);
1122
1176
  }
1123
1177
  if (peers) {
1124
- const luna = findModel(catalog, BALANCED_PROFILE_MODELS.explore);
1125
- if (!luna) missing.push(`${BALANCED_PROFILE_MODELS.explore}: absent from the live catalog`);
1178
+ const luna = findModel(catalog, contract.models.explore);
1179
+ if (!luna) missing.push(`${contract.models.explore}: absent from the live catalog`);
1126
1180
  else {
1127
- if (!hasToolCalls(luna)) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise tool_calls`);
1128
- if (!hasContextAtLeast(luna, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.explore}: advertised context window is below the 200K subagent floor`);
1129
- if (!supportsEffort(luna, "high") || !supportsEffort(luna, "max")) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise both "high" and "max" reasoning effort`);
1130
- if (!supportsEndpoint(luna, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise a supported Responses endpoint`);
1181
+ if (!hasToolCalls(luna)) missing.push(`${contract.models.explore}: does not advertise tool_calls`);
1182
+ if (!hasContextAtLeast(luna, contract.subagentContextTokens)) missing.push(`${contract.models.explore}: advertised context window is below the 200K subagent floor`);
1183
+ if (!supportsEffort(luna, "high") || !supportsEffort(luna, "max")) missing.push(`${contract.models.explore}: does not advertise both "high" and "max" reasoning effort`);
1184
+ if (!supportsEndpoint(luna, "responses")) missing.push(`${contract.models.explore}: does not advertise a supported Responses endpoint`);
1131
1185
  }
1132
- const generalPurpose = findModel(catalog, BALANCED_PROFILE_MODELS["General-Purpose"]);
1133
- if (!generalPurpose) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: absent from the live catalog`);
1186
+ const generalPurpose = findModel(catalog, contract.models["General-Purpose"]);
1187
+ if (!generalPurpose) missing.push(`${contract.models["General-Purpose"]}: absent from the live catalog`);
1134
1188
  else {
1135
- if (!hasToolCalls(generalPurpose)) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise tool_calls`);
1136
- if (!hasContextAtLeast(generalPurpose, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: advertised context window is below the 200K subagent floor`);
1137
- if (!supportsEffort(generalPurpose, "max")) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise a "max" reasoning effort`);
1138
- if (!supportsEndpoint(generalPurpose, "responses")) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise a supported Responses endpoint`);
1189
+ if (!hasToolCalls(generalPurpose)) missing.push(`${contract.models["General-Purpose"]}: does not advertise tool_calls`);
1190
+ if (!hasContextAtLeast(generalPurpose, contract.subagentContextTokens)) missing.push(`${contract.models["General-Purpose"]}: advertised context window is below the 200K subagent floor`);
1191
+ if (!supportsEffort(generalPurpose, "max")) missing.push(`${contract.models["General-Purpose"]}: does not advertise a "max" reasoning effort`);
1192
+ if (!supportsEndpoint(generalPurpose, "responses")) missing.push(`${contract.models["General-Purpose"]}: does not advertise a supported Responses endpoint`);
1139
1193
  }
1140
- const balancedReviewer = findModel(catalog, BALANCED_PROFILE_MODELS.reviewer);
1141
- if (!balancedReviewer) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: absent from the live catalog`);
1194
+ const balancedReviewer = findModel(catalog, contract.models.reviewer);
1195
+ if (!balancedReviewer) missing.push(`${contract.models.reviewer}: absent from the live catalog`);
1142
1196
  else {
1143
- if (!hasToolCalls(balancedReviewer)) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: does not advertise tool_calls`);
1144
- if (!hasContextAtLeast(balancedReviewer, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: advertised context window is below the 200K subagent floor`);
1145
- if (!supportsEffort(balancedReviewer, "high")) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: does not advertise a "high" reasoning effort`);
1146
- if (!supportsEndpoint(balancedReviewer, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: does not advertise a supported Responses endpoint`);
1197
+ if (!hasToolCalls(balancedReviewer)) missing.push(`${contract.models.reviewer}: does not advertise tool_calls`);
1198
+ if (!hasContextAtLeast(balancedReviewer, contract.subagentContextTokens)) missing.push(`${contract.models.reviewer}: advertised context window is below the 200K subagent floor`);
1199
+ if (!supportsEffort(balancedReviewer, contract.nativeEfforts.reviewer)) missing.push(`${contract.models.reviewer}: does not advertise a "${contract.nativeEfforts.reviewer}" reasoning effort`);
1200
+ if (!supportsEndpoint(balancedReviewer, "responses")) missing.push(`${contract.models.reviewer}: does not advertise a supported Responses endpoint`);
1147
1201
  }
1148
- const grok = findModel(catalog, BALANCED_PROFILE_MODELS.oracle);
1149
- if (!grok) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: absent from the live catalog`);
1202
+ const grok = findModel(catalog, contract.oracleModel);
1203
+ if (!grok) missing.push(`${contract.oracleModel}: absent from the live catalog`);
1150
1204
  else {
1151
- if (!hasContextAtLeast(grok, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: advertised context window is below the 200K subagent floor`);
1152
- if (!supportsEffort(grok, "medium")) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: does not advertise a "medium" reasoning effort`);
1153
- if (!hasUsablePromptMetadata(grok)) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: no usable max_prompt_tokens metadata`);
1154
- if (!supportsEndpoint(grok, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: does not advertise a supported Responses endpoint`);
1205
+ if (!hasContextAtLeast(grok, contract.subagentContextTokens)) missing.push(`${contract.oracleModel}: advertised context window is below the 200K subagent floor`);
1206
+ if (!supportsEffort(grok, contract.oracleEffort)) missing.push(`${contract.oracleModel}: does not advertise a "${contract.oracleEffort}" reasoning effort`);
1207
+ if (!hasUsablePromptMetadata(grok)) missing.push(`${contract.oracleModel}: no usable max_prompt_tokens metadata`);
1208
+ if (!supportsEndpoint(grok, "responses")) missing.push(`${contract.oracleModel}: does not advertise a supported Responses endpoint`);
1155
1209
  }
1156
1210
  }
1157
1211
  return {
@@ -1161,10 +1215,11 @@ function validateBalancedProfilePrerequisites(catalog, opts = {}) {
1161
1215
  }
1162
1216
  /**
1163
1217
  * Format `validateBalancedProfilePrerequisites`'s failure list into the
1164
- * launch error message.
1218
+ * launch error message. `profileId` names the alias the caller actually
1219
+ * typed, so a `balanced2` failure does not tell the user to retry `balanced`.
1165
1220
  */
1166
- function formatBalancedPrerequisiteFailure(missing) {
1167
- return "github-router claude -m balanced 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 balanced profile's exact roster. Run plain `github-router claude` instead.";
1221
+ function formatBalancedPrerequisiteFailure(missing, profileId = "balanced") {
1222
+ return `github-router claude -m ${profileId} 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 ${profileId} profile's exact roster. Run plain \`github-router claude\` instead.`;
1168
1223
  }
1169
1224
  //#endregion
1170
1225
  //#region src/lib/file-log-reporter.ts
@@ -1556,37 +1611,39 @@ const CHEAP_PICKER_MODELS = Object.freeze([
1556
1611
  neverOneM: true
1557
1612
  }
1558
1613
  ]);
1559
- const CHEAPEST_PICKER_MODELS = Object.freeze([{
1560
- id: "gpt-5.6-sol",
1561
- label: "GPT-5.6 Sol",
1562
- behavesAs: "claude-opus-5.5",
1563
- neverOneM: true
1564
- }, {
1565
- id: "gpt-6-luna",
1566
- label: "GPT-6 Luna",
1567
- behavesAs: "claude-opus-5.5",
1568
- neverOneM: true
1569
- }]);
1570
- const BALANCED_PICKER_MODELS = Object.freeze([
1571
- {
1572
- id: "gpt-5.6-sol",
1573
- label: "GPT-5.6 Sol",
1614
+ /**
1615
+ * Shared builder for the two cheapest-family and two balanced-family rosters.
1616
+ * Both families pin every row to the 200K default window (`neverOneM`): those
1617
+ * launches seed CLAUDE_CODE_DISABLE_1M_CONTEXT=1 (see server-setup), which
1618
+ * gates the client's `[1m]` unlock entirely, so a row labelled "(1M)" that
1619
+ * still budgets 200K would be a lie. Luna at a real 1M stays available via
1620
+ * `-m fast` / `-m cheap1m`. The upstream `[1m]` bracket (when present on other
1621
+ * profiles' rows) is stripped by `resolveModel` at request time.
1622
+ */
1623
+ function pinnedRows(sol, oracle) {
1624
+ const rows = [{
1625
+ id: sol,
1626
+ label: displayModelName(sol),
1574
1627
  behavesAs: "claude-opus-5.5",
1575
1628
  neverOneM: true
1576
- },
1577
- {
1629
+ }, {
1578
1630
  id: "gpt-6-luna",
1579
1631
  label: "GPT-6 Luna",
1580
1632
  behavesAs: "claude-opus-5.5",
1581
1633
  neverOneM: true
1582
- },
1583
- {
1584
- id: "grok-4.6",
1585
- label: "Grok 4.6",
1634
+ }];
1635
+ if (oracle !== void 0) rows.push({
1636
+ id: oracle,
1637
+ label: displayModelName(oracle),
1586
1638
  behavesAs: "claude-sonnet-5",
1587
1639
  neverOneM: true
1588
- }
1589
- ]);
1640
+ });
1641
+ return Object.freeze(rows);
1642
+ }
1643
+ const CHEAPEST_PICKER_MODELS = pinnedRows(cheapestContractFor("cheapest").advisorModel);
1644
+ const CHEAPEST2_PICKER_MODELS = pinnedRows(cheapestContractFor("cheapest2").advisorModel);
1645
+ const BALANCED_PICKER_MODELS = pinnedRows(balancedContractFor("balanced").models.lead, balancedContractFor("balanced").oracleModel);
1646
+ const BALANCED2_PICKER_MODELS = pinnedRows(balancedContractFor("balanced2").models.lead, balancedContractFor("balanced2").oracleModel);
1590
1647
  /**
1591
1648
  * Return the ordered, profile-specific `/model` rows supported by the live
1592
1649
  * Copilot catalog. Fast intentionally shares Standard's four-row inventory;
@@ -1604,7 +1661,7 @@ function selectableModelsInCatalog(profile) {
1604
1661
  const catalog = state.models?.data;
1605
1662
  if (!catalog || catalog.length === 0) return [];
1606
1663
  const present = new Set(catalog.map((entry) => entry.id));
1607
- return (profile === "max" ? MAX_PICKER_MODELS : profile === "cheap" ? CHEAP_PICKER_MODELS : profile === "cheap1m" ? CHEAP1M_PICKER_MODELS : profile === "cheapest" ? CHEAPEST_PICKER_MODELS : profile === "balanced" ? BALANCED_PICKER_MODELS : STANDARD_PICKER_MODELS).filter((entry) => present.has(entry.id)).map((entry) => ({
1664
+ return (profile === "max" ? MAX_PICKER_MODELS : profile === "cheap" ? CHEAP_PICKER_MODELS : profile === "cheap1m" ? CHEAP1M_PICKER_MODELS : isCheapestFamily(profile) ? profile === "cheapest2" ? CHEAPEST2_PICKER_MODELS : CHEAPEST_PICKER_MODELS : isBalancedFamily(profile) ? profile === "balanced2" ? BALANCED2_PICKER_MODELS : BALANCED_PICKER_MODELS : STANDARD_PICKER_MODELS).filter((entry) => present.has(entry.id)).map((entry) => ({
1608
1665
  model: entry.neverOneM ? entry.id : withOneMSuffix(entry.id),
1609
1666
  label: entry.label,
1610
1667
  behavesAs: entry.behavesAs
@@ -1642,7 +1699,7 @@ async function renameSettingsWithRetry(temp, target) {
1642
1699
  * 200K session's `/model` UI.
1643
1700
  */
1644
1701
  function routerWinsPicker(profile) {
1645
- return profile === "fast" || profile === "cheap" || profile === "cheap1m" || profile === "cheapest" || profile === "balanced";
1702
+ return profile === "fast" || profile === "cheap" || profile === "cheap1m" || isCheapestFamily(profile) || isBalancedFamily(profile);
1646
1703
  }
1647
1704
  function modelIdsFromExistingPicker(value) {
1648
1705
  if (!value || typeof value !== "object" || Array.isArray(value)) return [];
@@ -2042,12 +2099,13 @@ async function stopKeepAwake() {
2042
2099
  * that enabled it, so a session that suddenly carries three more servers is
2043
2100
  * explainable rather than mysterious — and so a surface turned on by a
2044
2101
  * flag is never miscredited to a remote.
2045
- * 4. Kusto is the one surface whose reach extends past the repository, so its
2046
- * cluster is never discovered: discovery may turn the GROUP on, and a call
2047
- * names the cluster it reads, held to a Kusto-shaped https origin. What a
2048
- * session can actually read is therefore still bounded by the operator's
2049
- * own identity in each cluster, which the router neither widens nor
2050
- * substitutes for.
2102
+ * 4. Kusto is the one surface whose requests extend past the repository, so
2103
+ * its cluster is never discovered: discovery may turn the GROUP on, and a
2104
+ * call names the cluster it reads. A per-call hostname is checked only for
2105
+ * a standalone `kusto` DNS label, with any suffix. That is not an ownership
2106
+ * allowlist: the selected host receives the Azure bearer token, so callers
2107
+ * must choose a trusted host. RBAC governs data access at a genuine Kusto
2108
+ * service; it does not protect the token from an untrusted endpoint.
2051
2109
  *
2052
2110
  * This is a deliberate difference from the deny-by-default
2053
2111
  * `GH_ROUTER_FM_SCAFFOLD_REPOS` precedent: that allowlist guards a tool that
@@ -2791,7 +2849,7 @@ function collectToolFieldKeys(body) {
2791
2849
  //#endregion
2792
2850
  //#region package.json
2793
2851
  var name = "github-router";
2794
- var version = "0.3.353";
2852
+ var version = "0.3.355";
2795
2853
  //#endregion
2796
2854
  //#region src/lib/approval.ts
2797
2855
  const awaitApproval = async () => {
@@ -5947,15 +6005,19 @@ function preprocessMaxRequest(rawBody, launch, subagentRequest = false) {
5947
6005
  Object.freeze([MAX_LUNA_HIGH_ALIAS_ID, MAX_LUNA_MAX_ALIAS_ID]);
5948
6006
  //#endregion
5949
6007
  //#region src/lib/fast-request-preprocess.ts
5950
- const cheapFamily = (profileId) => profileId === "cheap" || profileId === "cheap1m" || profileId === "cheapest" || profileId === "balanced";
5951
- const pinnedProfile = (profileId) => profileId === "fast" || cheapFamily(profileId);
6008
+ const pinnedProfile = (profileId) => isPinnedLaunchProfile(profileId);
6009
+ /**
6010
+ * Pinned profiles that share this preprocess. `fast` has its own alias and
6011
+ * effort semantics, so it is excluded; `max` never reaches here.
6012
+ */
6013
+ const cheapFamily = (profileId) => isPinnedLaunchProfile(profileId) && profileId !== "fast";
5952
6014
  /**
5953
6015
  * Profiles whose every selectable `/model` row must stay at Claude Code's
5954
6016
  * 200K DEFAULT context window (bare id, no `[1m]` accounting bracket).
5955
6017
  * `fast` keeps 1M on lead and subagents by design; `cheap1m` keeps 1M on
5956
6018
  * the lead only (its subagents are bare-by-construction).
5957
6019
  */
5958
- const bareEnforcedProfile = (profileId) => profileId === "cheap" || profileId === "cheapest" || profileId === "balanced";
6020
+ const bareEnforcedProfile = (profileId) => profileId === "cheap" || isCheapestFamily(profileId) || isBalancedFamily(profileId);
5959
6021
  function explicitEffortOf(value) {
5960
6022
  return typeof value === "string" && value.trim() !== "" ? value : void 0;
5961
6023
  }
@@ -6004,7 +6066,7 @@ function preprocessFastRequest(rawBody, launch, subagentRequest = false) {
6004
6066
  modified: false,
6005
6067
  retiredAlias: originalModel
6006
6068
  };
6007
- const alias = resolveModelAlias(originalModel);
6069
+ const alias = resolveModelAlias(originalModel, launch?.profileId);
6008
6070
  if (alias && (launch?.profileId !== "fast" && !cheapFamily(launch?.profileId) || isMaxModelAlias(originalModel))) return {
6009
6071
  body: rawBody,
6010
6072
  originalModel,
@@ -6023,10 +6085,10 @@ function preprocessFastRequest(rawBody, launch, subagentRequest = false) {
6023
6085
  let fixedEffort;
6024
6086
  if (alias) {
6025
6087
  fixedEffort = alias.absentEffortDefault;
6026
- parsed.model = canonicalizeAliasModel(originalModel);
6088
+ parsed.model = canonicalizeAliasModel(originalModel, launch?.profileId);
6027
6089
  } else if (bare === "gpt-6-luna" || bare === "gpt-6-luna") fixedEffort = "max";
6028
- else if (bare === "gpt-5.6-sol" || bare === "gpt-6-sol") fixedEffort = profileId === "balanced" && !subagentRequest ? BALANCED_PROFILE_LEAD_EFFORT : "high";
6029
- else if (bare === "grok-4.6") fixedEffort = "medium";
6090
+ else if (bare === "gpt-5.6-sol" || bare === "gpt-6-sol" || bare === "gpt-6.1-sol") fixedEffort = isBalancedFamily(profileId) && !subagentRequest ? balancedContractFor(profileId).leadEffort : "high";
6091
+ else if (bare === "grok-4.6" || bare === "grok-4.7") fixedEffort = "medium";
6030
6092
  else if (bare === "gemini-3.8-flash") fixedEffort = "high";
6031
6093
  else if (bare === "claude-sonnet-5") fixedEffort = "xhigh";
6032
6094
  else if (bare === "claude-opus-5.5" || bare === "claude-opus-5-5" || bare === "claude-opus-5.5") fixedEffort = "high";
@@ -6358,7 +6420,7 @@ function fastAdvisorMetadataMismatch(rawBody) {
6358
6420
  if (stripTrailingOneMSuffix(model).base !== FAST_PROFILE_ADVISOR_MODEL) return `the native Advisor tool requested ${JSON.stringify(model)} instead of ${JSON.stringify(FAST_PROFILE_ADVISOR_MODEL)}`;
6359
6421
  }
6360
6422
  }
6361
- function cheapestAdvisorMetadataMismatch(rawBody) {
6423
+ function cheapestAdvisorMetadataMismatch(rawBody, expectedModel) {
6362
6424
  let body;
6363
6425
  try {
6364
6426
  body = JSON.parse(rawBody);
@@ -6372,7 +6434,7 @@ function cheapestAdvisorMetadataMismatch(rawBody) {
6372
6434
  if (typeof type !== "string" || !type.startsWith("advisor_")) continue;
6373
6435
  const model = tool.model;
6374
6436
  if (typeof model !== "string") return "the native Advisor tool omitted its fixed model";
6375
- if (stripTrailingOneMSuffix(model).base !== CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL) return `the native Advisor tool requested ${JSON.stringify(model)} instead of ${JSON.stringify(CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL)}`;
6437
+ if (stripTrailingOneMSuffix(model).base !== expectedModel) return `the native Advisor tool requested ${JSON.stringify(model)} instead of ${JSON.stringify(expectedModel)}`;
6376
6438
  }
6377
6439
  }
6378
6440
  /**
@@ -6532,8 +6594,10 @@ async function handleCompletion(c) {
6532
6594
  const fastProfileRequest = identity.launch?.profileId === "fast";
6533
6595
  const maxProfileRequest = identity.launch?.profileId === "max";
6534
6596
  const cheapProfileRequest = identity.launch?.profileId === "cheap" || identity.launch?.profileId === "cheap1m";
6535
- const cheapestProfileRequest = identity.launch?.profileId === "cheapest";
6536
- const balancedProfileRequest = identity.launch?.profileId === "balanced";
6597
+ const cheapestProfileRequest = isCheapestFamily(identity.launch?.profileId);
6598
+ const balancedProfileRequest = isBalancedFamily(identity.launch?.profileId);
6599
+ const cheapestFamilyAdvisorModel = isCheapestFamily(identity.launch?.profileId) ? cheapestContractFor(identity.launch?.profileId).advisorModel : void 0;
6600
+ const cheapestFamilyAdvisorClientModel = isCheapestFamily(identity.launch?.profileId) ? cheapestContractFor(identity.launch?.profileId).advisorClientModel : void 0;
6537
6601
  const subagentAgentId = (c.req.header("x-claude-code-agent-id") ?? "").trim();
6538
6602
  const subagentRequest = subagentAgentId.length > 0;
6539
6603
  const fastSubagentRequest = fastProfileRequest && subagentRequest;
@@ -6615,16 +6679,16 @@ async function handleCompletion(c) {
6615
6679
  }
6616
6680
  }
6617
6681
  if (cheapestAdvisorEnabled) {
6618
- const mismatch = cheapestAdvisorMetadataMismatch(rawBody);
6682
+ const mismatch = cheapestAdvisorMetadataMismatch(rawBody, cheapestFamilyAdvisorClientModel ?? CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL);
6619
6683
  if (mismatch) return c.json({
6620
6684
  type: "error",
6621
6685
  error: {
6622
6686
  type: "invalid_request_error",
6623
- message: `Cheapest Advisor model mismatch: ${mismatch}. Run \`/advisor ${CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL}\` to restore the fixed cheapest profile, or relaunch with \`github-router claude -m cheapest\`.`
6687
+ message: `Cheapest Advisor model mismatch: ${mismatch}. Run \`/advisor ${cheapestFamilyAdvisorClientModel ?? CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL}\` to restore the fixed cheapest profile, or relaunch with \`github-router claude -m ${identity.launch?.profileId ?? "cheapest"}\`.`
6624
6688
  }
6625
6689
  }, 400);
6626
6690
  try {
6627
- fastAdvisorChoice = resolveCheapestAdvisorModel();
6691
+ fastAdvisorChoice = resolveCheapestAdvisorModel(cheapestFamilyAdvisorModel);
6628
6692
  } catch (error) {
6629
6693
  return c.json({
6630
6694
  type: "error",
@@ -6636,7 +6700,7 @@ async function handleCompletion(c) {
6636
6700
  }
6637
6701
  }
6638
6702
  if (cheapestReviewerEnabled && !fastAdvisorChoice) try {
6639
- fastAdvisorChoice = resolveCheapestAdvisorModel();
6703
+ fastAdvisorChoice = resolveCheapestAdvisorModel(cheapestFamilyAdvisorModel);
6640
6704
  } catch (error) {
6641
6705
  return c.json({
6642
6706
  type: "error",
@@ -6649,7 +6713,7 @@ async function handleCompletion(c) {
6649
6713
  const fastPreprocess = preprocessFastRequest(rawBody, identity.launch, subagentRequest);
6650
6714
  if (fastPreprocess.retiredAlias || fastPreprocess.rejectedAlias || fastPreprocess.rejectedModel) {
6651
6715
  const profileId = identity.launch?.profileId;
6652
- const profileLabel = profileId === "cheap" || profileId === "cheap1m" ? "cheap" : profileId === "cheapest" ? "cheapest" : "fast";
6716
+ const profileLabel = profileId === "cheap" || profileId === "cheap1m" ? "cheap" : isCheapestFamily(profileId) || isBalancedFamily(profileId) ? profileId : "fast";
6653
6717
  const message = fastPreprocess.retiredAlias ? `Router-owned model alias ${JSON.stringify(fastPreprocess.retiredAlias)} belongs to a retired Fast role and is no longer valid. Relaunch or select a current Fast role.` : profileId === "max" ? maxRequestError(fastPreprocess) ?? "Invalid max request" : fastPreprocess.rejectedAlias ? `Router-owned model alias ${JSON.stringify(fastPreprocess.rejectedAlias)} is valid only for an authenticated -m ${profileLabel} launch.` : `Model ${JSON.stringify(fastPreprocess.rejectedModel)} is outside the fixed -m ${profileLabel} model set.`;
6654
6718
  return c.json({
6655
6719
  type: "error",
@@ -8411,13 +8475,13 @@ function getClaudeCodeEnvVars(serverUrl, model, launchProfileId = "standard", pi
8411
8475
  if (process.env.ENABLE_TOOL_SEARCH === void 0) vars.ENABLE_TOOL_SEARCH = "auto";
8412
8476
  const isFastProfile = launchProfileId === "fast";
8413
8477
  const isMaxProfile = launchProfileId === "max";
8414
- const isCheapProfile = launchProfileId === "cheap" || launchProfileId === "cheap1m" || launchProfileId === "cheapest";
8478
+ const isCheapProfile = launchProfileId === "cheap" || launchProfileId === "cheap1m" || isCheapestFamily(launchProfileId);
8415
8479
  const routerWinsTiers = isFastProfile || isCheapProfile;
8416
- const pinStrict200K = launchProfileId === "cheap" || launchProfileId === "cheapest" || launchProfileId === "balanced";
8480
+ const pinStrict200K = launchProfileId === "cheap" || isCheapestFamily(launchProfileId) || isBalancedFamily(launchProfileId);
8417
8481
  if (pinStrict200K) {
8418
8482
  if (process.env.CLAUDE_CODE_DISABLE_1M_CONTEXT === void 0 || process.env.CLAUDE_CODE_DISABLE_1M_CONTEXT === "") vars.CLAUDE_CODE_DISABLE_1M_CONTEXT = "1";
8419
8483
  }
8420
- const pinLeadEffort = launchProfileId === "cheapest" ? "max" : launchProfileId === "balanced" ? BALANCED_PROFILE_LEAD_EFFORT : void 0;
8484
+ const pinLeadEffort = isCheapestFamily(launchProfileId) ? cheapestContractFor(launchProfileId).leadEffort : isBalancedFamily(launchProfileId) ? balancedContractFor(launchProfileId).leadEffort : void 0;
8421
8485
  if (pinLeadEffort !== void 0) {
8422
8486
  if ((process.env.CLAUDE_CODE_EFFORT_LEVEL ?? "").trim() === "") vars.CLAUDE_CODE_EFFORT_LEVEL = pinLeadEffort;
8423
8487
  }
@@ -8594,4 +8658,4 @@ function getPiLaunchEnvVars(mirrorDir) {
8594
8658
  //#endregion
8595
8659
  export { formatFastPrerequisiteFailure as A, runSelfUpdate as B, CHEAP_REVIEWER_ALIAS_ID as C, formatCheap1mPrerequisiteFailure as D, formatBalancedPrerequisiteFailure as E, validateCheapProfilePrerequisites as F, updateClaude as H, validateCheapestProfilePrerequisites as I, validateFastProfilePrerequisites as L, resolveLaunchProfile as M, validateBalancedProfilePrerequisites as N, formatCheapPrerequisiteFailure as O, validateCheap1mProfilePrerequisites as P, validateMaxProfileLaunch as R, CHEAP_PLAN_ALIAS_ID as S, MAX_BROWSE_LOW_ALIAS_ID as T, checkClaudeVersion as V, CHEAPEST_EXPLORE_ALIAS_ID as _, setupAndServe as a, CHEAP_EXPLORE_ALIAS_ID as b, startKeepAwake as c, listModelsForEndpoint as d, enableFileLogging as f, BROWSE_LOW_ALIAS_ID as g, BALANCED_REVIEWER_ALIAS_ID as h, parseSharedArgs as i, profileDescriptor as j, formatCheapestPrerequisiteFailure as k, stopKeepAwake as l, BALANCED_GENERAL_PURPOSE_ALIAS_ID as m, getCodexEnvVars as n, sharedServerArgs as o, BALANCED_EXPLORE_ALIAS_ID as p, getPiLaunchEnvVars as r, LAUNCH_SECRET_HEADER as s, getClaudeCodeEnvVars as t, injectModelPickerSettingsFile as u, CHEAPEST_GENERAL_PURPOSE_ALIAS_ID as v, LUNA_SCOUT_ALIAS_ID as w, CHEAP_GENERAL_PURPOSE_ALIAS_ID as x, CHEAPEST_REVIEWER_ALIAS_ID as y, queueDetachedGlobalInstall as z };
8596
8660
 
8597
- //# sourceMappingURL=server-setup-COrhtCdv.js.map
8661
+ //# sourceMappingURL=server-setup-DDZxJgl0.js.map