zidane-ui 9.2.2 → 9.3.1
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/browser-keybindings-host.js +3 -1
- package/dist/adapters/live.d.ts +6 -0
- package/dist/adapters/live.js +16 -8
- package/dist/adapters/server-composer-host.js +22 -9
- package/dist/adapters/server-host.js +143 -18
- package/dist/adapters/server-media.d.ts +9 -1
- package/dist/adapters/server-media.js +14 -1
- package/dist/adapters/server-settings-host.js +30 -3
- package/dist/adapters/server-settings-sections.js +23 -1
- package/dist/adapters/server-sidebar-host.d.ts +3 -1
- package/dist/adapters/server-sidebar-host.js +10 -1
- package/dist/app/ModalProvider.js +1 -1
- package/dist/approvals/ApprovalShell.js +1 -1
- package/dist/chat/DaemonOrb.d.ts +29 -1
- package/dist/chat/DaemonOrb.js +25 -12
- package/dist/chat/HostTranscript.d.ts +0 -12
- package/dist/chat/HostTranscript.js +6 -1
- package/dist/chat/SessionStreamsProvider.d.ts +8 -0
- package/dist/chat/SessionStreamsProvider.js +11 -2
- package/dist/chat/StatusDot.js +8 -2
- package/dist/chat/Transcript.d.ts +20 -11
- package/dist/chat/Transcript.js +335 -162
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/headless/host.d.ts +43 -7
- package/dist/chat/headless/index.d.ts +8 -6
- package/dist/chat/headless/index.js +11 -9
- package/dist/chat/headless/labels.d.ts +30 -0
- package/dist/chat/headless/labels.js +29 -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 +66 -0
- package/dist/chat/headless/markdown-scan.js +124 -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/session-list.d.ts +20 -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 +17 -2
- package/dist/chat/headless/sidebar/directory.js +50 -54
- package/dist/chat/headless/sidebar/environment.d.ts +5 -2
- package/dist/chat/headless/sidebar/environment.js +11 -2
- package/dist/chat/headless/sidebar/host.d.ts +15 -0
- package/dist/chat/headless/sidebar/inbox.d.ts +12 -3
- package/dist/chat/headless/sidebar/inbox.js +18 -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 +38 -2
- package/dist/chat/headless/sidebar/labels.js +16 -0
- 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 +2 -0
- package/dist/chat/headless/streams/actions.js +1 -0
- package/dist/chat/headless/streams/event-bytes.d.ts +6 -0
- package/dist/chat/headless/streams/event-bytes.js +34 -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 +24 -1
- package/dist/chat/headless/streams/store.js +51 -26
- package/dist/chat/headless/streams/transcript-map.d.ts +57 -0
- package/dist/chat/headless/streams/transcript-map.js +88 -0
- package/dist/chat/headless/streams/transcript.d.ts +4 -2
- package/dist/chat/headless/streams/transcript.js +19 -7
- 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 +32 -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-actions.d.ts +8 -3
- package/dist/chat/headless/transcript/fold-actions.js +16 -0
- 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 +4 -2
- package/dist/chat/headless/transcript/fold.js +37 -7
- 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 -1
- package/dist/chat/headless/transcript/index.js +2 -1
- package/dist/chat/headless/transcript/nesting.js +2 -1
- package/dist/chat/headless/transcript/rail.d.ts +142 -0
- package/dist/chat/headless/transcript/rail.js +290 -0
- package/dist/chat/headless/transcript/rows.d.ts +11 -1
- package/dist/chat/headless/transcript/run-failures.d.ts +4 -0
- package/dist/chat/headless/transcript/run-failures.js +31 -2
- 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/headless/transcript-labels.d.ts +1 -0
- package/dist/chat/headless/turn-labels.d.ts +1 -0
- package/dist/chat/headless/turn-labels.js +2 -1
- package/dist/chat/index.d.ts +10 -8
- package/dist/chat/index.js +9 -7
- package/dist/chat/interactions/ElicitationCard.js +1 -1
- package/dist/chat/interactions/InteractionCard.js +1 -1
- package/dist/chat/interactions/PlanCard.js +3 -3
- package/dist/chat/interactions/QuestionField.js +4 -4
- package/dist/chat/interactions/QuestionForm.js +3 -3
- package/dist/chat/interactions/SecretInput.js +1 -1
- package/dist/chat/sidebar/ProjectIcon.d.ts +1 -1
- package/dist/chat/sidebar/ProjectIcon.js +1 -1
- package/dist/chat/sidebar/RowChips.d.ts +3 -2
- package/dist/chat/sidebar/RowChips.js +6 -3
- package/dist/chat/sidebar/SessionSidebar.js +13 -14
- package/dist/chat/sidebar/SidebarFooter.d.ts +8 -5
- package/dist/chat/sidebar/SidebarFooter.js +6 -6
- package/dist/chat/sidebar/SidebarFrame.d.ts +2 -0
- package/dist/chat/sidebar/SidebarFrame.js +5 -2
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +3 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +3 -1
- package/dist/chat/sidebar/SpacesSection.d.ts +20 -1
- package/dist/chat/sidebar/SpacesSection.js +34 -13
- package/dist/chat/sidebar/index.d.ts +2 -2
- package/dist/chat/sidebar/session-menu.d.ts +11 -2
- package/dist/chat/sidebar/session-menu.js +50 -5
- package/dist/chat/sidebar/sidebar-live.js +1 -1
- package/dist/chat/sidebar/useInboxRows.js +43 -2
- package/dist/chat/sidebar/useInboxTriage.js +19 -14
- package/dist/chat/testing/contract.d.ts +5 -3
- package/dist/chat/testing/contract.js +66 -1
- package/dist/chat/testing/fixture-sidebar-host.d.ts +7 -1
- package/dist/chat/testing/fixture-sidebar-host.js +12 -0
- package/dist/chat/testing/sidebar.contract.d.ts +6 -0
- package/dist/chat/testing/sidebar.contract.js +24 -0
- 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/InteractionToolBody.js +1 -1
- package/dist/chat/transcript/LazyRow.d.ts +40 -40
- package/dist/chat/transcript/LazyRow.js +101 -149
- package/dist/chat/transcript/MermaidDiagram.js +2 -1
- package/dist/chat/transcript/SelectCursor.d.ts +11 -1
- package/dist/chat/transcript/SelectCursor.js +10 -5
- package/dist/chat/transcript/SubagentBlock.js +3 -2
- package/dist/chat/transcript/TranscriptRail.d.ts +109 -0
- package/dist/chat/transcript/TranscriptRail.js +579 -0
- package/dist/chat/transcript/TranscriptRow.d.ts +4 -7
- package/dist/chat/transcript/TranscriptRow.js +9 -5
- package/dist/chat/transcript/actions.d.ts +43 -3
- package/dist/chat/transcript/actions.js +27 -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 +3 -2
- package/dist/chat/transcript/fold.js +21 -2
- package/dist/chat/transcript/index.d.ts +11 -9
- package/dist/chat/transcript/index.js +10 -8
- package/dist/chat/transcript/markdown-cache.d.ts +7 -1
- package/dist/chat/transcript/markdown-cache.js +12 -1
- package/dist/chat/transcript/markdown.js +116 -54
- package/dist/chat/transcript/media-gallery.d.ts +3 -2
- package/dist/chat/transcript/media-gallery.js +10 -7
- package/dist/chat/transcript/notices.d.ts +23 -1
- package/dist/chat/transcript/notices.js +110 -28
- package/dist/chat/transcript/prompt.js +6 -4
- package/dist/chat/transcript/prose.js +3 -1
- package/dist/chat/transcript/receipt-parts.d.ts +22 -0
- package/dist/chat/transcript/receipt-parts.js +87 -0
- 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 +165 -0
- package/dist/chat/transcript/row-mount.js +498 -0
- package/dist/chat/transcript/row-parking.d.ts +125 -0
- package/dist/chat/transcript/row-parking.js +135 -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 +6 -78
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/scroll-clamp.js +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 -5
- 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 +24 -7
- package/dist/chat/transcript/use-transcript-rows.js +28 -46
- package/dist/chat/transcript/useSettledReveal.js +15 -3
- package/dist/chat/transcript/useStickToBottom.js +4 -4
- package/dist/chat/transcript/useTranscriptSearch.js +30 -14
- package/dist/chat/transcript/view-scope.d.ts +26 -6
- package/dist/chat/transcript/view-scope.js +106 -20
- package/dist/components/ChoiceCards.js +1 -1
- package/dist/components/ConfirmDialog.js +1 -1
- package/dist/components/CopyValue.d.ts +33 -0
- package/dist/components/CopyValue.js +54 -0
- package/dist/components/Form.js +1 -1
- package/dist/components/HowItWorks.js +1 -1
- package/dist/components/Menu.js +1 -1
- package/dist/components/StepFrame.js +2 -2
- package/dist/components/SwatchPicker.js +1 -1
- package/dist/components/ToggleCard.js +1 -1
- package/dist/components/floating/HoverCard.js +2 -3
- package/dist/components/floating/hover-delay.d.ts +4 -0
- package/dist/components/floating/hover-delay.js +6 -0
- package/dist/core.css +14 -12
- package/dist/dist/{index-Betz0OWq.d.ts → index-C6-t1SS9.d.ts} +21 -2
- package/dist/dist/index-De9AbmxS.d.ts +1 -0
- package/dist/dist/index.d.ts +5 -5
- package/dist/dist/sandbox-CSUihARm.d.ts +2 -0
- package/dist/dist/{timeout-CyU7HLyz.d.ts → timeout-CmTx6V9y.d.ts} +1 -0
- package/dist/extensions/ExtensionDialogHost.js +1 -1
- package/dist/files/TreeColumn.js +3 -1
- package/dist/files/headless/host.d.ts +2 -2
- package/dist/git/ImportRepoDialog.js +1 -1
- package/dist/git/MoveSessionDialog.js +2 -2
- package/dist/git/SandboxManager.d.ts +42 -0
- package/dist/git/SandboxManager.js +297 -0
- package/dist/git/SyncChip.js +1 -1
- package/dist/git/headless/index.d.ts +2 -1
- package/dist/git/headless/index.js +2 -1
- package/dist/git/headless/labels.d.ts +29 -0
- package/dist/git/headless/labels.js +34 -1
- package/dist/git/headless/sandboxes.d.ts +43 -0
- package/dist/git/headless/sandboxes.js +52 -0
- package/dist/git/index.d.ts +2 -1
- package/dist/git/index.js +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/keybindings/headless/catalog.d.ts +1 -1
- package/dist/keybindings/headless/catalog.js +12 -0
- package/dist/machines/HostsSection.d.ts +1 -1
- package/dist/machines/headless/labels.js +2 -2
- package/dist/motion/flip-list.js +3 -10
- package/dist/motion/presence.d.ts +10 -0
- package/dist/motion/presence.js +20 -1
- package/dist/motion/swap.d.ts +8 -2
- package/dist/motion/swap.js +5 -2
- package/dist/onboarding/conversation.js +27 -15
- package/dist/onboarding/demos/how-it-works.js +1 -1
- package/dist/onboarding/skills/parts.js +4 -4
- package/dist/onboarding/sources/SourceBrowser.js +1 -1
- package/dist/onboarding/steps/ReadyStep.js +1 -1
- package/dist/onboarding/steps/connect/KeyForm.js +1 -1
- package/dist/palette/headless/app-sources.js +20 -0
- package/dist/palette/headless/labels.js +2 -0
- package/dist/session/PlanTracker.js +3 -3
- package/dist/session/SecretsPanel.js +1 -1
- package/dist/session/SessionHeader.d.ts +18 -6
- package/dist/session/SessionHeader.js +68 -12
- package/dist/session/SessionPlaceMenu.d.ts +35 -0
- package/dist/session/SessionPlaceMenu.js +299 -0
- package/dist/session/SessionShell.js +1 -1
- package/dist/session/TurnDetailsDialog.js +1 -1
- package/dist/session/headless/index.d.ts +2 -1
- package/dist/session/headless/index.js +2 -1
- package/dist/session/headless/labels.d.ts +73 -0
- package/dist/session/headless/labels.js +73 -0
- package/dist/session/headless/place.d.ts +49 -0
- package/dist/session/headless/place.js +57 -0
- package/dist/session/index.d.ts +2 -1
- package/dist/session/index.js +2 -1
- package/dist/settings/ConversationPresetsCard.js +1 -1
- package/dist/settings/SettingCard.js +2 -2
- package/dist/settings/SettingsRowsPage.js +1 -1
- package/dist/settings/headless/fixture-performance.js +4 -2
- package/dist/settings/headless/fixture-sections.js +7 -0
- package/dist/settings/headless/labels.d.ts +1 -1
- package/dist/settings/headless/labels.js +1 -1
- package/dist/settings/headless/layout.d.ts +4 -4
- package/dist/settings/headless/layout.js +1 -1
- package/dist/settings/headless/performance.d.ts +4 -0
- package/dist/settings/headless/search.d.ts +2 -2
- package/dist/settings/headless/sections-host.d.ts +20 -2
- package/dist/settings/sections/claude-import/ClaudeImportDialog.js +1 -1
- package/dist/settings/sections/enabled-list/EnabledListSection.js +2 -2
- package/dist/settings/sections/environments/EnvironmentsSection.d.ts +9 -3
- package/dist/settings/sections/environments/EnvironmentsSection.js +292 -52
- package/dist/settings/sections/environments/labels.d.ts +15 -0
- package/dist/settings/sections/environments/labels.js +18 -3
- package/dist/settings/sections/extensions/ChangeOriginDialog.js +1 -1
- package/dist/settings/sections/extensions/ExtensionSourceBrowser.js +1 -1
- package/dist/settings/sections/extensions/ExtensionsSection.d.ts +3 -2
- package/dist/settings/sections/extensions/ExtensionsSection.js +9 -3
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +15 -5
- package/dist/settings/sections/keybindings/labels.d.ts +2 -0
- package/dist/settings/sections/keybindings/labels.js +2 -0
- package/dist/settings/sections/keybindings/rows.js +8 -0
- package/dist/settings/sections/models/SpacesDefaultsSection.d.ts +7 -3
- package/dist/settings/sections/models/SpacesDefaultsSection.js +11 -5
- 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/settings/sections/skills/SkillGroups.js +1 -1
- package/dist/settings/server-app.d.ts +4 -2
- package/dist/settings/server-app.js +7 -3
- package/dist/settings/testing/sections.contract.d.ts +7 -1
- package/dist/settings/testing/sections.contract.js +37 -0
- package/dist/styles.css +243 -19
- package/dist/terminal/TerminalDrawer.js +3 -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/SidePanel.js +3 -1
- package/package.json +2 -2
- package/src/styles/base.css +13 -0
- package/src/styles/chat.css +30 -0
- package/src/styles/components.css +0 -10
- package/src/styles/files.css +5 -0
- package/src/styles/sidebar.css +29 -7
- package/src/styles/terminal.css +6 -0
- package/src/styles/tokens.css +5 -0
- package/src/styles/transcript.css +138 -0
- package/src/styles/workspace.css +6 -0
- package/dist/dist/index-QcFzZlao.d.ts +0 -1
- package/dist/dist/sandbox-D0zsW8I1.d.ts +0 -2
- /package/dist/dist/{types-_Dtoq_No.d.ts → execution-failure-SREfl-EZ.d.ts} +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { EditableTitle } from "../components/EditableTitle.js";
|
|
2
2
|
import { RowActionsMenu } from "../components/RowActionsMenu.js";
|
|
3
|
+
import { useTooltip } from "../components/Tooltip.js";
|
|
3
4
|
import { ExtensionSlot } from "../extensions/ExtensionSlot.js";
|
|
4
5
|
import { RoutedLink } from "../extensions/links.js";
|
|
5
6
|
import { TitleText } from "../motion/title-text.js";
|
|
6
7
|
import { useSessionLabels } from "./useSessionLabels.js";
|
|
7
8
|
import { useEffect, useRef, useState } from "react";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
// src/session/SessionHeader.tsx
|
|
10
11
|
function folderBasename(path) {
|
|
11
12
|
const trimmed = path.replace(/[/\\]+$/, "");
|
|
@@ -18,7 +19,7 @@ function folderBasename(path) {
|
|
|
18
19
|
* @param props - The session facts, the folder, details and rename handlers, the menu, the `toolbar`, `className` and
|
|
19
20
|
* `style`.
|
|
20
21
|
*/
|
|
21
|
-
function SessionHeader({ title, titleDisplay, titleScope, cwd, isMain = false, running = false, server, onPickFolder, onOpenDetails, onRename, renaming = false, onRenamingChange, menuItems, onMenuOpenChange, startedFrom, toolbar, sessionId = titleScope, className = "", style }) {
|
|
22
|
+
function SessionHeader({ title, titleDisplay, titleScope, cwd, projectRoot, branch, BranchMenu, place, isMain = false, running = false, server, onPickFolder, onOpenDetails, onRename, renaming = false, onRenamingChange, menuItems, onMenuOpenChange, startedFrom, toolbar, sessionId = titleScope, className = "", style }) {
|
|
22
23
|
const labels = useSessionLabels();
|
|
23
24
|
const [menuAt, setMenuAt] = useState(null);
|
|
24
25
|
const setMenu = (at) => {
|
|
@@ -45,10 +46,12 @@ function SessionHeader({ title, titleDisplay, titleScope, cwd, isMain = false, r
|
|
|
45
46
|
};
|
|
46
47
|
const onServer = server !== void 0;
|
|
47
48
|
const folderless = !cwd;
|
|
48
|
-
const folderName = folderless ? labels.headerChat : folderBasename(cwd);
|
|
49
|
+
const folderName = folderless ? labels.headerChat : folderBasename(projectRoot || cwd);
|
|
50
|
+
const folderTip = useTooltip(isMain ? labels.headerMainFolder : folderless && running ? labels.headerChatRunning : onServer ? labels.headerFolderOnServer(cwd, server.name ?? null) : folderless ? labels.headerChatAttach : labels.headerChangeFolder(cwd));
|
|
49
51
|
const titleRef = useRef(null);
|
|
50
52
|
const [overflow, setOverflow] = useState(null);
|
|
51
53
|
const needsTruncate = overflow?.title === title ? overflow.value : true;
|
|
54
|
+
const titleTip = useTooltip(needsTruncate ? `${title} · ${labels.headerDetails}` : labels.headerDetails);
|
|
52
55
|
useEffect(() => {
|
|
53
56
|
const el = titleRef.current;
|
|
54
57
|
if (!el) return void 0;
|
|
@@ -82,16 +85,19 @@ function SessionHeader({ title, titleDisplay, titleScope, cwd, isMain = false, r
|
|
|
82
85
|
...style
|
|
83
86
|
},
|
|
84
87
|
children: [
|
|
88
|
+
place,
|
|
85
89
|
/* @__PURE__ */ jsx("button", {
|
|
90
|
+
...folderTip.anchorProps,
|
|
86
91
|
type: "button",
|
|
87
92
|
onClick: onPickFolder,
|
|
88
93
|
onContextMenu: openMenu,
|
|
89
94
|
disabled: !onPickFolder || isMain || onServer || folderless && running,
|
|
90
|
-
|
|
91
|
-
className: `zg-press-soft min-w-0 max-w-[200px] truncate text-left bg-transparent border-0 text-sm font-medium px-1.5 py-1 -mx-1.5 rounded-zg-sm transition-colors disabled:cursor-default enabled:cursor-pointer enabled:hover:before:bg-[var(--zg-row-hover)] ${folderless ? "
|
|
95
|
+
"data-testid": "session-project",
|
|
96
|
+
className: `zg-press-soft min-w-0 max-w-[200px] truncate text-left bg-transparent border-0 text-sm font-medium px-1.5 py-1 -mx-1.5 rounded-zg-sm transition-colors disabled:cursor-default enabled:cursor-pointer enabled:hover:before:bg-[var(--zg-row-hover)] ${folderless ? "text-[var(--zg-text-muted)]" : "text-[var(--zg-text)]"}`,
|
|
92
97
|
children: folderName
|
|
93
98
|
}),
|
|
94
|
-
|
|
99
|
+
folderTip.tip,
|
|
100
|
+
onServer && !place && /* @__PURE__ */ jsxs("span", {
|
|
95
101
|
className: "inline-flex items-center gap-1 shrink-0 text-xs text-[var(--zg-text-muted)] select-none",
|
|
96
102
|
title: server.url ?? labels.headerServerGone,
|
|
97
103
|
"data-testid": "session-host",
|
|
@@ -107,11 +113,13 @@ function SessionHeader({ title, titleDisplay, titleScope, cwd, isMain = false, r
|
|
|
107
113
|
server.status
|
|
108
114
|
]
|
|
109
115
|
}),
|
|
110
|
-
/* @__PURE__ */ jsx(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
/* @__PURE__ */ jsx(Crumb, {}),
|
|
117
|
+
branch && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(HeaderBranch, {
|
|
118
|
+
branch,
|
|
119
|
+
cwd,
|
|
120
|
+
sessionId: sessionId ?? null,
|
|
121
|
+
BranchMenu
|
|
122
|
+
}), /* @__PURE__ */ jsx(Crumb, {})] }),
|
|
115
123
|
renaming && onRename ? /* @__PURE__ */ jsx(EditableTitle, {
|
|
116
124
|
text: renameValue,
|
|
117
125
|
editing: true,
|
|
@@ -122,11 +130,12 @@ function SessionHeader({ title, titleDisplay, titleScope, cwd, isMain = false, r
|
|
|
122
130
|
label: labels.headerRename,
|
|
123
131
|
className: "zg-no-drag min-w-[8rem] max-w-full text-sm font-medium text-[var(--zg-text)] whitespace-nowrap overflow-hidden px-1.5 py-1 -mx-1.5 rounded-zg-sm bg-[var(--zg-row-hover)]"
|
|
124
132
|
}) : /* @__PURE__ */ jsx("button", {
|
|
133
|
+
...titleTip.anchorProps,
|
|
125
134
|
ref: titleRef,
|
|
126
135
|
type: "button",
|
|
127
136
|
onClick: onOpenDetails,
|
|
128
137
|
onContextMenu: openMenu,
|
|
129
|
-
|
|
138
|
+
"data-testid": "session-title",
|
|
130
139
|
dir: "auto",
|
|
131
140
|
className: `zg-press-subtle min-w-0 max-w-full text-left bg-transparent border-0 cursor-pointer text-sm font-medium text-[var(--zg-text-muted)] whitespace-nowrap overflow-hidden px-1.5 py-1 -mx-1.5 rounded-zg-sm hover:before:bg-[var(--zg-row-hover)] hover:text-[var(--zg-text)] transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[var(--zg-ring)] ${needsTruncate ? "text-ellipsis" : ""}`,
|
|
132
141
|
children: /* @__PURE__ */ jsx(TitleText, {
|
|
@@ -135,6 +144,7 @@ function SessionHeader({ title, titleDisplay, titleScope, cwd, isMain = false, r
|
|
|
135
144
|
...titleScope ? { scope: titleScope } : {}
|
|
136
145
|
})
|
|
137
146
|
}),
|
|
147
|
+
!renaming && titleTip.tip,
|
|
138
148
|
startedFrom && !renaming ? /* @__PURE__ */ jsx(HeaderOrigin, { origin: startedFrom }) : null,
|
|
139
149
|
/* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
140
150
|
/* @__PURE__ */ jsx(ExtensionSlot, {
|
|
@@ -152,6 +162,52 @@ function SessionHeader({ title, titleDisplay, titleScope, cwd, isMain = false, r
|
|
|
152
162
|
]
|
|
153
163
|
});
|
|
154
164
|
}
|
|
165
|
+
/** The breadcrumb's separator. */
|
|
166
|
+
function Crumb() {
|
|
167
|
+
return /* @__PURE__ */ jsx("span", {
|
|
168
|
+
className: "mx-px text-sm text-[var(--zg-text-subtle)] select-none",
|
|
169
|
+
"aria-hidden": true,
|
|
170
|
+
children: "/"
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/** The session's own branch: a click opens the switcher when the app gives one. */
|
|
174
|
+
function HeaderBranch({ branch, cwd, sessionId, BranchMenu }) {
|
|
175
|
+
const labels = useSessionLabels();
|
|
176
|
+
const ref = useRef(null);
|
|
177
|
+
const [open, setOpen] = useState(false);
|
|
178
|
+
const tip = useTooltip(BranchMenu ? labels.headerSwitchBranch(branch) : labels.headerBranch(branch));
|
|
179
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
180
|
+
/* @__PURE__ */ jsxs("button", {
|
|
181
|
+
...tip.anchorProps,
|
|
182
|
+
ref,
|
|
183
|
+
type: "button",
|
|
184
|
+
disabled: !BranchMenu,
|
|
185
|
+
onClick: () => setOpen((v) => !v),
|
|
186
|
+
"aria-haspopup": BranchMenu ? "menu" : void 0,
|
|
187
|
+
"aria-expanded": BranchMenu ? open : void 0,
|
|
188
|
+
"data-testid": "session-branch",
|
|
189
|
+
className: "zg-press-soft zg-no-drag min-w-0 max-w-[180px] shrink-[2] inline-flex items-center gap-1 bg-transparent border-0 px-1.5 py-1 -mx-1.5 rounded-zg-sm text-[var(--zg-text-muted)] transition-colors disabled:cursor-default enabled:cursor-pointer enabled:hover:before:bg-[var(--zg-row-hover)] enabled:hover:text-[var(--zg-text)]",
|
|
190
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
191
|
+
"aria-hidden": true,
|
|
192
|
+
className: "i-ph-git-branch text-sm shrink-0"
|
|
193
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
194
|
+
dir: "auto",
|
|
195
|
+
className: "font-mono text-sm tabular-nums truncate",
|
|
196
|
+
children: branch
|
|
197
|
+
})]
|
|
198
|
+
}),
|
|
199
|
+
tip.tip,
|
|
200
|
+
BranchMenu && /* @__PURE__ */ jsx(BranchMenu, {
|
|
201
|
+
open,
|
|
202
|
+
anchorRef: ref,
|
|
203
|
+
cwd,
|
|
204
|
+
sessionId,
|
|
205
|
+
current: branch,
|
|
206
|
+
onClose: () => setOpen(false),
|
|
207
|
+
onSwitched: () => setOpen(false)
|
|
208
|
+
})
|
|
209
|
+
] });
|
|
210
|
+
}
|
|
155
211
|
/** "From <view title>: <key>": the view opens the view, the key opens the row's link. */
|
|
156
212
|
function HeaderOrigin({ origin }) {
|
|
157
213
|
const labels = useSessionLabels();
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The header's cube: where a session runs when that is not this machine's folders (a sandbox, another
|
|
3
|
+
* machine, a saved server), and how it is doing. It is the daemon's orb (`StatusOrb`) as a cube: calm when ready, an arc
|
|
4
|
+
* while it sets up or connects, red when setup failed or the server is unreachable, dimmed while paused.
|
|
5
|
+
*
|
|
6
|
+
* A click opens its menu: what and where it is, the setup steps while it sets up, the server and its
|
|
7
|
+
* connection, then Wake up while it is up or paused (when the host can: it starts a paused one, and checks one
|
|
8
|
+
* that should be up, which its provider may have paused on its own), Pause while a sandbox is up (when the host
|
|
9
|
+
* can), the environment's own actions (loaded while the menu shows), Retry setup after a failure (Set up now once
|
|
10
|
+
* its sandbox was deleted), Delete sandbox (when the host can: the session stays, its next prompt sets up a new
|
|
11
|
+
* one), and Copy details last. Its rows carry no icons. Under the kind and state, the branch and the sandbox id
|
|
12
|
+
* copy themselves on click. Renders nothing for a session in a local folder or a worktree here.
|
|
13
|
+
*/
|
|
14
|
+
import { HostView } from "../chat/headless/hosts.js";
|
|
15
|
+
import { CSSProperties } from "react";
|
|
16
|
+
import { SessionEnvironmentSummary } from "zidane/chat";
|
|
17
|
+
/** Props for {@link SessionPlaceMenu}. */
|
|
18
|
+
export interface SessionPlaceMenuProps {
|
|
19
|
+
/** The session, for its environment's actions. */
|
|
20
|
+
sessionId: string;
|
|
21
|
+
/** Its environment. The dot shows for one outside this machine's folders (`isExternalEnvironment`). */
|
|
22
|
+
environment?: SessionEnvironmentSummary;
|
|
23
|
+
/** Its server: the host, `null` once it is no longer saved. Absent: a session on this computer. */
|
|
24
|
+
server?: HostView | null;
|
|
25
|
+
/** Extra classes on the trigger. */
|
|
26
|
+
className?: string;
|
|
27
|
+
/** Inline styles on the trigger. */
|
|
28
|
+
style?: CSSProperties;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Renders the dot and its menu, or nothing for a session in this machine's folders.
|
|
32
|
+
*
|
|
33
|
+
* @param props - The session, its environment and server, `className` and `style`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function SessionPlaceMenu({ environment, server, ...rest }: SessionPlaceMenuProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { useOptionalConfirm } from "../app/useConfirm.js";
|
|
2
|
+
import { StatusOrb } from "../chat/DaemonOrb.js";
|
|
3
|
+
import { hostStatusLabel } from "../chat/headless/hosts.js";
|
|
4
|
+
import { environmentKindLabel, runsInRemoteSandbox } from "../chat/headless/sidebar/environment.js";
|
|
5
|
+
import { useEnvironmentActions, useEnvironmentCommands } from "../chat/sidebar/session-menu.js";
|
|
6
|
+
import { useSidebarNotice } from "../chat/sidebar/SidebarHostProvider.js";
|
|
7
|
+
import { useSidebarLabels } from "../chat/sidebar/useSidebarLabels.js";
|
|
8
|
+
import { useChatLabels } from "../chat/useChatLabels.js";
|
|
9
|
+
import { CopyValue } from "../components/CopyValue.js";
|
|
10
|
+
import { Popover } from "../components/floating/Popover.js";
|
|
11
|
+
import { iconButtonClass } from "../components/IconButton.js";
|
|
12
|
+
import { Menu, MenuRow, MenuSection } from "../components/Menu.js";
|
|
13
|
+
import { Tooltip } from "../components/Tooltip.js";
|
|
14
|
+
import { environmentStateLabel, isExternalEnvironment, sessionPlaceTone } from "./headless/place.js";
|
|
15
|
+
import { useSessionLabels } from "./useSessionLabels.js";
|
|
16
|
+
import { useState } from "react";
|
|
17
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
// src/session/SessionPlaceMenu.tsx
|
|
19
|
+
const ORB = {
|
|
20
|
+
ready: "idle",
|
|
21
|
+
busy: "connecting",
|
|
22
|
+
reconnecting: "connecting",
|
|
23
|
+
failed: "down",
|
|
24
|
+
resuming: "connecting",
|
|
25
|
+
paused: "idle",
|
|
26
|
+
removed: "idle"
|
|
27
|
+
};
|
|
28
|
+
/** Dimmed while there is nothing running: paused, or its sandbox deleted. */
|
|
29
|
+
const dimmed = (tone) => tone === "paused" || tone === "removed" ? "opacity-50" : void 0;
|
|
30
|
+
/**
|
|
31
|
+
* Renders the dot and its menu, or nothing for a session in this machine's folders.
|
|
32
|
+
*
|
|
33
|
+
* @param props - The session, its environment and server, `className` and `style`.
|
|
34
|
+
*/
|
|
35
|
+
function SessionPlaceMenu({ environment, server, ...rest }) {
|
|
36
|
+
const external = isExternalEnvironment(environment) ? environment : void 0;
|
|
37
|
+
if (!external && server === void 0) return null;
|
|
38
|
+
return /* @__PURE__ */ jsx(PlaceMenu, {
|
|
39
|
+
...rest,
|
|
40
|
+
environment: external,
|
|
41
|
+
server
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function PlaceMenu({ sessionId, environment, server, className = "", style }) {
|
|
45
|
+
const labels = useSessionLabels();
|
|
46
|
+
const sidebarLabels = useSidebarLabels();
|
|
47
|
+
const chatLabels = useChatLabels();
|
|
48
|
+
const notify = useSidebarNotice();
|
|
49
|
+
const commands = useEnvironmentCommands();
|
|
50
|
+
const confirm = useOptionalConfirm();
|
|
51
|
+
const [open, setOpen] = useState(false);
|
|
52
|
+
const actions = useEnvironmentActions(sessionId, open && environment?.state === "ready");
|
|
53
|
+
const tone = sessionPlaceTone(environment, server);
|
|
54
|
+
const serverName = server ? server.name : labels.placeServerGone;
|
|
55
|
+
const where = environment ? environmentKindLabel(environment.kind, sidebarLabels) : labels.placeOnServer(serverName);
|
|
56
|
+
const state = environment ? environmentStateLabel(labels, environment, sessionPlaceTone(environment, void 0)) : labels.placeServerTones[tone];
|
|
57
|
+
const step = environment?.progress?.step;
|
|
58
|
+
const steps = environment?.state === "provisioning" || environment?.state === "failed" ? environment.progress?.steps ?? [] : [];
|
|
59
|
+
const stepAt = steps.findIndex((s) => s.id === step);
|
|
60
|
+
const copy = (close) => {
|
|
61
|
+
const details = {
|
|
62
|
+
...environment ? { environment: {
|
|
63
|
+
kind: environment.kind,
|
|
64
|
+
state: environment.state,
|
|
65
|
+
branch: environment.branch,
|
|
66
|
+
sandboxId: environment.sandboxId,
|
|
67
|
+
error: environment.error,
|
|
68
|
+
step,
|
|
69
|
+
suspended: environment.suspended,
|
|
70
|
+
removed: environment.removed
|
|
71
|
+
} } : {},
|
|
72
|
+
...server !== void 0 ? { server: server ? {
|
|
73
|
+
name: server.name,
|
|
74
|
+
status: server.status,
|
|
75
|
+
url: server.url,
|
|
76
|
+
error: server.error
|
|
77
|
+
} : null } : {}
|
|
78
|
+
};
|
|
79
|
+
close();
|
|
80
|
+
navigator.clipboard.writeText(JSON.stringify(details, null, 2)).then(() => notify(labels.placeCopied, "info"));
|
|
81
|
+
};
|
|
82
|
+
return /* @__PURE__ */ jsx(Popover, {
|
|
83
|
+
role: "menu",
|
|
84
|
+
side: "bottom",
|
|
85
|
+
align: "start",
|
|
86
|
+
width: 300,
|
|
87
|
+
ariaLabel: labels.placeMenu,
|
|
88
|
+
onOpenChange: setOpen,
|
|
89
|
+
trigger: (trigger) => /* @__PURE__ */ jsx(Tooltip, {
|
|
90
|
+
label: labels.placeTip(where, state),
|
|
91
|
+
disabled: open,
|
|
92
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
93
|
+
...trigger,
|
|
94
|
+
type: "button",
|
|
95
|
+
"aria-label": labels.placeTip(where, state),
|
|
96
|
+
"data-testid": "session-place",
|
|
97
|
+
"data-tone": tone,
|
|
98
|
+
className: `${iconButtonClass()} zg-no-drag ${className}`.trimEnd(),
|
|
99
|
+
style,
|
|
100
|
+
children: /* @__PURE__ */ jsx(StatusOrb, {
|
|
101
|
+
state: ORB[tone],
|
|
102
|
+
shape: "cube",
|
|
103
|
+
size: 13,
|
|
104
|
+
className: dimmed(tone)
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
}),
|
|
108
|
+
children: (close) => /* @__PURE__ */ jsxs(Menu, {
|
|
109
|
+
"aria-label": labels.placeMenu,
|
|
110
|
+
className: "py-1",
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ jsxs("div", {
|
|
113
|
+
className: "flex items-start gap-2.5 px-3 pt-2 pb-1.5",
|
|
114
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
115
|
+
className: "mt-[3px] shrink-0 inline-flex",
|
|
116
|
+
children: /* @__PURE__ */ jsx(StatusOrb, {
|
|
117
|
+
state: ORB[tone],
|
|
118
|
+
shape: "cube",
|
|
119
|
+
size: 13,
|
|
120
|
+
className: dimmed(tone)
|
|
121
|
+
})
|
|
122
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
123
|
+
className: "min-w-0",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ jsx("div", {
|
|
126
|
+
className: "text-xs font-medium text-[var(--zg-text)] truncate",
|
|
127
|
+
children: where
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ jsxs("div", {
|
|
130
|
+
className: "text-zg-meta leading-zg-meta text-[var(--zg-text-muted)] truncate",
|
|
131
|
+
children: [
|
|
132
|
+
state,
|
|
133
|
+
environment?.suspended && environment.state === "ready" ? ` · ${labels.placeResumes}` : "",
|
|
134
|
+
tone === "removed" ? ` · ${labels.placeRecreates}` : ""
|
|
135
|
+
]
|
|
136
|
+
}),
|
|
137
|
+
environment?.branch && /* @__PURE__ */ jsx(CopyValue, {
|
|
138
|
+
icon: "i-ph-git-branch",
|
|
139
|
+
text: environment.branch,
|
|
140
|
+
label: labels.placeCopyBranch,
|
|
141
|
+
copiedLabel: labels.placeCopiedValue,
|
|
142
|
+
className: "mt-1"
|
|
143
|
+
}),
|
|
144
|
+
environment?.sandboxId && tone !== "removed" && /* @__PURE__ */ jsx(CopyValue, {
|
|
145
|
+
icon: "i-ph-hash",
|
|
146
|
+
text: environment.sandboxId,
|
|
147
|
+
label: labels.placeCopySandboxId,
|
|
148
|
+
copiedLabel: labels.placeCopiedValue,
|
|
149
|
+
className: "mt-1"
|
|
150
|
+
}),
|
|
151
|
+
environment?.state === "failed" && tone !== "removed" && environment.error && /* @__PURE__ */ jsx("div", {
|
|
152
|
+
className: "mt-1 text-zg-meta leading-zg-meta text-[var(--zg-danger)] break-words",
|
|
153
|
+
children: environment.error
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
})]
|
|
157
|
+
}),
|
|
158
|
+
steps.length > 0 && /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(MenuSection, {
|
|
159
|
+
label: labels.placeSetup,
|
|
160
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
161
|
+
className: "list-none m-0 px-3 pb-1 flex flex-col gap-1",
|
|
162
|
+
children: steps.map((s, i) => {
|
|
163
|
+
const icon = environment?.state === "failed" && i === stepAt ? "i-ph-warning-circle text-[var(--zg-danger)]" : i < stepAt ? "i-ph-check text-[var(--zg-text-muted)]" : i === stepAt ? "i-ph-circle-notch animate-spin text-[var(--zg-text)]" : "i-ph-circle text-[var(--zg-text-subtle)]";
|
|
164
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
165
|
+
className: `flex items-center gap-2 text-xs ${i <= stepAt ? "text-[var(--zg-text)]" : "text-[var(--zg-text-muted)]"}`,
|
|
166
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
167
|
+
"aria-hidden": true,
|
|
168
|
+
className: `${icon} text-zg-meta shrink-0`
|
|
169
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
170
|
+
className: "truncate",
|
|
171
|
+
children: s.label
|
|
172
|
+
})]
|
|
173
|
+
}, s.id);
|
|
174
|
+
})
|
|
175
|
+
})
|
|
176
|
+
}) }),
|
|
177
|
+
server !== void 0 && environment && /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(MenuSection, {
|
|
178
|
+
label: labels.placeServer,
|
|
179
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
180
|
+
className: "px-3 pb-1 flex items-center gap-2 min-w-0 text-xs",
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ jsx("span", {
|
|
183
|
+
"aria-hidden": true,
|
|
184
|
+
className: "i-ph-hard-drives text-zg-meta text-[var(--zg-text-muted)] shrink-0"
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ jsx("span", {
|
|
187
|
+
className: "truncate text-[var(--zg-text)]",
|
|
188
|
+
children: serverName
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ jsx("span", {
|
|
191
|
+
className: "shrink-0 text-[var(--zg-text-muted)]",
|
|
192
|
+
children: server ? hostStatusLabel(server, chatLabels) : labels.placeServerGoneDetail
|
|
193
|
+
})
|
|
194
|
+
]
|
|
195
|
+
})
|
|
196
|
+
}) }),
|
|
197
|
+
server !== void 0 && !environment && (server?.url || server?.error || server === null) && /* @__PURE__ */ jsxs("div", {
|
|
198
|
+
className: "px-3 pb-1.5 -mt-1 flex flex-col gap-0.5 min-w-0 pl-[34px]",
|
|
199
|
+
children: [
|
|
200
|
+
server?.url && /* @__PURE__ */ jsx("span", {
|
|
201
|
+
className: "zg-meta truncate",
|
|
202
|
+
children: server.url
|
|
203
|
+
}),
|
|
204
|
+
server?.error && /* @__PURE__ */ jsx("span", {
|
|
205
|
+
className: "text-zg-meta leading-zg-meta text-[var(--zg-danger)] break-words",
|
|
206
|
+
children: server.error
|
|
207
|
+
}),
|
|
208
|
+
server === null && /* @__PURE__ */ jsx("span", {
|
|
209
|
+
className: "text-zg-meta leading-zg-meta text-[var(--zg-text-muted)]",
|
|
210
|
+
children: labels.placeServerGoneDetail
|
|
211
|
+
})
|
|
212
|
+
]
|
|
213
|
+
}),
|
|
214
|
+
/* @__PURE__ */ jsxs(MenuSection, {
|
|
215
|
+
label: labels.placeActions,
|
|
216
|
+
children: [
|
|
217
|
+
(tone === "paused" || tone === "ready") && environment && commands.wake && /* @__PURE__ */ jsx(MenuRow, {
|
|
218
|
+
role: "menuitem",
|
|
219
|
+
size: "lg",
|
|
220
|
+
title: labels.placeWake,
|
|
221
|
+
description: /* @__PURE__ */ jsx("span", {
|
|
222
|
+
className: "block truncate",
|
|
223
|
+
children: tone === "paused" ? labels.placeWakeHint : labels.placeWakeReadyHint
|
|
224
|
+
}),
|
|
225
|
+
onClick: () => {
|
|
226
|
+
close();
|
|
227
|
+
commands.wake?.(sessionId);
|
|
228
|
+
}
|
|
229
|
+
}),
|
|
230
|
+
tone === "ready" && environment && runsInRemoteSandbox(environment) && commands.pause && /* @__PURE__ */ jsx(MenuRow, {
|
|
231
|
+
role: "menuitem",
|
|
232
|
+
size: "lg",
|
|
233
|
+
title: labels.placePause,
|
|
234
|
+
description: /* @__PURE__ */ jsx("span", {
|
|
235
|
+
className: "block truncate",
|
|
236
|
+
children: labels.placePauseHint
|
|
237
|
+
}),
|
|
238
|
+
onClick: () => {
|
|
239
|
+
close();
|
|
240
|
+
commands.pause?.(sessionId);
|
|
241
|
+
}
|
|
242
|
+
}),
|
|
243
|
+
actions.map((action) => /* @__PURE__ */ jsx(MenuRow, {
|
|
244
|
+
role: "menuitem",
|
|
245
|
+
size: "lg",
|
|
246
|
+
title: action.label,
|
|
247
|
+
...action.description ? { description: /* @__PURE__ */ jsx("span", {
|
|
248
|
+
className: "block truncate",
|
|
249
|
+
children: action.description
|
|
250
|
+
}) } : {},
|
|
251
|
+
onClick: () => {
|
|
252
|
+
close();
|
|
253
|
+
commands.run(sessionId, action.id, action.label);
|
|
254
|
+
}
|
|
255
|
+
}, action.id)),
|
|
256
|
+
environment?.state === "failed" && /* @__PURE__ */ jsx(MenuRow, {
|
|
257
|
+
role: "menuitem",
|
|
258
|
+
size: "lg",
|
|
259
|
+
title: tone === "removed" ? labels.placeRecreate : environment.failure ? labels.placeRetryBroken[environment.failure].title : labels.placeRetry,
|
|
260
|
+
description: /* @__PURE__ */ jsx("span", {
|
|
261
|
+
className: "block truncate",
|
|
262
|
+
children: tone === "removed" ? labels.placeRecreateHint : environment.failure === "lost" && runsInRemoteSandbox(environment) ? labels.placeRetryLostSandboxHint : environment.failure ? labels.placeRetryBroken[environment.failure].hint : labels.placeRetryHint
|
|
263
|
+
}),
|
|
264
|
+
onClick: () => {
|
|
265
|
+
close();
|
|
266
|
+
commands.retry(sessionId);
|
|
267
|
+
}
|
|
268
|
+
}),
|
|
269
|
+
(tone === "ready" || tone === "paused") && environment && runsInRemoteSandbox(environment) && commands.remove && confirm && /* @__PURE__ */ jsx(MenuRow, {
|
|
270
|
+
role: "menuitem",
|
|
271
|
+
size: "lg",
|
|
272
|
+
destructive: true,
|
|
273
|
+
title: labels.placeDelete,
|
|
274
|
+
description: /* @__PURE__ */ jsx("span", {
|
|
275
|
+
className: "block truncate",
|
|
276
|
+
children: labels.placeDeleteHint
|
|
277
|
+
}),
|
|
278
|
+
onClick: () => {
|
|
279
|
+
close();
|
|
280
|
+
confirm({
|
|
281
|
+
title: labels.placeDeleteConfirmTitle,
|
|
282
|
+
message: labels.placeDeleteConfirmMessage,
|
|
283
|
+
confirmLabel: labels.placeDeleteConfirm,
|
|
284
|
+
destructive: true
|
|
285
|
+
}).then((ok) => ok ? commands.remove?.(sessionId) : void 0);
|
|
286
|
+
}
|
|
287
|
+
}),
|
|
288
|
+
/* @__PURE__ */ jsx(MenuRow, {
|
|
289
|
+
role: "menuitem",
|
|
290
|
+
title: labels.placeCopy,
|
|
291
|
+
onClick: () => copy(close)
|
|
292
|
+
})
|
|
293
|
+
]
|
|
294
|
+
})
|
|
295
|
+
]
|
|
296
|
+
})
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
export { SessionPlaceMenu };
|
|
@@ -26,7 +26,7 @@ function SessionShell({ title, description, onClose, footer, children, className
|
|
|
26
26
|
className: "text-sm font-semibold text-[var(--zg-text)] m-0 zg-balance",
|
|
27
27
|
children: title
|
|
28
28
|
}), description && /* @__PURE__ */ jsx("p", {
|
|
29
|
-
className: "text-xs text-[var(--zg-text-muted)] mt-0.5 m-0
|
|
29
|
+
className: "text-xs text-[var(--zg-text-muted)] mt-0.5 m-0",
|
|
30
30
|
children: description
|
|
31
31
|
})]
|
|
32
32
|
}), onClose && /* @__PURE__ */ jsx(IconButton, {
|
|
@@ -198,7 +198,7 @@ function TurnDetailsDialog({ sessionId, turnId, running = false, neighbors = nul
|
|
|
198
198
|
autoFocus: true
|
|
199
199
|
}) : preview && /* @__PURE__ */ jsx(CodePanel, {
|
|
200
200
|
maxHeight: 160,
|
|
201
|
-
className: "p-3 text-[var(--zg-text-muted)]
|
|
201
|
+
className: "p-3 text-[var(--zg-text-muted)]",
|
|
202
202
|
children: preview
|
|
203
203
|
})
|
|
204
204
|
]
|
|
@@ -4,6 +4,7 @@ import { EMPTY_HOME_PREFS, HOME_BLOCK_NAME_MAX, HomeBlock, HomeBlockSource, Home
|
|
|
4
4
|
import { ActivePlanSummary, PlanControlAction, PlanEditOp, PlanStep, PlanView, PlansSnapshot, PromptAttachment, QueueAddDelivery, QueueAddOptions, QueuePushDelivery, QueuedAttachment, QueuedMessage, RunningWorkItem, Schedule, ScheduleFire, ScheduleInput, SchedulePatch, SchedulesStatus, SessionArtifact, SessionArtifactGroup, SessionArtifactRow, SessionArtifactRowView, SessionArtifacts, SessionCacheReport, SessionDetailsActions, SessionExportFormat, SessionHost, SessionPlans, SessionQueue, SessionRunningWork, SessionSchedules, SessionSecretEntry, SessionSecretInput, SessionSecrets, SessionSideChats, SessionTurn, SessionTurns, SessionUsage, SideChatLookup, SideChatSession, TodoItem } from "./host.js";
|
|
5
5
|
import { KeyedState, createKeyedState } from "./keyed.js";
|
|
6
6
|
import { DEFAULT_SESSION_LABELS, SessionLabels } from "./labels.js";
|
|
7
|
+
import { SessionPlaceTone, environmentStateLabel, isExternalEnvironment, isReconnecting, sessionPlaceTone } from "./place.js";
|
|
7
8
|
import { InboxPlans, PlansState, TodoTallyCounts, createPlansState, displayedPlan, inboxPlans, planTally } from "./plans.js";
|
|
8
9
|
import { QueueBackend, QueueState, createQueueState, toQueuedMessages } from "./queue.js";
|
|
9
10
|
import { StagedAttachment, attachmentsKey, stagedToWire, wireToStaged } from "./queue-attachments.js";
|
|
@@ -15,4 +16,4 @@ import { SessionDiffEntry, SessionEditEvent, collectSessionDiffs, fileDiffCounts
|
|
|
15
16
|
import { SideRefusal, SideRequests, createSideRequests, parseSideCommand } from "./side.js";
|
|
16
17
|
import { ProviderResetCredit, ProviderResetOutcome, ProviderResetTarget, ProviderUsageSnapshot, ProviderUsageSource, ProviderUsageState, ProviderUsageView, USAGE_RANGES, USAGE_SNAPSHOT_KEY, UsageHeatmapDay, UsageModelDayPoint, UsageModelRow, UsageProviderRow, UsageRange, UsageSummaries, UsageSummary, UsageSummaryState, UsageSummaryStateOptions, createProviderUsageState, createUsageSummaryState, isUsageSummary, pickUsageSummary } from "./usage.js";
|
|
17
18
|
import { formatTokens, localDayString } from "./usage-format.js";
|
|
18
|
-
export { type ActivePlanSummary, ArtifactsState, DEFAULT_SESSION_LABELS, DiffListFile, DiffTreeDir, DiffTreeFile, DiffTreeNode, EMPTY_HOME_PREFS, HOME_BLOCK_NAME_MAX, HomeBlock, HomeBlockSource, HomePrefs, HomeRow, InboxPlans, KeyedState, PlanControlAction, type PlanEditOp, type PlanStep, type PlanView, type PlansSnapshot, PlansState, type PromptAttachment, type ProviderResetCredit, type ProviderResetOutcome, ProviderResetTarget, type ProviderUsageSnapshot, ProviderUsageSource, ProviderUsageState, ProviderUsageView, QueueAddDelivery, QueueAddOptions, QueueBackend, QueuePushDelivery, QueueState, type QueuedAttachment, QueuedMessage, ReminderWhen, RemindersSummary, type RunningWorkItem, RunningWorkState, type Schedule, type ScheduleFire, type ScheduleInput, type SchedulePatch, SchedulesBackend, SchedulesState, SchedulesStatus, SecretsState, SessionActionName, SessionActionTarget, SessionActions, SessionActionsDeps, type SessionArtifact, SessionArtifactGroup, SessionArtifactRow, SessionArtifactRowView, SessionArtifacts, SessionCacheReport, SessionConfirmOptions, SessionDetailsActions, SessionDiffEntry, SessionEditEvent, SessionExportFormat, SessionHost, SessionLabels, SessionPlans, SessionQueue, SessionRunningWork, SessionSchedules, SessionSecretEntry, SessionSecretInput, SessionSecrets, SessionSideChats, type SessionTurn, SessionTurns, SessionUsage, SideChatLookup, SideChatSession, SideRefusal, SideRequests, StagedAttachment, type TodoItem, TodoTallyCounts, USAGE_RANGES, USAGE_SNAPSHOT_KEY, UsageHeatmapDay, UsageModelDayPoint, UsageModelRow, UsageProviderRow, UsageRange, UsageSummaries, UsageSummary, UsageSummaryState, UsageSummaryStateOptions, addHomeBlockCopy, arrangeHomeBlocks, attachmentsKey, buildDiffTree, canKeepSchedule, collectSessionDiffs, countArtifacts, createArtifactsState, createKeyedState, createPlansState, createProviderUsageState, createQueueState, createRunningWorkState, createSchedulesState, createSecretsState, createSessionActions, createSideRequests, createUsageSummaryState, displayedPlan, duplicateHomeBlock, fileDiffCounts, fileOrder, formatTokens, groupArtifactRows, groupByPath, hideHomeBlock, homeBlocksOf, homeRows, inboxPlans, isScheduleFinished, isUsageSummary, localDayString, moveHomeBlock, parseHomePrefs, parseSideCommand, pickUsageSummary, placeHomeBlock, plainArtifactRow, planTally, readReminderWhen, relativeTo, remindersSummary, removeHomeBlock, renameHomeBlock, sameRunningWork, sessionKeyCommands, setHomeBlockIcon, setHomeBlockView, setHomeBlockWidth, showHomeBlock, sortSchedules, sortSecrets, stagedToWire, toQueuedMessages, upcomingSchedules, visibleRows, wireToStaged };
|
|
19
|
+
export { type ActivePlanSummary, ArtifactsState, DEFAULT_SESSION_LABELS, DiffListFile, DiffTreeDir, DiffTreeFile, DiffTreeNode, EMPTY_HOME_PREFS, HOME_BLOCK_NAME_MAX, HomeBlock, HomeBlockSource, HomePrefs, HomeRow, InboxPlans, KeyedState, PlanControlAction, type PlanEditOp, type PlanStep, type PlanView, type PlansSnapshot, PlansState, type PromptAttachment, type ProviderResetCredit, type ProviderResetOutcome, ProviderResetTarget, type ProviderUsageSnapshot, ProviderUsageSource, ProviderUsageState, ProviderUsageView, QueueAddDelivery, QueueAddOptions, QueueBackend, QueuePushDelivery, QueueState, type QueuedAttachment, QueuedMessage, ReminderWhen, RemindersSummary, type RunningWorkItem, RunningWorkState, type Schedule, type ScheduleFire, type ScheduleInput, type SchedulePatch, SchedulesBackend, SchedulesState, SchedulesStatus, SecretsState, SessionActionName, SessionActionTarget, SessionActions, SessionActionsDeps, type SessionArtifact, SessionArtifactGroup, SessionArtifactRow, SessionArtifactRowView, SessionArtifacts, SessionCacheReport, SessionConfirmOptions, SessionDetailsActions, SessionDiffEntry, SessionEditEvent, SessionExportFormat, SessionHost, SessionLabels, SessionPlaceTone, SessionPlans, SessionQueue, SessionRunningWork, SessionSchedules, SessionSecretEntry, SessionSecretInput, SessionSecrets, SessionSideChats, type SessionTurn, SessionTurns, SessionUsage, SideChatLookup, SideChatSession, SideRefusal, SideRequests, StagedAttachment, type TodoItem, TodoTallyCounts, USAGE_RANGES, USAGE_SNAPSHOT_KEY, UsageHeatmapDay, UsageModelDayPoint, UsageModelRow, UsageProviderRow, UsageRange, UsageSummaries, UsageSummary, UsageSummaryState, UsageSummaryStateOptions, addHomeBlockCopy, arrangeHomeBlocks, attachmentsKey, buildDiffTree, canKeepSchedule, collectSessionDiffs, countArtifacts, createArtifactsState, createKeyedState, createPlansState, createProviderUsageState, createQueueState, createRunningWorkState, createSchedulesState, createSecretsState, createSessionActions, createSideRequests, createUsageSummaryState, displayedPlan, duplicateHomeBlock, environmentStateLabel, fileDiffCounts, fileOrder, formatTokens, groupArtifactRows, groupByPath, hideHomeBlock, homeBlocksOf, homeRows, inboxPlans, isExternalEnvironment, isReconnecting, isScheduleFinished, isUsageSummary, localDayString, moveHomeBlock, parseHomePrefs, parseSideCommand, pickUsageSummary, placeHomeBlock, plainArtifactRow, planTally, readReminderWhen, relativeTo, remindersSummary, removeHomeBlock, renameHomeBlock, sameRunningWork, sessionKeyCommands, sessionPlaceTone, setHomeBlockIcon, setHomeBlockView, setHomeBlockWidth, showHomeBlock, sortSchedules, sortSecrets, stagedToWire, toQueuedMessages, upcomingSchedules, visibleRows, wireToStaged };
|
|
@@ -3,6 +3,7 @@ import { buildDiffTree, fileOrder, relativeTo, visibleRows } from "./diff-tree.j
|
|
|
3
3
|
import { EMPTY_HOME_PREFS, HOME_BLOCK_NAME_MAX, addHomeBlockCopy, arrangeHomeBlocks, duplicateHomeBlock, hideHomeBlock, homeBlocksOf, homeRows, moveHomeBlock, parseHomePrefs, placeHomeBlock, removeHomeBlock, renameHomeBlock, setHomeBlockIcon, setHomeBlockView, setHomeBlockWidth, showHomeBlock } from "./home-layout.js";
|
|
4
4
|
import { createKeyedState } from "./keyed.js";
|
|
5
5
|
import { DEFAULT_SESSION_LABELS } from "./labels.js";
|
|
6
|
+
import { environmentStateLabel, isExternalEnvironment, isReconnecting, sessionPlaceTone } from "./place.js";
|
|
6
7
|
import { createPlansState, displayedPlan, inboxPlans, planTally } from "./plans.js";
|
|
7
8
|
import { createQueueState, toQueuedMessages } from "./queue.js";
|
|
8
9
|
import { attachmentsKey, stagedToWire, wireToStaged } from "./queue-attachments.js";
|
|
@@ -14,4 +15,4 @@ import { collectSessionDiffs, fileDiffCounts, groupByPath } from "./session-diff
|
|
|
14
15
|
import { createSideRequests, parseSideCommand } from "./side.js";
|
|
15
16
|
import { USAGE_RANGES, USAGE_SNAPSHOT_KEY, createProviderUsageState, createUsageSummaryState, isUsageSummary, pickUsageSummary } from "./usage.js";
|
|
16
17
|
import { formatTokens, localDayString } from "./usage-format.js";
|
|
17
|
-
export { DEFAULT_SESSION_LABELS, EMPTY_HOME_PREFS, HOME_BLOCK_NAME_MAX, USAGE_RANGES, USAGE_SNAPSHOT_KEY, addHomeBlockCopy, arrangeHomeBlocks, attachmentsKey, buildDiffTree, canKeepSchedule, collectSessionDiffs, countArtifacts, createArtifactsState, createKeyedState, createPlansState, createProviderUsageState, createQueueState, createRunningWorkState, createSchedulesState, createSecretsState, createSessionActions, createSideRequests, createUsageSummaryState, displayedPlan, duplicateHomeBlock, fileDiffCounts, fileOrder, formatTokens, groupArtifactRows, groupByPath, hideHomeBlock, homeBlocksOf, homeRows, inboxPlans, isScheduleFinished, isUsageSummary, localDayString, moveHomeBlock, parseHomePrefs, parseSideCommand, pickUsageSummary, placeHomeBlock, plainArtifactRow, planTally, readReminderWhen, relativeTo, remindersSummary, removeHomeBlock, renameHomeBlock, sameRunningWork, sessionKeyCommands, setHomeBlockIcon, setHomeBlockView, setHomeBlockWidth, showHomeBlock, sortSchedules, sortSecrets, stagedToWire, toQueuedMessages, upcomingSchedules, visibleRows, wireToStaged };
|
|
18
|
+
export { DEFAULT_SESSION_LABELS, EMPTY_HOME_PREFS, HOME_BLOCK_NAME_MAX, USAGE_RANGES, USAGE_SNAPSHOT_KEY, addHomeBlockCopy, arrangeHomeBlocks, attachmentsKey, buildDiffTree, canKeepSchedule, collectSessionDiffs, countArtifacts, createArtifactsState, createKeyedState, createPlansState, createProviderUsageState, createQueueState, createRunningWorkState, createSchedulesState, createSecretsState, createSessionActions, createSideRequests, createUsageSummaryState, displayedPlan, duplicateHomeBlock, environmentStateLabel, fileDiffCounts, fileOrder, formatTokens, groupArtifactRows, groupByPath, hideHomeBlock, homeBlocksOf, homeRows, inboxPlans, isExternalEnvironment, isReconnecting, isScheduleFinished, isUsageSummary, localDayString, moveHomeBlock, parseHomePrefs, parseSideCommand, pickUsageSummary, placeHomeBlock, plainArtifactRow, planTally, readReminderWhen, relativeTo, remindersSummary, removeHomeBlock, renameHomeBlock, sameRunningWork, sessionKeyCommands, sessionPlaceTone, setHomeBlockIcon, setHomeBlockView, setHomeBlockWidth, showHomeBlock, sortSchedules, sortSecrets, stagedToWire, toQueuedMessages, upcomingSchedules, visibleRows, wireToStaged };
|
|
@@ -244,7 +244,80 @@ export declare const DEFAULT_SESSION_LABELS: {
|
|
|
244
244
|
headerChangeFolder: (cwd: string) => string;
|
|
245
245
|
headerServerGone: string;
|
|
246
246
|
headerOnServer: (server: string | null) => string;
|
|
247
|
+
headerBranch: (branch: string) => string;
|
|
248
|
+
headerSwitchBranch: (branch: string) => string;
|
|
247
249
|
headerRename: string;
|
|
250
|
+
placeMenu: string;
|
|
251
|
+
placeTones: {
|
|
252
|
+
ready: string;
|
|
253
|
+
busy: string;
|
|
254
|
+
reconnecting: string;
|
|
255
|
+
failed: string;
|
|
256
|
+
resuming: string;
|
|
257
|
+
paused: string;
|
|
258
|
+
removed: string;
|
|
259
|
+
};
|
|
260
|
+
placeServerTones: {
|
|
261
|
+
ready: string;
|
|
262
|
+
busy: string;
|
|
263
|
+
reconnecting: string;
|
|
264
|
+
failed: string;
|
|
265
|
+
resuming: string;
|
|
266
|
+
paused: string;
|
|
267
|
+
removed: string;
|
|
268
|
+
};
|
|
269
|
+
/** The state of an environment that broke after setup (`failure`), in place of `placeTones.failed`. */
|
|
270
|
+
placeBroken: {
|
|
271
|
+
lost: string;
|
|
272
|
+
unreachable: string;
|
|
273
|
+
};
|
|
274
|
+
placeTip: (where: string, state: string) => string;
|
|
275
|
+
placeResumes: string;
|
|
276
|
+
/** After `placeTones.removed`: when the new sandbox comes. */
|
|
277
|
+
placeRecreates: string;
|
|
278
|
+
/** Copies a detail line (the branch, the sandbox id). */
|
|
279
|
+
placeCopyBranch: string;
|
|
280
|
+
placeCopySandboxId: string;
|
|
281
|
+
placeCopiedValue: string;
|
|
282
|
+
placeOnServer: (server: string) => string;
|
|
283
|
+
placeServerGone: string;
|
|
284
|
+
placeServerGoneDetail: string;
|
|
285
|
+
placeSetup: string;
|
|
286
|
+
placeServer: string;
|
|
287
|
+
placeActions: string;
|
|
288
|
+
placeRetry: string;
|
|
289
|
+
placeRetryHint: string;
|
|
290
|
+
/** The retry of an environment that broke after setup, by how it broke. */
|
|
291
|
+
placeRetryBroken: {
|
|
292
|
+
lost: {
|
|
293
|
+
title: string;
|
|
294
|
+
hint: string;
|
|
295
|
+
};
|
|
296
|
+
unreachable: {
|
|
297
|
+
title: string;
|
|
298
|
+
hint: string;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
/** `placeRetryBroken.lost`'s hint for a remote sandbox, which held the only copy of the work. */
|
|
302
|
+
placeRetryLostSandboxHint: string;
|
|
303
|
+
/** Starts a paused environment now. */
|
|
304
|
+
placeWake: string;
|
|
305
|
+
placeWakeHint: string;
|
|
306
|
+
placeWakeReadyHint: string;
|
|
307
|
+
/** Pauses an idle sandbox now. */
|
|
308
|
+
placePause: string;
|
|
309
|
+
placePauseHint: string;
|
|
310
|
+
/** Deletes the sandbox and keeps the session (after a confirmation). */
|
|
311
|
+
placeDelete: string;
|
|
312
|
+
placeDeleteHint: string;
|
|
313
|
+
placeDeleteConfirmTitle: string;
|
|
314
|
+
placeDeleteConfirmMessage: string;
|
|
315
|
+
placeDeleteConfirm: string;
|
|
316
|
+
/** The retry of a deleted sandbox: set the new one up now. */
|
|
317
|
+
placeRecreate: string;
|
|
318
|
+
placeRecreateHint: string;
|
|
319
|
+
placeCopy: string;
|
|
320
|
+
placeCopied: string;
|
|
248
321
|
headerDetails: string;
|
|
249
322
|
detailsTitle: string;
|
|
250
323
|
detailsMainDescription: string;
|