@vibefield/rosetta-room 0.0.0-stage → 0.1.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 (435) hide show
  1. package/README.md +247 -2
  2. package/dist/HistoryRoom.d.ts +98 -0
  3. package/dist/HistoryRoom.js +440 -0
  4. package/dist/TranscriptReader.d.ts +22 -0
  5. package/dist/TranscriptReader.js +72 -0
  6. package/dist/components/ColdStart.d.ts +4 -0
  7. package/dist/components/ColdStart.js +5 -0
  8. package/dist/components/FilterChips.d.ts +4 -0
  9. package/dist/components/FilterChips.js +5 -0
  10. package/dist/components/HostAct.d.ts +9 -0
  11. package/dist/components/HostAct.js +16 -0
  12. package/dist/components/HostMenu.d.ts +41 -0
  13. package/dist/components/HostMenu.js +216 -0
  14. package/dist/components/IngestStatus.d.ts +4 -0
  15. package/dist/components/IngestStatus.js +20 -0
  16. package/dist/components/ListActivityNotice.d.ts +5 -0
  17. package/dist/components/ListActivityNotice.js +4 -0
  18. package/dist/components/ListSections.d.ts +20 -0
  19. package/dist/components/ListSections.js +39 -0
  20. package/dist/components/RenameHeading.d.ts +9 -0
  21. package/dist/components/RenameHeading.js +75 -0
  22. package/dist/components/SearchStrip.d.ts +5 -0
  23. package/dist/components/SearchStrip.js +8 -0
  24. package/dist/components/SummaryMetrics.d.ts +13 -0
  25. package/dist/components/SummaryMetrics.js +9 -0
  26. package/dist/components/SummaryPanels.d.ts +35 -0
  27. package/dist/components/SummaryPanels.js +117 -0
  28. package/dist/components/Transcript.d.ts +46 -0
  29. package/dist/components/Transcript.js +358 -0
  30. package/dist/components/charts/ActivityChartDetail.d.ts +13 -0
  31. package/dist/components/charts/ActivityChartDetail.js +78 -0
  32. package/dist/components/charts/CalendarHeatmap.d.ts +16 -0
  33. package/dist/components/charts/CalendarHeatmap.js +55 -0
  34. package/dist/components/charts/DayActivityChart.d.ts +8 -0
  35. package/dist/components/charts/DayActivityChart.js +71 -0
  36. package/dist/components/charts/ModelsChartDetail.d.ts +7 -0
  37. package/dist/components/charts/ModelsChartDetail.js +19 -0
  38. package/dist/components/charts/ProjectChartDialog.d.ts +19 -0
  39. package/dist/components/charts/ProjectChartDialog.js +39 -0
  40. package/dist/components/charts/Streamgraph.d.ts +16 -0
  41. package/dist/components/charts/Streamgraph.js +94 -0
  42. package/dist/components/charts/Treemap.d.ts +26 -0
  43. package/dist/components/charts/Treemap.js +81 -0
  44. package/dist/components/charts/index.d.ts +9 -0
  45. package/dist/components/charts/index.js +4 -0
  46. package/dist/components/charts/streamgraph-layout.d.ts +23 -0
  47. package/dist/components/charts/streamgraph-layout.js +114 -0
  48. package/dist/components/charts/treemap-layout.d.ts +32 -0
  49. package/dist/components/charts/treemap-layout.js +140 -0
  50. package/dist/components/charts/types.d.ts +65 -0
  51. package/dist/components/charts/types.js +8 -0
  52. package/dist/components/file-viewer/FileViewerBrowsers.d.ts +10 -0
  53. package/dist/components/file-viewer/FileViewerBrowsers.js +65 -0
  54. package/dist/components/file-viewer/FileViewerDialog.d.ts +33 -0
  55. package/dist/components/file-viewer/FileViewerDialog.js +82 -0
  56. package/dist/components/file-viewer/FileViewerHeader.d.ts +26 -0
  57. package/dist/components/file-viewer/FileViewerHeader.js +17 -0
  58. package/dist/components/file-viewer/ImageGalleryDialog.d.ts +14 -0
  59. package/dist/components/file-viewer/ImageGalleryDialog.js +98 -0
  60. package/dist/components/file-viewer/diff/index.d.ts +2 -0
  61. package/dist/components/file-viewer/diff/index.js +2 -0
  62. package/dist/components/file-viewer/diff/parse.d.ts +2 -0
  63. package/dist/components/file-viewer/diff/parse.js +164 -0
  64. package/dist/components/file-viewer/diff/types.d.ts +44 -0
  65. package/dist/components/file-viewer/diff/types.js +7 -0
  66. package/dist/components/file-viewer/gallery-source.d.ts +11 -0
  67. package/dist/components/file-viewer/gallery-source.js +75 -0
  68. package/dist/components/file-viewer/image-resource.d.ts +19 -0
  69. package/dist/components/file-viewer/image-resource.js +60 -0
  70. package/dist/components/file-viewer/index.d.ts +5 -0
  71. package/dist/components/file-viewer/index.js +8 -0
  72. package/dist/components/file-viewer/markdown/blocks.d.ts +2 -0
  73. package/dist/components/file-viewer/markdown/blocks.js +277 -0
  74. package/dist/components/file-viewer/markdown/index.d.ts +4 -0
  75. package/dist/components/file-viewer/markdown/index.js +35 -0
  76. package/dist/components/file-viewer/markdown/inline.d.ts +10 -0
  77. package/dist/components/file-viewer/markdown/inline.js +178 -0
  78. package/dist/components/file-viewer/markdown/render.d.ts +9 -0
  79. package/dist/components/file-viewer/markdown/render.js +78 -0
  80. package/dist/components/file-viewer/markdown/types.d.ts +57 -0
  81. package/dist/components/file-viewer/markdown/types.js +11 -0
  82. package/dist/components/file-viewer/minimap/CodeMinimap.d.ts +10 -0
  83. package/dist/components/file-viewer/minimap/CodeMinimap.js +296 -0
  84. package/dist/components/file-viewer/minimap/layout.d.ts +60 -0
  85. package/dist/components/file-viewer/minimap/layout.js +117 -0
  86. package/dist/components/file-viewer/minimap/palette.d.ts +2 -0
  87. package/dist/components/file-viewer/minimap/palette.js +73 -0
  88. package/dist/components/file-viewer/minimap/raster.d.ts +19 -0
  89. package/dist/components/file-viewer/minimap/raster.js +122 -0
  90. package/dist/components/file-viewer/registry.d.ts +25 -0
  91. package/dist/components/file-viewer/registry.js +182 -0
  92. package/dist/components/file-viewer/syntax/grammars.d.ts +16 -0
  93. package/dist/components/file-viewer/syntax/grammars.js +221 -0
  94. package/dist/components/file-viewer/syntax/index.d.ts +8 -0
  95. package/dist/components/file-viewer/syntax/index.js +9 -0
  96. package/dist/components/file-viewer/syntax/languages.d.ts +14 -0
  97. package/dist/components/file-viewer/syntax/languages.js +115 -0
  98. package/dist/components/file-viewer/syntax/tokenize-config.d.ts +2 -0
  99. package/dist/components/file-viewer/syntax/tokenize-config.js +132 -0
  100. package/dist/components/file-viewer/syntax/tokenize-css.d.ts +2 -0
  101. package/dist/components/file-viewer/syntax/tokenize-css.js +169 -0
  102. package/dist/components/file-viewer/syntax/tokenize-markup.d.ts +2 -0
  103. package/dist/components/file-viewer/syntax/tokenize-markup.js +124 -0
  104. package/dist/components/file-viewer/syntax/tokenize.d.ts +9 -0
  105. package/dist/components/file-viewer/syntax/tokenize.js +289 -0
  106. package/dist/components/file-viewer/syntax/types.d.ts +74 -0
  107. package/dist/components/file-viewer/syntax/types.js +13 -0
  108. package/dist/components/file-viewer/types.d.ts +111 -0
  109. package/dist/components/file-viewer/types.js +8 -0
  110. package/dist/components/file-viewer/use-file-content.d.ts +26 -0
  111. package/dist/components/file-viewer/use-file-content.js +144 -0
  112. package/dist/components/file-viewer/views/BinaryView.d.ts +2 -0
  113. package/dist/components/file-viewer/views/BinaryView.js +34 -0
  114. package/dist/components/file-viewer/views/CodeView.d.ts +2 -0
  115. package/dist/components/file-viewer/views/CodeView.js +46 -0
  116. package/dist/components/file-viewer/views/DiffBody.d.ts +7 -0
  117. package/dist/components/file-viewer/views/DiffBody.js +77 -0
  118. package/dist/components/file-viewer/views/DiffView.d.ts +2 -0
  119. package/dist/components/file-viewer/views/DiffView.js +11 -0
  120. package/dist/components/file-viewer/views/ImageView.d.ts +9 -0
  121. package/dist/components/file-viewer/views/ImageView.js +28 -0
  122. package/dist/components/file-viewer/views/MarkdownView.d.ts +9 -0
  123. package/dist/components/file-viewer/views/MarkdownView.js +20 -0
  124. package/dist/components/file-viewer/views/SvgView.d.ts +9 -0
  125. package/dist/components/file-viewer/views/SvgView.js +10 -0
  126. package/dist/components/git/ChangeTree.d.ts +20 -0
  127. package/dist/components/git/ChangeTree.js +35 -0
  128. package/dist/components/git/CommitViewer.d.ts +12 -0
  129. package/dist/components/git/CommitViewer.js +85 -0
  130. package/dist/components/git/GitChanges.d.ts +17 -0
  131. package/dist/components/git/GitChanges.js +70 -0
  132. package/dist/components/git/GitHistory.d.ts +9 -0
  133. package/dist/components/git/GitHistory.js +58 -0
  134. package/dist/components/git/co-author.d.ts +14 -0
  135. package/dist/components/git/co-author.js +55 -0
  136. package/dist/components/git/git-file-source.d.ts +18 -0
  137. package/dist/components/git/git-file-source.js +53 -0
  138. package/dist/components/git/git-host.d.ts +24 -0
  139. package/dist/components/git/git-host.js +130 -0
  140. package/dist/components/git/index.d.ts +10 -0
  141. package/dist/components/git/index.js +12 -0
  142. package/dist/components/git/path-tree.d.ts +23 -0
  143. package/dist/components/git/path-tree.js +73 -0
  144. package/dist/components/git/session-files.d.ts +9 -0
  145. package/dist/components/git/session-files.js +50 -0
  146. package/dist/components/git/types.d.ts +92 -0
  147. package/dist/components/git/types.js +9 -0
  148. package/dist/components/projects/ProjectActivitySparkline.d.ts +6 -0
  149. package/dist/components/projects/ProjectActivitySparkline.js +12 -0
  150. package/dist/components/projects/ProjectList.d.ts +25 -0
  151. package/dist/components/projects/ProjectList.js +43 -0
  152. package/dist/components/projects/ProjectListItem.d.ts +19 -0
  153. package/dist/components/projects/ProjectListItem.js +78 -0
  154. package/dist/components/projects/ProjectsColumn.d.ts +19 -0
  155. package/dist/components/projects/ProjectsColumn.js +36 -0
  156. package/dist/components/projects/index.d.ts +8 -0
  157. package/dist/components/projects/index.js +4 -0
  158. package/dist/components/search/MatchStepper.d.ts +9 -0
  159. package/dist/components/search/MatchStepper.js +14 -0
  160. package/dist/components/search/SearchLauncher.d.ts +12 -0
  161. package/dist/components/search/SearchLauncher.js +13 -0
  162. package/dist/components/search/SearchSheet.d.ts +29 -0
  163. package/dist/components/search/SearchSheet.js +230 -0
  164. package/dist/components/search/index.d.ts +8 -0
  165. package/dist/components/search/index.js +4 -0
  166. package/dist/components/search/shortcut.d.ts +25 -0
  167. package/dist/components/search/shortcut.js +32 -0
  168. package/dist/components/sessions/SessionList.d.ts +24 -0
  169. package/dist/components/sessions/SessionList.js +76 -0
  170. package/dist/components/sessions/SessionListItem.d.ts +13 -0
  171. package/dist/components/sessions/SessionListItem.js +58 -0
  172. package/dist/components/sessions/SessionsColumn.d.ts +26 -0
  173. package/dist/components/sessions/SessionsColumn.js +32 -0
  174. package/dist/components/sessions/index.d.ts +9 -0
  175. package/dist/components/sessions/index.js +4 -0
  176. package/dist/components/sessions/session-display.d.ts +8 -0
  177. package/dist/components/sessions/session-display.js +18 -0
  178. package/dist/components/sessions/types.d.ts +7 -0
  179. package/dist/components/sessions/types.js +1 -0
  180. package/dist/components/transcript/Activity.d.ts +45 -0
  181. package/dist/components/transcript/Activity.js +75 -0
  182. package/dist/components/transcript/Anchor.d.ts +8 -0
  183. package/dist/components/transcript/Anchor.js +23 -0
  184. package/dist/components/transcript/Attachments.d.ts +21 -0
  185. package/dist/components/transcript/Attachments.js +138 -0
  186. package/dist/components/transcript/AuthoredMessage.d.ts +19 -0
  187. package/dist/components/transcript/AuthoredMessage.js +17 -0
  188. package/dist/components/transcript/Compaction.d.ts +9 -0
  189. package/dist/components/transcript/Compaction.js +50 -0
  190. package/dist/components/transcript/DayPill.d.ts +38 -0
  191. package/dist/components/transcript/DayPill.js +68 -0
  192. package/dist/components/transcript/Document.d.ts +32 -0
  193. package/dist/components/transcript/Document.js +503 -0
  194. package/dist/components/transcript/Favicon.d.ts +32 -0
  195. package/dist/components/transcript/Favicon.js +71 -0
  196. package/dist/components/transcript/HeadOfDocument.d.ts +19 -0
  197. package/dist/components/transcript/HeadOfDocument.js +44 -0
  198. package/dist/components/transcript/Ledger.d.ts +53 -0
  199. package/dist/components/transcript/Ledger.js +182 -0
  200. package/dist/components/transcript/LineDetail.d.ts +24 -0
  201. package/dist/components/transcript/LineDetail.js +81 -0
  202. package/dist/components/transcript/Marker.d.ts +33 -0
  203. package/dist/components/transcript/Marker.js +21 -0
  204. package/dist/components/transcript/MessagePreview.d.ts +12 -0
  205. package/dist/components/transcript/MessagePreview.js +58 -0
  206. package/dist/components/transcript/Prompt.d.ts +20 -0
  207. package/dist/components/transcript/Prompt.js +55 -0
  208. package/dist/components/transcript/Prose.d.ts +19 -0
  209. package/dist/components/transcript/Prose.js +109 -0
  210. package/dist/components/transcript/ReceiptPill.d.ts +10 -0
  211. package/dist/components/transcript/ReceiptPill.js +10 -0
  212. package/dist/components/transcript/ResponseHead.d.ts +9 -0
  213. package/dist/components/transcript/ResponseHead.js +36 -0
  214. package/dist/components/transcript/Subthread.d.ts +19 -0
  215. package/dist/components/transcript/Subthread.js +96 -0
  216. package/dist/components/transcript/Team.d.ts +53 -0
  217. package/dist/components/transcript/Team.js +185 -0
  218. package/dist/components/transcript/Thinking.d.ts +24 -0
  219. package/dist/components/transcript/Thinking.js +50 -0
  220. package/dist/components/transcript/TimelineMeta.d.ts +9 -0
  221. package/dist/components/transcript/TimelineMeta.js +161 -0
  222. package/dist/components/transcript/TranscriptLoading.d.ts +10 -0
  223. package/dist/components/transcript/TranscriptLoading.js +10 -0
  224. package/dist/components/transcript/WebDetail.d.ts +8 -0
  225. package/dist/components/transcript/WebDetail.js +29 -0
  226. package/dist/components/transcript/Workflow.d.ts +12 -0
  227. package/dist/components/transcript/Workflow.js +208 -0
  228. package/dist/components/transcript/activity-plan.d.ts +84 -0
  229. package/dist/components/transcript/activity-plan.js +209 -0
  230. package/dist/components/transcript/attachment-file-source.d.ts +23 -0
  231. package/dist/components/transcript/attachment-file-source.js +103 -0
  232. package/dist/components/transcript/attachment-gallery.d.ts +12 -0
  233. package/dist/components/transcript/attachment-gallery.js +33 -0
  234. package/dist/components/transcript/detail-parts.d.ts +50 -0
  235. package/dist/components/transcript/detail-parts.js +295 -0
  236. package/dist/components/transcript/disclosure-state.d.ts +6 -0
  237. package/dist/components/transcript/disclosure-state.js +32 -0
  238. package/dist/components/transcript/disclosure-store.d.ts +8 -0
  239. package/dist/components/transcript/disclosure-store.js +31 -0
  240. package/dist/components/transcript/document-model.d.ts +15 -0
  241. package/dist/components/transcript/document-model.js +104 -0
  242. package/dist/components/transcript/document-plan.d.ts +28 -0
  243. package/dist/components/transcript/document-plan.js +145 -0
  244. package/dist/components/transcript/fold-preference.d.ts +17 -0
  245. package/dist/components/transcript/fold-preference.js +63 -0
  246. package/dist/components/transcript/glyphs.d.ts +15 -0
  247. package/dist/components/transcript/glyphs.js +47 -0
  248. package/dist/components/transcript/index.d.ts +23 -0
  249. package/dist/components/transcript/index.js +22 -0
  250. package/dist/components/transcript/message-file-source.d.ts +15 -0
  251. package/dist/components/transcript/message-file-source.js +31 -0
  252. package/dist/components/transcript/message-preview.d.ts +9 -0
  253. package/dist/components/transcript/message-preview.js +46 -0
  254. package/dist/components/transcript/read-file-source.d.ts +7 -0
  255. package/dist/components/transcript/read-file-source.js +34 -0
  256. package/dist/components/transcript/reader-context.d.ts +13 -0
  257. package/dist/components/transcript/reader-context.js +55 -0
  258. package/dist/components/transcript/reading-identity.d.ts +2 -0
  259. package/dist/components/transcript/reading-identity.js +52 -0
  260. package/dist/components/transcript/scroll-to-row.d.ts +2 -0
  261. package/dist/components/transcript/scroll-to-row.js +13 -0
  262. package/dist/components/transcript/thread-index.d.ts +14 -0
  263. package/dist/components/transcript/thread-index.js +40 -0
  264. package/dist/components/transcript/thread-navigation.d.ts +5 -0
  265. package/dist/components/transcript/thread-navigation.js +3 -0
  266. package/dist/components/transcript/timeline-meta-file-source.d.ts +6 -0
  267. package/dist/components/transcript/timeline-meta-file-source.js +55 -0
  268. package/dist/components/transcript/timeline-meta-state.d.ts +12 -0
  269. package/dist/components/transcript/timeline-meta-state.js +24 -0
  270. package/dist/components/ui/ColumnHeading.d.ts +27 -0
  271. package/dist/components/ui/ColumnHeading.js +7 -0
  272. package/dist/components/ui/ConfirmDialog.d.ts +14 -0
  273. package/dist/components/ui/ConfirmDialog.js +22 -0
  274. package/dist/components/ui/DialogShell.d.ts +18 -0
  275. package/dist/components/ui/DialogShell.js +40 -0
  276. package/dist/components/ui/EmptyState.d.ts +10 -0
  277. package/dist/components/ui/EmptyState.js +6 -0
  278. package/dist/components/ui/ListSummaryHeader.d.ts +9 -0
  279. package/dist/components/ui/ListSummaryHeader.js +6 -0
  280. package/dist/components/ui/ListToolbar.d.ts +6 -0
  281. package/dist/components/ui/ListToolbar.js +5 -0
  282. package/dist/components/ui/ResultGroupHeader.d.ts +9 -0
  283. package/dist/components/ui/ResultGroupHeader.js +5 -0
  284. package/dist/components/ui/SegmentedControl.d.ts +16 -0
  285. package/dist/components/ui/SegmentedControl.js +9 -0
  286. package/dist/components/ui/SummaryMetric.d.ts +13 -0
  287. package/dist/components/ui/SummaryMetric.js +10 -0
  288. package/dist/components/ui/Veil.d.ts +7 -0
  289. package/dist/components/ui/Veil.js +5 -0
  290. package/dist/components/ui/index.d.ts +20 -0
  291. package/dist/components/ui/index.js +10 -0
  292. package/dist/components/worktree/WorktreeColumn.d.ts +22 -0
  293. package/dist/components/worktree/WorktreeColumn.js +170 -0
  294. package/dist/components/worktree/WorktreeFileTree.d.ts +19 -0
  295. package/dist/components/worktree/WorktreeFileTree.js +60 -0
  296. package/dist/components/worktree/WorktreeHeader.d.ts +32 -0
  297. package/dist/components/worktree/WorktreeHeader.js +81 -0
  298. package/dist/components/worktree/WorktreeList.d.ts +8 -0
  299. package/dist/components/worktree/WorktreeList.js +12 -0
  300. package/dist/components/worktree/index.d.ts +12 -0
  301. package/dist/components/worktree/index.js +7 -0
  302. package/dist/components/worktree/types.d.ts +17 -0
  303. package/dist/components/worktree/types.js +3 -0
  304. package/dist/components/worktree/use-worktree-guest.d.ts +21 -0
  305. package/dist/components/worktree/use-worktree-guest.js +92 -0
  306. package/dist/components/worktree/worktree-file-commands.d.ts +19 -0
  307. package/dist/components/worktree/worktree-file-commands.js +112 -0
  308. package/dist/components/worktree/worktree-file-source.d.ts +15 -0
  309. package/dist/components/worktree/worktree-file-source.js +75 -0
  310. package/dist/components/worktree/worktree-host.d.ts +31 -0
  311. package/dist/components/worktree/worktree-host.js +242 -0
  312. package/dist/fixtures/index.d.ts +24 -0
  313. package/dist/fixtures/index.js +292 -0
  314. package/dist/host-inputs.d.ts +231 -0
  315. package/dist/host-inputs.js +35 -0
  316. package/dist/index.d.ts +18 -0
  317. package/dist/index.js +14 -0
  318. package/dist/lib/activity-details.d.ts +23 -0
  319. package/dist/lib/activity-details.js +78 -0
  320. package/dist/lib/activity-order.d.ts +32 -0
  321. package/dist/lib/activity-order.js +86 -0
  322. package/dist/lib/agent-paths.d.ts +6 -0
  323. package/dist/lib/agent-paths.js +19 -0
  324. package/dist/lib/agents.d.ts +15 -0
  325. package/dist/lib/agents.js +60 -0
  326. package/dist/lib/catalog-status.d.ts +3 -0
  327. package/dist/lib/catalog-status.js +10 -0
  328. package/dist/lib/chart-data.d.ts +14 -0
  329. package/dist/lib/chart-data.js +151 -0
  330. package/dist/lib/day-activity.d.ts +21 -0
  331. package/dist/lib/day-activity.js +56 -0
  332. package/dist/lib/format.d.ts +24 -0
  333. package/dist/lib/format.js +116 -0
  334. package/dist/lib/hooks.d.ts +118 -0
  335. package/dist/lib/hooks.js +608 -0
  336. package/dist/lib/icons.d.ts +21 -0
  337. package/dist/lib/icons.js +49 -0
  338. package/dist/lib/image-media.d.ts +6 -0
  339. package/dist/lib/image-media.js +30 -0
  340. package/dist/lib/ingest-activity.d.ts +50 -0
  341. package/dist/lib/ingest-activity.js +151 -0
  342. package/dist/lib/ingest.d.ts +25 -0
  343. package/dist/lib/ingest.js +70 -0
  344. package/dist/lib/model-labels.d.ts +5 -0
  345. package/dist/lib/model-labels.js +28 -0
  346. package/dist/lib/model.d.ts +73 -0
  347. package/dist/lib/model.js +141 -0
  348. package/dist/lib/motion.d.ts +13 -0
  349. package/dist/lib/motion.js +80 -0
  350. package/dist/lib/room-storage.d.ts +13 -0
  351. package/dist/lib/room-storage.js +40 -0
  352. package/dist/lib/search-results.d.ts +27 -0
  353. package/dist/lib/search-results.js +83 -0
  354. package/dist/lib/search-sheet.d.ts +119 -0
  355. package/dist/lib/search-sheet.js +282 -0
  356. package/dist/lib/sections.d.ts +19 -0
  357. package/dist/lib/sections.js +36 -0
  358. package/dist/lib/session-activity.d.ts +5 -0
  359. package/dist/lib/session-activity.js +15 -0
  360. package/dist/lib/session-leases.d.ts +15 -0
  361. package/dist/lib/session-leases.js +61 -0
  362. package/dist/lib/spend.d.ts +42 -0
  363. package/dist/lib/spend.js +112 -0
  364. package/dist/lib/tint.d.ts +9 -0
  365. package/dist/lib/tint.js +53 -0
  366. package/dist/lib/transcript/collaboration.d.ts +97 -0
  367. package/dist/lib/transcript/collaboration.js +423 -0
  368. package/dist/lib/transcript/families.d.ts +212 -0
  369. package/dist/lib/transcript/families.js +906 -0
  370. package/dist/lib/transcript/favicons.d.ts +54 -0
  371. package/dist/lib/transcript/favicons.js +183 -0
  372. package/dist/lib/transcript/head-of-document.d.ts +27 -0
  373. package/dist/lib/transcript/head-of-document.js +274 -0
  374. package/dist/lib/transcript/head-state.d.ts +182 -0
  375. package/dist/lib/transcript/head-state.js +305 -0
  376. package/dist/lib/transcript/history-window.d.ts +13 -0
  377. package/dist/lib/transcript/history-window.js +52 -0
  378. package/dist/lib/transcript/images.d.ts +8 -0
  379. package/dist/lib/transcript/images.js +60 -0
  380. package/dist/lib/transcript/index.d.ts +15 -0
  381. package/dist/lib/transcript/index.js +8 -0
  382. package/dist/lib/transcript/ledger.d.ts +143 -0
  383. package/dist/lib/transcript/ledger.js +513 -0
  384. package/dist/lib/transcript/protocol.d.ts +23 -0
  385. package/dist/lib/transcript/protocol.js +1 -0
  386. package/dist/lib/transcript/sittings.d.ts +75 -0
  387. package/dist/lib/transcript/sittings.js +147 -0
  388. package/dist/lib/transcript/tail-scroll.d.ts +36 -0
  389. package/dist/lib/transcript/tail-scroll.js +167 -0
  390. package/dist/lib/transcript/tail-state.d.ts +17 -0
  391. package/dist/lib/transcript/tail-state.js +30 -0
  392. package/dist/lib/transcript/turns.d.ts +192 -0
  393. package/dist/lib/transcript/turns.js +576 -0
  394. package/dist/lib/transcript/use-transcript-opening.d.ts +12 -0
  395. package/dist/lib/transcript/use-transcript-opening.js +31 -0
  396. package/dist/lib/transcript/use-transcript-tail.d.ts +25 -0
  397. package/dist/lib/transcript/use-transcript-tail.js +158 -0
  398. package/dist/lib/transcript/vocabulary.d.ts +119 -0
  399. package/dist/lib/transcript/vocabulary.js +293 -0
  400. package/dist/lib/transcript/web-address.d.ts +6 -0
  401. package/dist/lib/transcript/web-address.js +18 -0
  402. package/dist/lib/transcript/workflow.d.ts +31 -0
  403. package/dist/lib/transcript/workflow.js +133 -0
  404. package/dist/lib/use-activity-order.d.ts +2 -0
  405. package/dist/lib/use-activity-order.js +23 -0
  406. package/dist/lib/use-day-usage.d.ts +8 -0
  407. package/dist/lib/use-day-usage.js +31 -0
  408. package/dist/lib/use-deferred-list-order.d.ts +26 -0
  409. package/dist/lib/use-deferred-list-order.js +142 -0
  410. package/dist/lib/use-ingest-activity.d.ts +2 -0
  411. package/dist/lib/use-ingest-activity.js +49 -0
  412. package/dist/lib/use-list-motion.d.ts +4 -0
  413. package/dist/lib/use-list-motion.js +67 -0
  414. package/dist/ports.d.ts +222 -0
  415. package/dist/ports.js +3 -0
  416. package/dist/room-context.d.ts +60 -0
  417. package/dist/room-context.js +87 -0
  418. package/dist/styles/activity-chart.css +127 -0
  419. package/dist/styles/attachments.css +29 -0
  420. package/dist/styles/favicon.css +73 -0
  421. package/dist/styles/history-room.css +18 -0
  422. package/dist/styles/host-inputs.css +250 -0
  423. package/dist/styles/image-gallery.css +30 -0
  424. package/dist/styles/ingest.css +51 -0
  425. package/dist/styles/message-preview.css +34 -0
  426. package/dist/styles/models-chart.css +66 -0
  427. package/dist/styles/project-chart.css +19 -0
  428. package/dist/styles/reader.css +33 -0
  429. package/dist/styles/room.css +1411 -0
  430. package/dist/styles/search.css +252 -0
  431. package/dist/styles/transcript-activity.css +70 -0
  432. package/dist/styles/transcript-head.css +220 -0
  433. package/dist/styles/transcript-loading.css +57 -0
  434. package/dist/styles/transcript.css +1226 -0
  435. package/package.json +61 -4
