github-router 0.3.297 → 0.3.303

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 (104) hide show
  1. package/dist/{attribution-settings-B70GmZ68.js → attribution-settings-dta8MTnd.js} +322 -95
  2. package/dist/attribution-settings-dta8MTnd.js.map +1 -0
  3. package/dist/{auth-CluG5e-l.js → auth-CpjOjoUG.js} +4 -3
  4. package/dist/{auth-CluG5e-l.js.map → auth-CpjOjoUG.js.map} +1 -1
  5. package/dist/browser-ext/manifest.json +1 -1
  6. package/dist/{check-usage-iOzfnKJe.js → check-usage-BsN3S4Fu.js} +4 -4
  7. package/dist/{check-usage-iOzfnKJe.js.map → check-usage-BsN3S4Fu.js.map} +1 -1
  8. package/dist/{claude-DMMfvfns.js → claude-kr-Augld.js} +169 -170
  9. package/dist/claude-kr-Augld.js.map +1 -0
  10. package/dist/{codex-DVOyVv2B.js → codex-B1qnVlzG.js} +6 -5
  11. package/dist/{codex-DVOyVv2B.js.map → codex-B1qnVlzG.js.map} +1 -1
  12. package/dist/{debug-DsEwleGg.js → debug-BXRPyeqO.js} +2 -2
  13. package/dist/{debug-DsEwleGg.js.map → debug-BXRPyeqO.js.map} +1 -1
  14. package/dist/engine-B3w1TDgR.js +2 -0
  15. package/dist/{fast-profile-contract-K3P58nj3.js → fast-profile-contract-B6xn-Rzo.js} +26 -23
  16. package/dist/fast-profile-contract-B6xn-Rzo.js.map +1 -0
  17. package/dist/{gate-discovery-G6PAG61j.js → gate-discovery-DOIm3XHF.js} +5 -5
  18. package/dist/{gate-discovery-G6PAG61j.js.map → gate-discovery-DOIm3XHF.js.map} +1 -1
  19. package/dist/{get-copilot-usage-B7Z4XVWj.js → get-copilot-usage-ByjQqhdi.js} +3 -2
  20. package/dist/{get-copilot-usage-B7Z4XVWj.js.map → get-copilot-usage-ByjQqhdi.js.map} +1 -1
  21. package/dist/hooks.mjs +393 -40
  22. package/dist/hooks.sha256 +1 -1
  23. package/dist/{internal-artifact-open-D6tKMg8v.js → internal-artifact-open-DRSxShAW.js} +2 -2
  24. package/dist/{internal-artifact-open-D6tKMg8v.js.map → internal-artifact-open-DRSxShAW.js.map} +1 -1
  25. package/dist/{internal-fast-dispatch-guard-Bkr_iGOu.js → internal-fast-dispatch-guard-BhpZ6LvO.js} +72 -16
  26. package/dist/internal-fast-dispatch-guard-BhpZ6LvO.js.map +1 -0
  27. package/dist/{internal-fast-dispatch-guard-N-RaLrOn.js → internal-fast-dispatch-guard-C6BNoOnn.js} +1 -1
  28. package/dist/{internal-first-mate-guard-C9BV7J4U.js → internal-first-mate-guard-Bcb5JwiO.js} +3 -3
  29. package/dist/{internal-first-mate-guard-C9BV7J4U.js.map → internal-first-mate-guard-Bcb5JwiO.js.map} +1 -1
  30. package/dist/{internal-first-mate-guard-WJApyc8j.js → internal-first-mate-guard-Brh_uois.js} +1 -1
  31. package/dist/internal-max-dispatch-guard-DhAr8N_o.js +215 -0
  32. package/dist/internal-max-dispatch-guard-DhAr8N_o.js.map +1 -0
  33. package/dist/internal-max-dispatch-guard-k52H-PdC.js +2 -0
  34. package/dist/{internal-plan-review-t3PuNfuL.js → internal-plan-review-DVY-iV2x.js} +3 -3
  35. package/dist/{internal-plan-review-t3PuNfuL.js.map → internal-plan-review-DVY-iV2x.js.map} +1 -1
  36. package/dist/{internal-prompt-submit-C3KovHQG.js → internal-prompt-submit-BTqRn4FW.js} +4 -4
  37. package/dist/{internal-prompt-submit-C3KovHQG.js.map → internal-prompt-submit-BTqRn4FW.js.map} +1 -1
  38. package/dist/{internal-session-bind-d2uoja8I.js → internal-session-bind-YfH656lt.js} +2 -2
  39. package/dist/{internal-session-bind-d2uoja8I.js.map → internal-session-bind-YfH656lt.js.map} +1 -1
  40. package/dist/{internal-stop-hook-BjzrF1zd.js → internal-stop-hook-CWffknT2.js} +5 -5
  41. package/dist/{internal-stop-hook-BjzrF1zd.js.map → internal-stop-hook-CWffknT2.js.map} +1 -1
  42. package/dist/{internal-stop-review-YtDUGXpX.js → internal-stop-review-B8MmEyQ1.js} +2 -2
  43. package/dist/{internal-stop-review-YtDUGXpX.js.map → internal-stop-review-B8MmEyQ1.js.map} +1 -1
  44. package/dist/{internal-worker-guard-CdkeS9PN.js → internal-worker-guard-Dr6W83TC.js} +2 -2
  45. package/dist/{internal-worker-guard-CdkeS9PN.js.map → internal-worker-guard-Dr6W83TC.js.map} +1 -1
  46. package/dist/{internal-workspace-header-tuBXJV22.js → internal-workspace-header-Cep0WSIb.js} +2 -2
  47. package/dist/{internal-workspace-header-tuBXJV22.js.map → internal-workspace-header-Cep0WSIb.js.map} +1 -1
  48. package/dist/lifecycle-4TZrJuAa.js +2 -0
  49. package/dist/{lifecycle-CM9eTzvk.js → lifecycle-CmPJ6e_6.js} +2 -2
  50. package/dist/{lifecycle-CM9eTzvk.js.map → lifecycle-CmPJ6e_6.js.map} +1 -1
  51. package/dist/{lifecycle-Bg6doY3-.js → lifecycle-DgsJ_8Am.js} +2 -2
  52. package/dist/{lifecycle-Bg6doY3-.js.map → lifecycle-DgsJ_8Am.js.map} +1 -1
  53. package/dist/lifecycle-O91Vzzb-.js +2 -0
  54. package/dist/main.js +19 -18
  55. package/dist/main.js.map +1 -1
  56. package/dist/max-profile-contract-Ct62mtAR.js +276 -0
  57. package/dist/max-profile-contract-Ct62mtAR.js.map +1 -0
  58. package/dist/{mcp-workspace-header-dERl2YTT.js → mcp-workspace-header-NzFD0Wgd.js} +2 -2
  59. package/dist/{mcp-workspace-header-dERl2YTT.js.map → mcp-workspace-header-NzFD0Wgd.js.map} +1 -1
  60. package/dist/{models-DZ4hYsR7.js → models-1KwEUgzd.js} +3 -3
  61. package/dist/{models-DZ4hYsR7.js.map → models-1KwEUgzd.js.map} +1 -1
  62. package/dist/{orchestration-BiGCEwbH.js → orchestration-CYyp9w-t.js} +2 -2
  63. package/dist/{orchestration-BiGCEwbH.js.map → orchestration-CYyp9w-t.js.map} +1 -1
  64. package/dist/paths-DDAiPVto.js +2 -0
  65. package/dist/{paths-Ci485qSJ.js → paths-IcZW8gZx.js} +4 -4
  66. package/dist/{paths-Ci485qSJ.js.map → paths-IcZW8gZx.js.map} +1 -1
  67. package/dist/{peer-mcp-personas-ce6_YMnX.js → peer-mcp-personas-BU5dNLxQ.js} +737 -459
  68. package/dist/peer-mcp-personas-BU5dNLxQ.js.map +1 -0
  69. package/dist/{plan-review-hook-DuW0pSoM.js → plan-review-hook-szSNt6uU.js} +3 -3
  70. package/dist/{plan-review-hook-DuW0pSoM.js.map → plan-review-hook-szSNt6uU.js.map} +1 -1
  71. package/dist/{prompt-submit-hook-IMl7ssfr.js → prompt-submit-hook-ZUxo_jEl.js} +3 -3
  72. package/dist/{prompt-submit-hook-IMl7ssfr.js.map → prompt-submit-hook-ZUxo_jEl.js.map} +1 -1
  73. package/dist/{provision-BhCtm3md.js → provision-qNJgF5XD.js} +4 -4
  74. package/dist/{provision-BhCtm3md.js.map → provision-qNJgF5XD.js.map} +1 -1
  75. package/dist/{self-invocation-DAB_od0C.js → self-invocation-BJWbA8ka.js} +2 -2
  76. package/dist/{self-invocation-DAB_od0C.js.map → self-invocation-BJWbA8ka.js.map} +1 -1
  77. package/dist/{serve-Blj_dRSr.js → serve-T64kVeQN.js} +13 -12
  78. package/dist/{serve-Blj_dRSr.js.map → serve-T64kVeQN.js.map} +1 -1
  79. package/dist/{server-setup-DhG3YZPj.js → server-setup-C_LAE8NI.js} +222 -40
  80. package/dist/server-setup-C_LAE8NI.js.map +1 -0
  81. package/dist/{start-8QaqICtd.js → start-DHRToEyb.js} +3 -3
  82. package/dist/{start-8QaqICtd.js.map → start-DHRToEyb.js.map} +1 -1
  83. package/dist/state-B8adscCv.js +51 -0
  84. package/dist/state-B8adscCv.js.map +1 -0
  85. package/dist/{stop-gate-hook-DQnh_KfI.js → stop-gate-hook-CJOk28zd.js} +3 -3
  86. package/dist/{stop-gate-hook-DQnh_KfI.js.map → stop-gate-hook-CJOk28zd.js.map} +1 -1
  87. package/dist/{stop-gate-policy-DMr3KVmw.js → stop-gate-policy-zhzRIj6G.js} +2 -2
  88. package/dist/{stop-gate-policy-DMr3KVmw.js.map → stop-gate-policy-zhzRIj6G.js.map} +1 -1
  89. package/dist/{token-BtJhjXXu.js → token-CbuFyx-B.js} +4 -50
  90. package/dist/token-CbuFyx-B.js.map +1 -0
  91. package/dist/{worker-dispatch-BEHkTbnH.js → worker-dispatch-DgP5yT26.js} +2 -2
  92. package/dist/{worker-dispatch-BEHkTbnH.js.map → worker-dispatch-DgP5yT26.js.map} +1 -1
  93. package/package.json +1 -1
  94. package/dist/attribution-settings-B70GmZ68.js.map +0 -1
  95. package/dist/claude-DMMfvfns.js.map +0 -1
  96. package/dist/engine-BkGRuUNs.js +0 -2
  97. package/dist/fast-profile-contract-K3P58nj3.js.map +0 -1
  98. package/dist/internal-fast-dispatch-guard-Bkr_iGOu.js.map +0 -1
  99. package/dist/lifecycle-CGLt1cJQ.js +0 -2
  100. package/dist/lifecycle-DoUwpVDB.js +0 -2
  101. package/dist/paths-GD7bgGGy.js +0 -2
  102. package/dist/peer-mcp-personas-ce6_YMnX.js.map +0 -1
  103. package/dist/server-setup-DhG3YZPj.js.map +0 -1
  104. package/dist/token-BtJhjXXu.js.map +0 -1
