zidane 5.6.14 → 5.7.4

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 (119) hide show
  1. package/README.md +3 -1
  2. package/dist/{agent-ClkpElCZ.d.ts → agent-BNS2nx_T.d.ts} +535 -15
  3. package/dist/agent-BNS2nx_T.d.ts.map +1 -0
  4. package/dist/chat/pure.d.ts +4 -0
  5. package/dist/chat/pure.js +3 -0
  6. package/dist/chat.d.ts +31 -661
  7. package/dist/chat.d.ts.map +1 -1
  8. package/dist/chat.js +5 -3
  9. package/dist/chat.js.map +1 -1
  10. package/dist/contexts/docker.d.ts +1 -1
  11. package/dist/contexts/docker.d.ts.map +1 -1
  12. package/dist/contexts/docker.js.map +1 -1
  13. package/dist/{contexts-BOtMvzli.js → contexts-BD2U_xpi.js} +2 -2
  14. package/dist/{contexts-BOtMvzli.js.map → contexts-BD2U_xpi.js.map} +1 -1
  15. package/dist/contexts.d.ts +3 -3
  16. package/dist/contexts.js +1 -1
  17. package/dist/edit-utils-DnfNoj16.js +574 -0
  18. package/dist/edit-utils-DnfNoj16.js.map +1 -0
  19. package/dist/{errors-DdZXnyXE.js → errors-CoQnKRf1.js} +32 -2
  20. package/dist/{errors-DdZXnyXE.js.map → errors-CoQnKRf1.js.map} +1 -1
  21. package/dist/fetch-url-CPxfiXDa.js +518 -0
  22. package/dist/fetch-url-CPxfiXDa.js.map +1 -0
  23. package/dist/image-sniff-B7uFSNO1.js +90 -0
  24. package/dist/image-sniff-B7uFSNO1.js.map +1 -0
  25. package/dist/{index-CbS75MD3.d.ts → index-CZOwAJIX.d.ts} +2 -2
  26. package/dist/index-CZOwAJIX.d.ts.map +1 -0
  27. package/dist/{index-CTDMMdIy.d.ts → index-Ck_AWt8P.d.ts} +3 -4
  28. package/dist/index-Ck_AWt8P.d.ts.map +1 -0
  29. package/dist/{index-v3Tzobqr.d.ts → index-KiS7w0dC.d.ts} +3 -3
  30. package/dist/index-KiS7w0dC.d.ts.map +1 -0
  31. package/dist/index.d.ts +6 -6
  32. package/dist/index.js +13 -12
  33. package/dist/index.js.map +1 -1
  34. package/dist/{interpolate-DM1UcKeQ.js → interpolate-TySiqKzc.js} +23 -23
  35. package/dist/{interpolate-DM1UcKeQ.js.map → interpolate-TySiqKzc.js.map} +1 -1
  36. package/dist/{login-7tHcckmX.js → login-BDeqENSe.js} +7 -58
  37. package/dist/login-BDeqENSe.js.map +1 -0
  38. package/dist/{mcp-DGeB7-3D.js → mcp-Kqzz-Rs_.js} +8 -6
  39. package/dist/mcp-Kqzz-Rs_.js.map +1 -0
  40. package/dist/mcp.d.ts +2 -2
  41. package/dist/mcp.js +1 -1
  42. package/dist/{messages-Dym8S_YH.js → messages-CvRQTdbR.js} +118 -39
  43. package/dist/messages-CvRQTdbR.js.map +1 -0
  44. package/dist/{presets-w9Px_aAm.js → presets-JuOnSI-i.js} +2 -2
  45. package/dist/{presets-w9Px_aAm.js.map → presets-JuOnSI-i.js.map} +1 -1
  46. package/dist/presets.d.ts +3 -3
  47. package/dist/presets.js +1 -1
  48. package/dist/{providers-beXyD9W9.js → providers-h4HJPbbv.js} +485 -31
  49. package/dist/providers-h4HJPbbv.js.map +1 -0
  50. package/dist/providers.d.ts +2 -2
  51. package/dist/providers.js +3 -3
  52. package/dist/restate.d.ts +1 -1
  53. package/dist/restate.d.ts.map +1 -1
  54. package/dist/restate.js.map +1 -1
  55. package/dist/session/sqlite.d.ts +1 -1
  56. package/dist/session/sqlite.d.ts.map +1 -1
  57. package/dist/session/sqlite.js +1 -1
  58. package/dist/session/sqlite.js.map +1 -1
  59. package/dist/{session-BRIsmBSY.js → session-BzLou2_-.js} +2 -2
  60. package/dist/{session-BRIsmBSY.js.map → session-BzLou2_-.js.map} +1 -1
  61. package/dist/session.d.ts +2 -2
  62. package/dist/session.js +2 -2
  63. package/dist/skills.d.ts +3 -3
  64. package/dist/skills.js +1 -1
  65. package/dist/skills.js.map +1 -1
  66. package/dist/{stats-Lc3zL3RM.js → stats-DAKBEKjc.js} +12 -2
  67. package/dist/stats-DAKBEKjc.js.map +1 -0
  68. package/dist/{stdio-loader-EVAF5KlU.js → stdio-loader-Ce68wUmM.js} +4 -4
  69. package/dist/stdio-loader-Ce68wUmM.js.map +1 -0
  70. package/dist/tool-formatters-CU-j3a3e.d.ts +1471 -0
  71. package/dist/tool-formatters-CU-j3a3e.d.ts.map +1 -0
  72. package/dist/tools/fetch-url.d.ts +70 -0
  73. package/dist/tools/fetch-url.d.ts.map +1 -0
  74. package/dist/tools/fetch-url.js +2 -0
  75. package/dist/tools/web-search.d.ts +7 -0
  76. package/dist/tools/web-search.d.ts.map +1 -0
  77. package/dist/tools/web-search.js +190 -0
  78. package/dist/tools/web-search.js.map +1 -0
  79. package/dist/{tools-DhrLrOEr.js → tools-BGtJK0vo.js} +1368 -421
  80. package/dist/tools-BGtJK0vo.js.map +1 -0
  81. package/dist/tools.d.ts +3 -3
  82. package/dist/tools.js +1 -1
  83. package/dist/{turn-operations-UAkOjO-u.js → transcript-anchors-BTSZAPVc.js} +147 -2713
  84. package/dist/transcript-anchors-BTSZAPVc.js.map +1 -0
  85. package/dist/{transcript-anchors-D0TR6djV.d.ts → transcript-anchors-DX90kXc4.d.ts} +13 -1299
  86. package/dist/transcript-anchors-DX90kXc4.d.ts.map +1 -0
  87. package/dist/tui.d.ts +58 -28
  88. package/dist/tui.d.ts.map +1 -1
  89. package/dist/tui.js +1349 -422
  90. package/dist/tui.js.map +1 -1
  91. package/dist/turn-operations-CCHfR9eC.js +1938 -0
  92. package/dist/turn-operations-CCHfR9eC.js.map +1 -0
  93. package/dist/turn-operations-DDIl4YVk.d.ts +658 -0
  94. package/dist/turn-operations-DDIl4YVk.d.ts.map +1 -0
  95. package/dist/{types-oKPBdCmL.js → types-BPw_i5vb.js} +1 -1
  96. package/dist/types-BPw_i5vb.js.map +1 -0
  97. package/dist/{types-KukEp-mi.d.ts → types-CEAMIUXw.d.ts} +1 -1
  98. package/dist/types-CEAMIUXw.d.ts.map +1 -0
  99. package/dist/types.d.ts +4 -4
  100. package/dist/types.js +3 -3
  101. package/docs/CHAT.md +53 -6
  102. package/docs/SKILL.md +3 -0
  103. package/docs/TUI.md +7 -0
  104. package/package.json +18 -2
  105. package/dist/agent-ClkpElCZ.d.ts.map +0 -1
  106. package/dist/index-CTDMMdIy.d.ts.map +0 -1
  107. package/dist/index-CbS75MD3.d.ts.map +0 -1
  108. package/dist/index-v3Tzobqr.d.ts.map +0 -1
  109. package/dist/login-7tHcckmX.js.map +0 -1
  110. package/dist/mcp-DGeB7-3D.js.map +0 -1
  111. package/dist/messages-Dym8S_YH.js.map +0 -1
  112. package/dist/providers-beXyD9W9.js.map +0 -1
  113. package/dist/stats-Lc3zL3RM.js.map +0 -1
  114. package/dist/stdio-loader-EVAF5KlU.js.map +0 -1
  115. package/dist/tools-DhrLrOEr.js.map +0 -1
  116. package/dist/transcript-anchors-D0TR6djV.d.ts.map +0 -1
  117. package/dist/turn-operations-UAkOjO-u.js.map +0 -1
  118. package/dist/types-KukEp-mi.d.ts.map +0 -1
  119. package/dist/types-oKPBdCmL.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-BPw_i5vb.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/**\n * Shared types for the agent system.\n */\n\nimport type { ToolDef } from './tools/types'\nimport { Buffer } from 'node:buffer'\n\n// ---------------------------------------------------------------------------\n// Thinking / Reasoning\n// ---------------------------------------------------------------------------\n\n/**\n * Thinking / extended-reasoning configuration.\n *\n * - `'off'` — no thinking.\n * - `'minimal' | 'low' | 'medium' | 'high'` — explicit token budget. Maps to\n * provider-specific reasoning controls (Anthropic `thinking.type='enabled'`\n * with a budget; OpenAI `reasoning_effort`).\n * - `'adaptive'` — let the model decide per-turn whether and how much to think.\n * Anthropic-only (`thinking.type='adaptive'`). Other providers fall back to\n * no reasoning when this value is supplied.\n */\nexport type ThinkingLevel = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'adaptive'\n\n// ---------------------------------------------------------------------------\n// Clock / determinism seam\n// ---------------------------------------------------------------------------\n\n/**\n * Time + UUID source. Defaults to `Date.now()` and `crypto.randomUUID()`.\n *\n * Scoped to **journaled metadata** — every callsite that lands in\n * `SessionTurn.id`, `SessionTurn.createdAt`, `runId`, `turnId`, or hook\n * payloads consumers may persist. Live-only measurements (TTFT deltas,\n * `elapsed` counters) keep `Date.now()` directly so they reflect real\n * wall-clock progress.\n *\n * `now()` is allowed to return a `Promise<number>` so durable-execution\n * adapters can journal each timestamp (Restate's `ctx.date.now()` is\n * async because it routes through `ctx.run`). The loop awaits at every\n * callsite. `randomUUID()` stays synchronous because Restate's\n * `ctx.rand.uuidv4()` is deterministic-from-seed and doesn't need\n * journaling. The native default returns sync values for both.\n *\n * Durable-execution adapters (Restate, Temporal, …) inject a journaled\n * variant — Restate: `{ now: () => ctx.date.now(), randomUUID: () => ctx.rand.uuidv4() }` —\n * so replay regenerates byte-identical session metadata across attempts.\n *\n * Precedence: `AgentRunOptions.clock` > `AgentOptions.clock` >\n * {@link DEFAULT_AGENT_CLOCK}.\n */\nexport interface AgentClock {\n /**\n * Current wall-clock time in ms (epoch). May be async so journaled\n * implementations (Restate) can plumb through their durable timer.\n */\n now: () => number | Promise<number>\n /**\n * RFC-4122 v4 UUID string. Always sync — Restate's `rand.uuidv4()`\n * is seeded from the invocation ID and replay-stable by construction.\n */\n randomUUID: () => string\n}\n\n/** Native clock backing the default (Date.now + crypto.randomUUID). */\nexport const DEFAULT_AGENT_CLOCK: AgentClock = {\n now: () => Date.now(),\n randomUUID: () => crypto.randomUUID(),\n}\n\n// ---------------------------------------------------------------------------\n// MCP server configuration\n// ---------------------------------------------------------------------------\n\n/**\n * Slim shape of an upstream MCP tool descriptor — what `client.listTools()`\n * returns per entry. Exposed publicly so hosts can persist the schemas\n * between runs and feed them back via {@link McpServerConfig.cachedTools}\n * to skip the `tools/list` round-trip on subsequent bootstraps.\n */\nexport interface McpToolSchema {\n name: string\n description?: string | null\n inputSchema?: unknown\n}\n\nexport interface McpServerConfig {\n /** Display name (used for tool namespacing) */\n name: string\n /** Transport type */\n transport: 'stdio' | 'sse' | 'streamable-http'\n /** For stdio: command to run */\n command?: string\n /** For stdio: command arguments */\n args?: string[]\n /**\n * For stdio: environment variables to pass to the server process.\n *\n * Merged on top of the MCP SDK's default inherited environment — a safety\n * whitelist (`PATH`, `HOME`, `LANG`, `SHELL`, `USER` on POSIX; `APPDATA`,\n * `PATH`, ... on Win32). Setting this to `{}` no longer strips `PATH` from\n * the child process. Set {@link McpServerConfig.strictEnv} to `true` to\n * pass `env` verbatim with no inherited defaults.\n */\n env?: Record<string, string>\n /**\n * When true, {@link McpServerConfig.env} is passed verbatim to the spawned\n * process — the MCP SDK's default inherited environment (`PATH`, `HOME`, ...)\n * is NOT merged in. Most consumers should leave this off; the default merge\n * prevents `spawn ENOENT` when a stdio server declares an `env` without\n * restating `PATH`.\n */\n strictEnv?: boolean\n /**\n * For stdio: working directory of the spawned child process. Forwarded to\n * `StdioClientTransport`'s `cwd` (which is `spawn`'s `cwd`).\n *\n * When omitted, the child inherits the parent's cwd (`process.cwd()` at\n * spawn time). Set this when the server resolves paths relative to its\n * own cwd (e.g. `@blitz/bolt-mcp-server` reading `supabase/functions/...`)\n * and the project directory differs from where the agent was launched.\n *\n * Pass an absolute path. Relative values are forwarded as-is to the SDK,\n * which resolves them against the parent process's cwd.\n */\n cwd?: string\n /** For sse/streamable-http: server URL */\n url?: string\n /** Optional headers for HTTP transports */\n headers?: Record<string, string>\n /**\n * OAuth 2.1 authentication (sse / streamable-http only).\n *\n * - `'oauth'` — enables the SDK's OAuth flow with RFC 9728 protected-resource\n * metadata discovery, RFC 8414 / OIDC authorization-server metadata, RFC 7591\n * dynamic client registration, PKCE, and refresh-token rotation. Tokens persist\n * between runs via the host's credential store.\n * - `undefined` (default) — no OAuth. The host may still auto-promote a server\n * to OAuth on `UnauthorizedError` IF no static `Authorization` header is set\n * (the headers check stops us from second-guessing user-managed bearer tokens).\n *\n * Recognized aliases at parse time: Cursor's `authMethod: 'mcpOAuth'` maps to\n * `auth: 'oauth'` so `~/.cursor/mcp.json` pastes work unchanged.\n */\n auth?: 'oauth'\n /**\n * Timeout in milliseconds for MCP server bootstrap (connect + tool discovery).\n *\n * Zidane connects MCP servers lazily on the first `run()`. Without a\n * bootstrap timeout, a slow or hung server can delay the first provider call\n * for an arbitrarily long time even when that MCP server is never used.\n *\n * Default: `10000`.\n */\n bootstrapTimeout?: number\n /** Timeout in milliseconds for MCP tool calls (default: 30000) */\n toolTimeout?: number\n /**\n * Allow-list of tool names to expose. Names match the upstream tool name\n * (NOT the namespaced `mcp_{server}_{tool}` form). Tools not in the list are\n * dropped before registration — the model never sees them in its catalog and\n * the wire cost of advertising them is avoided.\n *\n * Mutually exclusive with {@link McpServerConfig.disabledTools} — passing both\n * throws at bootstrap time.\n *\n * Composes with {@link McpServerConfig.toolFilter}: allow-list applies first,\n * then the predicate. Composes with the `mcp:tools:filter` hook: config-side\n * filters apply first, then the hook can further narrow the list.\n */\n enabledTools?: string[]\n /**\n * Deny-list of tool names. Tools matching are dropped before registration.\n * Same matching semantics as {@link McpServerConfig.enabledTools}.\n */\n disabledTools?: string[]\n /**\n * Custom predicate run on each upstream tool. Return `true` to keep, `false`\n * to drop. Receives the raw `listTools()` payload — useful for filtering by\n * description, schema shape, or other metadata that an allow/deny list can't\n * express.\n *\n * Runs after the allow/deny filter but before the `mcp:tools:filter` hook.\n */\n toolFilter?: (tool: { name: string, description?: string | null, inputSchema?: unknown }) => boolean\n /**\n * Per-server override for {@link AgentBehavior.toolDisclosure}. When set,\n * this server's tools follow this disclosure mode regardless of the\n * agent-wide default. Useful when one big MCP server (200+ tools) should\n * stay lazy while smaller servers stay eager.\n *\n * Default: inherits from `behavior.toolDisclosure`.\n */\n disclosure?: 'eager' | 'lazy'\n /**\n * Pre-cached tool schemas to advertise without issuing `tools/list` at\n * bootstrap. The connection is still established (the SDK's `connect()`\n * is needed for `tools/call`) — only the discovery round-trip is\n * skipped. Schemas are trusted as-is; the host owns invalidation\n * (typical cache key: `(server identity, server version)`). If the\n * server later returns `MethodNotFound` for a cached tool, the host\n * should drop the entry from its cache so the next bootstrap re-lists.\n *\n * Compatible with every transport, every auth mode, and with\n * {@link McpServerConfig.lazyConnect}. Composes with the existing\n * `enabledTools` / `disabledTools` / `toolFilter` filters — those run\n * over the cached schemas exactly as they would over `listTools()`\n * output.\n */\n cachedTools?: McpToolSchema[]\n /**\n * Defer the `client.connect(transport)` call until the first\n * `tools/call` reaches this server. Bootstrap registers the server's\n * tools using {@link McpServerConfig.cachedTools} without touching\n * the network, taking MCP setup off the critical path of\n * `agent.run()`. The first invocation pays the connect cost\n * (~200-500ms typically); every subsequent call reuses the live\n * client.\n *\n * Requires {@link McpServerConfig.cachedTools} — without schemas in\n * hand there is nothing to advertise to the model, so deferring the\n * connection has no purpose. Bootstrap rejects the config otherwise.\n *\n * **Incompatible with `auth: 'oauth'`**: the OAuth handshake (token\n * refresh / RFC 9728 metadata discovery) can fail in ways that today\n * fire `mcp:auth:required` at bootstrap so the host can surface a\n * login affordance *before* the model commits to calling a tool.\n * Deferring that to first call means an auth failure surfaces mid-run\n * as a tool-result error, which the model can't recover from without\n * a fresh prompt. Bootstrap rejects the combination so the error is\n * loud and proximate to the misconfiguration. Use OAuth servers\n * without `lazyConnect` (with `cachedTools` alone, if you want to\n * skip the `tools/list` round-trip).\n *\n * On connect failure (network error, transport refused), the cached\n * promise is dropped so the next `tools/call` retries. The model\n * sees the failure as a normal tool error. Subsequent calls remain\n * eligible to succeed once the upstream is reachable again.\n */\n lazyConnect?: boolean\n}\n\n// ---------------------------------------------------------------------------\n// Tool execution\n// ---------------------------------------------------------------------------\n\n/**\n * Configuration for the loop's retry-with-backoff policy around\n * `provider.stream()`. See {@link AgentBehavior.retry}.\n */\nexport interface RetryConfig {\n /**\n * Maximum number of attempts including the initial call. `1` disables retry.\n * Values below `1`, non-finite, or non-integer fall back to the default.\n *\n * Default: `3`.\n */\n maxAttempts?: number\n /**\n * Initial backoff delay in milliseconds. Subsequent delays double\n * (exponential) before jitter is applied and the cap enforced.\n *\n * Default: `1000`.\n */\n initialDelayMs?: number\n /**\n * Upper bound on any single backoff delay in milliseconds. Caps both the\n * exponential schedule and any `retry-after` header the server returns.\n *\n * Default: `30_000`.\n */\n maxDelayMs?: number\n}\n\n/**\n * Per-tool argument hasher used by {@link AgentBehavior.dedupTools}.\n *\n * Returning a non-empty string activates dedup with that string as the\n * cache key. Returning `undefined` (or `''` / non-string) opts THIS call\n * out — the tool runs normally and no state is recorded. See\n * `dedupTools` for the full contract.\n */\nexport type DedupHasher = (input: Record<string, unknown>) => string | undefined\n\n/**\n * Per-tool dedup configuration. Two equivalent forms:\n *\n * - **Hasher only** (legacy form): a bare function. The framework runs\n * in `'replay'` mode — identical re-calls replay the prior result.\n * Existing consumers that pass a function continue working unchanged.\n * - **Config object**: explicit `hasher` plus a `mode`:\n * - `'replay'` (default) — replay the cached result on identical re-\n * calls. Cheap loop, but doesn't BREAK the loop — the model keeps\n * seeing the same tool_result and keeps trying.\n * - `'block-after'` — replay for the first `threshold` identical calls,\n * then refuse with `Blocked: <reason>` via `tool:gate`. Designed to\n * break tight loops where the model fixates on a single failing\n * call. The block lands on the Nth identical call (i.e. once the\n * total count reaches `threshold`); the cap is sticky — every\n * subsequent identical call also blocks until a different input\n * resets the counter.\n *\n * `reason` is the model-visible refusal text. The framework formats the\n * final tool_result as `Blocked: <reason>` (see `tool:gate` docs).\n * Strings are used verbatim; the callback form receives the input and\n * the (now-blocking) repeat count so it can produce per-invocation\n * messaging like `Blocked: 4 identical \"shell\" calls — try a different\n * approach`. Default reason is generic but actionable.\n */\n/**\n * Pluggable client-side context compactor — see\n * {@link AgentBehavior.compactStrategy}. The loop invokes this in place\n * of the built-in tail elision when `compactStrategy` is a function.\n *\n * Contract:\n * - Operates on the wire-level message list — the post-alias / post-\n * sanitize / post-`context:transform` view the provider will see.\n * The framework treats the returned array as the new wire payload;\n * `ctx.session` / `ctx.turns` are never modified.\n * - Must preserve `tool_use ↔ tool_result` adjacency. Stranding a\n * `tool_use` without its matching `tool_result` (or vice versa) will\n * trip the loop's pair-repair pass and either repair the violation\n * or throw (`strictToolPairing`).\n * - The trailing user message must remain — providers reject\n * assistant-tail wire payloads. If unsure, leave the last user turn\n * intact and operate on the prefix only.\n * - May return the input verbatim (e.g. when the total stays under the\n * host's threshold).\n * - Sync or async. The loop awaits the result, so a long-running LLM\n * summarizer will block the next turn — keep latency in mind.\n *\n * `ctx.threshold` and `ctx.keepTurns` are forwarded from\n * `behavior.compactThreshold` / `behavior.compactKeepTurns` so hosts\n * can reuse the same knobs the built-in tail mode uses.\n * `ctx.totalBytes` is the pre-compaction total — the same number the\n * tail mode uses to gate its threshold check, exposed so the function\n * can short-circuit on under-threshold inputs without recomputing.\n */\nexport type CompactFunction = (\n messages: SessionMessage[],\n ctx: {\n /** Resolved `behavior.compactThreshold` (default `131_072` when unset). */\n threshold: number\n /** Resolved `behavior.compactKeepTurns` (default `4` when unset). */\n keepTurns: number\n /**\n * Pre-compaction sum of `tool_result` output bytes across `messages`\n * — the same heuristic the built-in tail mode uses to decide\n * whether to act. Forwarded so the function can `return messages`\n * verbatim on a quick under-threshold check.\n */\n totalBytes: number\n },\n) => SessionMessage[] | Promise<SessionMessage[]>\n\nexport type DedupToolConfig\n = | DedupHasher\n | {\n hasher: DedupHasher\n mode?: 'replay' | 'block-after'\n /**\n * For `mode: 'block-after'` only — total count of identical calls\n * (including the first dispatch) at which the gate switches from\n * replay to block. Threshold `4` blocks the 4th identical call;\n * the first 3 (one dispatch + two replays) still go through.\n *\n * Ignored for `mode: 'replay'`. Default: `4`. Values `<= 1` are\n * clamped to `2` (anything less would block the very first replay,\n * which would behave the same as not having a hasher at all).\n */\n threshold?: number\n /**\n * Refusal text rendered into the model-visible tool_result as\n * `Blocked: <reason>`. Either a literal string or a callback that\n * receives the call's input and the repeat count (1-indexed total\n * of identical calls so far, including this blocking one).\n *\n * Default: a generic \"identical call repeated N times\" message.\n */\n reason?: string | ((input: Record<string, unknown>, count: number) => string)\n }\n\nexport interface AgentBehavior {\n /**\n * Maximum number of tools that may be in flight concurrently within a\n * single assistant turn. The scheduler dispatches concurrency-safe tools\n * (`ToolDef.isConcurrencySafe`) in parallel up to this cap; unsafe tools\n * act as barriers (wait for the fleet to drain, then run alone).\n *\n * Default: `10`. Set to `1` to force fully sequential dispatch regardless\n * of per-tool flags — useful for deterministic debugging / eval-grade\n * runs. Values `< 1` are clamped to `1`.\n */\n maxConcurrentTools?: number\n /**\n * Max agent loop iterations.\n *\n * Default: unlimited (Infinity). The loop runs until the model signals\n * completion (no tool calls / `end_turn`), the abort signal fires, or this\n * cap is hit. Set a finite value as a safety net for runaway loops.\n */\n maxTurns?: number\n /**\n * Run-level cost ceiling, expressed in USD. After each turn, the sum of\n * `TurnUsage.cost` across the run is compared against this value; if the\n * total has crossed the cap, the loop throws `AgentBudgetExceededError`\n * with `limit: 'cost'`. The agent finalizes the session run as\n * `'aborted'` so partial spend is recorded.\n *\n * Complements {@link maxTurns}: a single expensive turn (large context\n * window, deep reasoning) can blow past a turn-count cap but cost is\n * the unit operators actually want to bound for unattended runs.\n *\n * Checked **post-turn**, so the run may exceed by up to one turn's\n * spend before tripping — soft cap, not exact. Default: unbounded.\n * Set `0` to disable explicitly (negative / `NaN` are ignored).\n *\n * Requires the provider to populate `TurnUsage.cost` (every built-in\n * provider does). For providers that don't, the check silently no-ops\n * and {@link maxTotalTokens} is the right knob instead.\n */\n maxCostUsd?: number\n /**\n * Run-level token ceiling — sum of `TurnUsage.input + TurnUsage.output`\n * across the run. Same post-turn semantic + soft-cap behavior as\n * {@link maxCostUsd}; throws `AgentBudgetExceededError` with\n * `limit: 'tokens'` when exceeded.\n *\n * Cache reads / creations are **not** included in the sum — they're\n * billed at a steep discount, so counting them at par would make the\n * ceiling under-estimate the run's true affordability. Operators\n * wanting a stricter accounting should override via the `usage` hook.\n *\n * Default: unbounded. Set `0` to disable explicitly.\n */\n maxTotalTokens?: number\n /**\n * Bounded retry-with-backoff policy applied around `provider.stream()`.\n *\n * Triggers only on errors the provider classifies as `retryable: true`\n * (typically 429 / 5xx HTTP responses and mid-stream SSE errors like\n * Anthropic's `overloaded_error`). Terminal failures (auth, invalid\n * request, context exceeded, aborts) skip retry and propagate.\n *\n * Skipped when any output has already streamed to the user this turn —\n * replaying over partial text would produce a confusing transcript.\n * Mid-stream continuation (replaying with the partial assistant response\n * appended for the model to continue from) is a separate, larger change.\n *\n * The Anthropic SDK already retries pre-stream errors up to twice\n * internally; this loop-level retry catches mid-stream failures and\n * other providers that don't ship an SDK-side retry.\n *\n * Default: 3 attempts, 1s → 2s → 4s exponential with full jitter,\n * capped at 30s per delay, with `retry-after` / `retry-after-ms`\n * headers honored when present. Set `maxAttempts: 1` to disable.\n */\n retry?: RetryConfig\n /** Max tokens per LLM response (default: 16384) */\n maxTokens?: number\n /** Thinking token budget — overrides the level-based default when set */\n thinkingBudget?: number\n /**\n * Default model-specific options applied to every run, keyed by option id\n * (e.g. `{ fast: true }`). A per-run {@link AgentRunOptions.modelOptions}\n * takes precedence when set. See `StreamOptions.modelOptions`.\n */\n modelOptions?: Record<string, boolean>\n /** JSON Schema for structured output enforcement */\n schema?: Record<string, unknown>\n /**\n * Enable provider prompt caching. When on (default), the provider marks the\n * system prompt, tools, and the last stable message with cache breakpoints so\n * the shared prefix is served from cache across turns.\n *\n * - Anthropic: `cache_control: { type: 'ephemeral' }` on the last `system`\n * content part, the last tool, and the last message content part.\n * - OpenAI-compatible / OpenRouter: same shape — honored by Anthropic-backed\n * OpenRouter routes and by Gemini; ignored (no-op) by providers that cache\n * automatically (OpenAI, DeepSeek, Grok, Groq, Moonshot).\n *\n * Usage is surfaced via `TurnUsage.cacheRead` / `TurnUsage.cacheCreation`.\n *\n * Default: `true`.\n */\n cache?: boolean\n /**\n * Soft per-turn cap on total tool-output bytes. When the sum of `outputBytes`\n * across a turn's tool results exceeds this value, the loop injects a\n * synthetic user message instructing the model to summarize before calling\n * more tools, and fires the `budget:exceeded` hook.\n *\n * Measured **post-`tool:transform`** so consumer truncation counts toward the\n * budget. Off by default (undefined / `0` disables the check). A reasonable\n * starting value for OSS-model integrations is `32768`.\n */\n toolOutputBudget?: number\n /**\n * Canonical tool names whose output is exempt from\n * {@link AgentBehavior.toolOutputBudget} accounting. Their bytes don't\n * count toward the per-turn cap and the \"summarize before calling more\n * tools\" nudge is not triggered by them alone.\n *\n * Intended for tools whose entire purpose is to LOAD context into the\n * conversation — penalising them via the budget creates the exact\n * failure mode the budget is meant to prevent (the model gets steered\n * away from the very tool it just called to make progress):\n *\n * - `tool_search` — returns full `inputSchema` payloads for MCP tools the\n * model needs to call next. A Notion MCP server with 20+ tools easily\n * exceeds 64 KiB of schema JSON in a single discovery call.\n * - `skills_use` / `skills_read` — inject skill content; that text IS\n * the value of the call.\n *\n * `read_file` is intentionally NOT in the default list: a 200 KiB file\n * load is exactly the case the budget should steer against (pagination\n * or summarisation is the right next move).\n *\n * For MCP tools, key by the namespaced wire name (`mcp_<server>_<tool>`).\n * The matching happens on the canonical (registry-key) name, so aliases\n * are stable.\n *\n * Default: `undefined` — every tool counts. Chat profiles set their own\n * list — see `src/chat/agents.ts`.\n */\n toolOutputBudgetExcludeTools?: readonly string[]\n /**\n * Deduplicate identical re-reads of the same file in `read_file`. When the\n * model re-reads a file with the same slice and the bytes haven't changed\n * since the last read in this session, the tool returns a short stub\n * instead of re-emitting the full content. Pairs with the read-before-edit\n * guard in `edit` / `multi_edit`.\n *\n * Requires a session (set via `createSession()`); without one, the flag is\n * a no-op since per-session state has nowhere to live.\n *\n * Default: `true`.\n */\n dedupReads?: boolean\n /**\n * Taper the thinking budget over the course of a run. Late turns are\n * usually checkpoint / cleanup work where reasoning rarely pays for\n * itself; early turns benefit most. Two forms:\n *\n * - **Struct** — geometric decay starting after `afterTurn`, multiplying by\n * `factor` each subsequent turn, clamped to `floor`. Example\n * `{ afterTurn: 5, factor: 0.5, floor: 1024 }` with a base budget of 8192:\n * turns 1-5 = 8192, turn 6 = 4096, turn 7 = 2048, turn 8+ = 1024.\n * - **Function** — `(runTurn, baseBudget) => number`. Arbitrary curves;\n * `runTurn` is 1-indexed, run-relative (resumed sessions reset).\n *\n * No-op when `thinkingBudget` is unset. Honored by every provider that\n * respects `thinkingBudget` (anthropic explicit-budget `enabled` path,\n * adaptive `maxTokensCap`, openai-compat `max_tokens` padding).\n *\n * Default: `undefined` (no decay).\n */\n thinkingDecay?: { afterTurn: number, factor: number, floor: number } | ((runTurn: number, baseBudget: number) => number)\n /**\n * Per-tool soft call budget for this run. Keyed by **canonical** tool name.\n * On the first call after the run-cumulative dispatched count for that tool\n * reaches `max`, the framework fires `onExceed`:\n *\n * - `'steer'` (default) — let the call execute, but emit a synthetic user\n * message after the turn that nudges the model away from re-calling the\n * tool. Reuses the existing post-turn steer pathway used by\n * `toolOutputBudget`. Fires `tool-budget:exceeded` with `mode: 'steer'`.\n * - `'block'` — refuse the call via `tool:gate` `block`. The model sees a\n * `Blocked: <reason>` tool result. Fires `tool-budget:exceeded` with\n * `mode: 'block'`.\n * - **Function** — `(ctx) => { mode, message }`. The consumer supplies the\n * steering / refusal text and chooses the mode dynamically.\n *\n * Counts include both real dispatches and dedup substitutes (Z19 hits).\n * Excludes calls already blocked by an earlier gate (skill allow-list,\n * consumer hook). Tool dispatched by spawned subagents has its own per-run\n * counter — child counts never charge the parent.\n *\n * For MCP tools, key by the namespaced wire name (`mcp_<server>_<tool>`).\n *\n * Atomic in parallel mode: the middleware tracks its own per-tool\n * approval counter, incremented synchronously at gate-time. A\n * 4-call parallel batch against `max: 2` will let the first 2 through\n * and refuse the rest, even though the loop's `runToolCounts` only\n * propagates between calls (not within a single batch's gate fan-out).\n *\n * Default: `undefined` (no budget enforcement).\n */\n toolBudgets?: Record<string, {\n max: number\n onExceed?: 'steer' | 'block' | ((ctx: {\n tool: string\n count: number\n max: number\n }) => { mode: 'steer' | 'block', message: string })\n }>\n /**\n * Generic per-tool argument deduplication. Keyed by the tool's **canonical**\n * name (alias-stable). Each entry is a hasher: `(input) => string | undefined`.\n *\n * **Hasher contract** — three return values, three meanings:\n *\n * | Return | Meaning |\n * |-------------------------|------------------------------------------------------------------------|\n * | a non-empty string | Cache key for this call. Equal keys (most-recent-only, this session) |\n * | | replay the prior recorded result without re-dispatching the tool. |\n * | `undefined` | **Skip dedup for this call.** The tool runs normally; nothing recorded.|\n * | `''` / non-string | Treated identically to `undefined` (defensive: no dedup, no error). |\n *\n * The `undefined` opt-out is the way to say *\"this specific call is not\n * cacheable\"* (timestamps in input, randomness baked in, debug flags). It\n * is **not** the same as `JSON.stringify(input)` — that would dedup against\n * the verbatim input. Pick one explicitly:\n *\n * ```ts\n * // Always cache by full input — every identical re-call dedups.\n * dedupTools: { my_pure_tool: input => JSON.stringify(input) }\n *\n * // Cache by a normalized subset; non-cacheable shapes opt out.\n * dedupTools: {\n * execute_sql: (input) => {\n * const q = typeof input.query === 'string' ? input.query.trim().toLowerCase() : undefined\n * if (!q || q.includes('now()') || q.includes('random()')) return undefined\n * return q\n * },\n * }\n * ```\n *\n * On a hit, the previously-recorded result is replayed as the tool_result\n * without dispatching the tool. The substitution flows through `tool:gate`\n * `result` (Z20), so `tool:after` and `tool:transform` still fire.\n *\n * Requires a session (`createSession()`); without one, the map is a silent\n * no-op since per-session state has nowhere to live. Tools with side\n * effects or non-deterministic outputs (network, time, randomness) MUST\n * NOT be listed — there is no safety net beyond the consumer's hasher.\n *\n * For MCP tools, key by the namespaced wire name (`mcp_<server>_<tool>`).\n * Concurrency-safe siblings ({@link ToolDef.isConcurrencySafe}) in the\n * SAME assistant turn race against each other — none can dedup against\n * a sibling that started in the same batch. Unsafe tools act as barriers\n * and honor submission order within a turn, so an unsafe-but-listed tool\n * follows the cache cleanly.\n *\n * **Cache policy**: only the most recent `(hash, result)` per tool is\n * retained. Interleaved patterns (input A, input B, input A) miss on the\n * second A because B overwrote it. Sufficient for the common spam-the-\n * same-call loop; consumers needing a richer cache should hook\n * `tool:gate` directly.\n *\n * Default: `undefined` (no per-tool dedup).\n */\n dedupTools?: Record<string, DedupToolConfig>\n /**\n * Require `read_file` before `edit` / `multi_edit` on the same path, and\n * reject edits when the file has changed on disk since the last read in\n * this session. Eliminates the silent-corruption failure mode where a\n * model \"remembers\" stale content and applies a substring edit against\n * bytes that have moved.\n *\n * Requires a session. Off by default; turn it on for stricter eval-grade\n * runs where silent edit corruption would invalidate the result.\n *\n * Default: `false`.\n */\n requireReadBeforeEdit?: boolean\n /**\n * Client-side context compaction strategy. Use this for non-Anthropic\n * providers (OSS via cerebras / openai-compat / openrouter) that don't\n * have a server-side equivalent. Anthropic users should prefer the\n * server-side `context-management-2025-06-27` beta — see\n * `AnthropicParams.contextManagement`.\n *\n * - `'off'` (default) — no client-side compaction.\n * - `'tail'` — when total tool-output bytes in the persisted history\n * exceed `compactThreshold`, replace older `tool_result` outputs with a\n * short stub, keeping the newest `compactKeepTurns` turns intact. The\n * compaction is applied to the wire-level message list only; the\n * underlying session turns are not modified.\n * - **Function** ({@link CompactFunction}) — a pluggable replacement\n * that the loop calls instead of the built-in tail elision. The\n * function receives the post-`context:transform` wire messages and\n * returns the compacted view (sync or async). Use this to plug in\n * an LLM summarizer (\"`<analysis>` / `<summary>`\" style), a custom\n * semantic-aware compactor, or anything else hosts need beyond the\n * built-ins. The framework never modifies session turns — the same\n * wire-only contract as `'tail'` applies.\n *\n * Default: `'off'`.\n */\n compactStrategy?: 'off' | 'tail' | CompactFunction\n /**\n * Soft byte threshold that triggers tail compaction when\n * `compactStrategy === 'tail'`. Counts the post-`context:transform` bytes\n * of `tool_result` outputs across all messages. Default: `131_072` (128\n * KiB). Ignored when compaction is off.\n */\n compactThreshold?: number\n /**\n * Number of trailing turns to leave untouched during tail compaction. The\n * most-recent `compactKeepTurns` user/assistant messages are not eligible\n * for elision so the model keeps the freshest tool context. Default: `4`.\n */\n compactKeepTurns?: number\n /**\n * Prefix every line of `read_file` output with its 1-indexed line number\n * followed by a tab (`<N>\\t<content>`) — the compact `cat -n`-style\n * format Claude Code emits. The `edit` tool strips the prefix from\n * `old_string` / `new_string` so the model can paste back a numbered\n * chunk verbatim without breaking the match.\n *\n * Set `false` to opt out — useful for callers piping `read_file` into\n * downstream parsers that don't recognize the prefix. Per-call\n * `read_file({ lineNumbers: false })` overrides this default.\n *\n * Default: `true`.\n */\n readLineNumbers?: boolean\n /**\n * Replace older `read_file` `tool_result` blocks with a short stub when\n * a successful `edit` / `multi_edit` / `write_file` later in the same\n * run modified the same path. The replacement is applied to the\n * wire-level message list only — persisted session turns keep the\n * original content.\n *\n * Eliminates the common waste pattern where the model carries the\n * pre-edit file body forward across many turns \"in case it needs it\".\n * Pairs cleanly with `compactStrategy: 'tail'`: stale reads shrink\n * first, then the byte-threshold compaction fires if anything's left.\n *\n * Detection is conservative — only triggers when the corresponding\n * tool_result confirms success (`Edited …`, `Created …`, `Updated …`).\n * Failed edits and `No change needed` write_file calls do NOT\n * invalidate prior reads.\n *\n * Default: `false`.\n */\n elideStaleReads?: boolean\n /**\n * Tool disclosure strategy. Controls whether the model sees every tool's\n * full `inputSchema` in its tool list every turn (\"eager\") or whether MCP\n * tools are advertised as a name+description catalog in the system prompt\n * and only get full schemas after being surfaced via the `tool_search`\n * native tool (\"lazy\" / progressive disclosure).\n *\n * Native tools (those passed to `createAgent({ tools })`) and skill tools\n * are always eager — they are core to the agent and cheap. Only MCP tools\n * are eligible for lazy disclosure.\n *\n * When `'lazy'`, the agent:\n * - Appends a `<searchable_tools>` section to the system prompt listing\n * every MCP tool by `name` + `description` only (no `inputSchema`).\n * - Auto-injects a `tool_search` native tool (opt out via\n * {@link AgentBehavior.toolSearch}) the model uses to load schemas on\n * demand. Surfaced tools persist for the rest of the run.\n * - Rebuilds the wire-level tool list each turn in two phases: every\n * initially-eager tool in registry order (the cache-stable prefix),\n * then every dynamically-unlocked tool in **unlock order** at the\n * tail. Newly-unlocked tools never get inserted into the prefix, so\n * the provider tool-list cache (Anthropic ephemeral) only invalidates\n * the suffix from the first new schema onwards — not the full array.\n *\n * Trade-off: every `tool_search` invocation extends the tool list and\n * invalidates the tool-list cache breakpoint for the appended tail on\n * one turn. The eager-prefix portion stays cache-hit. With many MCP\n * servers, the savings on cold turns (fewer schemas in context) are\n * substantial; with one tiny MCP server, the overhead may not pay back.\n *\n * Default: `'eager'`.\n */\n toolDisclosure?: 'eager' | 'lazy'\n /**\n * Fine-grained config for the `tool_search` tool auto-injected when\n * {@link AgentBehavior.toolDisclosure} is `'lazy'`. No-op in eager mode.\n *\n * - `tool: false` — opt out of the auto-injection entirely. Use when the\n * host wants to ship a custom discovery tool. Note that the catalog\n * text drops the call-to-action prose in this case so the model isn't\n * pointed at a non-existent tool.\n * - `limit` — default cap on results returned per `tool_search` call when\n * the model omits the parameter. Default: `20`.\n *\n * Note on host-defined `tool_search`: a tool the host registers under the\n * name `tool_search` (or under any alias whose canonical is `tool_search`)\n * will shadow the auto-injected one — the catalog text will point at the\n * host's wire name, but driving the unlock flow requires either using\n * `createToolSearchTool({ catalog, unlocked })` from `tools/tool-search`\n * (which internally mutates the unlock set) or fully opting out via\n * `toolSearch.tool: false` and treating discovery as a host-side concern.\n * A bare host tool that doesn't touch the unlock set will not advance the\n * lazy disclosure state and the hard gate will keep refusing lazy calls.\n *\n * Default: `undefined` (auto-inject with the default limit).\n */\n toolSearch?: {\n tool?: false\n limit?: number\n }\n /**\n * Render the per-server `instructions` payload from the MCP `initialize`\n * handshake as a `# MCP Server Instructions` section appended to the\n * system prompt. Each server may return free-form guidance (e.g. \"the\n * database is already provisioned, use `apply_migration` directly\")\n * that materially changes how the model uses the server's tools.\n *\n * Matches the Claude Code SDK's default. Without this, models often\n * try to bootstrap state the server already advertises as ready —\n * e.g. running `npx supabase init` in a loop when the MCP server's\n * instructions would have said \"skip the init, use `apply_migration`\".\n *\n * The section is built once per run and embedded into the system\n * prompt next to the skills + searchable-tools catalogs, so it rides\n * the same system-prompt cache breakpoint. Server insertion order\n * matches `mcpServers` config order for byte-stable output.\n *\n * Only eager-connect servers contribute. `lazyConnect: true` servers\n * are excluded by design — pulling their instructions would force the\n * connection the host asked to defer. Empty / whitespace-only payloads\n * are normalized to \"no instructions\" so a server that returns `\"\"`\n * doesn't produce a stub heading.\n *\n * Default: `true`. Set `false` for paranoid embedders that want full\n * control of the system prompt or need to avoid leaking server\n * advisories into untrusted contexts.\n */\n surfaceMcpInstructions?: boolean\n /**\n * Hard cap on consecutive Anthropic `pause_turn` recoveries within a\n * single run. Anthropic 4.6+ may return `stop_reason: 'pause_turn'`\n * mid-turn for server-side reasons; the loop injects a \"Please continue.\"\n * user message and re-enters. With some 4.6 streaming edge cases the\n * model returns empty pauses indefinitely, which without this cap spins\n * forever burning tokens (the host's only escape was an external abort).\n *\n * When the consecutive-empty-pause counter reaches this value, the loop\n * exits cleanly. The last turn's `TurnUsage.finishReason` stays\n * `'pause'` so consumers can detect pause exhaustion from `stats`. The\n * `agent:abort` hook does NOT fire — this is graceful termination, not\n * user cancel.\n *\n * Only turns with no tool calls, no text, AND no thinking count toward\n * the cap (the case Claude Code's v2 SDK collapses to `stop` outright).\n * A pause turn with text resets the counter — productive turns are\n * never penalised.\n *\n * Set `0` to disable (loop will continue indefinitely on pauses; useful\n * only for tests). Default: `5`.\n */\n maxConsecutivePauseTurns?: number\n /**\n * Persist large `tool_result` outputs to disk and replace the in-message\n * content with a `<persisted-output>` stub (preview + filesystem path).\n * When the post-`tool:transform` byte size of a tool's result exceeds\n * this threshold, the framework writes the full payload to\n * `<persistDir>/<callId>.txt` and substitutes a fixed-format stub so the\n * model sees a 2 KiB preview plus the path it can `read_file`.\n *\n * The substitution happens at emit time (just after `tool:transform` runs)\n * and the stub flows into `session.turns` directly — so every subsequent\n * turn re-emits the same bytes, keeping the prompt-cache prefix stable.\n *\n * Set `0` / `undefined` to disable. Built-in chat profiles default to\n * `8192`. Tools listed in {@link AgentBehavior.persistExcludeTools} bypass\n * regardless of size — typically because their output is intentionally\n * short or persisting would be circular (e.g. `read_file`).\n *\n * Requires {@link AgentBehavior.persistDir} to be set; without a target\n * directory the framework silently skips persistence (no throw, no\n * substitution) since there's nowhere to write the blob.\n *\n * Default: `undefined` (off).\n */\n persistThreshold?: number\n /**\n * Canonical tool names to exclude from disk persistence regardless of\n * output size. The framework bypasses persistence for any tool whose\n * canonical name appears in this list — useful for tools whose results\n * are intentionally part of the prompt (`skills_use`), short envelopes\n * (`tool_search`, `present_plan`, `ask_user`), or where persistence\n * would be circular (`read_file`, whose pagination already serves the\n * same use case).\n *\n * Default: `undefined` (no exclusions). The chat-layer built-in profiles\n * set their own list — see `src/chat/agents.ts`.\n */\n persistExcludeTools?: readonly string[]\n /**\n * Directory under which persisted tool-result blobs land. Each call's\n * payload is written to `<persistDir>/<callId>.txt` (one file per\n * `tool_use` id, atomic via write-then-rename).\n *\n * The chat layer resolves this to `<userDir>/tool-results/<sessionId>/`\n * at session activation; SDK consumers pass an absolute path. Required\n * when {@link AgentBehavior.persistThreshold} is non-zero — when unset\n * the framework treats persistence as disabled.\n *\n * Default: `undefined`.\n */\n persistDir?: string\n /**\n * Soft byte-cap on the cumulative size of persisted blobs under\n * {@link persistDir} for THIS session. After every successful blob\n * write the framework sums the directory's `*.txt` payloads and, if\n * the total exceeds this value, removes oldest-first by mtime until\n * the remainder is at or below the cap.\n *\n * The just-written blob is never evicted in the same sweep (its mtime\n * is the newest), so a single oversize result still lands and gets\n * pointed at by its `<persisted-output>` stub — the LRU is a steady-\n * state housekeeping mechanism, not a per-call admission gate.\n *\n * Long unattended runs can otherwise grow `<userDir>/tool-results/<sessionId>/`\n * without bound; session-delete cleanup runs on demand, not on\n * schedule.\n *\n * Default: `undefined` (no cap). Set `0` to disable explicitly; the\n * eviction step is a no-op for non-positive / non-finite values.\n */\n persistMaxBytes?: number\n /**\n * Absolute directory where the `shell` tool's background mode (the\n * `run_in_background: true` flag) appends output log files. One file\n * per task: `<tasksDir>/<task-id>.log` (e.g. `bash_1.log`). The model\n * gets the absolute path back in the tool result and reads incremental\n * output via the regular `read_file` tool.\n *\n * The chat layer resolves this to `<userDir>/<sessionId>/tasks/` at\n * session activation; SDK consumers pass an absolute path. When unset,\n * `shell({ run_in_background: true })` surfaces a clean error to the\n * model so the framework doesn't silently fall back to a path the user\n * didn't pick.\n *\n * Default: `undefined`.\n */\n tasksDir?: string\n /**\n * Hide the built-in `shell` tool's `run_in_background` field + the\n * background-mode paragraphs in its description, even when\n * {@link AgentBehavior.tasksDir} is set. The model never sees the flag\n * and won't try to use it.\n *\n * Combined with the implicit gate on `tasksDir` (background mode also\n * auto-hides when `tasksDir` is unset, since the host hasn't wired the\n * log dir), this gives two ways to opt out:\n *\n * - **Implicit**: don't set `tasksDir`. The host hasn't opted in.\n * - **Explicit**: set `disableBackgroundTasks: true`. The host has\n * `tasksDir` for some other reason (legacy, fixture) but doesn't\n * want the model spawning background work.\n *\n * Only applies to the framework-provided `shell` tool (identity check\n * against the exported `shell` constant). Hosts who wrap or replace\n * the shell tool own their spec — the auto-disable doesn't touch\n * tool defs the agent doesn't recognize.\n *\n * Default: `false`.\n */\n disableBackgroundTasks?: boolean\n /**\n * Fail-fast instead of repair when the pre-send pairing pass detects\n * corruption (orphan `tool_use` / `tool_result`, duplicate ids,\n * compaction-stranded blocks). Throws {@link AgentToolPairingError} from\n * the next `agent.run()` turn carrying the structured repair list the\n * loop would have performed.\n *\n * Use case: training-data collectors that must reject any transcript\n * containing the synthetic `SYNTHETIC_TOOL_RESULT_PLACEHOLDER` rather\n * than ship poisoned data to the fine-tuning pipeline. User-facing chat\n * sessions should leave this off (the repair-on-the-fly behavior is the\n * point of the pass).\n *\n * Telemetry note: `pairing:repair` still fires for every repair before\n * the throw, so observability handlers see exactly what would have\n * happened.\n *\n * Default: `false`.\n */\n strictToolPairing?: boolean\n /**\n * Egress allowlist for the web tools (`fetch_url`, `web_search`). When set\n * to a non-empty list, those tools refuse any request whose target host\n * isn't covered — on `fetch_url` this is checked for the initial URL AND\n * every redirect hop (alongside the SSRF blocklist); on `web_search` it\n * gates the keyless DuckDuckGo / Tavily / Brave backends so a sandboxed or\n * compliance-bound host can pin egress to approved domains.\n *\n * Matching is host-suffix based and case-insensitive: an entry `example.com`\n * matches `example.com` and any subdomain (`docs.example.com`), but not\n * `notexample.com`. Ports are ignored (match on hostname only). Leading\n * dots are tolerated (`.example.com` ≡ `example.com`).\n *\n * Default: `undefined` (no allowlist — every public host is reachable,\n * subject to the SSRF blocklist). An empty array is treated the same as\n * `undefined` so a host can't accidentally lock itself out with `[]`.\n */\n fetchUrlAllowHosts?: readonly string[]\n /**\n * Enable an in-process response cache for the `fetch_url` tool, with this\n * TTL in milliseconds. Keyed on the requested URL string. When a fan-out\n * re-fetches the same page within the window (e.g. spidering a docs site\n * across parallel tool calls), the cached body is returned without a second\n * network round-trip.\n *\n * The cache is bounded by entry count and total bytes (fixed internal caps)\n * and is **process-local** — it never persists across restarts and is not\n * shared between agents. Only successful `2xx` text responses are cached;\n * redirects, errors, and aborts are not.\n *\n * Default: `undefined` / `0` → caching disabled (every call is a fresh\n * fetch — the stateless default). Set e.g. `900_000` (15 min) to enable.\n */\n fetchUrlCacheTtlMs?: number\n}\n\n// ---------------------------------------------------------------------------\n// Prompt parts (multimodal input)\n// ---------------------------------------------------------------------------\n\n/**\n * One block of a multimodal user prompt.\n *\n * `agent.run({ prompt })` accepts either a plain string (treated as a single\n * text part) or an array of these parts for multimodal inputs.\n *\n * `document` parts are routed per provider: PDF-style mime types are sent as\n * native document blocks when the provider supports them; text documents are\n * inlined as text with an attachment header. Providers that cannot handle an\n * image or document throw early.\n */\nexport type PromptPart\n = | PromptTextPart\n | PromptImagePart\n | PromptDocumentPart\n\nexport interface PromptTextPart {\n type: 'text'\n text: string\n}\n\nexport interface PromptImagePart {\n type: 'image'\n /** IANA media type (e.g. `image/png`, `image/jpeg`) */\n mediaType: string\n /** Base64-encoded payload */\n data: string\n /** Optional display name */\n name?: string\n}\n\nexport interface PromptDocumentPart {\n type: 'document'\n /** IANA media type (e.g. `application/pdf`, `text/plain`) */\n mediaType: string\n /** Either a base64-encoded payload (`encoding: 'base64'`) or raw text (`encoding: 'text'`) */\n data: string\n encoding: 'base64' | 'text'\n /** Optional display name used in attachment headers */\n name?: string\n}\n\n// ---------------------------------------------------------------------------\n// Canonical message format (used throughout the agent system)\n// ---------------------------------------------------------------------------\n\n/**\n * A single block of structured tool-result content.\n *\n * MCP servers can return a mix of text, image, resource, and audio blocks. Tools\n * return `string` for the common text-only case or `ToolResultContent[]` when they\n * need to preserve non-text content (e.g. screenshots from a browser MCP).\n *\n * Providers that support native multi-part tool results (Anthropic, OpenAI Codex via\n * pi-ai) route image blocks into their wire format verbatim; OpenAI-compat providers\n * route them via a companion-user-message fallback when the underlying model/endpoint\n * does not accept images inside tool-role messages.\n */\nexport type ToolResultContent\n = | ToolResultTextContent\n | ToolResultImageContent\n\nexport interface ToolResultTextContent {\n type: 'text'\n text: string\n}\n\nexport interface ToolResultImageContent {\n type: 'image'\n /** IANA media type (e.g. `image/png`, `image/jpeg`) */\n mediaType: string\n /** Base64-encoded payload */\n data: string\n}\n\n/**\n * Lossy flattener — converts `ToolResultContent[]` (or a plain string) to a single\n * string. Image blocks are replaced with `[image: <media> — <n> b64 bytes]` markers.\n *\n * Use at UI boundaries where a string is required; providers that understand\n * structured content should route the array through without flattening.\n */\nexport function toolResultToText(content: string | ToolResultContent[]): string {\n if (typeof content === 'string')\n return content\n return content\n .map((block) => {\n if (block.type === 'text')\n return block.text\n return `[image: ${block.mediaType} — ${block.data.length} b64 bytes]`\n })\n .join('\\n')\n}\n\n/**\n * Approximate **wire payload size** of a tool output, in bytes.\n *\n * - Plain text: UTF-8 byte length.\n * - Structured content: text blocks contribute their UTF-8 byte length; image\n * blocks contribute their **base64 character length** — a proxy for the\n * serialized request-body footprint, NOT for tokens. Vision encoders\n * tokenize decoded pixels (geometry-dependent; e.g. Anthropic ≈ `w·h/750`,\n * OpenAI ≈ 85 + 170/tile), which has no meaningful relationship to base64\n * length.\n *\n * Used by the agent loop to populate `outputBytes` on `tool:after`,\n * `tool:transform`, `mcp:tool:after`, and `mcp:tool:transform` hooks so\n * consumers can size-budget tool output without re-counting bytes themselves.\n * Suitable for byte-budget heuristics (`toolOutputBudget`, tail compaction);\n * NOT a substitute for provider-side context-window accounting — defer to\n * server-side context management (e.g. Anthropic's `context-management-*`\n * beta) when token accuracy matters.\n */\nexport function toolOutputByteLength(content: string | ToolResultContent[]): number {\n if (typeof content === 'string')\n return Buffer.byteLength(content)\n let total = 0\n for (const block of content) {\n if (block.type === 'text')\n total += Buffer.byteLength(block.text)\n else\n total += block.data.length\n }\n return total\n}\n\nexport type SessionContentBlock\n = | { type: 'text', text: string }\n | { type: 'image', mediaType: string, data: string, name?: string }\n | { type: 'tool_call', id: string, name: string, input: Record<string, unknown> }\n | {\n type: 'tool_result'\n callId: string\n /**\n * Tool output — either a plain string (text-only, the common case) or a structured\n * array of content blocks (text + image for multimodal tools such as screenshots).\n */\n output: string | ToolResultContent[]\n isError?: boolean\n }\n | {\n type: 'thinking'\n text: string\n signature?: string\n /**\n * Provider that minted `signature`. Signatures are provider-bound (Anthropic\n * HMAC vs. OpenAI `encrypted_content`) and are dropped on cross-provider\n * hops to avoid 400s. Unset means legacy/unknown — forwarded as-is.\n */\n signatureProducer?: 'anthropic' | 'openai'\n }\n | { type: 'redacted_thinking', data: string }\n | {\n /**\n * Opaque round-trip envelope for reasoning state minted by an OpenAI-compat\n * gateway (currently OpenRouter). The gateway expects its own\n * `reasoning_details` array echoed back verbatim on the next turn so the\n * upstream model can resume an extended-reasoning chain across tool calls.\n *\n * Stored opaquely because the items are provider-bound (Anthropic HMAC\n * signatures, OpenAI `encrypted_content`, model-specific summary formats\n * — all flowing through the gateway's normalized envelope).\n */\n type: 'provider_reasoning'\n producer: 'openrouter'\n details: unknown[]\n /**\n * Model id that produced the details. Reasoning is bound to a specific\n * upstream route — a model switch on the next turn invalidates the\n * embedded signatures, so the sender drops the block on mismatch.\n */\n model?: string\n }\n | {\n /**\n * Anthropic server-side tool invocation block (currently `web_search`).\n * Captured opaquely so the model's reasoning chain stays intact across\n * turns — Anthropic's docs require `encrypted_content` and\n * `encrypted_index` to be passed back on follow-up turns or citation\n * context is lost. Dropped on cross-provider sends.\n */\n type: 'server_tool_use'\n producer: 'anthropic'\n id: string\n name: string\n input: Record<string, unknown>\n }\n | {\n /**\n * Anthropic server-side tool result block. Pairs with `server_tool_use`\n * and carries the search hits Anthropic injected into the assistant\n * message. The full content array is preserved as `unknown[]` so\n * `encrypted_content` / `encrypted_index` survive a session round-trip\n * verbatim.\n */\n type: 'server_tool_result'\n producer: 'anthropic'\n toolUseId: string\n toolName: string\n content: unknown\n }\n | {\n /**\n * Compaction marker. Inserted by `compactConversation()` to replace a\n * prefix of turns with an LLM-generated summary.\n *\n * The marker lives in `session.turns` and renders in the transcript —\n * the user can still scroll back to see the original turns. From the\n * agent loop's wire-level perspective, every turn whose id appears in\n * `replacesTurnIds` is dropped, and this block's `summary` text is\n * sent to the model as a single user message in their place.\n *\n * The marker turn carries `role: 'user'` so it sits naturally at a\n * conversational boundary. Only the latest `compact-summary` block in\n * the session is honored — earlier markers are subsumed by later\n * ones (their `replacesTurnIds` are a strict prefix).\n */\n type: 'compact-summary'\n /** Turn ids the summary replaces, in chronological order. */\n replacesTurnIds: readonly string[]\n /** The summary text sent to the model in place of the elided turns. */\n summary: string\n /** Model id used to produce the summary. */\n model: string\n /** Token usage from the summary call. */\n usage: TurnUsage\n /** Unix-ms when compaction completed. */\n compactedAt: number\n }\n\nexport interface SessionMessage {\n role: 'user' | 'assistant'\n content: SessionContentBlock[]\n}\n\nexport interface SessionTurn {\n /** UUID — generated by the store if it provides generateTurnId, else crypto.randomUUID() */\n id: string\n /** Run that produced this turn (e.g. 'run_1') */\n runId?: string\n role: 'user' | 'assistant' | 'system'\n content: SessionContentBlock[]\n /** Token usage — only present on assistant turns */\n usage?: TurnUsage\n /** Unix timestamp (Date.now()) when the turn was created */\n createdAt: number\n}\n\n// ---------------------------------------------------------------------------\n// Agent run options\n// ---------------------------------------------------------------------------\n\n/**\n * Per-run hook registrations. Each entry can be a single handler or an array of handlers.\n * Keys are `AgentHooks` event names (loose-typed here to avoid a circular import; agent.ts\n * narrows it to the strongly-typed map).\n */\nexport type RunHookMap = Record<string, ((ctx: any) => unknown) | ((ctx: any) => unknown)[]>\n\nexport interface AgentRunOptions {\n model?: string\n /**\n * User prompt. Optional when resuming a session with existing turns.\n *\n * Accepts either a plain string (single text part) or an array of `PromptPart`s for\n * multimodal inputs (text, images, documents). See {@link PromptPart}.\n */\n prompt?: string | PromptPart[]\n system?: string\n /**\n * Optional metadata describing which named sections the host baked into\n * `system` (e.g. the rendered AGENTS.md/CLAUDE.md \"Rules\" block). Purely\n * informational — used by `agent.getContextBreakdown()` to attribute system-\n * prompt tokens to a \"Rules\" bucket the agent can't otherwise isolate from\n * the opaque base string. Does not affect what's sent to the model.\n */\n contextSections?: {\n /** Rendered user-instructions / rules block text (a substring of `system`). */\n rulesBlock?: string\n /** Source files behind the rules block, for per-file breakdown rows. */\n rulesFiles?: { path: string, source: string }[]\n }\n thinking?: ThinkingLevel\n /**\n * Enabled model-specific options for this run, keyed by option id (e.g.\n * `{ fast: true }` for Anthropic's fast mode). Options the active model\n * doesn't declare are silently ignored by the provider. Overrides\n * {@link AgentBehavior.modelOptions} when both are set.\n */\n modelOptions?: Record<string, boolean>\n /** Abort signal — when triggered, the agent stops after the current turn */\n signal?: AbortSignal\n /** Behavior overrides for this run (overrides agent defaults) */\n behavior?: AgentBehavior\n /** Tool overrides for this run. Pass {} for no tools. Omit to use agent tools. */\n tools?: Record<string, ToolDef>\n /**\n * Per-run hook registrations. Each hook is attached before the run starts and\n * detached in a finally block so handlers never leak across runs.\n *\n * Accepts either a single handler or an array (all handlers register).\n */\n hooks?: RunHookMap\n /**\n * Parent run id. Populated automatically by the `spawn` tool when the child\n * shares the parent's session; recorded on the resulting `SessionRun` so the\n * parent↔child run tree can be reconstructed from a persisted session.\n */\n parentRunId?: string\n /**\n * Zero-based subagent depth. 0 = top-level `agent.run()`, 1 = first-level\n * child spawned by a parent agent, and so on. Used by the spawn tool to\n * enforce `maxDepth` and to stamp `child:*` forwarded hook payloads.\n */\n depth?: number\n /**\n * Opaque trace-context carrier propagated from the parent agent's\n * tracer (typically a W3C `{ traceparent, tracestate }` map). The\n * child's `agent.run()` re-emits it on the `agent:start` hook so the\n * child's tracer can stitch its root span as a continuation of the\n * parent's spawn span. Empty / absent on top-level runs.\n *\n * Set automatically by the `spawn` tool when a parent's tracer wrote\n * into `SpawnHookContext.tracingContext` on `spawn:before`. SDK\n * consumers that drive subagents manually can populate this directly.\n */\n tracingContext?: Readonly<Record<string, string>>\n /**\n * Override the time + UUID source for this run only. Per-run wins over\n * agent-level ({@link AgentOptions.clock}); both fall back to\n * {@link DEFAULT_AGENT_CLOCK}. See {@link AgentClock}.\n */\n clock?: AgentClock\n}\n\n// ---------------------------------------------------------------------------\n// Agent stats\n// ---------------------------------------------------------------------------\n\n/**\n * Reason the provider gave for stopping the turn.\n *\n * - `'stop'` — natural turn end (`end_turn` / `stop_sequence`).\n * - `'tool-calls'` — model emitted tool_use blocks.\n * - `'length'` — `max_tokens` reached, or (Anthropic 4.6+) the response bumped\n * against the model's context window mid-stream\n * (`model_context_window_exceeded`). The partial response is preserved; the\n * loop emits this reason so consumers can prune/retry.\n * - `'content-filter'` — model refused.\n * - `'pause'` — Anthropic `pause_turn`: a server-side mid-turn pause for very\n * long thinking. The loop continues with a synthetic \"Please continue.\"\n * user message rather than terminating; consumers see the pause via this\n * finish reason on the prior assistant turn.\n * - `'error'` — provider classified the turn as failed.\n * - `'other'` — unknown / unmapped.\n */\nexport type TurnFinishReason = 'stop' | 'tool-calls' | 'length' | 'content-filter' | 'pause' | 'error' | 'other'\n\nexport interface TurnUsage {\n input: number\n output: number\n /** Tokens written to cache (Anthropic) */\n cacheCreation?: number\n /** Tokens read from cache (Anthropic) */\n cacheRead?: number\n /** Thinking/reasoning tokens used */\n thinking?: number\n /**\n * Cost in USD for this turn. Provider-reported when available\n * (OpenRouter, OpenAI via pi-ai); otherwise estimated from `modelId` ×\n * pi-ai's bundled price registry by `fillEstimatedCost` in\n * `src/providers/cost.ts`. Absent only when neither path could resolve\n * a price (unknown / unbundled model).\n */\n cost?: number\n /**\n * Why the model stopped this turn. Providers normalize native stop reasons to this union.\n * Absent when the provider did not surface a reason (e.g. mock turns).\n */\n finishReason?: TurnFinishReason\n /**\n * The model ID the provider ultimately used. May differ from the requested model when the\n * provider remaps aliases. Absent for providers that do not echo a model ID.\n */\n modelId?: string\n /**\n * Milliseconds from the moment the loop dispatched `provider.stream()`\n * (the `stream:start` hook firing) to the first observable byte of this\n * turn — earliest of `stream:text`, `stream:thinking`, or a tool_use\n * block. Captures the per-turn TTFT independently of run-relative TTFT\n * ({@link AgentStats.timeTillFirstTokenMs}, which only marks the first\n * turn).\n *\n * Useful for metrics histograms (`gen_ai.client.time_to_first_token`)\n * across long multi-turn runs where the run-level metric collapses to\n * the cold turn only. Absent for empty-stream turns and turns that\n * errored before any byte landed.\n */\n timeToFirstTokenMs?: number\n}\n\nexport interface AgentStats {\n /**\n * Cumulative input tokens across the parent agent loop **and** every\n * recursively-spawned sub-agent. Use this for billing / token-ledger\n * consumption.\n */\n totalIn: number\n /** Cumulative output tokens. Same semantics as {@link AgentStats.totalIn}. */\n totalOut: number\n /**\n * Cumulative cache-read tokens across the parent agent loop and every\n * recursively-spawned sub-agent. Surfaced at the top level (rather than\n * only per-`TurnUsage`) because Anthropic prices cache reads at a separate\n * line-item rate from regular input — billing-correct cost computation\n * needs this number directly. Always `0` for providers that don't report\n * cache usage.\n */\n totalCacheRead: number\n /**\n * Cumulative cache-creation tokens across the parent agent loop and every\n * recursively-spawned sub-agent. Same rationale as\n * {@link AgentStats.totalCacheRead} — separate Anthropic billing rate.\n * Always `0` for providers that don't report cache usage.\n */\n totalCacheCreation: number\n /**\n * Number of parent agent-loop turns. Children's turn counts live under\n * `children[].stats.turns` and are NOT folded in here — a single \"turns\"\n * number for the whole tree would conflate two different measures\n * (parent-loop iterations vs. tree-wide tool-call rounds).\n *\n * Tree-wide turn count: `flattenTurns(stats).length`.\n */\n turns: number\n /**\n * Wall-clock duration of the top-level `agent.run()` call, in milliseconds.\n * Children run during parent tool calls so this naturally subsumes child\n * wall time — sequential children inflate it, parallel children compress\n * into the parent's window.\n */\n elapsed: number\n /**\n * Per-turn usage breakdown for the **parent loop only**. Children's per-turn\n * usages live under `children[].stats.turnUsage`. Use {@link flattenTurns}\n * to walk the full tree.\n */\n turnUsage?: TurnUsage[]\n /**\n * Cumulative cost in USD — parent loop plus every recursively-spawned\n * sub-agent. Sums per-turn `TurnUsage.cost` reported by the provider.\n * Absent when neither parent nor any descendant reported a non-zero cost.\n */\n cost?: number\n /** Stats from child agents spawned during this run, in completion order. Recursive. */\n children?: ChildRunStats[]\n /** Structured output from schema enforcement (only present when behavior.schema is set) */\n output?: Record<string, unknown>\n /**\n * Milliseconds from the start of `agent.run()` to the first observable signal from the\n * provider (first `stream:text`, `stream:thinking`, or `tool:before` event).\n *\n * Absent when the run produced no observable signals (e.g. aborted before any stream event).\n */\n timeTillFirstTokenMs?: number\n}\n\nexport interface ChildRunStats {\n id: string\n task: string\n /**\n * The child agent's full {@link AgentStats}. Cumulative for that child's\n * own subtree (child loop + its grandchildren). Do **not** sum\n * `ctx.stats.totalIn` across `spawn:complete` events to derive top-level\n * totals — `agent.run()`'s return value is the canonical cumulative root.\n */\n stats: AgentStats\n /**\n * Subagent depth when this child ran. 1 = direct child of the top-level\n * agent, 2 = grandchild, etc. Useful for telemetry that wants to group\n * runs by depth.\n */\n depth?: number\n /**\n * Terminal state of the child run. `'completed'` is the default. Exposed so\n * a parent reading `stats.children` can distinguish aborted/timed-out\n * children without re-parsing the returned string.\n */\n status?: 'completed' | 'aborted' | 'timeout' | 'error'\n /**\n * Final structured output when the child was run with `behavior.schema`.\n * Mirrors `AgentStats.output` but is surfaced here so the parent can read\n * it without peeking at the nested `stats` bag.\n */\n output?: Record<string, unknown>\n}\n\n// ---------------------------------------------------------------------------\n// Hook context types\n// ---------------------------------------------------------------------------\n\n/**\n * Base context for tool execution hooks.\n *\n * `name` is the canonical tool identity — the spec name registered on the agent (or the\n * `mcp_{server}_{tool}` name for MCP tools). Hooks should policy-match against `name`.\n *\n * `displayName` is the outward-facing name — the alias surfaced to the LLM when\n * `AgentOptions.toolAliases` maps the canonical name; otherwise equal to `name`.\n * UI/telemetry adapters should emit `displayName`.\n *\n * Canonical vs. alias matters on session resume: `session.turns` persists canonical\n * names only, so renaming an alias cannot desync history.\n */\nexport interface ToolHookContext {\n turnId: string\n callId: string\n /** Canonical tool name (spec name). Stable across alias-map changes. */\n name: string\n /** Aliased (wire) name — equal to `name` when no alias is defined. */\n displayName: string\n input: Record<string, unknown>\n /**\n * The run this tool call belongs to (the `SessionRun.id`). Lets a single\n * `tool:*` listener disambiguate calls across parallel runs / subagent\n * trees without subscribing to the `child:tool:*` bubble events.\n */\n runId?: string\n /**\n * Parent run id when this tool call's agent is a subagent — i.e. the\n * `SessionRun.parentRunId` of the run that owns the call. Absent on\n * top-level runs. Useful for observability stitching: a UI grouping\n * subagent-scoped state (e.g. todowrite, edit batches) by parent\n * run can read this directly off `tool:before` / `tool:after`\n * without resolving the run row.\n */\n parentRunId?: string\n /**\n * Subagent depth for this tool call. 0 = top-level, 1 = first-level\n * child, etc. Mirrors `ToolContext.depth` so hook consumers don't\n * have to cross-reference the tool context. Omitted on top-level\n * runs (treated as 0).\n */\n depth?: number\n}\n\n/**\n * Base context for MCP tool hooks.\n *\n * `tool` is the native tool name on the MCP server. `server` is the configured server\n * name. The canonical zidane-namespaced identity is `mcp_{server}_{tool}`.\n *\n * `displayName` equals the canonical namespaced name unless the agent has aliased\n * this MCP tool via `AgentOptions.toolAliases`; in which case `displayName` is the\n * alias that the LLM sees.\n */\nexport interface McpToolHookContext {\n turnId: string\n callId: string\n server: string\n tool: string\n /** Aliased wire name for this MCP tool, or the canonical `mcp_{server}_{tool}` name. */\n displayName: string\n input: Record<string, unknown>\n /** Owning run id — same semantics as `ToolHookContext.runId`. */\n runId?: string\n /** Parent run id when this tool call's agent is a subagent — see `ToolHookContext.parentRunId`. */\n parentRunId?: string\n /** Subagent depth — see `ToolHookContext.depth`. */\n depth?: number\n}\n\n/** Base context for session hooks */\nexport interface SessionHookContext {\n sessionId: string\n}\n\n/** Base context for spawn hooks */\nexport interface SpawnHookContext {\n id: string\n task: string\n /**\n * Subagent depth for the spawn. 1 = direct child of the top-level agent.\n * Present on spawn:before/complete/error. Absent for grandchild spawns that\n * bubble through `child:*` events (which carry their own `depth`).\n */\n depth?: number\n /**\n * Mutable trace-context carrier for parent → child span linkage. Empty\n * object by default; a parent tracer mutates it on `spawn:before` (e.g.\n * `ctx.tracingContext.traceparent = '00-…-…-01'`) and the `spawn` tool\n * forwards the populated object to the child via\n * `AgentRunOptions.tracingContext`. The child's tracer re-emits it on\n * `agent:start` so it can be used as parent context when opening the\n * child's root span.\n *\n * Opaque to the harness — keys / values are tracer-defined. Standard\n * choice is W3C Trace Context (`traceparent` + optional `tracestate`),\n * but Datadog / Sentry / B3 carriers work too.\n */\n tracingContext?: Record<string, string>\n}\n\n/** Context for stream hooks */\nexport interface StreamHookContext {\n turnId: string\n}\n\n/** Context for OAuth refresh hooks */\nexport interface OAuthRefreshHookContext {\n provider: string\n providerId: string\n source: 'params' | 'file'\n previousCredentials: Record<string, unknown> & { access: string, refresh: string, expires: number }\n credentials: Record<string, unknown> & { access: string, refresh: string, expires: number }\n}\n\nexport type SessionEndStatus = 'completed' | 'aborted' | 'error'\n"],"mappings":";;;AAiEA,MAAa,sBAAkC;CAC7C,WAAW,KAAK,IAAI;CACpB,kBAAkB,OAAO,WAAW;AACtC;;;;;;;;AAwgCA,SAAgB,iBAAiB,SAA+C;CAC9E,IAAI,OAAO,YAAY,UACrB,OAAO;CACT,OAAO,QACJ,KAAK,UAAU;EACd,IAAI,MAAM,SAAS,QACjB,OAAO,MAAM;EACf,OAAO,WAAW,MAAM,UAAU,KAAK,MAAM,KAAK,OAAO;CAC3D,CAAC,EACA,KAAK,IAAI;AACd;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,qBAAqB,SAA+C;CAClF,IAAI,OAAO,YAAY,UACrB,OAAO,OAAO,WAAW,OAAO;CAClC,IAAI,QAAQ;CACZ,KAAK,MAAM,SAAS,SAClB,IAAI,MAAM,SAAS,QACjB,SAAS,OAAO,WAAW,MAAM,IAAI;MAErC,SAAS,MAAM,KAAK;CAExB,OAAO;AACT"}
