github-router 0.3.372 → 0.3.374
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.
- package/dist/ado-tools-BOW1k1KW.js +1 -0
- package/dist/{aic-ledger-Cp7Yk9-Q.js → aic-ledger-CeSXqTEE.js} +5 -7
- package/dist/{aic-ledger-Cp7Yk9-Q.js.map → aic-ledger-CeSXqTEE.js.map} +1 -1
- package/dist/{aic-statusline-settings-B5EMMSFC.js → aic-statusline-settings-BKveu679.js} +3 -4
- package/dist/{aic-statusline-settings-B5EMMSFC.js.map → aic-statusline-settings-BKveu679.js.map} +1 -1
- package/dist/{attribution-settings-HI_5bN_-.js → attribution-settings-BLTnz2_A.js} +33 -53
- package/dist/{attribution-settings-HI_5bN_-.js.map → attribution-settings-BLTnz2_A.js.map} +1 -1
- package/dist/{auth-B1egtvt4.js → auth-BZHpTtfF.js} +5 -6
- package/dist/{auth-B1egtvt4.js.map → auth-BZHpTtfF.js.map} +1 -1
- package/dist/{balanced-profile-contract-Dm_usmw7.js → balanced-profile-contract-B6pSoWjm.js} +2 -3
- package/dist/{balanced-profile-contract-Dm_usmw7.js.map → balanced-profile-contract-B6pSoWjm.js.map} +1 -1
- package/dist/{bluebird-client-ByCRusGQ.js → bluebird-client-BasIdv5J.js} +8 -12
- package/dist/{bluebird-client-ByCRusGQ.js.map → bluebird-client-BasIdv5J.js.map} +1 -1
- package/dist/{bluebird-client-CY6NBHQu.js → bluebird-client-BvoMTmEv.js} +1 -1
- package/dist/browser-bridge/index.js +84 -55
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/{check-usage-T_z84Pgc.js → check-usage-BlIWDuV2.js} +5 -6
- package/dist/{check-usage-T_z84Pgc.js.map → check-usage-BlIWDuV2.js.map} +1 -1
- package/dist/{claude-BBSsqwln.js → claude-DSXrdz0v.js} +37 -43
- package/dist/{claude-BBSsqwln.js.map → claude-DSXrdz0v.js.map} +1 -1
- package/dist/{claude-md-injection-BMon6WUD.js → claude-md-injection-DU5KYXNc.js} +6 -7
- package/dist/{claude-md-injection-BMon6WUD.js.map → claude-md-injection-DU5KYXNc.js.map} +1 -1
- package/dist/{client-CQMfroGV.js → client-Bjp3XAMK.js} +3 -5
- package/dist/{client-CQMfroGV.js.map → client-Bjp3XAMK.js.map} +1 -1
- package/dist/{codex-PRWoBiOH.js → codex-DGMUk65v.js} +10 -11
- package/dist/{codex-PRWoBiOH.js.map → codex-DGMUk65v.js.map} +1 -1
- package/dist/{copilot-discount-T-cfWmc4.js → copilot-discount-CHNQLYDJ.js} +3 -4
- package/dist/{copilot-discount-T-cfWmc4.js.map → copilot-discount-CHNQLYDJ.js.map} +1 -1
- package/dist/{debug-DL2JsRqY.js → debug-1HUHCWFl.js} +3 -4
- package/dist/{debug-DL2JsRqY.js.map → debug-1HUHCWFl.js.map} +1 -1
- package/dist/engine-BC4TF4pt.js +1 -0
- package/dist/{exec-Bf8g_bIR.js → exec-BC0MAnoA.js} +2 -3
- package/dist/{exec-Bf8g_bIR.js.map → exec-BC0MAnoA.js.map} +1 -1
- package/dist/{fast-profile-contract-JOnZBgFB.js → fast-profile-contract-BLnKg0Ay.js} +2 -3
- package/dist/{fast-profile-contract-JOnZBgFB.js.map → fast-profile-contract-BLnKg0Ay.js.map} +1 -1
- package/dist/{gate-discovery-BNy8GKsC.js → gate-discovery-DiXu_olc.js} +8 -10
- package/dist/{gate-discovery-BNy8GKsC.js.map → gate-discovery-DiXu_olc.js.map} +1 -1
- package/dist/{get-copilot-usage-BSXeQEx8.js → get-copilot-usage-CKg42gSH.js} +5 -6
- package/dist/{get-copilot-usage-BSXeQEx8.js.map → get-copilot-usage-CKg42gSH.js.map} +1 -1
- package/dist/{hook-mcp-client-DERIkeR7.js → hook-mcp-client-CYx10nlU.js} +2 -3
- package/dist/hook-mcp-client-CYx10nlU.js.map +1 -0
- package/dist/hooks.mjs +1766 -1548
- package/dist/hooks.sha256 +1 -1
- package/dist/{index-cmd-CjRcmYk3.js → index-cmd-BPXhTfGQ.js} +8 -9
- package/dist/index-cmd-BPXhTfGQ.js.map +1 -0
- package/dist/{internal-aic-status-CY0QxSa7.js → internal-aic-status-FQB1DQzX.js} +6 -8
- package/dist/{internal-aic-status-CY0QxSa7.js.map → internal-aic-status-FQB1DQzX.js.map} +1 -1
- package/dist/{internal-artifact-open-NAGn9Mgt.js → internal-artifact-open-DbHjipxU.js} +5 -7
- package/dist/{internal-artifact-open-NAGn9Mgt.js.map → internal-artifact-open-DbHjipxU.js.map} +1 -1
- package/dist/{internal-fast-dispatch-guard-De_DJOyZ.js → internal-fast-dispatch-guard-DMzqs-r8.js} +1 -1
- package/dist/{internal-fast-dispatch-guard-_n-A8hgo.js → internal-fast-dispatch-guard-PDdlkPU3.js} +6 -8
- package/dist/{internal-fast-dispatch-guard-_n-A8hgo.js.map → internal-fast-dispatch-guard-PDdlkPU3.js.map} +1 -1
- package/dist/{internal-first-mate-guard-GufCUMl3.js → internal-first-mate-guard-4Yro9xNM.js} +5 -7
- package/dist/{internal-first-mate-guard-GufCUMl3.js.map → internal-first-mate-guard-4Yro9xNM.js.map} +1 -1
- package/dist/{internal-first-mate-guard-C8GwLbaX.js → internal-first-mate-guard-BxPDUsV3.js} +1 -1
- package/dist/{internal-max-dispatch-guard-4rh6KSd8.js → internal-max-dispatch-guard-D3L00YXj.js} +5 -7
- package/dist/{internal-max-dispatch-guard-4rh6KSd8.js.map → internal-max-dispatch-guard-D3L00YXj.js.map} +1 -1
- package/dist/{internal-max-dispatch-guard-CKnzgJje.js → internal-max-dispatch-guard-fhBX_w49.js} +1 -1
- package/dist/{internal-plan-review-ChFx8wTX.js → internal-plan-review-BfHLeszV.js} +6 -7
- package/dist/{internal-plan-review-ChFx8wTX.js.map → internal-plan-review-BfHLeszV.js.map} +1 -1
- package/dist/{internal-prompt-submit-BW5g3MjD.js → internal-prompt-submit-BbnaMF2R.js} +7 -8
- package/dist/{internal-prompt-submit-BW5g3MjD.js.map → internal-prompt-submit-BbnaMF2R.js.map} +1 -1
- package/dist/{internal-prompt-submit-C4uDwr7G.js → internal-prompt-submit-DKzCckz-.js} +2 -2
- package/dist/{internal-rebrief-DvBS8myn.js → internal-rebrief-aEvxp7jw.js} +7 -9
- package/dist/{internal-rebrief-DvBS8myn.js.map → internal-rebrief-aEvxp7jw.js.map} +1 -1
- package/dist/{internal-session-bind-dsUOcKxU.js → internal-session-bind-pN1V11Mn.js} +3 -4
- package/dist/{internal-session-bind-dsUOcKxU.js.map → internal-session-bind-pN1V11Mn.js.map} +1 -1
- package/dist/{internal-stop-hook-CXlOsW63.js → internal-stop-hook-VQuOYpUC.js} +9 -10
- package/dist/{internal-stop-hook-CXlOsW63.js.map → internal-stop-hook-VQuOYpUC.js.map} +1 -1
- package/dist/{internal-stop-review-D_KEV_04.js → internal-stop-review-BWp-4XWW.js} +4 -5
- package/dist/{internal-stop-review-D_KEV_04.js.map → internal-stop-review-BWp-4XWW.js.map} +1 -1
- package/dist/{internal-worker-guard-DB6shBIn.js → internal-worker-guard-C9OZPgzu.js} +3 -4
- package/dist/{internal-worker-guard-DB6shBIn.js.map → internal-worker-guard-C9OZPgzu.js.map} +1 -1
- package/dist/{internal-workspace-header-DBg5Y7oN.js → internal-workspace-header-B4TXFBLU.js} +3 -4
- package/dist/{internal-workspace-header-DBg5Y7oN.js.map → internal-workspace-header-B4TXFBLU.js.map} +1 -1
- package/dist/lib/tree-sitter-pool/{lifecycle-Dx0SnP7Z.js → lifecycle-BPpOigPZ.js} +1 -2
- package/dist/lib/tree-sitter-pool/{lifecycle-C7W8D2lx.js → lifecycle-C3vsqXjS.js} +1 -3
- package/dist/lib/tree-sitter-pool/worker.js +29 -35
- package/dist/lifecycle-BENRuuX6.js +1 -0
- package/dist/{lifecycle-K9oVtGde.mjs → lifecycle-DBKu1T5r.mjs} +0 -1
- package/dist/{lifecycle-Gge2Dadd.js → lifecycle-Dh9y8OF1.js} +3 -4
- package/dist/{lifecycle-Gge2Dadd.js.map → lifecycle-Dh9y8OF1.js.map} +1 -1
- package/dist/lifecycle-Dli9vGI2.js +1 -0
- package/dist/{lifecycle-9nX09dBl.js → lifecycle-vjHAFCaY.js} +4 -6
- package/dist/{lifecycle-9nX09dBl.js.map → lifecycle-vjHAFCaY.js.map} +1 -1
- package/dist/main.js +26 -27
- package/dist/{max-profile-contract-CRj7N211.js → max-profile-contract-DLLTsSs2.js} +5 -8
- package/dist/{max-profile-contract-CRj7N211.js.map → max-profile-contract-DLLTsSs2.js.map} +1 -1
- package/dist/{mcp-workspace-header-Xw9B1W6T.js → mcp-workspace-header-C5-dOWNa.js} +3 -4
- package/dist/{mcp-workspace-header-Xw9B1W6T.js.map → mcp-workspace-header-C5-dOWNa.js.map} +1 -1
- package/dist/{models-Ca-HQTYi.js → models-B6nH1sS6.js} +4 -5
- package/dist/{models-Ca-HQTYi.js.map → models-B6nH1sS6.js.map} +1 -1
- package/dist/{orchestration-D3-2ulhX.js → orchestration-B93jxrWI.js} +4 -5
- package/dist/{orchestration-D3-2ulhX.js.map → orchestration-B93jxrWI.js.map} +1 -1
- package/dist/{package-root-B-osctCk.js → package-root-BXgdIM3q.js} +2 -3
- package/dist/{package-root-B-osctCk.js.map → package-root-BXgdIM3q.js.map} +1 -1
- package/dist/paths-Be9_ujQ3.js +1 -0
- package/dist/{paths-C5477RGC.js → paths-CVEO8jEH.js} +5 -7
- package/dist/{paths-C5477RGC.js.map → paths-CVEO8jEH.js.map} +1 -1
- package/dist/{peer-mcp-personas-Dxxw5X1g.js → peer-mcp-personas-Cv21q_YR.js} +244 -372
- package/dist/peer-mcp-personas-Cv21q_YR.js.map +1 -0
- package/dist/{pi-IYAvKF50.js → pi-DI2QtaiZ.js} +305 -89
- package/dist/pi-DI2QtaiZ.js.map +1 -0
- package/dist/{pi-memory-bridge-DEU1SUDz.js → pi-memory-bridge-Dvj1T3e3.js} +2 -3
- package/dist/{pi-memory-bridge-DEU1SUDz.js.map → pi-memory-bridge-Dvj1T3e3.js.map} +1 -1
- package/dist/{plan-review-hook-C9K-em4D.js → plan-review-hook-MhjK92wq.js} +5 -6
- package/dist/{plan-review-hook-C9K-em4D.js.map → plan-review-hook-MhjK92wq.js.map} +1 -1
- package/dist/{provision-CIn6I4w_.js → provision-CRmtV6ew.js} +10 -14
- package/dist/{provision-CIn6I4w_.js.map → provision-CRmtV6ew.js.map} +1 -1
- package/dist/rolldown-runtime-D3PmRqjj.js +4 -0
- package/dist/{self-invocation-BtcGj-lY.js → self-invocation-DMUnXVGT.js} +5 -7
- package/dist/{self-invocation-BtcGj-lY.js.map → self-invocation-DMUnXVGT.js.map} +1 -1
- package/dist/{serve-CttHP8dJ.js → serve-DRASJ-ZO.js} +24 -30
- package/dist/{serve-CttHP8dJ.js.map → serve-DRASJ-ZO.js.map} +1 -1
- package/dist/{server-setup-D7XHUrhM.js → server-setup-DldGizZR.js} +67 -117
- package/dist/{server-setup-D7XHUrhM.js.map → server-setup-DldGizZR.js.map} +1 -1
- package/dist/{service-backend-B6D_DY1Z.js → service-backend-Ce6b2XEe.js} +146 -146
- package/dist/service-backend-Ce6b2XEe.js.map +1 -0
- package/dist/{start-XU5HwLd9.js → start-C0gngUPK.js} +6 -8
- package/dist/{start-XU5HwLd9.js.map → start-C0gngUPK.js.map} +1 -1
- package/dist/{state-DzsaGHr9.js → state-CCGDJ43X.js} +2 -3
- package/dist/{state-DzsaGHr9.js.map → state-CCGDJ43X.js.map} +1 -1
- package/dist/{static-context-pack-CsOAC87F.js → static-context-pack-DwC69_VA.js} +14 -24
- package/dist/{static-context-pack-CsOAC87F.js.map → static-context-pack-DwC69_VA.js.map} +1 -1
- package/dist/{stop-gate-hook-DnLC09Lg.js → stop-gate-hook-CBVLD8iB.js} +9 -14
- package/dist/{stop-gate-hook-DnLC09Lg.js.map → stop-gate-hook-CBVLD8iB.js.map} +1 -1
- package/dist/{stop-gate-policy-Dx9c98_d.js → stop-gate-policy-BehNiNix.js} +4 -5
- package/dist/{stop-gate-policy-Dx9c98_d.js.map → stop-gate-policy-BehNiNix.js.map} +1 -1
- package/dist/{token-Dqjs5ixP.js → token-CPzYxU4Y.js} +16 -28
- package/dist/{token-Dqjs5ixP.js.map → token-CPzYxU4Y.js.map} +1 -1
- package/dist/{token-CVG0yI_j.js → token-DHEkiO4g.js} +3 -4
- package/dist/{token-CVG0yI_j.js.map → token-DHEkiO4g.js.map} +1 -1
- package/dist/{upstream-retry-i1k1Xai2.js → upstream-retry-VNR-bCuT.js} +2 -3
- package/dist/{upstream-retry-i1k1Xai2.js.map → upstream-retry-VNR-bCuT.js.map} +1 -1
- package/dist/{version-C8x2hQrZ.js → version-CTqwKr26.js} +3 -4
- package/dist/{version-C8x2hQrZ.js.map → version-CTqwKr26.js.map} +1 -1
- package/dist/{worker-dispatch-B1w2qfjX.js → worker-dispatch-C7RtNOXv.js} +3 -4
- package/dist/{worker-dispatch-B1w2qfjX.js.map → worker-dispatch-C7RtNOXv.js.map} +1 -1
- package/dist/{workiq-qnJR5_n2.js → workiq-CQauEAMc.js} +3 -4
- package/dist/{workiq-qnJR5_n2.js.map → workiq-CQauEAMc.js.map} +1 -1
- package/dist/{workiq-tools-CMoDjrO0.js → workiq-tools-7n2xXMrQ.js} +1 -1
- package/package.json +19 -17
- package/dist/ado-tools-CAtopk36.js +0 -1
- package/dist/engine-CDZdAx8N.js +0 -1
- package/dist/hook-mcp-client-DERIkeR7.js.map +0 -1
- package/dist/index-cmd-CjRcmYk3.js.map +0 -1
- package/dist/lifecycle-C_CT13c9.js +0 -1
- package/dist/lifecycle-DibiH857.js +0 -1
- package/dist/paths-CEswtFj5.js +0 -1
- package/dist/peer-mcp-personas-Dxxw5X1g.js.map +0 -1
- package/dist/pi-IYAvKF50.js.map +0 -1
- package/dist/service-backend-B6D_DY1Z.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Z as runSelfUpdate, a as setupAndServe, i as parseSharedArgs, n as getCodexEnvVars, o as sharedServerArgs, t as getClaudeCodeEnvVars, v as startKeepAwake } from "./server-setup-
|
|
3
|
-
import {
|
|
1
|
+
import { Bn as colbertDegradedWarning, Mn as provisionBrowserAssets, Nt as browserToolsEnabled, Vn as provisionAndIndexColbert } from "./peer-mcp-personas-Cv21q_YR.js";
|
|
2
|
+
import { Z as runSelfUpdate, a as setupAndServe, i as parseSharedArgs, n as getCodexEnvVars, o as sharedServerArgs, t as getClaudeCodeEnvVars, v as startKeepAwake } from "./server-setup-DldGizZR.js";
|
|
3
|
+
import { P as warmTreeSitterPool } from "./service-backend-Ce6b2XEe.js";
|
|
4
4
|
import { defineCommand } from "citty";
|
|
5
5
|
import consola from "consola";
|
|
6
6
|
import process$1 from "node:process";
|
|
7
7
|
import clipboard from "clipboardy";
|
|
8
|
-
|
|
8
|
+
// src/lib/shell.ts
|
|
9
9
|
function getShell() {
|
|
10
10
|
const { platform, env } = process$1;
|
|
11
11
|
if (platform === "win32") {
|
|
@@ -66,8 +66,7 @@ function generateEnvScript(envVars, commandToRun = "") {
|
|
|
66
66
|
if (commandBlock && commandToRun) return `${commandBlock}${shell === "cmd" ? " & " : shell === "powershell" ? "; " : " && "}${commandToRun}`;
|
|
67
67
|
return commandBlock || commandToRun;
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
//#region src/start.ts
|
|
69
|
+
// src/start.ts
|
|
71
70
|
function printAndCopyCommand(command, label) {
|
|
72
71
|
consola.box(`${label}\n\n${command}`);
|
|
73
72
|
try {
|
|
@@ -127,7 +126,6 @@ const start = defineCommand({
|
|
|
127
126
|
consola.box(`🌐 Usage Viewer: https://animeshkundu.github.io/github-router/dashboard.html?endpoint=${serverUrl}/usage`);
|
|
128
127
|
}
|
|
129
128
|
});
|
|
130
|
-
//#endregion
|
|
131
129
|
export { start };
|
|
132
130
|
|
|
133
|
-
//# sourceMappingURL=start-
|
|
131
|
+
//# sourceMappingURL=start-C0gngUPK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-XU5HwLd9.js","names":["process"],"sources":["../src/lib/shell.ts","../src/start.ts"],"sourcesContent":["import process from \"node:process\"\n\ntype ShellName = \"bash\" | \"zsh\" | \"fish\" | \"powershell\" | \"cmd\" | \"sh\"\ntype EnvVars = Record<string, string | undefined>\n\nfunction getShell(): ShellName {\n const { platform, env } = process\n\n if (platform === \"win32\") {\n // Git Bash / MSYS2 / Cygwin set SHELL even on Windows\n if (env.SHELL) {\n if (env.SHELL.endsWith(\"zsh\")) return \"zsh\"\n if (env.SHELL.endsWith(\"fish\")) return \"fish\"\n if (env.SHELL.endsWith(\"bash\")) return \"bash\"\n return \"sh\"\n }\n\n // Windows PowerShell 5.x sets this\n if (env.POWERSHELL_DISTRIBUTION_CHANNEL) return \"powershell\"\n\n // PowerShell (both 5.x and 7+/pwsh) adds user-scoped module paths\n // at runtime. The system-level PSModulePath in CMD lacks these paths.\n if (env.PSModulePath) {\n const lower = env.PSModulePath.toLowerCase()\n if (\n lower.includes(\"documents\\\\powershell\")\n || lower.includes(\"documents\\\\windowspowershell\")\n ) {\n return \"powershell\"\n }\n }\n\n return \"cmd\"\n }\n\n const shellPath = env.SHELL\n if (shellPath) {\n if (shellPath.endsWith(\"zsh\")) return \"zsh\"\n if (shellPath.endsWith(\"fish\")) return \"fish\"\n if (shellPath.endsWith(\"bash\")) return \"bash\"\n }\n\n return \"sh\"\n}\n\nfunction quotePosixValue(value: string): string {\n return `'${value.replace(/'/g, \"'\\\\''\")}'`\n}\n\nfunction quotePowerShellValue(value: string): string {\n return `'${value.replace(/'/g, \"''\")}'`\n}\n\n/**\n * Generates a copy-pasteable script to set multiple environment variables\n * and run a subsequent command.\n * @param {EnvVars} envVars - An object of environment variables to set.\n * @param {string} commandToRun - The command to run after setting the variables.\n * @returns {string} The formatted script string.\n */\nexport function generateEnvScript(\n envVars: EnvVars,\n commandToRun: string = \"\",\n): string {\n const shell = getShell()\n const filteredEnvVars = Object.entries(envVars).filter(\n ([, value]) => value !== undefined,\n ) as Array<[string, string]>\n\n let commandBlock: string\n\n switch (shell) {\n case \"powershell\": {\n commandBlock = filteredEnvVars\n .map(([key, value]) => `$env:${key} = ${quotePowerShellValue(value)}`)\n .join(\"; \")\n break\n }\n case \"cmd\": {\n commandBlock = filteredEnvVars\n .map(([key, value]) => `set \"${key}=${value}\"`)\n .join(\" & \")\n break\n }\n case \"fish\": {\n commandBlock = filteredEnvVars\n .map(([key, value]) => `set -gx ${key} ${quotePosixValue(value)}`)\n .join(\"; \")\n break\n }\n default: {\n // bash, zsh, sh\n const assignments = filteredEnvVars\n .map(([key, value]) => `${key}=${quotePosixValue(value)}`)\n .join(\" \")\n commandBlock = filteredEnvVars.length > 0 ? `export ${assignments}` : \"\"\n break\n }\n }\n\n if (commandBlock && commandToRun) {\n const separator =\n shell === \"cmd\" ? \" & \" : shell === \"powershell\" ? \"; \" : \" && \"\n return `${commandBlock}${separator}${commandToRun}`\n }\n\n return commandBlock || commandToRun\n}\n","#!/usr/bin/env node\n\nimport { defineCommand } from \"citty\"\nimport clipboard from \"clipboardy\"\nimport consola from \"consola\"\n\nimport { generateEnvScript } from \"./lib/shell\"\nimport { DEFAULT_CODEX_MODEL, DEFAULT_PORT } from \"./lib/port\"\nimport { provisionBrowserAssets } from \"./lib/browser-mcp/provision\"\nimport { browserToolsEnabled } from \"./lib/mcp-capabilities\"\nimport { colbertDegradedWarning, provisionAndIndexColbert } from \"./lib/colbert\"\nimport { startKeepAwake } from \"./lib/keep-awake\"\nimport { warmTreeSitterPool } from \"./lib/tree-sitter-pool/pool\"\nimport {\n getClaudeCodeEnvVars,\n getCodexEnvVars,\n parseSharedArgs,\n setupAndServe,\n sharedServerArgs,\n} from \"./lib/server-setup\"\nimport { runSelfUpdate } from \"./lib/self-update\"\n\nfunction printAndCopyCommand(command: string, label: string): void {\n consola.box(`${label}\\n\\n${command}`)\n try {\n clipboard.writeSync(command)\n consola.success(`Copied ${label} command to clipboard!`)\n } catch {\n consola.warn(\"Failed to copy to clipboard. Copy the command above manually.\")\n }\n}\n\nfunction generateClaudeCodeCommand(serverUrl: string, model?: string) {\n const envVars = getClaudeCodeEnvVars(serverUrl, model)\n const command = generateEnvScript(envVars, \"claude --dangerously-skip-permissions\")\n printAndCopyCommand(command, \"Claude Code\")\n}\n\nfunction generateCodexCommand(serverUrl: string, model?: string) {\n const codexModel = model ?? DEFAULT_CODEX_MODEL\n const envVars = getCodexEnvVars(serverUrl)\n const command = generateEnvScript(envVars, `codex -m ${codexModel}`)\n printAndCopyCommand(command, \"Codex CLI\")\n}\n\nexport const start = defineCommand({\n meta: {\n name: \"start\",\n description: \"Start the github-router server\",\n },\n args: {\n ...sharedServerArgs,\n cc: {\n type: \"boolean\",\n default: false,\n description:\n \"Generate a command to launch Claude Code with Copilot API config\",\n },\n cx: {\n type: \"boolean\",\n default: false,\n description:\n \"Generate a command to launch Codex CLI with Copilot API config\",\n },\n model: {\n alias: \"m\",\n type: \"string\",\n description: \"Override the default model (used with --cc or --cx)\",\n },\n },\n async run({ args }) {\n const parsed = parseSharedArgs(args as unknown as Record<string, unknown>)\n\n const { serverUrl } = await setupAndServe({\n ...parsed,\n port: parsed.port ?? DEFAULT_PORT,\n silent: false,\n })\n\n // Best-effort self-update (detached, applies next launch). Runs\n // after the server is listening so the bounded probe can't delay it.\n void runSelfUpdate({ selfUpdate: args[\"self-update\"] !== false })\n\n // Best-effort ColBERT semantic-search provision + background index of\n // the launch cwd (if a git repo). Opt-IN via --search (no-op otherwise);\n // never blocks launch, never throws.\n void provisionAndIndexColbert()\n\n // Surface a terminally-failed semantic index to the HUMAN (see the note\n // in claude.ts). Fire-and-forget; lexical search still works.\n void colbertDegradedWarning()\n .then((warning) => {\n if (warning) process.stderr.write(`${warning}\\n`)\n })\n .catch(() => {})\n\n // Ready one tree-sitter worker in the background so the first code search\n // avoids WASM/grammar initialization. One worker keeps launch CPU bounded;\n // demand grows the pool lazily. Opt out with GH_ROUTER_DISABLE_TS_POOL_WARMUP=1.\n void warmTreeSitterPool()\n\n // Best-effort: keep the machine awake while the proxy serves (win32\n // default-on; opt out with GH_ROUTER_DISABLE_KEEP_AWAKE=1). Holds a\n // SetThreadExecutionState assertion via a persistent PowerShell\n // helper. Self-registers its own SIGINT/SIGTERM/exit reaper — load-\n // bearing here, because `start` has no launchChild/onShutdown.\n startKeepAwake()\n\n // Best-effort: materialize the browser extension + bridge into the\n // stable app-dir and stamp the running version, so a one-time \"Load\n // unpacked\" survives npx/bunx upgrades. Gated on --browse; never\n // blocks launch, never throws.\n if (browserToolsEnabled()) {\n void provisionBrowserAssets().catch((err) =>\n consola.debug(\"Browser extension provisioning failed:\", err),\n )\n }\n\n if (args.cc) generateClaudeCodeCommand(serverUrl, args.model)\n if (args.cx) generateCodexCommand(serverUrl, args.model)\n\n consola.box(\n `🌐 Usage Viewer: https://animeshkundu.github.io/github-router/dashboard.html?endpoint=${serverUrl}/usage`,\n )\n },\n})\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"start-C0gngUPK.js","names":["process"],"sources":["../src/lib/shell.ts","../src/start.ts"],"sourcesContent":["import process from \"node:process\"\n\ntype ShellName = \"bash\" | \"zsh\" | \"fish\" | \"powershell\" | \"cmd\" | \"sh\"\ntype EnvVars = Record<string, string | undefined>\n\nfunction getShell(): ShellName {\n const { platform, env } = process\n\n if (platform === \"win32\") {\n // Git Bash / MSYS2 / Cygwin set SHELL even on Windows\n if (env.SHELL) {\n if (env.SHELL.endsWith(\"zsh\")) return \"zsh\"\n if (env.SHELL.endsWith(\"fish\")) return \"fish\"\n if (env.SHELL.endsWith(\"bash\")) return \"bash\"\n return \"sh\"\n }\n\n // Windows PowerShell 5.x sets this\n if (env.POWERSHELL_DISTRIBUTION_CHANNEL) return \"powershell\"\n\n // PowerShell (both 5.x and 7+/pwsh) adds user-scoped module paths\n // at runtime. The system-level PSModulePath in CMD lacks these paths.\n if (env.PSModulePath) {\n const lower = env.PSModulePath.toLowerCase()\n if (\n lower.includes(\"documents\\\\powershell\")\n || lower.includes(\"documents\\\\windowspowershell\")\n ) {\n return \"powershell\"\n }\n }\n\n return \"cmd\"\n }\n\n const shellPath = env.SHELL\n if (shellPath) {\n if (shellPath.endsWith(\"zsh\")) return \"zsh\"\n if (shellPath.endsWith(\"fish\")) return \"fish\"\n if (shellPath.endsWith(\"bash\")) return \"bash\"\n }\n\n return \"sh\"\n}\n\nfunction quotePosixValue(value: string): string {\n return `'${value.replace(/'/g, \"'\\\\''\")}'`\n}\n\nfunction quotePowerShellValue(value: string): string {\n return `'${value.replace(/'/g, \"''\")}'`\n}\n\n/**\n * Generates a copy-pasteable script to set multiple environment variables\n * and run a subsequent command.\n * @param {EnvVars} envVars - An object of environment variables to set.\n * @param {string} commandToRun - The command to run after setting the variables.\n * @returns {string} The formatted script string.\n */\nexport function generateEnvScript(\n envVars: EnvVars,\n commandToRun: string = \"\",\n): string {\n const shell = getShell()\n const filteredEnvVars = Object.entries(envVars).filter(\n ([, value]) => value !== undefined,\n ) as Array<[string, string]>\n\n let commandBlock: string\n\n switch (shell) {\n case \"powershell\": {\n commandBlock = filteredEnvVars\n .map(([key, value]) => `$env:${key} = ${quotePowerShellValue(value)}`)\n .join(\"; \")\n break\n }\n case \"cmd\": {\n commandBlock = filteredEnvVars\n .map(([key, value]) => `set \"${key}=${value}\"`)\n .join(\" & \")\n break\n }\n case \"fish\": {\n commandBlock = filteredEnvVars\n .map(([key, value]) => `set -gx ${key} ${quotePosixValue(value)}`)\n .join(\"; \")\n break\n }\n default: {\n // bash, zsh, sh\n const assignments = filteredEnvVars\n .map(([key, value]) => `${key}=${quotePosixValue(value)}`)\n .join(\" \")\n commandBlock = filteredEnvVars.length > 0 ? `export ${assignments}` : \"\"\n break\n }\n }\n\n if (commandBlock && commandToRun) {\n const separator =\n shell === \"cmd\" ? \" & \" : shell === \"powershell\" ? \"; \" : \" && \"\n return `${commandBlock}${separator}${commandToRun}`\n }\n\n return commandBlock || commandToRun\n}\n","#!/usr/bin/env node\n\nimport { defineCommand } from \"citty\"\nimport clipboard from \"clipboardy\"\nimport consola from \"consola\"\n\nimport { generateEnvScript } from \"./lib/shell\"\nimport { DEFAULT_CODEX_MODEL, DEFAULT_PORT } from \"./lib/port\"\nimport { provisionBrowserAssets } from \"./lib/browser-mcp/provision\"\nimport { browserToolsEnabled } from \"./lib/mcp-capabilities\"\nimport { colbertDegradedWarning, provisionAndIndexColbert } from \"./lib/colbert\"\nimport { startKeepAwake } from \"./lib/keep-awake\"\nimport { warmTreeSitterPool } from \"./lib/tree-sitter-pool/pool\"\nimport {\n getClaudeCodeEnvVars,\n getCodexEnvVars,\n parseSharedArgs,\n setupAndServe,\n sharedServerArgs,\n} from \"./lib/server-setup\"\nimport { runSelfUpdate } from \"./lib/self-update\"\n\nfunction printAndCopyCommand(command: string, label: string): void {\n consola.box(`${label}\\n\\n${command}`)\n try {\n clipboard.writeSync(command)\n consola.success(`Copied ${label} command to clipboard!`)\n } catch {\n consola.warn(\"Failed to copy to clipboard. Copy the command above manually.\")\n }\n}\n\nfunction generateClaudeCodeCommand(serverUrl: string, model?: string) {\n const envVars = getClaudeCodeEnvVars(serverUrl, model)\n const command = generateEnvScript(envVars, \"claude --dangerously-skip-permissions\")\n printAndCopyCommand(command, \"Claude Code\")\n}\n\nfunction generateCodexCommand(serverUrl: string, model?: string) {\n const codexModel = model ?? DEFAULT_CODEX_MODEL\n const envVars = getCodexEnvVars(serverUrl)\n const command = generateEnvScript(envVars, `codex -m ${codexModel}`)\n printAndCopyCommand(command, \"Codex CLI\")\n}\n\nexport const start = defineCommand({\n meta: {\n name: \"start\",\n description: \"Start the github-router server\",\n },\n args: {\n ...sharedServerArgs,\n cc: {\n type: \"boolean\",\n default: false,\n description:\n \"Generate a command to launch Claude Code with Copilot API config\",\n },\n cx: {\n type: \"boolean\",\n default: false,\n description:\n \"Generate a command to launch Codex CLI with Copilot API config\",\n },\n model: {\n alias: \"m\",\n type: \"string\",\n description: \"Override the default model (used with --cc or --cx)\",\n },\n },\n async run({ args }) {\n const parsed = parseSharedArgs(args as unknown as Record<string, unknown>)\n\n const { serverUrl } = await setupAndServe({\n ...parsed,\n port: parsed.port ?? DEFAULT_PORT,\n silent: false,\n })\n\n // Best-effort self-update (detached, applies next launch). Runs\n // after the server is listening so the bounded probe can't delay it.\n void runSelfUpdate({ selfUpdate: args[\"self-update\"] !== false })\n\n // Best-effort ColBERT semantic-search provision + background index of\n // the launch cwd (if a git repo). Opt-IN via --search (no-op otherwise);\n // never blocks launch, never throws.\n void provisionAndIndexColbert()\n\n // Surface a terminally-failed semantic index to the HUMAN (see the note\n // in claude.ts). Fire-and-forget; lexical search still works.\n void colbertDegradedWarning()\n .then((warning) => {\n if (warning) process.stderr.write(`${warning}\\n`)\n })\n .catch(() => {})\n\n // Ready one tree-sitter worker in the background so the first code search\n // avoids WASM/grammar initialization. One worker keeps launch CPU bounded;\n // demand grows the pool lazily. Opt out with GH_ROUTER_DISABLE_TS_POOL_WARMUP=1.\n void warmTreeSitterPool()\n\n // Best-effort: keep the machine awake while the proxy serves (win32\n // default-on; opt out with GH_ROUTER_DISABLE_KEEP_AWAKE=1). Holds a\n // SetThreadExecutionState assertion via a persistent PowerShell\n // helper. Self-registers its own SIGINT/SIGTERM/exit reaper — load-\n // bearing here, because `start` has no launchChild/onShutdown.\n startKeepAwake()\n\n // Best-effort: materialize the browser extension + bridge into the\n // stable app-dir and stamp the running version, so a one-time \"Load\n // unpacked\" survives npx/bunx upgrades. Gated on --browse; never\n // blocks launch, never throws.\n if (browserToolsEnabled()) {\n void provisionBrowserAssets().catch((err) =>\n consola.debug(\"Browser extension provisioning failed:\", err),\n )\n }\n\n if (args.cc) generateClaudeCodeCommand(serverUrl, args.model)\n if (args.cx) generateCodexCommand(serverUrl, args.model)\n\n consola.box(\n `🌐 Usage Viewer: https://animeshkundu.github.io/github-router/dashboard.html?endpoint=${serverUrl}/usage`,\n )\n },\n})\n"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
2
|
-
|
|
2
|
+
// src/lib/state.ts
|
|
3
3
|
/**
|
|
4
4
|
* Registry key backing the `state.peerMcpNonce` back-compat accessor
|
|
5
5
|
* below. Not a real launch id (no `registerLaunch` caller ever produces
|
|
@@ -63,7 +63,6 @@ Object.defineProperty(state, "peerMcpNonce", {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
-
//#endregion
|
|
67
66
|
export { state as t };
|
|
68
67
|
|
|
69
|
-
//# sourceMappingURL=state-
|
|
68
|
+
//# sourceMappingURL=state-CCGDJ43X.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-DzsaGHr9.js","names":[],"sources":["../src/lib/state.ts"],"sourcesContent":["import { randomBytes, randomUUID } from \"node:crypto\"\n\nimport type { ModelsResponse } from \"~/services/copilot/get-models\"\nimport type { BluebirdMcpClient } from \"./bluebird-client\"\nimport type { LaunchProfileId } from \"./launch-profile\"\n\n/**\n * One authenticated `github-router claude` (or `serve`) launch's identity\n * and capability scope, keyed by `launchId` in `state.launchRegistry`.\n *\n * Replaces the earlier scalar `state.peerMcpNonce` assumption — a single\n * process-global nonce cannot express \"which profile is this caller\", so\n * a concurrent fast + standard launch (or a reconnect) had no way to keep\n * their identities from being interchangeable. Each entry carries BOTH\n * credentials a launch presents on the wire:\n *\n * - `nonce` — the `/mcp` bearer (Streamable HTTP `Authorization` header).\n * - `secret` — the `/v1/messages` identity-preflight bearer, deliberately\n * a SEPARATE credential from `nonce` so leaking one surface's token\n * (say, via a client log) does not also authenticate the other.\n *\n * `allowedGroups` / `allowedPersonas` are the narrowing declaration for\n * scoped MCP surfaces: `undefined` means UNRESTRICTED (the standard/BYO\n * launch shape today), and a concrete `ReadonlySet` is a restricted profile's\n * hard allow-list. This module only stores and looks up the declaration;\n * enforcing it against `tools/list` / `tools/call` is the MCP route\n * handler's job.\n */\nexport interface LaunchRegistryEntry {\n /** Opaque per-launch id. Primary key into `state.launchRegistry`. */\n launchId: string\n /** `/mcp` Streamable HTTP bearer for this launch. */\n nonce: string\n /**\n * Optional lead-only `/mcp` bearer for fast profile.\n * Grants access to lead-only tools such as `astra`.\n */\n leadPeersNonce?: string\n /** `/v1/messages` identity-preflight bearer for this launch. */\n secret: string\n /** Which launch profile authenticated this entry. */\n profileId: LaunchProfileId\n /** Scoped MCP group allow-list. `undefined` = unrestricted. */\n allowedGroups?: ReadonlySet<string>\n /** Persona (peers-group) tool-name allow-list. `undefined` = unrestricted. */\n allowedPersonas?: ReadonlySet<string>\n /**\n * The client's own conversation id, learned from `x-claude-code-session-id`\n * on this launch's `/v1/messages` traffic.\n *\n * `/mcp` has no conversation header of its own, so a local consult issued\n * from an MCP tool call has nothing to key prompt-cache routing on. The\n * lead's `/v1/messages` requests are the one channel that carries the id,\n * and the launch registry is the shared place the messages route and the MCP\n * route both hold. Latest value wins: `/clear` starts a new conversation and\n * the stale id would otherwise follow the session forever.\n */\n sessionId?: string\n createdAt: number\n}\n\n/**\n * Registry key backing the `state.peerMcpNonce` back-compat accessor\n * below. Not a real launch id (no `registerLaunch` caller ever produces\n * this string), so it can never collide with a genuine per-launch UUID.\n */\nconst DEFAULT_LAUNCH_ID = \"__default__\"\n\nexport interface State {\n githubToken?: string\n copilotToken?: string\n /**\n * GitHub login of `githubToken`, resolved once at setup for the\n * launch summary. Display-only; auth decisions never read it.\n */\n githubUserLogin?: string\n\n /**\n * Where `githubToken` came from, which decides whether the proxy may\n * re-read it from disk.\n *\n * `\"file\"` — read from `PATHS.GITHUB_TOKEN_PATH`. A re-read is allowed, so\n * an out-of-band `github-router auth` heals a running proxy without a\n * restart.\n *\n * `\"explicit\"` — supplied by the operator via `--github-token` / `GH_TOKEN`.\n * The file is NEVER read on this path: silently replacing a\n * caller-supplied credential with whatever happens to be on disk would\n * override an explicit instruction. It also means \"run `github-router\n * auth`\" is false advice for this source — the remediation is to replace\n * the supplied value.\n */\n githubTokenSource?: \"file\" | \"explicit\"\n\n /**\n * Monotonic counter bumped on every SUCCESSFUL Copilot token exchange.\n *\n * This is the retry criterion for `tryRefreshAndRetry`, and it is\n * deliberately not \"did the token string change\": two consecutive\n * successful exchanges were observed returning an identical token, so a\n * string comparison would silently suppress legitimate retries. Nor is it\n * the refresh's own verdict — with requests A and B both holding a stale\n * token, A can refresh while B's later 401 is cooled down to a no-op, and\n * a verdict of \"nothing happened\" would fail B even though a good token is\n * already in `copilotToken`. Comparing generations answers the question\n * each request actually has: \"is what is in state now different from what\n * I already tried?\"\n */\n copilotTokenGeneration: number\n\n /**\n * Wall-clock ms after which `copilotToken` should be refreshed — already\n * skew-adjusted, so the per-request check is a plain `Date.now() >=` compare.\n *\n * Derived from the exchange's `refresh_in` (a DURATION) and never from its\n * absolute `expires_at`. A local clock running ahead of GitHub's would make\n * an absolute timestamp look already-past on a brand-new token and drive a\n * refresh storm; a duration is immune, because it is anchored to the same\n * clock that later reads it.\n */\n copilotTokenRefreshAt?: number\n\n /**\n * Second, WRITE-capable GitHub token for the first-mate\n * agent-orchestration surface (`--agents`). Minted by a separate\n * device-flow login against the GitHub CLI's OAuth client\n * (`GITHUB_AGENT_CLIENT_ID`, scopes `repo workflow read:org`) and\n * stored at `PATHS.GITHUB_AGENT_TOKEN_PATH`, apart from `githubToken`\n * (the Copilot App token, read:user). The first-mate GitHub service\n * layer uses this for ALL its calls (reads included, so it also works\n * on private repos). Undefined until the agent login has run.\n */\n githubAgentToken?: string\n\n accountType: string\n copilotApiUrl?: string\n models?: ModelsResponse\n vsCodeVersion?: string\n copilotVersion?: string\n\n manualApprove: boolean\n rateLimitWait: boolean\n showToken: boolean\n extendedBetas: boolean\n\n /**\n * Opt-in flag for the browser-control MCP tools (`browser_*`). Set by\n * `setupAndServe` from the `--browse` CLI flag or\n * `GH_ROUTER_ENABLE_BROWSE=1` env var. When false, all `browser_*`\n * tools are dropped from `tools/list` AND `tools/call` returns\n * -32601 — same defense-in-depth pattern as `workerToolsEnabled()` /\n * `standInToolEnabled()`. See `browserToolsEnabled()` in\n * `src/routes/mcp/handler.ts`.\n */\n browseEnabled: boolean\n\n /**\n * Opt-in flag for the fleet session-control MCP tools (`mcp__fleet__*`).\n * Set by `setupAndServe` from the `--fleet` CLI flag or\n * `GH_ROUTER_ENABLE_FLEET=1` env var. When false, all fleet tools are\n * dropped from `tools/list` AND `tools/call` returns -32601 — same\n * defense-in-depth pattern as `workerToolsEnabled()` /\n * `standInToolEnabled()`. See `fleetToolsEnabled()` in\n * `src/lib/mcp-capabilities.ts`.\n */\n fleetEnabled: boolean\n\n /**\n * Opt-in flag for the first-mate agent-orchestration MCP tools\n * (`mcp__first-mate__*`) and the in-process GitHub cloud-agent driving\n * layer. Set by `setupAndServe` from the `--agents` CLI flag or\n * `GH_ROUTER_ENABLE_AGENTS=1`. When false, the first-mate tools are\n * dropped from `tools/list` AND `tools/call` returns -32601 — same\n * defense-in-depth pattern as `fleetToolsEnabled()`. Additionally\n * requires `state.githubAgentToken` present (the write login), so the\n * surface is invisible rather than 401-ing when unauthenticated. See\n * `agentToolsEnabled()` in `src/lib/mcp-capabilities.ts`.\n */\n agentsEnabled: boolean\n\n /**\n * When true, --power-browse was passed (or GH_ROUTER_ENABLE_POWER_BROWSE=1\n * is set). Exposes the FULL browser MCP surface (~18 tools) on /mcp,\n * including the L0/L1 primitives that hand DOM details (refs,\n * bboxes, role/name dumps) to the lead model. Default --browse mode\n * exposes only the 6 lead-model tools (act, observe, extract,\n * navigate, screenshot, open_tab). Always implies browseEnabled.\n */\n powerBrowseEnabled: boolean\n\n /**\n * Opt-in flag for ColBERT/colgrep semantic code search. Set by\n * `setupAndServe` from the `--search` CLI flag or\n * `GH_ROUTER_ENABLE_SEMANTIC_SEARCH=1` env var. When false, no colgrep\n * binary/model is provisioned, no workspace is indexed, and the `code`\n * MCP tool serves lexical results (with `lexical-fallback` source when\n * semantic mode was requested). See `semanticSearchOptedIn()` in\n * `src/lib/colbert/index.ts`; `GH_ROUTER_DISABLE_SEMANTIC_SEARCH=1`\n * hard-disables regardless of this flag.\n */\n searchEnabled: boolean\n\n /**\n * Opt-in flag for Bluebird Azure DevOps code search. Set by\n * `setupAndServe` from the `--bluebird` CLI flag or\n * `GH_ROUTER_ENABLE_BLUEBIRD=1` env var. When true, the `code` MCP\n * tool routes `semantic`/`lexical` modes through the Bluebird MCP\n * server. This flag is independent from `searchEnabled`, which controls\n * local ColBERT provisioning; `exact`/`regex`/`ast` stay local.\n * See `src/lib/bluebird-client.ts`.\n */\n bluebirdEnabled: boolean\n\n /** Last connected Bluebird client, retained only for compatibility and\n * diagnostics. Client selection is owned by the Bluebird runtime manager. */\n bluebirdClient: BluebirdMcpClient | null\n\n /** Resolved Bluebird scope (org/project/repos/branch), for logging and\n * the `x-mcp-ec-*` headers baked into the client. */\n bluebirdOrganization: string | null\n bluebirdProject: string | null\n bluebirdRepositories: Array<string>\n bluebirdBranch: string | null\n\n /**\n * Azure DevOps remote MCP group (`mcp__ado__*`). Enabled by `--ado`, by\n * `GH_ROUTER_ENABLE_ADO=1`, or automatically when the workspace's git\n * remotes resolve to an Azure DevOps repository. See\n * `src/lib/azure-mcp-flags.ts` for the precedence and the trust argument.\n */\n adoEnabled: boolean\n /** Organization whose `https://mcp.dev.azure.com/{org}` endpoint is used. */\n adoOrganization: string | null\n /**\n * `X-MCP-Toolsets` selection. The single entry `\"all\"` means \"send no\n * header\". Empty only while the group is off.\n */\n adoToolsets: Array<string>\n /**\n * Send `X-MCP-Readonly: true`. True unless `--ado-write` was passed. Never\n * cleared by discovery — a git remote can turn this group on but can never\n * widen it to writes.\n */\n adoReadOnly: boolean\n\n /**\n * Kusto (Azure Data Explorer) MCP group (`mcp__kusto__*`). Turned on by the\n * operator's `--kusto` flag, by a named cluster, or automatically when the\n * workspace's git remotes resolve to an Azure DevOps repository. Discovery\n * turns the GROUP on and never supplies a cluster: the model names one per\n * call, and the operator's own cluster access bounds the reach.\n */\n kustoEnabled: boolean\n /**\n * Default cluster for calls that do not name one, or null. Null no longer\n * turns the group off: every kusto tool takes its own `cluster`, so a launch\n * with no default still works, it just requires the argument.\n */\n kustoCluster: string | null\n kustoDatabase: string | null\n\n /**\n * Cloud Agent Job API v2 MCP group (`mcp__cloudagent__*`): hand work to a cloud\n * coding agent running against an Azure DevOps repository.\n *\n * Enabled by `--cloudagent`, by `GH_ROUTER_ENABLE_CLOUDAGENT=1`, or automatically\n * when the workspace's git remotes resolve to an Azure DevOps repository.\n * Discovery enables the whole group, write tools included, matching the ADO,\n * Kusto and Bluebird groups; `--no-cloudagent` remains the operator's veto.\n */\n cloudAgentEnabled: boolean\n /** `prod` or `ppe`, normalized by `resolveCloudAgentFlags()` at launch. */\n cloudAgentEnvironment: string\n\n /**\n * Work IQ MCP group (`mcp__workiq__*`): Microsoft 365 research through the\n * hosted Work IQ service.\n *\n * Off by default and never auto-enabled: the group needs a signed-in Work IQ\n * account, and turning it on without one would advertise an empty server.\n * Enabled by `--workiq` or `GH_ROUTER_ENABLE_WORKIQ=1`.\n *\n * `setupAndServe` clears it back to false when the launch-time provisioning\n * pass cannot reach the service or has no usable token, so the group is\n * advertised only when the snapshot behind it is real.\n */\n workiqEnabled: boolean\n /**\n * Exposes the four mutating Work IQ tools (`create_entity`, `update_entity`,\n * `delete_entity`, `do_action`). The default surface is the eight read-only\n * tools; `--workiq-write` widens the snapshot to whatever the live server\n * actually advertises.\n */\n workiqWriteEnabled: boolean\n\n /**\n * Humanlike pacing override:\n * \"on\" - --humanlike CLI flag or GH_ROUTER_HUMANLIKE=1 env;\n * inject Beta-distributed inter-action delays, Bezier\n * mouse paths, per-keystroke jitter, scroll chunking\n * into every browser_* action dispatch.\n * \"off\" - GH_ROUTER_BROWSER_NO_HUMANLIKE=1; HARD disable, wins\n * over \"on\" so tests are reproducible.\n * \"auto\" - default; pacing engages only when bot-challenge\n * detection fires (Phase 4-future).\n *\n * Lead model never sees this state — it's an internal concern.\n */\n humanlikeForce: \"on\" | \"off\" | \"auto\"\n\n // Rate limiting configuration\n rateLimitSeconds?: number\n lastRequestTimestamp?: number\n\n // Persistent session identifiers to match VS Code fingerprint\n sessionId: string\n machineId: string\n\n /**\n * Keyed per-launch registry for the loopback `/mcp` endpoint AND the\n * `/v1/messages` identity preflight. Set by the `claude` subcommand\n * (via `registerLaunch` in `./launch-registry`) after `setupAndServe`\n * and before spawning Claude Code; removed by the launch's own\n * cleanup. When empty, `/mcp` rejects all requests — closes the\n * loopback-no-auth gap (DNS rebinding, malicious browser-ext native\n * messaging, sibling-process probe) exactly as the old scalar nonce\n * did when unset.\n *\n * Multiple entries coexist for concurrent fast/standard launches (or a\n * launch plus a reconnect); each is looked up by its OWN nonce/secret,\n * so two launches' authenticated identities never cross.\n */\n launchRegistry: Map<string, LaunchRegistryEntry>\n\n /**\n * @deprecated Back-compat accessor over the registry's DEFAULT_LAUNCH_ID\n * entry (profileId \"standard\", unrestricted `allowedGroups`/\n * `allowedPersonas`) — defined below via `Object.defineProperty`, not a\n * real stored field. Reading returns that entry's nonce; writing creates\n * or updates it (or deletes it on `undefined`). Exists so single-launch\n * call sites and tests that already do `state.peerMcpNonce = NONCE`\n * keep working unmodified while `checkAuth` and the identity preflight\n * consult the real keyed registry underneath. New code should call\n * `registerLaunch` / `findLaunchByNonce` / `findLaunchBySecret` from\n * `./launch-registry` directly instead of reading/writing this field.\n */\n peerMcpNonce?: string\n\n /**\n * Set by `github-router serve` (a single machine-wide control plane serving\n * many repos). When true, repo-scoped worker tools require an explicit/So-derived\n * `workspace` and must NOT silently default to the proxy launch cwd.\n */\n serveMode?: boolean\n}\n\nexport const state: State = {\n accountType: \"enterprise\",\n copilotTokenGeneration: 0,\n manualApprove: false,\n rateLimitWait: false,\n showToken: false,\n extendedBetas: false,\n browseEnabled: false,\n fleetEnabled: false,\n agentsEnabled: false,\n powerBrowseEnabled: false,\n searchEnabled: false,\n bluebirdEnabled: false,\n bluebirdClient: null,\n bluebirdOrganization: null,\n bluebirdProject: null,\n bluebirdRepositories: [],\n bluebirdBranch: null,\n adoEnabled: false,\n adoOrganization: null,\n adoToolsets: [],\n adoReadOnly: true,\n kustoEnabled: false,\n kustoCluster: null,\n kustoDatabase: null,\n cloudAgentEnabled: false,\n cloudAgentEnvironment: \"prod\",\n workiqEnabled: false,\n workiqWriteEnabled: false,\n humanlikeForce: \"auto\",\n sessionId: randomUUID(),\n machineId: randomBytes(32).toString(\"hex\"),\n launchRegistry: new Map(),\n}\n\n// `peerMcpNonce` is not a plain data field — it's a live view onto\n// `state.launchRegistry.get(DEFAULT_LAUNCH_ID)`. Defined via\n// `Object.defineProperty` (rather than a class) so `state` stays the\n// plain object literal every existing importer already destructures /\n// mutates directly.\nObject.defineProperty(state, \"peerMcpNonce\", {\n enumerable: true,\n configurable: true,\n get(): string | undefined {\n return state.launchRegistry.get(DEFAULT_LAUNCH_ID)?.nonce\n },\n set(value: string | undefined) {\n if (value === undefined) {\n state.launchRegistry.delete(DEFAULT_LAUNCH_ID)\n return\n }\n const existing = state.launchRegistry.get(DEFAULT_LAUNCH_ID)\n state.launchRegistry.set(DEFAULT_LAUNCH_ID, {\n launchId: DEFAULT_LAUNCH_ID,\n nonce: value,\n // A caller that only ever touches `peerMcpNonce` exposes MCP only and has\n // no Messages identity secret.\n // Never reuse the MCP bearer across surfaces: an empty secret cannot match\n // any non-empty custom header, while registered Claude launches always use\n // `registerLaunch` with independently generated credentials.\n secret: existing?.secret ?? \"\",\n profileId: existing?.profileId ?? \"standard\",\n allowedGroups: existing?.allowedGroups,\n allowedPersonas: existing?.allowedPersonas,\n createdAt: existing?.createdAt ?? Date.now(),\n })\n },\n})\n"],"mappings":";;;;;;;AAkEA,MAAM,oBAAoB;AAkS1B,MAAa,QAAe;CAC1B,aAAa;CACb,wBAAwB;CACxB,eAAe;CACf,eAAe;CACf,WAAW;CACX,eAAe;CACf,eAAe;CACf,cAAc;CACd,eAAe;CACf,oBAAoB;CACpB,eAAe;CACf,iBAAiB;CACjB,gBAAgB;CAChB,sBAAsB;CACtB,iBAAiB;CACjB,sBAAsB,CAAC;CACvB,gBAAgB;CAChB,YAAY;CACZ,iBAAiB;CACjB,aAAa,CAAC;CACd,aAAa;CACb,cAAc;CACd,cAAc;CACd,eAAe;CACf,mBAAmB;CACnB,uBAAuB;CACvB,eAAe;CACf,oBAAoB;CACpB,gBAAgB;CAChB,WAAW,WAAW;CACtB,WAAW,YAAY,EAAE,CAAC,CAAC,SAAS,KAAK;CACzC,gCAAgB,IAAI,IAAI;AAC1B;AAOA,OAAO,eAAe,OAAO,gBAAgB;CAC3C,YAAY;CACZ,cAAc;CACd,MAA0B;EACxB,OAAO,MAAM,eAAe,IAAI,iBAAiB,CAAC,EAAE;CACtD;CACA,IAAI,OAA2B;EAC7B,IAAI,UAAU,KAAA,GAAW;GACvB,MAAM,eAAe,OAAO,iBAAiB;GAC7C;EACF;EACA,MAAM,WAAW,MAAM,eAAe,IAAI,iBAAiB;EAC3D,MAAM,eAAe,IAAI,mBAAmB;GAC1C,UAAU;GACV,OAAO;GAMP,QAAQ,UAAU,UAAU;GAC5B,WAAW,UAAU,aAAa;GAClC,eAAe,UAAU;GACzB,iBAAiB,UAAU;GAC3B,WAAW,UAAU,aAAa,KAAK,IAAI;EAC7C,CAAC;CACH;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"state-CCGDJ43X.js","names":[],"sources":["../src/lib/state.ts"],"sourcesContent":["import { randomBytes, randomUUID } from \"node:crypto\"\n\nimport type { ModelsResponse } from \"~/services/copilot/get-models\"\nimport type { BluebirdMcpClient } from \"./bluebird-client\"\nimport type { LaunchProfileId } from \"./launch-profile\"\n\n/**\n * One authenticated `github-router claude` (or `serve`) launch's identity\n * and capability scope, keyed by `launchId` in `state.launchRegistry`.\n *\n * Replaces the earlier scalar `state.peerMcpNonce` assumption — a single\n * process-global nonce cannot express \"which profile is this caller\", so\n * a concurrent fast + standard launch (or a reconnect) had no way to keep\n * their identities from being interchangeable. Each entry carries BOTH\n * credentials a launch presents on the wire:\n *\n * - `nonce` — the `/mcp` bearer (Streamable HTTP `Authorization` header).\n * - `secret` — the `/v1/messages` identity-preflight bearer, deliberately\n * a SEPARATE credential from `nonce` so leaking one surface's token\n * (say, via a client log) does not also authenticate the other.\n *\n * `allowedGroups` / `allowedPersonas` are the narrowing declaration for\n * scoped MCP surfaces: `undefined` means UNRESTRICTED (the standard/BYO\n * launch shape today), and a concrete `ReadonlySet` is a restricted profile's\n * hard allow-list. This module only stores and looks up the declaration;\n * enforcing it against `tools/list` / `tools/call` is the MCP route\n * handler's job.\n */\nexport interface LaunchRegistryEntry {\n /** Opaque per-launch id. Primary key into `state.launchRegistry`. */\n launchId: string\n /** `/mcp` Streamable HTTP bearer for this launch. */\n nonce: string\n /**\n * Optional lead-only `/mcp` bearer for fast profile.\n * Grants access to lead-only tools such as `astra`.\n */\n leadPeersNonce?: string\n /** `/v1/messages` identity-preflight bearer for this launch. */\n secret: string\n /** Which launch profile authenticated this entry. */\n profileId: LaunchProfileId\n /** Scoped MCP group allow-list. `undefined` = unrestricted. */\n allowedGroups?: ReadonlySet<string>\n /** Persona (peers-group) tool-name allow-list. `undefined` = unrestricted. */\n allowedPersonas?: ReadonlySet<string>\n /**\n * The client's own conversation id, learned from `x-claude-code-session-id`\n * on this launch's `/v1/messages` traffic.\n *\n * `/mcp` has no conversation header of its own, so a local consult issued\n * from an MCP tool call has nothing to key prompt-cache routing on. The\n * lead's `/v1/messages` requests are the one channel that carries the id,\n * and the launch registry is the shared place the messages route and the MCP\n * route both hold. Latest value wins: `/clear` starts a new conversation and\n * the stale id would otherwise follow the session forever.\n */\n sessionId?: string\n createdAt: number\n}\n\n/**\n * Registry key backing the `state.peerMcpNonce` back-compat accessor\n * below. Not a real launch id (no `registerLaunch` caller ever produces\n * this string), so it can never collide with a genuine per-launch UUID.\n */\nconst DEFAULT_LAUNCH_ID = \"__default__\"\n\nexport interface State {\n githubToken?: string\n copilotToken?: string\n /**\n * GitHub login of `githubToken`, resolved once at setup for the\n * launch summary. Display-only; auth decisions never read it.\n */\n githubUserLogin?: string\n\n /**\n * Where `githubToken` came from, which decides whether the proxy may\n * re-read it from disk.\n *\n * `\"file\"` — read from `PATHS.GITHUB_TOKEN_PATH`. A re-read is allowed, so\n * an out-of-band `github-router auth` heals a running proxy without a\n * restart.\n *\n * `\"explicit\"` — supplied by the operator via `--github-token` / `GH_TOKEN`.\n * The file is NEVER read on this path: silently replacing a\n * caller-supplied credential with whatever happens to be on disk would\n * override an explicit instruction. It also means \"run `github-router\n * auth`\" is false advice for this source — the remediation is to replace\n * the supplied value.\n */\n githubTokenSource?: \"file\" | \"explicit\"\n\n /**\n * Monotonic counter bumped on every SUCCESSFUL Copilot token exchange.\n *\n * This is the retry criterion for `tryRefreshAndRetry`, and it is\n * deliberately not \"did the token string change\": two consecutive\n * successful exchanges were observed returning an identical token, so a\n * string comparison would silently suppress legitimate retries. Nor is it\n * the refresh's own verdict — with requests A and B both holding a stale\n * token, A can refresh while B's later 401 is cooled down to a no-op, and\n * a verdict of \"nothing happened\" would fail B even though a good token is\n * already in `copilotToken`. Comparing generations answers the question\n * each request actually has: \"is what is in state now different from what\n * I already tried?\"\n */\n copilotTokenGeneration: number\n\n /**\n * Wall-clock ms after which `copilotToken` should be refreshed — already\n * skew-adjusted, so the per-request check is a plain `Date.now() >=` compare.\n *\n * Derived from the exchange's `refresh_in` (a DURATION) and never from its\n * absolute `expires_at`. A local clock running ahead of GitHub's would make\n * an absolute timestamp look already-past on a brand-new token and drive a\n * refresh storm; a duration is immune, because it is anchored to the same\n * clock that later reads it.\n */\n copilotTokenRefreshAt?: number\n\n /**\n * Second, WRITE-capable GitHub token for the first-mate\n * agent-orchestration surface (`--agents`). Minted by a separate\n * device-flow login against the GitHub CLI's OAuth client\n * (`GITHUB_AGENT_CLIENT_ID`, scopes `repo workflow read:org`) and\n * stored at `PATHS.GITHUB_AGENT_TOKEN_PATH`, apart from `githubToken`\n * (the Copilot App token, read:user). The first-mate GitHub service\n * layer uses this for ALL its calls (reads included, so it also works\n * on private repos). Undefined until the agent login has run.\n */\n githubAgentToken?: string\n\n accountType: string\n copilotApiUrl?: string\n models?: ModelsResponse\n vsCodeVersion?: string\n copilotVersion?: string\n\n manualApprove: boolean\n rateLimitWait: boolean\n showToken: boolean\n extendedBetas: boolean\n\n /**\n * Opt-in flag for the browser-control MCP tools (`browser_*`). Set by\n * `setupAndServe` from the `--browse` CLI flag or\n * `GH_ROUTER_ENABLE_BROWSE=1` env var. When false, all `browser_*`\n * tools are dropped from `tools/list` AND `tools/call` returns\n * -32601 — same defense-in-depth pattern as `workerToolsEnabled()` /\n * `standInToolEnabled()`. See `browserToolsEnabled()` in\n * `src/routes/mcp/handler.ts`.\n */\n browseEnabled: boolean\n\n /**\n * Opt-in flag for the fleet session-control MCP tools (`mcp__fleet__*`).\n * Set by `setupAndServe` from the `--fleet` CLI flag or\n * `GH_ROUTER_ENABLE_FLEET=1` env var. When false, all fleet tools are\n * dropped from `tools/list` AND `tools/call` returns -32601 — same\n * defense-in-depth pattern as `workerToolsEnabled()` /\n * `standInToolEnabled()`. See `fleetToolsEnabled()` in\n * `src/lib/mcp-capabilities.ts`.\n */\n fleetEnabled: boolean\n\n /**\n * Opt-in flag for the first-mate agent-orchestration MCP tools\n * (`mcp__first-mate__*`) and the in-process GitHub cloud-agent driving\n * layer. Set by `setupAndServe` from the `--agents` CLI flag or\n * `GH_ROUTER_ENABLE_AGENTS=1`. When false, the first-mate tools are\n * dropped from `tools/list` AND `tools/call` returns -32601 — same\n * defense-in-depth pattern as `fleetToolsEnabled()`. Additionally\n * requires `state.githubAgentToken` present (the write login), so the\n * surface is invisible rather than 401-ing when unauthenticated. See\n * `agentToolsEnabled()` in `src/lib/mcp-capabilities.ts`.\n */\n agentsEnabled: boolean\n\n /**\n * When true, --power-browse was passed (or GH_ROUTER_ENABLE_POWER_BROWSE=1\n * is set). Exposes the FULL browser MCP surface (~18 tools) on /mcp,\n * including the L0/L1 primitives that hand DOM details (refs,\n * bboxes, role/name dumps) to the lead model. Default --browse mode\n * exposes only the 6 lead-model tools (act, observe, extract,\n * navigate, screenshot, open_tab). Always implies browseEnabled.\n */\n powerBrowseEnabled: boolean\n\n /**\n * Opt-in flag for ColBERT/colgrep semantic code search. Set by\n * `setupAndServe` from the `--search` CLI flag or\n * `GH_ROUTER_ENABLE_SEMANTIC_SEARCH=1` env var. When false, no colgrep\n * binary/model is provisioned, no workspace is indexed, and the `code`\n * MCP tool serves lexical results (with `lexical-fallback` source when\n * semantic mode was requested). See `semanticSearchOptedIn()` in\n * `src/lib/colbert/index.ts`; `GH_ROUTER_DISABLE_SEMANTIC_SEARCH=1`\n * hard-disables regardless of this flag.\n */\n searchEnabled: boolean\n\n /**\n * Opt-in flag for Bluebird Azure DevOps code search. Set by\n * `setupAndServe` from the `--bluebird` CLI flag or\n * `GH_ROUTER_ENABLE_BLUEBIRD=1` env var. When true, the `code` MCP\n * tool routes `semantic`/`lexical` modes through the Bluebird MCP\n * server. This flag is independent from `searchEnabled`, which controls\n * local ColBERT provisioning; `exact`/`regex`/`ast` stay local.\n * See `src/lib/bluebird-client.ts`.\n */\n bluebirdEnabled: boolean\n\n /** Last connected Bluebird client, retained only for compatibility and\n * diagnostics. Client selection is owned by the Bluebird runtime manager. */\n bluebirdClient: BluebirdMcpClient | null\n\n /** Resolved Bluebird scope (org/project/repos/branch), for logging and\n * the `x-mcp-ec-*` headers baked into the client. */\n bluebirdOrganization: string | null\n bluebirdProject: string | null\n bluebirdRepositories: Array<string>\n bluebirdBranch: string | null\n\n /**\n * Azure DevOps remote MCP group (`mcp__ado__*`). Enabled by `--ado`, by\n * `GH_ROUTER_ENABLE_ADO=1`, or automatically when the workspace's git\n * remotes resolve to an Azure DevOps repository. See\n * `src/lib/azure-mcp-flags.ts` for the precedence and the trust argument.\n */\n adoEnabled: boolean\n /** Organization whose `https://mcp.dev.azure.com/{org}` endpoint is used. */\n adoOrganization: string | null\n /**\n * `X-MCP-Toolsets` selection. The single entry `\"all\"` means \"send no\n * header\". Empty only while the group is off.\n */\n adoToolsets: Array<string>\n /**\n * Send `X-MCP-Readonly: true`. True unless `--ado-write` was passed. Never\n * cleared by discovery — a git remote can turn this group on but can never\n * widen it to writes.\n */\n adoReadOnly: boolean\n\n /**\n * Kusto (Azure Data Explorer) MCP group (`mcp__kusto__*`). Turned on by the\n * operator's `--kusto` flag, by a named cluster, or automatically when the\n * workspace's git remotes resolve to an Azure DevOps repository. Discovery\n * turns the GROUP on and never supplies a cluster: the model names one per\n * call, and the operator's own cluster access bounds the reach.\n */\n kustoEnabled: boolean\n /**\n * Default cluster for calls that do not name one, or null. Null no longer\n * turns the group off: every kusto tool takes its own `cluster`, so a launch\n * with no default still works, it just requires the argument.\n */\n kustoCluster: string | null\n kustoDatabase: string | null\n\n /**\n * Cloud Agent Job API v2 MCP group (`mcp__cloudagent__*`): hand work to a cloud\n * coding agent running against an Azure DevOps repository.\n *\n * Enabled by `--cloudagent`, by `GH_ROUTER_ENABLE_CLOUDAGENT=1`, or automatically\n * when the workspace's git remotes resolve to an Azure DevOps repository.\n * Discovery enables the whole group, write tools included, matching the ADO,\n * Kusto and Bluebird groups; `--no-cloudagent` remains the operator's veto.\n */\n cloudAgentEnabled: boolean\n /** `prod` or `ppe`, normalized by `resolveCloudAgentFlags()` at launch. */\n cloudAgentEnvironment: string\n\n /**\n * Work IQ MCP group (`mcp__workiq__*`): Microsoft 365 research through the\n * hosted Work IQ service.\n *\n * Off by default and never auto-enabled: the group needs a signed-in Work IQ\n * account, and turning it on without one would advertise an empty server.\n * Enabled by `--workiq` or `GH_ROUTER_ENABLE_WORKIQ=1`.\n *\n * `setupAndServe` clears it back to false when the launch-time provisioning\n * pass cannot reach the service or has no usable token, so the group is\n * advertised only when the snapshot behind it is real.\n */\n workiqEnabled: boolean\n /**\n * Exposes the four mutating Work IQ tools (`create_entity`, `update_entity`,\n * `delete_entity`, `do_action`). The default surface is the eight read-only\n * tools; `--workiq-write` widens the snapshot to whatever the live server\n * actually advertises.\n */\n workiqWriteEnabled: boolean\n\n /**\n * Humanlike pacing override:\n * \"on\" - --humanlike CLI flag or GH_ROUTER_HUMANLIKE=1 env;\n * inject Beta-distributed inter-action delays, Bezier\n * mouse paths, per-keystroke jitter, scroll chunking\n * into every browser_* action dispatch.\n * \"off\" - GH_ROUTER_BROWSER_NO_HUMANLIKE=1; HARD disable, wins\n * over \"on\" so tests are reproducible.\n * \"auto\" - default; pacing engages only when bot-challenge\n * detection fires (Phase 4-future).\n *\n * Lead model never sees this state — it's an internal concern.\n */\n humanlikeForce: \"on\" | \"off\" | \"auto\"\n\n // Rate limiting configuration\n rateLimitSeconds?: number\n lastRequestTimestamp?: number\n\n // Persistent session identifiers to match VS Code fingerprint\n sessionId: string\n machineId: string\n\n /**\n * Keyed per-launch registry for the loopback `/mcp` endpoint AND the\n * `/v1/messages` identity preflight. Set by the `claude` subcommand\n * (via `registerLaunch` in `./launch-registry`) after `setupAndServe`\n * and before spawning Claude Code; removed by the launch's own\n * cleanup. When empty, `/mcp` rejects all requests — closes the\n * loopback-no-auth gap (DNS rebinding, malicious browser-ext native\n * messaging, sibling-process probe) exactly as the old scalar nonce\n * did when unset.\n *\n * Multiple entries coexist for concurrent fast/standard launches (or a\n * launch plus a reconnect); each is looked up by its OWN nonce/secret,\n * so two launches' authenticated identities never cross.\n */\n launchRegistry: Map<string, LaunchRegistryEntry>\n\n /**\n * @deprecated Back-compat accessor over the registry's DEFAULT_LAUNCH_ID\n * entry (profileId \"standard\", unrestricted `allowedGroups`/\n * `allowedPersonas`) — defined below via `Object.defineProperty`, not a\n * real stored field. Reading returns that entry's nonce; writing creates\n * or updates it (or deletes it on `undefined`). Exists so single-launch\n * call sites and tests that already do `state.peerMcpNonce = NONCE`\n * keep working unmodified while `checkAuth` and the identity preflight\n * consult the real keyed registry underneath. New code should call\n * `registerLaunch` / `findLaunchByNonce` / `findLaunchBySecret` from\n * `./launch-registry` directly instead of reading/writing this field.\n */\n peerMcpNonce?: string\n\n /**\n * Set by `github-router serve` (a single machine-wide control plane serving\n * many repos). When true, repo-scoped worker tools require an explicit/So-derived\n * `workspace` and must NOT silently default to the proxy launch cwd.\n */\n serveMode?: boolean\n}\n\nexport const state: State = {\n accountType: \"enterprise\",\n copilotTokenGeneration: 0,\n manualApprove: false,\n rateLimitWait: false,\n showToken: false,\n extendedBetas: false,\n browseEnabled: false,\n fleetEnabled: false,\n agentsEnabled: false,\n powerBrowseEnabled: false,\n searchEnabled: false,\n bluebirdEnabled: false,\n bluebirdClient: null,\n bluebirdOrganization: null,\n bluebirdProject: null,\n bluebirdRepositories: [],\n bluebirdBranch: null,\n adoEnabled: false,\n adoOrganization: null,\n adoToolsets: [],\n adoReadOnly: true,\n kustoEnabled: false,\n kustoCluster: null,\n kustoDatabase: null,\n cloudAgentEnabled: false,\n cloudAgentEnvironment: \"prod\",\n workiqEnabled: false,\n workiqWriteEnabled: false,\n humanlikeForce: \"auto\",\n sessionId: randomUUID(),\n machineId: randomBytes(32).toString(\"hex\"),\n launchRegistry: new Map(),\n}\n\n// `peerMcpNonce` is not a plain data field — it's a live view onto\n// `state.launchRegistry.get(DEFAULT_LAUNCH_ID)`. Defined via\n// `Object.defineProperty` (rather than a class) so `state` stays the\n// plain object literal every existing importer already destructures /\n// mutates directly.\nObject.defineProperty(state, \"peerMcpNonce\", {\n enumerable: true,\n configurable: true,\n get(): string | undefined {\n return state.launchRegistry.get(DEFAULT_LAUNCH_ID)?.nonce\n },\n set(value: string | undefined) {\n if (value === undefined) {\n state.launchRegistry.delete(DEFAULT_LAUNCH_ID)\n return\n }\n const existing = state.launchRegistry.get(DEFAULT_LAUNCH_ID)\n state.launchRegistry.set(DEFAULT_LAUNCH_ID, {\n launchId: DEFAULT_LAUNCH_ID,\n nonce: value,\n // A caller that only ever touches `peerMcpNonce` exposes MCP only and has\n // no Messages identity secret.\n // Never reuse the MCP bearer across surfaces: an empty secret cannot match\n // any non-empty custom header, while registered Claude launches always use\n // `registerLaunch` with independently generated credentials.\n secret: existing?.secret ?? \"\",\n profileId: existing?.profileId ?? \"standard\",\n allowedGroups: existing?.allowedGroups,\n allowedPersonas: existing?.allowedPersonas,\n createdAt: existing?.createdAt ?? Date.now(),\n })\n },\n})\n"],"mappings":";;;;;;;AAkEA,MAAM,oBAAoB;AAkS1B,MAAa,QAAe;CAC1B,aAAa;CACb,wBAAwB;CACxB,eAAe;CACf,eAAe;CACf,WAAW;CACX,eAAe;CACf,eAAe;CACf,cAAc;CACd,eAAe;CACf,oBAAoB;CACpB,eAAe;CACf,iBAAiB;CACjB,gBAAgB;CAChB,sBAAsB;CACtB,iBAAiB;CACjB,sBAAsB,CAAC;CACvB,gBAAgB;CAChB,YAAY;CACZ,iBAAiB;CACjB,aAAa,CAAC;CACd,aAAa;CACb,cAAc;CACd,cAAc;CACd,eAAe;CACf,mBAAmB;CACnB,uBAAuB;CACvB,eAAe;CACf,oBAAoB;CACpB,gBAAgB;CAChB,WAAW,WAAW;CACtB,WAAW,YAAY,EAAE,CAAC,CAAC,SAAS,KAAK;CACzC,gCAAgB,IAAI,IAAI;AAC1B;AAOA,OAAO,eAAe,OAAO,gBAAgB;CAC3C,YAAY;CACZ,cAAc;CACd,MAA0B;EACxB,OAAO,MAAM,eAAe,IAAI,iBAAiB,CAAC,EAAE;CACtD;CACA,IAAI,OAA2B;EAC7B,IAAI,UAAU,KAAA,GAAW;GACvB,MAAM,eAAe,OAAO,iBAAiB;GAC7C;EACF;EACA,MAAM,WAAW,MAAM,eAAe,IAAI,iBAAiB;EAC3D,MAAM,eAAe,IAAI,mBAAmB;GAC1C,UAAU;GACV,OAAO;GAMP,QAAQ,UAAU,UAAU;GAC5B,WAAW,UAAU,aAAa;GAClC,eAAe,UAAU;GACzB,iBAAiB,UAAU;GAC3B,WAAW,UAAU,aAAa,KAAK,IAAI;EAC7C,CAAC;CACH;AACF,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as BALANCED_PROFILE_MODELS, t as BALANCED_PROFILE_CONTRACT } from "./balanced-profile-contract-
|
|
2
|
-
import { t as buildSelfCommand } from "./self-invocation-
|
|
3
|
-
import { s as isSubagentContext } from "./stop-gate-policy-
|
|
1
|
+
import { r as BALANCED_PROFILE_MODELS, t as BALANCED_PROFILE_CONTRACT } from "./balanced-profile-contract-B6pSoWjm.js";
|
|
2
|
+
import { t as buildSelfCommand } from "./self-invocation-DMUnXVGT.js";
|
|
3
|
+
import { s as isSubagentContext } from "./stop-gate-policy-BehNiNix.js";
|
|
4
4
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
|
|
6
|
+
// src/lib/cheapest-profile-contract.ts
|
|
7
7
|
/**
|
|
8
8
|
* Fixed identities for the literal `github-router claude -m cheapest` profile.
|
|
9
9
|
*
|
|
@@ -150,8 +150,7 @@ const CHEAPEST_PROFILE_CONTRACT = Object.freeze({
|
|
|
150
150
|
synthesizedPeers: CHEAPEST_PROFILE_SYNTHESIZED_PEERS,
|
|
151
151
|
delegationGraph: CHEAPEST_PROFILE_DELEGATION_GRAPH
|
|
152
152
|
});
|
|
153
|
-
|
|
154
|
-
//#region src/lib/cheapest2-profile-contract.ts
|
|
153
|
+
// src/lib/cheapest2-profile-contract.ts
|
|
155
154
|
/**
|
|
156
155
|
* Fixed identities for the literal `github-router claude -m cheapest2` profile.
|
|
157
156
|
*
|
|
@@ -201,8 +200,7 @@ const CHEAPEST2_PROFILE_CONTRACT = Object.freeze({
|
|
|
201
200
|
oracleModel: CHEAPEST2_PROFILE_ORACLE_MODEL,
|
|
202
201
|
rewriteModel: CHEAPEST2_PROFILE_REWRITE_MODEL
|
|
203
202
|
});
|
|
204
|
-
|
|
205
|
-
//#region src/lib/local-egress-constants.ts
|
|
203
|
+
// src/lib/local-egress-constants.ts
|
|
206
204
|
/**
|
|
207
205
|
* The two request-shaping numbers every local consult shares.
|
|
208
206
|
*
|
|
@@ -223,8 +221,7 @@ const CHEAPEST2_PROFILE_CONTRACT = Object.freeze({
|
|
|
223
221
|
* existed before it.
|
|
224
222
|
*/
|
|
225
223
|
const LOCAL_CONSULT_MAX_OUTPUT_TOKENS = 4096;
|
|
226
|
-
|
|
227
|
-
//#region src/lib/local-profile-contract.ts
|
|
224
|
+
// src/lib/local-profile-contract.ts
|
|
228
225
|
/**
|
|
229
226
|
* Fixed identities for the literal `github-router claude -m local` and
|
|
230
227
|
* `-m local2` launch profiles.
|
|
@@ -380,8 +377,7 @@ const LOCAL2_PROFILE_CONTRACT = Object.freeze({
|
|
|
380
377
|
});
|
|
381
378
|
/** The local lead slug, used by the child-env/tier-row wiring. */
|
|
382
379
|
const LOCAL_PROFILE_LEAD_MODEL = LOCAL_PROFILE_MODELS.lead;
|
|
383
|
-
|
|
384
|
-
//#region src/lib/balanced2-profile-contract.ts
|
|
380
|
+
// src/lib/balanced2-profile-contract.ts
|
|
385
381
|
/**
|
|
386
382
|
* Fixed identities for the literal `github-router claude -m balanced2` profile.
|
|
387
383
|
*
|
|
@@ -424,8 +420,7 @@ const BALANCED2_PROFILE_CONTRACT = Object.freeze({
|
|
|
424
420
|
nativeModels: BALANCED2_PROFILE_NATIVE_MODELS,
|
|
425
421
|
oracleModel: BALANCED2_PROFILE_ORACLE_MODEL
|
|
426
422
|
});
|
|
427
|
-
|
|
428
|
-
//#region src/lib/cheaplocal-profile-contract.ts
|
|
423
|
+
// src/lib/cheaplocal-profile-contract.ts
|
|
429
424
|
/**
|
|
430
425
|
* Fixed identities for the literal `github-router claude -m cheaplocal` profile.
|
|
431
426
|
*
|
|
@@ -520,8 +515,7 @@ const CHEAPLOCAL_PROFILE_CONTRACT = Object.freeze({
|
|
|
520
515
|
rewriteModel: CHEAPLOCAL_PROFILE_REWRITE_MODEL,
|
|
521
516
|
consultTransport: "local"
|
|
522
517
|
});
|
|
523
|
-
|
|
524
|
-
//#region src/lib/profile-family.ts
|
|
518
|
+
// src/lib/profile-family.ts
|
|
525
519
|
/**
|
|
526
520
|
* The `cheapest`/`cheapest2`/`cheaplocal` and `balanced`/`balanced2`
|
|
527
521
|
* launch-profile families.
|
|
@@ -670,8 +664,7 @@ function displayModelName(modelId) {
|
|
|
670
664
|
function cheapestRewriteModelFor(profileId) {
|
|
671
665
|
return cheapestContractFor(profileId).rewriteModel;
|
|
672
666
|
}
|
|
673
|
-
|
|
674
|
-
//#region src/lib/cheapest-prompt-rewrite.ts
|
|
667
|
+
// src/lib/cheapest-prompt-rewrite.ts
|
|
675
668
|
/**
|
|
676
669
|
* Cheapest-only Sol → Luna prompt rewrite (additive, fail-open).
|
|
677
670
|
*
|
|
@@ -901,8 +894,7 @@ async function runCheapestRewrite(input) {
|
|
|
901
894
|
controller.abort();
|
|
902
895
|
}
|
|
903
896
|
}
|
|
904
|
-
|
|
905
|
-
//#region src/lib/orchestration/prompt-submit-hook.ts
|
|
897
|
+
// src/lib/orchestration/prompt-submit-hook.ts
|
|
906
898
|
/**
|
|
907
899
|
* Pure decision logic for the `UserPromptSubmit` hook (the front-end of the
|
|
908
900
|
* floor-raising surface). It serves TWO duties on the one event:
|
|
@@ -1127,8 +1119,7 @@ async function decidePromptSubmitV2(input) {
|
|
|
1127
1119
|
function buildPromptSubmitHookCommand(invocation) {
|
|
1128
1120
|
return buildSelfCommand(invocation, "internal-prompt-submit");
|
|
1129
1121
|
}
|
|
1130
|
-
|
|
1131
|
-
//#region src/lib/static-context-pack.ts
|
|
1122
|
+
// src/lib/static-context-pack.ts
|
|
1132
1123
|
/**
|
|
1133
1124
|
* Static, prompt-independent context pack for the cheapest-profile rewrite.
|
|
1134
1125
|
*
|
|
@@ -1523,7 +1514,6 @@ function buildStaticPack(workspace) {
|
|
|
1523
1514
|
verifyCommand: detected.slice(0, 512)
|
|
1524
1515
|
};
|
|
1525
1516
|
}
|
|
1526
|
-
//#endregion
|
|
1527
1517
|
export { CHEAPEST2_PROFILE_MODELS as A, localContractFor as C, LOCAL_PROFILE_NATIVE_MODELS as D, LOCAL_PROFILE_NATIVE_AGENT_NAMES as E, CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MIN as F, CHEAPEST_PROFILE_MODELS as I, CHEAPEST_PROFILE_NATIVE_AGENT_NAMES as L, CHEAPEST_PROFILE_ADVISOR_MODEL as M, CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_DEFAULT as N, LOCAL_PROFILE_TIER_MODELS as O, CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MAX as P, CHEAPEST_PROFILE_NATIVE_EFFORTS as R, local2AdvisorContract as S, LOCAL_PROFILE_LEAD_MODEL as T, isBalancedFamily as _, decidePromptSubmitV2 as a, isLocalFamily as b, CHEAPEST_REWRITE_EFFORT as c, runCheapestRewrite as d, balancedContractFor as f, displayModelName as g, consultIsLocalTransport as h, decidePromptSubmit as i, CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL as j, LOCAL_CONSULT_MAX_OUTPUT_TOKENS as k, buildRebriefSystem as l, cheapestRewriteModelFor as m, PROMPT_STEER_GOAL as n, getPromptSearchTip as o, cheapestContractFor as p, buildPromptSubmitHookCommand as r, isNonTrivialPrompt as s, buildStaticPack as t, isCheapestRewriteDisabledEnv as u, isCheapestFamily as v, BALANCED2_PROFILE_MODELS as w, isPinnedLaunchProfile as x, isCheaplocalProfile as y };
|
|
1528
1518
|
|
|
1529
|
-
//# sourceMappingURL=static-context-pack-
|
|
1519
|
+
//# sourceMappingURL=static-context-pack-DwC69_VA.js.map
|