zidane 7.0.16 → 7.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +3 -5
  2. package/dist/{acp-Bw2b_kka.js → acp-BgNj1-gv.js} +4 -4
  3. package/dist/{acp-Bw2b_kka.js.map → acp-BgNj1-gv.js.map} +1 -1
  4. package/dist/acp-cli.js +5 -5
  5. package/dist/acp.d.ts +1 -1
  6. package/dist/acp.js +1 -1
  7. package/dist/{agent-B_uQo4f1.js → agent-Djzx-1kD.js} +291 -42
  8. package/dist/agent-Djzx-1kD.js.map +1 -0
  9. package/dist/agent.d.ts +1 -1
  10. package/dist/agent.js +1 -1
  11. package/dist/{anthropic-QbHqqTkV.js → anthropic-D_aMBEj8.js} +88 -5
  12. package/dist/anthropic-D_aMBEj8.js.map +1 -0
  13. package/dist/{approvals-B9aIQJRQ.js → approvals-iwgumeES.js} +74 -72
  14. package/dist/approvals-iwgumeES.js.map +1 -0
  15. package/dist/{auth-plw6npda.js → auth-UMMUxUhV.js} +5 -5
  16. package/dist/auth-UMMUxUhV.js.map +1 -0
  17. package/dist/chat/pure.d.ts +4 -4
  18. package/dist/chat/pure.js +2 -2
  19. package/dist/chat.d.ts +6 -6
  20. package/dist/chat.js +5 -5
  21. package/dist/contexts/daytona.d.ts +1 -1
  22. package/dist/contexts/e2b.d.ts +1 -1
  23. package/dist/daemon-cli.js +1 -1
  24. package/dist/eval.d.ts +1 -1
  25. package/dist/eval.js +1 -1
  26. package/dist/extensions.d.ts +2 -2
  27. package/dist/extensions.js +2 -2
  28. package/dist/headless.d.ts +1 -1
  29. package/dist/headless.js +3 -3
  30. package/dist/{index-Df2CH6bn.d.ts → index-BWotbLsf.d.ts} +27 -16
  31. package/dist/index-BWotbLsf.d.ts.map +1 -0
  32. package/dist/{index-Dc_zYpEu.d.ts → index-BuntpQUB.d.ts} +174 -6
  33. package/dist/index-BuntpQUB.d.ts.map +1 -0
  34. package/dist/index.d.ts +2 -2
  35. package/dist/index.js +8 -8
  36. package/dist/{ipc-T_pPnHkp.js → ipc-DApbjFms.js} +2 -2
  37. package/dist/{ipc-T_pPnHkp.js.map → ipc-DApbjFms.js.map} +1 -1
  38. package/dist/ipc.d.ts +5 -5
  39. package/dist/ipc.js +3 -3
  40. package/dist/mcp.d.ts +1 -1
  41. package/dist/{messages-21XfHxyF.js → messages-aORUmIKe.js} +2 -2
  42. package/dist/{messages-21XfHxyF.js.map → messages-aORUmIKe.js.map} +1 -1
  43. package/dist/{openai-compat-DY-AKxCg.js → openai-compat-cIeLSED_.js} +23 -25
  44. package/dist/openai-compat-cIeLSED_.js.map +1 -0
  45. package/dist/output/stream-json.d.ts +1 -1
  46. package/dist/output/terminal.d.ts +1 -1
  47. package/dist/plugins.d.ts +1 -1
  48. package/dist/presets.d.ts +1 -1
  49. package/dist/presets.js +1 -1
  50. package/dist/providers/anthropic.d.ts +2 -2
  51. package/dist/providers/anthropic.js +2 -2
  52. package/dist/providers/arcee.d.ts +1 -1
  53. package/dist/providers/arcee.js +1 -1
  54. package/dist/providers/baseten.d.ts +1 -1
  55. package/dist/providers/baseten.js +1 -1
  56. package/dist/providers/cerebras.d.ts +1 -1
  57. package/dist/providers/cerebras.js +1 -1
  58. package/dist/providers/local.d.ts +1 -1
  59. package/dist/providers/local.js +1 -1
  60. package/dist/providers/openai-compat.d.ts +1 -1
  61. package/dist/providers/openai-compat.js +1 -1
  62. package/dist/providers/openai.d.ts +1 -1
  63. package/dist/providers/openai.js +2 -2
  64. package/dist/providers/openrouter.d.ts +1 -1
  65. package/dist/providers/openrouter.js +1 -1
  66. package/dist/providers/xai.d.ts +1 -1
  67. package/dist/providers/xai.js +1 -1
  68. package/dist/{providers-CoK1rZ1p.js → providers-CTkZSxvp.js} +2 -2
  69. package/dist/{providers-CoK1rZ1p.js.map → providers-CTkZSxvp.js.map} +1 -1
  70. package/dist/providers.d.ts +1 -1
  71. package/dist/providers.js +3 -3
  72. package/dist/restate.d.ts +1 -1
  73. package/dist/restate.js +2 -2
  74. package/dist/{server-DXM8ZbGi.js → server-CAZZIQ_Z.js} +5 -5
  75. package/dist/{server-DXM8ZbGi.js.map → server-CAZZIQ_Z.js.map} +1 -1
  76. package/dist/session/sqlite.d.ts +1 -1
  77. package/dist/{session-DPZnncaQ.js → session-23Stp71-.js} +2 -2
  78. package/dist/session-23Stp71-.js.map +1 -0
  79. package/dist/session.d.ts +2 -2
  80. package/dist/session.js +4 -4
  81. package/dist/skills.d.ts +1 -1
  82. package/dist/{tool-formatters-BgdOYAy9.d.ts → tool-formatters-D1WrOONm.d.ts} +2 -2
  83. package/dist/{tool-formatters-BgdOYAy9.d.ts.map → tool-formatters-D1WrOONm.d.ts.map} +1 -1
  84. package/dist/tools/fetch-url.d.ts +1 -1
  85. package/dist/tools/web-search.d.ts +1 -1
  86. package/dist/tools.d.ts +1 -1
  87. package/dist/tools.js +1 -1
  88. package/dist/{transcript-anchors-CtnwuQJM.d.ts → transcript-anchors-BaSv0EKt.d.ts} +11 -5
  89. package/dist/transcript-anchors-BaSv0EKt.d.ts.map +1 -0
  90. package/dist/tui.d.ts +67 -11
  91. package/dist/tui.d.ts.map +1 -1
  92. package/dist/tui.js +3044 -2647
  93. package/dist/tui.js.map +1 -1
  94. package/dist/{turn-operations-khAvr7KJ.d.ts → turn-operations-DOOFW2z-.d.ts} +30 -4
  95. package/dist/{turn-operations-khAvr7KJ.d.ts.map → turn-operations-DOOFW2z-.d.ts.map} +1 -1
  96. package/dist/{turn-operations-DkJ1R0p8.js → turn-operations-Dt5L8smX.js} +31 -2
  97. package/dist/{turn-operations-DkJ1R0p8.js.map → turn-operations-Dt5L8smX.js.map} +1 -1
  98. package/dist/types-CWgENVLY.js.map +1 -1
  99. package/dist/types.d.ts +1 -1
  100. package/docs/ARTIFACTS.md +25 -10
  101. package/docs/CHAT.md +3 -3
  102. package/docs/EXTENSIONS.md +2 -2
  103. package/docs/IPC.md +2 -1
  104. package/docs/README.md +1 -1
  105. package/docs/SKILL.md +1 -0
  106. package/docs/TUI.md +8 -3
  107. package/package.json +1 -1
  108. package/dist/agent-B_uQo4f1.js.map +0 -1
  109. package/dist/anthropic-QbHqqTkV.js.map +0 -1
  110. package/dist/approvals-B9aIQJRQ.js.map +0 -1
  111. package/dist/auth-plw6npda.js.map +0 -1
  112. package/dist/index-Dc_zYpEu.d.ts.map +0 -1
  113. package/dist/index-Df2CH6bn.d.ts.map +0 -1
  114. package/dist/openai-compat-DY-AKxCg.js.map +0 -1
  115. package/dist/session-DPZnncaQ.js.map +0 -1
  116. package/dist/transcript-anchors-CtnwuQJM.d.ts.map +0 -1
