@vibefield/rosetta-room 0.0.0-stage → 0.1.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 (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,145 @@
1
+ function firstStampOf(prompts, segments) {
2
+ for (const prompt of prompts)
3
+ if (prompt.at !== null)
4
+ return prompt.at;
5
+ for (const segment of segments) {
6
+ for (const row of segmentRows(segment))
7
+ if (row.at !== null)
8
+ return row.at;
9
+ }
10
+ return null;
11
+ }
12
+ function firstRowIdOf(prompts, segments) {
13
+ const prompt = prompts[0];
14
+ if (prompt !== undefined)
15
+ return prompt.row.timeline_id;
16
+ const segment = segments[0];
17
+ if (segment === undefined)
18
+ return null;
19
+ return segment.kind === "ledger" ? (segment.rows[0]?.timeline_id ?? null) : segment.row.timeline_id;
20
+ }
21
+ function segmentRows(segment) {
22
+ return segment.kind === "ledger" || segment.kind === "compaction" ? segment.rows : [segment.row];
23
+ }
24
+ /** A turn's own first row, for the sitting it belongs to. */
25
+ function turnSitting(turn, indexOf) {
26
+ if (turn.prompt !== null)
27
+ return indexOf(turn.prompt.row);
28
+ const first = turn.segments[0];
29
+ return first === undefined ? 0 : indexOf(segmentRows(first)[0]);
30
+ }
31
+ /** Adjacent setting turns that share one compact configuration group. */
32
+ function clusterGroups(turns, sittingOf) {
33
+ const groups = [];
34
+ for (const turn of turns) {
35
+ const current = groups.at(-1);
36
+ const previous = current?.at(-1);
37
+ const joins = current !== undefined &&
38
+ previous !== undefined &&
39
+ turn.clusteredWithPrevious &&
40
+ turn.prompt !== null &&
41
+ previous.prompt !== null &&
42
+ turn.prompt.setting !== null &&
43
+ previous.prompt.setting !== null &&
44
+ !turn.prompt.fromParent &&
45
+ !previous.prompt.fromParent &&
46
+ previous.segments.length === 0 &&
47
+ sittingOf(previous) === sittingOf(turn);
48
+ if (joins)
49
+ current.push(turn);
50
+ else
51
+ groups.push([turn]);
52
+ }
53
+ return groups;
54
+ }
55
+ /**
56
+ * Fold turns and sittings into the sections the column draws. Sittings that
57
+ * end up with nothing drawable are dropped: a pill over an empty section would
58
+ * be a cut with nothing on the far side of it.
59
+ */
60
+ export function documentPlan(turns, sittings) {
61
+ const indexByRow = new Map();
62
+ sittings.forEach((sitting, index) => {
63
+ for (const row of sitting.rows)
64
+ indexByRow.set(row.timeline_id, index);
65
+ });
66
+ const indexOf = (row) => indexByRow.get(row.timeline_id) ?? 0;
67
+ const sittingOf = (turn) => turnSitting(turn, indexOf);
68
+ const parts = [];
69
+ for (const group of clusterGroups(turns, sittingOf)) {
70
+ // Only the last turn of a cluster can carry an answer, by construction.
71
+ const turn = group[group.length - 1];
72
+ const prompts = group
73
+ .map((member) => member.prompt)
74
+ .filter((prompt) => prompt !== null);
75
+ const openIndex = prompts[0] === undefined ? null : indexOf(prompts[0].row);
76
+ // Cut the segments wherever the sitting changes under them.
77
+ const slices = [];
78
+ turn.segments.forEach((segment, at) => {
79
+ const index = indexOf(segmentRows(segment)[0]);
80
+ const last = slices.at(-1);
81
+ if (last !== undefined && last.index === index)
82
+ last.segments.push(segment);
83
+ else
84
+ slices.push({ index, segments: [segment], from: at });
85
+ });
86
+ const headSlice = turn.head === null ? -1 : slices.findIndex((slice) => turn.headIndex >= slice.from && turn.headIndex < slice.from + slice.segments.length);
87
+ // A head with no segments to sit above still belongs to the reply that
88
+ // reported it; it rides with the prompt rather than disappearing.
89
+ const headOnOpener = turn.head !== null && headSlice === -1;
90
+ if (slices.length === 0) {
91
+ parts.push({
92
+ key: turn.key,
93
+ sittingIndex: openIndex ?? 0,
94
+ turn,
95
+ prompts,
96
+ before: [],
97
+ after: [],
98
+ showHead: turn.head !== null,
99
+ firstRowId: firstRowIdOf(prompts, []),
100
+ at: firstStampOf(prompts, []),
101
+ });
102
+ continue;
103
+ }
104
+ slices.forEach((slice, at) => {
105
+ const opensWithPrompt = at === 0 && openIndex !== null && openIndex === slice.index;
106
+ const slicePrompts = at === 0 && (opensWithPrompt || openIndex === null) ? prompts : [];
107
+ const cut = Math.max(0, Math.min(turn.headIndex - slice.from, slice.segments.length));
108
+ const showHead = at === headSlice || (headOnOpener && at === 0);
109
+ parts.push({
110
+ key: `${turn.key}:${at}`,
111
+ sittingIndex: slice.index,
112
+ turn,
113
+ prompts: slicePrompts,
114
+ before: slice.segments.slice(0, cut),
115
+ after: slice.segments.slice(cut),
116
+ showHead,
117
+ firstRowId: firstRowIdOf(slicePrompts, slice.segments),
118
+ at: firstStampOf(slicePrompts, slice.segments),
119
+ });
120
+ });
121
+ // The prompt fell in an earlier sitting than every segment: it needs its
122
+ // own part so its pill and its panel are not filed under the reply's day.
123
+ if (openIndex !== null && slices[0].index !== openIndex) {
124
+ parts.splice(parts.length - slices.length, 0, {
125
+ key: `${turn.key}:opener`,
126
+ sittingIndex: openIndex,
127
+ turn,
128
+ prompts,
129
+ before: [],
130
+ after: [],
131
+ showHead: false,
132
+ firstRowId: firstRowIdOf(prompts, []),
133
+ at: firstStampOf(prompts, []),
134
+ });
135
+ }
136
+ }
137
+ const planned = sittings.map((sitting) => ({ sitting, parts: [] }));
138
+ for (const part of parts) {
139
+ const target = planned[part.sittingIndex] ?? planned[0];
140
+ if (target === undefined)
141
+ continue;
142
+ target.parts.push(part);
143
+ }
144
+ return planned.filter((entry) => entry.parts.length > 0);
145
+ }
@@ -0,0 +1,17 @@
1
+ import type { KeyValueStore } from "../../lib/room-storage.js";
2
+ export interface FoldState {
3
+ readonly folded: boolean;
4
+ readonly revision: number;
5
+ }
6
+ /** One room's fold: its default, and the act that flips it. */
7
+ export interface FoldPreference {
8
+ subscribe(listener: () => void): () => void;
9
+ snapshot(): FoldState;
10
+ toggle(): void;
11
+ }
12
+ export declare function createFoldPreference(store: KeyValueStore | null): FoldPreference;
13
+ export declare function useFoldPreference(): {
14
+ folded: boolean;
15
+ revision: number;
16
+ toggle: () => void;
17
+ };
@@ -0,0 +1,63 @@
1
+ // §05 — the room's activity act: fold or open every run at once.
2
+ //
3
+ // The preference is per ROOM, not per run: the reader who wants the build log
4
+ // gets it in one press and keeps it for the session that follows. It is stored
5
+ // the way the project tints are — the room's storage, honestly priced: it is a
6
+ // property of this machine's reader, so it does not travel until the store
7
+ // does.
8
+ //
9
+ // The act sets the room's DEFAULT; every head follows it until pressed. It
10
+ // is ONE store per room, not one state per caller, so each run's head reads it, draws
11
+ // itself open or closed accordingly, and still folds or opens on its own
12
+ // press (a press is an override; the next press of the act clears every
13
+ // override). `data-fold` on the column remains for styling only.
14
+ //
15
+ // v2: the meaning changed with transcript-fold (2026-09-09). Before, "open"
16
+ // unfolded the few runs past eight lines; now it opens every run in the
17
+ // room, so the preference starts over, folded.
18
+ import { useSyncExternalStore } from "react";
19
+ import { useRoom } from "../../room-context.js";
20
+ /** Under the room's storage prefix. */
21
+ const STORE_KEY = "transcript.fold.v2";
22
+ const SERVER_STATE = { folded: true, revision: 0 };
23
+ export function createFoldPreference(store) {
24
+ /** Folded is the default: the ledger's closed sentence is the point. */
25
+ let folded = (() => {
26
+ try {
27
+ return store?.getItem(STORE_KEY) !== "off";
28
+ }
29
+ catch {
30
+ return true;
31
+ }
32
+ })();
33
+ let revision = 0;
34
+ let state = { folded, revision };
35
+ const listeners = new Set();
36
+ return {
37
+ subscribe(listener) {
38
+ listeners.add(listener);
39
+ return () => {
40
+ listeners.delete(listener);
41
+ };
42
+ },
43
+ snapshot: () => state,
44
+ toggle() {
45
+ folded = !folded;
46
+ revision += 1;
47
+ state = { folded, revision };
48
+ try {
49
+ store?.setItem(STORE_KEY, folded ? "on" : "off");
50
+ }
51
+ catch {
52
+ // storage refused; the preference holds for this run
53
+ }
54
+ for (const listener of listeners)
55
+ listener();
56
+ },
57
+ };
58
+ }
59
+ export function useFoldPreference() {
60
+ const { fold } = useRoom();
61
+ const value = useSyncExternalStore(fold.subscribe, fold.snapshot, () => SERVER_STATE);
62
+ return { ...value, toggle: fold.toggle };
63
+ }
@@ -0,0 +1,15 @@
1
+ import type { LedgerGlyph } from "../../lib/transcript/index.js";
2
+ export declare function FamilyGlyph({ glyph }: {
3
+ readonly glyph: LedgerGlyph;
4
+ }): import("react").JSX.Element;
5
+ /** T-5's one hue: the act did not complete. Substitutes the family glyph. */
6
+ export declare function FailGlyph(): import("react").JSX.Element;
7
+ /** The disclosure, on the 12-unit grid the record drew it on. */
8
+ export declare function LineChevron(): import("react").JSX.Element;
9
+ /** Working directory — metadata for a command frame, not another ledger act. */
10
+ export declare function DirectoryGlyph(): import("react").JSX.Element;
11
+ /** The column head's activity act — fold or open every run at once (§05). */
12
+ export declare function ActivityGlyph(): import("react").JSX.Element;
13
+ /** Reasoning's line form (Q10 A, transcript-fold): three points — the one
14
+ * glyph the record did not draw, for the one verb it did not have. */
15
+ export declare function ThoughtGlyph(): import("react").JSX.Element;
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const ROUND = { strokeLinecap: "round", strokeLinejoin: "round" };
3
+ /** Every family glyph, on the record's own paths. */
4
+ const PATHS = {
5
+ read: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M4 2.5h5.5L13 6v7.5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-10a1 1 0 0 1 1-1z" }), _jsx("path", { d: "M9.5 2.5V6H13" })] })),
6
+ list: _jsx("path", { d: "M3 4.5h10M3 8h10M3 11.5h6" }),
7
+ search: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "7", cy: "7", r: "4.2" }), _jsx("path", { d: "m10.2 10.2 3.3 3.3" })] })),
8
+ web: (_jsxs(_Fragment, { 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" })] })),
9
+ shell: (_jsxs(_Fragment, { children: [_jsx("path", { d: "m3 4.5 3.5 3.5L3 11.5" }), _jsx("path", { d: "M8.5 12h4.5" })] })),
10
+ delta: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M5.5 2.5v5M3 5h5" }), _jsx("path", { d: "M8 12h5" })] })),
11
+ delegate: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M4 2.5v6.5a2 2 0 0 0 2 2h7" }), _jsx("path", { d: "m10.5 8.5 2.5 2.5-2.5 2.5" })] })),
12
+ task: (_jsxs(_Fragment, { children: [_jsx("rect", { x: "3", y: "3", width: "10", height: "10", rx: "2" }), _jsx("path", { d: "m5.5 8 2 2 3.5-4" })] })),
13
+ question: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "8", cy: "8", r: "5.5" }), _jsx("path", { d: "M6.3 6.6a1.7 1.7 0 1 1 2.6 1.4c-.6.4-.9.7-.9 1.3" }), _jsx("path", { d: "M8 11.3v.1" })] })),
14
+ doc: (_jsxs(_Fragment, { children: [_jsx("rect", { x: "3", y: "2.5", width: "10", height: "11", rx: "1.5" }), _jsx("path", { d: "M5.5 6h5M5.5 8.5h5M5.5 11h3" })] })),
15
+ bell: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M5 11V7.5a3 3 0 0 1 6 0V11l1 1H4z" }), _jsx("path", { d: "M6.8 13.5a1.3 1.3 0 0 0 2.4 0" })] })),
16
+ box: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M2.5 5 8 2.5 13.5 5 8 7.5z" }), _jsx("path", { d: "M2.5 5v6L8 13.5l5.5-2.5V5M8 7.5v6" })] })),
17
+ plug: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M6 2.5v3M10 2.5v3M4 5.5h8v2a4 4 0 0 1-8 0z" }), _jsx("path", { d: "M8 11.5v2" })] })),
18
+ flag: _jsx("path", { d: "M4 13.5V3h7l-1.5 2.5L11 8H4" }),
19
+ bolt: _jsx("path", { d: "M9 2 4 9h4l-1 5 5-7H8z" }),
20
+ sliders: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M3 5h3M9 5h4M3 11h6M12 11h1" }), _jsx("circle", { cx: "7.5", cy: "5", r: "1.5" }), _jsx("circle", { cx: "10.5", cy: "11", r: "1.5" })] })),
21
+ clock: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "8", cy: "8", r: "5.5" }), _jsx("path", { d: "M8 5v3.2l2 1.3" })] })),
22
+ help: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M6.3 6.6a1.7 1.7 0 1 1 2.6 1.4c-.6.4-.9.7-.9 1.3" }), _jsx("path", { d: "M8 11.3v.1" })] })),
23
+ };
24
+ export function FamilyGlyph({ glyph }) {
25
+ return (_jsx("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", ...ROUND, "aria-hidden": "true", children: PATHS[glyph] }));
26
+ }
27
+ /** T-5's one hue: the act did not complete. Substitutes the family glyph. */
28
+ export function FailGlyph() {
29
+ return (_jsx("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", "aria-hidden": "true", children: _jsx("path", { d: "m4.5 4.5 7 7M11.5 4.5l-7 7" }) }));
30
+ }
31
+ /** The disclosure, on the 12-unit grid the record drew it on. */
32
+ export function LineChevron() {
33
+ return (_jsx("svg", { viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", ...ROUND, "aria-hidden": "true", children: _jsx("path", { d: "M4.5 2.5 8 6 4.5 9.5" }) }));
34
+ }
35
+ /** Working directory — metadata for a command frame, not another ledger act. */
36
+ export function DirectoryGlyph() {
37
+ return (_jsxs("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.4", ...ROUND, "aria-hidden": "true", children: [_jsx("path", { d: "M2.5 4.5h4l1.4 1.6h5.6v6.4a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1z" }), _jsx("path", { d: "M2.5 6.1V4a1 1 0 0 1 1-1h2.4l1.4 1.5" })] }));
38
+ }
39
+ /** The column head's activity act — fold or open every run at once (§05). */
40
+ export function ActivityGlyph() {
41
+ return (_jsx("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", ...ROUND, "aria-hidden": "true", children: _jsx("path", { d: "M2.5 8h2.5l2-4.5 2 9 2-4.5h2.5" }) }));
42
+ }
43
+ /** Reasoning's line form (Q10 A, transcript-fold): three points — the one
44
+ * glyph the record did not draw, for the one verb it did not have. */
45
+ export function ThoughtGlyph() {
46
+ return (_jsxs("svg", { viewBox: "0 0 16 16", fill: "currentColor", stroke: "none", "aria-hidden": "true", children: [_jsx("circle", { cx: "8", cy: "4.2", r: "1.1" }), _jsx("circle", { cx: "4.4", cy: "10.6", r: "1.1" }), _jsx("circle", { cx: "11.6", cy: "10.6", r: "1.1" })] }));
47
+ }
@@ -0,0 +1,23 @@
1
+ export { Anchor } from "./Anchor.js";
2
+ export { DayMenu, DayPill, Sitting, markStuckPills, pillText } from "./DayPill.js";
3
+ export { TranscriptDocument } from "./Document.js";
4
+ export type { TranscriptDocumentProps } from "./Document.js";
5
+ export { useTranscriptModel } from "./document-model.js";
6
+ export type { TranscriptModel } from "./document-model.js";
7
+ export { documentPlan } from "./document-plan.js";
8
+ export type { PlannedSitting, TurnPart } from "./document-plan.js";
9
+ export { Favicon, FaviconStack } from "./Favicon.js";
10
+ export { useFoldPreference } from "./fold-preference.js";
11
+ export { ActivityGlyph, FamilyGlyph, FailGlyph, LineChevron } from "./glyphs.js";
12
+ export { HeadOfDocument, TopFade, sessionStartLabel } from "./HeadOfDocument.js";
13
+ export { Ledger, Line } from "./Ledger.js";
14
+ export { LineDetail, hasDetail } from "./LineDetail.js";
15
+ export { GapMarker, Marker, Watermark } from "./Marker.js";
16
+ export { Prompt } from "./Prompt.js";
17
+ export { Prose, SegmentActs } from "./Prose.js";
18
+ export { ReceiptPill } from "./ReceiptPill.js";
19
+ export { ResponseHead } from "./ResponseHead.js";
20
+ export { Subthread } from "./Subthread.js";
21
+ export { Thinking } from "./Thinking.js";
22
+ export { buildThreadIndex, messageDomId, sessionContains, subthreadTitle, } from "./thread-index.js";
23
+ export type { ThreadFocus, ThreadIndex } from "./thread-index.js";
@@ -0,0 +1,22 @@
1
+ // The transcript's public door. `components/Transcript.tsx` keeps the column
2
+ // itself (its props are App.tsx's contract); everything the column is made of
3
+ // lives here.
4
+ export { Anchor } from "./Anchor.js";
5
+ export { DayMenu, DayPill, Sitting, markStuckPills, pillText } from "./DayPill.js";
6
+ export { TranscriptDocument } from "./Document.js";
7
+ export { useTranscriptModel } from "./document-model.js";
8
+ export { documentPlan } from "./document-plan.js";
9
+ export { Favicon, FaviconStack } from "./Favicon.js";
10
+ export { useFoldPreference } from "./fold-preference.js";
11
+ export { ActivityGlyph, FamilyGlyph, FailGlyph, LineChevron } from "./glyphs.js";
12
+ export { HeadOfDocument, TopFade, sessionStartLabel } from "./HeadOfDocument.js";
13
+ export { Ledger, Line } from "./Ledger.js";
14
+ export { LineDetail, hasDetail } from "./LineDetail.js";
15
+ export { GapMarker, Marker, Watermark } from "./Marker.js";
16
+ export { Prompt } from "./Prompt.js";
17
+ export { Prose, SegmentActs } from "./Prose.js";
18
+ export { ReceiptPill } from "./ReceiptPill.js";
19
+ export { ResponseHead } from "./ResponseHead.js";
20
+ export { Subthread } from "./Subthread.js";
21
+ export { Thinking } from "./Thinking.js";
22
+ export { buildThreadIndex, messageDomId, sessionContains, subthreadTitle, } from "./thread-index.js";
@@ -0,0 +1,15 @@
1
+ import type { CanonicalText } from "@vibefield/rosetta-protocol";
2
+ import type { AttachmentFact } from "../../lib/transcript/index.js";
3
+ import type { FileHandle, FileSource } from "../file-viewer/types.js";
4
+ export interface FullMessage {
5
+ readonly key: string;
6
+ readonly role: "user" | "agent";
7
+ /** Generated context can name its reading view without changing authorship. */
8
+ readonly title?: string | undefined;
9
+ readonly text: string;
10
+ readonly recordedText?: CanonicalText | null | undefined;
11
+ readonly attachments?: readonly AttachmentFact[] | undefined;
12
+ }
13
+ /** A full canonical member, or a snapshot of complete inline text. */
14
+ export declare function handleForMessage(message: FullMessage): FileHandle;
15
+ export declare const messageFileSource: FileSource;
@@ -0,0 +1,31 @@
1
+ /** A full canonical member, or a snapshot of complete inline text. */
2
+ export function handleForMessage(message) {
3
+ const name = `${message.title ?? (message.role === "user" ? "User prompt" : "Agent reply")}.md`;
4
+ const member = message.recordedText?.type === "member" ? message.recordedText : null;
5
+ if (member !== null)
6
+ return {
7
+ key: `message:${message.key}:${member.asset.digest}`,
8
+ name,
9
+ path: null,
10
+ size: member.byte_len,
11
+ ref: member.asset,
12
+ };
13
+ const bytes = new TextEncoder().encode(message.text);
14
+ return {
15
+ key: `message:${message.key}`,
16
+ name,
17
+ path: null,
18
+ size: bytes.byteLength,
19
+ ref: { type: "transcript-message", bytes },
20
+ };
21
+ }
22
+ export const messageFileSource = {
23
+ async read(handle, signal) {
24
+ signal.throwIfAborted();
25
+ const payload = handle.ref;
26
+ if (payload?.type !== "transcript-message" || !(payload.bytes instanceof Uint8Array)) {
27
+ throw new Error("This message is no longer available");
28
+ }
29
+ return payload.bytes;
30
+ },
31
+ };
@@ -0,0 +1,9 @@
1
+ export declare const MESSAGE_PREVIEW_CHARACTERS = 2400;
2
+ export declare const MESSAGE_PREVIEW_LINES = 32;
3
+ export interface MessageExcerpt {
4
+ readonly text: string;
5
+ readonly omitted: boolean;
6
+ }
7
+ export declare function messageExcerpt(text: string, budget?: number): MessageExcerpt;
8
+ /** Character counts stay meaningful for prose, source code and CJK text. */
9
+ export declare function messageCharacterCount(text: string): number;
@@ -0,0 +1,46 @@
1
+ // Bound the text handed to the transcript's Markdown renderer. The component
2
+ // can lower this budget further to fit the available reading width; the full
3
+ // message is kept separately and is only rendered in the file viewer.
4
+ export const MESSAGE_PREVIEW_CHARACTERS = 2400;
5
+ export const MESSAGE_PREVIEW_LINES = 32;
6
+ export function messageExcerpt(text, budget = MESSAGE_PREVIEW_CHARACTERS) {
7
+ let end = Math.min(text.length, Math.max(0, budget), MESSAGE_PREVIEW_CHARACTERS);
8
+ let lines = 1;
9
+ for (let at = 0; at < end; at += 1) {
10
+ if (text[at] === "\n" && ++lines > MESSAGE_PREVIEW_LINES) {
11
+ end = at;
12
+ break;
13
+ }
14
+ }
15
+ if (end === text.length)
16
+ return { text, omitted: false };
17
+ // Prefer a paragraph or line boundary near the end of the allowance.
18
+ // Otherwise keep the last whole word. Never split a UTF-16 surrogate pair.
19
+ const prefix = text.slice(0, end);
20
+ const paragraph = prefix.lastIndexOf("\n\n");
21
+ const line = prefix.lastIndexOf("\n");
22
+ const word = Math.max(prefix.lastIndexOf(" "), prefix.lastIndexOf("\t"));
23
+ const boundary = [paragraph, line, word].find((at) => at >= end * 0.75);
24
+ if (boundary !== undefined)
25
+ end = boundary;
26
+ if (end > 0 && /[\uD800-\uDBFF]/.test(text[end - 1]))
27
+ end -= 1;
28
+ let excerpt = text.slice(0, end).trimEnd();
29
+ // Do not finish on a heading or an empty fence whose content is omitted.
30
+ // Keep a heading-only introduction when it is all that fits.
31
+ const dangling = /(?:^|\n) {0,3}(?:#{1,6}\s+[^\n]*|`{3,}[^\n]*|~{3,}[^\n]*)$/;
32
+ for (let match = dangling.exec(excerpt); match !== null && match.index > 0; match = dangling.exec(excerpt)) {
33
+ const before = excerpt.slice(0, match.index).trimEnd();
34
+ if (before === "")
35
+ break;
36
+ excerpt = before;
37
+ }
38
+ return { text: excerpt, omitted: true };
39
+ }
40
+ /** Character counts stay meaningful for prose, source code and CJK text. */
41
+ export function messageCharacterCount(text) {
42
+ let count = 0;
43
+ for (const _character of text)
44
+ count += 1;
45
+ return count;
46
+ }
@@ -0,0 +1,7 @@
1
+ import type { PathFact } from "../../lib/transcript/index.js";
2
+ import type { SessionLeases } from "../../lib/session-leases.js";
3
+ import type { FileHandle, FileSource } from "../file-viewer/index.js";
4
+ /** Resolve and read one exact canonical target before opening the viewer. */
5
+ export declare function handleForReadPath(sessions: SessionLeases, path: PathFact, previewBytes?: Uint8Array, name?: string): Promise<FileHandle | null>;
6
+ /** Stable by construction: `useFileContent` treats source identity as a read. */
7
+ export declare const transcriptReadFileSource: FileSource;
@@ -0,0 +1,34 @@
1
+ // Canonical transcript file targets through the shared file-viewer seam.
2
+ //
3
+ // A transcript path is evidence, not authority. The renderer therefore sends
4
+ // only the session id, timeline id and target index back to rosettad. The
5
+ // daemon re-reads the canonical row, resolves the path recorded there and
6
+ // returns a bounded payload. The bytes ride on the handle so opening the
7
+ // dialog does not issue a second filesystem read against a file that may have
8
+ // changed between requests.
9
+ /** Resolve and read one exact canonical target before opening the viewer. */
10
+ export async function handleForReadPath(sessions, path, previewBytes, name) {
11
+ const address = path.read;
12
+ if (address === undefined || path.resource.type !== "file")
13
+ return null;
14
+ const bytes = previewBytes ?? await sessions.run(address.sessionId, (client) => client.readFileTarget(address.sessionId, address.timelineId, address.targetIndex));
15
+ return {
16
+ key: `read:${address.sessionId}:${address.timelineId}:${address.targetIndex}`,
17
+ name: name || path.name || "file",
18
+ path: path.resource.path,
19
+ size: bytes.byteLength,
20
+ ref: { type: "transcript-read", bytes },
21
+ };
22
+ }
23
+ /** Stable by construction: `useFileContent` treats source identity as a read. */
24
+ export const transcriptReadFileSource = {
25
+ async read(handle, signal) {
26
+ if (signal.aborted)
27
+ throw new DOMException("the file open was cancelled", "AbortError");
28
+ const payload = handle.ref;
29
+ if (payload?.type !== "transcript-read" || !(payload.bytes instanceof Uint8Array)) {
30
+ throw new Error("that recorded file is no longer available");
31
+ }
32
+ return payload.bytes;
33
+ },
34
+ };
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from "react";
2
+ export declare const ReaderModeProvider: import("react").Provider<boolean>;
3
+ /** True inside the reader: parts that open something draw as plain text. */
4
+ export declare function useReaderMode(): boolean;
5
+ export declare const MatchTermsProvider: import("react").Provider<readonly string[]>;
6
+ /** The words the reader marks, lower-cased; none outside a reader. */
7
+ export declare function useMatchTerms(): readonly string[];
8
+ /** A query's words as the index matches them: each word on its own, a phrase
9
+ * in quotes as one. */
10
+ export declare function matchTermsOf(query: string | null | undefined): readonly string[];
11
+ /** Marks every term in a run of text. Strings are marked; anything already
12
+ * drawn (an image link) is kept as it is. */
13
+ export declare function markTerms(content: ReactNode, terms: readonly string[]): ReactNode;
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // What the reader (PK3, `TranscriptReader`) tells the document it holds:
3
+ // that it is read-only, and the words its search matched, marked where the
4
+ // reply and the prompt say them. Only the reader provides either; the room
5
+ // marks a landing by its line and never by its words, so with no provider
6
+ // nothing here changes anything.
7
+ import { createContext, Fragment, useContext } from "react";
8
+ const ReaderModeContext = createContext(false);
9
+ export const ReaderModeProvider = ReaderModeContext.Provider;
10
+ /** True inside the reader: parts that open something draw as plain text. */
11
+ export function useReaderMode() {
12
+ return useContext(ReaderModeContext);
13
+ }
14
+ const MatchTermsContext = createContext([]);
15
+ export const MatchTermsProvider = MatchTermsContext.Provider;
16
+ /** The words the reader marks, lower-cased; none outside a reader. */
17
+ export function useMatchTerms() {
18
+ return useContext(MatchTermsContext);
19
+ }
20
+ /** A query's words as the index matches them: each word on its own, a phrase
21
+ * in quotes as one. */
22
+ export function matchTermsOf(query) {
23
+ if (query === null || query === undefined)
24
+ return [];
25
+ const terms = [];
26
+ for (const match of query.matchAll(/"([^"]*)"|(\S+)/g)) {
27
+ const term = (match[1] ?? match[2] ?? "").replace(/"/g, "").trim().toLowerCase();
28
+ if (term !== "" && !terms.includes(term))
29
+ terms.push(term);
30
+ }
31
+ // The longest first, so a phrase wins over a word inside it.
32
+ return terms.sort((left, right) => right.length - left.length);
33
+ }
34
+ function escape(term) {
35
+ return term.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
36
+ }
37
+ function markText(value, pattern) {
38
+ const parts = value.split(pattern);
39
+ if (parts.length === 1)
40
+ return value;
41
+ // split() with one capture group puts every match at an odd index.
42
+ return parts.map((part, at) => at % 2 === 1 ? _jsx("mark", { className: "tr-match", children: part }, at) : _jsx(Fragment, { children: part }, at));
43
+ }
44
+ /** Marks every term in a run of text. Strings are marked; anything already
45
+ * drawn (an image link) is kept as it is. */
46
+ export function markTerms(content, terms) {
47
+ if (terms.length === 0)
48
+ return content;
49
+ const pattern = new RegExp(`(${terms.map(escape).join("|")})`, "gi");
50
+ if (typeof content === "string")
51
+ return markText(content, pattern);
52
+ if (!Array.isArray(content))
53
+ return content;
54
+ return content.map((part, at) => typeof part === "string" ? _jsx(Fragment, { children: markText(part, pattern) }, `m${at}`) : part);
55
+ }
@@ -0,0 +1,2 @@
1
+ import type { ReadingSitting } from "./activity-plan.js";
2
+ export declare function retainReadingIdentity(previous: readonly ReadingSitting[], next: readonly ReadingSitting[]): ReadingSitting[];
@@ -0,0 +1,52 @@
1
+ import { activityRowKey } from "./activity-plan.js";
2
+ /** Prefer the largest surviving overlap, with one owner per old key. Inserting
3
+ * older rows must not remount an existing sitting, fold, or attachment rail.
4
+ * Real splits/merges keep the best surviving owner; row disclosure state is
5
+ * independently keyed by canonical identity. No historical rows are retained. */
6
+ function retainedKeys(previous, next) {
7
+ const owner = new Map();
8
+ for (const group of previous)
9
+ for (const row of group.rows)
10
+ owner.set(activityRowKey(row), group.key);
11
+ const matches = next.flatMap((group, index) => {
12
+ const counts = new Map();
13
+ for (const row of group.rows) {
14
+ const key = owner.get(activityRowKey(row));
15
+ if (key !== undefined)
16
+ counts.set(key, (counts.get(key) ?? 0) + 1);
17
+ }
18
+ return [...counts].map(([key, count]) => ({ index, key, count }));
19
+ }).sort((a, b) => b.count - a.count || a.index - b.index);
20
+ const assigned = new Map();
21
+ const used = new Set();
22
+ for (const match of matches) {
23
+ if (assigned.has(match.index) || used.has(match.key))
24
+ continue;
25
+ assigned.set(match.index, match.key);
26
+ used.add(match.key);
27
+ }
28
+ return next.map((group, index) => {
29
+ const saved = assigned.get(index);
30
+ if (saved !== undefined)
31
+ return saved;
32
+ let key = group.key;
33
+ while (used.has(key))
34
+ key += ":split";
35
+ used.add(key);
36
+ return key;
37
+ });
38
+ }
39
+ export function retainReadingIdentity(previous, next) {
40
+ const sittingKeys = retainedKeys(previous.map(x => ({ ...x.sitting, key: x.renderKey ?? x.sitting.key })), next.map(x => x.sitting));
41
+ return next.map(({ sitting, blocks }, index) => {
42
+ const old = previous.find(x => (x.renderKey ?? x.sitting.key) === sittingKeys[index]);
43
+ const groups = blocks.filter(block => block.kind === "activity");
44
+ const keys = retainedKeys(old?.blocks.filter(block => block.kind === "activity") ?? [], groups);
45
+ let groupIndex = 0;
46
+ return {
47
+ sitting,
48
+ renderKey: sittingKeys[index],
49
+ blocks: blocks.map(block => block.kind === "activity" ? { ...block, key: keys[groupIndex++] } : block),
50
+ };
51
+ });
52
+ }
@@ -0,0 +1,2 @@
1
+ /** Scroll only the transcript, never its overflow-hidden room ancestors. */
2
+ export declare function scrollRowTo(scroller: HTMLElement, element: HTMLElement, block: "center" | "nearest"): void;
@@ -0,0 +1,13 @@
1
+ /** Scroll only the transcript, never its overflow-hidden room ancestors. */
2
+ export function scrollRowTo(scroller, element, block) {
3
+ const frame = scroller.getBoundingClientRect();
4
+ const rect = element.getBoundingClientRect();
5
+ const top = rect.top - frame.top + scroller.scrollTop;
6
+ if (block === "center") {
7
+ scroller.scrollTop = top - Math.max(0, (scroller.clientHeight - rect.height) / 2);
8
+ }
9
+ else if (rect.top < frame.top)
10
+ scroller.scrollTop = top;
11
+ else if (rect.bottom > frame.bottom)
12
+ scroller.scrollTop = top - (scroller.clientHeight - rect.height);
13
+ }