zidane-ui 9.2.3 → 9.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/adapters/live.d.ts +6 -0
  2. package/dist/adapters/live.js +16 -8
  3. package/dist/adapters/server-composer-host.js +22 -9
  4. package/dist/adapters/server-host.js +143 -18
  5. package/dist/adapters/server-media.d.ts +9 -1
  6. package/dist/adapters/server-media.js +14 -1
  7. package/dist/chat/HostTranscript.d.ts +0 -12
  8. package/dist/chat/HostTranscript.js +6 -1
  9. package/dist/chat/SessionStreamsProvider.d.ts +8 -0
  10. package/dist/chat/SessionStreamsProvider.js +11 -2
  11. package/dist/chat/Transcript.d.ts +20 -11
  12. package/dist/chat/Transcript.js +326 -160
  13. package/dist/chat/composer/ComposerEditor.js +1 -1
  14. package/dist/chat/headless/host.d.ts +43 -7
  15. package/dist/chat/headless/index.d.ts +7 -6
  16. package/dist/chat/headless/index.js +10 -9
  17. package/dist/chat/headless/labels.d.ts +17 -0
  18. package/dist/chat/headless/labels.js +17 -0
  19. package/dist/chat/headless/markdown-chunks.d.ts +2 -1
  20. package/dist/chat/headless/markdown-chunks.js +12 -20
  21. package/dist/chat/headless/markdown-scan.d.ts +66 -0
  22. package/dist/chat/headless/markdown-scan.js +124 -0
  23. package/dist/chat/headless/markdown-stream.d.ts +64 -0
  24. package/dist/chat/headless/markdown-stream.js +143 -0
  25. package/dist/chat/headless/output-pager.d.ts +68 -0
  26. package/dist/chat/headless/output-pager.js +113 -0
  27. package/dist/chat/headless/session-list.d.ts +10 -0
  28. package/dist/chat/headless/sidebar/activity.d.ts +14 -0
  29. package/dist/chat/headless/sidebar/activity.js +32 -0
  30. package/dist/chat/headless/sidebar/directory.d.ts +9 -1
  31. package/dist/chat/headless/sidebar/directory.js +10 -50
  32. package/dist/chat/headless/sidebar/labels.d.ts +11 -1
  33. package/dist/chat/headless/sidebar/prewarm.d.ts +68 -0
  34. package/dist/chat/headless/sidebar/prewarm.js +114 -0
  35. package/dist/chat/headless/streams/actions.d.ts +2 -0
  36. package/dist/chat/headless/streams/actions.js +1 -0
  37. package/dist/chat/headless/streams/event-bytes.d.ts +6 -0
  38. package/dist/chat/headless/streams/event-bytes.js +34 -0
  39. package/dist/chat/headless/streams/live-events.d.ts +25 -1
  40. package/dist/chat/headless/streams/live-events.js +53 -2
  41. package/dist/chat/headless/streams/selectors.d.ts +3 -0
  42. package/dist/chat/headless/streams/selectors.js +8 -1
  43. package/dist/chat/headless/streams/session-streams.d.ts +15 -3
  44. package/dist/chat/headless/streams/session-streams.js +31 -3
  45. package/dist/chat/headless/streams/store.d.ts +24 -1
  46. package/dist/chat/headless/streams/store.js +51 -26
  47. package/dist/chat/headless/streams/transcript-map.d.ts +57 -0
  48. package/dist/chat/headless/streams/transcript-map.js +88 -0
  49. package/dist/chat/headless/streams/transcript.d.ts +4 -2
  50. package/dist/chat/headless/streams/transcript.js +19 -7
  51. package/dist/chat/headless/transcript/batch.js +5 -1
  52. package/dist/chat/headless/transcript/blob-media.d.ts +15 -0
  53. package/dist/chat/headless/transcript/blob-media.js +23 -0
  54. package/dist/chat/headless/transcript/collapse.d.ts +10 -0
  55. package/dist/chat/headless/transcript/collapse.js +32 -6
  56. package/dist/chat/headless/transcript/derive.d.ts +98 -0
  57. package/dist/chat/headless/transcript/derive.js +89 -0
  58. package/dist/chat/headless/transcript/exchange-media.d.ts +3 -1
  59. package/dist/chat/headless/transcript/exchange-media.js +8 -5
  60. package/dist/chat/headless/transcript/fold-attachments.d.ts +2 -0
  61. package/dist/chat/headless/transcript/fold-attachments.js +3 -2
  62. package/dist/chat/headless/transcript/fold.d.ts +2 -1
  63. package/dist/chat/headless/transcript/fold.js +16 -6
  64. package/dist/chat/headless/transcript/incremental.d.ts +53 -0
  65. package/dist/chat/headless/transcript/incremental.js +181 -0
  66. package/dist/chat/headless/transcript/index.d.ts +2 -2
  67. package/dist/chat/headless/transcript/index.js +2 -2
  68. package/dist/chat/headless/transcript/nesting.js +2 -1
  69. package/dist/chat/headless/transcript/rail.d.ts +50 -1
  70. package/dist/chat/headless/transcript/rail.js +165 -23
  71. package/dist/chat/headless/transcript/rows.d.ts +5 -1
  72. package/dist/chat/headless/transcript/run-failures.js +2 -1
  73. package/dist/chat/headless/transcript/seams.d.ts +78 -0
  74. package/dist/chat/headless/transcript/seams.js +116 -0
  75. package/dist/chat/headless/transcript/tool-media.d.ts +6 -7
  76. package/dist/chat/headless/transcript/tool-media.js +27 -9
  77. package/dist/chat/index.d.ts +8 -7
  78. package/dist/chat/index.js +17 -16
  79. package/dist/chat/sidebar/SidebarFooter.d.ts +8 -5
  80. package/dist/chat/sidebar/SidebarFooter.js +6 -6
  81. package/dist/chat/testing/contract.d.ts +5 -3
  82. package/dist/chat/testing/contract.js +66 -1
  83. package/dist/chat/transcript/DiffLines.d.ts +6 -1
  84. package/dist/chat/transcript/DiffLines.js +35 -20
  85. package/dist/chat/transcript/EditDiffBlock.d.ts +5 -1
  86. package/dist/chat/transcript/EditDiffBlock.js +89 -30
  87. package/dist/chat/transcript/LazyRow.d.ts +40 -40
  88. package/dist/chat/transcript/LazyRow.js +101 -149
  89. package/dist/chat/transcript/MermaidDiagram.js +2 -1
  90. package/dist/chat/transcript/SubagentBlock.js +3 -2
  91. package/dist/chat/transcript/TranscriptRail.d.ts +25 -2
  92. package/dist/chat/transcript/TranscriptRail.js +175 -17
  93. package/dist/chat/transcript/TranscriptRow.d.ts +4 -7
  94. package/dist/chat/transcript/TranscriptRow.js +4 -3
  95. package/dist/chat/transcript/actions.d.ts +37 -1
  96. package/dist/chat/transcript/actions.js +27 -1
  97. package/dist/chat/transcript/clipped-output.d.ts +58 -0
  98. package/dist/chat/transcript/clipped-output.js +131 -0
  99. package/dist/chat/transcript/fold-attachments.js +10 -5
  100. package/dist/chat/transcript/fold-worker.js +3 -2
  101. package/dist/chat/transcript/fold.js +2 -1
  102. package/dist/chat/transcript/index.d.ts +10 -9
  103. package/dist/chat/transcript/index.js +9 -8
  104. package/dist/chat/transcript/markdown-cache.d.ts +7 -1
  105. package/dist/chat/transcript/markdown-cache.js +12 -1
  106. package/dist/chat/transcript/markdown.js +116 -54
  107. package/dist/chat/transcript/media-gallery.d.ts +3 -2
  108. package/dist/chat/transcript/media-gallery.js +10 -7
  109. package/dist/chat/transcript/notices.js +2 -1
  110. package/dist/chat/transcript/prompt.js +6 -4
  111. package/dist/chat/transcript/prose.js +2 -1
  112. package/dist/chat/transcript/root-items.d.ts +96 -0
  113. package/dist/chat/transcript/root-items.js +180 -0
  114. package/dist/chat/transcript/row-mount.d.ts +165 -0
  115. package/dist/chat/transcript/row-mount.js +498 -0
  116. package/dist/chat/transcript/row-parking.d.ts +125 -0
  117. package/dist/chat/transcript/row-parking.js +135 -0
  118. package/dist/chat/transcript/row-ui-state.d.ts +37 -0
  119. package/dist/chat/transcript/row-ui-state.js +53 -0
  120. package/dist/chat/transcript/run-rows.js +3 -2
  121. package/dist/chat/transcript/script-input.d.ts +1 -1
  122. package/dist/chat/transcript/tasks.js +3 -2
  123. package/dist/chat/transcript/tool-media.d.ts +4 -2
  124. package/dist/chat/transcript/tool-media.js +15 -7
  125. package/dist/chat/transcript/tool-parts.d.ts +27 -4
  126. package/dist/chat/transcript/tool-parts.js +31 -5
  127. package/dist/chat/transcript/tool-payload.js +26 -11
  128. package/dist/chat/transcript/tool-row.d.ts +2 -1
  129. package/dist/chat/transcript/tool-row.js +38 -19
  130. package/dist/chat/transcript/use-transcript-rows.d.ts +24 -7
  131. package/dist/chat/transcript/use-transcript-rows.js +28 -46
  132. package/dist/chat/transcript/useStickToBottom.js +2 -3
  133. package/dist/chat/transcript/useTranscriptSearch.js +30 -14
  134. package/dist/chat/transcript/view-scope.d.ts +26 -6
  135. package/dist/chat/transcript/view-scope.js +106 -20
  136. package/dist/dist/{index-E1Z0aPmi.d.ts → index-C6-t1SS9.d.ts} +2 -1
  137. package/dist/dist/index.d.ts +1 -1
  138. package/dist/session/SessionHeader.js +1 -0
  139. package/dist/settings/headless/fixture-performance.js +4 -2
  140. package/dist/settings/headless/performance.d.ts +4 -0
  141. package/dist/settings/headless/search.d.ts +1 -1
  142. package/dist/settings/sections/performance/PerformanceSection.js +8 -1
  143. package/dist/settings/sections/performance/labels.d.ts +2 -0
  144. package/dist/settings/sections/performance/labels.js +2 -0
  145. package/dist/styles.css +33 -2
  146. package/dist/views/headless/answers.d.ts +8 -2
  147. package/dist/views/headless/answers.js +58 -1
  148. package/dist/views/headless/placement.d.ts +78 -0
  149. package/dist/views/headless/placement.js +154 -44
  150. package/package.json +2 -2
  151. package/src/styles/transcript.css +33 -2
