zidane-ui 9.2.3 → 9.4.0

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 (354) hide show
  1. package/dist/adapters/live.d.ts +8 -0
  2. package/dist/adapters/live.js +19 -8
  3. package/dist/adapters/server-composer-host.js +22 -9
  4. package/dist/adapters/server-git-host.js +5 -2
  5. package/dist/adapters/server-host.js +158 -27
  6. package/dist/adapters/server-machines-host.js +7 -0
  7. package/dist/adapters/server-media.d.ts +9 -1
  8. package/dist/adapters/server-media.js +14 -1
  9. package/dist/adapters/server-session-host.js +49 -0
  10. package/dist/adapters/server-settings-sections.js +4 -1
  11. package/dist/adapters/sse-host.js +3 -0
  12. package/dist/adapters/sse-protocol.d.ts +10 -0
  13. package/dist/appearance/ZoomIndicator.js +5 -8
  14. package/dist/chat/HostTranscript.d.ts +0 -12
  15. package/dist/chat/HostTranscript.js +20 -1
  16. package/dist/chat/SessionStreamsProvider.d.ts +9 -1
  17. package/dist/chat/SessionStreamsProvider.js +11 -2
  18. package/dist/chat/Transcript.d.ts +21 -11
  19. package/dist/chat/Transcript.js +346 -161
  20. package/dist/chat/composer/ModelOptionsPicker.js +6 -2
  21. package/dist/chat/composer/ModelPicker.d.ts +1 -1
  22. package/dist/chat/composer/PlacePicker.d.ts +3 -1
  23. package/dist/chat/composer/PlacePicker.js +5 -1
  24. package/dist/chat/composer/use-draft-target.js +15 -3
  25. package/dist/chat/headless/block-runs.js +26 -1
  26. package/dist/chat/headless/chip-views.js +1 -1
  27. package/dist/chat/headless/draft-target.d.ts +28 -1
  28. package/dist/chat/headless/draft-target.js +22 -1
  29. package/dist/chat/headless/host.d.ts +43 -7
  30. package/dist/chat/headless/hosts.d.ts +4 -0
  31. package/dist/chat/headless/index.d.ts +27 -26
  32. package/dist/chat/headless/index.js +15 -14
  33. package/dist/chat/headless/labels.d.ts +17 -0
  34. package/dist/chat/headless/labels.js +17 -0
  35. package/dist/chat/headless/markdown-chunks.d.ts +2 -1
  36. package/dist/chat/headless/markdown-chunks.js +12 -20
  37. package/dist/chat/headless/markdown-scan.d.ts +64 -0
  38. package/dist/chat/headless/markdown-scan.js +119 -0
  39. package/dist/chat/headless/markdown-stream.d.ts +64 -0
  40. package/dist/chat/headless/markdown-stream.js +143 -0
  41. package/dist/chat/headless/output-pager.d.ts +68 -0
  42. package/dist/chat/headless/output-pager.js +113 -0
  43. package/dist/chat/headless/prompt-origin.d.ts +2 -0
  44. package/dist/chat/headless/prompt-origin.js +6 -2
  45. package/dist/chat/headless/session-list.d.ts +10 -0
  46. package/dist/chat/headless/sidebar/activity.d.ts +14 -0
  47. package/dist/chat/headless/sidebar/activity.js +32 -0
  48. package/dist/chat/headless/sidebar/directory.d.ts +19 -2
  49. package/dist/chat/headless/sidebar/directory.js +19 -51
  50. package/dist/chat/headless/sidebar/environment.d.ts +15 -4
  51. package/dist/chat/headless/sidebar/environment.js +27 -9
  52. package/dist/chat/headless/sidebar/index.d.ts +2 -2
  53. package/dist/chat/headless/sidebar/index.js +2 -2
  54. package/dist/chat/headless/sidebar/labels.d.ts +19 -2
  55. package/dist/chat/headless/sidebar/labels.js +8 -1
  56. package/dist/chat/headless/sidebar/prewarm.d.ts +68 -0
  57. package/dist/chat/headless/sidebar/prewarm.js +114 -0
  58. package/dist/chat/headless/streams/actions.d.ts +4 -2
  59. package/dist/chat/headless/streams/actions.js +2 -1
  60. package/dist/chat/headless/streams/event-bytes.d.ts +17 -0
  61. package/dist/chat/headless/streams/event-bytes.js +46 -0
  62. package/dist/chat/headless/streams/live-events.d.ts +25 -1
  63. package/dist/chat/headless/streams/live-events.js +53 -2
  64. package/dist/chat/headless/streams/selectors.d.ts +3 -0
  65. package/dist/chat/headless/streams/selectors.js +8 -1
  66. package/dist/chat/headless/streams/session-streams.d.ts +15 -3
  67. package/dist/chat/headless/streams/session-streams.js +31 -3
  68. package/dist/chat/headless/streams/store.d.ts +45 -6
  69. package/dist/chat/headless/streams/store.js +85 -31
  70. package/dist/chat/headless/streams/transcript-map.d.ts +57 -0
  71. package/dist/chat/headless/streams/transcript-map.js +85 -0
  72. package/dist/chat/headless/streams/transcript.d.ts +4 -2
  73. package/dist/chat/headless/streams/transcript.js +19 -7
  74. package/dist/chat/headless/streams/types.d.ts +2 -1
  75. package/dist/chat/headless/transcript/batch.js +5 -1
  76. package/dist/chat/headless/transcript/blob-media.d.ts +15 -0
  77. package/dist/chat/headless/transcript/blob-media.js +23 -0
  78. package/dist/chat/headless/transcript/collapse.d.ts +10 -0
  79. package/dist/chat/headless/transcript/collapse.js +35 -6
  80. package/dist/chat/headless/transcript/derive.d.ts +98 -0
  81. package/dist/chat/headless/transcript/derive.js +89 -0
  82. package/dist/chat/headless/transcript/exchange-media.d.ts +3 -1
  83. package/dist/chat/headless/transcript/exchange-media.js +8 -5
  84. package/dist/chat/headless/transcript/fold-attachments.d.ts +2 -0
  85. package/dist/chat/headless/transcript/fold-attachments.js +3 -2
  86. package/dist/chat/headless/transcript/fold.d.ts +2 -1
  87. package/dist/chat/headless/transcript/fold.js +16 -6
  88. package/dist/chat/headless/transcript/incremental.d.ts +53 -0
  89. package/dist/chat/headless/transcript/incremental.js +181 -0
  90. package/dist/chat/headless/transcript/index.d.ts +2 -2
  91. package/dist/chat/headless/transcript/index.js +2 -2
  92. package/dist/chat/headless/transcript/nesting.js +2 -1
  93. package/dist/chat/headless/transcript/rail.d.ts +50 -1
  94. package/dist/chat/headless/transcript/rail.js +165 -23
  95. package/dist/chat/headless/transcript/rows.d.ts +5 -1
  96. package/dist/chat/headless/transcript/run-failures.js +2 -1
  97. package/dist/chat/headless/transcript/seams.d.ts +78 -0
  98. package/dist/chat/headless/transcript/seams.js +116 -0
  99. package/dist/chat/headless/transcript/tool-media.d.ts +6 -7
  100. package/dist/chat/headless/transcript/tool-media.js +27 -9
  101. package/dist/chat/index.d.ts +9 -8
  102. package/dist/chat/index.js +18 -17
  103. package/dist/chat/sidebar/ProjectIcon.js +1 -1
  104. package/dist/chat/sidebar/RowChips.js +2 -2
  105. package/dist/chat/sidebar/SessionSidebar.d.ts +6 -0
  106. package/dist/chat/sidebar/SessionSidebar.js +23 -16
  107. package/dist/chat/sidebar/SidebarFilterMenu.js +0 -1
  108. package/dist/chat/sidebar/SidebarFold.js +17 -16
  109. package/dist/chat/sidebar/SidebarFooter.d.ts +8 -5
  110. package/dist/chat/sidebar/SidebarFooter.js +6 -6
  111. package/dist/chat/sidebar/SidebarSessionRow.d.ts +7 -1
  112. package/dist/chat/sidebar/SidebarSessionRow.js +11 -8
  113. package/dist/chat/sidebar/session-menu.d.ts +4 -0
  114. package/dist/chat/sidebar/session-menu.js +14 -2
  115. package/dist/chat/sidebar/sidebar-live.js +28 -4
  116. package/dist/chat/sidebar/useInboxRows.js +6 -6
  117. package/dist/chat/sidebar/useInboxTriage.js +50 -47
  118. package/dist/chat/sidebar/useSessionSearch.js +19 -18
  119. package/dist/chat/testing/contract.d.ts +5 -3
  120. package/dist/chat/testing/contract.js +66 -1
  121. package/dist/chat/transcript/DiffLines.d.ts +6 -1
  122. package/dist/chat/transcript/DiffLines.js +35 -20
  123. package/dist/chat/transcript/EditDiffBlock.d.ts +5 -1
  124. package/dist/chat/transcript/EditDiffBlock.js +89 -30
  125. package/dist/chat/transcript/FileChip.js +28 -0
  126. package/dist/chat/transcript/LazyRow.d.ts +40 -40
  127. package/dist/chat/transcript/LazyRow.js +100 -149
  128. package/dist/chat/transcript/MermaidDiagram.js +2 -1
  129. package/dist/chat/transcript/PromptEcho.js +3 -11
  130. package/dist/chat/transcript/SessionChip.d.ts +11 -0
  131. package/dist/chat/transcript/SessionChip.js +34 -0
  132. package/dist/chat/transcript/SubagentBlock.js +3 -2
  133. package/dist/chat/transcript/TranscriptRail.d.ts +25 -2
  134. package/dist/chat/transcript/TranscriptRail.js +175 -17
  135. package/dist/chat/transcript/TranscriptRow.d.ts +4 -7
  136. package/dist/chat/transcript/TranscriptRow.js +4 -3
  137. package/dist/chat/transcript/actions.d.ts +37 -1
  138. package/dist/chat/transcript/actions.js +27 -1
  139. package/dist/chat/transcript/chip-details.d.ts +11 -0
  140. package/dist/chat/transcript/chip-details.js +17 -1
  141. package/dist/chat/transcript/clipped-output.d.ts +58 -0
  142. package/dist/chat/transcript/clipped-output.js +131 -0
  143. package/dist/chat/transcript/fold-attachments.js +10 -5
  144. package/dist/chat/transcript/fold-worker.js +5 -3
  145. package/dist/chat/transcript/fold.js +13 -4
  146. package/dist/chat/transcript/index.d.ts +11 -10
  147. package/dist/chat/transcript/index.js +10 -9
  148. package/dist/chat/transcript/markdown-cache.d.ts +17 -2
  149. package/dist/chat/transcript/markdown-cache.js +48 -4
  150. package/dist/chat/transcript/markdown.js +110 -55
  151. package/dist/chat/transcript/media-gallery.d.ts +3 -2
  152. package/dist/chat/transcript/media-gallery.js +19 -19
  153. package/dist/chat/transcript/messages.js +5 -4
  154. package/dist/chat/transcript/notices.js +2 -1
  155. package/dist/chat/transcript/prompt.d.ts +1 -1
  156. package/dist/chat/transcript/prompt.js +6 -4
  157. package/dist/chat/transcript/prose.js +2 -1
  158. package/dist/chat/transcript/root-items.d.ts +96 -0
  159. package/dist/chat/transcript/root-items.js +180 -0
  160. package/dist/chat/transcript/row-mount.d.ts +184 -0
  161. package/dist/chat/transcript/row-mount.js +532 -0
  162. package/dist/chat/transcript/row-parking.d.ts +152 -0
  163. package/dist/chat/transcript/row-parking.js +171 -0
  164. package/dist/chat/transcript/row-ui-state.d.ts +37 -0
  165. package/dist/chat/transcript/row-ui-state.js +53 -0
  166. package/dist/chat/transcript/run-rows.js +3 -2
  167. package/dist/chat/transcript/script-input.d.ts +1 -1
  168. package/dist/chat/transcript/tasks.js +3 -2
  169. package/dist/chat/transcript/tool-media.d.ts +4 -2
  170. package/dist/chat/transcript/tool-media.js +15 -7
  171. package/dist/chat/transcript/tool-parts.d.ts +27 -4
  172. package/dist/chat/transcript/tool-parts.js +31 -6
  173. package/dist/chat/transcript/tool-payload.js +26 -11
  174. package/dist/chat/transcript/tool-row.d.ts +2 -1
  175. package/dist/chat/transcript/tool-row.js +38 -19
  176. package/dist/chat/transcript/use-transcript-rows.d.ts +25 -8
  177. package/dist/chat/transcript/use-transcript-rows.js +28 -46
  178. package/dist/chat/transcript/useHistoryBackfill.d.ts +42 -0
  179. package/dist/chat/transcript/useHistoryBackfill.js +170 -0
  180. package/dist/chat/transcript/useStickToBottom.js +2 -3
  181. package/dist/chat/transcript/useTranscriptFind.js +2 -4
  182. package/dist/chat/transcript/useTranscriptScroll.d.ts +7 -4
  183. package/dist/chat/transcript/useTranscriptScroll.js +12 -1
  184. package/dist/chat/transcript/useTranscriptSearch.d.ts +2 -2
  185. package/dist/chat/transcript/useTranscriptSearch.js +35 -19
  186. package/dist/chat/transcript/useTranscriptSelectionCopy.d.ts +5 -5
  187. package/dist/chat/transcript/useTranscriptSelectionCopy.js +28 -7
  188. package/dist/chat/transcript/view-scope.d.ts +26 -6
  189. package/dist/chat/transcript/view-scope.js +106 -20
  190. package/dist/code/editor/FileTree.d.ts +2 -0
  191. package/dist/code/editor/FileTree.js +1 -1
  192. package/dist/code/editor/FileView.js +16 -25
  193. package/dist/code/editor/find/useFind.js +17 -17
  194. package/dist/code/editor/useCodeDocument.js +22 -19
  195. package/dist/code/editor/useDetachCleanup.js +4 -3
  196. package/dist/code/use-highlighted-html.js +12 -13
  197. package/dist/components/IconButton.d.ts +3 -1
  198. package/dist/components/IconButton.js +7 -2
  199. package/dist/components/IconButtonTip.d.ts +3 -1
  200. package/dist/components/IconButtonTip.js +2 -1
  201. package/dist/components/RowActionsMenu.js +7 -14
  202. package/dist/components/Tooltip.d.ts +4 -1
  203. package/dist/components/Tooltip.js +8 -6
  204. package/dist/components/assign-ref.d.ts +8 -0
  205. package/dist/components/assign-ref.js +12 -0
  206. package/dist/components/floating/FloatingSurface.js +2 -2
  207. package/dist/components/floating/HoverCard.js +32 -14
  208. package/dist/components/floating/Popover.js +4 -7
  209. package/dist/components/floating/useAnchoredPosition.d.ts +5 -3
  210. package/dist/components/floating/useAnchoredPosition.js +7 -7
  211. package/dist/components/object-key.d.ts +7 -0
  212. package/dist/components/object-key.js +18 -0
  213. package/dist/components/palette/PaletteList.js +2 -7
  214. package/dist/components/tooltip-arming.d.ts +3 -0
  215. package/dist/components/tooltip-arming.js +8 -1
  216. package/dist/core.css +3 -3
  217. package/dist/dist/{index-E1Z0aPmi.d.ts → index-BheVJOLc.d.ts} +3 -1
  218. package/dist/dist/index.d.ts +2 -2
  219. package/dist/files/FilesTab.js +0 -1
  220. package/dist/files/TreeColumn.d.ts +2 -4
  221. package/dist/files/TreeColumn.js +0 -5
  222. package/dist/files/headless/host.d.ts +3 -7
  223. package/dist/files/headless/labels.d.ts +0 -1
  224. package/dist/files/headless/labels.js +0 -1
  225. package/dist/files/headless/workspace-diff.js +1 -1
  226. package/dist/files/useCodeReview.js +1 -3
  227. package/dist/files/useFilesDiagnostics.d.ts +1 -1
  228. package/dist/files/useFilesDiagnostics.js +4 -11
  229. package/dist/files/useOpenFiles.js +9 -12
  230. package/dist/files/useWorkspace.d.ts +5 -7
  231. package/dist/files/useWorkspace.js +4 -15
  232. package/dist/git/GitBar.js +5 -3
  233. package/dist/git/MoveSessionDialog.d.ts +18 -8
  234. package/dist/git/MoveSessionDialog.js +32 -53
  235. package/dist/git/MoveToDialog.d.ts +61 -0
  236. package/dist/git/MoveToDialog.js +240 -0
  237. package/dist/git/SandboxManager.js +9 -4
  238. package/dist/git/SyncChip.js +11 -4
  239. package/dist/git/TeleportSessionDialog.d.ts +69 -0
  240. package/dist/git/TeleportSessionDialog.js +440 -0
  241. package/dist/git/headless/host.d.ts +14 -0
  242. package/dist/git/headless/index.d.ts +2 -1
  243. package/dist/git/headless/index.js +2 -1
  244. package/dist/git/headless/labels.d.ts +44 -1
  245. package/dist/git/headless/labels.js +50 -0
  246. package/dist/git/headless/sandboxes.d.ts +1 -1
  247. package/dist/git/headless/sandboxes.js +4 -3
  248. package/dist/git/headless/teleport.d.ts +76 -0
  249. package/dist/git/headless/teleport.js +19 -0
  250. package/dist/git/index.d.ts +4 -2
  251. package/dist/git/index.js +4 -2
  252. package/dist/git/useEnvironmentChoices.d.ts +5 -2
  253. package/dist/git/useEnvironmentChoices.js +12 -4
  254. package/dist/hooks/useLatest.d.ts +8 -0
  255. package/dist/hooks/useLatest.js +17 -0
  256. package/dist/hooks/useMinuteTick.d.ts +6 -2
  257. package/dist/hooks/useMinuteTick.js +12 -6
  258. package/dist/hooks/useNearViewport.js +11 -8
  259. package/dist/index.d.ts +3 -2
  260. package/dist/index.js +2 -1
  261. package/dist/keybindings/KeybindingsProvider.js +3 -4
  262. package/dist/keybindings/headless/catalog.d.ts +1 -1
  263. package/dist/keybindings/headless/catalog.js +18 -0
  264. package/dist/machines/AddServerForm.js +55 -3
  265. package/dist/machines/Banners.d.ts +2 -2
  266. package/dist/machines/Banners.js +3 -3
  267. package/dist/machines/DaemonMenu.js +1 -3
  268. package/dist/machines/HostsSection.js +5 -1
  269. package/dist/machines/OrganizationPanel.d.ts +25 -0
  270. package/dist/machines/OrganizationPanel.js +266 -0
  271. package/dist/machines/PersonalLayerPanel.d.ts +32 -0
  272. package/dist/machines/PersonalLayerPanel.js +360 -0
  273. package/dist/machines/headless/fixture-host.d.ts +10 -0
  274. package/dist/machines/headless/fixture-host.js +44 -0
  275. package/dist/machines/headless/host.d.ts +21 -1
  276. package/dist/machines/headless/index.d.ts +3 -1
  277. package/dist/machines/headless/index.js +3 -1
  278. package/dist/machines/headless/labels.d.ts +55 -0
  279. package/dist/machines/headless/labels.js +58 -1
  280. package/dist/machines/headless/layer.d.ts +64 -0
  281. package/dist/machines/headless/layer.js +56 -0
  282. package/dist/machines/headless/organization.d.ts +38 -0
  283. package/dist/machines/headless/organization.js +44 -0
  284. package/dist/machines/index.d.ts +3 -1
  285. package/dist/machines/index.js +3 -1
  286. package/dist/machines/testing/contract.d.ts +25 -1
  287. package/dist/machines/testing/contract.js +97 -1
  288. package/dist/motion/grow.js +12 -13
  289. package/dist/motion/swap.js +2 -5
  290. package/dist/motion/use-flip-list.d.ts +14 -0
  291. package/dist/motion/use-flip-list.js +17 -12
  292. package/dist/palette/headless/app-sources.js +37 -0
  293. package/dist/palette/headless/labels.js +3 -0
  294. package/dist/server/sse-handler.js +25 -2
  295. package/dist/session/DiffFileTree.js +1 -4
  296. package/dist/session/OpenSessionsDialog.d.ts +46 -0
  297. package/dist/session/OpenSessionsDialog.js +170 -0
  298. package/dist/session/PlanTracker.js +1 -2
  299. package/dist/session/ProjectHome.js +10 -9
  300. package/dist/session/RemindersPanel.js +10 -12
  301. package/dist/session/SecretsPanel.js +2 -1
  302. package/dist/session/SessionHeader.js +1 -0
  303. package/dist/session/SessionPeopleStack.d.ts +23 -0
  304. package/dist/session/SessionPeopleStack.js +65 -0
  305. package/dist/session/SessionPlaceMenu.js +5 -4
  306. package/dist/session/ShareSessionDialog.d.ts +32 -0
  307. package/dist/session/ShareSessionDialog.js +342 -0
  308. package/dist/session/TypingLine.d.ts +22 -0
  309. package/dist/session/TypingLine.js +31 -0
  310. package/dist/session/headless/host.d.ts +40 -1
  311. package/dist/session/headless/index.d.ts +4 -2
  312. package/dist/session/headless/index.js +3 -1
  313. package/dist/session/headless/labels.d.ts +49 -0
  314. package/dist/session/headless/labels.js +56 -0
  315. package/dist/session/headless/people.d.ts +29 -0
  316. package/dist/session/headless/people.js +53 -0
  317. package/dist/session/headless/place.d.ts +5 -0
  318. package/dist/session/headless/place.js +5 -1
  319. package/dist/session/headless/typing.d.ts +37 -0
  320. package/dist/session/headless/typing.js +60 -0
  321. package/dist/session/index.d.ts +5 -1
  322. package/dist/session/index.js +5 -1
  323. package/dist/settings/headless/fixture-performance.js +4 -2
  324. package/dist/settings/headless/performance.d.ts +4 -0
  325. package/dist/settings/headless/search.d.ts +1 -1
  326. package/dist/settings/headless/sections-host.d.ts +7 -2
  327. package/dist/settings/section.d.ts +15 -3
  328. package/dist/settings/section.js +15 -3
  329. package/dist/settings/sections/environments/EnvironmentsSection.js +30 -6
  330. package/dist/settings/sections/keybindings/labels.d.ts +3 -0
  331. package/dist/settings/sections/keybindings/labels.js +3 -0
  332. package/dist/settings/sections/keybindings/rows.js +12 -0
  333. package/dist/settings/sections/logs/LogsSection.js +5 -8
  334. package/dist/settings/sections/performance/PerformanceSection.js +8 -1
  335. package/dist/settings/sections/performance/labels.d.ts +2 -0
  336. package/dist/settings/sections/performance/labels.js +2 -0
  337. package/dist/styles.css +65 -9
  338. package/dist/terminal/HostTerminalSurface.js +28 -30
  339. package/dist/terminal/TerminalPanel.js +4 -12
  340. package/dist/terminal/TerminalProvider.d.ts +10 -2
  341. package/dist/terminal/TerminalProvider.js +10 -2
  342. package/dist/terminal/headless/labels.d.ts +0 -1
  343. package/dist/terminal/headless/labels.js +1 -2
  344. package/dist/terminal/headless/store.js +5 -1
  345. package/dist/views/headless/answers.d.ts +8 -2
  346. package/dist/views/headless/answers.js +58 -1
  347. package/dist/views/headless/placement.d.ts +78 -0
  348. package/dist/views/headless/placement.js +154 -44
  349. package/dist/workspace/LayoutBudget.js +1 -7
  350. package/package.json +2 -2
  351. package/src/styles/chat.css +3 -1
  352. package/src/styles/palette.css +3 -3
  353. package/src/styles/transcript.css +50 -5
  354. /package/dist/dist/{index-De9AbmxS.d.ts → index-ttmMvjgM.d.ts} +0 -0
