@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,112 @@
|
|
|
1
|
+
import { fileActionTargetForId } from "@vibecook/mille-ui";
|
|
2
|
+
import { createCommandRegistry } from "@vibecook/mille-ui/commands";
|
|
3
|
+
/** One registry per engine generation. Menu commands receive Mille's live
|
|
4
|
+
* context; keyboard commands get the same selection through its observers. */
|
|
5
|
+
export function createWorktreeFileCommands(engine, environment) {
|
|
6
|
+
let selectedIds = new Set();
|
|
7
|
+
let focusedId = null;
|
|
8
|
+
const emptyIds = new Set();
|
|
9
|
+
const available = () => {
|
|
10
|
+
const { actions, stale } = environment();
|
|
11
|
+
return !stale && typeof actions?.fileAction === "function";
|
|
12
|
+
};
|
|
13
|
+
const hasSelection = (ctx) => available() && ctx.selectedIds.size > 0;
|
|
14
|
+
async function perform(ctx, action) {
|
|
15
|
+
const { actions, platform, onReceipt } = environment();
|
|
16
|
+
if (!available() || actions === null || ctx.selectedIds.size === 0)
|
|
17
|
+
return;
|
|
18
|
+
const ids = action === "copyPath"
|
|
19
|
+
? [...ctx.selectedIds]
|
|
20
|
+
: ctx.focusedId !== null && ctx.selectedIds.has(ctx.focusedId)
|
|
21
|
+
? [ctx.focusedId]
|
|
22
|
+
: [];
|
|
23
|
+
if (ids.length === 0)
|
|
24
|
+
return;
|
|
25
|
+
try {
|
|
26
|
+
const paths = ids.map((id) => {
|
|
27
|
+
const target = fileActionTargetForId(ctx.snapshot, id);
|
|
28
|
+
if (target === null)
|
|
29
|
+
throw new Error("That file is no longer in the tree. Select it again.");
|
|
30
|
+
return target.rootRelativePath;
|
|
31
|
+
}).sort();
|
|
32
|
+
const result = await actions.fileAction({
|
|
33
|
+
root: engine.root,
|
|
34
|
+
generation: engine.generation,
|
|
35
|
+
action,
|
|
36
|
+
paths,
|
|
37
|
+
});
|
|
38
|
+
if (!result.ok)
|
|
39
|
+
throw new Error(result.error);
|
|
40
|
+
if (action === "copyPath") {
|
|
41
|
+
onReceipt(paths.length === 1 ? "Path copied" : `${paths.length} paths copied`);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
onReceipt(platform === "darwin" ? "Revealed in Finder" : "Revealed in file manager");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
onReceipt(error instanceof Error ? error.message : "Could not complete the file action.");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const commands = createCommandRegistry([
|
|
52
|
+
{
|
|
53
|
+
id: "file.copyAbsolutePath",
|
|
54
|
+
label: "Copy Path",
|
|
55
|
+
keybinding: ["Mod+C", "Ctrl+C", "Cmd+C"],
|
|
56
|
+
group: "path",
|
|
57
|
+
order: 0,
|
|
58
|
+
enablement: hasSelection,
|
|
59
|
+
run: (ctx) => perform(ctx, "copyPath"),
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "file.revealInFileManager",
|
|
63
|
+
label: () => environment().platform === "darwin"
|
|
64
|
+
? "Open in Finder"
|
|
65
|
+
: "Open in File Manager",
|
|
66
|
+
group: "path",
|
|
67
|
+
order: 1,
|
|
68
|
+
enablement: (ctx) => hasSelection(ctx) && ctx.focusedId !== null && ctx.selectedIds.has(ctx.focusedId),
|
|
69
|
+
run: (ctx) => perform(ctx, "revealInFileManager"),
|
|
70
|
+
},
|
|
71
|
+
// Mille installs its mutating Paste command if this id is absent. Reserve
|
|
72
|
+
// it explicitly so it stays unavailable in menus and keyboard dispatch.
|
|
73
|
+
{
|
|
74
|
+
id: "file.paste",
|
|
75
|
+
label: "Paste",
|
|
76
|
+
visibleInContextMenu: false,
|
|
77
|
+
enablement: () => false,
|
|
78
|
+
run: () => { },
|
|
79
|
+
},
|
|
80
|
+
]);
|
|
81
|
+
commands.setContextProvider(() => {
|
|
82
|
+
// Mille types its registry against the in-process engine; our port exposes
|
|
83
|
+
// the same snapshot methods used by these commands, as it does for the tree.
|
|
84
|
+
const fx = engine.fx;
|
|
85
|
+
const snapshot = fx.getSnapshot();
|
|
86
|
+
return {
|
|
87
|
+
fx,
|
|
88
|
+
snapshot,
|
|
89
|
+
focusedId,
|
|
90
|
+
focusedEntry: focusedId === null ? null : snapshot.getById(focusedId),
|
|
91
|
+
selectedIds,
|
|
92
|
+
selectedEntries: [...selectedIds].flatMap((id) => {
|
|
93
|
+
const entry = snapshot.getById(id);
|
|
94
|
+
return entry === null ? [] : [entry];
|
|
95
|
+
}),
|
|
96
|
+
isMultiSelect: selectedIds.size > 1,
|
|
97
|
+
isRenaming: false,
|
|
98
|
+
host: {},
|
|
99
|
+
cutIds: emptyIds,
|
|
100
|
+
copyIds: emptyIds,
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
return {
|
|
104
|
+
commands,
|
|
105
|
+
onSelectionChange: (ids) => {
|
|
106
|
+
selectedIds = ids;
|
|
107
|
+
},
|
|
108
|
+
onFocusedIdChange: (id) => {
|
|
109
|
+
focusedId = id;
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Entry } from "@vibecook/mille";
|
|
2
|
+
import type { FileHandle, FileSource } from "../file-viewer/index.js";
|
|
3
|
+
import type { WorktreeEngine } from "./types.js";
|
|
4
|
+
/** Can this entry be opened as a file at all? */
|
|
5
|
+
export declare function isOpenable(entry: Entry): boolean;
|
|
6
|
+
/** What the viewer needs to know about an entry the reader just opened. */
|
|
7
|
+
export declare function handleFor(engine: WorktreeEngine, entry: Entry): FileHandle;
|
|
8
|
+
/**
|
|
9
|
+
* A `FileSource` backed by one engine.
|
|
10
|
+
*
|
|
11
|
+
* Memoize this per engine: `useFileContent` treats a new source as a new
|
|
12
|
+
* request, so a fresh object every render would re-read the open file every
|
|
13
|
+
* render.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createWorktreeFileSource(engine: WorktreeEngine): FileSource;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// The adapter between the tree and the viewer: it is the ONLY file that knows
|
|
2
|
+
// both what a mille engine is and what a `FileSource` is.
|
|
3
|
+
//
|
|
4
|
+
// Bytes come back over the port the tree is already using, which means the
|
|
5
|
+
// renderer never opens a file itself. There is no `node:fs` here, no new IPC
|
|
6
|
+
// channel, and no path handed to a privileged process to read — the request
|
|
7
|
+
// is an entry id, and the engine will only answer for entries inside the root
|
|
8
|
+
// it was forked against. The read is bounded by the same walk the tree is.
|
|
9
|
+
/** `EntryKind.Directory`. A folder toggles; it does not open. */
|
|
10
|
+
const DIRECTORY = 1;
|
|
11
|
+
/** Deep enough for any real repository, shallow enough that a mirror that
|
|
12
|
+
* somehow cycles cannot hang the renderer. */
|
|
13
|
+
const MAX_DEPTH = 64;
|
|
14
|
+
/**
|
|
15
|
+
* The absolute path of an entry, walked up the mirror.
|
|
16
|
+
*
|
|
17
|
+
* `null` is a real answer: the mirror is viewport-bounded, so an ancestor can
|
|
18
|
+
* have been evicted, and the column would rather show no path than a wrong
|
|
19
|
+
* one. Nothing load-bearing depends on it — reading uses the id — so a null
|
|
20
|
+
* costs the reader the path line and the two acts that need a path.
|
|
21
|
+
*/
|
|
22
|
+
function pathOf(engine, id) {
|
|
23
|
+
const snapshot = engine.fx.getSnapshot();
|
|
24
|
+
const segments = [];
|
|
25
|
+
let current = snapshot.getById(id);
|
|
26
|
+
for (let depth = 0; depth < MAX_DEPTH; depth += 1) {
|
|
27
|
+
if (current === null)
|
|
28
|
+
return null;
|
|
29
|
+
// The root entry's own name is the folder the engine was pointed at, and
|
|
30
|
+
// `engine.root` already spells that out in full.
|
|
31
|
+
if (current.parentId === null) {
|
|
32
|
+
const root = engine.root.endsWith("/") ? engine.root.slice(0, -1) : engine.root;
|
|
33
|
+
return [root, ...segments.reverse()].join("/");
|
|
34
|
+
}
|
|
35
|
+
segments.push(current.name);
|
|
36
|
+
current = snapshot.getById(current.parentId);
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
/** Can this entry be opened as a file at all? */
|
|
41
|
+
export function isOpenable(entry) {
|
|
42
|
+
return entry.kind !== DIRECTORY;
|
|
43
|
+
}
|
|
44
|
+
/** What the viewer needs to know about an entry the reader just opened. */
|
|
45
|
+
export function handleFor(engine, entry) {
|
|
46
|
+
return {
|
|
47
|
+
// Scoped to the root, so the same id in a re-forked engine on a different
|
|
48
|
+
// project can never be mistaken for this one.
|
|
49
|
+
key: `${engine.root}#${entry.id}`,
|
|
50
|
+
name: entry.name,
|
|
51
|
+
path: pathOf(engine, entry.id),
|
|
52
|
+
size: entry.size,
|
|
53
|
+
ref: entry.id,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A `FileSource` backed by one engine.
|
|
58
|
+
*
|
|
59
|
+
* Memoize this per engine: `useFileContent` treats a new source as a new
|
|
60
|
+
* request, so a fresh object every render would re-read the open file every
|
|
61
|
+
* render.
|
|
62
|
+
*/
|
|
63
|
+
export function createWorktreeFileSource(engine) {
|
|
64
|
+
return {
|
|
65
|
+
async read(handle) {
|
|
66
|
+
const id = handle.ref;
|
|
67
|
+
if (typeof id !== "number")
|
|
68
|
+
throw new Error("that file is no longer in the tree");
|
|
69
|
+
// The port has no cancel for a read in flight; the caller drops the
|
|
70
|
+
// answer instead, which for a local file is the same thing a few
|
|
71
|
+
// milliseconds later.
|
|
72
|
+
return engine.fx.readFile(id);
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { GitConnection } from "../git/git-host.js";
|
|
2
|
+
import type { GitFacts } from "../../ports.js";
|
|
3
|
+
import type { WorktreeEngine } from "./types.js";
|
|
4
|
+
export interface WorktreeConnection {
|
|
5
|
+
readonly root: string;
|
|
6
|
+
readonly generation: number;
|
|
7
|
+
readonly engine: WorktreeEngine;
|
|
8
|
+
readonly git: GitConnection;
|
|
9
|
+
dispose(): void;
|
|
10
|
+
}
|
|
11
|
+
export type WorktreeConnectionState = {
|
|
12
|
+
readonly status: "idle";
|
|
13
|
+
} | {
|
|
14
|
+
readonly status: "connecting";
|
|
15
|
+
readonly root: string;
|
|
16
|
+
readonly generation: number;
|
|
17
|
+
} | {
|
|
18
|
+
readonly status: "ready";
|
|
19
|
+
readonly connection: WorktreeConnection;
|
|
20
|
+
} | {
|
|
21
|
+
readonly status: "error";
|
|
22
|
+
readonly root: string;
|
|
23
|
+
readonly generation: number;
|
|
24
|
+
readonly message: string;
|
|
25
|
+
};
|
|
26
|
+
/** The current generation-safe, atomically paired tree + git connection, or
|
|
27
|
+
* idle for a host with no worktree engine. */
|
|
28
|
+
export declare function useWorktreeConnection(): WorktreeConnectionState;
|
|
29
|
+
/** Branch, dirty count and sibling worktrees for one exact connection
|
|
30
|
+
* generation. `null` until the first answer, and for a folder without git. */
|
|
31
|
+
export declare function useGitFacts(root: string | null, generation: number | null): GitFacts | null;
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
// One transactional renderer connection for column ③. The host's worktree
|
|
2
|
+
// port transfers the mille and git ports together with the root and engine
|
|
3
|
+
// generation; this store publishes them together only after mille's async
|
|
4
|
+
// handshake has completed. A late handshake can therefore never pair an old
|
|
5
|
+
// tree with a new git client (or win after a newer project switch).
|
|
6
|
+
import { useEffect, useState, useSyncExternalStore } from "react";
|
|
7
|
+
import { connectFileExplorer } from "@vibecook/mille/port";
|
|
8
|
+
import { connectGitClient } from "../git/git-host.js";
|
|
9
|
+
import { useRoom } from "../../room-context.js";
|
|
10
|
+
/**
|
|
11
|
+
* Fallback wire window before Mille's virtualizer publishes the rail's
|
|
12
|
+
* measured viewport. This is deliberately independent from the native
|
|
13
|
+
* directory page size: the host can keep walking while the renderer receives
|
|
14
|
+
* only the rows it can use.
|
|
15
|
+
*/
|
|
16
|
+
const PORT_PREFETCH_ROWS = 200;
|
|
17
|
+
/**
|
|
18
|
+
* How much of the tree a port client caches before evicting cold entries.
|
|
19
|
+
* This is not a project or directory-size limit; wide folders rehydrate from
|
|
20
|
+
* the host as the viewport moves.
|
|
21
|
+
*/
|
|
22
|
+
const MIRROR_CAP = 20_000;
|
|
23
|
+
/** How often the column re-reads branch and dirty count. Slow on purpose:
|
|
24
|
+
* these are ambient facts about a repository someone else is editing, and
|
|
25
|
+
* the room is a reader. */
|
|
26
|
+
const GIT_FACTS_POLL_MS = 15_000;
|
|
27
|
+
const IDLE = { status: "idle" };
|
|
28
|
+
/** One store per worktree port, created on first read and listening from
|
|
29
|
+
* then on: the ports it is handed are one-owner capabilities, so it must not
|
|
30
|
+
* come and go with a component. */
|
|
31
|
+
const stores = new WeakMap();
|
|
32
|
+
function storeFor(port) {
|
|
33
|
+
let store = stores.get(port);
|
|
34
|
+
if (store === undefined) {
|
|
35
|
+
store = createWorktreeConnectionStore(port);
|
|
36
|
+
stores.set(port, store);
|
|
37
|
+
}
|
|
38
|
+
return store;
|
|
39
|
+
}
|
|
40
|
+
function createWorktreeConnectionStore(port) {
|
|
41
|
+
const storeListeners = new Set();
|
|
42
|
+
let storeState = IDLE;
|
|
43
|
+
let current = null;
|
|
44
|
+
let latestGeneration = 0;
|
|
45
|
+
let latestRoot = null;
|
|
46
|
+
let handshakeAttempt = 0;
|
|
47
|
+
let pendingHandshake = null;
|
|
48
|
+
function publish(next) {
|
|
49
|
+
storeState = next;
|
|
50
|
+
for (const listener of storeListeners)
|
|
51
|
+
listener();
|
|
52
|
+
}
|
|
53
|
+
function closePorts(message) {
|
|
54
|
+
message.treePort.close();
|
|
55
|
+
message.gitPort.close();
|
|
56
|
+
}
|
|
57
|
+
function disposeCurrent() {
|
|
58
|
+
const connection = current;
|
|
59
|
+
current = null;
|
|
60
|
+
connection?.dispose();
|
|
61
|
+
}
|
|
62
|
+
function cancelPendingHandshake() {
|
|
63
|
+
const pending = pendingHandshake;
|
|
64
|
+
pendingHandshake = null;
|
|
65
|
+
if (pending === null)
|
|
66
|
+
return;
|
|
67
|
+
pending.treePort.close();
|
|
68
|
+
pending.git.dispose();
|
|
69
|
+
}
|
|
70
|
+
function acceptStatus(message) {
|
|
71
|
+
if (message.generation < latestGeneration)
|
|
72
|
+
return;
|
|
73
|
+
if (message.generation === latestGeneration &&
|
|
74
|
+
latestRoot !== null &&
|
|
75
|
+
message.root !== latestRoot) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (message.state === "starting" &&
|
|
79
|
+
((storeState.status === "ready" &&
|
|
80
|
+
storeState.connection.generation === message.generation) ||
|
|
81
|
+
(storeState.status === "connecting" && storeState.generation === message.generation))) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
latestGeneration = message.generation;
|
|
85
|
+
latestRoot = message.root;
|
|
86
|
+
handshakeAttempt += 1;
|
|
87
|
+
cancelPendingHandshake();
|
|
88
|
+
disposeCurrent();
|
|
89
|
+
if (message.state === "starting") {
|
|
90
|
+
publish({
|
|
91
|
+
status: "connecting",
|
|
92
|
+
root: message.root,
|
|
93
|
+
generation: message.generation,
|
|
94
|
+
});
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
publish({
|
|
98
|
+
status: "error",
|
|
99
|
+
root: message.root,
|
|
100
|
+
generation: message.generation,
|
|
101
|
+
message: message.message ?? "The worktree process stopped unexpectedly.",
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function acceptPorts(message) {
|
|
105
|
+
if (message.generation < latestGeneration) {
|
|
106
|
+
closePorts(message);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (message.generation === latestGeneration &&
|
|
110
|
+
latestRoot !== null &&
|
|
111
|
+
message.root !== latestRoot) {
|
|
112
|
+
closePorts(message);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (storeState.status === "ready" &&
|
|
116
|
+
storeState.connection.generation === message.generation) {
|
|
117
|
+
closePorts(message);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (storeState.status === "error" && storeState.generation === message.generation) {
|
|
121
|
+
closePorts(message);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (message.generation > latestGeneration) {
|
|
125
|
+
latestGeneration = message.generation;
|
|
126
|
+
latestRoot = message.root;
|
|
127
|
+
disposeCurrent();
|
|
128
|
+
}
|
|
129
|
+
publish({
|
|
130
|
+
status: "connecting",
|
|
131
|
+
root: message.root,
|
|
132
|
+
generation: message.generation,
|
|
133
|
+
});
|
|
134
|
+
cancelPendingHandshake();
|
|
135
|
+
const attempt = (handshakeAttempt += 1);
|
|
136
|
+
const git = connectGitClient(message.gitPort, message.root, message.generation);
|
|
137
|
+
pendingHandshake = { attempt, treePort: message.treePort, git };
|
|
138
|
+
void connectFileExplorer(message.treePort, {
|
|
139
|
+
prefetchRows: PORT_PREFETCH_ROWS,
|
|
140
|
+
mirrorCap: MIRROR_CAP,
|
|
141
|
+
})
|
|
142
|
+
.then((fx) => {
|
|
143
|
+
if (pendingHandshake?.attempt === attempt)
|
|
144
|
+
pendingHandshake = null;
|
|
145
|
+
if (attempt !== handshakeAttempt || message.generation !== latestGeneration) {
|
|
146
|
+
void fx.dispose();
|
|
147
|
+
git.dispose();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
let disposed = false;
|
|
151
|
+
const engine = {
|
|
152
|
+
fx,
|
|
153
|
+
root: message.root,
|
|
154
|
+
generation: message.generation,
|
|
155
|
+
dispose: () => void fx.dispose(),
|
|
156
|
+
};
|
|
157
|
+
const connection = {
|
|
158
|
+
root: message.root,
|
|
159
|
+
generation: message.generation,
|
|
160
|
+
engine,
|
|
161
|
+
git,
|
|
162
|
+
dispose: () => {
|
|
163
|
+
if (disposed)
|
|
164
|
+
return;
|
|
165
|
+
disposed = true;
|
|
166
|
+
engine.dispose();
|
|
167
|
+
git.dispose();
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
disposeCurrent();
|
|
171
|
+
current = connection;
|
|
172
|
+
publish({ status: "ready", connection });
|
|
173
|
+
})
|
|
174
|
+
.catch((error) => {
|
|
175
|
+
if (pendingHandshake?.attempt === attempt)
|
|
176
|
+
pendingHandshake = null;
|
|
177
|
+
git.dispose();
|
|
178
|
+
message.treePort.close();
|
|
179
|
+
if (attempt !== handshakeAttempt || message.generation !== latestGeneration)
|
|
180
|
+
return;
|
|
181
|
+
publish({
|
|
182
|
+
status: "error",
|
|
183
|
+
root: message.root,
|
|
184
|
+
generation: message.generation,
|
|
185
|
+
message: error instanceof Error ? error.message : "Could not connect to the worktree.",
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
port.ports((event) => {
|
|
190
|
+
if (event.type === "ports")
|
|
191
|
+
acceptPorts(event);
|
|
192
|
+
else
|
|
193
|
+
acceptStatus(event);
|
|
194
|
+
});
|
|
195
|
+
return {
|
|
196
|
+
subscribe(listener) {
|
|
197
|
+
storeListeners.add(listener);
|
|
198
|
+
return () => storeListeners.delete(listener);
|
|
199
|
+
},
|
|
200
|
+
getSnapshot: () => storeState,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
const IDLE_STORE = { subscribe: () => () => { }, getSnapshot: () => IDLE };
|
|
204
|
+
/** The current generation-safe, atomically paired tree + git connection, or
|
|
205
|
+
* idle for a host with no worktree engine. */
|
|
206
|
+
export function useWorktreeConnection() {
|
|
207
|
+
const worktree = useRoom().host?.worktree;
|
|
208
|
+
const store = worktree === undefined ? IDLE_STORE : storeFor(worktree);
|
|
209
|
+
return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
210
|
+
}
|
|
211
|
+
/** Branch, dirty count and sibling worktrees for one exact connection
|
|
212
|
+
* generation. `null` until the first answer, and for a folder without git. */
|
|
213
|
+
export function useGitFacts(root, generation) {
|
|
214
|
+
const [facts, setFacts] = useState(null);
|
|
215
|
+
const worktree = useRoom().host?.worktree ?? null;
|
|
216
|
+
useEffect(() => {
|
|
217
|
+
setFacts(null);
|
|
218
|
+
const host = worktree;
|
|
219
|
+
if (root === null || generation === null || host === null)
|
|
220
|
+
return;
|
|
221
|
+
let cancelled = false;
|
|
222
|
+
const read = () => {
|
|
223
|
+
void host
|
|
224
|
+
.gitFacts(root, generation)
|
|
225
|
+
.then((next) => {
|
|
226
|
+
if (!cancelled)
|
|
227
|
+
setFacts(next);
|
|
228
|
+
})
|
|
229
|
+
.catch(() => {
|
|
230
|
+
if (!cancelled)
|
|
231
|
+
setFacts(null);
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
read();
|
|
235
|
+
const timer = window.setInterval(read, GIT_FACTS_POLL_MS);
|
|
236
|
+
return () => {
|
|
237
|
+
cancelled = true;
|
|
238
|
+
window.clearInterval(timer);
|
|
239
|
+
};
|
|
240
|
+
}, [root, generation, worktree]);
|
|
241
|
+
return facts;
|
|
242
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MetaState, TimelineEntry, UsageResponse } from "@vibefield/rosetta-protocol";
|
|
2
|
+
import type { AssetSource, CatalogStatus, RoomPorts } from "../ports.js";
|
|
3
|
+
import type { ActivityOrder } from "../lib/activity-order.js";
|
|
4
|
+
import type { ProjectStats, ProjectViewModel } from "../lib/model.js";
|
|
5
|
+
/** Everything the demo room shows. */
|
|
6
|
+
export interface RoomDemo {
|
|
7
|
+
readonly now: number;
|
|
8
|
+
readonly meta: MetaState;
|
|
9
|
+
readonly status: CatalogStatus;
|
|
10
|
+
readonly stats: ReadonlyMap<string, ProjectStats>;
|
|
11
|
+
readonly usage: ReadonlyMap<string, UsageResponse>;
|
|
12
|
+
readonly timelines: ReadonlyMap<string, readonly TimelineEntry[]>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createRoomDemo(now?: number): RoomDemo;
|
|
15
|
+
/** The demo's addresses: every stored image is a drawn tile, inline. */
|
|
16
|
+
export declare function demoAssets(): AssetSource;
|
|
17
|
+
/** Ports over the demo: a catalog, sessions and asset addresses. No host —
|
|
18
|
+
* a host that is a desktop adds its own `HostPort`. */
|
|
19
|
+
export declare function createDemoPorts(demo?: RoomDemo): RoomPorts;
|
|
20
|
+
/** The demo's projects as the room's columns draw them, for a harness that
|
|
21
|
+
* mounts a column on its own. */
|
|
22
|
+
export declare function demoProjectViewModels(demo?: RoomDemo): ProjectViewModel[];
|
|
23
|
+
/** The order the projects and sessions column would settle on for the demo. */
|
|
24
|
+
export declare function demoActivityOrder(demo?: RoomDemo): ActivityOrder;
|