package/dist/acp-cli.js CHANGED
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
- import { m as openaiCompat } from "./openai-compat-DY-AKxCg.js";
3
- import { xt as basic_default } from "./agent-B_uQo4f1.js";
2
+ import { m as openaiCompat } from "./openai-compat-cIeLSED_.js";
3
+ import { xt as basic_default } from "./agent-Djzx-1kD.js";
4
4
  import { r as createProcessContext } from "./contexts-BSFQVclW.js";
5
5
  import { createSandboxContext } from "./contexts/sandbox.js";
6
6
  import { p as resolveStorageDirs } from "./plugins-B531Tz5b.js";
7
- import { n as anthropic } from "./anthropic-QbHqqTkV.js";
7
+ import { n as anthropic } from "./anthropic-D_aMBEj8.js";
8
8
  import { arcee } from "./providers/arcee.js";
9
9
  import { baseten } from "./providers/baseten.js";
10
10
  import { cerebras } from "./providers/cerebras.js";
11
11
  import { openai } from "./providers/openai.js";
12
12
  import { openrouter } from "./providers/openrouter.js";
13
13
  import { xai } from "./providers/xai.js";
14
- import { d as StartUsageError, f as buildStartLocalOptions, h as startProviderNames, i as withAcpDefaultTools, m as startLocalArgOptions, p as parseStartArgValues, t as runAcpStdioServer } from "./acp-Bw2b_kka.js";
15
- import { d as BUILTIN_PROVIDERS, i as readCredentials, m as credKeyOf, r as credentialsPath, t as detectAuth, x as modelsForDescriptor } from "./auth-plw6npda.js";
14
+ import { d as StartUsageError, f as buildStartLocalOptions, h as startProviderNames, i as withAcpDefaultTools, m as startLocalArgOptions, p as parseStartArgValues, t as runAcpStdioServer } from "./acp-BgNj1-gv.js";
15
+ import { d as BUILTIN_PROVIDERS, i as readCredentials, m as credKeyOf, r as credentialsPath, t as detectAuth, x as modelsForDescriptor } from "./auth-UMMUxUhV.js";
16
16
  import { createDaytonaProvider } from "./contexts/daytona.js";
17
17
  import { createDockerContext } from "./contexts/docker.js";
18
18
  import { createE2BProvider } from "./contexts/e2b.js";
package/dist/acp.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { J_ as SessionStore, Mg as PromptPart, Vg as SessionContentBlock, W_ as Session, Xi as AgentOptions, d_ as TurnUsage, g_ as ToolDef, ig as AgentBehavior, mm as Provider, n_ as ToolResultContent, qi as Agent, t as Preset, xg as McpServerConfig } from "./index-Dc_zYpEu.js";
1
+ import { $_ as SessionStore, Fg as PromptPart, Wg as SessionContentBlock, Xi as AgentOptions, Y_ as Session, g_ as TurnUsage, gm as Provider, qi as Agent, s_ as ToolResultContent, sg as AgentBehavior, t as Preset, wg as McpServerConfig, x_ as ToolDef } from "./index-BuntpQUB.js";
2
2
  import { c as ExecutionContext } from "./types-U-rIVUDw.js";
3
3
  import { Readable, Writable } from "node:stream";
4
4
 
package/dist/acp.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { n as JsonRpcRemoteError, r as createJsonRpcConnection } from "./json-rpc-rSWMUh9b.js";
2
- import { a as wrapToolsForAcpClient, c as sessionBlocksToAcp, i as withAcpDefaultTools, l as stopReasonFromRun, n as AcpProtocolError, o as acpMcpServersToZidane, r as createAcpServer, s as acpPromptToPromptParts, t as runAcpStdioServer, u as toolResultToAcpContent } from "./acp-Bw2b_kka.js";
2
+ import { a as wrapToolsForAcpClient, c as sessionBlocksToAcp, i as withAcpDefaultTools, l as stopReasonFromRun, n as AcpProtocolError, o as acpMcpServersToZidane, r as createAcpServer, s as acpPromptToPromptParts, t as runAcpStdioServer, u as toolResultToAcpContent } from "./acp-BgNj1-gv.js";
3
3
  export { AcpProtocolError, JsonRpcRemoteError, acpMcpServersToZidane, acpPromptToPromptParts, createAcpServer, createJsonRpcConnection, runAcpStdioServer, sessionBlocksToAcp, stopReasonFromRun, toolResultToAcpContent, withAcpDefaultTools, wrapToolsForAcpClient };
@@ -1,4 +1,4 @@
1
- import { B as rewriteMessagesToWire, H as toWireName, I as augmentMcpDoubleUnderscoreAliases, L as buildAliasMaps, M as buildPromptMessage, N as canonicalizePrompt, R as buildSanitizedWireAliases, V as toCanonicalName, z as rewriteContentToCanonical } from "./openai-compat-DY-AKxCg.js";
1
+ import { B as rewriteMessagesToWire, H as toWireName, I as augmentMcpDoubleUnderscoreAliases, L as buildAliasMaps, M as buildPromptMessage, N as canonicalizePrompt, R as buildSanitizedWireAliases, V as toCanonicalName, w as fillEstimatedCost, z as rewriteContentToCanonical } from "./openai-compat-cIeLSED_.js";
2
2
  import { a as documentBlockMarker, c as toolOutputBudgetByteLength, l as toolOutputByteLength, o as isWireTurn, s as sanitizeToolResultMetadata, t as DEFAULT_AGENT_CLOCK, u as toolResultToText } from "./types-CWgENVLY.js";
3
3
  import { a as stripLineNumberPrefixes, i as resolveOldString, n as buildContextBreakdown, o as styleReplacementForVia, r as describeVia, t as buildContextSegments } from "./context-segments-CJCtJ9sU.js";
4
4
  import { n as estimateTokens, r as utf8ByteLength } from "./utils-ngQzYzZD.js";
@@ -17,8 +17,8 @@ import { t as escapeXml } from "./xml-D5HBhJle.js";
17
17
  import { n as reconcileImageMediaType } from "./media-sniff-UKijEaiQ.js";
18
18
  import { f as wrapDiscoveredMcpTools, i as deriveMcpToolMeta, n as connectMcpServers, s as nonOwningMcpView } from "./mcp-BIWa57eY.js";
