github-router 0.3.129 → 0.3.131

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.
@@ -1083,6 +1083,9 @@ var ArtifactClient = class {
1083
1083
  agentReply(text, signal) {
1084
1084
  return this.request("POST", `/api/artifact/${encodeURIComponent(this.sessionId)}/agent-reply`, { text }, signal, void 0, true);
1085
1085
  }
1086
+ end(signal) {
1087
+ return this.request("POST", `/api/artifact/${encodeURIComponent(this.sessionId)}/end`, void 0, signal, void 0, true);
1088
+ }
1086
1089
  async request(method, pathname, body, signal, timeoutMsHint, allowEmptyJson = false) {
1087
1090
  let url;
1088
1091
  try {
@@ -1286,6 +1289,15 @@ const ARTIFACT_TOOLS = Object.freeze([
1286
1289
  ...await clientFromEnv(env).agentReply(text, signal),
1287
1290
  next_step: "Wait for further human review, or continue if the review loop is complete."
1288
1291
  });
1292
+ }),
1293
+ tool("artifact_end", "End/close the ai-or-die Artifact review panel when the review loop is complete. Only works inside an ai-or-die tab-backed Claude session.", objectSchema$1({}, []), async (_args, signal) => {
1294
+ const env = readArtifactEnv();
1295
+ if (!env) return missingEnvResult();
1296
+ return ok$1({
1297
+ ok: true,
1298
+ ...await clientFromEnv(env).end(signal),
1299
+ next_step: "Artifact review loop ended."
1300
+ });
1289
1301
  })
1290
1302
  ]);
