github-router 0.3.338 → 0.3.340

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 (34) hide show
  1. package/dist/aic-statusline-settings-Chf-IT45.js +137 -0
  2. package/dist/aic-statusline-settings-Chf-IT45.js.map +1 -0
  3. package/dist/{attribution-settings-CeaG4eQa.js → attribution-settings-BTfKm-RU.js} +14 -14
  4. package/dist/attribution-settings-BTfKm-RU.js.map +1 -0
  5. package/dist/browser-ext/manifest.json +1 -1
  6. package/dist/{claude-CjsxXwv2.js → claude-DUpp7B4X.js} +11 -141
  7. package/dist/claude-DUpp7B4X.js.map +1 -0
  8. package/dist/{codex-CjZXP_n6.js → codex-Xn1xsoOw.js} +4 -4
  9. package/dist/{codex-CjZXP_n6.js.map → codex-Xn1xsoOw.js.map} +1 -1
  10. package/dist/engine-DvGukHty.js +2 -0
  11. package/dist/{gate-discovery-DGBZpoS7.js → gate-discovery-BIBgN6mA.js} +2 -2
  12. package/dist/{gate-discovery-DGBZpoS7.js.map → gate-discovery-BIBgN6mA.js.map} +1 -1
  13. package/dist/{internal-stop-hook-BgtHofxp.js → internal-stop-hook-Dyn0fRpZ.js} +2 -2
  14. package/dist/{internal-stop-hook-BgtHofxp.js.map → internal-stop-hook-Dyn0fRpZ.js.map} +1 -1
  15. package/dist/main.js +6 -5
  16. package/dist/main.js.map +1 -1
  17. package/dist/{peer-mcp-personas-qQgzZDPP.js → peer-mcp-personas-Dt0VRKYz.js} +26 -16
  18. package/dist/{peer-mcp-personas-qQgzZDPP.js.map → peer-mcp-personas-Dt0VRKYz.js.map} +1 -1
  19. package/dist/pi-DwfSuefC.js +1175 -0
  20. package/dist/pi-DwfSuefC.js.map +1 -0
  21. package/dist/{provision-CjIatImk.js → provision-D_aHUCXt.js} +11 -2
  22. package/dist/provision-D_aHUCXt.js.map +1 -0
  23. package/dist/{serve-BM6x_Cqs.js → serve-DWL5kmB_.js} +5 -5
  24. package/dist/{serve-BM6x_Cqs.js.map → serve-DWL5kmB_.js.map} +1 -1
  25. package/dist/{server-setup-M0PHRPjd.js → server-setup-UWugox0I.js} +109 -53
  26. package/dist/server-setup-UWugox0I.js.map +1 -0
  27. package/dist/{start-BWEckTMU.js → start-4OTehsYq.js} +3 -3
  28. package/dist/{start-BWEckTMU.js.map → start-4OTehsYq.js.map} +1 -1
  29. package/package.json +1 -1
  30. package/dist/attribution-settings-CeaG4eQa.js.map +0 -1
  31. package/dist/claude-CjsxXwv2.js.map +0 -1
  32. package/dist/engine-cNHuW0j7.js +0 -2
  33. package/dist/provision-CjIatImk.js.map +0 -1
  34. package/dist/server-setup-M0PHRPjd.js.map +0 -1
@@ -7,7 +7,7 @@ import { r as fetchWithTransientRetry } from "./upstream-retry-i1k1Xai2.js";
7
7
  import { t as getCopilotUsage } from "./get-copilot-usage-CGaV01dC.js";
8
8
  import { c as runCommandVoid, i as parseBoolEnv, o as resolveExecutable, r as killManagedTree, s as runCommandCapture } from "./exec-MCU1H-KZ.js";
