github-router 0.3.350 → 0.3.352

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 (146) hide show
  1. package/NOTICE +72 -0
  2. package/README.md +19 -0
  3. package/dist/ado-tools-xbuVU7YN.js +1 -0
  4. package/dist/{aic-ledger-D4oMcg7c.js → aic-ledger-BdvCgRmx.js} +3 -3
  5. package/dist/{aic-ledger-D4oMcg7c.js.map → aic-ledger-BdvCgRmx.js.map} +1 -1
  6. package/dist/{aic-statusline-settings-DCFywz3N.js → aic-statusline-settings-LnoxjBPe.js} +2 -2
  7. package/dist/{aic-statusline-settings-DCFywz3N.js.map → aic-statusline-settings-LnoxjBPe.js.map} +1 -1
  8. package/dist/{attribution-settings-B9T-EsEs.js → attribution-settings-ul6VU6iP.js} +11 -650
  9. package/dist/attribution-settings-ul6VU6iP.js.map +1 -0
  10. package/dist/{auth-Cgsy2T0s.js → auth-a_1lXYZ1.js} +4 -4
  11. package/dist/{auth-Cgsy2T0s.js.map → auth-a_1lXYZ1.js.map} +1 -1
  12. package/dist/{bluebird-client-DpYl1YmJ.js → bluebird-client-ltPIiyJU.js} +1103 -499
  13. package/dist/bluebird-client-ltPIiyJU.js.map +1 -0
  14. package/dist/bluebird-client-mr3M67k-.js +1 -0
  15. package/dist/browser-bridge/index.js +116 -98
  16. package/dist/browser-ext/manifest.json +1 -1
  17. package/dist/{check-usage-26G2hw_F.js → check-usage-Bsbc-Sn6.js} +4 -4
  18. package/dist/{check-usage-26G2hw_F.js.map → check-usage-Bsbc-Sn6.js.map} +1 -1
  19. package/dist/claude-md-injection-BoXOsg7h.js +669 -0
  20. package/dist/claude-md-injection-BoXOsg7h.js.map +1 -0
  21. package/dist/{claude-BY4e9ueE.js → claude-xO1XW-Nn.js} +79 -51
  22. package/dist/claude-xO1XW-Nn.js.map +1 -0
  23. package/dist/{codex-BOugL-uX.js → codex-DzUR40JA.js} +10 -8
  24. package/dist/{codex-BOugL-uX.js.map → codex-DzUR40JA.js.map} +1 -1
  25. package/dist/{copilot-discount-CilBhKQW.js → copilot-discount-C3jfysK-.js} +2 -2
  26. package/dist/{copilot-discount-CilBhKQW.js.map → copilot-discount-C3jfysK-.js.map} +1 -1
  27. package/dist/{debug-CigFsS-h.js → debug-BtqbflcL.js} +2 -2
  28. package/dist/{debug-CigFsS-h.js.map → debug-BtqbflcL.js.map} +1 -1
  29. package/dist/engine-DwLIk1Zn.js +1 -0
  30. package/dist/{exec-MCU1H-KZ.js → exec-Bf8g_bIR.js} +27 -2
  31. package/dist/exec-Bf8g_bIR.js.map +1 -0
  32. package/dist/{gate-discovery-BFqulsWz.js → gate-discovery-Cvdko01z.js} +6 -6
  33. package/dist/{gate-discovery-BFqulsWz.js.map → gate-discovery-Cvdko01z.js.map} +1 -1
  34. package/dist/{get-copilot-usage-C_6ast5h.js → get-copilot-usage-0_S8pRWJ.js} +3 -3
  35. package/dist/{get-copilot-usage-C_6ast5h.js.map → get-copilot-usage-0_S8pRWJ.js.map} +1 -1
  36. package/dist/{hook-mcp-client-BRL_y-bz.js → hook-mcp-client-DERIkeR7.js} +5 -3
  37. package/dist/{hook-mcp-client-BRL_y-bz.js.map → hook-mcp-client-DERIkeR7.js.map} +1 -1
  38. package/dist/hooks.mjs +10998 -6840
  39. package/dist/hooks.sha256 +1 -1
  40. package/dist/{index-cmd-DXYWgKS6.js → index-cmd-CJXUOH4q.js} +5 -5
  41. package/dist/{index-cmd-DXYWgKS6.js.map → index-cmd-CJXUOH4q.js.map} +1 -1
  42. package/dist/{internal-aic-status-lM0YNDaH.js → internal-aic-status-Dmi2bCsR.js} +4 -4
  43. package/dist/{internal-aic-status-lM0YNDaH.js.map → internal-aic-status-Dmi2bCsR.js.map} +1 -1
  44. package/dist/{internal-artifact-open-DErO3WpR.js → internal-artifact-open-C67gDjKo.js} +2 -2
  45. package/dist/{internal-artifact-open-DErO3WpR.js.map → internal-artifact-open-C67gDjKo.js.map} +1 -1
  46. package/dist/{internal-fast-dispatch-guard-DRsZJ-Rg.js → internal-fast-dispatch-guard-BQm1MI9d.js} +2 -2
  47. package/dist/{internal-fast-dispatch-guard-DRsZJ-Rg.js.map → internal-fast-dispatch-guard-BQm1MI9d.js.map} +1 -1
  48. package/dist/internal-fast-dispatch-guard-Cv7zf0ZI.js +1 -0
  49. package/dist/{internal-first-mate-guard-BEwDjHfX.js → internal-first-mate-guard-BJvCsVlU.js} +3 -3
  50. package/dist/{internal-first-mate-guard-BEwDjHfX.js.map → internal-first-mate-guard-BJvCsVlU.js.map} +1 -1
  51. package/dist/internal-first-mate-guard-D-IQGiTs.js +1 -0
  52. package/dist/{internal-max-dispatch-guard-DSjJwVH2.js → internal-max-dispatch-guard-DkJixDmG.js} +7 -5
  53. package/dist/{internal-max-dispatch-guard-DSjJwVH2.js.map → internal-max-dispatch-guard-DkJixDmG.js.map} +1 -1
  54. package/dist/internal-max-dispatch-guard-T-M7DRIW.js +1 -0
  55. package/dist/{internal-plan-review-DbX-mr9i.js → internal-plan-review-DIvaBBUd.js} +4 -4
  56. package/dist/{internal-plan-review-DbX-mr9i.js.map → internal-plan-review-DIvaBBUd.js.map} +1 -1
  57. package/dist/internal-prompt-submit-6OXEdQCK.js +2 -0
  58. package/dist/internal-prompt-submit-B9MJxc3K.js +194 -0
  59. package/dist/internal-prompt-submit-B9MJxc3K.js.map +1 -0
  60. package/dist/{internal-rebrief-BH9PMJhF.js → internal-rebrief-zIdunX3R.js} +6 -6
  61. package/dist/{internal-rebrief-BH9PMJhF.js.map → internal-rebrief-zIdunX3R.js.map} +1 -1
  62. package/dist/{internal-session-bind-DxdVbJ7x.js → internal-session-bind-CQLDPuTx.js} +2 -2
  63. package/dist/{internal-session-bind-DxdVbJ7x.js.map → internal-session-bind-CQLDPuTx.js.map} +1 -1
  64. package/dist/{internal-stop-hook-DlGc9WwJ.js → internal-stop-hook-DGcRVh_2.js} +7 -7
  65. package/dist/{internal-stop-hook-DlGc9WwJ.js.map → internal-stop-hook-DGcRVh_2.js.map} +1 -1
  66. package/dist/{internal-stop-review-CORT3UGr.js → internal-stop-review-X7zRRhyc.js} +3 -3
  67. package/dist/{internal-stop-review-CORT3UGr.js.map → internal-stop-review-X7zRRhyc.js.map} +1 -1
  68. package/dist/{internal-worker-guard-C0FJ4b29.js → internal-worker-guard-wP3UN-3D.js} +2 -2
  69. package/dist/{internal-worker-guard-C0FJ4b29.js.map → internal-worker-guard-wP3UN-3D.js.map} +1 -1
  70. package/dist/{internal-workspace-header-tvJVAXpv.js → internal-workspace-header-DiUnkUeU.js} +2 -2
  71. package/dist/{internal-workspace-header-tvJVAXpv.js.map → internal-workspace-header-DiUnkUeU.js.map} +1 -1
  72. package/dist/lib/tree-sitter-pool/worker.js +1 -2
  73. package/dist/{lifecycle-BqWTXaeC.js → lifecycle-BJ83L0tz.js} +3 -3
  74. package/dist/{lifecycle-BqWTXaeC.js.map → lifecycle-BJ83L0tz.js.map} +1 -1
  75. package/dist/lifecycle-CVg2-zQ3.js +1 -0
  76. package/dist/lifecycle-Dk_BHtfz.js +1 -0
  77. package/dist/{lifecycle-kpLzHUgD.js → lifecycle-aApO0hZW.js} +2 -2
  78. package/dist/{lifecycle-kpLzHUgD.js.map → lifecycle-aApO0hZW.js.map} +1 -1
  79. package/dist/main.js +23 -23
  80. package/dist/{max-profile-contract--dAYkEG1.js → max-profile-contract-DQDEDCsR.js} +2 -2
  81. package/dist/{max-profile-contract--dAYkEG1.js.map → max-profile-contract-DQDEDCsR.js.map} +1 -1
  82. package/dist/{mcp-workspace-header-B77WqVFw.js → mcp-workspace-header-DBQugQlQ.js} +2 -2
  83. package/dist/{mcp-workspace-header-B77WqVFw.js.map → mcp-workspace-header-DBQugQlQ.js.map} +1 -1
  84. package/dist/{models-BGCeGVXl.js → models-JIvKAGn0.js} +3 -3
  85. package/dist/{models-BGCeGVXl.js.map → models-JIvKAGn0.js.map} +1 -1
  86. package/dist/{orchestration-Dkqv-iv0.js → orchestration-D-S_0GVt.js} +3 -3
  87. package/dist/{orchestration-Dkqv-iv0.js.map → orchestration-D-S_0GVt.js.map} +1 -1
  88. package/dist/paths-C9x5U3dO.js +1 -0
  89. package/dist/{paths-CpbTHKeP.js → paths-xTSEAWfN.js} +115 -22
  90. package/dist/paths-xTSEAWfN.js.map +1 -0
  91. package/dist/{peer-mcp-personas-BwwSNnBC.js → peer-mcp-personas-DDMKRFFG.js} +2350 -836
  92. package/dist/peer-mcp-personas-DDMKRFFG.js.map +1 -0
  93. package/dist/{pi-Dpw8Otxw.js → pi-jVNeQXWf.js} +362 -37
  94. package/dist/pi-jVNeQXWf.js.map +1 -0
  95. package/dist/{plan-review-hook-LfG01VMp.js → plan-review-hook-BQ29WGv7.js} +5 -5
  96. package/dist/{plan-review-hook-LfG01VMp.js.map → plan-review-hook-BQ29WGv7.js.map} +1 -1
  97. package/dist/{provision-9TAIgyL7.js → provision-BtYRtvrj.js} +26 -18
  98. package/dist/provision-BtYRtvrj.js.map +1 -0
  99. package/dist/{self-invocation-DIUyoRgL.js → self-invocation-Dr5zlbpM.js} +2 -2
  100. package/dist/{self-invocation-DIUyoRgL.js.map → self-invocation-Dr5zlbpM.js.map} +1 -1
  101. package/dist/{serve-BRKRWkd1.js → serve-CmgmxigM.js} +35 -17
  102. package/dist/serve-CmgmxigM.js.map +1 -0
  103. package/dist/{server-setup-DXVFE7bf.js → server-setup-DinOFWiC.js} +393 -42
  104. package/dist/server-setup-DinOFWiC.js.map +1 -0
  105. package/dist/{service-backend-7SPDLUB9.js → service-backend-DV1u5x0Q.js} +51 -23
  106. package/dist/service-backend-DV1u5x0Q.js.map +1 -0
  107. package/dist/{start-CoR3jqUR.js → start-Dgsaz0HM.js} +4 -4
  108. package/dist/{start-CoR3jqUR.js.map → start-Dgsaz0HM.js.map} +1 -1
  109. package/dist/{state-CVp30CBF.js → state-CfEVoqBM.js} +8 -1
  110. package/dist/{state-CVp30CBF.js.map → state-CfEVoqBM.js.map} +1 -1
  111. package/dist/{prompt-submit-hook-DzhmQRs_.js → static-context-pack-CyucviRD.js} +402 -4
  112. package/dist/static-context-pack-CyucviRD.js.map +1 -0
  113. package/dist/{stop-gate-hook-C9VNxmt1.js → stop-gate-hook-BYd0NruJ.js} +4 -4
  114. package/dist/{stop-gate-hook-C9VNxmt1.js.map → stop-gate-hook-BYd0NruJ.js.map} +1 -1
  115. package/dist/{stop-gate-policy-DQsfjnsx.js → stop-gate-policy-FGAfpfc-.js} +3 -3
  116. package/dist/{stop-gate-policy-DQsfjnsx.js.map → stop-gate-policy-FGAfpfc-.js.map} +1 -1
  117. package/dist/{token-s5Wd-Kwr.js → token-CTf5jCmP.js} +7 -5
  118. package/dist/{token-s5Wd-Kwr.js.map → token-CTf5jCmP.js.map} +1 -1
  119. package/dist/{worker-dispatch-lRhno09M.js → worker-dispatch-BjfROaic.js} +2 -2
  120. package/dist/{worker-dispatch-lRhno09M.js.map → worker-dispatch-BjfROaic.js.map} +1 -1
  121. package/docs/azure-mcp.md +453 -0
  122. package/docs/bluebird-search.md +96 -7
  123. package/package.json +22 -22
  124. package/dist/attribution-settings-B9T-EsEs.js.map +0 -1
  125. package/dist/bluebird-client-DpYl1YmJ.js.map +0 -1
  126. package/dist/bluebird-client-bn9Yv6Cb.js +0 -2
  127. package/dist/claude-BY4e9ueE.js.map +0 -1
  128. package/dist/engine-DZfLaVcf.js +0 -2
  129. package/dist/exec-MCU1H-KZ.js.map +0 -1
  130. package/dist/internal-fast-dispatch-guard-DeZ6KilC.js +0 -2
  131. package/dist/internal-first-mate-guard-CAefr6Ce.js +0 -2
  132. package/dist/internal-max-dispatch-guard-KmbYwh7h.js +0 -2
  133. package/dist/internal-prompt-submit-CA5Y4DWM.js +0 -2
  134. package/dist/internal-prompt-submit-UhfnM_qG.js +0 -573
  135. package/dist/internal-prompt-submit-UhfnM_qG.js.map +0 -1
  136. package/dist/lifecycle-DMRZswwc.js +0 -2
  137. package/dist/lifecycle-FT75ohVw.js +0 -2
  138. package/dist/paths-CpbTHKeP.js.map +0 -1
  139. package/dist/paths-Dfivvq21.js +0 -2
  140. package/dist/peer-mcp-personas-BwwSNnBC.js.map +0 -1
  141. package/dist/pi-Dpw8Otxw.js.map +0 -1
  142. package/dist/prompt-submit-hook-DzhmQRs_.js.map +0 -1
  143. package/dist/provision-9TAIgyL7.js.map +0 -1
  144. package/dist/serve-BRKRWkd1.js.map +0 -1
  145. package/dist/server-setup-DXVFE7bf.js.map +0 -1
  146. package/dist/service-backend-7SPDLUB9.js.map +0 -1
