zidane-ui 9.2.3 → 9.4.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/live.d.ts +8 -0
- package/dist/adapters/live.js +19 -8
- package/dist/adapters/server-composer-host.js +22 -9
- package/dist/adapters/server-git-host.js +5 -2
- package/dist/adapters/server-host.js +158 -27
- package/dist/adapters/server-machines-host.js +7 -0
- package/dist/adapters/server-media.d.ts +9 -1
- package/dist/adapters/server-media.js +14 -1
- package/dist/adapters/server-session-host.js +49 -0
- 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/appearance/ZoomIndicator.js +5 -8
- package/dist/chat/HostTranscript.d.ts +0 -12
- package/dist/chat/HostTranscript.js +20 -1
- package/dist/chat/SessionStreamsProvider.d.ts +9 -1
- package/dist/chat/SessionStreamsProvider.js +11 -2
- package/dist/chat/Transcript.d.ts +21 -11
- package/dist/chat/Transcript.js +346 -161
- 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/use-draft-target.js +15 -3
- package/dist/chat/headless/block-runs.js +26 -1
- package/dist/chat/headless/chip-views.js +1 -1
- package/dist/chat/headless/draft-target.d.ts +28 -1
- package/dist/chat/headless/draft-target.js +22 -1
- package/dist/chat/headless/host.d.ts +43 -7
- package/dist/chat/headless/hosts.d.ts +4 -0
- package/dist/chat/headless/index.d.ts +27 -26
- package/dist/chat/headless/index.js +15 -14
- package/dist/chat/headless/labels.d.ts +17 -0
- package/dist/chat/headless/labels.js +17 -0
- package/dist/chat/headless/markdown-chunks.d.ts +2 -1
- package/dist/chat/headless/markdown-chunks.js +12 -20
- package/dist/chat/headless/markdown-scan.d.ts +64 -0
- package/dist/chat/headless/markdown-scan.js +119 -0
- package/dist/chat/headless/markdown-stream.d.ts +64 -0
- package/dist/chat/headless/markdown-stream.js +143 -0
- package/dist/chat/headless/output-pager.d.ts +68 -0
- package/dist/chat/headless/output-pager.js +113 -0
- package/dist/chat/headless/prompt-origin.d.ts +2 -0
- package/dist/chat/headless/prompt-origin.js +6 -2
- package/dist/chat/headless/session-list.d.ts +10 -0
- package/dist/chat/headless/sidebar/activity.d.ts +14 -0
- package/dist/chat/headless/sidebar/activity.js +32 -0
- package/dist/chat/headless/sidebar/directory.d.ts +19 -2
- package/dist/chat/headless/sidebar/directory.js +19 -51
- package/dist/chat/headless/sidebar/environment.d.ts +15 -4
- package/dist/chat/headless/sidebar/environment.js +27 -9
- package/dist/chat/headless/sidebar/index.d.ts +2 -2
- package/dist/chat/headless/sidebar/index.js +2 -2
- package/dist/chat/headless/sidebar/labels.d.ts +19 -2
- package/dist/chat/headless/sidebar/labels.js +8 -1
- package/dist/chat/headless/sidebar/prewarm.d.ts +68 -0
- package/dist/chat/headless/sidebar/prewarm.js +114 -0
- package/dist/chat/headless/streams/actions.d.ts +4 -2
- package/dist/chat/headless/streams/actions.js +2 -1
- package/dist/chat/headless/streams/event-bytes.d.ts +17 -0
- package/dist/chat/headless/streams/event-bytes.js +46 -0
- package/dist/chat/headless/streams/live-events.d.ts +25 -1
- package/dist/chat/headless/streams/live-events.js +53 -2
- package/dist/chat/headless/streams/selectors.d.ts +3 -0
- package/dist/chat/headless/streams/selectors.js +8 -1
- package/dist/chat/headless/streams/session-streams.d.ts +15 -3
- package/dist/chat/headless/streams/session-streams.js +31 -3
- package/dist/chat/headless/streams/store.d.ts +45 -6
- package/dist/chat/headless/streams/store.js +85 -31
- package/dist/chat/headless/streams/transcript-map.d.ts +57 -0
- package/dist/chat/headless/streams/transcript-map.js +85 -0
- package/dist/chat/headless/streams/transcript.d.ts +4 -2
- package/dist/chat/headless/streams/transcript.js +19 -7
- package/dist/chat/headless/streams/types.d.ts +2 -1
- package/dist/chat/headless/transcript/batch.js +5 -1
- package/dist/chat/headless/transcript/blob-media.d.ts +15 -0
- package/dist/chat/headless/transcript/blob-media.js +23 -0
- package/dist/chat/headless/transcript/collapse.d.ts +10 -0
- package/dist/chat/headless/transcript/collapse.js +35 -6
- package/dist/chat/headless/transcript/derive.d.ts +98 -0
- package/dist/chat/headless/transcript/derive.js +89 -0
- package/dist/chat/headless/transcript/exchange-media.d.ts +3 -1
- package/dist/chat/headless/transcript/exchange-media.js +8 -5
- package/dist/chat/headless/transcript/fold-attachments.d.ts +2 -0
- package/dist/chat/headless/transcript/fold-attachments.js +3 -2
- package/dist/chat/headless/transcript/fold.d.ts +2 -1
- package/dist/chat/headless/transcript/fold.js +16 -6
- package/dist/chat/headless/transcript/incremental.d.ts +53 -0
- package/dist/chat/headless/transcript/incremental.js +181 -0
- package/dist/chat/headless/transcript/index.d.ts +2 -2
- package/dist/chat/headless/transcript/index.js +2 -2
- package/dist/chat/headless/transcript/nesting.js +2 -1
- package/dist/chat/headless/transcript/rail.d.ts +50 -1
- package/dist/chat/headless/transcript/rail.js +165 -23
- package/dist/chat/headless/transcript/rows.d.ts +5 -1
- package/dist/chat/headless/transcript/run-failures.js +2 -1
- package/dist/chat/headless/transcript/seams.d.ts +78 -0
- package/dist/chat/headless/transcript/seams.js +116 -0
- package/dist/chat/headless/transcript/tool-media.d.ts +6 -7
- package/dist/chat/headless/transcript/tool-media.js +27 -9
- package/dist/chat/index.d.ts +9 -8
- package/dist/chat/index.js +18 -17
- package/dist/chat/sidebar/ProjectIcon.js +1 -1
- package/dist/chat/sidebar/RowChips.js +2 -2
- package/dist/chat/sidebar/SessionSidebar.d.ts +6 -0
- package/dist/chat/sidebar/SessionSidebar.js +23 -16
- package/dist/chat/sidebar/SidebarFilterMenu.js +0 -1
- package/dist/chat/sidebar/SidebarFold.js +17 -16
- package/dist/chat/sidebar/SidebarFooter.d.ts +8 -5
- package/dist/chat/sidebar/SidebarFooter.js +6 -6
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +7 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +11 -8
- 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.js +28 -4
- package/dist/chat/sidebar/useInboxRows.js +6 -6
- package/dist/chat/sidebar/useInboxTriage.js +50 -47
- package/dist/chat/sidebar/useSessionSearch.js +19 -18
- package/dist/chat/testing/contract.d.ts +5 -3
- package/dist/chat/testing/contract.js +66 -1
- package/dist/chat/transcript/DiffLines.d.ts +6 -1
- package/dist/chat/transcript/DiffLines.js +35 -20
- package/dist/chat/transcript/EditDiffBlock.d.ts +5 -1
- package/dist/chat/transcript/EditDiffBlock.js +89 -30
- package/dist/chat/transcript/FileChip.js +28 -0
- package/dist/chat/transcript/LazyRow.d.ts +40 -40
- package/dist/chat/transcript/LazyRow.js +100 -149
- package/dist/chat/transcript/MermaidDiagram.js +2 -1
- package/dist/chat/transcript/PromptEcho.js +3 -11
- package/dist/chat/transcript/SessionChip.d.ts +11 -0
- package/dist/chat/transcript/SessionChip.js +34 -0
- package/dist/chat/transcript/SubagentBlock.js +3 -2
- package/dist/chat/transcript/TranscriptRail.d.ts +25 -2
- package/dist/chat/transcript/TranscriptRail.js +175 -17
- package/dist/chat/transcript/TranscriptRow.d.ts +4 -7
- package/dist/chat/transcript/TranscriptRow.js +4 -3
- package/dist/chat/transcript/actions.d.ts +37 -1
- package/dist/chat/transcript/actions.js +27 -1
- package/dist/chat/transcript/chip-details.d.ts +11 -0
- package/dist/chat/transcript/chip-details.js +17 -1
- package/dist/chat/transcript/clipped-output.d.ts +58 -0
- package/dist/chat/transcript/clipped-output.js +131 -0
- package/dist/chat/transcript/fold-attachments.js +10 -5
- package/dist/chat/transcript/fold-worker.js +5 -3
- package/dist/chat/transcript/fold.js +13 -4
- package/dist/chat/transcript/index.d.ts +11 -10
- package/dist/chat/transcript/index.js +10 -9
- package/dist/chat/transcript/markdown-cache.d.ts +17 -2
- package/dist/chat/transcript/markdown-cache.js +48 -4
- package/dist/chat/transcript/markdown.js +110 -55
- package/dist/chat/transcript/media-gallery.d.ts +3 -2
- package/dist/chat/transcript/media-gallery.js +19 -19
- package/dist/chat/transcript/messages.js +5 -4
- package/dist/chat/transcript/notices.js +2 -1
- package/dist/chat/transcript/prompt.d.ts +1 -1
- package/dist/chat/transcript/prompt.js +6 -4
- package/dist/chat/transcript/prose.js +2 -1
- package/dist/chat/transcript/root-items.d.ts +96 -0
- package/dist/chat/transcript/root-items.js +180 -0
- package/dist/chat/transcript/row-mount.d.ts +184 -0
- package/dist/chat/transcript/row-mount.js +532 -0
- package/dist/chat/transcript/row-parking.d.ts +152 -0
- package/dist/chat/transcript/row-parking.js +171 -0
- package/dist/chat/transcript/row-ui-state.d.ts +37 -0
- package/dist/chat/transcript/row-ui-state.js +53 -0
- package/dist/chat/transcript/run-rows.js +3 -2
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/tasks.js +3 -2
- package/dist/chat/transcript/tool-media.d.ts +4 -2
- package/dist/chat/transcript/tool-media.js +15 -7
- package/dist/chat/transcript/tool-parts.d.ts +27 -4
- package/dist/chat/transcript/tool-parts.js +31 -6
- package/dist/chat/transcript/tool-payload.js +26 -11
- package/dist/chat/transcript/tool-row.d.ts +2 -1
- package/dist/chat/transcript/tool-row.js +38 -19
- package/dist/chat/transcript/use-transcript-rows.d.ts +25 -8
- package/dist/chat/transcript/use-transcript-rows.js +28 -46
- package/dist/chat/transcript/useHistoryBackfill.d.ts +42 -0
- package/dist/chat/transcript/useHistoryBackfill.js +170 -0
- package/dist/chat/transcript/useStickToBottom.js +2 -3
- 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 +35 -19
- package/dist/chat/transcript/useTranscriptSelectionCopy.d.ts +5 -5
- package/dist/chat/transcript/useTranscriptSelectionCopy.js +28 -7
- package/dist/chat/transcript/view-scope.d.ts +26 -6
- package/dist/chat/transcript/view-scope.js +106 -20
- package/dist/code/editor/FileTree.d.ts +2 -0
- package/dist/code/editor/FileTree.js +1 -1
- package/dist/code/editor/FileView.js +16 -25
- 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/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/RowActionsMenu.js +7 -14
- package/dist/components/Tooltip.d.ts +4 -1
- package/dist/components/Tooltip.js +8 -6
- package/dist/components/assign-ref.d.ts +8 -0
- package/dist/components/assign-ref.js +12 -0
- package/dist/components/floating/FloatingSurface.js +2 -2
- package/dist/components/floating/HoverCard.js +32 -14
- package/dist/components/floating/Popover.js +4 -7
- package/dist/components/floating/useAnchoredPosition.d.ts +5 -3
- package/dist/components/floating/useAnchoredPosition.js +7 -7
- package/dist/components/object-key.d.ts +7 -0
- package/dist/components/object-key.js +18 -0
- package/dist/components/palette/PaletteList.js +2 -7
- package/dist/components/tooltip-arming.d.ts +3 -0
- package/dist/components/tooltip-arming.js +8 -1
- package/dist/core.css +3 -3
- package/dist/dist/{index-E1Z0aPmi.d.ts → index-BheVJOLc.d.ts} +3 -1
- package/dist/dist/index.d.ts +2 -2
- 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 +3 -7
- 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/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 +5 -3
- package/dist/git/MoveSessionDialog.d.ts +18 -8
- package/dist/git/MoveSessionDialog.js +32 -53
- package/dist/git/MoveToDialog.d.ts +61 -0
- package/dist/git/MoveToDialog.js +240 -0
- package/dist/git/SandboxManager.js +9 -4
- package/dist/git/SyncChip.js +11 -4
- package/dist/git/TeleportSessionDialog.d.ts +69 -0
- package/dist/git/TeleportSessionDialog.js +440 -0
- 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 +44 -1
- package/dist/git/headless/labels.js +50 -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 +4 -2
- package/dist/git/index.js +4 -2
- package/dist/git/useEnvironmentChoices.d.ts +5 -2
- package/dist/git/useEnvironmentChoices.js +12 -4
- 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 +3 -2
- package/dist/index.js +2 -1
- 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/machines/AddServerForm.js +55 -3
- 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/HostsSection.js +5 -1
- package/dist/machines/OrganizationPanel.d.ts +25 -0
- package/dist/machines/OrganizationPanel.js +266 -0
- package/dist/machines/PersonalLayerPanel.d.ts +32 -0
- package/dist/machines/PersonalLayerPanel.js +360 -0
- package/dist/machines/headless/fixture-host.d.ts +10 -0
- package/dist/machines/headless/fixture-host.js +44 -0
- package/dist/machines/headless/host.d.ts +21 -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 +55 -0
- package/dist/machines/headless/labels.js +58 -1
- package/dist/machines/headless/layer.d.ts +64 -0
- package/dist/machines/headless/layer.js +56 -0
- package/dist/machines/headless/organization.d.ts +38 -0
- package/dist/machines/headless/organization.js +44 -0
- package/dist/machines/index.d.ts +3 -1
- package/dist/machines/index.js +3 -1
- package/dist/machines/testing/contract.d.ts +25 -1
- package/dist/machines/testing/contract.js +97 -1
- 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/palette/headless/app-sources.js +37 -0
- package/dist/palette/headless/labels.js +3 -0
- package/dist/server/sse-handler.js +25 -2
- package/dist/session/DiffFileTree.js +1 -4
- package/dist/session/OpenSessionsDialog.d.ts +46 -0
- package/dist/session/OpenSessionsDialog.js +170 -0
- package/dist/session/PlanTracker.js +1 -2
- package/dist/session/ProjectHome.js +10 -9
- package/dist/session/RemindersPanel.js +10 -12
- package/dist/session/SecretsPanel.js +2 -1
- package/dist/session/SessionHeader.js +1 -0
- package/dist/session/SessionPeopleStack.d.ts +23 -0
- package/dist/session/SessionPeopleStack.js +65 -0
- package/dist/session/SessionPlaceMenu.js +5 -4
- package/dist/session/ShareSessionDialog.d.ts +32 -0
- package/dist/session/ShareSessionDialog.js +342 -0
- package/dist/session/TypingLine.d.ts +22 -0
- package/dist/session/TypingLine.js +31 -0
- package/dist/session/headless/host.d.ts +40 -1
- package/dist/session/headless/index.d.ts +4 -2
- package/dist/session/headless/index.js +3 -1
- package/dist/session/headless/labels.d.ts +49 -0
- package/dist/session/headless/labels.js +56 -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/typing.d.ts +37 -0
- package/dist/session/headless/typing.js +60 -0
- package/dist/session/index.d.ts +5 -1
- package/dist/session/index.js +5 -1
- package/dist/settings/headless/fixture-performance.js +4 -2
- package/dist/settings/headless/performance.d.ts +4 -0
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/headless/sections-host.d.ts +7 -2
- package/dist/settings/section.d.ts +15 -3
- package/dist/settings/section.js +15 -3
- package/dist/settings/sections/environments/EnvironmentsSection.js +30 -6
- 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/performance/PerformanceSection.js +8 -1
- package/dist/settings/sections/performance/labels.d.ts +2 -0
- package/dist/settings/sections/performance/labels.js +2 -0
- package/dist/styles.css +65 -9
- 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/views/headless/answers.d.ts +8 -2
- package/dist/views/headless/answers.js +58 -1
- package/dist/views/headless/placement.d.ts +78 -0
- package/dist/views/headless/placement.js +154 -44
- package/dist/workspace/LayoutBudget.js +1 -7
- package/package.json +2 -2
- package/src/styles/chat.css +3 -1
- package/src/styles/palette.css +3 -3
- package/src/styles/transcript.css +50 -5
- /package/dist/dist/{index-De9AbmxS.d.ts → index-ttmMvjgM.d.ts} +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Move to…": one dialog for every way a session can move (docs/TELEPORT.md, docs/ENVIRONMENTS.md), opened with
|
|
3
|
+
* `useMoveSession()`. Its first step is the new-chat where menu (`WhereMenu`): the hosts, their machines, and the
|
|
4
|
+
* ways to run there (the folder, a worktree, a sandbox), with where the session runs now checked.
|
|
5
|
+
*
|
|
6
|
+
* - Another way on the same host: the move (`MoveSessionDialog`: folder, branch, confirmation).
|
|
7
|
+
* - Another host: the teleport (`TeleportSessionDialog`: what changes, the work to bring, the folder there).
|
|
8
|
+
* - Another host and another way there: the teleport, then the move on the new host. A move that fails then leaves
|
|
9
|
+
* the session on the new host in its folder, and says so; "Keep it in its folder" ends there.
|
|
10
|
+
*
|
|
11
|
+
* Teleport needs the hosts (`MoveSessionOptions.hosts`) and `GitHost.teleportSession`; without them, the menu lists
|
|
12
|
+
* this host alone.
|
|
13
|
+
*
|
|
14
|
+
* const moveSession = useMoveSession()
|
|
15
|
+
* moveSession?.(moveSubject(session), { hosts, onMoved: done => open(done.sessionId) })
|
|
16
|
+
*/
|
|
17
|
+
import { HostView } from "../chat/headless/hosts.js";
|
|
18
|
+
import { MoveSessionSubject } from "./headless/move.js";
|
|
19
|
+
import { TeleportDone } from "./TeleportSessionDialog.js";
|
|
20
|
+
import { CSSProperties } from "react";
|
|
21
|
+
/** What {@link useMoveSession}'s dialog needs beyond the session. */
|
|
22
|
+
export interface MoveSessionOptions {
|
|
23
|
+
/** The hosts it may go to: This computer first, then the servers. Absent: its own host alone (no teleport). */
|
|
24
|
+
hosts?: readonly HostView[];
|
|
25
|
+
/** The session is on another host now: its id there (open it). */
|
|
26
|
+
onMoved?: (done: TeleportDone) => void;
|
|
27
|
+
}
|
|
28
|
+
/** Props for {@link MoveToDialog}. */
|
|
29
|
+
export interface MoveToDialogProps {
|
|
30
|
+
/** The session to move. */
|
|
31
|
+
subject: MoveSessionSubject;
|
|
32
|
+
/** The hosts it can go to, and what happens once it moved there. */
|
|
33
|
+
options?: MoveSessionOptions;
|
|
34
|
+
/** It moved: on its own host (`undefined`), or to another (where it is now). */
|
|
35
|
+
onDone: (done?: TeleportDone) => void;
|
|
36
|
+
/** Closed without a move. */
|
|
37
|
+
onCancel: () => void;
|
|
38
|
+
/** Whether a teleport is running (a dismiss then waits for its outcome). */
|
|
39
|
+
onBusy?: (busy: boolean) => void;
|
|
40
|
+
/** A teleport failed: its words, and the host's. */
|
|
41
|
+
onFailed?: (message: string, detail?: string) => void;
|
|
42
|
+
/** Whether the dialog was dismissed while a teleport ran: the teleport's outcome then ends it, with no step after. */
|
|
43
|
+
dismissed?: () => boolean;
|
|
44
|
+
/** Extra classes on the root. */
|
|
45
|
+
className?: string;
|
|
46
|
+
/** Inline styles on the root. */
|
|
47
|
+
style?: CSSProperties;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The Move to… dialog: where, then the move, the teleport, or both.
|
|
51
|
+
*
|
|
52
|
+
* @param props - The {@link MoveToDialogProps}.
|
|
53
|
+
*/
|
|
54
|
+
export declare function MoveToDialog({ subject, options, onDone, onCancel, onBusy, onFailed, dismissed, className, style }: MoveToDialogProps): import("react").JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* Opens Move to… above whatever is open, over the `GitHost` in context. `undefined` without what it needs
|
|
57
|
+
* (`GitHost.moveSession` and `environments`, a modal layer): hide the control that calls it. The returned function
|
|
58
|
+
* resolves `true` once the session moved (here or to another host, then `options.onMoved` says where), `false` when
|
|
59
|
+
* closed.
|
|
60
|
+
*/
|
|
61
|
+
export declare function useMoveSession(): ((subject: MoveSessionSubject, options?: MoveSessionOptions) => Promise<boolean>) | undefined;
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { useOptionalModal } from "../app/ModalProvider.js";
|
|
2
|
+
import { toast } from "../app/toast.js";
|
|
3
|
+
import { buttonClass } from "../components/button.js";
|
|
4
|
+
import { useGitHost, useGitLabels } from "./GitProvider.js";
|
|
5
|
+
import { resolveDraftDescriptor } from "./headless/environment.js";
|
|
6
|
+
import { moveListingCwd } from "./headless/move.js";
|
|
7
|
+
import { MOVE_SESSION_TITLE_ID, MoveSessionDialog } from "./MoveSessionDialog.js";
|
|
8
|
+
import { TeleportSessionDialog } from "./TeleportSessionDialog.js";
|
|
9
|
+
import { useEnvironmentChoices } from "./useEnvironmentChoices.js";
|
|
10
|
+
import { WhereMenu } from "./WherePicker.js";
|
|
11
|
+
import { useCallback, useState } from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { isolationLabel } from "zidane/chat/pure";
|
|
14
|
+
// src/git/MoveToDialog.tsx
|
|
15
|
+
/** The id of This computer among the hosts (`HostView.id`). */
|
|
16
|
+
const LOCAL_ID = "local";
|
|
17
|
+
/** The session's own host, when the menu lists no other: from the hosts given (a web app's one server), else This computer. */
|
|
18
|
+
function ownHost(subject, hosts, localName) {
|
|
19
|
+
const id = subject.hostId ?? LOCAL_ID;
|
|
20
|
+
return hosts?.find((h) => h.id === id) ?? (hosts?.length === 1 ? {
|
|
21
|
+
...hosts[0],
|
|
22
|
+
id
|
|
23
|
+
} : void 0) ?? (subject.hostId ? {
|
|
24
|
+
id,
|
|
25
|
+
kind: "server",
|
|
26
|
+
name: subject.hostId,
|
|
27
|
+
status: "connected"
|
|
28
|
+
} : {
|
|
29
|
+
id,
|
|
30
|
+
kind: "local",
|
|
31
|
+
name: localName,
|
|
32
|
+
status: "local"
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The Move to… dialog: where, then the move, the teleport, or both.
|
|
37
|
+
*
|
|
38
|
+
* @param props - The {@link MoveToDialogProps}.
|
|
39
|
+
*/
|
|
40
|
+
function MoveToDialog({ subject, options, onDone, onCancel, onBusy, onFailed, dismissed, className, style }) {
|
|
41
|
+
const host = useGitHost();
|
|
42
|
+
const labels = useGitLabels();
|
|
43
|
+
const hereId = subject.hostId ?? LOCAL_ID;
|
|
44
|
+
const nowKind = subject.kind ?? "local";
|
|
45
|
+
const hosts = Boolean(host?.teleportSession && host.teleportTargets) && options?.hosts?.some((h) => h.id === hereId) ? options.hosts : [ownHost(subject, options?.hosts, labels.gitRunsOnLocal)];
|
|
46
|
+
const [step, setStep] = useState({ kind: "where" });
|
|
47
|
+
const [hostId, setHostId] = useState(hereId);
|
|
48
|
+
const [draft, setDraft] = useState({
|
|
49
|
+
kind: nowKind,
|
|
50
|
+
branch: ""
|
|
51
|
+
});
|
|
52
|
+
const here = hostId === hereId;
|
|
53
|
+
const descriptors = useEnvironmentChoices(here ? moveListingCwd(subject) ?? "" : "", hostId === LOCAL_ID ? void 0 : hostId, here ? {} : { machineOnly: true });
|
|
54
|
+
const selected = resolveDraftDescriptor(descriptors, draft);
|
|
55
|
+
const same = here && (selected?.kind ?? "local") === nowKind;
|
|
56
|
+
const ready = !same && (!here || selected !== void 0);
|
|
57
|
+
const proceed = () => {
|
|
58
|
+
if (here && selected) return setStep({
|
|
59
|
+
kind: "move",
|
|
60
|
+
draft: {
|
|
61
|
+
kind: selected.kind,
|
|
62
|
+
branch: draft?.kind === selected.kind ? draft.branch : ""
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const extra = selected && !selected.isDefault && selected.kind !== "local" ? {
|
|
66
|
+
kind: selected.kind,
|
|
67
|
+
branch: draft?.kind === selected.kind ? draft.branch : ""
|
|
68
|
+
} : null;
|
|
69
|
+
setStep({
|
|
70
|
+
kind: "teleport",
|
|
71
|
+
hostId,
|
|
72
|
+
draft: extra,
|
|
73
|
+
label: extra && selected ? isolationLabel(selected) : void 0
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
if (step.kind === "move") return /* @__PURE__ */ jsx(MoveSessionDialog, {
|
|
77
|
+
subject,
|
|
78
|
+
initial: step.draft,
|
|
79
|
+
onBack: () => setStep({ kind: "where" }),
|
|
80
|
+
onDone: () => onDone(),
|
|
81
|
+
onCancel,
|
|
82
|
+
...className ? { className } : {},
|
|
83
|
+
...style ? { style } : {}
|
|
84
|
+
});
|
|
85
|
+
if (step.kind === "teleport") return /* @__PURE__ */ jsx(TeleportSessionDialog, {
|
|
86
|
+
subject: { sessionId: subject.sessionId },
|
|
87
|
+
target: step.hostId,
|
|
88
|
+
titleId: MOVE_SESSION_TITLE_ID,
|
|
89
|
+
...step.label ? { then: step.label } : {},
|
|
90
|
+
onBack: () => setStep({ kind: "where" }),
|
|
91
|
+
...onBusy ? { onBusy } : {},
|
|
92
|
+
...onFailed ? { onFailed } : {},
|
|
93
|
+
onDone: (done) => {
|
|
94
|
+
if (step.draft && step.label && !dismissed?.()) setStep({
|
|
95
|
+
kind: "then",
|
|
96
|
+
done,
|
|
97
|
+
draft: step.draft,
|
|
98
|
+
label: step.label
|
|
99
|
+
});
|
|
100
|
+
else onDone(done);
|
|
101
|
+
},
|
|
102
|
+
onCancel,
|
|
103
|
+
...className ? { className } : {},
|
|
104
|
+
...style ? { style } : {}
|
|
105
|
+
});
|
|
106
|
+
if (step.kind === "then") {
|
|
107
|
+
const { done } = step;
|
|
108
|
+
const there = hosts.find((h) => h.id === done.hostId)?.name ?? done.hostId;
|
|
109
|
+
return /* @__PURE__ */ jsx(MoveSessionDialog, {
|
|
110
|
+
subject: {
|
|
111
|
+
sessionId: done.sessionId,
|
|
112
|
+
cwd: done.cwd ?? "",
|
|
113
|
+
...done.hostId === LOCAL_ID ? {} : { hostId: done.hostId },
|
|
114
|
+
kind: "local",
|
|
115
|
+
hasTurns: true
|
|
116
|
+
},
|
|
117
|
+
initial: step.draft,
|
|
118
|
+
lead: /* @__PURE__ */ jsx("p", {
|
|
119
|
+
className: "m-0 text-zg-label text-[var(--zg-text-muted)]",
|
|
120
|
+
"data-testid": "move-then",
|
|
121
|
+
children: labels.gitMoveThen(there, step.label)
|
|
122
|
+
}),
|
|
123
|
+
cancelLabel: labels.gitMoveKeepThere,
|
|
124
|
+
onDone: () => onDone(done),
|
|
125
|
+
onCancel: () => onDone(done),
|
|
126
|
+
...className ? { className } : {},
|
|
127
|
+
...style ? { style } : {}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
131
|
+
className: `zg-modal-panel zg-float w-[400px] max-w-[92vw] flex flex-col overflow-hidden${className ? ` ${className}` : ""}`,
|
|
132
|
+
style,
|
|
133
|
+
"data-testid": "move-to-dialog",
|
|
134
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ jsxs("div", {
|
|
137
|
+
className: "px-5 pt-4 pb-2",
|
|
138
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
139
|
+
id: MOVE_SESSION_TITLE_ID,
|
|
140
|
+
className: "m-0 text-sm font-semibold text-[var(--zg-text)] zg-balance",
|
|
141
|
+
children: labels.gitMoveTitle
|
|
142
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
143
|
+
className: "m-0 mt-1 text-zg-ui text-[var(--zg-text-muted)]",
|
|
144
|
+
children: same ? labels.gitMoveHere : labels.gitMoveWhere
|
|
145
|
+
})]
|
|
146
|
+
}),
|
|
147
|
+
/* @__PURE__ */ jsx("div", {
|
|
148
|
+
className: "px-3 pb-2 max-h-[min(440px,60vh)] overflow-y-auto",
|
|
149
|
+
children: /* @__PURE__ */ jsx(WhereMenu, {
|
|
150
|
+
hosts,
|
|
151
|
+
hostId,
|
|
152
|
+
onHostChange: (next) => {
|
|
153
|
+
setHostId(next);
|
|
154
|
+
setDraft(next === hereId ? {
|
|
155
|
+
kind: nowKind,
|
|
156
|
+
branch: ""
|
|
157
|
+
} : null);
|
|
158
|
+
},
|
|
159
|
+
descriptors,
|
|
160
|
+
draft,
|
|
161
|
+
onChange: setDraft,
|
|
162
|
+
...hosts.some((h) => h.kind === "local") ? {} : { local: false }
|
|
163
|
+
})
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ jsxs("footer", {
|
|
166
|
+
className: "flex items-center justify-end gap-2 px-5 py-3 bg-[var(--zg-tray)]",
|
|
167
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
168
|
+
type: "button",
|
|
169
|
+
onClick: onCancel,
|
|
170
|
+
className: buttonClass({ variant: "secondary" }),
|
|
171
|
+
children: labels.gitMoveCancel
|
|
172
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
173
|
+
type: "button",
|
|
174
|
+
"data-testid": "move-continue",
|
|
175
|
+
disabled: !ready,
|
|
176
|
+
onClick: proceed,
|
|
177
|
+
className: buttonClass({ variant: "solid" }),
|
|
178
|
+
children: labels.gitMoveContinue
|
|
179
|
+
})]
|
|
180
|
+
})
|
|
181
|
+
]
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Opens Move to… above whatever is open, over the `GitHost` in context. `undefined` without what it needs
|
|
186
|
+
* (`GitHost.moveSession` and `environments`, a modal layer): hide the control that calls it. The returned function
|
|
187
|
+
* resolves `true` once the session moved (here or to another host, then `options.onMoved` says where), `false` when
|
|
188
|
+
* closed.
|
|
189
|
+
*/
|
|
190
|
+
function useMoveSession() {
|
|
191
|
+
const host = useGitHost();
|
|
192
|
+
const modal = useOptionalModal();
|
|
193
|
+
const openLayer = modal?.openLayer;
|
|
194
|
+
const closeLayer = modal?.closeLayer;
|
|
195
|
+
const offered = Boolean(host?.moveSession && host.environments && openLayer && closeLayer);
|
|
196
|
+
const open = useCallback((subject, options) => new Promise((resolve) => {
|
|
197
|
+
if (!openLayer || !closeLayer) return resolve(false);
|
|
198
|
+
const previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
199
|
+
let running = false;
|
|
200
|
+
let dismissed = false;
|
|
201
|
+
let settled = false;
|
|
202
|
+
const settle = (moved, done) => {
|
|
203
|
+
if (settled) return;
|
|
204
|
+
settled = true;
|
|
205
|
+
if (done) options?.onMoved?.(done);
|
|
206
|
+
resolve(moved);
|
|
207
|
+
requestAnimationFrame(() => previousFocus?.focus());
|
|
208
|
+
};
|
|
209
|
+
openLayer(/* @__PURE__ */ jsx(MoveToDialog, {
|
|
210
|
+
subject,
|
|
211
|
+
...options ? { options } : {},
|
|
212
|
+
dismissed: () => dismissed,
|
|
213
|
+
onBusy: (busy) => {
|
|
214
|
+
running = busy;
|
|
215
|
+
},
|
|
216
|
+
onFailed: (message, detail) => {
|
|
217
|
+
if (dismissed) {
|
|
218
|
+
toast.error(message, detail ? { description: detail } : void 0);
|
|
219
|
+
settle(false);
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
onDone: (done) => {
|
|
223
|
+
if (!dismissed) closeLayer();
|
|
224
|
+
settle(true, done);
|
|
225
|
+
},
|
|
226
|
+
onCancel: () => {
|
|
227
|
+
closeLayer();
|
|
228
|
+
settle(false);
|
|
229
|
+
}
|
|
230
|
+
}), {
|
|
231
|
+
onDismiss: () => {
|
|
232
|
+
if (running) dismissed = true;
|
|
233
|
+
else settle(false);
|
|
234
|
+
},
|
|
235
|
+
labelledBy: MOVE_SESSION_TITLE_ID
|
|
236
|
+
});
|
|
237
|
+
}), [openLayer, closeLayer]);
|
|
238
|
+
return offered ? open : void 0;
|
|
239
|
+
}
|
|
240
|
+
export { MoveToDialog, useMoveSession };
|
|
@@ -30,6 +30,7 @@ const SandboxRow = memo(({ entry, source, onChanged, onOpenSession }) => {
|
|
|
30
30
|
const replacedTip = useTooltip(session && !session.current ? labels.sandboxReplacedHint(session.title) : null);
|
|
31
31
|
const linked = session?.current === true;
|
|
32
32
|
const stateWord = entry.state === "other" && entry.providerState ? entry.providerState : labels.sandboxStates[entry.state];
|
|
33
|
+
const stateTip = useTooltip(entry.state === "failed" && entry.reason ? entry.reason : null);
|
|
33
34
|
const age = entry.createdAt !== void 0 && readAt ? relativeTime(entry.createdAt, readAt, chatLabels) : void 0;
|
|
34
35
|
const act = (run, failed) => {
|
|
35
36
|
setBusy(true);
|
|
@@ -77,10 +78,14 @@ const SandboxRow = memo(({ entry, source, onChanged, onOpenSession }) => {
|
|
|
77
78
|
className: "text-zg-ui text-[var(--zg-text-muted)] truncate",
|
|
78
79
|
children: labels.sandboxUnlinked
|
|
79
80
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
|
|
82
|
-
className: "
|
|
83
|
-
children:
|
|
81
|
+
/* @__PURE__ */ jsxs("span", {
|
|
82
|
+
...stateTip.anchorProps,
|
|
83
|
+
className: "inline-flex",
|
|
84
|
+
children: [/* @__PURE__ */ jsx(MetaChip, {
|
|
85
|
+
tone: entry.state === "running" ? "success" : entry.state === "failed" ? "danger" : entry.state === "other" ? "warn" : "muted",
|
|
86
|
+
className: "ml-0.5",
|
|
87
|
+
children: stateWord
|
|
88
|
+
}), stateTip.tip]
|
|
84
89
|
}),
|
|
85
90
|
session && !session.current && /* @__PURE__ */ jsxs("span", {
|
|
86
91
|
...replacedTip.anchorProps,
|
package/dist/git/SyncChip.js
CHANGED
|
@@ -31,10 +31,17 @@ function SyncChip({ status, cwd, sessionId, running, onSynced, confirm = true, o
|
|
|
31
31
|
const confirmRef = useRef(null);
|
|
32
32
|
const counts = status.ahead > 0 || status.behind > 0;
|
|
33
33
|
const level = status.upstream !== null && !counts;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const [seen, setSeen] = useState({
|
|
35
|
+
running,
|
|
36
|
+
cwd
|
|
37
|
+
});
|
|
38
|
+
if (seen.running !== running || seen.cwd !== cwd) {
|
|
39
|
+
setSeen({
|
|
40
|
+
running,
|
|
41
|
+
cwd
|
|
42
|
+
});
|
|
43
|
+
if (running || seen.cwd !== cwd) setPopover(null);
|
|
44
|
+
}
|
|
38
45
|
useEffect(() => {
|
|
39
46
|
if (!popover) return void 0;
|
|
40
47
|
if (popover.kind === "confirm") requestAnimationFrame(() => confirmRef.current?.focus());
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Teleport to…": moves a session to another host (docs/TELEPORT.md). A
|
|
3
|
+
* short dialog on the modal layer, opened with `useTeleportSession()`.
|
|
4
|
+
*
|
|
5
|
+
* 1. Which host: every other connected host, compared with the session
|
|
6
|
+
* (`GitHost.teleportTargets`). A ready host shows nothing; one that needs
|
|
7
|
+
* setting up, runs it differently, or can't run it shows one quiet mark.
|
|
8
|
+
* 2. What changes there (the comparison's rows), the work in progress that
|
|
9
|
+
* would come along through git (`GitHost.teleportPreview`), and the
|
|
10
|
+
* ignored files, left behind unless ticked (likely secrets marked).
|
|
11
|
+
* 3. Teleport (`GitHost.teleportSession`). A failure changes nothing and
|
|
12
|
+
* shows in the dialog.
|
|
13
|
+
*
|
|
14
|
+
* const teleport = useTeleportSession();
|
|
15
|
+
* const moved = await teleport?.({ sessionId });
|
|
16
|
+
*/
|
|
17
|
+
import { CSSProperties } from "react";
|
|
18
|
+
/** The session a teleport moves. */
|
|
19
|
+
export interface TeleportSubject {
|
|
20
|
+
/** The session's id on its host. */
|
|
21
|
+
sessionId: string;
|
|
22
|
+
}
|
|
23
|
+
/** Where the session went: its id there, the host's id, and its folder there when one was picked. */
|
|
24
|
+
export interface TeleportDone {
|
|
25
|
+
/** The session's id on the target. */
|
|
26
|
+
sessionId: string;
|
|
27
|
+
/** The target's id. */
|
|
28
|
+
hostId: string;
|
|
29
|
+
/** Its folder on the target, when one was picked. */
|
|
30
|
+
cwd?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Props for {@link TeleportSessionDialog}. */
|
|
33
|
+
export interface TeleportSessionDialogProps {
|
|
34
|
+
/** The session to teleport. */
|
|
35
|
+
subject: TeleportSubject;
|
|
36
|
+
/** The session is on the target now. */
|
|
37
|
+
onDone: (done: TeleportDone) => void;
|
|
38
|
+
/** Closed without teleporting. */
|
|
39
|
+
onCancel: () => void;
|
|
40
|
+
/** Whether a teleport is running (a dismiss then waits for its outcome). */
|
|
41
|
+
onBusy?: (busy: boolean) => void;
|
|
42
|
+
/** A teleport failed: its words, and the host's. */
|
|
43
|
+
onFailed?: (message: string, detail?: string) => void;
|
|
44
|
+
/** The host already picked (Move to…'s where menu): the dialog opens on it, and Back goes to {@link TeleportSessionDialogProps.onBack}. */
|
|
45
|
+
target?: string;
|
|
46
|
+
/** Back from the first step shown (with {@link TeleportSessionDialogProps.target}). */
|
|
47
|
+
onBack?: () => void;
|
|
48
|
+
/** The isolation set up on the target after the teleport (Move to…): named in the confirmation. */
|
|
49
|
+
then?: string;
|
|
50
|
+
/** The heading's id, for the layer that labels itself with it. Default: `teleport-session-title`. */
|
|
51
|
+
titleId?: string;
|
|
52
|
+
/** Extra classes on the root. */
|
|
53
|
+
className?: string;
|
|
54
|
+
/** Inline styles on the root. */
|
|
55
|
+
style?: CSSProperties;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The teleport dialog: which host, what changes and what comes along, then teleport.
|
|
59
|
+
*
|
|
60
|
+
* @param props - The {@link TeleportSessionDialogProps}.
|
|
61
|
+
*/
|
|
62
|
+
export declare function TeleportSessionDialog({ subject, onDone, onCancel, onBusy, onFailed, target, onBack, then, titleId, className, style }: TeleportSessionDialogProps): import("react").JSX.Element;
|
|
63
|
+
/**
|
|
64
|
+
* Opens the teleport dialog over the `GitHost` in context. `undefined` without
|
|
65
|
+
* what it needs (`GitHost.teleportTargets` and `teleportSession`, a modal
|
|
66
|
+
* layer): hide the control that calls it. Resolves where the session went, or
|
|
67
|
+
* `null` when closed.
|
|
68
|
+
*/
|
|
69
|
+
export declare function useTeleportSession(): ((subject: TeleportSubject) => Promise<TeleportDone | null>) | undefined;
|