zidane 7.1.9 → 7.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/{acp-Bt-eb5Z8.js → acp-D-tVyUjw.js} +2 -2
  2. package/dist/{acp-Bt-eb5Z8.js.map → acp-D-tVyUjw.js.map} +1 -1
  3. package/dist/acp-cli.js +4 -4
  4. package/dist/acp.d.ts +1 -1
  5. package/dist/acp.js +1 -1
  6. package/dist/{agent-B6etKd_o.js → agent-D0zZnGbt.js} +135 -6
  7. package/dist/agent-D0zZnGbt.js.map +1 -0
  8. package/dist/agent.d.ts +1 -1
  9. package/dist/agent.js +1 -1
  10. package/dist/{anthropic-BQdAnY-w.js → anthropic-C2aole0G.js} +83 -100
  11. package/dist/anthropic-C2aole0G.js.map +1 -0
  12. package/dist/{approvals-CIKGWmiU.js → approvals-CnE_8JVZ.js} +53 -11
  13. package/dist/approvals-CnE_8JVZ.js.map +1 -0
  14. package/dist/{auth-CDDNbEmd.js → auth-BG2rVKSt.js} +2 -2
  15. package/dist/{auth-CDDNbEmd.js.map → auth-BG2rVKSt.js.map} +1 -1
  16. package/dist/chat/pure.d.ts +24 -8
  17. package/dist/chat/pure.d.ts.map +1 -1
  18. package/dist/chat/pure.js +248 -3
  19. package/dist/chat/pure.js.map +1 -0
  20. package/dist/chat.d.ts +6 -6
  21. package/dist/chat.js +4 -4
  22. package/dist/contexts/daytona.d.ts +1 -1
  23. package/dist/contexts/e2b.d.ts +1 -1
  24. package/dist/daemon-cli.js +1 -1
  25. package/dist/eval.d.ts +1 -1
  26. package/dist/extensions.d.ts +2 -2
  27. package/dist/extensions.js +1 -1
  28. package/dist/headless.d.ts +1 -1
  29. package/dist/headless.js +1 -1
  30. package/dist/{index-dXnPmqFx.d.ts → index-BgN1T3lk.d.ts} +342 -109
  31. package/dist/index-BgN1T3lk.d.ts.map +1 -0
  32. package/dist/{index-C45NxBZm.d.ts → index-CWHSTD2Q.d.ts} +5 -5
  33. package/dist/{index-C45NxBZm.d.ts.map → index-CWHSTD2Q.d.ts.map} +1 -1
  34. package/dist/index.d.ts +2 -2
  35. package/dist/index.js +2 -2
  36. package/dist/{ipc-BWsncell.js → ipc-Cu29nNEz.js} +2 -2
  37. package/dist/{ipc-BWsncell.js.map → ipc-Cu29nNEz.js.map} +1 -1
  38. package/dist/ipc.d.ts +5 -5
  39. package/dist/ipc.js +3 -3
  40. package/dist/mcp.d.ts +1 -1
  41. package/dist/output/stream-json.d.ts +1 -1
  42. package/dist/output/terminal.d.ts +1 -1
  43. package/dist/panels-B6gRk4bf.js.map +1 -1
  44. package/dist/plugins.d.ts +1 -1
  45. package/dist/presets.d.ts +1 -1
  46. package/dist/presets.js +1 -1
  47. package/dist/providers/anthropic.d.ts +1 -1
  48. package/dist/providers/anthropic.js +1 -1
  49. package/dist/providers/arcee.d.ts +1 -1
  50. package/dist/providers/baseten.d.ts +1 -1
  51. package/dist/providers/cerebras.d.ts +1 -1
  52. package/dist/providers/local.d.ts +1 -1
  53. package/dist/providers/openai-compat.d.ts +1 -1
  54. package/dist/providers/openai.d.ts +1 -1
  55. package/dist/providers/openai.js +3 -2
  56. package/dist/providers/openai.js.map +1 -1
  57. package/dist/providers/openrouter.d.ts +1 -1
  58. package/dist/providers/xai.d.ts +1 -1
  59. package/dist/providers.d.ts +1 -1
  60. package/dist/providers.js +1 -1
  61. package/dist/restate.d.ts +1 -1
  62. package/dist/restate.js +1 -1
  63. package/dist/session/sqlite.d.ts +19 -2
  64. package/dist/session/sqlite.d.ts.map +1 -1
  65. package/dist/session/sqlite.js +45 -1
  66. package/dist/session/sqlite.js.map +1 -1
  67. package/dist/session.d.ts +1 -1
  68. package/dist/{shell-path-CY7nWoF8.js → shell-path-DWo7ooWv.js} +6 -6
  69. package/dist/{shell-path-CY7nWoF8.js.map → shell-path-DWo7ooWv.js.map} +1 -1
  70. package/dist/skills.d.ts +1 -1
  71. package/dist/{todo-edits-PxMJvYIX.js → todo-edits-UOwgxGKu.js} +74 -13
  72. package/dist/todo-edits-UOwgxGKu.js.map +1 -0
  73. package/dist/{tool-formatters-Bl1afA8N.d.ts → tool-formatters-DoRLnfuD.d.ts} +5 -3
  74. package/dist/tool-formatters-DoRLnfuD.d.ts.map +1 -0
  75. package/dist/tools/fetch-url.d.ts +1 -1
  76. package/dist/tools/web-search.d.ts +1 -1
  77. package/dist/tools.d.ts +1 -1
  78. package/dist/tools.js +1 -1
  79. package/dist/{transcript-anchors-BfI3ZXh1.d.ts → transcript-anchors-BeudMbXx.d.ts} +12 -4
  80. package/dist/transcript-anchors-BeudMbXx.d.ts.map +1 -0
  81. package/dist/tui.d.ts +3 -3
  82. package/dist/tui.d.ts.map +1 -1
  83. package/dist/tui.js +290 -40
  84. package/dist/tui.js.map +1 -1
  85. package/dist/{turn-operations-D0x_g6XQ.d.ts → turn-operations-C8bMBDl_.d.ts} +3 -3
  86. package/dist/{turn-operations-D0x_g6XQ.d.ts.map → turn-operations-C8bMBDl_.d.ts.map} +1 -1
  87. package/dist/{turn-operations-D_k_FEur.js → turn-operations-DrbJlpq9.js} +5 -2
  88. package/dist/turn-operations-DrbJlpq9.js.map +1 -0
  89. package/dist/types.d.ts +1 -1
  90. package/docs/EXTENSIONS.md +1 -1
  91. package/docs/PANELS.md +16 -2
  92. package/package.json +3 -3
  93. package/dist/agent-B6etKd_o.js.map +0 -1
  94. package/dist/anthropic-BQdAnY-w.js.map +0 -1
  95. package/dist/approvals-CIKGWmiU.js.map +0 -1
  96. package/dist/index-dXnPmqFx.d.ts.map +0 -1
  97. package/dist/todo-edits-PxMJvYIX.js.map +0 -1
  98. package/dist/tool-formatters-Bl1afA8N.d.ts.map +0 -1
  99. package/dist/transcript-anchors-BfI3ZXh1.d.ts.map +0 -1
  100. package/dist/turn-operations-D_k_FEur.js.map +0 -1