@@ -3,13 +3,14 @@ import { CodeFrame } from "../../components/CodeFrame.js";
3
3
  import { useExtensionItems } from "../../extensions/ExtensionsProvider.js";
4
4
  import { renderersFor } from "../../extensions/headless/select.js";
5
5
  import { useLinkRouter } from "../../extensions/links.js";
6
- import { openFenceOf, splitMarkdown, withoutPartialEmphasis, withoutPartialFence } from "../headless/markdown-chunks.js";
6
+ import { splitMarkdown } from "../headless/markdown-chunks.js";
7
+ import { MarkdownStream } from "../headless/markdown-stream.js";
7
8
  import { DiagramsContext } from "./diagrams-scope.js";
8
9
  import { useBackgroundMount, useForceMountRows } from "./LazyRow.js";
9
- import { cachedMarkdown } from "./markdown-cache.js";
10
+ import { cachedMarkdown, liveMarkdown } from "./markdown-cache.js";
10
11
  import { useShellBlockRunner } from "./shell-block-scope.js";
11
12
  import { ChunkFencesContext, ChunkFencesScope, ViewFencePart, chunkFencesFor, fenceIndexIn, preloadViews, useViewTurn, useViewsEnabled, viewFenceStarts } from "./view-scope.js";
12
- import { Fragment, Suspense, createContext, lazy, memo, useContext, useEffect, useMemo, useRef, useState } from "react";
13
+ import { Suspense, createContext, lazy, memo, useContext, useEffect, useMemo, useState } from "react";
13
14
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
15
  import { isShellFence, mayHoldViewFence } from "zidane/chat/pure";