19
19
  import { appendStaticSection, renderSystemForWire } from "./prompt.js";
20
- import { a as detectTurnInterruption, c as ensureToolResultPairing, l as filterUnresolvedToolUses, m as resolveContentRefsInMessages, n as SYNTHETIC_TOOL_RESULT_PLACEHOLDER, p as remintDuplicateToolCallIds, s as ensureEndsWithUserMessage } from "./messages-21XfHxyF.js";
21
- import { a as getExtensionSessionState, c as setExtensionSessionState, l as withExtensionSession, n as currentExtensionSession, r as deleteExtensionSessionState, s as resumeChainRunIds } from "./session-DPZnncaQ.js";
20
+ import { a as detectTurnInterruption, c as ensureToolResultPairing, l as filterUnresolvedToolUses, m as resolveContentRefsInMessages, n as SYNTHETIC_TOOL_RESULT_PLACEHOLDER, p as remintDuplicateToolCallIds, s as ensureEndsWithUserMessage } from "./messages-aORUmIKe.js";
21
+ import { a as getExtensionSessionState, c as setExtensionSessionState, l as withExtensionSession, n as currentExtensionSession, r as deleteExtensionSessionState, s as resumeChainRunIds } from "./session-23Stp71-.js";
22
22
  import { n as flattenTurns, r as formatTokenUsage, t as effectiveInputFromTurn } from "./stats-DAKBEKjc.js";
23
23
  import { a as settleWithinTimeout, i as resolveTimeoutMs, n as abortableSleep, o as withInactivityTimeout, r as linkAbortSignal, s as withTimeout$1, t as OperationTimeoutError } from "./timeout-CjOG2mea.js";
24
24
  import { createRequire } from "node:module";
@@ -1530,6 +1530,44 @@ function createArtifactDetectHook(registration, options = {}) {
1530
1530
  //#endregion
1531
1531
  //#region src/extensions/builtin-artifact-kinds.ts
1532
1532
  const GITHUB_PR_URL = /https:\/\/github\.com\/([\w.-]+)\/([\w.-]+)\/pull\/(\d+)/g;
1533
+ /**
1534
+ * GitHub token for PR refresh: `GITHUB_TOKEN` / `GH_TOKEN` from the
1535
+ * environment, else whatever the `gh` CLI is logged in with (`gh auth
1536
+ * token`) — the same credential git-flow's `/pull-request` uses, so a PR the
1537
+ * user could create is a PR we can read. The CLI lookup is cached for five
1538
+ * minutes (per process) and never throws: no `gh`, not logged in → `null`,
1539
+ * and the request goes out anonymous (public repos still work).
1540
+ */
1541
+ let ghTokenCache = null;
1542
+ const GH_TOKEN_TTL_MS = 5 * 6e4;
1543
+ async function resolveGithubToken() {
1544
+ const env = process.env.GITHUB_TOKEN ?? process.env.GH_TOKEN;
1545
+ if (env) return env;
1546
+ if (ghTokenCache && Date.now() - ghTokenCache.at < GH_TOKEN_TTL_MS) return ghTokenCache.value;
1547
+ let value = null;
1548
+ try {
1549
+ const { execFile } = await import("node:child_process");
1550
+ value = await new Promise((resolve) => {
1551
+ execFile("gh", ["auth", "token"], { timeout: 3e3 }, (err, stdout) => {
1552
+ resolve(err ? null : stdout.trim() || null);
1553
+ });
1554
+ });
1555
+ } catch {
1556
+ value = null;
1557
+ }
1558
+ ghTokenCache = {
1559
+ value,
1560
+ at: Date.now()
1561
+ };
1562
+ return value;
1563
+ }
1564
+ /**
1565
+ * Indirection so tests (and hosts with their own credential store) can swap
1566
+ * the token source without touching the environment or the `gh` binary.
1567
+ */
1568
+ const githubTokenSource = { resolve: resolveGithubToken };
1569
+ /** A single GitHub path segment (owner / repo), as the detector captures it. */
1570
+ const GITHUB_SEGMENT = /^[\w.-]+$/;
1533
1571
  const GITLAB_MR_URL = /https?:\/\/[\w.-]+\/([\w./-]+?)\/-\/merge_requests\/(\d+)/g;
1534
1572
  const GIT_COMMIT_LINE = /^\[([^\s\]]+)(?: \(root-commit\))? ([0-9a-f]{7,40})\] (.*)$/m;
1535
1573
  /** Don't re-resolve an open PR more often than this. */
