github-router 0.3.204 → 0.3.206

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.
@@ -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.204",
5
+ "version": "0.3.206",
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,4 +1,4 @@
1
- import { B as runWorkerAgent, F as EXPLORE_DEFAULT_MODEL, I as IMPLEMENT_DEFAULT_MODEL, L as PLAN_DEFAULT_MODEL, N as BROWSE_DEFAULT_MODEL, P as DEFAULT_MODEL, R as REVIEW_DEFAULT_MODEL, V as withNoOutputRetry, z as appendPlanReminder } from "./peer-mcp-personas-BekOx3Rp.js";
1
+ import { B as runWorkerAgent, F as EXPLORE_DEFAULT_MODEL, I as IMPLEMENT_DEFAULT_MODEL, L as PLAN_DEFAULT_MODEL, N as BROWSE_DEFAULT_MODEL, P as DEFAULT_MODEL, R as REVIEW_DEFAULT_MODEL, V as withNoOutputRetry, z as appendPlanReminder } from "./peer-mcp-personas-C3ii7ZqP.js";
2
2
  import "./paths-BO22pMUb.js";
3
3
  import "./lifecycle-D-1CYr1Y.js";
4
4
  import "./lifecycle-bPdiXjYB.js";
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $ as buildAdvisorStream, $t as setupCopilotToken, A as trustRepo, At as readResponseBodyCapped, Bt as buildWorkspaceHeaderJson, C as fileLastPromptStore, Ct as getTokenCount, D as repoRoot, Dt as createResponses, E as repoFingerprint, Et as pickEndpoint, Ft as extractTarGzMember, G as toolbeltEnabled, Gt as DEFAULT_CODEX_MODEL_FALLBACKS, H as buildEnv, Ht as toolbeltPathOverride, It as extractZipMember, J as TOOLBELT_TOOLS, Jt as UPSTREAM_INACTIVITY_TIMEOUT_MS, K as toolbeltSkipSet, Kt as DEFAULT_PORT, Lt as shouldUseInsecureTls, M as resolveSealedGate, Mt as provisionBrowserAssets, Nt as hasSupportedBrowserInstalled, O as stopGateEnabledForRepo, Ot as createChatCompletions, Pt as provisionAndIndexColbert, Q as ADVISOR_TOOL_INSTRUCTIONS, Qt as withInstallLock, Rt as ArtifactClient, S as fileFindingsStore, St as createMessages, T as isSubagentContext, Tt as resolveMcpToolTimeoutMs, U as availableToolCommands, Ut as DEFAULT_CLAUDE_MODEL_FALLBACKS, Vt as collapsePathKeys, W as buildToolbeltAwareness, Wt as DEFAULT_CODEX_MODEL, X as searchWeb, Xt as pickClaudeDefault, Y as assetFor, Yt as generateRandomPort, Z as ADVISOR_INTERNAL_TOOL_NAME, Zt as getPackageVersion, _ as stopGateDisabled, _n as copilotBaseUrl, _t as nativeSubagentModel, a as buildPeerAwarenessSnippet, an as cacheVSCodeVersion, at as logStreamError, b as stopReviewEnabled, bn as state, bt as shimDefaultsToXhigh, c as personasFor, cn as resolveCodexModel, ct as handleMcpDelete, d as buildStopHookCommand, dn as getModels, dt as artifactToolsEnabled, en as setupGitHubAgentToken, et as injectAdvisorTool, f as captureLaunchBaseline, fn as getGitHubUser, ft as browseAgentEnabled, g as launchBaselineKey, gn as GITHUB_API_BASE_URL, gt as geminiAvailable, h as injectStopHookIntoSettingsFile, hn as forwardError, ht as fleetToolsEnabled, i as buildAgentPrompt, in as cacheModels, it as isControllerClosedError, j as liveExec, jt as parseJsonOrDiagnose, k as stopReviewStateDir, kt as MAX_RESPONSE_BODY_BYTES, l as buildArtifactOpenHookCommand, ln as resolveModel, lt as handleMcpPost, m as fileBlockBudget, mn as HTTPError, mt as browserToolsEnabled, n as MCP_GROUPS, nn as tryRefreshAndRetry, nt as buildAnthropicErrorEvent, o as buildPeerAwarenessSummary, on as filterBetaHeader, ot as readIteratorWithTimeout, p as decideStopHook, pn as fetchWithTransientRetry, pt as browserCompoundToolsEnabled, q as vscodeRipgrepPath, qt as UPSTREAM_FETCH_TIMEOUT_MS, r as assertMcpToolSurfaceConsistent, rn as cacheCopilotVersion, rt as buildOpenAIErrorEvent, s as enumerateInjectedMcpToolNames, sn as isNullish, st as relayAnthropicStream, t as GROUP_META, tn as setupGitHubToken, tt as isAdvisorRequested, u as buildSessionBindHookCommand, un as sleep$1, ut as agentToolsEnabled, v as stopGateId, vn as copilotHeaders, vt as standInToolEnabled, w as fileReviewDebounce, wt as assembleResponsesPayload, x as fileBaselineStore, xt as countTokens, y as stopGatePlanMode, yn as githubHeaders, yt as workerToolsEnabled, zt as buildWorkspaceHeaderHelperCommand } from "./peer-mcp-personas-BekOx3Rp.js";
2
+ import { $ as buildAdvisorStream, $t as setupCopilotToken, A as trustRepo, At as readResponseBodyCapped, Bt as buildWorkspaceHeaderJson, C as fileLastPromptStore, Ct as getTokenCount, D as repoRoot, Dt as createResponses, E as repoFingerprint, Et as pickEndpoint, Ft as extractTarGzMember, G as toolbeltEnabled, Gt as DEFAULT_CODEX_MODEL_FALLBACKS, H as buildEnv, Ht as toolbeltPathOverride, It as extractZipMember, J as TOOLBELT_TOOLS, Jt as UPSTREAM_INACTIVITY_TIMEOUT_MS, K as toolbeltSkipSet, Kt as DEFAULT_PORT, Lt as shouldUseInsecureTls, M as resolveSealedGate, Mt as provisionBrowserAssets, Nt as hasSupportedBrowserInstalled, O as stopGateEnabledForRepo, Ot as createChatCompletions, Pt as provisionAndIndexColbert, Q as ADVISOR_TOOL_INSTRUCTIONS, Qt as withInstallLock, Rt as ArtifactClient, S as fileFindingsStore, St as createMessages, T as isSubagentContext, Tt as resolveMcpToolTimeoutMs, U as availableToolCommands, Ut as DEFAULT_CLAUDE_MODEL_FALLBACKS, Vt as collapsePathKeys, W as buildToolbeltAwareness, Wt as DEFAULT_CODEX_MODEL, X as searchWeb, Xt as pickClaudeDefault, Y as assetFor, Yt as generateRandomPort, Z as ADVISOR_INTERNAL_TOOL_NAME, Zt as getPackageVersion, _ as stopGateDisabled, _n as copilotBaseUrl, _t as nativeSubagentModel, a as buildPeerAwarenessSnippet, an as cacheVSCodeVersion, at as logStreamError, b as stopReviewEnabled, bn as state, bt as shimDefaultsToXhigh, c as personasFor, cn as resolveCodexModel, ct as handleMcpDelete, d as buildStopHookCommand, dn as getModels, dt as artifactToolsEnabled, en as setupGitHubAgentToken, et as injectAdvisorTool, f as captureLaunchBaseline, fn as getGitHubUser, ft as browseAgentEnabled, g as launchBaselineKey, gn as GITHUB_API_BASE_URL, gt as geminiAvailable, h as injectStopHookIntoSettingsFile, hn as forwardError, ht as fleetToolsEnabled, i as buildAgentPrompt, in as cacheModels, it as isControllerClosedError, j as liveExec, jt as parseJsonOrDiagnose, k as stopReviewStateDir, kt as MAX_RESPONSE_BODY_BYTES, l as buildArtifactOpenHookCommand, ln as resolveModel, lt as handleMcpPost, m as fileBlockBudget, mn as HTTPError, mt as browserToolsEnabled, n as MCP_GROUPS, nn as tryRefreshAndRetry, nt as buildAnthropicErrorEvent, o as buildPeerAwarenessSummary, on as filterBetaHeader, ot as readIteratorWithTimeout, p as decideStopHook, pn as fetchWithTransientRetry, pt as browserCompoundToolsEnabled, q as vscodeRipgrepPath, qt as UPSTREAM_FETCH_TIMEOUT_MS, r as assertMcpToolSurfaceConsistent, rn as cacheCopilotVersion, rt as buildOpenAIErrorEvent, s as enumerateInjectedMcpToolNames, sn as isNullish, st as relayAnthropicStream, t as GROUP_META, tn as setupGitHubToken, tt as isAdvisorRequested, u as buildSessionBindHookCommand, un as sleep$1, ut as agentToolsEnabled, v as stopGateId, vn as copilotHeaders, vt as standInToolEnabled, w as fileReviewDebounce, wt as assembleResponsesPayload, x as fileBaselineStore, xt as countTokens, y as stopGatePlanMode, yn as githubHeaders, yt as workerToolsEnabled, zt as buildWorkspaceHeaderHelperCommand } from "./peer-mcp-personas-C3ii7ZqP.js";
3
3
  import { a as isUnderClaudeConfigMirror, d as writeRuntimeFileSecure, i as ensurePaths, o as removeOwnClaudeConfigMirror, r as ensureClaudeConfigMirror, t as PATHS, u as writeArtifactCredsToMirror } from "./paths-BO22pMUb.js";