@@ -1,6 +1,6 @@
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";
1
+ import { $d as sessionDirLabel, Am as ContextSegmentFile, Au as PanelIcon, Bd as ORCHESTRATED_BY_KEY, Bm as ContextExactCounts, Cf as chainPositionOf, Cu as rankPaletteItems, Df as pickChainPrimary, Du as PanelAction, Eu as PANEL_CONTENT_LIMITS, Ff as toggleKeyed, Fm as ContextBreakdownContributionContext, Fu as PanelRowItem, Gd as SessionEventStatus, Gm as ContextSnapshot, Go as ExtensionPaletteProviderEntry, Hd as SESSION_EVENT_STATUS_STYLE, Hm as ContextExtensionSection, If as AuthMethod, Im as ContextBreakdownContributor, Iu as PanelSection, Jd as WORKER_REPORT_FRAGMENT, Ju as ActiveTrigger, Kd as SessionEventStatusStyle, Km as ContextUsageSplit, Ld as StreamEvent, Lf as ProviderAuth, Lm as ContextBreakdownOptions, Lu as normalizePanelContent, Mm as ContextSegmentsInput, Mu as PanelKeyValueItem, Nm as buildContextSegments, Nu as PanelLoadContext, Of as pickPrimaryKeyed, Ou as PanelContent, Pf as toggleChainEntry, Pm as ContextBreakdown, Pu as PanelMarkdownItem, Qu as CompletionReference, Rm as ContextCategory, Ru as panelBadgeText, Sf as chainEntryKey, Su as pushPaletteRecent, Tf as chainsEqualKeyed, Tu as ExtensionPanelEntry, Ud as SESSION_ROLE_KEY, Um as ContextItem, Vm as ContextExtensionRow, Wd as SessionEvent, Wm as ContextMcpGroup, Xd as orchestratedBy, Xu as CompletionItem, Yd as isMainSession, Yu as CompletionContext, Zu as CompletionProvider, _f as formatTokensPerSecond, _u as fuzzyMatch, af as RUN_RECEIPT_GLYPH, au as PALETTE_LIMITS, bf as ModelChainEntry, bu as normalizePaletteItems, cd as CommandArgSuggestion, cf as RunReceiptCellKind, cu as PALETTE_RESULT_MAX, df as fitRunReceiptCells, du as PaletteHost, ed as applyInsert, ef as sessionEventExcerpt, em as LogLevel, ff as formatCostUsd, fu as PaletteItem, gf as formatTokenCount, gm as nextLogLevel, gu as RankedPaletteItem, hf as formatRunReceiptLine, hm as formatLogLine, hu as PaletteRunResult, id as mergeSuggestions, if as truncateTitle, jf as reorderKeyed, jm as ContextSegmentOrigin, ju as PanelItem, kf as positionKeyed, km as ContextSegment, ku as PanelCustomItem, lf as RunReceiptSegment, lu as PaletteContext, mf as formatRunReceiptCells, mm as filterLogRecords, mu as PaletteProvider, nd as findActiveTrigger, nf as sessionEventMeta, od as Command, of as RunReceipt, ou as PALETTE_RECENTS_MAX, pf as formatRunDuration, pm as LOG_LEVEL_CYCLE, pu as PaletteItemKind, qd as SessionEventTone, qm as buildContextBreakdown, rd as mergeReferences, rf as shortSessionId, sf as RunReceiptCell, su as PALETTE_RECENT_GROUP, td as collectReferences, tf as sessionEventLabel, tm as LogRecord, uf as RunReceiptSegmentKind, uu as PaletteGroup, vf as hasRunReceipt, vu as groupPaletteRows, wf as chainsEqual, wu as ExtensionPanel, xu as normalizePaletteRunResult, y_ as McpServerConfig, yf as runReceiptFromRun, yu as isPaletteContext, zm as ContextCategoryId } from "../index-BgN1T3lk.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-C8bMBDl_.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 retagUserPromptEvents, a as formatToolCall, b as HighlightSegment, c as splitPromptSegments, ct as BASH_CALL_ID_PREFIX, d as filterModelCatalog, dt as PromptTurnRef, f as indexOfEntry, ft as isEditErrorResult, g as chunkMarkdownForRender, gt as promptTurnRefs, h as MarkdownSegment, ht as isVisible, i as displayNameFor, j as highlightSegments, k as buildSessionSearchIndexAsync, l as CatalogEntry, lt as CACHE_NOTICE_LABEL, m as MARKDOWN_RENDER_CHUNK_TARGET_BYTES, mt as isUserBashEvent, n as ToolDisplayMeta, nt as DEFAULT_OAUTH_ACCOUNT_LABEL, o as PromptSegment, p as parseCustomModelQuery, pt as isTurnHighlighted, r as ToolFormatLine, s as PromptSegmentRef, st as oauthAccountLabel, t as TOOL_DISPLAY, u as buildModelCatalog, ut as EDIT_TOOL_NAMES, v as splitMarkdownCodeBlocks, vt as retagUserPromptEventsFromRefs, w as SearchTurnResult, x as IndexedSearchTurn, xt as turnSelectionOwnership, y as HighlightRange, yt as selectableTurnIds, z as searchTurns } from "../tool-formatters-DoRLnfuD.js";
4
4
 
5
5
  //#region src/chat/auth-rows.d.ts