@@ -1,15 +1,16 @@
1
- import { F as provisionTreeSitterAssets, I as withInstallLock } from "./service-backend-7SPDLUB9.js";
1
+ import { I as provisionTreeSitterAssets, L as withInstallLock } from "./service-backend-DV1u5x0Q.js";
2
2
  import { t as getPackageVersion } from "./version-C8x2hQrZ.js";
3
- import { i as ensurePaths, t as PATHS } from "./paths-CpbTHKeP.js";
4
- import { t as state } from "./state-CVp30CBF.js";
5
- import { _ as forwardError, a as cacheCopilotVersion, b as copilotBaseUrl, c as filterBetaHeader, d as resolveModel, f as sleep, g as HTTPError, i as tryRefreshAndRetry, l as isNullish, n as setupGitHubAgentToken, o as cacheModels, r as setupGitHubToken, s as cacheVSCodeVersion, t as setupCopilotToken, x as copilotHeaders } from "./token-s5Wd-Kwr.js";
3
+ import { i as ensurePaths, t as PATHS } from "./paths-xTSEAWfN.js";
4
+ import { t as state } from "./state-CfEVoqBM.js";
5
+ import { _ as forwardError, a as cacheCopilotVersion, b as copilotBaseUrl, c as filterBetaHeader, d as resolveModel, f as sleep, g as HTTPError, i as tryRefreshAndRetry, l as isNullish, n as setupGitHubAgentToken, o as cacheModels, r as setupGitHubToken, s as cacheVSCodeVersion, t as setupCopilotToken, x as copilotHeaders } from "./token-CTf5jCmP.js";
6
6
  import { r as fetchWithTransientRetry } from "./upstream-retry-i1k1Xai2.js";
