github-router 0.3.293 → 0.3.297
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{attribution-settings-Dx8TBPE8.js → attribution-settings-B70GmZ68.js} +72 -32
- package/dist/attribution-settings-B70GmZ68.js.map +1 -0
- package/dist/{auth-BwUHopJz.js → auth-CluG5e-l.js} +3 -3
- package/dist/{auth-BwUHopJz.js.map → auth-CluG5e-l.js.map} +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/{check-usage-BTda5753.js → check-usage-iOzfnKJe.js} +4 -4
- package/dist/{check-usage-BTda5753.js.map → check-usage-iOzfnKJe.js.map} +1 -1
- package/dist/{claude-BoAd_L2W.js → claude-DMMfvfns.js} +225 -61
- package/dist/claude-DMMfvfns.js.map +1 -0
- package/dist/{codex-BdJgGT6Q.js → codex-DVOyVv2B.js} +5 -5
- package/dist/{codex-BdJgGT6Q.js.map → codex-DVOyVv2B.js.map} +1 -1
- package/dist/{debug-B3UrZTHQ.js → debug-DsEwleGg.js} +2 -2
- package/dist/{debug-B3UrZTHQ.js.map → debug-DsEwleGg.js.map} +1 -1
- package/dist/engine-BkGRuUNs.js +2 -0
- package/dist/fast-profile-contract-K3P58nj3.js +57 -0
- package/dist/fast-profile-contract-K3P58nj3.js.map +1 -0
- package/dist/{gate-discovery-C30rfnyo.js → gate-discovery-G6PAG61j.js} +5 -5
- package/dist/{gate-discovery-C30rfnyo.js.map → gate-discovery-G6PAG61j.js.map} +1 -1
- package/dist/{get-copilot-usage-CRrf1ZSC.js → get-copilot-usage-B7Z4XVWj.js} +2 -2
- package/dist/{get-copilot-usage-CRrf1ZSC.js.map → get-copilot-usage-B7Z4XVWj.js.map} +1 -1
- package/dist/hooks.mjs +228 -3
- package/dist/hooks.sha256 +1 -1
- package/dist/{internal-artifact-open-BsEQRvDi.js → internal-artifact-open-D6tKMg8v.js} +2 -2
- package/dist/{internal-artifact-open-BsEQRvDi.js.map → internal-artifact-open-D6tKMg8v.js.map} +1 -1
- package/dist/internal-fast-dispatch-guard-Bkr_iGOu.js +191 -0
- package/dist/internal-fast-dispatch-guard-Bkr_iGOu.js.map +1 -0
- package/dist/internal-fast-dispatch-guard-N-RaLrOn.js +2 -0
- package/dist/{internal-first-mate-guard-CVFFJriA.js → internal-first-mate-guard-C9BV7J4U.js} +3 -3
- package/dist/{internal-first-mate-guard-CVFFJriA.js.map → internal-first-mate-guard-C9BV7J4U.js.map} +1 -1
- package/dist/{internal-first-mate-guard-DJdX6t48.js → internal-first-mate-guard-WJApyc8j.js} +1 -1
- package/dist/{internal-plan-review-8TKDLco6.js → internal-plan-review-t3PuNfuL.js} +3 -3
- package/dist/{internal-plan-review-8TKDLco6.js.map → internal-plan-review-t3PuNfuL.js.map} +1 -1
- package/dist/{internal-prompt-submit-Da7pxqua.js → internal-prompt-submit-C3KovHQG.js} +4 -4
- package/dist/{internal-prompt-submit-Da7pxqua.js.map → internal-prompt-submit-C3KovHQG.js.map} +1 -1
- package/dist/{internal-session-bind-BOFytA1f.js → internal-session-bind-d2uoja8I.js} +2 -2
- package/dist/{internal-session-bind-BOFytA1f.js.map → internal-session-bind-d2uoja8I.js.map} +1 -1
- package/dist/{internal-stop-hook-OnfK3BxE.js → internal-stop-hook-BjzrF1zd.js} +5 -5
- package/dist/{internal-stop-hook-OnfK3BxE.js.map → internal-stop-hook-BjzrF1zd.js.map} +1 -1
- package/dist/{internal-stop-review-CdouacHL.js → internal-stop-review-YtDUGXpX.js} +2 -2
- package/dist/{internal-stop-review-CdouacHL.js.map → internal-stop-review-YtDUGXpX.js.map} +1 -1
- package/dist/{internal-worker-guard-Bx-itoP8.js → internal-worker-guard-CdkeS9PN.js} +2 -2
- package/dist/{internal-worker-guard-Bx-itoP8.js.map → internal-worker-guard-CdkeS9PN.js.map} +1 -1
- package/dist/{internal-workspace-header-8WT0iB5K.js → internal-workspace-header-tuBXJV22.js} +2 -2
- package/dist/{internal-workspace-header-8WT0iB5K.js.map → internal-workspace-header-tuBXJV22.js.map} +1 -1
- package/dist/{lifecycle-nuOHfwgj.js → lifecycle-Bg6doY3-.js} +2 -2
- package/dist/{lifecycle-nuOHfwgj.js.map → lifecycle-Bg6doY3-.js.map} +1 -1
- package/dist/lifecycle-CGLt1cJQ.js +2 -0
- package/dist/{lifecycle-LeSfa7wH.js → lifecycle-CM9eTzvk.js} +2 -2
- package/dist/{lifecycle-LeSfa7wH.js.map → lifecycle-CM9eTzvk.js.map} +1 -1
- package/dist/lifecycle-DoUwpVDB.js +2 -0
- package/dist/main.js +19 -18
- package/dist/main.js.map +1 -1
- package/dist/{mcp-workspace-header-q34H_4wL.js → mcp-workspace-header-dERl2YTT.js} +2 -2
- package/dist/{mcp-workspace-header-q34H_4wL.js.map → mcp-workspace-header-dERl2YTT.js.map} +1 -1
- package/dist/{models-hhJcrZhr.js → models-DZ4hYsR7.js} +3 -3
- package/dist/{models-hhJcrZhr.js.map → models-DZ4hYsR7.js.map} +1 -1
- package/dist/{orchestration-pzbrKkgD.js → orchestration-BiGCEwbH.js} +2 -2
- package/dist/{orchestration-pzbrKkgD.js.map → orchestration-BiGCEwbH.js.map} +1 -1
- package/dist/{paths-BH4J7slC.js → paths-Ci485qSJ.js} +4 -4
- package/dist/{paths-BH4J7slC.js.map → paths-Ci485qSJ.js.map} +1 -1
- package/dist/paths-GD7bgGGy.js +2 -0
- package/dist/{peer-mcp-personas-DhI7ZPSx.js → peer-mcp-personas-ce6_YMnX.js} +407 -96
- package/dist/peer-mcp-personas-ce6_YMnX.js.map +1 -0
- package/dist/{plan-review-hook-CfcanA7_.js → plan-review-hook-DuW0pSoM.js} +3 -3
- package/dist/{plan-review-hook-CfcanA7_.js.map → plan-review-hook-DuW0pSoM.js.map} +1 -1
- package/dist/{prompt-submit-hook-Bqf9ORgb.js → prompt-submit-hook-IMl7ssfr.js} +3 -3
- package/dist/{prompt-submit-hook-Bqf9ORgb.js.map → prompt-submit-hook-IMl7ssfr.js.map} +1 -1
- package/dist/{provision-CZJ4EWls.js → provision-BhCtm3md.js} +4 -4
- package/dist/{provision-CZJ4EWls.js.map → provision-BhCtm3md.js.map} +1 -1
- package/dist/{self-invocation-DhO1Z8iD.js → self-invocation-DAB_od0C.js} +2 -2
- package/dist/{self-invocation-DhO1Z8iD.js.map → self-invocation-DAB_od0C.js.map} +1 -1
- package/dist/{serve-RxWYzoOl.js → serve-Blj_dRSr.js} +12 -12
- package/dist/{serve-RxWYzoOl.js.map → serve-Blj_dRSr.js.map} +1 -1
- package/dist/{server-setup-DbvbW5Ve.js → server-setup-DhG3YZPj.js} +436 -277
- package/dist/server-setup-DhG3YZPj.js.map +1 -0
- package/dist/{start-BNcGsXsY.js → start-8QaqICtd.js} +3 -3
- package/dist/{start-BNcGsXsY.js.map → start-8QaqICtd.js.map} +1 -1
- package/dist/{stop-gate-hook-BiBp5aGm.js → stop-gate-hook-DQnh_KfI.js} +3 -3
- package/dist/{stop-gate-hook-BiBp5aGm.js.map → stop-gate-hook-DQnh_KfI.js.map} +1 -1
- package/dist/{stop-gate-policy-BGd6b5hR.js → stop-gate-policy-DMr3KVmw.js} +2 -2
- package/dist/{stop-gate-policy-BGd6b5hR.js.map → stop-gate-policy-DMr3KVmw.js.map} +1 -1
- package/dist/{token-8drORhXg.js → token-BtJhjXXu.js} +54 -7
- package/dist/token-BtJhjXXu.js.map +1 -0
- package/dist/{worker-dispatch-D5fGroNr.js → worker-dispatch-BEHkTbnH.js} +2 -2
- package/dist/{worker-dispatch-D5fGroNr.js.map → worker-dispatch-BEHkTbnH.js.map} +1 -1
- package/package.json +1 -1
- package/dist/attribution-settings-Dx8TBPE8.js.map +0 -1
- package/dist/claude-BoAd_L2W.js.map +0 -1
- package/dist/engine-CK2b_cTt.js +0 -2
- package/dist/lifecycle-C8fOsQke.js +0 -2
- package/dist/lifecycle-D4Yc1aap.js +0 -2
- package/dist/paths-DJZoXfAS.js +0 -2
- package/dist/peer-mcp-personas-DhI7ZPSx.js.map +0 -1
- package/dist/server-setup-DbvbW5Ve.js.map +0 -1
- package/dist/token-8drORhXg.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as ensurePaths, t as PATHS } from "./paths-
|
|
2
|
-
import { A as state, r as setupGitHubToken } from "./token-
|
|
1
|
+
import { i as ensurePaths, t as PATHS } from "./paths-Ci485qSJ.js";
|
|
2
|
+
import { A as state, r as setupGitHubToken } from "./token-BtJhjXXu.js";
|
|
3
3
|
import { defineCommand } from "citty";
|
|
4
4
|
import consola from "consola";
|
|
5
5
|
//#region src/auth.ts
|
|
@@ -41,4 +41,4 @@ const auth = defineCommand({
|
|
|
41
41
|
//#endregion
|
|
42
42
|
export { auth };
|
|
43
43
|
|
|
44
|
-
//# sourceMappingURL=auth-
|
|
44
|
+
//# sourceMappingURL=auth-CluG5e-l.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-
|
|
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"}
|
|
@@ -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.
|
|
5
|
+
"version": "0.3.297",
|
|
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-
|
|
2
|
-
import { r as setupGitHubToken } from "./token-
|
|
3
|
-
import { t as getCopilotUsage } from "./get-copilot-usage-
|
|
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";
|
|
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-
|
|
43
|
+
//# sourceMappingURL=check-usage-iOzfnKJe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-usage-
|
|
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,26 +1,42 @@
|
|
|
1
|
-
import { Ct as
|
|
2
|
-
import { o as removeOwnClaudeConfigMirror, r as ensureClaudeConfigMirror, t as PATHS, u as writeArtifactCredsToMirror } from "./paths-
|
|
3
|
-
import { A as state, d as resolveModel } from "./token-
|
|
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";
|
|
4
4
|
import { r as parseBoolEnv } from "./exec-y8C_MU8A.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { i as
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import { l as
|
|
12
|
-
import {
|
|
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";
|
|
13
14
|
import { r as hookMcpRuntimeFromEnv } from "./hook-mcp-client-DBvm9608.js";
|
|
14
|
-
import { i as planReviewEnabled, t as buildPlanReviewHookCommand } from "./plan-review-hook-
|
|
15
|
-
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-
|
|
16
|
-
import { t as buildPromptSubmitHookCommand } from "./prompt-submit-hook-
|
|
17
|
-
import { i as assertShapingInstalled, n as buildFirstMateGuardHookCommand, t as FIRST_MATE_GUARD_MATCHER } from "./internal-first-mate-guard-
|
|
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";
|
|
18
20
|
import { defineCommand } from "citty";
|
|
19
21
|
import consola from "consola";
|
|
20
22
|
import path from "node:path";
|
|
21
23
|
import { randomBytes } from "node:crypto";
|
|
22
24
|
import { tmpdir } from "node:os";
|
|
23
|
-
import process from "node:process";
|
|
25
|
+
import process$1 from "node:process";
|
|
26
|
+
//#region src/lib/orchestration/fast-dispatch-hook.ts
|
|
27
|
+
/** Sentinel preserved through claude.ts's optional codex-MCP catch. */
|
|
28
|
+
var FastDispatchGuardInstallError = class extends Error {
|
|
29
|
+
constructor(message) {
|
|
30
|
+
super(message);
|
|
31
|
+
this.name = "FastDispatchGuardInstallError";
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
/** Assert fast launches never spawn without their native dispatch ACL. */
|
|
35
|
+
function assertFastDispatchGuardInstalled(fastProfile, installationSucceeded) {
|
|
36
|
+
if (fastProfile && !installationSucceeded) throw new FastDispatchGuardInstallError("fast profile requires the native Task/Agent ACL hook, but it could not be installed; refusing to start an unguarded fast session.");
|
|
37
|
+
}
|
|
38
|
+
/** This module is intentionally stateless; callers own launch cleanup. */
|
|
39
|
+
//#endregion
|
|
24
40
|
//#region src/lib/injected-skills/artifact-review-skill.ts
|
|
25
41
|
const ARTIFACT_REVIEW_SKILL = {
|
|
26
42
|
name: "gh-artifact-review",
|
|
@@ -94,6 +110,79 @@ To let the human act on the artifact (not just comment), emit declarative contro
|
|
|
94
110
|
`
|
|
95
111
|
};
|
|
96
112
|
//#endregion
|
|
113
|
+
//#region src/lib/fast-launch-cleanup.ts
|
|
114
|
+
function createFastLaunchCleanup(deps) {
|
|
115
|
+
let cleanupPromise;
|
|
116
|
+
return () => {
|
|
117
|
+
if (cleanupPromise) return cleanupPromise;
|
|
118
|
+
cleanupPromise = (async () => {
|
|
119
|
+
try {
|
|
120
|
+
await deps.server?.close(true);
|
|
121
|
+
} catch {}
|
|
122
|
+
try {
|
|
123
|
+
await deps.stopKeepAwake();
|
|
124
|
+
} catch {}
|
|
125
|
+
if (deps.runtimeCleanup) try {
|
|
126
|
+
await deps.runtimeCleanup();
|
|
127
|
+
} catch {}
|
|
128
|
+
try {
|
|
129
|
+
await deps.removeMirror();
|
|
130
|
+
} catch {}
|
|
131
|
+
})();
|
|
132
|
+
return cleanupPromise;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/lib/fast-advisor-client.ts
|
|
137
|
+
const ADVISOR_FLAG = "--advisor";
|
|
138
|
+
function featureEnvEnabled(value) {
|
|
139
|
+
if (value === void 0) return true;
|
|
140
|
+
return ![
|
|
141
|
+
"",
|
|
142
|
+
"0",
|
|
143
|
+
"false",
|
|
144
|
+
"no",
|
|
145
|
+
"off"
|
|
146
|
+
].includes(value.trim().toLowerCase());
|
|
147
|
+
}
|
|
148
|
+
/** Match Claude Code's hard-disable and experimental-enable opt-out semantics. */
|
|
149
|
+
function fastAdvisorClientEnabled(env = process.env) {
|
|
150
|
+
if (env.CLAUDE_CODE_DISABLE_ADVISOR_TOOL) return false;
|
|
151
|
+
return featureEnvEnabled(env.CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Remove every caller-supplied Advisor option and insert the fixed fast value.
|
|
155
|
+
*
|
|
156
|
+
* This parser intentionally keeps scanning after `--`: that separator marks
|
|
157
|
+
* github-router-to-Claude passthrough, not an exemption from the fixed profile.
|
|
158
|
+
* The fixed option is inserted before the first separator so Claude Code parses
|
|
159
|
+
* it as an option rather than positional input. A separate `--advisor` consumes
|
|
160
|
+
* its next token only when it is a value rather than another option; malformed
|
|
161
|
+
* missing-value forms are simply removed.
|
|
162
|
+
*/
|
|
163
|
+
function withFixedFastAdvisorArg(args, enabled = fastAdvisorClientEnabled()) {
|
|
164
|
+
const sanitized = [];
|
|
165
|
+
for (let index = 0; index < args.length; index++) {
|
|
166
|
+
const token = args[index];
|
|
167
|
+
if (token === ADVISOR_FLAG) {
|
|
168
|
+
const next = args[index + 1];
|
|
169
|
+
if (next !== void 0 && next !== "--" && !next.startsWith("-")) index++;
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
if (token.startsWith(`${ADVISOR_FLAG}=`)) continue;
|
|
173
|
+
sanitized.push(token);
|
|
174
|
+
}
|
|
175
|
+
if (!enabled) return sanitized;
|
|
176
|
+
const separator = sanitized.indexOf("--");
|
|
177
|
+
const fixed = [ADVISOR_FLAG, FAST_PROFILE_ADVISOR_CLIENT_MODEL];
|
|
178
|
+
if (separator < 0) return [...sanitized, ...fixed];
|
|
179
|
+
return [
|
|
180
|
+
...sanitized.slice(0, separator),
|
|
181
|
+
...fixed,
|
|
182
|
+
...sanitized.slice(separator)
|
|
183
|
+
];
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
97
186
|
//#region src/claude.ts
|
|
98
187
|
function isFirstMateSkillName(name) {
|
|
99
188
|
return name === "gh-first-mate" || name === "gh-first-mate-scaffold" || name === "gh-first-mate-operate" || name === "gh-first-mate-conduct";
|
|
@@ -208,12 +297,18 @@ const claude = defineCommand({
|
|
|
208
297
|
},
|
|
209
298
|
args: claudeArgs,
|
|
210
299
|
async run({ args, rawArgs }) {
|
|
211
|
-
const headlessProbeRequested = process.env.GH_ROUTER_ALLOW_HEADLESS_CLAUDE === "1" && rawArgs.includes("--print") && rawArgs.includes("--input-format") && rawArgs.includes("--output-format") && rawArgs.filter((arg) => arg === "stream-json").length >= 2;
|
|
212
|
-
if (!process.stdout.isTTY && !headlessProbeRequested) {
|
|
300
|
+
const headlessProbeRequested = process$1.env.GH_ROUTER_ALLOW_HEADLESS_CLAUDE === "1" && rawArgs.includes("--print") && rawArgs.includes("--input-format") && rawArgs.includes("--output-format") && rawArgs.filter((arg) => arg === "stream-json").length >= 2;
|
|
301
|
+
if (!process$1.stdout.isTTY && !headlessProbeRequested) {
|
|
213
302
|
consola.error("The claude subcommand requires a TTY (interactive terminal).");
|
|
214
|
-
process.exit(1);
|
|
303
|
+
process$1.exit(1);
|
|
215
304
|
}
|
|
216
305
|
const parsed = parseSharedArgs(args);
|
|
306
|
+
const requestedLaunchProfileId = resolveLaunchProfile(args.model);
|
|
307
|
+
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`);
|
|
310
|
+
process$1.exit(1);
|
|
311
|
+
}
|
|
217
312
|
if (args.stealth) {
|
|
218
313
|
parsed.extendedBetas = false;
|
|
219
314
|
consola.info("Stealth mode: VS Code-only beta filtering. Leverage features disabled.");
|
|
@@ -244,27 +339,55 @@ const claude = defineCommand({
|
|
|
244
339
|
serverUrl = result.serverUrl;
|
|
245
340
|
} catch (error) {
|
|
246
341
|
consola.error("Failed to start server:", error instanceof Error ? error.message : error);
|
|
247
|
-
process.exit(1);
|
|
342
|
+
process$1.exit(1);
|
|
248
343
|
}
|
|
249
344
|
runSelfUpdate({ selfUpdate: args["self-update"] !== false });
|
|
345
|
+
const cleanupPreMirrorFailure = createFastLaunchCleanup({
|
|
346
|
+
server,
|
|
347
|
+
stopKeepAwake,
|
|
348
|
+
removeMirror: removeOwnClaudeConfigMirror
|
|
349
|
+
});
|
|
250
350
|
try {
|
|
251
351
|
await ensureClaudeConfigMirror();
|
|
252
352
|
} catch (err) {
|
|
253
353
|
consola.error(`Failed to provision CLAUDE_CONFIG_DIR mirror: ${err instanceof Error ? err.message : String(err)}. Spawned Claude Code would not be able to authenticate.`);
|
|
254
|
-
|
|
354
|
+
await cleanupPreMirrorFailure();
|
|
355
|
+
process$1.exit(1);
|
|
255
356
|
}
|
|
256
357
|
enableFileLogging();
|
|
358
|
+
let fastRuntimeCleanup;
|
|
359
|
+
let fastLaunchId;
|
|
360
|
+
let fastCleanupPromise;
|
|
361
|
+
const disposeFastRuntime = async () => {
|
|
362
|
+
if (!fastRuntimeCleanup) return;
|
|
363
|
+
fastCleanupPromise ??= fastRuntimeCleanup();
|
|
364
|
+
await fastCleanupPromise;
|
|
365
|
+
};
|
|
366
|
+
const resetFastRuntimeOwnership = () => {
|
|
367
|
+
fastRuntimeCleanup = void 0;
|
|
368
|
+
fastLaunchId = void 0;
|
|
369
|
+
};
|
|
370
|
+
const cleanupFastLaunch = createFastLaunchCleanup({
|
|
371
|
+
server,
|
|
372
|
+
stopKeepAwake,
|
|
373
|
+
removeMirror: removeOwnClaudeConfigMirror,
|
|
374
|
+
runtimeCleanup: async () => {
|
|
375
|
+
if (fastRuntimeCleanup) await fastRuntimeCleanup();
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
const fastFatal = async (message) => {
|
|
379
|
+
consola.error(message);
|
|
380
|
+
process$1.stderr.write(`${message}\n`);
|
|
381
|
+
await cleanupFastLaunch();
|
|
382
|
+
process$1.exit(1);
|
|
383
|
+
throw new Error("process.exit returned unexpectedly");
|
|
384
|
+
};
|
|
257
385
|
const usingDefault = !args.model?.trim();
|
|
258
386
|
const requestedSlug = resolveLeadSlugArg(args.model);
|
|
259
387
|
const launchProfileId = resolveLaunchProfile(args.model);
|
|
260
388
|
if (launchProfileId === "fast") {
|
|
261
389
|
const prereqCheck = validateFastProfilePrerequisites(state.models);
|
|
262
|
-
if (!prereqCheck.ok)
|
|
263
|
-
const message = formatFastPrerequisiteFailure(prereqCheck.missing);
|
|
264
|
-
consola.error(message);
|
|
265
|
-
process.stderr.write(`${message}\n`);
|
|
266
|
-
process.exit(1);
|
|
267
|
-
}
|
|
390
|
+
if (!prereqCheck.ok) await fastFatal(formatFastPrerequisiteFailure(prereqCheck.missing));
|
|
268
391
|
}
|
|
269
392
|
let chosenSlug = launchProfileId === "fast" ? requestedSlug.endsWith("[1m]") ? `${LUNA_DRIVER_ALIAS_ID}[1m]` : LUNA_DRIVER_ALIAS_ID : requestedSlug;
|
|
270
393
|
let resolvedSlug = launchProfileId === "fast" ? resolveModel(requestedSlug) : resolveModel(chosenSlug);
|
|
@@ -286,9 +409,10 @@ const claude = defineCommand({
|
|
|
286
409
|
consola.warn(`Model "${resolvedSlug}" not found. Available claude models: ${available.join(", ")}`);
|
|
287
410
|
}
|
|
288
411
|
const banner = chosenSlug === resolvedSlug ? chosenSlug : `${chosenSlug} → ${resolvedSlug}`;
|
|
289
|
-
process.stderr.write(`Server ready on ${serverUrl}, launching Claude Code (${banner})...\n`);
|
|
412
|
+
process$1.stderr.write(`Server ready on ${serverUrl}, launching Claude Code (${banner})...\n`);
|
|
290
413
|
const envVars = getClaudeCodeEnvVars(serverUrl, chosenSlug, launchProfileId);
|
|
291
|
-
|
|
414
|
+
let extraArgs = collectChildPassthroughArgs(rawArgs, claudeArgs);
|
|
415
|
+
if (launchProfileId === "fast") extraArgs = withFixedFastAdvisorArg(extraArgs, fastAdvisorClientEnabled(process$1.env));
|
|
292
416
|
if (toolbeltEnabled()) {
|
|
293
417
|
provisionToolbelt().catch((err) => consola.debug("Toolbelt provisioning failed:", err));
|
|
294
418
|
const toolbeltLine = buildToolbeltAwareness(availableToolCommands());
|
|
@@ -300,7 +424,7 @@ const claude = defineCommand({
|
|
|
300
424
|
}
|
|
301
425
|
provisionAndIndexColbert();
|
|
302
426
|
colbertDegradedWarning(void 0, { logsToFile: true }).then((warning) => {
|
|
303
|
-
if (warning) process.stderr.write(`${warning}\n`);
|
|
427
|
+
if (warning) process$1.stderr.write(`${warning}\n`);
|
|
304
428
|
}).catch(() => {});
|
|
305
429
|
warmTreeSitterPool();
|
|
306
430
|
startKeepAwake();
|
|
@@ -312,12 +436,13 @@ const claude = defineCommand({
|
|
|
312
436
|
let onShutdown = baseShutdown;
|
|
313
437
|
let peerAwarenessSnippet;
|
|
314
438
|
let peerAwarenessSummary;
|
|
315
|
-
let
|
|
439
|
+
let fastWiringComplete = launchProfileId !== "fast";
|
|
316
440
|
const nativeAgentModels = launchProfileId === "fast" ? {
|
|
317
|
-
|
|
441
|
+
Explore: fastScoutModel(),
|
|
318
442
|
implementer: fastImplementerModel(),
|
|
319
443
|
reviewer: fastReviewerModel(),
|
|
320
|
-
planner: fastPlannerModel()
|
|
444
|
+
planner: fastPlannerModel(),
|
|
445
|
+
critic: fastCriticModel()
|
|
321
446
|
} : {
|
|
322
447
|
implementer: nativeSubagentModel(),
|
|
323
448
|
"implementer-fast": implementerFastModel(),
|
|
@@ -329,23 +454,22 @@ const claude = defineCommand({
|
|
|
329
454
|
"general-purpose-fast": generalPurposeFastModel()
|
|
330
455
|
};
|
|
331
456
|
const nativeAvailability = {
|
|
332
|
-
scoutAvailable: nativeAgentModels.scout != null,
|
|
457
|
+
scoutAvailable: (launchProfileId === "fast" ? nativeAgentModels.Explore : nativeAgentModels.scout) != null,
|
|
333
458
|
implementerFastAvailable: nativeAgentModels["implementer-fast"] != null,
|
|
334
459
|
reviewerFastAvailable: nativeAgentModels["reviewer-fast"] != null,
|
|
335
460
|
generalPurposeFastAvailable: nativeAgentModels["general-purpose-fast"] != null,
|
|
336
461
|
budgetLead: isBudgetClaudeLead(chosenSlug),
|
|
337
462
|
profile: launchProfileId
|
|
338
463
|
};
|
|
339
|
-
const codexMcpEnabled = args["codex-mcp"] !== false;
|
|
340
464
|
const selfInvocation = await resolveSelfInvocation();
|
|
341
465
|
{
|
|
342
466
|
const warning = hookLauncherDegradedWarning(selfInvocation);
|
|
343
|
-
if (warning) process.stderr.write(`${warning}\n`);
|
|
467
|
+
if (warning) process$1.stderr.write(`${warning}\n`);
|
|
344
468
|
}
|
|
345
469
|
if (codexMcpEnabled) try {
|
|
346
470
|
const requestedCli = args["codex-cli"] ?? false;
|
|
347
471
|
const isFastProfile = launchProfileId === "fast";
|
|
348
|
-
if (isFastProfile && requestedCli) process.stderr.write("Fast profile uses its fixed HTTP MCP surface; ignoring --codex-cli.\n");
|
|
472
|
+
if (isFastProfile && requestedCli) process$1.stderr.write("Fast profile uses its fixed HTTP MCP surface; ignoring --codex-cli.\n");
|
|
349
473
|
const backend = isFastProfile ? "http" : resolveCodexCliBackend({
|
|
350
474
|
requested: requestedCli,
|
|
351
475
|
codexInfo: requestedCli ? getCodexVersion() : null
|
|
@@ -365,7 +489,7 @@ const claude = defineCommand({
|
|
|
365
489
|
if (!isFastProfile && fleetToolsEnabled()) enabledGroups.push("fleet");
|
|
366
490
|
if (!isFastProfile && agentToolsEnabled()) enabledGroups.push("first-mate");
|
|
367
491
|
const { keys: groupKeys, skipped: skippedGroups } = await resolveGroupKeysFromMirror(enabledGroups);
|
|
368
|
-
if (isFastProfile && fastOracleModel() == null) throw new Error("fast profile prerequisite drift: exact
|
|
492
|
+
if (isFastProfile && (fastOracleModel() == null || fastCriticModel() == null)) throw new Error("fast profile prerequisite drift: exact Oracle or critic model no longer resolves");
|
|
369
493
|
const runtime = await writePeerMcpRuntimeFiles(serverUrl, {
|
|
370
494
|
codexCli: backend === "cli",
|
|
371
495
|
selfInvocation,
|
|
@@ -378,7 +502,7 @@ const claude = defineCommand({
|
|
|
378
502
|
reviewerModel: nativeAgentModels.reviewer,
|
|
379
503
|
reviewerFastModel: nativeAgentModels["reviewer-fast"],
|
|
380
504
|
brainstormModel: nativeAgentModels.brainstorm,
|
|
381
|
-
scoutModel: nativeAgentModels.scout,
|
|
505
|
+
scoutModel: isFastProfile ? nativeAgentModels.Explore : nativeAgentModels.scout,
|
|
382
506
|
scribeModel: nativeAgentModels.scribe,
|
|
383
507
|
implementerFastModel: nativeAgentModels["implementer-fast"],
|
|
384
508
|
generalPurposeFastModel: nativeAgentModels["general-purpose-fast"],
|
|
@@ -388,13 +512,15 @@ const claude = defineCommand({
|
|
|
388
512
|
...isFastProfile ? {
|
|
389
513
|
fastProfile: true,
|
|
390
514
|
plannerModel: nativeAgentModels.planner,
|
|
515
|
+
criticModel: nativeAgentModels.critic,
|
|
391
516
|
scoutEffort: FAST_SCOUT_EFFORT,
|
|
392
|
-
implementerEffort:
|
|
517
|
+
implementerEffort: FAST_IMPLEMENTER_EFFORT,
|
|
393
518
|
reviewerEffort: FAST_REVIEWER_EFFORT,
|
|
394
|
-
plannerEffort: FAST_PLANNER_EFFORT
|
|
519
|
+
plannerEffort: FAST_PLANNER_EFFORT,
|
|
520
|
+
criticEffort: FAST_CRITIC_EFFORT
|
|
395
521
|
} : {}
|
|
396
522
|
});
|
|
397
|
-
|
|
523
|
+
if (isFastProfile) fastRuntimeCleanup = runtime.cleanup;
|
|
398
524
|
const launchSecret = randomBytes(32).toString("hex");
|
|
399
525
|
const launchEntry = registerLaunch({
|
|
400
526
|
profileId: launchProfileId,
|
|
@@ -403,10 +529,22 @@ const claude = defineCommand({
|
|
|
403
529
|
allowedGroups: fastDescriptor.allowedGroups,
|
|
404
530
|
allowedPersonas: fastDescriptor.personaAllowlist
|
|
405
531
|
});
|
|
532
|
+
if (isFastProfile) fastLaunchId = launchEntry.launchId;
|
|
406
533
|
envVars.ANTHROPIC_CUSTOM_HEADERS = envVars.ANTHROPIC_CUSTOM_HEADERS ? `${envVars.ANTHROPIC_CUSTOM_HEADERS}\n${LAUNCH_SECRET_HEADER}: ${launchSecret}` : `${LAUNCH_SECRET_HEADER}: ${launchSecret}`;
|
|
407
534
|
envVars.GH_ROUTER_HOOK_MCP_URL = serverUrl;
|
|
408
535
|
envVars.GH_ROUTER_HOOK_NONCE = runtime.nonce;
|
|
409
|
-
onShutdown = async () => {
|
|
536
|
+
onShutdown = isFastProfile ? async () => {
|
|
537
|
+
try {
|
|
538
|
+
unregisterLaunch(launchEntry.launchId);
|
|
539
|
+
} finally {
|
|
540
|
+
try {
|
|
541
|
+
await runtime.cleanup();
|
|
542
|
+
} finally {
|
|
543
|
+
resetFastRuntimeOwnership();
|
|
544
|
+
await baseShutdown();
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
} : async () => {
|
|
410
548
|
unregisterLaunch(launchEntry.launchId);
|
|
411
549
|
await runtime.cleanup();
|
|
412
550
|
await baseShutdown();
|
|
@@ -431,10 +569,23 @@ const claude = defineCommand({
|
|
|
431
569
|
} else if (args["codex-mcp-only"] === true) consola.warn("--codex-mcp-only has no effect when peer MCP is wired via the mirrored .claude.json (the user's existing user-scope MCPs in the snapshot are still visible). Pass --no-codex-mcp to skip peer-MCP wiring entirely.");
|
|
432
570
|
subagentVisibility = injected.ok ? `subagent-visible (mirrored mcpServers: [${injected.serversAdded.join(", ")}])` : `subagent-INVISIBLE (collision on user-side mcpServers: [${injected.conflictingServers.join(", ")}]; parent-only via --mcp-config)`;
|
|
433
571
|
}
|
|
572
|
+
if (isFastProfile) {
|
|
573
|
+
let fastGuardInstalled = false;
|
|
574
|
+
try {
|
|
575
|
+
const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
|
|
576
|
+
const guardCommand = buildFastDispatchGuardHookCommand(selfInvocation);
|
|
577
|
+
await injectStopHookIntoSettingsFile(settingsPath, guardCommand, "PreToolUse", 10, FAST_DISPATCH_TOOL_MATCHER);
|
|
578
|
+
fastGuardInstalled = true;
|
|
579
|
+
} catch (err) {
|
|
580
|
+
consola.error(`Could not register the fast native dispatch ACL hook: ${String(err)}`);
|
|
581
|
+
}
|
|
582
|
+
assertFastDispatchGuardInstalled(true, fastGuardInstalled);
|
|
583
|
+
fastWiringComplete = true;
|
|
584
|
+
}
|
|
434
585
|
const personaNames = runtime.personas.map((p) => p.agentName).join(", ");
|
|
435
586
|
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).` : "";
|
|
436
|
-
process.stderr.write(`Peer MCP wired (backend=${backend}, personas=[${personaNames}], subagent .md files=${runtime.agentMdPaths.length}, ${subagentVisibility}).${skippedNote}\n`);
|
|
437
|
-
const sessionCwd = process.cwd();
|
|
587
|
+
process$1.stderr.write(`Peer MCP wired (backend=${backend}, personas=[${personaNames}], subagent .md files=${runtime.agentMdPaths.length}, ${subagentVisibility}).${skippedNote}\n`);
|
|
588
|
+
const sessionCwd = process$1.cwd();
|
|
438
589
|
const workerSkillsActive = workerToolsEnabled() && !isFastProfile;
|
|
439
590
|
let skillsWritten = 0;
|
|
440
591
|
let skillsToWrite = [];
|
|
@@ -459,7 +610,7 @@ const claude = defineCommand({
|
|
|
459
610
|
}
|
|
460
611
|
if (workerSkillsActive) {
|
|
461
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.");
|
|
462
|
-
else if (process.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.");
|
|
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.");
|
|
463
614
|
else try {
|
|
464
615
|
const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
|
|
465
616
|
const workersKey = workersKeyOf(groupKeys);
|
|
@@ -472,7 +623,7 @@ const claude = defineCommand({
|
|
|
472
623
|
}
|
|
473
624
|
if (skillsWritten > 0) {
|
|
474
625
|
const skillNames = skillsToWrite.map((s) => `/${s.name}`).join(", ");
|
|
475
|
-
process.stderr.write(`Injected skills (${skillsWritten}/${skillsToWrite.length}): ${skillNames}.\n`);
|
|
626
|
+
process$1.stderr.write(`Injected skills (${skillsWritten}/${skillsToWrite.length}): ${skillNames}.\n`);
|
|
476
627
|
}
|
|
477
628
|
}
|
|
478
629
|
if (agentToolsEnabled()) {
|
|
@@ -486,9 +637,9 @@ const claude = defineCommand({
|
|
|
486
637
|
consola.error(`Could not register the operator worker/orchestrate guard hook: ${String(err)}`);
|
|
487
638
|
}
|
|
488
639
|
assertShapingInstalled(true, shapingInstalled);
|
|
489
|
-
if (!process.env.GH_ROUTER_FM_SCAFFOLD_REPOS?.trim()) consola.info("first-mate: scaffold_repo is disabled (it writes to real repositories). Set GH_ROUTER_FM_SCAFFOLD_REPOS to a comma-separated list of owner/name entries, or owner/* for a whole org, to enable it.");
|
|
640
|
+
if (!process$1.env.GH_ROUTER_FM_SCAFFOLD_REPOS?.trim()) consola.info("first-mate: scaffold_repo is disabled (it writes to real repositories). Set GH_ROUTER_FM_SCAFFOLD_REPOS to a comma-separated list of owner/name entries, or owner/* for a whole org, to enable it.");
|
|
490
641
|
}
|
|
491
|
-
const aiordieSidecar = (process.env.AIORDIE_CLAUDE_BIND ?? "").trim();
|
|
642
|
+
const aiordieSidecar = (process$1.env.AIORDIE_CLAUDE_BIND ?? "").trim();
|
|
492
643
|
if (aiordieSidecar.length > 0 && !aiordieSidecar.includes("\"")) try {
|
|
493
644
|
const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
|
|
494
645
|
const command = buildSessionBindHookCommand(selfInvocation, aiordieSidecar);
|
|
@@ -505,7 +656,7 @@ const claude = defineCommand({
|
|
|
505
656
|
consola.warn(`Artifact-panel directive prepend failed: ${String(err)}`);
|
|
506
657
|
}
|
|
507
658
|
if (!isFastProfile) try {
|
|
508
|
-
await writeArtifactCredsToMirror(shouldUseInsecureTls(process.env.AIORDIE_BASE_URL ?? ""));
|
|
659
|
+
await writeArtifactCredsToMirror(shouldUseInsecureTls(process$1.env.AIORDIE_BASE_URL ?? ""));
|
|
509
660
|
const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
|
|
510
661
|
const cmd = buildArtifactOpenHookCommand(selfInvocation);
|
|
511
662
|
await injectStopHookIntoSettingsFile(settingsPath, cmd, "PostToolUse", void 0, "ExitPlanMode");
|
|
@@ -522,13 +673,13 @@ const claude = defineCommand({
|
|
|
522
673
|
}
|
|
523
674
|
if (!isFastProfile && args["trust-gate"] === true) try {
|
|
524
675
|
const root = await trustRepo(sessionCwd);
|
|
525
|
-
process.stderr.write(`Structural gate trusted for this repo (${root}); it will run on launch here from now on.\n`);
|
|
676
|
+
process$1.stderr.write(`Structural gate trusted for this repo (${root}); it will run on launch here from now on.\n`);
|
|
526
677
|
} catch (err) {
|
|
527
678
|
consola.warn(`Could not record gate trust: ${String(err)}`);
|
|
528
679
|
}
|
|
529
680
|
const gateDisabled = isFastProfile || stopGateDisabled(args);
|
|
530
|
-
const forceEnabled = parseBoolEnv(process.env.GH_ROUTER_ENABLE_STOP_GATE) === true;
|
|
531
|
-
const includeTests = parseBoolEnv(process.env.GH_ROUTER_STOP_GATE_RUN_TESTS) === true;
|
|
681
|
+
const forceEnabled = parseBoolEnv(process$1.env.GH_ROUTER_ENABLE_STOP_GATE) === true;
|
|
682
|
+
const includeTests = parseBoolEnv(process$1.env.GH_ROUTER_STOP_GATE_RUN_TESTS) === true;
|
|
532
683
|
const gateRoot = await repoRoot(sessionCwd).catch(() => sessionCwd);
|
|
533
684
|
let descriptor = null;
|
|
534
685
|
let discovering = false;
|
|
@@ -543,7 +694,7 @@ const claude = defineCommand({
|
|
|
543
694
|
workdir: gateRoot,
|
|
544
695
|
evidence: cached.evidence
|
|
545
696
|
};
|
|
546
|
-
else if (!forceEnabled && workerToolsEnabled() && parseBoolEnv(process.env.GH_ROUTER_ENABLE_GATE_DISCOVERY) === true) discovering = true;
|
|
697
|
+
else if (!forceEnabled && workerToolsEnabled() && parseBoolEnv(process$1.env.GH_ROUTER_ENABLE_GATE_DISCOVERY) === true) discovering = true;
|
|
547
698
|
}
|
|
548
699
|
}
|
|
549
700
|
let gateEnabled = gateDisabled ? false : await stopGateEnabledForRepo(sessionCwd).catch(() => false);
|
|
@@ -587,17 +738,17 @@ const claude = defineCommand({
|
|
|
587
738
|
})().catch(() => {});
|
|
588
739
|
}
|
|
589
740
|
const tail = "A regression or a gate-weakening diff blocks stopping until fixed (per-prompt, max 2). Opt out with GH_ROUTER_DISABLE_STOP_GATE=1.\n";
|
|
590
|
-
if (armed.kind === "sealed") process.stderr.write((autoTrusted ? `Structural-gate Stop hook enabled by default for this repo (gate=${armed.gateId}; runs typecheck/test/lint at stop). ` : `Structural-gate Stop hook enabled (gate=${armed.gateId}). `) + tail);
|
|
741
|
+
if (armed.kind === "sealed") process$1.stderr.write((autoTrusted ? `Structural-gate Stop hook enabled by default for this repo (gate=${armed.gateId}; runs typecheck/test/lint at stop). ` : `Structural-gate Stop hook enabled (gate=${armed.gateId}). `) + tail);
|
|
591
742
|
else {
|
|
592
743
|
const ids = checksForDescriptor(armed).map((c) => c.id).join(", ");
|
|
593
744
|
const testNote = includeTests ? "Full test suite ON. " : "Full test suite off by default (enable with GH_ROUTER_STOP_GATE_RUN_TESTS=1). ";
|
|
594
|
-
process.stderr.write(`Structural-gate Stop hook armed for this ${armed.ecosystem} repo (checks: ${ids}; from ${armed.evidence.join(", ")}). ${testNote}${tail}`);
|
|
745
|
+
process$1.stderr.write(`Structural-gate Stop hook armed for this ${armed.ecosystem} repo (checks: ${ids}; from ${armed.evidence.join(", ")}). ${testNote}${tail}`);
|
|
595
746
|
}
|
|
596
747
|
} catch (err) {
|
|
597
748
|
consola.warn(`Could not register the structural-gate Stop hook: ${String(err)}`);
|
|
598
749
|
}
|
|
599
750
|
} else if (gateEnabled && discovering) {
|
|
600
|
-
process.stderr.write("Structural Stop-gate: no checks parsed for this repo — discovering check commands in the background (arms on the next launch). Disable with GH_ROUTER_ENABLE_GATE_DISCOVERY=0.\n");
|
|
751
|
+
process$1.stderr.write("Structural Stop-gate: no checks parsed for this repo — discovering check commands in the background (arms on the next launch). Disable with GH_ROUTER_ENABLE_GATE_DISCOVERY=0.\n");
|
|
601
752
|
(async () => {
|
|
602
753
|
try {
|
|
603
754
|
const disc = await discoverGateCommands(gateRoot, {
|
|
@@ -620,7 +771,7 @@ const claude = defineCommand({
|
|
|
620
771
|
}
|
|
621
772
|
} catch {}
|
|
622
773
|
})().catch(() => {});
|
|
623
|
-
} else if (!gateDisabled && !descriptor && !discovering) process.stderr.write("Structural Stop-gate not enabled: no checks found in this repo (looked at package.json scripts / CI workflows / Makefile / Cargo.toml / go.mod / pyproject). Force a sealed gate with GH_ROUTER_ENABLE_STOP_GATE=1" + (workerToolsEnabled() ? ", or let a model discover them with GH_ROUTER_ENABLE_GATE_DISCOVERY=1" : "") + ".\n");
|
|
774
|
+
} else if (!gateDisabled && !descriptor && !discovering) process$1.stderr.write("Structural Stop-gate not enabled: no checks found in this repo (looked at package.json scripts / CI workflows / Makefile / Cargo.toml / go.mod / pyproject). Force a sealed gate with GH_ROUTER_ENABLE_STOP_GATE=1" + (workerToolsEnabled() ? ", or let a model discover them with GH_ROUTER_ENABLE_GATE_DISCOVERY=1" : "") + ".\n");
|
|
624
775
|
const peerSnippet = buildPeerAwarenessSnippet({
|
|
625
776
|
codexCli: backend === "cli",
|
|
626
777
|
geminiAvailable: geminiModelsAvailable,
|
|
@@ -633,6 +784,7 @@ const claude = defineCommand({
|
|
|
633
784
|
fleetAvailable: fleetToolsEnabled(),
|
|
634
785
|
agentToolsAvailable: agentToolsEnabled(),
|
|
635
786
|
...nativeAvailability,
|
|
787
|
+
profile: launchProfileId,
|
|
636
788
|
groupKeys
|
|
637
789
|
});
|
|
638
790
|
peerAwarenessSnippet = peerSnippet;
|
|
@@ -643,6 +795,7 @@ const claude = defineCommand({
|
|
|
643
795
|
fleetAvailable: fleetToolsEnabled(),
|
|
644
796
|
agentToolsAvailable: agentToolsEnabled(),
|
|
645
797
|
...nativeAvailability,
|
|
798
|
+
profile: launchProfileId,
|
|
646
799
|
nativeAgentModels,
|
|
647
800
|
groupKeys
|
|
648
801
|
});
|
|
@@ -657,18 +810,29 @@ const claude = defineCommand({
|
|
|
657
810
|
consola.warn(`Style-directive CLAUDE.md prepend failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
658
811
|
}
|
|
659
812
|
} catch (err) {
|
|
813
|
+
if (launchProfileId === "fast") {
|
|
814
|
+
if (fastLaunchId) unregisterLaunch(fastLaunchId);
|
|
815
|
+
await disposeFastRuntime().catch(() => {});
|
|
816
|
+
await server.close(true).catch(() => {});
|
|
817
|
+
await baseShutdown().catch(() => {});
|
|
818
|
+
resetFastRuntimeOwnership();
|
|
819
|
+
const message = `Fast profile wiring failed; refusing to launch an unguarded session: ${err instanceof Error ? err.message : String(err)}`;
|
|
820
|
+
consola.error(message);
|
|
821
|
+
process$1.stderr.write(`${message}\n`);
|
|
822
|
+
process$1.exit(1);
|
|
823
|
+
}
|
|
660
824
|
consola.warn(`Peer MCP wiring failed (claude will launch without it): ${err instanceof Error ? err.message : String(err)}`);
|
|
661
825
|
}
|
|
662
826
|
extraArgs.push("--append-system-prompt", peerAwarenessSnippet && peerAwarenessSummary ? `${OPERATING_DEFAULTS_DIGEST}\n\n${peerAwarenessSummary}` : OPERATING_DEFAULTS_DIGEST);
|
|
663
827
|
try {
|
|
664
828
|
await prependOperatingDefaultsToMirroredClaudeMd(buildOperatingDefaultsDirective({
|
|
665
829
|
...nativeAvailability,
|
|
666
|
-
fastRuntimeAvailable:
|
|
830
|
+
fastRuntimeAvailable: fastWiringComplete
|
|
667
831
|
}));
|
|
668
832
|
} catch (err) {
|
|
669
833
|
consola.warn(`Operating-defaults CLAUDE.md prepend failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
670
834
|
}
|
|
671
|
-
if (process.env.GH_ROUTER_DISABLE_NO_ATTRIBUTION !== "1") try {
|
|
835
|
+
if (process$1.env.GH_ROUTER_DISABLE_NO_ATTRIBUTION !== "1") try {
|
|
672
836
|
const settingsPath = path.join(PATHS.CLAUDE_CONFIG_DIR, "settings.json");
|
|
673
837
|
await injectAttributionSuppressionIntoSettingsFile(settingsPath);
|
|
674
838
|
} catch (err) {
|
|
@@ -685,4 +849,4 @@ const claude = defineCommand({
|
|
|
685
849
|
//#endregion
|
|
686
850
|
export { claude };
|
|
687
851
|
|
|
688
|
-
//# sourceMappingURL=claude-
|
|
852
|
+
//# sourceMappingURL=claude-DMMfvfns.js.map
|