github-router 0.3.229 → 0.3.233

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.
@@ -1,6 +1,6 @@
1
- import { t as PATHS } from "./paths-BO22pMUb.js";
2
- import { d as runCommandCapture, l as parseBoolEnv, n as isPidAlive, o as trackChild, p as runManagedExeCapture, r as registerColbertExitHandlers, t as getColbertInstanceUuid, u as resolveExecutable } from "./lifecycle-D-1CYr1Y.js";
3
- import { i as registerExitHandlers, n as getInstanceUuid, r as recordWorkerRepo, t as WorktreeRegistry } from "./lifecycle-bPdiXjYB.js";
1
+ import { t as PATHS } from "./paths-ogCi3URX.js";
2
+ import { d as runCommandCapture, l as parseBoolEnv, n as isPidAlive, o as trackChild, p as runManagedExeCapture, r as registerColbertExitHandlers, t as getColbertInstanceUuid, u as resolveExecutable } from "./lifecycle-C5ALWmZK.js";
3
+ import { i as registerExitHandlers, n as getInstanceUuid, r as recordWorkerRepo, t as WorktreeRegistry } from "./lifecycle-DR4TGEIY.js";
4
4
  import { createRequire } from "node:module";
5
5
  import consola from "consola";
6
6
  import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
@@ -18808,7 +18808,7 @@ function logAudit$1(record) {
18808
18808
  try {
18809
18809
  const fs$2 = await import("node:fs/promises");
18810
18810
  const path$1 = await import("node:path");
18811
- const { PATHS: PATHS$1 } = await import("./paths-B5k78n0d.js");
18811
+ const { PATHS: PATHS$1 } = await import("./paths-D20MaHeo.js");
18812
18812
  const dir = path$1.join(PATHS$1.APP_DIR, "browser-mcp");
18813
18813
  await fs$2.mkdir(dir, { recursive: true });
18814
18814
  const line = JSON.stringify({
@@ -25621,7 +25621,14 @@ async function countTokens(body, extraHeaders, callerSignal, retryTransient = fa
25621
25621
  */
25622
25622
  /** Preference-ordered OpenAI frontier reasoning models (SELECTION list). */
25623
25623
  const OPENAI_FRONTIER_MODELS = ["gpt-5.6-sol", "gpt-5.5"];
25624
- /** Models whose shim DEFAULT reasoning effort is xhigh (effort POLICY set). */
25624
+ /** Models whose shim reasoning effort becomes xhigh when the operator opts in
25625
+ * with `GH_ROUTER_FRONTIER_XHIGH_DEFAULT=1` (effort POLICY set).
25626
+ *
25627
+ * This is opt-IN, not the default. The shim maps a client's level to the
25628
+ * identical provider level and injects only `high` when the client sends no
25629
+ * `thinking` block at all; forcing xhigh here would silently override the level
25630
+ * the user chose. The set is retained so the opt-in restores the previous
25631
+ * behavior exactly, targeting the same models it used to. */
25625
25632
  const XHIGH_DEFAULT_SHIM_MODELS = ["gpt-5.6-sol", "gpt-5.5"];
25626
25633
  /** Normalize a model id for policy comparison: strip a leading `vendor/`
25627
25634
  * prefix and any trailing `[...]` decoration(s) (e.g. `[1m]`, `[1m][beta]`)
@@ -25629,7 +25636,8 @@ const XHIGH_DEFAULT_SHIM_MODELS = ["gpt-5.6-sol", "gpt-5.5"];
25629
25636
  function normalizeModelId(id) {
25630
25637
  return (id.includes("/") ? id.slice(id.lastIndexOf("/") + 1) : id).replace(/(?:\[[^\]]*\])+\s*$/, "");
25631
25638
  }
25632
- /** True iff `id` (after normalization) is in the xhigh effort-policy set. */
25639
+ /** True iff `id` (after normalization) is in the xhigh effort-policy set. Only
25640
+ * consulted when `GH_ROUTER_FRONTIER_XHIGH_DEFAULT=1` opts in. */
25633
25641
  function shimDefaultsToXhigh(id) {
25634
25642
  return XHIGH_DEFAULT_SHIM_MODELS.includes(normalizeModelId(id));
25635
25643
  }
@@ -25661,21 +25669,35 @@ function geminiAvailable(source = state) {
25661
25669
  return models.some((m) => /^gemini-3\..*pro/i.test(m.id));
25662
25670
  }
25663
25671
  /**
25664
- * First available OpenAI frontier model in the live catalog (prefer
25665
- * `gpt-5.6-sol`, fall back to `gpt-5.5`). Returns undefined when neither is
25666
- * present. With `requireToolCalls`, only returns a model whose catalog entry
25667
- * advertises `tool_calls`.
25672
+ * First id in `chain` that is present in the live catalog. With
25673
+ * `requireToolCalls`, skips an entry whose catalog record does not advertise
25674
+ * `tool_calls` (strict `!== true`, so absent metadata fails closed). Returns
25675
+ * undefined when the catalog is unavailable or nothing in the chain matches, so
25676
+ * every caller degrades gracefully rather than throwing on a thin catalog.
25677
+ *
25678
+ * Extracted from `resolveOpenAiFrontier` so the per-agent resolvers below share
25679
+ * one walk instead of hand-copying it. Ids are matched EXACTLY against
25680
+ * `catalog.id` — no slug translation, matching the pre-existing behavior.
25668
25681
  */
25669
- function resolveOpenAiFrontier(opts) {
25682
+ function firstPresentInCatalog(chain, opts) {
25670
25683
  const models = state.models?.data;
25671
25684
  if (!models) return void 0;
25672
- for (const id of OPENAI_FRONTIER_MODELS) {
25685
+ for (const id of chain) {
25673
25686
  const found = models.find((m) => m.id === id);
25674
25687
  if (!found) continue;
25675
25688
  if (opts?.requireToolCalls && found.capabilities?.supports?.tool_calls !== true) continue;
25676
25689
  return id;
25677
25690
  }
25678
25691
  }
25692
+ /**
25693
+ * First available OpenAI frontier model in the live catalog (prefer
25694
+ * `gpt-5.6-sol`, fall back to `gpt-5.5`). Returns undefined when neither is
25695
+ * present. With `requireToolCalls`, only returns a model whose catalog entry
25696
+ * advertises `tool_calls`.
25697
+ */
25698
+ function resolveOpenAiFrontier(opts) {
25699
+ return firstPresentInCatalog(OPENAI_FRONTIER_MODELS, opts);
25700
+ }
25679
25701
  function standInToolEnabled() {
25680
25702
  const models = state.models?.data;
25681
25703
  if (!models) return false;
@@ -25684,13 +25706,44 @@ function standInToolEnabled() {
25684
25706
  const hasGeminiPro = geminiAvailable();
25685
25707
  return hasOpenAi && hasOpus && hasGeminiPro;
25686
25708
  }
25687
- /** Return the model for the native OpenAI subagents (implementer, debugger,
25688
- * qa-engineer) iff it is live with tool calls. Prefers `gpt-5.6-sol`, falls
25689
- * back to `gpt-5.5`. One gate governs all three — they need the same frontier
25690
- * model. */
25709
+ /** Model for the native subagents that want the OpenAI frontier coder
25710
+ * (`implementer`, `reviewer`) iff it is live with tool calls. Prefers
25711
+ * `gpt-5.6-sol`, falls back to `gpt-5.5`. Absent those agents omit their
25712
+ * `model:` line and inherit the lead's model. */
25691
25713
  function nativeSubagentModel() {
25692
25714
  return resolveOpenAiFrontier({ requireToolCalls: true });
25693
25715
  }
25716
+ /** Model for `brainstorm`. Absent → inherits the lead's model.
25717
+ *
25718
+ * Leads with Google so the options it generates come from a third lab: the
25719
+ * Anthropic lead is the producer and the OpenAI frontier already backs
25720
+ * `implementer`/`reviewer`, so a same-lab brainstormer would mostly restate
25721
+ * what the lead already thought of. */
25722
+ function brainstormModel() {
25723
+ return firstPresentInCatalog([REVIEW_DEFAULT_MODEL, ...OPENAI_FRONTIER_MODELS], { requireToolCalls: true });
25724
+ }
25725
+ /** Model for `scribe`. Absent → inherits the lead's model.
25726
+ *
25727
+ * Leads with the mid tier: documentation is verifiable prose, not frontier
25728
+ * reasoning. */
25729
+ function scribeModel() {
25730
+ return firstPresentInCatalog(["gpt-5.6-terra", ...OPENAI_FRONTIER_MODELS], { requireToolCalls: true });
25731
+ }
25732
+ /**
25733
+ * Model for `scout` — CHEAP TIER ONLY, with no frontier fallback on purpose.
25734
+ *
25735
+ * `scout` exists so a foreground repository lookup does not run at the lead's
25736
+ * model rates. The usual "absent → omit `model:` and inherit the lead" fallback
25737
+ * would therefore defeat the agent: on a thin or briefly-unavailable catalog it
25738
+ * would silently start answering grep-and-summarize questions on Opus, which is
25739
+ * the exact cost it was added to avoid. Returning undefined here makes the
25740
+ * caller drop the agent instead, so the lead falls back to the CLI's `Explore`
25741
+ * (same behavior as before `scout` existed) rather than to an expensive
25742
+ * impostor wearing the cheap agent's name.
25743
+ */
25744
+ function scoutModel() {
25745
+ return firstPresentInCatalog([EXPLORE_DEFAULT_MODEL, DEFAULT_MODEL], { requireToolCalls: true });
25746
+ }
25694
25747
  /**
25695
25748
  * Gate for the worker tools (`explore`, `review`, `implement`).
25696
25749
  *
@@ -32956,9 +33009,12 @@ function buildAgentPrompt(persona, opts) {
32956
33009
  * of the live catalog). The raw `mcp__<workers>__*` tools are named only
32957
33010
  * as the guarded plumbing the dispatchers call, never as a main-agent
32958
33011
  * interface.
32959
- * - Always names the implementer/debugger/qa-engineer native subagents
32960
- * (they are injected unconditionally); the implementer-vs-`worker-implement`
32961
- * contrast is added only when worker tools are available.
33012
+ * - Always names the implementer/reviewer/brainstorm/scribe native subagents
33013
+ * (they are injected unconditionally, degrading to the lead's model rather
33014
+ * than disappearing); `scout` is named only when `scoutAvailable` is not
33015
+ * false, because it is dropped outright when no cheap-tier model resolves.
33016
+ * The implementer-vs-`worker-implement` contrast is added only when worker
33017
+ * tools are available.
32962
33018
  * - Conditionally lists stand_in only when `standInAvailable`
32963
33019
  * (mirrors `standInToolEnabled()`).
32964
33020
  * - Conditionally lists gh-first-mate only when `agentToolsAvailable`
@@ -32990,7 +33046,7 @@ function buildPeerAwarenessSnippet(opts) {
32990
33046
  const codexCliClause = opts.codexCli ? " `mcp__codex-cli__codex` dispatches to `codex-implementer` (gpt-5.3-codex with workspace-write) for end-to-end coding tasks." : "";
32991
33047
  const para2Parts = [`\`mcp__${searchKey}__code\` is the one-stop code search (no extra model call). Its DEFAULT mode (or \`mode:"semantic"\`) ranks by MEANING via ColBERT over a per-workspace index, the first thing to reach for on intent/concept questions ("where is retry/backoff handled", "how does auth work"); when that index isn't ready it transparently falls back to lexical (the response \`source\` says which engine ran). Forced modes cover the rest: \`lexical\` (BM25F-ranked + tree-sitter, best for exact symbols), \`exact\`, \`regex\`, \`complete\` (exhaustive set), \`ast_pattern\`+\`ast_lang\` for multi-line AST shapes, \`scan\` for a whole-workspace symbol outline, \`multiline\` for cross-line regex. Multiple queries can run in a single turn. The index covers code-shaped files; for unstructured files (logs, \`.csv\`, \`.env*\`, config-only wiring), \`grep\`/\`glob\` still apply.`];
32992
33048
  if (opts.workerToolsAvailable) para2Parts.push(`\`worker-*\` are background Agent subagents (subagent_type) that run the matching worker in its own context and deliver the result as a completion notification, so a long run never blocks the turn: \`worker-explore\` (read-only research), \`worker-review\` (reads the code to verify a change or claim), \`worker-plan\` (ordered implementation plan), \`worker-implement\` (edit/write/bash; ALWAYS runs in an isolated git worktree and returns the diff via a saved patch file; for in-place edits use the \`implementer\` subagent), \`worker-test\` (independent test author; also always worktree-isolated). The raw \`mcp__${workersKey}__*\` tools they call are guarded (a direct main-thread call is redirected to the matching agent); Workers themselves have \`code_search\`.`);
32993
- para2Parts.push(`Three native subagents are always available (Task): \`implementer\` (bounded implementation), \`debugger\` (reproduce + isolate a failure's root cause), and \`qa-engineer\` (review + author/run tests), each in its own context so the lead's context stays free; on gpt-5.6-sol when in the catalog, else the lead's model.`);
33049
+ para2Parts.push(`Native subagents (Task), each in its own context so heavy work never fills yours: \`implementer\` (you know what to build), \`reviewer\` (something exists and you want it assessed, including reproducing and root-causing a failure), \`brainstorm\` (you do not yet know which approach to take)${opts.scoutAvailable === false ? "" : ", `scout` (find or understand something in the repo, cheap)"}, \`scribe\` (docs and ADRs that trail the code).`);
32994
33050
  if (opts.workerToolsAvailable) para2Parts.push(`For a bounded, well-scoped implementation, prefer the \`implementer\` subagent over \`worker-implement\`; reach for \`worker-implement\` only when you specifically need git-worktree isolation, parallel variants, or a throwaway experiment.`);
32995
33051
  if (opts.workerToolsAvailable) para2Parts.push(`\`mcp__${orchestrateKey}__decompose\` composes an open-ended ask into a typed, VERIFIED workflow IR (a strong driver decorrelated by a cross-lab critic, so the decompose step isn't a single point of failure), and \`mcp__${orchestrateKey}__run_workflow\` executes that IR through a frozen kernel delivering max(orchestrated, baseline) over a sealed executable gate, so it never ships worse than a plain single-model run. \`mcp__${orchestrateKey}__verify_workflow\` checks an IR's floor invariants before you run it, and \`mcp__${orchestrateKey}__attest_step\` audits that a finished run's producers were each checked by a different lab. They suit non-trivial, role-separated asks; a trivial ask does not need them.`);
32996
33052
  else para2Parts.push(`\`mcp__${orchestrateKey}__verify_workflow\` statically checks a workflow IR's floor invariants and \`mcp__${orchestrateKey}__attest_step\` audits a run's cross-lab lineage (the \`decompose\`/\`run_workflow\` composer + kernel need the worker backend, unavailable here).`);
@@ -34211,5 +34267,5 @@ function enumerateInjectedMcpToolNames(groupKeys, opts = {}) {
34211
34267
  }
34212
34268
 
34213
34269
  //#endregion
34214
- export { searchWeb as $, UPSTREAM_FETCH_TIMEOUT_MS as $t, trustRepo as A, createResponses as At, TEST_DEFAULT_MODEL as B, warmTreeSitterPool as Bt, fileLastPromptStore as C, copilotBaseUrl as Cn, shimDefaultsToXhigh as Ct, repoRoot as D, assembleResponsesPayload as Dt, repoFingerprint as E, state as En, getTokenCount as Et, EXPLORE_DEFAULT_MODEL as F, provisionBrowserAssets as Ft, buildEnv as G, buildWorkspaceHeaderHelperCommand as Gt, resolveModeDefaults as H, DEFINITION_OF_GREATNESS as Ht, EXPLORE_DEFAULT_THINKING as I, hasSupportedBrowserInstalled as It, toolbeltEnabled as J, toolbeltPathOverride as Jt, availableToolCommands as K, buildWorkspaceHeaderJson as Kt, IMPLEMENT_DEFAULT_MODEL as L, provisionAndIndexColbert as Lt, resolveSealedGate as M, MAX_RESPONSE_BODY_BYTES as Mt, BROWSE_DEFAULT_MODEL as N, readResponseBodyCapped as Nt, stopGateEnabledForRepo as O, resolveMcpToolTimeoutMs as Ot, DEFAULT_MODEL as P, parseJsonOrDiagnose as Pt, assetFor as Q, DEFAULT_PORT as Qt, PLAN_DEFAULT_MODEL as R, extractTarGzMember as Rt, fileFindingsStore as S, GITHUB_API_BASE_URL as Sn, workerToolsEnabled as St, isSubagentContext as T, githubHeaders as Tn, createMessages as Tt, resolveWorkerRunOpts as U, shouldUseInsecureTls as Ut, appendPlanReminder as V, CONDENSED_OPERATING_SEQUENCE as Vt, runWorkerAgent as W, ArtifactClient as Wt, vscodeRipgrepPath as X, DEFAULT_CODEX_MODEL as Xt, toolbeltSkipSet as Y, DEFAULT_CLAUDE_MODEL_FALLBACKS as Yt, TOOLBELT_TOOLS$1 as Z, DEFAULT_CODEX_MODEL_FALLBACKS as Zt, stopGateDisabled as _, getModels as _n, browserToolsEnabled as _t, buildPeerAwarenessSnippet as a, setupCopilotToken as an, buildAnthropicErrorEvent as at, stopReviewEnabled as b, HTTPError as bn, nativeSubagentModel as bt, personasFor as c, tryRefreshAndRetry as cn, logStreamError as ct, buildStopHookCommand as d, cacheVSCodeVersion as dn, handleMcpDelete as dt, UPSTREAM_INACTIVITY_TIMEOUT_MS as en, ADVISOR_INTERNAL_TOOL_NAME as et, captureLaunchBaseline as f, filterBetaHeader as fn, handleMcpPost as ft, launchBaselineKey as g, sleep as gn, browserCompoundToolsEnabled as gt, injectStopHookIntoSettingsFile as h, resolveModel as hn, browseAgentEnabled as ht, buildAgentPrompt as i, withInstallLock as in, isAdvisorRequested as it, liveExec as j, createChatCompletions as jt, stopReviewStateDir as k, pickEndpoint as kt, buildArtifactOpenHookCommand as l, cacheCopilotVersion as ln, readIteratorWithTimeout as lt, fileBlockBudget as m, resolveCodexModel as mn, artifactToolsEnabled as mt, MCP_GROUPS as n, pickClaudeDefault as nn, buildAdvisorStream as nt, buildPeerAwarenessSummary as o, setupGitHubAgentToken as on, buildOpenAIErrorEvent as ot, decideStopHook as p, isNullish as pn, agentToolsEnabled as pt, buildToolbeltAwareness as q, collapsePathKeys as qt, assertMcpToolSurfaceConsistent as r, getPackageVersion as rn, injectAdvisorTool as rt, enumerateInjectedMcpToolNames as s, setupGitHubToken as sn, isControllerClosedError as st, GROUP_META as t, generateRandomPort as tn, ADVISOR_TOOL_INSTRUCTIONS as tt, buildSessionBindHookCommand as u, cacheModels as un, relayAnthropicStream as ut, stopGateId as v, getGitHubUser as vn, fleetToolsEnabled as vt, fileReviewDebounce as w, copilotHeaders as wn, countTokens as wt, fileBaselineStore as x, forwardError as xn, standInToolEnabled as xt, stopGatePlanMode as y, fetchWithTransientRetry as yn, geminiAvailable as yt, REVIEW_DEFAULT_MODEL as z, extractZipMember as zt };
34215
- //# sourceMappingURL=peer-mcp-personas-BKwMCOsl.js.map
34270
+ export { searchWeb as $, DEFAULT_CODEX_MODEL as $t, trustRepo as A, assembleResponsesPayload as At, TEST_DEFAULT_MODEL as B, provisionAndIndexColbert as Bt, fileLastPromptStore as C, HTTPError as Cn, scribeModel as Ct, repoRoot as D, copilotHeaders as Dn, countTokens as Dt, repoFingerprint as E, copilotBaseUrl as En, shimDefaultsToXhigh as Et, EXPLORE_DEFAULT_MODEL as F, MAX_RESPONSE_BODY_BYTES as Ft, buildEnv as G, DEFINITION_OF_GREATNESS as Gt, resolveModeDefaults as H, extractZipMember as Ht, EXPLORE_DEFAULT_THINKING as I, readResponseBodyCapped as It, toolbeltEnabled as J, buildWorkspaceHeaderHelperCommand as Jt, availableToolCommands as K, shouldUseInsecureTls as Kt, IMPLEMENT_DEFAULT_MODEL as L, parseJsonOrDiagnose as Lt, resolveSealedGate as M, pickEndpoint as Mt, BROWSE_DEFAULT_MODEL as N, createResponses as Nt, stopGateEnabledForRepo as O, githubHeaders as On, createMessages as Ot, DEFAULT_MODEL as P, createChatCompletions as Pt, assetFor as Q, DEFAULT_CLAUDE_MODEL_FALLBACKS as Qt, PLAN_DEFAULT_MODEL as R, provisionBrowserAssets as Rt, fileFindingsStore as S, fetchWithTransientRetry as Sn, scoutModel as St, isSubagentContext as T, GITHUB_API_BASE_URL as Tn, workerToolsEnabled as Tt, resolveWorkerRunOpts as U, warmTreeSitterPool as Ut, appendPlanReminder as V, extractTarGzMember as Vt, runWorkerAgent as W, CONDENSED_OPERATING_SEQUENCE as Wt, vscodeRipgrepPath as X, collapsePathKeys as Xt, toolbeltSkipSet as Y, buildWorkspaceHeaderJson as Yt, TOOLBELT_TOOLS$1 as Z, toolbeltPathOverride as Zt, stopGateDisabled as _, resolveCodexModel as _n, browserCompoundToolsEnabled as _t, buildPeerAwarenessSnippet as a, pickClaudeDefault as an, buildAnthropicErrorEvent as at, stopReviewEnabled as b, getModels as bn, geminiAvailable as bt, personasFor as c, setupCopilotToken as cn, logStreamError as ct, buildStopHookCommand as d, tryRefreshAndRetry as dn, handleMcpDelete as dt, DEFAULT_CODEX_MODEL_FALLBACKS as en, ADVISOR_INTERNAL_TOOL_NAME as et, captureLaunchBaseline as f, cacheCopilotVersion as fn, handleMcpPost as ft, launchBaselineKey as g, isNullish as gn, browseAgentEnabled as gt, injectStopHookIntoSettingsFile as h, filterBetaHeader as hn, brainstormModel as ht, buildAgentPrompt as i, generateRandomPort as in, isAdvisorRequested as it, liveExec as j, resolveMcpToolTimeoutMs as jt, stopReviewStateDir as k, state as kn, getTokenCount as kt, buildArtifactOpenHookCommand as l, setupGitHubAgentToken as ln, readIteratorWithTimeout as lt, fileBlockBudget as m, cacheVSCodeVersion as mn, artifactToolsEnabled as mt, MCP_GROUPS as n, UPSTREAM_FETCH_TIMEOUT_MS as nn, buildAdvisorStream as nt, buildPeerAwarenessSummary as o, getPackageVersion as on, buildOpenAIErrorEvent as ot, decideStopHook as p, cacheModels as pn, agentToolsEnabled as pt, buildToolbeltAwareness as q, ArtifactClient as qt, assertMcpToolSurfaceConsistent as r, UPSTREAM_INACTIVITY_TIMEOUT_MS as rn, injectAdvisorTool as rt, enumerateInjectedMcpToolNames as s, withInstallLock as sn, isControllerClosedError as st, GROUP_META as t, DEFAULT_PORT as tn, ADVISOR_TOOL_INSTRUCTIONS as tt, buildSessionBindHookCommand as u, setupGitHubToken as un, relayAnthropicStream as ut, stopGateId as v, resolveModel as vn, browserToolsEnabled as vt, fileReviewDebounce as w, forwardError as wn, standInToolEnabled as wt, fileBaselineStore as x, getGitHubUser as xn, nativeSubagentModel as xt, stopGatePlanMode as y, sleep as yn, fleetToolsEnabled as yt, REVIEW_DEFAULT_MODEL as z, hasSupportedBrowserInstalled as zt };
34271
+ //# sourceMappingURL=peer-mcp-personas-B-EPdjSE.js.map