@@ -250,4 +250,4 @@ interface TaskEntry {
250
250
  }
251
251
  //#endregion
252
252
  export { ExecutionContext as a, TaskEntry as c, ExecResult as i, TaskExitInfo as l, ContextCapabilities as n, ExecutionHandle as o, ContextType as r, SpawnConfig as s, BackgroundTaskStatus as t, TaskHandle as u };
253
- //# sourceMappingURL=types-KukEp-mi.d.ts.map
253
+ //# sourceMappingURL=types-CEAMIUXw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-CEAMIUXw.d.ts","names":[],"sources":["../src/contexts/types.ts"],"mappings":";;AAaA;;;;;;;UAAiB,mBAAA;EAQZ;EANH,KAAA;EAce;EAZf,UAAA;;EAEA,OAAA;EAWA;EATA,GAAA;AAAA;;UAQe,eAAA;EACf,EAAA;EACA,IAAA,EAAM,WAAW;EASQ;EAPzB,GAAA;AAAA;AAAA,UAOe,UAAA;EACf,MAAA;EACA,MAAA;EACA,QAAA;AAAA;AAAA,UAOe,WAAA;EAAW;EAE1B,GAAA;EAEY;EAAZ,GAAA,GAAM,MAAM;EAAZ;EAEA,KAAA;EAAA;EAEA,MAAA;IAEE,yBAAA,MAAA,WAIA;IAFA,GAAA,WAMA;IAJA,OAAA;EAAA;EAMY;EAHd,OAAA;IACE,QAAA;IACA,MAAA;IAAA,CACC,GAAA;EAAA;AAAA;AAAA,KAQO,WAAA;AAAA,UAEK,gBAAA;;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AAA,KAAoB,OAAA;AAAA;;;;AAiBR;AAUhC;;;;;;KAVY,oBAAA;;AAqBA;AAaZ;;;;;;UAxBiB,UAAA;EA4BQ;;;;;;EArBvB,MAAA;EAqBS;EAnBT,GAAA;EAoBA;EAlBA,UAAA;AAAA;;AAsBO;AAQT;;;;;;;;UAjBiB,YAAA;EACf,MAAA;EACA,MAAA,EAAQ,OAAA,CAAQ,oBAAA;EAChB,QAAA;EACA,MAAA,GAAS,MAAA,CAAO,OAAA;EAChB,UAAA;EAqBS;EAnBT,UAAA;EAqBA;EAnBA,OAAA;AAAA;;;;;;UAQe,SAAA;EACf,MAAA;EACA,GAAA;EACA,OAAA;EACA,GAAA;EACA,SAAA;EACA,UAAA;EACA,MAAA,EAAQ,oBAAA;EACR,QAAA;EACA,MAAA,GAAS,MAAA,CAAO,OAAO;;EAEvB,YAAA;AAAA"}
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as ExecutionContext, i as ExecResult, n as ContextCapabilities, o as ExecutionHandle, r as ContextType, s as SpawnConfig } from "./types-KukEp-mi.js";
2
- import { t as SandboxProvider } from "./index-CbS75MD3.js";
3
- import { $t as PromptTextPart, At as OpenAIParams, Bt as AgentStats, D as SkillConfig, En as ClassifiedErrorKind, F as SessionRun, I as SessionStore, Kt as McpServerConfig, Lt as AgentBehavior, M as CreateSessionOptions, Mt as CerebrasParams, N as Session, On as matchesContextExceeded, P as SessionData, Pt as AnthropicParams, Qt as PromptPart, Rt as AgentClock, S as ReadStateMap, Sn as AgentToolNotAllowedError, St as OpenRouterParams, Tn as ClassifiedError, Ut as DEFAULT_AGENT_CLOCK, Vt as ChildRunStats, Xt as PromptDocumentPart, Yt as OAuthRefreshHookContext, Zt as PromptImagePart, _n as toolResultToText, an as SessionMessage, b as ToolMap, bn as AgentContextExceededError, cn as StreamHookContext, dn as ToolResultContent, dt as StreamCallbacks, en as RetryConfig, fn as ToolResultImageContent, ft as StreamOptions, gn as toolOutputByteLength, gt as TurnResult, hn as TurnUsage, ht as ToolSpec, i as AgentOptions, in as SessionHookContext, j as SkillsConfig, k as SkillResource, ln as ThinkingLevel, lt as Provider, mn as TurnFinishReason, mt as ToolResult, nn as SessionContentBlock, on as SessionTurn, p as McpConnection, pn as ToolResultTextContent, pt as ToolCall, qt as McpToolHookContext, r as AgentHooks, rn as SessionEndStatus, sn as SpawnHookContext, t as Agent, tn as RunHookMap, un as ToolHookContext, ut as ProviderCapabilities, v as ToolContext, vn as AgentAbortedError, wn as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, x as ReadStateEntry, xn as AgentProviderError, y as ToolDef, yn as AgentBudgetExceededError, z as RemoteStoreOptions, zt as AgentRunOptions } from "./agent-ClkpElCZ.js";
4
- import { $ as ModelUsage, S as SpawnToolState, b as ChildAgent, et as flattenTurns, h as ValidationResult, t as Preset, tt as statsByModel, x as SpawnToolOptions, z as InteractionToolOptions } from "./index-CTDMMdIy.js";
1
+ import { An as ClassifiedError, Cn as AgentAbortedError, Ct as OpenRouterParams, D as SkillConfig, Dn as AgentToolNotAllowedError, En as AgentProviderError, F as SessionRun, Gt as AgentStats, Ht as AgentBehavior, I as SessionStore, Jt as DEFAULT_AGENT_CLOCK, Kt as ChildRunStats, Lt as CerebrasParams, M as CreateSessionOptions, N as Session, Nn as matchesContextExceeded, P as SessionData, Qt as McpToolHookContext, S as ReadStateMap, Sn as toolResultToText, Tn as AgentContextExceededError, Ut as AgentClock, Wt as AgentRunOptions, Zt as McpServerConfig, _n as ToolResultImageContent, _t as TurnResult, an as RetryConfig, b as ToolMap, bn as TurnUsage, cn as SessionEndStatus, dn as SessionTurn, dt as StreamCallbacks, en as OAuthRefreshHookContext, fn as SpawnHookContext, ft as StreamOptions, gn as ToolResultContent, gt as ToolSpec, hn as ToolHookContext, ht as ToolResult, i as AgentOptions, in as PromptTextPart, j as SkillsConfig, jn as ClassifiedErrorKind, jt as OpenAIParams, k as SkillResource, kn as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, ln as SessionHookContext, lt as Provider, mn as ThinkingLevel, mt as ToolCall, nn as PromptImagePart, on as RunHookMap, p as McpConnection, pn as StreamHookContext, r as AgentHooks, rn as PromptPart, sn as SessionContentBlock, t as Agent, tn as PromptDocumentPart, un as SessionMessage, ut as ProviderCapabilities, v as ToolContext, vn as ToolResultTextContent, wn as AgentBudgetExceededError, x as ReadStateEntry, xn as toolOutputByteLength, y as ToolDef, yn as TurnFinishReason, z as RemoteStoreOptions, zt as AnthropicParams } from "./agent-BNS2nx_T.js";
2
+ import { a as ExecutionContext, i as ExecResult, n as ContextCapabilities, o as ExecutionHandle, r as ContextType, s as SpawnConfig } from "./types-CEAMIUXw.js";
3
+ import { t as SandboxProvider } from "./index-CZOwAJIX.js";
4
+ import { $ as ModelUsage, S as SpawnToolState, b as ChildAgent, et as flattenTurns, h as ValidationResult, t as Preset, tt as statsByModel, x as SpawnToolOptions, z as InteractionToolOptions } from "./index-Ck_AWt8P.js";
5
5
  export { type Agent, AgentAbortedError, type AgentBehavior, AgentBudgetExceededError, type AgentClock, AgentContextExceededError, type AgentHooks, type AgentOptions, AgentProviderError, type AgentRunOptions, type AgentStats, AgentToolNotAllowedError, type AnthropicParams, CONTEXT_EXCEEDED_MESSAGE_PATTERNS, type CerebrasParams, type ChildAgent, type ChildRunStats, type ClassifiedError, type ClassifiedErrorKind, type ContextCapabilities, type ContextType, type CreateSessionOptions, DEFAULT_AGENT_CLOCK, type ExecResult, type ExecutionContext, type ExecutionHandle, type InteractionToolOptions, type McpConnection, type McpServerConfig, type McpToolHookContext, type ModelUsage, type OAuthRefreshHookContext, type OpenAIParams, type OpenRouterParams, type Preset, type PromptDocumentPart, type PromptImagePart, type PromptPart, type PromptTextPart, type Provider, type ProviderCapabilities, type ReadStateEntry, type ReadStateMap, type RemoteStoreOptions, type RetryConfig, type RunHookMap, type SandboxProvider, type Session, type SessionContentBlock, type SessionData, type SessionEndStatus, type SessionHookContext, type SessionMessage, type SessionRun, type SessionStore, type SessionTurn, type SkillConfig, type SkillResource, type SkillsConfig, type SpawnConfig, type SpawnHookContext, type SpawnToolOptions, type SpawnToolState, type StreamCallbacks, type StreamHookContext, type StreamOptions, type ThinkingLevel, type ToolCall, type ToolContext, type ToolDef, type ToolHookContext, type ToolMap, type ToolResult, type ToolResultContent, type ToolResultImageContent, type ToolResultTextContent, type ToolSpec, type TurnFinishReason, type TurnResult, type TurnUsage, type ValidationResult, flattenTurns, matchesContextExceeded, statsByModel, toolOutputByteLength, toolResultToText };