@@ -0,0 +1,503 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // The document — §03's anatomy, drawn.
3
+ //
4
+ // Primary speech stays visible; adjacent secondary events share one activity
5
+ // fold (§04B), after ownership and team chronology. Blocks retain their
6
+ // sittings (§07), because a sticky pill's containing
7
+ // block is its parent and only a section per sitting makes the next pill push
8
+ // the previous one OUT instead of stacking on it.
9
+ //
10
+ // Everything the shipped column did keeps working here: the live watermark,
11
+ // the focus landing from a search hit, subthreads interleaved by timestamp for
12
+ // a parent-only link and anchored under their own delegate line when the link
13
+ // is proven, and the honest states for a session the daemon has not reached.
14
+ import { Fragment, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
15
+ import { collaborationStamp, linkedChildSessionIds, participantPresentation, runtimeProfile, runSummary, standaloneWorkerSessions, taskBoundedReportWork, teamMemberPresentations, teamChronology, teamParticipants, teamSessionIds, workerThreadLinks, workflowAttemptIndex, workflowAttemptsFor, } from "../../lib/transcript/index.js";
16
+ import { useTeamTimelines } from "../../lib/hooks.js";
17
+ import { useRoom } from "../../room-context.js";
18
+ import { lastActive } from "../../lib/format.js";
19
+ import { sessionLastActive } from "../../lib/session-activity.js";
20
+ import { withinHistoryWindow } from "../../lib/transcript/history-window.js";
21
+ import { EmptyState } from "../ui/index.js";
22
+ import { Anchor } from "./Anchor.js";
23
+ import { DayPill, Sitting } from "./DayPill.js";
24
+ import { transcriptModel } from "./document-model.js";
25
+ import { activityCuts, activityPlan, activityRows } from "./activity-plan.js";
26
+ import { retainReadingIdentity } from "./reading-identity.js";
27
+ import { ActivityGroup, ContextEvent, revealActivityTarget } from "./Activity.js";
28
+ import { messageAttachments } from "../../lib/transcript/images.js";
29
+ import { DisclosureState } from "./disclosure-state.js";
30
+ import { ThreadNavigationContext } from "./thread-navigation.js";
31
+ import { Ledger } from "./Ledger.js";
32
+ import { GapMarker, Marker, Watermark } from "./Marker.js";
33
+ import { Compaction } from "./Compaction.js";
34
+ import { Prompt } from "./Prompt.js";
35
+ import { SegmentActs } from "./Prose.js";
36
+ import { AuthoredMessage } from "./AuthoredMessage.js";
37
+ import { ResponseHead } from "./ResponseHead.js";
38
+ import { Subthread } from "./Subthread.js";
39
+ import { messageDomId, sessionContains } from "./thread-index.js";
40
+ import { ThoughtLine } from "./Thinking.js";
41
+ import { KnownTeamRoster, TeamEvent, TeamWorkthread } from "./Team.js";
42
+ /** Mounted only by an open work disclosure; ordinary team traffic carries no private work. */
43
+ function LazyReportWork({ report, ...props }) {
44
+ const [rows, setRows] = useState(null);
45
+ const [error, setError] = useState(null);
46
+ const { sessions } = useRoom();
47
+ useEffect(() => {
48
+ const controller = new AbortController();
49
+ setRows(null);
50
+ setError(null);
51
+ void sessions.run(report.session_id, (client) => client.reportWork(report.session_id, report.timeline_id, controller.signal)).then((rows) => { if (!controller.signal.aborted)
52
+ setRows(rows); }, (error) => { if (!controller.signal.aborted)
53
+ setError(error instanceof Error ? error.message : "The recorded work is unavailable"); });
54
+ return () => controller.abort();
55
+ }, [report, sessions]);
56
+ if (error !== null)
57
+ return _jsx("p", { className: "tr-quiet", children: error });
58
+ if (rows === null)
59
+ return _jsx("p", { className: "tr-quiet", children: "Loading recorded work\u2026" });
60
+ const work = taskBoundedReportWork(report, rows);
61
+ if (work === null)
62
+ return _jsx("p", { className: "tr-quiet", children: "The recorded work is no longer available." });
63
+ return (_jsxs(_Fragment, { children: [_jsxs("p", { className: "tr-quiet", children: [work.actionCount, " ", work.actionCount === 1 ? "action" : "actions"] }), _jsx(ReportWorkDocument, { ...props, rows: work.rows, startedAt: work.startedAt, endedAt: work.endedAt })] }));
64
+ }
65
+ function staticTimelineFeed(rows) {
66
+ const nothing = () => undefined;
67
+ return {
68
+ rows: [...rows],
69
+ snapshotReady: true,
70
+ error: null,
71
+ retry: nothing,
72
+ timelineMeta: null,
73
+ status: "live",
74
+ watermark: null,
75
+ earlier: { kind: "none" },
76
+ earlierNotice: null,
77
+ earlierAbove: 0,
78
+ landed: null,
79
+ holdEarlier: nothing,
80
+ revealEarlier: nothing,
81
+ retryEarlier: nothing,
82
+ dismissEarlierNotice: nothing,
83
+ canLoadEarlier: false,
84
+ loadEarlier: nothing,
85
+ loadAnchor: async () => false,
86
+ };
87
+ }
88
+ function ReportWorkDocument({ session, rows, name, color, runtime, startedAt, endedAt, index, onReceipt, onOpenAttachment, onOpenPath, getRuntimeKind, homeDirectory, }) {
89
+ const boundedSession = useMemo(() => ({ ...session, stream_state: "indexed" }), [session]);
90
+ const feed = useMemo(() => staticTimelineFeed(rows), [rows]);
91
+ const model = useMemo(() => transcriptModel(rows, boundedSession, homeDirectory, Date.now()), [rows, boundedSession, homeDirectory]);
92
+ const scopedIndex = useMemo(() => {
93
+ const linked = new Set(rows.flatMap((row) => linkedChildSessionIds(row)));
94
+ const childrenByParent = new Map(index.childrenByParent);
95
+ childrenByParent.set(session.id, (index.childrenByParent.get(session.id) ?? []).filter((child) => linked.has(child.id)));
96
+ return { byId: index.byId, childrenByParent };
97
+ }, [rows, session.id, index]);
98
+ return (_jsx(TeamWorkthread, { name: name, color: color, runtime: runtime, startedAt: startedAt, endedAt: endedAt, children: _jsx(TranscriptDocument, { session: boundedSession, model: model, feed: feed, duringBackfill: false, index: scopedIndex, focus: null, highlightedTimelineId: null, onFocusConsumed: () => undefined, onReceipt: onReceipt, onOpenAttachment: onOpenAttachment, onOpenPath: onOpenPath, getRuntimeKind: getRuntimeKind, homeDirectory: homeDirectory, onPillPress: null, nested: true }) }));
99
+ }
100
+ export function TranscriptDocument({ session, model: baseModel, feed, duringBackfill, index, focus, highlightedTimelineId: parentHighlightedTimelineId, onFocusConsumed, onReceipt, onOpenAttachment, onOpenPath, getRuntimeKind, homeDirectory, onPillPress, head, nested = false, onTimelineLayout, }) {
101
+ const { sessions } = useRoom();
102
+ const navigation = useContext(ThreadNavigationContext);
103
+ const childNavigation = useMemo(() => ({ ...navigation, depth: navigation.depth + 1 }), [navigation]);
104
+ const runtimeKind = getRuntimeKind(session.runtime_id);
105
+ // Stream state describes indexing. Only newly arriving conversation rows
106
+ // can receive an activity accent, and it expires with recorded activity.
107
+ const recentActivity = !duringBackfill &&
108
+ lastActive(sessionLastActive(session), Date.now()) === "now";
109
+ const directChildren = index.childrenByParent.get(session.id) ?? [];
110
+ const teamIds = useMemo(() => teamSessionIds(session.id, directChildren, feed.rows), [session.id, directChildren, feed.rows]);
111
+ const teamIdSet = useMemo(() => new Set(teamIds), [teamIds]);
112
+ const teamFeed = useTeamTimelines(sessions, teamIds);
113
+ const hasEarlier = !feed.snapshotReady || feed.earlier.kind !== "none";
114
+ const chronology = useMemo(() => teamChronology(feed.rows, teamFeed.rowsBySession, { hasEarlier, ready: feed.snapshotReady }), [feed.rows, teamFeed.rowsBySession, hasEarlier, feed.snapshotReady]);
115
+ const displayedRows = chronology.rows;
116
+ const cuts = useMemo(() => activityCuts(feed.rows, feed.watermark, displayedRows), [feed.rows, feed.watermark, displayedRows]);
117
+ const model = useMemo(() => {
118
+ const derived = displayedRows === feed.rows
119
+ ? baseModel
120
+ : transcriptModel(displayedRows, session, homeDirectory, Date.now(), {
121
+ sharedCollaborationSessionIds: teamIdSet,
122
+ cutBefore: cuts.cutBefore,
123
+ });
124
+ if (chronology.duplicateRepresentatives.size === 0)
125
+ return { ...derived, gaps: cuts.gaps };
126
+ return {
127
+ ...derived,
128
+ gaps: cuts.gaps,
129
+ representatives: new Map([
130
+ ...derived.representatives,
131
+ ...chronology.duplicateRepresentatives,
132
+ ]),
133
+ };
134
+ }, [
135
+ displayedRows,
136
+ feed.rows,
137
+ baseModel,
138
+ session,
139
+ homeDirectory,
140
+ teamIdSet,
141
+ chronology.duplicateRepresentatives,
142
+ cuts,
143
+ ]);
144
+ const previousReading = useRef(null);
145
+ const reading = useMemo(() => retainReadingIdentity(previousReading.current?.sessionId === session.id ? previousReading.current.reading : [], activityPlan(model.plan, {
146
+ gaps: cuts.gaps, watermarkId: cuts.watermarkId, partial: !feed.snapshotReady || feed.earlier.kind !== "none",
147
+ })), [session.id, model.plan, cuts, feed.snapshotReady, feed.earlier.kind]);
148
+ useLayoutEffect(() => { previousReading.current = { sessionId: session.id, reading }; }, [session.id, reading]);
149
+ const workflowAttempts = useMemo(() => workflowAttemptIndex(displayedRows), [displayedRows]);
150
+ const teamMembers = useMemo(() => teamMemberPresentations(feed.rows, index.byId, teamFeed.rowsBySession, teamFeed.responseRuntimesBySession, feed.snapshotReady && feed.earlier.kind === "none"), [
151
+ feed.rows,
152
+ feed.snapshotReady,
153
+ feed.earlier.kind,
154
+ index.byId,
155
+ teamFeed.rowsBySession,
156
+ teamFeed.responseRuntimesBySession,
157
+ ]);
158
+ const knownTeamSessions = useMemo(() => directChildren.filter((child) => teamIdSet.has(child.id)), [directChildren, teamIdSet]);
159
+ const participants = useMemo(() => teamParticipants(teamMembers, knownTeamSessions, teamFeed.rowsBySession, teamFeed.responseRuntimesBySession), [
160
+ teamMembers,
161
+ knownTeamSessions,
162
+ teamFeed.rowsBySession,
163
+ teamFeed.responseRuntimesBySession,
164
+ ]);
165
+ const sessionByTimelineId = useMemo(() => new Map(displayedRows.map((row) => [row.timeline_id, row.session_id])), [displayedRows]);
166
+ const focusTimelineId = focus !== null && (focus.sessionId === session.id || teamIdSet.has(focus.sessionId))
167
+ ? (chronology.duplicateRepresentatives.get(focus.timelineId) ?? focus.timelineId)
168
+ : null;
169
+ const domIdOf = (timelineId) => messageDomId(sessionByTimelineId.get(timelineId) ?? session.id, timelineId);
170
+ useLayoutEffect(() => {
171
+ onTimelineLayout?.({
172
+ sessionId: session.id,
173
+ rows: displayedRows,
174
+ observedRows: [...feed.rows, ...[...teamFeed.rowsBySession.values()].flat()],
175
+ ready: feed.snapshotReady && (feed.rows[0]?.session_id ?? session.id) === session.id,
176
+ initialReady: teamFeed.historyReady || teamFeed.historyError !== null,
177
+ readySessionIds: [session.id, ...(teamFeed.historyReady ? teamIds : [])],
178
+ elementForRow: (row) => document.getElementById(messageDomId(row.session_id, row.timeline_id)),
179
+ elementForAnchor: (timelineId) => {
180
+ const representative = model.representatives.get(timelineId) ?? timelineId;
181
+ return document.getElementById(messageDomId(sessionByTimelineId.get(representative) ?? session.id, representative));
182
+ },
183
+ });
184
+ }, [onTimelineLayout, session.id, displayedRows, feed.snapshotReady, feed.rows, teamFeed.historyReady, teamFeed.historyError, teamFeed.rowsBySession, teamIds, model.representatives, sessionByTimelineId]);
185
+ const teamFocus = focus !== null && teamIdSet.has(focus.sessionId) ? focus : null;
186
+ const [teamHighlight, setTeamHighlight] = useState(null);
187
+ const teamFocusRequest = useRef(null);
188
+ const highlightedTimelineId = teamHighlight ?? parentHighlightedTimelineId;
189
+ useEffect(() => {
190
+ if (focus === null || focus.sessionId !== session.id)
191
+ return;
192
+ const drawnBy = chronology.duplicateRepresentatives.get(focus.timelineId);
193
+ if (drawnBy === undefined)
194
+ return;
195
+ const element = document.getElementById(messageDomId(sessionByTimelineId.get(drawnBy) ?? session.id, drawnBy));
196
+ if (element === null)
197
+ return;
198
+ revealActivityTarget(element);
199
+ setTeamHighlight(drawnBy);
200
+ onFocusConsumed();
201
+ window.setTimeout(() => setTeamHighlight(null), 1500);
202
+ }, [
203
+ focus,
204
+ session.id,
205
+ chronology.duplicateRepresentatives,
206
+ sessionByTimelineId,
207
+ onFocusConsumed,
208
+ ]);
209
+ useEffect(() => {
210
+ if (teamFocus === null) {
211
+ teamFocusRequest.current = null;
212
+ return;
213
+ }
214
+ const drawnBy = model.representatives.get(teamFocus.timelineId) ?? null;
215
+ if (drawnBy !== null) {
216
+ const element = document.getElementById(messageDomId(sessionByTimelineId.get(drawnBy) ?? session.id, drawnBy));
217
+ if (element !== null) {
218
+ revealActivityTarget(element);
219
+ setTeamHighlight(drawnBy);
220
+ onFocusConsumed();
221
+ window.setTimeout(() => setTeamHighlight(null), 1500);
222
+ }
223
+ return;
224
+ }
225
+ const source = teamFeed.rowsBySession
226
+ .get(teamFocus.sessionId)
227
+ ?.find((row) => row.timeline_id === teamFocus.timelineId);
228
+ if (source?.body.type === "collaboration" && source.body.event.channel === "coordinator" &&
229
+ source.body.event.kind === "assignment") {
230
+ onFocusConsumed();
231
+ onReceipt("That message is private team context, not shared team chronology");
232
+ return;
233
+ }
234
+ // A known delivery outside the current parent window needs its surrounding
235
+ // conversation. Never draw a floating, apparently complete history island.
236
+ if (!feed.snapshotReady)
237
+ return;
238
+ if (!teamFeed.historyReady) {
239
+ if (teamFeed.historyError !== null) {
240
+ onFocusConsumed();
241
+ onReceipt("Could not load that team message. Retry the team history in the conversation.");
242
+ }
243
+ return;
244
+ }
245
+ if (source !== undefined && feed.earlier.kind !== "none") {
246
+ if (feed.earlier.kind === "idle" || feed.earlier.kind === "held")
247
+ feed.loadEarlier();
248
+ if (feed.earlier.kind === "failed" && teamFocusRequest.current !== teamFocus.timelineId) {
249
+ teamFocusRequest.current = teamFocus.timelineId;
250
+ onReceipt("Could not load the surrounding conversation. Retry loading earlier history.");
251
+ }
252
+ return;
253
+ }
254
+ onFocusConsumed();
255
+ onReceipt("That team message is no longer available");
256
+ }, [
257
+ teamFocus,
258
+ teamFeed.historyReady,
259
+ teamFeed.historyError,
260
+ teamFeed.rowsBySession,
261
+ feed,
262
+ model,
263
+ onFocusConsumed,
264
+ onReceipt,
265
+ session.id,
266
+ sessionByTimelineId,
267
+ ]);
268
+ // Children this document owns. A proven `child_session_id` anchors an
269
+ // ordinary Agent worker under its earliest line. Team members are consumed
270
+ // above as roster + shared chronology and must never open duplicate threads.
271
+ const workerChildren = directChildren.filter((child) => !teamIdSet.has(child.id));
272
+ const ledgerLines = useMemo(() => model.turns.flatMap((turn) => turn.segments.flatMap((segment) => (segment.kind === "ledger" ? segment.lines : []))), [model]);
273
+ const workerLinks = useMemo(() => workerThreadLinks(ledgerLines, session.id, index.byId, teamIdSet), [ledgerLines, session.id, index.byId, teamIdSet]);
274
+ // Protocol-v14 daemons built before workflow child references were added
275
+ // omit `child_session_ids`. Resolve their lightweight workflow anchors once
276
+ // so a rolling client upgrade remains exact instead of guessing from a
277
+ // worker's arbitrary agent type/title. New daemons never take this path.
278
+ const legacyWorkflowRows = useMemo(() => (feed.timelineMeta?.workflows ?? [])
279
+ .filter((workflow) => workflow.child_session_ids === undefined)
280
+ .map((workflow) => ({ id: workflow.id, timelineId: workflow.timeline_id })), [feed.timelineMeta]);
281
+ const legacyWorkflowKey = `${session.id}\u0002${legacyWorkflowRows
282
+ .map((workflow) => `${workflow.id}\u0000${workflow.timelineId ?? ""}`)
283
+ .join("\u0001")}`;
284
+ const [legacyWorkflowIndex, setLegacyWorkflowIndex] = useState(null);
285
+ useEffect(() => {
286
+ if (legacyWorkflowRows.length === 0) {
287
+ setLegacyWorkflowIndex(null);
288
+ return;
289
+ }
290
+ let current = true;
291
+ const anchors = legacyWorkflowRows.flatMap((workflow) => workflow.timelineId === null ? [] : [workflow.timelineId]);
292
+ void Promise.allSettled(anchors.map(async (timelineId) => {
293
+ const row = await sessions.run(session.id, (client) => client.timelineEntry(session.id, timelineId));
294
+ return linkedChildSessionIds(row);
295
+ })).then((results) => {
296
+ if (!current)
297
+ return;
298
+ const ids = new Set(results.flatMap((result) => result.status === "fulfilled" ? result.value : []));
299
+ setLegacyWorkflowIndex({
300
+ key: legacyWorkflowKey,
301
+ ids,
302
+ complete: anchors.length === legacyWorkflowRows.length
303
+ && results.every((result) => result.status === "fulfilled"),
304
+ });
305
+ });
306
+ return () => {
307
+ current = false;
308
+ };
309
+ }, [legacyWorkflowKey, session.id, sessions]);
310
+ const indexedWorkflowChildren = useMemo(() => {
311
+ const ids = new Set((feed.timelineMeta?.workflows ?? []).flatMap((workflow) => workflow.child_session_ids ?? []));
312
+ const legacyReady = feed.timelineMeta !== null
313
+ && (legacyWorkflowRows.length === 0
314
+ || (legacyWorkflowIndex?.key === legacyWorkflowKey && legacyWorkflowIndex.complete));
315
+ if (legacyWorkflowIndex?.key === legacyWorkflowKey) {
316
+ for (const id of legacyWorkflowIndex.ids)
317
+ ids.add(id);
318
+ }
319
+ if (!legacyReady) {
320
+ // Until every old-daemon anchor answers, fail closed only for children
321
+ // whose sidecar proves delegation but supplies no ordinary Agent tool
322
+ // owner. Exact ordinary workers and parent-only children still render.
323
+ for (const child of workerChildren) {
324
+ if (child.delegation !== null
325
+ && child.delegation.parent_tool_native_id == null)
326
+ ids.add(child.id);
327
+ }
328
+ }
329
+ return ids;
330
+ }, [
331
+ feed.timelineMeta,
332
+ legacyWorkflowIndex,
333
+ legacyWorkflowKey,
334
+ legacyWorkflowRows.length,
335
+ workerChildren,
336
+ ]);
337
+ const floating = standaloneWorkerSessions(workerChildren, workerLinks, indexedWorkflowChildren).filter(child => feed.snapshotReady &&
338
+ (!hasEarlier || child.delegation?.parent_tool_native_id == null) &&
339
+ withinHistoryWindow(child.activity?.first_at ?? child.started_at, feed.rows, hasEarlier));
340
+ useEffect(() => {
341
+ if (focus === null || !hasEarlier || !feed.snapshotReady)
342
+ return;
343
+ const child = workerChildren.find(child => sessionContains(child.id, focus.sessionId, index.byId));
344
+ if (child === undefined || workerLinks.anchorRowByChild.has(child.id) || floating.some(row => row.id === child.id))
345
+ return;
346
+ if (feed.earlier.kind === "idle" || feed.earlier.kind === "held")
347
+ feed.loadEarlier();
348
+ }, [focus, hasEarlier, feed, workerChildren, workerLinks, floating, index.byId]);
349
+ const [revealedWorker, setRevealedWorker] = useState(null);
350
+ const revealRequest = useRef(0);
351
+ const revealLinkedWorker = (childId) => {
352
+ const anchorTimelineId = workerLinks.anchorRowByChild.get(childId);
353
+ if (anchorTimelineId === undefined)
354
+ return;
355
+ revealRequest.current += 1;
356
+ setRevealedWorker({ childId, anchorTimelineId, request: revealRequest.current });
357
+ };
358
+ useEffect(() => {
359
+ if (revealedWorker === null)
360
+ return;
361
+ const frame = window.requestAnimationFrame(() => {
362
+ const element = document.getElementById(messageDomId(session.id, revealedWorker.anchorTimelineId));
363
+ if (element !== null)
364
+ revealActivityTarget(element);
365
+ });
366
+ return () => window.cancelAnimationFrame(frame);
367
+ }, [revealedWorker, session.id]);
368
+ const renderChild = (child, anchored) => (_jsx(Subthread, { session: child, anchored: anchored, duringBackfill: duringBackfill, index: index, focus: focus, onFocusConsumed: onFocusConsumed, onReceipt: onReceipt, onOpenAttachment: onOpenAttachment, onOpenPath: onOpenPath, getRuntimeKind: getRuntimeKind, homeDirectory: homeDirectory }, child.id));
369
+ const reportWorkFor = (row) => {
370
+ if (row.body.type !== "collaboration")
371
+ return null;
372
+ const event = row.body.event;
373
+ if (event.kind !== "report" || event.source_session_id === null || event.source_response_id === null
374
+ || event.work_start_timeline_id === null || event.work_end_timeline_id === null)
375
+ return null;
376
+ const memberSession = index.byId.get(event.source_session_id);
377
+ if (memberSession === undefined || !teamIdSet.has(memberSession.id))
378
+ return null;
379
+ const participant = participantPresentation(participants, event.sender, event.team);
380
+ return {
381
+ actionCount: null,
382
+ startedAt: null,
383
+ endedAt: null,
384
+ content: _jsx(LazyReportWork, { report: row, session: memberSession, name: event.sender, color: event.color ?? participant?.color ?? null, runtime: participant?.runtime ?? runtimeProfile([], memberSession.delegation?.configured_model ?? null, teamFeed.responseRuntimesBySession.get(memberSession.id) ?? []), index: index, onReceipt: onReceipt, onOpenAttachment: onOpenAttachment, onOpenPath: onOpenPath, getRuntimeKind: getRuntimeKind, homeDirectory: homeDirectory }, `${row.session_id}:${row.timeline_id}`),
385
+ };
386
+ };
387
+ const renderSegment = (segment, embedded = false) => {
388
+ const rowId = segment.kind === "ledger" ? segment.rows[0].timeline_id : segment.row.timeline_id;
389
+ const hit = highlightedTimelineId === rowId;
390
+ switch (segment.kind) {
391
+ case "ledger":
392
+ return (_jsx(Ledger, { embedded: embedded, members: segment.members, summary: segment.summary, anchor: !embedded && segment.summary.closedByDefault ? (_jsx(Anchor, { at: segment.at, sessionId: segment.rows[0].session_id, timelineId: rowId, onReceipt: onReceipt })) : null, domIdOf: domIdOf, highlightedTimelineId: highlightedTimelineId, focusTimelineId: focusTimelineId, alive: (line) => recentActivity &&
393
+ line.rows[0].session_id === session.id &&
394
+ feed.watermark !== null && line.rows[0].ordinal > feed.watermark, hasChildren: (line) => (workerLinks.childrenByRow.get(line.rows[0].timeline_id) ?? []).length > 0, childFocused: (line) => (focus !== null &&
395
+ (workerLinks.childrenByRow.get(line.rows[0].timeline_id) ?? []).some((child) => sessionContains(child.id, focus.sessionId, index.byId))) ||
396
+ (revealedWorker !== null &&
397
+ (workerLinks.childrenByRow.get(line.rows[0].timeline_id) ?? []).some((child) => child.id === revealedWorker.childId)), subthreadsFor: (line) => (workerLinks.childrenByRow.get(line.rows[0].timeline_id) ?? []).map((child) => ({ childSessionId: child.id, node: renderChild(child, true) })), workflowAttemptsFor: (line) => workflowAttemptsFor(workflowAttempts, line.rows[0]), linkedChildId: (line) => workerLinks.referencedChildIdsByRow.get(line.rows[0].timeline_id)?.[0] ?? null, onOpenLinkedChild: revealLinkedWorker, teamMemberFor: (line) => line.rows
398
+ .map((row) => teamMembers.get(row.timeline_id) ?? null)
399
+ .find((member) => member !== null) ?? null, onOpenPath: onOpenPath, onOpenAttachment: onOpenAttachment }, segment.key));
400
+ case "thinking":
401
+ // A thought alone is a run of one, drawn as its line (Q10 A).
402
+ return (_jsx(ThoughtLine, { text: segment.text, embedded: embedded, spanMs: segment.spanMs, domId: domIdOf(rowId), timelineId: rowId, hit: hit, forceOpen: focusTimelineId === rowId, anchor: _jsx(Anchor, { at: segment.at, sessionId: segment.row.session_id, timelineId: rowId, onReceipt: onReceipt }) }, segment.key));
403
+ case "marker":
404
+ if (segment.notice.type === "permission_requested")
405
+ return _jsx(Marker, { text: segment.text, tone: segment.tone, domId: domIdOf(rowId), timelineId: rowId, hit: hit }, segment.key);
406
+ return _jsx(ContextEvent, { segment: segment, domId: domIdOf(rowId), hit: hit, forceOpen: focusTimelineId === rowId, onReceipt: onReceipt }, segment.key);
407
+ case "summary":
408
+ return _jsx(ContextEvent, { segment: segment, domId: domIdOf(rowId), hit: hit, forceOpen: focusTimelineId === rowId, onReceipt: onReceipt }, segment.key);
409
+ case "compaction":
410
+ return (_jsx(Compaction, { text: segment.text, domId: domIdOf(rowId), timelineId: rowId, hit: segment.rows.some((row) => row.timeline_id === highlightedTimelineId), forceOpen: segment.rows.some((row) => row.timeline_id === focusTimelineId), onReceipt: onReceipt }, segment.key));
411
+ case "prose":
412
+ return (_jsxs("div", { className: "tr-seg tr-prose ah-syntax", id: domIdOf(rowId), "data-timeline-id": rowId, "data-hit": hit || undefined, children: [_jsx(Anchor, { at: segment.at, sessionId: segment.row.session_id, timelineId: rowId, onReceipt: onReceipt }), _jsx(AuthoredMessage, { text: segment.text, attachments: segment.attachments, recordedText: segment.row.body.type === "agent" ? segment.row.body.text : null, messageKey: `${segment.row.session_id}:${rowId}`, role: "agent", onReceipt: onReceipt, onOpenAttachment: onOpenAttachment }), segment.citationLabels.length > 0 && (_jsx("p", { className: "tr-cites", children: segment.citationLabels.map((label, at) => (_jsx("span", { children: label }, at))) })), _jsx(SegmentActs, { text: segment.text ?? "", onReceipt: onReceipt })] }, segment.key));
413
+ case "collaboration": {
414
+ const sourceMember = teamIdSet.has(segment.row.session_id)
415
+ ? index.byId.get(segment.row.session_id)
416
+ : undefined;
417
+ const inferredRecipient = segment.event.channel === "coordinator" && segment.event.recipient === null
418
+ ? (sourceMember?.title ?? sourceMember?.native_session_id ?? null)
419
+ : segment.event.recipient;
420
+ const event = inferredRecipient === segment.event.recipient
421
+ ? segment.event
422
+ : { ...segment.event, recipient: inferredRecipient };
423
+ const participant = participantPresentation(participants, event.sender, event.team);
424
+ const recipientParticipant = participantPresentation(participants, event.recipient, event.team);
425
+ const stamp = collaborationStamp(segment.row);
426
+ return (_jsx(TeamEvent, { event: event, attachments: messageAttachments(segment.row), onOpenAttachment: onOpenAttachment, at: stamp.at, timeBasis: stamp.basis, domId: domIdOf(rowId), timelineId: rowId, participant: participant, recipientParticipant: recipientParticipant, hit: hit, forceOpen: focusTimelineId === rowId, reportWork: reportWorkFor(segment.row), onReceipt: onReceipt }, segment.key));
427
+ }
428
+ }
429
+ };
430
+ const showPills = model.sittings.length > 1;
431
+ let floatingAt = 0;
432
+ const drainFloating = (until) => {
433
+ const out = [];
434
+ while (floatingAt < floating.length &&
435
+ (until === null || floating[floatingAt].started_at <= until)) {
436
+ out.push(renderChild(floating[floatingAt], false));
437
+ floatingAt += 1;
438
+ }
439
+ return out;
440
+ };
441
+ const renderTools = (items, embedded) => {
442
+ const lines = items.map(item => item.line);
443
+ const rows = lines.flatMap(line => line.rows);
444
+ return renderSegment({ kind: "ledger", key: items[0].key, at: rows[0].at, rows, lines,
445
+ members: lines.map(line => ({ kind: "line", key: line.key, line })), summary: runSummary(lines) }, embedded);
446
+ };
447
+ const renderItem = (item) => {
448
+ if (item.kind === "tool")
449
+ return renderTools([item], false);
450
+ if (item.kind !== "prompt")
451
+ return renderSegment(item, true);
452
+ const row = item.prompt.row;
453
+ if (row.body.type === "collaboration")
454
+ return renderSegment({ kind: "collaboration", key: item.key,
455
+ row, at: row.at, event: row.body.event }, true);
456
+ return _jsx(Prompt, { prompts: [item.prompt], domIdOf: domIdOf, landedTimelineId: highlightedTimelineId, focusTimelineId: focusTimelineId, onReceipt: onReceipt, onOpenAttachment: onOpenAttachment }, item.key);
457
+ };
458
+ const renderItems = (items) => {
459
+ const nodes = [];
460
+ let tools = [];
461
+ const flush = () => { if (tools.length > 0)
462
+ nodes.push(renderTools(tools, true)); tools = []; };
463
+ for (const item of items) {
464
+ if (item.kind === "tool")
465
+ tools.push(item);
466
+ else {
467
+ flush();
468
+ nodes.push(renderItem(item));
469
+ }
470
+ }
471
+ flush();
472
+ return nodes;
473
+ };
474
+ const childIsFocused = (item) => item.kind === "tool" &&
475
+ (workerLinks.childrenByRow.get(item.line.rows[0].timeline_id) ?? []).some(child => (focus !== null && sessionContains(child.id, focus.sessionId, index.byId)) || child.id === revealedWorker?.childId);
476
+ const renderBlock = (block) => {
477
+ switch (block.kind) {
478
+ case "gap": return _jsx(GapMarker, { count: block.count, onPress: () => onReceipt(`${block.count} ${block.count === 1 ? "message is" : "messages are"} in the session but not in this page`) });
479
+ case "watermark": return _jsx(Watermark, { text: "received since opening" });
480
+ case "prompt": return _jsx("div", { className: "tr-turn tr-reading-prompt", children: _jsx(Prompt, { prompts: block.prompts, domIdOf: domIdOf, landedTimelineId: highlightedTimelineId, onReceipt: onReceipt, onOpenAttachment: onOpenAttachment }) });
481
+ case "reply": return _jsxs("div", { className: block.head === null ? "tr-reading-reply" : "tr-resp tr-reading-reply", children: [block.head !== null && _jsx(ResponseHead, { head: block.head, runtimeKind: runtimeKind, open: recentActivity && block.head.endedAt === null }), renderSegment(block.segment)] });
482
+ case "request": return renderItem(block.item);
483
+ case "activity": {
484
+ const hit = highlightedTimelineId !== null && block.rows.some(row => row.timeline_id === highlightedTimelineId)
485
+ ? highlightedTimelineId : null;
486
+ const forceOpen = block.items.some(item => childIsFocused(item) ||
487
+ activityRows(item).some(row => row.timeline_id === focusTimelineId));
488
+ return _jsx(ActivityGroup, { items: block.items, rows: block.rows, partial: block.partial, forceOpen: forceOpen, earlier: feed.earlier, onLoadEarlier: feed.loadEarlier, teamLoading: !teamFeed.historyReady, teamError: teamFeed.historyError, onRetryTeam: teamFeed.retry, onOpenAttachment: onOpenAttachment, onReceipt: onReceipt, highlightedId: hit, alive: row => recentActivity && row.session_id === session.id &&
489
+ feed.watermark !== null && row.ordinal > feed.watermark, children: renderItems(block.items) });
490
+ }
491
+ }
492
+ };
493
+ const partialParentHistory = !feed.snapshotReady || feed.earlier.kind !== "none";
494
+ const hasSafeRosterLine = [...teamMembers.values()].some((member) => member.operation === "known");
495
+ const showKnownTeam = knownTeamSessions.length > 0 &&
496
+ (teamMembers.size === 0 || (partialParentHistory && !hasSafeRosterLine));
497
+ const empty = model.plan.length === 0 && floating.length === 0 && !showKnownTeam;
498
+ return (_jsx(ThreadNavigationContext.Provider, { value: childNavigation, children: _jsxs(DisclosureState, { children: [head, showKnownTeam && (_jsx(KnownTeamRoster, { sessions: knownTeamSessions, rowsBySession: teamFeed.rowsBySession, responseRuntimesBySession: teamFeed.responseRuntimesBySession, historyReady: teamFeed.historyReady, historyError: teamFeed.historyError, onRetry: teamFeed.retry })), reading.map(({ sitting, blocks, renderKey }) => (_jsxs(Sitting, { sitting: sitting, children: [showPills && (_jsx(DayPill, { sitting: sitting, onPress: (event) => onPillPress?.(event.currentTarget, sitting.dayKey) })), blocks.map(block => _jsxs(Fragment, { children: [drainFloating(block.at), renderBlock(block)] }, block.key))] }, renderKey ?? sitting.key))), drainFloating(null), empty &&
499
+ feed.snapshotReady &&
500
+ (nested ? (_jsx("p", { className: "tr-quiet", children: session.stream_state === "indexed"
501
+ ? "No readable messages in this subthread."
502
+ : "This subthread has not been indexed yet." })) : session.stream_state !== "indexed" ? (_jsx(EmptyState, { title: duringBackfill ? "Indexing history" : "History not yet available", description: "No readable messages have been indexed for this session yet.", children: duringBackfill && _jsx("div", { className: "ah-meter", children: _jsx("i", { style: { width: "8%" } }) }) })) : (_jsx(EmptyState, { title: "Nothing readable yet", description: "This session has no readable timeline rows in the index." }))), session.stream_state === "streaming" && (_jsx("div", { className: "tr-mark", title: "Some source records have not been fully indexed", children: duringBackfill ? "indexing history" : "history incomplete" }))] }, session.id) }));
503
+ }
@@ -0,0 +1,32 @@
1
+ import "../../styles/favicon.css";
2
+ export interface FaviconProps {
3
+ /** The site, e.g. `developer.mozilla.org`. Null draws the globe, which is
4
+ * what a source with no parseable url honestly is. */
5
+ readonly host: string | null;
6
+ /** Pixels. 14 is the record's size and the only one the room uses today. */
7
+ readonly size?: number;
8
+ }
9
+ /**
10
+ * One site's icon: its own, in colour, on a hairline ring — or the globe.
11
+ *
12
+ * The globe covers four different facts that are one fact to a reader: the
13
+ * setting is off, the shell refused the host, the site has no icon, or this
14
+ * is a browser tab with no shell to ask. None of them is an error worth a
15
+ * reader's attention, so none of them says so.
16
+ */
17
+ export declare function Favicon({ host, size }: FaviconProps): import("react").JSX.Element;
18
+ export interface FaviconStackProps {
19
+ /** The sources' hosts, in the order the search returned them. */
20
+ readonly hosts: readonly (string | null)[];
21
+ /** How many to draw. Three is the record's stack. */
22
+ readonly max?: number;
23
+ }
24
+ /**
25
+ * The first few sites of a search, overlapping, at a line's right edge.
26
+ *
27
+ * It is a summary, not a list: the count beside it is what says how many
28
+ * there were, and the stack says what kind of places they were. Duplicate
29
+ * hosts collapse — five MDN pages are one site, and five identical icons
30
+ * would claim otherwise.
31
+ */
32
+ export declare function FaviconStack({ hosts, max }: FaviconStackProps): import("react").JSX.Element | null;
@@ -0,0 +1,71 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // A web line's site icon, and the stack of them at a line's edge.
3
+ //
4
+ // The design record's rule, in one sentence: the icon is content, so it keeps
5
+ // its colour — and it lives in the source list and in a small stack at the
6
+ // line's right, never in the glyph slot, which stays monoline. A site whose
7
+ // icon was not fetched wears the globe.
8
+ //
9
+ // Everything upstream of drawing lives in `lib/transcript/favicons.ts`: the
10
+ // setting, the shared per-host map, and the ask that the Electron shell
11
+ // answers. This file only decides what a result LOOKS like.
12
+ import { useState } from "react";
13
+ import { useFavicon } from "../../lib/transcript/favicons.js";
14
+ import "../../styles/favicon.css";
15
+ /** The globe, on this room's 16-unit grid at stroke 1.5 — the same drawing
16
+ * the design record used for a web line, which is deliberate: the fallback
17
+ * for "no icon" is the glyph the line already wears.
18
+ *
19
+ * It lives here rather than in `lib/icons.tsx` only because that file is
20
+ * being edited elsewhere this session; it belongs there. */
21
+ function GlobeGlyph() {
22
+ return (_jsxs("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", "aria-hidden": "true", children: [_jsx("circle", { cx: "8", cy: "8", r: "5.5" }), _jsx("path", { d: "M2.5 8h11M8 2.5c2.2 2.2 2.2 8.8 0 11M8 2.5c-2.2 2.2-2.2 8.8 0 11" })] }));
23
+ }
24
+ /**
25
+ * One site's icon: its own, in colour, on a hairline ring — or the globe.
26
+ *
27
+ * The globe covers four different facts that are one fact to a reader: the
28
+ * setting is off, the shell refused the host, the site has no icon, or this
29
+ * is a browser tab with no shell to ask. None of them is an error worth a
30
+ * reader's attention, so none of them says so.
31
+ */
32
+ export function Favicon({ host, size = 14 }) {
33
+ const { src, state } = useFavicon(host);
34
+ const [failedSrc, setFailedSrc] = useState(null);
35
+ // The host is the label because it is the fact the icon stands for; the
36
+ // title beside it in a source list is the same information twice.
37
+ const label = host ?? "unknown site";
38
+ // A custom property, so one rule sizes the plate, the ring and the image
39
+ // together; the default lives in the stylesheet rather than here.
40
+ const style = size === 14 ? undefined : { "--tr-fav-size": `${size}px` };
41
+ if (state === "ready" && src !== null && src !== failedSrc) {
42
+ return (_jsx("span", { className: "tr-fav", style: style, title: label, children: _jsx("img", { src: src, alt: "", loading: "lazy", decoding: "async", draggable: false, onError: () => setFailedSrc(src) }) }));
43
+ }
44
+ if (state === "loading") {
45
+ return _jsx("span", { className: "tr-fav tr-fav--loading", style: style, "aria-hidden": "true" });
46
+ }
47
+ return (_jsx("span", { className: "tr-fav tr-fav--globe", style: style, title: label, children: _jsx(GlobeGlyph, {}) }));
48
+ }
49
+ /**
50
+ * The first few sites of a search, overlapping, at a line's right edge.
51
+ *
52
+ * It is a summary, not a list: the count beside it is what says how many
53
+ * there were, and the stack says what kind of places they were. Duplicate
54
+ * hosts collapse — five MDN pages are one site, and five identical icons
55
+ * would claim otherwise.
56
+ */
57
+ export function FaviconStack({ hosts, max = 3 }) {
58
+ if (max <= 0)
59
+ return null;
60
+ const seen = [];
61
+ for (const host of hosts) {
62
+ if (host !== null && seen.includes(host))
63
+ continue;
64
+ seen.push(host);
65
+ if (seen.length === max)
66
+ break;
67
+ }
68
+ if (seen.length === 0)
69
+ return null;
70
+ return (_jsx("span", { className: "tr-favs", children: seen.map((host, index) => (_jsx(Favicon, { host: host }, host ?? `unknown-${index}`))) }));
71
+ }
@@ -0,0 +1,19 @@
1
+ import type { TimelineFeed } from "../../lib/hooks.js";
2
+ import "../../styles/transcript-head.css";
3
+ /** `Mon 31 Aug · 23:18:12` — the session's first second, said as a fact.
4
+ * Absolute, never "Today": the start of a session is a date, not a distance. */
5
+ export declare function sessionStartLabel(startedAt: number | null): string | null;
6
+ /** The top fade — one sticky, zero-height element at the head of the scroller
7
+ * whose pseudo-element paints the gradient. Mount it as the FIRST child of
8
+ * `.ah-scroll`; `useHeadOfDocument` writes `--frost` onto the scroller. */
9
+ export declare function TopFade(): import("react").JSX.Element;
10
+ export interface HeadOfDocumentProps {
11
+ readonly feed: TimelineFeed;
12
+ /** The accumulator, 0..1, from `useHeadOfDocument`. */
13
+ readonly pull: number;
14
+ /** First recorded conversation activity, for the session-start line. */
15
+ readonly startedAt: number | null;
16
+ /** The clock an anchor search is paging toward, while one runs. */
17
+ readonly finding?: string | null;
18
+ }
19
+ export declare function HeadOfDocument({ feed, pull, startedAt, finding }: HeadOfDocumentProps): import("react").JSX.Element;