zidane-ui 9.2.2 → 9.2.3

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.
Files changed (207) hide show
  1. package/dist/adapters/browser-keybindings-host.js +3 -1
  2. package/dist/adapters/server-settings-host.js +30 -3
  3. package/dist/adapters/server-settings-sections.js +23 -1
  4. package/dist/adapters/server-sidebar-host.d.ts +3 -1
  5. package/dist/adapters/server-sidebar-host.js +10 -1
  6. package/dist/app/ModalProvider.js +1 -1
  7. package/dist/approvals/ApprovalShell.js +1 -1
  8. package/dist/chat/DaemonOrb.d.ts +29 -1
  9. package/dist/chat/DaemonOrb.js +25 -12
  10. package/dist/chat/StatusDot.js +8 -2
  11. package/dist/chat/Transcript.js +11 -4
  12. package/dist/chat/headless/index.d.ts +3 -2
  13. package/dist/chat/headless/index.js +11 -10
  14. package/dist/chat/headless/labels.d.ts +13 -0
  15. package/dist/chat/headless/labels.js +12 -0
  16. package/dist/chat/headless/session-list.d.ts +10 -0
  17. package/dist/chat/headless/sidebar/directory.d.ts +8 -1
  18. package/dist/chat/headless/sidebar/directory.js +40 -4
  19. package/dist/chat/headless/sidebar/environment.d.ts +5 -2
  20. package/dist/chat/headless/sidebar/environment.js +11 -2
  21. package/dist/chat/headless/sidebar/host.d.ts +15 -0
  22. package/dist/chat/headless/sidebar/inbox.d.ts +12 -3
  23. package/dist/chat/headless/sidebar/inbox.js +18 -9
  24. package/dist/chat/headless/sidebar/index.d.ts +2 -2
  25. package/dist/chat/headless/sidebar/index.js +2 -2
  26. package/dist/chat/headless/sidebar/labels.d.ts +28 -2
  27. package/dist/chat/headless/sidebar/labels.js +16 -0
  28. package/dist/chat/headless/transcript/fold-actions.d.ts +8 -3
  29. package/dist/chat/headless/transcript/fold-actions.js +16 -0
  30. package/dist/chat/headless/transcript/fold.d.ts +2 -1
  31. package/dist/chat/headless/transcript/fold.js +22 -2
  32. package/dist/chat/headless/transcript/index.d.ts +2 -1
  33. package/dist/chat/headless/transcript/index.js +2 -1
  34. package/dist/chat/headless/transcript/rail.d.ts +93 -0
  35. package/dist/chat/headless/transcript/rail.js +148 -0
  36. package/dist/chat/headless/transcript/rows.d.ts +6 -0
  37. package/dist/chat/headless/transcript/run-failures.d.ts +4 -0
  38. package/dist/chat/headless/transcript/run-failures.js +29 -1
  39. package/dist/chat/headless/transcript-labels.d.ts +1 -0
  40. package/dist/chat/headless/turn-labels.d.ts +1 -0
  41. package/dist/chat/headless/turn-labels.js +2 -1
  42. package/dist/chat/index.d.ts +4 -3
  43. package/dist/chat/index.js +14 -13
  44. package/dist/chat/interactions/ElicitationCard.js +1 -1
  45. package/dist/chat/interactions/InteractionCard.js +1 -1
  46. package/dist/chat/interactions/PlanCard.js +3 -3
  47. package/dist/chat/interactions/QuestionField.js +4 -4
  48. package/dist/chat/interactions/QuestionForm.js +3 -3
  49. package/dist/chat/interactions/SecretInput.js +1 -1
  50. package/dist/chat/sidebar/ProjectIcon.d.ts +1 -1
  51. package/dist/chat/sidebar/ProjectIcon.js +1 -1
  52. package/dist/chat/sidebar/RowChips.d.ts +3 -2
  53. package/dist/chat/sidebar/RowChips.js +6 -3
  54. package/dist/chat/sidebar/SessionSidebar.js +13 -14
  55. package/dist/chat/sidebar/SidebarFrame.d.ts +2 -0
  56. package/dist/chat/sidebar/SidebarFrame.js +5 -2
  57. package/dist/chat/sidebar/SidebarSessionRow.d.ts +3 -1
  58. package/dist/chat/sidebar/SidebarSessionRow.js +3 -1
  59. package/dist/chat/sidebar/SpacesSection.d.ts +20 -1
  60. package/dist/chat/sidebar/SpacesSection.js +34 -13
  61. package/dist/chat/sidebar/index.d.ts +2 -2
  62. package/dist/chat/sidebar/session-menu.d.ts +11 -2
  63. package/dist/chat/sidebar/session-menu.js +50 -5
  64. package/dist/chat/sidebar/sidebar-live.js +1 -1
  65. package/dist/chat/sidebar/useInboxRows.js +43 -2
  66. package/dist/chat/sidebar/useInboxTriage.js +19 -14
  67. package/dist/chat/testing/fixture-sidebar-host.d.ts +7 -1
  68. package/dist/chat/testing/fixture-sidebar-host.js +12 -0
  69. package/dist/chat/testing/sidebar.contract.d.ts +6 -0
  70. package/dist/chat/testing/sidebar.contract.js +24 -0
  71. package/dist/chat/transcript/InteractionToolBody.js +1 -1
  72. package/dist/chat/transcript/SelectCursor.d.ts +11 -1
  73. package/dist/chat/transcript/SelectCursor.js +10 -5
  74. package/dist/chat/transcript/TranscriptRail.d.ts +86 -0
  75. package/dist/chat/transcript/TranscriptRail.js +421 -0
  76. package/dist/chat/transcript/TranscriptRow.js +5 -2
  77. package/dist/chat/transcript/actions.d.ts +6 -2
  78. package/dist/chat/transcript/fold.js +19 -1
  79. package/dist/chat/transcript/index.d.ts +3 -2
  80. package/dist/chat/transcript/index.js +3 -2
  81. package/dist/chat/transcript/notices.d.ts +23 -1
  82. package/dist/chat/transcript/notices.js +108 -27
  83. package/dist/chat/transcript/prose.js +1 -0
  84. package/dist/chat/transcript/receipt-parts.d.ts +22 -0
  85. package/dist/chat/transcript/receipt-parts.js +87 -0
  86. package/dist/chat/transcript/run-rows.js +3 -76
  87. package/dist/chat/transcript/script-input.d.ts +1 -1
  88. package/dist/chat/transcript/scroll-clamp.js +1 -1
  89. package/dist/chat/transcript/useSettledReveal.js +15 -3
  90. package/dist/chat/transcript/useStickToBottom.js +2 -1
  91. package/dist/components/ChoiceCards.js +1 -1
  92. package/dist/components/ConfirmDialog.js +1 -1
  93. package/dist/components/CopyValue.d.ts +33 -0
  94. package/dist/components/CopyValue.js +54 -0
  95. package/dist/components/Form.js +1 -1
  96. package/dist/components/HowItWorks.js +1 -1
  97. package/dist/components/Menu.js +1 -1
  98. package/dist/components/StepFrame.js +2 -2
  99. package/dist/components/SwatchPicker.js +1 -1
  100. package/dist/components/ToggleCard.js +1 -1
  101. package/dist/components/floating/HoverCard.js +2 -3
  102. package/dist/components/floating/hover-delay.d.ts +4 -0
  103. package/dist/components/floating/hover-delay.js +6 -0
  104. package/dist/core.css +14 -12
  105. package/dist/dist/index-De9AbmxS.d.ts +1 -0
  106. package/dist/dist/{index-Betz0OWq.d.ts → index-E1Z0aPmi.d.ts} +20 -2
  107. package/dist/dist/index.d.ts +5 -5
  108. package/dist/dist/sandbox-CSUihARm.d.ts +2 -0
  109. package/dist/dist/{timeout-CyU7HLyz.d.ts → timeout-CmTx6V9y.d.ts} +1 -0
  110. package/dist/extensions/ExtensionDialogHost.js +1 -1
  111. package/dist/files/TreeColumn.js +3 -1
  112. package/dist/files/headless/host.d.ts +2 -2
  113. package/dist/git/ImportRepoDialog.js +1 -1
  114. package/dist/git/MoveSessionDialog.js +2 -2
  115. package/dist/git/SandboxManager.d.ts +42 -0
  116. package/dist/git/SandboxManager.js +297 -0
  117. package/dist/git/SyncChip.js +1 -1
  118. package/dist/git/headless/index.d.ts +2 -1
  119. package/dist/git/headless/index.js +2 -1
  120. package/dist/git/headless/labels.d.ts +29 -0
  121. package/dist/git/headless/labels.js +34 -1
  122. package/dist/git/headless/sandboxes.d.ts +43 -0
  123. package/dist/git/headless/sandboxes.js +52 -0
  124. package/dist/git/index.d.ts +2 -1
  125. package/dist/git/index.js +2 -1
  126. package/dist/index.d.ts +2 -1
  127. package/dist/index.js +2 -1
  128. package/dist/keybindings/headless/catalog.d.ts +1 -1
  129. package/dist/keybindings/headless/catalog.js +12 -0
  130. package/dist/machines/HostsSection.d.ts +1 -1
  131. package/dist/machines/headless/labels.js +2 -2
  132. package/dist/motion/flip-list.js +3 -10
  133. package/dist/motion/presence.d.ts +10 -0
  134. package/dist/motion/presence.js +20 -1
  135. package/dist/motion/swap.d.ts +8 -2
  136. package/dist/motion/swap.js +5 -2
  137. package/dist/onboarding/conversation.js +27 -15
  138. package/dist/onboarding/demos/how-it-works.js +1 -1
  139. package/dist/onboarding/skills/parts.js +4 -4
  140. package/dist/onboarding/sources/SourceBrowser.js +1 -1
  141. package/dist/onboarding/steps/ReadyStep.js +1 -1
  142. package/dist/onboarding/steps/connect/KeyForm.js +1 -1
  143. package/dist/palette/headless/app-sources.js +20 -0
  144. package/dist/palette/headless/labels.js +2 -0
  145. package/dist/session/PlanTracker.js +3 -3
  146. package/dist/session/SecretsPanel.js +1 -1
  147. package/dist/session/SessionHeader.d.ts +18 -6
  148. package/dist/session/SessionHeader.js +67 -12
  149. package/dist/session/SessionPlaceMenu.d.ts +35 -0
  150. package/dist/session/SessionPlaceMenu.js +299 -0
  151. package/dist/session/SessionShell.js +1 -1
  152. package/dist/session/TurnDetailsDialog.js +1 -1
  153. package/dist/session/headless/index.d.ts +2 -1
  154. package/dist/session/headless/index.js +2 -1
  155. package/dist/session/headless/labels.d.ts +73 -0
  156. package/dist/session/headless/labels.js +73 -0
  157. package/dist/session/headless/place.d.ts +49 -0
  158. package/dist/session/headless/place.js +57 -0
  159. package/dist/session/index.d.ts +2 -1
  160. package/dist/session/index.js +2 -1
  161. package/dist/settings/ConversationPresetsCard.js +1 -1
  162. package/dist/settings/SettingCard.js +2 -2
  163. package/dist/settings/SettingsRowsPage.js +1 -1
  164. package/dist/settings/headless/fixture-sections.js +7 -0
  165. package/dist/settings/headless/labels.d.ts +1 -1
  166. package/dist/settings/headless/labels.js +1 -1
  167. package/dist/settings/headless/layout.d.ts +4 -4
  168. package/dist/settings/headless/layout.js +1 -1
  169. package/dist/settings/headless/search.d.ts +2 -2
  170. package/dist/settings/headless/sections-host.d.ts +20 -2
  171. package/dist/settings/sections/claude-import/ClaudeImportDialog.js +1 -1
  172. package/dist/settings/sections/enabled-list/EnabledListSection.js +2 -2
  173. package/dist/settings/sections/environments/EnvironmentsSection.d.ts +9 -3
  174. package/dist/settings/sections/environments/EnvironmentsSection.js +292 -52
  175. package/dist/settings/sections/environments/labels.d.ts +15 -0
  176. package/dist/settings/sections/environments/labels.js +18 -3
  177. package/dist/settings/sections/extensions/ChangeOriginDialog.js +1 -1
  178. package/dist/settings/sections/extensions/ExtensionSourceBrowser.js +1 -1
  179. package/dist/settings/sections/extensions/ExtensionsSection.d.ts +3 -2
  180. package/dist/settings/sections/extensions/ExtensionsSection.js +9 -3
  181. package/dist/settings/sections/host-catalog/HostCatalogSection.js +15 -5
  182. package/dist/settings/sections/keybindings/labels.d.ts +2 -0
  183. package/dist/settings/sections/keybindings/labels.js +2 -0
  184. package/dist/settings/sections/keybindings/rows.js +8 -0
  185. package/dist/settings/sections/models/SpacesDefaultsSection.d.ts +7 -3
  186. package/dist/settings/sections/models/SpacesDefaultsSection.js +11 -5
  187. package/dist/settings/sections/skills/SkillGroups.js +1 -1
  188. package/dist/settings/server-app.d.ts +4 -2
  189. package/dist/settings/server-app.js +7 -3
  190. package/dist/settings/testing/sections.contract.d.ts +7 -1
  191. package/dist/settings/testing/sections.contract.js +37 -0
  192. package/dist/styles.css +212 -19
  193. package/dist/terminal/TerminalDrawer.js +3 -1
  194. package/dist/workspace/SidePanel.js +3 -1
  195. package/package.json +2 -2
  196. package/src/styles/base.css +13 -0
  197. package/src/styles/chat.css +30 -0
  198. package/src/styles/components.css +0 -10
  199. package/src/styles/files.css +5 -0
  200. package/src/styles/sidebar.css +29 -7
  201. package/src/styles/terminal.css +6 -0
  202. package/src/styles/tokens.css +5 -0
  203. package/src/styles/transcript.css +107 -0
  204. package/src/styles/workspace.css +6 -0
  205. package/dist/dist/index-QcFzZlao.d.ts +0 -1
  206. package/dist/dist/sandbox-D0zsW8I1.d.ts +0 -2
  207. /package/dist/dist/{types-_Dtoq_No.d.ts → execution-failure-SREfl-EZ.d.ts} +0 -0
