zidane-ui 9.3.1 → 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 +2 -0
- package/dist/adapters/live.js +3 -0
- package/dist/adapters/server-git-host.js +5 -2
- package/dist/adapters/server-host.js +17 -11
- package/dist/adapters/server-machines-host.js +7 -0
- 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.js +15 -1
- package/dist/chat/SessionStreamsProvider.d.ts +1 -1
- 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/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/hosts.d.ts +4 -0
- package/dist/chat/headless/index.d.ts +25 -25
- package/dist/chat/headless/index.js +6 -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 +2 -0
- package/dist/chat/headless/prompt-origin.js +6 -2
- package/dist/chat/headless/sidebar/directory.d.ts +10 -1
- package/dist/chat/headless/sidebar/directory.js +9 -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/index.d.ts +2 -2
- package/dist/chat/headless/sidebar/index.js +2 -2
- package/dist/chat/headless/sidebar/labels.d.ts +9 -2
- package/dist/chat/headless/sidebar/labels.js +8 -1
- 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/store.d.ts +21 -5
- package/dist/chat/headless/streams/store.js +36 -7
- package/dist/chat/headless/streams/transcript-map.js +2 -5
- package/dist/chat/headless/streams/types.d.ts +2 -1
- package/dist/chat/headless/transcript/collapse.js +3 -0
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/index.js +2 -2
- 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/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/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 +3 -11
- package/dist/chat/transcript/SessionChip.d.ts +11 -0
- package/dist/chat/transcript/SessionChip.js +34 -0
- package/dist/chat/transcript/TranscriptRail.d.ts +1 -1
- 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 +11 -3
- package/dist/chat/transcript/index.d.ts +2 -2
- package/dist/chat/transcript/index.js +2 -2
- 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/prompt.d.ts +1 -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/tool-parts.js +0 -1
- 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 -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-C6-t1SS9.d.ts → index-BheVJOLc.d.ts} +1 -0
- 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/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/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/styles.css +32 -7
- 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/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 +17 -3
- /package/dist/dist/{index-De9AbmxS.d.ts → index-ttmMvjgM.d.ts} +0 -0
|
@@ -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;
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import { useOptionalModal } from "../app/ModalProvider.js";
|
|
2
|
+
import { toast } from "../app/toast.js";
|
|
3
|
+
import { buttonClass } from "../components/button.js";
|
|
4
|
+
import { Checkbox, MetaChip } from "../components/Form.js";
|
|
5
|
+
import { MenuNote, MenuRow } from "../components/Menu.js";
|
|
6
|
+
import { Notice } from "../components/Notice.js";
|
|
7
|
+
import { errorMessage } from "../components/report-error.js";
|
|
8
|
+
import { useGitHost, useGitLabels } from "./GitProvider.js";
|
|
9
|
+
import { canTeleportTo, movingCount, shownRows, teleportStoppable, workTarget } from "./headless/teleport.js";
|
|
10
|
+
import { RemoteFolderBrowser } from "./RemoteFolderPicker.js";
|
|
11
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
12
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
// src/git/TeleportSessionDialog.tsx
|
|
14
|
+
const TITLE_ID = "teleport-session-title";
|
|
15
|
+
/** Why a target can't take the session, for a notice's details: its error, else its first blocking row. */
|
|
16
|
+
function whyNot(target) {
|
|
17
|
+
const detail = target?.error ?? shownRows(target?.rows ?? [])[0]?.message;
|
|
18
|
+
return detail ? { detail } : {};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The teleport dialog: which host, what changes and what comes along, then teleport.
|
|
22
|
+
*
|
|
23
|
+
* @param props - The {@link TeleportSessionDialogProps}.
|
|
24
|
+
*/
|
|
25
|
+
function TeleportSessionDialog({ subject, onDone, onCancel, onBusy, onFailed, target, onBack, then, titleId = TITLE_ID, className, style }) {
|
|
26
|
+
const host = useGitHost();
|
|
27
|
+
const labels = useGitLabels();
|
|
28
|
+
const [targets, setTargets] = useState(null);
|
|
29
|
+
const [picked, setPicked] = useState(null);
|
|
30
|
+
const [preview, setPreview] = useState(null);
|
|
31
|
+
const [carry, setCarry] = useState(true);
|
|
32
|
+
const [checkout, setCheckout] = useState("");
|
|
33
|
+
const [folder, setFolder] = useState("");
|
|
34
|
+
const [ticked, setTicked] = useState(/* @__PURE__ */ new Set());
|
|
35
|
+
const [busy, setBusy] = useState(false);
|
|
36
|
+
const [error, setError] = useState(null);
|
|
37
|
+
const [notice, setNotice] = useState(null);
|
|
38
|
+
/** Browsing the target's folders (`GitHost.listFolders`) for the session's folder there. */
|
|
39
|
+
const [browsing, setBrowsing] = useState(false);
|
|
40
|
+
/** Where the teleport in flight is (`null`: not started yet), and its stop. */
|
|
41
|
+
const [progress, setProgress] = useState(null);
|
|
42
|
+
const stopRef = useRef(null);
|
|
43
|
+
const [stopped, setStopped] = useState(false);
|
|
44
|
+
const { sessionId } = subject;
|
|
45
|
+
const listTargets = host?.teleportTargets;
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!listTargets) return void 0;
|
|
48
|
+
let live = true;
|
|
49
|
+
listTargets(sessionId).then((found) => {
|
|
50
|
+
if (!live) return;
|
|
51
|
+
setTargets(found);
|
|
52
|
+
const chosen = target ? found.find((t) => t.hostId === target) : void 0;
|
|
53
|
+
if (chosen && canTeleportTo(chosen)) setPicked(chosen);
|
|
54
|
+
else if (target) setError({
|
|
55
|
+
message: labels.gitTeleportCannot(chosen?.name ?? target),
|
|
56
|
+
...whyNot(chosen)
|
|
57
|
+
});
|
|
58
|
+
}).catch((err) => {
|
|
59
|
+
if (!live) return;
|
|
60
|
+
setTargets([]);
|
|
61
|
+
setError({
|
|
62
|
+
message: labels.gitTeleportListFailed,
|
|
63
|
+
detail: errorMessage(err)
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
return () => {
|
|
67
|
+
live = false;
|
|
68
|
+
};
|
|
69
|
+
}, [
|
|
70
|
+
listTargets,
|
|
71
|
+
sessionId,
|
|
72
|
+
labels
|
|
73
|
+
]);
|
|
74
|
+
const readPreview = host?.teleportPreview;
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (!picked || !readPreview) return void 0;
|
|
77
|
+
let live = true;
|
|
78
|
+
readPreview(sessionId).then((found) => live && setPreview(found)).catch(() => live && setPreview(null));
|
|
79
|
+
return () => {
|
|
80
|
+
live = false;
|
|
81
|
+
};
|
|
82
|
+
}, [
|
|
83
|
+
picked,
|
|
84
|
+
readPreview,
|
|
85
|
+
sessionId
|
|
86
|
+
]);
|
|
87
|
+
const work = preview?.repo && movingCount(preview) > 0 ? preview : null;
|
|
88
|
+
const carrying = Boolean(work && carry);
|
|
89
|
+
const ready = picked !== null && (carrying ? checkout.trim() !== "" : folder.trim() !== "");
|
|
90
|
+
const pick = (target) => {
|
|
91
|
+
setPicked(target);
|
|
92
|
+
setPreview(null);
|
|
93
|
+
setTicked(/* @__PURE__ */ new Set());
|
|
94
|
+
setError(null);
|
|
95
|
+
};
|
|
96
|
+
const browse = picked && !picked.remote && host?.pickFolder ? () => void host.pickFolder?.().then((chosen) => chosen && setFolder(chosen), () => void 0) : picked && host?.listFolders ? () => setBrowsing(true) : void 0;
|
|
97
|
+
const back = () => {
|
|
98
|
+
if (browsing) return setBrowsing(false);
|
|
99
|
+
if (onBack && (target || !picked)) return onBack();
|
|
100
|
+
setPicked(null);
|
|
101
|
+
};
|
|
102
|
+
const toggle = (path) => setTicked((current) => {
|
|
103
|
+
const next = new Set(current);
|
|
104
|
+
if (next.has(path)) next.delete(path);
|
|
105
|
+
else next.add(path);
|
|
106
|
+
return next;
|
|
107
|
+
});
|
|
108
|
+
async function submit() {
|
|
109
|
+
if (!picked || !host?.teleportSession) return;
|
|
110
|
+
setBusy(true);
|
|
111
|
+
onBusy?.(true);
|
|
112
|
+
setError(null);
|
|
113
|
+
setStopped(false);
|
|
114
|
+
setProgress(null);
|
|
115
|
+
const stop = new AbortController();
|
|
116
|
+
stopRef.current = stop;
|
|
117
|
+
const place = carrying && work ? workTarget(checkout.trim(), work, sessionId) : void 0;
|
|
118
|
+
const outcome = await host.teleportSession(sessionId, {
|
|
119
|
+
hostId: picked.hostId,
|
|
120
|
+
...place ? { work: place } : {},
|
|
121
|
+
...carrying && ticked.size > 0 ? { carryIgnored: [...ticked] } : {},
|
|
122
|
+
...!carrying && folder.trim() ? { cwd: folder.trim() } : {}
|
|
123
|
+
}, {
|
|
124
|
+
onProgress: setProgress,
|
|
125
|
+
signal: stop.signal
|
|
126
|
+
}).catch((err) => ({
|
|
127
|
+
ok: false,
|
|
128
|
+
message: errorMessage(err)
|
|
129
|
+
}));
|
|
130
|
+
stopRef.current = null;
|
|
131
|
+
setBusy(false);
|
|
132
|
+
setProgress(null);
|
|
133
|
+
onBusy?.(false);
|
|
134
|
+
if (!outcome.ok && stop.signal.aborted) {
|
|
135
|
+
setStopped(true);
|
|
136
|
+
onFailed?.(labels.gitTeleportStopped);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (!outcome.ok) {
|
|
140
|
+
const headline = "unknown" in outcome && outcome.unknown ? labels.gitTeleportUnknown : labels.gitTeleportFailed;
|
|
141
|
+
onFailed?.(headline, outcome.message);
|
|
142
|
+
return setError({
|
|
143
|
+
message: headline,
|
|
144
|
+
detail: outcome.message
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const there = place?.path ?? folder.trim();
|
|
148
|
+
const done = {
|
|
149
|
+
sessionId: outcome.sessionId,
|
|
150
|
+
hostId: picked.hostId,
|
|
151
|
+
...there ? { cwd: there } : {}
|
|
152
|
+
};
|
|
153
|
+
if (outcome.notice) return setNotice({
|
|
154
|
+
done,
|
|
155
|
+
text: outcome.notice
|
|
156
|
+
});
|
|
157
|
+
onDone(done);
|
|
158
|
+
}
|
|
159
|
+
const mark = (target) => target.error !== void 0 || target.readiness === "blocked" ? /* @__PURE__ */ jsx(MetaChip, {
|
|
160
|
+
tone: "warn",
|
|
161
|
+
children: labels.gitTeleportMarkBlocked
|
|
162
|
+
}) : target.readiness === "changes" ? /* @__PURE__ */ jsx(MetaChip, {
|
|
163
|
+
tone: "warn",
|
|
164
|
+
children: labels.gitTeleportMarkChanges
|
|
165
|
+
}) : target.readiness === "fixable" ? /* @__PURE__ */ jsx(MetaChip, { children: labels.gitTeleportMarkFixable }) : void 0;
|
|
166
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
167
|
+
className: `zg-modal-panel zg-float w-[480px] max-w-[92vw] flex flex-col overflow-hidden${className ? ` ${className}` : ""}`,
|
|
168
|
+
style,
|
|
169
|
+
"data-testid": "teleport-session-dialog",
|
|
170
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
171
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
172
|
+
className: "px-5 pt-4 pb-4 flex flex-col gap-3 min-h-0",
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
|
|
175
|
+
id: titleId,
|
|
176
|
+
className: "m-0 text-sm font-semibold text-[var(--zg-text)] zg-balance",
|
|
177
|
+
children: labels.gitTeleportTitle
|
|
178
|
+
}), /* @__PURE__ */ jsxs("p", {
|
|
179
|
+
className: "m-0 mt-1 text-zg-ui text-[var(--zg-text-muted)]",
|
|
180
|
+
children: [picked ? labels.gitTeleportConfirm(picked.name) : labels.gitTeleportWhere, picked && then ? ` ${labels.gitTeleportThen(then)}` : ""]
|
|
181
|
+
})] }),
|
|
182
|
+
!picked && target && targets === null && /* @__PURE__ */ jsx(MenuNote, { children: labels.gitTeleportLoading }),
|
|
183
|
+
!picked && !target && /* @__PURE__ */ jsx("div", {
|
|
184
|
+
role: "menu",
|
|
185
|
+
"aria-label": labels.gitTeleportWhere,
|
|
186
|
+
className: "flex flex-col max-h-[min(360px,50vh)] overflow-y-auto",
|
|
187
|
+
children: targets === null ? /* @__PURE__ */ jsx(MenuNote, { children: labels.gitTeleportLoading }) : targets.length === 0 ? /* @__PURE__ */ jsx(MenuNote, { children: labels.gitTeleportNone }) : targets.map((target) => /* @__PURE__ */ jsx(MenuRow, {
|
|
188
|
+
"data-testid": `teleport-target-${target.hostId}`,
|
|
189
|
+
icon: /* @__PURE__ */ jsx("span", {
|
|
190
|
+
"aria-hidden": true,
|
|
191
|
+
className: target.remote ? "i-ph-hard-drives" : "i-ph-laptop"
|
|
192
|
+
}),
|
|
193
|
+
title: target.name,
|
|
194
|
+
description: target.error ?? shownRows(target.rows)[0]?.message,
|
|
195
|
+
size: "lg",
|
|
196
|
+
disabled: !canTeleportTo(target),
|
|
197
|
+
trailing: mark(target),
|
|
198
|
+
onClick: () => pick(target)
|
|
199
|
+
}, target.hostId))
|
|
200
|
+
}),
|
|
201
|
+
picked && !notice && /* @__PURE__ */ jsxs("div", {
|
|
202
|
+
className: "flex flex-col gap-2",
|
|
203
|
+
children: [
|
|
204
|
+
shownRows(picked.rows).length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
205
|
+
className: "m-0 pl-4 flex flex-col gap-1 text-zg-label text-[var(--zg-text-muted)]",
|
|
206
|
+
"data-testid": "teleport-rows",
|
|
207
|
+
children: shownRows(picked.rows).map((row) => /* @__PURE__ */ jsx("li", { children: row.message }, `${row.subject.kind}:${row.subject.name}`))
|
|
208
|
+
}),
|
|
209
|
+
preview && !preview.repo && /* @__PURE__ */ jsx("p", {
|
|
210
|
+
className: "m-0 text-zg-label text-[var(--zg-text-muted)]",
|
|
211
|
+
children: labels.gitTeleportNotRepo
|
|
212
|
+
}),
|
|
213
|
+
preview?.repo && !work && /* @__PURE__ */ jsx("p", {
|
|
214
|
+
className: "m-0 text-zg-label text-[var(--zg-text-muted)]",
|
|
215
|
+
children: labels.gitTeleportNoWork
|
|
216
|
+
}),
|
|
217
|
+
work && /* @__PURE__ */ jsxs("button", {
|
|
218
|
+
type: "button",
|
|
219
|
+
role: "checkbox",
|
|
220
|
+
"aria-checked": carry,
|
|
221
|
+
"data-testid": "teleport-carry-work",
|
|
222
|
+
disabled: busy,
|
|
223
|
+
onClick: () => setCarry((on) => !on),
|
|
224
|
+
className: "flex items-start gap-2 bg-transparent border-0 p-0 text-left text-zg-label text-[var(--zg-text)] cursor-pointer disabled:cursor-default",
|
|
225
|
+
children: [/* @__PURE__ */ jsx(Checkbox, { checked: carry }), /* @__PURE__ */ jsx("span", { children: labels.gitTeleportCarryWork(movingCount(work)) })]
|
|
226
|
+
}),
|
|
227
|
+
carrying && /* @__PURE__ */ jsxs("label", {
|
|
228
|
+
className: "flex items-center gap-2 min-w-0",
|
|
229
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
230
|
+
className: "text-xs text-[var(--zg-text-muted)] shrink-0",
|
|
231
|
+
children: labels.gitTeleportCheckout(picked.name)
|
|
232
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
233
|
+
value: checkout,
|
|
234
|
+
onChange: (e) => setCheckout(e.target.value),
|
|
235
|
+
placeholder: labels.gitTeleportCheckoutPlaceholder,
|
|
236
|
+
"data-testid": "teleport-checkout",
|
|
237
|
+
disabled: busy,
|
|
238
|
+
spellCheck: false,
|
|
239
|
+
className: "zg-well zg-meta flex-1 min-w-0 h-7 px-2.5 text-zg-label placeholder:text-[var(--zg-text-subtle)]"
|
|
240
|
+
})]
|
|
241
|
+
}),
|
|
242
|
+
!carrying && !browsing && /* @__PURE__ */ jsxs("div", {
|
|
243
|
+
className: "flex items-center gap-2 min-w-0",
|
|
244
|
+
children: [/* @__PURE__ */ jsxs("label", {
|
|
245
|
+
className: "flex items-center gap-2 min-w-0 flex-1",
|
|
246
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
247
|
+
className: "text-xs text-[var(--zg-text-muted)] shrink-0",
|
|
248
|
+
children: labels.gitTeleportFolder(picked.name)
|
|
249
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
250
|
+
value: folder,
|
|
251
|
+
onChange: (e) => setFolder(e.target.value),
|
|
252
|
+
placeholder: labels.gitTeleportFolderPlaceholder,
|
|
253
|
+
"data-testid": "teleport-folder",
|
|
254
|
+
disabled: busy,
|
|
255
|
+
spellCheck: false,
|
|
256
|
+
className: "zg-well zg-meta flex-1 min-w-0 h-7 px-2.5 text-zg-label placeholder:text-[var(--zg-text-subtle)]"
|
|
257
|
+
})]
|
|
258
|
+
}), browse && /* @__PURE__ */ jsx("button", {
|
|
259
|
+
type: "button",
|
|
260
|
+
"data-testid": "teleport-browse",
|
|
261
|
+
disabled: busy,
|
|
262
|
+
onClick: browse,
|
|
263
|
+
className: buttonClass({
|
|
264
|
+
variant: "ghost",
|
|
265
|
+
size: "xs"
|
|
266
|
+
}),
|
|
267
|
+
children: labels.gitTeleportBrowse
|
|
268
|
+
})]
|
|
269
|
+
}),
|
|
270
|
+
!carrying && browsing && /* @__PURE__ */ jsx(RemoteFolderBrowser, {
|
|
271
|
+
...picked.remote ? { hostId: picked.hostId } : {},
|
|
272
|
+
start: folder.trim() || null,
|
|
273
|
+
onUse: (path) => {
|
|
274
|
+
setFolder(path);
|
|
275
|
+
setBrowsing(false);
|
|
276
|
+
}
|
|
277
|
+
}),
|
|
278
|
+
carrying && work && work.ignored.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
279
|
+
className: "flex flex-col gap-1",
|
|
280
|
+
"data-testid": "teleport-ignored",
|
|
281
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
282
|
+
className: "m-0 text-zg-label text-[var(--zg-text-muted)]",
|
|
283
|
+
children: labels.gitTeleportIgnored
|
|
284
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
285
|
+
className: "flex flex-col gap-1 max-h-[140px] overflow-y-auto",
|
|
286
|
+
children: work.ignored.filter((entry) => !entry.path.endsWith("/")).map((entry) => /* @__PURE__ */ jsxs("button", {
|
|
287
|
+
type: "button",
|
|
288
|
+
role: "checkbox",
|
|
289
|
+
"aria-checked": ticked.has(entry.path),
|
|
290
|
+
disabled: busy,
|
|
291
|
+
onClick: () => toggle(entry.path),
|
|
292
|
+
className: "flex items-center gap-2 bg-transparent border-0 p-0 text-left text-zg-label text-[var(--zg-text)] cursor-pointer disabled:cursor-default",
|
|
293
|
+
children: [
|
|
294
|
+
/* @__PURE__ */ jsx(Checkbox, { checked: ticked.has(entry.path) }),
|
|
295
|
+
/* @__PURE__ */ jsx("span", {
|
|
296
|
+
className: "zg-meta truncate",
|
|
297
|
+
children: entry.path
|
|
298
|
+
}),
|
|
299
|
+
entry.secret && /* @__PURE__ */ jsx(MetaChip, {
|
|
300
|
+
tone: "warn",
|
|
301
|
+
children: labels.gitTeleportSecret
|
|
302
|
+
})
|
|
303
|
+
]
|
|
304
|
+
}, entry.path))
|
|
305
|
+
})]
|
|
306
|
+
}),
|
|
307
|
+
carrying && work?.lfs && /* @__PURE__ */ jsx("p", {
|
|
308
|
+
className: "m-0 text-zg-label text-[var(--zg-text-muted)]",
|
|
309
|
+
children: labels.gitTeleportLfs
|
|
310
|
+
}),
|
|
311
|
+
carrying && work && work.submodules.length > 0 && /* @__PURE__ */ jsx("p", {
|
|
312
|
+
className: "m-0 text-zg-label text-[var(--zg-text-muted)]",
|
|
313
|
+
children: labels.gitTeleportSubmodules(work.submodules.length)
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ jsx("p", {
|
|
316
|
+
className: "m-0 text-zg-label leading-relaxed text-[var(--zg-text-muted)]",
|
|
317
|
+
children: labels.gitTeleportDetail
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
}),
|
|
321
|
+
busy && /* @__PURE__ */ jsxs("p", {
|
|
322
|
+
role: "status",
|
|
323
|
+
"aria-live": "polite",
|
|
324
|
+
"data-testid": "teleport-progress",
|
|
325
|
+
className: "m-0 flex items-center gap-2 text-zg-label text-[var(--zg-text-muted)]",
|
|
326
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
327
|
+
"aria-hidden": true,
|
|
328
|
+
className: "i-ph-circle-notch animate-spin text-zg-meta shrink-0"
|
|
329
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
330
|
+
className: "tabular-nums",
|
|
331
|
+
children: progress ? labels.gitTeleportStage(progress.stage, progress.done, progress.total) : labels.gitTeleporting
|
|
332
|
+
})]
|
|
333
|
+
}),
|
|
334
|
+
stopped && /* @__PURE__ */ jsx(Notice, {
|
|
335
|
+
tone: "info",
|
|
336
|
+
children: labels.gitTeleportStopped
|
|
337
|
+
}),
|
|
338
|
+
notice && /* @__PURE__ */ jsx(Notice, {
|
|
339
|
+
tone: "warning",
|
|
340
|
+
detail: notice.text,
|
|
341
|
+
children: labels.gitTeleportSourceNotTold
|
|
342
|
+
}),
|
|
343
|
+
error && /* @__PURE__ */ jsx(Notice, {
|
|
344
|
+
tone: "error",
|
|
345
|
+
...error.detail ? { detail: error.detail } : {},
|
|
346
|
+
children: error.message
|
|
347
|
+
})
|
|
348
|
+
]
|
|
349
|
+
}), /* @__PURE__ */ jsx("footer", {
|
|
350
|
+
className: "flex items-center justify-end gap-2 px-5 py-3 bg-[var(--zg-tray)]",
|
|
351
|
+
children: notice ? /* @__PURE__ */ jsx("button", {
|
|
352
|
+
type: "button",
|
|
353
|
+
"data-testid": "teleport-done",
|
|
354
|
+
onClick: () => onDone(notice.done),
|
|
355
|
+
className: buttonClass({ variant: "solid" }),
|
|
356
|
+
children: labels.gitMoveDone
|
|
357
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
358
|
+
(picked || onBack) && /* @__PURE__ */ jsx("button", {
|
|
359
|
+
type: "button",
|
|
360
|
+
onClick: back,
|
|
361
|
+
disabled: busy,
|
|
362
|
+
className: `${buttonClass({ variant: "ghost" })} mr-auto`,
|
|
363
|
+
children: labels.gitMoveBack
|
|
364
|
+
}),
|
|
365
|
+
busy ? /* @__PURE__ */ jsx("button", {
|
|
366
|
+
type: "button",
|
|
367
|
+
"data-testid": "teleport-stop",
|
|
368
|
+
onClick: () => stopRef.current?.abort(),
|
|
369
|
+
disabled: !teleportStoppable(progress),
|
|
370
|
+
className: buttonClass({ variant: "secondary" }),
|
|
371
|
+
children: labels.gitTeleportStop
|
|
372
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
373
|
+
type: "button",
|
|
374
|
+
onClick: onCancel,
|
|
375
|
+
className: buttonClass({ variant: "secondary" }),
|
|
376
|
+
children: labels.gitMoveCancel
|
|
377
|
+
}),
|
|
378
|
+
picked && /* @__PURE__ */ jsx("button", {
|
|
379
|
+
type: "button",
|
|
380
|
+
"data-testid": "teleport-submit",
|
|
381
|
+
onClick: () => void submit(),
|
|
382
|
+
disabled: !ready || busy,
|
|
383
|
+
className: buttonClass({ variant: "solid" }),
|
|
384
|
+
children: busy ? labels.gitTeleporting : labels.gitTeleportSubmit
|
|
385
|
+
})
|
|
386
|
+
] })
|
|
387
|
+
})]
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Opens the teleport dialog over the `GitHost` in context. `undefined` without
|
|
392
|
+
* what it needs (`GitHost.teleportTargets` and `teleportSession`, a modal
|
|
393
|
+
* layer): hide the control that calls it. Resolves where the session went, or
|
|
394
|
+
* `null` when closed.
|
|
395
|
+
*/
|
|
396
|
+
function useTeleportSession() {
|
|
397
|
+
const host = useGitHost();
|
|
398
|
+
const modal = useOptionalModal();
|
|
399
|
+
const openLayer = modal?.openLayer;
|
|
400
|
+
const closeLayer = modal?.closeLayer;
|
|
401
|
+
const offered = Boolean(host?.teleportTargets && host.teleportSession && openLayer && closeLayer);
|
|
402
|
+
const open = useCallback((subject) => new Promise((resolve) => {
|
|
403
|
+
if (!openLayer || !closeLayer) return resolve(null);
|
|
404
|
+
const previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
405
|
+
let running = false;
|
|
406
|
+
let dismissed = false;
|
|
407
|
+
const settle = (done) => {
|
|
408
|
+
resolve(done);
|
|
409
|
+
requestAnimationFrame(() => previousFocus?.focus());
|
|
410
|
+
};
|
|
411
|
+
openLayer(/* @__PURE__ */ jsx(TeleportSessionDialog, {
|
|
412
|
+
subject,
|
|
413
|
+
onBusy: (busy) => {
|
|
414
|
+
running = busy;
|
|
415
|
+
},
|
|
416
|
+
onFailed: (message, detail) => {
|
|
417
|
+
if (dismissed) {
|
|
418
|
+
toast.error(message, detail ? { description: detail } : void 0);
|
|
419
|
+
settle(null);
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
onDone: (done) => {
|
|
423
|
+
if (!dismissed) closeLayer();
|
|
424
|
+
settle(done);
|
|
425
|
+
},
|
|
426
|
+
onCancel: () => {
|
|
427
|
+
closeLayer();
|
|
428
|
+
settle(null);
|
|
429
|
+
}
|
|
430
|
+
}), {
|
|
431
|
+
onDismiss: () => {
|
|
432
|
+
if (running) dismissed = true;
|
|
433
|
+
else settle(null);
|
|
434
|
+
},
|
|
435
|
+
labelledBy: TITLE_ID
|
|
436
|
+
});
|
|
437
|
+
}), [openLayer, closeLayer]);
|
|
438
|
+
return offered ? open : void 0;
|
|
439
|
+
}
|
|
440
|
+
export { TeleportSessionDialog, useTeleportSession };
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
* `zidane-ui/git/testing` in memory. All three run
|
|
12
12
|
* `zidane-ui/git/testing/contract`.
|
|
13
13
|
*/
|
|
14
|
+
import { TeleportCallView, TeleportOutcome, TeleportRequestView, TeleportTargetView } from "./teleport.js";
|
|
14
15
|
import { EnvironmentDescriptor } from "zidane/chat";
|
|
16
|
+
import { WorkPreview } from "zidane/ipc";
|
|
15
17
|
/** A local branch: when it last moved, and how it stands against the default branch. */
|
|
16
18
|
export interface GitBranch {
|
|
17
19
|
/** The branch name. */
|
|
@@ -265,6 +267,12 @@ export interface GitEnvironmentQuery {
|
|
|
265
267
|
cwd?: string;
|
|
266
268
|
/** The saved server the session would run on (absent: this host). */
|
|
267
269
|
hostId?: string;
|
|
270
|
+
/**
|
|
271
|
+
* What the host can run, whatever the folder: a kind is unavailable only for a
|
|
272
|
+
* reason of the machine (no API key, the tool not installed). For a default that
|
|
273
|
+
* applies to many folders. Default: what `cwd` can run.
|
|
274
|
+
*/
|
|
275
|
+
machineOnly?: boolean;
|
|
268
276
|
}
|
|
269
277
|
/** Where {@link GitHost.listFolders} lists. */
|
|
270
278
|
export interface GitFolderQuery {
|
|
@@ -366,6 +374,12 @@ export interface GitHost {
|
|
|
366
374
|
* machine's kinds). Nothing is copied; the session's terminals and background tasks stop. Absent: no "Move to…".
|
|
367
375
|
*/
|
|
368
376
|
moveSession?: (sessionId: string, target: GitMoveTarget) => Promise<GitMoveResult>;
|
|
377
|
+
/** Every other host the session could teleport to, compared with it (docs/TELEPORT.md). Absent: no "Teleport to…". */
|
|
378
|
+
teleportTargets?: (sessionId: string) => Promise<readonly TeleportTargetView[]>;
|
|
379
|
+
/** What would move from the session's folder through git, and what would not. Absent: work is never carried. */
|
|
380
|
+
teleportPreview?: (sessionId: string) => Promise<WorkPreview>;
|
|
381
|
+
/** Teleports the session; resolves its id on the target, or why it failed (nothing changed then). */
|
|
382
|
+
teleportSession?: (sessionId: string, request: TeleportRequestView, options?: TeleportCallView) => Promise<TeleportOutcome>;
|
|
369
383
|
/** The environment kinds a new session can run in. Absent: the app supplies them itself. */
|
|
370
384
|
environments?: (query: GitEnvironmentQuery) => Promise<readonly EnvironmentDescriptor[]>;
|
|
371
385
|
/**
|
|
@@ -6,4 +6,5 @@ import { DraftRemoteClone, resolveRemoteClone } from "./remote-clone.js";
|
|
|
6
6
|
import { SandboxFilter, SandboxesSource, sandboxCounts, sandboxMatches, sandboxSpecs, sortSandboxes } from "./sandboxes.js";
|
|
7
7
|
import { SWITCHER_SECTIONS, SwitcherCache, SwitcherEntry, SwitcherSection, SwitcherSectionId, ageIsDuration, clockTime, compactCount, countInLabel, createSwitcherCache, prMatches, readPullRequests, switcherCacheOf, switcherCreates, switcherKey, switcherSections } from "./switcher.js";
|
|
8
8
|
import { GitSyncAction, syncAction, syncSummary, syncTooltip } from "./sync.js";
|
|
9
|
-
|
|
9
|
+
import { TeleportCallView, TeleportOutcome, TeleportProgressView, TeleportRequestView, TeleportTargetView, canTeleportTo, movingCount, shownRows, teleportStoppable, workTarget } from "./teleport.js";
|
|
10
|
+
export { DEFAULT_GIT_LABELS, DraftEnvironment, DraftRemoteClone, EnvironmentMachine, GitActionResult, GitBranch, GitBranchPullRequest, GitCheckoutResult, GitCheckoutTarget, GitClone, GitCloneProgress, GitCloneResult, GitCreateFolderQuery, GitCreateFolderResult, GitEnvironmentQuery, GitFolderAllows, GitFolderEntry, GitFolderListing, GitFolderQuery, GitFolderResult, GitFolderSearchQuery, GitFolderSearchResult, GitHost, GitHostError, GitLabels, GitMoveResult, GitMoveTarget, GitPullRequest, GitPullRequestList, GitPullRequestQuery, GitRepoInfo, GitRepoSpec, GitStatus, GitSyncAction, GitSyncResult, MoveChoice, MoveSessionSubject, SWITCHER_SECTIONS, SandboxFilter, SandboxesSource, SwitcherCache, SwitcherEntry, SwitcherSection, SwitcherSectionId, TeleportCallView, TeleportOutcome, TeleportProgressView, TeleportRequestView, TeleportTargetView, WithMachinesOptions, ageIsDuration, canTeleportTo, clockTime, compactCount, countInLabel, createSwitcherCache, environmentBaseKind, environmentKindIcon, environmentMachineName, folderName, gitErrorText, leavesWorktree, machineEnvironmentKind, machinesOf, moveChoices, moveListingCwd, moveSubject, movingCount, newChatPlaceKind, prMatches, readPullRequests, resolveDraftDescriptor, resolveDraftEnvironment, resolveRemoteClone, sandboxCounts, sandboxMatches, sandboxSpecs, shownRows, sortSandboxes, switcherCacheOf, switcherCreates, switcherKey, switcherSections, syncAction, syncSummary, syncTooltip, teleportStoppable, withMachines, workTarget };
|
|
@@ -5,4 +5,5 @@ import { resolveRemoteClone } from "./remote-clone.js";
|
|
|
5
5
|
import { sandboxCounts, sandboxMatches, sandboxSpecs, sortSandboxes } from "./sandboxes.js";
|
|
6
6
|
import { SWITCHER_SECTIONS, ageIsDuration, clockTime, compactCount, countInLabel, createSwitcherCache, prMatches, readPullRequests, switcherCacheOf, switcherCreates, switcherKey, switcherSections } from "./switcher.js";
|
|
7
7
|
import { syncAction, syncSummary, syncTooltip } from "./sync.js";
|
|
8
|
-
|
|
8
|
+
import { canTeleportTo, movingCount, shownRows, teleportStoppable, workTarget } from "./teleport.js";
|
|
9
|
+
export { DEFAULT_GIT_LABELS, SWITCHER_SECTIONS, ageIsDuration, canTeleportTo, clockTime, compactCount, countInLabel, createSwitcherCache, environmentBaseKind, environmentKindIcon, environmentMachineName, folderName, gitErrorText, leavesWorktree, machineEnvironmentKind, machinesOf, moveChoices, moveListingCwd, moveSubject, movingCount, newChatPlaceKind, prMatches, readPullRequests, resolveDraftDescriptor, resolveDraftEnvironment, resolveRemoteClone, sandboxCounts, sandboxMatches, sandboxSpecs, shownRows, sortSandboxes, switcherCacheOf, switcherCreates, switcherKey, switcherSections, syncAction, syncSummary, syncTooltip, teleportStoppable, withMachines, workTarget };
|
|
@@ -142,6 +142,49 @@ export declare const DEFAULT_GIT_LABELS: {
|
|
|
142
142
|
gitMoveDone: string;
|
|
143
143
|
gitMoveListFailed: string;
|
|
144
144
|
gitMoveFailed: string;
|
|
145
|
+
gitTeleportTitle: string;
|
|
146
|
+
gitTeleportWhere: string;
|
|
147
|
+
gitTeleportLoading: string;
|
|
148
|
+
gitTeleportNone: string;
|
|
149
|
+
gitTeleportMarkFixable: string;
|
|
150
|
+
gitTeleportMarkChanges: string;
|
|
151
|
+
gitTeleportMarkBlocked: string;
|
|
152
|
+
gitTeleportConfirm: (name: string) => string;
|
|
153
|
+
gitTeleportCarryWork: (count: number) => string;
|
|
154
|
+
gitTeleportNoWork: string;
|
|
155
|
+
gitTeleportNotRepo: string;
|
|
156
|
+
gitTeleportCheckout: (name: string) => string;
|
|
157
|
+
gitTeleportCheckoutPlaceholder: string;
|
|
158
|
+
gitTeleportFolder: (name: string) => string;
|
|
159
|
+
gitTeleportFolderPlaceholder: string;
|
|
160
|
+
gitTeleportBrowse: string;
|
|
161
|
+
gitTeleportIgnored: string;
|
|
162
|
+
gitTeleportSecret: string;
|
|
163
|
+
gitTeleportLfs: string;
|
|
164
|
+
gitTeleportSubmodules: (count: number) => string;
|
|
165
|
+
gitTeleportDetail: string;
|
|
166
|
+
gitTeleportSubmit: string;
|
|
167
|
+
gitTeleporting: string;
|
|
168
|
+
/** Where a teleport is, under the dialog's content while it runs. */
|
|
169
|
+
gitTeleportStage: (stage: "export" | "transfer" | "prepare" | "commit" | "complete", done?: number, total?: number) => string;
|
|
170
|
+
gitTeleportStop: string;
|
|
171
|
+
gitTeleportStopped: string;
|
|
172
|
+
gitTeleportFailed: string;
|
|
173
|
+
/** The target stopped answering during the switch: the session may be on it already. */
|
|
174
|
+
gitTeleportUnknown: string;
|
|
175
|
+
/** The session moved, but its old host could not be told yet (the host's words under Details). */
|
|
176
|
+
gitTeleportSourceNotTold: string;
|
|
177
|
+
gitTeleportListFailed: string;
|
|
178
|
+
/** The host picked in Move to… can't take the session: why, from its comparison. */
|
|
179
|
+
gitTeleportCannot: (name: string) => string;
|
|
180
|
+
/** In the teleport step of Move to…, when an isolation was picked on the target too. */
|
|
181
|
+
gitTeleportThen: (isolation: string) => string;
|
|
182
|
+
gitMoveContinue: string;
|
|
183
|
+
gitMoveHere: string;
|
|
184
|
+
gitMoveUnavailable: string;
|
|
185
|
+
/** After a teleport, before its isolation is set up on the new host. */
|
|
186
|
+
gitMoveThen: (host: string, isolation: string) => string;
|
|
187
|
+
gitMoveKeepThere: string;
|
|
145
188
|
gitWhereLabel: string;
|
|
146
189
|
gitWhereTitle: (place: string, isolation: string | undefined, branch: string | undefined) => string;
|
|
147
190
|
gitRunsOn: string;
|
|
@@ -216,7 +259,7 @@ export declare const DEFAULT_GIT_LABELS: {
|
|
|
216
259
|
sandboxReplaced: string;
|
|
217
260
|
sandboxReplacedHint: (title: string) => string;
|
|
218
261
|
sandboxOpenSession: (title: string) => string;
|
|
219
|
-
sandboxStates: Record<"running" | "paused" | "other", string>;
|
|
262
|
+
sandboxStates: Record<"running" | "paused" | "failed" | "other", string>;
|
|
220
263
|
sandboxCpu: (count: number) => string;
|
|
221
264
|
sandboxMemory: (mib: number) => string;
|
|
222
265
|
sandboxCopyId: string;
|