4
4
  import { c as killManagedTree, d as runCommandCapture, f as runCommandVoid, l as parseBoolEnv, s as killChildProcessTree, u as resolveExecutable } from "./lifecycle-D-1CYr1Y.js";
5
5
  import { a as sweepRegistry } from "./lifecycle-bPdiXjYB.js";
@@ -978,10 +978,10 @@ function decideWorkerGuard(input) {
978
978
  function dispatcherDescription(mode) {
979
979
  return `${{
980
980
  explore: "Non-blocking `explore` worker: dispatches a read-only autonomous worker (its own context) in the background and delivers its summary as a completion notification.",
981
- implement: "Non-blocking `implement` worker: dispatches an autonomous coding worker (read/write/bash, optional git worktree) in the background and delivers its result as a completion notification.",
981
+ implement: "Non-blocking `implement` worker: dispatches an autonomous coding worker (read/write/bash) that ALWAYS runs in an isolated git worktree and returns the diff (for in-place edits use the `implementer` subagent), in the background, and delivers its result as a completion notification.",
982
982
  review: "Non-blocking `review` worker: dispatches a read-only reviewer that reads the code itself to verify a change or claim, in the background, and delivers findings as a completion notification.",
983
983
  plan: "Non-blocking `plan` worker: dispatches a read-only planner that returns an ordered implementation plan, in the background, and delivers it as a completion notification.",
984
- test: "Non-blocking `test` worker: dispatches an independent test author that writes tests trying to break the implementation, in the background, and delivers pass/fail as a completion notification.",
984
+ test: "Non-blocking `test` worker: dispatches an independent test author (in an isolated git worktree) that writes tests trying to break the implementation, in the background, and delivers pass/fail as a completion notification.",
985
985
  browse: "Non-blocking `browse` worker: dispatches an autonomous browser agent in the background and delivers its result as a completion notification."
986
986
  }[mode]} Use proactively for any ${mode}-mode worker task so a long run never blocks your turn: it returns immediately and notifies you when done.`;
987
987
  }
@@ -991,7 +991,7 @@ function dispatcherPrompt(mode, workersKey) {
991
991
  const tool = workerToolName(workersKey, mode);
992
992
  const briefField = mode === "browse" ? "task" : "prompt";
993
993
  const briefDescription = mode === "browse" ? "the lead's browse task, copied verbatim" : "the lead's worker brief, copied verbatim";
994
- const modeSpecificPassThrough = mode === "implement" || mode === "test" ? "\n - `worktree` (optional): pass `true` if the lead asked for isolated-worktree execution" : mode === "browse" ? "\n - `sessionId` (optional): pass through if the lead specified one" : "";
994
+ const modeSpecificPassThrough = mode === "browse" ? "\n - `sessionId` (optional): pass through if the lead specified one" : "";
995
995
  return [
996
996
  `# Subagent: ${dispatcherAgentName(mode)}`,
997
997
  "",
@@ -1089,6 +1089,27 @@ function resolveCodexCliBackend(opts) {
1089
1089
  return "cli";
1090
1090
  }
1091
1091
  /**
1092
+ * Build one scoped HTTP `mcpServers` entry for a group: `type: http`, the
1093
+ * `/mcp/<urlSuffix>` URL, the Bearer-nonce Authorization header, and the
1094
+ * per-session workspace `headersHelper` when supplied. Shared by
1095
+ * `buildPeerMcpConfig` (the session `.claude.json` entries) AND
1096
+ * `buildPeerAgentDefinitions` (the per-subagent inline `mcpServers` frontmatter
1097
+ * that sidesteps Claude Code's Agent-tool MCP-inheritance bug, anthropics/
1098
+ * claude-code#30280 — a bare name-reference "shares the parent connection" and
1099
+ * re-triggers it, so subagents MUST inline the full HTTP config to connect
1100
+ * independently). One source of truth so the two can't drift.
1101
+ */
1102
+ function httpEntryFor(serverUrl, group, nonce, workspaceHeaderCmd) {
1103
+ const entry = {
1104
+ type: "http",
1105
+ url: `${serverUrl}/mcp/${GROUP_META[group].urlSuffix}`,
1106
+ headers: { Authorization: `Bearer ${nonce}` }
1107
+ };
1108
+ const ws = workspaceHeaderCmd?.trim();
1109
+ if (ws) entry.headersHelper = ws;
1110
+ return entry;
1111
+ }
1112
+ /**
1092
1113
  * Build the JSON payload for `claude --mcp-config <path>` (and the same
1093
1114
  * entries that get merged into the mirrored `.claude.json`).
1094
1115
  *
@@ -1106,13 +1127,7 @@ function buildPeerMcpConfig(serverUrl, opts) {
1106
1127
  for (const group of MCP_GROUPS) {
1107
1128
  const key = opts.groupKeys[group];
1108
1129
  if (!key) continue;
1109
- const entry = {
1110
- type: "http",
1111
- url: `${serverUrl}/mcp/${GROUP_META[group].urlSuffix}`,
1112
- headers: { Authorization: `Bearer ${opts.nonce}` }
1113
- };
1114
- if (workspaceHeaderCmd) entry.headersHelper = workspaceHeaderCmd;
1115
- mcpServers[key] = entry;
1130
+ mcpServers[key] = httpEntryFor(serverUrl, group, opts.nonce, workspaceHeaderCmd);
1116
1131
  }
1117
1132
  if (opts.codexCli) mcpServers["codex-cli"] = {
1118
1133
  command: "codex",
@@ -1244,17 +1259,22 @@ function buildPeerAgentDefinitions(opts) {
1244
1259
  geminiAvailable: opts.geminiAvailable
1245
1260
  });
1246
1261
  const peersKey = peersKeyOf(opts.groupKeys);
1262
+ const peersMcp = opts.serverUrl ? { mcpServers: { [peersKey]: httpEntryFor(opts.serverUrl, "peers", opts.nonce, opts.workspaceHeaderCmd) } } : {};
1247
1263
  for (const persona of personas) out[persona.agentName] = {
1248
1264
  description: persona.description,
1249
1265
  prompt: buildAgentPrompt(persona, {
1250
1266
  codexCli: opts.codexCli,
1251
1267
  peersKey
1252
- })
1268
+ }),
1269
+ ...peersMcp
1270
+ };
1271
+ out["peer-review-coordinator"] = {
1272
+ ...buildCoordinatorAgent({
1273
+ codexCli: opts.codexCli,
1274
+ geminiAvailable: opts.geminiAvailable
1275
+ }),
1276
+ ...peersMcp
1253
1277
  };
1254
- out["peer-review-coordinator"] = buildCoordinatorAgent({
1255
- codexCli: opts.codexCli,
1256
- geminiAvailable: opts.geminiAvailable
1257
- });
1258
1278
  const nativeModel = opts.nativeSubagentModel && opts.nativeSubagentModel.length > 0 ? opts.nativeSubagentModel : void 0;
1259
1279
  const modelField = nativeModel ? { model: nativeModel } : {};
1260
1280
  out.implementer = {
@@ -1274,10 +1294,12 @@ function buildPeerAgentDefinitions(opts) {
1274
1294
  };
1275
1295
  if (opts.workerToolsAvailable) {
1276
1296
  const workersKey = workersKeyOf(opts.groupKeys);
1297
+ const workersMcp = opts.serverUrl ? { mcpServers: { [workersKey]: httpEntryFor(opts.serverUrl, "workers", opts.nonce, opts.workspaceHeaderCmd) } } : {};
1277
1298
  for (const mode of activeDispatchModes({ browse: opts.browseAvailable === true })) out[dispatcherAgentName(mode)] = {
1278
1299
  description: dispatcherDescription(mode),
1279
1300
  prompt: dispatcherPrompt(mode, workersKey),
1280
- tools: dispatcherTools(mode, workersKey)
1301
+ tools: dispatcherTools(mode, workersKey),
1302
+ ...workersMcp
1281
1303
  };
1282
1304
  }
1283
1305
  return out;
@@ -1323,15 +1345,48 @@ function escapeYamlString(s) {
1323
1345
  * component.
1324
1346
  */
1325
1347
  const VALID_AGENT_NAME = /^[A-Za-z][A-Za-z0-9-]*$/;
1348
+ /**
1349
+ * Emit the subagent-frontmatter `mcpServers` block as a YAML sequence of
1350
+ * single-key maps (the INLINE form that connects on subagent start — a bare
1351
+ * name-reference would re-trigger claude-code#30280). Scalars are
1352
+ * JSON.stringify-quoted, which is valid YAML double-quoted syntax (handles the
1353
+ * Windows-path/backslash headersHelper command safely).
1354
+ *
1355
+ * ```yaml
1356
+ * mcpServers:
1357
+ * - workers:
1358
+ * type: http
1359
+ * url: "http://127.0.0.1:PORT/mcp/workers"
1360
+ * headers:
1361
+ * Authorization: "Bearer <nonce>"
1362
+ * headersHelper: "<cmd>"
1363
+ * ```
1364
+ */
1365
+ function emitMcpServersYaml(mcpServers) {
1366
+ const lines = ["mcpServers:"];
1367
+ for (const [key, entry] of Object.entries(mcpServers)) {
1368
+ lines.push(` - ${JSON.stringify(key)}:`);
1369
+ lines.push(` type: ${JSON.stringify(entry.type)}`);
1370
+ lines.push(` url: ${JSON.stringify(entry.url)}`);
1371
+ lines.push(` headers:`);
1372
+ for (const [hk, hv] of Object.entries(entry.headers)) lines.push(` ${JSON.stringify(hk)}: ${JSON.stringify(hv)}`);
1373
+ if (entry.headersHelper !== void 0) lines.push(` headersHelper: ${JSON.stringify(entry.headersHelper)}`);
1374
+ }
1375
+ return lines;
1376
+ }
1326
1377
  /** Build a single subagent .md file body (frontmatter + system prompt).
1327
1378
  *
1328
1379
  * `tools` (optional) becomes a `tools:` frontmatter allowlist RESTRICTING the
1329
1380
  * subagent to exactly those tools (omission inherits the parent's full toolset,
1330
1381
  * per Claude Code semantics). Used by the `worker-*` dispatchers to pin each to
1331
1382
  * its single `mcp__<workersKey>__<mode>` tool — which physically prevents them
1332
- * from spawning other agents or doing extra work. Names are validated by the
1333
- * caller (`writePeerAgentMdFiles`) / are proxy-generated, so no escaping needed
1334
- * beyond the comma-join Claude Code's frontmatter parser expects. */
1383
+ * from spawning other agents or doing extra work. `mcpServers` (optional) is
1384
+ * emitted as an inline `mcpServers` frontmatter list so the subagent connects
1385
+ * directly to its scoped MCP server(s) a workaround for claude-code#30280
1386
+ * (Agent-tool subagents don't reliably inherit the session's HTTP MCP servers).
1387
+ * Names are validated by the caller (`writePeerAgentMdFiles`) / are
1388
+ * proxy-generated, so no escaping needed beyond the comma-join Claude Code's
1389
+ * frontmatter parser expects. */
1335
1390
  function buildAgentMd(spec) {
1336
1391
  const lines = [
1337
1392
  "---",
@@ -1340,6 +1395,7 @@ function buildAgentMd(spec) {
1340
1395
  ];
1341
1396
  if (spec.model) lines.push(`model: ${escapeYamlString(spec.model)}`);
1342
1397
  if (spec.tools && spec.tools.length > 0) lines.push(`tools: [${spec.tools.map((t) => JSON.stringify(t)).join(", ")}]`);
1398
+ if (spec.mcpServers && Object.keys(spec.mcpServers).length > 0) lines.push(...emitMcpServersYaml(spec.mcpServers));
1343
1399
  lines.push("---", "", spec.prompt, "");
1344
1400
  return lines.join("\n");
1345
1401
  }
@@ -1374,7 +1430,8 @@ async function writePeerAgentMdFiles(agents, opts) {
1374
1430
  description: def.description,
1375
1431
  prompt: def.prompt,
1376
1432
  model: def.model,
1377
- tools: def.tools
1433
+ tools: def.tools,
1434
+ mcpServers: def.mcpServers
1378
1435
  }));
1379
1436
  paths.push(filePath);
1380
1437
  }
@@ -1572,7 +1629,9 @@ async function writePeerMcpRuntimeFiles(serverUrl, opts) {
1572
1629
  browseAvailable: opts.browseAvailable,
1573
1630
  nativeSubagentModel: opts.nativeSubagentModel,
1574
1631
  nonce,
1575
- codexHome
1632
+ codexHome,
1633
+ serverUrl,
1634
+ workspaceHeaderCmd: buildWorkspaceHeaderHelperCommand(process.execPath, process.argv[1])
1576
1635
  });
1577
1636
  await fs.unlink(mcpConfigPath).catch(() => {});
1578
1637
  await fs.unlink(agentsPath).catch(() => {});
@@ -2835,7 +2894,7 @@ async function discoverGateCommands(cwd, opts) {
2835
2894
  if (files.length === 0) return null;
2836
2895
  let result;
2837
2896
  try {
2838
- const { runWorkerAgent } = await import("./engine-DI8PNfqU.js");
2897
+ const { runWorkerAgent } = await import("./engine-DZjN7BuD.js");
2839
2898
  result = await runWorkerAgent({
2840
2899
  mode: "explore",
2841
2900
  workspace: root,
@@ -4995,7 +5054,7 @@ function initProxyFromEnv() {
4995
5054
  //#endregion
4996
5055
  //#region package.json
4997
5056
  var name = "github-router";
4998
- var version$1 = "0.3.204";
5057
+ var version$1 = "0.3.206";
4999
5058
 
5000
5059
  //#endregion
5001
5060
  //#region src/lib/approval.ts