zidane 7.1.8 → 7.1.10
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.
- package/dist/{acp-BxRfclPQ.js → acp-Bt-eb5Z8.js} +2 -2
- package/dist/{acp-BxRfclPQ.js.map → acp-Bt-eb5Z8.js.map} +1 -1
- package/dist/acp-cli.js +3 -3
- package/dist/acp.d.ts +1 -1
- package/dist/acp.js +1 -1
- package/dist/{agent-CJbmpTmA.js → agent-B6etKd_o.js} +44 -10
- package/dist/agent-B6etKd_o.js.map +1 -0
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/{approvals-DMxUgyVd.js → approvals-CIKGWmiU.js} +6 -6
- package/dist/{approvals-DMxUgyVd.js.map → approvals-CIKGWmiU.js.map} +1 -1
- package/dist/{auth-DvMdkpGD.js → auth-CDDNbEmd.js} +2 -2
- package/dist/{auth-DvMdkpGD.js.map → auth-CDDNbEmd.js.map} +1 -1
- package/dist/{cache-telemetry-ehVdWsg2.js → cache-telemetry-D0xemhgK.js} +2 -2
- package/dist/{cache-telemetry-ehVdWsg2.js.map → cache-telemetry-D0xemhgK.js.map} +1 -1
- package/dist/chat/pure.d.ts +57 -4
- package/dist/chat/pure.d.ts.map +1 -1
- package/dist/chat/pure.js +4 -4
- package/dist/chat.d.ts +5 -5
- package/dist/chat.js +5 -5
- package/dist/contexts/daytona.d.ts +1 -1
- package/dist/contexts/e2b.d.ts +1 -1
- package/dist/daemon-cli.js +1 -1
- package/dist/eval.d.ts +1 -1
- package/dist/extensions.d.ts +2 -2
- package/dist/extensions.js +3 -2
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/{index-BMOl2Bog.d.ts → index-C45NxBZm.d.ts} +5 -5
- package/dist/{index-BMOl2Bog.d.ts.map → index-C45NxBZm.d.ts.map} +1 -1
- package/dist/{index-DCYh6lOp.d.ts → index-dXnPmqFx.d.ts} +129 -17
- package/dist/index-dXnPmqFx.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{ipc-BqEflvqC.js → ipc-CNRlwg7u.js} +2 -2
- package/dist/{ipc-BqEflvqC.js.map → ipc-CNRlwg7u.js.map} +1 -1
- package/dist/ipc.d.ts +5 -5
- package/dist/ipc.js +3 -3
- package/dist/mcp.d.ts +1 -1
- package/dist/output/stream-json.d.ts +1 -1
- package/dist/output/terminal.d.ts +1 -1
- package/dist/{cred-keys-BbbBr4q3.js → panels-B6gRk4bf.js} +174 -2
- package/dist/panels-B6gRk4bf.js.map +1 -0
- package/dist/plugins.d.ts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +1 -1
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/arcee.d.ts +1 -1
- package/dist/providers/baseten.d.ts +1 -1
- package/dist/providers/cerebras.d.ts +1 -1
- package/dist/providers/local.d.ts +1 -1
- package/dist/providers/openai-compat.d.ts +1 -1
- package/dist/providers/openai.d.ts +1 -1
- package/dist/providers/openrouter.d.ts +1 -1
- package/dist/providers/xai.d.ts +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/restate.d.ts +1 -1
- package/dist/restate.js +1 -1
- package/dist/session/sqlite.d.ts +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/{shell-path-DeSQjoHJ.js → shell-path-Db04cLEP.js} +6 -6
- package/dist/{shell-path-DeSQjoHJ.js.map → shell-path-Db04cLEP.js.map} +1 -1
- package/dist/skills.d.ts +1 -1
- package/dist/{todo-edits-Dw2oO2ON.js → todo-edits-PxMJvYIX.js} +91 -2
- package/dist/todo-edits-PxMJvYIX.js.map +1 -0
- package/dist/{tool-formatters-BDm0tjgy.d.ts → tool-formatters-Bl1afA8N.d.ts} +2 -2
- package/dist/{tool-formatters-BDm0tjgy.d.ts.map → tool-formatters-Bl1afA8N.d.ts.map} +1 -1
- package/dist/tools/fetch-url.d.ts +1 -1
- package/dist/tools/web-search.d.ts +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +1 -1
- package/dist/{transcript-anchors-DjcEsOYq.d.ts → transcript-anchors-BfI3ZXh1.d.ts} +3 -3
- package/dist/transcript-anchors-BfI3ZXh1.d.ts.map +1 -0
- package/dist/tui.d.ts +3 -3
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +425 -67
- package/dist/tui.js.map +1 -1
- package/dist/{turn-operations-Rqk3E0Ue.d.ts → turn-operations-D0x_g6XQ.d.ts} +14 -8
- package/dist/turn-operations-D0x_g6XQ.d.ts.map +1 -0
- package/dist/{turn-operations-JynC5ODZ.js → turn-operations-D_k_FEur.js} +21 -10
- package/dist/{turn-operations-JynC5ODZ.js.map → turn-operations-D_k_FEur.js.map} +1 -1
- package/dist/types.d.ts +1 -1
- package/docs/EXTENSIONS.md +27 -6
- package/docs/PANELS.md +86 -0
- package/docs/README.md +2 -0
- package/package.json +1 -1
- package/dist/agent-CJbmpTmA.js.map +0 -1
- package/dist/cred-keys-BbbBr4q3.js.map +0 -1
- package/dist/index-DCYh6lOp.d.ts.map +0 -1
- package/dist/todo-edits-Dw2oO2ON.js.map +0 -1
- package/dist/transcript-anchors-DjcEsOYq.d.ts.map +0 -1
- package/dist/turn-operations-Rqk3E0Ue.d.ts.map +0 -1
|
@@ -139,7 +139,7 @@ function diffCacheDimensions(prev, curr) {
|
|
|
139
139
|
const divergentAt = firstDivergentIndex(prev.messageHashes, curr.messageHashes);
|
|
140
140
|
if (divergentAt >= 0) {
|
|
141
141
|
changed.push("messagePrefix");
|
|
142
|
-
details.messagePrefix = `message
|
|
142
|
+
details.messagePrefix = `message ${divergentAt} of ${prev.messageCount}→${curr.messageCount} rewritten\nlikely compaction or history trimming`;
|
|
143
143
|
}
|
|
144
144
|
return {
|
|
145
145
|
changed,
|
|
@@ -277,4 +277,4 @@ function formatVerboseLine(input) {
|
|
|
277
277
|
//#endregion
|
|
278
278
|
export { snapshotCacheDimensions as a, installCacheBreakLogger as i, fnv1a32 as n, hashMessages as r, diffCacheDimensions as t };
|
|
279
279
|
|
|
280
|
-
//# sourceMappingURL=cache-telemetry-
|
|
280
|
+
//# sourceMappingURL=cache-telemetry-D0xemhgK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-telemetry-ehVdWsg2.js","names":[],"sources":["../src/cache-telemetry.ts"],"sourcesContent":["/**\n * Per-dimension cache-break detection.\n *\n * The agent surfaces `cacheRead` / `cacheCreation` in {@link TurnUsage}, but\n * doesn't answer the load-bearing diagnostic question: *which* dimension\n * busted the cache? When `cacheCreation > 0` on turn N+1 with no obvious\n * reason, you want to know whether the system prompt, the tool list, the\n * thinking config, or the model id changed — without re-reading the loop\n * source.\n *\n * This module hashes each cache-affecting dimension at `turn:before`, then\n * on `turn:after` checks whether the latest turn read its share of the\n * cached prefix. If not, it diffs the previous turn's dimension hashes\n * against the current ones and logs the responsible dimension(s).\n *\n * Wire contract:\n *\n * - Install via {@link installCacheBreakLogger} on the agent's hook bus.\n * Returns an uninstall fn. Idempotent — calling install twice on the\n * same bus leaves two listeners; callers manage lifecycle.\n * - Output sink defaults to `console.error`; pass `log` to redirect into a\n * {@link Logger}, span attribute writer, or test buffer.\n * - Heuristic only: a missing cache read on turn 1 is expected (nothing\n * cached yet); the logger only reports from turn 2 onward.\n * - Pure helper {@link diffCacheDimensions} is exported for tests so the\n * diff logic can be exercised without standing up the loop.\n *\n * The dimensions tracked are the inputs the provider treats as part of the\n * cache key — `system`, `tools`, `model`, thinking config, and the message\n * PREFIX. Tools are hashed after `provider.formatTools`, so MCP catalogues\n * showing up mid-run also register as a break. Messages are hashed\n * per-message and compared positionally (`messageHashes` / the\n * `messagePrefix` dimension): appending — what every healthy turn does — is\n * deliberately silent, while an in-place rewrite of an earlier message\n * (compaction, stale-read elision, media age-out, host-side history trims)\n * reports the exact index that diverged.\n */\n\nimport type { Hookable } from 'hookable'\nimport type { AgentHooks } from './agent'\nimport type { StreamOptions } from './providers'\n\n// ---------------------------------------------------------------------------\n// Public types\n// ---------------------------------------------------------------------------\n\n/**\n * Snapshot of per-request dimensions that contribute to the provider-side\n * prompt cache key. Hashed at `turn:before` and stashed for diffing on the\n * next request.\n *\n * Hashes are FNV-1a 32-bit (cheap, no allocations on the hot path,\n * collision rate good enough for diff detection — we're not signing\n * anything). For verbose output the helper also captures byte lengths so\n * `system: 1024 → 1031` reads like a real diff line.\n */\nexport interface CacheDimensionSnapshot {\n /** Hash of `options.system` (with boundary marker preserved). */\n systemHash: number\n /** Byte length of `options.system`. */\n systemBytes: number\n /** Hash of the JSON-serialized `options.tools` array. */\n toolsHash: number\n /** Number of tools in the array. */\n toolsCount: number\n /** Model id. */\n model: string\n /** Thinking level — `'off'` when absent. */\n thinking: string\n /** Exact thinking budget — `0` when absent. */\n thinkingBudget: number\n /** Whole-task thinking budget (Anthropic adaptive-only) — `0` when absent. */\n taskBudget: number\n /** Whether the level-derived effort hint is emitted — `true` when absent. */\n effortHint: boolean\n /**\n * Per-message content hashes, in order. Compared POSITIONALLY against the\n * previous turn so that appending messages — what every healthy turn does —\n * is not mistaken for a rewrite. A single cumulative hash cannot make that\n * distinction: it changes on plain growth too, and would name this dimension\n * on literally every break, drowning the real culprit.\n *\n * Tracked because the expensive real-world breaks live here, not in the\n * request scaffold: compaction, stale-read elision, media age-out and history\n * trimming all rewrite the transcript mid-conversation, and none of them touch\n * `system`, `tools`, or the model id. A run can lose its entire transcript to\n * a cache miss with every other dimension reading perfectly stable.\n */\n messageHashes: readonly number[]\n /** Number of messages in the request. */\n messageCount: number\n}\n\n/** Result of {@link diffCacheDimensions}. */\nexport interface CacheDimensionDiff {\n /** Dimension names whose hashes differ between the two snapshots. */\n changed: readonly CacheDimensionName[]\n /** Per-dimension details — only filled for changed dimensions. */\n details: Readonly<Partial<Record<CacheDimensionName, string>>>\n /**\n * Message index where the prefixes diverged, when `changed` includes\n * `'messagePrefix'`. Chunk-aligned values (multiples of the compaction\n * chunk) point at tail compaction / media age-out; non-aligned values point\n * at stale-read stubbing or host-side history surgery.\n */\n messagePrefixDivergedAt?: number\n}\n\n/** Cache-affecting dimension names. */\nexport type CacheDimensionName\n = | 'system'\n | 'tools'\n | 'model'\n | 'thinking'\n | 'thinkingBudget'\n | 'taskBudget'\n | 'effortHint'\n /**\n * Per-message hashes compared positionally over the shared range — see\n * {@link CacheDimensionSnapshot.messageHashes}. Appends are silent (every\n * healthy turn grows the list); any in-place rewrite of a shared position,\n * including the previous turn's last message, is reported with its index.\n */\n | 'messagePrefix'\n\n/**\n * Structured payload of the `'cache:break'` agent hook, emitted by\n * {@link installCacheBreakLogger} whenever a turn reads back materially less\n * prefix than the previous turn established (see `expectedReadAtLeast` /\n * `expectedReadRatio` on {@link CacheBreakLoggerOptions}).\n *\n * `changed` names the request dimensions that differ from the previous turn —\n * the culprit when the host rewrote something. An EMPTY `changed` is itself a\n * signal: the request was byte-stable AT THIS WIRE and the provider still\n * failed to serve the prefix. Three suspects, in the order to check them:\n *\n * 1. TTL expiry — a long pause since the previous turn (compare wall-clock\n * gaps; the default window is ~5 minutes).\n * 2. Provider-side eviction — no pause, no pattern; typically isolated.\n * 3. Downstream transformation churn — on architectures where a gateway CASTS\n * this request into another provider's format (Anthropic → OpenAI\n * Responses, Converse, …), these dimensions only cover the PRE-cast bytes.\n * A transform that isn't prefix-monotonic (unstable id mapping, per-request\n * injections, config-derived fields like reasoning effort) breaks the\n * vendor's cache while reading as byte-stable here. Recurring\n * empty-`changed` breaks on a cast route point at the transform, not at\n * this agent — instrument the gateway's OUTPUT with the same positional\n * hashing (`hashMessages`) to name the churn.\n */\nexport interface CacheBreakInfo {\n /**\n * 1-based turn index as counted by the detector — monotonic across the\n * INSTALLER'S lifetime, i.e. every `agent.run()` on this hook bus. It does\n * NOT reset per run the way `turn:after`'s `ctx.turn` does, so don't\n * correlate the two on any prompt after the first; use `turnId` for that.\n */\n turn: number\n turnId: string\n /** Model id of the request that broke — pair with a provider key to price the break. */\n model: string\n cacheRead: number\n cacheCreation: number\n /** The floor that tripped: `max(expectedReadAtLeast, ratio-derived floor)`. */\n expectedAtLeast: number\n /**\n * Approximate tokens re-billed by this break: the prefix the previous turn\n * had cached minus what this turn actually read back. That portion was\n * re-written at the cache-write rate (~1.25x input) instead of read at the\n * cache-read rate (~0.1x), so the extra spend is roughly\n * `1.15 x rebilledTokens` input-token equivalents. Approximate because the\n * healthy-turn counterfactual (the genuine new-transcript delta) is folded\n * into `cacheCreation` and cannot be separated out.\n */\n rebilledTokens: number\n /** Request dimensions that changed since the previous turn; empty ⇒ suspect TTL/eviction. */\n changed: CacheDimensionName[]\n /** Human-readable per-dimension diffs, keyed by the entries of `changed`. */\n details: Partial<Record<CacheDimensionName, string>>\n}\n\n/**\n * Structured payload of the `'cache:drift'` agent hook, emitted by\n * {@link installCacheBreakLogger} at `turn:before` whenever the outgoing\n * request DIVERGES from the previous completed turn's — any tracked dimension,\n * including an in-place rewrite of the message prefix.\n *\n * Drift is the PREDICTIVE counterpart of `'cache:break'`: it fires from the\n * request bytes alone, before (and regardless of whether) the provider\n * confirms a miss. That makes it the signal that works everywhere the\n * confirmed-cost path cannot see — providers that report no cache usage, and\n * format-casting gateways where this wire is the last observable point before\n * the cast. A turn that drifts here and then reports a healthy `cacheRead`\n * means the provider absorbed the change (e.g. only the tail moved); a turn\n * that drifts AND breaks gives the break its attribution for free.\n *\n * Intentional rewrites drift too, by design — that is the attribution story\n * for planned invalidations: tail compaction and media age-out cut on\n * chunk-aligned indices (`divergedAt` a multiple of the compaction chunk),\n * stale-read stubbing rewrites a read's own position, host history surgery\n * lands anywhere. `details.messagePrefix` carries the same hint in prose.\n */\nexport interface CacheDriftInfo {\n /** 1-based turn index, installer-lifetime monotonic — see {@link CacheBreakInfo.turn}. */\n turn: number\n turnId: string\n /** Model id of the OUTGOING request (post-fallback, pre-provider). */\n model: string\n /** Dimensions that differ from the previous completed turn's request. */\n changed: CacheDimensionName[]\n /** Human-readable per-dimension diffs, keyed by the entries of `changed`. */\n details: Partial<Record<CacheDimensionName, string>>\n /** Message index of an in-place prefix rewrite — see {@link CacheDimensionDiff.messagePrefixDivergedAt}. */\n divergedAt?: number\n previousMessageCount: number\n messageCount: number\n}\n\n// ---------------------------------------------------------------------------\n// Configuration\n// ---------------------------------------------------------------------------\n\nexport interface CacheBreakLoggerOptions {\n /**\n * Sink for log lines. Defaults to `console.error`. Use a {@link Logger} or\n * a test buffer here when you want the output to land somewhere other than\n * stderr.\n *\n * NOT every line is a dimension diff: unless {@link onEmitError} is\n * provided, `'cache:break'` handler errors are also routed here (prefixed\n * `cache-break: 'cache:break' handler threw:`). A host that counts `log`\n * invocations as \"dimension changes\" — the journal-mode wiring — should\n * either pass `onEmitError` or count via the `'cache:break'` hook instead.\n */\n log?: (line: string) => void\n /**\n * Sink for errors thrown by `'cache:break'` hook consumers. The emission is\n * try/caught so a UI bug in a handler can't unwind into the loop and abort\n * the run; this is where that error surfaces. Defaults to the {@link log}\n * channel (never a louder one — hosts route `log` away from stderr for good\n * reasons). Pass a dedicated sink when `log` invocations are being counted\n * as metrics.\n */\n onEmitError?: (error: unknown) => void\n /**\n * When `true`, emit a log line on EVERY turn (not just cache breaks) with\n * the per-dimension hashes. Useful for offline correlation; off by default\n * to keep the logger zero-noise on happy paths.\n */\n verbose?: boolean\n /**\n * Absolute floor for \"this turn missed cache\". The logger reports when\n * `cacheRead` falls below the threshold AND the dimensions differ from the\n * previous turn.\n *\n * Defaults to `1`, which on its own only catches TOTAL cache loss. That is not\n * the common failure: when the system prompt or the message prefix is\n * rewritten, `tools` + the static system block still match, so `cacheRead`\n * stays comfortably non-zero — pinned to a CONSTANT equal to that scaffold —\n * while the entire conversation re-bills at the cache-write rate. An\n * absolute-only threshold reports such a run as perfectly healthy.\n *\n * {@link CacheBreakLoggerOptions.expectedReadRatio} is the fix and is on by\n * default; this field remains as the absolute floor beneath it.\n */\n expectedReadAtLeast?: number\n /**\n * Detect PARTIAL-prefix breaks by comparing this turn's `cacheRead` against\n * the prefix the previous turn established (`cacheRead + cacheCreation`).\n * The conversation only grows, so a healthy turn reads back at least what the\n * one before it wrote; reading materially less means something at or before\n * the last message changed.\n *\n * Defaults to `0.8` — the slack absorbs tokenizer jitter and any uncached\n * dynamic system block, which is re-billed by design. Set `0` to disable and\n * restore the pre-6.3 absolute-only behavior.\n */\n expectedReadRatio?: number\n}\n\n// ---------------------------------------------------------------------------\n// Hashing\n// ---------------------------------------------------------------------------\n\nconst FNV_OFFSET = 0x811C9DC5\nconst FNV_PRIME = 0x01000193\n\n/**\n * Smallest previous-prefix size the ratio test will judge. Below this the run\n * has barely started (or the provider reports no cache at all) and the ratio is\n * noise — the absolute floor still applies.\n */\nconst MIN_JUDGED_PREFIX_TOKENS = 1024\n\n/**\n * FNV-1a-style 32-bit hash over UTF-16 code units. Pure, allocation-free,\n * ~10 ns per KB. Cryptographic strength is irrelevant here — we only need\n * change detection, and this has effectively zero collision risk for the\n * small number of dimensions tracked.\n *\n * Feeds the FULL char code into the mix (same as read-state's\n * `hashContent`) — masking to the low byte would collapse code points that\n * share a low byte, so a non-ASCII system-prompt change could hash\n * identically and silently hide a cache-dimension drift.\n *\n * Exported for tests; callers shouldn't typically import directly.\n */\nexport function fnv1a32(s: string): number {\n let h = FNV_OFFSET\n for (let i = 0; i < s.length; i++) {\n h ^= s.charCodeAt(i)\n // Multiply by FNV_PRIME mod 2^32, using `Math.imul` to keep within\n // 32-bit signed range (avoid >>> 0 ping-pong on every iteration).\n h = Math.imul(h, FNV_PRIME)\n }\n // Map signed → unsigned 32-bit so the printed hex is stable.\n return h >>> 0\n}\n\n/**\n * Build a {@link CacheDimensionSnapshot} from a `turn:before` payload.\n *\n * Pure — exported so hosts can compute snapshots outside the logger (e.g.\n * stamping them onto custom telemetry spans). The hash is deterministic on\n * byte-identical inputs.\n */\nexport function snapshotCacheDimensions(options: StreamOptions): CacheDimensionSnapshot {\n const toolsJson = JSON.stringify(options.tools ?? [])\n const messages = options.messages ?? []\n return {\n systemHash: fnv1a32(options.system),\n systemBytes: options.system.length,\n toolsHash: fnv1a32(toolsJson),\n toolsCount: Array.isArray(options.tools) ? options.tools.length : 0,\n model: options.model,\n thinking: options.thinking ?? 'off',\n thinkingBudget: options.thinkingBudget ?? 0,\n taskBudget: options.taskBudget ?? 0,\n effortHint: options.effortHint !== false,\n messageHashes: hashMessages(messages),\n messageCount: messages.length,\n }\n}\n\n/**\n * Hash each message independently, preserving order.\n *\n * Per-message rather than cumulative so the diff can tell an APPEND (healthy)\n * from a REWRITE (a cache break) by comparing positionally — see\n * {@link CacheDimensionSnapshot.messageHashes}.\n *\n * Folds field-by-field into a rolling FNV rather than `JSON.stringify`-ing the\n * whole list at once: on a long run the transcript is hundreds of KB, and\n * building one giant string every turn just to throw it away is the kind of\n * overhead that gets telemetry ripped back out.\n *\n * Exported so hosts can stamp the same hashes onto their own spans.\n */\nexport function hashMessages(messages: readonly { role: string, content: unknown }[]): number[] {\n const out: number[] = []\n for (const message of messages) {\n if (!message) {\n out.push(0)\n continue\n }\n let h = mixString(FNV_OFFSET, message.role ?? '')\n // `JSON.stringify` yields `undefined` (the value, not a string) for\n // undefined input — public export, so don't let a malformed message throw\n // inside a diagnostics helper.\n h = mixString(h, JSON.stringify(message.content) ?? '')\n out.push(h >>> 0)\n }\n return out\n}\n\n/**\n * Index of the first message whose content differs, or -1 when one list is a\n * pure prefix of the other (i.e. messages were only appended).\n */\nfunction firstDivergentIndex(prev: readonly number[], curr: readonly number[]): number {\n const shared = Math.min(prev.length, curr.length)\n for (let i = 0; i < shared; i++) {\n if (prev[i] !== curr[i])\n return i\n }\n return -1\n}\n\n/** Mix a string into a running FNV-1a state. */\nfunction mixString(seed: number, s: string): number {\n let h = seed\n for (let i = 0; i < s.length; i++) {\n h ^= s.charCodeAt(i)\n h = Math.imul(h, FNV_PRIME)\n }\n return h\n}\n\n// ---------------------------------------------------------------------------\n// Diffing\n// ---------------------------------------------------------------------------\n\n/**\n * Compare two snapshots and return the list of dimensions whose bytes\n * differ. The `details` map carries a short human-readable description per\n * changed dimension (e.g. `system: 1024 → 1031 bytes`).\n *\n * Pure / no I/O. Use this in tests to assert the diff logic; the logger\n * itself just formats and emits the result.\n */\nexport function diffCacheDimensions(\n prev: CacheDimensionSnapshot,\n curr: CacheDimensionSnapshot,\n): CacheDimensionDiff {\n const changed: CacheDimensionName[] = []\n const details: Partial<Record<CacheDimensionName, string>> = {}\n\n if (prev.systemHash !== curr.systemHash) {\n changed.push('system')\n details.system = `${prev.systemBytes} → ${curr.systemBytes} bytes (hash ${hex(prev.systemHash)} → ${hex(curr.systemHash)})`\n }\n if (prev.toolsHash !== curr.toolsHash) {\n changed.push('tools')\n details.tools = `${prev.toolsCount} → ${curr.toolsCount} tools (hash ${hex(prev.toolsHash)} → ${hex(curr.toolsHash)})`\n }\n if (prev.model !== curr.model) {\n changed.push('model')\n details.model = `${prev.model} → ${curr.model}`\n }\n if (prev.thinking !== curr.thinking) {\n changed.push('thinking')\n details.thinking = `${prev.thinking} → ${curr.thinking}`\n }\n if (prev.thinkingBudget !== curr.thinkingBudget) {\n changed.push('thinkingBudget')\n details.thinkingBudget = `${prev.thinkingBudget} → ${curr.thinkingBudget}`\n }\n if (prev.taskBudget !== curr.taskBudget) {\n changed.push('taskBudget')\n details.taskBudget = `${prev.taskBudget} → ${curr.taskBudget}`\n }\n if (prev.effortHint !== curr.effortHint) {\n changed.push('effortHint')\n details.effortHint = `${prev.effortHint} → ${curr.effortHint}`\n }\n // Reported last, mirroring the provider's tools → system → messages ordering:\n // a change here invalidates the least, a change in `tools` the most.\n //\n // Only a POSITIONAL divergence counts. Appending messages is what every\n // healthy turn does and must never be reported, or this dimension would name\n // itself on every single break and bury the real culprit.\n const divergentAt = firstDivergentIndex(prev.messageHashes, curr.messageHashes)\n if (divergentAt >= 0) {\n changed.push('messagePrefix')\n details.messagePrefix = `message[${divergentAt}] of ${prev.messageCount} → ${curr.messageCount} was rewritten in place`\n + ` — suspect compaction, stale-read elision, media age-out, or host-side history trimming`\n }\n\n // Single tail return so a dimension added below the messagePrefix check can\n // never be silently skipped on the turns where the prefix diverged — the\n // turns where full attribution matters most.\n return { changed, details, ...(divergentAt >= 0 ? { messagePrefixDivergedAt: divergentAt } : {}) }\n}\n\nfunction hex(n: number): string {\n return `0x${n.toString(16).padStart(8, '0')}`\n}\n\n// ---------------------------------------------------------------------------\n// Hook installer\n// ---------------------------------------------------------------------------\n\n/**\n * Install the cache-break logger on an agent's hook bus.\n *\n * Subscribes to `turn:before` (snapshot) + `turn:after` (compare with prior\n * snapshot, log breaks). Returns an `uninstall` fn that detaches both\n * listeners. Idempotent w.r.t. agent lifecycle — installs/uninstalls cleanly\n * across runs.\n *\n * Recommended setup:\n *\n * ```ts\n * const uninstall = installCacheBreakLogger(agent.hooks, {\n * log: line => logger.debug(line),\n * verbose: !!process.env.ZIDANE_DEBUG?.includes('cache'),\n * })\n * // ...\n * uninstall()\n * ```\n *\n * Performance: hashing runs on each `turn:before` and is bounded by the\n * input size (system + tools serialization). Disabled callers pay nothing\n * (don't install).\n */\nexport function installCacheBreakLogger(\n hooks: Hookable<AgentHooks>,\n options: CacheBreakLoggerOptions = {},\n): () => void {\n const log = options.log ?? ((line: string) => console.error(line))\n // Defaults into `log` (not console.error): hosts route `log` away from\n // stderr for good reasons — the TUI's alternate screen, e.g. — and a\n // consumer bug should not get a louder channel than the feature itself.\n const onEmitError = options.onEmitError\n ?? ((error: unknown) => log(`cache-break: 'cache:break' handler threw: ${String(error)}`))\n const verbose = options.verbose === true\n const expectedReadAtLeast = options.expectedReadAtLeast ?? 1\n const expectedReadRatio = options.expectedReadRatio ?? 0.8\n\n // Per-bus latest snapshot. Keyed implicitly by the bus instance —\n // installing on a fresh bus starts from empty. Across runs on the same\n // bus, the snapshot persists, which is what we want: the first turn of\n // run N+1 should hit cache if it shares a prefix with the last turn of\n // run N. The detector reports correctly across that boundary.\n let prev: CacheDimensionSnapshot | undefined\n /**\n * Size of the prefix the previous turn left cached (`cacheRead +\n * cacheCreation`). Turn N+1 should read back at least this much.\n */\n let previousPrefixTokens = 0\n let turnIndex = 0\n let pending: { snapshot: CacheDimensionSnapshot, turnIndex: number, turnId: string } | undefined\n\n function onTurnBefore(ctx: { turn: number, turnId: string, options: StreamOptions }): void {\n const curr = snapshotCacheDimensions(ctx.options)\n turnIndex += 1\n\n if (verbose) {\n log(formatVerboseLine({\n turn: turnIndex,\n turnId: ctx.turnId,\n snapshot: curr,\n }))\n }\n\n // Stash for the matching `turn:after`. The confirmed-cost path can't run\n // here — the cache-read result lands on `turn:after.usage`.\n pending = { snapshot: curr, turnIndex, turnId: ctx.turnId }\n\n // Predictive path: the request bytes alone tell us the prefix moved,\n // before any provider accounting. `prev` is the last COMPLETED turn's\n // snapshot (assigned at its `turn:after`), so a turn that errors before\n // completion doesn't become the comparison baseline. Fires for\n // intentional rewrites too — that is the attribution channel for\n // compaction cuts and stale-read stubs, not noise (see CacheDriftInfo).\n //\n // FIRE-AND-FORGET, deliberately not awaited: `turn:before` is dispatched\n // through the loop's PROPAGATING hook timeout (`boundedHook`), so awaiting\n // arbitrary drift consumers here would let a slow subscriber time out the\n // whole dispatch and abort the run — the exact coupling `onEmitError`\n // exists to rule out. (`'cache:break'` on `turn:after` rides the\n // timeout-swallowing dispatch, so awaiting is safe THERE.) Synchronous\n // subscribers still complete before the request goes out — hookable\n // invokes handlers inline — while async subscribers detach; the payload is\n // a fresh object per emission, so detached consumers can't observe later\n // mutation. Errors from either path route to `onEmitError`.\n if (prev && turnIndex > 1) {\n const diff = diffCacheDimensions(prev, curr)\n if (diff.changed.length > 0) {\n try {\n void Promise.resolve(hooks.callHook('cache:drift', {\n turn: turnIndex,\n turnId: ctx.turnId,\n model: curr.model,\n changed: [...diff.changed],\n details: { ...diff.details },\n ...(diff.messagePrefixDivergedAt !== undefined ? { divergedAt: diff.messagePrefixDivergedAt } : {}),\n previousMessageCount: prev.messageCount,\n messageCount: curr.messageCount,\n })).catch(onEmitError)\n }\n catch (error) {\n // a synchronously-throwing dispatch path must not unwind into the loop\n onEmitError(error)\n }\n }\n }\n }\n\n async function onTurnAfter(ctx: { turn: number, turnId: string, usage: { cacheRead?: number, cacheCreation?: number } }): Promise<void> {\n if (!pending || pending.turnId !== ctx.turnId)\n return\n const { snapshot: curr, turnIndex: tIdx } = pending\n pending = undefined\n\n // Skip break detection on providers that don't report `cacheRead` —\n // treating undefined as 0 would log a false break every turn on Codex,\n // Cerebras, or any host without a cache_read field. We can only diagnose\n // breaks when the provider tells us how much cache was actually used.\n if (prev && tIdx > 1 && typeof ctx.usage.cacheRead === 'number') {\n const cacheRead = ctx.usage.cacheRead\n // Below the absolute floor, OR materially short of the prefix the previous\n // turn already had cached. The second test is the one that catches a\n // partial break, where `cacheRead` is large but covers only the scaffold.\n const ratioFloor = expectedReadRatio > 0 && previousPrefixTokens >= MIN_JUDGED_PREFIX_TOKENS\n ? previousPrefixTokens * expectedReadRatio\n : 0\n if (cacheRead < expectedReadAtLeast || cacheRead < ratioFloor) {\n const diff = diffCacheDimensions(prev, curr)\n // The text line stays gated on an attributable dimension change (its\n // historical behavior); the typed hook fires on EVERY break — an\n // empty `changed` is the TTL-expiry / provider-eviction signature and\n // hosts (TUI chip, dashboards) want to see it.\n if (diff.changed.length > 0) {\n log(formatBreakLine({\n turn: tIdx,\n turnId: ctx.turnId,\n cacheRead,\n cacheCreation: ctx.usage.cacheCreation ?? 0,\n diff,\n }))\n }\n // Emission is side-effect-safe: this runs inside the loop's\n // `turn:after` dispatch, so a throwing consumer handler (a UI bug,\n // say) would otherwise unwind into the loop and abort the run — a\n // bad trade for an observational diagnostics module. Errors are\n // surfaced through the `log` channel instead of propagated.\n try {\n await hooks.callHook('cache:break', {\n turn: tIdx,\n turnId: ctx.turnId,\n model: curr.model,\n cacheRead,\n cacheCreation: ctx.usage.cacheCreation ?? 0,\n // Journal mode pins `expectedReadAtLeast` to Infinity (\"report\n // every dimension change\"), and Infinity JSON-serializes as\n // `null` — a metrics pipeline consuming this payload would see a\n // null floor on every break. When the absolute floor is\n // non-finite, report the tightest FINITE floor that actually\n // tripped: the ratio floor when this turn read less than it,\n // otherwise the previous turn's cached prefix (the \"should have\n // read everything\" claim the pin amounts to).\n expectedAtLeast: Number.isFinite(expectedReadAtLeast)\n ? Math.max(expectedReadAtLeast, Math.round(ratioFloor))\n : cacheRead < ratioFloor\n ? Math.round(ratioFloor)\n : Math.round(previousPrefixTokens),\n rebilledTokens: Math.max(0, Math.round(previousPrefixTokens - cacheRead)),\n changed: [...diff.changed],\n details: { ...diff.details },\n })\n }\n catch (error) {\n onEmitError(error)\n }\n }\n }\n\n previousPrefixTokens = (ctx.usage.cacheRead ?? 0) + (ctx.usage.cacheCreation ?? 0)\n prev = curr\n }\n\n // Hookable's `.hook()` returns its own unregister fn — keep both so\n // `uninstall()` is symmetric with the install path and survives a\n // future hookable rename of `removeHook`.\n const unregisterBefore = hooks.hook('turn:before', onTurnBefore)\n const unregisterAfter = hooks.hook('turn:after', onTurnAfter)\n\n return () => {\n unregisterBefore()\n unregisterAfter()\n }\n}\n\n// ---------------------------------------------------------------------------\n// Formatting\n// ---------------------------------------------------------------------------\n\nfunction formatBreakLine(input: {\n turn: number\n turnId: string\n cacheRead: number\n cacheCreation: number\n diff: CacheDimensionDiff\n}): string {\n const names = input.diff.changed.join(', ')\n const details = input.diff.changed\n .map(d => ` ${d}: ${input.diff.details[d]}`)\n .join('\\n')\n return [\n `[zidane:cache-break] turn=${input.turn} turnId=${input.turnId} cacheRead=${input.cacheRead} cacheCreation=${input.cacheCreation}`,\n ` changed: ${names}`,\n details,\n ].join('\\n')\n}\n\nfunction formatVerboseLine(input: {\n turn: number\n turnId: string\n snapshot: CacheDimensionSnapshot\n}): string {\n const s = input.snapshot\n return `[zidane:cache] turn=${input.turn} turnId=${input.turnId} system=${hex(s.systemHash)}(${s.systemBytes}b) tools=${hex(s.toolsHash)}(${s.toolsCount}) model=${s.model} thinking=${s.thinking}/${s.thinkingBudget}${s.taskBudget ? `/task=${s.taskBudget}` : ''}`\n}\n"],"mappings":";AA2RA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OAAO;KACZ,YAAY,KAAK;IACnB;GACF;EACF;EAEA,wBAAwB,IAAI,MAAM,aAAa,MAAM,IAAI,MAAM,iBAAiB;EAChF,OAAO;CACT;CAKA,MAAM,mBAAmB,MAAM,KAAK,eAAe,YAAY;CAC/D,MAAM,kBAAkB,MAAM,KAAK,cAAc,WAAW;CAE5D,aAAa;EACX,iBAAiB;EACjB,gBAAgB;CAClB;AACF;AAMA,SAAS,gBAAgB,OAMd;CACT,MAAM,QAAQ,MAAM,KAAK,QAAQ,KAAK,IAAI;CAC1C,MAAM,UAAU,MAAM,KAAK,QACxB,KAAI,MAAK,KAAK,EAAE,IAAI,MAAM,KAAK,QAAQ,IAAI,CAAC,CAC5C,KAAK,IAAI;CACZ,OAAO;EACL,6BAA6B,MAAM,KAAK,UAAU,MAAM,OAAO,aAAa,MAAM,UAAU,iBAAiB,MAAM;EACnH,cAAc;EACd;CACF,CAAC,CAAC,KAAK,IAAI;AACb;AAEA,SAAS,kBAAkB,OAIhB;CACT,MAAM,IAAI,MAAM;CAChB,OAAO,uBAAuB,MAAM,KAAK,UAAU,MAAM,OAAO,UAAU,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,WAAW,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,UAAU,EAAE,MAAM,YAAY,EAAE,SAAS,GAAG,EAAE,iBAAiB,EAAE,aAAa,SAAS,EAAE,eAAe;AACnQ"}
|
|
1
|
+
{"version":3,"file":"cache-telemetry-D0xemhgK.js","names":[],"sources":["../src/cache-telemetry.ts"],"sourcesContent":["/**\n * Per-dimension cache-break detection.\n *\n * The agent surfaces `cacheRead` / `cacheCreation` in {@link TurnUsage}, but\n * doesn't answer the load-bearing diagnostic question: *which* dimension\n * busted the cache? When `cacheCreation > 0` on turn N+1 with no obvious\n * reason, you want to know whether the system prompt, the tool list, the\n * thinking config, or the model id changed — without re-reading the loop\n * source.\n *\n * This module hashes each cache-affecting dimension at `turn:before`, then\n * on `turn:after` checks whether the latest turn read its share of the\n * cached prefix. If not, it diffs the previous turn's dimension hashes\n * against the current ones and logs the responsible dimension(s).\n *\n * Wire contract:\n *\n * - Install via {@link installCacheBreakLogger} on the agent's hook bus.\n * Returns an uninstall fn. Idempotent — calling install twice on the\n * same bus leaves two listeners; callers manage lifecycle.\n * - Output sink defaults to `console.error`; pass `log` to redirect into a\n * {@link Logger}, span attribute writer, or test buffer.\n * - Heuristic only: a missing cache read on turn 1 is expected (nothing\n * cached yet); the logger only reports from turn 2 onward.\n * - Pure helper {@link diffCacheDimensions} is exported for tests so the\n * diff logic can be exercised without standing up the loop.\n *\n * The dimensions tracked are the inputs the provider treats as part of the\n * cache key — `system`, `tools`, `model`, thinking config, and the message\n * PREFIX. Tools are hashed after `provider.formatTools`, so MCP catalogues\n * showing up mid-run also register as a break. Messages are hashed\n * per-message and compared positionally (`messageHashes` / the\n * `messagePrefix` dimension): appending — what every healthy turn does — is\n * deliberately silent, while an in-place rewrite of an earlier message\n * (compaction, stale-read elision, media age-out, host-side history trims)\n * reports the exact index that diverged.\n */\n\nimport type { Hookable } from 'hookable'\nimport type { AgentHooks } from './agent'\nimport type { StreamOptions } from './providers'\n\n// ---------------------------------------------------------------------------\n// Public types\n// ---------------------------------------------------------------------------\n\n/**\n * Snapshot of per-request dimensions that contribute to the provider-side\n * prompt cache key. Hashed at `turn:before` and stashed for diffing on the\n * next request.\n *\n * Hashes are FNV-1a 32-bit (cheap, no allocations on the hot path,\n * collision rate good enough for diff detection — we're not signing\n * anything). For verbose output the helper also captures byte lengths so\n * `system: 1024 → 1031` reads like a real diff line.\n */\nexport interface CacheDimensionSnapshot {\n /** Hash of `options.system` (with boundary marker preserved). */\n systemHash: number\n /** Byte length of `options.system`. */\n systemBytes: number\n /** Hash of the JSON-serialized `options.tools` array. */\n toolsHash: number\n /** Number of tools in the array. */\n toolsCount: number\n /** Model id. */\n model: string\n /** Thinking level — `'off'` when absent. */\n thinking: string\n /** Exact thinking budget — `0` when absent. */\n thinkingBudget: number\n /** Whole-task thinking budget (Anthropic adaptive-only) — `0` when absent. */\n taskBudget: number\n /** Whether the level-derived effort hint is emitted — `true` when absent. */\n effortHint: boolean\n /**\n * Per-message content hashes, in order. Compared POSITIONALLY against the\n * previous turn so that appending messages — what every healthy turn does —\n * is not mistaken for a rewrite. A single cumulative hash cannot make that\n * distinction: it changes on plain growth too, and would name this dimension\n * on literally every break, drowning the real culprit.\n *\n * Tracked because the expensive real-world breaks live here, not in the\n * request scaffold: compaction, stale-read elision, media age-out and history\n * trimming all rewrite the transcript mid-conversation, and none of them touch\n * `system`, `tools`, or the model id. A run can lose its entire transcript to\n * a cache miss with every other dimension reading perfectly stable.\n */\n messageHashes: readonly number[]\n /** Number of messages in the request. */\n messageCount: number\n}\n\n/** Result of {@link diffCacheDimensions}. */\nexport interface CacheDimensionDiff {\n /** Dimension names whose hashes differ between the two snapshots. */\n changed: readonly CacheDimensionName[]\n /** Per-dimension details — only filled for changed dimensions. */\n details: Readonly<Partial<Record<CacheDimensionName, string>>>\n /**\n * Message index where the prefixes diverged, when `changed` includes\n * `'messagePrefix'`. Chunk-aligned values (multiples of the compaction\n * chunk) point at tail compaction / media age-out; non-aligned values point\n * at stale-read stubbing or host-side history surgery.\n */\n messagePrefixDivergedAt?: number\n}\n\n/** Cache-affecting dimension names. */\nexport type CacheDimensionName\n = | 'system'\n | 'tools'\n | 'model'\n | 'thinking'\n | 'thinkingBudget'\n | 'taskBudget'\n | 'effortHint'\n /**\n * Per-message hashes compared positionally over the shared range — see\n * {@link CacheDimensionSnapshot.messageHashes}. Appends are silent (every\n * healthy turn grows the list); any in-place rewrite of a shared position,\n * including the previous turn's last message, is reported with its index.\n */\n | 'messagePrefix'\n\n/**\n * Structured payload of the `'cache:break'` agent hook, emitted by\n * {@link installCacheBreakLogger} whenever a turn reads back materially less\n * prefix than the previous turn established (see `expectedReadAtLeast` /\n * `expectedReadRatio` on {@link CacheBreakLoggerOptions}).\n *\n * `changed` names the request dimensions that differ from the previous turn —\n * the culprit when the host rewrote something. An EMPTY `changed` is itself a\n * signal: the request was byte-stable AT THIS WIRE and the provider still\n * failed to serve the prefix. Three suspects, in the order to check them:\n *\n * 1. TTL expiry — a long pause since the previous turn (compare wall-clock\n * gaps; the default window is ~5 minutes).\n * 2. Provider-side eviction — no pause, no pattern; typically isolated.\n * 3. Downstream transformation churn — on architectures where a gateway CASTS\n * this request into another provider's format (Anthropic → OpenAI\n * Responses, Converse, …), these dimensions only cover the PRE-cast bytes.\n * A transform that isn't prefix-monotonic (unstable id mapping, per-request\n * injections, config-derived fields like reasoning effort) breaks the\n * vendor's cache while reading as byte-stable here. Recurring\n * empty-`changed` breaks on a cast route point at the transform, not at\n * this agent — instrument the gateway's OUTPUT with the same positional\n * hashing (`hashMessages`) to name the churn.\n */\nexport interface CacheBreakInfo {\n /**\n * 1-based turn index as counted by the detector — monotonic across the\n * INSTALLER'S lifetime, i.e. every `agent.run()` on this hook bus. It does\n * NOT reset per run the way `turn:after`'s `ctx.turn` does, so don't\n * correlate the two on any prompt after the first; use `turnId` for that.\n */\n turn: number\n turnId: string\n /** Model id of the request that broke — pair with a provider key to price the break. */\n model: string\n cacheRead: number\n cacheCreation: number\n /** The floor that tripped: `max(expectedReadAtLeast, ratio-derived floor)`. */\n expectedAtLeast: number\n /**\n * Approximate tokens re-billed by this break: the prefix the previous turn\n * had cached minus what this turn actually read back. That portion was\n * re-written at the cache-write rate (~1.25x input) instead of read at the\n * cache-read rate (~0.1x), so the extra spend is roughly\n * `1.15 x rebilledTokens` input-token equivalents. Approximate because the\n * healthy-turn counterfactual (the genuine new-transcript delta) is folded\n * into `cacheCreation` and cannot be separated out.\n */\n rebilledTokens: number\n /** Request dimensions that changed since the previous turn; empty ⇒ suspect TTL/eviction. */\n changed: CacheDimensionName[]\n /** Human-readable per-dimension diffs, keyed by the entries of `changed`. */\n details: Partial<Record<CacheDimensionName, string>>\n}\n\n/**\n * Structured payload of the `'cache:drift'` agent hook, emitted by\n * {@link installCacheBreakLogger} at `turn:before` whenever the outgoing\n * request DIVERGES from the previous completed turn's — any tracked dimension,\n * including an in-place rewrite of the message prefix.\n *\n * Drift is the PREDICTIVE counterpart of `'cache:break'`: it fires from the\n * request bytes alone, before (and regardless of whether) the provider\n * confirms a miss. That makes it the signal that works everywhere the\n * confirmed-cost path cannot see — providers that report no cache usage, and\n * format-casting gateways where this wire is the last observable point before\n * the cast. A turn that drifts here and then reports a healthy `cacheRead`\n * means the provider absorbed the change (e.g. only the tail moved); a turn\n * that drifts AND breaks gives the break its attribution for free.\n *\n * Intentional rewrites drift too, by design — that is the attribution story\n * for planned invalidations: tail compaction and media age-out cut on\n * chunk-aligned indices (`divergedAt` a multiple of the compaction chunk),\n * stale-read stubbing rewrites a read's own position, host history surgery\n * lands anywhere. `details.messagePrefix` carries the same hint in prose.\n */\nexport interface CacheDriftInfo {\n /** 1-based turn index, installer-lifetime monotonic — see {@link CacheBreakInfo.turn}. */\n turn: number\n turnId: string\n /** Model id of the OUTGOING request (post-fallback, pre-provider). */\n model: string\n /** Dimensions that differ from the previous completed turn's request. */\n changed: CacheDimensionName[]\n /** Human-readable per-dimension diffs, keyed by the entries of `changed`. */\n details: Partial<Record<CacheDimensionName, string>>\n /** Message index of an in-place prefix rewrite — see {@link CacheDimensionDiff.messagePrefixDivergedAt}. */\n divergedAt?: number\n previousMessageCount: number\n messageCount: number\n}\n\n// ---------------------------------------------------------------------------\n// Configuration\n// ---------------------------------------------------------------------------\n\nexport interface CacheBreakLoggerOptions {\n /**\n * Sink for log lines. Defaults to `console.error`. Use a {@link Logger} or\n * a test buffer here when you want the output to land somewhere other than\n * stderr.\n *\n * NOT every line is a dimension diff: unless {@link onEmitError} is\n * provided, `'cache:break'` handler errors are also routed here (prefixed\n * `cache-break: 'cache:break' handler threw:`). A host that counts `log`\n * invocations as \"dimension changes\" — the journal-mode wiring — should\n * either pass `onEmitError` or count via the `'cache:break'` hook instead.\n */\n log?: (line: string) => void\n /**\n * Sink for errors thrown by `'cache:break'` hook consumers. The emission is\n * try/caught so a UI bug in a handler can't unwind into the loop and abort\n * the run; this is where that error surfaces. Defaults to the {@link log}\n * channel (never a louder one — hosts route `log` away from stderr for good\n * reasons). Pass a dedicated sink when `log` invocations are being counted\n * as metrics.\n */\n onEmitError?: (error: unknown) => void\n /**\n * When `true`, emit a log line on EVERY turn (not just cache breaks) with\n * the per-dimension hashes. Useful for offline correlation; off by default\n * to keep the logger zero-noise on happy paths.\n */\n verbose?: boolean\n /**\n * Absolute floor for \"this turn missed cache\". The logger reports when\n * `cacheRead` falls below the threshold AND the dimensions differ from the\n * previous turn.\n *\n * Defaults to `1`, which on its own only catches TOTAL cache loss. That is not\n * the common failure: when the system prompt or the message prefix is\n * rewritten, `tools` + the static system block still match, so `cacheRead`\n * stays comfortably non-zero — pinned to a CONSTANT equal to that scaffold —\n * while the entire conversation re-bills at the cache-write rate. An\n * absolute-only threshold reports such a run as perfectly healthy.\n *\n * {@link CacheBreakLoggerOptions.expectedReadRatio} is the fix and is on by\n * default; this field remains as the absolute floor beneath it.\n */\n expectedReadAtLeast?: number\n /**\n * Detect PARTIAL-prefix breaks by comparing this turn's `cacheRead` against\n * the prefix the previous turn established (`cacheRead + cacheCreation`).\n * The conversation only grows, so a healthy turn reads back at least what the\n * one before it wrote; reading materially less means something at or before\n * the last message changed.\n *\n * Defaults to `0.8` — the slack absorbs tokenizer jitter and any uncached\n * dynamic system block, which is re-billed by design. Set `0` to disable and\n * restore the pre-6.3 absolute-only behavior.\n */\n expectedReadRatio?: number\n}\n\n// ---------------------------------------------------------------------------\n// Hashing\n// ---------------------------------------------------------------------------\n\nconst FNV_OFFSET = 0x811C9DC5\nconst FNV_PRIME = 0x01000193\n\n/**\n * Smallest previous-prefix size the ratio test will judge. Below this the run\n * has barely started (or the provider reports no cache at all) and the ratio is\n * noise — the absolute floor still applies.\n */\nconst MIN_JUDGED_PREFIX_TOKENS = 1024\n\n/**\n * FNV-1a-style 32-bit hash over UTF-16 code units. Pure, allocation-free,\n * ~10 ns per KB. Cryptographic strength is irrelevant here — we only need\n * change detection, and this has effectively zero collision risk for the\n * small number of dimensions tracked.\n *\n * Feeds the FULL char code into the mix (same as read-state's\n * `hashContent`) — masking to the low byte would collapse code points that\n * share a low byte, so a non-ASCII system-prompt change could hash\n * identically and silently hide a cache-dimension drift.\n *\n * Exported for tests; callers shouldn't typically import directly.\n */\nexport function fnv1a32(s: string): number {\n let h = FNV_OFFSET\n for (let i = 0; i < s.length; i++) {\n h ^= s.charCodeAt(i)\n // Multiply by FNV_PRIME mod 2^32, using `Math.imul` to keep within\n // 32-bit signed range (avoid >>> 0 ping-pong on every iteration).\n h = Math.imul(h, FNV_PRIME)\n }\n // Map signed → unsigned 32-bit so the printed hex is stable.\n return h >>> 0\n}\n\n/**\n * Build a {@link CacheDimensionSnapshot} from a `turn:before` payload.\n *\n * Pure — exported so hosts can compute snapshots outside the logger (e.g.\n * stamping them onto custom telemetry spans). The hash is deterministic on\n * byte-identical inputs.\n */\nexport function snapshotCacheDimensions(options: StreamOptions): CacheDimensionSnapshot {\n const toolsJson = JSON.stringify(options.tools ?? [])\n const messages = options.messages ?? []\n return {\n systemHash: fnv1a32(options.system),\n systemBytes: options.system.length,\n toolsHash: fnv1a32(toolsJson),\n toolsCount: Array.isArray(options.tools) ? options.tools.length : 0,\n model: options.model,\n thinking: options.thinking ?? 'off',\n thinkingBudget: options.thinkingBudget ?? 0,\n taskBudget: options.taskBudget ?? 0,\n effortHint: options.effortHint !== false,\n messageHashes: hashMessages(messages),\n messageCount: messages.length,\n }\n}\n\n/**\n * Hash each message independently, preserving order.\n *\n * Per-message rather than cumulative so the diff can tell an APPEND (healthy)\n * from a REWRITE (a cache break) by comparing positionally — see\n * {@link CacheDimensionSnapshot.messageHashes}.\n *\n * Folds field-by-field into a rolling FNV rather than `JSON.stringify`-ing the\n * whole list at once: on a long run the transcript is hundreds of KB, and\n * building one giant string every turn just to throw it away is the kind of\n * overhead that gets telemetry ripped back out.\n *\n * Exported so hosts can stamp the same hashes onto their own spans.\n */\nexport function hashMessages(messages: readonly { role: string, content: unknown }[]): number[] {\n const out: number[] = []\n for (const message of messages) {\n if (!message) {\n out.push(0)\n continue\n }\n let h = mixString(FNV_OFFSET, message.role ?? '')\n // `JSON.stringify` yields `undefined` (the value, not a string) for\n // undefined input — public export, so don't let a malformed message throw\n // inside a diagnostics helper.\n h = mixString(h, JSON.stringify(message.content) ?? '')\n out.push(h >>> 0)\n }\n return out\n}\n\n/**\n * Index of the first message whose content differs, or -1 when one list is a\n * pure prefix of the other (i.e. messages were only appended).\n */\nfunction firstDivergentIndex(prev: readonly number[], curr: readonly number[]): number {\n const shared = Math.min(prev.length, curr.length)\n for (let i = 0; i < shared; i++) {\n if (prev[i] !== curr[i])\n return i\n }\n return -1\n}\n\n/** Mix a string into a running FNV-1a state. */\nfunction mixString(seed: number, s: string): number {\n let h = seed\n for (let i = 0; i < s.length; i++) {\n h ^= s.charCodeAt(i)\n h = Math.imul(h, FNV_PRIME)\n }\n return h\n}\n\n// ---------------------------------------------------------------------------\n// Diffing\n// ---------------------------------------------------------------------------\n\n/**\n * Compare two snapshots and return the list of dimensions whose bytes\n * differ. The `details` map carries a short human-readable description per\n * changed dimension (e.g. `system: 1024 → 1031 bytes`).\n *\n * Pure / no I/O. Use this in tests to assert the diff logic; the logger\n * itself just formats and emits the result.\n */\nexport function diffCacheDimensions(\n prev: CacheDimensionSnapshot,\n curr: CacheDimensionSnapshot,\n): CacheDimensionDiff {\n const changed: CacheDimensionName[] = []\n const details: Partial<Record<CacheDimensionName, string>> = {}\n\n if (prev.systemHash !== curr.systemHash) {\n changed.push('system')\n details.system = `${prev.systemBytes} → ${curr.systemBytes} bytes (hash ${hex(prev.systemHash)} → ${hex(curr.systemHash)})`\n }\n if (prev.toolsHash !== curr.toolsHash) {\n changed.push('tools')\n details.tools = `${prev.toolsCount} → ${curr.toolsCount} tools (hash ${hex(prev.toolsHash)} → ${hex(curr.toolsHash)})`\n }\n if (prev.model !== curr.model) {\n changed.push('model')\n details.model = `${prev.model} → ${curr.model}`\n }\n if (prev.thinking !== curr.thinking) {\n changed.push('thinking')\n details.thinking = `${prev.thinking} → ${curr.thinking}`\n }\n if (prev.thinkingBudget !== curr.thinkingBudget) {\n changed.push('thinkingBudget')\n details.thinkingBudget = `${prev.thinkingBudget} → ${curr.thinkingBudget}`\n }\n if (prev.taskBudget !== curr.taskBudget) {\n changed.push('taskBudget')\n details.taskBudget = `${prev.taskBudget} → ${curr.taskBudget}`\n }\n if (prev.effortHint !== curr.effortHint) {\n changed.push('effortHint')\n details.effortHint = `${prev.effortHint} → ${curr.effortHint}`\n }\n // Reported last, mirroring the provider's tools → system → messages ordering:\n // a change here invalidates the least, a change in `tools` the most.\n //\n // Only a POSITIONAL divergence counts. Appending messages is what every\n // healthy turn does and must never be reported, or this dimension would name\n // itself on every single break and bury the real culprit.\n const divergentAt = firstDivergentIndex(prev.messageHashes, curr.messageHashes)\n if (divergentAt >= 0) {\n changed.push('messagePrefix')\n // Two lines: the fact, then the usual suspects. Notice rows render each\n // line on its own so this never reads as one run-on sentence.\n details.messagePrefix = `message ${divergentAt} of ${prev.messageCount}→${curr.messageCount} rewritten`\n + `\\nlikely compaction or history trimming`\n }\n\n // Single tail return so a dimension added below the messagePrefix check can\n // never be silently skipped on the turns where the prefix diverged — the\n // turns where full attribution matters most.\n return { changed, details, ...(divergentAt >= 0 ? { messagePrefixDivergedAt: divergentAt } : {}) }\n}\n\nfunction hex(n: number): string {\n return `0x${n.toString(16).padStart(8, '0')}`\n}\n\n// ---------------------------------------------------------------------------\n// Hook installer\n// ---------------------------------------------------------------------------\n\n/**\n * Install the cache-break logger on an agent's hook bus.\n *\n * Subscribes to `turn:before` (snapshot) + `turn:after` (compare with prior\n * snapshot, log breaks). Returns an `uninstall` fn that detaches both\n * listeners. Idempotent w.r.t. agent lifecycle — installs/uninstalls cleanly\n * across runs.\n *\n * Recommended setup:\n *\n * ```ts\n * const uninstall = installCacheBreakLogger(agent.hooks, {\n * log: line => logger.debug(line),\n * verbose: !!process.env.ZIDANE_DEBUG?.includes('cache'),\n * })\n * // ...\n * uninstall()\n * ```\n *\n * Performance: hashing runs on each `turn:before` and is bounded by the\n * input size (system + tools serialization). Disabled callers pay nothing\n * (don't install).\n */\nexport function installCacheBreakLogger(\n hooks: Hookable<AgentHooks>,\n options: CacheBreakLoggerOptions = {},\n): () => void {\n const log = options.log ?? ((line: string) => console.error(line))\n // Defaults into `log` (not console.error): hosts route `log` away from\n // stderr for good reasons — the TUI's alternate screen, e.g. — and a\n // consumer bug should not get a louder channel than the feature itself.\n const onEmitError = options.onEmitError\n ?? ((error: unknown) => log(`cache-break: 'cache:break' handler threw: ${String(error)}`))\n const verbose = options.verbose === true\n const expectedReadAtLeast = options.expectedReadAtLeast ?? 1\n const expectedReadRatio = options.expectedReadRatio ?? 0.8\n\n // Per-bus latest snapshot. Keyed implicitly by the bus instance —\n // installing on a fresh bus starts from empty. Across runs on the same\n // bus, the snapshot persists, which is what we want: the first turn of\n // run N+1 should hit cache if it shares a prefix with the last turn of\n // run N. The detector reports correctly across that boundary.\n let prev: CacheDimensionSnapshot | undefined\n /**\n * Size of the prefix the previous turn left cached (`cacheRead +\n * cacheCreation`). Turn N+1 should read back at least this much.\n */\n let previousPrefixTokens = 0\n let turnIndex = 0\n let pending: { snapshot: CacheDimensionSnapshot, turnIndex: number, turnId: string } | undefined\n\n function onTurnBefore(ctx: { turn: number, turnId: string, options: StreamOptions }): void {\n const curr = snapshotCacheDimensions(ctx.options)\n turnIndex += 1\n\n if (verbose) {\n log(formatVerboseLine({\n turn: turnIndex,\n turnId: ctx.turnId,\n snapshot: curr,\n }))\n }\n\n // Stash for the matching `turn:after`. The confirmed-cost path can't run\n // here — the cache-read result lands on `turn:after.usage`.\n pending = { snapshot: curr, turnIndex, turnId: ctx.turnId }\n\n // Predictive path: the request bytes alone tell us the prefix moved,\n // before any provider accounting. `prev` is the last COMPLETED turn's\n // snapshot (assigned at its `turn:after`), so a turn that errors before\n // completion doesn't become the comparison baseline. Fires for\n // intentional rewrites too — that is the attribution channel for\n // compaction cuts and stale-read stubs, not noise (see CacheDriftInfo).\n //\n // FIRE-AND-FORGET, deliberately not awaited: `turn:before` is dispatched\n // through the loop's PROPAGATING hook timeout (`boundedHook`), so awaiting\n // arbitrary drift consumers here would let a slow subscriber time out the\n // whole dispatch and abort the run — the exact coupling `onEmitError`\n // exists to rule out. (`'cache:break'` on `turn:after` rides the\n // timeout-swallowing dispatch, so awaiting is safe THERE.) Synchronous\n // subscribers still complete before the request goes out — hookable\n // invokes handlers inline — while async subscribers detach; the payload is\n // a fresh object per emission, so detached consumers can't observe later\n // mutation. Errors from either path route to `onEmitError`.\n if (prev && turnIndex > 1) {\n const diff = diffCacheDimensions(prev, curr)\n if (diff.changed.length > 0) {\n try {\n void Promise.resolve(hooks.callHook('cache:drift', {\n turn: turnIndex,\n turnId: ctx.turnId,\n model: curr.model,\n changed: [...diff.changed],\n details: { ...diff.details },\n ...(diff.messagePrefixDivergedAt !== undefined ? { divergedAt: diff.messagePrefixDivergedAt } : {}),\n previousMessageCount: prev.messageCount,\n messageCount: curr.messageCount,\n })).catch(onEmitError)\n }\n catch (error) {\n // a synchronously-throwing dispatch path must not unwind into the loop\n onEmitError(error)\n }\n }\n }\n }\n\n async function onTurnAfter(ctx: { turn: number, turnId: string, usage: { cacheRead?: number, cacheCreation?: number } }): Promise<void> {\n if (!pending || pending.turnId !== ctx.turnId)\n return\n const { snapshot: curr, turnIndex: tIdx } = pending\n pending = undefined\n\n // Skip break detection on providers that don't report `cacheRead` —\n // treating undefined as 0 would log a false break every turn on Codex,\n // Cerebras, or any host without a cache_read field. We can only diagnose\n // breaks when the provider tells us how much cache was actually used.\n if (prev && tIdx > 1 && typeof ctx.usage.cacheRead === 'number') {\n const cacheRead = ctx.usage.cacheRead\n // Below the absolute floor, OR materially short of the prefix the previous\n // turn already had cached. The second test is the one that catches a\n // partial break, where `cacheRead` is large but covers only the scaffold.\n const ratioFloor = expectedReadRatio > 0 && previousPrefixTokens >= MIN_JUDGED_PREFIX_TOKENS\n ? previousPrefixTokens * expectedReadRatio\n : 0\n if (cacheRead < expectedReadAtLeast || cacheRead < ratioFloor) {\n const diff = diffCacheDimensions(prev, curr)\n // The text line stays gated on an attributable dimension change (its\n // historical behavior); the typed hook fires on EVERY break — an\n // empty `changed` is the TTL-expiry / provider-eviction signature and\n // hosts (TUI chip, dashboards) want to see it.\n if (diff.changed.length > 0) {\n log(formatBreakLine({\n turn: tIdx,\n turnId: ctx.turnId,\n cacheRead,\n cacheCreation: ctx.usage.cacheCreation ?? 0,\n diff,\n }))\n }\n // Emission is side-effect-safe: this runs inside the loop's\n // `turn:after` dispatch, so a throwing consumer handler (a UI bug,\n // say) would otherwise unwind into the loop and abort the run — a\n // bad trade for an observational diagnostics module. Errors are\n // surfaced through the `log` channel instead of propagated.\n try {\n await hooks.callHook('cache:break', {\n turn: tIdx,\n turnId: ctx.turnId,\n model: curr.model,\n cacheRead,\n cacheCreation: ctx.usage.cacheCreation ?? 0,\n // Journal mode pins `expectedReadAtLeast` to Infinity (\"report\n // every dimension change\"), and Infinity JSON-serializes as\n // `null` — a metrics pipeline consuming this payload would see a\n // null floor on every break. When the absolute floor is\n // non-finite, report the tightest FINITE floor that actually\n // tripped: the ratio floor when this turn read less than it,\n // otherwise the previous turn's cached prefix (the \"should have\n // read everything\" claim the pin amounts to).\n expectedAtLeast: Number.isFinite(expectedReadAtLeast)\n ? Math.max(expectedReadAtLeast, Math.round(ratioFloor))\n : cacheRead < ratioFloor\n ? Math.round(ratioFloor)\n : Math.round(previousPrefixTokens),\n rebilledTokens: Math.max(0, Math.round(previousPrefixTokens - cacheRead)),\n changed: [...diff.changed],\n details: { ...diff.details },\n })\n }\n catch (error) {\n onEmitError(error)\n }\n }\n }\n\n previousPrefixTokens = (ctx.usage.cacheRead ?? 0) + (ctx.usage.cacheCreation ?? 0)\n prev = curr\n }\n\n // Hookable's `.hook()` returns its own unregister fn — keep both so\n // `uninstall()` is symmetric with the install path and survives a\n // future hookable rename of `removeHook`.\n const unregisterBefore = hooks.hook('turn:before', onTurnBefore)\n const unregisterAfter = hooks.hook('turn:after', onTurnAfter)\n\n return () => {\n unregisterBefore()\n unregisterAfter()\n }\n}\n\n// ---------------------------------------------------------------------------\n// Formatting\n// ---------------------------------------------------------------------------\n\nfunction formatBreakLine(input: {\n turn: number\n turnId: string\n cacheRead: number\n cacheCreation: number\n diff: CacheDimensionDiff\n}): string {\n const names = input.diff.changed.join(', ')\n const details = input.diff.changed\n .map(d => ` ${d}: ${input.diff.details[d]}`)\n .join('\\n')\n return [\n `[zidane:cache-break] turn=${input.turn} turnId=${input.turnId} cacheRead=${input.cacheRead} cacheCreation=${input.cacheCreation}`,\n ` changed: ${names}`,\n details,\n ].join('\\n')\n}\n\nfunction formatVerboseLine(input: {\n turn: number\n turnId: string\n snapshot: CacheDimensionSnapshot\n}): string {\n const s = input.snapshot\n return `[zidane:cache] turn=${input.turn} turnId=${input.turnId} system=${hex(s.systemHash)}(${s.systemBytes}b) tools=${hex(s.toolsHash)}(${s.toolsCount}) model=${s.model} thinking=${s.thinking}/${s.thinkingBudget}${s.taskBudget ? `/task=${s.taskBudget}` : ''}`\n}\n"],"mappings":";AA2RA,MAAM,aAAa;AACnB,MAAM,YAAY;;;;;;AAOlB,MAAM,2BAA2B;;;;;;;;;;;;;;AAejC,SAAgB,QAAQ,GAAmB;CACzC,IAAI,IAAI;CACR,KAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK;EACjC,KAAK,EAAE,WAAW,CAAC;EAGnB,IAAI,KAAK,KAAK,GAAG,SAAS;CAC5B;CAEA,OAAO,MAAM;AACf;;;;;;;;AASA,SAAgB,wBAAwB,SAAgD;CACtF,MAAM,YAAY,KAAK,UAAU,QAAQ,SAAS,CAAC,CAAC;CACpD,MAAM,WAAW,QAAQ,YAAY,CAAC;CACtC,OAAO;EACL,YAAY,QAAQ,QAAQ,MAAM;EAClC,aAAa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,OAAO;EACL,6BAA6B,MAAM,KAAK,UAAU,MAAM,OAAO,aAAa,MAAM,UAAU,iBAAiB,MAAM;EACnH,cAAc;EACd;CACF,CAAC,CAAC,KAAK,IAAI;AACb;AAEA,SAAS,kBAAkB,OAIhB;CACT,MAAM,IAAI,MAAM;CAChB,OAAO,uBAAuB,MAAM,KAAK,UAAU,MAAM,OAAO,UAAU,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,WAAW,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,UAAU,EAAE,MAAM,YAAY,EAAE,SAAS,GAAG,EAAE,iBAAiB,EAAE,aAAa,SAAS,EAAE,eAAe;AACnQ"}
|
package/dist/chat/pure.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as formatTaskSummary, $t as chatReferenceTokensFromText, A as finalizeStreamingMarkdown, B as formatCredits, Bt as uniqueSkillNamesFromReferences, Ct as extractEditPayload, D as MAX_TRANSCRIPT_EVENTS, Dt as summarizeEditPayload, Et as splitLines, F as ProviderUsageStatus, G as updatedLabel, H as mostConstrainedWindow, Ht as createFilesCompletionProvider, I as ProviderUsageWindow, J as compactPath, Jt as createCommandsCompletionProvider, K as usageTone, L as UsageTone, Lt as summarizeOutcomes, M as turnContextSize, N as ProviderUsageCredits, O as TRANSCRIPT_TRIM_TO_EVENTS, Ot as tokenize, P as ProviderUsageSnapshot, Q as formatTaskStatus, Qt as ChatReferenceScope, R as activeSnapshotFor, Rt as SKILLS_TRIGGER, St as computeLineDiff, Tt as previewEditPayload, U as resetLabel, Ut as uniqueFilesFromReferences, V as formatUsagePercent, Vt as FILES_TRIGGER, W as showsAccount, X as fmtTokens, Xt as ChatReferenceData, Y as fmtCost, Yt as CHATS_TRIGGER, Z as formatDuration, Zt as ChatReferenceEntry, _t as PreviewResult, bt as buildUnifiedDiff, ct as retryLabel, dt as DiffOp, en as createChatsCompletionProvider, et as previewLine, ft as EditHunkSummary, gt as InlineSegment, ht as InlineDiff, i as turnAsText, it as cacheBreakChip, j as finalizeStreamingMarkdownForOwner, k as capTranscriptEvents, lt as streamingLabel, mt as HunkResolution, n as deleteTurnSafely, nn as blendHsl, nt as CacheChipContent, ot as compactingLabel, p as TodoItem, pt as EditSummary, q as ageString, qt as COMMANDS_TRIGGER, r as truncateTurnsAt, rn as buildLinearRamp, rt as CacheChipTone, st as liveSessionCost, t as countNeighbors, tn as uniqueChatIdsFromReferences, tt as shortId, ut as DiffLine, vt as applyEditPayload, wt as filetypeFromPath, xt as computeInlineDiff, yt as buildContextualDiff, z as formatBalance, zt as createSkillsCompletionProvider } from "../turn-operations-
|
|
3
|
-
import { A as filterSessionSearchCatalog, B as searchableTurnText, C as SearchSessionResult, D as SessionSearchIndex, E as SessionSearchExcerpt, F as searchSessionHistoryIndexAsync, I as searchSessionIndex, J as DAEMON_HEALTH_GLYPH, L as searchSessionIndexAsync, M as searchHighlightRanges, N as searchSessionHistory, O as buildSessionSearchIndex, P as searchSessionHistoryIndex, Q as DaemonHealthTone, R as searchSessionTurns, S as SearchExcerpt, T as SessionHistoryMatch, X as DaemonHealth, Y as DAEMON_HEALTH_STYLE, Z as DaemonHealthStyle, _ as normalizeMarkdownCodeFences, _t as retagUserPromptEventsFromRefs, a as formatToolCall, b as HighlightSegment, bt as turnSelectionOwnership, c as splitPromptSegments, ct as BASH_CALL_ID_PREFIX, d as filterModelCatalog, dt as isEditErrorResult, f as indexOfEntry, ft as isTurnHighlighted, g as chunkMarkdownForRender, gt as retagUserPromptEvents, h as MarkdownSegment, ht as promptTurnRefs, i as displayNameFor, j as highlightSegments, k as buildSessionSearchIndexAsync, l as CatalogEntry, lt as EDIT_TOOL_NAMES, m as MARKDOWN_RENDER_CHUNK_TARGET_BYTES, mt as isVisible, n as ToolDisplayMeta, nt as DEFAULT_OAUTH_ACCOUNT_LABEL, o as PromptSegment, p as parseCustomModelQuery, pt as isUserBashEvent, r as ToolFormatLine, s as PromptSegmentRef, st as oauthAccountLabel, t as TOOL_DISPLAY, u as buildModelCatalog, ut as PromptTurnRef, v as splitMarkdownCodeBlocks, vt as selectableTurnIds, w as SearchTurnResult, x as IndexedSearchTurn, y as HighlightRange, z as searchTurns } from "../tool-formatters-
|
|
1
|
+
import { Ad as shortSessionId, Au as collectReferences, Bd as formatRunDuration, Bp as LOG_LEVEL_CYCLE, Cd as orchestratedBy, Cs as PanelKeyValueItem, Cu as ActiveTrigger, Dd as sessionEventExcerpt, Dp as LogLevel, Ds as PanelSection, Du as CompletionReference, Ed as sessionDirLabel, Es as PanelRowItem, Eu as CompletionProvider, Fd as RunReceiptCellKind, Fu as Command, Gd as hasRunReceipt, Hd as formatRunReceiptLine, Hp as formatLogLine, Id as RunReceiptSegment, Kd as runReceiptFromRun, Kg as McpServerConfig, Ld as RunReceiptSegmentKind, Lu as CommandArgSuggestion, Md as RUN_RECEIPT_GLYPH, Mu as mergeReferences, Nd as RunReceipt, Nu as mergeSuggestions, Od as sessionEventLabel, Op as LogRecord, Os as normalizePanelContent, Pd as RunReceiptCell, Qd as chainsEqualKeyed, Rd as fitRunReceiptCells, Sd as isMainSession, Ss as PanelItem, Ts as PanelMarkdownItem, Tu as CompletionItem, Ud as formatTokenCount, Up as nextLogLevel, Vd as formatRunReceiptCells, Vp as filterLogRecords, Wd as formatTokensPerSecond, Xd as chainPositionOf, Yd as chainEntryKey, Zd as chainsEqual, _d as SessionEvent, _m as ContextMcpGroup, _s as PANEL_CONTENT_LIMITS, am as ContextSegmentsInput, bd as SessionEventTone, bm as buildContextBreakdown, bs as PanelCustomItem, cf as toggleKeyed, cm as ContextBreakdownContributionContext, dd as StreamEvent, dm as ContextCategory, ef as pickChainPrimary, fm as ContextCategoryId, gd as SESSION_ROLE_KEY, gm as ContextItem, gs as ExtensionPanelEntry, hd as SESSION_EVENT_STATUS_STYLE, hm as ContextExtensionSection, hs as ExtensionPanel, if as reorderKeyed, im as ContextSegmentOrigin, jd as truncateTitle, ju as findActiveTrigger, kd as sessionEventMeta, ks as panelBadgeText, ku as applyInsert, lf as AuthMethod, lm as ContextBreakdownContributor, mm as ContextExtensionRow, nf as positionKeyed, nm as ContextSegment, om as buildContextSegments, pd as ORCHESTRATED_BY_KEY, pm as ContextExactCounts, qd as ModelChainEntry, rm as ContextSegmentFile, sf as toggleChainEntry, sm as ContextBreakdown, tf as pickPrimaryKeyed, uf as ProviderAuth, um as ContextBreakdownOptions, vd as SessionEventStatus, vm as ContextSnapshot, vs as PanelAction, ws as PanelLoadContext, wu as CompletionContext, xd as WORKER_REPORT_FRAGMENT, xs as PanelIcon, yd as SessionEventStatusStyle, ym as ContextUsageSplit, ys as PanelContent, zd as formatCostUsd } from "../index-dXnPmqFx.js";
|
|
2
|
+
import { $ as formatTaskSummary, $t as chatReferenceTokensFromText, A as finalizeStreamingMarkdown, B as formatCredits, Bt as uniqueSkillNamesFromReferences, Ct as extractEditPayload, D as MAX_TRANSCRIPT_EVENTS, Dt as summarizeEditPayload, Et as splitLines, F as ProviderUsageStatus, G as updatedLabel, H as mostConstrainedWindow, Ht as createFilesCompletionProvider, I as ProviderUsageWindow, J as compactPath, Jt as createCommandsCompletionProvider, K as usageTone, L as UsageTone, Lt as summarizeOutcomes, M as turnContextSize, N as ProviderUsageCredits, O as TRANSCRIPT_TRIM_TO_EVENTS, Ot as tokenize, P as ProviderUsageSnapshot, Q as formatTaskStatus, Qt as ChatReferenceScope, R as activeSnapshotFor, Rt as SKILLS_TRIGGER, St as computeLineDiff, Tt as previewEditPayload, U as resetLabel, Ut as uniqueFilesFromReferences, V as formatUsagePercent, Vt as FILES_TRIGGER, W as showsAccount, X as fmtTokens, Xt as ChatReferenceData, Y as fmtCost, Yt as CHATS_TRIGGER, Z as formatDuration, Zt as ChatReferenceEntry, _t as PreviewResult, bt as buildUnifiedDiff, ct as retryLabel, dt as DiffOp, en as createChatsCompletionProvider, et as previewLine, ft as EditHunkSummary, gt as InlineSegment, ht as InlineDiff, i as turnAsText, it as cacheBreakChip, j as finalizeStreamingMarkdownForOwner, k as capTranscriptEvents, lt as streamingLabel, mt as HunkResolution, n as deleteTurnSafely, nn as blendHsl, nt as CacheChipContent, ot as compactingLabel, p as TodoItem, pt as EditSummary, q as ageString, qt as COMMANDS_TRIGGER, r as truncateTurnsAt, rn as buildLinearRamp, rt as CacheChipTone, st as liveSessionCost, t as countNeighbors, tn as uniqueChatIdsFromReferences, tt as shortId, ut as DiffLine, vt as applyEditPayload, wt as filetypeFromPath, xt as computeInlineDiff, yt as buildContextualDiff, z as formatBalance, zt as createSkillsCompletionProvider } from "../turn-operations-D0x_g6XQ.js";
|
|
3
|
+
import { A as filterSessionSearchCatalog, B as searchableTurnText, C as SearchSessionResult, D as SessionSearchIndex, E as SessionSearchExcerpt, F as searchSessionHistoryIndexAsync, I as searchSessionIndex, J as DAEMON_HEALTH_GLYPH, L as searchSessionIndexAsync, M as searchHighlightRanges, N as searchSessionHistory, O as buildSessionSearchIndex, P as searchSessionHistoryIndex, Q as DaemonHealthTone, R as searchSessionTurns, S as SearchExcerpt, T as SessionHistoryMatch, X as DaemonHealth, Y as DAEMON_HEALTH_STYLE, Z as DaemonHealthStyle, _ as normalizeMarkdownCodeFences, _t as retagUserPromptEventsFromRefs, a as formatToolCall, b as HighlightSegment, bt as turnSelectionOwnership, c as splitPromptSegments, ct as BASH_CALL_ID_PREFIX, d as filterModelCatalog, dt as isEditErrorResult, f as indexOfEntry, ft as isTurnHighlighted, g as chunkMarkdownForRender, gt as retagUserPromptEvents, h as MarkdownSegment, ht as promptTurnRefs, i as displayNameFor, j as highlightSegments, k as buildSessionSearchIndexAsync, l as CatalogEntry, lt as EDIT_TOOL_NAMES, m as MARKDOWN_RENDER_CHUNK_TARGET_BYTES, mt as isVisible, n as ToolDisplayMeta, nt as DEFAULT_OAUTH_ACCOUNT_LABEL, o as PromptSegment, p as parseCustomModelQuery, pt as isUserBashEvent, r as ToolFormatLine, s as PromptSegmentRef, st as oauthAccountLabel, t as TOOL_DISPLAY, u as buildModelCatalog, ut as PromptTurnRef, v as splitMarkdownCodeBlocks, vt as selectableTurnIds, w as SearchTurnResult, x as IndexedSearchTurn, y as HighlightRange, z as searchTurns } from "../tool-formatters-Bl1afA8N.js";
|
|
4
4
|
|
|
5
5
|
//#region src/chat/auth-rows.d.ts
|
|
6
6
|
/**
|
|
@@ -170,6 +170,59 @@ type NoticeSeverity = NonNullable<StreamEvent['notice']>['severity'];
|
|
|
170
170
|
/** Leading glyph per severity. `info` is deliberately quiet — a middle dot. */
|
|
171
171
|
declare const NOTICE_GLYPH: Readonly<Record<NoticeSeverity, string>>;
|
|
172
172
|
//#endregion
|
|
173
|
+
//#region src/chat/panels.d.ts
|
|
174
|
+
declare const ARTIFACTS_PANEL_ID = "artifacts";
|
|
175
|
+
/** Built-in tabs the hosts render with their own components. */
|
|
176
|
+
interface BuiltinPanelTab {
|
|
177
|
+
id: typeof ARTIFACTS_PANEL_ID;
|
|
178
|
+
label: string;
|
|
179
|
+
icon: PanelIcon;
|
|
180
|
+
builtin: true;
|
|
181
|
+
}
|
|
182
|
+
interface ExtensionPanelTab {
|
|
183
|
+
id: string;
|
|
184
|
+
label: string;
|
|
185
|
+
icon?: PanelIcon;
|
|
186
|
+
builtin: false;
|
|
187
|
+
owner: string;
|
|
188
|
+
}
|
|
189
|
+
type PanelTab = BuiltinPanelTab | ExtensionPanelTab;
|
|
190
|
+
declare const BUILTIN_PANEL_TABS: readonly BuiltinPanelTab[];
|
|
191
|
+
interface PanelCatalogOptions {
|
|
192
|
+
/** Hide the artifacts tab (the user's `artifacts: false` setting). */
|
|
193
|
+
showArtifacts?: boolean;
|
|
194
|
+
}
|
|
195
|
+
/** Built-ins first, then extension panels in registry (load) order. */
|
|
196
|
+
declare function buildPanelCatalog(extensionPanels: readonly Pick<ExtensionPanelEntry, 'id' | 'label' | 'icon' | 'owner'>[], options?: PanelCatalogOptions): PanelTab[];
|
|
197
|
+
interface PanelState {
|
|
198
|
+
open: boolean;
|
|
199
|
+
/** Active tab id; `null` when nothing has been chosen yet (hosts pick the first tab). */
|
|
200
|
+
activeId: string | null;
|
|
201
|
+
/** Monotonic counter bumped on every user pick; gates proactive opens. */
|
|
202
|
+
userPicks: number;
|
|
203
|
+
/** `userPicks` value at the last proactive open that was honoured. */
|
|
204
|
+
proactiveAt: number;
|
|
205
|
+
}
|
|
206
|
+
declare const INITIAL_PANEL_STATE: PanelState;
|
|
207
|
+
/** The user clicked a tab (or a keybinding cycled to it). Always honoured, always opens. */
|
|
208
|
+
declare function pickTab(state: PanelState, id: string): PanelState;
|
|
209
|
+
declare function togglePanel(state: PanelState): PanelState;
|
|
210
|
+
declare function closePanel(state: PanelState): PanelState;
|
|
211
|
+
/**
|
|
212
|
+
* Agent / extension asked to show a tab. Honoured only when the user has
|
|
213
|
+
* not picked a tab since the last honoured proactive open; otherwise the
|
|
214
|
+
* request is dropped and the state returned unchanged.
|
|
215
|
+
*/
|
|
216
|
+
declare function openProactive(state: PanelState, id: string): PanelState;
|
|
217
|
+
/**
|
|
218
|
+
* Resolve the tab to render: the active one when it still exists, else the
|
|
219
|
+
* first tab, else `null` (empty catalog). Keeps state stable when an
|
|
220
|
+
* extension is disabled and its tab vanishes.
|
|
221
|
+
*/
|
|
222
|
+
declare function resolveActiveTab(state: PanelState, catalog: readonly PanelTab[]): PanelTab | null;
|
|
223
|
+
/** Cycle to the next / previous tab (wraps). Counts as a user pick. */
|
|
224
|
+
declare function cycleTab(state: PanelState, catalog: readonly PanelTab[], direction: 1 | -1): PanelState;
|
|
225
|
+
//#endregion
|
|
173
226
|
//#region src/chat/todo-edits.d.ts
|
|
174
227
|
/**
|
|
175
228
|
* Mint an id that cannot collide with an existing row.
|
|
@@ -217,5 +270,5 @@ declare function cycleTodoStatus(items: readonly TodoItem[], id: string): TodoIt
|
|
|
217
270
|
*/
|
|
218
271
|
declare function buildTodoRetryMessage(item: TodoItem): string;
|
|
219
272
|
//#endregion
|
|
220
|
-
export { type ActiveTrigger, type AuthMethod, BASH_CALL_ID_PREFIX, type BuildVisibleInstructionRowsOptions, CHATS_TRIGGER, COMMANDS_TRIGGER, type CacheChipContent, type CacheChipTone, type CatalogEntry, type ChatReferenceData, type ChatReferenceEntry, type ChatReferenceScope, type Command, type CommandArgSuggestion, type CompletionContext, type CompletionItem, type CompletionProvider, type CompletionReference, type ContextBreakdown, type ContextBreakdownContributionContext, type ContextBreakdownContributor, type ContextBreakdownOptions, type ContextCategory, type ContextCategoryId, type ContextExactCounts, type ContextExtensionRow, type ContextExtensionSection, type ContextItem, type ContextMcpGroup, type ContextSegment, type ContextSegmentFile, type ContextSegmentOrigin, type ContextSegmentsInput, type ContextSnapshot, type ContextUsageSplit, DAEMON_HEALTH_GLYPH, DAEMON_HEALTH_STYLE, DEFAULT_OAUTH_ACCOUNT_LABEL, type DaemonHealth, type DaemonHealthStyle, type DaemonHealthTone, type DiffLine, type DiffOp, EDIT_TOOL_NAMES, type EditHunkSummary, type EditSummary, FILES_TRIGGER, type HighlightRange, type HighlightSegment, type HunkResolution, INSTRUCTION_PREVIEW_LINE_CAP, type IndexedSearchTurn, type InlineDiff, type InlineSegment, type InstallScopeChoice, LOG_LEVEL_CYCLE, type LogLevel, type LogRecord, MARKDOWN_RENDER_CHUNK_TARGET_BYTES, MAX_TRANSCRIPT_EVENTS, MCP_TRANSPORTS, type MarkdownSegment, type McpFormResult, type McpFormValues, type McpTransport, type ModelChainEntry, NOTICE_GLYPH, type NoticeSeverity, ORCHESTRATED_BY_KEY, type PreviewResult, type PromptSegment, type PromptSegmentRef, type PromptTurnRef, type ProviderAuth, type ProviderUsageCredits, type ProviderUsageSnapshot, type ProviderUsageStatus, type ProviderUsageWindow, RUN_RECEIPT_GLYPH, type RunReceipt, type RunReceiptCell, type RunReceiptCellKind, type RunReceiptSegment, type RunReceiptSegmentKind, SESSION_EVENT_STATUS_STYLE, SESSION_ROLE_KEY, SKILLS_TRIGGER, type SearchExcerpt, type SearchSessionResult, type SearchTurnResult, type SessionEvent, type SessionEventStatus, type SessionEventStatusStyle, type SessionEventTone, type SessionHistoryMatch, type SessionSearchExcerpt, type SessionSearchIndex, TOOL_DISPLAY, TRANSCRIPT_TRIM_TO_EVENTS, type ToolDisplayMeta, type ToolFormatLine, type UsageTone, type VisibleAuthRow, type VisibleInstructionRow, WORKER_REPORT_FRAGMENT, activeSnapshotFor, addTodo, ageString, applyEditPayload, applyInsert, blendHsl, buildContextBreakdown, buildContextSegments, buildContextualDiff, buildLinearRamp, buildModelCatalog, buildSessionSearchIndex, buildSessionSearchIndexAsync, buildTodoRetryMessage, buildUnifiedDiff, buildVisibleAuthRows, buildVisibleInstructionRows, cacheBreakChip, capTranscriptEvents, chainEntryKey, chainPositionOf, chainsEqual, chainsEqualKeyed, chatReferenceTokensFromText, chunkMarkdownForRender, clearTodos, collectReferences, compactPath, compactingLabel, computeInlineDiff, computeLineDiff, countNeighbors, createChatsCompletionProvider, createCommandsCompletionProvider, createFilesCompletionProvider, createSkillsCompletionProvider, cycleTodoStatus, deleteTurnSafely, displayNameFor, editTodo, extractEditPayload, filetypeFromPath, filterLogRecords, filterModelCatalog, filterSessionSearchCatalog, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, findActiveTrigger, fitRunReceiptCells, fmtCost, fmtTokens, formatBalance, formatCostUsd, formatCredits, formatDuration, formatLogLine, formatRunDuration, formatRunReceiptCells, formatRunReceiptLine, formatTaskStatus, formatTaskSummary, formatTokenCount, formatTokensPerSecond, formatToolCall, formatUsagePercent, hasRunReceipt, highlightSegments, indexOfEntry, indexOfProviderRow, instructionOriginBadge, instructionPreviewLines, isEditErrorResult, isExpandableProvider, isMainSession, isTurnHighlighted, isUserBashEvent, isVisible, liveSessionCost, mergeReferences, mergeSuggestions, mostConstrainedWindow, nextLogLevel, nextTodoId, normalizeMarkdownCodeFences, oauthAccountLabel, orchestratedBy, parentProviderKey, parseCustomModelQuery, parseKeyValueLines, pickChainPrimary, pickPrimaryKeyed, positionKeyed, previewEditPayload, previewLine, promptTurnRefs, removeTodo, reorderKeyed, resetLabel, retagUserPromptEvents, retagUserPromptEventsFromRefs, retryLabel, runReceiptFromRun, searchHighlightRanges, searchSessionHistory, searchSessionHistoryIndex, searchSessionHistoryIndexAsync, searchSessionIndex, searchSessionIndexAsync, searchSessionTurns, searchTurns, searchableTurnText, selectableSources, selectableTurnIds, sessionDirLabel, sessionEventExcerpt, sessionEventLabel, sessionEventMeta, shortId, shortSessionId, showsAccount, splitCommandLine, splitLines, splitMarkdownCodeBlocks, splitPromptSegments, streamingLabel, summarizeEditPayload, summarizeOutcomes, toggleChainEntry, toggleKeyed, tokenize, truncateTitle, truncateTurnsAt, turnAsText, turnContextSize, turnSelectionOwnership, uniqueChatIdsFromReferences, uniqueFilesFromReferences, uniqueSkillNamesFromReferences, updatedLabel, usageTone, validateMcpForm };
|
|
273
|
+
export { ARTIFACTS_PANEL_ID, type ActiveTrigger, type AuthMethod, BASH_CALL_ID_PREFIX, BUILTIN_PANEL_TABS, type BuildVisibleInstructionRowsOptions, type BuiltinPanelTab, CHATS_TRIGGER, COMMANDS_TRIGGER, type CacheChipContent, type CacheChipTone, type CatalogEntry, type ChatReferenceData, type ChatReferenceEntry, type ChatReferenceScope, type Command, type CommandArgSuggestion, type CompletionContext, type CompletionItem, type CompletionProvider, type CompletionReference, type ContextBreakdown, type ContextBreakdownContributionContext, type ContextBreakdownContributor, type ContextBreakdownOptions, type ContextCategory, type ContextCategoryId, type ContextExactCounts, type ContextExtensionRow, type ContextExtensionSection, type ContextItem, type ContextMcpGroup, type ContextSegment, type ContextSegmentFile, type ContextSegmentOrigin, type ContextSegmentsInput, type ContextSnapshot, type ContextUsageSplit, DAEMON_HEALTH_GLYPH, DAEMON_HEALTH_STYLE, DEFAULT_OAUTH_ACCOUNT_LABEL, type DaemonHealth, type DaemonHealthStyle, type DaemonHealthTone, type DiffLine, type DiffOp, EDIT_TOOL_NAMES, type EditHunkSummary, type EditSummary, type ExtensionPanel, type ExtensionPanelEntry, type ExtensionPanelTab, FILES_TRIGGER, type HighlightRange, type HighlightSegment, type HunkResolution, INITIAL_PANEL_STATE, INSTRUCTION_PREVIEW_LINE_CAP, type IndexedSearchTurn, type InlineDiff, type InlineSegment, type InstallScopeChoice, LOG_LEVEL_CYCLE, type LogLevel, type LogRecord, MARKDOWN_RENDER_CHUNK_TARGET_BYTES, MAX_TRANSCRIPT_EVENTS, MCP_TRANSPORTS, type MarkdownSegment, type McpFormResult, type McpFormValues, type McpTransport, type ModelChainEntry, NOTICE_GLYPH, type NoticeSeverity, ORCHESTRATED_BY_KEY, PANEL_CONTENT_LIMITS, type PanelAction, type PanelCatalogOptions, type PanelContent, type PanelCustomItem, type PanelIcon, type PanelItem, type PanelKeyValueItem, type PanelLoadContext, type PanelMarkdownItem, type PanelRowItem, type PanelSection, type PanelState, type PanelTab, type PreviewResult, type PromptSegment, type PromptSegmentRef, type PromptTurnRef, type ProviderAuth, type ProviderUsageCredits, type ProviderUsageSnapshot, type ProviderUsageStatus, type ProviderUsageWindow, RUN_RECEIPT_GLYPH, type RunReceipt, type RunReceiptCell, type RunReceiptCellKind, type RunReceiptSegment, type RunReceiptSegmentKind, SESSION_EVENT_STATUS_STYLE, SESSION_ROLE_KEY, SKILLS_TRIGGER, type SearchExcerpt, type SearchSessionResult, type SearchTurnResult, type SessionEvent, type SessionEventStatus, type SessionEventStatusStyle, type SessionEventTone, type SessionHistoryMatch, type SessionSearchExcerpt, type SessionSearchIndex, TOOL_DISPLAY, TRANSCRIPT_TRIM_TO_EVENTS, type ToolDisplayMeta, type ToolFormatLine, type UsageTone, type VisibleAuthRow, type VisibleInstructionRow, WORKER_REPORT_FRAGMENT, activeSnapshotFor, addTodo, ageString, applyEditPayload, applyInsert, blendHsl, buildContextBreakdown, buildContextSegments, buildContextualDiff, buildLinearRamp, buildModelCatalog, buildPanelCatalog, buildSessionSearchIndex, buildSessionSearchIndexAsync, buildTodoRetryMessage, buildUnifiedDiff, buildVisibleAuthRows, buildVisibleInstructionRows, cacheBreakChip, capTranscriptEvents, chainEntryKey, chainPositionOf, chainsEqual, chainsEqualKeyed, chatReferenceTokensFromText, chunkMarkdownForRender, clearTodos, closePanel, collectReferences, compactPath, compactingLabel, computeInlineDiff, computeLineDiff, countNeighbors, createChatsCompletionProvider, createCommandsCompletionProvider, createFilesCompletionProvider, createSkillsCompletionProvider, cycleTab, cycleTodoStatus, deleteTurnSafely, displayNameFor, editTodo, extractEditPayload, filetypeFromPath, filterLogRecords, filterModelCatalog, filterSessionSearchCatalog, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, findActiveTrigger, fitRunReceiptCells, fmtCost, fmtTokens, formatBalance, formatCostUsd, formatCredits, formatDuration, formatLogLine, formatRunDuration, formatRunReceiptCells, formatRunReceiptLine, formatTaskStatus, formatTaskSummary, formatTokenCount, formatTokensPerSecond, formatToolCall, formatUsagePercent, hasRunReceipt, highlightSegments, indexOfEntry, indexOfProviderRow, instructionOriginBadge, instructionPreviewLines, isEditErrorResult, isExpandableProvider, isMainSession, isTurnHighlighted, isUserBashEvent, isVisible, liveSessionCost, mergeReferences, mergeSuggestions, mostConstrainedWindow, nextLogLevel, nextTodoId, normalizeMarkdownCodeFences, normalizePanelContent, oauthAccountLabel, openProactive, orchestratedBy, panelBadgeText, parentProviderKey, parseCustomModelQuery, parseKeyValueLines, pickChainPrimary, pickPrimaryKeyed, pickTab, positionKeyed, previewEditPayload, previewLine, promptTurnRefs, removeTodo, reorderKeyed, resetLabel, resolveActiveTab, retagUserPromptEvents, retagUserPromptEventsFromRefs, retryLabel, runReceiptFromRun, searchHighlightRanges, searchSessionHistory, searchSessionHistoryIndex, searchSessionHistoryIndexAsync, searchSessionIndex, searchSessionIndexAsync, searchSessionTurns, searchTurns, searchableTurnText, selectableSources, selectableTurnIds, sessionDirLabel, sessionEventExcerpt, sessionEventLabel, sessionEventMeta, shortId, shortSessionId, showsAccount, splitCommandLine, splitLines, splitMarkdownCodeBlocks, splitPromptSegments, streamingLabel, summarizeEditPayload, summarizeOutcomes, toggleChainEntry, toggleKeyed, togglePanel, tokenize, truncateTitle, truncateTurnsAt, turnAsText, turnContextSize, turnSelectionOwnership, uniqueChatIdsFromReferences, uniqueFilesFromReferences, uniqueSkillNamesFromReferences, updatedLabel, usageTone, validateMcpForm };
|
|
221
274
|
//# sourceMappingURL=pure.d.ts.map
|
package/dist/chat/pure.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pure.d.ts","names":[],"sources":["../../src/chat/auth-rows.ts","../../src/chat/instruction-rows.ts","../../src/chat/mcp-form.ts","../../src/chat/notice-format.ts","../../src/chat/todo-edits.ts"],"mappings":";;;;;AAwCA;;;;;;;;AAAA,KAXY,cAAA;EACJ,IAAA;EAAkB,QAAA,EAAU,YAAA;EAAc,UAAA;AAAA;EAC1C,IAAA;EAAgB,WAAA;EAAqB,MAAA,EAAQ,UAAU;AAAA;;;;;;;;iBAS/C,iBAAA,CAAkB,QAAA,EAAU,YAAA,GAAe,UAAU;;iBAKrD,oBAAA,CAAqB,QAAsB,EAAZ,YAAY;;AAgB1C;AA6BjB;;;;AAAqD;AAWrD;;iBA3CgB,oBAAA,CACd,SAAA,WAAoB,YAAA,IACpB,QAAA,EAAU,WAAA,WACT,cAAA;;;;;iBA6Ba,iBAAA,CAAkB,GAAmB,EAAd,cAAc;AAWkC;;;;ACjFvF;;;ADiFuF,iBAAvE,kBAAA,CAAmB,IAAA,WAAe,cAAc,IAAI,WAAA;;;;;;;;;cCjFvD,4BAAA;ADoBb;AAAA,UCjBiB,qBAAA;EACf,OAAA,EAAS,cAAc;EACvB,QAAA;AAAA;AAAA,UAGe,kCAAA;EACf,QAAA,WAAmB,cAAA;EDWgD;ECTnE,QAAA,EAAU,WAAA;EDcI;ECZd,WAAA;;EAEA,YAAA,GAAe,OAAA,EAAS,cAAA;AAAA;ADuB1B;;;;;;;;;AAAA,iBCXgB,2BAAA,CACd,IAAA,EAAM,kCAAA,GACL,qBAAqB;;;;;ADYP;AA6BjB;;;;AAAqD;iBCpBrC,uBAAA,CAAwB,IAAA;EAAiB,KAAA;EAAiB,MAAA;AAAA;;;;;AD+Ba;iBCZvE,sBAAA,CAAuB,OAAuB,EAAd,cAAc;;;;KC3ElD,kBAAA;AAAA,KAEA,YAAA;AAAA,cAEC,cAAA,WAAyB,YAAY;AAAA,UAEjC,aAAA;EACf,IAAA;EACA,SAAA,EAAW,YAAA;EFkBG;EEhBd,WAAA;;EAEA,GAAA;EFc0C;EEZ1C,GAAA;EFYyD;EEVzD,OAAA;EACA,KAAA,EAAO,kBAAkB;AAAA;AAAA,UAGV,aAAA;EACf,KAAA,EAAO,eAAA;EACP,KAAA,EAAO,kBAAkB;AAAA;AFsB3B;;;;AAAA,iBEfgB,eAAA,CAAgB,MAAA,EAAQ,aAAA;EAAkB,EAAA;EAAU,MAAA,EAAQ,aAAa;AAAA;EAAO,EAAA;EAAW,KAAA;AAAA;;;;AFkB1F;AA6BjB;iBEIgB,gBAAA,CAAiB,IAAY;;;AFJQ;AAWrD;;;;;iBESgB,kBAAA,CACd,GAAA,UACA,IAAA;EAAQ,KAAA;EAAe,UAAA;AAAA;EACpB,EAAA;EAAU,KAAA,EAAO,MAAM;AAAA;EAAuB,EAAA;EAAW,KAAA;AAAA;;;KCvGlD,cAAA,GAAiB,WAAW,CAAC,WAAA;;cAG5B,YAAA,EAAc,QAAA,CAAS,MAAA,CAAO,cAAA;;;;;;
|
|
1
|
+
{"version":3,"file":"pure.d.ts","names":[],"sources":["../../src/chat/auth-rows.ts","../../src/chat/instruction-rows.ts","../../src/chat/mcp-form.ts","../../src/chat/notice-format.ts","../../src/chat/panels.ts","../../src/chat/todo-edits.ts"],"mappings":";;;;;AAwCA;;;;;;;;AAAA,KAXY,cAAA;EACJ,IAAA;EAAkB,QAAA,EAAU,YAAA;EAAc,UAAA;AAAA;EAC1C,IAAA;EAAgB,WAAA;EAAqB,MAAA,EAAQ,UAAU;AAAA;;;;;;;;iBAS/C,iBAAA,CAAkB,QAAA,EAAU,YAAA,GAAe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;;;;;;AJrF/B;AAS/D;;;iBKTgB,UAAA,CAAW,KAA0B,WAAV,QAAQ;;;;;ALSkB;iBKKrD,OAAA,CAAQ,KAAA,WAAgB,QAAA,IAAY,OAAA,WAAkB,QAAQ;;;;ALAnB;AAa3D;iBKDgB,QAAA,CAAS,KAAA,WAAgB,QAAA,IAAY,EAAA,UAAY,OAAA,WAAkB,QAAQ;;iBAQ3E,UAAA,CAAW,KAAA,WAAgB,QAAA,IAAY,EAAA,WAAa,QAAQ;;iBAK5D,UAAA,IAAc,QAAQ;;;;;;;;;ALTrB;AA6BjB;iBKNgB,eAAA,CAAgB,KAAA,WAAgB,QAAA,IAAY,EAAA,WAAa,QAAQ;;;ALM5B;AAWrD;;;;;;iBKmBgB,qBAAA,CAAsB,IAAc,EAAR,QAAQ"}
|
package/dist/chat/pure.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as buildContextBreakdown, m as buildContextSegments, n as normalizePanelContent, p as oauthAccountLabel, r as panelBadgeText, s as DEFAULT_OAUTH_ACCOUNT_LABEL, t as PANEL_CONTENT_LIMITS } from "../panels-B6gRk4bf.js";
|
|
2
2
|
import { a as formatDuration, c as previewLine, i as fmtTokens, l as shortId, n as compactPath, o as formatTaskStatus, r as fmtCost, s as formatTaskSummary, t as ageString } from "../format-BF745pLL.js";
|
|
3
3
|
import { i as nextLogLevel, n as filterLogRecords, r as formatLogLine, t as LOG_LEVEL_CYCLE } from "../logs-view-CWG8aUAG.js";
|
|
4
4
|
import { a as mergeReferences, n as collectReferences, o as mergeSuggestions, r as findActiveTrigger, t as applyInsert } from "../completion-core-BRo86R_L.js";
|
|
5
|
-
import { $ as pickChainPrimary, $t as formatCostUsd, A as indexOfEntry, An as uniqueChatIdsFromReferences, Bt as isMainSession, C as resetLabel, Ct as isVisible, D as splitPromptSegments, Dn as CHATS_TRIGGER, Dt as retagUserPromptEvents, E as usageTone, En as summarizeOutcomes, Et as promptTurnRefs, Ft as ORCHESTRATED_BY_KEY, G as DAEMON_HEALTH_GLYPH, Gt as sessionDirLabel, H as liveSessionCost, I as normalizeMarkdownCodeFences, It as SESSION_EVENT_STATUS_STYLE, J as chainEntryKey, Jt as sessionEventMeta, K as DAEMON_HEALTH_STYLE, Kt as sessionEventExcerpt, L as splitMarkdownCodeBlocks, Lt as SESSION_ROLE_KEY, M as MARKDOWN_RENDER_CHUNK_TARGET_BYTES, Mt as turnSelectionOwnership, N as chunkMarkdownForRender, O as buildModelCatalog, On as chatReferenceTokensFromText, Ot as retagUserPromptEventsFromRefs, Qt as fitRunReceiptCells, Rt as WORKER_REPORT_FRAGMENT, S as mostConstrainedWindow, St as isUserBashEvent, T as updatedLabel, U as retryLabel, V as compactingLabel, Vt as orchestratedBy, W as streamingLabel, X as chainsEqual, Xt as truncateTitle, Y as chainPositionOf, Yt as shortSessionId, Z as chainsEqualKeyed, Zt as RUN_RECEIPT_GLYPH, _ as turnContextSize, _n as summarizeEditPayload, _t as buildLinearRamp, a as TOOL_DISPLAY, an as hasRunReceipt, b as formatCredits, bt as isEditErrorResult, c as MAX_TRANSCRIPT_EVENTS, cn as buildContextualDiff, ct as SKILLS_TRIGGER, d as finalizeStreamingMarkdown, dn as computeInlineDiff, dt as FILES_TRIGGER, en as formatRunDuration, et as pickPrimaryKeyed, f as finalizeStreamingMarkdownForOwner, fn as computeLineDiff, ft as createFilesCompletionProvider, gn as splitLines, gt as blendHsl, hn as previewEditPayload, ht as createCommandsCompletionProvider, i as turnAsText, in as formatTokensPerSecond, j as parseCustomModelQuery, k as filterModelCatalog, kn as createChatsCompletionProvider, kt as selectableTurnIds, l as TRANSCRIPT_TRIM_TO_EVENTS, ln as buildUnifiedDiff, lt as createSkillsCompletionProvider, mn as filetypeFromPath, mt as COMMANDS_TRIGGER, n as deleteTurnSafely, nn as formatRunReceiptLine, o as displayNameFor, on as runReceiptFromRun, ot as toggleChainEntry, pn as extractEditPayload, pt as uniqueFilesFromReferences, qt as sessionEventLabel, r as truncateTurnsAt, rn as formatTokenCount, rt as reorderKeyed, s as formatToolCall, sn as applyEditPayload, st as toggleKeyed, t as countNeighbors, tn as formatRunReceiptCells, tt as positionKeyed, u as capTranscriptEvents, ut as uniqueSkillNamesFromReferences, v as activeSnapshotFor, vn as tokenize, vt as BASH_CALL_ID_PREFIX, w as showsAccount, x as formatUsagePercent, xt as isTurnHighlighted, y as formatBalance, yt as EDIT_TOOL_NAMES, z as cacheBreakChip } from "../turn-operations-
|
|
5
|
+
import { $ as pickChainPrimary, $t as formatCostUsd, A as indexOfEntry, An as uniqueChatIdsFromReferences, Bt as isMainSession, C as resetLabel, Ct as isVisible, D as splitPromptSegments, Dn as CHATS_TRIGGER, Dt as retagUserPromptEvents, E as usageTone, En as summarizeOutcomes, Et as promptTurnRefs, Ft as ORCHESTRATED_BY_KEY, G as DAEMON_HEALTH_GLYPH, Gt as sessionDirLabel, H as liveSessionCost, I as normalizeMarkdownCodeFences, It as SESSION_EVENT_STATUS_STYLE, J as chainEntryKey, Jt as sessionEventMeta, K as DAEMON_HEALTH_STYLE, Kt as sessionEventExcerpt, L as splitMarkdownCodeBlocks, Lt as SESSION_ROLE_KEY, M as MARKDOWN_RENDER_CHUNK_TARGET_BYTES, Mt as turnSelectionOwnership, N as chunkMarkdownForRender, O as buildModelCatalog, On as chatReferenceTokensFromText, Ot as retagUserPromptEventsFromRefs, Qt as fitRunReceiptCells, Rt as WORKER_REPORT_FRAGMENT, S as mostConstrainedWindow, St as isUserBashEvent, T as updatedLabel, U as retryLabel, V as compactingLabel, Vt as orchestratedBy, W as streamingLabel, X as chainsEqual, Xt as truncateTitle, Y as chainPositionOf, Yt as shortSessionId, Z as chainsEqualKeyed, Zt as RUN_RECEIPT_GLYPH, _ as turnContextSize, _n as summarizeEditPayload, _t as buildLinearRamp, a as TOOL_DISPLAY, an as hasRunReceipt, b as formatCredits, bt as isEditErrorResult, c as MAX_TRANSCRIPT_EVENTS, cn as buildContextualDiff, ct as SKILLS_TRIGGER, d as finalizeStreamingMarkdown, dn as computeInlineDiff, dt as FILES_TRIGGER, en as formatRunDuration, et as pickPrimaryKeyed, f as finalizeStreamingMarkdownForOwner, fn as computeLineDiff, ft as createFilesCompletionProvider, gn as splitLines, gt as blendHsl, hn as previewEditPayload, ht as createCommandsCompletionProvider, i as turnAsText, in as formatTokensPerSecond, j as parseCustomModelQuery, k as filterModelCatalog, kn as createChatsCompletionProvider, kt as selectableTurnIds, l as TRANSCRIPT_TRIM_TO_EVENTS, ln as buildUnifiedDiff, lt as createSkillsCompletionProvider, mn as filetypeFromPath, mt as COMMANDS_TRIGGER, n as deleteTurnSafely, nn as formatRunReceiptLine, o as displayNameFor, on as runReceiptFromRun, ot as toggleChainEntry, pn as extractEditPayload, pt as uniqueFilesFromReferences, qt as sessionEventLabel, r as truncateTurnsAt, rn as formatTokenCount, rt as reorderKeyed, s as formatToolCall, sn as applyEditPayload, st as toggleKeyed, t as countNeighbors, tn as formatRunReceiptCells, tt as positionKeyed, u as capTranscriptEvents, ut as uniqueSkillNamesFromReferences, v as activeSnapshotFor, vn as tokenize, vt as BASH_CALL_ID_PREFIX, w as showsAccount, x as formatUsagePercent, xt as isTurnHighlighted, y as formatBalance, yt as EDIT_TOOL_NAMES, z as cacheBreakChip } from "../turn-operations-D_k_FEur.js";
|
|
6
6
|
import { a as searchHighlightRanges, c as searchSessionHistoryIndexAsync, d as searchSessionTurns, f as searchTurns, i as highlightSegments, l as searchSessionIndex, n as buildSessionSearchIndexAsync, o as searchSessionHistory, p as searchableTurnText, r as filterSessionSearchCatalog, s as searchSessionHistoryIndex, t as buildSessionSearchIndex, u as searchSessionIndexAsync } from "../history-search-C4bk1Wz_.js";
|
|
7
|
-
import {
|
|
8
|
-
export { BASH_CALL_ID_PREFIX, CHATS_TRIGGER, COMMANDS_TRIGGER, DAEMON_HEALTH_GLYPH, DAEMON_HEALTH_STYLE, DEFAULT_OAUTH_ACCOUNT_LABEL, EDIT_TOOL_NAMES, FILES_TRIGGER, INSTRUCTION_PREVIEW_LINE_CAP, LOG_LEVEL_CYCLE, MARKDOWN_RENDER_CHUNK_TARGET_BYTES, MAX_TRANSCRIPT_EVENTS, MCP_TRANSPORTS, NOTICE_GLYPH, ORCHESTRATED_BY_KEY, RUN_RECEIPT_GLYPH, SESSION_EVENT_STATUS_STYLE, SESSION_ROLE_KEY, SKILLS_TRIGGER, TOOL_DISPLAY, TRANSCRIPT_TRIM_TO_EVENTS, WORKER_REPORT_FRAGMENT, activeSnapshotFor, addTodo, ageString, applyEditPayload, applyInsert, blendHsl, buildContextBreakdown, buildContextSegments, buildContextualDiff, buildLinearRamp, buildModelCatalog, buildSessionSearchIndex, buildSessionSearchIndexAsync, buildTodoRetryMessage, buildUnifiedDiff, buildVisibleAuthRows, buildVisibleInstructionRows, cacheBreakChip, capTranscriptEvents, chainEntryKey, chainPositionOf, chainsEqual, chainsEqualKeyed, chatReferenceTokensFromText, chunkMarkdownForRender, clearTodos, collectReferences, compactPath, compactingLabel, computeInlineDiff, computeLineDiff, countNeighbors, createChatsCompletionProvider, createCommandsCompletionProvider, createFilesCompletionProvider, createSkillsCompletionProvider, cycleTodoStatus, deleteTurnSafely, displayNameFor, editTodo, extractEditPayload, filetypeFromPath, filterLogRecords, filterModelCatalog, filterSessionSearchCatalog, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, findActiveTrigger, fitRunReceiptCells, fmtCost, fmtTokens, formatBalance, formatCostUsd, formatCredits, formatDuration, formatLogLine, formatRunDuration, formatRunReceiptCells, formatRunReceiptLine, formatTaskStatus, formatTaskSummary, formatTokenCount, formatTokensPerSecond, formatToolCall, formatUsagePercent, hasRunReceipt, highlightSegments, indexOfEntry, indexOfProviderRow, instructionOriginBadge, instructionPreviewLines, isEditErrorResult, isExpandableProvider, isMainSession, isTurnHighlighted, isUserBashEvent, isVisible, liveSessionCost, mergeReferences, mergeSuggestions, mostConstrainedWindow, nextLogLevel, nextTodoId, normalizeMarkdownCodeFences, oauthAccountLabel, orchestratedBy, parentProviderKey, parseCustomModelQuery, parseKeyValueLines, pickChainPrimary, pickPrimaryKeyed, positionKeyed, previewEditPayload, previewLine, promptTurnRefs, removeTodo, reorderKeyed, resetLabel, retagUserPromptEvents, retagUserPromptEventsFromRefs, retryLabel, runReceiptFromRun, searchHighlightRanges, searchSessionHistory, searchSessionHistoryIndex, searchSessionHistoryIndexAsync, searchSessionIndex, searchSessionIndexAsync, searchSessionTurns, searchTurns, searchableTurnText, selectableSources, selectableTurnIds, sessionDirLabel, sessionEventExcerpt, sessionEventLabel, sessionEventMeta, shortId, shortSessionId, showsAccount, splitCommandLine, splitLines, splitMarkdownCodeBlocks, splitPromptSegments, streamingLabel, summarizeEditPayload, summarizeOutcomes, toggleChainEntry, toggleKeyed, tokenize, truncateTitle, truncateTurnsAt, turnAsText, turnContextSize, turnSelectionOwnership, uniqueChatIdsFromReferences, uniqueFilesFromReferences, uniqueSkillNamesFromReferences, updatedLabel, usageTone, validateMcpForm };
|
|
7
|
+
import { A as parentProviderKey, C as INSTRUCTION_PREVIEW_LINE_CAP, D as buildVisibleAuthRows, E as instructionPreviewLines, O as indexOfProviderRow, S as validateMcpForm, T as instructionOriginBadge, _ as togglePanel, a as editTodo, b as parseKeyValueLines, c as ARTIFACTS_PANEL_ID, d as buildPanelCatalog, f as closePanel, g as resolveActiveTab, h as pickTab, i as cycleTodoStatus, j as selectableSources, k as isExpandableProvider, l as BUILTIN_PANEL_TABS, m as openProactive, n as buildTodoRetryMessage, o as nextTodoId, p as cycleTab, r as clearTodos, s as removeTodo, t as addTodo, u as INITIAL_PANEL_STATE, v as NOTICE_GLYPH, w as buildVisibleInstructionRows, x as splitCommandLine, y as MCP_TRANSPORTS } from "../todo-edits-PxMJvYIX.js";
|
|
8
|
+
export { ARTIFACTS_PANEL_ID, BASH_CALL_ID_PREFIX, BUILTIN_PANEL_TABS, CHATS_TRIGGER, COMMANDS_TRIGGER, DAEMON_HEALTH_GLYPH, DAEMON_HEALTH_STYLE, DEFAULT_OAUTH_ACCOUNT_LABEL, EDIT_TOOL_NAMES, FILES_TRIGGER, INITIAL_PANEL_STATE, INSTRUCTION_PREVIEW_LINE_CAP, LOG_LEVEL_CYCLE, MARKDOWN_RENDER_CHUNK_TARGET_BYTES, MAX_TRANSCRIPT_EVENTS, MCP_TRANSPORTS, NOTICE_GLYPH, ORCHESTRATED_BY_KEY, PANEL_CONTENT_LIMITS, RUN_RECEIPT_GLYPH, SESSION_EVENT_STATUS_STYLE, SESSION_ROLE_KEY, SKILLS_TRIGGER, TOOL_DISPLAY, TRANSCRIPT_TRIM_TO_EVENTS, WORKER_REPORT_FRAGMENT, activeSnapshotFor, addTodo, ageString, applyEditPayload, applyInsert, blendHsl, buildContextBreakdown, buildContextSegments, buildContextualDiff, buildLinearRamp, buildModelCatalog, buildPanelCatalog, buildSessionSearchIndex, buildSessionSearchIndexAsync, buildTodoRetryMessage, buildUnifiedDiff, buildVisibleAuthRows, buildVisibleInstructionRows, cacheBreakChip, capTranscriptEvents, chainEntryKey, chainPositionOf, chainsEqual, chainsEqualKeyed, chatReferenceTokensFromText, chunkMarkdownForRender, clearTodos, closePanel, collectReferences, compactPath, compactingLabel, computeInlineDiff, computeLineDiff, countNeighbors, createChatsCompletionProvider, createCommandsCompletionProvider, createFilesCompletionProvider, createSkillsCompletionProvider, cycleTab, cycleTodoStatus, deleteTurnSafely, displayNameFor, editTodo, extractEditPayload, filetypeFromPath, filterLogRecords, filterModelCatalog, filterSessionSearchCatalog, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, findActiveTrigger, fitRunReceiptCells, fmtCost, fmtTokens, formatBalance, formatCostUsd, formatCredits, formatDuration, formatLogLine, formatRunDuration, formatRunReceiptCells, formatRunReceiptLine, formatTaskStatus, formatTaskSummary, formatTokenCount, formatTokensPerSecond, formatToolCall, formatUsagePercent, hasRunReceipt, highlightSegments, indexOfEntry, indexOfProviderRow, instructionOriginBadge, instructionPreviewLines, isEditErrorResult, isExpandableProvider, isMainSession, isTurnHighlighted, isUserBashEvent, isVisible, liveSessionCost, mergeReferences, mergeSuggestions, mostConstrainedWindow, nextLogLevel, nextTodoId, normalizeMarkdownCodeFences, normalizePanelContent, oauthAccountLabel, openProactive, orchestratedBy, panelBadgeText, parentProviderKey, parseCustomModelQuery, parseKeyValueLines, pickChainPrimary, pickPrimaryKeyed, pickTab, positionKeyed, previewEditPayload, previewLine, promptTurnRefs, removeTodo, reorderKeyed, resetLabel, resolveActiveTab, retagUserPromptEvents, retagUserPromptEventsFromRefs, retryLabel, runReceiptFromRun, searchHighlightRanges, searchSessionHistory, searchSessionHistoryIndex, searchSessionHistoryIndexAsync, searchSessionIndex, searchSessionIndexAsync, searchSessionTurns, searchTurns, searchableTurnText, selectableSources, selectableTurnIds, sessionDirLabel, sessionEventExcerpt, sessionEventLabel, sessionEventMeta, shortId, shortSessionId, showsAccount, splitCommandLine, splitLines, splitMarkdownCodeBlocks, splitPromptSegments, streamingLabel, summarizeEditPayload, summarizeOutcomes, toggleChainEntry, toggleKeyed, togglePanel, tokenize, truncateTitle, truncateTurnsAt, turnAsText, turnContextSize, turnSelectionOwnership, uniqueChatIdsFromReferences, uniqueFilesFromReferences, uniqueSkillNamesFromReferences, updatedLabel, usageTone, validateMcpForm };
|
package/dist/chat.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $d as
|
|
2
|
-
import { $ as ProjectsFile, $i as ChatTurnsReadToolOptions, $n as shouldAutoGenerateTitle, $r as updateAppliedMarkerPath, $t as parentServerName, A as buildSkillsConfig, Ai as ArtifactViewRow, An as createMemoryApprovalsStore, Ar as bootTick, At as modelChainMetadata, B as SettingsCategoryDescriptor, Bi as COMMUNICATION_DOCTRINE, Bn as QueuedAttachment, Br as useUpdateCheck, Bt as clearMcpToolsCache, C as userSystemMdPath, Ci as performInPlaceSelfUpdate, Cn as EditOutcomeLedger, Cr as ClaudeImportSummary, Ct as redirectUriFromAuthUrl, D as SpawnStartRecord, Di as chatWindowBehavior, Dn as ApprovalHub, Dr as importFromClaudeCode, Dt as runOAuthLogin, E as useStreamBuffer, Ei as chatAutoCompactBehavior, En as runCompaction, Er as hasClaudeCodeSetup, Et as oauthUsesManualCodePaste, F as SETTINGS_CATEGORIES, Fi as DiscoverAgentsMdOptions, Fn as CommandSummary, Fr as upgradeInstalledPackages, Ft as mcpsWritePath, G as StringSettingKey, Gi as INTERACTION_GUIDANCE_NO_PROMPTS, Gn as SessionPresence, Gr as InstalledVersionWatcher, Gt as subscribeMcpToolsCache, H as SettingsInput, Hi as EnvSectionOptions, Hn as RunningWorkItem, Hr as RunUpdateCommandResult, Ht as mcpToolsCachePath, I as SETTINGS_CHOICES, Ii as discoverAgentsMd, In as HostSettings, Ir as BuildUpdateHintOptions, It as removeMcpServer, J as folderlessCwd, Ji as SUBAGENT_GUIDANCE, Jn as WireApprovalRequest, Jr as UseRestartRequiredOptions, Jt as useMcpToolToggleMap, K as enforceSettingsInvariants, Ki as PLAN_MODE_DOCTRINE, Kn as StreamProgressInfo, Kr as UPDATE_APPLIED_MARKER, Kt as McpToolToggleSet, L as SETTINGS_INPUTS, Li as renderAgentsMdBlock, Ln as HostSignal, Lr as UseUpdateCheckOptions, Lt as upsertMcpServer, M as discoverProjectSkills, Mi as summarizeArtifactCounts, Mn as PendingApprovalsStore, Mr as UpgradePackageResult, Mt as McpConfigScope, N as BooleanSettingKey, Ni as AgentsMdFile, Nn as ApprovalOriginator, Nr as UpgradeProgressEvent, Nt as RemoveMcpResult, O as buildSpawnEndEvent, Oi as ArtifactScope, On as ApprovalRequestInput, Or as tryOpenBrowser, Ot as supportsOAuth, P as DEFAULT_SETTINGS, Pi as AgentsMdResult, Pn as CommandArgSuggestionSummary, Pr as UpgradeReport, Pt as UpsertMcpResult, Q as ProjectEntry, Qi as envSection, Qn as generateSessionTitle, Qr as readUpdateAppliedMarker, Qt as indexOfServerRow, R as SETTINGS_TOGGLES, Ri as ACTIONS_WITH_CARE_DOCTRINE, Rn as PendingInteraction, Rr as buildRestartHint, Rt as CachedMcpToolList, S as userScopeOverridesLoad, Si as parseSemver, Sn as createInteractionHub, Sr as ClaudeImportOptions, St as normalizeRedirectPaste, T as StreamSource, Ti as resolvePlatformPackage, Tn as CompactionEntry, Tr as countClaudeSessionFiles, Tt as OAuthPrompt, U as SettingsProvider, Ui as IDENTITY_PREFIX, Un as SendOptions, Ur as runUpdateCommand, Ut as refreshMcpToolsCatalog, V as SettingsChoice, Vi as DOING_TASKS_DOCTRINE, Vn as QueuedItem, Vr as RunUpdateCommandOptions, Vt as loadMcpToolsCache, W as SettingsToggle, Wi as INTERACTION_GUIDANCE, Wn as SerializedPreview, Wr as InstalledVersionState, Wt as saveMcpToolsCache, X as scopeCwd, Xi as buildBuildSystem, Xn as GenerateSessionTitleOptions, Xr as hasUpdateAppliedMarker, Xt as VisibleMcpRow, Y as resolveSessionCwd, Yi as TOKEN_DISCIPLINE_DOCTRINE, Yn as toTodosSnapshot, Yr as WatchInstalledVersionOptions, Yt as useMcpToolToggleSet, Z as IMPLICITLY_SAFE_TOOLS, Zi as buildPlanSystem, Zn as cleanTitle, Zr as probeInstalledVersion, Zt as buildVisibleMcpRows, _ as DiscoverSystemMdOptions, _i as checkForUpdate, _n as createChatHost, _r as ArtifactReferenceData, _t as usageSourceFor, a as GRUVBOX_DARK, ai as findInstalledCompanion, an as useMcpAuthState, ar as Commit, at as readProjects, b as discoverSystemMd, bi as detectLibc, br as scoreArtifacts, bt as FetchOAuthRedirectResult, c as CATPPUCCIN_LATTE, ci as InPlaceUpdateResult, cn as McpAuthStatus, cr as Walk, ct as runEndNotice, d as ThemeProvider, di as PerformInPlaceUpdateOptions, dn as extractEditPayloadForGate, dr as DiscoveryProvider, dt as clearProviderUsageCache, ea as chatReferenceTokensForPrompt, ei as useRestartRequired, en as createFileMcpCredentialStore, er as BuildHintsOptions, et as addToSafelist, f as useColors, fi as PerformSelfUpdateOptions, fn as readFileSafe, fr as useDiscovery, ft as fetchAllProviderUsage, g as useTheme, gi as UpdateStatus, gn as ContextSegmentsReport, gr as ARTIFACTS_COMPLETION_PROVIDER_ID, gt as usageChecksOptedOut, h as useSyntaxStyles, hi as TarballAvailabilityOptions, hn as ChatHost, hr as useConfig, ht as providerUsageSupported, i as VAPORWAVE_THEME, ia as unwrapCallTool, ii as InstalledCompanion, in as useMcpAuthDispatch, ir as quoteForShell, it as projectsFilePath, j as defaultSkillScanPaths, ji as groupArtifacts, jn as ChatHostEnvironment, jr as UpgradeInstalledPackagesOptions, jt as sessionModelFallbacks, k as buildSpawnStartEvent, ki as ArtifactViewGroup, kn as createApprovalHub, kr as bootProfileEnabled, kt as ModelFallbackTarget, l as CATPPUCCIN_MACCHIATO, li as PackageManagerCommand, ln as getMcpAuthStatus, lr as createDiscoverySlot, lt as FetchProviderUsageOptions, m as useSurfaces, mi as SelfUpdateResult, mn as serializePreview, mr as ConfigProvider, mt as fetchProviderUsageAccounts, n as createActiveTodoAnchorHooks, na as CALL_TOOL_NAME, ni as writeUpdateAppliedMarker, nn as patchMcpCredential, nr as shortChord, nt as isOnSafelist, o as GRUVBOX_LIGHT, oi as CheckForUpdateOptions, on as McpAuthEvent, or as DiscoverySlot, ot as suggestSafelistEntries, p as useSelectStyle, pi as PlatformTarballOptions, pn as resolveCwdPath, pr as useDiscoveryOptional, pt as fetchProviderUsage, q as useSettings, qi as PLAN_MODE_DOCTRINE_NO_PROMPTS, qn as TodosSnapshot, qr as UpdateAppliedMarker, qt as buildToolToggle, r as renderActiveTodoAnchor, ra as UnwrappedToolCall, ri as CompanionSpec, rn as McpAuthProvider, rr as parseEditorCommand, rt as matchesSafelistEntry, s as CATPPUCCIN_FRAPPE, si as DetectPackageManagerOptions, sn as McpAuthStateMap, sr as DiscoverySlotOptions, st as writeProjects, t as ActiveTodoAnchorOptions, ta as createChatTurnsReadTool, ti as watchInstalledVersion, tn as mcpCredentialsPath, tr as buildHints, tt as getSafelist, u as CATPPUCCIN_MOCHA, ui as PackageManagerId, un as reduceMcpAuth, ur as DiscoveryContextValue, ut as USAGE_CACHE_TTL_MS, v as SystemMdFile, vi as checkTarballAvailable, vr as ArtifactReferenceEntry, vt as findGitRoot, w as StreamBuffer, wi as performSelfUpdate, wn as PendingAnnotation, wr as ClaudeSessionImportResult, wt as OAuthFlowOptions, x as renderSystemMdSeed, xi as detectPackageManager, xn as InteractionHub, xr as ClaudeCopyResult, xt as fetchOAuthRedirect, y as SystemMdResult, yi as compareSemver, yr as createArtifactsCompletionProvider, yt as formatPathForCwd, z as SettingsCategory, zi as BuildSystemOptions, zn as PromptAttachment, zr as buildUpdateHint, zt as McpToolsCache } from "./index-
|
|
3
|
-
import { $ as ModelUsageSummary, A as ProviderCredential, At as groupBindings, B as removeStoredCredential, Bt as Hint, C as discoverProjectMcps, Ct as KeyBindingDef, D as OAuthCredential, Dt as ResolvedExtensionKeybinding, E as CredentialsFile, Et as ParsedBinding, F as readCredentials, Ft as readKeybindings, G as writeCredentials, H as setPreferredCredential, Ht as hintsLength, I as readProviderCredential, It as readKeybindingsRaw, J as ProviderRegistry, K as AutoUpdateConfig, L as readProviderCredentialPair, Lt as resolveExtensionKeybindings, M as StoredCredential, Mt as matchesBinding, N as applyApiKeyEnv, Nt as mergeKeybindings, O as PreferCredentialResult, Ot as ensureKeybindingsFile, P as credentialsPath, Pt as parseBindingSpec, Q as resolveStoragePaths, R as readProviderCredentials, Rt as stripJsonComments, S as defaultMcpsConfigPaths, St as KeyAction, T as ApiKeyCredential, Tt as KeyBindings, U as setProviderCredential, Ut as truncateTrailing, V as setCredentialLabel, Vt as clipHintsToWidth, W as storedCredentialsOf, X as ResolvedPaths, Y as ResolvedConfig, Z as resolveConfig, _ as DiscoveredMcp, _t as usageByModel, a as SessionExportTarget, at as eventsFromTurns, b as buildMcpServers, bt as KEYBINDING_DEF_BY_ACTION, c as writeSessionExport, ct as loadState, d as useEnabledToggleSet, dt as stripSpawnTokensLine, et as StateStoreApi, f as DiscoveredPlugin, ft as sumRunCosts, g as projectUserPaths, gt as updateToolEventOutcomes, h as ProjectUserPath, ht as toolResultText, i as SessionExportFormat, it as deriveSessionTitle, j as SetProviderCredentialOptions, jt as keybindingsPath, k as PreferredCredentialTarget, kt as formatBindingForDisplay, l as EnabledAllowlistKey, lt as marginTopFor, m as discoverProjectPlugins, mt as toolCallPreview, n as computeTurnAnchors, nt as compactSummaryEvent, o as renderSession, ot as lastContextSizeFromTurns, p as buildPluginContributions, pt as titleFromTurns, q as ChatOptions, r as SessionExportAnchor, rt as createStateStore, s as resolveSessionExportTarget, st as listSessionMeta, t as TranscriptItem, tt as TuiState, u as EnabledToggleSet, ut as saveState, v as DiscoveryError, vt as DEFAULT_KEYBINDINGS, w as parseMcpsFile, wt as KeyBindingSection, x as dedupMcpServersByName, xt as KEYBINDING_KEY_COL_WIDTH, y as DiscoveryResult, yt as KEYBINDING_DEFS, z as removeProviderCredential, zt as EMPTY_HINTS } from "./transcript-anchors-
|
|
4
|
-
import { $ as formatTaskSummary, $t as chatReferenceTokensFromText, A as finalizeStreamingMarkdown, At as buildEditOutcomesAnnotation, Bt as uniqueSkillNamesFromReferences, C as sanitizeTodoItems, Ct as extractEditPayload, D as MAX_TRANSCRIPT_EVENTS, Dt as summarizeEditPayload, E as useActiveTodos, Et as splitLines, F as ProviderUsageStatus, Ft as rewriteMultiEditHeader, Gt as ListProjectFilesOptions, H as mostConstrainedWindow, Ht as createFilesCompletionProvider, I as ProviderUsageWindow, It as stripEditOutcomesAnnotation, J as compactPath, Jt as createCommandsCompletionProvider, Kt as listProjectFiles, Lt as summarizeOutcomes, M as turnContextSize, Mt as mergeApprovalAndBodyOutcomes, N as ProviderUsageCredits, Nt as parseEditOutcomesFromResult, O as TRANSCRIPT_TRIM_TO_EVENTS, Ot as tokenize, P as ProviderUsageSnapshot, Pt as resolveApprovalForPayload, Q as formatTaskStatus, Qt as ChatReferenceScope, R as activeSnapshotFor, Rt as SKILLS_TRIGGER, S as pruneTodosByRun, St as computeLineDiff, T as setTodosForRun, Tt as previewEditPayload, Ut as uniqueFilesFromReferences, V as formatUsagePercent, Vt as FILES_TRIGGER, W as showsAccount, Wt as FileEntry, X as fmtTokens, Xt as ChatReferenceData, Y as fmtCost, Yt as CHATS_TRIGGER, Z as formatDuration, Zt as ChatReferenceEntry, _ as createTodoTools, _t as PreviewResult, a as ActiveTodosState, at as cacheBreakNoticeText, b as isTodoTool, bt as buildUnifiedDiff, c as TODOREAD_TOOL, ct as retryLabel, d as TODO_STATUS_GLYPHS, dt as DiffOp, en as createChatsCompletionProvider, et as previewLine, f as TODO_WRITE_COUNTS_METADATA_KEY, ft as EditHunkSummary, g as TodosBag, gt as InlineSegment, h as TodoTally, ht as InlineDiff, i as turnAsText, it as cacheBreakChip, j as finalizeStreamingMarkdownForOwner, jt as maskToOutcomeKinds, k as capTranscriptEvents, kt as ResolvedApproval, l as TODOS_METADATA_KEY, m as TodoStatus, mt as HunkResolution, n as deleteTurnSafely, nn as blendHsl, nt as CacheChipContent, o as CreateTodoToolsOptions, ot as compactingLabel, p as TodoItem, pt as EditSummary, q as ageString, qt as COMMANDS_TRIGGER, r as truncateTurnsAt, rn as buildLinearRamp, rt as CacheChipTone, s as DEFAULT_MAX_TODO_ITEMS, t as countNeighbors, tn as uniqueChatIdsFromReferences, tt as shortId, u as TODOWRITE_TOOL, ut as DiffLine, v as getArchivedTodosForRun, vt as applyEditPayload, w as selectActiveTodos, wt as filetypeFromPath, x as pickActiveRunId, xt as computeInlineDiff, y as getTodosForRun, yt as buildContextualDiff, zt as createSkillsCompletionProvider } from "./turn-operations-
|
|
5
|
-
import { $ as ACCOUNT_CRED_KEY_INFIX, A as filterSessionSearchCatalog, B as searchableTurnText, C as SearchSessionResult, D as SessionSearchIndex, E as SessionSearchExcerpt, F as searchSessionHistoryIndexAsync, G as SafeModeProvider, H as ApprovalRequest, I as searchSessionIndex, J as DAEMON_HEALTH_GLYPH, K as useSafeModeActions, L as searchSessionIndexAsync, M as searchHighlightRanges, N as searchSessionHistory, O as buildSessionSearchIndex, P as searchSessionHistoryIndex, Q as DaemonHealthTone, R as searchSessionTurns, S as SearchExcerpt, T as SessionHistoryMatch, U as RequestApproval, V as ApprovalDecision, W as SafeModeActions, X as DaemonHealth, Y as DAEMON_HEALTH_STYLE, Z as DaemonHealthStyle, _ as normalizeMarkdownCodeFences, a as formatToolCall, at as isAccountCredKey, b as HighlightSegment, bt as turnSelectionOwnership, c as splitPromptSegments, d as filterModelCatalog, dt as isEditErrorResult, et as ALTERNATE_CRED_KEY_SUFFIX, f as indexOfEntry, ft as isTurnHighlighted, g as chunkMarkdownForRender, h as MarkdownSegment, i as displayNameFor, it as alternateCredKey, j as highlightSegments, k as buildSessionSearchIndexAsync, l as CatalogEntry, m as MARKDOWN_RENDER_CHUNK_TARGET_BYTES, mt as isVisible, n as ToolDisplayMeta, nt as DEFAULT_OAUTH_ACCOUNT_LABEL, o as PromptSegment, ot as isReservedCredKey, q as useSafeModeQueue, r as ToolFormatLine, rt as accountCredKey, s as PromptSegmentRef, st as oauthAccountLabel, t as TOOL_DISPLAY, tt as CRED_KEY_SLOT_SEPARATOR, u as buildModelCatalog, v as splitMarkdownCodeBlocks, vt as selectableTurnIds, w as SearchTurnResult, x as IndexedSearchTurn, y as HighlightRange, yt as selectionAfterTurnRemoval, z as searchTurns } from "./tool-formatters-
|
|
1
|
+
import { $d as filterChainFallbacks, $f as PlanRequest, $l as StorageMode, $o as ExtensionStorageSurface, $p as accentColor, $u as parseCommandInvocation, Ad as shortSessionId, Af as piIdOf, Au as collectReferences, Bd as formatRunDuration, Bf as AnswerValue, Bi as generateStructuredData, Cd as orchestratedBy, Cf as getModelInfo, Cu as ActiveTrigger, Dd as sessionEventExcerpt, Df as modelsForDescriptor, Du as CompletionReference, Ed as sessionDirLabel, Ef as modelSupportsReasoning, Eo as ExtensionContext, Eu as CompletionProvider, Fa as inlineLoadedExtension, Fd as RunReceiptCellKind, Ff as OUTPUT_RESERVE_TOKENS, Fo as ExtensionKeybinding, Fu as Command, Gd as hasRunReceipt, Gf as InteractionRequest, Go as ExtensionProviderMiddleware, Gp as AgentProfile, Hd as formatRunReceiptLine, Hf as CreateInteractionToolsOptions, Ho as ExtensionPaths, Hu as CommandInvocation, Id as RunReceiptSegment, If as effectiveContextWindow, Io as ExtensionKeybindingDispatchContext, Iu as CommandAgentResult, Jd as buildRunModel, Jf as InteractionsProvider, Jo as ExtensionRuntimeEnv, Jp as BUILTIN_AGENTS, Ju as CommandStepFn, Kd as runReceiptFromRun, Kf as InteractionResponse, Ko as ExtensionRegistry, Kp as AgentRegistry, Ku as CommandStep, Ld as RunReceiptSegmentKind, Lf as shouldAutoCompact, Lo as ExtensionManifest, Md as RUN_RECEIPT_GLYPH, Mf as AUTO_COMPACT_MIN_GROWTH_FRACTION, Mo as ExtensionFooterHint, Mu as mergeReferences, Na as defaultExtensionScanPaths, Nd as RunReceipt, Nf as AutoCompactDecision, No as ExtensionGuiPanel, Nu as mergeSuggestions, Od as sessionEventLabel, Of as openaiDescriptor, Oo as ExtensionContributions, Pa as discoverExtensions, Pd as RunReceiptCell, Pf as AutoCompactInput, Qf as PlanPayload, Ql as StorageDirs, Qo as ExtensionStorageScope, Qp as PLAN_AGENT, Qu as executeCommand, Ra as scanExtensionDirectories, Rd as fitRunReceiptCells, Rf as ASK_USER_TOOL, Ro as ExtensionMcpConfigTransform, Sd as isMainSession, Sf as getContextWindow, Su as useCompletion, Td as renderSessionEventXml, Tf as modelOptionsFor, To as ExtensionCapability, Tu as CompletionItem, Ud as formatTokenCount, Uf as HOST_INTERACTION_ID_PREFIX, Uo as ExtensionPermission, Uu as CommandOutputBlock, Vd as formatRunReceiptCells, Vf as ConfirmQuestion, Vo as ExtensionOrderedContribution, Wa as defineExtension, Wd as formatTokensPerSecond, Wf as InteractionOrigin, Wp as AgentAccent, Xd as chainPositionOf, Xf as PendingInteractionEntry, Xo as ExtensionSkillPolicy, Xp as DEFAULT_BUDGET_EXCLUDE_TOOLS, Yf as PRESENT_PLAN_TOOL, Yo as ExtensionSessionStateSurface, Yp as DEFAULT_AGENT_ID, Zd as chainsEqual, Zf as PlanDecision, Zl as ResolveStorageDirsOptions, Zo as ExtensionSource, Zp as DEFAULT_PERSIST_EXCLUDE_TOOLS, Zu as commandSteps, _d as SessionEvent, _f as ProviderDescriptor, _m as ContextMcpGroup, _p as serializeInteractionResponse, _u as createPathAutocompleteProvider, aa as buildExtensionRegistry, ad as InteractionMode, af as restoreChainFallbacks, am as ContextSegmentsInput, ap as QuestionRequest, au as DEFAULT_THEME, bd as SessionEventTone, bf as credKeyOf, bm as buildContextBreakdown, bu as tokenEndingAtCursor, ca as filterExtensionRegistry, cd as Screen, cm as ContextBreakdownContributionContext, cp as SelectQuestion, cu as Theme, da as partitionExtensionCatalog, dd as StreamEvent, df as ProviderKey, dm as ContextCategory, do as EMPTY_EXTENSION_REGISTRY, dp as createAutomaticInteractionResponse, ds as GuiContributions, du as ThemeSurfaces, ed as EditDiffDisplay, em as resolveAgentId, ep as PlanResponse, es as ExtensionToolCatalogTransform, eu as StorageSlot, fd as ToolCallDisplay, ff as detectAuth, fm as ContextCategoryId, fp as createInteractionTools, fs as LoadedExtension, fu as resolveChipColor, gd as SESSION_ROLE_KEY, gf as ModelOption, gm as ContextItem, gp as pendingInteractionsFromTurns, gu as InlineGhost, hd as SESSION_EVENT_STATUS_STYLE, hf as ModelInfo, hm as ContextExtensionSection, hp as makeRequestInteraction, hu as InlineAutocompleteProvider, ia as buildExtensionPreset, id as EditPayload, im as ContextSegmentOrigin, ip as QuestionPayload, iu as ChipColorMap, jd as truncateTitle, jf as restoreModelOptions, jo as ExtensionDefinition, ju as findActiveTrigger, kd as sessionEventMeta, kf as openrouterDescriptor, ku as applyInsert, ld as SessionMeta, lf as AuthMethod, lm as ContextBreakdownContributor, lp as TextQuestion, lu as ThemeColors, mf as CustomField, mm as ContextExtensionRow, mp as isModelInteraction, ms as TuiContributions, mu as InlineAutocompleteContext, na as BuildExtensionRegistryOptions, nd as EditOutcome, nm as ContextSegment, np as Question, nu as BUILTIN_THEMES, oa as composeExtensionPreset, od as Owner, of as sanitizeModelChain, om as buildContextSegments, op as QuestionResponse, os as ExtensionToolResultMetadataRegistration, ou as SyntaxStyles, pd as ORCHESTRATED_BY_KEY, pf as BUILTIN_PROVIDERS, pm as ContextExactCounts, po as ExtensionApiVersion, pp as isInteractionTool, pu as resolveTheme, qd as ModelChainEntry, qf as InteractionsActions, qo as ExtensionRunTransform, qp as BUILD_AGENT, qu as CommandStepContext, rd as EditOutcomeKind, rf as providerKeySetChanged, rm as ContextSegmentFile, rp as QuestionChoice, ru as ChipColor, sa as disposeExtensionRegistry, sd as Picked, sf as toggleChainEntry, sm as ContextBreakdown, sp as QuestionType, su as SyntaxTokenStyle, td as EditHunk, tm as singleAgentRegistry, tp as PlanStep, tu as resolveStorageDirs, ua as mergeContributions, ud as Settings, uf as ProviderAuth, um as ContextBreakdownOptions, up as buildResumedToolResultsTurn, uu as ThemeSelect, vd as SessionEventStatus, vf as anthropicDescriptor, vm as ContextSnapshot, vp as useInteractionsActions, vu as patchInlineGhost, wd as parseSessionEventXml, wf as localDescriptor, wu as CompletionContext, xd as WORKER_REPORT_FRAGMENT, xf as enabledModelOptions, xo as ExtensionBehaviorTransform, xu as CompletionState, yd as SessionEventStatusStyle, yf as cerebrasDescriptor, ym as ContextUsageSplit, yp as useInteractionsQueue, yu as resolveInlineSuggestion, zd as formatCostUsd, zf as AUTOMATIC_INTERACTION_INSTRUCTION, zi as GenerateStructuredDataOptions, zo as ExtensionModal, zu as CommandExecution } from "./index-dXnPmqFx.js";
|
|
2
|
+
import { $ as ProjectsFile, $i as ChatTurnsReadToolOptions, $n as shouldAutoGenerateTitle, $r as updateAppliedMarkerPath, $t as parentServerName, A as buildSkillsConfig, Ai as ArtifactViewRow, An as createMemoryApprovalsStore, Ar as bootTick, At as modelChainMetadata, B as SettingsCategoryDescriptor, Bi as COMMUNICATION_DOCTRINE, Bn as QueuedAttachment, Br as useUpdateCheck, Bt as clearMcpToolsCache, C as userSystemMdPath, Ci as performInPlaceSelfUpdate, Cn as EditOutcomeLedger, Cr as ClaudeImportSummary, Ct as redirectUriFromAuthUrl, D as SpawnStartRecord, Di as chatWindowBehavior, Dn as ApprovalHub, Dr as importFromClaudeCode, Dt as runOAuthLogin, E as useStreamBuffer, Ei as chatAutoCompactBehavior, En as runCompaction, Er as hasClaudeCodeSetup, Et as oauthUsesManualCodePaste, F as SETTINGS_CATEGORIES, Fi as DiscoverAgentsMdOptions, Fn as CommandSummary, Fr as upgradeInstalledPackages, Ft as mcpsWritePath, G as StringSettingKey, Gi as INTERACTION_GUIDANCE_NO_PROMPTS, Gn as SessionPresence, Gr as InstalledVersionWatcher, Gt as subscribeMcpToolsCache, H as SettingsInput, Hi as EnvSectionOptions, Hn as RunningWorkItem, Hr as RunUpdateCommandResult, Ht as mcpToolsCachePath, I as SETTINGS_CHOICES, Ii as discoverAgentsMd, In as HostSettings, Ir as BuildUpdateHintOptions, It as removeMcpServer, J as folderlessCwd, Ji as SUBAGENT_GUIDANCE, Jn as WireApprovalRequest, Jr as UseRestartRequiredOptions, Jt as useMcpToolToggleMap, K as enforceSettingsInvariants, Ki as PLAN_MODE_DOCTRINE, Kn as StreamProgressInfo, Kr as UPDATE_APPLIED_MARKER, Kt as McpToolToggleSet, L as SETTINGS_INPUTS, Li as renderAgentsMdBlock, Ln as HostSignal, Lr as UseUpdateCheckOptions, Lt as upsertMcpServer, M as discoverProjectSkills, Mi as summarizeArtifactCounts, Mn as PendingApprovalsStore, Mr as UpgradePackageResult, Mt as McpConfigScope, N as BooleanSettingKey, Ni as AgentsMdFile, Nn as ApprovalOriginator, Nr as UpgradeProgressEvent, Nt as RemoveMcpResult, O as buildSpawnEndEvent, Oi as ArtifactScope, On as ApprovalRequestInput, Or as tryOpenBrowser, Ot as supportsOAuth, P as DEFAULT_SETTINGS, Pi as AgentsMdResult, Pn as CommandArgSuggestionSummary, Pr as UpgradeReport, Pt as UpsertMcpResult, Q as ProjectEntry, Qi as envSection, Qn as generateSessionTitle, Qr as readUpdateAppliedMarker, Qt as indexOfServerRow, R as SETTINGS_TOGGLES, Ri as ACTIONS_WITH_CARE_DOCTRINE, Rn as PendingInteraction, Rr as buildRestartHint, Rt as CachedMcpToolList, S as userScopeOverridesLoad, Si as parseSemver, Sn as createInteractionHub, Sr as ClaudeImportOptions, St as normalizeRedirectPaste, T as StreamSource, Ti as resolvePlatformPackage, Tn as CompactionEntry, Tr as countClaudeSessionFiles, Tt as OAuthPrompt, U as SettingsProvider, Ui as IDENTITY_PREFIX, Un as SendOptions, Ur as runUpdateCommand, Ut as refreshMcpToolsCatalog, V as SettingsChoice, Vi as DOING_TASKS_DOCTRINE, Vn as QueuedItem, Vr as RunUpdateCommandOptions, Vt as loadMcpToolsCache, W as SettingsToggle, Wi as INTERACTION_GUIDANCE, Wn as SerializedPreview, Wr as InstalledVersionState, Wt as saveMcpToolsCache, X as scopeCwd, Xi as buildBuildSystem, Xn as GenerateSessionTitleOptions, Xr as hasUpdateAppliedMarker, Xt as VisibleMcpRow, Y as resolveSessionCwd, Yi as TOKEN_DISCIPLINE_DOCTRINE, Yn as toTodosSnapshot, Yr as WatchInstalledVersionOptions, Yt as useMcpToolToggleSet, Z as IMPLICITLY_SAFE_TOOLS, Zi as buildPlanSystem, Zn as cleanTitle, Zr as probeInstalledVersion, Zt as buildVisibleMcpRows, _ as DiscoverSystemMdOptions, _i as checkForUpdate, _n as createChatHost, _r as ArtifactReferenceData, _t as usageSourceFor, a as GRUVBOX_DARK, ai as findInstalledCompanion, an as useMcpAuthState, ar as Commit, at as readProjects, b as discoverSystemMd, bi as detectLibc, br as scoreArtifacts, bt as FetchOAuthRedirectResult, c as CATPPUCCIN_LATTE, ci as InPlaceUpdateResult, cn as McpAuthStatus, cr as Walk, ct as runEndNotice, d as ThemeProvider, di as PerformInPlaceUpdateOptions, dn as extractEditPayloadForGate, dr as DiscoveryProvider, dt as clearProviderUsageCache, ea as chatReferenceTokensForPrompt, ei as useRestartRequired, en as createFileMcpCredentialStore, er as BuildHintsOptions, et as addToSafelist, f as useColors, fi as PerformSelfUpdateOptions, fn as readFileSafe, fr as useDiscovery, ft as fetchAllProviderUsage, g as useTheme, gi as UpdateStatus, gn as ContextSegmentsReport, gr as ARTIFACTS_COMPLETION_PROVIDER_ID, gt as usageChecksOptedOut, h as useSyntaxStyles, hi as TarballAvailabilityOptions, hn as ChatHost, hr as useConfig, ht as providerUsageSupported, i as VAPORWAVE_THEME, ia as unwrapCallTool, ii as InstalledCompanion, in as useMcpAuthDispatch, ir as quoteForShell, it as projectsFilePath, j as defaultSkillScanPaths, ji as groupArtifacts, jn as ChatHostEnvironment, jr as UpgradeInstalledPackagesOptions, jt as sessionModelFallbacks, k as buildSpawnStartEvent, ki as ArtifactViewGroup, kn as createApprovalHub, kr as bootProfileEnabled, kt as ModelFallbackTarget, l as CATPPUCCIN_MACCHIATO, li as PackageManagerCommand, ln as getMcpAuthStatus, lr as createDiscoverySlot, lt as FetchProviderUsageOptions, m as useSurfaces, mi as SelfUpdateResult, mn as serializePreview, mr as ConfigProvider, mt as fetchProviderUsageAccounts, n as createActiveTodoAnchorHooks, na as CALL_TOOL_NAME, ni as writeUpdateAppliedMarker, nn as patchMcpCredential, nr as shortChord, nt as isOnSafelist, o as GRUVBOX_LIGHT, oi as CheckForUpdateOptions, on as McpAuthEvent, or as DiscoverySlot, ot as suggestSafelistEntries, p as useSelectStyle, pi as PlatformTarballOptions, pn as resolveCwdPath, pr as useDiscoveryOptional, pt as fetchProviderUsage, q as useSettings, qi as PLAN_MODE_DOCTRINE_NO_PROMPTS, qn as TodosSnapshot, qr as UpdateAppliedMarker, qt as buildToolToggle, r as renderActiveTodoAnchor, ra as UnwrappedToolCall, ri as CompanionSpec, rn as McpAuthProvider, rr as parseEditorCommand, rt as matchesSafelistEntry, s as CATPPUCCIN_FRAPPE, si as DetectPackageManagerOptions, sn as McpAuthStateMap, sr as DiscoverySlotOptions, st as writeProjects, t as ActiveTodoAnchorOptions, ta as createChatTurnsReadTool, ti as watchInstalledVersion, tn as mcpCredentialsPath, tr as buildHints, tt as getSafelist, u as CATPPUCCIN_MOCHA, ui as PackageManagerId, un as reduceMcpAuth, ur as DiscoveryContextValue, ut as USAGE_CACHE_TTL_MS, v as SystemMdFile, vi as checkTarballAvailable, vr as ArtifactReferenceEntry, vt as findGitRoot, w as StreamBuffer, wi as performSelfUpdate, wn as PendingAnnotation, wr as ClaudeSessionImportResult, wt as OAuthFlowOptions, x as renderSystemMdSeed, xi as detectPackageManager, xn as InteractionHub, xr as ClaudeCopyResult, xt as fetchOAuthRedirect, y as SystemMdResult, yi as compareSemver, yr as createArtifactsCompletionProvider, yt as formatPathForCwd, z as SettingsCategory, zi as BuildSystemOptions, zn as PromptAttachment, zr as buildUpdateHint, zt as McpToolsCache } from "./index-C45NxBZm.js";
|
|
3
|
+
import { $ as ModelUsageSummary, A as ProviderCredential, At as groupBindings, B as removeStoredCredential, Bt as Hint, C as discoverProjectMcps, Ct as KeyBindingDef, D as OAuthCredential, Dt as ResolvedExtensionKeybinding, E as CredentialsFile, Et as ParsedBinding, F as readCredentials, Ft as readKeybindings, G as writeCredentials, H as setPreferredCredential, Ht as hintsLength, I as readProviderCredential, It as readKeybindingsRaw, J as ProviderRegistry, K as AutoUpdateConfig, L as readProviderCredentialPair, Lt as resolveExtensionKeybindings, M as StoredCredential, Mt as matchesBinding, N as applyApiKeyEnv, Nt as mergeKeybindings, O as PreferCredentialResult, Ot as ensureKeybindingsFile, P as credentialsPath, Pt as parseBindingSpec, Q as resolveStoragePaths, R as readProviderCredentials, Rt as stripJsonComments, S as defaultMcpsConfigPaths, St as KeyAction, T as ApiKeyCredential, Tt as KeyBindings, U as setProviderCredential, Ut as truncateTrailing, V as setCredentialLabel, Vt as clipHintsToWidth, W as storedCredentialsOf, X as ResolvedPaths, Y as ResolvedConfig, Z as resolveConfig, _ as DiscoveredMcp, _t as usageByModel, a as SessionExportTarget, at as eventsFromTurns, b as buildMcpServers, bt as KEYBINDING_DEF_BY_ACTION, c as writeSessionExport, ct as loadState, d as useEnabledToggleSet, dt as stripSpawnTokensLine, et as StateStoreApi, f as DiscoveredPlugin, ft as sumRunCosts, g as projectUserPaths, gt as updateToolEventOutcomes, h as ProjectUserPath, ht as toolResultText, i as SessionExportFormat, it as deriveSessionTitle, j as SetProviderCredentialOptions, jt as keybindingsPath, k as PreferredCredentialTarget, kt as formatBindingForDisplay, l as EnabledAllowlistKey, lt as marginTopFor, m as discoverProjectPlugins, mt as toolCallPreview, n as computeTurnAnchors, nt as compactSummaryEvent, o as renderSession, ot as lastContextSizeFromTurns, p as buildPluginContributions, pt as titleFromTurns, q as ChatOptions, r as SessionExportAnchor, rt as createStateStore, s as resolveSessionExportTarget, st as listSessionMeta, t as TranscriptItem, tt as TuiState, u as EnabledToggleSet, ut as saveState, v as DiscoveryError, vt as DEFAULT_KEYBINDINGS, w as parseMcpsFile, wt as KeyBindingSection, x as dedupMcpServersByName, xt as KEYBINDING_KEY_COL_WIDTH, y as DiscoveryResult, yt as KEYBINDING_DEFS, z as removeProviderCredential, zt as EMPTY_HINTS } from "./transcript-anchors-BfI3ZXh1.js";
|
|
4
|
+
import { $ as formatTaskSummary, $t as chatReferenceTokensFromText, A as finalizeStreamingMarkdown, At as buildEditOutcomesAnnotation, Bt as uniqueSkillNamesFromReferences, C as sanitizeTodoItems, Ct as extractEditPayload, D as MAX_TRANSCRIPT_EVENTS, Dt as summarizeEditPayload, E as useActiveTodos, Et as splitLines, F as ProviderUsageStatus, Ft as rewriteMultiEditHeader, Gt as ListProjectFilesOptions, H as mostConstrainedWindow, Ht as createFilesCompletionProvider, I as ProviderUsageWindow, It as stripEditOutcomesAnnotation, J as compactPath, Jt as createCommandsCompletionProvider, Kt as listProjectFiles, Lt as summarizeOutcomes, M as turnContextSize, Mt as mergeApprovalAndBodyOutcomes, N as ProviderUsageCredits, Nt as parseEditOutcomesFromResult, O as TRANSCRIPT_TRIM_TO_EVENTS, Ot as tokenize, P as ProviderUsageSnapshot, Pt as resolveApprovalForPayload, Q as formatTaskStatus, Qt as ChatReferenceScope, R as activeSnapshotFor, Rt as SKILLS_TRIGGER, S as pruneTodosByRun, St as computeLineDiff, T as setTodosForRun, Tt as previewEditPayload, Ut as uniqueFilesFromReferences, V as formatUsagePercent, Vt as FILES_TRIGGER, W as showsAccount, Wt as FileEntry, X as fmtTokens, Xt as ChatReferenceData, Y as fmtCost, Yt as CHATS_TRIGGER, Z as formatDuration, Zt as ChatReferenceEntry, _ as createTodoTools, _t as PreviewResult, a as ActiveTodosState, at as cacheBreakNoticeText, b as isTodoTool, bt as buildUnifiedDiff, c as TODOREAD_TOOL, ct as retryLabel, d as TODO_STATUS_GLYPHS, dt as DiffOp, en as createChatsCompletionProvider, et as previewLine, f as TODO_WRITE_COUNTS_METADATA_KEY, ft as EditHunkSummary, g as TodosBag, gt as InlineSegment, h as TodoTally, ht as InlineDiff, i as turnAsText, it as cacheBreakChip, j as finalizeStreamingMarkdownForOwner, jt as maskToOutcomeKinds, k as capTranscriptEvents, kt as ResolvedApproval, l as TODOS_METADATA_KEY, m as TodoStatus, mt as HunkResolution, n as deleteTurnSafely, nn as blendHsl, nt as CacheChipContent, o as CreateTodoToolsOptions, ot as compactingLabel, p as TodoItem, pt as EditSummary, q as ageString, qt as COMMANDS_TRIGGER, r as truncateTurnsAt, rn as buildLinearRamp, rt as CacheChipTone, s as DEFAULT_MAX_TODO_ITEMS, t as countNeighbors, tn as uniqueChatIdsFromReferences, tt as shortId, u as TODOWRITE_TOOL, ut as DiffLine, v as getArchivedTodosForRun, vt as applyEditPayload, w as selectActiveTodos, wt as filetypeFromPath, x as pickActiveRunId, xt as computeInlineDiff, y as getTodosForRun, yt as buildContextualDiff, zt as createSkillsCompletionProvider } from "./turn-operations-D0x_g6XQ.js";
|
|
5
|
+
import { $ as ACCOUNT_CRED_KEY_INFIX, A as filterSessionSearchCatalog, B as searchableTurnText, C as SearchSessionResult, D as SessionSearchIndex, E as SessionSearchExcerpt, F as searchSessionHistoryIndexAsync, G as SafeModeProvider, H as ApprovalRequest, I as searchSessionIndex, J as DAEMON_HEALTH_GLYPH, K as useSafeModeActions, L as searchSessionIndexAsync, M as searchHighlightRanges, N as searchSessionHistory, O as buildSessionSearchIndex, P as searchSessionHistoryIndex, Q as DaemonHealthTone, R as searchSessionTurns, S as SearchExcerpt, T as SessionHistoryMatch, U as RequestApproval, V as ApprovalDecision, W as SafeModeActions, X as DaemonHealth, Y as DAEMON_HEALTH_STYLE, Z as DaemonHealthStyle, _ as normalizeMarkdownCodeFences, a as formatToolCall, at as isAccountCredKey, b as HighlightSegment, bt as turnSelectionOwnership, c as splitPromptSegments, d as filterModelCatalog, dt as isEditErrorResult, et as ALTERNATE_CRED_KEY_SUFFIX, f as indexOfEntry, ft as isTurnHighlighted, g as chunkMarkdownForRender, h as MarkdownSegment, i as displayNameFor, it as alternateCredKey, j as highlightSegments, k as buildSessionSearchIndexAsync, l as CatalogEntry, m as MARKDOWN_RENDER_CHUNK_TARGET_BYTES, mt as isVisible, n as ToolDisplayMeta, nt as DEFAULT_OAUTH_ACCOUNT_LABEL, o as PromptSegment, ot as isReservedCredKey, q as useSafeModeQueue, r as ToolFormatLine, rt as accountCredKey, s as PromptSegmentRef, st as oauthAccountLabel, t as TOOL_DISPLAY, tt as CRED_KEY_SLOT_SEPARATOR, u as buildModelCatalog, v as splitMarkdownCodeBlocks, vt as selectableTurnIds, w as SearchTurnResult, x as IndexedSearchTurn, y as HighlightRange, yt as selectionAfterTurnRemoval, z as searchTurns } from "./tool-formatters-Bl1afA8N.js";
|
|
6
6
|
export { ACCOUNT_CRED_KEY_INFIX, ACTIONS_WITH_CARE_DOCTRINE, ALTERNATE_CRED_KEY_SUFFIX, ARTIFACTS_COMPLETION_PROVIDER_ID, ASK_USER_TOOL, AUTOMATIC_INTERACTION_INSTRUCTION, AUTO_COMPACT_MIN_GROWTH_FRACTION, type ActiveTodoAnchorOptions, type ActiveTodosState, type ActiveTrigger, type AgentAccent, type AgentProfile, type AgentRegistry, type AgentsMdFile, type AgentsMdResult, type AnswerValue, type ApiKeyCredential, type ApprovalDecision, type ApprovalHub, type ApprovalOriginator, type ApprovalRequest, type ApprovalRequestInput, type ArtifactReferenceData, type ArtifactReferenceEntry, type ArtifactScope, type ArtifactViewGroup, type ArtifactViewRow, type AuthMethod, type AutoCompactDecision, type AutoCompactInput, type AutoUpdateConfig, BUILD_AGENT, BUILTIN_AGENTS, BUILTIN_PROVIDERS, BUILTIN_THEMES, type BooleanSettingKey, type BuildExtensionRegistryOptions, type BuildHintsOptions, type BuildSystemOptions, type BuildUpdateHintOptions, CALL_TOOL_NAME, CATPPUCCIN_FRAPPE, CATPPUCCIN_LATTE, CATPPUCCIN_MACCHIATO, CATPPUCCIN_MOCHA, CHATS_TRIGGER, COMMANDS_TRIGGER, COMMUNICATION_DOCTRINE, CRED_KEY_SLOT_SEPARATOR, type CacheChipContent, type CacheChipTone, type CachedMcpToolList, type CatalogEntry, type ChatHost, type ChatHostEnvironment, type ChatOptions, type ChatReferenceData, type ChatReferenceEntry, type ChatReferenceScope, type ChatTurnsReadToolOptions, type CheckForUpdateOptions, type ChipColor, type ChipColorMap, type ClaudeCopyResult, type ClaudeImportOptions, type ClaudeImportSummary, type ClaudeSessionImportResult, type Command, type CommandAgentResult, type CommandArgSuggestionSummary, type CommandExecution, type CommandInvocation, type CommandOutputBlock, type CommandStep, type CommandStepContext, type CommandStepFn, type CommandSummary, type Commit, type CompactionEntry, type CompanionSpec, type CompletionContext, type CompletionItem, type CompletionProvider, type CompletionReference, type CompletionState, ConfigProvider, type ConfirmQuestion, type ContextBreakdown, type ContextBreakdownContributionContext, type ContextBreakdownContributor, type ContextBreakdownOptions, type ContextCategory, type ContextCategoryId, type ContextExactCounts, type ContextExtensionRow, type ContextExtensionSection, type ContextItem, type ContextMcpGroup, type ContextSegment, type ContextSegmentFile, type ContextSegmentOrigin, type ContextSegmentsInput, type ContextSegmentsReport, type ContextSnapshot, type ContextUsageSplit, type CreateInteractionToolsOptions, type CreateTodoToolsOptions, type CredentialsFile, type CustomField, DAEMON_HEALTH_GLYPH, DAEMON_HEALTH_STYLE, DEFAULT_AGENT_ID, DEFAULT_BUDGET_EXCLUDE_TOOLS, DEFAULT_KEYBINDINGS, DEFAULT_MAX_TODO_ITEMS, DEFAULT_OAUTH_ACCOUNT_LABEL, DEFAULT_PERSIST_EXCLUDE_TOOLS, DEFAULT_SETTINGS, DEFAULT_THEME, DOING_TASKS_DOCTRINE, type DaemonHealth, type DaemonHealthStyle, type DaemonHealthTone, type DetectPackageManagerOptions, type DiffLine, type DiffOp, type DiscoverAgentsMdOptions, type DiscoverSystemMdOptions, type DiscoveredMcp, type DiscoveredPlugin, type DiscoveryContextValue, type DiscoveryError, DiscoveryProvider, type DiscoveryResult, type DiscoverySlot, type DiscoverySlotOptions, EMPTY_EXTENSION_REGISTRY, EMPTY_HINTS, type EditDiffDisplay, type EditHunk, type EditHunkSummary, type EditOutcome, type EditOutcomeKind, EditOutcomeLedger, type EditPayload, type EditSummary, type EnabledAllowlistKey, type EnabledToggleSet, type EnvSectionOptions, type ExtensionApiVersion, type ExtensionBehaviorTransform, type ExtensionCapability, type ExtensionContext, type ExtensionContributions, type ExtensionDefinition, type ExtensionFooterHint, type ExtensionGuiPanel, type ExtensionKeybinding, type ExtensionKeybindingDispatchContext, type ExtensionManifest, type ExtensionMcpConfigTransform, type ExtensionModal, type ExtensionOrderedContribution, type ExtensionPaths, type ExtensionPermission, type ExtensionProviderMiddleware, type ExtensionRegistry, type ExtensionRunTransform, type ExtensionRuntimeEnv, type ExtensionSessionStateSurface, type ExtensionSkillPolicy, type ExtensionSource, type ExtensionStorageScope, type ExtensionStorageSurface, type ExtensionToolCatalogTransform, type ExtensionToolResultMetadataRegistration, FILES_TRIGGER, type FetchOAuthRedirectResult, type FetchProviderUsageOptions, type FileEntry, GRUVBOX_DARK, GRUVBOX_LIGHT, type GenerateSessionTitleOptions, type GenerateStructuredDataOptions, type GuiContributions, HOST_INTERACTION_ID_PREFIX, type HighlightRange, type HighlightSegment, type Hint, type HostSettings, type HostSignal, type HunkResolution, IDENTITY_PREFIX, IMPLICITLY_SAFE_TOOLS, INTERACTION_GUIDANCE, INTERACTION_GUIDANCE_NO_PROMPTS, type InPlaceUpdateResult, type IndexedSearchTurn, type InlineAutocompleteContext, type InlineAutocompleteProvider, type InlineDiff, type InlineGhost, type InlineSegment, type InstalledCompanion, type InstalledVersionState, type InstalledVersionWatcher, type InteractionHub, type InteractionMode, type InteractionOrigin, type InteractionRequest, type InteractionResponse, type InteractionsActions, InteractionsProvider, KEYBINDING_DEFS, KEYBINDING_DEF_BY_ACTION, KEYBINDING_KEY_COL_WIDTH, type KeyAction, type KeyBindingDef, type KeyBindingSection, type KeyBindings, type ListProjectFilesOptions, type LoadedExtension, MARKDOWN_RENDER_CHUNK_TARGET_BYTES, MAX_TRANSCRIPT_EVENTS, type MarkdownSegment, type McpAuthEvent, McpAuthProvider, type McpAuthStateMap, type McpAuthStatus, type McpConfigScope, type McpToolToggleSet, type McpToolsCache, type ModelChainEntry, type ModelFallbackTarget, type ModelInfo, type ModelOption, type ModelUsageSummary, type OAuthCredential, type OAuthFlowOptions, type OAuthPrompt, ORCHESTRATED_BY_KEY, OUTPUT_RESERVE_TOKENS, type Owner, PLAN_AGENT, PLAN_MODE_DOCTRINE, PLAN_MODE_DOCTRINE_NO_PROMPTS, PRESENT_PLAN_TOOL, type PackageManagerCommand, type PackageManagerId, type ParsedBinding, type PendingAnnotation, type PendingApprovalsStore, type PendingInteraction, type PendingInteractionEntry, type PerformInPlaceUpdateOptions, type PerformSelfUpdateOptions, type Picked, type PlanDecision, type PlanPayload, type PlanRequest, type PlanResponse, type PlanStep, type PlatformTarballOptions, type PreferCredentialResult, type PreferredCredentialTarget, type PreviewResult, type ProjectEntry, type ProjectUserPath, type ProjectsFile, type PromptAttachment, type PromptSegment, type PromptSegmentRef, type ProviderAuth, type ProviderCredential, type ProviderDescriptor, type ProviderKey, type ProviderRegistry, type ProviderUsageCredits, type ProviderUsageSnapshot, type ProviderUsageStatus, type ProviderUsageWindow, type Question, type QuestionChoice, type QuestionPayload, type QuestionRequest, type QuestionResponse, type QuestionType, type QueuedAttachment, type QueuedItem, RUN_RECEIPT_GLYPH, type RemoveMcpResult, type RequestApproval, type ResolveStorageDirsOptions, type ResolvedApproval, type ResolvedConfig, type ResolvedExtensionKeybinding, type ResolvedPaths, type RunReceipt, type RunReceiptCell, type RunReceiptCellKind, type RunReceiptSegment, type RunReceiptSegmentKind, type RunUpdateCommandOptions, type RunUpdateCommandResult, type RunningWorkItem, SESSION_EVENT_STATUS_STYLE, SESSION_ROLE_KEY, SETTINGS_CATEGORIES, SETTINGS_CHOICES, SETTINGS_INPUTS, SETTINGS_TOGGLES, SKILLS_TRIGGER, SUBAGENT_GUIDANCE, type SafeModeActions, SafeModeProvider, type Screen, type SearchExcerpt, type SearchSessionResult, type SearchTurnResult, type SelectQuestion, type SelfUpdateResult, type SendOptions, type SerializedPreview, type SessionEvent, type SessionEventStatus, type SessionEventStatusStyle, type SessionEventTone, type SessionExportAnchor, type SessionExportFormat, type SessionExportTarget, type SessionHistoryMatch, type SessionMeta, type SessionPresence, type SessionSearchExcerpt, type SessionSearchIndex, type SetProviderCredentialOptions, type Settings, type SettingsCategory, type SettingsCategoryDescriptor, type SettingsChoice, type SettingsInput, SettingsProvider, type SettingsToggle, type SpawnStartRecord, type StateStoreApi, type StorageDirs, type StorageMode, type StorageSlot, type StoredCredential, type StreamBuffer, type StreamEvent, type StreamProgressInfo, type StreamSource, type StringSettingKey, type SyntaxStyles, type SyntaxTokenStyle, type SystemMdFile, type SystemMdResult, TODOREAD_TOOL, TODOS_METADATA_KEY, TODOWRITE_TOOL, TODO_STATUS_GLYPHS, TODO_WRITE_COUNTS_METADATA_KEY, TOKEN_DISCIPLINE_DOCTRINE, TOOL_DISPLAY, TRANSCRIPT_TRIM_TO_EVENTS, type TarballAvailabilityOptions, type TextQuestion, type Theme, type ThemeColors, ThemeProvider, type ThemeSelect, type ThemeSurfaces, type TodoItem, type TodoStatus, type TodoTally, type TodosBag, type TodosSnapshot, type ToolCallDisplay, type ToolDisplayMeta, type ToolFormatLine, type TranscriptItem, type TuiContributions, type TuiState, UPDATE_APPLIED_MARKER, USAGE_CACHE_TTL_MS, type UnwrappedToolCall, type UpdateAppliedMarker, type UpdateStatus, type UpgradeInstalledPackagesOptions, type UpgradePackageResult, type UpgradeProgressEvent, type UpgradeReport, type UpsertMcpResult, type UseRestartRequiredOptions, type UseUpdateCheckOptions, VAPORWAVE_THEME, type VisibleMcpRow, WORKER_REPORT_FRAGMENT, type Walk, type WatchInstalledVersionOptions, type WireApprovalRequest, accentColor, accountCredKey, activeSnapshotFor, addToSafelist, ageString, alternateCredKey, anthropicDescriptor, applyApiKeyEnv, applyEditPayload, applyInsert, blendHsl, bootProfileEnabled, bootTick, buildBuildSystem, buildContextBreakdown, buildContextSegments, buildContextualDiff, buildEditOutcomesAnnotation, buildExtensionPreset, buildExtensionRegistry, buildHints, buildLinearRamp, buildMcpServers, buildModelCatalog, buildPlanSystem, buildPluginContributions, buildRestartHint, buildResumedToolResultsTurn, buildRunModel, buildSessionSearchIndex, buildSessionSearchIndexAsync, buildSkillsConfig, buildSpawnEndEvent, buildSpawnStartEvent, buildToolToggle, buildUnifiedDiff, buildUpdateHint, buildVisibleMcpRows, cacheBreakChip, cacheBreakNoticeText, capTranscriptEvents, cerebrasDescriptor, chainPositionOf, chainsEqual, chatAutoCompactBehavior, chatReferenceTokensForPrompt, chatReferenceTokensFromText, chatWindowBehavior, checkForUpdate, checkTarballAvailable, chunkMarkdownForRender, cleanTitle, clearMcpToolsCache, clearProviderUsageCache, clipHintsToWidth, collectReferences, commandSteps, compactPath, compactSummaryEvent, compactingLabel, compareSemver, composeExtensionPreset, computeInlineDiff, computeLineDiff, computeTurnAnchors, countClaudeSessionFiles, countNeighbors, createActiveTodoAnchorHooks, createApprovalHub, createArtifactsCompletionProvider, createAutomaticInteractionResponse, createChatHost, createChatTurnsReadTool, createChatsCompletionProvider, createCommandsCompletionProvider, createDiscoverySlot, createFileMcpCredentialStore, createFilesCompletionProvider, createInteractionHub, createInteractionTools, createMemoryApprovalsStore, createPathAutocompleteProvider, createSkillsCompletionProvider, createStateStore, createTodoTools, credKeyOf, credentialsPath, dedupMcpServersByName, defaultExtensionScanPaths, defaultMcpsConfigPaths, defaultSkillScanPaths, defineExtension, deleteTurnSafely, deriveSessionTitle, detectAuth, detectLibc, detectPackageManager, discoverAgentsMd, discoverExtensions, discoverProjectMcps, discoverProjectPlugins, discoverProjectSkills, discoverSystemMd, displayNameFor, disposeExtensionRegistry, effectiveContextWindow, enabledModelOptions, enforceSettingsInvariants, ensureKeybindingsFile, envSection, eventsFromTurns, executeCommand, extractEditPayload, extractEditPayloadForGate, fetchAllProviderUsage, fetchOAuthRedirect, fetchProviderUsage, fetchProviderUsageAccounts, filetypeFromPath, filterChainFallbacks, filterExtensionRegistry, filterModelCatalog, filterSessionSearchCatalog, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, findActiveTrigger, findGitRoot, findInstalledCompanion, fitRunReceiptCells, fmtCost, fmtTokens, folderlessCwd, formatBindingForDisplay, formatCostUsd, formatDuration, formatPathForCwd, formatRunDuration, formatRunReceiptCells, formatRunReceiptLine, formatTaskStatus, formatTaskSummary, formatTokenCount, formatTokensPerSecond, formatToolCall, formatUsagePercent, generateSessionTitle, generateStructuredData, getArchivedTodosForRun, getContextWindow, getMcpAuthStatus, getModelInfo, getSafelist, getTodosForRun, groupArtifacts, groupBindings, hasClaudeCodeSetup, hasRunReceipt, hasUpdateAppliedMarker, highlightSegments, hintsLength, importFromClaudeCode, indexOfEntry, indexOfServerRow, inlineLoadedExtension, isAccountCredKey, isEditErrorResult, isInteractionTool, isMainSession, isModelInteraction, isOnSafelist, isReservedCredKey, isTodoTool, isTurnHighlighted, isVisible, keybindingsPath, lastContextSizeFromTurns, listProjectFiles, listSessionMeta, loadMcpToolsCache, loadState, localDescriptor, makeRequestInteraction, marginTopFor, maskToOutcomeKinds, matchesBinding, matchesSafelistEntry, mcpCredentialsPath, mcpToolsCachePath, mcpsWritePath, mergeApprovalAndBodyOutcomes, mergeContributions, mergeKeybindings, mergeReferences, mergeSuggestions, modelChainMetadata, modelOptionsFor, modelSupportsReasoning, modelsForDescriptor, mostConstrainedWindow, normalizeMarkdownCodeFences, normalizeRedirectPaste, oauthAccountLabel, oauthUsesManualCodePaste, openaiDescriptor, openrouterDescriptor, orchestratedBy, parentServerName, parseBindingSpec, parseCommandInvocation, parseEditOutcomesFromResult, parseEditorCommand, parseMcpsFile, parseSemver, parseSessionEventXml, partitionExtensionCatalog, patchInlineGhost, patchMcpCredential, pendingInteractionsFromTurns, performInPlaceSelfUpdate, performSelfUpdate, piIdOf, pickActiveRunId, previewEditPayload, previewLine, probeInstalledVersion, projectUserPaths, projectsFilePath, providerKeySetChanged, providerUsageSupported, pruneTodosByRun, quoteForShell, readCredentials, readFileSafe, readKeybindings, readKeybindingsRaw, readProjects, readProviderCredential, readProviderCredentialPair, readProviderCredentials, readUpdateAppliedMarker, redirectUriFromAuthUrl, reduceMcpAuth, refreshMcpToolsCatalog, removeMcpServer, removeProviderCredential, removeStoredCredential, renderActiveTodoAnchor, renderAgentsMdBlock, renderSession, renderSessionEventXml, renderSystemMdSeed, resolveAgentId, resolveApprovalForPayload, resolveChipColor, resolveConfig, resolveCwdPath, resolveExtensionKeybindings, resolveInlineSuggestion, resolvePlatformPackage, resolveSessionCwd, resolveSessionExportTarget, resolveStorageDirs, resolveStoragePaths, resolveTheme, restoreChainFallbacks, restoreModelOptions, retryLabel, rewriteMultiEditHeader, runCompaction, runEndNotice, runOAuthLogin, runReceiptFromRun, runUpdateCommand, sanitizeModelChain, sanitizeTodoItems, saveMcpToolsCache, saveState, scanExtensionDirectories, scopeCwd, scoreArtifacts, searchHighlightRanges, searchSessionHistory, searchSessionHistoryIndex, searchSessionHistoryIndexAsync, searchSessionIndex, searchSessionIndexAsync, searchSessionTurns, searchTurns, searchableTurnText, selectActiveTodos, selectableTurnIds, selectionAfterTurnRemoval, serializeInteractionResponse, serializePreview, sessionDirLabel, sessionEventExcerpt, sessionEventLabel, sessionEventMeta, sessionModelFallbacks, setCredentialLabel, setPreferredCredential, setProviderCredential, setTodosForRun, shortChord, shortId, shortSessionId, shouldAutoCompact, shouldAutoGenerateTitle, showsAccount, singleAgentRegistry, splitLines, splitMarkdownCodeBlocks, splitPromptSegments, storedCredentialsOf, stripEditOutcomesAnnotation, stripJsonComments, stripSpawnTokensLine, subscribeMcpToolsCache, suggestSafelistEntries, sumRunCosts, summarizeArtifactCounts, summarizeEditPayload, summarizeOutcomes, supportsOAuth, titleFromTurns, toTodosSnapshot, toggleChainEntry, tokenEndingAtCursor, tokenize, toolCallPreview, toolResultText, truncateTitle, truncateTrailing, truncateTurnsAt, tryOpenBrowser, turnAsText, turnContextSize, turnSelectionOwnership, uniqueChatIdsFromReferences, uniqueFilesFromReferences, uniqueSkillNamesFromReferences, unwrapCallTool, updateAppliedMarkerPath, updateToolEventOutcomes, upgradeInstalledPackages, upsertMcpServer, usageByModel, usageChecksOptedOut, usageSourceFor, useActiveTodos, useColors, useCompletion, useConfig, useDiscovery, useDiscoveryOptional, useEnabledToggleSet, useInteractionsActions, useInteractionsQueue, useMcpAuthDispatch, useMcpAuthState, useMcpToolToggleMap, useMcpToolToggleSet, useRestartRequired, useSafeModeActions, useSafeModeQueue, useSelectStyle, useSettings, useStreamBuffer, useSurfaces, useSyntaxStyles, useTheme, useUpdateCheck, userScopeOverridesLoad, userSystemMdPath, watchInstalledVersion, writeCredentials, writeProjects, writeSessionExport, writeUpdateAppliedMarker };
|