9
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-C6AgFJNp.js";
10
- import { $ as EFFORT_ORDER, $t as readResponseBodyCapped, An as withOneMSuffixForLead, B as resolveAdvisorEffort, Bt as createMessages, D as toolbeltEnabled, Dn as catalogAdvertises1M, En as classifyMessagesRoute, F as ADVISOR_TOOL_INSTRUCTIONS, G as repairKnownThinkingHistory, H as resolveCheapestAdvisorModel, Hn as CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS, Ht as getTokenCount, I as FAST_ADVISOR_TOOL_INSTRUCTIONS, In as CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS, J as buildOpenAIErrorEvent, Jt as warnOnTokenPriceDrift, K as repairRejectedThinkingHistory, L as buildAdvisorStream, Ln as CHEAP_PROFILE_ADVISOR_CLIENT_MODEL, Mn as CHEAPEST_PROFILE_MODELS, N as searchWeb, Nn as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, On as oneMContextDisabled, P as ADVISOR_INTERNAL_TOOL_NAME, Q as relayAnthropicStream, Qt as MAX_RESPONSE_BODY_BYTES, R as injectAdvisorTool, Rn as CHEAP_PROFILE_MODELS, Rt as shimDefaultsToXhigh, Tn as upstreamMaxConnections, U as formatThinkingRepairDecline, Ut as getTokenizerFromModel, V as resolveAdvisorModel, Vt as getTextTokenCount, W as rememberThinkingHistoryRepair, Wt as findLaunchBySecret, X as logStreamError, Xt as createResponses, Y as isControllerClosedError, Yt as resolveMcpToolTimeoutMs, Z as readIteratorWithTimeout, Zt as createChatCompletions, at as agentToolsEnabled, bn as generateRandomPort, dn as toolbeltPathOverride, en as parseJsonOrDiagnose, et as UNKNOWN_EFFORT_ANCHOR, i as assertMcpToolSurfaceConsistent, it as handleMcpPost, jn as CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL, kn as withOneMSuffix, nt as clampEffort, pn as BUDGET_SMALL_FAST_SLUG, q as buildAnthropicErrorEvent, qt as assembleResponsesPayload, rt as handleMcpDelete, tn as normalizeOpenAIUsage, tt as bucketEffort, vn as UPSTREAM_FETCH_TIMEOUT_MS, wn as upstreamAllowH2, xn as isBudgetClaudeLead, yn as UPSTREAM_INACTIVITY_TIMEOUT_MS, z as isAdvisorRequested, zn as CHEAP_PROFILE_NATIVE_AGENT_NAMES, zt as countTokens } from "./peer-mcp-personas-qQgzZDPP.js";
10
+ import { $ as EFFORT_ORDER, $t as readResponseBodyCapped, An as withOneMSuffixForLead, B as resolveAdvisorEffort, Bn as CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS, Bt as createMessages, D as toolbeltEnabled, Dn as catalogAdvertises1M, En as classifyMessagesRoute, F as ADVISOR_TOOL_INSTRUCTIONS, Fn as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, G as repairKnownThinkingHistory, H as resolveCheapestAdvisorModel, Hn as CHEAP_PROFILE_MODELS, Ht as getTokenCount, I as FAST_ADVISOR_TOOL_INSTRUCTIONS, J as buildOpenAIErrorEvent, Jt as warnOnTokenPriceDrift, K as repairRejectedThinkingHistory, Kn as CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS, L as buildAdvisorStream, N as searchWeb, On as oneMContextDisabled, P as ADVISOR_INTERNAL_TOOL_NAME, Pn as CHEAPEST_PROFILE_MODELS, Q as relayAnthropicStream, Qt as MAX_RESPONSE_BODY_BYTES, R as injectAdvisorTool, Rt as shimDefaultsToXhigh, Tn as upstreamMaxConnections, U as formatThinkingRepairDecline, Un as CHEAP_PROFILE_NATIVE_AGENT_NAMES, Ut as getTokenizerFromModel, V as resolveAdvisorModel, Vn as CHEAP_PROFILE_ADVISOR_CLIENT_MODEL, Vt as getTextTokenCount, W as rememberThinkingHistoryRepair, Wt as findLaunchBySecret, X as logStreamError, Xt as createResponses, Y as isControllerClosedError, Yt as resolveMcpToolTimeoutMs, Z as readIteratorWithTimeout, Zt as createChatCompletions, at as agentToolsEnabled, bn as generateRandomPort, dn as toolbeltPathOverride, en as parseJsonOrDiagnose, et as UNKNOWN_EFFORT_ANCHOR, i as assertMcpToolSurfaceConsistent, it as handleMcpPost, jn as CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL, kn as withOneMSuffix, nt as clampEffort, pn as BUDGET_SMALL_FAST_SLUG, q as buildAnthropicErrorEvent, qt as assembleResponsesPayload, rt as handleMcpDelete, tn as normalizeOpenAIUsage, tt as bucketEffort, vn as UPSTREAM_FETCH_TIMEOUT_MS, wn as upstreamAllowH2, xn as isBudgetClaudeLead, yn as UPSTREAM_INACTIVITY_TIMEOUT_MS, z as isAdvisorRequested, zt as countTokens } from "./peer-mcp-personas-Dt0VRKYz.js";
11
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-LTJstj1e.js";
12
12
  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-D4fmThbS.js";