7
- import { t as getCopilotUsage } from "./get-copilot-usage-C_6ast5h.js";
8
- import { c as runCommandVoid, i as parseBoolEnv, o as resolveExecutable, r as killManagedTree, s as runCommandCapture } from "./exec-MCU1H-KZ.js";
7
+ import { t as getCopilotUsage } from "./get-copilot-usage-0_S8pRWJ.js";
8
+ import { a as parseBoolEnv, c as runCommandCapture, i as killManagedTree, s as resolveExecutable, u as runCommandVoid } from "./exec-Bf8g_bIR.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-XiIj4O1U.js";
10
- import { $ as readIteratorWithTimeout, $t as createChatCompletions, An as oneMContextDisabled, B as injectAdvisorTool, Bt as shimDefaultsToXhigh, Cn as isBudgetClaudeLead, D as toolbeltEnabled, Dn as upstreamMaxConnections, En as upstreamAllowH2, F as ADVISOR_TOOL_INSTRUCTIONS, G as formatThinkingRepairDecline, Gn as CHEAP_PROFILE_NATIVE_AGENT_NAMES, Gt as getTokenizerFromModel, H as resolveAdvisorEffort, Hn as CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS, Ht as createMessages, I as CHEAPEST_ADVISOR_TOOL_INSTRUCTIONS, In as CHEAPEST_PROFILE_MODELS, J as repairRejectedThinkingHistory, Jn as CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS, K as rememberThinkingHistoryRepair, Kt as findLaunchBySecret, L as CHEAPEST_REVIEWER_ADVISOR_TOOL_INSTRUCTIONS, Ln as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, Mn as withOneMSuffixForLead, N as searchWeb, Nn as CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL, On as classifyMessagesRoute, P as ADVISOR_INTERNAL_TOOL_NAME, Q as logStreamError, Qt as createResponses, R as FAST_ADVISOR_TOOL_INSTRUCTIONS, Sn as generateRandomPort, U as resolveAdvisorModel, Un as CHEAP_PROFILE_ADVISOR_CLIENT_MODEL, Ut as getTextTokenCount, V as isAdvisorRequested, Vt as countTokens, W as resolveCheapestAdvisorModel, Wn as CHEAP_PROFILE_MODELS, Wt as getTokenCount, X as buildOpenAIErrorEvent, Xt as warnOnTokenPriceDrift, Y as buildAnthropicErrorEvent, Yt as assembleResponsesPayload, Z as isControllerClosedError, Zt as resolveMcpToolTimeoutMs, at as handleMcpDelete, bn as UPSTREAM_FETCH_TIMEOUT_MS, en as MAX_RESPONSE_BODY_BYTES, et as relayAnthropicStream, hn as BUDGET_SMALL_FAST_SLUG, i as assertMcpToolSurfaceConsistent, it as clampEffort, jn as withOneMSuffix, kn as catalogAdvertises1M, nn as parseJsonOrDiagnose, nt as UNKNOWN_EFFORT_ANCHOR, ot as handleMcpPost, pn as toolbeltPathOverride, q as repairKnownThinkingHistory, rn as normalizeOpenAIUsage, rt as bucketEffort, st as agentToolsEnabled, tn as readResponseBodyCapped, tt as EFFORT_ORDER, xn as UPSTREAM_INACTIVITY_TIMEOUT_MS, z as buildAdvisorStream } from "./peer-mcp-personas-BwwSNnBC.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--dAYkEG1.js";
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-D4oMcg7c.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";
12
+ import { f as getAzureRepoFromGit } from "./bluebird-client-ltPIiyJU.js";
13
+ 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";
13
14
  import consola from "consola";
14
15
  import fs, { existsSync } from "node:fs";
15
16
  import path from "node:path";