@@ -8,14 +8,15 @@
8
8
  * an agent running in the page and a recorded fixture all implement this.
9
9
  */
10
10
  import { ChatBlockRuns } from "./block-runs.js";
11
+ import { ToolOutputRange } from "./output-pager.js";
11
12
  import { PromptOrigin } from "./prompt-origin.js";
12
13
  import { SessionRemoval, SessionRowChange } from "./sidebar/directory.js";
13
14
  import { SessionArchiveFilter, SidebarListSession } from "./sidebar/types.js";
14
15
  import { SidebarViewsHost } from "./sidebar/view.js";
15
16
  import { Readable } from "./store.js";
16
17
  import { ChatBadgeActions, ChatChipDetails, ChatPaths, ChatReferences, ChatSearchSync, ChatSiteIcons } from "./transcript-host.js";
17
- import { PromptSegmentRef } from "zidane/chat/pure";
18
- import { InteractionRequest, InteractionResponse, MessageDelivery, SessionInboxPatch as SessionInboxPatch$1, StreamEvent } from "zidane/chat";
18
+ import { PromptOutline, PromptSegmentRef, TranscriptEvents } from "zidane/chat/pure";
19
+ import { InteractionRequest, InteractionResponse, MessageDelivery, SessionInboxPatch as SessionInboxPatch$1, StreamEvent, ToolCallDetail as ToolCallDetail$1, ToolResultSlice } from "zidane/chat";
19
20
  /** An attachment on a prompt, as the components can show it. */