1291
1303
  function readArtifactEnv() {
@@ -14856,7 +14868,7 @@ function standInToolEnabled() {
14856
14868
  *
14857
14869
  * Returns true iff BOTH:
14858
14870
  * 1. Copilot's live catalog (`state.models?.data`) contains the
14859
- * worker default model (`gemini-3.5-flash`, used by explore/review)
14871
+ * worker default model (`gpt-5.4-mini`, used by explore)
14860
14872
  * AND that entry advertises `capabilities.supports.tool_calls ===
14861
14873
  * true`. The worker loop is function-calling; a model that can't
14862
14874
  * emit tool_calls is unusable, so dormant-register (omit from
@@ -18810,22 +18822,31 @@ async function createWorktree(workspaceAbs, opts) {
18810
18822
  */
18811
18823
  const WORKTREE_REGISTRY = new WorktreeRegistry();
18812
18824
  registerExitHandlers(WORKTREE_REGISTRY);
18813
- /** Default model + thinking for the READ-ONLY worker modes (`explore`,
18814
- * `review`). `gemini-3.5-flash` at `high` (its top reasoning tier) — fast,
18815
- * 1M-context, tool-call-capable.
18825
+ /** Default model + thinking for the `explore` mode. `gpt-5.4-mini` at
18826
+ * `xhigh` fast, cheap, 400k-context, tool-call-capable, with tight
18827
+ * function-calling-loop discipline.
18816
18828
  *
18817
- * HISTORY / CAVEAT: an earlier iteration moved OFF flash to
18818
- * `gemini-3.1-pro-preview` because *that* flash early-stopped with empty
18819
- * turns on the function-calling loop. `gemini-3.5-flash` is a NEWER model
18820
- * and is being re-evaluated for the read-only workload, where parallel
18821
- * read/search batches and sound stop/continue decisions matter. If it
18822
- * regresses to early-stopping, revert this to `gemini-3.1-pro-preview`.
18829
+ * HISTORY / CAVEAT: earlier iterations used `gemini-3.1-pro-preview` then
18830
+ * `gemini-3.5-flash`; both flash defaults early-stopped with empty turns
18831
+ * on the function-calling loop (read a file then end the turn with no
18832
+ * summary), which the single no-output retry couldn't reliably recover.
18833
+ * `gpt-5.4-mini` does not show that pathology and is the proven `browse`
18834
+ * default. Routed through `/responses` by the stream-fn endpoint split.
18823
18835
  *
18824
18836
  * Exported so the MCP handler + the gate (`workerToolsEnabled`) read the
18825
18837
  * same constant — drift would ship a tool whose docs/gate disagree with
18826
18838
  * its runtime default. Caller can override per call via the `model` arg. */
18827
- const DEFAULT_MODEL = "gemini-3.5-flash";
18828
- const DEFAULT_THINKING = "high";
18839
+ const DEFAULT_MODEL = "gpt-5.4-mini";
18840
+ const DEFAULT_THINKING = "xhigh";
18841
+ /** Default model + thinking for the READ-ONLY `review` mode. `gpt-5.5` at
18842
+ * `xhigh` — the strongest reasoning tier, 1M+ context, so the reviewer
18843
+ * has full headroom to verify correctness against the actual code. Same
18844
+ * model as `implement`; like it, this is NOT a `workerToolsEnabled` gate
18845
+ * input — if absent (e.g. a non-enterprise tier) `review` errors helpfully
18846
+ * at call time rather than vanishing the whole worker surface. Caller can
18847
+ * override per call via the `model` arg. */
18848
+ const REVIEW_DEFAULT_MODEL = "gpt-5.5";
18849
+ const REVIEW_DEFAULT_THINKING = "xhigh";
18829
18850
  /** Default model + thinking for the READ+WRITE `implement` mode. `gpt-5.5`
18830
18851
  * at `xhigh` — the strongest reasoning tier in the catalog, 1M+ context,
18831
18852
  * routed through `/responses` by the stream-fn endpoint split. Coding edits
@@ -18952,9 +18973,10 @@ async function runWorkerAgentOnce(opts) {
18952
18973
  try {
18953
18974
  const isBrowse = opts.mode === "browse";
18954
18975
  const isPlan = opts.mode === "plan";
18976
+ const isReview = opts.mode === "review";
18955
18977
  const isWriteCapable = opts.mode === "implement" || opts.mode === "test";
18956
- const defaultModel = isBrowse ? BROWSE_DEFAULT_MODEL : isPlan ? PLAN_DEFAULT_MODEL : isWriteCapable ? IMPLEMENT_DEFAULT_MODEL : DEFAULT_MODEL;
18957
- const defaultThinking = isBrowse ? BROWSE_DEFAULT_THINKING : isPlan ? PLAN_DEFAULT_THINKING : isWriteCapable ? IMPLEMENT_DEFAULT_THINKING : DEFAULT_THINKING;
18978
+ const defaultModel = isBrowse ? BROWSE_DEFAULT_MODEL : isPlan ? PLAN_DEFAULT_MODEL : isReview ? REVIEW_DEFAULT_MODEL : isWriteCapable ? IMPLEMENT_DEFAULT_MODEL : DEFAULT_MODEL;
18979
+ const defaultThinking = isBrowse ? BROWSE_DEFAULT_THINKING : isPlan ? PLAN_DEFAULT_THINKING : isReview ? REVIEW_DEFAULT_THINKING : isWriteCapable ? IMPLEMENT_DEFAULT_THINKING : DEFAULT_THINKING;
18958
18980
  const resolved = resolveModelAndThinking({
18959
18981
  model: opts.model ?? defaultModel,
18960
18982
  thinking: opts.thinking ?? defaultThinking
@@ -21853,7 +21875,7 @@ const NON_PERSONA_MCP_TOOLS = Object.freeze([
21853
21875
  toolNameHttp: "explore",
21854
21876
  group: "workers",
21855
21877
  capability: "worker",
21856
- description: "Read-only investigation by an autonomous worker (Pi runtime; default model `gemini-3.5-flash` at high reasoning, override via the `model` arg with any Copilot-catalog model that advertises `tool_calls`). Tools: read, glob, grep, code_search (semantic-first), web_search, fetch_url, advisor (consult a stronger cross-lab model), update_plan (planning checklist), and toolbelt (run a read-only analysis CLI: rg/fd/jq/yq/sg/gron/tokei/difft/git). The worker's system prompt sandboxes it and gives one-line descriptions of each tool, so brief it on the investigation, not on tool semantics. Offloads bounded research that would otherwise eat your context window — the worker plans its own tool calls and returns a single text answer. Examples: \"find files matching X then summarize\", \"how does library Y handle Z\", \"survey this codebase for usages of deprecated API\".",
21878
+ description: "Read-only investigation by an autonomous worker (Pi runtime; default model `gpt-5.4-mini` at xhigh reasoning, override via the `model` arg with any Copilot-catalog model that advertises `tool_calls`). Tools: read, glob, grep, code_search (semantic-first), web_search, fetch_url, advisor (consult a stronger cross-lab model), update_plan (planning checklist), and toolbelt (run a read-only analysis CLI: rg/fd/jq/yq/sg/gron/tokei/difft/git). The worker's system prompt sandboxes it and gives one-line descriptions of each tool, so brief it on the investigation, not on tool semantics. Offloads bounded research that would otherwise eat your context window — the worker plans its own tool calls and returns a single text answer. Examples: \"find files matching X then summarize\", \"how does library Y handle Z\", \"survey this codebase for usages of deprecated API\".",
21857
21879
  inputSchema: {
21858
21880
  type: "object",
21859
21881
  required: ["prompt"],
@@ -21865,7 +21887,7 @@ const NON_PERSONA_MCP_TOOLS = Object.freeze([
21865
21887
  },
21866
21888
  model: {
21867
21889
  type: "string",
21868
- description: "Optional Copilot catalog model id (defaults to gemini-3.5-flash). Must advertise tool_calls support; the engine emits an isError envelope listing the eligible catalog models on mismatch."
21890
+ description: "Optional Copilot catalog model id (defaults to gpt-5.4-mini). Must advertise tool_calls support; the engine emits an isError envelope listing the eligible catalog models on mismatch."
21869
21891
  },
21870
21892
  thinking: {
21871
21893
  type: "string",
@@ -21945,7 +21967,7 @@ const NON_PERSONA_MCP_TOOLS = Object.freeze([
21945
21967
  toolNameHttp: "review",
21946
21968
  group: "workers",
21947
21969
  capability: "worker",
21948
- description: "Read-only code review by an autonomous worker (Pi runtime; default model `gemini-3.5-flash`, override via `model` with any Copilot-catalog model that advertises `tool_calls`). Same read-only toolset as `explore` (read, glob, grep, code_search, web_search, fetch_url, advisor, update_plan, toolbelt) — it CANNOT edit — but the worker is framed as a reviewer: it verifies correctness against the actual code itself rather than trusting a claim, and reports findings (bugs, edge cases, security / concurrency / resource risks, missing handling) with a severity and `file:line`. Brief it with the change / diff / claim to verify (paste it, or name the files) — it reads the code to confirm, so you get a self-verifying second opinion that doesn't depend on you having pre-extracted the relevant code. Unlike the `peers` critics (single stateless model calls on the artifact you paste), this worker can navigate the repo to check surrounding context for itself.",
21970
+ description: "Read-only code review by an autonomous worker (Pi runtime; default model `gpt-5.5` at xhigh reasoning, override via `model` with any Copilot-catalog model that advertises `tool_calls`). Same read-only toolset as `explore` (read, glob, grep, code_search, web_search, fetch_url, advisor, update_plan, toolbelt) — it CANNOT edit — but the worker is framed as a reviewer: it verifies correctness against the actual code itself rather than trusting a claim, and reports findings (bugs, edge cases, security / concurrency / resource risks, missing handling) with a severity and `file:line`. Brief it with the change / diff / claim to verify (paste it, or name the files) — it reads the code to confirm, so you get a self-verifying second opinion that doesn't depend on you having pre-extracted the relevant code. Unlike the `peers` critics (single stateless model calls on the artifact you paste), this worker can navigate the repo to check surrounding context for itself.",
21949
21971
  inputSchema: {
21950
21972
  type: "object",
21951
21973
  required: ["prompt"],
@@ -21957,7 +21979,7 @@ const NON_PERSONA_MCP_TOOLS = Object.freeze([
21957
21979
  },
21958
21980
  model: {
21959
21981
  type: "string",
21960
- description: "Optional Copilot catalog model id (defaults to gemini-3.5-flash). Must advertise tool_calls support; the engine emits an isError envelope listing the eligible catalog models on mismatch."
21982
+ description: "Optional Copilot catalog model id (defaults to gpt-5.5). Must advertise tool_calls support; the engine emits an isError envelope listing the eligible catalog models on mismatch."
21961
21983
  },
21962
21984
  thinking: {
21963
21985
  type: "string",
@@ -21989,7 +22011,7 @@ const NON_PERSONA_MCP_TOOLS = Object.freeze([
21989
22011
  toolNameHttp: "plan",
21990
22012
  group: "workers",
21991
22013
  capability: "worker",
21992
- description: "Read-only implementation planning by an autonomous worker (Pi runtime; default model `gemini-3.5-flash`, override via `model` with any Copilot-catalog model that advertises `tool_calls`). Same read-only toolset as `explore` (read, glob, grep, code_search, web_search, fetch_url, advisor, update_plan, toolbelt) — it CANNOT edit — but the worker is framed as a planner: from the task and acceptance criteria it produces a concrete, ordered implementation plan (the files to change, the approach, the key risks, and how each acceptance criterion will be verified), grounded by reading the actual code. Brief it with the task and any acceptance criteria; it returns a single plan, not code.",
22014
+ description: "Read-only implementation planning by an autonomous worker (Pi runtime; default model `claude-opus-4.8`, override via `model` with any Copilot-catalog model that advertises `tool_calls`). Same read-only toolset as `explore` (read, glob, grep, code_search, web_search, fetch_url, advisor, update_plan, toolbelt) — it CANNOT edit — but the worker is framed as a planner: from the task and acceptance criteria it produces a concrete, ordered implementation plan (the files to change, the approach, the key risks, and how each acceptance criterion will be verified), grounded by reading the actual code. Brief it with the task and any acceptance criteria; it returns a single plan, not code.",
21993
22015
  inputSchema: {
21994
22016
  type: "object",
21995
22017
  required: ["prompt"],
@@ -22001,7 +22023,7 @@ const NON_PERSONA_MCP_TOOLS = Object.freeze([
22001
22023
  },
22002
22024
  model: {
22003
22025
  type: "string",
22004
- description: "Optional Copilot catalog model id (defaults to gemini-3.5-flash). Must advertise tool_calls support; the engine emits an isError envelope listing the eligible catalog models on mismatch."
22026
+ description: "Optional Copilot catalog model id (defaults to claude-opus-4.8). Must advertise tool_calls support; the engine emits an isError envelope listing the eligible catalog models on mismatch."
22005
22027
  },
22006
22028
  thinking: {
22007
22029
  type: "string",
@@ -22683,5 +22705,5 @@ async function runStandInToolCall(args, signal) {
22683
22705
  }
22684
22706
 
22685
22707
  //#endregion
22686
- export { handleMcpDelete as $, IMPLEMENT_DEFAULT_MODEL as A, setupCopilotToken as At, TOOLBELT_TOOLS$1 as B, sleep as Bt, stopGateEnabledForRepo as C, DEFAULT_PORT as Ct, liveExec as D, pickClaudeDefault as Dt, resolveSealedGate as E, generateRandomPort as Et, availableToolCommands as F, cacheVSCodeVersion as Ft, buildAdvisorStream as G, GITHUB_API_BASE_URL as Gt, searchWeb as H, fetchWithTransientRetry as Ht, buildToolbeltAwareness as I, filterBetaHeader as It, buildOpenAIErrorEvent as J, githubHeaders as Jt, injectAdvisorTool as K, copilotBaseUrl as Kt, toolbeltEnabled as L, isNullish as Lt, appendPlanReminder as M, tryRefreshAndRetry as Mt, runWorkerAgent as N, cacheCopilotVersion as Nt, BROWSE_DEFAULT_MODEL as O, getPackageVersion as Ot, withNoOutputRetry as P, cacheModels as Pt, relayAnthropicStream as Q, toolbeltSkipSet as R, resolveCodexModel as Rt, repoRoot as S, DEFAULT_CODEX_MODEL_FALLBACKS as St, trustRepo as T, UPSTREAM_INACTIVITY_TIMEOUT_MS as Tt, ADVISOR_INTERNAL_TOOL_NAME as U, HTTPError as Ut, assetFor as V, getModels as Vt, ADVISOR_TOOL_INSTRUCTIONS as W, forwardError as Wt, logStreamError as X, isControllerClosedError as Y, state as Yt, readIteratorWithTimeout as Z, fileFindingsStore as _, extractZipMember as _t, buildPeerAwarenessSnippet as a, countTokens as at, isSubagentContext as b, DEFAULT_CLAUDE_MODEL_FALLBACKS as bt, buildStopHookCommand as c, createResponses as ct, fileBlockBudget as d, readResponseBodyCapped as dt, handleMcpPost as et, injectStopHookIntoSettingsFile as f, parseJsonOrDiagnose as ft, fileBaselineStore as g, extractTarGzMember as gt, stopReviewEnabled as h, provisionAndIndexColbert as ht, buildAgentPrompt as i, workerToolsEnabled as it, PLAN_DEFAULT_MODEL as j, setupGitHubToken as jt, DEFAULT_MODEL as k, withInstallLock as kt, captureLaunchBaseline as l, createChatCompletions as lt, stopGateId as m, hasSupportedBrowserInstalled as mt, MCP_GROUPS as n, fleetToolsEnabled as nt, personasFor as o, createMessages as ot, launchBaselineKey as p, provisionBrowserAssets as pt, isAdvisorRequested as q, copilotHeaders as qt, assertMcpToolSurfaceConsistent as r, standInToolEnabled as rt, buildSessionBindHookCommand as s, getTokenCount as st, GROUP_META as t, browserToolsEnabled as tt, decideStopHook as u, MAX_RESPONSE_BODY_BYTES as ut, fileLastPromptStore as v, collapsePathKeys as vt, stopReviewStateDir as w, UPSTREAM_FETCH_TIMEOUT_MS as wt, repoFingerprint as x, DEFAULT_CODEX_MODEL as xt, fileReviewDebounce as y, toolbeltPathOverride as yt, vscodeRipgrepPath as z, resolveModel as zt };
22687
- //# sourceMappingURL=peer-mcp-personas-B1Oqydxt.js.map
22708
+ export { relayAnthropicStream as $, IMPLEMENT_DEFAULT_MODEL as A, withInstallLock as At, vscodeRipgrepPath as B, resolveModel as Bt, stopGateEnabledForRepo as C, DEFAULT_CODEX_MODEL_FALLBACKS as Ct, liveExec as D, generateRandomPort as Dt, resolveSealedGate as E, UPSTREAM_INACTIVITY_TIMEOUT_MS as Et, withNoOutputRetry as F, cacheModels as Ft, ADVISOR_TOOL_INSTRUCTIONS as G, forwardError as Gt, assetFor as H, getModels as Ht, availableToolCommands as I, cacheVSCodeVersion as It, isAdvisorRequested as J, copilotHeaders as Jt, buildAdvisorStream as K, GITHUB_API_BASE_URL as Kt, buildToolbeltAwareness as L, filterBetaHeader as Lt, REVIEW_DEFAULT_MODEL as M, setupGitHubToken as Mt, appendPlanReminder as N, tryRefreshAndRetry as Nt, BROWSE_DEFAULT_MODEL as O, pickClaudeDefault as Ot, runWorkerAgent as P, cacheCopilotVersion as Pt, readIteratorWithTimeout as Q, toolbeltEnabled as R, isNullish as Rt, repoRoot as S, DEFAULT_CODEX_MODEL as St, trustRepo as T, UPSTREAM_FETCH_TIMEOUT_MS as Tt, searchWeb as U, fetchWithTransientRetry as Ut, TOOLBELT_TOOLS$1 as V, sleep as Vt, ADVISOR_INTERNAL_TOOL_NAME as W, HTTPError as Wt, isControllerClosedError as X, state as Xt, buildOpenAIErrorEvent as Y, githubHeaders as Yt, logStreamError as Z, fileFindingsStore as _, extractTarGzMember as _t, buildPeerAwarenessSnippet as a, workerToolsEnabled as at, isSubagentContext as b, toolbeltPathOverride as bt, buildStopHookCommand as c, getTokenCount as ct, fileBlockBudget as d, MAX_RESPONSE_BODY_BYTES as dt, handleMcpDelete as et, injectStopHookIntoSettingsFile as f, readResponseBodyCapped as ft, fileBaselineStore as g, provisionAndIndexColbert as gt, stopReviewEnabled as h, hasSupportedBrowserInstalled as ht, buildAgentPrompt as i, standInToolEnabled as it, PLAN_DEFAULT_MODEL as j, setupCopilotToken as jt, DEFAULT_MODEL as k, getPackageVersion as kt, captureLaunchBaseline as l, createResponses as lt, stopGateId as m, provisionBrowserAssets as mt, MCP_GROUPS as n, browserToolsEnabled as nt, personasFor as o, countTokens as ot, launchBaselineKey as p, parseJsonOrDiagnose as pt, injectAdvisorTool as q, copilotBaseUrl as qt, assertMcpToolSurfaceConsistent as r, fleetToolsEnabled as rt, buildSessionBindHookCommand as s, createMessages as st, GROUP_META as t, handleMcpPost as tt, decideStopHook as u, createChatCompletions as ut, fileLastPromptStore as v, extractZipMember as vt, stopReviewStateDir as w, DEFAULT_PORT as wt, repoFingerprint as x, DEFAULT_CLAUDE_MODEL_FALLBACKS as xt, fileReviewDebounce as y, collapsePathKeys as yt, toolbeltSkipSet as z, resolveCodexModel as zt };
22709
+ //# sourceMappingURL=peer-mcp-personas-CH2gmdPN.js.map