@@ -306,15 +307,22 @@ async function getLatestVersion(npmPath) {
306
307
  * shutdown, or racing each other (callers hold `withInstallLock`
307
308
  * before queueing).
308
309
  */
309
- function queueDetachedGlobalInstall(npmPath, spec) {
310
+ function queueDetachedGlobalInstall(npmPath, spec, extraArgs = []) {
311
+ const parentPid = process.pid;
312
+ const installArgs = [
313
+ "install",
314
+ "-g",
315
+ spec,
316
+ ...extraArgs
317
+ ];
310
318
  const waiter = `
311
- const pid = ${process.pid};
319
+ const pid = ${parentPid};
312
320
  const { spawn } = require("node:child_process");
313
321
  function alive() { try { process.kill(pid, 0); return true } catch { return false } }
314
322
  const timer = setInterval(() => {
315
323
  if (alive()) return;
316
324
  clearInterval(timer);
317
- const args = ["install", "-g", ${JSON.stringify(spec)}, "--silent"];
325
+ const args = [...${JSON.stringify(installArgs)}, "--silent"];
318
326
  const isWin = process.platform === "win32";
319
327
  const child = spawn(${JSON.stringify(npmPath)}, args, {
320
328
  stdio: "ignore", windowsHide: true, shell: isWin, detached: !isWin,
@@ -387,7 +395,9 @@ const FAST_PROFILE = Object.freeze({
387
395
  "peers",
388
396
  "search",
389
397
  "workers",
390
- "browser"
398
+ "browser",
399
+ "ado",
400
+ "kusto"
391
401
  ]),
392
402
  hasCoordinator: false
393
403
  });
@@ -407,7 +417,9 @@ const CHEAP1M_PROFILE = Object.freeze({
407
417
  "peers",
408
418
  "search",
409
419
  "workers",
410
- "browser"
420
+ "browser",
421
+ "ado",
422
+ "kusto"
411
423
  ]),
412
424
  hasCoordinator: false
413
425
  });
@@ -427,7 +439,9 @@ const CHEAP_PROFILE = Object.freeze({
427
439
  "peers",
428
440
  "search",
429
441
  "workers",
430
- "browser"
442
+ "browser",
443
+ "ado",
444
+ "kusto"
431
445
  ]),
432
446
  hasCoordinator: false
433
447
  });
@@ -448,17 +462,19 @@ const CHEAPEST_PROFILE = Object.freeze({
448
462
  "peers",
449
463
  "search",
450
464
  "workers",
451
- "browser"
465
+ "browser",
466
+ "ado",
467
+ "kusto"
452
468
  ]),
453
469
  hasCoordinator: false
454
470
  });
455
471
  /**
456
- * The `-m balanced` roster: the most-complex-tasks tier. A Sol/high lead at
457
- * the 200K default window, a three-agent surface (`Explore`/
458
- * `General-Purpose`/`reviewer`, every role at 200K — no `Plan`: the lead
459
- * owns planning), and the Grok-4.6/medium Oracle-only peer set. Hard-denies
460
- * match fast's: core workers, `orchestrate`, `decide`, `fleet`, and
461
- * `first-mate`.
472
+ * The `-m balanced` roster: the most-complex-tasks tier. A Sol/medium lead
473
+ * (`BALANCED_PROFILE_LEAD_EFFORT`) at the 200K default window, a three-agent
474
+ * surface (`Explore`/`General-Purpose`/`reviewer`, every role at 200K — no
475
+ * `Plan`: the lead owns planning), and the Grok-4.6/medium Oracle-only peer
476
+ * set. Hard-denies match fast's: core workers, `orchestrate`, `decide`,
477
+ * `fleet`, and `first-mate`.
462
478
  */
463
479
  const BALANCED_PROFILE = Object.freeze({
464
480
  id: "balanced",
@@ -468,7 +484,9 @@ const BALANCED_PROFILE = Object.freeze({
468
484
  "peers",
469
485
  "search",
470
486
  "workers",
471
- "browser"
487
+ "browser",
488
+ "ado",
489
+ "kusto"
472
490
  ]),
473
491
  hasCoordinator: false
474
492
  });
@@ -498,7 +516,9 @@ const MAX_PROFILE = Object.freeze({
498
516
  "browser",
499
517
  "decide",
500
518
  "fleet",
501
- "first-mate"
519
+ "first-mate",
520
+ "ado",
521
+ "kusto"
502
522
  ]),
503
523
  hasCoordinator: true
504
524
  });
@@ -1097,6 +1117,7 @@ function validateBalancedProfilePrerequisites(catalog, opts = {}) {
1097
1117
  if (!hasToolCalls(sol)) missing.push(`${BALANCED_PROFILE_MODELS.lead}: does not advertise tool_calls`);
1098
1118
  if (!hasContextAtLeast(sol, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.lead}: advertised context window is below the 200K subagent floor`);
1099
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)`);
1100
1121
  if (!supportsEndpoint(sol, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.lead}: does not advertise a supported Responses endpoint`);
1101
1122
  }
1102
1123
  if (peers) {
@@ -1483,7 +1504,7 @@ const MAX_PICKER_MODELS = Object.freeze([
1483
1504
  behavesAs: "claude-opus-5.5"
1484
1505
  }
1485
1506
  ]);