6
6
  /**
@@ -171,10 +171,15 @@ type NoticeSeverity = NonNullable<StreamEvent['notice']>['severity'];
171
171
  declare const NOTICE_GLYPH: Readonly<Record<NoticeSeverity, string>>;
172
172
  //#endregion
173
173
  //#region src/chat/panels.d.ts
174
+ declare const INBOX_PANEL_ID = "inbox";
175
+ declare const TODOS_PANEL_ID = "todos";
174
176
  declare const ARTIFACTS_PANEL_ID = "artifacts";
177
+ declare const DIFFS_PANEL_ID = "diffs";
178
+ declare const FILES_PANEL_ID = "files";
175
179
  /** Built-in tabs the hosts render with their own components. */
180
+ type BuiltinPanelId = typeof INBOX_PANEL_ID | typeof TODOS_PANEL_ID | typeof ARTIFACTS_PANEL_ID | typeof DIFFS_PANEL_ID | typeof FILES_PANEL_ID;
176
181
  interface BuiltinPanelTab {
177
- id: typeof ARTIFACTS_PANEL_ID;
182
+ id: BuiltinPanelId;
178
183
  label: string;
179
184
  icon: PanelIcon;
180
185
  builtin: true;
@@ -191,6 +196,8 @@ declare const BUILTIN_PANEL_TABS: readonly BuiltinPanelTab[];
191
196
  interface PanelCatalogOptions {
192
197
  /** Hide the artifacts tab (the user's `artifacts: false` setting). */
193
198
  showArtifacts?: boolean;
199
+ /** Built-in ids the host can't render (the TUI has no diff viewer yet). */
200
+ omitBuiltins?: readonly BuiltinPanelId[];
194
201
  }
195
202
  /** Built-ins first, then extension panels in registry (load) order. */
196
203
  declare function buildPanelCatalog(extensionPanels: readonly Pick<ExtensionPanelEntry, 'id' | 'label' | 'icon' | 'owner'>[], options?: PanelCatalogOptions): PanelTab[];
@@ -204,16 +211,25 @@ interface PanelState {
204
211
  proactiveAt: number;
205
212
  }
206
213
  declare const INITIAL_PANEL_STATE: PanelState;
214
+ /** Add a tab to the host's pinned strip (idempotent, keeps order). */
215
+ declare function pinTab(pinned: readonly string[], id: string): readonly string[];
207
216
  /** The user clicked a tab (or a keybinding cycled to it). Always honoured, always opens. */
208
217
  declare function pickTab(state: PanelState, id: string): PanelState;
209
218
  declare function togglePanel(state: PanelState): PanelState;
210
219
  declare function closePanel(state: PanelState): PanelState;
211
220
  /**
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.
221
+ * Agent / extension asked to show a tab. Honoured only until the user has
222
+ * picked a tab themselves (a badge that flipped must never steal the tab);
223
+ * otherwise the request is dropped and the state returned unchanged.
215
224
  */
216
225
  declare function openProactive(state: PanelState, id: string): PanelState;
226
+ /**
227
+ * The agent is blocked on the user (a plan to approve, a question to
228
+ * answer): show the tab regardless of earlier picks. Costs at most a tab
229
+ * switch, and nothing in that tab decides implicitly. Not a user pick, so
230
+ * it does not lock out later proactive opens.
231
+ */
232
+ declare function openForAttention(state: PanelState, id: string): PanelState;
217
233
  /**
218
234
  * Resolve the tab to render: the active one when it still exists, else the
219
235
  * first tab, else `null` (empty catalog). Keeps state stable when an
@@ -270,5 +286,5 @@ declare function cycleTodoStatus(items: readonly TodoItem[], id: string): TodoIt
270
286
  */
271
287
  declare function buildTodoRetryMessage(item: TodoItem): string;
272
288
  //#endregion
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 };
289
+ export { ARTIFACTS_PANEL_ID, type ActiveTrigger, type AuthMethod, BASH_CALL_ID_PREFIX, BUILTIN_PANEL_TABS, type BuildVisibleInstructionRowsOptions, type BuiltinPanelId, type BuiltinPanelTab, CACHE_NOTICE_LABEL, 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, DIFFS_PANEL_ID, type DaemonHealth, type DaemonHealthStyle, type DaemonHealthTone, type DiffLine, type DiffOp, EDIT_TOOL_NAMES, type EditHunkSummary, type EditSummary, type ExtensionPaletteProviderEntry, type ExtensionPanel, type ExtensionPanelEntry, type ExtensionPanelTab, FILES_PANEL_ID, FILES_TRIGGER, type HighlightRange, type HighlightSegment, type HunkResolution, INBOX_PANEL_ID, 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, PALETTE_LIMITS, PALETTE_RECENTS_MAX, PALETTE_RECENT_GROUP, PALETTE_RESULT_MAX, PANEL_CONTENT_LIMITS, type PaletteContext, type PaletteGroup, type PaletteHost, type PaletteItem, type PaletteItemKind, type PaletteProvider, type PaletteRunResult, 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 RankedPaletteItem, 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, TODOS_PANEL_ID, 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, fuzzyMatch, groupPaletteRows, hasRunReceipt, highlightSegments, indexOfEntry, indexOfProviderRow, instructionOriginBadge, instructionPreviewLines, isEditErrorResult, isExpandableProvider, isMainSession, isPaletteContext, isTurnHighlighted, isUserBashEvent, isVisible, liveSessionCost, mergeReferences, mergeSuggestions, mostConstrainedWindow, nextLogLevel, nextTodoId, normalizeMarkdownCodeFences, normalizePaletteItems, normalizePaletteRunResult, normalizePanelContent, oauthAccountLabel, openForAttention, openProactive, orchestratedBy, panelBadgeText, parentProviderKey, parseCustomModelQuery, parseKeyValueLines, pickChainPrimary, pickPrimaryKeyed, pickTab, pinTab, positionKeyed, previewEditPayload, previewLine, promptTurnRefs, pushPaletteRecent, rankPaletteItems, 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 };
274
290
  //# sourceMappingURL=pure.d.ts.map