15
16
  import ReactMarkdown, { defaultUrlTransform } from "react-markdown";
@@ -246,16 +247,44 @@ const documentComponents = {
246
247
  em: ({ children }) => /* @__PURE__ */ jsx("em", { children })
247
248
  };
248
249
  const REMARK_PLUGINS = [remarkGfm];
249
- const MarkdownChunk = memo(({ text, document, plugins, urlTransform }) => cachedMarkdown(text, {
250
- document: Boolean(document),
251
- plugins: plugins ?? void 0,
252
- urlTransform
253
- }, () => ReactMarkdown({
254
- remarkPlugins: plugins,
255
- components: document ? documentComponents : components,
256
- ...urlTransform ? { urlTransform } : {},
257
- children: text
258
- })));
250
+ const MarkdownChunk = memo(({ text, document, plugins, urlTransform, live = false }) => {
251
+ const key = {
252
+ document: Boolean(document),
253
+ plugins: plugins ?? void 0,
254
+ urlTransform
255
+ };
256
+ const parse = () => ReactMarkdown({
257
+ remarkPlugins: plugins,
258
+ components: document ? documentComponents : components,
259
+ ...urlTransform ? { urlTransform } : {},
260
+ children: text
261
+ });
262
+ return live ? liveMarkdown(text, key, parse) : cachedMarkdown(text, key, parse);
263
+ });
264
+ /** One chunk: its parse, in its view fences' scope with views on. */
265
+ function ChunkPart({ text, fences, document, plugins, urlTransform, live = false }) {
266
+ const parsed = /* @__PURE__ */ jsx(MarkdownChunk, {
267
+ text,
268
+ document,
269
+ plugins,
270
+ urlTransform,
271
+ live
272
+ });
273
+ return fences ? /* @__PURE__ */ jsx(ChunkFencesScope, {
274
+ base: fences.base,
275
+ starts: fences.starts,
276
+ children: parsed
277
+ }) : parsed;
278
+ }
279
+ /**
280
+ * The chunks that no longer change, as siblings in the prose box. It renders again only when one more closes (the
281
+ * stream keeps the array until then), so a frame of a long streaming reply reconciles its tail, not every chunk.
282
+ */
283
+ const SettledChunks = memo(({ chunks, count, fences, ...rest }) => /* @__PURE__ */ jsx(Fragment$1, { children: chunks.slice(0, count).map((chunk, i) => /* @__PURE__ */ jsx(ChunkPart, {
284
+ text: chunk,
285
+ fences: fences?.[i],
286
+ ...rest
287
+ }, i)) }));
259
288
  /** Chunks rendered in a long text's first commit, then per frame until all are in. */