@@ -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 zg-pretty",
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)] zg-pretty",
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;
@@ -211,7 +211,80 @@ const SESSION_SURFACE_LABELS = {
211
211
  headerChangeFolder: (cwd) => `${cwd}. Click to change folder`,
212
212
  headerServerGone: "This server is no longer saved",
213
213
  headerOnServer: (server) => `on ${server ?? "a removed server"}`,
214
+ headerBranch: (branch) => `Branch ${branch}`,
215
+ headerSwitchBranch: (branch) => `Branch ${branch}. Click to switch`,
214
216
  headerRename: "Rename session",
217
+ placeMenu: "Where this session runs",
218
+ placeTones: {
219
+ ready: "Ready",
220
+ busy: "Setting up",
221
+ reconnecting: "Reconnecting",
222
+ failed: "Setup failed",
223
+ resuming: "Resuming",
224
+ paused: "Paused",
225
+ removed: "Deleted"
226
+ },
227
+ placeServerTones: {
228
+ ready: "Connected",
229
+ busy: "Connecting",
230
+ reconnecting: "Reconnecting",
231
+ failed: "Unreachable",
232
+ resuming: "Connected",
233
+ paused: "Connected",
234
+ removed: "Connected"
235
+ },
236
+ /** The state of an environment that broke after setup (`failure`), in place of `placeTones.failed`. */
237
+ placeBroken: {
238
+ lost: "Gone",
239
+ unreachable: "Not answering"
240
+ },
241
+ placeTip: (where, state) => `${where}: ${state}`,
242
+ placeResumes: "resumes on your next prompt",
243
+ /** After `placeTones.removed`: when the new sandbox comes. */
244
+ placeRecreates: "a new one on your next prompt",
245
+ /** Copies a detail line (the branch, the sandbox id). */
246
+ placeCopyBranch: "Copy branch",
247
+ placeCopySandboxId: "Copy sandbox id",
248
+ placeCopiedValue: "Copied",
249
+ placeOnServer: (server) => `On ${server}`,
250
+ placeServerGone: "A removed server",
251
+ placeServerGoneDetail: "This server is no longer saved.",
252
+ placeSetup: "Setup",
253
+ placeServer: "Server",
254
+ placeActions: "Actions",
255
+ placeRetry: "Retry setup",
256
+ placeRetryHint: "Sets the environment up again",
257
+ /** The retry of an environment that broke after setup, by how it broke. */
258
+ placeRetryBroken: {
259
+ lost: {
260
+ title: "Set up again",
261
+ hint: "Sets up a new one"
262
+ },
263
+ unreachable: {
264
+ title: "Reconnect",
265
+ hint: "Tries to reach it again"
266
+ }
267
+ },
268
+ /** `placeRetryBroken.lost`'s hint for a remote sandbox, which held the only copy of the work. */
269
+ placeRetryLostSandboxHint: "A new one; work not pushed or saved at its last pause is lost",
270
+ /** Starts a paused environment now. */
271
+ placeWake: "Wake up",
272
+ placeWakeHint: "Starts it now, before your next prompt",
273
+ placeWakeReadyHint: "Starts it if it fell asleep on its own",
274
+ /** Pauses an idle sandbox now. */
275
+ placePause: "Pause",
276
+ placePauseHint: "Stops it until your next prompt",
277
+ /** Deletes the sandbox and keeps the session (after a confirmation). */
278
+ placeDelete: "Delete sandbox",
279
+ placeDeleteHint: "A new one gets set up on your next prompt",
280
+ placeDeleteConfirmTitle: "Delete this sandbox?",
281
+ placeDeleteConfirmMessage: "Work not pushed or saved at its last pause is lost. Your next prompt sets up a new sandbox.",
282
+ placeDeleteConfirm: "Delete",
283
+ /** The retry of a deleted sandbox: set the new one up now. */
284
+ placeRecreate: "Set up now",
285
+ placeRecreateHint: "Sets up a new sandbox",
286
+ placeCopy: "Copy details",
287
+ placeCopied: "Details copied",
215
288
  headerDetails: "Session details",
216
289
  detailsTitle: "Session details",
217
290
  detailsMainDescription: "Main runs your other sessions",
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Where a session runs, for the header's dot (`SessionPlaceMenu`): whether it runs somewhere other than this
3
+ * machine's folders (a sandbox, another machine, a saved server), and one tone for its state.
4
+ */
5
+ import { HostView } from "../../chat/headless/hosts.js";
6
+ import { SessionEnvironmentSummary } from "zidane/chat";
7
+ /**
8
+ * The dot's state: ready, setting up or connecting, reconnecting to an environment that stopped answering, failed
9
+ * or unreachable, starting back up after a pause, paused while idle, its sandbox deleted (a new one comes with the
10
+ * next prompt).
11
+ */
12
+ export type SessionPlaceTone = 'ready' | 'busy' | 'reconnecting' | 'failed' | 'resuming' | 'paused' | 'removed';
13
+ /**
14
+ * Whether the environment stopped answering and the host is still reconnecting to it: its window
15
+ * (`reconnectUntil`) has not passed. Past it, the host gave up (or went away): it reads as failed.
16
+ *
17
+ * @param environment - The session's environment, if any.
18
+ * @param now - The current time, epoch ms.
19
+ */
20
+ export declare function isReconnecting(environment: SessionEnvironmentSummary | undefined, now?: number): boolean;
21
+ /**
22
+ * Whether the environment runs outside this machine's own folders: a sandbox, an extension's kind or another
23
+ * machine. A local folder and a worktree here do not.
24
+ *
25
+ * @param environment - The session's environment, if any.
26
+ */
27
+ export declare function isExternalEnvironment(environment: SessionEnvironmentSummary | undefined): boolean;
28
+ /**
29
+ * The environment's state in words: how it broke when it broke after setup (`failure`), else its tone.
30
+ *
31
+ * @param labels - The tone words and the broken-state words.
32
+ * @param labels.placeTones - A word per tone.
33
+ * @param labels.placeBroken - A word per way an environment breaks.
34
+ * @param environment - The session's environment.
35
+ * @param tone - Its tone (`sessionPlaceTone`).
36
+ */
37
+ export declare function environmentStateLabel(labels: {
38
+ placeTones: Record<SessionPlaceTone, string>;
39
+ placeBroken: Record<'lost' | 'unreachable', string>;
40
+ }, environment: SessionEnvironmentSummary | undefined, tone: SessionPlaceTone): string;
41
+ /**
42
+ * One tone for where a session runs: a failure wins (unless the host is reconnecting to it, or it is a sandbox
43
+ * deleted on purpose), then work in progress, then a paused environment starting back up, then a pause.
44
+ *
45
+ * @param environment - Its environment when it runs outside this machine's folders, else `undefined`.
46
+ * @param server - Its server: the host, `null` once it is no longer saved, `undefined` for a session here.
47
+ * @param now - The current time, epoch ms (a reconnect window that passed reads as failed).
48
+ */
49
+ export declare function sessionPlaceTone(environment: SessionEnvironmentSummary | undefined, server: HostView | null | undefined, now?: number): SessionPlaceTone;
@@ -0,0 +1,57 @@
1
+ // src/session/headless/place.ts
2
+ /**
3
+ * Whether the environment stopped answering and the host is still reconnecting to it: its window
4
+ * (`reconnectUntil`) has not passed. Past it, the host gave up (or went away): it reads as failed.
5
+ *
6
+ * @param environment - The session's environment, if any.
7
+ * @param now - The current time, epoch ms.
8
+ */
9
+ function isReconnecting(environment, now = Date.now()) {
10
+ return environment?.state === "failed" && environment.failure === "unreachable" && environment.reconnectUntil !== void 0 && environment.reconnectUntil > now;
11
+ }
12
+ /**
13
+ * Whether the environment runs outside this machine's own folders: a sandbox, an extension's kind or another
14
+ * machine. A local folder and a worktree here do not.
15
+ *
16
+ * @param environment - The session's environment, if any.
17
+ */
18
+ function isExternalEnvironment(environment) {
19
+ return environment !== void 0 && environment.kind !== "local" && environment.kind !== "worktree";
20
+ }
21
+ /**
22
+ * The environment's state in words: how it broke when it broke after setup (`failure`), else its tone.
23
+ *
24
+ * @param labels - The tone words and the broken-state words.
25
+ * @param labels.placeTones - A word per tone.
26
+ * @param labels.placeBroken - A word per way an environment breaks.
27
+ * @param environment - The session's environment.
28
+ * @param tone - Its tone (`sessionPlaceTone`).
29
+ */
30
+ function environmentStateLabel(labels, environment, tone) {
31
+ return tone === "failed" && environment?.failure ? labels.placeBroken[environment.failure] : labels.placeTones[tone];
32
+ }
33
+ const SERVER_DOWN = /* @__PURE__ */ new Set([
34
+ "offline",
35
+ "auth-refused",
36
+ "identity",
37
+ "version-mismatch"
38
+ ]);
39
+ /**
40
+ * One tone for where a session runs: a failure wins (unless the host is reconnecting to it, or it is a sandbox
41
+ * deleted on purpose), then work in progress, then a paused environment starting back up, then a pause.
42
+ *
43
+ * @param environment - Its environment when it runs outside this machine's folders, else `undefined`.
44
+ * @param server - Its server: the host, `null` once it is no longer saved, `undefined` for a session here.
45
+ * @param now - The current time, epoch ms (a reconnect window that passed reads as failed).
46
+ */
47
+ function sessionPlaceTone(environment, server, now = Date.now()) {
48
+ const serverDown = server === null || server !== void 0 && SERVER_DOWN.has(server.status);
49
+ if (!serverDown && isReconnecting(environment, now)) return "reconnecting";
50
+ if (!serverDown && environment?.state === "failed" && environment.removed) return "removed";
51
+ if (environment?.state === "failed" || server === null || server && SERVER_DOWN.has(server.status)) return "failed";
52
+ if (environment?.state === "provisioning" || server?.status === "connecting" || server?.status === "reconnecting") return "busy";
53
+ if (environment?.resuming) return "resuming";
54
+ if (environment?.suspended) return "paused";
55
+ return "ready";
56
+ }
57
+ export { environmentStateLabel, isExternalEnvironment, isReconnecting, sessionPlaceTone };
@@ -13,6 +13,7 @@ import { SecretsPanel, SecretsPanelProps } from "./SecretsPanel.js";
13
13
  import { SessionCacheFacts, SessionCacheFactsProps, useSessionCacheReport } from "./SessionCacheFacts.js";
14
14
  import { SessionDetailsDialog, SessionDetailsDialogProps, SessionDetailsFacts, SessionDetailsSpace, SessionDetailsStatus, SessionFolderLocation } from "./SessionDetailsDialog.js";
15
15
  import { SessionHeader, SessionHeaderOrigin, SessionHeaderProps, SessionHeaderServer } from "./SessionHeader.js";
16
+ import { SessionPlaceMenu, SessionPlaceMenuProps } from "./SessionPlaceMenu.js";
16
17
  import { SessionProvider, SessionProviderProps, useAllSchedules, useSchedulesStatus, useSessionArtifacts, useSessionHost, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets } from "./SessionProvider.js";
17
18
  import { RenderSessionShell, SessionShell, SessionShellProps } from "./SessionShell.js";
18
19
  import { SideChat, SideChatProps } from "./SideChat.js";
@@ -23,4 +24,4 @@ import { useSessionActionError } from "./useSessionActionError.js";
23
24
  import { useSessionLabels } from "./useSessionLabels.js";
24
25
  import { UsageSummaryView, useUsageSummary } from "./useUsageSummary.js";
25
26
  import { WelcomeScreen, WelcomeScreenProps } from "./WelcomeScreen.js";
26
- export { ArtifactOpenEvent, ArtifactRowChips, ArtifactRowChipsFields, ArtifactRowChipsProps, ArtifactsPanel, ArtifactsPanelFocus, ArtifactsPanelProps, ArtifactsSavedViews, AttentionActions, BADGE_ICONS, DiffFacts, DiffFactsProps, DiffFileTree, DiffFileTreeProps, FindingCounts, InboxAttention, InboxAttentionProps, PanelAttentionProps, PlanTracker, PlanTrackerProps, ProjectHome, ProjectHomeProject, ProjectHomeProps, ProjectHomeRepo, ProjectHomeStartResult, ProjectHomeSwitcher, ProviderUsage, ProviderUsageProvider, ProviderUsageProviderProps, QueueAttachmentRowProps, QueueAttachmentsSlot, QueueAttention, QueueTab, QueueTabProps, RecentPlans, RecentPlansProps, RemindersPanel, RemindersPanelProps, RemindersScope, type RenderSessionShell, RunningWorkDialog, RunningWorkDialogProps, SecretsAttention, SecretsAttentionProps, SecretsPanel, SecretsPanelProps, SessionCacheFacts, SessionCacheFactsProps, SessionDetailsDialog, SessionDetailsDialogProps, SessionDetailsFacts, SessionDetailsSpace, SessionDetailsStatus, SessionFolderLocation, SessionHeader, SessionHeaderOrigin, SessionHeaderProps, SessionHeaderServer, SessionProvider, SessionProviderProps, SessionShell, type SessionShellProps, SideChat, SideChatProps, TODO_ROW_CLASS, TodoListItem, TodoListView, TodoListViewProps, TodoTally, TodoTallyProps, TurnDetailsDialog, TurnDetailsDialogProps, UsagePanel, UsagePanelProps, UsageSummaryView, WelcomeScreen, WelcomeScreenProps, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useInboxPlans, useProviderUsage, useSchedulesStatus, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useUsageSummary };
27
+ export { ArtifactOpenEvent, ArtifactRowChips, ArtifactRowChipsFields, ArtifactRowChipsProps, ArtifactsPanel, ArtifactsPanelFocus, ArtifactsPanelProps, ArtifactsSavedViews, AttentionActions, BADGE_ICONS, DiffFacts, DiffFactsProps, DiffFileTree, DiffFileTreeProps, FindingCounts, InboxAttention, InboxAttentionProps, PanelAttentionProps, PlanTracker, PlanTrackerProps, ProjectHome, ProjectHomeProject, ProjectHomeProps, ProjectHomeRepo, ProjectHomeStartResult, ProjectHomeSwitcher, ProviderUsage, ProviderUsageProvider, ProviderUsageProviderProps, QueueAttachmentRowProps, QueueAttachmentsSlot, QueueAttention, QueueTab, QueueTabProps, RecentPlans, RecentPlansProps, RemindersPanel, RemindersPanelProps, RemindersScope, type RenderSessionShell, RunningWorkDialog, RunningWorkDialogProps, SecretsAttention, SecretsAttentionProps, SecretsPanel, SecretsPanelProps, SessionCacheFacts, SessionCacheFactsProps, SessionDetailsDialog, SessionDetailsDialogProps, SessionDetailsFacts, SessionDetailsSpace, SessionDetailsStatus, SessionFolderLocation, SessionHeader, SessionHeaderOrigin, SessionHeaderProps, SessionHeaderServer, SessionPlaceMenu, SessionPlaceMenuProps, SessionProvider, SessionProviderProps, SessionShell, type SessionShellProps, SideChat, SideChatProps, TODO_ROW_CLASS, TodoListItem, TodoListView, TodoListViewProps, TodoTally, TodoTallyProps, TurnDetailsDialog, TurnDetailsDialogProps, UsagePanel, UsagePanelProps, UsageSummaryView, WelcomeScreen, WelcomeScreenProps, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useInboxPlans, useProviderUsage, useSchedulesStatus, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useUsageSummary };