@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.
- package/README.md +247 -2
- package/dist/HistoryRoom.d.ts +98 -0
- package/dist/HistoryRoom.js +440 -0
- package/dist/TranscriptReader.d.ts +22 -0
- package/dist/TranscriptReader.js +72 -0
- package/dist/components/ColdStart.d.ts +4 -0
- package/dist/components/ColdStart.js +5 -0
- package/dist/components/FilterChips.d.ts +4 -0
- package/dist/components/FilterChips.js +5 -0
- package/dist/components/HostAct.d.ts +9 -0
- package/dist/components/HostAct.js +16 -0
- package/dist/components/HostMenu.d.ts +41 -0
- package/dist/components/HostMenu.js +216 -0
- package/dist/components/IngestStatus.d.ts +4 -0
- package/dist/components/IngestStatus.js +20 -0
- package/dist/components/ListActivityNotice.d.ts +5 -0
- package/dist/components/ListActivityNotice.js +4 -0
- package/dist/components/ListSections.d.ts +20 -0
- package/dist/components/ListSections.js +39 -0
- package/dist/components/RenameHeading.d.ts +9 -0
- package/dist/components/RenameHeading.js +75 -0
- package/dist/components/SearchStrip.d.ts +5 -0
- package/dist/components/SearchStrip.js +8 -0
- package/dist/components/SummaryMetrics.d.ts +13 -0
- package/dist/components/SummaryMetrics.js +9 -0
- package/dist/components/SummaryPanels.d.ts +35 -0
- package/dist/components/SummaryPanels.js +117 -0
- package/dist/components/Transcript.d.ts +46 -0
- package/dist/components/Transcript.js +358 -0
- package/dist/components/charts/ActivityChartDetail.d.ts +13 -0
- package/dist/components/charts/ActivityChartDetail.js +78 -0
- package/dist/components/charts/CalendarHeatmap.d.ts +16 -0
- package/dist/components/charts/CalendarHeatmap.js +55 -0
- package/dist/components/charts/DayActivityChart.d.ts +8 -0
- package/dist/components/charts/DayActivityChart.js +71 -0
- package/dist/components/charts/ModelsChartDetail.d.ts +7 -0
- package/dist/components/charts/ModelsChartDetail.js +19 -0
- package/dist/components/charts/ProjectChartDialog.d.ts +19 -0
- package/dist/components/charts/ProjectChartDialog.js +39 -0
- package/dist/components/charts/Streamgraph.d.ts +16 -0
- package/dist/components/charts/Streamgraph.js +94 -0
- package/dist/components/charts/Treemap.d.ts +26 -0
- package/dist/components/charts/Treemap.js +81 -0
- package/dist/components/charts/index.d.ts +9 -0
- package/dist/components/charts/index.js +4 -0
- package/dist/components/charts/streamgraph-layout.d.ts +23 -0
- package/dist/components/charts/streamgraph-layout.js +114 -0
- package/dist/components/charts/treemap-layout.d.ts +32 -0
- package/dist/components/charts/treemap-layout.js +140 -0
- package/dist/components/charts/types.d.ts +65 -0
- package/dist/components/charts/types.js +8 -0
- package/dist/components/file-viewer/FileViewerBrowsers.d.ts +10 -0
- package/dist/components/file-viewer/FileViewerBrowsers.js +65 -0
- package/dist/components/file-viewer/FileViewerDialog.d.ts +33 -0
- package/dist/components/file-viewer/FileViewerDialog.js +82 -0
- package/dist/components/file-viewer/FileViewerHeader.d.ts +26 -0
- package/dist/components/file-viewer/FileViewerHeader.js +17 -0
- package/dist/components/file-viewer/ImageGalleryDialog.d.ts +14 -0
- package/dist/components/file-viewer/ImageGalleryDialog.js +98 -0
- package/dist/components/file-viewer/diff/index.d.ts +2 -0
- package/dist/components/file-viewer/diff/index.js +2 -0
- package/dist/components/file-viewer/diff/parse.d.ts +2 -0
- package/dist/components/file-viewer/diff/parse.js +164 -0
- package/dist/components/file-viewer/diff/types.d.ts +44 -0
- package/dist/components/file-viewer/diff/types.js +7 -0
- package/dist/components/file-viewer/gallery-source.d.ts +11 -0
- package/dist/components/file-viewer/gallery-source.js +75 -0
- package/dist/components/file-viewer/image-resource.d.ts +19 -0
- package/dist/components/file-viewer/image-resource.js +60 -0
- package/dist/components/file-viewer/index.d.ts +5 -0
- package/dist/components/file-viewer/index.js +8 -0
- package/dist/components/file-viewer/markdown/blocks.d.ts +2 -0
- package/dist/components/file-viewer/markdown/blocks.js +277 -0
- package/dist/components/file-viewer/markdown/index.d.ts +4 -0
- package/dist/components/file-viewer/markdown/index.js +35 -0
- package/dist/components/file-viewer/markdown/inline.d.ts +10 -0
- package/dist/components/file-viewer/markdown/inline.js +178 -0
- package/dist/components/file-viewer/markdown/render.d.ts +9 -0
- package/dist/components/file-viewer/markdown/render.js +78 -0
- package/dist/components/file-viewer/markdown/types.d.ts +57 -0
- package/dist/components/file-viewer/markdown/types.js +11 -0
- package/dist/components/file-viewer/minimap/CodeMinimap.d.ts +10 -0
- package/dist/components/file-viewer/minimap/CodeMinimap.js +296 -0
- package/dist/components/file-viewer/minimap/layout.d.ts +60 -0
- package/dist/components/file-viewer/minimap/layout.js +117 -0
- package/dist/components/file-viewer/minimap/palette.d.ts +2 -0
- package/dist/components/file-viewer/minimap/palette.js +73 -0
- package/dist/components/file-viewer/minimap/raster.d.ts +19 -0
- package/dist/components/file-viewer/minimap/raster.js +122 -0
- package/dist/components/file-viewer/registry.d.ts +25 -0
- package/dist/components/file-viewer/registry.js +182 -0
- package/dist/components/file-viewer/syntax/grammars.d.ts +16 -0
- package/dist/components/file-viewer/syntax/grammars.js +221 -0
- package/dist/components/file-viewer/syntax/index.d.ts +8 -0
- package/dist/components/file-viewer/syntax/index.js +9 -0
- package/dist/components/file-viewer/syntax/languages.d.ts +14 -0
- package/dist/components/file-viewer/syntax/languages.js +115 -0
- package/dist/components/file-viewer/syntax/tokenize-config.d.ts +2 -0
- package/dist/components/file-viewer/syntax/tokenize-config.js +132 -0
- package/dist/components/file-viewer/syntax/tokenize-css.d.ts +2 -0
- package/dist/components/file-viewer/syntax/tokenize-css.js +169 -0
- package/dist/components/file-viewer/syntax/tokenize-markup.d.ts +2 -0
- package/dist/components/file-viewer/syntax/tokenize-markup.js +124 -0
- package/dist/components/file-viewer/syntax/tokenize.d.ts +9 -0
- package/dist/components/file-viewer/syntax/tokenize.js +289 -0
- package/dist/components/file-viewer/syntax/types.d.ts +74 -0
- package/dist/components/file-viewer/syntax/types.js +13 -0
- package/dist/components/file-viewer/types.d.ts +111 -0
- package/dist/components/file-viewer/types.js +8 -0
- package/dist/components/file-viewer/use-file-content.d.ts +26 -0
- package/dist/components/file-viewer/use-file-content.js +144 -0
- package/dist/components/file-viewer/views/BinaryView.d.ts +2 -0
- package/dist/components/file-viewer/views/BinaryView.js +34 -0
- package/dist/components/file-viewer/views/CodeView.d.ts +2 -0
- package/dist/components/file-viewer/views/CodeView.js +46 -0
- package/dist/components/file-viewer/views/DiffBody.d.ts +7 -0
- package/dist/components/file-viewer/views/DiffBody.js +77 -0
- package/dist/components/file-viewer/views/DiffView.d.ts +2 -0
- package/dist/components/file-viewer/views/DiffView.js +11 -0
- package/dist/components/file-viewer/views/ImageView.d.ts +9 -0
- package/dist/components/file-viewer/views/ImageView.js +28 -0
- package/dist/components/file-viewer/views/MarkdownView.d.ts +9 -0
- package/dist/components/file-viewer/views/MarkdownView.js +20 -0
- package/dist/components/file-viewer/views/SvgView.d.ts +9 -0
- package/dist/components/file-viewer/views/SvgView.js +10 -0
- package/dist/components/git/ChangeTree.d.ts +20 -0
- package/dist/components/git/ChangeTree.js +35 -0
- package/dist/components/git/CommitViewer.d.ts +12 -0
- package/dist/components/git/CommitViewer.js +85 -0
- package/dist/components/git/GitChanges.d.ts +17 -0
- package/dist/components/git/GitChanges.js +70 -0
- package/dist/components/git/GitHistory.d.ts +9 -0
- package/dist/components/git/GitHistory.js +58 -0
- package/dist/components/git/co-author.d.ts +14 -0
- package/dist/components/git/co-author.js +55 -0
- package/dist/components/git/git-file-source.d.ts +18 -0
- package/dist/components/git/git-file-source.js +53 -0
- package/dist/components/git/git-host.d.ts +24 -0
- package/dist/components/git/git-host.js +130 -0
- package/dist/components/git/index.d.ts +10 -0
- package/dist/components/git/index.js +12 -0
- package/dist/components/git/path-tree.d.ts +23 -0
- package/dist/components/git/path-tree.js +73 -0
- package/dist/components/git/session-files.d.ts +9 -0
- package/dist/components/git/session-files.js +50 -0
- package/dist/components/git/types.d.ts +92 -0
- package/dist/components/git/types.js +9 -0
- package/dist/components/projects/ProjectActivitySparkline.d.ts +6 -0
- package/dist/components/projects/ProjectActivitySparkline.js +12 -0
- package/dist/components/projects/ProjectList.d.ts +25 -0
- package/dist/components/projects/ProjectList.js +43 -0
- package/dist/components/projects/ProjectListItem.d.ts +19 -0
- package/dist/components/projects/ProjectListItem.js +78 -0
- package/dist/components/projects/ProjectsColumn.d.ts +19 -0
- package/dist/components/projects/ProjectsColumn.js +36 -0
- package/dist/components/projects/index.d.ts +8 -0
- package/dist/components/projects/index.js +4 -0
- package/dist/components/search/MatchStepper.d.ts +9 -0
- package/dist/components/search/MatchStepper.js +14 -0
- package/dist/components/search/SearchLauncher.d.ts +12 -0
- package/dist/components/search/SearchLauncher.js +13 -0
- package/dist/components/search/SearchSheet.d.ts +29 -0
- package/dist/components/search/SearchSheet.js +230 -0
- package/dist/components/search/index.d.ts +8 -0
- package/dist/components/search/index.js +4 -0
- package/dist/components/search/shortcut.d.ts +25 -0
- package/dist/components/search/shortcut.js +32 -0
- package/dist/components/sessions/SessionList.d.ts +24 -0
- package/dist/components/sessions/SessionList.js +76 -0
- package/dist/components/sessions/SessionListItem.d.ts +13 -0
- package/dist/components/sessions/SessionListItem.js +58 -0
- package/dist/components/sessions/SessionsColumn.d.ts +26 -0
- package/dist/components/sessions/SessionsColumn.js +32 -0
- package/dist/components/sessions/index.d.ts +9 -0
- package/dist/components/sessions/index.js +4 -0
- package/dist/components/sessions/session-display.d.ts +8 -0
- package/dist/components/sessions/session-display.js +18 -0
- package/dist/components/sessions/types.d.ts +7 -0
- package/dist/components/sessions/types.js +1 -0
- package/dist/components/transcript/Activity.d.ts +45 -0
- package/dist/components/transcript/Activity.js +75 -0
- package/dist/components/transcript/Anchor.d.ts +8 -0
- package/dist/components/transcript/Anchor.js +23 -0
- package/dist/components/transcript/Attachments.d.ts +21 -0
- package/dist/components/transcript/Attachments.js +138 -0
- package/dist/components/transcript/AuthoredMessage.d.ts +19 -0
- package/dist/components/transcript/AuthoredMessage.js +17 -0
- package/dist/components/transcript/Compaction.d.ts +9 -0
- package/dist/components/transcript/Compaction.js +50 -0
- package/dist/components/transcript/DayPill.d.ts +38 -0
- package/dist/components/transcript/DayPill.js +68 -0
- package/dist/components/transcript/Document.d.ts +32 -0
- package/dist/components/transcript/Document.js +503 -0
- package/dist/components/transcript/Favicon.d.ts +32 -0
- package/dist/components/transcript/Favicon.js +71 -0
- package/dist/components/transcript/HeadOfDocument.d.ts +19 -0
- package/dist/components/transcript/HeadOfDocument.js +44 -0
- package/dist/components/transcript/Ledger.d.ts +53 -0
- package/dist/components/transcript/Ledger.js +182 -0
- package/dist/components/transcript/LineDetail.d.ts +24 -0
- package/dist/components/transcript/LineDetail.js +81 -0
- package/dist/components/transcript/Marker.d.ts +33 -0
- package/dist/components/transcript/Marker.js +21 -0
- package/dist/components/transcript/MessagePreview.d.ts +12 -0
- package/dist/components/transcript/MessagePreview.js +58 -0
- package/dist/components/transcript/Prompt.d.ts +20 -0
- package/dist/components/transcript/Prompt.js +55 -0
- package/dist/components/transcript/Prose.d.ts +19 -0
- package/dist/components/transcript/Prose.js +109 -0
- package/dist/components/transcript/ReceiptPill.d.ts +10 -0
- package/dist/components/transcript/ReceiptPill.js +10 -0
- package/dist/components/transcript/ResponseHead.d.ts +9 -0
- package/dist/components/transcript/ResponseHead.js +36 -0
- package/dist/components/transcript/Subthread.d.ts +19 -0
- package/dist/components/transcript/Subthread.js +96 -0
- package/dist/components/transcript/Team.d.ts +53 -0
- package/dist/components/transcript/Team.js +185 -0
- package/dist/components/transcript/Thinking.d.ts +24 -0
- package/dist/components/transcript/Thinking.js +50 -0
- package/dist/components/transcript/TimelineMeta.d.ts +9 -0
- package/dist/components/transcript/TimelineMeta.js +161 -0
- package/dist/components/transcript/TranscriptLoading.d.ts +10 -0
- package/dist/components/transcript/TranscriptLoading.js +10 -0
- package/dist/components/transcript/WebDetail.d.ts +8 -0
- package/dist/components/transcript/WebDetail.js +29 -0
- package/dist/components/transcript/Workflow.d.ts +12 -0
- package/dist/components/transcript/Workflow.js +208 -0
- package/dist/components/transcript/activity-plan.d.ts +84 -0
- package/dist/components/transcript/activity-plan.js +209 -0
- package/dist/components/transcript/attachment-file-source.d.ts +23 -0
- package/dist/components/transcript/attachment-file-source.js +103 -0
- package/dist/components/transcript/attachment-gallery.d.ts +12 -0
- package/dist/components/transcript/attachment-gallery.js +33 -0
- package/dist/components/transcript/detail-parts.d.ts +50 -0
- package/dist/components/transcript/detail-parts.js +295 -0
- package/dist/components/transcript/disclosure-state.d.ts +6 -0
- package/dist/components/transcript/disclosure-state.js +32 -0
- package/dist/components/transcript/disclosure-store.d.ts +8 -0
- package/dist/components/transcript/disclosure-store.js +31 -0
- package/dist/components/transcript/document-model.d.ts +15 -0
- package/dist/components/transcript/document-model.js +104 -0
- package/dist/components/transcript/document-plan.d.ts +28 -0
- package/dist/components/transcript/document-plan.js +145 -0
- package/dist/components/transcript/fold-preference.d.ts +17 -0
- package/dist/components/transcript/fold-preference.js +63 -0
- package/dist/components/transcript/glyphs.d.ts +15 -0
- package/dist/components/transcript/glyphs.js +47 -0
- package/dist/components/transcript/index.d.ts +23 -0
- package/dist/components/transcript/index.js +22 -0
- package/dist/components/transcript/message-file-source.d.ts +15 -0
- package/dist/components/transcript/message-file-source.js +31 -0
- package/dist/components/transcript/message-preview.d.ts +9 -0
- package/dist/components/transcript/message-preview.js +46 -0
- package/dist/components/transcript/read-file-source.d.ts +7 -0
- package/dist/components/transcript/read-file-source.js +34 -0
- package/dist/components/transcript/reader-context.d.ts +13 -0
- package/dist/components/transcript/reader-context.js +55 -0
- package/dist/components/transcript/reading-identity.d.ts +2 -0
- package/dist/components/transcript/reading-identity.js +52 -0
- package/dist/components/transcript/scroll-to-row.d.ts +2 -0
- package/dist/components/transcript/scroll-to-row.js +13 -0
- package/dist/components/transcript/thread-index.d.ts +14 -0
- package/dist/components/transcript/thread-index.js +40 -0
- package/dist/components/transcript/thread-navigation.d.ts +5 -0
- package/dist/components/transcript/thread-navigation.js +3 -0
- package/dist/components/transcript/timeline-meta-file-source.d.ts +6 -0
- package/dist/components/transcript/timeline-meta-file-source.js +55 -0
- package/dist/components/transcript/timeline-meta-state.d.ts +12 -0
- package/dist/components/transcript/timeline-meta-state.js +24 -0
- package/dist/components/ui/ColumnHeading.d.ts +27 -0
- package/dist/components/ui/ColumnHeading.js +7 -0
- package/dist/components/ui/ConfirmDialog.d.ts +14 -0
- package/dist/components/ui/ConfirmDialog.js +22 -0
- package/dist/components/ui/DialogShell.d.ts +18 -0
- package/dist/components/ui/DialogShell.js +40 -0
- package/dist/components/ui/EmptyState.d.ts +10 -0
- package/dist/components/ui/EmptyState.js +6 -0
- package/dist/components/ui/ListSummaryHeader.d.ts +9 -0
- package/dist/components/ui/ListSummaryHeader.js +6 -0
- package/dist/components/ui/ListToolbar.d.ts +6 -0
- package/dist/components/ui/ListToolbar.js +5 -0
- package/dist/components/ui/ResultGroupHeader.d.ts +9 -0
- package/dist/components/ui/ResultGroupHeader.js +5 -0
- package/dist/components/ui/SegmentedControl.d.ts +16 -0
- package/dist/components/ui/SegmentedControl.js +9 -0
- package/dist/components/ui/SummaryMetric.d.ts +13 -0
- package/dist/components/ui/SummaryMetric.js +10 -0
- package/dist/components/ui/Veil.d.ts +7 -0
- package/dist/components/ui/Veil.js +5 -0
- package/dist/components/ui/index.d.ts +20 -0
- package/dist/components/ui/index.js +10 -0
- package/dist/components/worktree/WorktreeColumn.d.ts +22 -0
- package/dist/components/worktree/WorktreeColumn.js +170 -0
- package/dist/components/worktree/WorktreeFileTree.d.ts +19 -0
- package/dist/components/worktree/WorktreeFileTree.js +60 -0
- package/dist/components/worktree/WorktreeHeader.d.ts +32 -0
- package/dist/components/worktree/WorktreeHeader.js +81 -0
- package/dist/components/worktree/WorktreeList.d.ts +8 -0
- package/dist/components/worktree/WorktreeList.js +12 -0
- package/dist/components/worktree/index.d.ts +12 -0
- package/dist/components/worktree/index.js +7 -0
- package/dist/components/worktree/types.d.ts +17 -0
- package/dist/components/worktree/types.js +3 -0
- package/dist/components/worktree/use-worktree-guest.d.ts +21 -0
- package/dist/components/worktree/use-worktree-guest.js +92 -0
- package/dist/components/worktree/worktree-file-commands.d.ts +19 -0
- package/dist/components/worktree/worktree-file-commands.js +112 -0
- package/dist/components/worktree/worktree-file-source.d.ts +15 -0
- package/dist/components/worktree/worktree-file-source.js +75 -0
- package/dist/components/worktree/worktree-host.d.ts +31 -0
- package/dist/components/worktree/worktree-host.js +242 -0
- package/dist/fixtures/index.d.ts +24 -0
- package/dist/fixtures/index.js +292 -0
- package/dist/host-inputs.d.ts +231 -0
- package/dist/host-inputs.js +35 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +14 -0
- package/dist/lib/activity-details.d.ts +23 -0
- package/dist/lib/activity-details.js +78 -0
- package/dist/lib/activity-order.d.ts +32 -0
- package/dist/lib/activity-order.js +86 -0
- package/dist/lib/agent-paths.d.ts +6 -0
- package/dist/lib/agent-paths.js +19 -0
- package/dist/lib/agents.d.ts +15 -0
- package/dist/lib/agents.js +60 -0
- package/dist/lib/catalog-status.d.ts +3 -0
- package/dist/lib/catalog-status.js +10 -0
- package/dist/lib/chart-data.d.ts +14 -0
- package/dist/lib/chart-data.js +151 -0
- package/dist/lib/day-activity.d.ts +21 -0
- package/dist/lib/day-activity.js +56 -0
- package/dist/lib/format.d.ts +24 -0
- package/dist/lib/format.js +116 -0
- package/dist/lib/hooks.d.ts +118 -0
- package/dist/lib/hooks.js +608 -0
- package/dist/lib/icons.d.ts +21 -0
- package/dist/lib/icons.js +49 -0
- package/dist/lib/image-media.d.ts +6 -0
- package/dist/lib/image-media.js +30 -0
- package/dist/lib/ingest-activity.d.ts +50 -0
- package/dist/lib/ingest-activity.js +151 -0
- package/dist/lib/ingest.d.ts +25 -0
- package/dist/lib/ingest.js +70 -0
- package/dist/lib/model-labels.d.ts +5 -0
- package/dist/lib/model-labels.js +28 -0
- package/dist/lib/model.d.ts +73 -0
- package/dist/lib/model.js +141 -0
- package/dist/lib/motion.d.ts +13 -0
- package/dist/lib/motion.js +80 -0
- package/dist/lib/room-storage.d.ts +13 -0
- package/dist/lib/room-storage.js +40 -0
- package/dist/lib/search-results.d.ts +27 -0
- package/dist/lib/search-results.js +83 -0
- package/dist/lib/search-sheet.d.ts +119 -0
- package/dist/lib/search-sheet.js +282 -0
- package/dist/lib/sections.d.ts +19 -0
- package/dist/lib/sections.js +36 -0
- package/dist/lib/session-activity.d.ts +5 -0
- package/dist/lib/session-activity.js +15 -0
- package/dist/lib/session-leases.d.ts +15 -0
- package/dist/lib/session-leases.js +61 -0
- package/dist/lib/spend.d.ts +42 -0
- package/dist/lib/spend.js +112 -0
- package/dist/lib/tint.d.ts +9 -0
- package/dist/lib/tint.js +53 -0
- package/dist/lib/transcript/collaboration.d.ts +97 -0
- package/dist/lib/transcript/collaboration.js +423 -0
- package/dist/lib/transcript/families.d.ts +212 -0
- package/dist/lib/transcript/families.js +906 -0
- package/dist/lib/transcript/favicons.d.ts +54 -0
- package/dist/lib/transcript/favicons.js +183 -0
- package/dist/lib/transcript/head-of-document.d.ts +27 -0
- package/dist/lib/transcript/head-of-document.js +274 -0
- package/dist/lib/transcript/head-state.d.ts +182 -0
- package/dist/lib/transcript/head-state.js +305 -0
- package/dist/lib/transcript/history-window.d.ts +13 -0
- package/dist/lib/transcript/history-window.js +52 -0
- package/dist/lib/transcript/images.d.ts +8 -0
- package/dist/lib/transcript/images.js +60 -0
- package/dist/lib/transcript/index.d.ts +15 -0
- package/dist/lib/transcript/index.js +8 -0
- package/dist/lib/transcript/ledger.d.ts +143 -0
- package/dist/lib/transcript/ledger.js +513 -0
- package/dist/lib/transcript/protocol.d.ts +23 -0
- package/dist/lib/transcript/protocol.js +1 -0
- package/dist/lib/transcript/sittings.d.ts +75 -0
- package/dist/lib/transcript/sittings.js +147 -0
- package/dist/lib/transcript/tail-scroll.d.ts +36 -0
- package/dist/lib/transcript/tail-scroll.js +167 -0
- package/dist/lib/transcript/tail-state.d.ts +17 -0
- package/dist/lib/transcript/tail-state.js +30 -0
- package/dist/lib/transcript/turns.d.ts +192 -0
- package/dist/lib/transcript/turns.js +576 -0
- package/dist/lib/transcript/use-transcript-opening.d.ts +12 -0
- package/dist/lib/transcript/use-transcript-opening.js +31 -0
- package/dist/lib/transcript/use-transcript-tail.d.ts +25 -0
- package/dist/lib/transcript/use-transcript-tail.js +158 -0
- package/dist/lib/transcript/vocabulary.d.ts +119 -0
- package/dist/lib/transcript/vocabulary.js +293 -0
- package/dist/lib/transcript/web-address.d.ts +6 -0
- package/dist/lib/transcript/web-address.js +18 -0
- package/dist/lib/transcript/workflow.d.ts +31 -0
- package/dist/lib/transcript/workflow.js +133 -0
- package/dist/lib/use-activity-order.d.ts +2 -0
- package/dist/lib/use-activity-order.js +23 -0
- package/dist/lib/use-day-usage.d.ts +8 -0
- package/dist/lib/use-day-usage.js +31 -0
- package/dist/lib/use-deferred-list-order.d.ts +26 -0
- package/dist/lib/use-deferred-list-order.js +142 -0
- package/dist/lib/use-ingest-activity.d.ts +2 -0
- package/dist/lib/use-ingest-activity.js +49 -0
- package/dist/lib/use-list-motion.d.ts +4 -0
- package/dist/lib/use-list-motion.js +67 -0
- package/dist/ports.d.ts +222 -0
- package/dist/ports.js +3 -0
- package/dist/room-context.d.ts +60 -0
- package/dist/room-context.js +87 -0
- package/dist/styles/activity-chart.css +127 -0
- package/dist/styles/attachments.css +29 -0
- package/dist/styles/favicon.css +73 -0
- package/dist/styles/history-room.css +18 -0
- package/dist/styles/host-inputs.css +250 -0
- package/dist/styles/image-gallery.css +30 -0
- package/dist/styles/ingest.css +51 -0
- package/dist/styles/message-preview.css +34 -0
- package/dist/styles/models-chart.css +66 -0
- package/dist/styles/project-chart.css +19 -0
- package/dist/styles/reader.css +33 -0
- package/dist/styles/room.css +1411 -0
- package/dist/styles/search.css +252 -0
- package/dist/styles/transcript-activity.css +70 -0
- package/dist/styles/transcript-head.css +220 -0
- package/dist/styles/transcript-loading.css +57 -0
- package/dist/styles/transcript.css +1226 -0
- package/package.json +61 -4
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// The heavier detail bodies — a change's diff, a question's options, a
|
|
3
|
+
// report's findings, a produced document, an external call's fields, a
|
|
4
|
+
// collaboration's participants.
|
|
5
|
+
//
|
|
6
|
+
// Split out of `LineDetail.tsx` only for size: the dispatcher there names one
|
|
7
|
+
// renderer per `LedgerDetail` kind, and these are the ones long enough to
|
|
8
|
+
// bury it. Every rule they obey is the same one — show what the ROW proved,
|
|
9
|
+
// state absence rather than faking it, and cap what would otherwise become a
|
|
10
|
+
// scroll trap inside the measure.
|
|
11
|
+
import { useMemo, useState } from "react";
|
|
12
|
+
import { FileIcon } from "@vibecook/mille-ui/icons";
|
|
13
|
+
import { vibefieldIconTheme } from "@vibecook/mille-ui/icons/vibefield";
|
|
14
|
+
import { canonicalText, commandDirectoryContext, commandPreviewText, diffstatText, resourceDisplay, splitPath, TASK_PREVIEW_LIMIT, taskDisplayRows, } from "../../lib/transcript/index.js";
|
|
15
|
+
import { parseDiff } from "../file-viewer/diff/index.js";
|
|
16
|
+
import { highlight, languageFor, PLAIN_TEXT } from "../file-viewer/syntax/index.js";
|
|
17
|
+
import { useRoom } from "../../room-context.js";
|
|
18
|
+
import { DirectoryGlyph } from "./glyphs.js";
|
|
19
|
+
/** Q5 A's cap: the hunk that matters, where you are reading. */
|
|
20
|
+
const DIFF_LINE_CAP = 12;
|
|
21
|
+
/** A bounded list is a list; an unbounded one is a scroll trap in the measure. */
|
|
22
|
+
export const LIST_CAP = 24;
|
|
23
|
+
const SHELL = languageFor("command.sh") ?? PLAIN_TEXT;
|
|
24
|
+
const LANGUAGE_FILE = {
|
|
25
|
+
bash: "command.sh",
|
|
26
|
+
bun: "command.js",
|
|
27
|
+
deno: "command.js",
|
|
28
|
+
fish: "command.sh",
|
|
29
|
+
javascript: "command.js",
|
|
30
|
+
js: "command.js",
|
|
31
|
+
lua: "command.lua",
|
|
32
|
+
node: "command.js",
|
|
33
|
+
nodejs: "command.js",
|
|
34
|
+
php: "command.php",
|
|
35
|
+
py: "command.py",
|
|
36
|
+
python: "command.py",
|
|
37
|
+
ruby: "command.rb",
|
|
38
|
+
sh: "command.sh",
|
|
39
|
+
shell: "command.sh",
|
|
40
|
+
sql: "command.sql",
|
|
41
|
+
sqlite3: "command.sql",
|
|
42
|
+
typescript: "command.ts",
|
|
43
|
+
ts: "command.ts",
|
|
44
|
+
zsh: "command.sh",
|
|
45
|
+
};
|
|
46
|
+
function namedLanguage(name) {
|
|
47
|
+
if (name === null)
|
|
48
|
+
return null;
|
|
49
|
+
const normalized = name.trim().toLowerCase();
|
|
50
|
+
const file = LANGUAGE_FILE[normalized] ?? "command." + normalized;
|
|
51
|
+
return languageFor(file);
|
|
52
|
+
}
|
|
53
|
+
function heredocLanguage(opener) {
|
|
54
|
+
const redirected = opener.match(/>\s*["']?([^\s"';&|]+)["']?\s+<<-?/);
|
|
55
|
+
if (redirected !== null) {
|
|
56
|
+
const fromTarget = languageFor(redirected[1]);
|
|
57
|
+
if (fromTarget !== null)
|
|
58
|
+
return fromTarget;
|
|
59
|
+
}
|
|
60
|
+
const interpreter = opener.match(/(?:^|[;&|]\s*)(?:env\s+)?(python(?:\d+(?:\.\d+)*)?|nodejs?|deno|bun|ruby|php|lua|bash|zsh|fish|sh|sqlite3)\b/i)?.[1];
|
|
61
|
+
if (interpreter === undefined)
|
|
62
|
+
return null;
|
|
63
|
+
return namedLanguage(interpreter.toLowerCase().replace(/^python.*$/, "python"));
|
|
64
|
+
}
|
|
65
|
+
/** A command is shell until a declared heredoc body begins. When its launcher
|
|
66
|
+
* or redirect target names a language, use the file viewer's grammar for that
|
|
67
|
+
* body and return to shell for the delimiter and anything after it. */
|
|
68
|
+
function commandHighlight(text, language, code) {
|
|
69
|
+
if (code)
|
|
70
|
+
return highlight(text, namedLanguage(language) ?? PLAIN_TEXT);
|
|
71
|
+
const lines = text.split("\n");
|
|
72
|
+
const markerMatch = lines[0]?.match(/<<-?\s*(?:'([^']+)'|"([^"]+)"|([A-Za-z_][A-Za-z0-9_]*))/);
|
|
73
|
+
const embedded = markerMatch === undefined || markerMatch === null
|
|
74
|
+
? null
|
|
75
|
+
: heredocLanguage(lines[0]);
|
|
76
|
+
if (markerMatch === undefined || markerMatch === null || embedded === null || lines.length < 2) {
|
|
77
|
+
return highlight(text, SHELL);
|
|
78
|
+
}
|
|
79
|
+
const marker = markerMatch[1] ?? markerMatch[2] ?? markerMatch[3];
|
|
80
|
+
const close = lines.findIndex((line, at) => at > 0 && line.trim() === marker);
|
|
81
|
+
const bodyEnd = close === -1 ? lines.length : close;
|
|
82
|
+
const out = [...highlight(lines[0], SHELL)];
|
|
83
|
+
if (bodyEnd > 1)
|
|
84
|
+
out.push(...highlight(lines.slice(1, bodyEnd).join("\n"), embedded));
|
|
85
|
+
if (close !== -1)
|
|
86
|
+
out.push(...highlight(lines.slice(close).join("\n"), SHELL));
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
89
|
+
function HighlightedCommand({ text, language, code, }) {
|
|
90
|
+
const lines = useMemo(() => commandHighlight(text, language, code), [code, language, text]);
|
|
91
|
+
return (_jsx("pre", { className: code ? "tr-diag tr-command__text" : "tr-command__text", "aria-label": text, children: _jsx("code", { children: lines.map((line, row) => (_jsx("span", { className: "tr-command__line", children: line.map((token, at) => token.kind === "plain" ? (_jsx("span", { children: token.text }, at)) : (_jsx("span", { "data-t": token.kind, children: token.text }, at))) }, row))) }) }));
|
|
92
|
+
}
|
|
93
|
+
export function PathList({ paths, total, onOpenPath, }) {
|
|
94
|
+
const shown = paths.slice(0, LIST_CAP);
|
|
95
|
+
const hasOpenablePath = onOpenPath !== undefined && shown.some((path) => path.read !== undefined);
|
|
96
|
+
return (_jsxs("ul", { className: "tr-paths", "data-openable": hasOpenablePath || undefined, children: [shown.map((path, at) => {
|
|
97
|
+
const openable = onOpenPath !== undefined && path.read !== undefined;
|
|
98
|
+
const name = splitPath(path.label).name || path.name || path.label;
|
|
99
|
+
const entryKind = path.resource.type === "directory" ? 1 : path.resource.type === "file" ? 0 : null;
|
|
100
|
+
const label = (_jsxs(_Fragment, { children: [entryKind !== null && (_jsx(FileIcon, { ariaLabel: `${name} ${entryKind === 1 ? "folder" : "file"}`, className: "tr-paths__icon", entry: { name, kind: entryKind }, expanded: false, theme: vibefieldIconTheme })), _jsx("span", { className: "name", children: name }), path.range !== undefined && _jsx("span", { className: "tr-paths__range", children: path.range })] }));
|
|
101
|
+
return (_jsx("li", { title: path.label, children: openable ? (_jsx("button", { type: "button", className: "tr-paths__file", title: path.label, "aria-label": `Open ${path.label}${path.range === undefined ? "" : `, ${path.range}`}`, onClick: () => onOpenPath?.(path), children: label })) : (_jsx("span", { className: "tr-paths__entry", children: label })) }, `${path.label}-${at}`));
|
|
102
|
+
}), total > shown.length && _jsxs("li", { className: "tr-more", children: ["\u2026 ", total - shown.length, " more"] })] }));
|
|
103
|
+
}
|
|
104
|
+
const TASK_STATUS_LABEL = {
|
|
105
|
+
pending: "pending",
|
|
106
|
+
in_progress: "in progress",
|
|
107
|
+
completed: "done",
|
|
108
|
+
failed: "failed",
|
|
109
|
+
cancelled: "cancelled",
|
|
110
|
+
unknown: "status unknown",
|
|
111
|
+
};
|
|
112
|
+
const TASK_CHANGE_LABEL = {
|
|
113
|
+
added: "added",
|
|
114
|
+
started: "started",
|
|
115
|
+
done: "done",
|
|
116
|
+
reopened: "reopened",
|
|
117
|
+
failed: "failed",
|
|
118
|
+
cancelled: "cancelled",
|
|
119
|
+
updated: "updated",
|
|
120
|
+
};
|
|
121
|
+
/** A task action opens to a three-row glimpse immediately after that action.
|
|
122
|
+
* The changed row stays last; the reader can disclose the complete board. */
|
|
123
|
+
export function Tasks({ tasks, total, changedTaskId, change, }) {
|
|
124
|
+
const [showFull, setShowFull] = useState(false);
|
|
125
|
+
const all = useMemo(() => taskDisplayRows(tasks, changedTaskId, true), [tasks, changedTaskId]);
|
|
126
|
+
const shown = useMemo(() => (showFull ? all : taskDisplayRows(tasks, changedTaskId, false)), [all, changedTaskId, showFull, tasks]);
|
|
127
|
+
const canToggle = all.length > TASK_PREVIEW_LIMIT;
|
|
128
|
+
const unrecorded = Math.max(0, total - all.length);
|
|
129
|
+
return (_jsxs("ul", { className: "tr-tasks", "aria-label": "Task list", children: [shown.length === 0 && _jsx("li", { className: "tr-tasks__empty", children: "No tasks at this point" }), shown.map((task) => {
|
|
130
|
+
const status = task.status ?? "unknown";
|
|
131
|
+
const changed = task.task_id === changedTaskId ? change : null;
|
|
132
|
+
const metadata = [
|
|
133
|
+
`#${task.task_id}`,
|
|
134
|
+
task.owner === null ? null : task.owner,
|
|
135
|
+
task.blocker_ids.length === 0
|
|
136
|
+
? null
|
|
137
|
+
: `blocked by ${task.blocker_ids.map((id) => `#${id}`).join(", ")}`,
|
|
138
|
+
].filter((item) => item !== null);
|
|
139
|
+
return (_jsxs("li", { className: "tr-task", "data-change": changed ?? undefined, "data-status": status, children: [_jsx("span", { "aria-label": TASK_STATUS_LABEL[status], className: "tr-task__check", role: "img", title: TASK_STATUS_LABEL[status] }), _jsx("span", { className: "tr-task__subject", title: task.subject ?? `Task #${task.task_id}`, children: task.subject ?? `Task #${task.task_id}` }), _jsx("span", { className: "tr-task__meta", children: metadata.join(" · ") }), changed !== null && _jsx("span", { className: "tr-task__delta", children: TASK_CHANGE_LABEL[changed] })] }, task.task_id));
|
|
140
|
+
}), canToggle && (_jsx("li", { className: "tr-tasks__toggle", children: _jsx("button", { type: "button", "aria-expanded": showFull, "aria-label": showFull ? "Show less" : `Show all ${total} tasks`, onClick: () => setShowFull((value) => !value), children: showFull ? "show less" : "show full tasks" }) })), showFull && unrecorded > 0 && (_jsxs("li", { className: "tr-more", children: ["\u2026 ", unrecorded, " more not recorded"] }))] }));
|
|
141
|
+
}
|
|
142
|
+
export function DiffLines({ delta }) {
|
|
143
|
+
const text = delta.diff === null ? "" : canonicalText(delta.diff);
|
|
144
|
+
if (text.trim() === "") {
|
|
145
|
+
return _jsx("p", { className: "tr-text tr-quiet", children: "no diff recorded" });
|
|
146
|
+
}
|
|
147
|
+
const parsed = parseDiff(text);
|
|
148
|
+
const rows = [];
|
|
149
|
+
let drawn = 0;
|
|
150
|
+
let total = 0;
|
|
151
|
+
for (const hunk of parsed.hunks) {
|
|
152
|
+
for (const line of hunk.lines) {
|
|
153
|
+
total += 1;
|
|
154
|
+
if (drawn >= DIFF_LINE_CAP)
|
|
155
|
+
continue;
|
|
156
|
+
drawn += 1;
|
|
157
|
+
const number = line.newNumber ?? line.oldNumber ?? "";
|
|
158
|
+
rows.push(_jsxs("div", { className: line.kind === "add" ? "add" : line.kind === "del" ? "del" : "ctx", children: [_jsx("span", { children: number }), _jsx("span", { children: line.kind === "add" ? "+" : line.kind === "del" ? "−" : " " }), _jsx("span", { children: line.text })] }, total));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// git said something this parser could not read as hunks — the honest
|
|
162
|
+
// answer is the stored text, still capped, rather than an empty frame.
|
|
163
|
+
if (rows.length === 0) {
|
|
164
|
+
const lines = text.split("\n");
|
|
165
|
+
total = lines.length;
|
|
166
|
+
lines.slice(0, DIFF_LINE_CAP).forEach((line, at) => {
|
|
167
|
+
rows.push(_jsxs("div", { className: "ctx", children: [_jsx("span", {}), _jsx("span", { children: " " }), _jsx("span", { children: line })] }, at));
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return (_jsxs("div", { className: "tr-diff", children: [rows, total > DIFF_LINE_CAP && _jsxs("div", { className: "more", children: ["\u2026 ", total - DIFF_LINE_CAP, " more lines"] })] }));
|
|
171
|
+
}
|
|
172
|
+
export function DiffDetail({ deltas, diffstat, }) {
|
|
173
|
+
const stat = diffstatText(diffstat.added, diffstat.removed);
|
|
174
|
+
return (_jsxs(_Fragment, { children: [deltas.slice(0, 4).map((delta, at) => (_jsxs("div", { children: [_jsxs("div", { className: "tr-detail__bar", children: [_jsx("span", { className: "path", children: resourceDisplay(delta.path, {}) }), at === 0 && stat !== null && _jsx("span", { children: stat })] }), _jsx(DiffLines, { delta: delta })] }, at))), deltas.length > 4 && (_jsxs("p", { className: "tr-text tr-quiet", children: ["\u2026 ", deltas.length - 4, " more files in this change"] }))] }));
|
|
175
|
+
}
|
|
176
|
+
export function CommandList({ commands, code, }) {
|
|
177
|
+
const directory = commandDirectoryContext(commands);
|
|
178
|
+
return (_jsxs(_Fragment, { children: [directory !== null && (_jsxs("span", { "aria-label": directory.title, className: "tr-command-cwd", title: directory.title, children: [_jsx(DirectoryGlyph, {}), _jsx("bdi", { children: directory.label })] })), code ? (_jsx("div", { className: "tr-command-stack", children: commands.map((command, at) => (_jsx(CommandSource, { command: command, code: true }, at))) })) : (_jsxs("ul", { className: "tr-cmds", children: [commands.slice(0, LIST_CAP).map((command, at) => (_jsx(CommandSource, { command: command, code: false }, at))), commands.length > LIST_CAP && (_jsxs("li", { className: "tr-more", children: ["\u2026 ", commands.length - LIST_CAP, " more"] }))] }))] }));
|
|
179
|
+
}
|
|
180
|
+
function CommandSource({ command, code }) {
|
|
181
|
+
const { sessions } = useRoom();
|
|
182
|
+
const [full, setFull] = useState(null);
|
|
183
|
+
const [expanded, setExpanded] = useState(false);
|
|
184
|
+
const [loading, setLoading] = useState(false);
|
|
185
|
+
const [failed, setFailed] = useState(false);
|
|
186
|
+
const expandable = command.sourceTruncated && command.sessionId !== null && command.timelineId !== null;
|
|
187
|
+
const disclose = async () => {
|
|
188
|
+
if (expanded) {
|
|
189
|
+
setExpanded(false);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (!expandable || loading)
|
|
193
|
+
return;
|
|
194
|
+
if (full !== null) {
|
|
195
|
+
setExpanded(true);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
setLoading(true);
|
|
199
|
+
setFailed(false);
|
|
200
|
+
try {
|
|
201
|
+
const sessionId = command.sessionId;
|
|
202
|
+
const response = await sessions.run(sessionId, (client) => client.command(sessionId, command.timelineId));
|
|
203
|
+
setFull(response.command);
|
|
204
|
+
setExpanded(true);
|
|
205
|
+
}
|
|
206
|
+
catch {
|
|
207
|
+
setFailed(true);
|
|
208
|
+
}
|
|
209
|
+
finally {
|
|
210
|
+
setLoading(false);
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
const text = expanded && full !== null
|
|
214
|
+
? full
|
|
215
|
+
: commandPreviewText(command.command, command.sourceTruncated);
|
|
216
|
+
const body = _jsx(HighlightedCommand, { code: code, language: command.language, text: text });
|
|
217
|
+
const more = expandable ? (_jsx("button", { "aria-expanded": expanded, className: "tr-command__more", type: "button", onClick: disclose, disabled: loading, children: loading
|
|
218
|
+
? "loading full command…"
|
|
219
|
+
: failed
|
|
220
|
+
? "couldn’t load · retry"
|
|
221
|
+
: expanded
|
|
222
|
+
? "show preview"
|
|
223
|
+
: "show full command" })) : null;
|
|
224
|
+
return code ? (_jsxs("div", { className: "tr-command ah-syntax", "data-full": expanded || undefined, children: [body, more] })) : (_jsxs("li", { className: "tr-command ah-syntax", "data-full": expanded || undefined, children: [_jsx("span", { "aria-hidden": "true", className: "tr-command__prompt", children: ">_" }), body, more] }));
|
|
225
|
+
}
|
|
226
|
+
function answerText(question, answers) {
|
|
227
|
+
return answers
|
|
228
|
+
.filter((answer) => answer.question_id === question.id)
|
|
229
|
+
.flatMap((answer) => answer.values.map(canonicalText));
|
|
230
|
+
}
|
|
231
|
+
/** Conversation, so it opens by default: the questions with their options and
|
|
232
|
+
* the answer marked in primary ink. */
|
|
233
|
+
export function Questions({ questions, answers, }) {
|
|
234
|
+
return (_jsx("dl", { className: "tr-kv", children: questions.map((question) => {
|
|
235
|
+
const chosen = answerText(question, answers);
|
|
236
|
+
const free = chosen.filter((value) => !question.options.some((option) => option.id === value || option.label === value));
|
|
237
|
+
return (_jsxs("div", { className: "tr-kv__pair", children: [_jsx("dt", { children: question.header ?? canonicalText(question.prompt) }), _jsxs("dd", { "data-prose": "", children: [question.options.length === 0
|
|
238
|
+
? chosen.join(" · ") || "no answer recorded"
|
|
239
|
+
: question.options.map((option, at) => {
|
|
240
|
+
const picked = chosen.includes(option.id) || chosen.includes(option.label);
|
|
241
|
+
return (_jsxs("span", { children: [at > 0 && " · ", picked ? _jsxs("b", { children: [option.label, " (chosen)"] }) : option.label] }, option.id));
|
|
242
|
+
}), free.length > 0 && question.options.length > 0 && (_jsxs("span", { children: [" · ", _jsx("b", { children: free.join(", ") })] }))] })] }, question.id));
|
|
243
|
+
}) }));
|
|
244
|
+
}
|
|
245
|
+
export function Findings({ findings, total }) {
|
|
246
|
+
return (_jsxs("dl", { className: "tr-kv", children: [findings.slice(0, LIST_CAP).map((finding, at) => (_jsxs("div", { className: "tr-kv__pair", children: [_jsx("dt", { children: finding.severity }), _jsxs("dd", { "data-prose": "", children: [_jsx("b", { children: finding.title }), finding.summary !== null && ` — ${canonicalText(finding.summary)}`, finding.resources.length > 0 && (_jsx("span", { className: "n", children: finding.resources.map((resource) => resourceDisplay(resource, {})).join(", ") }))] })] }, at))), total > findings.length && (_jsxs("div", { className: "tr-kv__pair", children: [_jsx("dt", {}), _jsxs("dd", { "data-prose": "", children: ["\u2026 ", total - findings.length, " more"] })] }))] }));
|
|
247
|
+
}
|
|
248
|
+
function displayText(value) {
|
|
249
|
+
switch (value.type) {
|
|
250
|
+
case "text":
|
|
251
|
+
case "number":
|
|
252
|
+
return value.value;
|
|
253
|
+
case "boolean":
|
|
254
|
+
return value.value ? "yes" : "no";
|
|
255
|
+
case "resource":
|
|
256
|
+
return resourceDisplay(value.value, {});
|
|
257
|
+
case "list":
|
|
258
|
+
return value.value
|
|
259
|
+
.map((item) => (item.type === "boolean" ? (item.value ? "yes" : "no") : item.value))
|
|
260
|
+
.join(", ");
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
export function Fields({ fields }) {
|
|
264
|
+
if (fields.length === 0)
|
|
265
|
+
return null;
|
|
266
|
+
return (_jsx("dl", { className: "tr-kv", children: fields.map((field, at) => (_jsxs("div", { className: "tr-kv__pair", children: [_jsx("dt", { children: field.label }), _jsx("dd", { "data-prose": "", children: displayText(field.value) })] }, at))) }));
|
|
267
|
+
}
|
|
268
|
+
function DocumentBlocks({ blocks }) {
|
|
269
|
+
return (_jsx(_Fragment, { children: blocks.map((block, at) => {
|
|
270
|
+
switch (block.type) {
|
|
271
|
+
case "field":
|
|
272
|
+
return _jsx(Fields, { fields: [block.field] }, at);
|
|
273
|
+
case "list":
|
|
274
|
+
return (_jsxs("ul", { className: "tr-paths", children: [block.heading !== null && _jsx("li", { className: "tr-more", children: block.heading }), block.items.slice(0, LIST_CAP).map((item, index) => (_jsx("li", { children: item.type === "boolean" ? (item.value ? "yes" : "no") : item.value }, index)))] }, at));
|
|
275
|
+
case "table":
|
|
276
|
+
return (_jsxs("table", { className: "tr-dtable", children: [block.heading !== null && _jsx("caption", { children: block.heading }), _jsx("thead", { children: _jsx("tr", { children: block.columns.map((column, index) => (_jsx("th", { children: column }, index))) }) }), _jsx("tbody", { children: block.rows.slice(0, LIST_CAP).map((row, index) => (_jsx("tr", { children: row.map((cell, column) => (_jsx("td", { children: cell.type === "boolean" ? (cell.value ? "yes" : "no") : cell.value }, column))) }, index))) })] }, at));
|
|
277
|
+
case "section":
|
|
278
|
+
return (_jsxs("div", { children: [_jsx("p", { className: "tr-text tr-quiet", children: block.heading }), _jsx(DocumentBlocks, { blocks: block.blocks })] }, at));
|
|
279
|
+
}
|
|
280
|
+
}) }));
|
|
281
|
+
}
|
|
282
|
+
export function Document({ document }) {
|
|
283
|
+
if (document.type === "member") {
|
|
284
|
+
return _jsx("p", { className: "tr-text", children: document.preview });
|
|
285
|
+
}
|
|
286
|
+
return (_jsxs(_Fragment, { children: [document.summary !== null && _jsx("p", { className: "tr-text", children: canonicalText(document.summary) }), _jsx(DocumentBlocks, { blocks: document.blocks }), document.resources.length > 0 && (_jsx(PathList, { paths: document.resources.map((resource) => ({
|
|
287
|
+
label: resourceDisplay(resource, {}),
|
|
288
|
+
dir: "",
|
|
289
|
+
name: resourceDisplay(resource, {}),
|
|
290
|
+
resource,
|
|
291
|
+
})), total: document.resources.length }))] }));
|
|
292
|
+
}
|
|
293
|
+
export function Participants({ participants, total, body, }) {
|
|
294
|
+
return (_jsxs(_Fragment, { children: [body !== null && _jsx("p", { className: "tr-text", children: body }), _jsxs("dl", { className: "tr-kv", children: [participants.slice(0, LIST_CAP).map((participant, at) => (_jsxs("div", { className: "tr-kv__pair", children: [_jsx("dt", { children: participant.name }), _jsx("dd", { "data-prose": "", children: [participant.role, participant.state].filter((piece) => piece !== null).join(" · ") })] }, at))), total > participants.length && (_jsxs("div", { className: "tr-kv__pair", children: [_jsx("dt", {}), _jsxs("dd", { "data-prose": "", children: ["\u2026 ", total - participants.length, " more"] })] }))] })] }));
|
|
295
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare function DisclosureState({ children }: {
|
|
3
|
+
readonly children: ReactNode;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
5
|
+
export declare function useRowDisclosure(key: string, initial?: boolean): [boolean, (value: boolean | ((open: boolean) => boolean)) => void];
|
|
6
|
+
export declare function useGroupDisclosure(keys: readonly string[], revision: number): [boolean | undefined, (open: boolean) => void];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Session-local disclosure state survives an event moving into an older page's
|
|
3
|
+
// activity group. It is deliberately separate from the room's fold preference.
|
|
4
|
+
import { createContext, useCallback, useContext, useState, useSyncExternalStore } from "react";
|
|
5
|
+
import { createDisclosureStore } from "./disclosure-store.js";
|
|
6
|
+
const DisclosureContext = createContext(null);
|
|
7
|
+
export function DisclosureState({ children }) {
|
|
8
|
+
const [store] = useState(createDisclosureStore);
|
|
9
|
+
return _jsx(DisclosureContext.Provider, { value: store, children: children });
|
|
10
|
+
}
|
|
11
|
+
const subscribeNothing = () => () => { };
|
|
12
|
+
const noValue = () => undefined;
|
|
13
|
+
export function useRowDisclosure(key, initial = false) {
|
|
14
|
+
const store = useContext(DisclosureContext);
|
|
15
|
+
const [fallback, setFallback] = useState(initial);
|
|
16
|
+
const read = useCallback(() => store?.row(key), [store, key]);
|
|
17
|
+
const saved = useSyncExternalStore(store?.subscribe ?? subscribeNothing, read, noValue);
|
|
18
|
+
const open = saved ?? fallback;
|
|
19
|
+
const setOpen = useCallback((value) => {
|
|
20
|
+
const next = typeof value === "function" ? value(store?.row(key) ?? fallback) : value;
|
|
21
|
+
if (store === null)
|
|
22
|
+
setFallback(next);
|
|
23
|
+
else
|
|
24
|
+
store.setRow(key, next);
|
|
25
|
+
}, [store, key, fallback]);
|
|
26
|
+
return [open, setOpen];
|
|
27
|
+
}
|
|
28
|
+
export function useGroupDisclosure(keys, revision) {
|
|
29
|
+
const store = useContext(DisclosureContext);
|
|
30
|
+
useSyncExternalStore(store?.subscribe ?? subscribeNothing, store?.version ?? (() => 0), () => 0);
|
|
31
|
+
return [store?.group(keys, revision), (open) => store?.setGroup(keys, open, revision)];
|
|
32
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function createDisclosureStore(): {
|
|
2
|
+
subscribe(listener: () => void): () => void;
|
|
3
|
+
version: () => number;
|
|
4
|
+
row: (key: string) => boolean | undefined;
|
|
5
|
+
setRow(key: string, open: boolean): void;
|
|
6
|
+
group(keys: readonly string[], revision: number): boolean | undefined;
|
|
7
|
+
setGroup(keys: readonly string[], open: boolean, revision: number): void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function createDisclosureStore() {
|
|
2
|
+
const rows = new Map();
|
|
3
|
+
const groups = new Map();
|
|
4
|
+
const listeners = new Set();
|
|
5
|
+
let sequence = 0;
|
|
6
|
+
const changed = () => { sequence += 1; for (const listener of listeners)
|
|
7
|
+
listener(); };
|
|
8
|
+
return {
|
|
9
|
+
subscribe(listener) { listeners.add(listener); return () => { listeners.delete(listener); }; },
|
|
10
|
+
version: () => sequence,
|
|
11
|
+
row: (key) => rows.get(key),
|
|
12
|
+
setRow(key, open) { if (rows.get(key) !== open) {
|
|
13
|
+
rows.set(key, open);
|
|
14
|
+
changed();
|
|
15
|
+
} },
|
|
16
|
+
group(keys, revision) {
|
|
17
|
+
let latest;
|
|
18
|
+
for (const key of keys) {
|
|
19
|
+
const value = groups.get(key);
|
|
20
|
+
if (value?.revision === revision && (latest === undefined || value.sequence > latest.sequence))
|
|
21
|
+
latest = value;
|
|
22
|
+
}
|
|
23
|
+
return latest?.open;
|
|
24
|
+
},
|
|
25
|
+
setGroup(keys, open, revision) {
|
|
26
|
+
for (const key of keys)
|
|
27
|
+
groups.set(key, { open, revision, sequence: sequence + 1 });
|
|
28
|
+
changed();
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SessionRow, TimelineEntry } from "@vibefield/rosetta-protocol";
|
|
2
|
+
import type { DayEntry, DocumentOptions, Sitting, Turn } from "../../lib/transcript/index.js";
|
|
3
|
+
import type { PlannedSitting } from "./document-plan.js";
|
|
4
|
+
export interface TranscriptModel {
|
|
5
|
+
readonly turns: readonly Turn[];
|
|
6
|
+
readonly sittings: readonly Sitting[];
|
|
7
|
+
readonly days: readonly DayEntry[];
|
|
8
|
+
readonly plan: readonly PlannedSitting[];
|
|
9
|
+
/** `timeline_id` → the `timeline_id` whose element actually draws it. */
|
|
10
|
+
readonly representatives: ReadonlyMap<string, string>;
|
|
11
|
+
/** The row after a discontinuity → how many rows the page is missing. */
|
|
12
|
+
readonly gaps: ReadonlyMap<string, number>;
|
|
13
|
+
}
|
|
14
|
+
export declare function transcriptModel(rows: readonly TimelineEntry[], session: SessionRow | null, homeDirectory: string | null, now: number, options?: DocumentOptions): TranscriptModel;
|
|
15
|
+
export declare function useTranscriptModel(rows: readonly TimelineEntry[], session: SessionRow | null, homeDirectory: string | null, now: number, options?: DocumentOptions): TranscriptModel;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// One derivation of the document, shared by the column and by every child run.
|
|
2
|
+
//
|
|
3
|
+
// The turns, the sittings, the day list and the plan that reconciles them are
|
|
4
|
+
// all pure functions of the loaded rows; this hook memoises them together so
|
|
5
|
+
// the column and the document can never be looking at two different documents.
|
|
6
|
+
//
|
|
7
|
+
// It also answers two questions the DOM asks:
|
|
8
|
+
//
|
|
9
|
+
// · Which element DRAWS a given row? A fold collapses several rows into one
|
|
10
|
+
// line, so a search hit's `timeline_id` may have no element of its own.
|
|
11
|
+
// The representative map sends the landing to the element that contains it
|
|
12
|
+
// instead of failing to find one.
|
|
13
|
+
// · Where did the projection skip? Ordinals are contiguous in a loaded page,
|
|
14
|
+
// so a jump is a real absence — D33's data gap, stated rather than
|
|
15
|
+
// silently closed over.
|
|
16
|
+
import { useMemo } from "react";
|
|
17
|
+
import { dayList, documentTurns, sittings } from "../../lib/transcript/index.js";
|
|
18
|
+
import { documentPlan } from "./document-plan.js";
|
|
19
|
+
function buildRepresentatives(turns) {
|
|
20
|
+
const map = new Map();
|
|
21
|
+
const claim = (rows, by) => {
|
|
22
|
+
for (const row of rows)
|
|
23
|
+
map.set(row.timeline_id, by);
|
|
24
|
+
};
|
|
25
|
+
for (const turn of turns) {
|
|
26
|
+
if (turn.prompt !== null) {
|
|
27
|
+
claim(turn.prompt.rows, turn.prompt.row.timeline_id);
|
|
28
|
+
if (turn.prompt.commandOutputRow !== null && turn.prompt.setting === null) {
|
|
29
|
+
const id = turn.prompt.commandOutputRow.timeline_id;
|
|
30
|
+
map.set(id, id);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
for (const segment of turn.segments) {
|
|
34
|
+
if (segment.kind === "compaction") {
|
|
35
|
+
claim(segment.rows, segment.row.timeline_id);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (segment.kind === "ledger") {
|
|
39
|
+
for (const member of segment.members) {
|
|
40
|
+
if (member.kind !== "line") {
|
|
41
|
+
map.set(member.row.timeline_id, member.row.timeline_id);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const key = member.line.rows[0]?.timeline_id;
|
|
45
|
+
if (key !== undefined)
|
|
46
|
+
claim(member.line.rows, key);
|
|
47
|
+
}
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
map.set(segment.row.timeline_id, segment.row.timeline_id);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return map;
|
|
54
|
+
}
|
|
55
|
+
function buildGaps(rows) {
|
|
56
|
+
const gaps = new Map();
|
|
57
|
+
const previousBySession = new Map();
|
|
58
|
+
for (const row of rows) {
|
|
59
|
+
const previous = previousBySession.get(row.session_id);
|
|
60
|
+
const missing = previous === undefined ? 0 : row.ordinal - previous - 1;
|
|
61
|
+
if (missing > 0)
|
|
62
|
+
gaps.set(row.timeline_id, missing);
|
|
63
|
+
previousBySession.set(row.session_id, row.ordinal);
|
|
64
|
+
}
|
|
65
|
+
return gaps;
|
|
66
|
+
}
|
|
67
|
+
export function transcriptModel(rows, session, homeDirectory, now, options = {}) {
|
|
68
|
+
// Sittings first: a run never straddles a pill, so the turns are cut at
|
|
69
|
+
// every sitting's first row (`cutBefore`) before they are folded.
|
|
70
|
+
const list = sittings(rows, now);
|
|
71
|
+
const gaps = buildGaps(rows);
|
|
72
|
+
const cutBefore = new Set([...(options.cutBefore ?? gaps.keys()), ...list
|
|
73
|
+
.slice(1)
|
|
74
|
+
.map((sitting) => sitting.rows[0]?.timeline_id)
|
|
75
|
+
.filter((id) => id !== undefined)]);
|
|
76
|
+
const turns = documentTurns(rows, {
|
|
77
|
+
...options,
|
|
78
|
+
cutBefore,
|
|
79
|
+
context: { cwd: session?.cwd ?? null, home: homeDirectory },
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
turns,
|
|
83
|
+
sittings: list,
|
|
84
|
+
days: dayList(list),
|
|
85
|
+
plan: documentPlan(turns, list),
|
|
86
|
+
representatives: buildRepresentatives(turns),
|
|
87
|
+
gaps,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export function useTranscriptModel(rows, session, homeDirectory, now, options = {}) {
|
|
91
|
+
const cwd = session?.cwd ?? null;
|
|
92
|
+
const sharedKey = [...(options.sharedCollaborationSessionIds ?? [])].sort().join("\u0000");
|
|
93
|
+
const cutKey = [...(options.cutBefore ?? [])].sort().join("\u0000");
|
|
94
|
+
return useMemo(() => {
|
|
95
|
+
const sharedCollaborationSessionIds = new Set(sharedKey === "" ? [] : sharedKey.split("\u0000"));
|
|
96
|
+
return transcriptModel(rows, session, homeDirectory, now, {
|
|
97
|
+
...options,
|
|
98
|
+
sharedCollaborationSessionIds,
|
|
99
|
+
});
|
|
100
|
+
// `now` only names the day a stamp falls in; re-deriving the whole
|
|
101
|
+
// document on every clock tick would be a memo that never hits.
|
|
102
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
103
|
+
}, [rows, cwd, homeDirectory, sharedKey, cutKey]);
|
|
104
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Prompt, Segment, Sitting, Turn } from "../../lib/transcript/index.js";
|
|
2
|
+
/** One drawn block: a slice of one turn, inside exactly one sitting. */
|
|
3
|
+
export interface TurnPart {
|
|
4
|
+
readonly key: string;
|
|
5
|
+
readonly sittingIndex: number;
|
|
6
|
+
readonly turn: Turn;
|
|
7
|
+
/** The prompts this part opens with — several only for grouped settings. */
|
|
8
|
+
readonly prompts: readonly Prompt[];
|
|
9
|
+
/** Segments before the head (leading markers) and after it. */
|
|
10
|
+
readonly before: readonly Segment[];
|
|
11
|
+
readonly after: readonly Segment[];
|
|
12
|
+
/** T-4's eyebrow belongs to this part. */
|
|
13
|
+
readonly showHead: boolean;
|
|
14
|
+
/** The first row drawn here — the paging hook's landing contract. */
|
|
15
|
+
readonly firstRowId: string | null;
|
|
16
|
+
/** The first stamp under this part, for placing an unanchored child run. */
|
|
17
|
+
readonly at: number | null;
|
|
18
|
+
}
|
|
19
|
+
export interface PlannedSitting {
|
|
20
|
+
readonly sitting: Sitting;
|
|
21
|
+
readonly parts: readonly TurnPart[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Fold turns and sittings into the sections the column draws. Sittings that
|
|
25
|
+
* end up with nothing drawable are dropped: a pill over an empty section would
|
|
26
|
+
* be a cut with nothing on the far side of it.
|
|
27
|
+
*/
|
|
28
|
+
export declare function documentPlan(turns: readonly Turn[], sittings: readonly Sitting[]): PlannedSitting[];
|