260
289
  const CHUNKS_PER_FRAME = 2;
261
290
  /**
@@ -270,16 +299,39 @@ const CHUNKS_PER_FRAME = 2;
270
299
  * @param props - The {@link MarkdownProps}.
271
300
  */
272
301
  const Markdown = memo(({ children, className, style, document, streaming = false, remarkPlugins = REMARK_PLUGINS, urlTransform, CodeBlock = HighlightedCode, Link = PlainLink, InlineCode, Image }) => {
273
- const streamed = useRef(streaming);
274
- if (streaming) streamed.current = true;
275
- const fine = streamed.current;
302
+ const [stream, setStream] = useState(() => streaming ? new MarkdownStream() : null);
303
+ if (streaming && stream === null) setStream(new MarkdownStream());
276
304
  const views = useViewsEnabled();
277
- const chunks = useMemo(() => splitMarkdown(streaming ? withoutPartialEmphasis(withoutPartialFence(children)) : children, { streaming: fine }), [
305
+ const { closed, tail, fence } = useMemo(() => {
306
+ if (!stream) {
307
+ const chunks = splitMarkdown(children);
308
+ return {
309
+ closed: chunks.slice(0, -1),
310
+ tail: chunks.at(-1),
311
+ fence: null
312
+ };
313
+ }
314
+ return stream.frame(children, streaming);
315
+ }, [
316
+ stream,
278
317
  children,
279
- streaming,
280
- fine
318
+ streaming
319
+ ]);
320
+ const [fencesMemo, setFencesMemo] = useState(null);
321
+ const closedFences = useMemo(() => views ? chunkFencesFor(closed, fencesMemo) : null, [
322
+ closed,
323
+ views,
324
+ fencesMemo
281
325
  ]);
282
- const chunkFences = useMemo(() => views ? chunkFencesFor(chunks) : null, [chunks, views]);
326
+ if (closedFences && fencesMemo?.chunks !== closed) setFencesMemo({
327
+ chunks: closed,
328
+ fences: closedFences
329
+ });
330
+ const lastFences = closedFences?.at(-1);
331
+ const tailFences = views ? {
332
+ base: lastFences ? lastFences.base + lastFences.starts.length : 0,
333
+ starts: viewFenceStarts(tail)
334
+ } : null;
283
335
  const parts = useMemo(() => ({
284
336
  CodeBlock,
285
337
  Link,
@@ -291,18 +343,18 @@ const Markdown = memo(({ children, className, style, document, streaming = false
291
343
  InlineCode,
292
344
  Image
293
345
  ]);
294
- const tail = streaming ? openFenceOf(chunks[chunks.length - 1]) : null;
295
346
  const searching = useForceMountRows();
296
347
  const renderers = useExtensionItems("renderer");
297
348
  const diagrams = useContext(DiagramsContext) && !claimsLanguage(renderers, "mermaid");
298
- if (views && streaming && mayHoldViewFence(chunks[chunks.length - 1] ?? "") && !claimsLanguage(renderers, "view")) preloadViews();
349
+ if (views && streaming && mayHoldViewFence(tail) && !claimsLanguage(renderers, "view")) preloadViews();
299
350
  const background = useBackgroundMount();
300
351
  const [shown, setShown] = useState(CHUNKS_PER_FRAME);
301
- const complete = useRef(!background || chunks.length <= CHUNKS_PER_FRAME);
302
- if (searching || shown >= chunks.length) complete.current = true;
303
- const visible = complete.current ? chunks.length : shown;
352
+ const total = closed.length + 1;
353
+ const [complete, setComplete] = useState(!background || total <= CHUNKS_PER_FRAME);
354
+ if (!complete && (searching || shown >= total)) setComplete(true);
355
+ const visible = complete ? total : shown;
304
356
  useEffect(() => {
305
- if (complete.current) return void 0;
357
+ if (complete) return void 0;
306
358
  let timer = 0;
307
359
  const frame = requestAnimationFrame(() => {
308
360
  timer = window.setTimeout(() => setShown((n) => n + CHUNKS_PER_FRAME), 0);
@@ -311,39 +363,42 @@ const Markdown = memo(({ children, className, style, document, streaming = false
311
363
  cancelAnimationFrame(frame);
312
364
  window.clearTimeout(timer);
313
365
  };
314
- }, [visible]);
366
+ }, [visible, complete]);
367
+ const plugins = remarkPlugins;
368
+ const transform = Image ? withMediaSources(urlTransform) : urlTransform;
369
+ const tailText = fence ? fence.before : tail;
370
+ const tailShown = closed.length < visible;
315
371
  return /* @__PURE__ */ jsx(PartsContext.Provider, {
316
372
  value: parts,
317
- children: /* @__PURE__ */ jsx("div", {
373
+ children: /* @__PURE__ */ jsxs("div", {
318
374
  className: `zg-md${views ? " zg-md-views" : ""} ${className ?? ""}`,
319
375
  style,
320
- children: chunks.slice(0, visible).map((chunk, i) => {
321
- const fence = tail && i === chunks.length - 1 ? tail : null;
322
- const text = fence ? fence.before : chunk;
323
- const parsed = text ? /* @__PURE__ */ jsx(MarkdownChunk, {
324
- text,
325
- document,
326
- plugins: remarkPlugins,
327
- urlTransform: Image ? withMediaSources(urlTransform) : urlTransform
328
- }) : null;
329
- const fences = chunkFences?.[i];
330
- return /* @__PURE__ */ jsxs(Fragment, { children: [fences && parsed ? /* @__PURE__ */ jsx(ChunkFencesScope, {
331
- base: fences.base,
332
- starts: fences.starts,
333
- children: parsed
334
- }) : parsed, fence ? diagrams && fence.language === "mermaid" && fence.code.trim() ? /* @__PURE__ */ jsx(DiagramFence, {
335
- code: fence.code,
336
- streaming: true
337
- }) : views && fence.language === "view" ? /* @__PURE__ */ jsx(ViewFenceBlock, {
338
- code: fence.code,
339
- index: (fences?.base ?? 0) + viewFenceStarts(fence.before).length,
340
- streaming: true,
341
- CodeBlock
342
- }) : /* @__PURE__ */ jsx(CodeBlock, {
343
- code: fence.code,
344
- language: fence.language
345
- }) : null] }, i);
346
- })
376
+ children: [/* @__PURE__ */ jsx(SettledChunks, {
377
+ chunks: closed,
378
+ count: Math.min(visible, closed.length),
379
+ fences: closedFences,
380
+ document,
381
+ plugins,
382
+ urlTransform: transform
383
+ }), tailShown ? /* @__PURE__ */ jsxs(Fragment$1, { children: [tailText ? /* @__PURE__ */ jsx(ChunkPart, {
384
+ text: tailText,
385
+ fences: tailFences,
386
+ document,
387
+ plugins,
388
+ urlTransform: transform,
389
+ live: streaming
390
+ }) : null, fence ? diagrams && fence.language === "mermaid" && fence.code.trim() ? /* @__PURE__ */ jsx(DiagramFence, {
391
+ code: fence.code,
392
+ streaming: true
393
+ }) : views && fence.language === "view" ? /* @__PURE__ */ jsx(ViewFenceBlock, {
394
+ code: fence.code,
395
+ index: (tailFences?.base ?? 0) + viewFenceStarts(fence.before).length,
396
+ streaming: true,
397
+ CodeBlock
398
+ }) : /* @__PURE__ */ jsx(CodeBlock, {
399
+ code: fence.code,
400
+ language: fence.language
401
+ }) : null] }) : null]
347
402
  })
348
403
  });
349
404
  });
@@ -13,6 +13,7 @@
13
13
  import { ChatEvent } from "../headless/host.js";
14
14
  import { TranscriptActions } from "./actions.js";
15
15
  import { MouseEvent, ReactNode } from "react";
16
+ import { TranscriptEvents } from "zidane/chat/pure";
16
17
  /** What a medium's component hands the gallery: its key, and for the menu what it is and where it loads from. */
17
18
  export interface GalleryMedium {
18
19
  /** Its key in its exchange (`mediumKey`). */
@@ -43,8 +44,8 @@ export declare function useMediaGallery(): MediaGallery | null;
43
44
  export declare function messageMediaUrlOf(actions: Pick<TranscriptActions, 'messageMediaUrl'>, src: string): string | undefined;
44
45
  /** Props for {@link MediaGalleryProvider}. */
45
46
  export interface MediaGalleryProviderProps {
46
- /** The transcript's events, whose media the gallery steps through. */
47
- events: readonly ChatEvent[];
47
+ /** The transcript's events, whose media the gallery steps through, or its transcript store (read when a medium opens). */
48
+ events: readonly ChatEvent[] | TranscriptEvents<ChatEvent>;
48
49
  children?: ReactNode;
49
50
  }
50
51
  /**
@@ -1,15 +1,16 @@
1
1
  import { copyImage, copyImageBase64, copyImageDataUrl } from "../../components/image-clipboard.js";
2
2
  import { useLightbox } from "../../components/Lightbox.js";
3
+ import { useLatest } from "../../hooks/useLatest.js";
3
4
  import { useLabels } from "../../labels.js";
4
5
  import { exchangesMedia } from "../headless/transcript/exchange-media.js";
5
6
  import { PdfPreview } from "../PdfPreview.js";
6
7
  import { TextPreview } from "../TextPreview.js";
7
8
  import { useChatLabels } from "../useChatLabels.js";
8
- import { useTranscriptActions } from "./actions.js";
9
+ import { attachmentSrcOf, toolMediaSrcOf, useTranscriptActions } from "./actions.js";
9
10
  import { useTranscriptRenderers } from "./renderers.js";
10
11
  import { Suspense, createContext, lazy, useCallback, useContext, useMemo, useRef, useState } from "react";
11
12
  import { jsx, jsxs } from "react/jsx-runtime";
12
- import { messageMediaOf } from "zidane/chat/pure";
13
+ import { messageMediaOf, transcriptArray } from "zidane/chat/pure";
13
14
  // src/chat/transcript/media-gallery.tsx
14
15
  const RowActionsMenu = lazy(() => import("../../components/RowActionsMenu.js").then((m) => ({ default: m.RowActionsMenu })));
15
16
  const GalleryContext = createContext(null);
@@ -170,7 +171,7 @@ function lightboxItemOf(medium, { actions, mediumActions, TextPreview, isLoaded
170
171
  };
171
172
  }
172
173
  if (medium.from === "tool") {
173
- const url = actions.toolMediaUrl?.(medium.callId, medium.index);
174
+ const url = toolMediaSrcOf(actions, medium.callId, medium);
174
175
  if (!url) return null;
175
176
  return {
176
177
  key: medium.key,
@@ -230,12 +231,10 @@ function MediaGalleryProvider({ events, children }) {
230
231
  const rootRef = useRef(null);
231
232
  const [loaded, setLoaded] = useState(() => /* @__PURE__ */ new Set());
232
233
  const [menu, setMenu] = useState(null);
233
- const eventsRef = useRef(events);
234
- eventsRef.current = events;
234
+ const getEvents = useLatest(events);
235
235
  const failedRef = useRef(/* @__PURE__ */ new Set());
236
- const loadedRef = useRef(loaded);
237
- loadedRef.current = loaded;
238
- const isLoaded = useCallback((src) => loadedRef.current.has(src), []);
236
+ const getLoaded = useLatest(loaded);
237
+ const isLoaded = useCallback((src) => getLoaded().has(src), [getLoaded]);
239
238
  const itemOf = useCallback((medium) => {
240
239
  const item = lightboxItemOf(medium, {
241
240
  actions,
@@ -254,20 +253,17 @@ function MediaGalleryProvider({ events, children }) {
254
253
  TextPreview$1,
255
254
  isLoaded
256
255
  ]);
257
- const live = useRef({
256
+ const live = useLatest({
258
257
  itemOf,
259
258
  lightbox,
260
- mediumActions
259
+ mediumActions,
260
+ actions
261
261
  });
262
- live.current = {
263
- itemOf,
264
- lightbox,
265
- mediumActions
266
- };
267
262
  const gallery = useMemo(() => ({
268
263
  open(key, origin) {
269
- const { itemOf, lightbox } = live.current;
270
- const exchanges = exchangesMedia(eventsRef.current);
264
+ const { itemOf, lightbox, actions: current } = live();
265
+ const source = getEvents();
266
+ const exchanges = exchangesMedia(Array.isArray(source) ? source : transcriptArray(source), (att) => attachmentSrcOf(current, att));
271
267
  const row = origin.closest("[data-row]");
272
268
  const prompts = rootRef.current ? [...rootRef.current.querySelectorAll("[data-prompt]")] : [];
273
269
  const at = row ? prompts.filter((p) => p === row || p.compareDocumentPosition(row) & Node.DOCUMENT_POSITION_FOLLOWING).length : -1;
@@ -280,7 +276,7 @@ function MediaGalleryProvider({ events, children }) {
280
276
  return true;
281
277
  },
282
278
  menu(event, medium) {
283
- const items = live.current.mediumActions(medium, (src) => loaded.has(src));
279
+ const items = live().mediumActions(medium, (src) => loaded.has(src));
284
280
  if (items.length === 0) return;
285
281
  event.preventDefault();
286
282
  event.stopPropagation();
@@ -295,7 +291,11 @@ function MediaGalleryProvider({ events, children }) {
295
291
  remoteLoaded: (src) => loaded.has(src),
296
292
  loadRemote: (src) => setLoaded((prev) => prev.has(src) ? prev : new Set(prev).add(src)),
297
293
  failed: (key) => void failedRef.current.add(key)
298
- }), [loaded]);
294
+ }), [
295
+ loaded,
296
+ live,
297
+ getEvents
298
+ ]);
299
299
  return /* @__PURE__ */ jsxs(GalleryContext.Provider, {
300
300
  value: gallery,
301
301
  children: [
@@ -57,23 +57,24 @@ const MessageGroupRow = memo(({ row, renderRows, className, style }) => {
57
57
  ...row.between.map((m) => m.id),
58
58
  ...count > 0 ? ["header"] : []
59
59
  ]));
60
+ const { between, current: currentRow } = row;
60
61
  const entries = useMemo(() => [
61
62
  ...stack.map((m) => ({
62
63
  row: m,
63
64
  slot: "earlier"
64
65
  })),
65
- ...row.between.map((m) => ({
66
+ ...between.map((m) => ({
66
67
  row: m,
67
68
  slot: "between"
68
69
  })),
69
70
  {
70
- row: row.current,
71
+ row: currentRow,
71
72
  slot: count > 0 ? "current" : "only"
72
73
  }
73
74
  ], [
74
75
  stack,
75
- row.between,
76
- row.current,
76
+ between,
77
+ currentRow,
77
78
  count
78
79
  ]);
79
80
  return /* @__PURE__ */ jsx("div", {
@@ -7,6 +7,7 @@ import { useTranscriptActions } from "./actions.js";
7
7
  import { AuthFailureCard } from "./AuthFailureCard.js";
8
8
  import { Caret } from "./frame.js";
9
9
  import { useTranscriptRenderers } from "./renderers.js";
10
+ import { useRowPartKey, useRowUiState } from "./row-ui-state.js";
10
11
  import { memo, useId, useState } from "react";
11
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
13
  import { CONTINUE_PROMPT, SESSION_EVENT_STATUS_STYLE, describeSpawnEnd, sessionDirLabel, sessionEventExcerpt, sessionEventMeta, shortSessionId, spawnStartParts } from "zidane/chat/pure";
@@ -335,7 +336,7 @@ const COMMAND_DETAIL_LINE = "26.4px";
335
336
  * monospace `<pre>` would misrender them as a wall of mono.
336
337
  */
337
338
  const CommandDetailRow = memo(({ label, text, syntax, className, style }) => {
338
- const [open, setOpen] = useState(false);
339
+ const [open, setOpen] = useRowUiState(useRowPartKey("command-detail"), false);
339
340
  const mounted = useStaysMounted(open);
340
341
  const labels = useChatLabels();
341
342
  const { Markdown, CodeBlock } = useTranscriptRenderers();
@@ -6,8 +6,8 @@
6
6
  * commands; by default the plain text). A file chip's icon and name come
7
7
  * from the `attachmentLabel` slot.
8
8
  */
9
- import { ChatAttachment } from "../headless/host.js";
10
9
  import { Row } from "../headless/transcript/rows.js";
10
+ import { ChatAttachment } from "../headless/host.js";
11
11
  import "../headless/transcript/index.js";
12
12
  import { AttachmentLabelParts } from "./renderers.js";
13
13
  import { CSSProperties } from "react";
@@ -4,6 +4,7 @@ import { mediumKey } from "../headless/transcript/exchange-media.js";
4
4
  import { PdfPreview } from "../PdfPreview.js";
5
5
  import { TextPreview } from "../TextPreview.js";
6
6
  import { useChatLabels } from "../useChatLabels.js";
7
+ import { attachmentSrcOf, useTranscriptActions } from "./actions.js";
7
8
  import { Dot, useRowIcons } from "./frame.js";
8
9
  import { useMediaGallery } from "./media-gallery.js";
9
10
  import { MessageMedia, promptMediaOf } from "./message-media.js";
@@ -65,13 +66,14 @@ function UserPromptAttachments({ items, className, style }) {
65
66
  const labels = useChatLabels();
66
67
  const lightbox = useLightbox();
67
68
  const mediaGallery = useMediaGallery();
69
+ const actions = useTranscriptActions();
68
70
  const { TextPreview: TextPreview$1 = TextPreview } = useTranscriptRenderers();
69
71
  const [failed, setFailed] = useState(() => /* @__PURE__ */ new Set());
70
72
  const isImage = (att) => att.mediaType.startsWith("image/");
71
73
  const gallery = items.map((att, idx) => ({
72
74
  att,
73
75
  idx,
74
- src: att.dataUrl
76
+ src: attachmentSrcOf(actions, att)
75
77
  })).filter((entry) => entry.src !== void 0 && (isImage(entry.att) ? !failed.has(entry.idx) : isPdfAttachment(entry.att) || isTextLike(entry.att)));
76
78
  const galleryItems = gallery.map(({ att, idx, src }) => isImage(att) ? {
77
79
  key: String(idx),
@@ -115,14 +117,14 @@ function UserPromptAttachments({ items, className, style }) {
115
117
  title: att.name,
116
118
  "aria-label": labels.viewAttachment(att.name),
117
119
  onClick: (event) => openAt(idx, position, event.currentTarget),
118
- onContextMenu: mediaGallery && att.dataUrl ? (event) => mediaGallery.menu(event, {
120
+ onContextMenu: mediaGallery ? (event) => mediaGallery.menu(event, {
119
121
  key: mediumKey.attachment(idx),
120
122
  kind: "image",
121
- url: att.dataUrl
123
+ url: gallery[position].src
122
124
  }) : void 0,
123
125
  className: "zg-press-subtle block p-0 border-0 bg-transparent cursor-zoom-in rounded-zg-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--zg-ring)]",
124
126
  children: /* @__PURE__ */ jsx("img", {
125
- src: att.dataUrl,
127
+ src: gallery[position].src,
126
128
  alt: att.name,
127
129
  onError: () => setFailed((prev) => new Set(prev).add(idx)),
128
130
  className: "block w-16 h-16 object-cover rounded-zg-md bg-[var(--zg-tray)] shadow-[inset_0_0_0_1px_var(--zg-hairline)]"
@@ -2,6 +2,7 @@ import { useStaysMounted } from "../../motion/collapse.js";
2
2
  import { useChatLabels } from "../useChatLabels.js";
3
3
  import { Caret } from "./frame.js";
4
4
  import { useTranscriptRenderers } from "./renderers.js";
5
+ import { useRowPartKey, useRowUiState } from "./row-ui-state.js";
5
6
  import { ToolTiming } from "./tool-parts.js";
6
7
  import { memo, useState } from "react";
7
8
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -74,7 +75,7 @@ const ThinkingRow = memo(({ text, thinkingMs, live, autoExpand = false, classNam
74
75
  * groups); replayed groups render a bare count.
75
76
  */
76
77
  const ThinkingBatchRow = memo(({ thoughts, totalMs, autoExpand = false, className, style }) => {
77
- const [open, setOpen] = useState(false);
78
+ const [open, setOpen] = useRowUiState(useRowPartKey("thoughts"), false);
78
79
  const labels = useChatLabels();
79
80
  return /* @__PURE__ */ jsxs("div", {
80
81
  className: ["text-xs", className].filter(Boolean).join(" "),
@@ -0,0 +1,96 @@
1
+ /**
2
+ * The transcript's root items: each root row, each worker's block, and what
3
+ * follows a turn (the codemode views of an exchange with no reply text, the
4
+ * extensions' `transcript.turn-end` items), keyed and estimated. And the
5
+ * text a search reads from a row's data, to know which unmounted rows to
6
+ * mount for it.
7
+ */
8
+ import { Cluster, GroupCluster, Row } from "../headless/transcript/rows.js";
9
+ import "../headless/transcript/index.js";
10
+ /** A root item's key and first-pass height. */
11
+ export interface RootItemSpec {
12
+ /** Its id among the root items: the row's id for a row. */
13
+ key: string;
14
+ /** Its height before it is measured (px). */
15
+ estimate: number;
16
+ }
17
+ /** A root item and what it renders. */
18
+ export type RootItem = RootItemSpec & ({
19
+ kind: 'single';
20
+ cluster: Extract<Cluster, {
21
+ kind: 'single';
22
+ }>;
23
+ } | {
24
+ kind: 'group';
25
+ cluster: GroupCluster;
26
+ ci: number;
27
+ } | {
28
+ kind: 'views-end';
29
+ rowId: string;
30
+ turns: readonly string[];
31
+ } | {
32
+ kind: 'turn-end';
33
+ turnId: string;
34
+ });
35
+ /** A subagent block's id among the rows: its first row's, not its position (a prepended page shifts every position). */
36
+ export declare function groupRowId(cluster: GroupCluster, index: number): string;
37
+ /**
38
+ * The root items, in order.
39
+ *
40
+ * @param clusters - The transcript's root clusters.
41
+ * @param hidden - Rows that render nothing (no item).
42
+ * @param collapsedGroups - Worker blocks start collapsed.
43
+ * @param textlessEnds - After which row the codemode views of an exchange with no reply text go, or null.
44
+ * @param turnEnds - After which row the extensions' items for which turns go, or null.
45
+ * @param offset - Where `clusters` start among the transcript's clusters (the open part's, after the settled ones).
46
+ */
47
+ export declare function rootItems(clusters: readonly Cluster[], hidden: (row: Row) => boolean, collapsedGroups: boolean, textlessEnds: ReadonlyMap<string, readonly string[]> | null, turnEnds: ReadonlyMap<string, readonly string[]> | null, offset?: number): RootItem[];
48
+ /**
49
+ * Every string a row holds, lowercased: what it shows (and some it does not, ids and paths). Cached per row object.
50
+ * A search mounts the rows whose text holds its needle; the DOM walk then finds what they really show.
51
+ *
52
+ * @param row - A row, or a block's cluster.
53
+ */
54
+ export declare function rowSearchText(row: object): string;
55
+ /**
56
+ * The id of the last root row holding each turn among `clusters`: once per clusters array (a settled part's, read
57
+ * every tick, is walked once).
58
+ *
59
+ * @param clusters - Root clusters.
60
+ */
61
+ export declare function lastRowByTurn(clusters: readonly Cluster[]): ReadonlyMap<string, string>;
62
+ /** What follows rows, split by the part their row is in: an item list per part derives from its own. */
63
+ export interface PartEnds {
64
+ settled: ReadonlyMap<string, readonly string[]> | null;
65
+ open: ReadonlyMap<string, readonly string[]> | null;
66
+ }
67
+ /**
68
+ * Places groups of turns after the last root row holding one of them, in the part that row is in.
69
+ * Each part's map is `previous`'s while it holds the same: the settled items then stay.
70
+ *
71
+ * @param parts - The settled and the open root clusters.
72
+ * @param parts.settled - The settled clusters.
73
+ * @param parts.open - The open clusters.
74
+ * @param place - Calls `at` for each group: `at(turnId)` is where a turn's last row is.
75
+ * @param previous - The last result.
76
+ */
77
+ export declare function endsByRow(parts: {
78
+ settled: readonly Cluster[];
79
+ open: readonly Cluster[];
80
+ }, place: (at: (turnId: string) => {
81
+ rowId: string;
82
+ open: boolean;
83
+ } | undefined, add: (where: {
84
+ rowId: string;
85
+ open: boolean;
86
+ }, turns: readonly string[]) => void) => void, previous: PartEnds | null): PartEnds;
87
+ /**
88
+ * The keys of the items whose data holds one of `needles` (lowercased).
89
+ *
90
+ * @param items - The root items, or their settled and open parts.
91
+ * @param needles - What the search looks for.
92
+ */
93
+ export declare function matchingItems(items: readonly RootItem[] | {
94
+ settled: readonly RootItem[];
95
+ open: readonly RootItem[];
96
+ }, needles: readonly string[]): string[];