@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,158 @@
1
+ import { useCallback, useLayoutEffect, useRef, useState } from "react";
2
+ import { REDUCED_MOTION_QUERY, SETTLE_EASING } from "../motion.js";
3
+ import { TailArrivals } from "./tail-state.js";
4
+ import { TailScroll } from "./tail-scroll.js";
5
+ const EMPTY = { away: false, unseen: 0 };
6
+ export function useTranscriptTail(scrollerRef, sessionId, enabled, seeking, opening = false) {
7
+ const [state, setState] = useState(EMPTY);
8
+ const controller = useRef(null);
9
+ const layout = useRef(null);
10
+ const accept = useRef(null);
11
+ const openingRef = useRef(opening);
12
+ openingRef.current = opening;
13
+ // The document owns the displayed chronology (including shared team
14
+ // messages). Buffer its first child layout until the parent has mounted.
15
+ const onLayout = useCallback((next) => {
16
+ layout.current = next;
17
+ accept.current?.(next);
18
+ }, []);
19
+ useLayoutEffect(() => {
20
+ setState(EMPTY);
21
+ const element = scrollerRef.current;
22
+ if (!enabled || sessionId === null || element === null)
23
+ return;
24
+ const preference = window.matchMedia(REDUCED_MOTION_QUERY);
25
+ const scroll = new TailScroll(element, setState, () => preference.matches);
26
+ controller.current = scroll;
27
+ if (seeking)
28
+ scroll.pause();
29
+ const arrivals = new TailArrivals();
30
+ const animations = new Set();
31
+ const cancelEntrances = () => {
32
+ for (const animation of animations)
33
+ animation.cancel();
34
+ animations.clear();
35
+ };
36
+ const update = (next) => {
37
+ if (next.sessionId !== sessionId)
38
+ return;
39
+ if (!next.ready) {
40
+ arrivals.reset();
41
+ scroll.update(false, 0);
42
+ return;
43
+ }
44
+ const displayed = new Set(next.rows.map(row => row.timeline_id));
45
+ const fresh = arrivals.update(next.observedRows ?? next.rows).filter(row => displayed.has(row.timeline_id));
46
+ for (const id of next.readySessionIds)
47
+ arrivals.prime(id);
48
+ scroll.update(true, fresh.length, openingRef.current);
49
+ if (openingRef.current || fresh.length === 0 || preference.matches)
50
+ return;
51
+ const viewport = element.getBoundingClientRect();
52
+ const allowance = scroll.isFollowing ? element.clientHeight : 0;
53
+ // Animate actual new message elements, never an existing fold's
54
+ // representative, a patch, a historical page, or a whole transcript.
55
+ const entering = fresh.slice(-24).flatMap((row) => {
56
+ const target = next.elementForRow(row);
57
+ if (target === null || !element.contains(target))
58
+ return [];
59
+ const box = target.getBoundingClientRect();
60
+ return box.height > 0 &&
61
+ box.bottom >= viewport.top &&
62
+ box.top <= viewport.bottom + allowance
63
+ ? [target]
64
+ : [];
65
+ });
66
+ for (const target of entering) {
67
+ const animation = target.animate([
68
+ { opacity: 0, translate: "0 6px" },
69
+ { opacity: 1, translate: "0 0" },
70
+ ], { duration: 280, easing: SETTLE_EASING });
71
+ animations.add(animation);
72
+ animation.onfinish = () => animations.delete(animation);
73
+ }
74
+ };
75
+ accept.current = update;
76
+ if (layout.current)
77
+ update(layout.current);
78
+ const wheel = (event) => {
79
+ if (Math.abs(event.deltaY) > Math.abs(event.deltaX))
80
+ scroll.pause();
81
+ };
82
+ const pointer = (event) => {
83
+ // Native scrollbar drags and clicks on the scroll surface also express
84
+ // reader intent, even on platforms that do not send wheel events.
85
+ if (event.target === element || scroll.isAnimating)
86
+ scroll.pause();
87
+ };
88
+ const focus = (event) => {
89
+ // Tabbing to a message action is reading/navigation intent. Keep that
90
+ // focused control in view instead of continuing a return past it.
91
+ if (event.target !== element)
92
+ scroll.pause();
93
+ };
94
+ let touchY = null;
95
+ const touchStart = (event) => {
96
+ touchY = event.touches[0]?.clientY ?? null;
97
+ };
98
+ const touchMove = (event) => {
99
+ if (touchY !== null && Math.abs((event.touches[0]?.clientY ?? touchY) - touchY) > 4) {
100
+ scroll.pause();
101
+ }
102
+ };
103
+ const key = (event) => {
104
+ if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey)
105
+ return;
106
+ if (event.target instanceof Element &&
107
+ event.target.closest("input, textarea, select, button, a, [contenteditable='true']"))
108
+ return;
109
+ if (["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", " "].includes(event.key)) {
110
+ scroll.pause();
111
+ }
112
+ };
113
+ const preferenceChanged = () => {
114
+ if (preference.matches)
115
+ cancelEntrances();
116
+ scroll.resize();
117
+ };
118
+ // Observe the document as well as the viewport: images, disclosures,
119
+ // streamed text and window resizing can change the foot without a row.
120
+ const observer = new ResizeObserver(scroll.resize);
121
+ observer.observe(element);
122
+ const content = element.querySelector(".tr-col");
123
+ if (content)
124
+ observer.observe(content);
125
+ element.addEventListener("scroll", scroll.onScroll, { passive: true });
126
+ element.addEventListener("wheel", wheel, { passive: true });
127
+ element.addEventListener("pointerdown", pointer, { passive: true });
128
+ element.addEventListener("focusin", focus);
129
+ element.addEventListener("touchstart", touchStart, { passive: true });
130
+ element.addEventListener("touchmove", touchMove, { passive: true });
131
+ element.addEventListener("keydown", key);
132
+ preference.addEventListener("change", preferenceChanged);
133
+ return () => {
134
+ accept.current = null;
135
+ controller.current = null;
136
+ observer.disconnect();
137
+ cancelEntrances();
138
+ scroll.dispose();
139
+ element.removeEventListener("scroll", scroll.onScroll);
140
+ element.removeEventListener("wheel", wheel);
141
+ element.removeEventListener("pointerdown", pointer);
142
+ element.removeEventListener("focusin", focus);
143
+ element.removeEventListener("touchstart", touchStart);
144
+ element.removeEventListener("touchmove", touchMove);
145
+ element.removeEventListener("keydown", key);
146
+ preference.removeEventListener("change", preferenceChanged);
147
+ };
148
+ // Seeking changes pause the existing controller below; they must not
149
+ // recreate it or forget unread arrivals in this session.
150
+ }, [enabled, sessionId, scrollerRef]);
151
+ useLayoutEffect(() => {
152
+ if (seeking)
153
+ controller.current?.pause();
154
+ }, [seeking]);
155
+ const pause = useCallback(() => controller.current?.pause(), []);
156
+ const latest = useCallback(() => controller.current?.latest(), []);
157
+ return { ...state, onLayout, pause, latest };
158
+ }
@@ -0,0 +1,119 @@
1
+ import type { AttachmentRef, CanonicalText, CitationRef, Notice, ResourceRef, TimelineEntry, ToolAction } from "@vibefield/rosetta-protocol";
2
+ /** One of the protocol's twenty-eight closed action families. */
3
+ export type ToolFamily = ToolAction["type"];
4
+ /**
5
+ * T-3's fold rule. `look` is high-volume and low-stakes, so consecutive looks
6
+ * of one family fold to a single line; `act` is the session's work product and
7
+ * always stands alone. `shell` is deliberately a LOOK (decided 2026-09-01) —
8
+ * running a command is looking at the world, and a *failed* command is an act,
9
+ * which is why a failure breaks the fold.
10
+ */
11
+ export type LedgerClass = "look" | "act";
12
+ export declare const FAMILY_CLASS: Readonly<Record<ToolFamily, LedgerClass>>;
13
+ /**
14
+ * The run's closing sentence is nouns, never verbs — `17 commands · 3 edits ·
15
+ * 4 reads` (T-3). One entry per family, singular and plural.
16
+ */
17
+ export declare const FAMILY_NOUN: Readonly<Record<ToolFamily, readonly [string, string]>>;
18
+ /** `1 read` · `4 reads`. The count is always stated; the noun agrees with it. */
19
+ export declare function familyNoun(family: ToolFamily, count: number): string;
20
+ /**
21
+ * The nouns a *fold* uses for its own members — `4 files`, `2 commands`. A fold
22
+ * counts the things looked at, which is not always the family's run noun: four
23
+ * `file_read` rows are `4 files` on the line and `4 reads` in the sentence.
24
+ */
25
+ export declare const FOLD_NOUN: Readonly<Record<ToolFamily, readonly [string, string]>>;
26
+ /**
27
+ * Monoline glyph names on the 16-unit grid at stroke 1.5, `currentColor` — the
28
+ * record's own symbol ids minus the `g-` prefix, so a component draws
29
+ * `<use href={"#g-" + glyph}/>`. One glyph per FAMILY, never per operation: a
30
+ * file's type is not a state, and neither is a tool's, so `Created` and
31
+ * `Edited` share the delta glyph and the verb carries the operation.
32
+ *
33
+ * The glyph slot is substituted by STATE, not by this name (§04's last rows):
34
+ * a `failed` line draws `#g-fail`, a `running` line draws the breathing dot.
35
+ */
36
+ export type LedgerGlyph = "read" | "list" | "search" | "web" | "shell" | "delta" | "delegate" | "task" | "question" | "doc" | "bell" | "box" | "plug" | "flag" | "bolt" | "sliders" | "clock" | "help";
37
+ export declare const FAMILY_GLYPH: Readonly<Record<ToolFamily, LedgerGlyph>>;
38
+ /**
39
+ * Ink and typeface for one span of the object column, named for the record's
40
+ * own classes so a component maps them without translating:
41
+ *
42
+ * - `plain` → a bare span: mono 11.5, primary ink. The object's default.
43
+ * - `dir` → `.dir`: mono, tertiary. A path's directory, so the NAME is what
44
+ * the eye lands on.
45
+ * - `query` → `.q`: mono, primary. A search term, quoted by weight not marks.
46
+ * - `aside` → `.in`: SANS 12, tertiary. Qualifiers and prose — `in files`,
47
+ * a fold's name list, a delegate's objective, a question's prompt.
48
+ */
49
+ export type ObjectTone = "plain" | "dir" | "query" | "aside";
50
+ export interface ObjectPart {
51
+ readonly text: string;
52
+ readonly tone: ObjectTone;
53
+ }
54
+ /**
55
+ * Concatenate the parts with NO separator — each part's text already carries
56
+ * the spacing the record draws (a directory ends in `/`, an aside opens with
57
+ * ` · ` or ` `). Use it for a `title` attribute or an assertion, never as a
58
+ * substitute for drawing the parts, which is where the tones live.
59
+ */
60
+ export declare function objectText(parts: readonly ObjectPart[]): string;
61
+ export declare function part(text: string, tone?: ObjectTone): ObjectPart;
62
+ /**
63
+ * Where the reading happens. A path is drawn relative to the session's own
64
+ * working directory when it lies beneath it, then home-relative, then whole —
65
+ * the record draws `packages/field-app/src/design-system/CardShell.tsx`, never
66
+ * the eleven leading characters that are the same on every line.
67
+ */
68
+ export interface LedgerContext {
69
+ /** `SessionRow.cwd` — the adapter's one settled primary working directory. */
70
+ readonly cwd?: string | null;
71
+ /** The viewer's home directory, for the `~/…` form. */
72
+ readonly home?: string | null;
73
+ }
74
+ export declare function shortenPath(path: string, context?: LedgerContext): string;
75
+ export declare function basename(path: string): string;
76
+ /**
77
+ * Split a path or url into its dim leading run and its bright last segment.
78
+ * A url loses its scheme first: the record draws
79
+ * `developer.mozilla.org/en-US/docs/Web/API/` + `WebGPU_API`.
80
+ */
81
+ export declare function splitPath(label: string): {
82
+ dir: string;
83
+ name: string;
84
+ };
85
+ /** Object parts for a path: directory dim, name bright (§04, `file_read`). */
86
+ export declare function pathParts(label: string): ObjectPart[];
87
+ /** The host of a url, for a source's caption and its icon's cache key. */
88
+ export declare function urlHost(url: string): string;
89
+ /** Inline text, or the preview a content-addressed member stands in for. */
90
+ export declare function canonicalText(text: CanonicalText): string;
91
+ /** The first line, clamped — every ledger line is one line by construction. */
92
+ export declare function firstLine(text: string, max?: number): string;
93
+ export declare function resourceLabel(resource: ResourceRef): string;
94
+ /** A resource as the reader should see it: shortened when it is a local path. */
95
+ export declare function resourceDisplay(resource: ResourceRef, context: LedgerContext): string;
96
+ export declare function attachmentLabel(attachment: AttachmentRef): string;
97
+ export declare function citationLabel(citation: CitationRef): string;
98
+ /**
99
+ * Every `Notice` is a hairline marker, never a filled alarm (§03 G). This is
100
+ * its one line of text; a `runtime_error` earns red text and nothing more.
101
+ */
102
+ export declare function noticeText(notice: Notice): string;
103
+ /**
104
+ * A span at second precision — `21s`, `9m 36s`, `1h 04m`, `1d 11h`. The run's
105
+ * sentence and a line's own duration both use it. `lib/format.ts`'s `duration`
106
+ * is the canonical MINUTE-precision form and is what §07's pause pill uses;
107
+ * this is its finer sibling, because a two-command fold that took 21 seconds
108
+ * must not read `0m`.
109
+ */
110
+ export declare function spanText(ms: number): string;
111
+ /**
112
+ * Every stamp a row can honestly offer, in no particular order. Timing is
113
+ * evidence-backed and frequently absent — the Claude Code and Codex rows on
114
+ * today's daemon carry `completed_at` and nothing else — so a span is taken
115
+ * from what is there and is `null` when the row cannot prove one.
116
+ */
117
+ export declare function rowStamps(row: TimelineEntry): number[];
118
+ /** The span across a set of rows, or null when fewer than two stamps exist. */
119
+ export declare function stampSpan(rows: readonly TimelineEntry[]): number | null;
@@ -0,0 +1,293 @@
1
+ export const FAMILY_CLASS = {
2
+ file_read: "look",
3
+ file_list: "look",
4
+ file_search: "look",
5
+ code_lookup: "look",
6
+ web_search: "look",
7
+ web_fetch: "look",
8
+ web_navigate: "look",
9
+ tool_discovery: "look",
10
+ shell: "look",
11
+ file_change: "act",
12
+ code_execute: "act",
13
+ process: "act",
14
+ orchestration: "act",
15
+ delegate: "act",
16
+ collaborate: "act",
17
+ question: "act",
18
+ skill: "act",
19
+ workflow: "act",
20
+ schedule: "act",
21
+ artifact: "act",
22
+ notification: "act",
23
+ mode: "act",
24
+ task: "act",
25
+ plan: "act",
26
+ finding: "act",
27
+ structured_output: "act",
28
+ external: "act",
29
+ unknown: "act",
30
+ };
31
+ /**
32
+ * The run's closing sentence is nouns, never verbs — `17 commands · 3 edits ·
33
+ * 4 reads` (T-3). One entry per family, singular and plural.
34
+ */
35
+ export const FAMILY_NOUN = {
36
+ file_read: ["read", "reads"],
37
+ file_list: ["listing", "listings"],
38
+ file_search: ["search", "searches"],
39
+ code_lookup: ["lookup", "lookups"],
40
+ web_search: ["web search", "web searches"],
41
+ web_fetch: ["fetch", "fetches"],
42
+ web_navigate: ["page", "pages"],
43
+ tool_discovery: ["tool search", "tool searches"],
44
+ shell: ["command", "commands"],
45
+ code_execute: ["run", "runs"],
46
+ file_change: ["edit", "edits"],
47
+ process: ["process", "processes"],
48
+ orchestration: ["tool batch", "tool batches"],
49
+ delegate: ["delegation", "delegations"],
50
+ collaborate: ["message", "messages"],
51
+ question: ["question", "questions"],
52
+ skill: ["skill", "skills"],
53
+ workflow: ["workflow", "workflows"],
54
+ schedule: ["schedule", "schedules"],
55
+ artifact: ["artifact", "artifacts"],
56
+ notification: ["notification", "notifications"],
57
+ mode: ["mode change", "mode changes"],
58
+ task: ["task", "tasks"],
59
+ plan: ["plan", "plans"],
60
+ finding: ["report", "reports"],
61
+ structured_output: ["document", "documents"],
62
+ external: ["call", "calls"],
63
+ unknown: ["call", "calls"],
64
+ };
65
+ /** `1 read` · `4 reads`. The count is always stated; the noun agrees with it. */
66
+ export function familyNoun(family, count) {
67
+ const [one, many] = FAMILY_NOUN[family];
68
+ return `${count} ${count === 1 ? one : many}`;
69
+ }
70
+ /**
71
+ * The nouns a *fold* uses for its own members — `4 files`, `2 commands`. A fold
72
+ * counts the things looked at, which is not always the family's run noun: four
73
+ * `file_read` rows are `4 files` on the line and `4 reads` in the sentence.
74
+ */
75
+ export const FOLD_NOUN = {
76
+ ...FAMILY_NOUN,
77
+ file_read: ["file", "files"],
78
+ file_list: ["directory", "directories"],
79
+ shell: ["command", "commands"],
80
+ web_fetch: ["page", "pages"],
81
+ };
82
+ export const FAMILY_GLYPH = {
83
+ file_read: "read",
84
+ file_list: "list",
85
+ file_search: "search",
86
+ code_lookup: "search",
87
+ web_search: "web",
88
+ web_fetch: "web",
89
+ web_navigate: "web",
90
+ tool_discovery: "plug",
91
+ file_change: "delta",
92
+ shell: "shell",
93
+ code_execute: "shell",
94
+ process: "clock",
95
+ orchestration: "bolt",
96
+ delegate: "delegate",
97
+ collaborate: "bell",
98
+ question: "question",
99
+ skill: "bolt",
100
+ workflow: "bolt",
101
+ schedule: "clock",
102
+ artifact: "box",
103
+ notification: "bell",
104
+ mode: "sliders",
105
+ task: "task",
106
+ plan: "task",
107
+ finding: "flag",
108
+ structured_output: "doc",
109
+ external: "plug",
110
+ unknown: "help",
111
+ };
112
+ /**
113
+ * Concatenate the parts with NO separator — each part's text already carries
114
+ * the spacing the record draws (a directory ends in `/`, an aside opens with
115
+ * ` · ` or ` `). Use it for a `title` attribute or an assertion, never as a
116
+ * substitute for drawing the parts, which is where the tones live.
117
+ */
118
+ export function objectText(parts) {
119
+ return parts.map((part) => part.text).join("");
120
+ }
121
+ export function part(text, tone = "plain") {
122
+ return { text, tone };
123
+ }
124
+ export function shortenPath(path, context = {}) {
125
+ const cwd = context.cwd?.replace(/\/+$/, "") ?? null;
126
+ if (cwd !== null && cwd.length > 0) {
127
+ if (path === cwd)
128
+ return basename(path);
129
+ if (path.startsWith(`${cwd}/`))
130
+ return path.slice(cwd.length + 1);
131
+ }
132
+ const home = context.home?.replace(/\/+$/, "") ?? null;
133
+ if (home !== null && home.length > 0 && path.startsWith(`${home}/`)) {
134
+ return `~/${path.slice(home.length + 1)}`;
135
+ }
136
+ return path;
137
+ }
138
+ export function basename(path) {
139
+ const trimmed = path.replace(/\/+$/, "");
140
+ const cut = trimmed.lastIndexOf("/");
141
+ return cut === -1 ? trimmed : trimmed.slice(cut + 1);
142
+ }
143
+ /**
144
+ * Split a path or url into its dim leading run and its bright last segment.
145
+ * A url loses its scheme first: the record draws
146
+ * `developer.mozilla.org/en-US/docs/Web/API/` + `WebGPU_API`.
147
+ */
148
+ export function splitPath(label) {
149
+ const stripped = label.replace(/^[a-z][a-z0-9+.-]*:\/\//i, "").replace(/\/+$/, "");
150
+ const cut = stripped.lastIndexOf("/");
151
+ if (cut === -1)
152
+ return { dir: "", name: stripped };
153
+ return { dir: stripped.slice(0, cut + 1), name: stripped.slice(cut + 1) };
154
+ }
155
+ /** Object parts for a path: directory dim, name bright (§04, `file_read`). */
156
+ export function pathParts(label) {
157
+ const { dir, name } = splitPath(label);
158
+ const parts = [];
159
+ if (dir)
160
+ parts.push(part(dir, "dir"));
161
+ parts.push(part(name || label));
162
+ return parts;
163
+ }
164
+ /** The host of a url, for a source's caption and its icon's cache key. */
165
+ export function urlHost(url) {
166
+ const match = /^(?:[a-z][a-z0-9+.-]*:\/\/)?([^/?#]+)/i.exec(url);
167
+ return match ? match[1].replace(/^www\./i, "") : url;
168
+ }
169
+ /** Inline text, or the preview a content-addressed member stands in for. */
170
+ export function canonicalText(text) {
171
+ return text.type === "inline" ? text.text : text.preview;
172
+ }
173
+ /** The first line, clamped — every ledger line is one line by construction. */
174
+ export function firstLine(text, max = 120) {
175
+ const line = text.split("\n", 1)[0].trim();
176
+ return line.length > max ? `${line.slice(0, max - 1)}…` : line;
177
+ }
178
+ export function resourceLabel(resource) {
179
+ switch (resource.type) {
180
+ case "file":
181
+ case "directory":
182
+ return resource.path;
183
+ case "url":
184
+ return resource.url;
185
+ case "session":
186
+ case "task":
187
+ case "process":
188
+ return resource.id;
189
+ case "asset":
190
+ return resource.asset.url;
191
+ }
192
+ }
193
+ /** A resource as the reader should see it: shortened when it is a local path. */
194
+ export function resourceDisplay(resource, context) {
195
+ const label = resourceLabel(resource);
196
+ return resource.type === "file" || resource.type === "directory"
197
+ ? shortenPath(label, context)
198
+ : label;
199
+ }
200
+ export function attachmentLabel(attachment) {
201
+ return attachment.name?.trim() || attachment.label?.trim() || (attachment.kind === "image" ? "Image" : "Attachment");
202
+ }
203
+ export function citationLabel(citation) {
204
+ const source = citation.source ? resourceLabel(citation.source) : null;
205
+ return citation.title?.trim() || source || citation.provider?.trim() || "Source";
206
+ }
207
+ /**
208
+ * Every `Notice` is a hairline marker, never a filled alarm (§03 G). This is
209
+ * its one line of text; a `runtime_error` earns red text and nothing more.
210
+ */
211
+ export function noticeText(notice) {
212
+ switch (notice.type) {
213
+ case "compaction":
214
+ return notice.reason ? `context compacted · ${notice.reason}` : "context compacted";
215
+ case "truncation": {
216
+ const count = notice.omitted_count === null ? "" : ` · ${notice.omitted_count} omitted`;
217
+ return `${notice.scope.replaceAll("_", " ")} truncated${count}`;
218
+ }
219
+ case "model_changed":
220
+ return notice.from ? `model ${notice.from} → ${notice.to}` : `model → ${notice.to}`;
221
+ case "mode_changed":
222
+ return notice.from ? `mode ${notice.from} → ${notice.to}` : `mode → ${notice.to}`;
223
+ case "permission_requested":
224
+ return notice.scope ? `permission requested · ${notice.scope}` : "permission requested";
225
+ case "permission_decision":
226
+ return notice.scope
227
+ ? `permission ${notice.decision} · ${notice.scope}`
228
+ : `permission ${notice.decision}`;
229
+ case "handoff":
230
+ return `handed off to ${notice.to_agent ?? notice.to_session_id ?? "another agent"}`;
231
+ case "command_output":
232
+ return canonicalText(notice.output);
233
+ case "async_task": {
234
+ const identity = notice.task_id ?? notice.tool_use_id;
235
+ const status = notice.status === "succeeded" ? "completed" : notice.status.replaceAll("_", " ");
236
+ return ["background task", identity, status, notice.summary]
237
+ .filter((value) => value !== null)
238
+ .join(" · ");
239
+ }
240
+ case "runtime_error":
241
+ return `runtime error · ${notice.kind.replaceAll("_", " ")} · ${notice.summary}`;
242
+ }
243
+ }
244
+ /* ── spans ───────────────────────────────────────────────────────────────── */
245
+ /**
246
+ * A span at second precision — `21s`, `9m 36s`, `1h 04m`, `1d 11h`. The run's
247
+ * sentence and a line's own duration both use it. `lib/format.ts`'s `duration`
248
+ * is the canonical MINUTE-precision form and is what §07's pause pill uses;
249
+ * this is its finer sibling, because a two-command fold that took 21 seconds
250
+ * must not read `0m`.
251
+ */
252
+ export function spanText(ms) {
253
+ const seconds = Math.max(0, Math.round(ms / 1000));
254
+ if (seconds < 60)
255
+ return `${seconds}s`;
256
+ const minutes = Math.floor(seconds / 60);
257
+ if (minutes < 60)
258
+ return `${minutes}m ${String(seconds % 60).padStart(2, "0")}s`;
259
+ const hours = Math.floor(minutes / 60);
260
+ if (hours < 24)
261
+ return `${hours}h ${String(minutes % 60).padStart(2, "0")}m`;
262
+ return `${Math.floor(hours / 24)}d ${hours % 24}h`;
263
+ }
264
+ /* ── stamps ──────────────────────────────────────────────────────────────── */
265
+ /**
266
+ * Every stamp a row can honestly offer, in no particular order. Timing is
267
+ * evidence-backed and frequently absent — the Claude Code and Codex rows on
268
+ * today's daemon carry `completed_at` and nothing else — so a span is taken
269
+ * from what is there and is `null` when the row cannot prove one.
270
+ */
271
+ export function rowStamps(row) {
272
+ const stamps = [];
273
+ if (row.at !== null)
274
+ stamps.push(row.at);
275
+ if (row.body.type === "tool_use") {
276
+ const timing = row.body.tool.timing;
277
+ if (timing) {
278
+ if (timing.started_at !== null)
279
+ stamps.push(timing.started_at);
280
+ if (timing.completed_at !== null)
281
+ stamps.push(timing.completed_at);
282
+ }
283
+ }
284
+ return stamps;
285
+ }
286
+ /** The span across a set of rows, or null when fewer than two stamps exist. */
287
+ export function stampSpan(rows) {
288
+ const stamps = rows.flatMap(rowStamps);
289
+ if (stamps.length < 2)
290
+ return null;
291
+ const span = Math.max(...stamps) - Math.min(...stamps);
292
+ return span > 0 ? span : null;
293
+ }
@@ -0,0 +1,6 @@
1
+ /** Recorded web addresses are data, never relative navigation or executable
2
+ * schemes. Keep the exact URL for opening; only normalize the icon cache key. */
3
+ export declare function webAddress(value: string | null): {
4
+ href: string;
5
+ host: string;
6
+ } | null;
@@ -0,0 +1,18 @@
1
+ /** Recorded web addresses are data, never relative navigation or executable
2
+ * schemes. Keep the exact URL for opening; only normalize the icon cache key. */
3
+ export function webAddress(value) {
4
+ if (!value)
5
+ return null;
6
+ try {
7
+ const url = new URL(value);
8
+ if (url.protocol !== "https:" && url.protocol !== "http:")
9
+ return null;
10
+ if (url.username || url.password)
11
+ return null;
12
+ const host = url.hostname.toLowerCase().replace(/\.$/, "");
13
+ return host ? { href: url.href, host } : null;
14
+ }
15
+ catch {
16
+ return null;
17
+ }
18
+ }
@@ -0,0 +1,31 @@
1
+ import type { TimelineEntry, ToolStatus, WorkflowRunStatus, WorkflowWorker } from "@vibefield/rosetta-protocol";
2
+ export interface WorkflowAttemptFact {
3
+ readonly timelineId: string;
4
+ readonly attempt: number;
5
+ readonly taskId: string | null;
6
+ readonly runId: string | null;
7
+ readonly resumed: boolean;
8
+ readonly status: ToolStatus;
9
+ readonly at: number | null;
10
+ readonly completedAt: number | null;
11
+ readonly durationMs: number | null;
12
+ readonly summary: string | null;
13
+ }
14
+ export interface WorkflowAttemptIndex {
15
+ readonly byRunId: ReadonlyMap<string, readonly WorkflowAttemptFact[]>;
16
+ readonly byTimelineId: ReadonlyMap<string, WorkflowAttemptFact>;
17
+ }
18
+ export declare function workflowAttemptIndex(rows: readonly TimelineEntry[]): WorkflowAttemptIndex;
19
+ export declare function workflowAttemptsFor(index: WorkflowAttemptIndex, row: TimelineEntry): readonly WorkflowAttemptFact[];
20
+ export interface WorkflowRuntimeFact {
21
+ readonly basis: "observed" | "varies" | "configured" | "unknown";
22
+ readonly model: string;
23
+ readonly effort: string;
24
+ }
25
+ /** Observed child-response metadata wins. A sidecar configuration is a
26
+ * labelled fallback, never presented as observation. */
27
+ export declare function workflowRuntime(worker: WorkflowWorker, defaultModel: string | null): WorkflowRuntimeFact;
28
+ /** Terminal run state refines unfinished worker rows without falsifying the
29
+ * native worker outcome. Cached completion is called reused and claims no
30
+ * fresh accounting. */
31
+ export declare function workflowWorkerState(worker: WorkflowWorker, runStatus: WorkflowRunStatus): string;