@@ -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/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,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,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AAA,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"}
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,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;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A,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
@@ -2,7 +2,252 @@ import { h as buildContextBreakdown, m as buildContextSegments, n as normalizePa
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-D_k_FEur.js";
5
+ import { $ as pickChainPrimary, $t as fitRunReceiptCells, A as indexOfEntry, An as createChatsCompletionProvider, At as selectableTurnIds, C as resetLabel, Ct as isUserBashEvent, D as splitPromptSegments, Dn as summarizeOutcomes, Dt as promptTurnRefs, E as usageTone, G as DAEMON_HEALTH_GLYPH, H as liveSessionCost, Ht as orchestratedBy, I as normalizeMarkdownCodeFences, It as ORCHESTRATED_BY_KEY, J as chainEntryKey, Jt as sessionEventLabel, K as DAEMON_HEALTH_STYLE, Kt as sessionDirLabel, L as splitMarkdownCodeBlocks, Lt as SESSION_EVENT_STATUS_STYLE, M as MARKDOWN_RENDER_CHUNK_TARGET_BYTES, N as chunkMarkdownForRender, Nt as turnSelectionOwnership, O as buildModelCatalog, On as CHATS_TRIGGER, Ot as retagUserPromptEvents, Qt as RUN_RECEIPT_GLYPH, Rt as SESSION_ROLE_KEY, S as mostConstrainedWindow, St as isTurnHighlighted, T as updatedLabel, U as retryLabel, V as compactingLabel, Vt as isMainSession, W as streamingLabel, X as chainsEqual, Xt as shortSessionId, Y as chainPositionOf, Yt as sessionEventMeta, Z as chainsEqualKeyed, Zt as truncateTitle, _ as turnContextSize, _n as splitLines, _t as buildLinearRamp, a as TOOL_DISPLAY, an as formatTokensPerSecond, b as formatCredits, bt as EDIT_TOOL_NAMES, c as MAX_TRANSCRIPT_EVENTS, cn as applyEditPayload, ct as SKILLS_TRIGGER, d as finalizeStreamingMarkdown, dt as FILES_TRIGGER, en as formatCostUsd, et as pickPrimaryKeyed, f as finalizeStreamingMarkdownForOwner, fn as computeInlineDiff, ft as createFilesCompletionProvider, gn as previewEditPayload, gt as blendHsl, hn as filetypeFromPath, ht as createCommandsCompletionProvider, i as turnAsText, in as formatTokenCount, j as parseCustomModelQuery, jn as uniqueChatIdsFromReferences, k as filterModelCatalog, kn as chatReferenceTokensFromText, kt as retagUserPromptEventsFromRefs, l as TRANSCRIPT_TRIM_TO_EVENTS, ln as buildContextualDiff, lt as createSkillsCompletionProvider, mn as extractEditPayload, mt as COMMANDS_TRIGGER, n as deleteTurnSafely, nn as formatRunReceiptCells, o as displayNameFor, on as hasRunReceipt, ot as toggleChainEntry, pn as computeLineDiff, pt as uniqueFilesFromReferences, qt as sessionEventExcerpt, r as truncateTurnsAt, rn as formatRunReceiptLine, rt as reorderKeyed, s as formatToolCall, sn as runReceiptFromRun, st as toggleKeyed, t as countNeighbors, tn as formatRunDuration, tt as positionKeyed, u as capTranscriptEvents, un as buildUnifiedDiff, ut as uniqueSkillNamesFromReferences, v as activeSnapshotFor, vn as summarizeEditPayload, vt as BASH_CALL_ID_PREFIX, w as showsAccount, wt as isVisible, x as formatUsagePercent, xt as isEditErrorResult, y as formatBalance, yn as tokenize, yt as CACHE_NOTICE_LABEL, z as cacheBreakChip, zt as WORKER_REPORT_FRAGMENT } from "../turn-operations-DrbJlpq9.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 { 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 };
7
+ import { A as buildVisibleInstructionRows, C as togglePanel, D as splitCommandLine, E as parseKeyValueLines, F as isExpandableProvider, I as parentProviderKey, L as selectableSources, M as instructionPreviewLines, N as buildVisibleAuthRows, O as validateMcpForm, P as indexOfProviderRow, S as resolveActiveTab, T as MCP_TRANSPORTS, _ as cycleTab, a as editTodo, b as pickTab, c as ARTIFACTS_PANEL_ID, d as FILES_PANEL_ID, f as INBOX_PANEL_ID, g as closePanel, h as buildPanelCatalog, i as cycleTodoStatus, j as instructionOriginBadge, k as INSTRUCTION_PREVIEW_LINE_CAP, l as BUILTIN_PANEL_TABS, m as TODOS_PANEL_ID, n as buildTodoRetryMessage, o as nextTodoId, p as INITIAL_PANEL_STATE, r as clearTodos, s as removeTodo, t as addTodo, u as DIFFS_PANEL_ID, v as openForAttention, w as NOTICE_GLYPH, x as pinTab, y as openProactive } from "../todo-edits-UOwgxGKu.js";
8
+ //#region src/chat/palette.ts
9
+ /** Group name the hosts use for the most-recently-used rows shown on an empty query. */
10
+ const PALETTE_RECENT_GROUP = "Recent";
11
+ const PALETTE_RECENTS_MAX = 12;
12
+ /** Ranked rows returned for a query; the host virtualises anyway, this bounds the work. */
13
+ const PALETTE_RESULT_MAX = 200;
14
+ /**
15
+ * Subsequence match of `query` in `text` with the usual bonuses: word
16
+ * starts and the very beginning score higher, gaps cost, runs of adjacent
17
+ * hits are rewarded. Returns null when not every query character appears
18
+ * in order. Case-insensitive; `query` must already be lower-cased.
19
+ */
20
+ function fuzzyMatch(text, query) {
21
+ if (query.length === 0) return {
22
+ score: 0,
23
+ indices: []
24
+ };
25
+ const lower = text.toLowerCase();
26
+ const indices = [];
27
+ let score = 0;
28
+ let from = 0;
29
+ let prev = -2;
30
+ for (const ch of query) {
31
+ const at = lower.indexOf(ch, from);
32
+ if (at === -1) return null;
33
+ const before = at === 0 ? "" : lower[at - 1];
34
+ if (at === 0) score += 8;
35
+ else if (before === " " || before === "/" || before === "-" || before === "_" || before === ":" || before === ".") score += 6;
36
+ else if (text[at] !== lower[at] && text[at - 1] === lower[at - 1]) score += 4;
37
+ else score += 1;
38
+ if (at === prev + 1) score += 3;
39
+ else if (prev >= 0) score -= Math.min(3, at - prev - 1) * .5;
40
+ indices.push(at);
41
+ prev = at;
42
+ from = at + 1;
43
+ }
44
+ score -= text.length * .02;
45
+ return {
46
+ score,
47
+ indices
48
+ };
49
+ }
50
+ /** Every whitespace-separated term must match (AND); scores add, highlight indices merge. */
51
+ function matchTerms(text, terms) {
52
+ let score = 0;
53
+ const indices = /* @__PURE__ */ new Set();
54
+ for (const term of terms) {
55
+ const m = fuzzyMatch(text, term);
56
+ if (!m) return null;
57
+ score += m.score;
58
+ for (const i of m.indices) indices.add(i);
59
+ }
60
+ return {
61
+ score,
62
+ indices: [...indices].sort((a, b) => a - b)
63
+ };
64
+ }
65
+ /**
66
+ * Score every item against `query`. Terms are AND-ed: `tog sid` needs both
67
+ * `tog` and `sid` in order somewhere in the text. Title matches dominate;
68
+ * description, keywords and group are fallbacks that never outrank a
69
+ * title hit. On an empty query recents come first (most recent on top),
70
+ * then the catalog in provider order.
71
+ */
72
+ function rankPaletteItems(items, query, recents = []) {
73
+ const terms = query.trim().toLowerCase().split(/\s+/).filter(Boolean);
74
+ if (terms.length === 0) {
75
+ const recentRank = new Map(recents.map((id, i) => [id, i]));
76
+ const out = [];
77
+ for (const item of items) {
78
+ const r = recentRank.get(item.id);
79
+ if (item.searchOnly && r === void 0) continue;
80
+ out.push({
81
+ item,
82
+ score: r === void 0 ? 0 : 12 - r,
83
+ titleMatches: []
84
+ });
85
+ }
86
+ return out.sort((a, b) => b.score - a.score).slice(0, 200);
87
+ }
88
+ const out = [];
89
+ for (const item of items) {
90
+ const title = matchTerms(item.title, terms);
91
+ if (title) {
92
+ out.push({
93
+ item,
94
+ score: 100 + title.score,
95
+ titleMatches: title.indices
96
+ });
97
+ continue;
98
+ }
99
+ const haystack = [
100
+ item.title,
101
+ item.description ?? "",
102
+ item.group,
103
+ ...item.keywords ?? []
104
+ ].filter(Boolean);
105
+ let total = 0;
106
+ let ok = true;
107
+ for (const term of terms) {
108
+ let best = -Infinity;
109
+ for (const field of haystack) {
110
+ const m = fuzzyMatch(field, term);
111
+ if (m && m.score > best) best = m.score;
112
+ }
113
+ if (best === -Infinity) {
114
+ ok = false;
115
+ break;
116
+ }
117
+ total += best;
118
+ }
119
+ if (ok) out.push({
120
+ item,
121
+ score: total,
122
+ titleMatches: []
123
+ });
124
+ }
125
+ return out.sort((a, b) => b.score - a.score || a.item.title.localeCompare(b.item.title)).slice(0, 200);
126
+ }
127
+ /**
128
+ * Sections for display. With a query the ranking already interleaves
129
+ * providers, so groups follow the order of their best row. Without a
130
+ * query the recents (ids in `recents`, present in `ranked`) form a
131
+ * leading `Recent` section and the rest keeps provider order.
132
+ */
133
+ function groupPaletteRows(ranked, query, recents = []) {
134
+ const groups = /* @__PURE__ */ new Map();
135
+ const push = (title, row) => {
136
+ const list = groups.get(title);
137
+ if (list) list.push(row);
138
+ else groups.set(title, [row]);
139
+ };
140
+ const isRecent = new Set(query.trim() ? [] : recents);
141
+ for (const row of ranked) push(isRecent.has(row.item.id) ? PALETTE_RECENT_GROUP : row.item.group, row);
142
+ return [...groups.entries()].map(([title, rows]) => ({
143
+ title,
144
+ rows
145
+ }));
146
+ }
147
+ /** Most-recent-first list of ids, deduplicated and capped. */
148
+ function pushPaletteRecent(recents, id) {
149
+ return [id, ...recents.filter((r) => r !== id)].slice(0, 12);
150
+ }
151
+ const PALETTE_LIMITS = {
152
+ items: 500,
153
+ textChars: 500,
154
+ keywords: 16
155
+ };
156
+ function str(v, max = PALETTE_LIMITS.textChars) {
157
+ return typeof v === "string" && v.length > 0 ? v.length > max ? `${v.slice(0, max - 1)}…` : v : void 0;
158
+ }
159
+ /**
160
+ * Coerce whatever a provider returned into well-formed items: entries
161
+ * without an id or title are dropped, strings are capped, unknown kinds
162
+ * fall back to `action`, and `source` is stamped with the provider id.
163
+ * Never throws.
164
+ */
165
+ function normalizePaletteItems(input, source, defaultGroup) {
166
+ if (!Array.isArray(input)) return [];
167
+ const out = [];
168
+ const seen = /* @__PURE__ */ new Set();
169
+ for (const raw of input.slice(0, PALETTE_LIMITS.items)) {
170
+ if (!raw || typeof raw !== "object") continue;
171
+ const r = raw;
172
+ const id = str(r.id, 200);
173
+ const title = str(r.title, 200);
174
+ if (!id || !title || seen.has(id)) continue;
175
+ seen.add(id);
176
+ const item = {
177
+ id,
178
+ title,
179
+ group: str(r.group, 80) ?? defaultGroup,
180
+ source
181
+ };
182
+ const description = str(r.description);
183
+ if (description) item.description = description;
184
+ if (Array.isArray(r.keywords)) {
185
+ const kw = r.keywords.filter((k) => typeof k === "string" && k.length > 0).slice(0, PALETTE_LIMITS.keywords);
186
+ if (kw.length > 0) item.keywords = kw.map((k) => k.slice(0, 60));
187
+ }
188
+ if (r.icon && typeof r.icon === "object") {
189
+ const icon = r.icon;
190
+ const gui = str(icon.gui, 120);
191
+ const tui = str(icon.tui, 8);
192
+ if (gui || tui) item.icon = {
193
+ ...gui ? { gui } : {},
194
+ ...tui ? { tui } : {}
195
+ };
196
+ }
197
+ if (r.kind === "toggle" || r.kind === "picker") item.kind = r.kind;
198
+ if (typeof r.checked === "boolean") item.checked = r.checked;
199
+ const keybinding = str(r.keybinding, 60);
200
+ if (keybinding) item.keybinding = keybinding;
201
+ const disabled = str(r.disabled, 200);
202
+ if (disabled) item.disabled = disabled;
203
+ if (r.searchOnly === true) item.searchOnly = true;
204
+ out.push(item);
205
+ }
206
+ return out;
207
+ }
208
+ /** Same guard for a `run` result: anything malformed becomes `undefined` (nothing to do). */
209
+ function normalizePaletteRunResult(input, source, defaultGroup) {
210
+ if (!input || typeof input !== "object") return void 0;
211
+ const r = input;
212
+ switch (r.kind) {
213
+ case "items": {
214
+ const out = {
215
+ kind: "items",
216
+ items: normalizePaletteItems(r.items, source, defaultGroup)
217
+ };
218
+ const title = str(r.title, 200);
219
+ const placeholder = str(r.placeholder, 200);
220
+ if (title) out.title = title;
221
+ if (placeholder) out.placeholder = placeholder;
222
+ return out;
223
+ }
224
+ case "prompt":
225
+ case "insert": {
226
+ const text = str(r.text, 2e4);
227
+ return text ? {
228
+ kind: r.kind,
229
+ text
230
+ } : void 0;
231
+ }
232
+ case "notify": {
233
+ const text = str(r.text, 1e3);
234
+ if (!text) return void 0;
235
+ return {
236
+ kind: "notify",
237
+ text,
238
+ tone: r.tone === "warn" || r.tone === "error" ? r.tone : "info"
239
+ };
240
+ }
241
+ default: return;
242
+ }
243
+ }
244
+ /** Type guard hosts use before forwarding a payload from an untrusted provider. */
245
+ function isPaletteContext(v) {
246
+ if (!v || typeof v !== "object") return false;
247
+ const c = v;
248
+ return (c.host === "gui" || c.host === "tui") && (c.cwd === void 0 || typeof c.cwd === "string") && (c.sessionId === void 0 || typeof c.sessionId === "string") && (c.busy === void 0 || typeof c.busy === "boolean");
249
+ }
250
+ //#endregion
251
+ export { ARTIFACTS_PANEL_ID, BASH_CALL_ID_PREFIX, BUILTIN_PANEL_TABS, CACHE_NOTICE_LABEL, CHATS_TRIGGER, COMMANDS_TRIGGER, DAEMON_HEALTH_GLYPH, DAEMON_HEALTH_STYLE, DEFAULT_OAUTH_ACCOUNT_LABEL, DIFFS_PANEL_ID, EDIT_TOOL_NAMES, FILES_PANEL_ID, FILES_TRIGGER, INBOX_PANEL_ID, 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, PALETTE_LIMITS, PALETTE_RECENTS_MAX, PALETTE_RECENT_GROUP, PALETTE_RESULT_MAX, PANEL_CONTENT_LIMITS, RUN_RECEIPT_GLYPH, SESSION_EVENT_STATUS_STYLE, SESSION_ROLE_KEY, SKILLS_TRIGGER, TODOS_PANEL_ID, 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, fuzzyMatch, groupPaletteRows, hasRunReceipt, highlightSegments, indexOfEntry, indexOfProviderRow, instructionOriginBadge, instructionPreviewLines, isEditErrorResult, isExpandableProvider, isMainSession, isPaletteContext, isTurnHighlighted, isUserBashEvent, isVisible, liveSessionCost, mergeReferences, mergeSuggestions, mostConstrainedWindow, nextLogLevel, nextTodoId, normalizeMarkdownCodeFences, normalizePaletteItems, normalizePaletteRunResult, normalizePanelContent, oauthAccountLabel, openForAttention, openProactive, orchestratedBy, panelBadgeText, parentProviderKey, parseCustomModelQuery, parseKeyValueLines, pickChainPrimary, pickPrimaryKeyed, pickTab, pinTab, positionKeyed, previewEditPayload, previewLine, promptTurnRefs, pushPaletteRecent, rankPaletteItems, 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 };
252
+
253
+ //# sourceMappingURL=pure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pure.js","names":[],"sources":["../../src/chat/palette.ts"],"sourcesContent":["/**\n * Command palette: the renderer-agnostic model.\n *\n * Everything the user can do from the palette is a {@link PaletteItem}:\n * built-in key actions, `/` commands, panels, sessions, settings toggles\n * and extension actions all flow through one shape, so one search covers\n * the app. Items are JSON-safe data and `run` is addressed by id, the same\n * contract side panels use: an extension's provider executes where the\n * extension lives (TUI in-process, GUI main process) and the palette\n * paints in the host with its own components.\n *\n * This module is pure (no React, no node): ranking, grouping, recents and\n * the normaliser applied before items cross IPC. The TUI and the GUI each\n * render the result; they never re-implement the ordering.\n */\nimport type { PanelIcon } from '../extensions/panels'\nimport type { JsonValue } from '../types'\n\nexport type PaletteHost = 'gui' | 'tui'\n\n/** `toggle` shows a checked state; `picker` opens a nested list on run. */\nexport type PaletteItemKind = 'action' | 'toggle' | 'picker'\n\nexport interface PaletteItem {\n /** Stable, unique across providers: `builtin:openSettings`, `slash:compact`, `<extension>/<id>`. */\n id: string\n title: string\n description?: string\n /** Section header. Hosts order groups by first appearance after `Recent`. */\n group: string\n /** Extra search terms not shown in the row. */\n keywords?: readonly string[]\n icon?: PanelIcon\n kind?: PaletteItemKind\n /** For `toggle` items. */\n checked?: boolean\n /** Resolved chord spec (`ctrl+shift+k`); the host formats it for display. */\n keybinding?: string\n /** Reason the item cannot run right now; it stays listed, muted. */\n disabled?: string\n /**\n * Only appears once the query matches it: bulk catalogs (every file in\n * the project) stay out of the empty-query listing but are one keystroke\n * away.\n */\n searchOnly?: boolean\n /** Provider that owns `run` for this item. Stamped by the aggregator. */\n source: string\n}\n\n/** JSON-safe snapshot of the host handed to providers. Never holds functions. */\nexport interface PaletteContext {\n host: PaletteHost\n cwd?: string\n sessionId?: string\n /** A run is in flight on the active session. */\n busy?: boolean\n}\n\n/**\n * What a provider's `run` may hand back. `items` opens a nested picker\n * (branches, environments); the host keeps a stack so Backspace on an\n * empty query goes back one level. `prompt` sends text to the chat,\n * `insert` puts it in the composer (a `/` command that takes arguments).\n */\nexport type PaletteRunResult\n = | void\n | undefined\n | { kind: 'items', title?: string, placeholder?: string, items: readonly PaletteItem[] }\n | { kind: 'prompt', text: string }\n | { kind: 'insert', text: string }\n | { kind: 'notify', text: string, tone?: 'info' | 'warn' | 'error' }\n\nexport interface PaletteProvider {\n id: string\n /** Items for the current context. Called on open, on `subscribe` emits, and on explicit refresh. */\n items: (ctx: PaletteContext) => readonly PaletteItem[] | Promise<readonly PaletteItem[]>\n run: (itemId: string, ctx: PaletteContext) => PaletteRunResult | Promise<PaletteRunResult>\n /** Live updates while the palette is open, same contract as panels. */\n subscribe?: (emit: () => void) => () => void\n}\n\n// ---------------------------------------------------------------------------\n// Ranking\n// ---------------------------------------------------------------------------\n\nexport interface RankedPaletteItem {\n item: PaletteItem\n score: number\n /** Indices into `item.title` to highlight. Empty when the match came from elsewhere. */\n titleMatches: readonly number[]\n}\n\n/** Group name the hosts use for the most-recently-used rows shown on an empty query. */\nexport const PALETTE_RECENT_GROUP = 'Recent'\nexport const PALETTE_RECENTS_MAX = 12\n/** Ranked rows returned for a query; the host virtualises anyway, this bounds the work. */\nexport const PALETTE_RESULT_MAX = 200\n\n/**\n * Subsequence match of `query` in `text` with the usual bonuses: word\n * starts and the very beginning score higher, gaps cost, runs of adjacent\n * hits are rewarded. Returns null when not every query character appears\n * in order. Case-insensitive; `query` must already be lower-cased.\n */\nexport function fuzzyMatch(text: string, query: string): { score: number, indices: number[] } | null {\n if (query.length === 0)\n return { score: 0, indices: [] }\n const lower = text.toLowerCase()\n const indices: number[] = []\n let score = 0\n let from = 0\n let prev = -2\n for (const ch of query) {\n const at = lower.indexOf(ch, from)\n if (at === -1)\n return null\n const before = at === 0 ? '' : lower[at - 1]\n if (at === 0)\n score += 8\n else if (before === ' ' || before === '/' || before === '-' || before === '_' || before === ':' || before === '.')\n score += 6\n else if (text[at] !== lower[at] && text[at - 1] === lower[at - 1])\n score += 4 // camelCase hump\n else\n score += 1\n if (at === prev + 1)\n score += 3\n else if (prev >= 0)\n score -= Math.min(3, at - prev - 1) * 0.5\n indices.push(at)\n prev = at\n from = at + 1\n }\n // Shorter targets win ties: \"Open settings\" over \"Open settings: keybindings\".\n score -= text.length * 0.02\n return { score, indices }\n}\n\n/** Every whitespace-separated term must match (AND); scores add, highlight indices merge. */\nfunction matchTerms(text: string, terms: readonly string[]): { score: number, indices: number[] } | null {\n let score = 0\n const indices = new Set<number>()\n for (const term of terms) {\n const m = fuzzyMatch(text, term)\n if (!m)\n return null\n score += m.score\n for (const i of m.indices) indices.add(i)\n }\n return { score, indices: [...indices].sort((a, b) => a - b) }\n}\n\n/**\n * Score every item against `query`. Terms are AND-ed: `tog sid` needs both\n * `tog` and `sid` in order somewhere in the text. Title matches dominate;\n * description, keywords and group are fallbacks that never outrank a\n * title hit. On an empty query recents come first (most recent on top),\n * then the catalog in provider order.\n */\nexport function rankPaletteItems(\n items: readonly PaletteItem[],\n query: string,\n recents: readonly string[] = [],\n): RankedPaletteItem[] {\n const terms = query.trim().toLowerCase().split(/\\s+/).filter(Boolean)\n if (terms.length === 0) {\n const recentRank = new Map(recents.map((id, i) => [id, i]))\n const out: RankedPaletteItem[] = []\n for (const item of items) {\n const r = recentRank.get(item.id)\n // Search-only items surface on an empty query only as recents.\n if (item.searchOnly && r === undefined)\n continue\n out.push({ item, score: r === undefined ? 0 : PALETTE_RECENTS_MAX - r, titleMatches: [] })\n }\n // Stable: recents by recency, everything else keeps provider order.\n return out.sort((a, b) => b.score - a.score).slice(0, PALETTE_RESULT_MAX)\n }\n const out: RankedPaletteItem[] = []\n for (const item of items) {\n const title = matchTerms(item.title, terms)\n if (title) {\n out.push({ item, score: 100 + title.score, titleMatches: title.indices })\n continue\n }\n // Fallback: every term must land somewhere across title, description, keywords, group.\n const haystack = [item.title, item.description ?? '', item.group, ...(item.keywords ?? [])].filter(Boolean)\n let total = 0\n let ok = true\n for (const term of terms) {\n let best = -Infinity\n for (const field of haystack) {\n const m = fuzzyMatch(field, term)\n if (m && m.score > best)\n best = m.score\n }\n if (best === -Infinity) {\n ok = false\n break\n }\n total += best\n }\n if (ok)\n out.push({ item, score: total, titleMatches: [] })\n }\n return out.sort((a, b) => b.score - a.score || a.item.title.localeCompare(b.item.title)).slice(0, PALETTE_RESULT_MAX)\n}\n\nexport interface PaletteGroup {\n title: string\n rows: readonly RankedPaletteItem[]\n}\n\n/**\n * Sections for display. With a query the ranking already interleaves\n * providers, so groups follow the order of their best row. Without a\n * query the recents (ids in `recents`, present in `ranked`) form a\n * leading `Recent` section and the rest keeps provider order.\n */\nexport function groupPaletteRows(\n ranked: readonly RankedPaletteItem[],\n query: string,\n recents: readonly string[] = [],\n): PaletteGroup[] {\n const groups = new Map<string, RankedPaletteItem[]>()\n const push = (title: string, row: RankedPaletteItem) => {\n const list = groups.get(title)\n if (list)\n list.push(row)\n else groups.set(title, [row])\n }\n const isRecent = new Set(query.trim() ? [] : recents)\n for (const row of ranked)\n push(isRecent.has(row.item.id) ? PALETTE_RECENT_GROUP : row.item.group, row)\n return [...groups.entries()].map(([title, rows]) => ({ title, rows }))\n}\n\n/** Most-recent-first list of ids, deduplicated and capped. */\nexport function pushPaletteRecent(recents: readonly string[], id: string): string[] {\n return [id, ...recents.filter(r => r !== id)].slice(0, PALETTE_RECENTS_MAX)\n}\n\n// ---------------------------------------------------------------------------\n// Normalisation (before items cross IPC or reach a renderer)\n// ---------------------------------------------------------------------------\n\nexport const PALETTE_LIMITS = {\n items: 500,\n textChars: 500,\n keywords: 16,\n} as const\n\nfunction str(v: unknown, max: number = PALETTE_LIMITS.textChars): string | undefined {\n return typeof v === 'string' && v.length > 0 ? (v.length > max ? `${v.slice(0, max - 1)}…` : v) : undefined\n}\n\n/**\n * Coerce whatever a provider returned into well-formed items: entries\n * without an id or title are dropped, strings are capped, unknown kinds\n * fall back to `action`, and `source` is stamped with the provider id.\n * Never throws.\n */\nexport function normalizePaletteItems(input: unknown, source: string, defaultGroup: string): PaletteItem[] {\n if (!Array.isArray(input))\n return []\n const out: PaletteItem[] = []\n const seen = new Set<string>()\n for (const raw of input.slice(0, PALETTE_LIMITS.items)) {\n if (!raw || typeof raw !== 'object')\n continue\n const r = raw as Record<string, unknown>\n const id = str(r.id, 200)\n const title = str(r.title, 200)\n if (!id || !title || seen.has(id))\n continue\n seen.add(id)\n const item: PaletteItem = { id, title, group: str(r.group, 80) ?? defaultGroup, source }\n const description = str(r.description)\n if (description)\n item.description = description\n if (Array.isArray(r.keywords)) {\n const kw = r.keywords.filter((k): k is string => typeof k === 'string' && k.length > 0).slice(0, PALETTE_LIMITS.keywords)\n if (kw.length > 0)\n item.keywords = kw.map(k => k.slice(0, 60))\n }\n if (r.icon && typeof r.icon === 'object') {\n const icon = r.icon as Record<string, unknown>\n const gui = str(icon.gui, 120)\n const tui = str(icon.tui, 8)\n if (gui || tui)\n item.icon = { ...(gui ? { gui } : {}), ...(tui ? { tui } : {}) }\n }\n if (r.kind === 'toggle' || r.kind === 'picker')\n item.kind = r.kind\n if (typeof r.checked === 'boolean')\n item.checked = r.checked\n const keybinding = str(r.keybinding, 60)\n if (keybinding)\n item.keybinding = keybinding\n const disabled = str(r.disabled, 200)\n if (disabled)\n item.disabled = disabled\n if (r.searchOnly === true)\n item.searchOnly = true\n out.push(item)\n }\n return out\n}\n\n/** Same guard for a `run` result: anything malformed becomes `undefined` (nothing to do). */\nexport function normalizePaletteRunResult(input: unknown, source: string, defaultGroup: string): PaletteRunResult {\n if (!input || typeof input !== 'object')\n return undefined\n const r = input as Record<string, unknown>\n switch (r.kind) {\n case 'items': {\n const out: Extract<PaletteRunResult, { kind: 'items' }> = {\n kind: 'items',\n items: normalizePaletteItems(r.items, source, defaultGroup),\n }\n const title = str(r.title, 200)\n const placeholder = str(r.placeholder, 200)\n if (title)\n out.title = title\n if (placeholder)\n out.placeholder = placeholder\n return out\n }\n case 'prompt':\n case 'insert': {\n const text = str(r.text, 20_000)\n return text ? { kind: r.kind, text } : undefined\n }\n case 'notify': {\n const text = str(r.text, 1000)\n if (!text)\n return undefined\n const tone = r.tone === 'warn' || r.tone === 'error' ? r.tone : 'info'\n return { kind: 'notify', text, tone }\n }\n default:\n return undefined\n }\n}\n\n/** Type guard hosts use before forwarding a payload from an untrusted provider. */\nexport function isPaletteContext(v: unknown): v is PaletteContext {\n if (!v || typeof v !== 'object')\n return false\n const c = v as Record<string, JsonValue | undefined>\n return (c.host === 'gui' || c.host === 'tui')\n && (c.cwd === undefined || typeof c.cwd === 'string')\n && (c.sessionId === undefined || typeof c.sessionId === 'string')\n && (c.busy === undefined || typeof c.busy === 'boolean')\n}\n"],"mappings":";;;;;;;;;AA8FA,MAAa,uBAAuB;AACpC,MAAa,sBAAsB;;AAEnC,MAAa,qBAAqB;;;;;;;AAQlC,SAAgB,WAAW,MAAc,OAA4D;CACnG,IAAI,MAAM,WAAW,GACnB,OAAO;EAAE,OAAO;EAAG,SAAS,CAAC;CAAE;CACjC,MAAM,QAAQ,KAAK,YAAY;CAC/B,MAAM,UAAoB,CAAC;CAC3B,IAAI,QAAQ;CACZ,IAAI,OAAO;CACX,IAAI,OAAO;CACX,KAAK,MAAM,MAAM,OAAO;EACtB,MAAM,KAAK,MAAM,QAAQ,IAAI,IAAI;EACjC,IAAI,OAAO,IACT,OAAO;EACT,MAAM,SAAS,OAAO,IAAI,KAAK,MAAM,KAAK;EAC1C,IAAI,OAAO,GACT,SAAS;OACN,IAAI,WAAW,OAAO,WAAW,OAAO,WAAW,OAAO,WAAW,OAAO,WAAW,OAAO,WAAW,KAC5G,SAAS;OACN,IAAI,KAAK,QAAQ,MAAM,OAAO,KAAK,KAAK,OAAO,MAAM,KAAK,IAC7D,SAAS;OAET,SAAS;EACX,IAAI,OAAO,OAAO,GAChB,SAAS;OACN,IAAI,QAAQ,GACf,SAAS,KAAK,IAAI,GAAG,KAAK,OAAO,CAAC,IAAI;EACxC,QAAQ,KAAK,EAAE;EACf,OAAO;EAC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