zidane 5.3.0 → 5.3.1

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 (64) hide show
  1. package/dist/{agent-CYpPKn5Z.d.ts → agent-bKs7MRT2.d.ts} +430 -5
  2. package/dist/agent-bKs7MRT2.d.ts.map +1 -0
  3. package/dist/chat.d.ts +310 -6
  4. package/dist/chat.d.ts.map +1 -1
  5. package/dist/chat.js +2 -2
  6. package/dist/{errors-COmsomd5.js → errors-Byb0F8B9.js} +44 -2
  7. package/dist/errors-Byb0F8B9.js.map +1 -0
  8. package/dist/{index-D-cTScN3.d.ts → index-BlMvPh9X.d.ts} +57 -10
  9. package/dist/index-BlMvPh9X.d.ts.map +1 -0
  10. package/dist/{index-Cc-q1hLT.d.ts → index-CTmNaIDb.d.ts} +2 -2
  11. package/dist/{index-Cc-q1hLT.d.ts.map → index-CTmNaIDb.d.ts.map} +1 -1
  12. package/dist/index.d.ts +4 -4
  13. package/dist/index.js +10 -10
  14. package/dist/{interpolate-BhmHKD6x.js → interpolate-ERgZUxgg.js} +2 -2
  15. package/dist/{interpolate-BhmHKD6x.js.map → interpolate-ERgZUxgg.js.map} +1 -1
  16. package/dist/{login-BXVt5wuA.js → login-CNS9_8Ue.js} +3 -3
  17. package/dist/{login-BXVt5wuA.js.map → login-CNS9_8Ue.js.map} +1 -1
  18. package/dist/{mcp-B1psg7jf.js → mcp-ZsSFo4Dp.js} +2 -2
  19. package/dist/{mcp-B1psg7jf.js.map → mcp-ZsSFo4Dp.js.map} +1 -1
  20. package/dist/mcp.d.ts +1 -1
  21. package/dist/mcp.js +1 -1
  22. package/dist/{messages-DsbMYNmt.js → messages-D0xT979U.js} +631 -68
  23. package/dist/messages-D0xT979U.js.map +1 -0
  24. package/dist/{presets-tvD28pCu.js → presets-h5i3kpOP.js} +29 -10
  25. package/dist/presets-h5i3kpOP.js.map +1 -0
  26. package/dist/presets.d.ts +2 -2
  27. package/dist/presets.js +1 -1
  28. package/dist/{providers-v1Rn2rqG.js → providers-x3LZByR5.js} +38 -6
  29. package/dist/providers-x3LZByR5.js.map +1 -0
  30. package/dist/providers.d.ts +2 -2
  31. package/dist/providers.js +3 -3
  32. package/dist/session/sqlite.d.ts +1 -1
  33. package/dist/session/sqlite.js +1 -1
  34. package/dist/{session-DOJgRXvF.js → session-BHZwxmfr.js} +2 -2
  35. package/dist/{session-DOJgRXvF.js.map → session-BHZwxmfr.js.map} +1 -1
  36. package/dist/session.d.ts +1 -1
  37. package/dist/session.js +2 -2
  38. package/dist/skills.d.ts +2 -2
  39. package/dist/skills.js +1 -1
  40. package/dist/{tools-CMVruxF0.js → tools-CWEDS2ZT.js} +380 -48
  41. package/dist/tools-CWEDS2ZT.js.map +1 -0
  42. package/dist/tools.d.ts +2 -2
  43. package/dist/tools.js +1 -1
  44. package/dist/{transcript-anchors-eyhlGeBI.d.ts → transcript-anchors-DOUqyvXR.d.ts} +28 -4
  45. package/dist/transcript-anchors-DOUqyvXR.d.ts.map +1 -0
  46. package/dist/tui.d.ts +29 -3
  47. package/dist/tui.d.ts.map +1 -1
  48. package/dist/tui.js +365 -80
  49. package/dist/tui.js.map +1 -1
  50. package/dist/{turn-operations-Y7e15gJf.js → turn-operations-D9HvatsR.js} +678 -33
  51. package/dist/turn-operations-D9HvatsR.js.map +1 -0
  52. package/dist/types-IcokUOyC.js.map +1 -1
  53. package/dist/types.d.ts +2 -2
  54. package/dist/types.js +1 -1
  55. package/package.json +1 -1
  56. package/dist/agent-CYpPKn5Z.d.ts.map +0 -1
  57. package/dist/errors-COmsomd5.js.map +0 -1
  58. package/dist/index-D-cTScN3.d.ts.map +0 -1
  59. package/dist/messages-DsbMYNmt.js.map +0 -1
  60. package/dist/presets-tvD28pCu.js.map +0 -1
  61. package/dist/providers-v1Rn2rqG.js.map +0 -1
  62. package/dist/tools-CMVruxF0.js.map +0 -1
  63. package/dist/transcript-anchors-eyhlGeBI.d.ts.map +0 -1
  64. package/dist/turn-operations-Y7e15gJf.js.map +0 -1
package/dist/chat.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Ft as ToolResultContent, T as SkillsConfig, W as Provider, kt as SessionTurn, x as SkillConfig, zt as TurnUsage } from "./agent-CYpPKn5Z.js";
2
- import { K as McpCredentialEntry, q as McpCredentialStore } from "./index-D-cTScN3.js";
3
- import { m as SourcedScanPath } from "./index-Cc-q1hLT.js";
4
- import { $ as TextQuestion, $n as piIdOf, $t as EditHunk, A as splitMarkdownCodeBlocks, An as applyInsert, At as ProviderRegistry, B as PendingInteractionEntry, Bn as ModelInfo, Bt as isVisible, C as renderSession, Cn as stripJsonComments, Ct as DiscoveryError, D as PromptSegmentRef, Dn as CompletionProvider, Dt as discoverProjectMcps, E as PromptSegment, En as CompletionItem, Et as defaultMcpsConfigPaths, F as InteractionRequest, Fn as AuthMethod, Ft as createStateStore, G as PlanStep, Gn as credKeyOf, Gt as saveState, H as PlanPayload, Hn as ProviderDescriptor, Ht as listSessionMeta, I as InteractionResponse, In as ProviderAuth, It as deriveSessionTitle, J as QuestionPayload, Jn as getModelInfo, Jt as sumRunCosts, K as Question, Kn as effectiveContextWindow, Kt as selectableTurnIds, L as InteractionsActions, Ln as ProviderKey, Lt as eventsFromTurns, M as AnswerValue, Mn as findActiveTrigger, Mt as resolveConfig, N as ConfirmQuestion, Nn as mergeReferences, Nt as StateStoreApi, O as splitPromptSegments, On as CompletionReference, Ot as parseMcpsFile, P as CreateInteractionToolsOptions, Pn as useCompletion, Pt as TuiState, Q as SelectQuestion, Qn as openrouterDescriptor, Qt as turnSelectionOwnership, R as InteractionsProvider, Rn as detectAuth, Rt as isEditErrorResult, S as SessionExportTarget, Sn as readKeybindings, St as DiscoveredMcp, T as writeSessionExport, Tn as CompletionContext, Tt as buildMcpServers, U as PlanRequest, Un as anthropicDescriptor, Ut as loadState, V as PlanDecision, Vn as OUTPUT_RESERVE_TOKENS, Vt as lastContextSizeFromTurns, W as PlanResponse, Wn as cerebrasDescriptor, Wt as marginTopFor, X as QuestionResponse, Xn as modelsForDescriptor, Xt as toolCallPreview, Y as QuestionRequest, Yn as modelSupportsReasoning, Yt as titleFromTurns, Z as QuestionType, Zn as openaiDescriptor, Zt as toolResultText, _ as ThemeSurfaces, _n as ensureKeybindingsFile, _t as RequestApproval, a as ToolFormatLine, an as Screen, ar as DEFAULT_AGENT_ID, at as serializeInteractionResponse, b as SessionExportAnchor, bn as mergeKeybindings, bt as useSafeModeActions, c as BUILTIN_THEMES, cn as StreamEvent, cr as accentColor, ct as Hint, d as DEFAULT_THEME, dn as KEYBINDING_DEFS, dt as truncateTrailing, en as EditOutcome, er as AgentAccent, et as buildResumedToolResultsTurn, f as SyntaxStyles, fn as KEYBINDING_DEF_BY_ACTION, ft as EnabledAllowlistKey, g as ThemeSelect, gn as ParsedBinding, gt as ApprovalRequest, h as ThemeColors, hn as KeyBindings, ht as ApprovalDecision, i as ToolDisplayMeta, in as Picked, ir as BUILTIN_AGENTS, it as pendingInteractionsFromTurns, j as ASK_USER_TOOL, jn as collectReferences, jt as ResolvedConfig, k as MarkdownSegment, kn as CompletionState, kt as ChatOptions, l as ChipColor, ln as ToolCallDisplay, lr as resolveAgentId, lt as clipHintsToWidth, m as Theme, mn as KeyBindingDef, mt as useEnabledToggleSet, n as computeTurnAnchors, nn as EditPayload, nr as AgentRegistry, nt as isInteractionTool, o as displayNameFor, on as SessionMeta, or as DEFAULT_PERSIST_EXCLUDE_TOOLS, ot as useInteractionsActions, p as SyntaxTokenStyle, pn as KeyAction, pt as EnabledToggleSet, q as QuestionChoice, qn as getContextWindow, qt as stripSpawnTokensLine, r as TOOL_DISPLAY, rn as Owner, rr as BUILD_AGENT, rt as makeRequestInteraction, s as formatToolCall, sn as Settings, sr as PLAN_AGENT, st as useInteractionsQueue, t as TranscriptItem, tn as EditOutcomeKind, tr as AgentProfile, tt as createInteractionTools, u as ChipColorMap, un as DEFAULT_KEYBINDINGS, ur as singleAgentRegistry, ut as hintsLength, v as resolveChipColor, vn as keybindingsPath, vt as SafeModeActions, w as resolveSessionExportTarget, wn as ActiveTrigger, wt as DiscoveryResult, x as SessionExportFormat, xn as parseBindingSpec, xt as useSafeModeQueue, y as resolveTheme, yn as matchesBinding, yt as SafeModeProvider, z as PRESENT_PLAN_TOOL, zn as BUILTIN_PROVIDERS, zt as isTurnHighlighted } from "./transcript-anchors-eyhlGeBI.js";
1
+ import { D as Session, T as SkillsConfig, Wt as SessionTurn, Xt as ToolResultContent, en as TurnUsage, et as Provider, x as SkillConfig } from "./agent-bKs7MRT2.js";
2
+ import { K as McpCredentialEntry, q as McpCredentialStore, t as Preset } from "./index-BlMvPh9X.js";
3
+ import { m as SourcedScanPath } from "./index-CTmNaIDb.js";
4
+ import { $ as TextQuestion, $n as piIdOf, $t as EditHunk, A as splitMarkdownCodeBlocks, An as applyInsert, At as ProviderRegistry, B as PendingInteractionEntry, Bn as ModelInfo, Bt as isVisible, C as renderSession, Cn as stripJsonComments, Ct as DiscoveryError, D as PromptSegmentRef, Dn as CompletionProvider, Dt as discoverProjectMcps, E as PromptSegment, En as CompletionItem, Et as defaultMcpsConfigPaths, F as InteractionRequest, Fn as AuthMethod, Ft as createStateStore, G as PlanStep, Gn as credKeyOf, Gt as saveState, H as PlanPayload, Hn as ProviderDescriptor, Ht as listSessionMeta, I as InteractionResponse, In as ProviderAuth, It as deriveSessionTitle, J as QuestionPayload, Jn as getModelInfo, Jt as sumRunCosts, K as Question, Kn as effectiveContextWindow, Kt as selectableTurnIds, L as InteractionsActions, Ln as ProviderKey, Lt as eventsFromTurns, M as AnswerValue, Mn as findActiveTrigger, Mt as resolveConfig, N as ConfirmQuestion, Nn as mergeReferences, Nt as StateStoreApi, O as splitPromptSegments, On as CompletionReference, Ot as parseMcpsFile, P as CreateInteractionToolsOptions, Pn as useCompletion, Pt as TuiState, Q as SelectQuestion, Qn as openrouterDescriptor, Qt as turnSelectionOwnership, R as InteractionsProvider, Rn as detectAuth, Rt as isEditErrorResult, S as SessionExportTarget, Sn as readKeybindings, St as DiscoveredMcp, T as writeSessionExport, Tn as CompletionContext, Tt as buildMcpServers, U as PlanRequest, Un as anthropicDescriptor, Ut as loadState, V as PlanDecision, Vn as OUTPUT_RESERVE_TOKENS, Vt as lastContextSizeFromTurns, W as PlanResponse, Wn as cerebrasDescriptor, Wt as marginTopFor, X as QuestionResponse, Xn as modelsForDescriptor, Xt as toolCallPreview, Y as QuestionRequest, Yn as modelSupportsReasoning, Yt as titleFromTurns, Z as QuestionType, Zn as openaiDescriptor, Zt as toolResultText, _ as ThemeSurfaces, _n as ensureKeybindingsFile, _t as RequestApproval, a as ToolFormatLine, an as Screen, ar as DEFAULT_AGENT_ID, at as serializeInteractionResponse, b as SessionExportAnchor, bn as mergeKeybindings, bt as useSafeModeActions, c as BUILTIN_THEMES, cn as StreamEvent, cr as accentColor, ct as Hint, d as DEFAULT_THEME, dn as KEYBINDING_DEFS, dt as truncateTrailing, en as EditOutcome, er as AgentAccent, et as buildResumedToolResultsTurn, f as SyntaxStyles, fn as KEYBINDING_DEF_BY_ACTION, ft as EnabledAllowlistKey, g as ThemeSelect, gn as ParsedBinding, gt as ApprovalRequest, h as ThemeColors, hn as KeyBindings, ht as ApprovalDecision, i as ToolDisplayMeta, in as Picked, ir as BUILTIN_AGENTS, it as pendingInteractionsFromTurns, j as ASK_USER_TOOL, jn as collectReferences, jt as ResolvedConfig, k as MarkdownSegment, kn as CompletionState, kt as ChatOptions, l as ChipColor, ln as ToolCallDisplay, lr as resolveAgentId, lt as clipHintsToWidth, m as Theme, mn as KeyBindingDef, mt as useEnabledToggleSet, n as computeTurnAnchors, nn as EditPayload, nr as AgentRegistry, nt as isInteractionTool, o as displayNameFor, on as SessionMeta, or as DEFAULT_PERSIST_EXCLUDE_TOOLS, ot as useInteractionsActions, p as SyntaxTokenStyle, pn as KeyAction, pt as EnabledToggleSet, q as QuestionChoice, qn as getContextWindow, qt as stripSpawnTokensLine, r as TOOL_DISPLAY, rn as Owner, rr as BUILD_AGENT, rt as makeRequestInteraction, s as formatToolCall, sn as Settings, sr as PLAN_AGENT, st as useInteractionsQueue, t as TranscriptItem, tn as EditOutcomeKind, tr as AgentProfile, tt as createInteractionTools, u as ChipColorMap, un as DEFAULT_KEYBINDINGS, ur as singleAgentRegistry, ut as hintsLength, v as resolveChipColor, vn as keybindingsPath, vt as SafeModeActions, w as resolveSessionExportTarget, wn as ActiveTrigger, wt as DiscoveryResult, x as SessionExportFormat, xn as parseBindingSpec, xt as useSafeModeQueue, y as resolveTheme, yn as matchesBinding, yt as SafeModeProvider, z as PRESENT_PLAN_TOOL, zn as BUILTIN_PROVIDERS, zt as isTurnHighlighted } from "./transcript-anchors-DOUqyvXR.js";
5
5
  import { OAuthCredentials } from "@mariozechner/pi-ai/oauth";
