github-router 0.3.332 → 0.3.334

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 (39) hide show
  1. package/dist/{attribution-settings-BeO1w_DL.js → attribution-settings-BwJ_HbhG.js} +91 -51
  2. package/dist/attribution-settings-BwJ_HbhG.js.map +1 -0
  3. package/dist/balanced-profile-contract-DkmALvc7.js +130 -0
  4. package/dist/balanced-profile-contract-DkmALvc7.js.map +1 -0
  5. package/dist/browser-ext/manifest.json +1 -1
  6. package/dist/{claude-BQQPdXLb.js → claude-C1fHEK9k.js} +15 -14
  7. package/dist/claude-C1fHEK9k.js.map +1 -0
  8. package/dist/{codex-fW-hbxtT.js → codex-DPgcI7n4.js} +4 -4
  9. package/dist/{codex-fW-hbxtT.js.map → codex-DPgcI7n4.js.map} +1 -1
  10. package/dist/engine-Dt_WWJcW.js +2 -0
  11. package/dist/{gate-discovery-DbwVeERm.js → gate-discovery-BTgLdzhP.js} +2 -2
  12. package/dist/{gate-discovery-DbwVeERm.js.map → gate-discovery-BTgLdzhP.js.map} +1 -1
  13. package/dist/hooks.mjs +49 -3
  14. package/dist/hooks.sha256 +1 -1
  15. package/dist/{internal-fast-dispatch-guard-DoXO3X7P.js → internal-fast-dispatch-guard-BykpMYog.js} +26 -4
  16. package/dist/internal-fast-dispatch-guard-BykpMYog.js.map +1 -0
  17. package/dist/{internal-fast-dispatch-guard-DPR16qUE.js → internal-fast-dispatch-guard-VvR1xQnL.js} +1 -1
  18. package/dist/{internal-stop-hook-DO8RKfKB.js → internal-stop-hook-t_pg41SR.js} +2 -2
  19. package/dist/{internal-stop-hook-DO8RKfKB.js.map → internal-stop-hook-t_pg41SR.js.map} +1 -1
  20. package/dist/main.js +6 -6
  21. package/dist/{peer-mcp-personas-CeB2Kcn2.js → peer-mcp-personas-7esbf4L6.js} +29 -91
  22. package/dist/peer-mcp-personas-7esbf4L6.js.map +1 -0
  23. package/dist/{provision-DZLsyRYh.js → provision-DFscSS0y.js} +2 -2
  24. package/dist/{provision-DZLsyRYh.js.map → provision-DFscSS0y.js.map} +1 -1
  25. package/dist/{serve-ik_96Q2Z.js → serve-DHCliFCz.js} +5 -5
  26. package/dist/{serve-ik_96Q2Z.js.map → serve-DHCliFCz.js.map} +1 -1
  27. package/dist/{server-setup-CK3O_Hwf.js → server-setup-aZtjyebO.js} +51 -38
  28. package/dist/server-setup-aZtjyebO.js.map +1 -0
  29. package/dist/{start-DPOJJSvp.js → start-CWQ5jAwp.js} +3 -3
  30. package/dist/{start-DPOJJSvp.js.map → start-CWQ5jAwp.js.map} +1 -1
  31. package/package.json +1 -1
  32. package/dist/attribution-settings-BeO1w_DL.js.map +0 -1
  33. package/dist/claude-BQQPdXLb.js.map +0 -1
  34. package/dist/engine-E4WJGSeg.js +0 -2
  35. package/dist/fast-profile-contract-DmsyQQrw.js +0 -61
  36. package/dist/fast-profile-contract-DmsyQQrw.js.map +0 -1
  37. package/dist/internal-fast-dispatch-guard-DoXO3X7P.js.map +0 -1
  38. package/dist/peer-mcp-personas-CeB2Kcn2.js.map +0 -1
  39. package/dist/server-setup-CK3O_Hwf.js.map +0 -1
