zidane-ui 9.3.1 → 9.5.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/dist/adapters/index.d.ts +2 -1
- package/dist/adapters/index.js +2 -1
- package/dist/adapters/live.d.ts +9 -2
- package/dist/adapters/live.js +8 -2
- package/dist/adapters/server-approvals-host.js +3 -1
- package/dist/adapters/server-channels-host.d.ts +32 -0
- package/dist/adapters/server-channels-host.js +49 -0
- package/dist/adapters/server-composer-host.js +13 -0
- package/dist/adapters/server-files-host.js +12 -31
- package/dist/adapters/server-git-host.js +5 -2
- package/dist/adapters/server-host.js +44 -14
- package/dist/adapters/server-machines-host.d.ts +5 -0
- package/dist/adapters/server-machines-host.js +15 -1
- package/dist/adapters/server-oauth-flow.d.ts +2 -1
- package/dist/adapters/server-projects.d.ts +15 -0
- package/dist/adapters/server-projects.js +225 -0
- package/dist/adapters/server-session-host.d.ts +2 -0
- package/dist/adapters/server-session-host.js +69 -1
- package/dist/adapters/server-settings-sections.js +4 -1
- package/dist/adapters/sse-host.js +3 -0
- package/dist/adapters/sse-protocol.d.ts +10 -0
- package/dist/app/AppHostProvider.d.ts +1 -1
- package/dist/app/AppHostProvider.js +7 -2
- package/dist/app/ModalProvider.d.ts +6 -2
- package/dist/app/ModalProvider.js +38 -10
- package/dist/app/headless/app-host.d.ts +3 -0
- package/dist/appearance/ZoomIndicator.js +5 -8
- package/dist/approvals/ApprovalsProvider.d.ts +2 -1
- package/dist/approvals/ApprovalsProvider.js +12 -4
- package/dist/approvals/headless/host.d.ts +13 -2
- package/dist/approvals/headless/index.d.ts +3 -3
- package/dist/approvals/headless/index.js +2 -2
- package/dist/approvals/headless/labels.d.ts +12 -2
- package/dist/approvals/headless/labels.js +19 -1
- package/dist/channels/BindingEditorDialog.d.ts +18 -0
- package/dist/channels/BindingEditorDialog.js +637 -0
- package/dist/channels/ChannelAlertsList.d.ts +25 -0
- package/dist/channels/ChannelAlertsList.js +107 -0
- package/dist/channels/ChannelDefaultsSection.d.ts +20 -0
- package/dist/channels/ChannelDefaultsSection.js +133 -0
- package/dist/channels/ChannelsProvider.d.ts +31 -0
- package/dist/channels/ChannelsProvider.js +29 -0
- package/dist/channels/ChannelsSettingsSection.d.ts +40 -0
- package/dist/channels/ChannelsSettingsSection.js +456 -0
- package/dist/channels/ConnectionSetupDialog.d.ts +16 -0
- package/dist/channels/ConnectionSetupDialog.js +470 -0
- package/dist/channels/HeldRepliesList.d.ts +27 -0
- package/dist/channels/HeldRepliesList.js +173 -0
- package/dist/channels/ProjectChannelsSection.d.ts +55 -0
- package/dist/channels/ProjectChannelsSection.js +433 -0
- package/dist/channels/ReadinessChecklist.d.ts +102 -0
- package/dist/channels/ReadinessChecklist.js +273 -0
- package/dist/channels/TestSessionBanner.d.ts +24 -0
- package/dist/channels/TestSessionBanner.js +44 -0
- package/dist/channels/channels-parts.d.ts +104 -0
- package/dist/channels/channels-parts.js +203 -0
- package/dist/channels/context.d.ts +9 -0
- package/dist/channels/context.js +14 -0
- package/dist/channels/headless/access.d.ts +127 -0
- package/dist/channels/headless/access.js +187 -0
- package/dist/channels/headless/fixture-host.d.ts +83 -0
- package/dist/channels/headless/fixture-host.js +557 -0
- package/dist/channels/headless/host.d.ts +245 -0
- package/dist/channels/headless/host.js +39 -0
- package/dist/channels/headless/index.d.ts +10 -0
- package/dist/channels/headless/index.js +5 -0
- package/dist/channels/headless/labels.d.ts +217 -0
- package/dist/channels/headless/labels.js +260 -0
- package/dist/channels/headless/state.d.ts +22 -0
- package/dist/channels/headless/state.js +303 -0
- package/dist/channels/index.d.ts +21 -0
- package/dist/channels/index.js +13 -0
- package/dist/channels/testing/contract.d.ts +31 -0
- package/dist/channels/testing/contract.js +378 -0
- package/dist/channels/testing/index.d.ts +7 -0
- package/dist/channels/testing/index.js +1 -0
- package/dist/chat/HostBadge.js +1 -0
- package/dist/chat/HostTranscript.js +15 -1
- package/dist/chat/OrchestratorBadge.d.ts +23 -0
- package/dist/chat/OrchestratorBadge.js +22 -0
- package/dist/chat/SessionGroupHeader.d.ts +11 -1
- package/dist/chat/SessionGroupHeader.js +25 -14
- package/dist/chat/SessionRow.d.ts +141 -0
- package/dist/chat/SessionRow.js +215 -0
- package/dist/chat/SessionStreamsProvider.d.ts +1 -1
- package/dist/chat/StatusDot.d.ts +7 -2
- package/dist/chat/StatusDot.js +3 -2
- package/dist/chat/Transcript.d.ts +3 -2
- package/dist/chat/Transcript.js +26 -7
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/composer/ContextBreakdown.d.ts +27 -2
- package/dist/chat/composer/ContextBreakdown.js +123 -2
- package/dist/chat/composer/DraftPickers.js +2 -0
- package/dist/chat/composer/HostContextOrb.d.ts +2 -0
- package/dist/chat/composer/HostContextOrb.js +17 -2
- package/dist/chat/composer/ModelOptionsPicker.js +6 -2
- package/dist/chat/composer/ModelPicker.d.ts +1 -1
- package/dist/chat/composer/PlacePicker.d.ts +3 -1
- package/dist/chat/composer/PlacePicker.js +5 -1
- package/dist/chat/composer/ProjectMenu.d.ts +16 -3
- package/dist/chat/composer/ProjectMenu.js +102 -20
- package/dist/chat/composer/ScopeToggle.d.ts +3 -1
- package/dist/chat/composer/ScopeToggle.js +2 -1
- package/dist/chat/composer/ServerScopeToggle.d.ts +3 -1
- package/dist/chat/composer/ServerScopeToggle.js +2 -1
- package/dist/chat/composer/index.d.ts +2 -2
- package/dist/chat/composer/index.js +2 -2
- package/dist/chat/composer/use-draft-target.d.ts +5 -0
- package/dist/chat/composer/use-draft-target.js +18 -3
- package/dist/chat/composer/use-send-prompt.d.ts +2 -0
- package/dist/chat/composer/use-send-prompt.js +4 -1
- package/dist/chat/headless/answered-first.d.ts +28 -0
- package/dist/chat/headless/answered-first.js +14 -0
- package/dist/chat/headless/block-runs.js +26 -1
- package/dist/chat/headless/chip-labels.d.ts +2 -0
- package/dist/chat/headless/chip-labels.js +2 -0
- package/dist/chat/headless/chip-views.js +1 -1
- package/dist/chat/headless/composer/composer-sources.d.ts +5 -2
- package/dist/chat/headless/composer/composer-sources.js +6 -0
- package/dist/chat/headless/composer/host.d.ts +13 -0
- package/dist/chat/headless/composer/index.d.ts +2 -2
- package/dist/chat/headless/composer/labels-chrome.d.ts +3 -0
- package/dist/chat/headless/composer/labels-chrome.js +4 -1
- package/dist/chat/headless/composer/labels-editor.d.ts +2 -0
- package/dist/chat/headless/composer/labels-editor.js +2 -0
- package/dist/chat/headless/draft-target.d.ts +30 -1
- package/dist/chat/headless/draft-target.js +22 -1
- package/dist/chat/headless/folder-groups.d.ts +41 -0
- package/dist/chat/headless/folder-groups.js +76 -0
- package/dist/chat/headless/host.d.ts +16 -1
- package/dist/chat/headless/hosts.d.ts +4 -0
- package/dist/chat/headless/index.d.ts +31 -27
- package/dist/chat/headless/index.js +33 -29
- package/dist/chat/headless/labels.d.ts +34 -4
- package/dist/chat/headless/labels.js +28 -6
- package/dist/chat/headless/markdown-scan.d.ts +0 -2
- package/dist/chat/headless/markdown-scan.js +3 -8
- package/dist/chat/headless/markdown-stream.js +3 -3
- package/dist/chat/headless/prompt-origin.d.ts +4 -2
- package/dist/chat/headless/prompt-origin.js +9 -5
- package/dist/chat/headless/send-flow.d.ts +2 -0
- package/dist/chat/headless/session-list.d.ts +28 -2
- package/dist/chat/headless/sidebar/directory.d.ts +15 -1
- package/dist/chat/headless/sidebar/directory.js +11 -1
- package/dist/chat/headless/sidebar/environment.d.ts +15 -4
- package/dist/chat/headless/sidebar/environment.js +27 -9
- package/dist/chat/headless/sidebar/inbox.d.ts +13 -3
- package/dist/chat/headless/sidebar/inbox.js +40 -19
- package/dist/chat/headless/sidebar/index.d.ts +6 -4
- package/dist/chat/headless/sidebar/index.js +5 -3
- package/dist/chat/headless/sidebar/labels.d.ts +38 -8
- package/dist/chat/headless/sidebar/labels.js +8 -4
- package/dist/chat/headless/sidebar/project-main.d.ts +43 -0
- package/dist/chat/headless/sidebar/project-main.js +46 -0
- package/dist/chat/headless/sidebar/row-changes.d.ts +43 -0
- package/dist/chat/headless/sidebar/row-changes.js +43 -0
- package/dist/chat/headless/sidebar/rows.d.ts +2 -1
- package/dist/chat/headless/sidebar/rows.js +7 -3
- package/dist/chat/headless/sidebar/types.d.ts +12 -0
- package/dist/chat/headless/streams/actions.d.ts +2 -2
- package/dist/chat/headless/streams/actions.js +1 -1
- package/dist/chat/headless/streams/event-bytes.d.ts +12 -1
- package/dist/chat/headless/streams/event-bytes.js +13 -1
- package/dist/chat/headless/streams/live-events.d.ts +12 -0
- package/dist/chat/headless/streams/live-events.js +21 -2
- package/dist/chat/headless/streams/store.d.ts +38 -5
- package/dist/chat/headless/streams/store.js +74 -22
- package/dist/chat/headless/streams/transcript-map.js +2 -5
- package/dist/chat/headless/streams/types.d.ts +4 -2
- package/dist/chat/headless/transcript/collapse.js +6 -1
- package/dist/chat/headless/transcript/rail.d.ts +8 -1
- package/dist/chat/headless/transcript/rail.js +9 -2
- package/dist/chat/headless/transcript/rows.d.ts +5 -1
- package/dist/chat/headless/transcript-labels.d.ts +1 -0
- package/dist/chat/index.d.ts +6 -4
- package/dist/chat/index.js +8 -6
- package/dist/chat/interactions/HostInteractions.js +4 -2
- package/dist/chat/interactions/InboxPanel.js +6 -4
- package/dist/chat/interactions/use-answer-interaction.d.ts +11 -0
- package/dist/chat/interactions/use-answer-interaction.js +19 -0
- package/dist/chat/rich-composer/artifact-mentions.d.ts +29 -0
- package/dist/chat/rich-composer/artifact-mentions.js +40 -0
- package/dist/chat/rich-composer/composer-extensions.d.ts +3 -2
- package/dist/chat/rich-composer/composer-extensions.js +12 -9
- package/dist/chat/rich-composer/use-composer-sources.js +1 -0
- package/dist/chat/sidebar/InboxList.d.ts +13 -2
- package/dist/chat/sidebar/InboxList.js +44 -48
- package/dist/chat/sidebar/MainSessionRow.d.ts +2 -1
- package/dist/chat/sidebar/MainSessionRow.js +1 -1
- package/dist/chat/sidebar/ProjectIcon.d.ts +8 -4
- package/dist/chat/sidebar/ProjectIcon.js +16 -4
- package/dist/chat/sidebar/RowChips.js +2 -2
- package/dist/chat/sidebar/SessionSidebar.d.ts +47 -0
- package/dist/chat/sidebar/SessionSidebar.js +85 -28
- package/dist/chat/sidebar/SidebarFilterMenu.js +0 -1
- package/dist/chat/sidebar/SidebarFold.js +17 -16
- package/dist/chat/sidebar/SidebarFooter.d.ts +2 -23
- package/dist/chat/sidebar/SidebarFooter.js +2 -43
- package/dist/chat/sidebar/SidebarGroupHeader.d.ts +7 -3
- package/dist/chat/sidebar/SidebarGroupHeader.js +15 -10
- package/dist/chat/sidebar/SidebarLiveProvider.d.ts +22 -0
- package/dist/chat/sidebar/SidebarLiveProvider.js +20 -0
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +12 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +25 -13
- package/dist/chat/sidebar/inbox-triage.d.ts +18 -2
- package/dist/chat/sidebar/inbox-triage.js +39 -12
- package/dist/chat/sidebar/index.d.ts +5 -4
- package/dist/chat/sidebar/index.js +3 -2
- package/dist/chat/sidebar/session-menu.d.ts +4 -0
- package/dist/chat/sidebar/session-menu.js +14 -2
- package/dist/chat/sidebar/sidebar-live.d.ts +29 -2
- package/dist/chat/sidebar/sidebar-live.js +64 -6
- package/dist/chat/sidebar/useInboxRows.js +8 -9
- package/dist/chat/sidebar/useInboxTriage.d.ts +5 -2
- package/dist/chat/sidebar/useInboxTriage.js +78 -67
- package/dist/chat/sidebar/useSessionSearch.js +19 -18
- package/dist/chat/testing/fixture-composer-host.d.ts +3 -1
- package/dist/chat/testing/fixture-composer-host.js +1 -0
- package/dist/chat/transcript/FileChip.js +28 -0
- package/dist/chat/transcript/LazyRow.d.ts +1 -1
- package/dist/chat/transcript/LazyRow.js +3 -4
- package/dist/chat/transcript/PromptEcho.js +18 -13
- package/dist/chat/transcript/PromptOriginLabel.d.ts +1 -1
- package/dist/chat/transcript/SessionChip.d.ts +11 -0
- package/dist/chat/transcript/SessionChip.js +34 -0
- package/dist/chat/transcript/TranscriptRail.d.ts +4 -2
- package/dist/chat/transcript/TranscriptRail.js +12 -2
- package/dist/chat/transcript/TranscriptRow.js +1 -0
- package/dist/chat/transcript/badges.d.ts +1 -0
- package/dist/chat/transcript/badges.js +1 -0
- package/dist/chat/transcript/chip-details.d.ts +11 -0
- package/dist/chat/transcript/chip-details.js +17 -1
- package/dist/chat/transcript/fold-worker.js +2 -1
- package/dist/chat/transcript/fold.js +13 -4
- package/dist/chat/transcript/index.d.ts +3 -3
- package/dist/chat/transcript/index.js +3 -3
- package/dist/chat/transcript/inline-facts.d.ts +9 -0
- package/dist/chat/transcript/inline-facts.js +20 -0
- package/dist/chat/transcript/markdown-cache.d.ts +10 -1
- package/dist/chat/transcript/markdown-cache.js +37 -4
- package/dist/chat/transcript/markdown.js +27 -34
- package/dist/chat/transcript/media-gallery.js +13 -16
- package/dist/chat/transcript/messages.js +5 -4
- package/dist/chat/transcript/notices.d.ts +25 -3
- package/dist/chat/transcript/notices.js +136 -17
- package/dist/chat/transcript/prompt.d.ts +1 -1
- package/dist/chat/transcript/prompt.js +8 -1
- package/dist/chat/transcript/row-mount.d.ts +27 -8
- package/dist/chat/transcript/row-mount.js +114 -80
- package/dist/chat/transcript/row-parking.d.ts +27 -0
- package/dist/chat/transcript/row-parking.js +37 -1
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/tasks.d.ts +1 -1
- package/dist/chat/transcript/tasks.js +1 -1
- package/dist/chat/transcript/tool-parts.js +0 -1
- package/dist/chat/transcript/tool-row.js +3 -2
- package/dist/chat/transcript/use-transcript-rows.d.ts +1 -1
- package/dist/chat/transcript/useHistoryBackfill.d.ts +42 -0
- package/dist/chat/transcript/useHistoryBackfill.js +170 -0
- package/dist/chat/transcript/useTranscriptFind.js +2 -4
- package/dist/chat/transcript/useTranscriptScroll.d.ts +7 -4
- package/dist/chat/transcript/useTranscriptScroll.js +12 -1
- package/dist/chat/transcript/useTranscriptSearch.d.ts +2 -2
- package/dist/chat/transcript/useTranscriptSearch.js +6 -6
- package/dist/chat/transcript/useTranscriptSelectionCopy.d.ts +5 -5
- package/dist/chat/transcript/useTranscriptSelectionCopy.js +28 -7
- package/dist/code/editor/FileTree.d.ts +2 -0
- package/dist/code/editor/FileTree.js +1 -1
- package/dist/code/editor/FileView.js +16 -27
- package/dist/code/editor/find/useFind.js +17 -17
- package/dist/code/editor/useCodeDocument.js +22 -19
- package/dist/code/editor/useDetachCleanup.js +4 -3
- package/dist/code/use-highlighted-html.js +12 -13
- package/dist/components/Form.d.ts +28 -1
- package/dist/components/Form.js +43 -7
- package/dist/components/HelpTip.d.ts +22 -0
- package/dist/components/HelpTip.js +26 -0
- package/dist/components/IconButton.d.ts +3 -1
- package/dist/components/IconButton.js +7 -2
- package/dist/components/IconButtonTip.d.ts +3 -1
- package/dist/components/IconButtonTip.js +2 -1
- package/dist/components/Menu.js +1 -1
- package/dist/components/Notice.d.ts +6 -4
- package/dist/components/Notice.js +73 -27
- package/dist/components/Progress.js +10 -4
- package/dist/components/RowActionsMenu.js +7 -14
- package/dist/components/SearchField.d.ts +46 -0
- package/dist/components/SearchField.js +50 -0
- package/dist/components/ShowMore.d.ts +48 -0
- package/dist/components/ShowMore.js +57 -0
- package/dist/components/Tooltip.d.ts +4 -1
- package/dist/components/Tooltip.js +16 -11
- package/dist/components/assign-ref.d.ts +8 -0
- package/dist/components/assign-ref.js +12 -0
- package/dist/components/charts/ScatterChart.js +13 -6
- package/dist/components/floating/FloatingSurface.js +4 -4
- package/dist/components/floating/HoverCard.js +32 -14
- package/dist/components/floating/Popover.js +4 -7
- package/dist/components/floating/useAnchoredPosition.d.ts +20 -4
- package/dist/components/floating/useAnchoredPosition.js +44 -10
- package/dist/components/object-key.d.ts +7 -0
- package/dist/components/object-key.js +18 -0
- package/dist/components/palette/PaletteList.d.ts +5 -5
- package/dist/components/palette/PaletteList.js +1 -7
- package/dist/components/palette/PalettePanel.js +18 -12
- package/dist/components/palette/palette-layout.d.ts +5 -1
- package/dist/components/palette/palette-layout.js +13 -10
- package/dist/components/tooltip-arming.d.ts +3 -0
- package/dist/components/tooltip-arming.js +8 -1
- package/dist/core.css +45 -20
- package/dist/dist/index-BmO8bRgK.d.ts +1 -0
- package/dist/dist/{index-C6-t1SS9.d.ts → index-Bsp5Ku7r.d.ts} +264 -133
- package/dist/dist/index.d.ts +5 -5
- package/dist/dist/sandbox-Bzg_jJK2.d.ts +2 -0
- package/dist/dist/{timeout-CmTx6V9y.d.ts → timeout-NoG7ppkm.d.ts} +1 -1
- package/dist/files/FilesProvider.d.ts +2 -0
- package/dist/files/FilesProvider.js +5 -1
- package/dist/files/FilesTab.js +0 -1
- package/dist/files/TreeColumn.d.ts +2 -4
- package/dist/files/TreeColumn.js +0 -5
- package/dist/files/headless/host.d.ts +9 -9
- package/dist/files/headless/labels.d.ts +0 -1
- package/dist/files/headless/labels.js +0 -1
- package/dist/files/headless/workspace-diff.js +1 -1
- package/dist/files/index.d.ts +2 -2
- package/dist/files/index.js +2 -2
- package/dist/files/useCodeReview.js +1 -3
- package/dist/files/useFilesDiagnostics.d.ts +1 -1
- package/dist/files/useFilesDiagnostics.js +4 -11
- package/dist/files/useOpenFiles.js +9 -12
- package/dist/files/useWorkspace.d.ts +5 -7
- package/dist/files/useWorkspace.js +4 -15
- package/dist/git/GitBar.js +13 -5
- package/dist/git/MoveSessionDialog.d.ts +18 -8
- package/dist/git/MoveSessionDialog.js +39 -57
- package/dist/git/MoveToDialog.d.ts +63 -0
- package/dist/git/MoveToDialog.js +267 -0
- package/dist/git/SandboxManager.js +9 -4
- package/dist/git/SyncChip.js +11 -4
- package/dist/git/TeleportSessionDialog.d.ts +76 -0
- package/dist/git/TeleportSessionDialog.js +596 -0
- package/dist/git/WherePicker.js +4 -1
- package/dist/git/headless/host.d.ts +14 -0
- package/dist/git/headless/index.d.ts +2 -1
- package/dist/git/headless/index.js +2 -1
- package/dist/git/headless/labels.d.ts +52 -1
- package/dist/git/headless/labels.js +58 -0
- package/dist/git/headless/sandboxes.d.ts +1 -1
- package/dist/git/headless/sandboxes.js +4 -3
- package/dist/git/headless/teleport.d.ts +76 -0
- package/dist/git/headless/teleport.js +19 -0
- package/dist/git/index.d.ts +5 -3
- package/dist/git/index.js +5 -3
- package/dist/git/useEnvironmentChoices.d.ts +24 -2
- package/dist/git/useEnvironmentChoices.js +43 -11
- package/dist/hooks/useLastCount.d.ts +9 -0
- package/dist/hooks/useLastCount.js +29 -0
- package/dist/hooks/useLatest.d.ts +8 -0
- package/dist/hooks/useLatest.js +17 -0
- package/dist/hooks/useMinuteTick.d.ts +6 -2
- package/dist/hooks/useMinuteTick.js +12 -6
- package/dist/hooks/useNearViewport.js +11 -8
- package/dist/index.d.ts +8 -3
- package/dist/index.js +8 -3
- package/dist/keybindings/KeybindingsProvider.js +3 -4
- package/dist/keybindings/headless/catalog.d.ts +1 -1
- package/dist/keybindings/headless/catalog.js +18 -0
- package/dist/keybindings/headless/overrides.d.ts +1 -1
- package/dist/keybindings/headless/overrides.js +14 -3
- package/dist/labels.d.ts +7 -0
- package/dist/labels.js +10 -3
- package/dist/machines/AddMachineDialog.js +1 -1
- package/dist/machines/AddServerForm.d.ts +14 -2
- package/dist/machines/AddServerForm.js +198 -30
- package/dist/machines/Banners.d.ts +2 -2
- package/dist/machines/Banners.js +3 -3
- package/dist/machines/DaemonMenu.js +1 -3
- package/dist/machines/HostCapabilities.js +8 -4
- package/dist/machines/HostSignIn.d.ts +2 -1
- package/dist/machines/HostSignIn.js +1 -0
- package/dist/machines/HostSyncPanel.d.ts +4 -1
- package/dist/machines/HostSyncPanel.js +248 -132
- package/dist/machines/HostsSection.d.ts +2 -2
- package/dist/machines/HostsSection.js +94 -51
- package/dist/machines/LinkedAccountsPanel.d.ts +29 -0
- package/dist/machines/LinkedAccountsPanel.js +268 -0
- package/dist/machines/MachinesExplainer.d.ts +4 -4
- package/dist/machines/MachinesExplainer.js +27 -17
- package/dist/machines/OrganizationPanel.d.ts +32 -0
- package/dist/machines/OrganizationPanel.js +553 -0
- package/dist/machines/ProjectsSpendPanel.d.ts +22 -0
- package/dist/machines/ProjectsSpendPanel.js +160 -0
- package/dist/machines/ServerMachinesPanel.js +19 -4
- package/dist/machines/ServerUpdatePanel.js +3 -3
- package/dist/machines/SyncAccounts.d.ts +14 -7
- package/dist/machines/SyncAccounts.js +67 -81
- package/dist/machines/TokensPanel.js +54 -30
- package/dist/machines/headless/fixture-host.d.ts +15 -0
- package/dist/machines/headless/fixture-host.js +75 -0
- package/dist/machines/headless/fixtures.d.ts +12 -0
- package/dist/machines/headless/fixtures.js +71 -1
- package/dist/machines/headless/host.d.ts +25 -1
- package/dist/machines/headless/index.d.ts +3 -1
- package/dist/machines/headless/index.js +3 -1
- package/dist/machines/headless/labels.d.ts +104 -8
- package/dist/machines/headless/labels.js +121 -21
- package/dist/machines/headless/linked-accounts.d.ts +42 -0
- package/dist/machines/headless/linked-accounts.js +31 -0
- package/dist/machines/headless/organization.d.ts +44 -0
- package/dist/machines/headless/organization.js +54 -0
- package/dist/machines/headless/sync.d.ts +2 -0
- package/dist/machines/index.d.ts +4 -1
- package/dist/machines/index.js +4 -1
- package/dist/machines/sync-rows.d.ts +8 -0
- package/dist/machines/sync-rows.js +10 -0
- package/dist/machines/testing/index.d.ts +3 -3
- package/dist/machines/testing/index.js +2 -2
- package/dist/motion/grow.js +12 -13
- package/dist/motion/swap.js +2 -5
- package/dist/motion/use-flip-list.d.ts +14 -0
- package/dist/motion/use-flip-list.js +17 -12
- package/dist/onboarding/demos/extensions.d.ts +4 -0
- package/dist/onboarding/demos/extensions.js +27 -1
- package/dist/onboarding/demos/sidebar-layout.d.ts +4 -2
- package/dist/onboarding/demos/sidebar-layout.js +5 -2
- package/dist/onboarding/headless/labels.d.ts +9 -0
- package/dist/onboarding/headless/labels.js +2 -0
- package/dist/onboarding/steps/SidebarStep.js +4 -2
- package/dist/onboarding/steps/setting-cards.d.ts +4 -2
- package/dist/onboarding/steps/setting-cards.js +3 -2
- package/dist/palette/PaletteDialog.js +4 -4
- package/dist/palette/PaletteRows.js +34 -16
- package/dist/palette/headless/app-sources.js +40 -1
- package/dist/palette/headless/labels.js +5 -2
- package/dist/palette/usePaletteController.js +4 -8
- package/dist/server/sse-handler.js +25 -2
- package/dist/session/ArtifactsPanel.js +11 -23
- package/dist/session/DiffFileTree.js +1 -4
- package/dist/session/NewProjectDialog.d.ts +33 -0
- package/dist/session/NewProjectDialog.js +216 -0
- package/dist/session/OpenProjectsDialog.d.ts +56 -0
- package/dist/session/OpenProjectsDialog.js +324 -0
- package/dist/session/OpenSessionsDialog.d.ts +46 -0
- package/dist/session/OpenSessionsDialog.js +295 -0
- package/dist/session/PlanTracker.js +1 -2
- package/dist/session/ProjectArtifactsHome.d.ts +42 -0
- package/dist/session/ProjectArtifactsHome.js +98 -0
- package/dist/session/ProjectArtifactsSection.d.ts +13 -0
- package/dist/session/ProjectArtifactsSection.js +367 -0
- package/dist/session/ProjectBudgetsSection.d.ts +7 -0
- package/dist/session/ProjectBudgetsSection.js +377 -0
- package/dist/session/ProjectContextSection.d.ts +20 -0
- package/dist/session/ProjectContextSection.js +139 -0
- package/dist/session/ProjectHome.d.ts +32 -5
- package/dist/session/ProjectHome.js +502 -254
- package/dist/session/ProjectInstructionsSection.d.ts +7 -0
- package/dist/session/ProjectInstructionsSection.js +179 -0
- package/dist/session/ProjectMainButton.d.ts +35 -0
- package/dist/session/ProjectMainButton.js +73 -0
- package/dist/session/ProjectName.d.ts +76 -0
- package/dist/session/ProjectName.js +140 -0
- package/dist/session/ProjectOrchestratorSection.d.ts +14 -0
- package/dist/session/ProjectOrchestratorSection.js +117 -0
- package/dist/session/ProjectPublishDialog.d.ts +30 -0
- package/dist/session/ProjectPublishDialog.js +420 -0
- package/dist/session/ProjectSessionAccessSection.d.ts +13 -0
- package/dist/session/ProjectSessionAccessSection.js +109 -0
- package/dist/session/ProjectSessionsList.d.ts +53 -0
- package/dist/session/ProjectSessionsList.js +316 -0
- package/dist/session/ProjectSettingsDialog.d.ts +30 -0
- package/dist/session/ProjectSettingsDialog.js +693 -0
- package/dist/session/ProjectShareDialog.d.ts +36 -0
- package/dist/session/ProjectShareDialog.js +190 -0
- package/dist/session/ProjectSkillsSection.d.ts +7 -0
- package/dist/session/ProjectSkillsSection.js +197 -0
- package/dist/session/ProjectToolsSection.d.ts +16 -0
- package/dist/session/ProjectToolsSection.js +347 -0
- package/dist/session/ProjectUsage.d.ts +61 -0
- package/dist/session/ProjectUsage.js +344 -0
- package/dist/session/ProviderUsageProvider.d.ts +2 -3
- package/dist/session/QueueTab.js +11 -1
- package/dist/session/RemindersPanel.js +10 -12
- package/dist/session/SecretsPanel.js +2 -1
- package/dist/session/SessionAccessNotice.d.ts +31 -0
- package/dist/session/SessionAccessNotice.js +69 -0
- package/dist/session/SessionDetailsDialog.d.ts +3 -1
- package/dist/session/SessionDetailsDialog.js +16 -1
- package/dist/session/SessionHeader.d.ts +10 -3
- package/dist/session/SessionHeader.js +19 -7
- package/dist/session/SessionPeopleStack.d.ts +24 -0
- package/dist/session/SessionPeopleStack.js +99 -0
- package/dist/session/SessionPlaceMenu.js +7 -6
- package/dist/session/SessionProvider.d.ts +13 -1
- package/dist/session/SessionProvider.js +21 -1
- package/dist/session/ShareSessionDialog.d.ts +32 -0
- package/dist/session/ShareSessionDialog.js +241 -0
- package/dist/session/TypingLine.d.ts +27 -0
- package/dist/session/TypingLine.js +42 -0
- package/dist/session/{UsagePanel.d.ts → UsageSection.d.ts} +9 -13
- package/dist/session/{UsagePanel.js → UsageSection.js} +40 -41
- package/dist/session/artifact-row-parts.d.ts +32 -0
- package/dist/session/artifact-row-parts.js +51 -0
- package/dist/session/headless/access.d.ts +33 -0
- package/dist/session/headless/access.js +48 -0
- package/dist/session/headless/fixture-host.d.ts +48 -9
- package/dist/session/headless/fixture-host.js +139 -1
- package/dist/session/headless/fixture-project-artifacts.d.ts +77 -0
- package/dist/session/headless/fixture-project-artifacts.js +168 -0
- package/dist/session/headless/fixture-project-content.d.ts +67 -0
- package/dist/session/headless/fixture-project-content.js +176 -0
- package/dist/session/headless/fixture-projects.d.ts +175 -0
- package/dist/session/headless/fixture-projects.js +498 -0
- package/dist/session/headless/home-layout.d.ts +18 -2
- package/dist/session/headless/home-layout.js +20 -7
- package/dist/session/headless/host.d.ts +302 -7
- package/dist/session/headless/index.d.ts +11 -4
- package/dist/session/headless/index.js +9 -2
- package/dist/session/headless/labels.d.ts +428 -4
- package/dist/session/headless/labels.js +109 -5
- package/dist/session/headless/orchestration-labels.d.ts +52 -0
- package/dist/session/headless/orchestration-labels.js +59 -0
- package/dist/session/headless/people.d.ts +29 -0
- package/dist/session/headless/people.js +53 -0
- package/dist/session/headless/place.d.ts +5 -0
- package/dist/session/headless/place.js +5 -1
- package/dist/session/headless/project-artifact-labels.d.ts +67 -0
- package/dist/session/headless/project-artifact-labels.js +96 -0
- package/dist/session/headless/project-artifacts.d.ts +124 -0
- package/dist/session/headless/project-artifacts.js +271 -0
- package/dist/session/headless/project-content-labels.d.ts +88 -0
- package/dist/session/headless/project-content-labels.js +152 -0
- package/dist/session/headless/project-labels.d.ts +123 -0
- package/dist/session/headless/project-labels.js +128 -0
- package/dist/session/headless/project-sessions.d.ts +37 -0
- package/dist/session/headless/project-sessions.js +57 -0
- package/dist/session/headless/project-usage-labels.d.ts +74 -0
- package/dist/session/headless/project-usage-labels.js +81 -0
- package/dist/session/headless/project-usage.d.ts +65 -0
- package/dist/session/headless/project-usage.js +92 -0
- package/dist/session/headless/projects.d.ts +158 -0
- package/dist/session/headless/projects.js +301 -0
- package/dist/session/headless/pushed-once.d.ts +22 -0
- package/dist/session/headless/pushed-once.js +28 -0
- package/dist/session/headless/queue.js +2 -1
- package/dist/session/headless/typing.d.ts +56 -0
- package/dist/session/headless/typing.js +115 -0
- package/dist/session/home-block-parts.d.ts +40 -0
- package/dist/session/home-block-parts.js +46 -0
- package/dist/session/index.d.ts +21 -4
- package/dist/session/index.js +20 -3
- package/dist/session/modal-shell.d.ts +1 -1
- package/dist/session/modal-shell.js +1 -1
- package/dist/session/project-artifact-parts.d.ts +59 -0
- package/dist/session/project-artifact-parts.js +222 -0
- package/dist/session/project-content-parts.d.ts +176 -0
- package/dist/session/project-content-parts.js +546 -0
- package/dist/session/project-files.d.ts +48 -0
- package/dist/session/project-files.js +54 -0
- package/dist/session/project-folder-actions.d.ts +11 -0
- package/dist/session/project-folder-actions.js +39 -0
- package/dist/session/project-mcp-add.d.ts +23 -0
- package/dist/session/project-mcp-add.js +107 -0
- package/dist/session/project-record-document.d.ts +48 -0
- package/dist/session/project-record-document.js +225 -0
- package/dist/session/project-settings-parts.d.ts +69 -0
- package/dist/session/project-settings-parts.js +90 -0
- package/dist/session/share-people.d.ts +222 -0
- package/dist/session/share-people.js +457 -0
- package/dist/session/testing/contract.d.ts +67 -8
- package/dist/session/testing/contract.js +343 -6
- package/dist/session/testing/index.d.ts +5 -2
- package/dist/session/testing/index.js +4 -1
- package/dist/session/testing/project-artifacts.contract.js +159 -0
- package/dist/session/testing/project-content.contract.d.ts +19 -0
- package/dist/session/testing/project-content.contract.js +221 -0
- package/dist/session/testing/project-sessions.contract.js +134 -0
- package/dist/session/use-folder-missing.d.ts +6 -0
- package/dist/session/use-folder-missing.js +31 -0
- package/dist/session/use-folder-project.d.ts +14 -0
- package/dist/session/use-folder-project.js +37 -0
- package/dist/session/use-home-projects.d.ts +48 -0
- package/dist/session/use-home-projects.js +118 -0
- package/dist/session/use-project-home-layout.d.ts +33 -0
- package/dist/session/use-project-home-layout.js +134 -0
- package/dist/session/use-project-home-on.d.ts +2 -0
- package/dist/session/use-project-home-on.js +14 -0
- package/dist/settings/SettingCard.d.ts +3 -1
- package/dist/settings/SettingCard.js +2 -1
- package/dist/settings/SettingDemo.d.ts +3 -1
- package/dist/settings/SettingDemo.js +4 -3
- package/dist/settings/SettingsShell.d.ts +2 -1
- package/dist/settings/SettingsShell.js +55 -43
- package/dist/settings/headless/index.d.ts +2 -1
- package/dist/settings/headless/index.js +2 -1
- package/dist/settings/headless/mcp-requirement.d.ts +93 -0
- package/dist/settings/headless/mcp-requirement.js +116 -0
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/headless/sections-host.d.ts +7 -2
- package/dist/settings/index.d.ts +3 -2
- package/dist/settings/index.js +5 -4
- package/dist/settings/section.d.ts +24 -3
- package/dist/settings/section.js +27 -4
- package/dist/settings/sections/editor/labels.js +1 -1
- package/dist/settings/sections/environments/EnvironmentsSection.js +30 -6
- package/dist/settings/sections/extensions/ExtensionConfigRows.d.ts +6 -2
- package/dist/settings/sections/extensions/ExtensionConfigRows.js +10 -1
- package/dist/settings/sections/extensions/ExtensionOptionsSection.js +1 -0
- package/dist/settings/sections/extensions/ExtensionsSection.d.ts +6 -3
- package/dist/settings/sections/extensions/ExtensionsSection.js +24 -3
- package/dist/settings/sections/extensions/McpRequirementRow.d.ts +45 -0
- package/dist/settings/sections/extensions/McpRequirementRow.js +298 -0
- package/dist/settings/sections/extensions/labels.d.ts +4 -0
- package/dist/settings/sections/extensions/labels.js +4 -0
- package/dist/settings/sections/extensions/options-labels.d.ts +39 -0
- package/dist/settings/sections/extensions/options-labels.js +48 -1
- package/dist/settings/sections/extensions/use-mcp-setup.d.ts +6 -0
- package/dist/settings/sections/extensions/use-mcp-setup.js +41 -0
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +3 -0
- package/dist/settings/sections/index.d.ts +4 -3
- package/dist/settings/sections/index.js +4 -3
- package/dist/settings/sections/instructions/InstructionsSection.d.ts +69 -1
- package/dist/settings/sections/instructions/InstructionsSection.js +181 -109
- package/dist/settings/sections/keybindings/labels.d.ts +3 -0
- package/dist/settings/sections/keybindings/labels.js +3 -0
- package/dist/settings/sections/keybindings/rows.js +12 -0
- package/dist/settings/sections/logs/LogsSection.js +5 -8
- package/dist/settings/sections/mcp/McpAddForm.d.ts +9 -2
- package/dist/settings/sections/mcp/McpAddForm.js +15 -7
- package/dist/settings/sections/mcp/McpServerRow.js +7 -47
- package/dist/settings/sections/mcp/McpSignIn.d.ts +38 -0
- package/dist/settings/sections/mcp/McpSignIn.js +72 -0
- package/dist/settings/sections/mcp/labels.js +1 -1
- package/dist/settings/sections/models/AgentDefaults.d.ts +12 -4
- package/dist/settings/sections/models/AgentDefaults.js +102 -70
- package/dist/settings/sections/models/ModelPickField.d.ts +10 -1
- package/dist/settings/sections/models/ModelPickField.js +87 -39
- package/dist/settings/sections/models/labels.d.ts +8 -0
- package/dist/settings/sections/models/labels.js +8 -0
- package/dist/settings/sections/performance/labels.js +2 -2
- package/dist/settings/sections/providers/ServerSignIn.d.ts +6 -1
- package/dist/settings/sections/providers/ServerSignIn.js +66 -61
- package/dist/settings/sections/skills/SkillList.d.ts +45 -0
- package/dist/settings/sections/skills/SkillList.js +58 -40
- package/dist/settings/server-app.d.ts +2 -0
- package/dist/settings/server-app.js +16 -4
- package/dist/styles.css +154 -36
- package/dist/terminal/HostTerminalSurface.js +28 -30
- package/dist/terminal/TerminalPanel.js +4 -12
- package/dist/terminal/TerminalProvider.d.ts +10 -2
- package/dist/terminal/TerminalProvider.js +10 -2
- package/dist/terminal/headless/labels.d.ts +0 -1
- package/dist/terminal/headless/labels.js +1 -2
- package/dist/terminal/headless/store.js +5 -1
- package/dist/theme/runtime-icons.js +7 -3
- package/dist/workspace/LayoutBudget.js +1 -7
- package/dist/workspace/PanelContentView.js +1 -1
- package/package.json +26 -2
- package/src/styles/app.css +6 -3
- package/src/styles/chat.css +3 -1
- package/src/styles/palette.css +15 -19
- package/src/styles/primitives.css +3 -1
- package/src/styles/transcript.css +39 -3
- package/dist/dist/index-De9AbmxS.d.ts +0 -1
- package/dist/dist/sandbox-CSUihARm.d.ts +0 -2
- /package/dist/dist/{execution-failure-SREfl-EZ.d.ts → execution-failure-_L2r_Qd-.d.ts} +0 -0
|
@@ -3,7 +3,8 @@ import { resolveDraftDescriptor } from "../../git/headless/environment.js";
|
|
|
3
3
|
import { resolveRemoteClone } from "../../git/headless/remote-clone.js";
|
|
4
4
|
import { useImportRepo } from "../../git/ImportRepoDialog.js";
|
|
5
5
|
import { useEnvironmentChoices } from "../../git/useEnvironmentChoices.js";
|
|
6
|
-
import { draftFolderPath, draftLocalFolder, recentHostFolders, recentLocalFolders } from "../headless/draft-target.js";
|
|
6
|
+
import { draftFolderPath, draftLocalFolder, recentHostFolders, recentLocalFolders, unavailablePlaceIssue } from "../headless/draft-target.js";
|
|
7
|
+
import { folderRoots } from "../headless/folder-groups.js";
|
|
7
8
|
import { useEffect, useMemo, useState } from "react";
|
|
8
9
|
import { LOCAL_HOST_KEY, placeEnvironmentKind, placeOfPick } from "zidane/chat/pure";
|
|
9
10
|
// src/chat/composer/use-draft-target.ts
|
|
@@ -136,6 +137,15 @@ function useDraftTarget(options) {
|
|
|
136
137
|
setPlaceCheck(null);
|
|
137
138
|
} else if (!placeCheck.folder) setPlaceCheck(null);
|
|
138
139
|
}
|
|
140
|
+
const placeKind = isNewSession && place && placeSaved && place.hostId === hostId ? placeEnvironmentKind(place) : void 0;
|
|
141
|
+
const fallbackIssue = unavailablePlaceIssue(placeKind, environment?.kind, environmentChoices, descriptor);
|
|
142
|
+
const fallbackKey = fallbackIssue ? JSON.stringify([
|
|
143
|
+
placeKind,
|
|
144
|
+
folderPath,
|
|
145
|
+
remoteFolder
|
|
146
|
+
]) : null;
|
|
147
|
+
const [dismissedFallback, setDismissedFallback] = useState(null);
|
|
148
|
+
const shownFallback = fallbackIssue && fallbackKey !== dismissedFallback ? fallbackIssue : null;
|
|
139
149
|
const localFolder = draftLocalFolder({
|
|
140
150
|
...folderState,
|
|
141
151
|
onMachine: Boolean(machine)
|
|
@@ -233,6 +243,7 @@ function useDraftTarget(options) {
|
|
|
233
243
|
const [cloning, setCloning] = useState(false);
|
|
234
244
|
const serverId = server?.id;
|
|
235
245
|
const serverFolders = useMemo(() => serverId ? recentHostFolders(sessions, serverId) : [], [serverId, sessions]);
|
|
246
|
+
const roots = useMemo(() => folderRoots(sessions, serverId), [serverId, sessions]);
|
|
236
247
|
const serverName = server?.name;
|
|
237
248
|
const serverUrl = server?.url;
|
|
238
249
|
const pickedKind = descriptor?.kind;
|
|
@@ -289,6 +300,7 @@ function useDraftTarget(options) {
|
|
|
289
300
|
remoteFolder,
|
|
290
301
|
setRemoteFolder,
|
|
291
302
|
serverFolders,
|
|
303
|
+
folderRoots: roots,
|
|
292
304
|
remoteRoot: remoteRootListing?.path ?? null,
|
|
293
305
|
...serverImports ? { importRepoOnServer: async () => {
|
|
294
306
|
const cloned = await importOnServer();
|
|
@@ -304,8 +316,11 @@ function useDraftTarget(options) {
|
|
|
304
316
|
machineFolder,
|
|
305
317
|
setMachineFolder,
|
|
306
318
|
machineHost,
|
|
307
|
-
placeIssue,
|
|
308
|
-
dismissPlaceIssue: () =>
|
|
319
|
+
placeIssue: placeIssue ?? shownFallback,
|
|
320
|
+
dismissPlaceIssue: () => {
|
|
321
|
+
if (placeIssue) setPlaceIssue(null);
|
|
322
|
+
else setDismissedFallback(fallbackKey);
|
|
323
|
+
},
|
|
309
324
|
here,
|
|
310
325
|
error,
|
|
311
326
|
setError
|
|
@@ -25,6 +25,8 @@ export interface SendPromptOptions {
|
|
|
25
25
|
draft: DraftTarget;
|
|
26
26
|
/** The server the composer talks to (`null`: this computer). */
|
|
27
27
|
hostId: string | null;
|
|
28
|
+
/** The project the draft's session is filed in whatever its folder (the home of a project with no folder). Absent: its folder's. */
|
|
29
|
+
projectId?: string;
|
|
28
30
|
/** Creates the draft's session. Rejects with why it can't (shown on the draft). */
|
|
29
31
|
createSession: (request: NewSessionRequest) => Promise<{
|
|
30
32
|
id: string;
|
|
@@ -67,7 +67,10 @@ function useSendPrompt(options) {
|
|
|
67
67
|
...options.newSessionDefaults(),
|
|
68
68
|
untitled: labels.sendUntitled
|
|
69
69
|
}, onMachine);
|
|
70
|
-
const created = await options.createSession(
|
|
70
|
+
const created = await options.createSession(options.projectId ? {
|
|
71
|
+
...request,
|
|
72
|
+
projectId: options.projectId
|
|
73
|
+
} : request);
|
|
71
74
|
options.onSessionCreated?.();
|
|
72
75
|
return created;
|
|
73
76
|
} catch (err) {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A person's answer that came second (docs/MULTIPLAYER.md, In a shared session): the host keeps the first answer to
|
|
3
|
+
* an approval or a question, and tells the second who gave it and what it was. Every host adapter reads that the same
|
|
4
|
+
* way here.
|
|
5
|
+
*/
|
|
6
|
+
/** What a host answers `approvals.resolve` or `interactions.respond` (its fields this reads). */
|
|
7
|
+
export interface AnswerOutcome<D> {
|
|
8
|
+
/** The answer was taken: it is the first. */
|
|
9
|
+
ok: boolean;
|
|
10
|
+
/** The first answer, when this one came second. */
|
|
11
|
+
decision?: D;
|
|
12
|
+
/** Who gave the first answer. */
|
|
13
|
+
answeredBy?: {
|
|
14
|
+
id: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Who answered first and what, when this answer came second; `undefined` when it was taken (or the host says nothing).
|
|
20
|
+
*
|
|
21
|
+
* @param result - The host's answer to `approvals.resolve` or `interactions.respond`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function answeredFirstOf<D>(result: AnswerOutcome<D> | null | undefined): {
|
|
24
|
+
answeredFirst: {
|
|
25
|
+
decision: D;
|
|
26
|
+
by?: string;
|
|
27
|
+
};
|
|
28
|
+
} | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/chat/headless/answered-first.ts
|
|
2
|
+
/**
|
|
3
|
+
* Who answered first and what, when this answer came second; `undefined` when it was taken (or the host says nothing).
|
|
4
|
+
*
|
|
5
|
+
* @param result - The host's answer to `approvals.resolve` or `interactions.respond`.
|
|
6
|
+
*/
|
|
7
|
+
function answeredFirstOf(result) {
|
|
8
|
+
if (!result || result.ok || result.decision === void 0) return void 0;
|
|
9
|
+
return { answeredFirst: {
|
|
10
|
+
decision: result.decision,
|
|
11
|
+
...result.answeredBy ? { by: result.answeredBy.name ?? result.answeredBy.id } : {}
|
|
12
|
+
} };
|
|
13
|
+
}
|
|
14
|
+
export { answeredFirstOf };
|
|
@@ -15,6 +15,7 @@ const LINE_CHARS = 2e3;
|
|
|
15
15
|
*/
|
|
16
16
|
function createChatBlockRuns(transport) {
|
|
17
17
|
const stores = /* @__PURE__ */ new Map();
|
|
18
|
+
const views = /* @__PURE__ */ new Map();
|
|
18
19
|
/** The last read asked for, per session: an older answer never overwrites a newer one. */
|
|
19
20
|
const reads = /* @__PURE__ */ new Map();
|
|
20
21
|
const refresh = (sessionId) => {
|
|
@@ -36,6 +37,30 @@ function createChatBlockRuns(transport) {
|
|
|
36
37
|
}
|
|
37
38
|
return store;
|
|
38
39
|
};
|
|
40
|
+
const viewOf = (sessionId) => {
|
|
41
|
+
let view = views.get(sessionId);
|
|
42
|
+
if (!view) {
|
|
43
|
+
const store = runsOf(sessionId);
|
|
44
|
+
let watchers = 0;
|
|
45
|
+
let stale = false;
|
|
46
|
+
view = {
|
|
47
|
+
get: store.get,
|
|
48
|
+
subscribe(onChange) {
|
|
49
|
+
if (watchers++ === 0 && stale) refresh(sessionId);
|
|
50
|
+
const off = store.subscribe(onChange);
|
|
51
|
+
let on = true;
|
|
52
|
+
return () => {
|
|
53
|
+
if (!on) return;
|
|
54
|
+
on = false;
|
|
55
|
+
off();
|
|
56
|
+
if (--watchers === 0) stale = true;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
views.set(sessionId, view);
|
|
61
|
+
}
|
|
62
|
+
return view;
|
|
63
|
+
};
|
|
39
64
|
const lives = /* @__PURE__ */ new Map();
|
|
40
65
|
const stops = /* @__PURE__ */ new Map();
|
|
41
66
|
const liveOf = (sessionId) => {
|
|
@@ -55,7 +80,7 @@ function createChatBlockRuns(transport) {
|
|
|
55
80
|
});
|
|
56
81
|
};
|
|
57
82
|
return {
|
|
58
|
-
runs:
|
|
83
|
+
runs: viewOf,
|
|
59
84
|
run: (sessionId, request, options) => transport.run(sessionId, request, options),
|
|
60
85
|
remove: (sessionId, key) => transport.remove(sessionId, key),
|
|
61
86
|
live: liveOf,
|
|
@@ -34,6 +34,8 @@ export declare const CHIP_LABELS: {
|
|
|
34
34
|
interactionWaitingAnswers: string;
|
|
35
35
|
interactionDismissed: string;
|
|
36
36
|
interactionAnsweredBy: (who: string) => string;
|
|
37
|
+
/** An answer that came second: who answered first, and what (`answered` for a question says nothing more). */
|
|
38
|
+
interactionAnsweredFirst: (who: string | undefined, decision: string) => string;
|
|
37
39
|
badgePathUnavailable: string;
|
|
38
40
|
badgeNoComposer: string;
|
|
39
41
|
badgeActionFailed: string;
|
|
@@ -35,6 +35,8 @@ const CHIP_LABELS = {
|
|
|
35
35
|
interactionWaitingAnswers: "Waiting for your answers",
|
|
36
36
|
interactionDismissed: "Dismissed, no answer given",
|
|
37
37
|
interactionAnsweredBy: (who) => `Answered by ${who}`,
|
|
38
|
+
/** An answer that came second: who answered first, and what (`answered` for a question says nothing more). */
|
|
39
|
+
interactionAnsweredFirst: (who, decision) => `Already answered${who ? ` by ${who}` : ""}${decision === "answered" ? "" : `: ${decision}`}`,
|
|
38
40
|
badgePathUnavailable: "Path unavailable.",
|
|
39
41
|
badgeNoComposer: "No chat to add to here",
|
|
40
42
|
badgeActionFailed: "That action didn't work.",
|
|
@@ -42,7 +42,7 @@ const normalizeId = (id) => id.replace(/-/g, "").toLowerCase();
|
|
|
42
42
|
* @param token - The chip's text (`#3f2a`).
|
|
43
43
|
*/
|
|
44
44
|
function sessionForToken(sessions, token) {
|
|
45
|
-
const needle = token.replace(/^#/, "")
|
|
45
|
+
const needle = normalizeId(token.replace(/^#/, ""));
|
|
46
46
|
if (!needle) return null;
|
|
47
47
|
const hits = sessions.filter((s) => normalizeId(s.id).startsWith(needle));
|
|
48
48
|
return hits.length === 1 ? hits[0] : null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The composer's completion sources (`ComposerHost.completions`) and how
|
|
3
|
-
* the Chatbox reads them. `@` files, `/` commands
|
|
3
|
+
* the Chatbox reads them. `@` files, `/` commands, `#` chats and the
|
|
4
|
+
* project's artifacts are read
|
|
4
5
|
* when asked for (their popover opens; a typed `/name` needs its badge):
|
|
5
6
|
* nothing is fetched while they stay closed, an invalidation (an agent's
|
|
6
7
|
* write, a session change) only stales them, and the next read refetches.
|
|
@@ -9,7 +10,7 @@
|
|
|
9
10
|
* extension completion providers stay subscribed (`use-composer-sources.ts`):
|
|
10
11
|
* the submit path and the editor need them, and they rarely change.
|
|
11
12
|
*/
|
|
12
|
-
import { CommandSummary, ComposerCompletions, FileEntry } from "./host.js";
|
|
13
|
+
import { CommandSummary, ComposerArtifactEntry, ComposerCompletions, FileEntry } from "./host.js";
|
|
13
14
|
import { ChatReferenceEntry } from "zidane/chat/pure";
|
|
14
15
|
/** A list read on demand. */
|
|
15
16
|
export interface LazyList<T> {
|
|
@@ -38,6 +39,8 @@ export interface ComposerLists {
|
|
|
38
39
|
commands: LazyList<CommandSummary>;
|
|
39
40
|
/** `#` chats. */
|
|
40
41
|
chats: LazyList<ChatReferenceEntry>;
|
|
42
|
+
/** `#` artifacts of the folder's project. */
|
|
43
|
+
artifacts: LazyList<ComposerArtifactEntry>;
|
|
41
44
|
/** A new folder, file root or server (`null`: none): every list starts over. */
|
|
42
45
|
setScope: (scope: ComposerListScope | null) => void;
|
|
43
46
|
}
|
|
@@ -58,15 +58,21 @@ function createComposerLists(completions, onCommands) {
|
|
|
58
58
|
hostId: scope.hostId
|
|
59
59
|
}) : null, (entries) => entries, onCommands);
|
|
60
60
|
const chats = lazyList("chats", () => scope && completions?.chats ? completions.chats() : null, (entries) => entries);
|
|
61
|
+
const artifacts = lazyList("artifacts", () => scope && completions?.artifacts ? completions.artifacts({
|
|
62
|
+
cwd: scope.folderPath,
|
|
63
|
+
hostId: scope.hostId
|
|
64
|
+
}) : null, (entries) => entries);
|
|
61
65
|
return {
|
|
62
66
|
files,
|
|
63
67
|
commands,
|
|
64
68
|
chats,
|
|
69
|
+
artifacts,
|
|
65
70
|
setScope(next) {
|
|
66
71
|
scope = next;
|
|
67
72
|
files.reset();
|
|
68
73
|
commands.reset();
|
|
69
74
|
chats.reset();
|
|
75
|
+
artifacts.reset();
|
|
70
76
|
}
|
|
71
77
|
};
|
|
72
78
|
}
|
|
@@ -118,6 +118,17 @@ export interface ComposerFolders {
|
|
|
118
118
|
/** Remembers `path` as the next new session's folder. */
|
|
119
119
|
setLastUsed: (path: string) => Promise<void>;
|
|
120
120
|
}
|
|
121
|
+
/** An artifact of the composer's project that `#` can mention (docs/ARTIFACTS.md § Mentions). */
|
|
122
|
+
export interface ComposerArtifactEntry {
|
|
123
|
+
/** The project artifact's id: the mention names its first 8 hex digits. */
|
|
124
|
+
id: string;
|
|
125
|
+
/** Its kind (`pull_request`, `file`, an extension's). */
|
|
126
|
+
kind: string;
|
|
127
|
+
/** Its human line: the mention's chip text. */
|
|
128
|
+
label: string;
|
|
129
|
+
/** Its locator. */
|
|
130
|
+
uri: string;
|
|
131
|
+
}
|
|
121
132
|
/** The catalogs behind the composer's completions. Each one left out empties its popover. */
|
|
122
133
|
export interface ComposerCompletions {
|
|
123
134
|
/** The files under `root` for `@` mentions (`hostId`: the server holding `root`). */
|
|
@@ -128,6 +139,8 @@ export interface ComposerCompletions {
|
|
|
128
139
|
commandArgs?: (scope: ComposerScope, name: string, prefix: string) => Promise<readonly CommandArgSuggestionSummary[]>;
|
|
129
140
|
/** The sessions `#` can reference. */
|
|
130
141
|
chats?: () => Promise<readonly ChatReferenceEntry[]>;
|
|
142
|
+
/** The artifacts of the scope's project that `#` can mention, the newest first. Absent: `#` offers chats only. */
|
|
143
|
+
artifacts?: (scope: ComposerScope) => Promise<readonly ComposerArtifactEntry[]>;
|
|
131
144
|
/** Calls `listener` with the enabled skills in a scope (`/skill` completion and badges), now and on each change. Returns the unsubscribe. */
|
|
132
145
|
watchSkills?: (scope: ComposerScope, listener: (skills: readonly SkillConfig[]) => void) => () => void;
|
|
133
146
|
/**
|
|
@@ -4,7 +4,7 @@ import { ComposerListScope, ComposerLists, LazyList, createComposerLists } from
|
|
|
4
4
|
import { ConversationBadge, ConversationBadgeData, ConversationBadgeInput, InboxSummary, MAX_EXTENSION_COMPOSER_BADGES, conversationBadges, resolveBadgePanel } from "./conversation-badges.js";
|
|
5
5
|
import { BookDraft, ComposerDraftStorage, DraftBook, NewChatPlaceKey, StoredComposerDraft, UNDECIDED_NEW_CHAT_DRAFT_KEY, WebStorageDraftStorageOptions, createDraftBook, createWebStorageDraftStorage, draftBookOf, newChatDraftKey } from "./draft-book.js";
|
|
6
6
|
import { wireAttachmentsToChat } from "./draft-sync.js";
|
|
7
|
-
import { CommandArgSuggestionSummary, CommandSummary, ComposerAttachment, ComposerAutocomplete, ComposerCommandArgs, ComposerCompletions, ComposerDraftAttachmentsListener, ComposerDrafts, ComposerExtensionItem, ComposerExtensionProvider, ComposerFolderLocation, ComposerFolders, ComposerHost, ComposerPromptSuggestion, ComposerScope, ComposerSharedGhost, ComposerSkillGroup, ComposerSuggestions, FileEntry, PromptAttachment, SharedDraft, SharedDraftAttachmentsChange, SharedDraftChange, SkillConfig } from "./host.js";
|
|
7
|
+
import { CommandArgSuggestionSummary, CommandSummary, ComposerArtifactEntry, ComposerAttachment, ComposerAutocomplete, ComposerCommandArgs, ComposerCompletions, ComposerDraftAttachmentsListener, ComposerDrafts, ComposerExtensionItem, ComposerExtensionProvider, ComposerFolderLocation, ComposerFolders, ComposerHost, ComposerPromptSuggestion, ComposerScope, ComposerSharedGhost, ComposerSkillGroup, ComposerSuggestions, FileEntry, PromptAttachment, SharedDraft, SharedDraftAttachmentsChange, SharedDraftChange, SkillConfig } from "./host.js";
|
|
8
8
|
import { ComposerAgentProfile, ComposerAgents, ComposerCacheImpact, ComposerCacheImpactChange, ComposerContext, ComposerContextBreakdown, ComposerContextStatus, ComposerControls, ComposerCostStatus, ComposerEffort, ComposerModels, ComposerPrefs, ComposerPrefsState, ComposerRememberedModel, ComposerRunProgress, ComposerRuns, ComposerSessionView } from "./host-chrome.js";
|
|
9
9
|
import { ComposerLabels, DEFAULT_COMPOSER_LABELS } from "./labels.js";
|
|
10
10
|
import { ComposerChromeLabels, DEFAULT_COMPOSER_CHROME_LABELS } from "./labels-chrome.js";
|
|
@@ -16,4 +16,4 @@ import { ComposerModelEntry, ComposerModelOption, ImageModelRow, ModelCatalogRow
|
|
|
16
16
|
import { EffortPickerTarget, defaultModelPatch, effortPickerTarget, rememberedDefaultModel } from "./new-session-defaults.js";
|
|
17
17
|
import { SetDefaultModel, commitModelPick, lastModelChainOf, rememberableChain, rememberedPick, settledResource } from "./remember-model-pick.js";
|
|
18
18
|
import { EMPTY_RUN_METER, RunMeter, RunMeterRow, RunMeterSignal, RunMeterState, createRunMeter } from "./run-meter.js";
|
|
19
|
-
export { BookDraft, type CommandArgSuggestionSummary, type CommandSummary, ComposerAgentProfile, ComposerAgents, ComposerAttachment, ComposerAutocomplete, ComposerCacheImpact, ComposerCacheImpactChange, ComposerChromeLabels, ComposerCommandArgs, ComposerCompletions, ComposerContext, ComposerContextBreakdown, ComposerContextStatus, ComposerControls, ComposerCostStatus, ComposerDraftAttachmentsListener, ComposerDraftStorage, ComposerDrafts, ComposerEffort, ComposerExtensionItem, ComposerExtensionProvider, ComposerFolderLocation, ComposerFolders, ComposerHost, ComposerLabels, type ComposerListScope, type ComposerLists, ComposerModelEntry, ComposerModelOption, ComposerModels, ComposerPrefs, ComposerPrefsState, ComposerPromptSuggestion, ComposerRememberedModel, ComposerRunProgress, ComposerRuns, ComposerScope, ComposerSessionView, ComposerSharedGhost, ComposerSkillGroup, ComposerSuggestions, ConversationBadge, ConversationBadgeData, ConversationBadgeInput, DEFAULT_COMPOSER_CHROME_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_MODEL_PICKER_PREFS, DraftBook, EMPTY_RUN_METER, EffortPickerTarget, type FileEntry, ImageModelRow, InboxSummary, type LazyList, LiveCostStatus, LiveStreamProgress, MAX_EXTENSION_COMPOSER_BADGES, MODEL_PICKER_STORAGE_KEY, ModelCatalogRow, ModelKnobs, ModelKnobsMemory, ModelKnobsStore, ModelNames, ModelNamesProvider, ModelNamesStore, ModelPickRef, ModelPickerPrefs, ModelPickerPrefsStorage, ModelPickerPrefsStore, NewChatPlaceKey, type PromptAttachment, type ResourceSnapshot, RunMeter, RunMeterRow, RunMeterSignal, RunMeterState, SetDefaultModel, SharedDraft, SharedDraftAttachmentsChange, SharedDraftChange, type SkillConfig, StoredComposerDraft, UNDECIDED_NEW_CHAT_DRAFT_KEY, WebStorageDraftStorageOptions, commitModelPick, composeLiveCost, conversationBadges, createComposerLists, createDraftBook, createModelKnobs, createModelNames, createModelPickerPrefs, createRunMeter, createWebStorageDraftStorage, defaultModelPatch, draftBookOf, effortPickerTarget, findCommand, formatSessionCostLabel, lastModelChainOf, modelKnobsOf, modelNamesOf, namerFor, newChatDraftKey, parseModelPickerPrefs, rememberableChain, rememberedDefaultModel, rememberedPick, resolveBadgePanel, settledResource, wireAttachmentsToChat };
|
|
19
|
+
export { BookDraft, type CommandArgSuggestionSummary, type CommandSummary, ComposerAgentProfile, ComposerAgents, ComposerArtifactEntry, ComposerAttachment, ComposerAutocomplete, ComposerCacheImpact, ComposerCacheImpactChange, ComposerChromeLabels, ComposerCommandArgs, ComposerCompletions, ComposerContext, ComposerContextBreakdown, ComposerContextStatus, ComposerControls, ComposerCostStatus, ComposerDraftAttachmentsListener, ComposerDraftStorage, ComposerDrafts, ComposerEffort, ComposerExtensionItem, ComposerExtensionProvider, ComposerFolderLocation, ComposerFolders, ComposerHost, ComposerLabels, type ComposerListScope, type ComposerLists, ComposerModelEntry, ComposerModelOption, ComposerModels, ComposerPrefs, ComposerPrefsState, ComposerPromptSuggestion, ComposerRememberedModel, ComposerRunProgress, ComposerRuns, ComposerScope, ComposerSessionView, ComposerSharedGhost, ComposerSkillGroup, ComposerSuggestions, ConversationBadge, ConversationBadgeData, ConversationBadgeInput, DEFAULT_COMPOSER_CHROME_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_MODEL_PICKER_PREFS, DraftBook, EMPTY_RUN_METER, EffortPickerTarget, type FileEntry, ImageModelRow, InboxSummary, type LazyList, LiveCostStatus, LiveStreamProgress, MAX_EXTENSION_COMPOSER_BADGES, MODEL_PICKER_STORAGE_KEY, ModelCatalogRow, ModelKnobs, ModelKnobsMemory, ModelKnobsStore, ModelNames, ModelNamesProvider, ModelNamesStore, ModelPickRef, ModelPickerPrefs, ModelPickerPrefsStorage, ModelPickerPrefsStore, NewChatPlaceKey, type PromptAttachment, type ResourceSnapshot, RunMeter, RunMeterRow, RunMeterSignal, RunMeterState, SetDefaultModel, SharedDraft, SharedDraftAttachmentsChange, SharedDraftChange, type SkillConfig, StoredComposerDraft, UNDECIDED_NEW_CHAT_DRAFT_KEY, WebStorageDraftStorageOptions, commitModelPick, composeLiveCost, conversationBadges, createComposerLists, createDraftBook, createModelKnobs, createModelNames, createModelPickerPrefs, createRunMeter, createWebStorageDraftStorage, defaultModelPatch, draftBookOf, effortPickerTarget, findCommand, formatSessionCostLabel, lastModelChainOf, modelKnobsOf, modelNamesOf, namerFor, newChatDraftKey, parseModelPickerPrefs, rememberableChain, rememberedDefaultModel, rememberedPick, resolveBadgePanel, settledResource, wireAttachmentsToChat };
|
|
@@ -35,7 +35,10 @@ export declare const DEFAULT_COMPOSER_CHROME_LABELS: {
|
|
|
35
35
|
/** The folder menu with nothing in it yet (no projects, nothing to add one with). */
|
|
36
36
|
scopeNoProjects: string;
|
|
37
37
|
scopeSelectDirectory: string;
|
|
38
|
+
scopeNewProject: string;
|
|
38
39
|
scopeBackToProjects: string;
|
|
40
|
+
/** A project's row in the folder menu: the button that shows or hides its worktrees. */
|
|
41
|
+
scopeWorktrees: (n: number, project: string) => string;
|
|
39
42
|
scopeServerGroup: (host: string) => string;
|
|
40
43
|
scopeServerChoose: (host: string) => string;
|
|
41
44
|
scopeServerFolderHint: (folder: string, host: string) => string;
|
|
@@ -36,13 +36,16 @@ const DEFAULT_COMPOSER_CHROME_LABELS = {
|
|
|
36
36
|
/** The folder menu with nothing in it yet (no projects, nothing to add one with). */
|
|
37
37
|
scopeNoProjects: "No projects yet",
|
|
38
38
|
scopeSelectDirectory: "Select directory…",
|
|
39
|
+
scopeNewProject: "New project…",
|
|
39
40
|
scopeBackToProjects: "Projects",
|
|
41
|
+
/** A project's row in the folder menu: the button that shows or hides its worktrees. */
|
|
42
|
+
scopeWorktrees: (n, project) => n === 1 ? `1 worktree of ${project}` : `${n} worktrees of ${project}`,
|
|
40
43
|
scopeServerGroup: (host) => `Folder on ${host}`,
|
|
41
44
|
scopeServerChoose: (host) => `Choose a folder on ${host}`,
|
|
42
45
|
scopeServerFolderHint: (folder, host) => `${folder} on ${host}. Click to change folder`,
|
|
43
46
|
scopeServerDefault: "Default folder",
|
|
44
47
|
scopeServerDefaultHint: (host) => `The first workspace root on ${host}`,
|
|
45
|
-
scopeCloneWill: (name) =>
|
|
48
|
+
scopeCloneWill: (name) => `Will clone ${name}`,
|
|
46
49
|
scopeCloneWillHint: (url, parent, host) => `Sending clones ${url} into ${parent} on ${host}`,
|
|
47
50
|
scopeCloneThere: (path, host) => `${path} on ${host}, already there`,
|
|
48
51
|
scopeCloneOffHint: (host) => `Cloning is off on ${host} (allowClone). New chats start in its default folder.`,
|
|
@@ -22,6 +22,8 @@ export declare const DEFAULT_COMPOSER_EDITOR_LABELS: {
|
|
|
22
22
|
chatScopeAll: string;
|
|
23
23
|
/** A `#` row's message count. */
|
|
24
24
|
chatMessages: (n: number) => string;
|
|
25
|
+
/** The `#` popover's section of the project's artifacts. */
|
|
26
|
+
mentionArtifacts: string;
|
|
25
27
|
/** The prompt mode chips, and the history position while ↑/↓ browse it. */
|
|
26
28
|
modeShell: string;
|
|
27
29
|
modeSearch: string;
|
|
@@ -23,6 +23,8 @@ const DEFAULT_COMPOSER_EDITOR_LABELS = {
|
|
|
23
23
|
chatScopeAll: "All projects",
|
|
24
24
|
/** A `#` row's message count. */
|
|
25
25
|
chatMessages: (n) => `${n} messages`,
|
|
26
|
+
/** The `#` popover's section of the project's artifacts. */
|
|
27
|
+
mentionArtifacts: "Artifacts",
|
|
26
28
|
/** The prompt mode chips, and the history position while ↑/↓ browse it. */
|
|
27
29
|
modeShell: "shell",
|
|
28
30
|
modeSearch: "search",
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* The draft starts on this computer.
|
|
11
11
|
* - `machine-gone`: the machine is no longer one of the server's. The draft starts on the server itself.
|
|
12
12
|
* - `folder-gone`: the folder is not there any more. The draft starts in the usual folder.
|
|
13
|
+
* - `unavailable`: the place's isolation can't run in the draft's folder (`label`, and its `reason`). The draft
|
|
14
|
+
* starts in `fallback`, the host's default (or Local), and starts in the isolation again in a folder it serves.
|
|
13
15
|
*/
|
|
14
16
|
export type DraftPlaceIssue = {
|
|
15
17
|
kind: 'unsaved';
|
|
@@ -22,13 +24,39 @@ export type DraftPlaceIssue = {
|
|
|
22
24
|
} | {
|
|
23
25
|
kind: 'folder-gone';
|
|
24
26
|
folder: string;
|
|
27
|
+
} | {
|
|
28
|
+
kind: 'unavailable';
|
|
29
|
+
label: string;
|
|
30
|
+
reason?: string;
|
|
31
|
+
fallback: string;
|
|
25
32
|
};
|
|
33
|
+
/** A descriptor as {@link unavailablePlaceIssue} reads it. */
|
|
34
|
+
interface PlaceKindDescriptor {
|
|
35
|
+
kind: string;
|
|
36
|
+
label: string;
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
available: boolean;
|
|
39
|
+
reason?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The `unavailable` issue of a new chat whose default place asks for `placeKind`: when the draft still asks
|
|
43
|
+
* for it (`draftKind`), the host lists it, and it can't run in the draft's folder, so the draft resolved to
|
|
44
|
+
* `resolved` instead. `null` otherwise: it runs there, the draft picked something else, or the list is not in yet.
|
|
45
|
+
*
|
|
46
|
+
* @param placeKind - The default place's isolation (`placeEnvironmentKind`); absent: the host's default.
|
|
47
|
+
* @param draftKind - What the draft asks for now.
|
|
48
|
+
* @param descriptors - What the draft's host lists for its folder.
|
|
49
|
+
* @param resolved - What the draft resolved to (`resolveDraftDescriptor`).
|
|
50
|
+
*/
|
|
51
|
+
export declare function unavailablePlaceIssue(placeKind: string | undefined, draftKind: string | undefined, descriptors: readonly PlaceKindDescriptor[], resolved: Pick<PlaceKindDescriptor, 'kind' | 'label'> | undefined): DraftPlaceIssue | null;
|
|
26
52
|
/** A session row as {@link recentLocalFolders} reads it. */
|
|
27
53
|
export interface DraftFolderSource {
|
|
28
54
|
/** The session's folder (`''`: none). */
|
|
29
55
|
cwd?: string | null;
|
|
30
56
|
/** Set for a server's session: its folders are not on this computer. */
|
|
31
57
|
hostId?: string | null;
|
|
58
|
+
/** The project it belongs to: the main checkout for a linked worktree (the folder menu folds those). */
|
|
59
|
+
projectRoot?: string | null;
|
|
32
60
|
}
|
|
33
61
|
/**
|
|
34
62
|
* This computer's recent folders, most recent first (the rows' order), each once.
|
|
@@ -72,4 +100,5 @@ export declare function draftFolderPath(state: DraftFolderState): string | null;
|
|
|
72
100
|
*
|
|
73
101
|
* @param state - The draft's picks (`sessionCwd` set: not a draft, `null`).
|
|
74
102
|
*/
|
|
75
|
-
export declare function draftLocalFolder(state: DraftFolderState): string | null;
|
|
103
|
+
export declare function draftLocalFolder(state: DraftFolderState): string | null;
|
|
104
|
+
export {};
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
// src/chat/headless/draft-target.ts
|
|
2
2
|
/**
|
|
3
|
+
* The `unavailable` issue of a new chat whose default place asks for `placeKind`: when the draft still asks
|
|
4
|
+
* for it (`draftKind`), the host lists it, and it can't run in the draft's folder, so the draft resolved to
|
|
5
|
+
* `resolved` instead. `null` otherwise: it runs there, the draft picked something else, or the list is not in yet.
|
|
6
|
+
*
|
|
7
|
+
* @param placeKind - The default place's isolation (`placeEnvironmentKind`); absent: the host's default.
|
|
8
|
+
* @param draftKind - What the draft asks for now.
|
|
9
|
+
* @param descriptors - What the draft's host lists for its folder.
|
|
10
|
+
* @param resolved - What the draft resolved to (`resolveDraftDescriptor`).
|
|
11
|
+
*/
|
|
12
|
+
function unavailablePlaceIssue(placeKind, draftKind, descriptors, resolved) {
|
|
13
|
+
if (!placeKind || draftKind !== placeKind || !resolved || resolved.kind === placeKind) return null;
|
|
14
|
+
const wanted = descriptors.find((d) => d.kind === placeKind);
|
|
15
|
+
if (!wanted || wanted.enabled && wanted.available) return null;
|
|
16
|
+
return {
|
|
17
|
+
kind: "unavailable",
|
|
18
|
+
label: wanted.label,
|
|
19
|
+
...wanted.reason ? { reason: wanted.reason } : {},
|
|
20
|
+
fallback: resolved.label
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
3
24
|
* This computer's recent folders, most recent first (the rows' order), each once.
|
|
4
25
|
*
|
|
5
26
|
* @param sessions - The session rows, most recently updated first.
|
|
@@ -55,4 +76,4 @@ function draftLocalFolder(state) {
|
|
|
55
76
|
if (state.sessionCwd !== void 0 || state.onServer || state.onMachine || state.folderless) return null;
|
|
56
77
|
return draftFolderPath(state) || null;
|
|
57
78
|
}
|
|
58
|
-
export { draftFolderPath, draftLocalFolder, recentHostFolders, recentLocalFolders };
|
|
79
|
+
export { draftFolderPath, draftLocalFolder, recentHostFolders, recentLocalFolders, unavailablePlaceIssue };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The folder menu's rows (`ProjectMenu`): each listed folder, with its project's linked worktrees folded under it.
|
|
3
|
+
*
|
|
4
|
+
* A folder is a worktree when the host filed its sessions under another project root (`SessionData.projectRoot`,
|
|
5
|
+
* the main checkout of a linked worktree) and it is not a folder inside that root, or when it sits in the app's own
|
|
6
|
+
* worktree layout: `<repo>/.zidane/worktrees/<branch>`, or `<data dir>/worktrees/<repo>-<hash>/<branch>` (matched to
|
|
7
|
+
* the one listed folder named `<repo>`). A worktree whose project is not listed stays a row of its own.
|
|
8
|
+
*/
|
|
9
|
+
/** A session row as {@link folderRoots} reads it. */
|
|
10
|
+
export interface FolderRootSource {
|
|
11
|
+
/** The session's folder (`''`: none). */
|
|
12
|
+
cwd?: string | null;
|
|
13
|
+
/** The project it belongs to: the main checkout for a linked worktree. */
|
|
14
|
+
projectRoot?: string | null;
|
|
15
|
+
/** Set for a server's session. */
|
|
16
|
+
hostId?: string | null;
|
|
17
|
+
}
|
|
18
|
+
/** One top-level row of the folder menu. */
|
|
19
|
+
export interface FolderGroup {
|
|
20
|
+
/** The folder, as listed. */
|
|
21
|
+
folder: string;
|
|
22
|
+
/** The folder is a worktree whose project is not listed. */
|
|
23
|
+
worktree: boolean;
|
|
24
|
+
/** Its project's worktrees that are listed, in the list's order. */
|
|
25
|
+
worktrees: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The project root of each session folder that is a linked worktree: its `projectRoot` when that is another folder
|
|
29
|
+
* the folder is not inside (a subfolder of a repository is no worktree). Keys and values have no trailing separator.
|
|
30
|
+
*
|
|
31
|
+
* @param sessions - The session rows.
|
|
32
|
+
* @param hostId - Read this server's sessions. Absent: this computer's.
|
|
33
|
+
*/
|
|
34
|
+
export declare function folderRoots(sessions: readonly FolderRootSource[], hostId?: string): Record<string, string>;
|
|
35
|
+
/**
|
|
36
|
+
* The folder menu's rows: the folders in their order, each worktree under its project's row when that is listed.
|
|
37
|
+
*
|
|
38
|
+
* @param folders - The folders, most recent first.
|
|
39
|
+
* @param roots - The project root of each worktree folder ({@link folderRoots}). The app's worktree layout counts too.
|
|
40
|
+
*/
|
|
41
|
+
export declare function groupFolders(folders: readonly string[], roots?: Readonly<Record<string, string>>): FolderGroup[];
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// src/chat/headless/folder-groups.ts
|
|
2
|
+
const trim = (path) => path.replace(/[/\\]+$/, "") || path;
|
|
3
|
+
const baseOf = (path) => trim(path).split(/[/\\]/).pop() ?? path;
|
|
4
|
+
const IN_REPO = /^(.+)[/\\]\.zidane[/\\]worktrees[/\\][^/\\]+$/;
|
|
5
|
+
const IN_DATA_DIR = /[/\\]worktrees[/\\](.+)-[0-9a-f]{8}[/\\][^/\\]+$/;
|
|
6
|
+
function isInside(folder, root) {
|
|
7
|
+
return folder.length > root.length && folder.startsWith(root) && /[/\\]/.test(folder[root.length] ?? "");
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The project root of each session folder that is a linked worktree: its `projectRoot` when that is another folder
|
|
11
|
+
* the folder is not inside (a subfolder of a repository is no worktree). Keys and values have no trailing separator.
|
|
12
|
+
*
|
|
13
|
+
* @param sessions - The session rows.
|
|
14
|
+
* @param hostId - Read this server's sessions. Absent: this computer's.
|
|
15
|
+
*/
|
|
16
|
+
function folderRoots(sessions, hostId) {
|
|
17
|
+
const out = {};
|
|
18
|
+
for (const s of sessions) {
|
|
19
|
+
if (!s.cwd || !s.projectRoot || (hostId === void 0 ? Boolean(s.hostId) : s.hostId !== hostId)) continue;
|
|
20
|
+
const cwd = trim(s.cwd);
|
|
21
|
+
const root = trim(s.projectRoot);
|
|
22
|
+
if (cwd === root || cwd in out || isInside(cwd, root) && !IN_REPO.test(cwd)) continue;
|
|
23
|
+
out[cwd] = root;
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The folder menu's rows: the folders in their order, each worktree under its project's row when that is listed.
|
|
29
|
+
*
|
|
30
|
+
* @param folders - The folders, most recent first.
|
|
31
|
+
* @param roots - The project root of each worktree folder ({@link folderRoots}). The app's worktree layout counts too.
|
|
32
|
+
*/
|
|
33
|
+
function groupFolders(folders, roots = {}) {
|
|
34
|
+
const keys = folders.map(trim);
|
|
35
|
+
const at = /* @__PURE__ */ new Map();
|
|
36
|
+
keys.forEach((key, i) => {
|
|
37
|
+
if (!at.has(key)) at.set(key, i);
|
|
38
|
+
});
|
|
39
|
+
const kind = keys.map((key) => {
|
|
40
|
+
const known = roots[key];
|
|
41
|
+
if (known !== void 0 && trim(known) !== key) return { root: trim(known) };
|
|
42
|
+
const inRepo = IN_REPO.exec(key);
|
|
43
|
+
if (inRepo) return { root: inRepo[1] };
|
|
44
|
+
const inData = IN_DATA_DIR.exec(key);
|
|
45
|
+
return inData ? { repo: inData[1] } : null;
|
|
46
|
+
});
|
|
47
|
+
const rootIndex = (i) => {
|
|
48
|
+
const k = kind[i];
|
|
49
|
+
if (!k) return void 0;
|
|
50
|
+
if ("root" in k) {
|
|
51
|
+
const j = at.get(k.root);
|
|
52
|
+
return j !== void 0 && j !== i && !kind[j] ? j : void 0;
|
|
53
|
+
}
|
|
54
|
+
const named = keys.flatMap((key, j) => j !== i && !kind[j] && baseOf(key) === k.repo ? [j] : []);
|
|
55
|
+
return named.length === 1 ? named[0] : void 0;
|
|
56
|
+
};
|
|
57
|
+
const under = /* @__PURE__ */ new Map();
|
|
58
|
+
const top = [];
|
|
59
|
+
folders.forEach((folder, i) => {
|
|
60
|
+
if (at.get(keys[i]) !== i) return;
|
|
61
|
+
const root = rootIndex(i);
|
|
62
|
+
if (root === void 0) {
|
|
63
|
+
top.push(i);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const list = under.get(root) ?? [];
|
|
67
|
+
list.push(folder);
|
|
68
|
+
under.set(root, list);
|
|
69
|
+
});
|
|
70
|
+
return top.map((i) => ({
|
|
71
|
+
folder: folders[i],
|
|
72
|
+
worktree: kind[i] !== null,
|
|
73
|
+
worktrees: under.get(i) ?? []
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
export { folderRoots, groupFolders };
|
|
@@ -65,6 +65,11 @@ export type ChatEvent = Omit<StreamEvent, 'attachments'> & {
|
|
|
65
65
|
thinkingStartedAt?: number;
|
|
66
66
|
/** A closed live thinking segment's duration, replacing `thinkingStartedAt`. */
|
|
67
67
|
thinkingMs?: number;
|
|
68
|
+
/**
|
|
69
|
+
* A prompt this window sent to a live share whose owner's computer is offline: the owner's name. The server holds it
|
|
70
|
+
* until that computer is back; the row says so instead of showing it sent.
|
|
71
|
+
*/
|
|
72
|
+
heldFor?: string;
|
|
68
73
|
};
|
|
69
74
|
/** Run state of a session: `idle`, `running`, `completed`, or `error`. */
|
|
70
75
|
export type ChatSessionStatus = 'idle' | 'running' | 'completed' | 'error';
|
|
@@ -221,6 +226,13 @@ export interface SessionSearchHit {
|
|
|
221
226
|
/** The session's last activity, epoch ms. */
|
|
222
227
|
updatedAt: number;
|
|
223
228
|
}
|
|
229
|
+
/** Who answered a request first, when an answer from this window came second: the first one stands. */
|
|
230
|
+
export interface InteractionAnsweredFirst {
|
|
231
|
+
/** Their name, when the host knows it. */
|
|
232
|
+
by?: string;
|
|
233
|
+
/** Their answer in short: a plan's decision, an elicitation's action, or `answered` for a question. */
|
|
234
|
+
decision: string;
|
|
235
|
+
}
|
|
224
236
|
/** The seam between the chat components and whatever runs the agent: readable stores plus optional actions. A component hides the control for any capability the host leaves out. */
|
|
225
237
|
export interface ChatHost {
|
|
226
238
|
/** Session list and management. Each method left out hides its control (rename, archive, favorite, delete). */
|
|
@@ -286,7 +298,10 @@ export interface ChatHost {
|
|
|
286
298
|
pending: (sessionId: string) => Readable<readonly ChatInteraction[]>;
|
|
287
299
|
/** Every session's pending requests, in arrival order (badges per session, the palette). Absent: only per session. */
|
|
288
300
|
all?: () => Readable<readonly ChatInteraction[]>;
|
|
289
|
-
|
|
301
|
+
/** Answers a request. Resolves with {@link InteractionAnsweredFirst} when someone else answered it first: their answer stands. */
|
|
302
|
+
answer: (requestId: string, response: InteractionResponse) => Promise<void | {
|
|
303
|
+
answeredFirst: InteractionAnsweredFirst;
|
|
304
|
+
}>;
|
|
290
305
|
/** Withdraw a request unanswered: the agent moves on without it. Absent: no Dismiss control. */
|
|
291
306
|
cancel?: (requestId: string, reason?: string) => Promise<void>;
|
|
292
307
|
};
|
|
@@ -26,6 +26,10 @@ export interface HostView {
|
|
|
26
26
|
error?: string;
|
|
27
27
|
/** The host's home folder, shown as `~` in its paths (`useDisplayPath`). Absent: its paths show in full. */
|
|
28
28
|
home?: string;
|
|
29
|
+
/** The server signs its users in (organization mode, its handshake has an identity). */
|
|
30
|
+
signsIn?: true;
|
|
31
|
+
/** It shares sessions between its people (organization mode with multiplayer on): Share… and Open sessions show. */
|
|
32
|
+
shares?: true;
|
|
29
33
|
}
|
|
30
34
|
/**
|
|
31
35
|
* Whether sessions on a host can be driven: This computer always, a server
|