13
13
  import consola from "consola";
@@ -580,6 +580,16 @@ const BALANCED_GENERAL_PURPOSE_ALIAS_ID = "gh-router-balanced-general-purpose-ma
580
580
  const BALANCED_REVIEWER_ALIAS_ID = "gh-router-balanced-reviewer-high";
581
581
  const LUNA_SONNET_ALIAS_ID = "gh-router-luna-sonnet-xhigh";
582
582
  /**
583
+ * Shared browse-dispatcher alias (every pinned profile except max): the
584
+ * `worker-browse` native is an identical thin dispatcher on fast, cheap,
585
+ * cheap1m, cheapest, and balanced, so one router-owned, non-catalog identity
586
+ * serves all five (precedent: the shared `SKILL_*` aliases). Carries the
587
+ * fixed `low` effort until the authenticated request boundary. Emitted BARE
588
+ * (no `[1m]`) by every pinned `build*ProfileAgentDefinitions` worker-browse
589
+ * block, so the dispatcher's own turns run at the 200K default window.
590
+ */
591
+ const BROWSE_LOW_ALIAS_ID = "gh-router-browse-low";
592
+ /**
583
593
  * Router-owned alias id for the fast profile's Haiku-tier row
584
594
  * (`ANTHROPIC_DEFAULT_HAIKU_MODEL` / `ANTHROPIC_SMALL_FAST_MODEL`).
585
595
  */
@@ -589,6 +599,10 @@ const LUNA_HAIKU_ALIAS_ID = "gh-router-luna-haiku-high";
589
599
  * boundary and are never valid on standard or fast launches. */
590
600
  const MAX_LUNA_HIGH_ALIAS_ID = "gh-router-max-luna-high";
591
601
  const MAX_LUNA_MAX_ALIAS_ID = "gh-router-max-luna-max";
602
+ /** Max-profile browse-dispatcher alias: same `low`-effort, bare-200K browse
603
+ * as the shared alias above, but max-isolated (the max preprocessor never
604
+ * consults the shared alias table, so a shared id would be rejected there). */
605
+ const MAX_BROWSE_LOW_ALIAS_ID = "gh-router-max-browse-low";
592
606
  /**
593
607
  * Pipeline skill aliases (`/gh-gather-context`, `/gh-plan`, `/gh-implement`).
594
608
  * Router-owned, non-catalog identities shared by every pinned profile: all
@@ -608,7 +622,11 @@ const SKILL_REVIEW_PASS2_ALIAS_ID = "gh-router-skill-review-pass2-medium";
608
622
  const LUNA_REAL_MODEL_ID = FAST_PROFILE_MODELS.luna;
609
623
  /** The real Copilot catalog id every Sol skill alias canonicalizes to. */
610
624
  const SKILL_SOL_REAL_MODEL_ID = FAST_PROFILE_MODELS.plan;
611
- const MAX_ALIAS_IDS = /* @__PURE__ */ new Set([MAX_LUNA_HIGH_ALIAS_ID, MAX_LUNA_MAX_ALIAS_ID]);
625
+ const MAX_ALIAS_IDS = /* @__PURE__ */ new Set([
626
+ MAX_LUNA_HIGH_ALIAS_ID,
627
+ MAX_LUNA_MAX_ALIAS_ID,
628
+ MAX_BROWSE_LOW_ALIAS_ID
629
+ ]);
612
630
  function isMaxModelAlias(id) {
613
631
  return MAX_ALIAS_IDS.has(stripTrailingOneMSuffix(id).base);
614
632
  }