@@ -6,8 +6,8 @@ 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-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
- import { c as FAST_PROFILE_MODELS, l as FAST_PROFILE_NATIVE_AGENT_NAMES, r as FAST_PROFILE_ADVISOR_MODEL } from "./fast-profile-contract-DmsyQQrw.js";
10
- import { $ as EFFORT_ORDER, $t as MAX_RESPONSE_BODY_BYTES, An as withOneMSuffix, B as resolveAdvisorEffort, Bt as countTokens, D as toolbeltEnabled, Dn as classifyMessagesRoute, En as upstreamMaxConnections, F as ADVISOR_TOOL_INSTRUCTIONS, G as repairKnownThinkingHistory, Gn as CHEAP_PROFILE_NATIVE_AGENT_NAMES, Gt as findLaunchBySecret, H as resolveCheapestAdvisorModel, Hn as CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS, Ht as getTextTokenCount, I as FAST_ADVISOR_TOOL_INSTRUCTIONS, In as BALANCED_PROFILE_SUBAGENT_CONTEXT_TOKENS, J as buildOpenAIErrorEvent, Jn as CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS, Jt as assembleResponsesPayload, K as repairRejectedThinkingHistory, L as buildAdvisorStream, Ln as CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL, Mn as BALANCED_PROFILE_MODELS, N as searchWeb, Nn as BALANCED_PROFILE_NATIVE_AGENT_NAMES, On as catalogAdvertises1M, P as ADVISOR_INTERNAL_TOOL_NAME, Q as relayAnthropicStream, Qt as createChatCompletions, R as injectAdvisorTool, Rn as CHEAPEST_PROFILE_MODELS, Sn as isBudgetClaudeLead, Tn as upstreamAllowH2, U as formatThinkingRepairDecline, Un as CHEAP_PROFILE_ADVISOR_CLIENT_MODEL, Ut as getTokenCount, V as resolveAdvisorModel, Vt as createMessages, W as rememberThinkingHistoryRepair, Wn as CHEAP_PROFILE_MODELS, Wt as getTokenizerFromModel, X as logStreamError, Xt as resolveMcpToolTimeoutMs, Y as isControllerClosedError, Yt as warnOnTokenPriceDrift, Z as readIteratorWithTimeout, Zt as createResponses, at as agentToolsEnabled, bn as UPSTREAM_INACTIVITY_TIMEOUT_MS, en as readResponseBodyCapped, et as UNKNOWN_EFFORT_ANCHOR, fn as toolbeltPathOverride, i as assertMcpToolSurfaceConsistent, it as handleMcpPost, jn as withOneMSuffixForLead, kn as oneMContextDisabled, mn as BUDGET_SMALL_FAST_SLUG, nn as normalizeOpenAIUsage, nt as clampEffort, q as buildAnthropicErrorEvent, rt as handleMcpDelete, tn as parseJsonOrDiagnose, tt as bucketEffort, xn as generateRandomPort, yn as UPSTREAM_FETCH_TIMEOUT_MS, z as isAdvisorRequested, zn as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, zt as shimDefaultsToXhigh } from "./peer-mcp-personas-CeB2Kcn2.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-DkmALvc7.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-7esbf4L6.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-MJJt0zm-.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";
@@ -424,7 +424,7 @@ const CHEAP_PROFILE = Object.freeze({
424
424
  });
425
425
  /**
426
426
  * The `-m cheapest` roster: the exact cheap surface and groups, but Luna-led
427
- * (`gpt-5.6-luna`/max at the 200K default window), a Gemini/high Advisor, a
427
+ * (`gpt-5.6-luna`/max at the 200K default window), a Sol/medium Advisor, a
428
428
  * Sol/high Oracle, and a Gemini/high reviewer. Oracle-only peer set, no
429
429
  * `astra`. Hard-denies match fast's: core workers, `orchestrate`, `decide`,
430
430
  * `fleet`, and `first-mate`.
@@ -575,8 +575,8 @@ const CHEAPEST_REVIEWER_ALIAS_ID = "gh-router-cheapest-reviewer-high";
575
575
  */
576
576
  const BALANCED_EXPLORE_ALIAS_ID = "gh-router-balanced-explore-high";
