github-router 0.3.315 → 0.3.317

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 (105) hide show
  1. package/dist/{aic-ledger-BS47yb_C.js → aic-ledger-DY03LbBM.js} +2 -2
  2. package/dist/{aic-ledger-BS47yb_C.js.map → aic-ledger-DY03LbBM.js.map} +1 -1
  3. package/dist/{attribution-settings-DXmmyuEE.js → attribution-settings-D6dAkP4e.js} +120 -21
  4. package/dist/attribution-settings-D6dAkP4e.js.map +1 -0
  5. package/dist/{auth-D8t41c5D.js → auth-Iun7ftd8.js} +4 -4
  6. package/dist/{auth-D8t41c5D.js.map → auth-Iun7ftd8.js.map} +1 -1
  7. package/dist/browser-ext/manifest.json +1 -1
  8. package/dist/{check-usage-BpBKOjGZ.js → check-usage-1c-0z3iy.js} +4 -4
  9. package/dist/{check-usage-BpBKOjGZ.js.map → check-usage-1c-0z3iy.js.map} +1 -1
  10. package/dist/{claude-Cmmu3-cL.js → claude-aZ6OaFP5.js} +178 -49
  11. package/dist/claude-aZ6OaFP5.js.map +1 -0
  12. package/dist/{codex-DqTKKoEx.js → codex-PTdWu7er.js} +6 -6
  13. package/dist/codex-PTdWu7er.js.map +1 -0
  14. package/dist/{copilot-discount-IbXR5A28.js → copilot-discount-C3jx9Q-o.js} +2 -2
  15. package/dist/{copilot-discount-IbXR5A28.js.map → copilot-discount-C3jx9Q-o.js.map} +1 -1
  16. package/dist/{debug-CA7pg8V9.js → debug-CDyXUPcC.js} +2 -2
  17. package/dist/{debug-CA7pg8V9.js.map → debug-CDyXUPcC.js.map} +1 -1
  18. package/dist/engine-D5GNXylB.js +2 -0
  19. package/dist/{gate-discovery-CPk6Z8yc.js → gate-discovery-B17pvgE0.js} +5 -5
  20. package/dist/{gate-discovery-CPk6Z8yc.js.map → gate-discovery-B17pvgE0.js.map} +1 -1
  21. package/dist/{get-copilot-usage-FSQE8szQ.js → get-copilot-usage-BWCAzmSc.js} +3 -3
  22. package/dist/{get-copilot-usage-FSQE8szQ.js.map → get-copilot-usage-BWCAzmSc.js.map} +1 -1
  23. package/dist/hooks.mjs +125 -117
  24. package/dist/hooks.sha256 +1 -1
  25. package/dist/{internal-aic-status-BN0xRLSF.js → internal-aic-status-BiblmImt.js} +13 -6
  26. package/dist/{internal-aic-status-BN0xRLSF.js.map → internal-aic-status-BiblmImt.js.map} +1 -1
  27. package/dist/{internal-artifact-open-B3stUu74.js → internal-artifact-open-CA1trJ15.js} +2 -2
  28. package/dist/{internal-artifact-open-B3stUu74.js.map → internal-artifact-open-CA1trJ15.js.map} +1 -1
  29. package/dist/{internal-fast-dispatch-guard-CAwYj_Yz.js → internal-fast-dispatch-guard-CZ4BZuAG.js} +2 -2
  30. package/dist/{internal-fast-dispatch-guard-CAwYj_Yz.js.map → internal-fast-dispatch-guard-CZ4BZuAG.js.map} +1 -1
  31. package/dist/{internal-fast-dispatch-guard-2QjUlhqO.js → internal-fast-dispatch-guard-D5kozMpo.js} +1 -1
  32. package/dist/{internal-first-mate-guard-VgnHBp0s.js → internal-first-mate-guard-B_or0eN3.js} +1 -1
  33. package/dist/{internal-first-mate-guard-B0rbLb0L.js → internal-first-mate-guard-CiFH6X1H.js} +3 -3
  34. package/dist/{internal-first-mate-guard-B0rbLb0L.js.map → internal-first-mate-guard-CiFH6X1H.js.map} +1 -1
  35. package/dist/{internal-max-dispatch-guard-BzKsY9ze.js → internal-max-dispatch-guard-BGOHRYRt.js} +1 -1
  36. package/dist/{internal-max-dispatch-guard-l1NGYHtF.js → internal-max-dispatch-guard-CnBZxo5l.js} +3 -3
  37. package/dist/{internal-max-dispatch-guard-l1NGYHtF.js.map → internal-max-dispatch-guard-CnBZxo5l.js.map} +1 -1
  38. package/dist/{internal-plan-review-QUvNZmMR.js → internal-plan-review-C73snnD8.js} +3 -3
  39. package/dist/{internal-plan-review-QUvNZmMR.js.map → internal-plan-review-C73snnD8.js.map} +1 -1
  40. package/dist/{internal-prompt-submit-fj5ccft_.js → internal-prompt-submit-dov4UvBo.js} +4 -4
  41. package/dist/{internal-prompt-submit-fj5ccft_.js.map → internal-prompt-submit-dov4UvBo.js.map} +1 -1
  42. package/dist/{internal-session-bind-0Hmak8PR.js → internal-session-bind-C3hrb9rP.js} +2 -2
  43. package/dist/{internal-session-bind-0Hmak8PR.js.map → internal-session-bind-C3hrb9rP.js.map} +1 -1
  44. package/dist/{internal-stop-hook-BKiKYeda.js → internal-stop-hook-DZ6CCP4C.js} +5 -5
  45. package/dist/{internal-stop-hook-BKiKYeda.js.map → internal-stop-hook-DZ6CCP4C.js.map} +1 -1
  46. package/dist/{internal-stop-review-8v2llYDB.js → internal-stop-review-MBVYtrYS.js} +2 -2
  47. package/dist/{internal-stop-review-8v2llYDB.js.map → internal-stop-review-MBVYtrYS.js.map} +1 -1
  48. package/dist/{internal-worker-guard-BI4Pl0Ew.js → internal-worker-guard-dxGawAY3.js} +2 -2
  49. package/dist/{internal-worker-guard-BI4Pl0Ew.js.map → internal-worker-guard-dxGawAY3.js.map} +1 -1
  50. package/dist/{internal-workspace-header-kg9FoNXK.js → internal-workspace-header-_aEXOz5q.js} +2 -2
  51. package/dist/{internal-workspace-header-kg9FoNXK.js.map → internal-workspace-header-_aEXOz5q.js.map} +1 -1
  52. package/dist/{lifecycle-IwotwedG.js → lifecycle-CJB2BwSJ.js} +2 -2
  53. package/dist/{lifecycle-IwotwedG.js.map → lifecycle-CJB2BwSJ.js.map} +1 -1
  54. package/dist/lifecycle-D0KsoSqz.js +2 -0
  55. package/dist/lifecycle-DimEguJO.js +2 -0
  56. package/dist/{lifecycle-Cx1wVrLb.js → lifecycle-_BE0SnNs.js} +2 -2
  57. package/dist/{lifecycle-Cx1wVrLb.js.map → lifecycle-_BE0SnNs.js.map} +1 -1
  58. package/dist/main.js +20 -20
  59. package/dist/{max-profile-contract-BcrMlrmo.js → max-profile-contract-Bl7I_EOC.js} +2 -2
  60. package/dist/{max-profile-contract-BcrMlrmo.js.map → max-profile-contract-Bl7I_EOC.js.map} +1 -1
  61. package/dist/{mcp-workspace-header-BYgWioLH.js → mcp-workspace-header-mXRLE8kg.js} +2 -2
  62. package/dist/{mcp-workspace-header-BYgWioLH.js.map → mcp-workspace-header-mXRLE8kg.js.map} +1 -1
  63. package/dist/{models-DgLeb-Dv.js → models-CSFIVxAH.js} +3 -3
  64. package/dist/{models-DgLeb-Dv.js.map → models-CSFIVxAH.js.map} +1 -1
  65. package/dist/{orchestration-Dc3mO0G3.js → orchestration-B8kypXcZ.js} +2 -2
  66. package/dist/{orchestration-Dc3mO0G3.js.map → orchestration-B8kypXcZ.js.map} +1 -1
  67. package/dist/{paths-CMxlQEfQ.js → paths-CHBAj_t9.js} +36 -4
  68. package/dist/{paths-CMxlQEfQ.js.map → paths-CHBAj_t9.js.map} +1 -1
  69. package/dist/paths-eHoOwFzZ.js +2 -0
  70. package/dist/{peer-mcp-personas-CYWJSxPK.js → peer-mcp-personas-CRMVuMVF.js} +201 -61
  71. package/dist/peer-mcp-personas-CRMVuMVF.js.map +1 -0
  72. package/dist/{plan-review-hook-BIMwWkh6.js → plan-review-hook-BMmw7wxR.js} +3 -3
  73. package/dist/{plan-review-hook-BIMwWkh6.js.map → plan-review-hook-BMmw7wxR.js.map} +1 -1
  74. package/dist/{prompt-submit-hook-BcFpjHXg.js → prompt-submit-hook-CGgT5m4Q.js} +3 -3
  75. package/dist/{prompt-submit-hook-BcFpjHXg.js.map → prompt-submit-hook-CGgT5m4Q.js.map} +1 -1
  76. package/dist/{provision-AwSjt-vR.js → provision-Bn8-NDp7.js} +4 -4
  77. package/dist/{provision-AwSjt-vR.js.map → provision-Bn8-NDp7.js.map} +1 -1
  78. package/dist/{self-invocation-cRl4RqfW.js → self-invocation-DahN1gw9.js} +2 -2
  79. package/dist/{self-invocation-cRl4RqfW.js.map → self-invocation-DahN1gw9.js.map} +1 -1
  80. package/dist/{serve-BG2O6Slz.js → serve-CX4Ifk5p.js} +13 -13
  81. package/dist/{serve-BG2O6Slz.js.map → serve-CX4Ifk5p.js.map} +1 -1
  82. package/dist/{server-setup-D7ABbEs1.js → server-setup-0PaS4m2B.js} +254 -66
  83. package/dist/server-setup-0PaS4m2B.js.map +1 -0
  84. package/dist/{start-Dpwpnq99.js → start-Bz_559ua.js} +3 -3
  85. package/dist/{start-Dpwpnq99.js.map → start-Bz_559ua.js.map} +1 -1
  86. package/dist/{state-B8adscCv.js → state-BlMpEFAt.js} +2 -1
  87. package/dist/{state-B8adscCv.js.map → state-BlMpEFAt.js.map} +1 -1
  88. package/dist/{stop-gate-hook-BUCxa5Kc.js → stop-gate-hook-D7N759TG.js} +72 -4
  89. package/dist/{stop-gate-hook-BUCxa5Kc.js.map → stop-gate-hook-D7N759TG.js.map} +1 -1
  90. package/dist/{stop-gate-policy--bpyxxXU.js → stop-gate-policy-C0gt04R0.js} +2 -2
  91. package/dist/{stop-gate-policy--bpyxxXU.js.map → stop-gate-policy-C0gt04R0.js.map} +1 -1
  92. package/dist/{token-ClzS23Y2.js → token-86uk6y4P.js} +3 -3
  93. package/dist/{token-ClzS23Y2.js.map → token-86uk6y4P.js.map} +1 -1
  94. package/dist/{worker-dispatch-DMIdrlsF.js → worker-dispatch-B-OA7tvU.js} +2 -2
  95. package/dist/{worker-dispatch-DMIdrlsF.js.map → worker-dispatch-B-OA7tvU.js.map} +1 -1
  96. package/package.json +1 -1
  97. package/dist/attribution-settings-DXmmyuEE.js.map +0 -1
  98. package/dist/claude-Cmmu3-cL.js.map +0 -1
  99. package/dist/codex-DqTKKoEx.js.map +0 -1
  100. package/dist/engine-b9XaKLp0.js +0 -2
  101. package/dist/lifecycle-BpqAyaAj.js +0 -2
  102. package/dist/lifecycle-CL2WiyeQ.js +0 -2
  103. package/dist/paths-BXXCVFvA.js +0 -2
  104. package/dist/peer-mcp-personas-CYWJSxPK.js.map +0 -1
  105. package/dist/server-setup-D7ABbEs1.js.map +0 -1