@@ -616,6 +634,7 @@ function maxAliasEffort(id) {
616
634
  const base = stripTrailingOneMSuffix(id).base;
617
635
  if (base === "gh-router-max-luna-high") return "high";
618
636
  if (base === "gh-router-max-luna-max") return "max";
637
+ if (base === "gh-router-max-browse-low") return "low";
619
638
  }
620
639
  function maxAliasModel(id) {
621
640
  return isMaxModelAlias(id) ? LUNA_REAL_MODEL_ID : void 0;
@@ -668,6 +687,11 @@ const MODEL_ALIAS_TABLE = /* @__PURE__ */ new Map([
668
687
  realModel: LUNA_REAL_MODEL_ID,
669
688
  absentEffortDefault: "high"
670
689
  }],
690
+ [BROWSE_LOW_ALIAS_ID, {
691
+ aliasId: BROWSE_LOW_ALIAS_ID,
692
+ realModel: LUNA_REAL_MODEL_ID,
693
+ absentEffortDefault: "low"
694
+ }],
671
695
  [CHEAP_EXPLORE_ALIAS_ID, {
672
696
  aliasId: CHEAP_EXPLORE_ALIAS_ID,
673
697
  realModel: CHEAP_PROFILE_MODELS.explore,
@@ -994,8 +1018,14 @@ const CHEAPEST_SUBAGENT_MIN_CONTEXT_TOKENS = CHEAPEST_PROFILE_SUBAGENT_CONTEXT_T
994
1018
  * Oracle, and a Sol/medium Advisor — all at the 200K default with
995
1019
  * their fixed efforts and supported endpoints. There is no `Plan` role: the
996
1020
  * lead plans directly.
1021
+ *
1022
+ * `opts.peers === false` (the Pi `--no-peers` path) validates the LEAD only:
1023
+ * no peer or native-role model is used in that launch, so requiring them
1024
+ * would fail a session that cannot consume them. Defaults to full-roster
1025
+ * validation (every existing caller, including `claude`, is unaffected).
997
1026
  */
998
- function validateCheapestProfilePrerequisites(catalog) {
1027
+ function validateCheapestProfilePrerequisites(catalog, opts = {}) {
1028
+ const peers = opts.peers !== false;
999
1029
  const missing = [];
1000
1030
  const luna = findModel(catalog, CHEAPEST_PROFILE_MODELS.lead);
1001
1031
  if (!luna) missing.push(`${CHEAPEST_PROFILE_MODELS.lead}: absent from the live catalog`);
@@ -1005,21 +1035,23 @@ function validateCheapestProfilePrerequisites(catalog) {
1005
1035
  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`);
1006
1036
  if (!supportsEndpoint(luna, "responses")) missing.push(`${CHEAPEST_PROFILE_MODELS.lead}: does not advertise a supported Responses endpoint`);
1007
1037
  }
1008
- const oracle = findModel(catalog, CHEAPEST_PROFILE_MODELS.oracle);
1009
- if (!oracle) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: absent from the live catalog`);
1010
- else {
1011
- if (!hasContextAtLeast(oracle, CHEAPEST_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: advertised context window is below the 200K subagent floor`);
1012
- if (!supportsEffort(oracle, "high")) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: does not advertise a "high" reasoning effort`);
1013
- if (!supportsEndpoint(oracle, "responses")) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: does not advertise a supported Responses endpoint`);
1014
- if (!hasUsablePromptMetadata(oracle)) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: no usable max_prompt_tokens metadata (Oracle brief)`);
1015
- }
1016
- const reviewer = findModel(catalog, CHEAPEST_PROFILE_MODELS.reviewer);
1017
- if (!reviewer) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: absent from the live catalog`);
1018
- else {
1019
- if (!hasToolCalls(reviewer)) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: does not advertise tool_calls`);
1020
- if (!hasContextAtLeast(reviewer, CHEAPEST_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: advertised context window is below the 200K subagent floor`);
1021
- if (!supportsEffort(reviewer, "high")) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: does not advertise a "high" reasoning effort`);
1022
- if (!supportsEndpoint(reviewer, "responses")) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: does not advertise a supported Responses endpoint`);
1038
+ if (peers) {
1039
+ const oracle = findModel(catalog, CHEAPEST_PROFILE_MODELS.oracle);
1040
+ if (!oracle) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: absent from the live catalog`);
1041
+ else {
1042
+ if (!hasContextAtLeast(oracle, CHEAPEST_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: advertised context window is below the 200K subagent floor`);
1043
+ if (!supportsEffort(oracle, "high")) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: does not advertise a "high" reasoning effort`);
1044
+ if (!supportsEndpoint(oracle, "responses")) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: does not advertise a supported Responses endpoint`);
1045
+ if (!hasUsablePromptMetadata(oracle)) missing.push(`${CHEAPEST_PROFILE_MODELS.oracle}: no usable max_prompt_tokens metadata (Oracle brief)`);
1046
+ }
1047
+ const reviewer = findModel(catalog, CHEAPEST_PROFILE_MODELS.reviewer);
1048
+ if (!reviewer) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: absent from the live catalog`);
1049
+ else {
1050
+ if (!hasToolCalls(reviewer)) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: does not advertise tool_calls`);
1051
+ if (!hasContextAtLeast(reviewer, CHEAPEST_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: advertised context window is below the 200K subagent floor`);
1052
+ if (!supportsEffort(reviewer, "high")) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: does not advertise a "high" reasoning effort`);
1053
+ if (!supportsEndpoint(reviewer, "responses")) missing.push(`${CHEAPEST_PROFILE_MODELS.reviewer}: does not advertise a supported Responses endpoint`);
1054
+ }
1023
1055
  }
1024
1056
  return {
1025
1057
  ok: missing.length === 0,
@@ -1041,8 +1073,13 @@ const BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS = BALANCED_PROFILE_SUBAGENT_CONTEXT_T
1041
1073
  * and a Grok Oracle — all at the 200K default with their
1042
1074
  * fixed efforts and supported endpoints. There is no `Plan` role: the lead
1043
1075
  * owns planning directly.
1076
+ *
1077
+ * `opts.peers === false` (the Pi `--no-peers` path) validates the LEAD only;
1078
+ * see `validateCheapestProfilePrerequisites` for why. Defaults to full-roster
1079
+ * validation (every existing caller is unaffected).
1044
1080
  */
1045
- function validateBalancedProfilePrerequisites(catalog) {
1081
+ function validateBalancedProfilePrerequisites(catalog, opts = {}) {
1082
+ const peers = opts.peers !== false;
1046
1083
  const missing = [];
1047
1084
  const sol = findModel(catalog, BALANCED_PROFILE_MODELS.lead);
1048
1085
  if (!sol) missing.push(`${BALANCED_PROFILE_MODELS.lead}: absent from the live catalog`);
@@ -1052,37 +1089,39 @@ function validateBalancedProfilePrerequisites(catalog) {
1052
1089
  if (!supportsEffort(sol, "high")) missing.push(`${BALANCED_PROFILE_MODELS.lead}: does not advertise a "high" reasoning effort`);
1053
1090
  if (!supportsEndpoint(sol, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.lead}: does not advertise a supported Responses endpoint`);
1054
1091
  }
1055
- const luna = findModel(catalog, BALANCED_PROFILE_MODELS.explore);
1056
- if (!luna) missing.push(`${BALANCED_PROFILE_MODELS.explore}: absent from the live catalog`);
1057
- else {
1058
- if (!hasToolCalls(luna)) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise tool_calls`);
1059
- if (!hasContextAtLeast(luna, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.explore}: advertised context window is below the 200K subagent floor`);
1060
- if (!supportsEffort(luna, "high") || !supportsEffort(luna, "max")) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise both "high" and "max" reasoning effort`);
1061
- if (!supportsEndpoint(luna, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise a supported Responses endpoint`);
1062
- }
1063
- const generalPurpose = findModel(catalog, BALANCED_PROFILE_MODELS["General-Purpose"]);
1064
- if (!generalPurpose) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: absent from the live catalog`);
1065
- else {
1066
- if (!hasToolCalls(generalPurpose)) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise tool_calls`);
1067
- if (!hasContextAtLeast(generalPurpose, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: advertised context window is below the 200K subagent floor`);
1068
- if (!supportsEffort(generalPurpose, "max")) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise a "max" reasoning effort`);
1069
- if (!supportsEndpoint(generalPurpose, "responses")) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise a supported Responses endpoint`);
1070
- }
1071
- const balancedReviewer = findModel(catalog, BALANCED_PROFILE_MODELS.reviewer);
1072
- if (!balancedReviewer) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: absent from the live catalog`);
1073
- else {
1074
- if (!hasToolCalls(balancedReviewer)) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: does not advertise tool_calls`);
1075
- if (!hasContextAtLeast(balancedReviewer, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: advertised context window is below the 200K subagent floor`);
1076
- if (!supportsEffort(balancedReviewer, "high")) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: does not advertise a "high" reasoning effort`);
1077
- if (!supportsEndpoint(balancedReviewer, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: does not advertise a supported Responses endpoint`);
1078
- }
1079
- const grok = findModel(catalog, BALANCED_PROFILE_MODELS.oracle);
1080
- if (!grok) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: absent from the live catalog`);
1081
- else {
1082
- if (!hasContextAtLeast(grok, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: advertised context window is below the 200K subagent floor`);
1083
- if (!supportsEffort(grok, "medium")) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: does not advertise a "medium" reasoning effort`);
1084
- if (!hasUsablePromptMetadata(grok)) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: no usable max_prompt_tokens metadata`);
1085
- if (!supportsEndpoint(grok, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: does not advertise a supported Responses endpoint`);
1092
+ if (peers) {
1093
+ const luna = findModel(catalog, BALANCED_PROFILE_MODELS.explore);
1094
+ if (!luna) missing.push(`${BALANCED_PROFILE_MODELS.explore}: absent from the live catalog`);
1095
+ else {
1096
+ if (!hasToolCalls(luna)) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise tool_calls`);
1097
+ if (!hasContextAtLeast(luna, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.explore}: advertised context window is below the 200K subagent floor`);
1098
+ if (!supportsEffort(luna, "high") || !supportsEffort(luna, "max")) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise both "high" and "max" reasoning effort`);
1099
+ if (!supportsEndpoint(luna, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise a supported Responses endpoint`);
1100
+ }
1101
+ const generalPurpose = findModel(catalog, BALANCED_PROFILE_MODELS["General-Purpose"]);
1102
+ if (!generalPurpose) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: absent from the live catalog`);
1103
+ else {
1104
+ if (!hasToolCalls(generalPurpose)) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise tool_calls`);
1105
+ if (!hasContextAtLeast(generalPurpose, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: advertised context window is below the 200K subagent floor`);
1106
+ if (!supportsEffort(generalPurpose, "max")) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise a "max" reasoning effort`);
1107
+ if (!supportsEndpoint(generalPurpose, "responses")) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise a supported Responses endpoint`);
1108
+ }
1109
+ const balancedReviewer = findModel(catalog, BALANCED_PROFILE_MODELS.reviewer);
1110
+ if (!balancedReviewer) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: absent from the live catalog`);
1111
+ else {
1112
+ if (!hasToolCalls(balancedReviewer)) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: does not advertise tool_calls`);
1113
+ if (!hasContextAtLeast(balancedReviewer, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: advertised context window is below the 200K subagent floor`);
1114
+ if (!supportsEffort(balancedReviewer, "high")) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: does not advertise a "high" reasoning effort`);
1115
+ if (!supportsEndpoint(balancedReviewer, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: does not advertise a supported Responses endpoint`);
1116
+ }
1117
+ const grok = findModel(catalog, BALANCED_PROFILE_MODELS.oracle);
1118
+ if (!grok) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: absent from the live catalog`);
1119
+ else {
1120
+ if (!hasContextAtLeast(grok, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: advertised context window is below the 200K subagent floor`);
1121
+ if (!supportsEffort(grok, "medium")) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: does not advertise a "medium" reasoning effort`);
1122
+ if (!hasUsablePromptMetadata(grok)) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: no usable max_prompt_tokens metadata`);
1123
+ if (!supportsEndpoint(grok, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: does not advertise a supported Responses endpoint`);
1124
+ }
1086
1125
  }
1087
1126
  return {
1088
1127
  ok: missing.length === 0,
@@ -2466,7 +2505,7 @@ function collectToolFieldKeys(body) {
2466
2505
  //#endregion
2467
2506
  //#region package.json
2468
2507
  var name = "github-router";
2469
- var version = "0.3.338";
2508
+ var version = "0.3.340";
2470
2509
  //#endregion
2471
2510
  //#region src/lib/approval.ts
2472
2511
  const awaitApproval = async () => {
@@ -8115,7 +8154,24 @@ function getCodexEnvVars(serverUrl) {
8115
8154
  if (toolbeltEnabled()) Object.assign(vars, toolbeltPathOverride(process.env, PATHS.TOOLBELT_BIN_DIR));
8116
8155
  return vars;
8117
8156
  }
8157
+ /**
8158
+ * Build environment variables for the Pi coding agent.
8159
+ *
8160
+ * Pi resolves its agent dir from `PI_CODING_AGENT_DIR` (else
8161
+ * `~/.pi/agent`); pointing it at the router-owned per-launch mirror
8162
+ * isolates the session (same role as `CLAUDE_CONFIG_DIR` for Claude
8163
+ * Code / `CODEX_HOME` for Codex). Model routing comes from the
8164
+ * mirror's `models.json` (gh-router provider → proxy `/v1`), so no
8165
+ * provider API keys are passed here — and the parent env is sanitized
8166
+ * of Pi credential keys (see `STRIPPED_PARENT_ENV_KEYS`) so a stale
8167
+ * shell export can't re-route the session off the proxy.
8168
+ */
8169
+ function getPiLaunchEnvVars(mirrorDir) {
8170
+ const vars = { PI_CODING_AGENT_DIR: mirrorDir };
8171
+ if (toolbeltEnabled()) Object.assign(vars, toolbeltPathOverride(process.env, PATHS.TOOLBELT_BIN_DIR));
8172
+ return vars;
8173
+ }
8118
8174
  //#endregion
8119
- export { validateBalancedProfilePrerequisites as A, formatBalancedPrerequisiteFailure as C, formatFastPrerequisiteFailure as D, formatCheapestPrerequisiteFailure as E, validateMaxProfileLaunch as F, runSelfUpdate as I, checkClaudeVersion as L, validateCheapProfilePrerequisites as M, validateCheapestProfilePrerequisites as N, profileDescriptor as O, validateFastProfilePrerequisites as P, updateClaude as R, LUNA_SCOUT_ALIAS_ID as S, formatCheapPrerequisiteFailure as T, CHEAPEST_REVIEWER_ALIAS_ID as _, sharedServerArgs as a, CHEAP_PLAN_ALIAS_ID as b, stopKeepAwake as c, enableFileLogging as d, BALANCED_EXPLORE_ALIAS_ID as f, CHEAPEST_GENERAL_PURPOSE_ALIAS_ID as g, CHEAPEST_EXPLORE_ALIAS_ID as h, setupAndServe as i, validateCheap1mProfilePrerequisites as j, resolveLaunchProfile as k, injectModelPickerSettingsFile as l, BALANCED_REVIEWER_ALIAS_ID as m, getCodexEnvVars as n, LAUNCH_SECRET_HEADER as o, BALANCED_GENERAL_PURPOSE_ALIAS_ID as p, parseSharedArgs as r, startKeepAwake as s, getClaudeCodeEnvVars as t, listModelsForEndpoint as u, CHEAP_EXPLORE_ALIAS_ID as v, formatCheap1mPrerequisiteFailure as w, CHEAP_REVIEWER_ALIAS_ID as x, CHEAP_GENERAL_PURPOSE_ALIAS_ID as y };
8175
+ export { formatFastPrerequisiteFailure as A, checkClaudeVersion as B, CHEAP_REVIEWER_ALIAS_ID as C, formatCheap1mPrerequisiteFailure as D, formatBalancedPrerequisiteFailure as E, validateCheapProfilePrerequisites as F, 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, updateClaude 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, runSelfUpdate as z };
8120
8176
 
8121
- //# sourceMappingURL=server-setup-M0PHRPjd.js.map
8177
+ //# sourceMappingURL=server-setup-UWugox0I.js.map