@@ -1,5 +1,6 @@
1
- import { i as ensurePaths, t as PATHS } from "./paths-Ci485qSJ.js";
2
- import { A as state, r as setupGitHubToken } from "./token-BtJhjXXu.js";
1
+ import { i as ensurePaths, t as PATHS } from "./paths-IcZW8gZx.js";
2
+ import { t as state } from "./state-B8adscCv.js";
3
+ import { r as setupGitHubToken } from "./token-CbuFyx-B.js";
3
4
  import { defineCommand } from "citty";
4
5
  import consola from "consola";
5
6
  //#region src/auth.ts
@@ -41,4 +42,4 @@ const auth = defineCommand({
41
42
  //#endregion
42
43
  export { auth };
43
44
 
44
- //# sourceMappingURL=auth-CluG5e-l.js.map
45
+ //# sourceMappingURL=auth-CpjOjoUG.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-CluG5e-l.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-CpjOjoUG.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.297",
5
+ "version": "0.3.303",
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-Ci485qSJ.js";
2
- import { r as setupGitHubToken } from "./token-BtJhjXXu.js";
3
- import { t as getCopilotUsage } from "./get-copilot-usage-B7Z4XVWj.js";
1
+ import { i as ensurePaths } from "./paths-IcZW8gZx.js";
2
+ import { r as setupGitHubToken } from "./token-CbuFyx-B.js";
3
+ import { t as getCopilotUsage } from "./get-copilot-usage-ByjQqhdi.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-iOzfnKJe.js.map
43
+ //# sourceMappingURL=check-usage-BsN3S4Fu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-usage-iOzfnKJe.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-BsN3S4Fu.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,22 +1,25 @@
1
- import { $t as unregisterLaunch, At as standInToolEnabled, Bt as formatFastPrerequisiteFailure, Ct as implementerFastModel, Dt as reviewerModel, E as toolbeltEnabled, Et as reviewerFastModel, Ht as resolveLaunchProfile, Mn as pickClaudeDefault, Nn as resolveLeadSlugArg, Nt as LUNA_DRIVER_ALIAS_ID, Ot as scoutModel, Qt as registerLaunch, St as generalPurposeFastModel, T as buildToolbeltAwareness, Tt as resolveGeminiReviewModel, Vt as profileDescriptor, Wt as validateFastProfilePrerequisites, _t as fastPlannerModel, at as FAST_PLANNER_EFFORT, bt as fleetToolsEnabled, ct as agentToolsEnabled, dn as colbertDegradedWarning, dt as browseAgentEnabled, fn as provisionAndIndexColbert, ft as browserCompoundToolsEnabled, gt as fastOracleModel, hn as warmTreeSitterPool, ht as fastImplementerModel, it as FAST_IMPLEMENTER_EFFORT, jn as isBudgetClaudeLead, jt as workerToolsEnabled, kt as scribeModel, ln as provisionBrowserAssets, lt as artifactToolsEnabled, mt as fastCriticModel, o as buildPeerAwarenessSnippet, ot as FAST_REVIEWER_EFFORT, pt as browserToolsEnabled, r as agentNamesForToolAllowlist, rt as FAST_CRITIC_EFFORT, s as buildPeerAwarenessSummary, st as FAST_SCOUT_EFFORT, ut as brainstormModel, vt as fastReviewerModel, w as availableToolCommands, wn as DEFAULT_CLAUDE_MODEL_FALLBACKS, wt as nativeSubagentModel, xt as geminiAvailable, yn as shouldUseInsecureTls, yt as fastScoutModel } from "./peer-mcp-personas-ce6_YMnX.js";
2
- import { o as removeOwnClaudeConfigMirror, r as ensureClaudeConfigMirror, t as PATHS, u as writeArtifactCredsToMirror } from "./paths-Ci485qSJ.js";
3
- import { A as state, d as resolveModel } from "./token-BtJhjXXu.js";
1
+ import { $t as warmTreeSitterPool, Ct as reviewerFastModel, D as toolbeltEnabled, Dt as standInToolEnabled, E as buildToolbeltAwareness, Et as scribeModel, Hn as validateMaxProfileLaunch, It as registerLaunch, Lt as unregisterLaunch, Nn as formatFastPrerequisiteFailure, Ot as workerToolsEnabled, Rn as profileDescriptor, St as resolveGeminiReviewModel, T as availableToolCommands, Tn as LUNA_DRIVER_ALIAS_ID, Tt as scoutModel, Vn as validateFastProfilePrerequisites, Xt as provisionAndIndexColbert, Yt as colbertDegradedWarning, _n as resolveLeadSlugArg, _t as fleetToolsEnabled, at as artifactToolsEnabled, bt as implementerFastModel, cn as DEFAULT_CLAUDE_MODEL_FALLBACKS, ct as browserCompoundToolsEnabled, dt as fastGeneralPurposeModel, ft as fastImplementerModel, gn as pickClaudeDefault, gt as fastScoutModel, hn as isBudgetClaudeLead, ht as fastReviewerModel, it as agentToolsEnabled, lt as browserToolsEnabled, mt as fastPlanModel, o as buildPeerAwarenessSnippet, ot as brainstormModel, pt as fastOracleModel, qt as provisionBrowserAssets, r as agentNamesForToolAllowlist, rn as shouldUseInsecureTls, s as buildPeerAwarenessSummary, st as browseAgentEnabled, ut as fastAdvisorModel, vt as geminiAvailable, wt as reviewerModel, xt as nativeSubagentModel, yt as generalPurposeFastModel, zn as resolveLaunchProfile } from "./peer-mcp-personas-BU5dNLxQ.js";
2
+ import { o as removeOwnClaudeConfigMirror, r as ensureClaudeConfigMirror, t as PATHS, u as writeArtifactCredsToMirror } from "./paths-IcZW8gZx.js";
3
+ import { t as state } from "./state-B8adscCv.js";
4
+ import { d as resolveModel } from "./token-CbuFyx-B.js";
4
5
  import { r as parseBoolEnv } from "./exec-y8C_MU8A.js";
5
- import { a as sharedServerArgs, c as stopKeepAwake, d as runSelfUpdate, f as checkClaudeVersion, i as setupAndServe, l as listModelsForEndpoint, o as LAUNCH_SECRET_HEADER, p as updateClaude, r as parseSharedArgs, s as startKeepAwake, t as getClaudeCodeEnvVars, u as enableFileLogging } from "./server-setup-DhG3YZPj.js";
6
- import { t as FAST_PROFILE_ADVISOR_CLIENT_MODEL } from "./fast-profile-contract-K3P58nj3.js";
7
- import { n as hookLauncherDegradedWarning, r as resolveSelfInvocation } from "./self-invocation-DAB_od0C.js";
8
- import { i as launchChild, r as getCodexVersion, t as provisionToolbelt } from "./provision-BhCtm3md.js";
9
- 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-DQnh_KfI.js";
10
- import { t as liveExec } from "./orchestration-BiGCEwbH.js";
11
- import { c as repoRoot, d as trustRepo, l as stopGateEnabledForRepo, s as repoFingerprint, t as fileBaselineStore } from "./stop-gate-policy-DMr3KVmw.js";
12
- import { l as guardToolMatcher, n as activeDispatchModes, r as buildWorkerGuardHookCommand } from "./worker-dispatch-BEHkTbnH.js";
13
- import { _ as injectPeerMcpIntoMirror, a as appendPeerAwarenessToMirroredClaudeMd, b as workersKeyOf, c as prependArtifactPanelDirectiveToMirroredClaudeMd, i as OPERATING_DEFAULTS_DIGEST, l as prependOperatingDefaultsToMirroredClaudeMd, m as planModeAllowRules, n as INJECTED_SKILLS, o as appendToolbeltAwarenessToMirroredClaudeMd, p as injectAllowRules, r as writeInjectedSkill, s as buildOperatingDefaultsDirective, t as injectAttributionSuppressionIntoSettingsFile, u as prependStyleDirectiveToMirroredClaudeMd, v as resolveCodexCliBackend, x as writePeerMcpRuntimeFiles, y as resolveGroupKeysFromMirror } from "./attribution-settings-B70GmZ68.js";
6
+ import { a as sharedServerArgs, c as stopKeepAwake, d as runSelfUpdate, f as checkClaudeVersion, i as setupAndServe, l as listModelsForEndpoint, o as LAUNCH_SECRET_HEADER, p as updateClaude, r as parseSharedArgs, s as startKeepAwake, t as getClaudeCodeEnvVars, u as enableFileLogging } from "./server-setup-C_LAE8NI.js";
7
+ import { t as FAST_PROFILE_ADVISOR_CLIENT_MODEL } from "./fast-profile-contract-B6xn-Rzo.js";
8
+ import { c as formatMaxPrerequisiteFailure, f as maxGeminiModel, g as maxReviewerModel, i as MAX_PROFILE_MODELS, m as maxOpusModel, p as maxGrokModel } from "./max-profile-contract-Ct62mtAR.js";
9
+ import { n as hookLauncherDegradedWarning, r as resolveSelfInvocation } from "./self-invocation-BJWbA8ka.js";
10
+ import { i as launchChild, r as getCodexVersion, t as provisionToolbelt } from "./provision-qNJgF5XD.js";
11
+ 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-CJOk28zd.js";
12
+ import { t as liveExec } from "./orchestration-CYyp9w-t.js";
13
+ import { c as repoRoot, d as trustRepo, l as stopGateEnabledForRepo, s as repoFingerprint, t as fileBaselineStore } from "./stop-gate-policy-zhzRIj6G.js";
14
+ import { l as guardToolMatcher, n as activeDispatchModes, r as buildWorkerGuardHookCommand } from "./worker-dispatch-DgP5yT26.js";
15
+ 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-dta8MTnd.js";
14
16
  import { r as hookMcpRuntimeFromEnv } from "./hook-mcp-client-DBvm9608.js";
15
- import { i as planReviewEnabled, t as buildPlanReviewHookCommand } from "./plan-review-hook-DuW0pSoM.js";
16
- 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-G6PAG61j.js";
17
- import { t as buildPromptSubmitHookCommand } from "./prompt-submit-hook-IMl7ssfr.js";
18
- import { i as assertShapingInstalled, n as buildFirstMateGuardHookCommand, t as FIRST_MATE_GUARD_MATCHER } from "./internal-first-mate-guard-C9BV7J4U.js";
19
- import { r as FAST_DISPATCH_TOOL_MATCHER, t as buildFastDispatchGuardHookCommand } from "./internal-fast-dispatch-guard-Bkr_iGOu.js";
17
+ import { i as planReviewEnabled, t as buildPlanReviewHookCommand } from "./plan-review-hook-szSNt6uU.js";
18
+ 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-DOIm3XHF.js";
19
+ import { t as buildPromptSubmitHookCommand } from "./prompt-submit-hook-ZUxo_jEl.js";
20
+ import { i as assertShapingInstalled, n as buildFirstMateGuardHookCommand, t as FIRST_MATE_GUARD_MATCHER } from "./internal-first-mate-guard-Bcb5JwiO.js";
21
+ import { r as FAST_DISPATCH_TOOL_MATCHER, t as buildFastDispatchGuardHookCommand } from "./internal-fast-dispatch-guard-BhpZ6LvO.js";
22
+ import { i as assertMaxDispatchGuardInstalled, r as MAX_DISPATCH_TOOL_MATCHER, t as buildMaxDispatchGuardHookCommand } from "./internal-max-dispatch-guard-DhAr8N_o.js";
20
23
  import { defineCommand } from "citty";
21
24
  import consola from "consola";
22
25
  import path from "node:path";
@@ -37,79 +40,6 @@ function assertFastDispatchGuardInstalled(fastProfile, installationSucceeded) {
37
40
  }
38
41
  /** This module is intentionally stateless; callers own launch cleanup. */
39
42
  //#endregion
40
- //#region src/lib/injected-skills/artifact-review-skill.ts
41
- const ARTIFACT_REVIEW_SKILL = {
42
- name: "gh-artifact-review",
43
- md: `---
44
- name: gh-artifact-review
45
- description: Reviews plans and artifacts in the ai-or-die panel. Defaults to authoring a self-contained HTML artifact (rich, annotatable, optionally interactive) and opening THAT for the human, then drains feedback with artifact_await, revises, and ends the loop. Use when running inside an ai-or-die tab and there is a plan, comparison, diagram, table, diff, or report the user should see before proceeding.
46
- user-invocable: true
47
- ---
48
-
49
- # gh-artifact-review: human review in the ai-or-die panel
50
-
51
- Use this when you finish a plan or produce something a user should review and you are inside an ai-or-die tab (the \`mcp__peers__artifact_*\` tools drive a live panel). The human can click any block or select text to attach a comment, and can click declarative action controls you emit — both come back to you as typed events.
52
-
53
- ## Default: present HTML, not raw markdown
54
-
55
- HTML is the canonical review artifact — it renders richly and is annotatable element-by-element. When the content is anything visual or structured (a comparison, table, diagram, diff, dashboard, or a plan you want to look polished), **author a self-contained \`.html\` file** (inline CSS, no external deps, readable typography) and open THAT.
56
-
57
- - Plan-mode plans: the panel auto-opens them already rendered to HTML — you do not need to convert them by hand.
58
- - Do not paste raw markdown into an \`.html\`; write real HTML (headings, lists, tables, \`<pre>\` for code). Opening a raw \`.md\` still renders, but a purpose-built HTML artifact reads better and annotates cleanly.
59
-
60
- ## When to reach for an artifact
61
-
62
- Default to one for anything easier to grasp visually than as terminal prose: plans, design proposals, comparisons / trade-offs, decisions that need the user's input, diagrams / architecture, tables, code diffs, reports. Skip it only for trivial one-line answers.
63
-
64
- ## Playbooks (what a good artifact of each type contains)
65
-
66
- - **plan**: goal, current state, the proposed approach (high-level decisions, not every line), then risks and open questions at the end.
67
- - **comparison**: options as columns, trade-offs as rows, current-vs-target where relevant, and an explicit recommendation. Do not make the reader infer the winner.
68
- - **table**: scannable rows, a sticky header, aligned numeric columns; group/section dense records rather than one flat wall.
69
- - **diagram**: boxes + arrows. Mermaid when automatic layout matters; positioned SVG/CSS when each node needs prose, code, or controls.
70
- - **code / diff**: \`<pre>\` with before/after or unified-diff styling; keep line context tight; call out the changed lines.
71
- - **report / dashboard**: lead with the headline number / verdict, then supporting detail; keep one idea per section.
72
-
73
- ## Design system
74
-
75
- Artifacts stay portable (they must render identically opened standalone), so do not depend on a server-injected theme. Pick the look in priority order: (1) a look the user named; (2) the **subject project's** own design system, its Tailwind / theme config, CSS variables / tokens, component library, or existing styled pages, especially when the artifact previews that app's UI; (3) only when both come up empty, clean readable defaults (system font stack, generous spacing, a single accent).
76
-
77
- ## Loop
78
-
79
- 1. Open: \`mcp__peers__artifact_open\` with the absolute path of the \`.html\` (or the file). Pass \`mode:"interactive"\` when the HTML carries \`data-aod-*\` action controls (below). Relay the returned \`viewUrl\` and tell the user to review in the panel.
80
- 2. Drain: \`mcp__peers__artifact_await\`. It long-holds for the human's next events and returns \`{events, status, cursor}\`. **Pass the returned \`cursor\` on your next call** so you only receive newer events; if \`events\` is empty, call again with that cursor.
81
- 3. Act on each event by \`kind\`:
82
- - \`comment\` — a free-text note anchored to the artifact (\`selector\`, quoted \`text\`, \`sourceLine\`); apply the requested change at that exact spot.
83
- - \`action\` — the human clicked a control you emitted (\`action\` verb, \`elementId\`, optional \`value\`; a multi-select submit arrives as one action carrying the selected set). Do what the verb means (approve a step, choose an option, apply a toggle set).
84
- 4. Reply: \`mcp__peers__artifact_reply\` with a concise summary of what you changed. Optionally \`mcp__peers__artifact_update({file})\` or \`({html})\` to replace the artifact content in place, or \`mcp__peers__artifact_refresh\` to reload it from disk.
85
- 5. Repeat 2-4 until the user is satisfied; then \`mcp__peers__artifact_end\`. Use \`mcp__peers__artifact_dismiss\` to hide the panel while keeping the review alive (queued feedback preserved) if the user wants it out of the way without ending.
86
-
87
- ### Push arrival (you do not have to be polling)
88
-
89
- When you are idle at the prompt, panel feedback can arrive on its own as a new turn (the tab injects it). Structured actions that answer a pending decision are routed to you directly. Either way, the durable record is the \`artifact_await\` drain, so when in doubt call \`artifact_await\` (with your last cursor) to reconcile — it replays anything you missed.
90
-
91
- ### \`artifact_poll\` (frozen legacy)
92
-
93
- \`mcp__peers__artifact_poll\` still resolves for back-compat but returns the OLD payload (human comments only, no structured actions). Prefer \`artifact_await\`.
94
-
95
- ## Interactive controls (data-aod-* authoring)
96
-
97
- To let the human act on the artifact (not just comment), emit declarative controls; the panel wires them and delivers a typed \`action\` event. No JS in the artifact.
98
-
99
- - **choose-one (fires immediately):** each option is a button that posts the moment it is clicked.
100
- \`<button data-aod-action="choose" data-aod-group="decision-1" data-aod-id="opt-jwt" data-aod-value="jwt">JWT</button>\`
101
- - **multi-select (toggle then submit):** checkboxes sharing a \`data-aod-group\`, plus one submit button with the same group. The submit delivers ONE action carrying \`{group, selected:[{elementId, value?}]}\`.
102
- \`<input type="checkbox" data-aod-action="check" data-aod-group="opts" data-aod-id="a" data-aod-value="a">\` … \`<button data-aod-action="submit" data-aod-group="opts" data-aod-id="opts-submit">Apply</button>\`
103
- - **plan steps:** \`<li class="aod-step" data-aod-id="plan-step-3" data-source-line="14">\` with per-step \`data-aod-action="approve"/"skip"\` buttons.
104
- - **Required attrs:** \`data-aod-action\` (verb), \`data-aod-id\` (stable, echoed back as \`elementId\`; a control missing it is ignored), optional \`data-aod-value\`. Keep \`data-source-line\` for comment mapping.
105
-
106
- ## Honest limits
107
-
108
- - If a tool errors (e.g. \`NOT_IN_AIORDIE_TAB\`, \`UNREACHABLE\`, \`INVALID_REQUEST\`), report the code/message verbatim; do not claim the panel opened.
109
- - The panel is a review surface, not an approver: outward/irreversible actions still need explicit user confirmation.
110
- `
111
- };
112
- //#endregion
113
43
  //#region src/lib/fast-launch-cleanup.ts
114
44
  function createFastLaunchCleanup(deps) {
115
45
  let cleanupPromise;
@@ -184,9 +114,6 @@ function withFixedFastAdvisorArg(args, enabled = fastAdvisorClientEnabled()) {
184
114
  }
185
115
  //#endregion
186
116
  //#region src/claude.ts
187
- function isFirstMateSkillName(name) {
188
- return name === "gh-first-mate" || name === "gh-first-mate-scaffold" || name === "gh-first-mate-operate" || name === "gh-first-mate-conduct";
189
- }
190
117
  const claudeArgs = {
191
118
  ...sharedServerArgs,
192
119
  model: {
@@ -305,8 +232,13 @@ const claude = defineCommand({
305
232
  const parsed = parseSharedArgs(args);
306
233
  const requestedLaunchProfileId = resolveLaunchProfile(args.model);
307
234
  const codexMcpEnabled = args["codex-mcp"] !== false;
308
- if (requestedLaunchProfileId === "fast" && !codexMcpEnabled) {
309
- process$1.stderr.write(`github-router claude -m fast requires codex MCP wiring for its native roster and dispatch ACL; remove --no-codex-mcp or choose a standard model.\n`);
235
+ if (requestedLaunchProfileId === "max" && args["codex-cli"]) {
236
+ process$1.stderr.write(`Max profile uses its fixed HTTP MCP surface; --codex-cli is not supported in max profile.\n`);
237
+ process$1.exit(1);
238
+ }
239
+ if ((requestedLaunchProfileId === "fast" || requestedLaunchProfileId === "max") && !codexMcpEnabled) {
240
+ const message = `github-router claude -m ${requestedLaunchProfileId === "fast" ? "fast" : "max"} requires codex MCP wiring for its native roster and dispatch ACL; remove --no-codex-mcp or choose a standard model.`;
241
+ process$1.stderr.write(`${message}\n`);
310
242
  process$1.exit(1);
311
243
  }
312
244
  if (args.stealth) {
@@ -388,6 +320,9 @@ const claude = defineCommand({
388
320
  if (launchProfileId === "fast") {
389
321
  const prereqCheck = validateFastProfilePrerequisites(state.models);
390
322
  if (!prereqCheck.ok) await fastFatal(formatFastPrerequisiteFailure(prereqCheck.missing));
323
+ } else if (launchProfileId === "max") {
324
+ const prereqCheck = validateMaxProfileLaunch(state.models);
325
+ if (!prereqCheck.ok) await fastFatal(formatMaxPrerequisiteFailure(prereqCheck.missing));
391
326
  }
392
327
  let chosenSlug = launchProfileId === "fast" ? requestedSlug.endsWith("[1m]") ? `${LUNA_DRIVER_ALIAS_ID}[1m]` : LUNA_DRIVER_ALIAS_ID : requestedSlug;
393
328
  let resolvedSlug = launchProfileId === "fast" ? resolveModel(requestedSlug) : resolveModel(chosenSlug);
@@ -436,13 +371,25 @@ const claude = defineCommand({
436
371
  let onShutdown = baseShutdown;
437
372
  let peerAwarenessSnippet;
438
373
  let peerAwarenessSummary;
374
+ let operatingGroupKeys = {};
439
375
  let fastWiringComplete = launchProfileId !== "fast";
376
+ const browseAgentAvailable = browseAgentEnabled();
377
+ const directBrowserAvailable = browserToolsEnabled();
378
+ const artifactAvailable = artifactToolsEnabled();
379
+ const resolvedMaxReviewerModel = launchProfileId === "max" ? maxReviewerModel() : void 0;
440
380
  const nativeAgentModels = launchProfileId === "fast" ? {
441
381
  Explore: fastScoutModel(),
382
+ Plan: fastPlanModel(),
383
+ "general-purpose": fastGeneralPurposeModel(),
442
384
  implementer: fastImplementerModel(),
443
- reviewer: fastReviewerModel(),
444
- planner: fastPlannerModel(),
445
- critic: fastCriticModel()
385
+ reviewer: fastReviewerModel()
386
+ } : launchProfileId === "max" ? {
387
+ Explore: MAX_PROFILE_MODELS.luna,
388
+ Plan: MAX_PROFILE_MODELS.sol,
389
+ "general-purpose": MAX_PROFILE_MODELS.luna,
390
+ implementer: MAX_PROFILE_MODELS.gemini,
391
+ reviewer: resolvedMaxReviewerModel,
392
+ brainstorm: maxGrokModel() ?? maxGeminiModel() ?? MAX_PROFILE_MODELS.grok
446
393
  } : {
447
394
  implementer: nativeSubagentModel(),
448
395
  "implementer-fast": implementerFastModel(),
@@ -469,35 +416,41 @@ const claude = defineCommand({
469
416
  if (codexMcpEnabled) try {
470
417
  const requestedCli = args["codex-cli"] ?? false;
471
418
  const isFastProfile = launchProfileId === "fast";
419
+ const isMaxProfile = launchProfileId === "max";
472
420
  if (isFastProfile && requestedCli) process$1.stderr.write("Fast profile uses its fixed HTTP MCP surface; ignoring --codex-cli.\n");
473
- const backend = isFastProfile ? "http" : resolveCodexCliBackend({
421
+ const backend = isFastProfile || isMaxProfile ? "http" : resolveCodexCliBackend({
474
422
  requested: requestedCli,
475
423
  codexInfo: requestedCli ? getCodexVersion() : null
476
424
  });
477
- const geminiModelsAvailable = geminiAvailable();
478
- if (!geminiModelsAvailable) consola.info("gemini-3.1-pro-preview not found in your Copilot model catalog; gemini-critic persona will not be registered.");
425
+ const geminiModelsAvailable = isMaxProfile ? maxGeminiModel() !== void 0 : geminiAvailable();
426
+ if (!geminiModelsAvailable) consola.info(isMaxProfile ? "Neither Grok 4.6/high nor Gemini 3.7 Flash 1M/high is usable; max third-lab personas and stand_in will not be registered." : "gemini-3.1-pro-preview not found in your Copilot model catalog; gemini-critic persona will not be registered.");
479
427
  const fastDescriptor = profileDescriptor(launchProfileId);
480
- const baseGroups = [
428
+ const baseGroups = isFastProfile || isMaxProfile ? ["peers", "search"] : [
481
429
  "peers",
482
430
  "search",
483
431
  "orchestrate"
484
432
  ];
485
- if (workerToolsEnabled()) baseGroups.push("workers");
433
+ if (workerToolsEnabled() && !isFastProfile && !isMaxProfile) baseGroups.push("workers");
434
+ if ((isFastProfile || isMaxProfile) && browseAgentAvailable) baseGroups.push("workers");
486
435
  const enabledGroups = fastDescriptor.allowedGroups ? baseGroups.filter((g) => fastDescriptor.allowedGroups.has(g)) : baseGroups;
487
- if (!isFastProfile && standInToolEnabled()) enabledGroups.push("decide");
488
- if (browserToolsEnabled() && (!fastDescriptor.allowedGroups || fastDescriptor.allowedGroups.has("browser"))) enabledGroups.push("browser");
489
- if (!isFastProfile && fleetToolsEnabled()) enabledGroups.push("fleet");
490
- if (!isFastProfile && agentToolsEnabled()) enabledGroups.push("first-mate");
436
+ if (!isFastProfile && !isMaxProfile && standInToolEnabled()) enabledGroups.push("decide");
437
+ if (isMaxProfile && maxOpusModel() !== void 0 && standInToolEnabled({ maxProfile: true })) enabledGroups.push("decide");
438
+ if (directBrowserAvailable && (!fastDescriptor.allowedGroups || fastDescriptor.allowedGroups.has("browser"))) enabledGroups.push("browser");
439
+ if (!isFastProfile && !isMaxProfile && fleetToolsEnabled()) enabledGroups.push("fleet");
440
+ if (!isFastProfile && !isMaxProfile && agentToolsEnabled()) enabledGroups.push("first-mate");
441
+ if (isMaxProfile && fleetToolsEnabled()) enabledGroups.push("fleet");
442
+ if (isMaxProfile && agentToolsEnabled()) enabledGroups.push("first-mate");
491
443
  const { keys: groupKeys, skipped: skippedGroups } = await resolveGroupKeysFromMirror(enabledGroups);
492
- if (isFastProfile && (fastOracleModel() == null || fastCriticModel() == null)) throw new Error("fast profile prerequisite drift: exact Oracle or critic model no longer resolves");
444
+ operatingGroupKeys = groupKeys;
445
+ if (isFastProfile && (fastOracleModel() == null || fastAdvisorModel() == null || nativeAgentModels.implementer == null)) throw new Error("fast profile prerequisite drift: exact Oracle, Advisor, or implementer model no longer resolves");
493
446
  const runtime = await writePeerMcpRuntimeFiles(serverUrl, {
494
447
  codexCli: backend === "cli",
495
448
  selfInvocation,
496
449
  geminiAvailable: geminiModelsAvailable,
497
- geminiModel: resolveGeminiReviewModel(),
450
+ geminiModel: isMaxProfile ? maxGeminiModel() : resolveGeminiReviewModel(),
498
451
  groupKeys,
499
- workerToolsAvailable: !isFastProfile && workerToolsEnabled(),
500
- browseAvailable: !isFastProfile && browseAgentEnabled(),
452
+ workerToolsAvailable: !isFastProfile && !isMaxProfile && workerToolsEnabled(),
453
+ browseAvailable: browseAgentAvailable,
501
454
  nativeSubagentModel: nativeAgentModels.implementer,
502
455
  reviewerModel: nativeAgentModels.reviewer,
503
456
  reviewerFastModel: nativeAgentModels["reviewer-fast"],
@@ -511,16 +464,34 @@ const claude = defineCommand({
511
464
  includeCoordinator: fastDescriptor.hasCoordinator,
512
465
  ...isFastProfile ? {
513
466
  fastProfile: true,
514
- plannerModel: nativeAgentModels.planner,
515
- criticModel: nativeAgentModels.critic,
516
- scoutEffort: FAST_SCOUT_EFFORT,
517
- implementerEffort: FAST_IMPLEMENTER_EFFORT,
518
- reviewerEffort: FAST_REVIEWER_EFFORT,
519
- plannerEffort: FAST_PLANNER_EFFORT,
520
- criticEffort: FAST_CRITIC_EFFORT
467
+ fastExploreModel: nativeAgentModels.Explore,
468
+ fastPlanModel: nativeAgentModels.Plan,
469
+ fastGeneralPurposeModel: nativeAgentModels["general-purpose"],
470
+ fastImplementerModel: nativeAgentModels.implementer,
471
+ fastReviewerModel: nativeAgentModels.reviewer
472
+ } : isMaxProfile ? {
473
+ maxProfile: true,
474
+ workerToolsAvailable: false,
475
+ browseAvailable: browseAgentAvailable,
476
+ maxExploreModel: MAX_PROFILE_MODELS.luna,
477
+ maxPlanModel: MAX_PROFILE_MODELS.sol,
478
+ maxGeneralPurposeModel: MAX_PROFILE_MODELS.luna,
479
+ maxImplementerModel: MAX_PROFILE_MODELS.gemini,
480
+ maxReviewerModel: resolvedMaxReviewerModel,
481
+ maxReviewerEffort: resolvedMaxReviewerModel === MAX_PROFILE_MODELS.luna ? "max" : "high",
482
+ maxBrainstormModel: maxGrokModel() ?? maxGeminiModel() ?? MAX_PROFILE_MODELS.grok,
483
+ maxGeminiModel: maxGeminiModel(),
484
+ maxGrokModel: maxGrokModel(),
485
+ maxPeerModels: {
486
+ sol: MAX_PROFILE_MODELS.sol,
487
+ luna: MAX_PROFILE_MODELS.luna,
488
+ opus: maxOpusModel(),
489
+ gemini: maxGeminiModel(),
490
+ grok: maxGrokModel()
491
+ }
521
492
  } : {}
522
493
  });
523
- if (isFastProfile) fastRuntimeCleanup = runtime.cleanup;
494
+ if (isFastProfile || isMaxProfile) fastRuntimeCleanup = runtime.cleanup;
524
495
  const launchSecret = randomBytes(32).toString("hex");
525
496
  const launchEntry = registerLaunch({
526
497
  profileId: launchProfileId,
@@ -529,11 +500,11 @@ const claude = defineCommand({
529
500
  allowedGroups: fastDescriptor.allowedGroups,
530
501
  allowedPersonas: fastDescriptor.personaAllowlist
531
502
  });
532
- if (isFastProfile) fastLaunchId = launchEntry.launchId;
503
+ if (isFastProfile || isMaxProfile) fastLaunchId = launchEntry.launchId;
533
504
  envVars.ANTHROPIC_CUSTOM_HEADERS = envVars.ANTHROPIC_CUSTOM_HEADERS ? `${envVars.ANTHROPIC_CUSTOM_HEADERS}\n${LAUNCH_SECRET_HEADER}: ${launchSecret}` : `${LAUNCH_SECRET_HEADER}: ${launchSecret}`;
534
505
  envVars.GH_ROUTER_HOOK_MCP_URL = serverUrl;
535
506
  envVars.GH_ROUTER_HOOK_NONCE = runtime.nonce;
536
- onShutdown = isFastProfile ? async () => {
507
+ onShutdown = isFastProfile || isMaxProfile ? async () => {
537
508
  try {
538
509
  unregisterLaunch(launchEntry.launchId);
539
510
  } finally {
@@ -573,7 +544,10 @@ const claude = defineCommand({
573
544
  let fastGuardInstalled = false;
574
545
  try {
575
546
  const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
576
- const guardCommand = buildFastDispatchGuardHookCommand(selfInvocation);
547
+ const guardCommand = buildFastDispatchGuardHookCommand(selfInvocation, {
548
+ allowBrowse: browseAgentAvailable,
549
+ allowedTargets: [...fastDescriptor.nativeRoster ?? [], ...browseAgentAvailable ? ["worker-browse"] : []]
550
+ });
577
551
  await injectStopHookIntoSettingsFile(settingsPath, guardCommand, "PreToolUse", 10, FAST_DISPATCH_TOOL_MATCHER);
578
552
  fastGuardInstalled = true;
579
553
  } catch (err) {
@@ -581,24 +555,40 @@ const claude = defineCommand({
581
555
  }
582
556
  assertFastDispatchGuardInstalled(true, fastGuardInstalled);
583
557
  fastWiringComplete = true;
558
+ } else if (isMaxProfile) {
559
+ let maxGuardInstalled = false;
560
+ try {
561
+ const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
562
+ const guardCommand = buildMaxDispatchGuardHookCommand(selfInvocation, {
563
+ reviewerModel: resolvedMaxReviewerModel,
564
+ reviewerEffort: resolvedMaxReviewerModel === MAX_PROFILE_MODELS.luna ? "max" : "high"
565
+ });
566
+ await injectStopHookIntoSettingsFile(settingsPath, guardCommand, "PreToolUse", 10, MAX_DISPATCH_TOOL_MATCHER);
567
+ maxGuardInstalled = true;
568
+ } catch (err) {
569
+ consola.error(`Could not register the max native dispatch ACL hook: ${String(err)}`);
570
+ }
571
+ assertMaxDispatchGuardInstalled(true, maxGuardInstalled);
572
+ fastWiringComplete = true;
584
573
  }
585
574
  const personaNames = runtime.personas.map((p) => p.agentName).join(", ");
586
575
  const skippedNote = skippedGroups.length > 0 ? ` WARNING: groups [${skippedGroups.join(", ")}] skipped — both the bare and \`gh-router-<group>\` keys collide with your own mcpServers; those tools are unavailable this session (rename the user-side server to re-enable).` : "";
587
576
  process$1.stderr.write(`Peer MCP wired (backend=${backend}, personas=[${personaNames}], subagent .md files=${runtime.agentMdPaths.length}, ${subagentVisibility}).${skippedNote}\n`);
588
577
  const sessionCwd = process$1.cwd();
589
- const workerSkillsActive = workerToolsEnabled() && !isFastProfile;
578
+ const workerSkillsActive = workerToolsEnabled() && launchProfileId === "standard";
579
+ const skillsToWrite = injectedSkillsForLaunch({
580
+ profileId: launchProfileId,
581
+ workerSkillsActive,
582
+ firstMateEnabled: agentToolsEnabled()
583
+ });
590
584
  let skillsWritten = 0;
591
- let skillsToWrite = [];
592
- if (workerSkillsActive) {
593
- skillsToWrite = INJECTED_SKILLS.filter((s) => !isFirstMateSkillName(s.name) || agentToolsEnabled());
594
- for (const s of skillsToWrite) if ((await writeInjectedSkill(s.name, s.md).catch(() => ({ written: false }))).written) skillsWritten++;
595
- try {
596
- const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
597
- const cmd = buildPromptSubmitHookCommand(selfInvocation);
598
- await injectStopHookIntoSettingsFile(settingsPath, cmd, "UserPromptSubmit", 45);
599
- } catch (err) {
600
- consola.warn(`Could not register the UserPromptSubmit hook: ${String(err)}`);
601
- }
585
+ for (const s of skillsToWrite) if ((await writeInjectedSkill(s.name, s.md).catch(() => ({ written: false }))).written) skillsWritten++;
586
+ if (workerSkillsActive) try {
587
+ const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
588
+ const cmd = buildPromptSubmitHookCommand(selfInvocation);
589
+ await injectStopHookIntoSettingsFile(settingsPath, cmd, "UserPromptSubmit", 45);
590
+ } catch (err) {
591
+ consola.warn(`Could not register the UserPromptSubmit hook: ${String(err)}`);
602
592
  }
603
593
  try {
604
594
  const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
@@ -608,23 +598,21 @@ const claude = defineCommand({
608
598
  } catch (err) {
609
599
  consola.warn(`Could not auto-approve injected tools: ${String(err)}`);
610
600
  }
611
- if (workerSkillsActive) {
612
- if (!injected?.ok) consola.warn("Workers non-blocking guard NOT registered: subagent MCP injection fell back to parent-only (--mcp-config), so worker-* dispatchers cannot reach the workers server. Raw (blocking) worker tools remain usable on the main thread this session.");
613
- else if (process$1.env.GH_ROUTER_DISABLE_WORKER_GUARD === "1") consola.info("Workers non-blocking guard disabled via GH_ROUTER_DISABLE_WORKER_GUARD=1 — raw mcp__workers__* is callable on the main thread (blocking); the worker-* background agents remain the steered, non-blocking default.");
614
- else try {
615
- const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
616
- const workersKey = workersKeyOf(groupKeys);
617
- const modes = activeDispatchModes({ browse: browseAgentEnabled() });
618
- const cmd = buildWorkerGuardHookCommand(selfInvocation, workersKey, modes);
619
- const matcher = guardToolMatcher(workersKey, modes);
620
- await injectStopHookIntoSettingsFile(settingsPath, cmd, "PreToolUse", 10, matcher);
621
- } catch (err) {
622
- consola.warn(`Could not register the workers PreToolUse guard hook: ${String(err)}`);
623
- }
624
- if (skillsWritten > 0) {
625
- const skillNames = skillsToWrite.map((s) => `/${s.name}`).join(", ");
626
- process$1.stderr.write(`Injected skills (${skillsWritten}/${skillsToWrite.length}): ${skillNames}.\n`);
627
- }
601
+ if (workerSkillsActive || (isFastProfile || isMaxProfile) && browseAgentAvailable) if (!(isFastProfile || injected?.ok === true)) consola.warn("Workers non-blocking guard NOT registered: subagent MCP injection fell back to parent-only (--mcp-config), so worker-* dispatchers cannot reach the workers server. Raw (blocking) worker tools remain usable on the main thread this session.");
602
+ else if (process$1.env.GH_ROUTER_DISABLE_WORKER_GUARD === "1") consola.info("Workers non-blocking guard disabled via GH_ROUTER_DISABLE_WORKER_GUARD=1 raw mcp__workers__* is callable on the main thread (blocking); the worker-* background agents remain the steered, non-blocking default.");
603
+ else try {
604
+ const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
605
+ const workersKey = workersKeyOf(groupKeys);
606
+ const modes = isFastProfile || isMaxProfile ? ["browse"] : activeDispatchModes({ browse: browseAgentAvailable });
607
+ const cmd = buildWorkerGuardHookCommand(selfInvocation, workersKey, modes);
608
+ const matcher = guardToolMatcher(workersKey, modes);
609
+ await injectStopHookIntoSettingsFile(settingsPath, cmd, "PreToolUse", 10, matcher);
610
+ } catch (err) {
611
+ consola.warn(`Could not register the workers PreToolUse guard hook: ${String(err)}`);
612
+ }
613
+ if (skillsWritten > 0) {
614
+ const skillNames = skillsToWrite.map((s) => `/${s.name}`).join(", ");
615
+ process$1.stderr.write(`Injected skills (${skillsWritten}/${skillsToWrite.length}): ${skillNames}.\n`);
628
616
  }
629
617
  if (agentToolsEnabled()) {
630
618
  let shapingInstalled = false;
@@ -648,14 +636,15 @@ const claude = defineCommand({
648
636
  } catch (err) {
649
637
  consola.warn(`Could not register the ai-or-die session-bind hook: ${String(err)}`);
650
638
  }
651
- if (artifactToolsEnabled()) {
652
- await writeInjectedSkill(ARTIFACT_REVIEW_SKILL.name, ARTIFACT_REVIEW_SKILL.md).catch(() => ({ written: false }));
639
+ if (artifactAvailable) {
640
+ const artifactReviewSkill = buildArtifactReviewSkill(groupKeys.peers);
641
+ await writeInjectedSkill(artifactReviewSkill.name, artifactReviewSkill.md).catch(() => ({ written: false }));
653
642
  try {
654
643
  await prependArtifactPanelDirectiveToMirroredClaudeMd(groupKeys.peers);
655
644
  } catch (err) {
656
645
  consola.warn(`Artifact-panel directive prepend failed: ${String(err)}`);
657
646
  }
658
- if (!isFastProfile) try {
647
+ try {
659
648
  await writeArtifactCredsToMirror(shouldUseInsecureTls(process$1.env.AIORDIE_BASE_URL ?? ""));
660
649
  const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
661
650
  const cmd = buildArtifactOpenHookCommand(selfInvocation);
@@ -671,13 +660,13 @@ const claude = defineCommand({
671
660
  } catch (err) {
672
661
  consola.warn(`Could not register the advisory plan-review hook: ${String(err)}`);
673
662
  }
674
- if (!isFastProfile && args["trust-gate"] === true) try {
663
+ if (!isFastProfile && !isMaxProfile && args["trust-gate"] === true) try {
675
664
  const root = await trustRepo(sessionCwd);
676
665
  process$1.stderr.write(`Structural gate trusted for this repo (${root}); it will run on launch here from now on.\n`);
677
666
  } catch (err) {
678
667
  consola.warn(`Could not record gate trust: ${String(err)}`);
679
668
  }
680
- const gateDisabled = isFastProfile || stopGateDisabled(args);
669
+ const gateDisabled = isFastProfile || isMaxProfile || stopGateDisabled(args);
681
670
  const forceEnabled = parseBoolEnv(process$1.env.GH_ROUTER_ENABLE_STOP_GATE) === true;
682
671
  const includeTests = parseBoolEnv(process$1.env.GH_ROUTER_STOP_GATE_RUN_TESTS) === true;
683
672
  const gateRoot = await repoRoot(sessionCwd).catch(() => sessionCwd);
@@ -775,25 +764,29 @@ const claude = defineCommand({
775
764
  const peerSnippet = buildPeerAwarenessSnippet({
776
765
  codexCli: backend === "cli",
777
766
  geminiAvailable: geminiModelsAvailable,
778
- geminiModel: resolveGeminiReviewModel(),
779
- workerToolsAvailable: workerToolsEnabled(),
780
- standInAvailable: standInToolEnabled(),
781
- browseAvailable: browserToolsEnabled(),
782
- compoundBrowseAvailable: browserCompoundToolsEnabled(),
783
- powerBrowseAvailable: state.powerBrowseEnabled,
767
+ geminiModel: isMaxProfile ? maxGeminiModel() : resolveGeminiReviewModel(),
768
+ workerToolsAvailable: isMaxProfile ? false : workerToolsEnabled(),
769
+ standInAvailable: isMaxProfile ? maxOpusModel() !== void 0 && standInToolEnabled({ maxProfile: true }) : standInToolEnabled(),
770
+ browseAvailable: browseAgentAvailable,
771
+ browserToolsAvailable: directBrowserAvailable,
772
+ compoundBrowseAvailable: isMaxProfile ? false : browserCompoundToolsEnabled(),
773
+ powerBrowseAvailable: isMaxProfile ? false : state.powerBrowseEnabled,
784
774
  fleetAvailable: fleetToolsEnabled(),
785
775
  agentToolsAvailable: agentToolsEnabled(),
776
+ artifactToolsAvailable: artifactAvailable,
786
777
  ...nativeAvailability,
787
778
  profile: launchProfileId,
788
779
  groupKeys
789
780
  });
790
781
  peerAwarenessSnippet = peerSnippet;
791
782
  peerAwarenessSummary = buildPeerAwarenessSummary({
792
- workerToolsAvailable: workerToolsEnabled(),
793
- standInAvailable: standInToolEnabled(),
794
- browseAvailable: browserToolsEnabled(),
783
+ workerToolsAvailable: isMaxProfile ? false : workerToolsEnabled(),
784
+ standInAvailable: isMaxProfile ? maxOpusModel() !== void 0 && standInToolEnabled({ maxProfile: true }) : standInToolEnabled(),
785
+ browseAvailable: browseAgentAvailable,
786
+ browserToolsAvailable: directBrowserAvailable,
795
787
  fleetAvailable: fleetToolsEnabled(),
796
788
  agentToolsAvailable: agentToolsEnabled(),
789
+ artifactToolsAvailable: artifactAvailable,
797
790
  ...nativeAvailability,
798
791
  profile: launchProfileId,
799
792
  nativeAgentModels,
@@ -810,24 +803,30 @@ const claude = defineCommand({
810
803
  consola.warn(`Style-directive CLAUDE.md prepend failed: ${err instanceof Error ? err.message : String(err)}`);
811
804
  }
812
805
  } catch (err) {
813
- if (launchProfileId === "fast") {
806
+ if (launchProfileId === "fast" || launchProfileId === "max") {
814
807
  if (fastLaunchId) unregisterLaunch(fastLaunchId);
815
808
  await disposeFastRuntime().catch(() => {});
816
809
  await server.close(true).catch(() => {});
817
810
  await baseShutdown().catch(() => {});
818
811
  resetFastRuntimeOwnership();
819
- const message = `Fast profile wiring failed; refusing to launch an unguarded session: ${err instanceof Error ? err.message : String(err)}`;
812
+ const message = `${launchProfileId === "fast" ? "Fast" : "Max"} profile wiring failed; refusing to launch an unguarded session: ${err instanceof Error ? err.message : String(err)}`;
820
813
  consola.error(message);
821
814
  process$1.stderr.write(`${message}\n`);
822
815
  process$1.exit(1);
823
816
  }
824
817
  consola.warn(`Peer MCP wiring failed (claude will launch without it): ${err instanceof Error ? err.message : String(err)}`);
825
818
  }
826
- extraArgs.push("--append-system-prompt", peerAwarenessSnippet && peerAwarenessSummary ? `${OPERATING_DEFAULTS_DIGEST}\n\n${peerAwarenessSummary}` : OPERATING_DEFAULTS_DIGEST);
819
+ const operatingDefaultsDigest = buildOperatingDefaultsDigest({ profile: launchProfileId });
820
+ extraArgs.push("--append-system-prompt", peerAwarenessSnippet && peerAwarenessSummary ? `${operatingDefaultsDigest}\n\n${peerAwarenessSummary}` : operatingDefaultsDigest);
827
821
  try {
828
822
  await prependOperatingDefaultsToMirroredClaudeMd(buildOperatingDefaultsDirective({
829
823
  ...nativeAvailability,
830
- fastRuntimeAvailable: fastWiringComplete
824
+ fastRuntimeAvailable: fastWiringComplete,
825
+ browseAvailable: browseAgentAvailable,
826
+ browserToolsAvailable: directBrowserAvailable,
827
+ artifactAvailable,
828
+ groupKeys: operatingGroupKeys,
829
+ peersKey: operatingGroupKeys.peers
831
830
  }));
832
831
  } catch (err) {
833
832
  consola.warn(`Operating-defaults CLAUDE.md prepend failed: ${err instanceof Error ? err.message : String(err)}`);
@@ -849,4 +848,4 @@ const claude = defineCommand({
849
848
  //#endregion
850
849
  export { claude };
851
850
 
852
- //# sourceMappingURL=claude-DMMfvfns.js.map
851
+ //# sourceMappingURL=claude-kr-Augld.js.map