package/dist/types.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as AgentToolNotAllowedError, i as AgentProviderError, l as matchesContextExceeded, n as AgentBudgetExceededError, r as AgentContextExceededError, s as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, t as AgentAbortedError } from "./errors-DdZXnyXE.js";
2
- import { n as toolOutputByteLength, r as toolResultToText, t as DEFAULT_AGENT_CLOCK } from "./types-oKPBdCmL.js";
3
- import { r as statsByModel, t as flattenTurns } from "./stats-Lc3zL3RM.js";
1
+ import { a as AgentToolNotAllowedError, d as matchesContextExceeded, i as AgentProviderError, n as AgentBudgetExceededError, r as AgentContextExceededError, s as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, t as AgentAbortedError } from "./errors-CoQnKRf1.js";
2
+ import { n as toolOutputByteLength, r as toolResultToText, t as DEFAULT_AGENT_CLOCK } from "./types-BPw_i5vb.js";
3
+ import { i as statsByModel, n as flattenTurns } from "./stats-DAKBEKjc.js";
4
4
  export { AgentAbortedError, AgentBudgetExceededError, AgentContextExceededError, AgentProviderError, AgentToolNotAllowedError, CONTEXT_EXCEEDED_MESSAGE_PATTERNS, DEFAULT_AGENT_CLOCK, flattenTurns, matchesContextExceeded, statsByModel, toolOutputByteLength, toolResultToText };