1486
- const CHEAP_PICKER_MODELS = Object.freeze([
1507
+ const CHEAP1M_PICKER_MODELS = Object.freeze([
1487
1508
  {
1488
1509
  id: "gpt-5.6-sol",
1489
1510
  label: "GPT-5.6 Sol",
@@ -1509,7 +1530,7 @@ const CHEAP_PICKER_MODELS = Object.freeze([
1509
1530
  neverOneM: true
1510
1531
  }
1511
1532
  ]);
1512
- const CHEAPEST_PICKER_MODELS = Object.freeze([
1533
+ const CHEAP_PICKER_MODELS = Object.freeze([
1513
1534
  {
1514
1535
  id: "gpt-5.6-sol",
1515
1536
  label: "GPT-5.6 Sol",
@@ -1523,12 +1544,29 @@ const CHEAPEST_PICKER_MODELS = Object.freeze([
1523
1544
  neverOneM: true
1524
1545
  },
1525
1546
  {
1526
- id: "gpt-6-luna",
1527
- label: "GPT-6 Luna (1M)",
1528
- behavesAs: "claude-opus-5.5",
1529
- neverOneM: false
1547
+ id: "gemini-3.8-flash",
1548
+ label: "Gemini 3.8 Flash",
1549
+ behavesAs: "claude-sonnet-5",
1550
+ neverOneM: true
1551
+ },
1552
+ {
1553
+ id: "grok-4.6",
1554
+ label: "Grok 4.6",
1555
+ behavesAs: "claude-sonnet-5",
1556
+ neverOneM: true
1530
1557
  }
1531
1558
  ]);
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
+ }]);
1532
1570
  const BALANCED_PICKER_MODELS = Object.freeze([
1533
1571
  {
1534
1572
  id: "gpt-5.6-sol",
@@ -1540,7 +1578,7 @@ const BALANCED_PICKER_MODELS = Object.freeze([
1540
1578
  id: "gpt-6-luna",
1541
1579
  label: "GPT-6 Luna",
1542
1580
  behavesAs: "claude-opus-5.5",
1543
- neverOneM: false
1581
+ neverOneM: true
1544
1582
  },
1545
1583
  {
1546
1584
  id: "grok-4.6",
@@ -1566,7 +1604,7 @@ function selectableModelsInCatalog(profile) {
1566
1604
  const catalog = state.models?.data;
1567
1605
  if (!catalog || catalog.length === 0) return [];
1568
1606
  const present = new Set(catalog.map((entry) => entry.id));
1569
- return (profile === "max" ? MAX_PICKER_MODELS : profile === "cheap" || profile === "cheap1m" ? CHEAP_PICKER_MODELS : profile === "cheapest" ? CHEAPEST_PICKER_MODELS : profile === "balanced" ? BALANCED_PICKER_MODELS : STANDARD_PICKER_MODELS).filter((entry) => present.has(entry.id)).map((entry) => ({
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) => ({
1570
1608
  model: entry.neverOneM ? entry.id : withOneMSuffix(entry.id),
1571
1609
  label: entry.label,
1572
1610
  behavesAs: entry.behavesAs
@@ -1970,6 +2008,233 @@ async function stopKeepAwake() {
1970
2008
  releaseSync();
1971
2009
  }
1972
2010
  //#endregion
2011
+ //#region src/lib/azure-mcp-flags.ts
2012
+ /**
2013
+ * Which Azure-backed MCP surfaces this launch enables, and why.
2014
+ *
2015
+ * Three surfaces share one discovery signal: the workspace's git remotes. A
2016
+ * checkout whose `origin` is an Azure DevOps repository turns Bluebird code
2017
+ * search, the Azure DevOps MCP group and the Kusto group on by default. The rule
2018
+ * exists because that remote is already proof this is an Azure workspace, and
2019
+ * the alternative — an opt-in flag every session — meant nobody enabled them.
2020
+ *
2021
+ * Kusto joined that rule later, when the cluster became a per-call argument.
2022
+ * What kept it out before was that a git remote carries no cluster identity, so
2023
+ * a discovery-enabled group would have advertised five tools that could not
2024
+ * answer anything. With the cluster named per call, the same remote that says
2025
+ * "this is an Azure workspace" is enough to offer the tool, and the operator
2026
+ * still owns the only thing that bounds what it can read: their own identity in
2027
+ * the cluster. See `resolveAzureMcpFlags` for where the three surfaces'
2028
+ * precedence tables and one banner live.
2029
+ *
2030
+ * **The trust question is answered, not ignored.** A cloned repository's
2031
+ * `origin` is attacker-controllable, so with this rule opening someone else's
2032
+ * repo would silently provision three credentialed network clients. Four
2033
+ * properties bound that:
2034
+ *
2035
+ * 1. Auto-enable can never produce a WRITE surface. `--ado-write` is a flag
2036
+ * only; nothing discovered from a remote clears `X-MCP-Readonly`.
2037
+ * 2. Every surface is suppressible individually (`--no-bluebird`,
2038
+ * `--no-ado`, `--no-kusto`, or the `GH_ROUTER_DISABLE_*` env vars) and
2039
+ * wholesale (`GH_ROUTER_AZURE_MCPS=off`), and an explicit negative always
2040
+ * beats an explicit positive.
2041
+ * 3. The launch banner names both the enabled set and, per surface, the CAUSE
2042
+ * that enabled it, so a session that suddenly carries three more servers is
2043
+ * explainable rather than mysterious — and so a surface turned on by a
2044
+ * 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.
2051
+ *
2052
+ * This is a deliberate difference from the deny-by-default
2053
+ * `GH_ROUTER_FM_SCAFFOLD_REPOS` precedent: that allowlist guards a tool that
2054
+ * creates branches and opens pull requests, whereas this only turns on
2055
+ * read-only lookups.
2056
+ *
2057
+ * The three input flags are TRI-STATE (`undefined` = absent, `true` = asked
2058
+ * for, `false` = explicitly refused), because an absent flag and `--no-x` are
2059
+ * different intentions and the `default: false` boolean convention erases the
2060
+ * difference. Read-only-by-default discovery is only safe while an operator
2061
+ * can always say no.
2062
+ */
2063
+ /**
2064
+ * The production probe. `getAzureRepoFromGit` THROWS on every non-Azure
2065
+ * workspace (no Azure remote, conflicting origins, ambiguous remotes) and on
2066
+ * any git failure — correct for a caller asking a question about a specific
2067
+ * workspace, wrong for a launch step whose only job is to decide whether to
2068
+ * turn some tools on. Every failure resolves to "not an Azure workspace", and
2069
+ * a launch is never failed by discovery.
2070
+ */
2071
+ async function gitAzureRepoProbe(workspace, signal) {
2072
+ try {
2073
+ return await getAzureRepoFromGit(workspace, signal);
2074
+ } catch {
2075
+ return null;
2076
+ }
2077
+ }
2078
+ /** `GH_ROUTER_AZURE_MCPS=off` — the wholesale kill switch for auto-enable. */
2079
+ function azureMcpsSuppressed(env = process.env) {
2080
+ const raw = env.GH_ROUTER_AZURE_MCPS?.trim().toLowerCase();
2081
+ if (!raw) return false;
2082
+ return raw === "0" || raw === "off" || raw === "false" || raw === "no";
2083
+ }
2084
+ /**
2085
+ * Tri-state of a capability from its CLI flag and env equivalent.
2086
+ *
2087
+ * An explicit CLI negative always wins, including over an env positive: the
2088
+ * CLI is the more specific and more recent statement of intent. `envKey` is
2089
+ * consulted only when the CLI was silent.
2090
+ */
2091
+ function triState(explicit, envKey, env) {
2092
+ if (explicit === false) return false;
2093
+ const envRaw = env[envKey]?.trim().toLowerCase();
2094
+ if (envRaw === "0" || envRaw === "off" || envRaw === "false" || envRaw === "no") return false;
2095
+ if (explicit === true) return true;
2096
+ if (envRaw === "1") return true;
2097
+ }
2098
+ function readIntent(inputs) {
2099
+ const env = inputs.env ?? process.env;
2100
+ return {
2101
+ bluebird: inputs.bluebirdFlag,
2102
+ ado: triState(inputs.adoFlag, "GH_ROUTER_ENABLE_ADO", env),
2103
+ kusto: triState(inputs.kustoFlag, "GH_ROUTER_ENABLE_KUSTO", env),
2104
+ adoOrganization: inputs.adoOrganization?.trim() || env.GH_ROUTER_ADO_ORG?.trim() || null,
2105
+ adoToolsets: inputs.adoToolsets?.trim() || env.GH_ROUTER_ADO_TOOLSETS?.trim() || null,
2106
+ adoAllToolsets: inputs.adoAllToolsets === true || env.GH_ROUTER_ADO_ALL_TOOLSETS === "1",
2107
+ kustoCluster: inputs.kustoCluster?.trim() || env.GH_ROUTER_KUSTO_CLUSTER?.trim() || null,
2108
+ kustoDatabase: inputs.kustoDatabase?.trim() || env.GH_ROUTER_KUSTO_DATABASE?.trim() || null
2109
+ };
2110
+ }
2111
+ /**
2112
+ * Whether the git-remote read can change any outcome. Consulted before
2113
+ * `discoverAzureRepo` so a launch where every surface is already decided does
2114
+ * not pay for a `git remote -v` process — the probe must not become an
2115
+ * unconditional pre-listen spawn on every launch.
2116
+ *
2117
+ * All three surfaces can be decided BY discovery, so each one keeps the probe
2118
+ * alive while its outcome is open. The cost of getting this wrong is a surface
2119
+ * that silently never appears; the cost of erring the other way is one bounded
2120
+ * `git remote -v` in a launch where it changed nothing, so the test is per
2121
+ * surface and only skips the spawn when every answer is already fixed.
2122
+ */
2123
+ function azureDiscoveryNeeded(inputs) {
2124
+ if (azureMcpsSuppressed(inputs.env ?? process.env)) return false;
2125
+ const intent = readIntent(inputs);
2126
+ if (intent.bluebird === void 0) return true;
2127
+ if (intent.ado === void 0 && !intent.adoOrganization) return true;
2128
+ return intent.kusto === void 0 && !intent.kustoCluster;
2129
+ }
2130
+ /**
2131
+ * Turn resolved intent plus the discovered repository into the final flags.
2132
+ *
2133
+ * Precedence per capability: explicit negative → explicit positive →
2134
+ * discovery → off. For Kusto the positive step has two forms, a flag or a named
2135
+ * cluster, and the discovery step now exists: an Azure DevOps remote is what
2136
+ * offers the group. Naming a scope on the command line (`--ado-org`,
2137
+ * `--kusto-cluster`) is itself a positive statement of intent, because nobody
2138
+ * supplies an endpoint they do not want used — but a scope is no longer
2139
+ * REQUIRED, since the cluster is selectable per call and discovery supplies
2140
+ * none.
2141
+ */
2142
+ function resolveAzureMcpFlags(inputs, discovered) {
2143
+ const suppressAll = azureMcpsSuppressed(inputs.env ?? process.env);
2144
+ const intent = readIntent(inputs);
2145
+ const reasons = [];
2146
+ const warnings = [];
2147
+ const origin = discovered ? `${discovered.organization}/${discovered.project}/${discovered.repository}` : null;
2148
+ let bluebird = false;
2149
+ if (!suppressAll && intent.bluebird !== false) {
2150
+ if (intent.bluebird === true) {
2151
+ if (discovered) bluebird = true;
2152
+ else warnings.push("bluebird: requested but no Azure DevOps git remote was found");
2153
+ } else if (discovered) {
2154
+ bluebird = true;
2155
+ reasons.push(`bluebird: Azure DevOps remote ${origin}`);
2156
+ }
2157
+ }
2158
+ const adoOrg = intent.adoOrganization ?? discovered?.organization ?? null;
2159
+ let ado = false;
2160
+ if (!suppressAll && intent.ado !== false) {
2161
+ if (intent.ado === true && !adoOrg) warnings.push("ado: requested but no organization (--ado-org) and no Azure DevOps git remote");
2162
+ else if (adoOrg) {
2163
+ if (intent.ado === true || intent.adoOrganization) ado = true;
2164
+ else {
2165
+ ado = true;
2166
+ reasons.push(`ado: Azure DevOps remote ${origin}`);
2167
+ }
2168
+ }
2169
+ }
2170
+ let kusto = false;
2171
+ if (!suppressAll && intent.kusto !== false) {
2172
+ if (intent.kustoCluster) {
2173
+ normalizeKustoClusterUri(intent.kustoCluster);
2174
+ kusto = true;
2175
+ } else if (intent.kusto === true) kusto = true;
2176
+ else if (discovered) {
2177
+ kusto = true;
2178
+ reasons.push(`kusto: Azure DevOps remote ${origin}`);
2179
+ }
2180
+ }
2181
+ return {
2182
+ bluebird,
2183
+ ado,
2184
+ kusto,
2185
+ adoOrganization: ado ? adoOrg : null,
2186
+ adoToolsets: ado ? resolveAdoToolsets(intent) : null,
2187
+ kustoCluster: kusto ? intent.kustoCluster : null,
2188
+ kustoDatabase: kusto ? intent.kustoDatabase : null,
2189
+ reasons,
2190
+ warnings
2191
+ };
2192
+ }
2193
+ /**
2194
+ * Toolset selection: `--ado-all-toolsets` sends no header, an explicit list is
2195
+ * validated against the documented values, and the curated default covers the
2196
+ * repository loop. An invalid value throws rather than degrading to the
2197
+ * default — a typo that silently widened or narrowed the surface is worse than
2198
+ * a failed launch.
2199
+ */
2200
+ function resolveAdoToolsets(intent) {
2201
+ if (intent.adoAllToolsets) return ["all"];
2202
+ if (!intent.adoToolsets) return [...ADO_DEFAULT_TOOLSETS];
2203
+ return normalizeAdoToolsets(intent.adoToolsets);
2204
+ }
2205
+ let discoveryPromise = null;
2206
+ /**
2207
+ * The workspace's Azure DevOps repository, resolved at most once per process.
2208
+ *
2209
+ * Memoized because up to two capabilities consume the same answer and a second
2210
+ * `git remote -v` spawn would buy nothing. A FAILED probe is memoized too: the
2211
+ * failure is a property of the workspace, and retrying it per consumer would
2212
+ * multiply the spawn the memoization exists to avoid.
2213
+ */
2214
+ function discoverAzureRepo(opts = {}) {
2215
+ if (discoveryPromise) return discoveryPromise;
2216
+ const workspace = opts.workspace ?? process.cwd();
2217
+ const probe = opts.probe ?? gitAzureRepoProbe;
2218
+ const timeoutMs = opts.timeoutMs ?? 5e3;
2219
+ discoveryPromise = (async () => {
2220
+ const timer = new AbortController();
2221
+ const handle = setTimeout(() => timer.abort(/* @__PURE__ */ new Error("Azure repository discovery timed out")), timeoutMs);
2222
+ handle.unref?.();
2223
+ const onOuterAbort = () => timer.abort(opts.signal?.reason ?? /* @__PURE__ */ new Error("aborted"));
2224
+ if (opts.signal?.aborted) onOuterAbort();
2225
+ else opts.signal?.addEventListener("abort", onOuterAbort, { once: true });
2226
+ try {
2227
+ return await probe(workspace, timer.signal);
2228
+ } catch {
2229
+ return null;
2230
+ } finally {
2231
+ clearTimeout(handle);
2232
+ opts.signal?.removeEventListener("abort", onOuterAbort);
2233
+ }
2234
+ })();
2235
+ return discoveryPromise;
2236
+ }
2237
+ //#endregion
1973
2238
  //#region src/lib/first-mate/scheduler/autospawn.ts
1974
2239
  /**
1975
2240
  * Opt-in auto-spawn of the first-mate scheduler daemon as a SEPARATE process
@@ -2407,10 +2672,12 @@ function formatTokenInfo(inputTokens, outputTokens, cacheReadTokens, cacheWriteT
2407
2672
  if (inputTokens === void 0 && (aicNano ?? 0) <= 0) return void 0;
2408
2673
  const parts = [];
2409
2674
  const maxPrompt = model?.capabilities?.limits?.max_prompt_tokens;
2410
- if (inputTokens !== void 0) if (maxPrompt) {
2411
- const pct = (inputTokens / maxPrompt * 100).toFixed(1);
2412
- parts.push(`in:${formatTokens(inputTokens)}/${formatTokens(maxPrompt)} (${pct}%)`);
2413
- } else parts.push(`in:${formatTokens(inputTokens)}`);
2675
+ if (inputTokens !== void 0) {
2676
+ if (maxPrompt) {
2677
+ const pct = (inputTokens / maxPrompt * 100).toFixed(1);
2678
+ parts.push(`in:${formatTokens(inputTokens)}/${formatTokens(maxPrompt)} (${pct}%)`);
2679
+ } else parts.push(`in:${formatTokens(inputTokens)}`);
2680
+ }
2414
2681
  if (outputTokens !== void 0) parts.push(`out:${formatTokens(outputTokens)}`);
2415
2682
  if ((cacheReadTokens ?? 0) > 0 || (cacheWriteTokens ?? 0) > 0) parts.push(`cache:r${formatTokens(cacheReadTokens ?? 0)}/w${formatTokens(cacheWriteTokens ?? 0)}`);
2416
2683
  if ((aicNano ?? 0) > 0) parts.push(`aic:${formatAic(nanoAiuToCredits(aicNano))}`);
@@ -2524,7 +2791,7 @@ function collectToolFieldKeys(body) {
2524
2791
  //#endregion
2525
2792
  //#region package.json
2526
2793
  var name = "github-router";
2527
- var version = "0.3.350";
2794
+ var version = "0.3.352";
2528
2795
  //#endregion
2529
2796
  //#region src/lib/approval.ts
2530
2797
  const awaitApproval = async () => {
@@ -7782,7 +8049,35 @@ async function setupAndServe(options) {
7782
8049
  bluebirdEnabled: options.bluebirdEnabled
7783
8050
  });
7784
8051
  state.searchEnabled = searchFlags.searchEnabled;
7785
- state.bluebirdEnabled = searchFlags.bluebirdEnabled;
8052
+ const azureInputs = {
8053
+ bluebirdFlag: searchFlags.bluebirdEnabled ? true : options.bluebirdEnabled === false ? false : void 0,
8054
+ adoFlag: options.adoEnabled,
8055
+ kustoFlag: options.kustoEnabled,
8056
+ adoOrganization: options.adoOrganization,
8057
+ adoToolsets: options.adoToolsets,
8058
+ adoAllToolsets: options.adoAllToolsets,
8059
+ kustoCluster: options.kustoCluster,
8060
+ kustoDatabase: options.kustoDatabase
8061
+ };
8062
+ const azureFlags = resolveAzureMcpFlags(azureInputs, azureDiscoveryNeeded(azureInputs) ? await discoverAzureRepo({}) : null);
8063
+ state.bluebirdEnabled = azureFlags.bluebird;
8064
+ state.adoEnabled = azureFlags.ado;
8065
+ state.adoOrganization = azureFlags.adoOrganization;
8066
+ state.adoToolsets = azureFlags.adoToolsets ?? [];
8067
+ state.adoReadOnly = options.adoWriteEnabled !== true;
8068
+ state.kustoEnabled = azureFlags.kusto;
8069
+ state.kustoCluster = azureFlags.kustoCluster;
8070
+ state.kustoDatabase = azureFlags.kustoDatabase;
8071
+ if (state.kustoEnabled && state.kustoCluster === null) consola.info("Kusto MCP: no default cluster; every call must name one (--kusto-cluster sets a default).");
8072
+ for (const reason of azureFlags.reasons) consola.info(`Azure MCP auto-enabled (${reason}).`);
8073
+ if (azureFlags.reasons.length > 0) consola.info("Suppress auto-enabled Azure surfaces with --no-bluebird / --no-ado / --no-kusto, or GH_ROUTER_AZURE_MCPS=off.");
8074
+ for (const warning of azureFlags.warnings) consola.warn(`Azure MCP: ${warning}`);
8075
+ if (state.adoEnabled && options.adoWriteEnabled === true) consola.warn("Azure DevOps MCP is running WITHOUT X-MCP-Readonly (--ado-write). Mutating tools are reachable from this session.");
8076
+ if (state.adoEnabled) {
8077
+ consola.info("Azure DevOps MCP: provisioning the remote tool surface...");
8078
+ const result = await provisionAdoTools();
8079
+ if (result.ok) consola.info(`Azure DevOps MCP: ${result.toolCount} tool(s) exposed.`);
8080
+ }
7786
8081
  state.fleetEnabled = options.fleetEnabled || process.env.GH_ROUTER_ENABLE_FLEET === "1";
7787
8082
  state.agentsEnabled = options.agentsEnabled || process.env.GH_ROUTER_ENABLE_AGENTS === "1";
7788
8083
  state.powerBrowseEnabled = options.powerBrowseEnabled || process.env.GH_ROUTER_ENABLE_POWER_BROWSE === "1";
@@ -7938,9 +8233,48 @@ const sharedServerArgs = {
7938
8233
  description: "Enable ColBERT/colgrep semantic code search (meaning-ranked `code` tool results over a per-workspace index, with transparent lexical fallback). Off by default; the `code` tool is lexical-only unless this is set. Can also be enabled with GH_ROUTER_ENABLE_SEMANTIC_SEARCH=1. GH_ROUTER_DISABLE_SEMANTIC_SEARCH=1 hard-disables (wins over --search, for tests)."
7939
8234
  },
7940
8235
  bluebird: {
8236
+ type: "boolean",
8237
+ default: void 0,
8238
+ description: "Route semantic + lexical `code` tool search through the Bluebird Azure DevOps MCP server (exact/regex/ast stay local). Requires an Azure DevOps git remote plus `az login`. Can also be enabled with GH_ROUTER_ENABLE_BLUEBIRD=1. Auto-enabled when the workspace's git remotes resolve to an Azure DevOps repository; --no-bluebird or GH_ROUTER_AZURE_MCPS=off suppresses that.",
8239
+ negativeDescription: "Never route through Bluebird, even when an Azure DevOps remote is discovered."
8240
+ },
8241
+ ado: {
8242
+ type: "boolean",
8243
+ default: void 0,
8244
+ description: "Expose the Azure DevOps remote MCP group (mcp__ado__*), read-only by default. Requires `az login` and an organization from --ado-org or an Azure DevOps git remote. Auto-enabled on Azure DevOps remote discovery; GH_ROUTER_ENABLE_ADO=1 is the env equivalent.",
8245
+ negativeDescription: "Never expose the Azure DevOps MCP group, even when an Azure DevOps remote is discovered."
8246
+ },
8247
+ "ado-org": {
8248
+ type: "string",
8249
+ description: "Azure DevOps organization name for the `ado` group. Overrides the organization derived from the git remote. Falls back to GH_ROUTER_ADO_ORG."
8250
+ },
8251
+ "ado-toolsets": {
8252
+ type: "string",
8253
+ description: "Comma-separated Azure DevOps MCP toolsets to request (all, repos, advsec, wit, pipelines, wiki, work, testplan, elm). Default repos,wit,pipelines,wiki. Falls back to GH_ROUTER_ADO_TOOLSETS."
8254
+ },
8255
+ "ado-all-toolsets": {
7941
8256
  type: "boolean",
7942
8257
  default: false,
7943
- description: "Route semantic + lexical `code` tool search through the Bluebird Azure DevOps MCP server (exact/regex/ast stay local). Requires an Azure DevOps git remote plus `az login`. Can also be enabled with GH_ROUTER_ENABLE_BLUEBIRD=1."
8258
+ description: "Request every Azure DevOps MCP toolset (sends no X-MCP-Toolsets header). Independent of read-only: this cannot produce a write tool. Falls back to GH_ROUTER_ADO_ALL_TOOLSETS=1."
8259
+ },
8260
+ "ado-write": {
8261
+ type: "boolean",
8262
+ default: false,
8263
+ description: "Let the Azure DevOps MCP group call mutating tools by omitting X-MCP-Readonly. Off by default and never implied by repository discovery; a banner line marks the elevated session."
8264
+ },
8265
+ kusto: {
8266
+ type: "boolean",
8267
+ default: void 0,
8268
+ description: "Expose the Kusto (Azure Data Explorer) MCP group (mcp__kusto__*), read-only. Enabled automatically in a checkout whose git remote is an Azure DevOps repository. Without --kusto-cluster every call must name the cluster to query, since different tables live in different clusters. GH_ROUTER_ENABLE_KUSTO=1 is the env equivalent.",
8269
+ negativeDescription: "Never expose the Kusto MCP group, even when a cluster is configured, the env equivalent is set, or the repository is an Azure DevOps checkout."
8270
+ },
8271
+ "kusto-cluster": {
8272
+ type: "string",
8273
+ description: "Default Kusto cluster URI, e.g. https://example.kusto.windows.net, used by calls that do not name one. Naming a cluster is itself enough to enable the `kusto` group. Falls back to GH_ROUTER_KUSTO_CLUSTER."
8274
+ },
8275
+ "kusto-database": {
8276
+ type: "string",
8277
+ description: "Default Kusto database for calls that do not name one, applied to whichever cluster the call resolves. Falls back to GH_ROUTER_KUSTO_DATABASE."
7944
8278
  }
7945
8279
  };
7946
8280
  const allowedAccountTypes = /* @__PURE__ */ new Set([
@@ -7996,7 +8330,15 @@ function parseSharedArgs(args) {
7996
8330
  powerBrowseEnabled: args["power-browse"],
7997
8331
  humanlikeEnabled: args.humanlike,
7998
8332
  searchEnabled: args.search,
7999
- bluebirdEnabled: args.bluebird
8333
+ bluebirdEnabled: args.bluebird,
8334
+ adoEnabled: args.ado,
8335
+ adoOrganization: args["ado-org"],
8336
+ adoToolsets: args["ado-toolsets"],
8337
+ adoAllToolsets: args["ado-all-toolsets"],
8338
+ adoWriteEnabled: args["ado-write"],
8339
+ kustoEnabled: args.kusto,
8340
+ kustoCluster: args["kusto-cluster"],
8341
+ kustoDatabase: args["kusto-database"]
8000
8342
  };
8001
8343
  }
8002
8344
  /**
@@ -8071,11 +8413,19 @@ function getClaudeCodeEnvVars(serverUrl, model, launchProfileId = "standard", pi
8071
8413
  const isMaxProfile = launchProfileId === "max";
8072
8414
  const isCheapProfile = launchProfileId === "cheap" || launchProfileId === "cheap1m" || launchProfileId === "cheapest";
8073
8415
  const routerWinsTiers = isFastProfile || isCheapProfile;
8416
+ const pinStrict200K = launchProfileId === "cheap" || launchProfileId === "cheapest" || launchProfileId === "balanced";
8417
+ if (pinStrict200K) {
8418
+ 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
+ }
8420
+ const pinLeadEffort = launchProfileId === "cheapest" ? "max" : launchProfileId === "balanced" ? BALANCED_PROFILE_LEAD_EFFORT : void 0;
8421
+ if (pinLeadEffort !== void 0) {
8422
+ if ((process.env.CLAUDE_CODE_EFFORT_LEVEL ?? "").trim() === "") vars.CLAUDE_CODE_EFFORT_LEVEL = pinLeadEffort;
8423
+ }
8074
8424
  const smallFastModel = isMaxProfile ? MAX_LUNA_HIGH_ALIAS_ID : isFastProfile ? LUNA_HAIKU_ALIAS_ID : isCheapProfile ? LUNA_HAIKU_ALIAS_ID : isBudgetClaudeLead(model) && (state.models?.data?.some((m) => m.id === "claude-haiku-4.5") ?? false) ? BUDGET_SMALL_FAST_SLUG : "claude-sonnet-5";
8075
8425
  if (process.env.ANTHROPIC_SMALL_FAST_MODEL === void 0 || routerWinsTiers) vars.ANTHROPIC_SMALL_FAST_MODEL = (isFastProfile || isMaxProfile) && !isCheapProfile ? oneMSuffixForAlias(smallFastModel) : smallFastModel;
8076
8426
  const seedTierRow = (modelKey, nameKey, bareSlug) => {
8077
8427
  if (process.env[modelKey] !== void 0) return;
8078
- vars[modelKey] = withOneMSuffixForLead(bareSlug);
8428
+ vars[modelKey] = pinStrict200K ? bareSlug : withOneMSuffixForLead(bareSlug);
8079
8429
  if (process.env[nameKey] === void 0) vars[nameKey] = bareSlug;
8080
8430
  };
8081
8431
  const seedFastAliasTierRow = (modelKey, nameKey, aliasId, displayName, force = false) => {
@@ -8237,10 +8587,11 @@ function getPiLaunchEnvVars(mirrorDir) {
8237
8587
  vars.npm_config_fund = "false";
8238
8588
  vars.npm_config_update_notifier = "false";
8239
8589
  }
8590
+ vars.npm_config_allow_scripts = "";
8240
8591
  if (toolbeltEnabled()) Object.assign(vars, toolbeltPathOverride(process.env, PATHS.TOOLBELT_BIN_DIR));
8241
8592
  return vars;
8242
8593
  }
8243
8594
  //#endregion
8244
8595
  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 };
8245
8596
 
8246
- //# sourceMappingURL=server-setup-DXVFE7bf.js.map
8597
+ //# sourceMappingURL=server-setup-DinOFWiC.js.map