20
21
  export interface ChatAttachment {
21
22
  /** File name shown on the attachment chip. */
@@ -26,6 +27,8 @@ export interface ChatAttachment {
26
27
  size: number;
27
28
  /** Where a preview loads the bytes from (images and PDFs): a `data:` URL, an object URL, or any URL the page can load. */
28
29
  dataUrl?: string;
30
+ /** The blob the session store holds it as (`attachment://<hash>`): without `dataUrl`, it loads by hash (`TranscriptActions.blobMediaUrl`). */
31
+ ref?: string;
29
32
  /**
30
33
  * The file as the user picked it, when the composer converted it to send
31
34
  * (an image re-encoded to fit the cap). The host saves these bytes where
@@ -46,9 +49,10 @@ export interface ChatAttachmentOriginal {
46
49
  }
47
50
  /**
48
51
  * zidane's canonical transcript event, plus what a live client knows and a
49
- * replay does not: attachment previews, arrival times, clipped outputs and
50
- * thinking durations. Every extra is optional; a replayed `StreamEvent`
51
- * list is a valid `ChatEvent` list.
52
+ * replay does not: attachment previews, arrival times and thinking
53
+ * durations. Every extra is optional; a replayed `StreamEvent` list is a
54
+ * valid `ChatEvent` list. What the host cut from a row for the wire is the
55
+ * event's own `clipped` (`host.toolOutput`, `host.toolCall` fetch the rest).
52
56
  */
53
57
  export type ChatEvent = Omit<StreamEvent, 'attachments'> & {
54
58
  attachments?: readonly ChatAttachment[];
@@ -57,8 +61,6 @@ export type ChatEvent = Omit<StreamEvent, 'attachments'> & {
57
61
  * only when its host sent none (`startedAt` / `durationMs`, an older host).
58
62
  */
59
63
  receivedAt?: number;
60
- /** The `tool-result` text was cut for transport; `host.toolOutput` fetches the whole of it. */
61
- clipped?: true;
62
64
  /** Epoch ms a live thinking segment opened (on its first event). */
63
65
  thinkingStartedAt?: number;
64
66
  /** A closed live thinking segment's duration, replacing `thinkingStartedAt`. */
@@ -103,6 +105,12 @@ export interface ChatSession {
103
105
  export interface TranscriptState {
104
106
  /** The events loaded so far, oldest first. */
105
107
  events: readonly ChatEvent[];
108
+ /**
109
+ * The same events as a transcript store (settled exchanges and the open one), when the host keeps them so
110
+ * (`SessionStreamStore`). A renderer that reads it walks only the open exchange per streamed delta; `events`
111
+ * is then made on first read.
112
+ */
113
+ transcript?: TranscriptEvents<ChatEvent>;
106
114
  /** A run is in flight: the last reply may still be streaming. */
107
115
  running: boolean;
108
116
  /** History has arrived (until then the transcript shows its loading state). */
@@ -116,6 +124,16 @@ export interface TranscriptState {
116
124
  export interface Transcript extends Readable<TranscriptState> {
117
125
  /** Fetches older events and prepends them to `events`. Absent: the Earlier messages control is hidden. */
118
126
  loadEarlier?: () => void;
127
+ /**
128
+ * Loads the earlier pages up to turn position `index` (a prompt the rail lists, `PromptOutlineEntry.index`).
129
+ * Resolves `true` once that turn's rows are in. Absent: the rail jumps only to prompts already loaded.
130
+ */
131
+ loadThrough?: (index: number) => Promise<boolean>;
132
+ /**
133
+ * The session's prompt outline: every typed prompt and its turn position, loaded or not. `null` when the host
134
+ * can't say (one from before it). Absent: the rail lists the loaded prompts only.
135
+ */
136
+ outline?: () => Promise<PromptOutline | null>;
119
137
  }
120
138
  /** A request from the agent that waits for the user: a question, a plan, or an approval. */
121
139
  export interface ChatInteraction {
@@ -276,12 +294,30 @@ export interface ChatHost {
276
294
  models?: Readable<readonly ChatModelProvider[]>;
277
295
  /** A tool call's full output, when the event carries a preview only. */
278
296
  toolOutput?: (sessionId: string, callId: string) => Promise<string | null>;
297
+ /**
298
+ * One range of a tool call's full output (UTF-16 code units), when the event carries a preview only:
299
+ * the row then pages through it (`TOOL_OUTPUT_PAGE_SIZE` at a time) instead of reading it whole with
300
+ * `toolOutput`. `null` when the host holds no result for the call. `turnId`: the call's turn, a hint
301
+ * where to look first.
302
+ */
303
+ toolOutputRange?: (sessionId: string, callId: string, range: ToolOutputRange, turnId?: string) => Promise<ToolResultSlice | null>;
304
+ /**
305
+ * The whole of a tool call (its input, every hunk of its edit), when the
306
+ * event went out lean (`clipped.input`, `edit.clipped`). `turnId`: the
307
+ * call's turn, a hint where to look first.
308
+ */
309
+ toolCall?: (sessionId: string, callId: string, turnId?: string) => Promise<ToolCallDetail$1 | null>;
279
310
  /**
280
311
  * Where a message's media loads from (`![alt](src)`, see
281
312
  * `TranscriptActions.messageMediaUrl`): `src` as written, or the host's
282
313
  * address for a local file; `undefined` when it serves none.
283
314
  */
284
315
  messageMediaUrl?: (sessionId: string, src: string) => string | undefined;
316
+ /**
317
+ * The address of a medium the host's session store holds by content hash (`TranscriptActions.blobMediaUrl`): a
318
+ * prompt's attachment, a tool result's media block. The same bytes for good. `undefined` when it serves none now.
319
+ */
320
+ blobMediaUrl?: (hash: string, name?: string) => string | undefined;
285
321
  /** Stop a running tool call (a shell command). */
286
322
  cancelTool?: (sessionId: string, callId: string) => void;
287
323
  /** The transcript search a session's other windows share. Absent: the search stays in this window. */
@@ -1,14 +1,15 @@
1
1
  import { commandRef, shortUrl, urlRefs } from "./badge-refs.js";
2
2
  import { ChatBlockRunOptions, ChatBlockRunTransport, ChatBlockRuns, LIVE_BLOCK_RUN_LINES, LiveBlockRun, createChatBlockRuns } from "./block-runs.js";
3
3
  import { beginChipWork, chipWorkBusy, resetChipWorkForTests, whenChipsSettle } from "./chip-settle.js";
4
+ import { ChipViewLabels, commandName, commandView, commitView, sessionForToken, sessionView, skillGroupView, skillName, skillView } from "./chip-views.js";
4
5
  import { SessionNotification, SessionNotificationStore, createNotificationStore } from "./sidebar/notifications.js";
5
6
  import { SessionActivityFilter, SessionArchiveFilter, SidebarExtensionView, SidebarGroupBy, SidebarInboxGroupBy, SidebarLayout, SidebarListSession, SidebarOrigin, SidebarSortBy, SidebarView, VIEW_CHOICE } from "./sidebar/types.js";
6
7
  import { DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SidebarLastSessions, SidebarViewDefaults, SidebarViewMap, SidebarViewPicks, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, SpaceSwitcherPrefs, createSidebarViews, defaultSidebarLayout, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, readSidebarViews, resolveSidebarView, sidebarLayoutOf, sidebarViewDefaults } from "./sidebar/view.js";
7
8
  import { AGENT_GROUPING, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, SidebarContributionStores, SidebarContributions, SidebarGrouping, SidebarItemEntry, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarSpace, claimChildSessions, clearedViewFilters, createDecorator, extensionSpaceOf, filterQueryOf, filtersForSpace, itemsForSpace, mergeSidebarSpaces, nextSavedViewName, resolveGrouping, resolveSort, sidebarContributionsOf, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn } from "./sidebar/query.js";
8
9
  import { DirectoryServer, DirectorySettings, ProjectInSpace, RuntimeNow, RuntimeOrigin, SessionDirectory, SessionDirectoryOptions, SessionDirectorySource, SessionDirectoryState, SessionDirectoryStreams, SessionRef, SessionRemoval, SessionRowChange, availableProjectsOf, createSessionDirectory, filterDirectorySessions, projectKeyOf, sessionRefsOf } from "./sidebar/directory.js";
9
- import { ChipViewLabels, commandName, commandView, commitView, sessionForToken, sessionView, skillGroupView, skillName, skillView } from "./chip-views.js";
10
10
  import "./composer/index.js";
11
11
  import { ComposerMode, caretEffectivelyAtStart, composeSubmitText, decodeHistoryEntry, encodeHistoryDraft, exitsModeOnKey, modeForTypedChar, unsentDraft } from "./composer-modes.js";
12
+ import { DraftScope, DraftScopeState, DraftScopeStore, DraftScopeStoreOptions, createDraftScopeStore, draftScopeOf } from "./draft-scope.js";
12
13
  import { OtherStreamSignal, SessionFallbackModel, SessionPageState, SessionRetryState, SessionStreamPage, SessionStreamSignal } from "./streams/types.js";
13
14
  import { DrainPlan } from "./streams/pacer.js";
14
15
  import { FrameScheduler, defaultFrameScheduler } from "./streams/scheduler.js";
@@ -21,15 +22,15 @@ import { EMPTY_RUN_METER, RunMeter, RunMeterRow, RunMeterSignal, RunMeterState,
21
22
  import { ComposerAgentProfile, ComposerAgents, ComposerCacheImpact, ComposerCacheImpactChange, ComposerContext, ComposerContextBreakdown, ComposerContextStatus, ComposerControls, ComposerCostStatus, ComposerEffort, ComposerModels, ComposerPrefs, ComposerPrefsState, ComposerRememberedModel, ComposerRunProgress, ComposerRuns, ComposerSessionView } from "./composer/host-chrome.js";
22
23
  import { DEFAULT_MODEL_PICKER_PREFS, MODEL_PICKER_STORAGE_KEY, ModelPickerPrefs, ModelPickerPrefsStorage, ModelPickerPrefsStore, createModelPickerPrefs, parseModelPickerPrefs } from "./composer/model-picker-prefs.js";
23
24
  import { CommandArgSuggestionSummary, CommandSummary, ComposerAttachment, ComposerAutocomplete, ComposerCommandArgs, ComposerCompletions, ComposerDraftAttachmentsListener, ComposerDrafts, ComposerExtensionItem, ComposerExtensionProvider, ComposerFolderLocation, ComposerFolders, ComposerHost, ComposerPromptSuggestion, ComposerScope, ComposerSharedGhost, ComposerSkillGroup, ComposerSuggestions, FileEntry, PromptAttachment, SharedDraft, SharedDraftAttachmentsChange, SharedDraftChange, SkillConfig } from "./composer/host.js";
24
- import { DraftScope, DraftScopeState, DraftScopeStore, DraftScopeStoreOptions, createDraftScopeStore, draftScopeOf } from "./draft-scope.js";
25
25
  import { DraftFolderSource, DraftFolderState, DraftPlaceIssue, draftFolderPath, draftLocalFolder, recentHostFolders, recentLocalFolders } from "./draft-target.js";
26
26
  import { FileChip, FileChipKind, chipForPath, classifyInlineCode, positionSuffix, resolveChipPath } from "./file-chip.js";
27
+ import { ChatAttachment, ChatAttachmentOriginal, ChatEvent, ChatHost, ChatInteraction, ChatModel, ChatModelProvider, ChatSession, ChatSessionStatus, SendInput, SessionSearchHit, Transcript, TranscriptState } from "./host.js";
27
28
  import { SessionBadgesEntry, SessionBadgesSource, SessionBadgesStore, createSessionBadges } from "./sidebar/badges.js";
28
29
  import { SessionWindowMode, SidebarEnvironmentHost, SidebarHost } from "./sidebar/host.js";
29
30
  import { COMMON_EMOJI, MAIN_SESSION_ICON_KEY, PROJECT_ICONS_KEY, ProjectIcon, ProjectIconMap, firstGrapheme, isProjectIcon, parseProjectIcons } from "./sidebar/project-icons.js";
30
- import { ChatAttachment, ChatAttachmentOriginal, ChatEvent, ChatHost, ChatInteraction, ChatModel, ChatModelProvider, ChatSession, ChatSessionStatus, SendInput, SessionSearchHit, Transcript, TranscriptState } from "./host.js";
31
31
  import { HostStatus, HostView, hostReachable, hostStatusLabel } from "./hosts.js";
32
32
  import { ChatLabels, DEFAULT_CHAT_LABELS, secretExpiryWords } from "./labels.js";
33
+ import { CHUNK_THRESHOLD, OpenFence, openFenceOf, splitMarkdown, withoutPartialEmphasis, withoutPartialFence } from "./markdown-chunks.js";
33
34
  import { findCommand } from "./composer/commands.js";
34
35
  import { ComposerListScope, ComposerLists, LazyList, createComposerLists } from "./composer/composer-sources.js";
35
36
  import { ComposerChromeLabels, DEFAULT_COMPOSER_CHROME_LABELS } from "./composer/labels-chrome.js";
@@ -40,8 +41,8 @@ import { ModelKnobs, ModelKnobsMemory, ModelKnobsStore, createModelKnobs, modelK
40
41
  import { ModelNames, ModelNamesProvider, ModelNamesStore, createModelNames, modelNamesOf, namerFor } from "./composer/model-names.js";
41
42
  import { EffortPickerTarget, defaultModelPatch, effortPickerTarget, rememberedDefaultModel } from "./composer/new-session-defaults.js";
42
43
  import { SetDefaultModel, commitModelPick, lastModelChainOf, rememberableChain, rememberedPick, settledResource } from "./composer/remember-model-pick.js";
43
- import { CHUNK_THRESHOLD, OpenFence, openFenceOf, splitMarkdown, withoutPartialEmphasis, withoutPartialFence } from "./markdown-chunks.js";
44
44
  import { NotificationSettings, NotifyEvent, approvalNotificationDetail, notificationContent, questionNotificationDetail, shouldNotify } from "./notifications.js";
45
+ import { TOOL_OUTPUT_PAGE_SIZE, ToolOutputPager, ToolOutputPagerOptions, ToolOutputPagerState, ToolOutputRange, ToolOutputRangeReader, createToolOutputPager, sliceToolOutput, toolOutputPagerDone } from "./output-pager.js";
45
46
  import { ChipResolution, PathResolver, PathResolverOptions, createPathResolver } from "./path-resolver.js";
46
47
  import { PromptOrigin, PromptOriginWire, PromptViewOrigin, promptOriginWire } from "./prompt-origin.js";
47
48
  import { REFERENCES_STORAGE_KEY, ReferenceStore, ReferenceStoreOptions, ReferenceViewEntry, createReferenceStore } from "./reference-store.js";
@@ -80,9 +81,9 @@ import { dockRunReceipts, dotVariantFor, findLastStreamingRow, foldExchanges, fo
80
81
  import { FoldActionItem, FoldActionState, foldActionItems, toolAction } from "./transcript/fold-actions.js";
81
82
  import { nestToolCalls, nestedCallVisible } from "./transcript/nesting.js";
82
83
  import { PairingResult, ToolPairing, pairToolEvents } from "./transcript/pairing.js";
83
- import { EMPTY_RAIL, RailExchange, RailModel, TranscriptRailState, TranscriptRailStore, computeRailModel, createTranscriptRailStore, dataRowSelector, plainPreview, sameRail } from "./transcript/rail.js";
84
+ import { EMPTY_RAIL, RailExchange, RailModel, TranscriptRailState, TranscriptRailStore, computeRailModel, computeRailModelParts, createTranscriptRailStore, dataRowSelector, plainPreview, railWithOutline, sameRail } from "./transcript/rail.js";
84
85
  import { RunFailure, failureTooltip, markRunFailures } from "./transcript/run-failures.js";
85
86
  import { SelectStops, computeSelectStops, rowTurnIds, stopForRow } from "./transcript/select-stops.js";
86
87
  import { ChatBadgeActions, ChatChipDetails, ChatCommandFacts, ChatCommit, ChatContextFacts, ChatPaths, ChatReferences, ChatReferencesChange, ChatResolvedPath, ChatSearchState, ChatSearchSync, ChatSessionFacts, ChatSiteIcons, ChatSkillFacts } from "./transcript-host.js";
87
88
  import { TurnPromptDraft, promptDraftOf } from "./turn-prompt.js";
88
- export { AGENT_GROUPING, type AuthCardPlan, type AuthFixes, type AuthSettingsTarget, type BashExitMeta, BookDraft, BuildQuerySidebarRowsOptions, BuildSidebarRowsOptions, CHATS_BUCKET, CHUNK_THRESHOLD, COMMON_EMOJI, CalendarOptions, ChatAttachment, ChatAttachmentOriginal, ChatBadgeActions, ChatBlockRunOptions, ChatBlockRunTransport, ChatBlockRuns, ChatChipDetails, ChatCommandFacts, ChatCommit, ChatContextFacts, ChatEvent, ChatHost, ChatInteraction, ChatLabels, ChatModel, ChatModelProvider, ChatPaths, ChatReferences, ChatReferencesChange, ChatResolvedPath, ChatSearchState, ChatSearchSync, ChatSession, ChatSessionFacts, ChatSessionStatus, ChatSiteIcons, ChatSkillFacts, ChipResolution, ChipViewLabels, type Cluster, type CommandArgSuggestionSummary, type CommandSummary, CompactionProgress, CompactionProgressStore, CompactionSignal, ComposerAgentProfile, ComposerAgents, ComposerAttachment, ComposerAutocomplete, ComposerCacheImpact, ComposerCacheImpactChange, ComposerChromeLabels, ComposerCommandArgs, ComposerCompletions, ComposerContext, ComposerContextBreakdown, ComposerContextStatus, ComposerControls, ComposerCostStatus, ComposerDraftAttachmentsListener, ComposerDraftStorage, ComposerDrafts, ComposerEffort, ComposerExtensionItem, ComposerExtensionProvider, ComposerFolderLocation, ComposerFolders, ComposerHost, ComposerLabels, type ComposerListScope, type ComposerLists, ComposerMode, ComposerModelEntry, ComposerModelOption, ComposerModels, ComposerPrefs, ComposerPrefsState, ComposerPromptSuggestion, ComposerRememberedModel, ComposerRunProgress, ComposerRuns, ComposerScope, ComposerSessionView, ComposerSharedGhost, ComposerSkillGroup, ComposerSuggestions, ConversationBadge, ConversationBadgeData, ConversationBadgeInput, DEFAULT_CHAT_LABELS, DEFAULT_COMPOSER_CHROME_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_MODEL_PICKER_PREFS, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, DeltaBucket, DirectoryServer, DirectorySettings, DotStateInput, type DotVariant, DraftBook, DraftFolderSource, DraftFolderState, DraftPlaceIssue, DraftScope, DraftScopeState, DraftScopeStore, DraftScopeStoreOptions, type DrainPlan, EMPTY_RAIL, EMPTY_RUN_METER, EffortPickerTarget, type ExchangeFoldStats, type ExchangeMedium, FileChip, FileChipKind, type FileEntry, type FoldActionItem, type FoldActionState, type FrameScheduler, type GroupCluster, HostStatus, HostView, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, ImageModelRow, InboxRow, InboxRowsOptions, InboxSection, InboxShelfId, InboxSummary, InboxUrgency, LIVE_BLOCK_RUN_LINES, type LazyList, ListableSession, LiveBlockRun, LiveCostStatus, LiveStreamProgress, type LoadEarlierOptions, MAIN_SESSION_ICON_KEY, MAX_EXTENSION_COMPOSER_BADGES, MAX_ROW_CHIPS, MODEL_PICKER_STORAGE_KEY, type MediaRef, ModelCatalogRow, ModelKnobs, ModelKnobsMemory, ModelKnobsStore, ModelNames, ModelNamesProvider, ModelNamesStore, ModelPickRef, ModelPickerPrefs, ModelPickerPrefsStorage, ModelPickerPrefsStore, NO_PROVIDER_ERROR, NO_SIDEBAR_CONTRIBUTIONS, NewChatPlaceKey, NewSessionDefaults, NewSessionRequest, type NotificationSettings, type NotifyEvent, OpenFence, type OtherStreamSignal, type Owned, PINNED_PROJECTS_KEY, PROJECT_GROUP_CAP, PROJECT_ICONS_KEY, type PairingResult, PathResolver, PathResolverOptions, type PendingEcho, PinsBySpace, ProjectIcon, ProjectIconMap, ProjectInSpace, type PromptAttachment, type PromptOrigin, type PromptOriginWire, type PromptViewOrigin, REFERENCES_STORAGE_KEY, RELATIVE_TIME_DATE_AFTER_DAYS, type RailExchange, type RailModel, Readable, ReferenceStore, ReferenceStoreOptions, ReferenceViewEntry, type ResourceSnapshot, type Row, RunEstimatesRow, RunEstimatesSignal, RunEstimatesStore, type RunFailure, RunMeter, RunMeterRow, RunMeterSignal, RunMeterState, RuntimeNow, RuntimeOrigin, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SMOOTH_TICK_MS, SecretTimeLeft, type SelectStops, SendAttachment, SendDraft, SendFlowDeps, SendInput, SendPromptAttachment, SendRequest, SessionActivity, SessionActivityFilter, SessionActivitySignal, SessionActivityStore, SessionArchiveFilter, SessionBadgesEntry, SessionBadgesSource, SessionBadgesStore, SessionDirectory, SessionDirectoryOptions, SessionDirectorySource, SessionDirectoryState, SessionDirectoryStreams, type SessionFallbackModel, SessionGroupBy, SessionHistory, SessionHistoryDirection, SessionHistoryOptions, SessionHistoryPage, SessionHistoryState, SessionHistoryStore, type SessionInboxFields, type SessionInboxPatch, SessionListOptions, SessionListRow, SessionNotification, SessionNotificationStore, type SessionPageState, SessionRef, SessionRemoval, type SessionRetryState, SessionRowChange, SessionSearchHit, SessionSortBy, type SessionStreamActions, type SessionStreamPage, type SessionStreamSignal, SessionStreamStore, type SessionStreamStoreOptions, type SessionStreamWrite, type SessionStreams, type SessionStreamsOptions, SessionWindowMode, SetDefaultModel, SharedDraft, SharedDraftAttachmentsChange, SharedDraftChange, SidebarContributionStores, SidebarContributions, SidebarDotState, SidebarEnvironmentHost, SidebarExtensionView, SidebarGroupBy, SidebarGrouping, SidebarHost, SidebarInboxGroupBy, SidebarItemEntry, SidebarLabels, SidebarLastSessions, type SidebarLayout, SidebarListRow, SidebarListSession, SidebarNode, SidebarOrigin, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarSortBy, SidebarSpace, SidebarView, SidebarViewDefaults, SidebarViewMap, SidebarViewPicks, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, type SkillConfig, SpaceSwitcherPrefs, type SpawnMeta, StoredComposerDraft, type TaskInfo, type ToolPairing, type ToolRowModel, Transcript, type TranscriptRailState, type TranscriptRailStore, TranscriptState, TurnPromptDraft, UNDECIDED_NEW_CHAT_DRAFT_KEY, VIEW_CHOICE, WebStorageDraftStorageOptions, Writable, activityLabel, applyInboxPatch, approvalNotificationDetail, authFailureDetails, availableProjectsOf, batchTaskRuns, batchThinkingRuns, batchToolRuns, beginChipWork, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSessionRows, buildSidebarRows, caretEffectivelyAtStart, chipForPath, chipWorkBusy, claimChildSessions, classifyInlineCode, clearedViewFilters, clusterByOwner, collapseEvents, commandName, commandRef, commandView, commitModelPick, commitView, compareInboxSection, compareSessions, composeLiveCost, composeSubmitText, computeRailModel, computeSelectStops, constant, conversationBadges, createAuthFixes, createChatBlockRuns, createCompactionProgress, createComposerLists, createDecorator, createDraftBook, createDraftScopeStore, createModelKnobs, createModelNames, createModelPickerPrefs, createNotificationStore, createPathResolver, createReferenceStore, createRunEstimates, createRunMeter, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSessionStreamActions, createSessionStreams, createSidebarViews, createSiteIcons, createTranscriptRailStore, createWebStorageDraftStorage, dataRowSelector, dateBucket, decodeHistoryEntry, defaultFrameScheduler, defaultModelPatch, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, dockRunReceipts, dotVariantFor, draftBookOf, draftFolderPath, draftLocalFolder, draftScopeOf, drainBucket, effortPickerTarget, encodeHistoryDraft, environmentKindLabel, environmentSummaryText, exchangesMedia, exitsModeOnKey, extensionSpaceOf, failureTooltip, filterDirectorySessions, filterQueryOf, filterSessions, filtersForSpace, findCommand, findLastStreamingRow, firstGrapheme, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, formatElapsedShort, formatSessionCostLabel, groupsByFolder, hostReachable, hostStatusLabel, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, inheritRowIdentity, isAuthFixed, isProjectIcon, isProjectMember, isSettled, isSnoozed, itemRows, itemsForSpace, lastModelChainOf, markRunFailures, mediaRefsOf, mediumKey, mergeLiveTail, mergePromptPreviews, mergeSidebarSpaces, missingPreviewData, modeForTypedChar, modelKnobsOf, modelNamesOf, namerFor, nestSidebarRows, nestToolCalls, nestedCallVisible, newChatDraftKey, newSessionRequest, nextInboxChangeAt, nextSavedViewName, nextWakeAt, notificationContent, openFenceOf, pairToolEvents, parseBashExitMeta, parseModelPickerPrefs, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, plainPreview, planAuthCard, positionSuffix, projectKeyOf, projectPathOf, promptAttachments, promptDraftOf, promptOriginWire, promptRefs, questionNotificationDetail, readSidebarViews, recentHostFolders, recentLocalFolders, reduceActivity, reduceCompaction, refusedSpawn, relativeTime, rememberableChain, rememberedDefaultModel, rememberedPick, repoGroups, resetChipWorkForTests, resolveBadgePanel, resolveChipPath, resolveGrouping, resolveSidebarView, resolveSort, rowTurnIds, runsInRemoteSandbox, safeSurrogateSlice, sameRail, secretExpiryWords, secretTimeLeft, secretTimeLeftIso, selectEditEvents, sendPrompt, sessionForToken, sessionRefsOf, sessionView, settledResource, shellCommandOf, shortUrl, shouldNotify, sidebarContributionsOf, sidebarLayoutOf, sidebarViewDefaults, siteOrigin, skillGroupView, skillName, skillView, spaceMembership, splitMarkdown, stableSelection, stopForRow, switcherSpaces, tickBucket, toolAction, toolFailed, unsentDraft, urlRefs, useReadable, viewFilterOf, viewFiltersOn, whenChipsSettle, wireAttachmentsToChat, wireOriginal, withPinnedProject, withoutPartialEmphasis, withoutPartialFence, writable };
89
+ export { AGENT_GROUPING, type AuthCardPlan, type AuthFixes, type AuthSettingsTarget, type BashExitMeta, BookDraft, BuildQuerySidebarRowsOptions, BuildSidebarRowsOptions, CHATS_BUCKET, CHUNK_THRESHOLD, COMMON_EMOJI, CalendarOptions, ChatAttachment, ChatAttachmentOriginal, ChatBadgeActions, ChatBlockRunOptions, ChatBlockRunTransport, ChatBlockRuns, ChatChipDetails, ChatCommandFacts, ChatCommit, ChatContextFacts, ChatEvent, ChatHost, ChatInteraction, ChatLabels, ChatModel, ChatModelProvider, ChatPaths, ChatReferences, ChatReferencesChange, ChatResolvedPath, ChatSearchState, ChatSearchSync, ChatSession, ChatSessionFacts, ChatSessionStatus, ChatSiteIcons, ChatSkillFacts, ChipResolution, ChipViewLabels, type Cluster, type CommandArgSuggestionSummary, type CommandSummary, CompactionProgress, CompactionProgressStore, CompactionSignal, ComposerAgentProfile, ComposerAgents, ComposerAttachment, ComposerAutocomplete, ComposerCacheImpact, ComposerCacheImpactChange, ComposerChromeLabels, ComposerCommandArgs, ComposerCompletions, ComposerContext, ComposerContextBreakdown, ComposerContextStatus, ComposerControls, ComposerCostStatus, ComposerDraftAttachmentsListener, ComposerDraftStorage, ComposerDrafts, ComposerEffort, ComposerExtensionItem, ComposerExtensionProvider, ComposerFolderLocation, ComposerFolders, ComposerHost, ComposerLabels, type ComposerListScope, type ComposerLists, ComposerMode, ComposerModelEntry, ComposerModelOption, ComposerModels, ComposerPrefs, ComposerPrefsState, ComposerPromptSuggestion, ComposerRememberedModel, ComposerRunProgress, ComposerRuns, ComposerScope, ComposerSessionView, ComposerSharedGhost, ComposerSkillGroup, ComposerSuggestions, ConversationBadge, ConversationBadgeData, ConversationBadgeInput, DEFAULT_CHAT_LABELS, DEFAULT_COMPOSER_CHROME_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_MODEL_PICKER_PREFS, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, DeltaBucket, DirectoryServer, DirectorySettings, DotStateInput, type DotVariant, DraftBook, DraftFolderSource, DraftFolderState, DraftPlaceIssue, DraftScope, DraftScopeState, DraftScopeStore, DraftScopeStoreOptions, type DrainPlan, EMPTY_RAIL, EMPTY_RUN_METER, EffortPickerTarget, type ExchangeFoldStats, type ExchangeMedium, FileChip, FileChipKind, type FileEntry, type FoldActionItem, type FoldActionState, type FrameScheduler, type GroupCluster, HostStatus, HostView, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, ImageModelRow, InboxRow, InboxRowsOptions, InboxSection, InboxShelfId, InboxSummary, InboxUrgency, LIVE_BLOCK_RUN_LINES, type LazyList, ListableSession, LiveBlockRun, LiveCostStatus, LiveStreamProgress, type LoadEarlierOptions, MAIN_SESSION_ICON_KEY, MAX_EXTENSION_COMPOSER_BADGES, MAX_ROW_CHIPS, MODEL_PICKER_STORAGE_KEY, type MediaRef, ModelCatalogRow, ModelKnobs, ModelKnobsMemory, ModelKnobsStore, ModelNames, ModelNamesProvider, ModelNamesStore, ModelPickRef, ModelPickerPrefs, ModelPickerPrefsStorage, ModelPickerPrefsStore, NO_PROVIDER_ERROR, NO_SIDEBAR_CONTRIBUTIONS, NewChatPlaceKey, NewSessionDefaults, NewSessionRequest, type NotificationSettings, type NotifyEvent, OpenFence, type OtherStreamSignal, type Owned, PINNED_PROJECTS_KEY, PROJECT_GROUP_CAP, PROJECT_ICONS_KEY, type PairingResult, PathResolver, PathResolverOptions, type PendingEcho, PinsBySpace, ProjectIcon, ProjectIconMap, ProjectInSpace, type PromptAttachment, type PromptOrigin, type PromptOriginWire, type PromptViewOrigin, REFERENCES_STORAGE_KEY, RELATIVE_TIME_DATE_AFTER_DAYS, type RailExchange, type RailModel, Readable, ReferenceStore, ReferenceStoreOptions, ReferenceViewEntry, type ResourceSnapshot, type Row, RunEstimatesRow, RunEstimatesSignal, RunEstimatesStore, type RunFailure, RunMeter, RunMeterRow, RunMeterSignal, RunMeterState, RuntimeNow, RuntimeOrigin, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SMOOTH_TICK_MS, SecretTimeLeft, type SelectStops, SendAttachment, SendDraft, SendFlowDeps, SendInput, SendPromptAttachment, SendRequest, SessionActivity, SessionActivityFilter, SessionActivitySignal, SessionActivityStore, SessionArchiveFilter, SessionBadgesEntry, SessionBadgesSource, SessionBadgesStore, SessionDirectory, SessionDirectoryOptions, SessionDirectorySource, SessionDirectoryState, SessionDirectoryStreams, type SessionFallbackModel, SessionGroupBy, SessionHistory, SessionHistoryDirection, SessionHistoryOptions, SessionHistoryPage, SessionHistoryState, SessionHistoryStore, type SessionInboxFields, type SessionInboxPatch, SessionListOptions, SessionListRow, SessionNotification, SessionNotificationStore, type SessionPageState, SessionRef, SessionRemoval, type SessionRetryState, SessionRowChange, SessionSearchHit, SessionSortBy, type SessionStreamActions, type SessionStreamPage, type SessionStreamSignal, SessionStreamStore, type SessionStreamStoreOptions, type SessionStreamWrite, type SessionStreams, type SessionStreamsOptions, SessionWindowMode, SetDefaultModel, SharedDraft, SharedDraftAttachmentsChange, SharedDraftChange, SidebarContributionStores, SidebarContributions, SidebarDotState, SidebarEnvironmentHost, SidebarExtensionView, SidebarGroupBy, SidebarGrouping, SidebarHost, SidebarInboxGroupBy, SidebarItemEntry, SidebarLabels, SidebarLastSessions, type SidebarLayout, SidebarListRow, SidebarListSession, SidebarNode, SidebarOrigin, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarSortBy, SidebarSpace, SidebarView, SidebarViewDefaults, SidebarViewMap, SidebarViewPicks, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, type SkillConfig, SpaceSwitcherPrefs, type SpawnMeta, StoredComposerDraft, TOOL_OUTPUT_PAGE_SIZE, type TaskInfo, ToolOutputPager, ToolOutputPagerOptions, ToolOutputPagerState, ToolOutputRange, ToolOutputRangeReader, type ToolPairing, type ToolRowModel, Transcript, type TranscriptRailState, type TranscriptRailStore, TranscriptState, TurnPromptDraft, UNDECIDED_NEW_CHAT_DRAFT_KEY, VIEW_CHOICE, WebStorageDraftStorageOptions, Writable, activityLabel, applyInboxPatch, approvalNotificationDetail, authFailureDetails, availableProjectsOf, batchTaskRuns, batchThinkingRuns, batchToolRuns, beginChipWork, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSessionRows, buildSidebarRows, caretEffectivelyAtStart, chipForPath, chipWorkBusy, claimChildSessions, classifyInlineCode, clearedViewFilters, clusterByOwner, collapseEvents, commandName, commandRef, commandView, commitModelPick, commitView, compareInboxSection, compareSessions, composeLiveCost, composeSubmitText, computeRailModel, computeRailModelParts, computeSelectStops, constant, conversationBadges, createAuthFixes, createChatBlockRuns, createCompactionProgress, createComposerLists, createDecorator, createDraftBook, createDraftScopeStore, createModelKnobs, createModelNames, createModelPickerPrefs, createNotificationStore, createPathResolver, createReferenceStore, createRunEstimates, createRunMeter, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSessionStreamActions, createSessionStreams, createSidebarViews, createSiteIcons, createToolOutputPager, createTranscriptRailStore, createWebStorageDraftStorage, dataRowSelector, dateBucket, decodeHistoryEntry, defaultFrameScheduler, defaultModelPatch, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, dockRunReceipts, dotVariantFor, draftBookOf, draftFolderPath, draftLocalFolder, draftScopeOf, drainBucket, effortPickerTarget, encodeHistoryDraft, environmentKindLabel, environmentSummaryText, exchangesMedia, exitsModeOnKey, extensionSpaceOf, failureTooltip, filterDirectorySessions, filterQueryOf, filterSessions, filtersForSpace, findCommand, findLastStreamingRow, firstGrapheme, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, formatElapsedShort, formatSessionCostLabel, groupsByFolder, hostReachable, hostStatusLabel, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, inheritRowIdentity, isAuthFixed, isProjectIcon, isProjectMember, isSettled, isSnoozed, itemRows, itemsForSpace, lastModelChainOf, markRunFailures, mediaRefsOf, mediumKey, mergeLiveTail, mergePromptPreviews, mergeSidebarSpaces, missingPreviewData, modeForTypedChar, modelKnobsOf, modelNamesOf, namerFor, nestSidebarRows, nestToolCalls, nestedCallVisible, newChatDraftKey, newSessionRequest, nextInboxChangeAt, nextSavedViewName, nextWakeAt, notificationContent, openFenceOf, pairToolEvents, parseBashExitMeta, parseModelPickerPrefs, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, plainPreview, planAuthCard, positionSuffix, projectKeyOf, projectPathOf, promptAttachments, promptDraftOf, promptOriginWire, promptRefs, questionNotificationDetail, railWithOutline, readSidebarViews, recentHostFolders, recentLocalFolders, reduceActivity, reduceCompaction, refusedSpawn, relativeTime, rememberableChain, rememberedDefaultModel, rememberedPick, repoGroups, resetChipWorkForTests, resolveBadgePanel, resolveChipPath, resolveGrouping, resolveSidebarView, resolveSort, rowTurnIds, runsInRemoteSandbox, safeSurrogateSlice, sameRail, secretExpiryWords, secretTimeLeft, secretTimeLeftIso, selectEditEvents, sendPrompt, sessionForToken, sessionRefsOf, sessionView, settledResource, shellCommandOf, shortUrl, shouldNotify, sidebarContributionsOf, sidebarLayoutOf, sidebarViewDefaults, siteOrigin, skillGroupView, skillName, skillView, sliceToolOutput, spaceMembership, splitMarkdown, stableSelection, stopForRow, switcherSpaces, tickBucket, toolAction, toolFailed, toolOutputPagerDone, unsentDraft, urlRefs, useReadable, viewFilterOf, viewFiltersOn, whenChipsSettle, wireAttachmentsToChat, wireOriginal, withPinnedProject, withoutPartialEmphasis, withoutPartialFence, writable };
@@ -10,18 +10,20 @@ import { SessionStreamStore } from "./streams/store.js";
10
10
  import { DEFAULT_MODEL_PICKER_PREFS, MODEL_PICKER_STORAGE_KEY, createModelPickerPrefs, parseModelPickerPrefs } from "./composer/model-picker-prefs.js";
11
11
  import { EMPTY_RUN_METER, createRunMeter } from "./composer/run-meter.js";
12
12
  import { beginChipWork, chipWorkBusy, resetChipWorkForTests, whenChipsSettle } from "./chip-settle.js";
13
- import { applyInboxPatch, isSettled, isSnoozed, nextWakeAt } from "./sidebar/inbox-state.js";
14
13
  import { commandName, commandView, commitView, sessionForToken, sessionView, skillGroupView, skillName, skillView } from "./chip-views.js";
14
+ import { applyInboxPatch, isSettled, isSnoozed, nextWakeAt } from "./sidebar/inbox-state.js";
15
15
  import { caretEffectivelyAtStart, composeSubmitText, decodeHistoryEntry, encodeHistoryDraft, exitsModeOnKey, modeForTypedChar, unsentDraft } from "./composer-modes.js";
16
+ import { createSessionStreams } from "./streams/session-streams.js";
17
+ import { createDraftScopeStore, draftScopeOf } from "./draft-scope.js";
16
18
  import { DEFAULT_COMPOSER_CHROME_LABELS } from "./composer/labels-chrome.js";
17
19
  import { DEFAULT_COMPOSER_LABELS } from "./composer/labels.js";
18
- import { createDraftScopeStore, draftScopeOf } from "./draft-scope.js";
19
20
  import { draftFolderPath, draftLocalFolder, recentHostFolders, recentLocalFolders } from "./draft-target.js";
20
21
  import { chipForPath, classifyInlineCode, positionSuffix, resolveChipPath } from "./file-chip.js";
21
22
  import { hostReachable, hostStatusLabel } from "./hosts.js";
22
23
  import { DEFAULT_CHAT_LABELS, secretExpiryWords } from "./labels.js";
23
24
  import { CHUNK_THRESHOLD, openFenceOf, splitMarkdown, withoutPartialEmphasis, withoutPartialFence } from "./markdown-chunks.js";
24
25
  import { approvalNotificationDetail, notificationContent, questionNotificationDetail, shouldNotify } from "./notifications.js";
26
+ import { TOOL_OUTPUT_PAGE_SIZE, createToolOutputPager, sliceToolOutput, toolOutputPagerDone } from "./output-pager.js";
25
27
  import { createPathResolver } from "./path-resolver.js";
26
28
  import { findCommand } from "./composer/commands.js";
27
29
  import { promptOriginWire } from "./prompt-origin.js";
@@ -33,21 +35,20 @@ import { foldActionItems, toolAction } from "./transcript/fold-actions.js";
33
35
  import { dockRunReceipts, dotVariantFor, findLastStreamingRow, foldExchanges, foldWorkerRows } from "./transcript/fold.js";
34
36
  import { nestToolCalls, nestedCallVisible } from "./transcript/nesting.js";
35
37
  import { computeSelectStops, rowTurnIds, stopForRow } from "./transcript/select-stops.js";
36
- import { EMPTY_RAIL, computeRailModel, createTranscriptRailStore, dataRowSelector, plainPreview, sameRail } from "./transcript/rail.js";
38
+ import { EMPTY_RAIL, computeRailModel, computeRailModelParts, createTranscriptRailStore, dataRowSelector, plainPreview, railWithOutline, sameRail } from "./transcript/rail.js";
37
39
  import { failureTooltip, markRunFailures } from "./transcript/run-failures.js";
38
40
  import { secretTimeLeft, secretTimeLeftIso } from "./secrets.js";
39
- import { createModelKnobs, modelKnobsOf } from "./composer/model-knobs.js";
40
- import { createModelNames, modelNamesOf, namerFor } from "./composer/model-names.js";
41
- import { NO_PROVIDER_ERROR, newSessionRequest, promptAttachments, promptRefs, sendPrompt, shellCommandOf, wireOriginal } from "./send-flow.js";
42
41
  import { createRunEstimates, pickRunEstimate } from "./sidebar/estimates.js";
43
42
  import { createSessionStreamActions } from "./streams/actions.js";
44
43
  import { selectEditEvents, stableSelection } from "./streams/selectors.js";
45
- import { createSessionStreams } from "./streams/session-streams.js";
46
44
  import { composeLiveCost, formatSessionCostLabel } from "./composer/live-cost.js";
45
+ import { createModelKnobs, modelKnobsOf } from "./composer/model-knobs.js";
46
+ import { createModelNames, modelNamesOf, namerFor } from "./composer/model-names.js";
47
47
  import { commitModelPick, lastModelChainOf, rememberableChain, rememberedPick, settledResource } from "./composer/remember-model-pick.js";
48
48
  import { MAX_EXTENSION_COMPOSER_BADGES, conversationBadges, resolveBadgePanel } from "./composer/conversation-badges.js";
49
- import { PROJECT_GROUP_CAP, RELATIVE_TIME_DATE_AFTER_DAYS, buildSessionRows, compareSessions, dateBucket, filterSessions, formatElapsedShort, relativeTime } from "./session-list.js";
49
+ import { NO_PROVIDER_ERROR, newSessionRequest, promptAttachments, promptRefs, sendPrompt, shellCommandOf, wireOriginal } from "./send-flow.js";
50
50
  import { defaultModelPatch, effortPickerTarget, rememberedDefaultModel } from "./composer/new-session-defaults.js";
51
+ import { PROJECT_GROUP_CAP, RELATIVE_TIME_DATE_AFTER_DAYS, buildSessionRows, compareSessions, dateBucket, filterSessions, formatElapsedShort, relativeTime } from "./session-list.js";
51
52
  import { wireAttachmentsToChat } from "./composer/draft-sync.js";
52
53
  import { createSiteIcons, siteOrigin } from "./site-icons.js";
53
54
  import { COMMON_EMOJI, MAIN_SESSION_ICON_KEY, PROJECT_ICONS_KEY, firstGrapheme, isProjectIcon, parseProjectIcons } from "./sidebar/project-icons.js";
@@ -72,4 +73,4 @@ import { constant, useReadable, writable } from "./store.js";
72
73
  import { createComposerLists } from "./composer/composer-sources.js";
73
74
  import { UNDECIDED_NEW_CHAT_DRAFT_KEY, createDraftBook, createWebStorageDraftStorage, draftBookOf, newChatDraftKey } from "./composer/draft-book.js";
74
75
  import { promptDraftOf } from "./turn-prompt.js";
75
- export { AGENT_GROUPING, CHATS_BUCKET, CHUNK_THRESHOLD, COMMON_EMOJI, DEFAULT_CHAT_LABELS, DEFAULT_COMPOSER_CHROME_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_MODEL_PICKER_PREFS, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, EMPTY_RAIL, EMPTY_RUN_METER, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, LIVE_BLOCK_RUN_LINES, MAIN_SESSION_ICON_KEY, MAX_EXTENSION_COMPOSER_BADGES, MAX_ROW_CHIPS, MODEL_PICKER_STORAGE_KEY, NO_PROVIDER_ERROR, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_GROUP_CAP, PROJECT_ICONS_KEY, REFERENCES_STORAGE_KEY, RELATIVE_TIME_DATE_AFTER_DAYS, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SMOOTH_TICK_MS, SessionStreamStore, UNDECIDED_NEW_CHAT_DRAFT_KEY, VIEW_CHOICE, activityLabel, applyInboxPatch, approvalNotificationDetail, authFailureDetails, availableProjectsOf, batchTaskRuns, batchThinkingRuns, batchToolRuns, beginChipWork, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSessionRows, buildSidebarRows, caretEffectivelyAtStart, chipForPath, chipWorkBusy, claimChildSessions, classifyInlineCode, clearedViewFilters, clusterByOwner, collapseEvents, commandName, commandRef, commandView, commitModelPick, commitView, compareInboxSection, compareSessions, composeLiveCost, composeSubmitText, computeRailModel, computeSelectStops, constant, conversationBadges, createAuthFixes, createChatBlockRuns, createCompactionProgress, createComposerLists, createDecorator, createDraftBook, createDraftScopeStore, createModelKnobs, createModelNames, createModelPickerPrefs, createNotificationStore, createPathResolver, createReferenceStore, createRunEstimates, createRunMeter, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSessionStreamActions, createSessionStreams, createSidebarViews, createSiteIcons, createTranscriptRailStore, createWebStorageDraftStorage, dataRowSelector, dateBucket, decodeHistoryEntry, defaultFrameScheduler, defaultModelPatch, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, dockRunReceipts, dotVariantFor, draftBookOf, draftFolderPath, draftLocalFolder, draftScopeOf, drainBucket, effortPickerTarget, encodeHistoryDraft, environmentKindLabel, environmentSummaryText, exchangesMedia, exitsModeOnKey, extensionSpaceOf, failureTooltip, filterDirectorySessions, filterQueryOf, filterSessions, filtersForSpace, findCommand, findLastStreamingRow, firstGrapheme, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, formatElapsedShort, formatSessionCostLabel, groupsByFolder, hostReachable, hostStatusLabel, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, inheritRowIdentity, isAuthFixed, isProjectIcon, isProjectMember, isSettled, isSnoozed, itemRows, itemsForSpace, lastModelChainOf, markRunFailures, mediaRefsOf, mediumKey, mergeLiveTail, mergePromptPreviews, mergeSidebarSpaces, missingPreviewData, modeForTypedChar, modelKnobsOf, modelNamesOf, namerFor, nestSidebarRows, nestToolCalls, nestedCallVisible, newChatDraftKey, newSessionRequest, nextInboxChangeAt, nextSavedViewName, nextWakeAt, notificationContent, openFenceOf, pairToolEvents, parseBashExitMeta, parseModelPickerPrefs, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, plainPreview, planAuthCard, positionSuffix, projectKeyOf, projectPathOf, promptAttachments, promptDraftOf, promptOriginWire, promptRefs, questionNotificationDetail, readSidebarViews, recentHostFolders, recentLocalFolders, reduceActivity, reduceCompaction, refusedSpawn, relativeTime, rememberableChain, rememberedDefaultModel, rememberedPick, repoGroups, resetChipWorkForTests, resolveBadgePanel, resolveChipPath, resolveGrouping, resolveSidebarView, resolveSort, rowTurnIds, runsInRemoteSandbox, safeSurrogateSlice, sameRail, secretExpiryWords, secretTimeLeft, secretTimeLeftIso, selectEditEvents, sendPrompt, sessionForToken, sessionRefsOf, sessionView, settledResource, shellCommandOf, shortUrl, shouldNotify, sidebarContributionsOf, sidebarLayoutOf, sidebarViewDefaults, siteOrigin, skillGroupView, skillName, skillView, spaceMembership, splitMarkdown, stableSelection, stopForRow, switcherSpaces, tickBucket, toolAction, toolFailed, unsentDraft, urlRefs, useReadable, viewFilterOf, viewFiltersOn, whenChipsSettle, wireAttachmentsToChat, wireOriginal, withPinnedProject, withoutPartialEmphasis, withoutPartialFence, writable };
76
+ export { AGENT_GROUPING, CHATS_BUCKET, CHUNK_THRESHOLD, COMMON_EMOJI, DEFAULT_CHAT_LABELS, DEFAULT_COMPOSER_CHROME_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_MODEL_PICKER_PREFS, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, EMPTY_RAIL, EMPTY_RUN_METER, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, LIVE_BLOCK_RUN_LINES, MAIN_SESSION_ICON_KEY, MAX_EXTENSION_COMPOSER_BADGES, MAX_ROW_CHIPS, MODEL_PICKER_STORAGE_KEY, NO_PROVIDER_ERROR, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_GROUP_CAP, PROJECT_ICONS_KEY, REFERENCES_STORAGE_KEY, RELATIVE_TIME_DATE_AFTER_DAYS, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SMOOTH_TICK_MS, SessionStreamStore, TOOL_OUTPUT_PAGE_SIZE, UNDECIDED_NEW_CHAT_DRAFT_KEY, VIEW_CHOICE, activityLabel, applyInboxPatch, approvalNotificationDetail, authFailureDetails, availableProjectsOf, batchTaskRuns, batchThinkingRuns, batchToolRuns, beginChipWork, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSessionRows, buildSidebarRows, caretEffectivelyAtStart, chipForPath, chipWorkBusy, claimChildSessions, classifyInlineCode, clearedViewFilters, clusterByOwner, collapseEvents, commandName, commandRef, commandView, commitModelPick, commitView, compareInboxSection, compareSessions, composeLiveCost, composeSubmitText, computeRailModel, computeRailModelParts, computeSelectStops, constant, conversationBadges, createAuthFixes, createChatBlockRuns, createCompactionProgress, createComposerLists, createDecorator, createDraftBook, createDraftScopeStore, createModelKnobs, createModelNames, createModelPickerPrefs, createNotificationStore, createPathResolver, createReferenceStore, createRunEstimates, createRunMeter, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSessionStreamActions, createSessionStreams, createSidebarViews, createSiteIcons, createToolOutputPager, createTranscriptRailStore, createWebStorageDraftStorage, dataRowSelector, dateBucket, decodeHistoryEntry, defaultFrameScheduler, defaultModelPatch, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, dockRunReceipts, dotVariantFor, draftBookOf, draftFolderPath, draftLocalFolder, draftScopeOf, drainBucket, effortPickerTarget, encodeHistoryDraft, environmentKindLabel, environmentSummaryText, exchangesMedia, exitsModeOnKey, extensionSpaceOf, failureTooltip, filterDirectorySessions, filterQueryOf, filterSessions, filtersForSpace, findCommand, findLastStreamingRow, firstGrapheme, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, formatElapsedShort, formatSessionCostLabel, groupsByFolder, hostReachable, hostStatusLabel, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, inheritRowIdentity, isAuthFixed, isProjectIcon, isProjectMember, isSettled, isSnoozed, itemRows, itemsForSpace, lastModelChainOf, markRunFailures, mediaRefsOf, mediumKey, mergeLiveTail, mergePromptPreviews, mergeSidebarSpaces, missingPreviewData, modeForTypedChar, modelKnobsOf, modelNamesOf, namerFor, nestSidebarRows, nestToolCalls, nestedCallVisible, newChatDraftKey, newSessionRequest, nextInboxChangeAt, nextSavedViewName, nextWakeAt, notificationContent, openFenceOf, pairToolEvents, parseBashExitMeta, parseModelPickerPrefs, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, plainPreview, planAuthCard, positionSuffix, projectKeyOf, projectPathOf, promptAttachments, promptDraftOf, promptOriginWire, promptRefs, questionNotificationDetail, railWithOutline, readSidebarViews, recentHostFolders, recentLocalFolders, reduceActivity, reduceCompaction, refusedSpawn, relativeTime, rememberableChain, rememberedDefaultModel, rememberedPick, repoGroups, resetChipWorkForTests, resolveBadgePanel, resolveChipPath, resolveGrouping, resolveSidebarView, resolveSort, rowTurnIds, runsInRemoteSandbox, safeSurrogateSlice, sameRail, secretExpiryWords, secretTimeLeft, secretTimeLeftIso, selectEditEvents, sendPrompt, sessionForToken, sessionRefsOf, sessionView, settledResource, shellCommandOf, shortUrl, shouldNotify, sidebarContributionsOf, sidebarLayoutOf, sidebarViewDefaults, siteOrigin, skillGroupView, skillName, skillView, sliceToolOutput, spaceMembership, splitMarkdown, stableSelection, stopForRow, switcherSpaces, tickBucket, toolAction, toolFailed, toolOutputPagerDone, unsentDraft, urlRefs, useReadable, viewFilterOf, viewFiltersOn, whenChipsSettle, wireAttachmentsToChat, wireOriginal, withPinnedProject, withoutPartialEmphasis, withoutPartialFence, writable };
@@ -135,6 +135,23 @@ export declare const DEFAULT_CHAT_LABELS: {
135
135
  modelVerdictTitle: (approved: boolean, model: string, confidence: string | null) => string;
136
136
  loadFullOutput: string;
137
137
  loadingFullOutput: string;
138
+ /** A paged result (`ChatHost.toolOutputRange`): read its next page. */
139
+ loadMoreOutput: string;
140
+ /** A paged result: read every page still missing. */
141
+ loadAllOutput: string;
142
+ loadingOutput: string;
143
+ /** How much of a paged result shows: the sizes loaded and in all. */
144
+ outputLoaded: (loaded: string, total: string) => string;
145
+ /** A page of a result failed to load (the raw error as the detail). */
146
+ outputLoadFailed: string;
147
+ /** Under an input the host clipped for the wire (`clipped.input`). */
148
+ loadFullInput: string;
149
+ loadingFullInput: string;
150
+ /** Under a diff the host cut to its first hunks (`EditPayload.clipped`). */
151
+ loadFullDiff: string;
152
+ loadingFullDiff: string;
153
+ /** What a diff the host cut leaves out: the hunks it dropped (0: one hunk cut short) and the size of the whole diff's text. */
154
+ diffNotShown: (hunks: number, size: string) => string;
138
155
  showOutput: string;
139
156
  inputCaption: string;
140
157
  outputCaption: string;
@@ -173,6 +173,23 @@ const DEFAULT_CHAT_LABELS = {
173
173
  modelVerdictTitle: (approved, model, confidence) => `${approved ? "Approved" : "Blocked"} by the decision model ${model}${confidence ? ` (confidence ${confidence})` : ""}`,
174
174
  loadFullOutput: "Load full output",
175
175
  loadingFullOutput: "Loading full output…",
176
+ /** A paged result (`ChatHost.toolOutputRange`): read its next page. */
177
+ loadMoreOutput: "Load more",
178
+ /** A paged result: read every page still missing. */
179
+ loadAllOutput: "Load all",
180
+ loadingOutput: "Loading…",
181
+ /** How much of a paged result shows: the sizes loaded and in all. */
182
+ outputLoaded: (loaded, total) => `${loaded} of ${total} loaded`,
183
+ /** A page of a result failed to load (the raw error as the detail). */
184
+ outputLoadFailed: "Couldn't load the output",
185
+ /** Under an input the host clipped for the wire (`clipped.input`). */
186
+ loadFullInput: "Load full input",
187
+ loadingFullInput: "Loading full input…",
188
+ /** Under a diff the host cut to its first hunks (`EditPayload.clipped`). */
189
+ loadFullDiff: "Load full diff",
190
+ loadingFullDiff: "Loading full diff…",
191
+ /** What a diff the host cut leaves out: the hunks it dropped (0: one hunk cut short) and the size of the whole diff's text. */
192
+ diffNotShown: (hunks, size) => hunks > 0 ? `${hunks} more ${hunks === 1 ? "hunk" : "hunks"} not shown, ${size} in all` : `Part of the diff not shown, ${size} in all`,
176
193
  showOutput: "Show output",
177
194
  inputCaption: "Input",
178
195
  outputCaption: "Output",
@@ -43,7 +43,8 @@ export interface OpenFence {
43
43
  */
44
44
  export declare function openFenceOf(chunk: string): OpenFence | null;
45
45
  /**
46
- * Splits markdown into chunks that parse on their own, so a long or streaming reply can re-render only its last chunk. Text shorter than the threshold comes back as one chunk.
46
+ * Splits markdown into chunks that parse on their own, so a long or streaming reply can re-render only its last chunk. Text shorter than the threshold, or holding a definition, comes back as one chunk.
47
+ * While a reply streams it re-renders on every delta, so it splits at every block boundary: everything above the open block stays a memoised chunk (`MarkdownStream` keeps that split as the text grows).
47
48
  *
48
49
  * @param text - The markdown to split.
49
50
  * @param opts - Split options. `streaming: true` uses finer chunks for a reply that is still growing.
@@ -1,3 +1,4 @@
1
+ import { BlockScanner, STREAMING_THRESHOLD, fenceLanguage, opensChunk } from "./markdown-scan.js";
1
2
  import { isFenceClose, parseFenceOpen } from "zidane/chat/pure";
2
3
  // src/chat/headless/markdown-chunks.ts
3
4
  /** Below this, one parse is cheap enough: no chunking at all. */
@@ -9,13 +10,6 @@ function stepFence(fence, line) {
9
10
  if (fence) return isFenceClose(line, fence.char, fence.length) ? null : fence;
10
11
  return parseFenceOpen(line);
11
12
  }
12
- /**
13
- * While a reply streams it is re-rendered on every delta (many per second),
14
- * so it splits much finer: everything above the growing paragraph stays a
15
- * memoised chunk and only the tail is parsed again.
16
- */
17
- const STREAMING_THRESHOLD = 1200;
18
- const STREAMING_TARGET = 600;
19
13
  /** A last line of one or two backticks or tildes: a fence still arriving. */
20
14
  const PARTIAL_FENCE = /\n {0,3}(?:`{1,2}|~{1,2})$/;
21
15
  /**
@@ -69,8 +63,7 @@ function openFenceOf(chunk) {
69
63
  fence = next;
70
64
  }
71
65
  if (fence === null || fence.indent !== 0) return null;
72
- const info = lines[at].slice(fence.length);
73
- const language = /^(\w+)/.exec(info.trim().split(/\s/)[0] ?? "")?.[1] ?? "plaintext";
66
+ const language = fenceLanguage(lines[at].slice(fence.length));
74
67
  return {
75
68
  before: lines.slice(0, at).join("\n"),
76
69
  language,
@@ -78,31 +71,30 @@ function openFenceOf(chunk) {
78
71
  };
79
72
  }
80
73
  /**
81
- * Splits markdown into chunks that parse on their own, so a long or streaming reply can re-render only its last chunk. Text shorter than the threshold comes back as one chunk.
74
+ * Splits markdown into chunks that parse on their own, so a long or streaming reply can re-render only its last chunk. Text shorter than the threshold, or holding a definition, comes back as one chunk.
75
+ * While a reply streams it re-renders on every delta, so it splits at every block boundary: everything above the open block stays a memoised chunk (`MarkdownStream` keeps that split as the text grows).
82
76
  *
83
77
  * @param text - The markdown to split.
84
78
  * @param opts - Split options. `streaming: true` uses finer chunks for a reply that is still growing.
85
79
  */
86
80
  function splitMarkdown(text, opts = {}) {
87
81
  const threshold = opts.streaming ? STREAMING_THRESHOLD : CHUNK_THRESHOLD;
88
- const target = opts.streaming ? STREAMING_TARGET : CHUNK_TARGET;
82
+ const target = opts.streaming ? 0 : CHUNK_TARGET;
89
83
  if (text.length < threshold) return [text];
90
84
  const lines = text.split("\n");
85
+ const scanner = new BlockScanner(target);
91
86
  const chunks = [];
92
87
  let start = 0;
93
- let size = 0;
94
- let fence = null;
95
88
  for (let i = 0; i < lines.length; i++) {
96
89
  const line = lines[i];
97
- fence = stepFence(fence, line);
98
- size += line.length + 1;
99
- const next = lines[i + 1];
100
- if (fence === null && size >= target && line.trim() === "" && next !== void 0 && next.length > 0 && next[0] !== " " && next[0] !== " ") {
101
- chunks.push(lines.slice(start, i + 1).join("\n"));
102
- start = i + 1;
103
- size = 0;
90
+ if (scanner.pending && opensChunk(line, true)) {
91
+ chunks.push(lines.slice(start, i).join("\n"));
92
+ start = i;
93
+ scanner.startChunk();
104
94
  }
95
+ scanner.feed(line, 0);
105
96
  }
97
+ if (scanner.refs) return [text];
106
98
  chunks.push(lines.slice(start).join("\n"));
107
99
  return chunks;
108
100
  }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * The line scanner both markdown splitters share (`splitMarkdown` and the
3
+ * streaming `MarkdownStream`): where a chunk may start, and the block state a
4
+ * line leaves behind. Internal to the chat area.
5
+ *
6
+ * A chunk starts at a line after a blank line outside every block that spans
7
+ * blanks: a fence (core's `parseFenceOpen` / `isFenceClose`), an HTML block that
8
+ * only ends on its end marker (CommonMark types 1 to 5: `<pre>`, `<!--`, …). The
9
+ * line must start at column 0 and must not be a list item: an indented line
10
+ * may continue a list item, and a list item after a blank may continue a loose
11
+ * list. Everything else a blank line ends, so each chunk parses on its own as
12
+ * it would inside the whole text.
13
+ *
14
+ * Link reference and footnote definitions are the exception: one later in the
15
+ * text changes how earlier blocks parse. A text that holds one (or a line that
16
+ * looks like one) parses whole.
17
+ */
18
+ import { FenceOpen } from "zidane/chat/pure";
19
+ /** `line` without the CR of a CRLF line ending. */
20
+ export declare function withoutCR(line: string): string;
21
+ /**
22
+ * Whether a chunk can start at `line`, the line after a candidate blank line:
23
+ * it starts at column 0 and is not a list item. `undefined` while that depends
24
+ * on characters still to come (`-` may become `- item` or `-1`).
25
+ *
26
+ * @param line - The line, or what has arrived of it.
27
+ * @param complete - The line is whole (its newline arrived, or the text ended).
28
+ */
29
+ export declare function opensChunk(line: string, complete: boolean): boolean | undefined;
30
+ /** Whether `line` may be a definition, read outside every block. */
31
+ export declare function isDefinitionLine(line: string): boolean;
32
+ /** The block state after each line, and whether the next line may start a chunk. */
33
+ export declare class BlockScanner {
34
+ private readonly target;
35
+ /** The fence open after the lines fed. */
36
+ fence: FenceOpen | null;
37
+ /** Where the open fence's line starts. */
38
+ fenceAt: number;
39
+ /** Where the open fence's line ends (its newline). */
40
+ fenceEnd: number;
41
+ /** The end marker of the open HTML block, or `null`. */
42
+ html: RegExp | null;
43
+ /** Characters since the chunk started. */
44
+ size: number;
45
+ /** The last line was blank, outside every block, past the target: the next line may start a chunk. */
46
+ pending: boolean;
47
+ /** A definition was seen. */
48
+ refs: boolean;
49
+ /** @param target - The size a chunk reaches before it may end. */
50
+ constructor(target: number);
51
+ /**
52
+ * Feeds one whole line.
53
+ *
54
+ * @param line - The line, without its newline.
55
+ * @param at - Where it starts in the text.
56
+ */
57
+ feed(line: string, at: number): void;
58
+ /** A chunk starts at the next line. */
59
+ startChunk(): void;
60
+ }
61
+ /** Below this, a streaming reply parses whole. */
62
+ export declare const STREAMING_THRESHOLD = 1200;
63
+ /** While a reply streams, every block boundary is a chunk boundary. */
64
+ export declare const STREAMING_TARGET = 0;
65
+ /** The language a fence's info string names, as the parsed block's class does (`plaintext` for none). */
66
+ export declare function fenceLanguage(info: string): string;
@@ -0,0 +1,124 @@
1
+ import { isFenceClose, parseFenceOpen } from "zidane/chat/pure";
2
+ // src/chat/headless/markdown-scan.ts
3
+ /** A line that may define a link reference or a footnote, after any container markers. */
4
+ const DEFINITION = /^(?:[ \t>]|[*+-][ \t]|\d{1,9}[.)][ \t])*\[(?:[^\]\\\n]|\\.){1,999}\]:/;
5
+ /** The start of an HTML block that runs past blank lines (CommonMark types 1 to 5). */
6
+ const HTML_START = /^ {0,3}(?:<(script|pre|style|textarea)(?=[\s>]|$)|<!--|<\?|<![a-z]|<!\[CDATA\[)/i;
7
+ const HTML_END_RAW = /<\/(?:script|pre|style|textarea)>/i;
8
+ const HTML_END_COMMENT = /-->/;
9
+ const HTML_END_PI = /\?>/;
10
+ const HTML_END_DECL = />/;
11
+ const HTML_END_CDATA = /\]\]>/;
12
+ /** The end marker of the HTML block `line` opens and does not close, or `null`. */
13
+ function htmlBlockOf(line) {
14
+ const start = HTML_START.exec(line);
15
+ if (!start) return null;
16
+ const opener = start[0].trimStart();
17
+ const end = start[1] ? HTML_END_RAW : opener.startsWith("<!--") ? HTML_END_COMMENT : opener.startsWith("<?") ? HTML_END_PI : opener.startsWith("<![") ? HTML_END_CDATA : HTML_END_DECL;
18
+ return end.test(line.slice(start[0].length)) ? null : end;
19
+ }
20
+ /** `line` without the CR of a CRLF line ending. */
21
+ function withoutCR(line) {
22
+ return line.endsWith("\r") ? line.slice(0, -1) : line;
23
+ }
24
+ /** Whether `line` holds only spaces, tabs and a carriage return. */
25
+ function isBlank(line) {
26
+ for (let i = 0; i < line.length; i++) {
27
+ const c = line.charCodeAt(i);
28
+ if (c !== 32 && c !== 9 && c !== 13 && c !== 11 && c !== 12) return false;
29
+ }
30
+ return true;
31
+ }
32
+ const isDigit = (c) => c !== void 0 && c >= "0" && c <= "9";
33
+ const isMarkerGap = (c) => c === " " || c === " " || c === "\r";
34
+ /**
35
+ * Whether a chunk can start at `line`, the line after a candidate blank line:
36
+ * it starts at column 0 and is not a list item. `undefined` while that depends
37
+ * on characters still to come (`-` may become `- item` or `-1`).
38
+ *
39
+ * @param line - The line, or what has arrived of it.
40
+ * @param complete - The line is whole (its newline arrived, or the text ended).
41
+ */
42
+ function opensChunk(line, complete) {
43
+ const c = line[0];
44
+ if (c === void 0) return complete ? false : void 0;
45
+ if (c === " " || c === " " || c === "\r") return false;
46
+ if (c === "*" || c === "+" || c === "-") {
47
+ if (line.length > 1) return !isMarkerGap(line[1]);
48
+ return complete ? false : void 0;
49
+ }
50
+ if (!isDigit(c)) return true;
51
+ let i = 1;
52
+ while (i < line.length && isDigit(line[i])) i++;
53
+ if (i > 9) return true;
54
+ if (i === line.length) return complete ? true : void 0;
55
+ const after = line[i];
56
+ if (after !== "." && after !== ")") return true;
57
+ if (i + 1 < line.length) return !isMarkerGap(line[i + 1]);
58
+ return complete ? false : void 0;
59
+ }
60
+ /** Whether `line` may be a definition, read outside every block. */
61
+ function isDefinitionLine(line) {
62
+ return DEFINITION.test(line);
63
+ }
64
+ /** The block state after each line, and whether the next line may start a chunk. */
65
+ var BlockScanner = class {
66
+ target;
67
+ /** The fence open after the lines fed. */
68
+ fence = null;
69
+ /** Where the open fence's line starts. */
70
+ fenceAt = -1;
71
+ /** Where the open fence's line ends (its newline). */
72
+ fenceEnd = -1;
73
+ /** The end marker of the open HTML block, or `null`. */
74
+ html = null;
75
+ /** Characters since the chunk started. */
76
+ size = 0;
77
+ /** The last line was blank, outside every block, past the target: the next line may start a chunk. */
78
+ pending = false;
79
+ /** A definition was seen. */
80
+ refs = false;
81
+ /** @param target - The size a chunk reaches before it may end. */
82
+ constructor(target) {
83
+ this.target = target;
84
+ }
85
+ /**
86
+ * Feeds one whole line.
87
+ *
88
+ * @param line - The line, without its newline.
89
+ * @param at - Where it starts in the text.
90
+ */
91
+ feed(line, at) {
92
+ this.size += line.length + 1;
93
+ const bare = withoutCR(line);
94
+ if (this.fence) {
95
+ if (isFenceClose(bare, this.fence.char, this.fence.length)) this.fence = null;
96
+ } else if (this.html) {
97
+ if (this.html.test(line)) this.html = null;
98
+ } else {
99
+ const open = parseFenceOpen(bare);
100
+ if (open) {
101
+ this.fence = open;
102
+ this.fenceAt = at;
103
+ this.fenceEnd = at + line.length;
104
+ } else {
105
+ this.html = htmlBlockOf(line);
106
+ if (!this.html && !this.refs && isDefinitionLine(line)) this.refs = true;
107
+ }
108
+ }
109
+ this.pending = !this.fence && !this.html && this.size >= this.target && isBlank(line);
110
+ }
111
+ /** A chunk starts at the next line. */
112
+ startChunk() {
113
+ this.size = 0;
114
+ }
115
+ };
116
+ /** Below this, a streaming reply parses whole. */
117
+ const STREAMING_THRESHOLD = 1200;
118
+ /** While a reply streams, every block boundary is a chunk boundary. */
119
+ const STREAMING_TARGET = 0;
120
+ /** The language a fence's info string names, as the parsed block's class does (`plaintext` for none). */
121
+ function fenceLanguage(info) {
122
+ return /^(\w+)/.exec(info.trim().split(/\s/)[0] ?? "")?.[1] ?? "plaintext";
123
+ }
124
+ export { BlockScanner, STREAMING_TARGET, STREAMING_THRESHOLD, fenceLanguage, isDefinitionLine, opensChunk, withoutCR };