package/docs/CHAT.md CHANGED
@@ -151,7 +151,7 @@ The table below indexes every named export; sections further down dive into the
151
151
  | `project-root` | `findGitRoot(cwd)` — walks upward looking for `.git`, returns absolute path or `null`. Used for session scope tagging + export anchors. |
152
152
  | `prompt-segments` | `splitPromptSegments(text, refs)` → `PromptSegment[]`. GUI maps the same segments to inline-block chip pills. |
153
153
  | `project-user-paths` | `projectUserPaths({ subPath, cwd, home, prefix })` — shared search-order builder for project + user config discovery. Powers `defaultSkillScanPaths` (`'skills'`) and `defaultMcpsConfigPaths` (calls it twice, once per `mcps.json` / `mcp.json`); the same convention extends to any new discovery surface. |
154
- | `providers` | `ProviderDescriptor` registry + helpers — `BUILTIN_PROVIDERS`, built-ins (`anthropicDescriptor`, `openaiDescriptor`, `openrouterDescriptor`, `cerebrasDescriptor`), `modelsForDescriptor`, `getModelInfo`, `getContextWindow`, `effectiveContextWindow`, `modelSupportsReasoning`, `OUTPUT_RESERVE_TOKENS`, `credKeyOf`, `piIdOf`. |
154
+ | `providers` | `ProviderDescriptor` registry + helpers — `BUILTIN_PROVIDERS` (`anthropicDescriptor`, `openaiDescriptor`, `openrouterDescriptor`, `cerebrasDescriptor`, `localDescriptor`), `modelsForDescriptor`, `getModelInfo`, `getContextWindow`, `effectiveContextWindow`, `modelSupportsReasoning`, `OUTPUT_RESERVE_TOKENS`, `credKeyOf`, `piIdOf`. `cursorDescriptor` is exported but NOT in `BUILTIN_PROVIDERS` (OAuth works, inference not wired). See **Local provider**. |
155
155
  | `safe-mode` | Per-project safelist + matchers — `IMPLICITLY_SAFE_TOOLS`, `suggestSafelistEntry`, `addToSafelist`, `getSafelist`, `isOnSafelist`, `matchesSafelistEntry`, `readProjects`, `writeProjects`, `projectsFilePath`. |