@@ -1,6 +1,6 @@
1
- import { i as ensurePaths, t as PATHS } from "./paths-CMxlQEfQ.js";
2
- import { t as state } from "./state-B8adscCv.js";
3
- import { r as setupGitHubToken } from "./token-ClzS23Y2.js";
1
+ import { i as ensurePaths, t as PATHS } from "./paths-CHBAj_t9.js";
2
+ import { t as state } from "./state-BlMpEFAt.js";
3
+ import { r as setupGitHubToken } from "./token-86uk6y4P.js";
4
4
  import { defineCommand } from "citty";
5
5
  import consola from "consola";
6
6
  //#region src/auth.ts
@@ -42,4 +42,4 @@ const auth = defineCommand({
42
42
  //#endregion
43
43
  export { auth };
44
44
 
45
- //# sourceMappingURL=auth-D8t41c5D.js.map
45
+ //# sourceMappingURL=auth-Iun7ftd8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-D8t41c5D.js","names":[],"sources":["../src/auth.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { defineCommand } from \"citty\"\nimport consola from \"consola\"\n\nimport { PATHS, ensurePaths } from \"./lib/paths\"\nimport { state } from \"./lib/state\"\nimport { setupGitHubToken } from \"./lib/token\"\n\ninterface RunAuthOptions {\n verbose: boolean\n showToken: boolean\n}\n\nexport async function runAuth(options: RunAuthOptions): Promise<void> {\n if (options.verbose) {\n consola.level = 5\n consola.info(\"Verbose logging enabled\")\n }\n\n state.showToken = options.showToken\n\n await ensurePaths()\n await setupGitHubToken({ force: true })\n consola.success(\"GitHub token written to\", PATHS.GITHUB_TOKEN_PATH)\n}\n\nexport const auth = defineCommand({\n meta: {\n name: \"auth\",\n description: \"Run GitHub auth flow without running the server\",\n },\n args: {\n verbose: {\n alias: \"v\",\n type: \"boolean\",\n default: false,\n description: \"Enable verbose logging\",\n },\n \"show-token\": {\n type: \"boolean\",\n default: false,\n description: \"Show GitHub token on auth\",\n },\n },\n run({ args }) {\n return runAuth({\n verbose: args.verbose,\n showToken: args[\"show-token\"],\n })\n },\n})\n"],"mappings":";;;;;;AAcA,eAAsB,QAAQ,SAAwC;CACpE,IAAI,QAAQ,SAAS;EACnB,QAAQ,QAAQ;EAChB,QAAQ,KAAK,yBAAyB;CACxC;CAEA,MAAM,YAAY,QAAQ;CAE1B,MAAM,YAAY;CAClB,MAAM,iBAAiB,EAAE,OAAO,KAAK,CAAC;CACtC,QAAQ,QAAQ,2BAA2B,MAAM,iBAAiB;AACpE;AAEA,MAAa,OAAO,cAAc;CAChC,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CACA,MAAM;EACJ,SAAS;GACP,OAAO;GACP,MAAM;GACN,SAAS;GACT,aAAa;EACf;EACA,cAAc;GACZ,MAAM;GACN,SAAS;GACT,aAAa;EACf;CACF;CACA,IAAI,EAAE,QAAQ;EACZ,OAAO,QAAQ;GACb,SAAS,KAAK;GACd,WAAW,KAAK;EAClB,CAAC;CACH;AACF,CAAC"}
1
+ {"version":3,"file":"auth-Iun7ftd8.js","names":[],"sources":["../src/auth.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { defineCommand } from \"citty\"\nimport consola from \"consola\"\n\nimport { PATHS, ensurePaths } from \"./lib/paths\"\nimport { state } from \"./lib/state\"\nimport { setupGitHubToken } from \"./lib/token\"\n\ninterface RunAuthOptions {\n verbose: boolean\n showToken: boolean\n}\n\nexport async function runAuth(options: RunAuthOptions): Promise<void> {\n if (options.verbose) {\n consola.level = 5\n consola.info(\"Verbose logging enabled\")\n }\n\n state.showToken = options.showToken\n\n await ensurePaths()\n await setupGitHubToken({ force: true })\n consola.success(\"GitHub token written to\", PATHS.GITHUB_TOKEN_PATH)\n}\n\nexport const auth = defineCommand({\n meta: {\n name: \"auth\",\n description: \"Run GitHub auth flow without running the server\",\n },\n args: {\n verbose: {\n alias: \"v\",\n type: \"boolean\",\n default: false,\n description: \"Enable verbose logging\",\n },\n \"show-token\": {\n type: \"boolean\",\n default: false,\n description: \"Show GitHub token on auth\",\n },\n },\n run({ args }) {\n return runAuth({\n verbose: args.verbose,\n showToken: args[\"show-token\"],\n })\n },\n})\n"],"mappings":";;;;;;AAcA,eAAsB,QAAQ,SAAwC;CACpE,IAAI,QAAQ,SAAS;EACnB,QAAQ,QAAQ;EAChB,QAAQ,KAAK,yBAAyB;CACxC;CAEA,MAAM,YAAY,QAAQ;CAE1B,MAAM,YAAY;CAClB,MAAM,iBAAiB,EAAE,OAAO,KAAK,CAAC;CACtC,QAAQ,QAAQ,2BAA2B,MAAM,iBAAiB;AACpE;AAEA,MAAa,OAAO,cAAc;CAChC,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CACA,MAAM;EACJ,SAAS;GACP,OAAO;GACP,MAAM;GACN,SAAS;GACT,aAAa;EACf;EACA,cAAc;GACZ,MAAM;GACN,SAAS;GACT,aAAa;EACf;CACF;CACA,IAAI,EAAE,QAAQ;EACZ,OAAO,QAAQ;GACb,SAAS,KAAK;GACd,WAAW,KAAK;EAClB,CAAC;CACH;AACF,CAAC"}
@@ -2,7 +2,7 @@
2
2
  "manifest_version": 3,
3
3
  "name": "github-router browser bridge",
4
4
  "short_name": "gh-router-browser",
5
- "version": "0.3.315",
5
+ "version": "0.3.317",
6
6
  "description": "Bridge between Claude (via github-router /mcp) and the browser. Implements tab control, navigation, clicks, form fill, downloads, screenshots, devtools eval. Blocks navigation to chrome://settings.",
7
7
  "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqJElxuBlonBS3TVW9FJN0mGTtShB3L1hoaYf6k39SOr1ogGYmF90EjRxy1i21k9wQQjPf26bcBu/9X67KrQjQV0uB38CaNukgiSeoLjfptN811u+PJHx6BP+jx3Qa6/3VenNPxHC8WEU0GXql8QSjIHEyCwKb6fMASXOK94JyB5Ywov2x8mt/+9ncqBBBMVzf6r5Sagy4PL1XnryLsuADD/vOEkPet8wXgH/Oj7v5tTsQQZ7U1JT51PoDs2BFnXc5v3TkVgZwd32k3ONh+nkDw1Hof+4zwUGOyJE6eMrlYzRlKM4Qxdf9JpavQvqfieAbTRWcyKeclnHeoIfE7cDBQIDAQAB",
8
8
  "background": {
@@ -1,6 +1,6 @@
1
- import { i as ensurePaths } from "./paths-CMxlQEfQ.js";
2
- import { r as setupGitHubToken } from "./token-ClzS23Y2.js";
3
- import { t as getCopilotUsage } from "./get-copilot-usage-FSQE8szQ.js";
1
+ import { i as ensurePaths } from "./paths-CHBAj_t9.js";
2
+ import { r as setupGitHubToken } from "./token-86uk6y4P.js";
3
+ import { t as getCopilotUsage } from "./get-copilot-usage-BWCAzmSc.js";
4
4
  import { defineCommand } from "citty";
5
5
  import consola from "consola";
6
6
  //#region src/check-usage.ts
@@ -40,4 +40,4 @@ const checkUsage = defineCommand({
40
40
  //#endregion
41
41
  export { checkUsage };
42
42
 
43
- //# sourceMappingURL=check-usage-BpBKOjGZ.js.map
43
+ //# sourceMappingURL=check-usage-1c-0z3iy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-usage-BpBKOjGZ.js","names":[],"sources":["../src/check-usage.ts"],"sourcesContent":["import { defineCommand } from \"citty\"\nimport consola from \"consola\"\n\nimport { ensurePaths } from \"./lib/paths\"\nimport { setupGitHubToken } from \"./lib/token\"\nimport {\n getCopilotUsage,\n type QuotaDetail,\n} from \"./services/github/get-copilot-usage\"\n\nexport const checkUsage = defineCommand({\n meta: {\n name: \"check-usage\",\n description: \"Show current GitHub Copilot usage/quota information\",\n },\n async run() {\n await ensurePaths()\n await setupGitHubToken()\n try {\n const usage = await getCopilotUsage()\n const premium = usage.quota_snapshots.premium_interactions\n const premiumTotal = premium.entitlement\n const premiumUsed = premiumTotal - premium.remaining\n const premiumPercentUsed =\n premiumTotal > 0 ? (premiumUsed / premiumTotal) * 100 : 0\n const premiumPercentRemaining = premium.percent_remaining\n\n // Helper to summarize a quota snapshot\n function summarizeQuota(name: string, snap: QuotaDetail | undefined) {\n if (!snap) return `${name}: N/A`\n const total = snap.entitlement\n const used = total - snap.remaining\n const percentUsed = total > 0 ? (used / total) * 100 : 0\n const percentRemaining = snap.percent_remaining\n return `${name}: ${used}/${total} used (${percentUsed.toFixed(1)}% used, ${percentRemaining.toFixed(1)}% remaining)`\n }\n\n const premiumLine = `Premium: ${premiumUsed}/${premiumTotal} used (${premiumPercentUsed.toFixed(1)}% used, ${premiumPercentRemaining.toFixed(1)}% remaining)`\n const chatLine = summarizeQuota(\"Chat\", usage.quota_snapshots.chat)\n const completionsLine = summarizeQuota(\n \"Completions\",\n usage.quota_snapshots.completions,\n )\n\n consola.box(\n `Copilot Usage (plan: ${usage.copilot_plan})\\n`\n + `Quota resets: ${usage.quota_reset_date}\\n`\n + `\\nQuotas:\\n`\n + ` ${premiumLine}\\n`\n + ` ${chatLine}\\n`\n + ` ${completionsLine}`,\n )\n } catch (err) {\n consola.error(\"Failed to fetch Copilot usage:\", err)\n process.exit(1)\n }\n },\n})\n"],"mappings":";;;;;;AAUA,MAAa,aAAa,cAAc;CACtC,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CACA,MAAM,MAAM;EACV,MAAM,YAAY;EAClB,MAAM,iBAAiB;EACvB,IAAI;GACF,MAAM,QAAQ,MAAM,gBAAgB;GACpC,MAAM,UAAU,MAAM,gBAAgB;GACtC,MAAM,eAAe,QAAQ;GAC7B,MAAM,cAAc,eAAe,QAAQ;GAC3C,MAAM,qBACJ,eAAe,IAAK,cAAc,eAAgB,MAAM;GAC1D,MAAM,0BAA0B,QAAQ;GAGxC,SAAS,eAAe,MAAc,MAA+B;IACnE,IAAI,CAAC,MAAM,OAAO,GAAG,KAAK;IAC1B,MAAM,QAAQ,KAAK;IACnB,MAAM,OAAO,QAAQ,KAAK;IAC1B,MAAM,cAAc,QAAQ,IAAK,OAAO,QAAS,MAAM;IACvD,MAAM,mBAAmB,KAAK;IAC9B,OAAO,GAAG,KAAK,IAAI,KAAK,GAAG,MAAM,SAAS,YAAY,QAAQ,CAAC,EAAE,UAAU,iBAAiB,QAAQ,CAAC,EAAE;GACzG;GAEA,MAAM,cAAc,YAAY,YAAY,GAAG,aAAa,SAAS,mBAAmB,QAAQ,CAAC,EAAE,UAAU,wBAAwB,QAAQ,CAAC,EAAE;GAChJ,MAAM,WAAW,eAAe,QAAQ,MAAM,gBAAgB,IAAI;GAClE,MAAM,kBAAkB,eACtB,eACA,MAAM,gBAAgB,WACxB;GAEA,QAAQ,IACN,wBAAwB,MAAM,aAAa,mBACtB,MAAM,iBAAiB,iBAEnC,YAAY,MACZ,SAAS,MACT,iBACX;EACF,SAAS,KAAK;GACZ,QAAQ,MAAM,kCAAkC,GAAG;GACnD,QAAQ,KAAK,CAAC;EAChB;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"check-usage-1c-0z3iy.js","names":[],"sources":["../src/check-usage.ts"],"sourcesContent":["import { defineCommand } from \"citty\"\nimport consola from \"consola\"\n\nimport { ensurePaths } from \"./lib/paths\"\nimport { setupGitHubToken } from \"./lib/token\"\nimport {\n getCopilotUsage,\n type QuotaDetail,\n} from \"./services/github/get-copilot-usage\"\n\nexport const checkUsage = defineCommand({\n meta: {\n name: \"check-usage\",\n description: \"Show current GitHub Copilot usage/quota information\",\n },\n async run() {\n await ensurePaths()\n await setupGitHubToken()\n try {\n const usage = await getCopilotUsage()\n const premium = usage.quota_snapshots.premium_interactions\n const premiumTotal = premium.entitlement\n const premiumUsed = premiumTotal - premium.remaining\n const premiumPercentUsed =\n premiumTotal > 0 ? (premiumUsed / premiumTotal) * 100 : 0\n const premiumPercentRemaining = premium.percent_remaining\n\n // Helper to summarize a quota snapshot\n function summarizeQuota(name: string, snap: QuotaDetail | undefined) {\n if (!snap) return `${name}: N/A`\n const total = snap.entitlement\n const used = total - snap.remaining\n const percentUsed = total > 0 ? (used / total) * 100 : 0\n const percentRemaining = snap.percent_remaining\n return `${name}: ${used}/${total} used (${percentUsed.toFixed(1)}% used, ${percentRemaining.toFixed(1)}% remaining)`\n }\n\n const premiumLine = `Premium: ${premiumUsed}/${premiumTotal} used (${premiumPercentUsed.toFixed(1)}% used, ${premiumPercentRemaining.toFixed(1)}% remaining)`\n const chatLine = summarizeQuota(\"Chat\", usage.quota_snapshots.chat)\n const completionsLine = summarizeQuota(\n \"Completions\",\n usage.quota_snapshots.completions,\n )\n\n consola.box(\n `Copilot Usage (plan: ${usage.copilot_plan})\\n`\n + `Quota resets: ${usage.quota_reset_date}\\n`\n + `\\nQuotas:\\n`\n + ` ${premiumLine}\\n`\n + ` ${chatLine}\\n`\n + ` ${completionsLine}`,\n )\n } catch (err) {\n consola.error(\"Failed to fetch Copilot usage:\", err)\n process.exit(1)\n }\n },\n})\n"],"mappings":";;;;;;AAUA,MAAa,aAAa,cAAc;CACtC,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CACA,MAAM,MAAM;EACV,MAAM,YAAY;EAClB,MAAM,iBAAiB;EACvB,IAAI;GACF,MAAM,QAAQ,MAAM,gBAAgB;GACpC,MAAM,UAAU,MAAM,gBAAgB;GACtC,MAAM,eAAe,QAAQ;GAC7B,MAAM,cAAc,eAAe,QAAQ;GAC3C,MAAM,qBACJ,eAAe,IAAK,cAAc,eAAgB,MAAM;GAC1D,MAAM,0BAA0B,QAAQ;GAGxC,SAAS,eAAe,MAAc,MAA+B;IACnE,IAAI,CAAC,MAAM,OAAO,GAAG,KAAK;IAC1B,MAAM,QAAQ,KAAK;IACnB,MAAM,OAAO,QAAQ,KAAK;IAC1B,MAAM,cAAc,QAAQ,IAAK,OAAO,QAAS,MAAM;IACvD,MAAM,mBAAmB,KAAK;IAC9B,OAAO,GAAG,KAAK,IAAI,KAAK,GAAG,MAAM,SAAS,YAAY,QAAQ,CAAC,EAAE,UAAU,iBAAiB,QAAQ,CAAC,EAAE;GACzG;GAEA,MAAM,cAAc,YAAY,YAAY,GAAG,aAAa,SAAS,mBAAmB,QAAQ,CAAC,EAAE,UAAU,wBAAwB,QAAQ,CAAC,EAAE;GAChJ,MAAM,WAAW,eAAe,QAAQ,MAAM,gBAAgB,IAAI;GAClE,MAAM,kBAAkB,eACtB,eACA,MAAM,gBAAgB,WACxB;GAEA,QAAQ,IACN,wBAAwB,MAAM,aAAa,mBACtB,MAAM,iBAAiB,iBAEnC,YAAY,MACZ,SAAS,MACT,iBACX;EACF,SAAS,KAAK;GACZ,QAAQ,MAAM,kCAAkC,GAAG;GACnD,QAAQ,KAAK,CAAC;EAChB;CACF;AACF,CAAC"}
@@ -1,27 +1,27 @@
1
- import { $t as colbertDegradedWarning, At as scribeModel, Bt as registerLaunch, Ct as generalPurposeFastModel, D as toolbeltEnabled, Dt as reviewerFastModel, E as buildToolbeltAwareness, Et as resolveGeminiReviewModel, Mt as workerToolsEnabled, Nn as CHEAP_PROFILE_NATIVE_MODELS, Ot as reviewerModel, St as geminiAvailable, T as availableToolCommands, Tt as nativeSubagentModel, Vt as unregisterLaunch, Zt as provisionBrowserAssets, _t as fastOracleModel, at as artifactToolsEnabled, bn as pickClaudeDefault, bt as fastScoutModel, ct as browserCompoundToolsEnabled, dt as cheapOracleModel, en as provisionAndIndexColbert, fn as DEFAULT_CLAUDE_MODEL_FALLBACKS, ft as cheapReviewerModel, gt as fastImplementerModel, ht as fastGeneralPurposeModel, it as agentToolsEnabled, jt as standInToolEnabled, kn as CHEAP_PROFILE_ADVISOR_CLIENT_MODEL, kt as scoutModel, lt as browserToolsEnabled, mt as fastAstraModel, o as buildPeerAwarenessSnippet, ot as brainstormModel, pt as fastAdvisorModel, r as agentNamesForToolAllowlist, rn as warmTreeSitterPool, s as buildPeerAwarenessSummary, sn as shouldUseInsecureTls, st as browseAgentEnabled, ut as cheapAdvisorModel, vt as fastPlanModel, wt as implementerFastModel, xn as resolveLeadSlugArg, xt as fleetToolsEnabled, yn as isBudgetClaudeLead, yt as fastReviewerModel } from "./peer-mcp-personas-CYWJSxPK.js";
2
- import { o as removeOwnClaudeConfigMirror, r as ensureClaudeConfigMirror, t as PATHS, u as writeArtifactCredsToMirror } from "./paths-CMxlQEfQ.js";
3
- import { t as state } from "./state-B8adscCv.js";
4
- import { d as resolveModel } from "./token-ClzS23Y2.js";
1
+ import { At as resolveGeminiReviewModel, Cn as isBudgetClaudeLead, Ct as fastReviewerModel, D as toolbeltEnabled, Dt as generalPurposeFastModel, E as buildToolbeltAwareness, Et as geminiAvailable, Ft as standInToolEnabled, Gt as unregisterLaunch, It as workerToolsEnabled, Ln as CHEAPEST_PROFILE_NATIVE_MODELS, Mt as reviewerModel, Nn as CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL, Nt as scoutModel, Ot as implementerFastModel, Pt as scribeModel, St as fastPlanModel, T as availableToolCommands, Tn as resolveLeadSlugArg, Tt as fleetToolsEnabled, Un as CHEAP_PROFILE_NATIVE_MODELS, Wt as registerLaunch, _t as fastAdvisorModel, at as agentToolsEnabled, bt as fastImplementerModel, ct as browseAgentEnabled, dn as shouldUseInsecureTls, dt as cheapAdvisorModel, ft as cheapOracleModel, gn as DEFAULT_CLAUDE_MODEL_FALLBACKS, gt as cheapestReviewerModel, ht as cheapestOracleModel, in as provisionAndIndexColbert, jt as reviewerFastModel, kt as nativeSubagentModel, lt as browserCompoundToolsEnabled, mt as cheapestAdvisorModel, o as buildPeerAwarenessSnippet, ot as artifactToolsEnabled, pt as cheapReviewerModel, r as agentNamesForToolAllowlist, rn as colbertDegradedWarning, s as buildPeerAwarenessSummary, sn as warmTreeSitterPool, st as brainstormModel, tn as provisionBrowserAssets, ut as browserToolsEnabled, vt as fastAstraModel, wn as pickClaudeDefault, wt as fastScoutModel, xt as fastOracleModel, yt as fastGeneralPurposeModel, zn as CHEAP_PROFILE_ADVISOR_CLIENT_MODEL } from "./peer-mcp-personas-CRMVuMVF.js";
2
+ import { d as writeArtifactCredsToMirror, o as purgeNonRouterAgentsFromMirror, r as ensureClaudeConfigMirror, s as removeOwnClaudeConfigMirror, t as PATHS } from "./paths-CHBAj_t9.js";
3
+ import { t as state } from "./state-BlMpEFAt.js";
4
+ import { d as resolveModel } from "./token-86uk6y4P.js";
5
5
  import { i as parseBoolEnv } from "./exec-COUT4QsS.js";
6
- import { C as checkClaudeVersion, S as runSelfUpdate, _ as resolveLaunchProfile, a as sharedServerArgs, b as validateFastProfilePrerequisites, c as stopKeepAwake, d as enableFileLogging, g as profileDescriptor, h as formatFastPrerequisiteFailure, i as setupAndServe, l as injectModelPickerSettingsFile, m as formatCheapPrerequisiteFailure, o as LAUNCH_SECRET_HEADER, p as formatCheap1mPrerequisiteFailure, r as parseSharedArgs, s as startKeepAwake, t as getClaudeCodeEnvVars, u as listModelsForEndpoint, v as validateCheap1mProfilePrerequisites, w as updateClaude, x as validateMaxProfileLaunch, y as validateCheapProfilePrerequisites } from "./server-setup-D7ABbEs1.js";
6
+ import { C as validateMaxProfileLaunch, E as updateClaude, S as validateFastProfilePrerequisites, T as checkClaudeVersion, _ as profileDescriptor, a as sharedServerArgs, b as validateCheapProfilePrerequisites, c as stopKeepAwake, d as enableFileLogging, g as formatFastPrerequisiteFailure, h as formatCheapestPrerequisiteFailure, i as setupAndServe, l as injectModelPickerSettingsFile, m as formatCheapPrerequisiteFailure, o as LAUNCH_SECRET_HEADER, p as formatCheap1mPrerequisiteFailure, r as parseSharedArgs, s as startKeepAwake, t as getClaudeCodeEnvVars, u as listModelsForEndpoint, v as resolveLaunchProfile, w as runSelfUpdate, x as validateCheapestProfilePrerequisites, y as validateCheap1mProfilePrerequisites } from "./server-setup-0PaS4m2B.js";
7
7
  import { t as FAST_PROFILE_ADVISOR_CLIENT_MODEL } from "./fast-profile-contract-_DhIWank.js";
8
- import { _ as maxReviewerModel, c as formatMaxPrerequisiteFailure, f as maxCodexReviewerModel, h as maxOpusModel, i as MAX_PROFILE_MODELS, m as maxGrokModel, o as MAX_PROFILE_NATIVE_EFFORTS, p as maxGeminiModel, v as maxSonnetModel } from "./max-profile-contract-BcrMlrmo.js";
9
- import { n as hookLauncherDegradedWarning, r as resolveSelfInvocation, t as buildSelfCommand } from "./self-invocation-cRl4RqfW.js";
10
- import { i as launchChild, r as getCodexVersion, t as provisionToolbelt } from "./provision-AwSjt-vR.js";
11
- import { a as formatAicExitSummary, l as removeAicLedgerFile, n as aicSnapshot, t as aicLedgerPath, u as sweepStaleAicLedgerFiles } from "./aic-ledger-BS47yb_C.js";
12
- import { i as captureLaunchBaseline, l as stopGateDisabled, n as buildSessionBindHookCommand, r as buildStopHookCommand, s as injectStopHookIntoSettingsFile, t as buildArtifactOpenHookCommand, u as stopGateId } from "./stop-gate-hook-BUCxa5Kc.js";
13
- import { t as liveExec } from "./orchestration-Dc3mO0G3.js";
14
- import { c as repoRoot, d as trustRepo, l as stopGateEnabledForRepo, s as repoFingerprint, t as fileBaselineStore } from "./stop-gate-policy--bpyxxXU.js";
15
- import { l as guardToolMatcher, n as activeDispatchModes, r as buildWorkerGuardHookCommand } from "./worker-dispatch-DMIdrlsF.js";
16
- import { C as writePeerMcpRuntimeFiles, S as workersKeyOf, a as appendPeerAwarenessToMirroredClaudeMd, b as resolveCodexCliBackend, c as buildOperatingDefaultsDirective, d as prependStyleDirectiveToMirroredClaudeMd, f as buildArtifactReviewSkill, g as planModeAllowRules, h as injectAllowRules, i as writeInjectedSkill, l as prependArtifactPanelDirectiveToMirroredClaudeMd, o as appendToolbeltAwarenessToMirroredClaudeMd, r as injectedSkillsForLaunch, s as buildOperatingDefaultsDigest, t as injectAttributionSuppressionIntoSettingsFile, u as prependOperatingDefaultsToMirroredClaudeMd, x as resolveGroupKeysFromMirror, y as injectPeerMcpIntoMirror } from "./attribution-settings-DXmmyuEE.js";
8
+ import { _ as maxReviewerModel, c as formatMaxPrerequisiteFailure, f as maxCodexReviewerModel, h as maxOpusModel, i as MAX_PROFILE_MODELS, m as maxGrokModel, o as MAX_PROFILE_NATIVE_EFFORTS, p as maxGeminiModel, v as maxSonnetModel } from "./max-profile-contract-Bl7I_EOC.js";
9
+ import { n as hookLauncherDegradedWarning, r as resolveSelfInvocation, t as buildSelfCommand } from "./self-invocation-DahN1gw9.js";
10
+ import { i as launchChild, r as getCodexVersion, t as provisionToolbelt } from "./provision-Bn8-NDp7.js";
11
+ import { a as formatAicExitSummary, l as removeAicLedgerFile, n as aicSnapshot, t as aicLedgerPath, u as sweepStaleAicLedgerFiles } from "./aic-ledger-DY03LbBM.js";
12
+ import { d as stopGateId, i as captureLaunchBaseline, l as purgeNonRouterHooksForPinnedProfile, n as buildSessionBindHookCommand, r as buildStopHookCommand, s as injectStopHookIntoSettingsFile, t as buildArtifactOpenHookCommand, u as stopGateDisabled } from "./stop-gate-hook-D7N759TG.js";
13
+ import { t as liveExec } from "./orchestration-B8kypXcZ.js";
14
+ import { c as repoRoot, d as trustRepo, l as stopGateEnabledForRepo, s as repoFingerprint, t as fileBaselineStore } from "./stop-gate-policy-C0gt04R0.js";
15
+ import { l as guardToolMatcher, n as activeDispatchModes, r as buildWorkerGuardHookCommand } from "./worker-dispatch-B-OA7tvU.js";
16
+ import { C as writePeerMcpRuntimeFiles, S as workersKeyOf, a as appendPeerAwarenessToMirroredClaudeMd, b as resolveCodexCliBackend, c as buildOperatingDefaultsDirective, d as prependStyleDirectiveToMirroredClaudeMd, f as buildArtifactReviewSkill, g as planModeAllowRules, h as injectAllowRules, i as writeInjectedSkill, l as prependArtifactPanelDirectiveToMirroredClaudeMd, o as appendToolbeltAwarenessToMirroredClaudeMd, r as injectedSkillsForLaunch, s as buildOperatingDefaultsDigest, t as injectAttributionSuppressionIntoSettingsFile, u as prependOperatingDefaultsToMirroredClaudeMd, x as resolveGroupKeysFromMirror, y as injectPeerMcpIntoMirror } from "./attribution-settings-D6dAkP4e.js";
17
17
  import { r as hookMcpRuntimeFromEnv } from "./hook-mcp-client-DBvm9608.js";
18
- import { i as planReviewEnabled, t as buildPlanReviewHookCommand } from "./plan-review-hook-BIMwWkh6.js";
19
- import { a as checksForDescriptor, i as writeDiscoveredGate, n as readDiscoveredGate, o as descriptorHash, r as sourcesHash, s as parseGateDescriptor, t as discoverGateCommands } from "./gate-discovery-CPk6Z8yc.js";
20
- import { t as buildPromptSubmitHookCommand } from "./prompt-submit-hook-BcFpjHXg.js";
21
- import { i as assertShapingInstalled, n as buildFirstMateGuardHookCommand, t as FIRST_MATE_GUARD_MATCHER } from "./internal-first-mate-guard-B0rbLb0L.js";
22
- import { r as FAST_DISPATCH_TOOL_MATCHER, t as buildFastDispatchGuardHookCommand } from "./internal-fast-dispatch-guard-CAwYj_Yz.js";
23
- import { i as assertMaxDispatchGuardInstalled, r as MAX_DISPATCH_TOOL_MATCHER, t as buildMaxDispatchGuardHookCommand } from "./internal-max-dispatch-guard-l1NGYHtF.js";
24
- import { n as formatDiscountedCostTable, t as discountedUsdForSnapshot } from "./copilot-discount-IbXR5A28.js";
18
+ import { i as planReviewEnabled, t as buildPlanReviewHookCommand } from "./plan-review-hook-BMmw7wxR.js";
19
+ import { a as checksForDescriptor, i as writeDiscoveredGate, n as readDiscoveredGate, o as descriptorHash, r as sourcesHash, s as parseGateDescriptor, t as discoverGateCommands } from "./gate-discovery-B17pvgE0.js";
20
+ import { t as buildPromptSubmitHookCommand } from "./prompt-submit-hook-CGgT5m4Q.js";
21
+ import { i as assertShapingInstalled, n as buildFirstMateGuardHookCommand, t as FIRST_MATE_GUARD_MATCHER } from "./internal-first-mate-guard-CiFH6X1H.js";
22
+ import { r as FAST_DISPATCH_TOOL_MATCHER, t as buildFastDispatchGuardHookCommand } from "./internal-fast-dispatch-guard-CZ4BZuAG.js";
23
+ import { i as assertMaxDispatchGuardInstalled, r as MAX_DISPATCH_TOOL_MATCHER, t as buildMaxDispatchGuardHookCommand } from "./internal-max-dispatch-guard-CnBZxo5l.js";
24
+ import { n as formatDiscountedCostTable, t as discountedUsdForSnapshot } from "./copilot-discount-C3jx9Q-o.js";
25
25
  import { defineCommand } from "citty";
26
26
  import consola from "consola";
27
27
  import path from "node:path";
@@ -57,12 +57,18 @@ function assertFastDispatchGuardInstalled(fastProfile, installationSucceeded) {
57
57
  * same mirror mechanics work for concurrent launches. AIC is pinned: it
58
58
  * renders even when the terminal is too narrow for any other segment.
59
59
  *
60
- * Wrap-don't-clobber: when the user's own config already defines `statusLine`
61
- * as a `{type:"command", command:string}` shape, that command is preserved via
62
- * `GH_ROUTER_AIC_USER_STATUSLINE` (set by the caller from the returned
63
- * `userCommand`) and the hook composes one line: `[AIC x.xx] <user line>`.
64
- * Any other pre-existing `statusLine` shape is left untouched
65
- * (`reason: "unrecognized"`) rather than risk breaking an exotic config.
60
+ * Standard launches use wrap-don't-clobber: when the user's own config
61
+ * already defines `statusLine` as a `{type:"command", command:string}`
62
+ * shape, that command is preserved via `GH_ROUTER_AIC_USER_STATUSLINE`
63
+ * (set by the caller from the returned `userCommand`) and the hook
64
+ * composes one line: `[AIC x.xx] <user line>`. Any other pre-existing
65
+ * `statusLine` shape is left untouched (`reason: "unrecognized"`) rather
66
+ * than risk breaking an exotic config.
67
+ *
68
+ * Pinned launches (fast/cheap/cheap1m/cheapest, `routerWins: true`) run
69
+ * router-provided surfaces only: ANY pre-existing `statusLine` is backed
70
+ * up to a mirror sidecar and replaced with ours (`mode: "forced"`), so the
71
+ * native rich line always renders and the user command never executes.
66
72
  *
67
73
  * Failure model matches the sibling settings writers: a transient read error
68
74
  * or a non-object settings.json throws (never clobber a file we don't
@@ -82,7 +88,7 @@ function isCommandStatusLine(value) {
82
88
  const record = value;
83
89
  return record.type === "command" && typeof record.command === "string" && record.command.length > 0;
84
90
  }
85
- async function injectAicStatusLineIntoSettingsFile(settingsPath, statusCommand) {
91
+ async function injectAicStatusLineIntoSettingsFile(settingsPath, statusCommand, opts = {}) {
86
92
  let existing = {};
87
93
  let raw;
88
94
  try {
@@ -102,6 +108,22 @@ async function injectAicStatusLineIntoSettingsFile(settingsPath, statusCommand)
102
108
  written: false,
103
109
  reason: "already-set"
104
110
  };
111
+ if (opts.routerWins) {
112
+ const hadPrevious = true;
113
+ await writeSettingsAtomically(settingsPath, {
114
+ ...existing,
115
+ statusLine: {
116
+ type: "command",
117
+ command: statusCommand
118
+ }
119
+ });
120
+ await writeBackupSidecar(settingsPath, current);
121
+ return {
122
+ written: true,
123
+ mode: "forced",
124
+ hadPrevious
125
+ };
126
+ }
105
127
  if (isCommandStatusLine(current)) {
106
128
  const userCommand = current.command;
107
129
  await writeSettingsAtomically(settingsPath, {
@@ -139,6 +161,19 @@ async function writeSettingsAtomically(settingsPath, merged) {
139
161
  await fs.writeFile(tmp, `${JSON.stringify(merged, null, 2)}\n`, { mode: 384 });
140
162
  await fs.rename(tmp, settingsPath);
141
163
  }
164
+ /**
165
+ * Record a replaced `statusLine` value in a mirror sidecar for audit.
166
+ * Mirror-only (same dir as the mirrored settings.json); the operator's
167
+ * real settings are never touched. Best-effort: a backup failure must
168
+ * not fail the injection that already succeeded.
169
+ */
170
+ async function writeBackupSidecar(settingsPath, previous) {
171
+ const backupPath = `${settingsPath}.aic-statusline-backup.json`;
172
+ const payload = { replacedStatusLine: previous };
173
+ try {
174
+ await fs.writeFile(backupPath, `${JSON.stringify(payload, null, 2)}\n`, { mode: 384 });
175
+ } catch {}
176
+ }
142
177
  //#endregion
143
178
  //#region src/lib/fast-launch-cleanup.ts
144
179
  function createFastLaunchCleanup(deps) {
@@ -164,8 +199,8 @@ function createFastLaunchCleanup(deps) {
164
199
  }
165
200
  //#endregion
166
201
  //#region src/lib/fast-advisor-client.ts
167
- const ADVISOR_FLAG$1 = "--advisor";
168
- function featureEnvEnabled$1(value) {
202
+ const ADVISOR_FLAG$2 = "--advisor";
203
+ function featureEnvEnabled$2(value) {
169
204
  if (value === void 0) return true;
170
205
  return ![
171
206
  "",
@@ -178,7 +213,7 @@ function featureEnvEnabled$1(value) {
178
213
  /** Match Claude Code's hard-disable and experimental-enable opt-out semantics. */
179
214
  function fastAdvisorClientEnabled(env = process.env) {
180
215
  if (env.CLAUDE_CODE_DISABLE_ADVISOR_TOOL) return false;
181
- return featureEnvEnabled$1(env.CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL);
216
+ return featureEnvEnabled$2(env.CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL);
182
217
  }
183
218
  /**
184
219
  * Remove every caller-supplied Advisor option and insert the fixed fast value.
@@ -194,17 +229,17 @@ function withFixedFastAdvisorArg(args, enabled = fastAdvisorClientEnabled()) {
194
229
  const sanitized = [];
195
230
  for (let index = 0; index < args.length; index++) {
196
231
  const token = args[index];
197
- if (token === ADVISOR_FLAG$1) {
232
+ if (token === ADVISOR_FLAG$2) {
198
233
  const next = args[index + 1];
199
234
  if (next !== void 0 && next !== "--" && !next.startsWith("-")) index++;
200
235
  continue;
201
236
  }
202
- if (token.startsWith(`${ADVISOR_FLAG$1}=`)) continue;
237
+ if (token.startsWith(`${ADVISOR_FLAG$2}=`)) continue;
203
238
  sanitized.push(token);
204
239
  }
205
240
  if (!enabled) return sanitized;
206
241
  const separator = sanitized.indexOf("--");
207
- const fixed = [ADVISOR_FLAG$1, FAST_PROFILE_ADVISOR_CLIENT_MODEL];
242
+ const fixed = [ADVISOR_FLAG$2, FAST_PROFILE_ADVISOR_CLIENT_MODEL];
208
243
  if (separator < 0) return [...sanitized, ...fixed];
209
244
  return [
210
245
  ...sanitized.slice(0, separator),
@@ -214,8 +249,8 @@ function withFixedFastAdvisorArg(args, enabled = fastAdvisorClientEnabled()) {
214
249
  }
215
250
  //#endregion
216
251
  //#region src/lib/cheap-advisor-client.ts
217
- const ADVISOR_FLAG = "--advisor";
218
- function featureEnvEnabled(value) {
252
+ const ADVISOR_FLAG$1 = "--advisor";
253
+ function featureEnvEnabled$1(value) {
219
254
  if (value === void 0) return true;
220
255
  return ![
221
256
  "",
@@ -228,7 +263,7 @@ function featureEnvEnabled(value) {
228
263
  /** Match Claude Code's hard-disable and experimental-enable opt-out semantics. */
229
264
  function cheapAdvisorClientEnabled(env = process.env) {
230
265
  if (env.CLAUDE_CODE_DISABLE_ADVISOR_TOOL) return false;
231
- return featureEnvEnabled(env.CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL);
266
+ return featureEnvEnabled$1(env.CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL);
232
267
  }
233
268
  /**
234
269
  * Remove every caller-supplied Advisor option and insert the fixed cheap value
@@ -238,6 +273,53 @@ function cheapAdvisorClientEnabled(env = process.env) {
238
273
  * the first separator so Claude Code parses it as an option.
239
274
  */
240
275
  function withFixedCheapAdvisorArg(args, enabled = cheapAdvisorClientEnabled()) {
276
+ const sanitized = [];
277
+ for (let index = 0; index < args.length; index++) {
278
+ const token = args[index];
279
+ if (token === ADVISOR_FLAG$1) {
280
+ const next = args[index + 1];
281
+ if (next !== void 0 && next !== "--" && !next.startsWith("-")) index++;
282
+ continue;
283
+ }
284
+ if (token.startsWith(`${ADVISOR_FLAG$1}=`)) continue;
285
+ sanitized.push(token);
286
+ }
287
+ if (!enabled) return sanitized;
288
+ const separator = sanitized.indexOf("--");
289
+ const fixed = [ADVISOR_FLAG$1, CHEAP_PROFILE_ADVISOR_CLIENT_MODEL];
290
+ if (separator < 0) return [...sanitized, ...fixed];
291
+ return [
292
+ ...sanitized.slice(0, separator),
293
+ ...fixed,
294
+ ...sanitized.slice(separator)
295
+ ];
296
+ }
297
+ //#endregion
298
+ //#region src/lib/cheapest-advisor-client.ts
299
+ const ADVISOR_FLAG = "--advisor";
300
+ function featureEnvEnabled(value) {
301
+ if (value === void 0) return true;
302
+ return ![
303
+ "",
304
+ "0",
305
+ "false",
306
+ "no",
307
+ "off"
308
+ ].includes(value.trim().toLowerCase());
309
+ }
310
+ /** Match Claude Code's hard-disable and experimental-enable opt-out semantics. */
311
+ function cheapestAdvisorClientEnabled(env = process.env) {
312
+ if (env.CLAUDE_CODE_DISABLE_ADVISOR_TOOL) return false;
313
+ return featureEnvEnabled(env.CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL);
314
+ }
315
+ /**
316
+ * Remove every caller-supplied Advisor option and insert the fixed cheapest
317
+ * value (the BARE `gemini-3.8-flash` — 200K default window — see
318
+ * `CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL`). Same parser semantics as the
319
+ * cheap variant: keeps scanning after `--`, and the fixed option is inserted
320
+ * before the first separator so Claude Code parses it as an option.
321
+ */
322
+ function withFixedCheapestAdvisorArg(args, enabled = cheapestAdvisorClientEnabled()) {
241
323
  const sanitized = [];
242
324
  for (let index = 0; index < args.length; index++) {
243
325
  const token = args[index];
@@ -251,7 +333,7 @@ function withFixedCheapAdvisorArg(args, enabled = cheapAdvisorClientEnabled()) {
251
333
  }
252
334
  if (!enabled) return sanitized;
253
335
  const separator = sanitized.indexOf("--");
254
- const fixed = [ADVISOR_FLAG, CHEAP_PROFILE_ADVISOR_CLIENT_MODEL];
336
+ const fixed = [ADVISOR_FLAG, CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL];
255
337
  if (separator < 0) return [...sanitized, ...fixed];
256
338
  return [
257
339
  ...sanitized.slice(0, separator),
@@ -266,7 +348,7 @@ const claudeArgs = {
266
348
  model: {
267
349
  alias: "m",
268
350
  type: "string",
269
- description: "Override the default model for Claude Code. Accepts a profile alias (fast, cheap, cheap1m, max), a full slug (e.g. claude-opus-4-7), or an Opus family shorthand (e.g. 4.7, 4.8, 4.6) which expands to the best variant for that family — adding the [1m] suffix when a 1M-context backend is in the catalog."
351
+ description: "Override the default model for Claude Code. Accepts a profile alias (fast, cheap, cheap1m, cheapest, max), a full slug (e.g. claude-opus-4-7), or an Opus family shorthand (e.g. 4.7, 4.8, 4.6) which expands to the best variant for that family — adding the [1m] suffix when a 1M-context backend is in the catalog."
270
352
  },
271
353
  "codex-mcp": {
272
354
  type: "boolean",
@@ -383,8 +465,8 @@ const claude = defineCommand({
383
465
  process$1.stderr.write(`Max profile uses its fixed HTTP MCP surface; --codex-cli is not supported in max profile.\n`);
384
466
  process$1.exit(1);
385
467
  }
386
- if ((requestedLaunchProfileId === "fast" || requestedLaunchProfileId === "max" || requestedLaunchProfileId === "cheap" || requestedLaunchProfileId === "cheap1m") && !codexMcpEnabled) {
387
- const message = `github-router claude -m ${requestedLaunchProfileId === "fast" ? "fast" : requestedLaunchProfileId === "cheap" ? "cheap" : requestedLaunchProfileId === "cheap1m" ? "cheap1m" : "max"} requires codex MCP wiring for its native roster and dispatch ACL; remove --no-codex-mcp or choose a standard model.`;
468
+ if ((requestedLaunchProfileId === "fast" || requestedLaunchProfileId === "max" || requestedLaunchProfileId === "cheap" || requestedLaunchProfileId === "cheap1m" || requestedLaunchProfileId === "cheapest") && !codexMcpEnabled) {
469
+ const message = `github-router claude -m ${requestedLaunchProfileId === "fast" ? "fast" : requestedLaunchProfileId === "cheap" ? "cheap" : requestedLaunchProfileId === "cheap1m" ? "cheap1m" : requestedLaunchProfileId === "cheapest" ? "cheapest" : "max"} requires codex MCP wiring for its native roster and dispatch ACL; remove --no-codex-mcp or choose a standard model.`;
388
470
  process$1.stderr.write(`${message}\n`);
389
471
  process$1.exit(1);
390
472
  }
@@ -473,6 +555,9 @@ const claude = defineCommand({
473
555
  } else if (launchProfileId === "cheap" || launchProfileId === "cheap1m") {
474
556
  const prereqCheck = launchProfileId === "cheap1m" ? validateCheap1mProfilePrerequisites(state.models) : validateCheapProfilePrerequisites(state.models);
475
557
  if (!prereqCheck.ok) await fastFatal(launchProfileId === "cheap1m" ? formatCheap1mPrerequisiteFailure(prereqCheck.missing) : formatCheapPrerequisiteFailure(prereqCheck.missing));
558
+ } else if (launchProfileId === "cheapest") {
559
+ const prereqCheck = validateCheapestProfilePrerequisites(state.models);
560
+ if (!prereqCheck.ok) await fastFatal(formatCheapestPrerequisiteFailure(prereqCheck.missing));
476
561
  }
477
562
  let chosenSlug = requestedSlug;
478
563
  let resolvedSlug = resolveModel(chosenSlug);
@@ -495,19 +580,48 @@ const claude = defineCommand({
495
580
  }
496
581
  const banner = chosenSlug === resolvedSlug ? chosenSlug : `${chosenSlug} → ${resolvedSlug}`;
497
582
  process$1.stderr.write(`Server ready on ${serverUrl}, launching Claude Code (${banner})...\n`);
583
+ if (launchProfileId === "fast" || launchProfileId === "cheap" || launchProfileId === "cheap1m" || launchProfileId === "cheapest") {
584
+ try {
585
+ const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
586
+ const purgedHooks = await purgeNonRouterHooksForPinnedProfile(settingsPath);
587
+ if (purgedHooks.removed > 0) consola.info(`Removed ${purgedHooks.removed} non-router hook entries from this launch's isolated settings (${launchProfileId} provides its own hooks).`);
588
+ } catch (err) {
589
+ consola.warn(`Non-router hook purge skipped: ${err instanceof Error ? err.message : String(err)}.`);
590
+ }
591
+ try {
592
+ const purgedAgents = await purgeNonRouterAgentsFromMirror();
593
+ if (purgedAgents > 0) consola.info(`Removed ${purgedAgents} non-router subagent files from this launch's isolated agents dir (${launchProfileId} provides its own roster).`);
594
+ } catch (err) {
595
+ consola.warn(`Non-router subagent purge skipped: ${err instanceof Error ? err.message : String(err)}.`);
596
+ }
597
+ }
498
598
  let pickerModels;
499
599
  try {
500
600
  const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
501
601
  const picker = await injectModelPickerSettingsFile(settingsPath, launchProfileId);
502
602
  pickerModels = picker.models;
503
603
  if (picker.reason === "user-set") consola.info("Preserving the user-configured modelPicker for this launch; router-curated rows were not merged.");
604
+ else if (picker.reason === "router-overwrite") consola.info("Replaced a stale modelPicker in this launch's isolated settings with the router-curated rows for this profile.");
504
605
  } catch (err) {
505
606
  consola.warn(`Model-picker settings injection skipped: ${err instanceof Error ? err.message : String(err)}. Use an explicit -m model if the curated rows are unavailable.`);
506
607
  }
507
608
  const envVars = getClaudeCodeEnvVars(serverUrl, chosenSlug, launchProfileId, pickerModels);
609
+ if (launchProfileId === "cheap" || launchProfileId === "cheapest") {
610
+ const suspectKeys = [
611
+ "ANTHROPIC_MODEL",
612
+ "ANTHROPIC_DEFAULT_OPUS_MODEL",
613
+ "ANTHROPIC_DEFAULT_SONNET_MODEL",
614
+ "ANTHROPIC_DEFAULT_HAIKU_MODEL",
615
+ "ANTHROPIC_CUSTOM_MODEL_OPTION"
616
+ ].filter((key) => typeof envVars[key] === "string" && /\[1m\]/i.test(envVars[key]));
617
+ const suspectPicker = (pickerModels ?? []).filter((id) => /\[1m\]/i.test(id));
618
+ if (suspectKeys.length > 0 || suspectPicker.length > 0) consola.warn(`Pinned-profile context leak (${launchProfileId} must be bare 200K): ` + [...suspectKeys.map((key) => `env:${key}`), ...suspectPicker.map((id) => `picker:${id}`)].join(", "));
619
+ }
620
+ if (launchProfileId === "fast" || launchProfileId === "cheap" || launchProfileId === "cheap1m" || launchProfileId === "cheapest") consola.info(`Pinned launch: profile=${launchProfileId} lead=${chosenSlug} pickerRows=${pickerModels?.length ?? 0}.`);
508
621
  let extraArgs = collectChildPassthroughArgs(rawArgs, claudeArgs);
509
622
  if (launchProfileId === "fast") extraArgs = withFixedFastAdvisorArg(extraArgs, fastAdvisorClientEnabled(process$1.env));
510
623
  else if (launchProfileId === "cheap" || launchProfileId === "cheap1m") extraArgs = withFixedCheapAdvisorArg(extraArgs, cheapAdvisorClientEnabled(process$1.env));
624
+ else if (launchProfileId === "cheapest") extraArgs = withFixedCheapestAdvisorArg(extraArgs, cheapestAdvisorClientEnabled(process$1.env));
511
625
  if (toolbeltEnabled()) {
512
626
  provisionToolbelt().catch((err) => consola.debug("Toolbelt provisioning failed:", err));
513
627
  const toolbeltLine = buildToolbeltAwareness(availableToolCommands());
@@ -533,7 +647,7 @@ const claude = defineCommand({
533
647
  let peerAwarenessSnippet;
534
648
  let peerAwarenessSummary;
535
649
  let operatingGroupKeys = {};
536
- let fastWiringComplete = launchProfileId !== "fast" && !(launchProfileId === "cheap" || launchProfileId === "cheap1m");
650
+ let fastWiringComplete = launchProfileId !== "fast" && !(launchProfileId === "cheap" || launchProfileId === "cheap1m" || launchProfileId === "cheapest");
537
651
  const astraAvailable = (launchProfileId === "fast" || launchProfileId === "cheap1m") && Boolean(fastAstraModel());
538
652
  const browseAgentAvailable = browseAgentEnabled();
539
653
  const directBrowserAvailable = browserToolsEnabled();
@@ -552,6 +666,12 @@ const claude = defineCommand({
552
666
  "general-purpose": CHEAP_PROFILE_NATIVE_MODELS["general-purpose"],
553
667
  implementer: CHEAP_PROFILE_NATIVE_MODELS.implementer,
554
668
  reviewer: cheapReviewerModel()
669
+ } : launchProfileId === "cheapest" ? {
670
+ Explore: CHEAPEST_PROFILE_NATIVE_MODELS.Explore,
671
+ Plan: CHEAPEST_PROFILE_NATIVE_MODELS.Plan,
672
+ "general-purpose": CHEAPEST_PROFILE_NATIVE_MODELS["general-purpose"],
673
+ implementer: CHEAPEST_PROFILE_NATIVE_MODELS.implementer,
674
+ reviewer: cheapestReviewerModel()
555
675
  } : launchProfileId === "max" ? {
556
676
  Explore: MAX_PROFILE_MODELS.luna,
557
677
  Plan: MAX_PROFILE_MODELS.sol,
@@ -570,7 +690,7 @@ const claude = defineCommand({
570
690
  "general-purpose-fast": generalPurposeFastModel()
571
691
  };
572
692
  const nativeAvailability = {
573
- scoutAvailable: (launchProfileId === "fast" || launchProfileId === "cheap" || launchProfileId === "cheap1m" ? nativeAgentModels.Explore : nativeAgentModels.scout) != null,
693
+ scoutAvailable: (launchProfileId === "fast" || launchProfileId === "cheap" || launchProfileId === "cheap1m" || launchProfileId === "cheapest" ? nativeAgentModels.Explore : nativeAgentModels.scout) != null,
574
694
  implementerFastAvailable: nativeAgentModels["implementer-fast"] != null,
575
695
  reviewerFastAvailable: nativeAgentModels["reviewer-fast"] != null,
576
696
  generalPurposeFastAvailable: nativeAgentModels["general-purpose-fast"] != null,
@@ -586,7 +706,7 @@ const claude = defineCommand({
586
706
  const requestedCli = args["codex-cli"] ?? false;
587
707
  const isFastProfile = launchProfileId === "fast";
588
708
  const isMaxProfile = launchProfileId === "max";
589
- const isCheapProfile = launchProfileId === "cheap" || launchProfileId === "cheap1m";
709
+ const isCheapProfile = launchProfileId === "cheap" || launchProfileId === "cheap1m" || launchProfileId === "cheapest";
590
710
  const isPinnedProfile = isFastProfile || isMaxProfile || isCheapProfile;
591
711
  if ((isFastProfile || isCheapProfile) && requestedCli) process$1.stderr.write("Fast/cheap profile uses its fixed HTTP MCP surface; ignoring --codex-cli.\n");
592
712
  const backend = isPinnedProfile ? "http" : resolveCodexCliBackend({
@@ -613,7 +733,8 @@ const claude = defineCommand({
613
733
  if (isMaxProfile && agentToolsEnabled()) enabledGroups.push("first-mate");
614
734
  const { keys: groupKeys, skipped: skippedGroups } = await resolveGroupKeysFromMirror(enabledGroups);
615
735
  operatingGroupKeys = groupKeys;
616
- if (isPinnedProfile && ((isCheapProfile ? cheapOracleModel() : fastOracleModel()) == null || (isCheapProfile ? cheapAdvisorModel() : fastAdvisorModel()) == null || nativeAgentModels.implementer == null)) {
736
+ if (isPinnedProfile && ((launchProfileId === "cheapest" ? cheapestOracleModel() : isCheapProfile ? cheapOracleModel() : fastOracleModel()) == null || (launchProfileId === "cheapest" ? cheapestAdvisorModel() : isCheapProfile ? cheapAdvisorModel() : fastAdvisorModel()) == null || nativeAgentModels.implementer == null)) {
737
+ if (launchProfileId === "cheapest") throw new Error("cheapest profile prerequisite drift: exact implementer, oracle (gpt-5.6-sol), or advisor (gemini-3.8-flash) model no longer resolves");
617
738
  if (isCheapProfile) throw new Error("cheap profile prerequisite drift: exact implementer or oracle (grok-4.6) model no longer resolves");
618
739
  throw new Error("fast profile prerequisite drift: exact Oracle, Advisor, or implementer model no longer resolves");
619
740
  }
@@ -645,6 +766,13 @@ const claude = defineCommand({
645
766
  fastGeneralPurposeModel: nativeAgentModels["general-purpose"],
646
767
  fastImplementerModel: nativeAgentModels.implementer,
647
768
  fastReviewerModel: nativeAgentModels.reviewer
769
+ } : launchProfileId === "cheapest" ? {
770
+ cheapestProfile: true,
771
+ cheapestExploreModel: nativeAgentModels.Explore,
772
+ cheapestPlanModel: nativeAgentModels.Plan,
773
+ cheapestGeneralPurposeModel: nativeAgentModels["general-purpose"],
774
+ cheapestImplementerModel: nativeAgentModels.implementer,
775
+ cheapestReviewerModel: nativeAgentModels.reviewer
648
776
  } : isCheapProfile ? {
649
777
  cheapProfile: true,
650
778
  cheapExploreModel: nativeAgentModels.Explore,
@@ -991,13 +1119,13 @@ const claude = defineCommand({
991
1119
  consola.warn(`Style-directive CLAUDE.md prepend failed: ${err instanceof Error ? err.message : String(err)}`);
992
1120
  }
993
1121
  } catch (err) {
994
- if (launchProfileId === "fast" || launchProfileId === "max" || launchProfileId === "cheap" || launchProfileId === "cheap1m") {
1122
+ if (launchProfileId === "fast" || launchProfileId === "max" || launchProfileId === "cheap" || launchProfileId === "cheap1m" || launchProfileId === "cheapest") {
995
1123
  if (fastLaunchId) unregisterLaunch(fastLaunchId);
996
1124
  await disposeFastRuntime().catch(() => {});
997
1125
  await server.close(true).catch(() => {});
998
1126
  await baseShutdown().catch(() => {});
999
1127
  resetFastRuntimeOwnership();
1000
- const message = `${launchProfileId === "fast" ? "Fast" : launchProfileId === "cheap" ? "Cheap" : launchProfileId === "cheap1m" ? "Cheap1m" : "Max"} profile wiring failed; refusing to launch an unguarded session: ${err instanceof Error ? err.message : String(err)}`;
1128
+ const message = `${launchProfileId === "fast" ? "Fast" : launchProfileId === "cheap" ? "Cheap" : launchProfileId === "cheap1m" ? "Cheap1m" : launchProfileId === "cheapest" ? "Cheapest" : "Max"} profile wiring failed; refusing to launch an unguarded session: ${err instanceof Error ? err.message : String(err)}`;
1001
1129
  consola.error(message);
1002
1130
  process$1.stderr.write(`${message}\n`);
1003
1131
  process$1.exit(1);
@@ -1031,10 +1159,11 @@ const claude = defineCommand({
1031
1159
  }
1032
1160
  if (process$1.env.GH_ROUTER_DISABLE_AIC_STATUSLINE !== "1") try {
1033
1161
  sweepStaleAicLedgerFiles();
1034
- const injected = await injectAicStatusLineIntoSettingsFile(path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json"), buildAicStatusHookCommand(selfInvocation));
1162
+ const injected = await injectAicStatusLineIntoSettingsFile(path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json"), buildAicStatusHookCommand(selfInvocation), launchProfileId === "fast" || launchProfileId === "cheap" || launchProfileId === "cheap1m" || launchProfileId === "cheapest" ? { routerWins: true } : {});
1035
1163
  if (injected.written) {
1036
1164
  envVars[AIC_LEDGER_ENV] = aicLedgerPath();
1037
1165
  if (injected.mode === "wrapped" && injected.userCommand) envVars[AIC_USER_STATUSLINE_ENV] = injected.userCommand;
1166
+ if (injected.mode === "forced") consola.info(`Pinned status line installed natively for ${launchProfileId}; a pre-existing statusLine was backed up in this launch's isolated settings and will not run.`);
1038
1167
  }
1039
1168
  } catch (err) {
1040
1169
  consola.warn(`AIC status line skipped: ${err instanceof Error ? err.message : String(err)}`);
@@ -1059,4 +1188,4 @@ const claude = defineCommand({
1059
1188
  //#endregion
1060
1189
  export { claude };
1061
1190
 
1062
- //# sourceMappingURL=claude-Cmmu3-cL.js.map
1191
+ //# sourceMappingURL=claude-aZ6OaFP5.js.map