@@ -1588,49 +1626,125 @@ const pullRequestKind = {
1588
1626
  render(artifact) {
1589
1627
  const meta = metaRecord(artifact);
1590
1628
  const state = typeof meta.state === "string" ? meta.state : void 0;
1629
+ const badges = [];
1630
+ if (typeof meta.additions === "number" || typeof meta.deletions === "number") badges.push({
1631
+ text: `+${meta.additions ?? 0} −${meta.deletions ?? 0}`,
1632
+ tone: "diff",
1633
+ ...typeof meta.changedFiles === "number" ? { title: `${meta.changedFiles} file${meta.changedFiles === 1 ? "" : "s"} changed` } : {}
1634
+ });
1635
+ if (typeof meta.reviews === "number" && meta.reviews > 0) badges.push({
1636
+ text: `${meta.reviews} review${meta.reviews === 1 ? "" : "s"}`,
1637
+ tone: "neutral"
1638
+ });
1639
+ if (typeof meta.comments === "number" && meta.comments > 0) badges.push({
1640
+ text: `${meta.comments} comment${meta.comments === 1 ? "" : "s"}`,
1641
+ tone: "neutral"
1642
+ });
1643
+ if (meta.mergeable === "clean" && (state === "open" || state === "approved")) badges.push({
1644
+ text: "ready to merge",
1645
+ tone: "success"
1646
+ });
1647
+ else if (meta.mergeable === "unstable") badges.push({
1648
+ text: "checks failing",
1649
+ tone: "warn"
1650
+ });
1651
+ else if (meta.mergeable === "dirty") badges.push({
1652
+ text: "conflicts",
1653
+ tone: "warn"
1654
+ });
1655
+ const prTitle = typeof meta.title === "string" && meta.title.trim() ? meta.title.trim() : null;
1591
1656
  return {
1592
- title: artifact.label,
1593
- ...typeof meta.title === "string" ? { subtitle: meta.title } : {},
1657
+ title: prTitle ?? artifact.label,
1658
+ ...prTitle ? { subtitle: artifact.label } : {},
1594
1659
  href: artifact.uri,
1595
- ...state ? { status: state } : {}
1660
+ ...state ? { status: state.replace("_", " ") } : {},
1661
+ ...badges.length > 0 ? { badges } : {}
1596
1662
  };
1597
1663
  },
1598
1664
  /**
1599
- * GitHub only (GitLab needs per-host auth). Unauthenticated when no
1600
- * `GITHUB_TOKEN` / `GH_TOKEN` is in the environment — public repos work,
1601
- * private ones (and the 60/h anonymous limit) degrade to `undefined`, i.e.
1602
- * "no refresh", never an error. Bounded by a 4 s timeout.
1665
+ * GitHub only (GitLab needs per-host auth). Token from the environment or
1666
+ * the `gh` CLI (see {@link resolveGithubToken}); without either the call is
1667
+ * anonymous — public repos work, private ones (and the 60/h anonymous
1668
+ * limit) degrade to `undefined`, i.e. "no refresh", never an error.
1669
+ * Bounded by a 4 s timeout. Captures state, title, diff size, changed
1670
+ * files and comment counts into `meta` for the rail.
1603
1671
  *
1604
1672
  * Rate-limit hygiene: terminal states (`merged` / `closed`) never change,
1605
1673
  * and a fresh `resolvedAt` (within {@link PR_RESOLVE_TTL_MS}) is reused, so
1606
1674
  * reopening the modal and arrowing through a dozen PRs doesn't spend a
1607
1675
  * dozen anonymous API calls each time.
1676
+ *
1677
+ * `meta` is NOT trusted here: the detector regex-captures these fields, but
1678
+ * `record_artifact` and `ctx.artifacts.record` let a model or an extension
1679
+ * write anything. Path segments are re-validated to the shape a real repo
1680
+ * has — rejecting is clearer than escaping, since nothing else is a repo —
1681
+ * so a crafted `owner` can't steer this token-bearing request at another
1682
+ * endpoint.
1608
1683
  */
1609
- async resolve(artifact) {
1684
+ async resolve(artifact, opts) {
1610
1685
  const meta = metaRecord(artifact);
1611
- if (meta.provider !== "github" || typeof meta.owner !== "string" || typeof meta.repo !== "string" || typeof meta.number !== "number") return void 0;
1612
- if (meta.state === "merged" || meta.state === "closed") return void 0;
1613
- if (typeof meta.resolvedAt === "number" && Date.now() - meta.resolvedAt < PR_RESOLVE_TTL_MS) return void 0;
1614
- const token = process.env.GITHUB_TOKEN ?? process.env.GH_TOKEN;
1686
+ if (meta.provider !== "github") return void 0;
1687
+ const { owner, repo, number } = meta;
1688
+ if (typeof owner !== "string" || !GITHUB_SEGMENT.test(owner)) return void 0;
1689
+ if (typeof repo !== "string" || !GITHUB_SEGMENT.test(repo)) return void 0;
1690
+ if (typeof number !== "number" || !Number.isInteger(number) || number <= 0) return void 0;
1691
+ if (meta.state === "merged" || meta.state === "closed" && !opts?.force) return void 0;
1692
+ if (!opts?.force && typeof meta.resolvedAt === "number" && Date.now() - meta.resolvedAt < PR_RESOLVE_TTL_MS) return void 0;
1693
+ const token = await githubTokenSource.resolve();
1615
1694
  const controller = new AbortController();
1616
1695
  const timer = setTimeout(() => controller.abort(), 4e3);
1696
+ const headers = {
1697
+ "Accept": "application/vnd.github+json",
1698
+ "User-Agent": "zidane",
1699
+ ...token ? { Authorization: `Bearer ${token}` } : {}
1700
+ };
1617
1701
  try {
1618
- const res = await fetch(`https://api.github.com/repos/${meta.owner}/${meta.repo}/pulls/${meta.number}`, {
1619
- headers: {
1620
- "Accept": "application/vnd.github+json",
1621
- "User-Agent": "zidane",
1622
- ...token ? { Authorization: `Bearer ${token}` } : {}
1623
- },
1702
+ const base = `https://api.github.com/repos/${owner}/${repo}/pulls/${number}`;
1703
+ const res = await fetch(base, {
1704
+ headers,
1624
1705
  signal: controller.signal
1625
1706
  });
1626
1707
  if (!res.ok) return void 0;
1627
1708
  const body = await res.json();
1628
- const state = body.merged ? "merged" : body.draft ? "draft" : typeof body.state === "string" ? body.state : void 0;
1709
+ const num = (v) => typeof v === "number" && Number.isFinite(v) ? v : void 0;
1710
+ const comments = (num(body.comments) ?? 0) + (num(body.review_comments) ?? 0);
1711
+ let decision;
1712
+ let reviews;
1713
+ const isOpen = !body.merged && body.state === "open";
1714
+ if (isOpen) try {
1715
+ const rr = await fetch(`${base}/reviews?per_page=100`, {
1716
+ headers,
1717
+ signal: controller.signal
1718
+ });
1719
+ if (rr.ok) {
1720
+ const list = await rr.json();
1721
+ if (Array.isArray(list)) {
1722
+ reviews = list.filter((r) => r.state && r.state !== "PENDING").length;
1723
+ const latest = /* @__PURE__ */ new Map();
1724
+ for (const r of list) {
1725
+ const login = r.user?.login;
1726
+ if (!login || login === body.user?.login || !r.state || r.state === "COMMENTED" || r.state === "PENDING") continue;
1727
+ latest.set(login, r.state);
1728
+ }
1729
+ const states = [...latest.values()];
1730
+ if (states.includes("CHANGES_REQUESTED")) decision = "changes_requested";
1731
+ else if (states.includes("APPROVED")) decision = "approved";
1732
+ }
1733
+ }
1734
+ } catch {}
1735
+ const state = body.merged ? "merged" : body.draft ? "draft" : body.state === "open" ? decision ?? "open" : typeof body.state === "string" ? body.state : void 0;
1629
1736
  if (!state) return void 0;
1737
+ const mergeable = typeof body.mergeable_state === "string" ? body.mergeable_state : void 0;
1630
1738
  return { meta: {
1631
1739
  ...meta,
1632
1740
  state,
1633
1741
  ...typeof body.title === "string" ? { title: body.title } : {},
1742
+ ...num(body.additions) !== void 0 ? { additions: num(body.additions) } : {},
1743
+ ...num(body.deletions) !== void 0 ? { deletions: num(body.deletions) } : {},
1744
+ ...num(body.changed_files) !== void 0 ? { changedFiles: num(body.changed_files) } : {},
1745
+ ...num(body.comments) !== void 0 || num(body.review_comments) !== void 0 ? { comments } : {},
1746
+ ...reviews !== void 0 ? { reviews } : {},
1747
+ ...isOpen && mergeable ? { mergeable } : {},
1634
1748
  resolvedAt: Date.now()
1635
1749
  } };
1636
1750
  } catch {
@@ -1702,18 +1816,18 @@ const branchKind = {
1702
1816
  },
1703
1817
  render: (artifact) => ({ title: artifact.label })
1704
1818
  };
1819
+ /**
1820
+ * `file` has NO automatic detector on purpose. Every `write_file` becoming
1821
+ * an artifact is noise — a refactor would produce dozens of rows that are
1822
+ * really just the diff and go stale on the next rename. A file is an
1823
+ * artifact only when something deliberately says so: the model via
1824
+ * `record_artifact` (a generated report, an export) or an extension via
1825
+ * `ctx.artifacts.record` (a build output). The kind keeps its rendering
1826
+ * and `file:` URI canonicalization for those paths.
1827
+ */
1705
1828
  const fileKind = {
1706
1829
  kind: ARTIFACT_KINDS.file,
1707
1830
  label: "File",
1708
- detect({ tool, input, result, isError }) {
1709
- if (isError || tool !== "write_file") return void 0;
1710
- const path = typeof input.path === "string" ? input.path : void 0;
1711
- if (!path || !resultText(result).startsWith(`Created ${path} (`)) return void 0;
1712
- return {
1713
- uri: `file:${path}`,
1714
- label: path
1715
- };
1716
- },
1717
1831
  render(artifact) {
1718
1832
  const path = artifact.uri.startsWith("file://") ? artifact.uri.slice(7) : artifact.uri;
1719
1833
  return {
@@ -1788,11 +1902,11 @@ function renderArtifactRow(artifact, registry) {
1788
1902
  * no resolver, the resolver declined, or it threw. Callers persist the
1789
1903
  * result through their store / RPC — this never writes.
1790
1904
  */
1791
- async function refreshArtifact(artifact, registry) {
1905
+ async function refreshArtifact(artifact, registry, opts) {
1792
1906
  const registration = resolveArtifactKind(artifact.kind, registry);
1793
1907
  if (!registration?.resolve) return void 0;
1794
1908
  try {
1795
- const patch = await registration.resolve(artifact);
1909
+ const patch = await registration.resolve(artifact, opts);
1796
1910
  if (!patch || patch.label === void 0 && patch.meta === void 0) return void 0;
1797
1911
  return {
1798
1912
  ...artifact,
@@ -2787,7 +2901,7 @@ const KEYBINDING_DEFS = [
2787
2901
  action: "openArtifacts",
2788
2902
  default: "ctrl+shift+a",
2789
2903
  label: "artifacts",
2790
- description: "open the session's artifacts (pull requests, branches, commits, files). Same as /artifacts",
2904
+ description: "toggle the artifacts rail (pull requests, branches, commits, recorded files) — same as clicking the ▢ chip on the title bar",
2791
2905
  group: "Global"
2792
2906
  },
2793
2907
  {
@@ -3360,8 +3474,10 @@ const recordArtifact = {
3360
3474
  spec: {
3361
3475
  name: RECORD_ARTIFACT_TOOL,
3362
3476
  description: [
3363
- "Record an artifact this session produced so it is tracked on the session (visible via /artifacts).",
3364
- "Pull requests from `gh pr create`, commits, branches and files created with `write_file` are detected automatically — call this only for outputs the automatic detection cannot see: a PR opened from a background shell task, a deployment, an issue, a release, a file created by a script.",
3477
+ "Record a deliverable this session produced so the user can find it later in the artifacts panel. An artifact is an OUTPUT the user would want a link to — not a step of the work.",
3478
+ "Worth recording: a pull request or merge request URL, a deployment / preview URL, an issue or ticket you filed, a release or tag, a generated report / export / dataset the user asked for, a build output they will pick up.",
3479
+ "Not worth recording: source files you edited or created as part of implementing a change, scratch files, logs, intermediate results, anything already implied by the diff.",
3480
+ "Pull requests from `gh pr create`, `git commit` commits and newly created branches are detected automatically — record those only when the automatic path could not see them (e.g. a PR opened from a background shell task).",
3365
3481
  "Idempotent per (kind, uri): recording the same artifact again refreshes its label/meta."
3366
3482
  ].join("\n"),
3367
3483
  inputSchema: {
@@ -3369,7 +3485,7 @@ const recordArtifact = {
3369
3485
  properties: {
3370
3486
  kind: {
3371
3487
  type: "string",
3372
- description: "Artifact kind: `pull_request`, `branch`, `commit`, `file`, or a custom kind such as `deployment` / `issue` (`[\\w.:-]+`)."
3488
+ description: "Artifact kind: `pull_request`, `branch`, `commit`, `file` (a deliverable file, not a source edit), or a custom kind such as `deployment`, `issue`, `release` (`[\\w.:-]+`)."
3373
3489
  },
3374
3490
  uri: {
3375
3491
  type: "string",
@@ -3403,7 +3519,7 @@ const recordArtifact = {
3403
3519
  //#region src/presets/artifacts.ts
3404
3520
  /**
3405
3521
  * Built-in artifact detection — records pull requests, branches, commits
3406
- * and created files a session produces (see `session/artifacts.ts`).
3522
+ * a session produces — never files automatically (see `session/artifacts.ts`).
3407
3523
  *
3408
3524
  * Opt-in by composition, not baked into `basic`: SDK consumers who never
3409
3525
  * spread this preset see zero behavior change, while the TUI / daemon
@@ -7299,6 +7415,32 @@ function createArtifactsSurface(resolve) {
7299
7415
  kind,
7300
7416
  uri
7301
7417
  });
7418
+ },
7419
+ record: async (input) => {
7420
+ const scope = resolve();
7421
+ if (!scope?.sessionId) return void 0;
7422
+ const write = scope.record ?? scope.store.upsertArtifact?.bind(scope.store);
7423
+ if (!write) return void 0;
7424
+ const normalized = normalizeArtifactInput(input);
7425
+ if (!normalized) return void 0;
7426
+ const now = Date.now();
7427
+ const projectRoot = normalized.projectRoot ?? scope.projectRoot;
7428
+ try {
7429
+ return await write({
7430
+ id: crypto.randomUUID(),
7431
+ sessionId: scope.sessionId,
7432
+ ...scope.runId ? { runId: scope.runId } : {},
7433
+ kind: normalized.kind,
7434
+ uri: normalized.uri,
7435
+ label: normalized.label,
7436
+ ...projectRoot ? { projectRoot } : {},
7437
+ ...normalized.meta !== void 0 ? { meta: normalized.meta } : {},
7438
+ createdAt: now,
7439
+ updatedAt: now
7440
+ }) ?? void 0;
7441
+ } catch {
7442
+ return;
7443
+ }
7302
7444
  }
7303
7445
  };
7304
7446
  }
@@ -13116,6 +13258,26 @@ const DEFAULT_AUTO_COMPACT_MAX_FAILURES = 2;
13116
13258
  */
13117
13259
  const COMPACT_PROGRESS_THROTTLE_MS = 250;
13118
13260
  /**
13261
+ * Minimum gap between `stream:progress` dispatches during a parent turn. Same
13262
+ * cadence as compaction progress: fast enough to read as live, slow enough
13263
+ * that the (possibly async, catalog-priced) hook never becomes a hot path.
13264
+ */
13265
+ const STREAM_PROGRESS_THROTTLE_MS = 250;
13266
+ /**
13267
+ * Prompt-side proxy for a live cost estimate when the provider hasn't reported
13268
+ * mid-stream usage: the previous assistant turn's split. Consecutive turns
13269
+ * ride nearly the same prefix, so its fresh/cached/written breakdown is a far
13270
+ * better guess than "all fresh input" (which would overprice a cached prompt
13271
+ * ten-fold). `undefined` on the first turn of a session — the estimate then
13272
+ * prices output only until `turn:after` settles it.
13273
+ */
13274
+ function lastAssistantUsage(turns) {
13275
+ for (let i = turns.length - 1; i >= 0; i--) {
13276
+ const t = turns[i];
13277
+ if (t.role === "assistant" && t.usage && t.usage.input + (t.usage.cacheRead ?? 0) + (t.usage.cacheCreation ?? 0) > 0) return t.usage;
13278
+ }
13279
+ }
13280
+ /**
13119
13281
  * Normalize `behavior.autoCompact` into the loop's {@link ResolvedAutoCompact}
13120
13282
  * shape, or `undefined` when disabled (`false` / unset). Applies the
13121
13283
  * `provider.meta.contextWindow` fallback and inherits `compactKeepTurns` for
@@ -13460,6 +13622,71 @@ async function executeTurn(ctx, turn, priorUsage) {
13460
13622
  if (process.env.ZIDANE_DEBUG) process.stderr.write(`[zidane/loop] stream hook handler threw: ${errorMessage(err)}\n`);
13461
13623
  });
13462
13624
  };
13625
+ let liveUsage;
13626
+ let lastProgressAt = 0;
13627
+ let progressTimer;
13628
+ let progressEnded = false;
13629
+ const priorTurnUsage = lastAssistantUsage(ctx.turns);
13630
+ const emitProgress = async () => {
13631
+ if (progressEnded) return;
13632
+ const providerOutput = liveUsage?.outputTokens;
13633
+ const outputTokens = providerOutput ?? estimateTokens(currentText + currentThinking);
13634
+ const promptSide = liveUsage?.inputTokens !== void 0 ? {
13635
+ input: liveUsage.inputTokens,
13636
+ cacheRead: liveUsage.cacheRead,
13637
+ cacheCreation: liveUsage.cacheCreation
13638
+ } : priorTurnUsage ? {
13639
+ input: priorTurnUsage.input,
13640
+ cacheRead: priorTurnUsage.cacheRead,
13641
+ cacheCreation: priorTurnUsage.cacheCreation
13642
+ } : { input: 0 };
13643
+ let estCostUsd;
13644
+ if (liveUsage?.billable !== false) estCostUsd = (await fillEstimatedCost({
13645
+ ...promptSide,
13646
+ output: outputTokens,
13647
+ modelId: streamOptions.model
13648
+ }, ctx.provider.name, void 0, ctx.behavior.modelCatalog)).cost;
13649
+ if (progressEnded) return;
13650
+ await ctx.hooks.callHook("stream:progress", {
13651
+ turnId,
13652
+ elapsedMs: Date.now() - streamStartedAt,
13653
+ outputTokens,
13654
+ ...liveUsage?.inputTokens !== void 0 ? { inputTokens: liveUsage.inputTokens } : {},
13655
+ ...liveUsage?.cacheRead !== void 0 ? { cacheRead: liveUsage.cacheRead } : {},
13656
+ ...liveUsage?.cacheCreation !== void 0 ? { cacheCreation: liveUsage.cacheCreation } : {},
13657
+ estimated: providerOutput === void 0,
13658
+ ...estCostUsd !== void 0 ? { estCostUsd } : {}
13659
+ });
13660
+ };
13661
+ const fireProgress = () => {
13662
+ lastProgressAt = Date.now();
13663
+ emitProgress().catch((err) => {
13664
+ if (process.env.ZIDANE_DEBUG) process.stderr.write(`[zidane/loop] stream:progress handler threw: ${errorMessage(err)}\n`);
13665
+ });
13666
+ };
13667
+ const scheduleProgress = () => {
13668
+ if (progressEnded) return;
13669
+ const wait = STREAM_PROGRESS_THROTTLE_MS - (Date.now() - lastProgressAt);
13670
+ if (wait <= 0) {
13671
+ if (progressTimer) {
13672
+ clearTimeout(progressTimer);
13673
+ progressTimer = void 0;
13674
+ }
13675
+ fireProgress();
13676
+ return;
13677
+ }
13678
+ if (!progressTimer) progressTimer = setTimeout(() => {
13679
+ progressTimer = void 0;
13680
+ fireProgress();
13681
+ }, wait);
13682
+ };
13683
+ const endProgress = () => {
13684
+ progressEnded = true;
13685
+ if (progressTimer) {
13686
+ clearTimeout(progressTimer);
13687
+ progressTimer = void 0;
13688
+ }
13689
+ };
13463
13690
  const retryCfg = resolveRetryConfig(ctx.behavior.retry);
13464
13691
  let result;
13465
13692
  let attempt = 0;
@@ -13477,6 +13704,7 @@ async function executeTurn(ctx, turn, priorUsage) {
13477
13704
  text,
13478
13705
  turnId
13479
13706
  }));
13707
+ scheduleProgress();
13480
13708
  },
13481
13709
  onThinking(delta) {
13482
13710
  markTurnTtft();
@@ -13487,6 +13715,11 @@ async function executeTurn(ctx, turn, priorUsage) {
13487
13715
  thinking,
13488
13716
  turnId
13489
13717
  }));
13718
+ scheduleProgress();
13719
+ },
13720
+ onUsage(usage) {
13721
+ liveUsage = usage;
13722
+ scheduleProgress();
13490
13723
  },
13491
13724
  onServerToolUse({ id, name, input }) {
13492
13725
  enqueueStreamHook(() => ctx.hooks.callHook("stream:server_tool_use", {
@@ -13516,6 +13749,11 @@ async function executeTurn(ctx, turn, priorUsage) {
13516
13749
  break;
13517
13750
  } catch (caught) {
13518
13751
  let terminalErr = caught;
13752
+ liveUsage = void 0;
13753
+ if (progressTimer) {
13754
+ clearTimeout(progressTimer);
13755
+ progressTimer = void 0;
13756
+ }
13519
13757
  const failure = assessStreamFailure({
13520
13758
  err: caught,
13521
13759
  runAborted: ctx.signal.aborted,
@@ -13633,10 +13871,19 @@ async function executeTurn(ctx, turn, priorUsage) {
13633
13871
  },
13634
13872
  cumulativeUsage: buildCumulativeUsage(priorUsage, errorUsage)
13635
13873
  }));
13874
+ endProgress();
13636
13875
  throw wrapProviderError(terminalErr, ctx);
13637
13876
  }
13638
13877
  }
13639
13878
  await streamHookChain;
13879
+ if (progressTimer || currentText || currentThinking || liveUsage) {
13880
+ if (progressTimer) {
13881
+ clearTimeout(progressTimer);
13882
+ progressTimer = void 0;
13883
+ }
13884
+ await settledHook(ctx, "hook stream:progress", emitProgress());
13885
+ }
13886
+ endProgress();
13640
13887
  if (currentText) await settledHook(ctx, "hook stream:end", ctx.hooks.callHook("stream:end", {
13641
13888
  text: currentText,
13642
13889
  turnId
@@ -14385,7 +14632,7 @@ async function emitToolResult(ctx, params) {
14385
14632
  const MAX_ARTIFACTS_PER_TOOL_RESULT = 50;
14386
14633
  async function recordArtifactsFromMetadata(ctx, params) {
14387
14634
  const raw = params.metadata?.[ARTIFACTS_METADATA_KEY];
14388
- if (!Array.isArray(raw) || raw.length === 0 || !ctx.session) return;
14635
+ if (ctx.artifactsDisabled || !Array.isArray(raw) || raw.length === 0 || !ctx.session) return;
14389
14636
  const inputs = [];
14390
14637
  for (const entry of raw.slice(0, MAX_ARTIFACTS_PER_TOOL_RESULT)) {
14391
14638
  const normalized = normalizeArtifactInput(entry);
@@ -15551,6 +15798,7 @@ const HOOK_EVENT_SET = /* @__PURE__ */ new Set([
15551
15798
  "stream:text",
15552
15799
  "stream:end",
15553
15800
  "stream:thinking",
15801
+ "stream:progress",
15554
15802
  "stream:server_tool_use",
15555
15803
  "stream:server_tool_result",
15556
15804
  "stream:error",
@@ -16640,7 +16888,7 @@ function warnContextContributorFailureOnce(contributor, err) {
16640
16888
  process.stderr.write(`[zidane/agent] context breakdown contributor failed${owner}: ${errorMessage(err)}\n`);
16641
16889
  }
16642
16890
  function createAgent(rawOptions) {
16643
- const { provider: providerOption, name: agentName, system: agentSystem, tools: agentTools, toolAliases, behavior: agentBehavior, execution, handle: injectedHandle, mcpServers, session, readState: agentReadState, toolState: toolStateStore, skills: agentSkills, mcpConnector, mcpToolWrap, eager, hooks: initialHooks, clock: agentClock, toolKill, contextBreakdownSections, runTransforms, behaviorTransforms, toolCatalogTransforms, mcpConfigTransforms, skillPolicies, toolResultMetadata } = foldExtensionRegistry(rawOptions);
16891
+ const { provider: providerOption, name: agentName, system: agentSystem, tools: agentTools, toolAliases, behavior: agentBehavior, execution, handle: injectedHandle, mcpServers, session, readState: agentReadState, toolState: toolStateStore, skills: agentSkills, mcpConnector, mcpToolWrap, eager, hooks: initialHooks, clock: agentClock, toolKill, contextBreakdownSections, runTransforms, behaviorTransforms, toolCatalogTransforms, mcpConfigTransforms, skillPolicies, toolResultMetadata, artifacts: artifactsOption } = foldExtensionRegistry(rawOptions);
16644
16892
  const providers = normalizeProviders(providerOption);
16645
16893
  const provider = providers[0];
16646
16894
  const hooks = createHooks();
@@ -17290,6 +17538,7 @@ function createAgent(rawOptions) {
17290
17538
  ...modelOptions ? { modelOptions } : {},
17291
17539
  ...resolvedAutoCompact ? { autoCompact: resolvedAutoCompact } : {},
17292
17540
  ...session ? { session } : {},
17541
+ ...artifactsOption === false ? { artifactsDisabled: true } : {},
17293
17542
  ...agentReadState ? { readState: agentReadState } : {},
17294
17543
  toolState: toolStateController,
17295
17544
  ...options.parentRunId ? { parentRunId: options.parentRunId } : {},
@@ -17817,6 +18066,6 @@ function createAgent(rawOptions) {
17817
18066
  };
17818
18067
  }
17819
18068
  //#endregion
17820
- export { installExtensionFromSpec as $, normalizeShellCommand as $n, KEYBINDING_DEF_BY_ACTION as $t, selectFilesFromSession as A, resolveExtensionConfig as An, createSkillsRunScriptTool as At, buildUpToCompactPrompt as B, commitKind as Bn, formatModelLine as Bt, resolveLegacySessionDir as C, createDebugLog as Cn, WAIT_TASK_TIMED_OUT_PREFIX as Ct, resolveTasksDir as D, coerceExtensionConfigInput as Dn, isSpawnTool as Dt, resolveSessionDir as E, clampExtensionConfigNumber as En, createSpawnTool as Et, TRAILER as F, createExtensionBus as Fn, tailTruncate as Ft, summaryToTurn as G, resolveArtifactKind as Gn, glob as Gt, anchorPreviewFor as H, pullRequestKind as Hn, listFiles as Ht, buildCompactPrompt as I, serializedPayloadBytes as In, readFile$1 as It, CompactPromptTooLongError as J, OUTPUT_RESERVE_TOKENS as Jn, artifacts_default as Jt, truncateHeadForPtlRetry as K, createArtifactDetectHook as Kn, edit as Kt, buildFromCompactPrompt as L, BUILTIN_ARTIFACT_KINDS as Ln, looksBinary as Lt, compactConversation as M, sanitizeExtensionConfigActionPatch as Mn, shellKill as Mt, BASE_INSTRUCTIONS as N, toWireConfigSchema as Nn, createShellTool as Nt, buildPostCompactAttachments as O, isValidExtensionConfigItem as On, reserveChildLabel as Ot, NO_TOOLS_PREAMBLE as P, EXTENSION_BUS_MAX_PAYLOAD_BYTES as Pn, shell as Pt, fetchExtensionSource as Q, defaultRepeatGuardTracked as Qn, KEYBINDING_DEFS as Qt, buildFullCompactPrompt as R, artifactKindLabel as Rn, multiEdit as Rt, resolveLegacyPersistDir as S, scanExtensionDirectories as Sn, writeFile$1 as St, resolvePersistDir as T, defineExtension as Tn, createToolSearchTool as Tt, sliceForCompaction as U, refreshArtifact as Un, createInteractionTool as Ut, ANCHOR_PREVIEW_MAX_CHARS as V, fileKind as Vn, matchModelEntries as Vt, stripImagesFromTurns as W, renderArtifactRow as Wn, grep as Wt, createExtensionPromptBridge as X, shouldAutoCompact as Xn, recordArtifact as Xt, EMPTY_EXTENSION_REGISTRY as Y, effectiveContextWindow as Yn, RECORD_ARTIFACT_TOOL as Yt, ExtensionInstallError as Z, defaultRepeatGuardNormalize as Zn, DEFAULT_KEYBINDINGS as Zt, buildPersistedStub as _, defaultExtensionScanPaths as _n, createWorkspaceSurface as _t, stagedToolState as a, matchesBinding as an, readStateKey as ar, createExtensionHud as at, migrateSessionArtifactDirs as b, isExtensionDefinition as bn, basicTools as bt, INTERRUPT_MESSAGE_FOR_TOOL_USE as c, readKeybindings as cn, buildExtensionRegistry as ct, TOOL_USE_SKIPPED_MESSAGE as d, stripJsonComments as dn, filterExtensionRegistry as dt, KEYBINDING_KEY_COL_WIDTH as en, stableStringify as er, listExtensionCandidates as et, applyCompactSummaryCutoff as f, ALTERNATE_CRED_KEY_SUFFIX as fn, filterRegistryPlugins as ft, PERSISTENCE_PREVIEW_BYTES as g, ENTRY_CANDIDATES as gn, createExtensionHostRuntimeBridge as gt, PERSISTED_STUB_PREFIX as h, registerExtensionHostModules as hn, createArtifactsSurface as ht, isToolStateOps as i, keybindingsPath as in, hydrateReadStateFromSessionAsync as ir, updateInstalledExtension as it, selectRecentFiles as j, resolveExtensionConfigValue as jn, createSkillsReadTool as jt, selectFilesFromReadState as k, isValidExtensionConfigValue as kn, createSkillsUseTool as kt, SHELL_CASCADE_CANCEL_MESSAGE as l, readKeybindingsRaw as ln, composeExtensionPreset as lt, renderStaleReadNotice as m, isReservedCredKey as mn, partitionExtensionCatalog as mt, DEFAULT_MAX_VALUE_BYTES as n, formatBindingForDisplay as nn, hashContent as nr, readExtensionInstallProvenance as nt, normalizeProviders as o, mergeKeybindings as on, resolveReadStateMap as or, discoverAndBuildExtensionRegistry as ot, collectNewlyStaleReadPaths as p, alternateCredKey as pn, mergeContributions as pt, CompactInvalidInputError as q, AUTO_COMPACT_MIN_GROWTH_FRACTION as qn, validateToolArgs as qt, createToolStateController as r, groupBindings as rn, hydrateReadStateFromSession as rr, removeInstalledExtension as rt, resolveModelTargets as s, parseBindingSpec as sn, buildExtensionPreset as st, createAgent as t, ensureKeybindingsFile as tn, getReadState as tr, parseExtensionInstallSource as tt, TOOL_USE_CANCELLED_MESSAGE as u, resolveExtensionKeybindings as un, disposeExtensionRegistry as ut, cleanupPersistedSession as v, discoverExtensions as vn, composePresets as vt, resolveMcpWarningsDir as w, setDebugLogSink as wn, waitTask as wt, rehomePersistedStubs as x, parseExtensionScanPathEnv as xn, basic_default as xt, maybePersistToolResult as y, inlineLoadedExtension as yn, definePreset as yt, buildTailCompactPrompt as z, branchKind as zn, createModelSearchTool as zt };
18069
+ export { installExtensionFromSpec as $, defaultRepeatGuardTracked as $n, KEYBINDING_DEF_BY_ACTION as $t, selectFilesFromSession as A, resolveExtensionConfig as An, createSkillsRunScriptTool as At, buildUpToCompactPrompt as B, commitKind as Bn, formatModelLine as Bt, resolveLegacySessionDir as C, createDebugLog as Cn, WAIT_TASK_TIMED_OUT_PREFIX as Ct, resolveTasksDir as D, coerceExtensionConfigInput as Dn, isSpawnTool as Dt, resolveSessionDir as E, clampExtensionConfigNumber as En, createSpawnTool as Et, TRAILER as F, createExtensionBus as Fn, tailTruncate as Ft, summaryToTurn as G, renderArtifactRow as Gn, glob as Gt, anchorPreviewFor as H, githubTokenSource as Hn, listFiles as Ht, buildCompactPrompt as I, serializedPayloadBytes as In, readFile$1 as It, CompactPromptTooLongError as J, AUTO_COMPACT_MIN_GROWTH_FRACTION as Jn, artifacts_default as Jt, truncateHeadForPtlRetry as K, resolveArtifactKind as Kn, edit as Kt, buildFromCompactPrompt as L, BUILTIN_ARTIFACT_KINDS as Ln, looksBinary as Lt, compactConversation as M, sanitizeExtensionConfigActionPatch as Mn, shellKill as Mt, BASE_INSTRUCTIONS as N, toWireConfigSchema as Nn, createShellTool as Nt, buildPostCompactAttachments as O, isValidExtensionConfigItem as On, reserveChildLabel as Ot, NO_TOOLS_PREAMBLE as P, EXTENSION_BUS_MAX_PAYLOAD_BYTES as Pn, shell as Pt, fetchExtensionSource as Q, defaultRepeatGuardNormalize as Qn, KEYBINDING_DEFS as Qt, buildFullCompactPrompt as R, artifactKindLabel as Rn, multiEdit as Rt, resolveLegacyPersistDir as S, scanExtensionDirectories as Sn, writeFile$1 as St, resolvePersistDir as T, defineExtension as Tn, createToolSearchTool as Tt, sliceForCompaction as U, pullRequestKind as Un, createInteractionTool as Ut, ANCHOR_PREVIEW_MAX_CHARS as V, fileKind as Vn, matchModelEntries as Vt, stripImagesFromTurns as W, refreshArtifact as Wn, grep as Wt, createExtensionPromptBridge as X, effectiveContextWindow as Xn, recordArtifact as Xt, EMPTY_EXTENSION_REGISTRY as Y, OUTPUT_RESERVE_TOKENS as Yn, RECORD_ARTIFACT_TOOL as Yt, ExtensionInstallError as Z, shouldAutoCompact as Zn, DEFAULT_KEYBINDINGS as Zt, buildPersistedStub as _, defaultExtensionScanPaths as _n, createWorkspaceSurface as _t, stagedToolState as a, matchesBinding as an, hydrateReadStateFromSessionAsync as ar, createExtensionHud as at, migrateSessionArtifactDirs as b, isExtensionDefinition as bn, basicTools as bt, INTERRUPT_MESSAGE_FOR_TOOL_USE as c, readKeybindings as cn, buildExtensionRegistry as ct, TOOL_USE_SKIPPED_MESSAGE as d, stripJsonComments as dn, filterExtensionRegistry as dt, KEYBINDING_KEY_COL_WIDTH as en, normalizeShellCommand as er, listExtensionCandidates as et, applyCompactSummaryCutoff as f, ALTERNATE_CRED_KEY_SUFFIX as fn, filterRegistryPlugins as ft, PERSISTENCE_PREVIEW_BYTES as g, ENTRY_CANDIDATES as gn, createExtensionHostRuntimeBridge as gt, PERSISTED_STUB_PREFIX as h, registerExtensionHostModules as hn, createArtifactsSurface as ht, isToolStateOps as i, keybindingsPath as in, hydrateReadStateFromSession as ir, updateInstalledExtension as it, selectRecentFiles as j, resolveExtensionConfigValue as jn, createSkillsReadTool as jt, selectFilesFromReadState as k, isValidExtensionConfigValue as kn, createSkillsUseTool as kt, SHELL_CASCADE_CANCEL_MESSAGE as l, readKeybindingsRaw as ln, composeExtensionPreset as lt, renderStaleReadNotice as m, isReservedCredKey as mn, partitionExtensionCatalog as mt, DEFAULT_MAX_VALUE_BYTES as n, formatBindingForDisplay as nn, getReadState as nr, readExtensionInstallProvenance as nt, normalizeProviders as o, mergeKeybindings as on, readStateKey as or, discoverAndBuildExtensionRegistry as ot, collectNewlyStaleReadPaths as p, alternateCredKey as pn, mergeContributions as pt, CompactInvalidInputError as q, createArtifactDetectHook as qn, validateToolArgs as qt, createToolStateController as r, groupBindings as rn, hashContent as rr, removeInstalledExtension as rt, resolveModelTargets as s, parseBindingSpec as sn, resolveReadStateMap as sr, buildExtensionPreset as st, createAgent as t, ensureKeybindingsFile as tn, stableStringify as tr, parseExtensionInstallSource as tt, TOOL_USE_CANCELLED_MESSAGE as u, resolveExtensionKeybindings as un, disposeExtensionRegistry as ut, cleanupPersistedSession as v, discoverExtensions as vn, composePresets as vt, resolveMcpWarningsDir as w, setDebugLogSink as wn, waitTask as wt, rehomePersistedStubs as x, parseExtensionScanPathEnv as xn, basic_default as xt, maybePersistToolResult as y, inlineLoadedExtension as yn, definePreset as yt, buildTailCompactPrompt as z, branchKind as zn, createModelSearchTool as zt };
17821
18070
 
17822
- //# sourceMappingURL=agent-B_uQo4f1.js.map
18071
+ //# sourceMappingURL=agent-Djzx-1kD.js.map