156
156
  | `safe-mode-context` | `SafeModeProvider` owns a FIFO approval queue. `useSafeModeQueue()` returns the live array; `useSafeModeActions()` returns stable `{ requestApproval, resolveHead, denyAll }`. |
157
157
  | `session-export` | `renderSession`, `resolveSessionExportTarget`, `writeSessionExport`, `SessionExportFormat`, `SessionExportAnchor`, `SessionExportTarget`. |
@@ -213,6 +213,41 @@ resolveConfig({
213
213
  | `ZIDANE_PROJECT_DB` | `'0' / 'false' / 'off' / 'no'` → off; `'1' / 'true' / 'on' / 'yes'` → on. Sits between `options.projectDb` and the user-config file. |
214
214
  | `ZIDANE_CREDENTIALS_PATH` | Set by `resolveConfig` itself; the harness providers read it. |
215
215
  | `ZIDANE_DEBUG` | Enables stderr logging for swallowed errors (teardown, save, MCP bootstrap). |
216
+ | `LOCAL_LLM_BASE_URL` | Local provider endpoint, e.g. `http://localhost:11434/v1` (Ollama). Required for `local`. Mirrored from the wizard's `baseURL` field. See **Local provider**. |
217
+ | `LOCAL_LLM_API_KEY` | Optional bearer key for the local endpoint (most local servers are unauthenticated; defaults to a placeholder). |
218
+ | `LOCAL_LLM_DEFAULT_MODEL` | Default model id the local server exposes (e.g. `llama3.1:8b`). Surfaced as the `local` provider's single picker entry. |
219
+ | `LOCAL_LLM_CONTEXT_WINDOW` | Override the assumed context window for the local model (positive integer). Defaults to `8192`; invalid values fall back to the default. |
220
+
221
+ ### Local provider
222
+
223
+ `localDescriptor` (key `local`, label *Local LLM*) points zidane at any
224
+ self-hosted OpenAI-compatible server — Ollama, vLLM, LM Studio, Lemonade, llama.cpp's server,
225
+ text-generation-webui, etc. It's a thin wrapper over the shared `openaiCompat` provider, so it
226
+ speaks the standard `POST /chat/completions` + SSE dialect.
227
+
228
+ It has **no `envKey` and no fixed model catalogue** — both the endpoint and the model come from
229
+ the user. Configuration goes through the wizard's `customFields` (persisted in the apikey
230
+ credential and mirrored into env vars by `applyApiKeyEnv` at launch):
231
+
232
+ | Field | Env var | Required | Notes |
233
+ |---|---|---|---|
234
+ | Base URL | `LOCAL_LLM_BASE_URL` | yes | e.g. Ollama `http://localhost:11434/v1`, vLLM `http://localhost:8000/v1`, LM Studio `http://localhost:1234/v1`. |
235
+ | API key | `LOCAL_LLM_API_KEY` | no | Only for servers started with auth (vLLM `--api-key`, gateways). Blank → placeholder. |
236
+ | Default model | `LOCAL_LLM_DEFAULT_MODEL` | no | The model id your server exposes. When set, it's surfaced as the provider's single model-picker entry. |
237
+
238
+ **Configure via the TUI:** open the auth screen → pick *Local LLM* → the wizard
239
+ walks the three fields → credentials are saved; the provider then appears in the model picker once a
240
+ default model is set. (From Settings → Authentication, the *add or re-configure* action jumps
241
+ straight into this wizard.)
242
+
243
+ **Configure via env (headless / hosts):** set `LOCAL_LLM_BASE_URL` (+ optionally the others) before
244
+ launch — `detectAuth` treats the provider as available once all required fields resolve.
245
+
246
+ **Context window** is unknown over the OpenAI-compat API, so it defaults to a conservative `8192`
247
+ (footer indicator + auto-compaction lean on this — under-estimating is the safe direction). Raise it
248
+ with `LOCAL_LLM_CONTEXT_WINDOW` for larger-context models. Vision / cache / reasoning are off by
249
+ default (most OSS local deployments strict-validate the request schema); pass a custom descriptor
250
+ calling `local({ capabilities })` to flip them.
216
251
 
217
252
  ### Project-DB precedence
218
253
 
@@ -307,8 +342,8 @@ interface AgentProfile {
307
342
 
308
343
  Built-ins (`BUILTIN_AGENTS`):
309
344
 
310
- - **`BUILD_AGENT`** (`build`) — full tool access: `shell`, `readFile`, `writeFile`, `listFiles`, `edit`, `multiEdit`, `glob`, `grep`, plus `spawn` (with `persist: true` so reloads can reconstruct the subagent tree) and `todowrite` / `todoread` layered in via `composePresets(..., createTodoTools())` (see **Todos**).
311
- - **`PLAN_AGENT`** (`plan`) — read-only: `readFile`, `listFiles`, `glob`, `grep`. System prompt is `PLAN_MODE_DOCTRINE`. No todos — a read-only exploration session has nothing to checkpoint.
345
+ - **`BUILD_AGENT`** (`build`) — full tool access: `shell`, `readFile`, `writeFile`, `listFiles`, `edit`, `multiEdit`, `glob`, `grep`, `webSearch`, `fetchUrl`, plus `spawn` (with `persist: true` so reloads can reconstruct the subagent tree) and `todowrite` / `todoread` layered in via `composePresets(..., createTodoTools())` (see **Todos**).
346
+ - **`PLAN_AGENT`** (`plan`) — read-only: `readFile`, `listFiles`, `glob`, `grep`, `webSearch`, `fetchUrl`. System prompt is `PLAN_MODE_DOCTRINE`. No todos — a read-only exploration session has nothing to checkpoint.
312
347
 
313
348
  Both share `SHARED_BEHAVIOR`:
314
349
 
@@ -657,7 +692,7 @@ A user-overridable action catalog. Defaults declared in `KEYBINDING_DEFS`; user
657
692
  ```ts
658
693
  type KeyAction
659
694
  = | 'openSettings' | 'openSessionDetails' | 'openModelPicker' | 'openEffortPicker'
660
- | 'openTodos' | 'cycleAgent' | 'enterSelectTurnMode'
695
+ | 'openTodos' | 'openContextPanel' | 'openKeybindings' | 'cycleAgent' | 'enterSelectTurnMode'
661
696
  | 'enterQueueSelection' | 'pushQueuedMessage' | 'dropQueuedMessage'
662
697
  | 'turnFork' | 'turnDelete' | 'turnCopy'
663
698
  | 'sessionDelete' | 'sessionCopyId' | 'sessionGenerateTitle'
@@ -702,6 +737,18 @@ Skip reasons: `'disabled'` / `'unknown-window'` / `'invalid-threshold'` / `'inva
702
737
 
703
738
  The next user prompt **must** await the in-flight promise before calling `agent.run()` — otherwise the new run races the `appendTurns(summaryTurn, …restored)` and picks up the pre-compaction history mid-write. The TUI also exposes a manual `k` shortcut on the session-details modal that calls the same primitives.
704
739
 
740
+ ## Context-usage breakdown
741
+
742
+ A categorized view of what's consuming the context window — system prompt, rules (AGENTS.md/CLAUDE.md), skills catalog, MCP instructions, subagent definitions, tool definitions, MCP tools, conversation, plus deferred (lazy) tools, the autocompact buffer, and free space. Surfaced as the TUI `ctrl+g` panel and the GUI context popover; both consume the same data.
743
+
744
+ - **`agent.getContextBreakdown(opts?)`** (on the core `Agent`, see `docs/ARCHITECTURE.md`) returns a `ContextBreakdown | null`. It snapshots the assembled prompt sections at run time (and a skills-only **pre-run** assembly before the first turn, so the panel works the moment the chat screen opens), then shapes them via `buildContextBreakdown`. The snapshot is cleared on `reset()` / `destroy()`, so it never leaks stale data across sessions.
745
+ - **`buildContextBreakdown(snapshot)`** (`zidane/chat` + `zidane/chat/pure`, node-free) is the pure shaper. Live categories always reconcile to the real last-turn total (`conversation = used − Σ(other live)`), so the bar can never contradict the footer's `ctx` gauge. Free space and the autocompact buffer are exact; per-section counts are heuristic (`estimateTokens`) unless the provider supplies exact counts.
746
+ - **Exact counts (optional).** When a provider implements `Provider.countTokens(payload)` (Anthropic `messages.countTokens`, OpenAI `responses.input_tokens`), `getContextBreakdown` differences a system-only and a system+tools probe to attribute the System prompt + Tool definitions buckets exactly; categories with no exact source render with a `~` prefix. `countTokens` returns `null` when unavailable (no endpoint / wrong auth) and the heuristic fills in — it can never break the breakdown.
747
+ - **Autocompact zone.** Pass `opts.compactThreshold` (the `Settings.autoCompactThreshold` fraction) and the "Autocompact buffer" bucket becomes the whole tail from the threshold to the end of the window, so the bar shows exactly where compaction will fire.
748
+ - **Rules attribution.** The agent can't isolate the rules block from the opaque host-composed system string, so the host passes `AgentRunOptions.contextSections = { rulesBlock, rulesFiles }` (the rendered AGENTS.md block + its source files) for a dedicated, per-file "Rules" row. The TUI and GUI both discover rules via `discoverAgentsMd` and thread this through.
749
+
750
+ `ContextBreakdown`, `ContextBreakdownOptions`, `ContextSnapshot`, `ContextCategory`, `ContextItem`, `ContextUsageSplit`, `ContextExactCounts`, `ContextMcpGroup`, and `buildContextBreakdown` are all exported from both `zidane/chat` and `zidane/chat/pure`.
751
+
705
752
  ## Edit-diff rendering
706
753
 
707
754
  Renderer-agnostic helpers for turning `edit` / `multi_edit` / `write_file` tool calls into a unified diff. Two tiers:
@@ -1138,8 +1185,8 @@ Trigger rules (enforced by `findActiveTrigger`):
1138
1185
 
1139
1186
  Built-in providers:
1140
1187
 
1141
- - **`createSkillsCompletionProvider`** — trigger `/`. Filters by the user's allowlist. Submission helper: `uniqueSkillNamesFromReferences`.
1142
- - **`createFilesCompletionProvider`** — trigger `@`. Suggests files from the cwd, gitignored paths excluded. Submission helper: `uniqueFilesFromReferences`. Optional `formatPath(entry)` hook rewrites the catalog's project-root-relative path into the form inserted into the prompt; pair with `formatPathForCwd` so the emitted reference resolves under the agent's CWD even when the TUI launches from a project subdirectory (default: identity).
1188
+ - **`createSkillsCompletionProvider`** — trigger `/`. Filters by the user's allowlist. Matching is case-insensitive; name prefix outranks name substring outranks description substring, with an fzf-scored name fuzzy fallback so `reseach` still finds `research`. Submission helper: `uniqueSkillNamesFromReferences`.
1189
+ - **`createFilesCompletionProvider`** — trigger `@`. Suggests files from the cwd, gitignored paths excluded. Matching is case-insensitive across name + path, with an fzf-scored basename fuzzy fallback so `lop.ts` still finds `loop.ts`; exact / prefix / substring hits always outrank fuzzy ones. Submission helper: `uniqueFilesFromReferences`. Optional `formatPath(entry)` hook rewrites the catalog's project-root-relative path into the form inserted into the prompt; pair with `formatPathForCwd` so the emitted reference resolves under the agent's CWD even when the TUI launches from a project subdirectory (default: identity).
1143
1190
 
1144
1191
  ```ts
1145
1192
  import { createFilesCompletionProvider, formatPathForCwd } from 'zidane/chat'
package/docs/SKILL.md CHANGED
@@ -318,6 +318,8 @@ Hooks fire at every lifecycle point via [hookable](https://github.com/unjs/hooka
318
318
  | `stream:thinking` | Each reasoning chunk | — | `delta, thinking, turnId` |
319
319
  | `stream:text` | Each text chunk | — | `delta, text, turnId` |
320
320
  | `stream:end` | Text stream complete (only if text present) | — | `text, turnId` |
321
+ | `stream:server_tool_use` | Provider-executed tool invocation (e.g. Anthropic `web_search_20250305`) | — | `id, name, input, turnId` |
322
+ | `stream:server_tool_result` | Provider-executed tool returned | — | `toolUseId, toolName, content, turnId` |
321
323
  | `turn:after` | Assistant turn complete (always fires, even on error) | — | `turn, turnId, usage, message, toolCounts: { turn, run }` |
322
324
  | `tool-results:after` | After the user-role tool-results turn is pushed (persistence seam — write the pair together) | — | `turn, turnId, message, results: readonly ToolResult[]` |
323
325
  | `tool:gate` | Before each tool call | **yes** (`block, reason, result?`) | `turnId, callId, name, displayName, input, runToolCounts` — set `block` to refuse with `tool_result.content = "Blocked: <reason>"` + `is_error: true` (pinned contract); set `result` to substitute and skip execute (fires `tool:transform` + `tool:after`); `block` wins over `result` |
@@ -371,6 +373,7 @@ Same three fields land on `ToolContext` (visible to the tool body via `ctx.runId
371
373
 
372
374
  ```
373
375
  child:stream:text / child:stream:thinking / child:stream:end
376
+ child:stream:server_tool_use / child:stream:server_tool_result
374
377
  child:tool:gate / child:mcp:tool:gate ← mutable: block/reason/result propagate to the child
375
378
  child:tool:transform ← mutable: parent can rewrite the child's tool_result
376
379
  child:tool:before / child:tool:after / child:tool:error / child:tool:cancelled
package/docs/TUI.md CHANGED
@@ -195,6 +195,7 @@ Every customizable shortcut routes through `<userDir>/keybindings.json` and is p
195
195
  | `ctrl+l` | `openEffortPicker` | chat (idle, model has reasoning) | open reasoning-effort picker |
196
196
  | `ctrl+s` | `enterSelectTurnMode` | chat (idle) | enter select-turn mode (transcript navigation) |
197
197
  | `ctrl+t` | `openTodos` | chat (session attached) | open the active run's `todowrite` checkpoints (read-only) |
198
+ | `ctrl+g` | `openContextPanel` | chat | open the context-usage breakdown panel (read-only) |
198
199
  | `ctrl+y` | `openKeybindings` | non-auth | open the keybindings panel — read-only catalog grouped by surface, with `↵` to edit `~/.zidane/keybindings.json` |
199
200
  | `ctrl+k` | `cancelToolCall` | chat (busy, ≥1 in-flight call) | open the cancel-tool picker — pick one call to flip via `agent.cancelTool(callId)`, or press `a` to cancel every in-flight call. Distinct from `esc abort` (whole-run abort); siblings keep running |
200
201
  | `shift+tab` | `cycleAgent` | chat (idle, ≥2 profiles) | cycle to next agent profile |
@@ -276,6 +277,8 @@ Edit-diff rendering (`showEditDiffs` on) takes precedence over `toolCallDisplay`
276
277
 
277
278
  Hosts adding a new tool: extend `TOOL_DISPLAY` in `zidane/chat` with a `{ displayName, format }` entry. The TUI's renderer picks it up automatically — no `components.tsx` changes.
278
279
 
280
+ Provider-executed tools (`stream:server_tool_use` / `stream:server_tool_result`, e.g. Anthropic's server-side `web_search_20250305`) are synthesized into the same `'tool'` / `'tool-result'` events in `app.tsx`, so they flow through `<EventLine>` and `TOOL_DISPLAY` like locally-dispatched tools. Add a `TOOL_DISPLAY` entry under the producer's tool name to customize rendering.
281
+
279
282
  ### Edit-diff rendering
280
283
 
281
284
  `Settings.showEditDiffs` (default **on**) renders `edit` / `multi_edit` / `write_file` tool calls as a unified diff via the native `<diff>` renderable. Wire path:
@@ -354,6 +357,10 @@ Two thin chrome layers on top of the renderer-agnostic `useActiveTodos` hook (se
354
357
 
355
358
  Both surfaces resolve "what list to show" via `useActiveTodos(session)`, which carries both the live `todos` (model-facing) and the `archive` (sidecar — see [Todos in CHAT.md](./CHAT.md#todos) for the archive contract). The indicator only renders when there's a live `in_progress` item (an archived in-progress item is by definition stale and hidden). The modal renders `todos` when non-empty, falling back to `archive` when the live slot has been auto-cleared.
356
359
 
360
+ ### Context-usage panel
361
+
362
+ - **`ContextPanelModal`** (`src/tui/context-panel.tsx`) — opened via `ctrl+g` (`openContextPanel`), closes on `esc`. Read-only, on-demand: the `App.tsx` handler calls `agent.getContextBreakdown({ model, effectiveWindow, autocompactBuffer, compactThreshold })` (see [Context-usage breakdown in CHAT.md](./CHAT.md#context-usage-breakdown)) and opens the modal with the result — guarded so a stale async resolve (session switched mid-fetch) doesn't pop a panel for the wrong agent. Renders a single full-width stacked bar (one fixed-hue segment per live category, the autocompact-buffer zone pinned at the tail from the threshold to the window end, free space as the remaining track) above per-category rows (swatch · label · token count · percent). Estimated rows carry a `~` prefix; the footnote `~ estimated — exact counts unavailable for this provider` shows only when ≥1 live category is heuristic. Below the categories: an "active skills" section (informational — an activated skill's body lives in the conversation, already counted there) and a "last turn" section with the exact cache-read / cache-write / fresh-input / output split from `TurnUsage`. Expandable rows (MCP tools, per-rule files) toggle with `↵`/`space`; `↑↓` move the cursor across expandable groups. The panel works before the first message via the agent's skills-only pre-run assembly. The bar palette is shared verbatim with the GUI popover so both surfaces read identically.
363
+
357
364
  In addition, every `todowrite` tool call in the transcript renders a small "what's in progress" sub-list directly beneath the formatted call line. The sub-list reads the call's `input.todos` payload (the checkpoint the model just wrote), filters to `status === 'in_progress'`, and prints one indented `◐ <content>` row per item. Hidden when the payload has no in-progress items (e.g. all-completed close-out) so the transcript stays tight. This is purely declarative — it reads the event's own payload, not session state, so it's stable across re-renders and matches what the model intended at that checkpoint (not the latest list state, which the indicator + modal already surface).
358
365
 
359
366
  Because top-level runs share `session.metadata.todos.session`, a list written in one prompt **stays visible across the next prompt** — the user aborts mid-task, sends a follow-up, and the indicator + modal continue to show the same list until the model rewrites or auto-clears it. Subagent runs surface their own slot when they're the live run (`pickActiveRunId` picks the latest running run); when a subagent completes, the active resolution reflows to the parent's session slot on the next paint.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zidane",
3
- "version": "5.6.14",
3
+ "version": "5.7.4",
4
4
  "description": "an agent that goes straight to the goal",
5
5
  "type": "module",
6
6
  "private": false,
@@ -31,6 +31,14 @@
31
31
  "import": "./dist/tools.js",
32
32
  "types": "./dist/tools.d.ts"
33
33
  },
34
+ "./tools/web-search": {
35
+ "import": "./dist/tools/web-search.js",
36
+ "types": "./dist/tools/web-search.d.ts"
37
+ },
38
+ "./tools/fetch-url": {
39
+ "import": "./dist/tools/fetch-url.js",
40
+ "types": "./dist/tools/fetch-url.d.ts"
41
+ },
34
42
  "./presets": {
35
43
  "import": "./dist/presets.js",
36
44
  "types": "./dist/presets.d.ts"
@@ -67,6 +75,10 @@
67
75
  "import": "./dist/chat.js",
68
76
  "types": "./dist/chat.d.ts"
69
77
  },
78
+ "./chat/pure": {
79
+ "import": "./dist/chat/pure.js",
80
+ "types": "./dist/chat/pure.d.ts"
81
+ },
70
82
  "./tui": {
71
83
  "import": "./dist/tui.js",
72
84
  "types": "./dist/tui.d.ts"
@@ -96,7 +108,7 @@
96
108
  "lint": "eslint .",
97
109
  "lint:fix": "eslint . --fix",
98
110
  "test": "bun test",
99
- "release": "bumpp package.json tui/package.json tui/npm/*/package.json",
111
+ "release": "bumpp package.json tui/package.json tui/npm/*/package.json --execute \"bun install --cpu='*' --os='*'\" --all",
100
112
  "typecheck": "tsc --noEmit"
101
113
  },
102
114
  "dependencies": {
@@ -105,6 +117,10 @@
105
117
  "fzf": "^0.5.2",
106
118
  "hookable": "^6.1.1"
107
119
  },
120
+ "overrides": {
121
+ "@types/react": "19.2.15",
122
+ "@types/react-dom": "19.2.3"
123
+ },
108
124
  "peerDependencies": {
109
125
  "@anthropic-ai/sdk": "^0.90.0",
110
126
  "@modelcontextprotocol/sdk": ">=1.11.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-ClkpElCZ.d.ts","names":[],"sources":["../src/errors.ts","../src/types.ts","../src/providers/anthropic.ts","../src/providers/cerebras.ts","../src/providers/openai.ts","../src/providers/openai-compat.ts","../src/providers/openrouter.ts","../src/providers/schema-sanitize.ts","../src/providers/index.ts","../src/session/messages.ts","../src/session/file-map.ts","../src/session/memory.ts","../src/session/remote.ts","../src/session/index.ts","../src/skills/types.ts","../src/tools/read-state.ts","../src/tools/types.ts","../src/mcp/index.ts","../src/skills/activation.ts","../src/agent.ts"],"mappings":";;;;;;;;;;;;;;AAYA;;;;KAAY,mBAAA;AAGZ;AAAA,UAAiB,eAAA;EACf,IAAA,EAAM,mBAAA;EAAmB;EAEzB,YAAA;EAFM;EAIN,OAAA;EAAA;;;;AAQD;;EADC,SAAA;AAAA;AAAA,UAGQ,iBAAA;EAIR;EAFA,QAAA;EAMA;EAJA,YAAA;EAIS;EAFT,KAAA;EASqC;EAPrC,SAAA;AAAA;;;;;cAOW,yBAAA,SAAkC,KAAA;EAAA,SACpC,IAAA;EAAA,SACA,QAAA;EAAA,SACA,YAAA;cAEG,OAAA,UAAiB,OAAA,EAAS,iBAAA;AAAA;AAYxC;;;;AAAA,cAAa,kBAAA,SAA2B,KAAA;EAAA,SAC7B,IAAA;EAAA,SACA,QAAA;EAAA,SACA,YAAA;EAMA;;;;;EAAA,SAAA,SAAA;cAEG,OAAA,UAAiB,OAAA,EAAS,iBAAA;AAAA;;;;cAY3B,iBAAA,SAA0B,KAAA;EAAA,SAC5B,IAAA;cAEG,OAAA,WAA+B,OAAA;IAAY,KAAA;EAAA;AAAA;;;AAyBzD;;;;;;;;;;;;;;;;;cAAa,wBAAA,SAAiC,KAAA;EAAA,SACnC,IAAA;;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AAa,YAAA;EAAc,KAAA;EAAO,KAAA,EAAO,YAAA;EAAc,KAAA,EAAO;AAAA,GAAc,YAAA,GAAe,KAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-CTDMMdIy.d.ts","names":[],"sources":["../src/cache-telemetry.ts","../src/compact/messages.ts","../src/compact/prompt.ts","../src/compact/errors.ts","../src/compact/compact.ts","../src/compact/restore.ts","../src/compact/utils.ts","../src/logger.ts","../src/loop.ts","../src/loop-persistence.ts","../src/mcp/oauth-provider.ts","../src/mcp/login.ts","../src/mcp/oauth-callback.ts","../src/metrics.ts","../src/run-summary.ts","../src/stats.ts","../src/system-prompt.ts","../src/tools/edit.ts","../src/tools/glob.ts","../src/tools/grep.ts","../src/tools/interaction.ts","../src/tools/list-files.ts","../src/tools/multi-edit.ts","../src/tools/read-file.ts","../src/tools/shell.ts","../src/tools/shell-kill.ts","../src/tools/skills-read.ts","../src/tools/skills-run-script.ts","../src/tools/skills-use.ts","../src/tools/spawn.ts","../src/tools/tool-search.ts","../src/tools/validation.ts","../src/tools/write-file.ts","../src/tracing.ts","../src/zod.ts","../src/presets/basic.ts","../src/presets/index.ts"],"mappings":";;;;;;;;;;;AA8EA;;;;;AAWA;UArCiB,sBAAA;;EAEf,UAAA;EAyCA;EAvCA,WAAA;EA6CA;EA3CA,SAAA;EAqDmB;EAnDnB,UAAA;EAqEc;EAnEd,KAAA;;EAEA,QAAA;EAiE+B;EA/D/B,cAAA;AAAA;;UAIe,kBAAA;EA8EgC;EA5E/C,OAAA,WAAkB,kBAAA;EA4E6C;EA1E/D,OAAA,EAAS,QAAA,CAAS,OAAA,CAAQ,MAAA,CAAO,kBAAA;AAAA;AAmGnC;AAAA,KA/FY,kBAAA;AAAA,UAWK,uBAAA;EAqFT;;;;;EA/EN,GAAA,IAAO,IAAA;EA+EP;;;;;EAzEA,OAAA;EAsIc;;;;;;;;;EA5Hd,mBAAA;AAAA;;;;;;;;ACvFF;iBDyGgB,OAAA,CAAQ,CAAA;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IAAc,GAAA,GAAM,MAAA;IAAwB,OAAA;EAAA,MAAuB,OAAA,CAAQ,UAAA;EAClI,QAAA,GAAW,SAAA,UAAmB,IAAA,aAAiB,OAAA;EAC/C,SAAA,GAAY,SAAA,UAAmB,IAAA,UAAc,OAAA,aAAoB,OAAA;EACjE,SAAA,GAAY,SAAA,UAAmB,IAAA,aAAiB,OAAA;EAChD,OAAA,GAAU,SAAA,aAAsB,OAAA;AAAA;AAAA,iBAOlB,oBAAA,CAAqB,QAAA,EAAU,eAAA,GAAkB,gBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-v3Tzobqr.d.ts","names":[],"sources":["../src/skills/allowed-tools.ts","../src/skills/catalog.ts","../src/skills/discovery.ts","../src/skills/interpolate.ts","../src/skills/resolve.ts","../src/skills/validate.ts","../src/skills/writer.ts","../src/skills/index.ts"],"mappings":";;;;;;cAuBa,8BAAA;;;;;;;;;;ACHb;iBDmBgB,uBAAA,CACd,KAAA,EAAO,QAAA,CAAS,UAAA,GAChB,KAAA,EAAO,oBAAA;;;UCrBQ,mBAAA;EDoBR;;;;;ECdP,oBAAA;EDe2B;;;;ECV3B,YAAA;AAAA;;;;iBAMc,YAAA,CACd,MAAA,EAAQ,WAAA,IACR,OAAA,GAAS,mBAAA;;;UC4ED,eAAA;EACR,WAAA,EAAa,MAAA;EACb,IAAA;EACA,WAAA,EAAa,eAAA;AAAA;;;;;;;;;;;;ADlGf;;;;;iBCqHgB,gBAAA,CAAiB,OAAA,WAAkB,eAAA;AAAA,UAuUzC,iBAAA;;EAER,MAAA,GAAS,WAAA;AAAA;;;;;;;;;AAtc4E;;;iBAodjE,cAAA,CACpB,QAAA,UACA,OAAA,GAAS,iBAAA,GACR,OAAA,CAAQ,WAAA;;UAqNM,eAAA;EACf,IAAA;EACA,MAAA,EAAQ,WAAA;AAAA;;;AAjjBV;;;iBAyjBgB,mBAAA,CAAA,GAAuB,eAAA;;AAxctC;;;iBAyde,WAAA,CAAY,IAAA,WAAe,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