6
6
  import { Dispatch, ReactNode, SetStateAction } from "react";
7
7
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
@@ -1277,7 +1277,7 @@ declare function addToSafelist(dataDir: string, projectDir: string, entry: strin
1277
1277
  /** Read the safelist for one project. Returns `[]` for unknown projects. */
1278
1278
  declare function getSafelist(dataDir: string, projectDir: string): readonly string[];
1279
1279
  /**
1280
- * Tools that always pass without prompting. Two categories:
1280
+ * Tools that always pass without prompting. Three categories:
1281
1281
  *
1282
1282
  * - **Pure reads** (`read_file`, `list_files`, `glob`, `grep`) — no
1283
1283
  * side effects on disk or the model's own state.
@@ -1285,6 +1285,12 @@ declare function getSafelist(dataDir: string, projectDir: string): readonly stri
1285
1285
  * itself surfaces a TUI picker the user has to answer, so prompting
1286
1286
  * for approval first would mean "approve this prompt before you see
1287
1287
  * the prompt": redundant + breaks the flow. The picker IS the gate.
1288
+ * - **Todos** (`todowrite`, `todoread`) — write to a slot on
1289
+ * `session.metadata.todos` and nothing else. No shell, no disk, no
1290
+ * network. The model uses these for checkpointing every few steps;
1291
+ * a per-call approval prompt would drown the conversation in
1292
+ * interruptions that buy no safety since the tool's surface is
1293
+ * read/write on a metadata bag we already trust the agent with.
1288
1294
  *
1289
1295
  * Users who want to gate any of these must disable safe-mode entirely
1290
1296
  * (or fork this list in their own embedding).
@@ -1513,6 +1519,304 @@ declare const CATPPUCCIN_LATTE: Theme;
1513
1519
  //#region src/chat/themes/vaporwave.d.ts
1514
1520
  declare const VAPORWAVE_THEME: Theme;
1515
1521
  //#endregion
1522
+ //#region src/chat/todos.d.ts
1523
+ declare const TODOWRITE_TOOL = "todowrite";
1524
+ declare const TODOREAD_TOOL = "todoread";
1525
+ /** True when `name` is one of the todo tool canonical names. */
1526
+ declare function isTodoTool(name: string): boolean;
1527
+ /** `session.metadata[TODOS_METADATA_KEY]: TodosBag` — see {@link TodosBag}. */
1528
+ declare const TODOS_METADATA_KEY = "todos";
1529
+ /** `session.metadata[TODO_WRITE_COUNTS_METADATA_KEY]: CountsBag` — mirrors `TodosBag` shape. */
1530
+ declare const TODO_WRITE_COUNTS_METADATA_KEY = "todoWriteCounts";
1531
+ type TodoStatus = 'pending' | 'in_progress' | 'completed' | 'cancelled';
1532
+ interface TodoItem {
1533
+ /** Stable id — the model picks it. Reusing an id replaces that item. */
1534
+ id: string;
1535
+ /** One-line task summary (Markdown allowed; renderers may sanitize). */
1536
+ content: string;
1537
+ status: TodoStatus;
1538
+ }
1539
+ /**
1540
+ * On-disk shape at `session.metadata[TODOS_METADATA_KEY]`.
1541
+ *
1542
+ * Sub-fields are absent (not empty) when they carry no data — keeps the
1543
+ * persisted metadata clean and lets `JSON.stringify` skip empty bags
1544
+ * entirely on session save.
1545
+ */
1546
+ interface TodosBag {
1547
+ /** Top-level slot — shared across runs whose `parentRunId` is unset. */
1548
+ session?: TodoItem[];
1549
+ /** Per-subagent-run slots, keyed by the child run's id. */
1550
+ byRun?: Record<string, TodoItem[]>;
1551
+ /**
1552
+ * Most-recent non-empty list per slot — sidecar for UI surfaces, NOT
1553
+ * visible to `todoread`. Updated on every non-empty write; **preserved**
1554
+ * across the auto-clear path. Lets the modal keep showing "what was just
1555
+ * completed" after a fully-done batch wipes the live slot. Empty writes
1556
+ * never touch the archive — clearing the live list shouldn't erase the
1557
+ * audit trail.
1558
+ */
1559
+ archive?: {
1560
+ session?: TodoItem[];
1561
+ byRun?: Record<string, TodoItem[]>;
1562
+ };
1563
+ }
1564
+ declare const TODO_STATUS_GLYPHS: Readonly<Record<TodoStatus, string>>;
1565
+ interface CreateTodoToolsOptions {
1566
+ /**
1567
+ * Maximum item count per `todowrite`. Excess items are truncated by the
1568
+ * recursive validator and reported back to the model in the tool_result.
1569
+ *
1570
+ * Default: `100`. The default is generous; a planning agent that exceeds
1571
+ * 100 items per call is usually flailing.
1572
+ */
1573
+ maxItems?: number;
1574
+ /**
1575
+ * Per-run cap on `todowrite` calls, plumbed into `behavior.toolBudgets`.
1576
+ * `onMaxWrites` chooses the reaction (steer / block) — see
1577
+ * {@link AgentBehavior.toolBudgets} for the contract.
1578
+ *
1579
+ * **Default: `0` (no cap).** `todowrite` is a state-transition tool —
1580
+ * a legitimate run of an N-item list needs at least `N + 1` calls
1581
+ * (initial plan + one transition per item) to complete, so a hard
1582
+ * cap punishes the legitimate path. The nudges that DO apply are the
1583
+ * `remindAfter` reminder (soft, in-band) and the identical-payload
1584
+ * dedup check (silent, structural). Hosts that want a true hard cap
1585
+ * can opt in by setting `maxWritesPerRun: N`.
1586
+ *
1587
+ * **Counting semantics** (when opted in): the budget counts every
1588
+ * dispatched call, including dedup substitutes (zidane spec). The
1589
+ * {@link remindAfter} counter counts execute-only dispatches —
1590
+ * dedup hits replay the prior result and never reach the tool body.
1591
+ * Use this budget (not the reminder) as the hard limit.
1592
+ */
1593
+ maxWritesPerRun?: number;
1594
+ onMaxWrites?: 'steer' | 'block';
1595
+ /**
1596
+ * Append a "you've checkpointed N times — only call this at significant
1597
+ * task transitions" nudge to the tool_result once `todowrite` has fired
1598
+ * this many times in the current run. The nudge rides on the result
1599
+ * string, so the model sees it on its next turn without `system:transform`
1600
+ * plumbing.
1601
+ *
1602
+ * Counts only executed dispatches (dedup hits skip the tool body and so
1603
+ * skip the increment). For a hard cap that also covers dedup hits, use
1604
+ * {@link maxWritesPerRun}.
1605
+ *
1606
+ * Set to `0` to opt out. Default: `3`.
1607
+ */
1608
+ remindAfter?: number;
1609
+ /**
1610
+ * Custom reminder text. Receives the post-call count and the items that
1611
+ * were just written. Return `''` (or `undefined`) to suppress the reminder
1612
+ * for this specific call. Default text nudges towards "back to executing,
1613
+ * not re-planning."
1614
+ */
1615
+ reminderText?: (count: number, items: readonly TodoItem[]) => string | undefined;
1616
+ /**
1617
+ * Short-circuit the tool body when the incoming payload is identical to
1618
+ * the **current slot** (session-shared for top-level runs, per-run for
1619
+ * subagents). The model gets a "No change — N items already tracked."
1620
+ * acknowledgment instead of a fresh "Updated N items." line.
1621
+ * Default: `true`.
1622
+ *
1623
+ * Read `session.metadata.todos` via {@link getTodosForRun} for the
1624
+ * comparison — so the resolution naturally follows the keying rule
1625
+ * (top-level reads the session slot, subagent reads its own). Does
1626
+ * NOT plumb through `behavior.dedupTools`: that cache lives at the
1627
+ * gate, is keyed per session, and would conflate top-level + subagent
1628
+ * re-writes of structurally identical payloads.
1629
+ *
1630
+ * Counter advances on identical re-writes regardless — the model
1631
+ * called the tool, that's a call. Lets the reminder threshold catch
1632
+ * spam. Set `false` to skip the check entirely (every call rewrites
1633
+ * the slot, useful when state-shape comparisons are pointless for
1634
+ * your usage).
1635
+ */
1636
+ dedupIdentical?: boolean;
1637
+ /**
1638
+ * Override the JSON-schema-level descriptions surfaced to the model.
1639
+ * Useful for telemetry experiments. Leave unset to inherit the built-in
1640
+ * doctrine prose.
1641
+ */
1642
+ writeDescription?: string;
1643
+ readDescription?: string;
1644
+ }
1645
+ /**
1646
+ * Read the active list for `runId`. Top-level runs see the session-shared
1647
+ * slot; subagent runs see their own. Returns a fresh `[]` (not stored in
1648
+ * metadata) when no slot exists — the caller can mutate the result
1649
+ * without affecting state.
1650
+ */
1651
+ declare function getTodosForRun(session: Session, runId: string): TodoItem[];
1652
+ /**
1653
+ * Replace the active list for `runId`. Routes to the session-shared slot
1654
+ * for top-level runs and to the per-run slot for subagents. Empty arrays
1655
+ * delete the slot entirely so persisted metadata stays clean.
1656
+ *
1657
+ * Side effect: a **non-empty** write also stashes the same list into
1658
+ * `bag.archive` (same routing). Empty writes never touch the archive —
1659
+ * clearing the live list (whether explicitly or via the tool's auto-
1660
+ * clear) preserves the "last shown" snapshot so UI surfaces can keep
1661
+ * rendering what was just completed. See {@link getArchivedTodosForRun}.
1662
+ */
1663
+ declare function setTodosForRun(session: Session, runId: string, items: readonly TodoItem[]): void;
1664
+ /**
1665
+ * Read the archived (most-recent non-empty) list for `runId`. Same slot
1666
+ * routing as {@link getTodosForRun}, but reads `bag.archive` instead of
1667
+ * the live slot. Returns a fresh `[]` when no archive exists.
1668
+ *
1669
+ * UI surfaces use this to keep showing "what was just completed" after
1670
+ * the live list auto-clears. The model never sees the archive — it's a
1671
+ * read-only sidecar for human-facing rendering.
1672
+ */
1673
+ declare function getArchivedTodosForRun(session: Session, runId: string): TodoItem[];
1674
+ /**
1675
+ * Reconcile `session.metadata.todos.byRun` (live + archive) against
1676
+ * `session.runs`. Drops subagent slots whose runId isn't in the run
1677
+ * list. The top-level `session` slot is unaffected — it's session-
1678
+ * scoped, not per-run, so there's no orphan to GC.
1679
+ *
1680
+ * Useful after `session.setRuns()` (fork / restore) or to GC stale
1681
+ * metadata mutated by an external caller. Also prunes the parallel
1682
+ * counter bag so the two don't drift.
1683
+ *
1684
+ * `dropped` reports the live-byRun orphans only (archive-only orphans
1685
+ * are silently swept). The live half is the contract callers actually
1686
+ * observe.
1687
+ */
1688
+ declare function pruneTodosByRun(session: Session): {
1689
+ dropped: readonly string[];
1690
+ };
1691
+ /**
1692
+ * Build a `Preset` carrying the `{ todowrite, todoread }` tool pair.
1693
+ * Identical-payload dedup is handled inside the tool body — the
1694
+ * comparison resolves against the active slot (session-shared for
1695
+ * top-level runs, per-run for subagents) and intentionally does NOT
1696
+ * plumb through `behavior.dedupTools`. See the `dedupIdentical` option
1697
+ * doc for the rationale.
1698
+ *
1699
+ * By default the preset adds **no** `toolBudgets` entry — `todowrite`
1700
+ * is a state-transition tool, so a hard cap is the wrong abstraction
1701
+ * (it punishes the legitimate "finish the N-item plan" path). Hosts
1702
+ * that want a ceiling pass `maxWritesPerRun: N` explicitly; the
1703
+ * factory then plumbs a `behavior.toolBudgets.todowrite` entry
1704
+ * through.
1705
+ *
1706
+ * Returning a `Preset` (not a bare tool map) lets the result flow
1707
+ * through {@link composePresets} unchanged — todos compose with any
1708
+ * other preset the same way every other preset does. `toolBudgets` is
1709
+ * a tool-name-keyed record that `composePresets` deep-merges, so a
1710
+ * caller's custom budget entries for other tools survive the
1711
+ * layering, and a caller's override for `todowrite` itself wins by
1712
+ * being placed later in the chain.
1713
+ *
1714
+ * ```ts
1715
+ * import { basic, composePresets } from 'zidane/presets'
1716
+ * import { createTodoTools } from 'zidane/chat'
1717
+ *
1718
+ * // Default: no budget — relies on the in-band reminder + dedup.
1719
+ * createAgent({ ...composePresets(basic, createTodoTools()), provider })
1720
+ *
1721
+ * // Opt-in hard cap: refuse > 20 writes per run.
1722
+ * createAgent({
1723
+ * ...composePresets(basic, createTodoTools({ maxWritesPerRun: 20 })),
1724
+ * provider,
1725
+ * })
1726
+ * ```
1727
+ *
1728
+ * For the trivial "just add the tools to an existing config" case, plain
1729
+ * spread is also fine since the returned `Preset` only sets `tools`
1730
+ * (and `behavior` when a budget is opted in):
1731
+ *
1732
+ * ```ts
1733
+ * createAgent({ ...basic, ...createTodoTools(), provider })
1734
+ * ```
1735
+ */
1736
+ declare function createTodoTools(options?: CreateTodoToolsOptions): Preset;
1737
+ interface TodoTally {
1738
+ pending: number;
1739
+ in_progress: number;
1740
+ completed: number;
1741
+ cancelled: number;
1742
+ }
1743
+ interface ActiveTodosState {
1744
+ /** Run the slice came from. `null` ⇒ no session / no runs / no active run. */
1745
+ runId: string | null;
1746
+ /**
1747
+ * Live list — what `todoread` would return. Empty when the slot was
1748
+ * cleared (e.g. auto-clear after every item completed) or never
1749
+ * written. Source of truth for the model's view.
1750
+ */
1751
+ todos: readonly TodoItem[];
1752
+ /**
1753
+ * Most-recent non-empty list for the active slot, preserved across
1754
+ * auto-clear. Equals `todos` when the live list is non-empty;
1755
+ * otherwise the last batch that was shown (commonly the all-`completed`
1756
+ * close-out). UI surfaces fall back to this when `todos` is empty so
1757
+ * the user can still glance back at "what was just finished" — until
1758
+ * the model writes a new list. Empty array when no list was ever
1759
+ * written for this slot.
1760
+ */
1761
+ archive: readonly TodoItem[];
1762
+ /**
1763
+ * The first `in_progress` item from `todos` (the **live** list), when
1764
+ * one exists. Drives the inline indicator above the prompt. Always
1765
+ * `null` when the live list is empty — even if the archive carries
1766
+ * an in-progress item, that item is by definition stale.
1767
+ */
1768
+ inProgress: TodoItem | null;
1769
+ /**
1770
+ * Per-status counts. Computed over `todos` when non-empty, else over
1771
+ * `archive`. Zeros only when both are empty. Lets the modal header
1772
+ * show a meaningful tally for the archived "last batch" view.
1773
+ */
1774
+ tally: TodoTally;
1775
+ }
1776
+ /**
1777
+ * Pick the "active" run for UI surfaces that show one slot at a time
1778
+ * (todos indicator, todos modal, footer ctx indicator). The resolved
1779
+ * runId then routes through {@link getTodosForRun} — top-level runs
1780
+ * land on the session-shared slot, subagent runs on their own.
1781
+ *
1782
+ * - A currently-running run wins (latest-started one if several).
1783
+ * - Otherwise the most recently appended run wins.
1784
+ * - `null` when the session has no runs.
1785
+ *
1786
+ * Mirrors the "most recent thing that mattered" policy that drives
1787
+ * `lastContextSizeFromTurns` — but walks `session.runs` rather than
1788
+ * `session.turns` because the active todo slot is a function of the
1789
+ * run, not of message history.
1790
+ */
1791
+ declare function pickActiveRunId(session: Session | null | undefined): string | null;
1792
+ /**
1793
+ * Pure selector — derive the active-todos state from a session snapshot.
1794
+ * Used by {@link useActiveTodos} and directly testable without React.
1795
+ *
1796
+ * Resolves both `todos` (live, model-facing) and `archive` (last
1797
+ * non-empty snapshot for UI fallback). The tally folds over whichever
1798
+ * list is non-empty; `inProgress` is sourced strictly from `todos`
1799
+ * because an archived in-progress item is by definition stale.
1800
+ */
1801
+ declare function selectActiveTodos(session: Session | null | undefined): ActiveTodosState;
1802
+ /**
1803
+ * React hook — active-todos state for the supplied session. Recomputes
1804
+ * on every parent re-render; the work is O(runs + todos), both bounded
1805
+ * by small constants in practice.
1806
+ *
1807
+ * Why no memoization: `Session.runs` is mutated in place by `completeRun`
1808
+ * / `abortRun` (status flips without changing array length or item
1809
+ * identity), so any memo keyed off length / bag identity would silently
1810
+ * return stale state when e.g. a child subagent run completes and the
1811
+ * "active" run should reflow to the parent. The selector is cheap
1812
+ * enough that running it every parent render is the simpler, correct
1813
+ * answer — see `selectActiveTodos` for the O(n) cost.
1814
+ *
1815
+ * The hook lives in `chat/` so a GUI consumer can mount it verbatim.
1816
+ * Renderer-agnostic — no `@opentui/*` imports.
1817
+ */
1818
+ declare function useActiveTodos(session: Session | null | undefined): ActiveTodosState;
1819
+ //#endregion
1516
1820
  //#region src/chat/turn-operations.d.ts
1517
1821
  /**
1518
1822
  * Fork — keep every turn up to and including `turnId`, then strip any
@@ -1569,5 +1873,5 @@ declare function countNeighbors(turnIds: readonly string[], turnId: string): {
1569
1873
  after: number;
1570
1874
  } | null;
1571
1875
  //#endregion
1572
- export { ACTIONS_WITH_CARE_DOCTRINE, ASK_USER_TOOL, type ActiveTrigger, type AgentAccent, type AgentProfile, type AgentRegistry, type AnswerValue, type ApiKeyCredential, type ApprovalDecision, type ApprovalRequest, type AuthMethod, type AutoCompactDecision, type AutoCompactInput, BUILD_AGENT, BUILTIN_AGENTS, BUILTIN_PROVIDERS, BUILTIN_THEMES, type BooleanSettingKey, type BuildSystemOptions, CATPPUCCIN_FRAPPE, CATPPUCCIN_LATTE, CATPPUCCIN_MACCHIATO, CATPPUCCIN_MOCHA, COMMUNICATION_DOCTRINE, type CatalogEntry, type ChatOptions, type ChipColor, type ChipColorMap, type Commit, type CompletionContext, type CompletionItem, type CompletionProvider, type CompletionReference, type CompletionState, ConfigProvider, type ConfirmQuestion, type CreateInteractionToolsOptions, type CredentialsFile, DEFAULT_AGENT_ID, DEFAULT_KEYBINDINGS, DEFAULT_PERSIST_EXCLUDE_TOOLS, DEFAULT_SETTINGS, DEFAULT_THEME, DOING_TASKS_DOCTRINE, type DiffLine, type DiffOp, type DiscoveredMcp, type DiscoveryContextValue, type DiscoveryError, DiscoveryProvider, type DiscoveryResult, type DiscoverySlot, type DiscoverySlotOptions, type EditHunk, type EditOutcome, type EditOutcomeKind, type EditPayload, type EnabledAllowlistKey, type EnabledToggleSet, type EnvSectionOptions, FILES_TRIGGER, type FileEntry, type GenerateSessionTitleOptions, type Hint, type HunkResolution, IDENTITY_PREFIX, IMPLICITLY_SAFE_TOOLS, INTERACTION_GUIDANCE, INTERACTION_GUIDANCE_NO_PROMPTS, type InlineDiff, type InlineSegment, type InteractionRequest, type InteractionResponse, type InteractionsActions, InteractionsProvider, KEYBINDING_DEFS, KEYBINDING_DEF_BY_ACTION, type KeyAction, type KeyBindingDef, type KeyBindings, type ListProjectFilesOptions, type MarkdownSegment, type McpAuthEvent, McpAuthProvider, type McpAuthStateMap, type McpAuthStatus, type ModelInfo, type OAuthCredential, type OAuthFlowOptions, OUTPUT_RESERVE_TOKENS, type Owner, PLAN_AGENT, PLAN_MODE_DOCTRINE, PLAN_MODE_DOCTRINE_NO_PROMPTS, PRESENT_PLAN_TOOL, type ParsedBinding, type PendingInteractionEntry, type Picked, type PlanDecision, type PlanPayload, type PlanRequest, type PlanResponse, type PlanStep, type PreviewResult, type ProjectEntry, type ProjectUserPath, type ProjectsFile, type PromptSegment, type PromptSegmentRef, type ProviderAuth, type ProviderCredential, type ProviderDescriptor, type ProviderKey, type ProviderRegistry, type Question, type QuestionChoice, type QuestionPayload, type QuestionRequest, type QuestionResponse, type QuestionType, type RequestApproval, type ResolvedApproval, type ResolvedConfig, SETTINGS_CHOICES, SETTINGS_TOGGLES, SKILLS_TRIGGER, SUBAGENT_GUIDANCE, type SafeModeActions, SafeModeProvider, type Screen, type SelectQuestion, type SessionExportAnchor, type SessionExportFormat, type SessionExportTarget, type SessionMeta, type Settings, type SettingsChoice, SettingsProvider, type SettingsToggle, type StateStoreApi, type StreamBuffer, type StreamEvent, type StreamSource, type SyntaxStyles, type SyntaxTokenStyle, TOKEN_DISCIPLINE_DOCTRINE, TOOL_DISPLAY, type TextQuestion, type Theme, type ThemeColors, ThemeProvider, type ThemeSelect, type ThemeSurfaces, type ToolCallDisplay, type ToolDisplayMeta, type ToolFormatLine, type TranscriptItem, type TuiState, VAPORWAVE_THEME, type Walk, accentColor, addToSafelist, ageString, anthropicDescriptor, applyApiKeyEnv, applyEditPayload, applyInsert, blendHsl, bootProfileEnabled, bootTick, buildBuildSystem, buildContextualDiff, buildEditOutcomesAnnotation, buildLinearRamp, buildMcpServers, buildModelCatalog, buildPlanSystem, buildResumedToolResultsTurn, buildSkillsConfig, buildUnifiedDiff, cerebrasDescriptor, cleanTitle, clipHintsToWidth, collectReferences, compactPath, computeInlineDiff, computeLineDiff, computeTurnAnchors, countNeighbors, createDiscoverySlot, createFileMcpCredentialStore, createFilesCompletionProvider, createInteractionTools, createSkillsCompletionProvider, createStateStore, credKeyOf, credentialsPath, defaultMcpsConfigPaths, defaultSkillScanPaths, deleteTurnSafely, deriveSessionTitle, detectAuth, discoverProjectMcps, discoverProjectSkills, displayNameFor, effectiveContextWindow, ensureKeybindingsFile, envSection, eventsFromTurns, extractEditPayload, filetypeFromPath, filterModelCatalog, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, findActiveTrigger, findGitRoot, fmtTokens, formatPathForCwd, formatToolCall, generateSessionTitle, getContextWindow, getMcpAuthStatus, getModelInfo, getSafelist, hintsLength, indexOfEntry, isEditErrorResult, isInteractionTool, isOnSafelist, isTurnHighlighted, isVisible, keybindingsPath, lastContextSizeFromTurns, listProjectFiles, listSessionMeta, loadState, makeRequestInteraction, marginTopFor, maskToOutcomeKinds, matchesBinding, matchesSafelistEntry, mcpCredentialsPath, mergeKeybindings, mergeReferences, modelSupportsReasoning, modelsForDescriptor, openaiDescriptor, openrouterDescriptor, parseBindingSpec, parseEditOutcomesFromResult, parseMcpsFile, patchMcpCredential, pendingInteractionsFromTurns, piIdOf, previewEditPayload, projectUserPaths, projectsFilePath, readCredentials, readKeybindings, readProjects, readProviderCredential, reduceMcpAuth, removeProviderCredential, renderSession, resolveAgentId, resolveApprovalForPayload, resolveChipColor, resolveConfig, resolveSessionExportTarget, resolveTheme, runOAuthLogin, saveState, selectableTurnIds, serializeInteractionResponse, setProviderCredential, shortId, shouldAutoCompact, singleAgentRegistry, splitLines, splitMarkdownCodeBlocks, splitPromptSegments, stripJsonComments, stripSpawnTokensLine, suggestSafelistEntry, sumRunCosts, summarizeOutcomes, supportsOAuth, titleFromTurns, tokenize, toolCallPreview, toolResultText, truncateTrailing, truncateTurnsAt, tryOpenBrowser, turnAsText, turnContextSize, turnSelectionOwnership, uniqueFilesFromReferences, uniqueSkillNamesFromReferences, useColors, useCompletion, useConfig, useDiscovery, useDiscoveryOptional, useEnabledToggleSet, useInteractionsActions, useInteractionsQueue, useMcpAuthDispatch, useMcpAuthState, useSafeModeActions, useSafeModeQueue, useSelectStyle, useSettings, useStreamBuffer, useSurfaces, useSyntaxStyles, useTheme, writeCredentials, writeProjects, writeSessionExport };
1876
+ export { ACTIONS_WITH_CARE_DOCTRINE, ASK_USER_TOOL, type ActiveTodosState, type ActiveTrigger, type AgentAccent, type AgentProfile, type AgentRegistry, type AnswerValue, type ApiKeyCredential, type ApprovalDecision, type ApprovalRequest, type AuthMethod, type AutoCompactDecision, type AutoCompactInput, BUILD_AGENT, BUILTIN_AGENTS, BUILTIN_PROVIDERS, BUILTIN_THEMES, type BooleanSettingKey, type BuildSystemOptions, CATPPUCCIN_FRAPPE, CATPPUCCIN_LATTE, CATPPUCCIN_MACCHIATO, CATPPUCCIN_MOCHA, COMMUNICATION_DOCTRINE, type CatalogEntry, type ChatOptions, type ChipColor, type ChipColorMap, type Commit, type CompletionContext, type CompletionItem, type CompletionProvider, type CompletionReference, type CompletionState, ConfigProvider, type ConfirmQuestion, type CreateInteractionToolsOptions, type CreateTodoToolsOptions, type CredentialsFile, DEFAULT_AGENT_ID, DEFAULT_KEYBINDINGS, DEFAULT_PERSIST_EXCLUDE_TOOLS, DEFAULT_SETTINGS, DEFAULT_THEME, DOING_TASKS_DOCTRINE, type DiffLine, type DiffOp, type DiscoveredMcp, type DiscoveryContextValue, type DiscoveryError, DiscoveryProvider, type DiscoveryResult, type DiscoverySlot, type DiscoverySlotOptions, type EditHunk, type EditOutcome, type EditOutcomeKind, type EditPayload, type EnabledAllowlistKey, type EnabledToggleSet, type EnvSectionOptions, FILES_TRIGGER, type FileEntry, type GenerateSessionTitleOptions, type Hint, type HunkResolution, IDENTITY_PREFIX, IMPLICITLY_SAFE_TOOLS, INTERACTION_GUIDANCE, INTERACTION_GUIDANCE_NO_PROMPTS, type InlineDiff, type InlineSegment, type InteractionRequest, type InteractionResponse, type InteractionsActions, InteractionsProvider, KEYBINDING_DEFS, KEYBINDING_DEF_BY_ACTION, type KeyAction, type KeyBindingDef, type KeyBindings, type ListProjectFilesOptions, type MarkdownSegment, type McpAuthEvent, McpAuthProvider, type McpAuthStateMap, type McpAuthStatus, type ModelInfo, type OAuthCredential, type OAuthFlowOptions, OUTPUT_RESERVE_TOKENS, type Owner, PLAN_AGENT, PLAN_MODE_DOCTRINE, PLAN_MODE_DOCTRINE_NO_PROMPTS, PRESENT_PLAN_TOOL, type ParsedBinding, type PendingInteractionEntry, type Picked, type PlanDecision, type PlanPayload, type PlanRequest, type PlanResponse, type PlanStep, type PreviewResult, type ProjectEntry, type ProjectUserPath, type ProjectsFile, type PromptSegment, type PromptSegmentRef, type ProviderAuth, type ProviderCredential, type ProviderDescriptor, type ProviderKey, type ProviderRegistry, type Question, type QuestionChoice, type QuestionPayload, type QuestionRequest, type QuestionResponse, type QuestionType, type RequestApproval, type ResolvedApproval, type ResolvedConfig, SETTINGS_CHOICES, SETTINGS_TOGGLES, SKILLS_TRIGGER, SUBAGENT_GUIDANCE, type SafeModeActions, SafeModeProvider, type Screen, type SelectQuestion, type SessionExportAnchor, type SessionExportFormat, type SessionExportTarget, type SessionMeta, type Settings, type SettingsChoice, SettingsProvider, type SettingsToggle, type StateStoreApi, type StreamBuffer, type StreamEvent, type StreamSource, type SyntaxStyles, type SyntaxTokenStyle, TODOREAD_TOOL, TODOS_METADATA_KEY, TODOWRITE_TOOL, TODO_STATUS_GLYPHS, TODO_WRITE_COUNTS_METADATA_KEY, TOKEN_DISCIPLINE_DOCTRINE, TOOL_DISPLAY, type TextQuestion, type Theme, type ThemeColors, ThemeProvider, type ThemeSelect, type ThemeSurfaces, type TodoItem, type TodoStatus, type TodoTally, type TodosBag, type ToolCallDisplay, type ToolDisplayMeta, type ToolFormatLine, type TranscriptItem, type TuiState, VAPORWAVE_THEME, type Walk, accentColor, addToSafelist, ageString, anthropicDescriptor, applyApiKeyEnv, applyEditPayload, applyInsert, blendHsl, bootProfileEnabled, bootTick, buildBuildSystem, buildContextualDiff, buildEditOutcomesAnnotation, buildLinearRamp, buildMcpServers, buildModelCatalog, buildPlanSystem, buildResumedToolResultsTurn, buildSkillsConfig, buildUnifiedDiff, cerebrasDescriptor, cleanTitle, clipHintsToWidth, collectReferences, compactPath, computeInlineDiff, computeLineDiff, computeTurnAnchors, countNeighbors, createDiscoverySlot, createFileMcpCredentialStore, createFilesCompletionProvider, createInteractionTools, createSkillsCompletionProvider, createStateStore, createTodoTools, credKeyOf, credentialsPath, defaultMcpsConfigPaths, defaultSkillScanPaths, deleteTurnSafely, deriveSessionTitle, detectAuth, discoverProjectMcps, discoverProjectSkills, displayNameFor, effectiveContextWindow, ensureKeybindingsFile, envSection, eventsFromTurns, extractEditPayload, filetypeFromPath, filterModelCatalog, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, findActiveTrigger, findGitRoot, fmtTokens, formatPathForCwd, formatToolCall, generateSessionTitle, getArchivedTodosForRun, getContextWindow, getMcpAuthStatus, getModelInfo, getSafelist, getTodosForRun, hintsLength, indexOfEntry, isEditErrorResult, isInteractionTool, isOnSafelist, isTodoTool, isTurnHighlighted, isVisible, keybindingsPath, lastContextSizeFromTurns, listProjectFiles, listSessionMeta, loadState, makeRequestInteraction, marginTopFor, maskToOutcomeKinds, matchesBinding, matchesSafelistEntry, mcpCredentialsPath, mergeKeybindings, mergeReferences, modelSupportsReasoning, modelsForDescriptor, openaiDescriptor, openrouterDescriptor, parseBindingSpec, parseEditOutcomesFromResult, parseMcpsFile, patchMcpCredential, pendingInteractionsFromTurns, piIdOf, pickActiveRunId, previewEditPayload, projectUserPaths, projectsFilePath, pruneTodosByRun, readCredentials, readKeybindings, readProjects, readProviderCredential, reduceMcpAuth, removeProviderCredential, renderSession, resolveAgentId, resolveApprovalForPayload, resolveChipColor, resolveConfig, resolveSessionExportTarget, resolveTheme, runOAuthLogin, saveState, selectActiveTodos, selectableTurnIds, serializeInteractionResponse, setProviderCredential, setTodosForRun, shortId, shouldAutoCompact, singleAgentRegistry, splitLines, splitMarkdownCodeBlocks, splitPromptSegments, stripJsonComments, stripSpawnTokensLine, suggestSafelistEntry, sumRunCosts, summarizeOutcomes, supportsOAuth, titleFromTurns, tokenize, toolCallPreview, toolResultText, truncateTrailing, truncateTurnsAt, tryOpenBrowser, turnAsText, turnContextSize, turnSelectionOwnership, uniqueFilesFromReferences, uniqueSkillNamesFromReferences, useActiveTodos, useColors, useCompletion, useConfig, useDiscovery, useDiscoveryOptional, useEnabledToggleSet, useInteractionsActions, useInteractionsQueue, useMcpAuthDispatch, useMcpAuthState, useSafeModeActions, useSafeModeQueue, useSelectStyle, useSettings, useStreamBuffer, useSurfaces, useSyntaxStyles, useTheme, writeCredentials, writeProjects, writeSessionExport };
1573
1877
  //# sourceMappingURL=chat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat.d.ts","names":[],"sources":["../src/chat/agent-prompt.ts","../src/chat/auto-compact.ts","../src/chat/boot-profiler.ts","../src/chat/browser.ts","../src/chat/color-gradient.ts","../src/chat/files-discovery.ts","../src/chat/completion-files.ts","../src/chat/completion-skills.ts","../src/chat/config-context.tsx","../src/chat/credentials.ts","../src/chat/discovery-context.tsx","../src/chat/discovery-slot.ts","../src/chat/edit-approval.ts","../src/tools/edit-utils.ts","../src/chat/edit-diff.ts","../src/chat/format.ts","../src/chat/generate-title.ts","../src/chat/mcp-auth-state.ts","../src/chat/mcp-auth-context.tsx","../src/chat/mcp-credentials.ts","../src/chat/model-catalog.ts","../src/chat/oauth.ts","../src/chat/path-display.ts","../src/chat/project-root.ts","../src/chat/project-user-paths.ts","../src/chat/safe-mode.ts","../src/chat/settings-context.tsx","../src/chat/skills-discovery.ts","../src/chat/streaming.ts","../src/chat/theme-context.tsx","../src/chat/themes/catppuccin.ts","../src/chat/themes/vaporwave.ts","../src/chat/turn-operations.ts"],"mappings":";;;;;;;;;;;;;;;;;;;AA6BA;;;;;AAOA;;;;;;;;cAPa,eAAA;AAAA,UAOI,iBAAA;EAuCD;;;;;AAoChB;EApEE,GAAA;;;;AAmFF;;;;;AAgBA;;EAxFE,WAAA;EAwFiC;EAtFjC,IAAA;EAqGW;EAnGX,QAAA;AAAA;;;AAiHF;;;;;AAgBA;;;;;AAsBA;;iBAtIgB,UAAA,CAAW,IAAA,EAAM,iBAAA;;;AAkJjC;;;;;AASA;cAvHa,oBAAA;;;;AA0Ib;;;;cA3Ha,yBAAA;;;;;;;AAgLb;cAhKa,sBAAA;;;;AAqLb;;;;cAtKa,0BAAA;;;;AC9Hb;;;;;;cD4Ia,iBAAA;;;;;AC3Gb;;cD2Ha,kBAAA;;;;;;;;cAsBA,oBAAA;ACnIb;;;;;;;AAAA,cD+Ia,+BAAA;;;;;AEnLb;;cF4La,6BAAA;AAAA,UAmBI,kBAAA;EE/MqB;EFiNpC,GAAA;EE7LgC;;;;;;;EFqMhC,WAAA;EGhP4B;EHkP5B,IAAA;EGlP6B;EHoP7B,QAAA;;;;AIpLF;;;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color-gradient.ts","../src/chat/files-discovery.ts","../src/chat/completion-files.ts","../src/chat/completion-skills.ts","../src/chat/config-context.tsx","../src/chat/credentials.ts","../src/chat/discovery-context.tsx","../src/chat/discovery-slot.ts","../src/chat/edit-approval.ts","../src/tools/edit-utils.ts","../src/chat/edit-diff.ts","../src/chat/format.ts","../src/chat/generate-title.ts","../src/chat/mcp-auth-state.ts","../src/chat/mcp-auth-context.tsx","../src/chat/mcp-credentials.ts","../src/chat/model-catalog.ts","../src/chat/oauth.ts","../src/chat/path-display.ts","../src/chat/project-root.ts","../src/chat/project-user-paths.ts","../src/chat/safe-mode.ts","../src/chat/settings-context.tsx","../src/chat/skills-discovery.ts","../src/chat/streaming.ts","../src/chat/theme-context.tsx","../src/chat/themes/catppuccin.ts","../src/chat/themes/vaporwave.ts","../src/chat/todos.ts","../src/chat/turn-operations.ts"],"mappings":";;;;;;;;;;;;;;;;;;;AA6BA;;;;;AAOA;;;;;;;;cAPa,eAAA;AAAA,UAOI,iBAAA;EAuCD;;;;;AAoChB;EApEE,GAAA;;;;AAmFF;;;;;AAgBA;;EAxFE,WAAA;EAwFiC;EAtFjC,IAAA;EAqGW;EAnGX,QAAA;AAAA;;;AAiHF;;;;;AAgBA;;;;;AAsBA;;iBAtIgB,UAAA,CAAW,IAAA,EAAM,iBAAA;;;AAkJjC;;;;;AASA;cAvHa,oBAAA;;;;AA0Ib;;;;cA3Ha,yBAAA;;;;;;;AAgLb;cAhKa,sBAAA;;;;AAqLb;;;;cAtKa,0BAAA;;;;AC9Hb;;;;;;cD4Ia,iBAAA;;;;;AC3Gb;;cD2Ha,kBAAA;;;;;;;;cAsBA,oBAAA;ACnIb;;;;;;;AAAA,cD+Ia,+BAAA;;;;;AEnLb;;cF4La,6BAAA;AAAA,UAmBI,kBAAA;EE/MqB;EFiNpC,GAAA;EE7LgC;;;;;;;EFqMhC,WAAA;EGhP4B;EHkP5B,IAAA;EGlP6B;EHoP7B,QAAA;;;;AIpLF;;;;;;;;;EJiME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BzB,iBAAA,CAAkB,OAAA,EAAS,OAAA,sBAA6B,gBAAA;;;;;AvB16BxE;;;;;AASA;;;;;AAYA;;iBuBi8BgB,cAAA,CAAe,OAAA,EAAS,OAAA,sBAA6B,gBAAA;;;;;AhCh+BrE;;;;;;;;;;AAuCA;;;;;iBiC1CgB,eAAA,CAAgB,KAAA,WAAgB,WAAA,IAAe,MAAA,WAAiB,WAAA;;;;;AjC6FhF;;;;;AAgBA;;;;;AAeA;;;iBiCnGgB,gBAAA,CAAiB,KAAA,WAAgB,WAAA,IAAe,MAAA,WAAiB,WAAA;;AjCiHjF;;;;;AAgBA;;iBiCzEgB,UAAA,CAAW,IAAA,EAAM,WAAA;;;AjC+FjC;;;iBiChEgB,cAAA,CACd,OAAA,qBACA,MAAA;EACG,MAAA;EAAgB,KAAA;AAAA"}
package/dist/chat.js CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as useMcpAuthDispatch, $n as bootTick, $t as isVisible, A as getSafelist, An as KEYBINDING_DEF_BY_ACTION, Ar as ACTIONS_WITH_CARE_DOCTRINE, B as supportsOAuth, Bn as uniqueSkillNamesFromReferences, Br as buildBuildSystem, Bt as CATPPUCCIN_MOCHA, C as resolveSessionExportTarget, Cn as maskToOutcomeKinds, Cr as BUILTIN_AGENTS, Ct as shortId, D as useSafeModeQueue, Dn as findGitRoot, Dr as accentColor, Dt as SETTINGS_CHOICES, E as useSafeModeActions, En as summarizeOutcomes, Er as PLAN_AGENT, Et as DEFAULT_SETTINGS, F as suggestSafelistEntry, Fn as parseBindingSpec, Fr as INTERACTION_GUIDANCE_NO_PROMPTS, Ft as resolveTheme, G as defaultMcpsConfigPaths, Gn as collectReferences, Gt as ConfigProvider, H as filterModelCatalog, Hn as createFilesCompletionProvider, Hr as envSection, Ht as DiscoveryProvider, I as writeProjects, In as readKeybindings, Ir as PLAN_MODE_DOCTRINE, It as VAPORWAVE_THEME, J as projectUserPaths, Jn as useCompletion, Jt as createStateStore, K as discoverProjectMcps, Kn as findActiveTrigger, Kt as useConfig, L as splitPromptSegments, Ln as stripJsonComments, Lr as PLAN_MODE_DOCTRINE_NO_PROMPTS, Lt as CATPPUCCIN_FRAPPE, M as matchesSafelistEntry, Mn as keybindingsPath, Mr as DOING_TASKS_DOCTRINE, Mt as BUILTIN_THEMES, N as projectsFilePath, Nn as matchesBinding, Nr as IDENTITY_PREFIX, Nt as DEFAULT_THEME, O as IMPLICITLY_SAFE_TOOLS, On as DEFAULT_KEYBINDINGS, Or as resolveAgentId, Ot as SETTINGS_TOGGLES, P as readProjects, Pn as mergeKeybindings, Pr as INTERACTION_GUIDANCE, Pt as resolveChipColor, Q as McpAuthProvider, Qn as bootProfileEnabled, Qt as isTurnHighlighted, R as formatPathForCwd, Rn as SKILLS_TRIGGER, Rr as SUBAGENT_GUIDANCE, Rt as CATPPUCCIN_LATTE, S as renderSession, Sn as buildEditOutcomesAnnotation, Sr as BUILD_AGENT, St as fmtTokens, T as SafeModeProvider, Tn as resolveApprovalForPayload, Tr as DEFAULT_PERSIST_EXCLUDE_TOOLS, Tt as useEnabledToggleSet, U as indexOfEntry, Un as uniqueFilesFromReferences, Ut as useDiscovery, V as buildModelCatalog, Vn as FILES_TRIGGER, Vr as buildPlanSystem, Vt as createDiscoverySlot, W as buildMcpServers, Wn as applyInsert, Wt as useDiscoveryOptional, X as mcpCredentialsPath, Xn as buildLinearRamp, Xt as eventsFromTurns, Y as createFileMcpCredentialStore, Yn as blendHsl, Yt as deriveSessionTitle, Z as patchMcpCredential, Zn as tryOpenBrowser, Zt as isEditErrorResult, _ as turnContextSize, _n as extractEditPayload, _r as modelSupportsReasoning, _t as truncateTrailing, a as computeTurnAnchors, an as selectableTurnIds, ar as readProviderCredential, at as InteractionsProvider, b as defaultSkillScanPaths, bn as splitLines, br as openrouterDescriptor, bt as ageString, c as formatToolCall, cn as titleFromTurns, cr as writeCredentials, ct as createInteractionTools, d as useSelectStyle, dn as turnSelectionOwnership, dr as anthropicDescriptor, dt as pendingInteractionsFromTurns, en as lastContextSizeFromTurns, er as shouldAutoCompact, et as useMcpAuthState, f as useSurfaces, fn as applyEditPayload, fr as cerebrasDescriptor, ft as serializeInteractionResponse, g as finalizeStreamingMarkdownForOwner, gn as computeLineDiff, gr as getModelInfo, gt as hintsLength, h as finalizeStreamingMarkdown, hn as computeInlineDiff, hr as getContextWindow, ht as clipHintsToWidth, i as turnAsText, in as saveState, ir as readCredentials, it as ASK_USER_TOOL, j as isOnSafelist, jn as ensureKeybindingsFile, jr as COMMUNICATION_DOCTRINE, jt as useSettings, k as addToSafelist, kn as KEYBINDING_DEFS, kr as singleAgentRegistry, kt as SettingsProvider, l as ThemeProvider, ln as toolCallPreview, lr as BUILTIN_PROVIDERS, lt as isInteractionTool, m as useTheme, mn as buildUnifiedDiff, mr as effectiveContextWindow, mt as useInteractionsQueue, n as deleteTurnSafely, nn as loadState, nr as applyApiKeyEnv, nt as reduceMcpAuth, o as TOOL_DISPLAY, on as stripSpawnTokensLine, or as removeProviderCredential, ot as PRESENT_PLAN_TOOL, p as useSyntaxStyles, pn as buildContextualDiff, pr as credKeyOf, pt as useInteractionsActions, q as parseMcpsFile, qn as mergeReferences, qt as resolveConfig, r as truncateTurnsAt, rn as marginTopFor, rr as credentialsPath, rt as splitMarkdownCodeBlocks, s as displayNameFor, sn as sumRunCosts, sr as setProviderCredential, st as buildResumedToolResultsTurn, t as countNeighbors, tn as listSessionMeta, tr as detectAuth, tt as getMcpAuthStatus, u as useColors, un as toolResultText, ur as OUTPUT_RESERVE_TOKENS, ut as makeRequestInteraction, v as useStreamBuffer, vn as filetypeFromPath, vr as modelsForDescriptor, vt as cleanTitle, w as writeSessionExport, wn as parseEditOutcomesFromResult, wr as DEFAULT_AGENT_ID, wt as listProjectFiles, x as discoverProjectSkills, xn as tokenize, xr as piIdOf, xt as compactPath, y as buildSkillsConfig, yn as previewEditPayload, yr as openaiDescriptor, yt as generateSessionTitle, z as runOAuthLogin, zn as createSkillsCompletionProvider, zr as TOKEN_DISCIPLINE_DOCTRINE, zt as CATPPUCCIN_MACCHIATO } from "./turn-operations-Y7e15gJf.js";
2
- export { ACTIONS_WITH_CARE_DOCTRINE, ASK_USER_TOOL, BUILD_AGENT, BUILTIN_AGENTS, BUILTIN_PROVIDERS, BUILTIN_THEMES, CATPPUCCIN_FRAPPE, CATPPUCCIN_LATTE, CATPPUCCIN_MACCHIATO, CATPPUCCIN_MOCHA, COMMUNICATION_DOCTRINE, ConfigProvider, DEFAULT_AGENT_ID, DEFAULT_KEYBINDINGS, DEFAULT_PERSIST_EXCLUDE_TOOLS, DEFAULT_SETTINGS, DEFAULT_THEME, DOING_TASKS_DOCTRINE, DiscoveryProvider, FILES_TRIGGER, IDENTITY_PREFIX, IMPLICITLY_SAFE_TOOLS, INTERACTION_GUIDANCE, INTERACTION_GUIDANCE_NO_PROMPTS, InteractionsProvider, KEYBINDING_DEFS, KEYBINDING_DEF_BY_ACTION, McpAuthProvider, OUTPUT_RESERVE_TOKENS, PLAN_AGENT, PLAN_MODE_DOCTRINE, PLAN_MODE_DOCTRINE_NO_PROMPTS, PRESENT_PLAN_TOOL, SETTINGS_CHOICES, SETTINGS_TOGGLES, SKILLS_TRIGGER, SUBAGENT_GUIDANCE, SafeModeProvider, SettingsProvider, TOKEN_DISCIPLINE_DOCTRINE, TOOL_DISPLAY, ThemeProvider, VAPORWAVE_THEME, accentColor, addToSafelist, ageString, anthropicDescriptor, applyApiKeyEnv, applyEditPayload, applyInsert, blendHsl, bootProfileEnabled, bootTick, buildBuildSystem, buildContextualDiff, buildEditOutcomesAnnotation, buildLinearRamp, buildMcpServers, buildModelCatalog, buildPlanSystem, buildResumedToolResultsTurn, buildSkillsConfig, buildUnifiedDiff, cerebrasDescriptor, cleanTitle, clipHintsToWidth, collectReferences, compactPath, computeInlineDiff, computeLineDiff, computeTurnAnchors, countNeighbors, createDiscoverySlot, createFileMcpCredentialStore, createFilesCompletionProvider, createInteractionTools, createSkillsCompletionProvider, createStateStore, credKeyOf, credentialsPath, defaultMcpsConfigPaths, defaultSkillScanPaths, deleteTurnSafely, deriveSessionTitle, detectAuth, discoverProjectMcps, discoverProjectSkills, displayNameFor, effectiveContextWindow, ensureKeybindingsFile, envSection, eventsFromTurns, extractEditPayload, filetypeFromPath, filterModelCatalog, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, findActiveTrigger, findGitRoot, fmtTokens, formatPathForCwd, formatToolCall, generateSessionTitle, getContextWindow, getMcpAuthStatus, getModelInfo, getSafelist, hintsLength, indexOfEntry, isEditErrorResult, isInteractionTool, isOnSafelist, isTurnHighlighted, isVisible, keybindingsPath, lastContextSizeFromTurns, listProjectFiles, listSessionMeta, loadState, makeRequestInteraction, marginTopFor, maskToOutcomeKinds, matchesBinding, matchesSafelistEntry, mcpCredentialsPath, mergeKeybindings, mergeReferences, modelSupportsReasoning, modelsForDescriptor, openaiDescriptor, openrouterDescriptor, parseBindingSpec, parseEditOutcomesFromResult, parseMcpsFile, patchMcpCredential, pendingInteractionsFromTurns, piIdOf, previewEditPayload, projectUserPaths, projectsFilePath, readCredentials, readKeybindings, readProjects, readProviderCredential, reduceMcpAuth, removeProviderCredential, renderSession, resolveAgentId, resolveApprovalForPayload, resolveChipColor, resolveConfig, resolveSessionExportTarget, resolveTheme, runOAuthLogin, saveState, selectableTurnIds, serializeInteractionResponse, setProviderCredential, shortId, shouldAutoCompact, singleAgentRegistry, splitLines, splitMarkdownCodeBlocks, splitPromptSegments, stripJsonComments, stripSpawnTokensLine, suggestSafelistEntry, sumRunCosts, summarizeOutcomes, supportsOAuth, titleFromTurns, tokenize, toolCallPreview, toolResultText, truncateTrailing, truncateTurnsAt, tryOpenBrowser, turnAsText, turnContextSize, turnSelectionOwnership, uniqueFilesFromReferences, uniqueSkillNamesFromReferences, useColors, useCompletion, useConfig, useDiscovery, useDiscoveryOptional, useEnabledToggleSet, useInteractionsActions, useInteractionsQueue, useMcpAuthDispatch, useMcpAuthState, useSafeModeActions, useSafeModeQueue, useSelectStyle, useSettings, useStreamBuffer, useSurfaces, useSyntaxStyles, useTheme, writeCredentials, writeProjects, writeSessionExport };
1
+ import { $ as useMcpAuthDispatch, $n as bootTick, $r as TOKEN_DISCIPLINE_DOCTRINE, $t as isVisible, A as getSafelist, An as KEYBINDING_DEF_BY_ACTION, Ar as TODOREAD_TOOL, B as supportsOAuth, Bn as uniqueSkillNamesFromReferences, Br as pruneTodosByRun, Bt as CATPPUCCIN_MOCHA, C as resolveSessionExportTarget, Cn as maskToOutcomeKinds, Cr as BUILTIN_AGENTS, Ct as shortId, D as useSafeModeQueue, Dn as findGitRoot, Dr as accentColor, Dt as SETTINGS_CHOICES, E as useSafeModeActions, En as summarizeOutcomes, Er as PLAN_AGENT, Et as DEFAULT_SETTINGS, F as suggestSafelistEntry, Fn as parseBindingSpec, Fr as createTodoTools, Ft as resolveTheme, G as defaultMcpsConfigPaths, Gn as collectReferences, Gr as COMMUNICATION_DOCTRINE, Gt as ConfigProvider, H as filterModelCatalog, Hn as createFilesCompletionProvider, Hr as setTodosForRun, Ht as DiscoveryProvider, I as writeProjects, In as readKeybindings, Ir as getArchivedTodosForRun, It as VAPORWAVE_THEME, J as projectUserPaths, Jn as useCompletion, Jr as INTERACTION_GUIDANCE, Jt as createStateStore, K as discoverProjectMcps, Kn as findActiveTrigger, Kr as DOING_TASKS_DOCTRINE, Kt as useConfig, L as splitPromptSegments, Ln as stripJsonComments, Lr as getTodosForRun, Lt as CATPPUCCIN_FRAPPE, M as matchesSafelistEntry, Mn as keybindingsPath, Mr as TODOWRITE_TOOL, Mt as BUILTIN_THEMES, N as projectsFilePath, Nn as matchesBinding, Nr as TODO_STATUS_GLYPHS, Nt as DEFAULT_THEME, O as IMPLICITLY_SAFE_TOOLS, On as DEFAULT_KEYBINDINGS, Or as resolveAgentId, Ot as SETTINGS_TOGGLES, P as readProjects, Pn as mergeKeybindings, Pr as TODO_WRITE_COUNTS_METADATA_KEY, Pt as resolveChipColor, Q as McpAuthProvider, Qn as bootProfileEnabled, Qr as SUBAGENT_GUIDANCE, Qt as isTurnHighlighted, R as formatPathForCwd, Rn as SKILLS_TRIGGER, Rr as isTodoTool, Rt as CATPPUCCIN_LATTE, S as renderSession, Sn as buildEditOutcomesAnnotation, Sr as BUILD_AGENT, St as fmtTokens, T as SafeModeProvider, Tn as resolveApprovalForPayload, Tr as DEFAULT_PERSIST_EXCLUDE_TOOLS, Tt as useEnabledToggleSet, U as indexOfEntry, Un as uniqueFilesFromReferences, Ur as useActiveTodos, Ut as useDiscovery, V as buildModelCatalog, Vn as FILES_TRIGGER, Vr as selectActiveTodos, Vt as createDiscoverySlot, W as buildMcpServers, Wn as applyInsert, Wr as ACTIONS_WITH_CARE_DOCTRINE, Wt as useDiscoveryOptional, X as mcpCredentialsPath, Xn as buildLinearRamp, Xr as PLAN_MODE_DOCTRINE, Xt as eventsFromTurns, Y as createFileMcpCredentialStore, Yn as blendHsl, Yr as INTERACTION_GUIDANCE_NO_PROMPTS, Yt as deriveSessionTitle, Z as patchMcpCredential, Zn as tryOpenBrowser, Zr as PLAN_MODE_DOCTRINE_NO_PROMPTS, Zt as isEditErrorResult, _ as turnContextSize, _n as extractEditPayload, _r as modelSupportsReasoning, _t as truncateTrailing, a as computeTurnAnchors, an as selectableTurnIds, ar as readProviderCredential, at as InteractionsProvider, b as defaultSkillScanPaths, bn as splitLines, br as openrouterDescriptor, bt as ageString, c as formatToolCall, cn as titleFromTurns, cr as writeCredentials, ct as createInteractionTools, d as useSelectStyle, dn as turnSelectionOwnership, dr as anthropicDescriptor, dt as pendingInteractionsFromTurns, ei as buildBuildSystem, en as lastContextSizeFromTurns, er as shouldAutoCompact, et as useMcpAuthState, f as useSurfaces, fn as applyEditPayload, fr as cerebrasDescriptor, ft as serializeInteractionResponse, g as finalizeStreamingMarkdownForOwner, gn as computeLineDiff, gr as getModelInfo, gt as hintsLength, h as finalizeStreamingMarkdown, hn as computeInlineDiff, hr as getContextWindow, ht as clipHintsToWidth, i as turnAsText, in as saveState, ir as readCredentials, it as ASK_USER_TOOL, j as isOnSafelist, jn as ensureKeybindingsFile, jr as TODOS_METADATA_KEY, jt as useSettings, k as addToSafelist, kn as KEYBINDING_DEFS, kr as singleAgentRegistry, kt as SettingsProvider, l as ThemeProvider, ln as toolCallPreview, lr as BUILTIN_PROVIDERS, lt as isInteractionTool, m as useTheme, mn as buildUnifiedDiff, mr as effectiveContextWindow, mt as useInteractionsQueue, n as deleteTurnSafely, ni as envSection, nn as loadState, nr as applyApiKeyEnv, nt as reduceMcpAuth, o as TOOL_DISPLAY, on as stripSpawnTokensLine, or as removeProviderCredential, ot as PRESENT_PLAN_TOOL, p as useSyntaxStyles, pn as buildContextualDiff, pr as credKeyOf, pt as useInteractionsActions, q as parseMcpsFile, qn as mergeReferences, qr as IDENTITY_PREFIX, qt as resolveConfig, r as truncateTurnsAt, rn as marginTopFor, rr as credentialsPath, rt as splitMarkdownCodeBlocks, s as displayNameFor, sn as sumRunCosts, sr as setProviderCredential, st as buildResumedToolResultsTurn, t as countNeighbors, ti as buildPlanSystem, tn as listSessionMeta, tr as detectAuth, tt as getMcpAuthStatus, u as useColors, un as toolResultText, ur as OUTPUT_RESERVE_TOKENS, ut as makeRequestInteraction, v as useStreamBuffer, vn as filetypeFromPath, vr as modelsForDescriptor, vt as cleanTitle, w as writeSessionExport, wn as parseEditOutcomesFromResult, wr as DEFAULT_AGENT_ID, wt as listProjectFiles, x as discoverProjectSkills, xn as tokenize, xr as piIdOf, xt as compactPath, y as buildSkillsConfig, yn as previewEditPayload, yr as openaiDescriptor, yt as generateSessionTitle, z as runOAuthLogin, zn as createSkillsCompletionProvider, zr as pickActiveRunId, zt as CATPPUCCIN_MACCHIATO } from "./turn-operations-D9HvatsR.js";
2
+ export { ACTIONS_WITH_CARE_DOCTRINE, ASK_USER_TOOL, BUILD_AGENT, BUILTIN_AGENTS, BUILTIN_PROVIDERS, BUILTIN_THEMES, CATPPUCCIN_FRAPPE, CATPPUCCIN_LATTE, CATPPUCCIN_MACCHIATO, CATPPUCCIN_MOCHA, COMMUNICATION_DOCTRINE, ConfigProvider, DEFAULT_AGENT_ID, DEFAULT_KEYBINDINGS, DEFAULT_PERSIST_EXCLUDE_TOOLS, DEFAULT_SETTINGS, DEFAULT_THEME, DOING_TASKS_DOCTRINE, DiscoveryProvider, FILES_TRIGGER, IDENTITY_PREFIX, IMPLICITLY_SAFE_TOOLS, INTERACTION_GUIDANCE, INTERACTION_GUIDANCE_NO_PROMPTS, InteractionsProvider, KEYBINDING_DEFS, KEYBINDING_DEF_BY_ACTION, McpAuthProvider, OUTPUT_RESERVE_TOKENS, PLAN_AGENT, PLAN_MODE_DOCTRINE, PLAN_MODE_DOCTRINE_NO_PROMPTS, PRESENT_PLAN_TOOL, SETTINGS_CHOICES, SETTINGS_TOGGLES, SKILLS_TRIGGER, SUBAGENT_GUIDANCE, SafeModeProvider, SettingsProvider, TODOREAD_TOOL, TODOS_METADATA_KEY, TODOWRITE_TOOL, TODO_STATUS_GLYPHS, TODO_WRITE_COUNTS_METADATA_KEY, TOKEN_DISCIPLINE_DOCTRINE, TOOL_DISPLAY, ThemeProvider, VAPORWAVE_THEME, accentColor, addToSafelist, ageString, anthropicDescriptor, applyApiKeyEnv, applyEditPayload, applyInsert, blendHsl, bootProfileEnabled, bootTick, buildBuildSystem, buildContextualDiff, buildEditOutcomesAnnotation, buildLinearRamp, buildMcpServers, buildModelCatalog, buildPlanSystem, buildResumedToolResultsTurn, buildSkillsConfig, buildUnifiedDiff, cerebrasDescriptor, cleanTitle, clipHintsToWidth, collectReferences, compactPath, computeInlineDiff, computeLineDiff, computeTurnAnchors, countNeighbors, createDiscoverySlot, createFileMcpCredentialStore, createFilesCompletionProvider, createInteractionTools, createSkillsCompletionProvider, createStateStore, createTodoTools, credKeyOf, credentialsPath, defaultMcpsConfigPaths, defaultSkillScanPaths, deleteTurnSafely, deriveSessionTitle, detectAuth, discoverProjectMcps, discoverProjectSkills, displayNameFor, effectiveContextWindow, ensureKeybindingsFile, envSection, eventsFromTurns, extractEditPayload, filetypeFromPath, filterModelCatalog, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, findActiveTrigger, findGitRoot, fmtTokens, formatPathForCwd, formatToolCall, generateSessionTitle, getArchivedTodosForRun, getContextWindow, getMcpAuthStatus, getModelInfo, getSafelist, getTodosForRun, hintsLength, indexOfEntry, isEditErrorResult, isInteractionTool, isOnSafelist, isTodoTool, isTurnHighlighted, isVisible, keybindingsPath, lastContextSizeFromTurns, listProjectFiles, listSessionMeta, loadState, makeRequestInteraction, marginTopFor, maskToOutcomeKinds, matchesBinding, matchesSafelistEntry, mcpCredentialsPath, mergeKeybindings, mergeReferences, modelSupportsReasoning, modelsForDescriptor, openaiDescriptor, openrouterDescriptor, parseBindingSpec, parseEditOutcomesFromResult, parseMcpsFile, patchMcpCredential, pendingInteractionsFromTurns, piIdOf, pickActiveRunId, previewEditPayload, projectUserPaths, projectsFilePath, pruneTodosByRun, readCredentials, readKeybindings, readProjects, readProviderCredential, reduceMcpAuth, removeProviderCredential, renderSession, resolveAgentId, resolveApprovalForPayload, resolveChipColor, resolveConfig, resolveSessionExportTarget, resolveTheme, runOAuthLogin, saveState, selectActiveTodos, selectableTurnIds, serializeInteractionResponse, setProviderCredential, setTodosForRun, shortId, shouldAutoCompact, singleAgentRegistry, splitLines, splitMarkdownCodeBlocks, splitPromptSegments, stripJsonComments, stripSpawnTokensLine, suggestSafelistEntry, sumRunCosts, summarizeOutcomes, supportsOAuth, titleFromTurns, tokenize, toolCallPreview, toolResultText, truncateTrailing, truncateTurnsAt, tryOpenBrowser, turnAsText, turnContextSize, turnSelectionOwnership, uniqueFilesFromReferences, uniqueSkillNamesFromReferences, useActiveTodos, useColors, useCompletion, useConfig, useDiscovery, useDiscoveryOptional, useEnabledToggleSet, useInteractionsActions, useInteractionsQueue, useMcpAuthDispatch, useMcpAuthState, useSafeModeActions, useSafeModeQueue, useSelectStyle, useSettings, useStreamBuffer, useSurfaces, useSyntaxStyles, useTheme, writeCredentials, writeProjects, writeSessionExport };
@@ -47,6 +47,41 @@ var AgentAbortedError = class extends Error {
47
47
  }
48
48
  };
49
49
  /**
50
+ * Thrown by the pre-send pairing repair when {@link AgentBehavior.strictToolPairing}
51
+ * is `true` and {@link ensureToolResultPairing} would otherwise patch over
52
+ * corruption. Strict mode opts into fail-fast for training-data collectors and
53
+ * any consumer that prefers to bail out rather than ship a transcript carrying
54
+ * a {@link SYNTHETIC_TOOL_RESULT_PLACEHOLDER}.
55
+ *
56
+ * The `repairs` field carries every repair the loop would have made — useful
57
+ * for postmortems and for surfacing exactly which transcripts were rejected.
58
+ *
59
+ * Note: callers consuming the chat layer (TUI/SDK presets) typically leave
60
+ * `strictToolPairing` off so user-facing sessions auto-heal instead of
61
+ * crashing.
62
+ */
63
+ var AgentToolPairingError = class extends Error {
64
+ code = "tool_pairing_corruption";
65
+ /** Provider whose wire format the corruption would have hit. */
66
+ provider;
67
+ /** Upstream error code when the corruption was detected from a 400 response. */
68
+ providerCode;
69
+ /**
70
+ * Repairs the harness would have performed had strict mode been off.
71
+ * Preserves the full diagnostic so consumers can route to telemetry,
72
+ * `/rewind` flows, or training-data quarantine without re-walking the
73
+ * transcript.
74
+ */
75
+ repairs;
76
+ constructor(options) {
77
+ super(options.message, options.cause !== void 0 ? { cause: options.cause } : void 0);
78
+ this.name = "AgentToolPairingError";
79
+ this.provider = options.provider;
80
+ this.providerCode = options.providerCode;
81
+ this.repairs = options.repairs;
82
+ }
83
+ };
84
+ /**
50
85
  * Thrown (well — constructed; attach via the `tool:gate` block signal) when the
51
86
  * union of `allowed-tools` across active skills does not permit a tool call.
52
87
  *
@@ -115,6 +150,13 @@ function toTypedError(classification, provider, cause) {
115
150
  cause
116
151
  });
117
152
  if (classification.kind === "aborted") return new AgentAbortedError(message, { cause });
153
+ if (classification.kind === "tool_pairing_corruption") return new AgentToolPairingError({
154
+ message,
155
+ provider,
156
+ providerCode: classification.providerCode,
157
+ repairs: [],
158
+ cause
159
+ });
118
160
  return new AgentProviderError(message, {
119
161
  provider,
120
162
  providerCode: classification.providerCode,
@@ -123,6 +165,6 @@ function toTypedError(classification, provider, cause) {
123
165
  });
124
166
  }
125
167
  //#endregion
126
- export { CONTEXT_EXCEEDED_MESSAGE_PATTERNS as a, toTypedError as c, AgentToolNotAllowedError as i, AgentContextExceededError as n, errorMessage as o, AgentProviderError as r, matchesContextExceeded as s, AgentAbortedError as t };
168
+ export { AgentToolPairingError as a, matchesContextExceeded as c, AgentToolNotAllowedError as i, toTypedError as l, AgentContextExceededError as n, CONTEXT_EXCEEDED_MESSAGE_PATTERNS as o, AgentProviderError as r, errorMessage as s, AgentAbortedError as t };
127
169
 
128
- //# sourceMappingURL=errors-COmsomd5.js.map
170
+ //# sourceMappingURL=errors-Byb0F8B9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-Byb0F8B9.js","names":[],"sources":["../src/errors.ts"],"sourcesContent":["/**\n * Typed error classes for agent runs.\n *\n * Providers classify native errors into one of these so downstream consumers\n * can react without string-sniffing messages.\n *\n * Provider authors: implement `Provider.classifyError` to map native errors\n * (SDK exceptions, HTTP responses) to a `ClassifiedError`. The loop wraps\n * unclassified errors in `AgentProviderError` automatically.\n */\n\n/** Kind of classified provider error */\nexport type ClassifiedErrorKind = 'context_exceeded' | 'provider_error' | 'aborted' | 'tool_pairing_corruption'\n\n/** Structured classification returned by `Provider.classifyError` */\nexport interface ClassifiedError {\n kind: ClassifiedErrorKind\n /** Upstream error code as surfaced by the provider (e.g. `context_length_exceeded`). Optional. */\n providerCode?: string\n /** Optional human-readable message override. Falls back to the underlying error's message. */\n message?: string\n /**\n * Hint that the error is transient and a retry with backoff is reasonable\n * (e.g. 429, 5xx, truncated stream). Omitted when the provider can't decide;\n * callers should default to \"do not retry\" when absent to avoid hammering\n * terminal failures (auth, invalid request).\n */\n retryable?: boolean\n}\n\ninterface TypedErrorOptions {\n /** Provider name, always set (e.g. `anthropic`, `openrouter`) */\n provider: string\n /** Optional upstream error code */\n providerCode?: string\n /** Original error from the provider SDK/HTTP layer */\n cause?: unknown\n /** See {@link ClassifiedError.retryable}. */\n retryable?: boolean\n}\n\n/**\n * Thrown when the model or provider signals that the context window was exceeded.\n * Downstream consumers should catch this, prune history, and retry.\n */\nexport class AgentContextExceededError extends Error {\n readonly code = 'context_exceeded' as const\n readonly provider: string\n readonly providerCode?: string\n\n constructor(message: string, options: TypedErrorOptions) {\n super(message, options.cause !== undefined ? { cause: options.cause } : undefined)\n this.name = 'AgentContextExceededError'\n this.provider = options.provider\n this.providerCode = options.providerCode\n }\n}\n\n/**\n * Thrown when the provider returns a non-context error (auth, rate limit, server error, etc.).\n * Catch-all for unclassified provider failures.\n */\nexport class AgentProviderError extends Error {\n readonly code = 'provider_error' as const\n readonly provider: string\n readonly providerCode?: string\n /**\n * Whether a retry with backoff is likely to succeed. See\n * {@link ClassifiedError.retryable}. Absent when the provider did not\n * classify the error — callers should treat absent as \"don't retry\".\n */\n readonly retryable?: boolean\n\n constructor(message: string, options: TypedErrorOptions) {\n super(message, options.cause !== undefined ? { cause: options.cause } : undefined)\n this.name = 'AgentProviderError'\n this.provider = options.provider\n this.providerCode = options.providerCode\n this.retryable = options.retryable\n }\n}\n\n/**\n * Thrown when a run is aborted by the consumer via `agent.abort()` or an external `AbortSignal`.\n */\nexport class AgentAbortedError extends Error {\n readonly code = 'aborted' as const\n\n constructor(message = 'Agent run aborted', options?: { cause?: unknown }) {\n super(message, options?.cause !== undefined ? { cause: options.cause } : undefined)\n this.name = 'AgentAbortedError'\n }\n}\n\n/**\n * Thrown by the pre-send pairing repair when {@link AgentBehavior.strictToolPairing}\n * is `true` and {@link ensureToolResultPairing} would otherwise patch over\n * corruption. Strict mode opts into fail-fast for training-data collectors and\n * any consumer that prefers to bail out rather than ship a transcript carrying\n * a {@link SYNTHETIC_TOOL_RESULT_PLACEHOLDER}.\n *\n * The `repairs` field carries every repair the loop would have made — useful\n * for postmortems and for surfacing exactly which transcripts were rejected.\n *\n * Note: callers consuming the chat layer (TUI/SDK presets) typically leave\n * `strictToolPairing` off so user-facing sessions auto-heal instead of\n * crashing.\n */\nexport class AgentToolPairingError extends Error {\n readonly code = 'tool_pairing_corruption' as const\n /** Provider whose wire format the corruption would have hit. */\n readonly provider?: string\n /** Upstream error code when the corruption was detected from a 400 response. */\n readonly providerCode?: string\n /**\n * Repairs the harness would have performed had strict mode been off.\n * Preserves the full diagnostic so consumers can route to telemetry,\n * `/rewind` flows, or training-data quarantine without re-walking the\n * transcript.\n */\n readonly repairs: ReadonlyArray<{\n mode: string\n callId?: string\n messageIndex: number\n }>\n\n constructor(options: {\n message: string\n provider?: string\n providerCode?: string\n repairs: ReadonlyArray<{ mode: string, callId?: string, messageIndex: number }>\n cause?: unknown\n }) {\n super(options.message, options.cause !== undefined ? { cause: options.cause } : undefined)\n this.name = 'AgentToolPairingError'\n this.provider = options.provider\n this.providerCode = options.providerCode\n this.repairs = options.repairs\n }\n}\n\n/**\n * Thrown (well — constructed; attach via the `tool:gate` block signal) when the\n * union of `allowed-tools` across active skills does not permit a tool call.\n *\n * Produced by the allowed-tools middleware registered on `tool:gate` /\n * `mcp:tool:gate`. The gate's `block = true` + `reason` carry the same message\n * so consumers that don't look at this typed error still get a useful string.\n */\nexport class AgentToolNotAllowedError extends Error {\n readonly code = 'tool_not_allowed' as const\n /** Canonical tool name the agent tried to call. */\n readonly toolName: string\n /** Aliased / wire name the LLM saw. */\n readonly displayName: string\n /** Flattened union of `allowedTools` patterns across active skills. */\n readonly allowedUnion: readonly string[]\n /** Names of the skills currently active when the block fired. */\n readonly activeSkills: readonly string[]\n\n constructor(options: {\n toolName: string\n displayName: string\n allowedUnion: readonly string[]\n activeSkills: readonly string[]\n cause?: unknown\n }) {\n const msg = (\n `Tool \"${options.displayName}\" is not in the allowed-tools union of the active `\n + `skill(s) [${options.activeSkills.join(', ')}]. Union: [${options.allowedUnion.join(' ')}].`\n )\n super(msg, options.cause !== undefined ? { cause: options.cause } : undefined)\n this.name = 'AgentToolNotAllowedError'\n this.toolName = options.toolName\n this.displayName = options.displayName\n this.allowedUnion = options.allowedUnion\n this.activeSkills = options.activeSkills\n }\n}\n\n/**\n * Regex patterns matching common \"context window exceeded\" messages across providers.\n *\n * Use {@link matchesContextExceeded} to test a free-form error message against them.\n * Provider authors can also compose these into their own `classifyError` fallbacks.\n */\nexport const CONTEXT_EXCEEDED_MESSAGE_PATTERNS: readonly RegExp[] = [\n /context[_\\s]length[_\\s]exceeded/i,\n /maximum context length/i,\n /prompt is too long/i,\n /context window/i,\n]\n\n/**\n * Return true when `message` matches any of the known \"context window exceeded\"\n * phrasings. Safe for `''` / non-strings (returns false).\n */\nexport function matchesContextExceeded(message: unknown): boolean {\n if (typeof message !== 'string' || message.length === 0)\n return false\n return CONTEXT_EXCEEDED_MESSAGE_PATTERNS.some(re => re.test(message))\n}\n\n/**\n * Extract a printable message from an unknown thrown value.\n *\n * Standardizes the `err instanceof Error ? err.message : String(err)` idiom\n * that every `catch (err)` block was reaching for.\n */\nexport function errorMessage(err: unknown): string {\n if (err instanceof Error)\n return err.message\n return String(err)\n}\n\n/**\n * Convert a `ClassifiedError` + underlying cause into the matching typed error instance.\n */\nexport function toTypedError(\n classification: ClassifiedError,\n provider: string,\n cause: unknown,\n): AgentContextExceededError | AgentProviderError | AgentAbortedError | AgentToolPairingError {\n const message = classification.message ?? errorMessage(cause)\n\n if (classification.kind === 'context_exceeded') {\n return new AgentContextExceededError(message, {\n provider,\n providerCode: classification.providerCode,\n cause,\n })\n }\n\n if (classification.kind === 'aborted') {\n return new AgentAbortedError(message, { cause })\n }\n\n if (classification.kind === 'tool_pairing_corruption') {\n return new AgentToolPairingError({\n message,\n provider,\n providerCode: classification.providerCode,\n // Server-side rejection: we don't have the structured repair list a\n // local-pre-send strict-mode throw would carry. Surface an empty\n // array so consumers branching on `repairs.length` see \"the harness\n // didn't get a chance to walk the transcript\".\n repairs: [],\n cause,\n })\n }\n\n return new AgentProviderError(message, {\n provider,\n providerCode: classification.providerCode,\n retryable: classification.ret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