577
577
  const BALANCED_PLAN_ALIAS_ID = "gh-router-balanced-plan-high";
578
- const BALANCED_GENERAL_PURPOSE_ALIAS_ID = "gh-router-balanced-general-purpose-high";
579
- const BALANCED_REVIEWER_ALIAS_ID = "gh-router-balanced-reviewer-max";
578
+ const BALANCED_GENERAL_PURPOSE_ALIAS_ID = "gh-router-balanced-general-purpose-max";
579
+ const BALANCED_REVIEWER_ALIAS_ID = "gh-router-balanced-reviewer-high";
580
580
  const LUNA_SONNET_ALIAS_ID = "gh-router-luna-sonnet-xhigh";
581
581
  /**
582
582
  * Router-owned alias id for the fast profile's Haiku-tier row
@@ -630,7 +630,12 @@ function maxAliasModel(id) {
630
630
  * `/v1/messages` identity preflight), after the effort default has already
631
631
  * been read off the alias.
632
632
  */
633
- const RETIRED_FAST_ALIAS_IDS = /* @__PURE__ */ new Set([LUNA_IMPLEMENTER_ALIAS_ID, FAST_CRITIC_ALIAS_ID]);
633
+ const RETIRED_FAST_ALIAS_IDS = /* @__PURE__ */ new Set([
634
+ LUNA_IMPLEMENTER_ALIAS_ID,
635
+ FAST_CRITIC_ALIAS_ID,
636
+ "gh-router-balanced-general-purpose-high",
637
+ "gh-router-balanced-reviewer-max"
638
+ ]);
634
639
  const MODEL_ALIAS_TABLE = /* @__PURE__ */ new Map([
635
640
  [LUNA_DRIVER_ALIAS_ID, {
636
641
  aliasId: LUNA_DRIVER_ALIAS_ID,
@@ -725,12 +730,12 @@ const MODEL_ALIAS_TABLE = /* @__PURE__ */ new Map([
725
730
  [BALANCED_GENERAL_PURPOSE_ALIAS_ID, {
726
731
  aliasId: BALANCED_GENERAL_PURPOSE_ALIAS_ID,
727
732
  realModel: BALANCED_PROFILE_MODELS["General-Purpose"],
728
- absentEffortDefault: "high"
733
+ absentEffortDefault: "max"
729
734
  }],
730
735
  [BALANCED_REVIEWER_ALIAS_ID, {
731
736
  aliasId: BALANCED_REVIEWER_ALIAS_ID,
732
737
  realModel: BALANCED_PROFILE_MODELS.reviewer,
733
- absentEffortDefault: "max"
738
+ absentEffortDefault: "high"
734
739
  }],
735
740
  [SKILL_GATHER_CONTEXT_LEAD_ALIAS_ID, {
736
741
  aliasId: SKILL_GATHER_CONTEXT_LEAD_ALIAS_ID,
@@ -994,9 +999,9 @@ function formatCheapPrerequisiteFailure(missing) {
994
999
  const CHEAPEST_SUBAGENT_MIN_CONTEXT_TOKENS = CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS;
995
1000
  /**
996
1001
  * Validate the live Copilot catalog for `-m cheapest`: Luna lead at the 200K
997
- * default window, Luna Explore/Plan/GP/implementer roles, Gemini reviewer and
998
- * Advisor, and a Sol Oracle — all at the 200K default with their fixed
999
- * efforts and supported endpoints.
1002
+ * default window, Luna Explore/GP roles, a Sol Plan and Oracle, a Gemini
1003
+ * reviewer, and a Sol/medium Advisor — all at the 200K default with
1004
+ * their fixed efforts and supported endpoints.
1000
1005
  */
1001
1006
  function validateCheapestProfilePrerequisites(catalog) {
1002
1007
  const missing = [];
@@ -1041,8 +1046,8 @@ function formatCheapestPrerequisiteFailure(missing) {
1041
1046
  const BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS = BALANCED_PROFILE_SUBAGENT_CONTEXT_TOKENS;
1042
1047
  /**
1043
1048
  * Validate the live Copilot catalog for `-m balanced`: Sol lead at the 200K
1044
- * default window, Luna Explore/Reviewer roles, Sol Plan, Gemini
1045
- * General-Purpose, and a Grok Oracle — all at the 200K default with their
1049
+ * default window, Luna Explore/General-Purpose roles, Sol Plan, Gemini
1050
+ * reviewer, and a Grok Oracle — all at the 200K default with their
1046
1051
  * fixed efforts and supported endpoints.
1047
1052
  */
1048
1053
  function validateBalancedProfilePrerequisites(catalog) {
@@ -1063,13 +1068,21 @@ function validateBalancedProfilePrerequisites(catalog) {
1063
1068
  if (!supportsEffort(luna, "high") || !supportsEffort(luna, "max")) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise both "high" and "max" reasoning effort`);
1064
1069
  if (!supportsEndpoint(luna, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise a supported Responses endpoint`);
1065
1070
  }
1066
- const gemini = findModel(catalog, BALANCED_PROFILE_MODELS["General-Purpose"]);
1067
- if (!gemini) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: absent from the live catalog`);
1071
+ const generalPurpose = findModel(catalog, BALANCED_PROFILE_MODELS["General-Purpose"]);
1072
+ if (!generalPurpose) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: absent from the live catalog`);
1068
1073
  else {
1069
- if (!hasToolCalls(gemini)) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise tool_calls`);
1070
- if (!hasContextAtLeast(gemini, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: advertised context window is below the 200K subagent floor`);
1071
- if (!supportsEffort(gemini, "high")) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise a "high" reasoning effort`);
1072
- if (!supportsEndpoint(gemini, "chat")) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise a supported chat-completions endpoint`);
1074
+ if (!hasToolCalls(generalPurpose)) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise tool_calls`);
1075
+ if (!hasContextAtLeast(generalPurpose, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: advertised context window is below the 200K subagent floor`);
1076
+ if (!supportsEffort(generalPurpose, "max")) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise a "max" reasoning effort`);
1077
+ if (!supportsEndpoint(generalPurpose, "responses")) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise a supported Responses endpoint`);
1078
+ }
1079
+ const balancedReviewer = findModel(catalog, BALANCED_PROFILE_MODELS.reviewer);
1080
+ if (!balancedReviewer) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: absent from the live catalog`);
1081
+ else {
1082
+ if (!hasToolCalls(balancedReviewer)) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: does not advertise tool_calls`);
1083
+ if (!hasContextAtLeast(balancedReviewer, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: advertised context window is below the 200K subagent floor`);
1084
+ if (!supportsEffort(balancedReviewer, "high")) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: does not advertise a "high" reasoning effort`);
1085
+ if (!supportsEndpoint(balancedReviewer, "chat")) missing.push(`${BALANCED_PROFILE_MODELS.reviewer}: does not advertise a supported chat-completions endpoint`);
1073
1086
  }
1074
1087
  const grok = findModel(catalog, BALANCED_PROFILE_MODELS.oracle);
1075
1088
  if (!grok) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: absent from the live catalog`);
@@ -1440,7 +1453,7 @@ const CHEAP_PICKER_MODELS = Object.freeze([
1440
1453
  id: "gpt-5.6-luna",
1441
1454
  label: "GPT-5.6 Luna",
1442
1455
  behavesAs: "claude-opus-5",
1443
- neverOneM: true
1456
+ neverOneM: false
1444
1457
  },
1445
1458
  {
1446
1459
  id: "gemini-3.8-flash",
@@ -1466,7 +1479,7 @@ const CHEAPEST_PICKER_MODELS = Object.freeze([
1466
1479
  id: "gpt-5.6-luna",
1467
1480
  label: "GPT-5.6 Luna",
1468
1481
  behavesAs: "claude-opus-5",
1469
- neverOneM: true
1482
+ neverOneM: false
1470
1483
  },
1471
1484
  {
1472
1485
  id: "gemini-3.8-flash",
@@ -1486,7 +1499,7 @@ const BALANCED_PICKER_MODELS = Object.freeze([
1486
1499
  id: "gpt-5.6-luna",
1487
1500
  label: "GPT-5.6 Luna",
1488
1501
  behavesAs: "claude-opus-5",
1489
- neverOneM: true
1502
+ neverOneM: false
1490
1503
  },
1491
1504
  {
1492
1505
  id: "gemini-3.8-flash",
@@ -2476,7 +2489,7 @@ function collectToolFieldKeys(body) {
2476
2489
  //#endregion
2477
2490
  //#region package.json
2478
2491
  var name = "github-router";
2479
- var version = "0.3.332";
2492
+ var version = "0.3.334";
2480
2493
  //#endregion
2481
2494
  //#region src/lib/approval.ts
2482
2495
  const awaitApproval = async () => {
@@ -5649,8 +5662,9 @@ function explicitEffortOf(value) {
5649
5662
  * bare subagent slugs at the wiring layer), so this preprocess is shared.
5650
5663
  * Note the reviewer differs: fast reviews on Sonnet 5/xhigh while cheap
5651
5664
  * reviews on Luna/max, cheapest reviews on Gemini/high, and balanced reviews
5652
- * on Luna/max — all rows exist here, so each profile's reviewer resolves to
5653
- * its fixed effort.
5665
+ * on Gemini/high — all rows exist here, so each profile's reviewer resolves to
5666
+ * its fixed effort. The balanced LEAD is the other exception: bare Sol leads
5667
+ * at medium (`BALANCED_PROFILE_LEAD_EFFORT`), not the shared high.
5654
5668
  *
5655
5669
  * Pinned-profile isolation (fast/cheap/cheap1m/cheapest/balanced): only
5656
5670
  * router-provided models are accepted (anything else is `rejectedModel`).
@@ -5705,7 +5719,7 @@ function preprocessFastRequest(rawBody, launch, subagentRequest = false) {
5705
5719
  fixedEffort = alias.absentEffortDefault;
5706
5720
  parsed.model = canonicalizeAliasModel(originalModel);
5707
5721
  } else if (bare === "gpt-5.6-luna") fixedEffort = "max";
5708
- else if (bare === "gpt-5.6-sol") fixedEffort = "high";
5722
+ else if (bare === "gpt-5.6-sol") fixedEffort = profileId === "balanced" && !subagentRequest ? BALANCED_PROFILE_LEAD_EFFORT : "high";
5709
5723
  else if (bare === "grok-4.6") fixedEffort = "medium";
5710
5724
  else if (bare === "gemini-3.8-flash") fixedEffort = "high";
5711
5725
  else if (bare === "claude-sonnet-5") fixedEffort = "xhigh";
@@ -6202,14 +6216,12 @@ async function handleCompletion(c) {
6202
6216
  const maxLeadAdvisor = maxProfileRequest && !maxSubagentRequest;
6203
6217
  const cheapLeadAdvisor = cheapProfileRequest && !cheapSubagentRequest;
6204
6218
  const cheapestLeadAdvisor = cheapestProfileRequest && !cheapestSubagentRequest;
6205
- const balancedLeadAdvisor = balancedProfileRequest && !balancedSubagentRequest;
6206
6219
  const advisorEnabled = advisorRequested && !fastSubagentRequest && !maxSubagentRequest && !cheapSubagentRequest && !cheapestSubagentRequest && !balancedSubagentRequest;
6207
6220
  const fastAdvisorEnabled = fastLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
6208
6221
  const maxAdvisorEnabled = maxLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
6209
6222
  const cheapAdvisorEnabled = cheapLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
6210
6223
  const cheapestAdvisorEnabled = cheapestLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
6211
- const balancedAdvisorEnabled = balancedLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
6212
- const advisorBehaviorEnabled = fastLeadAdvisor ? fastAdvisorEnabled : cheapLeadAdvisor ? cheapAdvisorEnabled : cheapestLeadAdvisor ? cheapestAdvisorEnabled : balancedLeadAdvisor ? balancedAdvisorEnabled : maxLeadAdvisor ? maxAdvisorEnabled : advisorEnabled;
6224
+ const advisorBehaviorEnabled = balancedProfileRequest ? false : fastLeadAdvisor ? fastAdvisorEnabled : cheapLeadAdvisor ? cheapAdvisorEnabled : cheapestLeadAdvisor ? cheapestAdvisorEnabled : maxLeadAdvisor ? maxAdvisorEnabled : advisorEnabled;
6213
6225
  let fastAdvisorChoice;
6214
6226
  let maxAdvisorChoice;
6215
6227
  if (maxAdvisorEnabled) {
@@ -6248,9 +6260,9 @@ async function handleCompletion(c) {
6248
6260
  }, 503);
6249
6261
  }
6250
6262
  }
6251
- if (cheapAdvisorEnabled || balancedAdvisorEnabled) {
6263
+ if (cheapAdvisorEnabled) {
6252
6264
  const mismatch = fastAdvisorMetadataMismatch(rawBody);
6253
- const relaunchProfile = identity.launch?.profileId === "cheap1m" ? "cheap1m" : identity.launch?.profileId === "balanced" ? "balanced" : "cheap";
6265
+ const relaunchProfile = identity.launch?.profileId === "cheap1m" ? "cheap1m" : "cheap";
6254
6266
  if (mismatch) return c.json({
6255
6267
  type: "error",
6256
6268
  error: {
@@ -6341,7 +6353,7 @@ async function handleCompletion(c) {
6341
6353
  parsedBase = JSON.parse(promptWindowBody);
6342
6354
  } catch {}
6343
6355
  const wantsStream = parsedBase?.stream === true;
6344
- if ((fastAdvisorEnabled || cheapAdvisorEnabled || cheapestAdvisorEnabled || balancedAdvisorEnabled || maxAdvisorEnabled) && wantsStream) {
6356
+ if ((fastAdvisorEnabled || cheapAdvisorEnabled || cheapestAdvisorEnabled || maxAdvisorEnabled) && wantsStream) {
6345
6357
  const initialConversation = Array.isArray(parsedBase.messages) ? parsedBase.messages : [];
6346
6358
  const parsedInitial = parseAnthropicRequest(parsedBase, modelId, selectedModel);
6347
6359
  const translatedAdvisorAborter = new AbortController();
@@ -6364,7 +6376,7 @@ async function handleCompletion(c) {
6364
6376
  effort: maxAdvisorChoice.effort,
6365
6377
  escalated: false,
6366
6378
  fastProfile: false
6367
- } : cheapAdvisorEnabled || cheapestAdvisorEnabled || balancedAdvisorEnabled ? {
6379
+ } : cheapAdvisorEnabled || cheapestAdvisorEnabled ? {
6368
6380
  model: fastAdvisorChoice.model,
6369
6381
  effort: resolveAdvisorEffort(rawBody, fastAdvisorChoice.model, true),
6370
6382
  escalated: fastAdvisorChoice.escalated,
@@ -6384,7 +6396,7 @@ async function handleCompletion(c) {
6384
6396
  advisorEscalated: advisorChoice.escalated,
6385
6397
  advisorFastProfile: advisorChoice.fastProfile,
6386
6398
  advisorMaxProfile: maxAdvisorEnabled,
6387
- advisorCheapProfile: cheapAdvisorEnabled || cheapestAdvisorEnabled || balancedAdvisorEnabled,
6399
+ advisorCheapProfile: cheapAdvisorEnabled || cheapestAdvisorEnabled,
6388
6400
  advisorEffort: advisorChoice.effort,
6389
6401
  externalAborter: translatedAdvisorAborter,
6390
6402
  continueTurn: makeShimContinueTurn(endpoint, {
@@ -6507,10 +6519,10 @@ async function handleCompletion(c) {
6507
6519
  requestHeaders,
6508
6520
  advisorModel: advisorChoice.model,
6509
6521
  advisorEscalated: advisorChoice.escalated,
6510
- advisorFastProfile: fastLeadAdvisor || cheapLeadAdvisor || cheapestLeadAdvisor || balancedLeadAdvisor,
6522
+ advisorFastProfile: fastLeadAdvisor || cheapLeadAdvisor || cheapestLeadAdvisor,
6511
6523
  advisorMaxProfile: maxAdvisorEnabled,
6512
- advisorCheapProfile: cheapLeadAdvisor || cheapestLeadAdvisor || balancedLeadAdvisor,
6513
- advisorEffort: maxAdvisorChoice ? maxAdvisorChoice.effort : resolveAdvisorEffort(rawBody, advisorChoice.model, fastLeadAdvisor || cheapLeadAdvisor || cheapestLeadAdvisor || balancedLeadAdvisor),
6524
+ advisorCheapProfile: cheapLeadAdvisor || cheapestLeadAdvisor,
6525
+ advisorEffort: maxAdvisorChoice ? maxAdvisorChoice.effort : resolveAdvisorEffort(rawBody, advisorChoice.model, fastLeadAdvisor || cheapLeadAdvisor || cheapestLeadAdvisor),
6514
6526
  externalAborter: advisorAborter
6515
6527
  }), {
6516
6528
  status: response.status,
@@ -7972,6 +7984,7 @@ function getClaudeCodeEnvVars(serverUrl, model, launchProfileId = "standard", pi
7972
7984
  const mcpToolTimeoutMs = String(resolveMcpToolTimeoutMs());
7973
7985
  if (process.env.MCP_TIMEOUT === void 0) vars.MCP_TIMEOUT = mcpToolTimeoutMs;
7974
7986
  if (process.env.MCP_TOOL_TIMEOUT === void 0) vars.MCP_TOOL_TIMEOUT = mcpToolTimeoutMs;
7987
+ if (process.env.ENABLE_TOOL_SEARCH === void 0) vars.ENABLE_TOOL_SEARCH = "auto";
7975
7988
  const isFastProfile = launchProfileId === "fast";
7976
7989
  const isMaxProfile = launchProfileId === "max";
7977
7990
  const isCheapProfile = launchProfileId === "cheap" || launchProfileId === "cheap1m" || launchProfileId === "cheapest";
@@ -8125,4 +8138,4 @@ function getCodexEnvVars(serverUrl) {
8125
8138
  //#endregion
8126
8139
  export { profileDescriptor as A, updateClaude as B, CHEAP_REVIEWER_ALIAS_ID as C, formatCheapPrerequisiteFailure as D, formatCheap1mPrerequisiteFailure as E, validateCheapestProfilePrerequisites as F, validateFastProfilePrerequisites as I, validateMaxProfileLaunch as L, validateBalancedProfilePrerequisites as M, validateCheap1mProfilePrerequisites as N, formatCheapestPrerequisiteFailure as O, validateCheapProfilePrerequisites as P, runSelfUpdate as R, CHEAP_PLAN_ALIAS_ID as S, formatBalancedPrerequisiteFailure as T, CHEAPEST_GENERAL_PURPOSE_ALIAS_ID as _, sharedServerArgs as a, CHEAP_EXPLORE_ALIAS_ID as b, stopKeepAwake as c, enableFileLogging as d, BALANCED_EXPLORE_ALIAS_ID as f, CHEAPEST_EXPLORE_ALIAS_ID as g, BALANCED_REVIEWER_ALIAS_ID as h, setupAndServe as i, resolveLaunchProfile as j, formatFastPrerequisiteFailure as k, injectModelPickerSettingsFile as l, BALANCED_PLAN_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, CHEAPEST_PLAN_ALIAS_ID as v, LUNA_SCOUT_ALIAS_ID as w, CHEAP_GENERAL_PURPOSE_ALIAS_ID as x, CHEAPEST_REVIEWER_ALIAS_ID as y, checkClaudeVersion as z };
8127
8140
 
8128
- //# sourceMappingURL=server-setup-CK3O_Hwf.js.map
8141
+ //# sourceMappingURL=server-setup-aZtjyebO.js.map