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
@@ -4,8 +4,8 @@ import { createNotificationStore } from "./notifications.js";
4
4
  import { NO_SIDEBAR_CONTRIBUTIONS, filterQueryOf, filtersForSpace, mergeSidebarSpaces, resolveGrouping, resolveSort, spaceMembership, switcherSpaces } from "./query.js";
5
5
  import { isProjectMember } from "./rows.js";
6
6
  import { VIEW_CHOICE } from "./types.js";
7
- import { DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS } from "./view.js";
8
- import { DEFAULT_SPACE_ID, SESSION_INBOX_KEYS, SessionQueryError, activeSpaceOf, createRecentChanges, normalizeSpaces, projectNameOf, resolveSessionSpace, sessionDirLabel, viewQuery } from "zidane/chat/pure";
7
+ import { DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS } from "./view.js";
8
+ import { DEFAULT_SPACE_ID, SESSION_INBOX_KEYS, SessionQueryError, activeSpaceOf, arrangeSpaceList, createRecentChanges, normalizeSpaces, projectNameOf, resolveSessionSpace, sessionDirLabel, viewQuery } from "zidane/chat/pure";
9
9
  // src/chat/headless/sidebar/directory.ts
10
10
  /** The longest wait of one timer (`setTimeout` overflows past 2^31 ms): a later snooze end re-arms on the way. */
11
11
  const MAX_TIMER_MS = 2 ** 31 - 1;
@@ -54,6 +54,13 @@ function createSessionDirectory(options) {
54
54
  let switcherFrom = null;
55
55
  let switcher = [];
56
56
  let hiddenSpaces = [];
57
+ const sharedList = (settings) => settings.spacesShared === true && options.saveSpaceList !== void 0;
58
+ /** Saves the switcher's arrangement into the shared list. */
59
+ const saveArrangement = (order, hidden) => {
60
+ const byId = new Map(merged.map((s) => [s.id, s]));
61
+ const list = arrangeSpaceList(options.settings.get().spaceList, order.flatMap((id) => byId.has(id) ? [byId.get(id)] : []), hidden);
62
+ options.saveSpaceList(list).catch((err) => options.onError?.(err));
63
+ };
57
64
  const spacesFrom = (settings, spaceId) => {
58
65
  const spacesOn = settings.spaces;
59
66
  const contributions = contributionsStore.get();
@@ -65,7 +72,8 @@ function createSessionDirectory(options) {
65
72
  merged = mergeSidebarSpaces(normalizeSpaces(settings.spaceList), settings.spaceList, contributions.spaces);
66
73
  }
67
74
  const spaces = merged;
68
- const prefs = views.switcher.get();
75
+ const shared = sharedList(settings);
76
+ const prefs = shared ? DEFAULT_SWITCHER_PREFS : views.switcher.get();
69
77
  if (!switcherFrom || switcherFrom.spaces !== spaces || switcherFrom.prefs !== prefs) {
70
78
  switcherFrom = {
71
79
  spaces,
@@ -73,7 +81,7 @@ function createSessionDirectory(options) {
73
81
  };
74
82
  switcher = switcherSpaces(spaces, prefs);
75
83
  const hidden = new Set(prefs.hidden);
76
- hiddenSpaces = spaces.filter((s) => s.id !== DEFAULT_SPACE_ID && hidden.has(s.id));
84
+ hiddenSpaces = spaces.filter((s) => s.id !== DEFAULT_SPACE_ID && (shared ? s.hidden === true : hidden.has(s.id)));
77
85
  }
78
86
  return {
79
87
  spacesOn,
@@ -350,6 +358,21 @@ function createSessionDirectory(options) {
350
358
  offs.push(options.settings.subscribe(reconcile));
351
359
  offs.push(views.space.subscribe(reconcile));
352
360
  offs.push(views.switcher.subscribe(reconcile));
361
+ const adoptSwitcher = () => {
362
+ const prefs = views.switcher.get();
363
+ if (!sharedList(options.settings.get()) || prefs.order.length === 0 && prefs.hidden.length === 0) return;
364
+ const order = switcherSpaces(merged.map((s) => ({
365
+ ...s,
366
+ hidden: false
367
+ })), {
368
+ order: prefs.order,
369
+ hidden: []
370
+ }).map((s) => s.id);
371
+ saveArrangement(order, /* @__PURE__ */ new Set([...prefs.hidden, ...merged.filter((s) => s.hidden).map((s) => s.id)]));
372
+ views.setSwitcher(DEFAULT_SWITCHER_PREFS);
373
+ };
374
+ adoptSwitcher();
375
+ offs.push(options.settings.subscribe(adoptSwitcher));
353
376
  let offContributions = contributionsStore.subscribe(reconcile);
354
377
  offs.push(() => offContributions());
355
378
  followContributions = (next) => {
@@ -615,6 +638,14 @@ function createSessionDirectory(options) {
615
638
  },
616
639
  setSpaceHidden(spaceId, hidden) {
617
640
  if (spaceId === DEFAULT_SPACE_ID) return;
641
+ if (sharedList(options.settings.get())) {
642
+ const now = new Set(merged.filter((s) => s.hidden).map((s) => s.id));
643
+ if (hidden) now.add(spaceId);
644
+ else now.delete(spaceId);
645
+ saveArrangement(merged.map((s) => s.id), now);
646
+ if (hidden && state.get().activeSpace.id === spaceId) showSpace(DEFAULT_SPACE_ID);
647
+ return;
648
+ }
618
649
  const prefs = views.switcher.get();
619
650
  const rest = prefs.hidden.filter((id) => id !== spaceId);
620
651
  views.setSwitcher({
@@ -630,6 +661,11 @@ function createSessionDirectory(options) {
630
661
  if (at === -1 || to < 0 || to >= order.length) return;
631
662
  order.splice(at, 1);
632
663
  order.splice(to, 0, spaceId);
664
+ if (sharedList(options.settings.get())) {
665
+ const hidden = merged.filter((s) => s.hidden);
666
+ saveArrangement([...order, ...hidden.map((s) => s.id)], new Set(hidden.map((s) => s.id)));
667
+ return;
668
+ }
633
669
  const prefs = views.switcher.get();
634
670
  const kept = prefs.order.filter((id) => !order.includes(id));
635
671
  views.setSwitcher({
@@ -19,12 +19,15 @@ export declare function runsInRemoteSandbox(environment: SessionEnvironmentSumma
19
19
  */
20
20
  export declare function environmentKindLabel(kind: string, labels: Pick<SidebarLabels, 'environmentKinds' | 'environmentOnMachine'>): string;
21
21
  /**
22
- * Where a session runs, in one line: tooltips and screen readers.
22
+ * Where a session runs, in one line: tooltips and screen readers. Its state is the header dot's
23
+ * (`sessionPlaceTone`), so a row and the header agree: reconnecting is not a failure, and an
24
+ * environment that broke after setup says how.
23
25
  *
24
26
  * @param environment - The session's environment.
25
27
  * @param labels - The sidebar labels.
28
+ * @param now - The current time, epoch ms (a reconnect window that passed reads as failed).
26
29
  */
27
- export declare function environmentSummaryText(environment: SessionEnvironmentSummary, labels: SidebarLabels): string;
30
+ export declare function environmentSummaryText(environment: SessionEnvironmentSummary, labels: SidebarLabels, now?: number): string;
28
31
  /**
29
32
  * The delete confirmation: the question, and a warning when the session's sandbox goes with it.
30
33
  *
@@ -1,3 +1,4 @@
1
+ import { sessionPlaceTone } from "../../../session/headless/place.js";
1
2
  import { parseMachineKind } from "zidane/chat/pure";
2
3
  // src/chat/headless/sidebar/environment.ts
3
4
  /** Kinds whose work lives in a remote sandbox: deleting the session deletes it. */
@@ -22,19 +23,27 @@ function environmentKindLabel(kind, labels) {
22
23
  return labels.environmentKinds[kind] ?? kind;
23
24
  }
24
25
  /**
25
- * Where a session runs, in one line: tooltips and screen readers.
26
+ * Where a session runs, in one line: tooltips and screen readers. Its state is the header dot's
27
+ * (`sessionPlaceTone`), so a row and the header agree: reconnecting is not a failure, and an
28
+ * environment that broke after setup says how.
26
29
  *
27
30
  * @param environment - The session's environment.
28
31
  * @param labels - The sidebar labels.
32
+ * @param now - The current time, epoch ms (a reconnect window that passed reads as failed).
29
33
  */
30
- function environmentSummaryText(environment, labels) {
34
+ function environmentSummaryText(environment, labels, now = Date.now()) {
31
35
  const label = environmentKindLabel(environment.kind, labels);
32
36
  const where = environment.branch ? labels.environmentOnBranch(label, environment.branch) : label;
33
37
  if (environment.state === "provisioning") {
34
38
  const step = environment.progress?.steps.find((s) => s.id === environment.progress?.step);
35
39
  return step ? labels.environmentSettingUpStep(where, step.label) : labels.environmentSettingUp(where);
36
40
  }
41
+ if (environment.state === "failed" && environment.removed) return labels.environmentRemoved(where);
42
+ if (sessionPlaceTone(environment, void 0, now) === "reconnecting") return labels.environmentReconnecting(where);
43
+ if (environment.state === "failed" && environment.failure === "lost") return labels.environmentGone(where, environment.error);
44
+ if (environment.state === "failed" && environment.failure === "unreachable") return labels.environmentNotAnswering(where, environment.error);
37
45
  if (environment.state === "failed") return labels.environmentSetupFailed(where, environment.error);
46
+ if (environment.resuming) return labels.environmentResuming(where);
38
47
  if (environment.suspended) return labels.environmentPaused(where);
39
48
  return where;
40
49
  }
@@ -21,6 +21,21 @@ export interface SidebarEnvironmentHost {
21
21
  run: (sessionId: string, actionId: string) => Promise<EnvironmentActionResult>;
22
22
  /** Sets a failed environment up again; progress arrives as the session's row changing. */
23
23
  retry: (sessionId: string) => Promise<void>;
24
+ /**
25
+ * Starts a paused environment now, as the next prompt would; the row shows it resuming until it answers, then
26
+ * this resolves. Resolves at once when it isn't paused; rejects when it fails to start. Absent: no "Wake up".
27
+ */
28
+ wake?: (sessionId: string) => Promise<void>;
29
+ /**
30
+ * Pauses an idle environment now, as the idle sweep would; the row shows it paused. Rejects while it runs, or
31
+ * when its kind can't pause. Absent: no "Pause".
32
+ */
33
+ pause?: (sessionId: string) => Promise<void>;
34
+ /**
35
+ * Deletes the session's sandbox and keeps the session; its next prompt sets up a new one. Rejects while it
36
+ * runs, or when its kind keeps it. Absent: no "Delete sandbox".
37
+ */
38
+ remove?: (sessionId: string) => Promise<void>;
24
39
  }
25
40
  /** The sidebar's platform capabilities. Every member is optional. */
26
41
  export interface SidebarHost {
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * The inbox layout's rows: one flat list instead of groups. React-free.
3
3
  *
4
- * pinned favorites, in their manual order (`sidebarOrder`), then newest first
5
- * active the rest touched in the last 3 days, newest return first; flat, or in project folders
4
+ * pinned favorites, in their manual order (`sidebarOrder`), then by the user's last message
5
+ * active the rest active in the last 3 days, by the user's last message (else creation); flat, or in
6
+ * project folders. Agent activity never reorders a section: rows stay put while agents work
6
7
  * ── the shelves, docked under the list by the sidebar; each one folds ──
7
8
  * working sessions with a run going, latest message first
8
9
  * snoozed hidden until their snooze ends, the earliest first
@@ -87,7 +88,14 @@ export interface InboxRowsOptions {
87
88
  activeId?: string | null;
88
89
  /** How long without activity moves a session to Earlier (`inboxEarlierAfterMs`). Default {@link INBOX_EARLIER_AFTER_MS}. */
89
90
  earlierAfterMs?: number;
91
+ /**
92
+ * Sessions whose run ended a moment ago ({@link INBOX_RUN_HOLD_MS}): still on the Working shelf, so a gap between
93
+ * two runs (a queued message going out, a run resuming) does not send a row to Active and straight back.
94
+ */
95
+ holdRunning?: ReadonlySet<string>;
90
96
  }
97
+ /** How long a session whose run ended stays on the Working shelf, in ms: longer than the gap between two runs. */
98
+ export declare const INBOX_RUN_HOLD_MS = 1500;
91
99
  /**
92
100
  * Which section a session belongs in.
93
101
  *
@@ -95,8 +103,9 @@ export interface InboxRowsOptions {
95
103
  * @param now - Epoch ms: whether its snooze has ended.
96
104
  * @param earlierAfterMs - How long without activity moves it to Earlier. Default {@link INBOX_EARLIER_AFTER_MS}.
97
105
  * @param needsYou - The sessions waiting on the user: in the list (Pinned or Active), never on a shelf.
106
+ * @param holdRunning - Sessions whose run just ended: still Working for a moment (`InboxRowsOptions.holdRunning`).
98
107
  */
99
- export declare function inboxSectionOf(session: SidebarListSession, now: number, earlierAfterMs?: number, needsYou?: ReadonlySet<string>): InboxSection;
108
+ export declare function inboxSectionOf(session: SidebarListSession, now: number, earlierAfterMs?: number, needsYou?: ReadonlySet<string>, holdRunning?: ReadonlySet<string>): InboxSection;
100
109
  /**
101
110
  * Whether `a` comes before `b` in a section's order (negative), after it (positive), or ties: Pinned by manual
102
111
  * order then recency, Active by newest return (the ones waiting on the user first), each shelf by its own.
@@ -31,25 +31,33 @@ function inboxEarlierAfterMs(days) {
31
31
  }
32
32
  /** Where the folded shelves persist (a JSON array of shelf ids). */
33
33
  const INBOX_SHELVES_KEY = "zg-sidebar-inbox-shelves:v2";
34
+ /** How long a session whose run ended stays on the Working shelf, in ms: longer than the gap between two runs. */
35
+ const INBOX_RUN_HOLD_MS = 1500;
34
36
  const EMPTY = /* @__PURE__ */ new Set();
35
37
  const PAGED = /* @__PURE__ */ new Set(["earlier", "settled"]);
36
- /** Newest return first: its last activity, or its last message, whichever is later. */
38
+ /** Its last activity, agent's included: what moves it to Earlier after days without any. */
37
39
  const returnedAt = (s) => Math.max(s.updatedAt, s.lastUserMessageAt ?? 0, s.createdAt);
38
40
  /**
41
+ * What orders a section: the user's last message, else when they created it. Never the agent's activity, so a
42
+ * run starting, saving or ending reorders nothing; a row moves up only when the user sends to it.
43
+ */
44
+ const touchedAt = (s) => Math.max(s.lastUserMessageAt ?? 0, s.createdAt);
45
+ /**
39
46
  * Which section a session belongs in.
40
47
  *
41
48
  * @param session - The session.
42
49
  * @param now - Epoch ms: whether its snooze has ended.
43
50
  * @param earlierAfterMs - How long without activity moves it to Earlier. Default {@link INBOX_EARLIER_AFTER_MS}.
44
51
  * @param needsYou - The sessions waiting on the user: in the list (Pinned or Active), never on a shelf.
52
+ * @param holdRunning - Sessions whose run just ended: still Working for a moment (`InboxRowsOptions.holdRunning`).
45
53
  */
46
- function inboxSectionOf(session, now, earlierAfterMs = INBOX_EARLIER_AFTER_MS, needsYou) {
54
+ function inboxSectionOf(session, now, earlierAfterMs = INBOX_EARLIER_AFTER_MS, needsYou, holdRunning) {
47
55
  if (needsYou?.has(session.id) && !session.archived) return session.favorite ? "pinned" : "active";
48
56
  if (isSnoozed(session, now)) return "snoozed";
49
57
  if (session.archived) return "archived";
50
58
  if (session.settledAt !== void 0) return "settled";
51
59
  if (session.favorite) return "pinned";
52
- if (session.status === "running") return "working";
60
+ if (session.status === "running" || holdRunning?.has(session.id)) return "working";
53
61
  if (returnedAt(session) < now - earlierAfterMs) return "earlier";
54
62
  return "active";
55
63
  }
@@ -58,12 +66,12 @@ function comparePinned(a, b) {
58
66
  if (a.sidebarOrder !== void 0 && b.sidebarOrder !== void 0) return a.sidebarOrder < b.sidebarOrder ? -1 : a.sidebarOrder > b.sidebarOrder ? 1 : 0;
59
67
  if (a.sidebarOrder !== void 0) return -1;
60
68
  if (b.sidebarOrder !== void 0) return 1;
61
- return returnedAt(b) - returnedAt(a);
69
+ return touchedAt(b) - touchedAt(a);
62
70
  }
63
71
  const SHELF_ORDER = {
64
- working: (a, b) => (b.lastUserMessageAt ?? b.updatedAt) - (a.lastUserMessageAt ?? a.updatedAt),
72
+ working: (a, b) => touchedAt(b) - touchedAt(a),
65
73
  snoozed: (a, b) => (a.snoozedUntil ?? 0) - (b.snoozedUntil ?? 0),
66
- earlier: (a, b) => returnedAt(b) - returnedAt(a),
74
+ earlier: (a, b) => touchedAt(b) - touchedAt(a),
67
75
  settled: (a, b) => (b.settledAt ?? 0) - (a.settledAt ?? 0),
68
76
  archived: (a, b) => b.updatedAt - a.updatedAt
69
77
  };
@@ -78,7 +86,7 @@ const SHELF_ORDER = {
78
86
  */
79
87
  function compareInboxSection(section, a, b, needsYou = EMPTY) {
80
88
  if (section === "pinned") return comparePinned(a, b);
81
- if (section === "active") return Number(needsYou.has(b.id)) - Number(needsYou.has(a.id)) || returnedAt(b) - returnedAt(a);
89
+ if (section === "active") return Number(needsYou.has(b.id)) - Number(needsYou.has(a.id)) || touchedAt(b) - touchedAt(a);
82
90
  return SHELF_ORDER[section](a, b);
83
91
  }
84
92
  /**
@@ -111,7 +119,8 @@ function buildInboxRows(sessions, options) {
111
119
  archived: []
112
120
  };
113
121
  const needsYou = options.needsYou ?? EMPTY;
114
- for (const s of sessions) by[inboxSectionOf(s, now, earlierAfterMs, needsYou)].push(s);
122
+ const holdRunning = options.holdRunning ?? EMPTY;
123
+ for (const s of sessions) by[inboxSectionOf(s, now, earlierAfterMs, needsYou, holdRunning)].push(s);
115
124
  for (const section of [
116
125
  "pinned",
117
126
  "active",
@@ -236,4 +245,4 @@ function inboxDockStart(rows) {
236
245
  const at = rows.findIndex((row) => row.kind === "shelf");
237
246
  return at < 0 ? rows.length : at;
238
247
  }
239
- export { INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, buildInboxRows, compareInboxSection, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, nextInboxChangeAt };
248
+ export { INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, buildInboxRows, compareInboxSection, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, nextInboxChangeAt };
@@ -7,7 +7,7 @@ import { deleteSessionPrompt, environmentKindLabel, environmentSummaryText, runs
7
7
  import { RunEstimatesRow, RunEstimatesSignal, RunEstimatesStore, createRunEstimates, pickRunEstimate } from "./estimates.js";
8
8
  import { SESSION_HISTORY_LIMIT, SessionHistory, SessionHistoryDirection, SessionHistoryOptions, SessionHistoryPage, SessionHistoryState, SessionHistoryStore, createSessionHistory, parseSessionHistory } from "./history.js";
9
9
  import { SessionWindowMode, SidebarEnvironmentHost, SidebarHost } from "./host.js";
10
- import { INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, InboxRow, InboxRowsOptions, InboxSection, InboxShelfId, InboxUrgency, buildInboxRows, compareInboxSection, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, nextInboxChangeAt } from "./inbox.js";
10
+ import { INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, InboxRow, InboxRowsOptions, InboxSection, InboxShelfId, InboxUrgency, buildInboxRows, compareInboxSection, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, nextInboxChangeAt } from "./inbox.js";
11
11
  import { SessionInboxFields, SessionInboxPatch, applyInboxPatch, isSettled, isSnoozed, nextWakeAt } from "./inbox-state.js";
12
12
  import { DEFAULT_SIDEBAR_LABELS, SidebarLabels } from "./labels.js";
13
13
  import { SessionNotification, SessionNotificationStore, createNotificationStore } from "./notifications.js";
@@ -18,4 +18,4 @@ import { AGENT_GROUPING, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, SidebarContrib
18
18
  import { BuildQuerySidebarRowsOptions, BuildSidebarRowsOptions, CHATS_BUCKET, SidebarListRow, SidebarNode, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, groupsByFolder, isProjectMember, itemRows, nestSidebarRows, partitionMainSession, projectPathOf, repoGroups } from "./rows.js";
19
19
  import { SessionActivityFilter, SessionArchiveFilter, SidebarExtensionView, SidebarGroupBy, SidebarInboxGroupBy, SidebarLayout, SidebarListSession, SidebarOrigin, SidebarSortBy, SidebarView, VIEW_CHOICE } from "./types.js";
20
20
  import { DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SidebarLastSessions, SidebarViewDefaults, SidebarViewMap, SidebarViewPicks, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, SpaceSwitcherPrefs, createSidebarViews, defaultSidebarLayout, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, readSidebarViews, resolveSidebarView, sidebarLayoutOf, sidebarViewDefaults } from "./view.js";
21
- export { AGENT_GROUPING, BuildQuerySidebarRowsOptions, BuildSidebarRowsOptions, CHATS_BUCKET, COMMON_EMOJI, CompactionProgress, CompactionProgressStore, CompactionSignal, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, DirectoryServer, DirectorySettings, DotStateInput, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, InboxRow, InboxRowsOptions, InboxSection, InboxShelfId, InboxUrgency, MAIN_SESSION_ICON_KEY, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_ICONS_KEY, PinsBySpace, ProjectIcon, ProjectIconMap, ProjectInSpace, RunEstimatesRow, RunEstimatesSignal, RunEstimatesStore, RuntimeNow, RuntimeOrigin, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SessionActivity, SessionActivityFilter, SessionActivitySignal, SessionActivityStore, SessionArchiveFilter, SessionBadgesEntry, SessionBadgesSource, SessionBadgesStore, SessionDirectory, SessionDirectoryOptions, SessionDirectorySource, SessionDirectoryState, SessionDirectoryStreams, SessionHistory, SessionHistoryDirection, SessionHistoryOptions, SessionHistoryPage, SessionHistoryState, SessionHistoryStore, type SessionInboxFields, type SessionInboxPatch, SessionNotification, SessionNotificationStore, SessionRef, SessionRemoval, SessionRowChange, SessionWindowMode, SidebarContributionStores, SidebarContributions, SidebarDotState, SidebarEnvironmentHost, SidebarExtensionView, SidebarGroupBy, SidebarGrouping, SidebarHost, SidebarInboxGroupBy, SidebarItemEntry, SidebarLabels, SidebarLastSessions, type SidebarLayout, SidebarListRow, SidebarListSession, SidebarNode, SidebarOrigin, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarSortBy, SidebarSpace, SidebarView, SidebarViewDefaults, SidebarViewMap, SidebarViewPicks, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, SpaceSwitcherPrefs, VIEW_CHOICE, activityLabel, applyInboxPatch, availableProjectsOf, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSidebarRows, claimChildSessions, clearedViewFilters, compareInboxSection, createCompactionProgress, createDecorator, createNotificationStore, createRunEstimates, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSidebarViews, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, environmentKindLabel, environmentSummaryText, extensionSpaceOf, filterDirectorySessions, filterQueryOf, filtersForSpace, firstGrapheme, groupsByFolder, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, isProjectIcon, isProjectMember, isSettled, isSnoozed, itemRows, itemsForSpace, mergeSidebarSpaces, nestSidebarRows, nextInboxChangeAt, nextSavedViewName, nextWakeAt, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, projectKeyOf, projectPathOf, readSidebarViews, reduceActivity, reduceCompaction, repoGroups, resolveGrouping, resolveSidebarView, resolveSort, runsInRemoteSandbox, sessionRefsOf, sidebarContributionsOf, sidebarLayoutOf, sidebarViewDefaults, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn, withPinnedProject };
21
+ export { AGENT_GROUPING, BuildQuerySidebarRowsOptions, BuildSidebarRowsOptions, CHATS_BUCKET, COMMON_EMOJI, CompactionProgress, CompactionProgressStore, CompactionSignal, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, DirectoryServer, DirectorySettings, DotStateInput, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, InboxRow, InboxRowsOptions, InboxSection, InboxShelfId, InboxUrgency, MAIN_SESSION_ICON_KEY, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_ICONS_KEY, PinsBySpace, ProjectIcon, ProjectIconMap, ProjectInSpace, RunEstimatesRow, RunEstimatesSignal, RunEstimatesStore, RuntimeNow, RuntimeOrigin, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SessionActivity, SessionActivityFilter, SessionActivitySignal, SessionActivityStore, SessionArchiveFilter, SessionBadgesEntry, SessionBadgesSource, SessionBadgesStore, SessionDirectory, SessionDirectoryOptions, SessionDirectorySource, SessionDirectoryState, SessionDirectoryStreams, SessionHistory, SessionHistoryDirection, SessionHistoryOptions, SessionHistoryPage, SessionHistoryState, SessionHistoryStore, type SessionInboxFields, type SessionInboxPatch, SessionNotification, SessionNotificationStore, SessionRef, SessionRemoval, SessionRowChange, SessionWindowMode, SidebarContributionStores, SidebarContributions, SidebarDotState, SidebarEnvironmentHost, SidebarExtensionView, SidebarGroupBy, SidebarGrouping, SidebarHost, SidebarInboxGroupBy, SidebarItemEntry, SidebarLabels, SidebarLastSessions, type SidebarLayout, SidebarListRow, SidebarListSession, SidebarNode, SidebarOrigin, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarSortBy, SidebarSpace, SidebarView, SidebarViewDefaults, SidebarViewMap, SidebarViewPicks, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, SpaceSwitcherPrefs, VIEW_CHOICE, activityLabel, applyInboxPatch, availableProjectsOf, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSidebarRows, claimChildSessions, clearedViewFilters, compareInboxSection, createCompactionProgress, createDecorator, createNotificationStore, createRunEstimates, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSidebarViews, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, environmentKindLabel, environmentSummaryText, extensionSpaceOf, filterDirectorySessions, filterQueryOf, filtersForSpace, firstGrapheme, groupsByFolder, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, isProjectIcon, isProjectMember, isSettled, isSnoozed, itemRows, itemsForSpace, mergeSidebarSpaces, nestSidebarRows, nextInboxChangeAt, nextSavedViewName, nextWakeAt, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, projectKeyOf, projectPathOf, readSidebarViews, reduceActivity, reduceCompaction, repoGroups, resolveGrouping, resolveSidebarView, resolveSort, runsInRemoteSandbox, sessionRefsOf, sidebarContributionsOf, sidebarLayoutOf, sidebarViewDefaults, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn, withPinnedProject };
@@ -6,7 +6,7 @@ import { deriveDotState } from "./dot-state.js";
6
6
  import { deleteSessionPrompt, environmentKindLabel, environmentSummaryText, runsInRemoteSandbox } from "./environment.js";
7
7
  import { createRunEstimates, pickRunEstimate } from "./estimates.js";
8
8
  import { SESSION_HISTORY_LIMIT, createSessionHistory, parseSessionHistory } from "./history.js";
9
- import { INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, buildInboxRows, compareInboxSection, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, nextInboxChangeAt } from "./inbox.js";
9
+ import { INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, buildInboxRows, compareInboxSection, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, nextInboxChangeAt } from "./inbox.js";
10
10
  import { applyInboxPatch, isSettled, isSnoozed, nextWakeAt } from "./inbox-state.js";
11
11
  import { DEFAULT_SIDEBAR_LABELS } from "./labels.js";
12
12
  import { createNotificationStore } from "./notifications.js";
@@ -17,4 +17,4 @@ import { AGENT_GROUPING, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, claimChildSess
17
17
  import { CHATS_BUCKET, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, groupsByFolder, isProjectMember, itemRows, nestSidebarRows, partitionMainSession, projectPathOf, repoGroups } from "./rows.js";
18
18
  import { VIEW_CHOICE } from "./types.js";
19
19
  import { DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, createSidebarViews, defaultSidebarLayout, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, readSidebarViews, resolveSidebarView, sidebarLayoutOf, sidebarViewDefaults } from "./view.js";
20
- export { AGENT_GROUPING, CHATS_BUCKET, COMMON_EMOJI, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, MAIN_SESSION_ICON_KEY, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_ICONS_KEY, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, VIEW_CHOICE, activityLabel, applyInboxPatch, availableProjectsOf, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSidebarRows, claimChildSessions, clearedViewFilters, compareInboxSection, createCompactionProgress, createDecorator, createNotificationStore, createRunEstimates, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSidebarViews, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, environmentKindLabel, environmentSummaryText, extensionSpaceOf, filterDirectorySessions, filterQueryOf, filtersForSpace, firstGrapheme, groupsByFolder, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, isProjectIcon, isProjectMember, isSettled, isSnoozed, itemRows, itemsForSpace, mergeSidebarSpaces, nestSidebarRows, nextInboxChangeAt, nextSavedViewName, nextWakeAt, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, projectKeyOf, projectPathOf, readSidebarViews, reduceActivity, reduceCompaction, repoGroups, resolveGrouping, resolveSidebarView, resolveSort, runsInRemoteSandbox, sessionRefsOf, sidebarContributionsOf, sidebarLayoutOf, sidebarViewDefaults, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn, withPinnedProject };
20
+ export { AGENT_GROUPING, CHATS_BUCKET, COMMON_EMOJI, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, MAIN_SESSION_ICON_KEY, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_ICONS_KEY, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, VIEW_CHOICE, activityLabel, applyInboxPatch, availableProjectsOf, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSidebarRows, claimChildSessions, clearedViewFilters, compareInboxSection, createCompactionProgress, createDecorator, createNotificationStore, createRunEstimates, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSidebarViews, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, environmentKindLabel, environmentSummaryText, extensionSpaceOf, filterDirectorySessions, filterQueryOf, filtersForSpace, firstGrapheme, groupsByFolder, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, isProjectIcon, isProjectMember, isSettled, isSnoozed, itemRows, itemsForSpace, mergeSidebarSpaces, nestSidebarRows, nextInboxChangeAt, nextSavedViewName, nextWakeAt, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, projectKeyOf, projectPathOf, readSidebarViews, reduceActivity, reduceCompaction, repoGroups, resolveGrouping, resolveSidebarView, resolveSort, runsInRemoteSandbox, sessionRefsOf, sidebarContributionsOf, sidebarLayoutOf, sidebarViewDefaults, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn, withPinnedProject };
@@ -1,7 +1,7 @@
1
1
  import { SecretTimeLeft } from "../secrets.js";
2
- import { u as AuthFailure } from "../../../dist/timeout-CyU7HLyz.js";
2
+ import { u as AuthFailure } from "../../../dist/timeout-CmTx6V9y.js";
3
3
  import "../../../dist/index.js";
4
- import { $j as TaskOutcomeCounts, LM as McpJobView, Qj as TaskOutcome, UL as SecretTtl } from "../../../dist/index-Betz0OWq.js";
4
+ import { $L as SecretTtl, HM as McpJobView, iM as TaskOutcomeCounts, rM as TaskOutcome } from "../../../dist/index-E1Z0aPmi.js";
5
5
  import "../index.js";
6
6
  /** The default English strings of the session sidebar, merged over the chat layer's. */
7
7
  export declare const DEFAULT_SIDEBAR_LABELS: {
@@ -61,7 +61,15 @@ export declare const DEFAULT_SIDEBAR_LABELS: {
61
61
  environmentSettingUp: (where: string) => string;
62
62
  environmentSettingUpStep: (where: string, step: string) => string;
63
63
  environmentSetupFailed: (where: string, error?: string) => string;
64
+ /** It stopped answering after setup, and the host is reconnecting. */
65
+ environmentReconnecting: (where: string) => string;
66
+ /** It broke after setup: gone for good (`lost`). */
67
+ environmentGone: (where: string, error?: string) => string;
68
+ /** It broke after setup: not answering, and the host stopped reconnecting (`unreachable`). */
69
+ environmentNotAnswering: (where: string, error?: string) => string;
64
70
  environmentPaused: (where: string) => string;
71
+ environmentResuming: (where: string) => string;
72
+ environmentRemoved: (where: string) => string;
65
73
  menuRename: string;
66
74
  menuAddFavorite: string;
67
75
  menuRemoveFavorite: string;
@@ -73,6 +81,7 @@ export declare const DEFAULT_SIDEBAR_LABELS: {
73
81
  menuOpenChatWindow: string;
74
82
  menuOpenPanelsWindow: string;
75
83
  menuRetryEnvironment: string;
84
+ menuWakeEnvironment: string;
76
85
  menuMoveTo: string;
77
86
  menuMoveToSpace: string;
78
87
  menuDelete: string;
@@ -108,6 +117,9 @@ export declare const DEFAULT_SIDEBAR_LABELS: {
108
117
  moveProjectFailed: (message: string) => string;
109
118
  environmentActionFailed: (action: string, message: string) => string;
110
119
  retryEnvironmentFailed: (message: string) => string;
120
+ wakeEnvironmentFailed: (message: string) => string;
121
+ pauseEnvironmentFailed: (message: string) => string;
122
+ deleteEnvironmentFailed: (message: string) => string;
111
123
  footerSettings: string;
112
124
  footerSettingsWithNote: (note: string) => string;
113
125
  footerSignIn: string;
@@ -119,6 +131,10 @@ export declare const DEFAULT_SIDEBAR_LABELS: {
119
131
  useSpaces: string;
120
132
  useSpacesDescription: string;
121
133
  yourSpaces: string;
134
+ spacesHome: string;
135
+ spacesHomeDescription: string;
136
+ spacesHomeLocal: string;
137
+ spacesHomeOffline: (name: string) => string;
122
138
  addSpace: string;
123
139
  newSpaceName: (n: number) => string;
124
140
  defaultSpaceName: string;
@@ -247,6 +263,15 @@ export declare const DEFAULT_SIDEBAR_LABELS: {
247
263
  stoppedByYou: string;
248
264
  retry: string;
249
265
  retryHint: string;
266
+ retryEnvironmentHint: string;
267
+ environmentRepaired: {
268
+ lost: string;
269
+ unreachable: string;
270
+ };
271
+ retryEnvironmentLostTitle: string;
272
+ retryEnvironmentLostDetail: string;
273
+ retryEnvironmentLostSandboxDetail: string;
274
+ retryEnvironmentLostConfirm: string;
250
275
  continueRun: string;
251
276
  continueHint: string;
252
277
  resetsAt: (time: string) => string;
@@ -688,6 +713,7 @@ export declare const DEFAULT_SIDEBAR_LABELS: {
688
713
  selectTurnCopied: string;
689
714
  selectTurnNothingToCopy: string;
690
715
  selectTurnForkFailed: string;
716
+ promptRail: string;
691
717
  copy: string;
692
718
  copied: string;
693
719
  copyCode: string;
@@ -70,7 +70,15 @@ const DEFAULT_SIDEBAR_LABELS = {
70
70
  environmentSettingUp: (where) => `${where}. Setting up…`,
71
71
  environmentSettingUpStep: (where, step) => `${where}. ${step}…`,
72
72
  environmentSetupFailed: (where, error) => `${where}. Setup failed${error ? `: ${error}` : "."}`,
73
+ /** It stopped answering after setup, and the host is reconnecting. */
74
+ environmentReconnecting: (where) => `${where}. Reconnecting…`,
75
+ /** It broke after setup: gone for good (`lost`). */
76
+ environmentGone: (where, error) => `${where}. Gone${error ? `: ${error}` : "."}`,
77
+ /** It broke after setup: not answering, and the host stopped reconnecting (`unreachable`). */
78
+ environmentNotAnswering: (where, error) => `${where}. Not answering${error ? `: ${error}` : "."}`,
73
79
  environmentPaused: (where) => `${where}. Paused while idle, resumes on your next prompt.`,
80
+ environmentResuming: (where) => `${where}. Resuming…`,
81
+ environmentRemoved: (where) => `${where}. Sandbox deleted, a new one is set up on your next prompt.`,
74
82
  menuRename: "Rename",
75
83
  menuAddFavorite: "Add to favorites",
76
84
  menuRemoveFavorite: "Remove from favorites",
@@ -82,6 +90,7 @@ const DEFAULT_SIDEBAR_LABELS = {
82
90
  menuOpenChatWindow: "Open conversation in new window",
83
91
  menuOpenPanelsWindow: "Open side panels in new window",
84
92
  menuRetryEnvironment: "Retry environment setup",
93
+ menuWakeEnvironment: "Wake up environment",
85
94
  menuMoveTo: "Move to…",
86
95
  menuMoveToSpace: "Move to space",
87
96
  menuDelete: "Delete",
@@ -117,6 +126,9 @@ const DEFAULT_SIDEBAR_LABELS = {
117
126
  moveProjectFailed: (message) => `Couldn't move the project: ${message}`,
118
127
  environmentActionFailed: (action, message) => `${action} failed: ${message}`,
119
128
  retryEnvironmentFailed: (message) => `Couldn't retry the environment: ${message}`,
129
+ wakeEnvironmentFailed: (message) => `Couldn't wake the environment: ${message}`,
130
+ pauseEnvironmentFailed: (message) => `Couldn't pause the environment: ${message}`,
131
+ deleteEnvironmentFailed: (message) => `Couldn't delete the sandbox: ${message}`,
120
132
  footerSettings: "Settings",
121
133
  footerSettingsWithNote: (note) => `Settings. ${note}`,
122
134
  footerSignIn: "sign in",
@@ -128,6 +140,10 @@ const DEFAULT_SIDEBAR_LABELS = {
128
140
  useSpaces: "Use spaces",
129
141
  useSpacesDescription: "Group sessions into spaces, each with its own defaults for new sessions. Off shows every session in one list.",
130
142
  yourSpaces: "Your spaces",
143
+ spacesHome: "Spaces come from",
144
+ spacesHomeDescription: "Every device with the same home server shows the same spaces.",
145
+ spacesHomeLocal: "This computer",
146
+ spacesHomeOffline: (name) => `${name} is offline. Spaces can't be changed until it is back.`,
131
147
  addSpace: "Add space",
132
148
  newSpaceName: (n) => `Space ${n}`,
133
149
  defaultSpaceName: "Default",
@@ -21,14 +21,17 @@ type ThinkingRow = Extract<Row, {
21
21
  type SetupRow = Extract<Row, {
22
22
  kind: 'environment-setup';
23
23
  }>;
24
+ type CompactRow = Extract<Row, {
25
+ kind: 'compact-summary';
26
+ }>;
24
27
  /** `waiting`: a `spawn` call that has not started yet, every slot being taken. */
25
28
  export type FoldActionState = 'waiting' | 'running' | 'ok' | 'err';
26
- /** One overview line of a folded exchange: a tool call, a run of thoughts, a worker, or a note. */
29
+ /** One overview line of a folded exchange: a tool call, a run of thoughts, a worker, a note, or a compaction. */
27
30
  export interface FoldActionItem {
28
31
  /** Stable per action (its first row's id), so lists animate entries, not text changes. */
29
32
  id: string;
30
- /** What the line stands for: a `tool` call, consecutive `thought` segments, a `worker` (subagent), a `note`, or the environment's `setup`. */
31
- kind: 'tool' | 'thought' | 'worker' | 'note' | 'setup';
33
+ /** What the line stands for: a `tool` call, consecutive `thought` segments, a `worker` (subagent), a `note`, the environment's `setup`, or a `compact`ion the run went through. */
34
+ kind: 'tool' | 'thought' | 'worker' | 'note' | 'setup' | 'compact';
32
35
  /** The overview: "Ran bun test", "Read select-stops.ts", "Thought". */
33
36
  label: string;
34
37
  /** Quiet context after the label: a file's directory, "+2" chained commands. */
@@ -64,6 +67,8 @@ export interface FoldActionItem {
64
67
  children?: FoldActionItem[];
65
68
  /** A `setup` line's attempt: its steps and output are the details. */
66
69
  setup?: SetupRow;
70
+ /** A `compact` line's compaction: its model and tokens ride the line, its summary is the details. */
71
+ compact?: CompactRow;
67
72
  }
68
73
  /**
69
74
  * The overview item for one tool call: the shared words, plus what the details show.
@@ -140,6 +140,12 @@ function foldUnits(rows) {
140
140
  kind: "note"
141
141
  });
142
142
  break;
143
+ case "compact-summary":
144
+ units.push({
145
+ item: row,
146
+ kind: "compact"
147
+ });
148
+ break;
143
149
  case "environment-setup": {
144
150
  const state = setupState(row);
145
151
  const { startedAt, endedAt } = row.setup;
@@ -210,6 +216,16 @@ function actionItem(step) {
210
216
  }
211
217
  case "worker": return workerItem(step);
212
218
  case "setup": return setupAction(step.items[0]);
219
+ case "compact": {
220
+ const row = step.items[0];
221
+ return {
222
+ id: row.id,
223
+ kind: "compact",
224
+ label: `${row.compact.replacedCount} turns compacted`,
225
+ state: "ok",
226
+ compact: row
227
+ };
228
+ }
213
229
  case "tool": return callItem(step.call);
214
230
  }
215
231
  }
@@ -39,7 +39,8 @@ export declare function dockRunReceipts(rows: readonly Row[], show: boolean): {
39
39
  * Compact density: fold every exchange's work behind one `exchange-fold`
40
40
  * row. An exchange is the span between two boundary rows (`user-prompt`,
41
41
  * `separator`, `compact-summary`); rows that {@link foldsInCompact} move
42
- * into the fold, which sits RIGHT UNDER the exchange's prompt, ahead of the
42
+ * into the fold, and so does a compaction the run went on after
43
+ * ({@link compactionInRun}), which sits RIGHT UNDER the exchange's prompt, ahead of the
43
44
  * prose (prose written before the first call still reads after the work
44
45
  * indicator, never between the prompt and it).
45
46
  *
@@ -100,7 +100,8 @@ function rowStats(stats) {
100
100
  * Compact density: fold every exchange's work behind one `exchange-fold`
101
101
  * row. An exchange is the span between two boundary rows (`user-prompt`,
102
102
  * `separator`, `compact-summary`); rows that {@link foldsInCompact} move
103
- * into the fold, which sits RIGHT UNDER the exchange's prompt, ahead of the
103
+ * into the fold, and so does a compaction the run went on after
104
+ * ({@link compactionInRun}), which sits RIGHT UNDER the exchange's prompt, ahead of the
104
105
  * prose (prose written before the first call still reads after the work
105
106
  * indicator, never between the prompt and it).
106
107
  *
@@ -159,7 +160,12 @@ function foldExchanges(rows, isStreaming) {
159
160
  folded = [];
160
161
  visible = [];
161
162
  };
162
- for (const row of rows) {
163
+ for (let i = 0; i < rows.length; i++) {
164
+ const row = rows[i];
165
+ if (row.kind === "compact-summary" && boundary?.kind === "user-prompt" && compactionInRun(rows, i, isStreaming)) {
166
+ folded.push(row);
167
+ continue;
168
+ }
163
169
  if (TOOL_GROUP_BOUNDARIES.has(row.kind)) {
164
170
  flush(false);
165
171
  out.push(row);
@@ -172,6 +178,20 @@ function foldExchanges(rows, isStreaming) {
172
178
  flush(true);
173
179
  return out;
174
180
  }
181
+ /**
182
+ * The compaction at `at` happened inside its prompt's run: the run went on
183
+ * after it (anything but another boundary follows, past further
184
+ * compactions), or it is the live tail. Then it is one of the run's steps;
185
+ * a compaction between runs (a manual `/compact`, one the next prompt
186
+ * follows) stays a boundary of its own.
187
+ */
188
+ function compactionInRun(rows, at, isStreaming) {
189
+ for (let i = at + 1; i < rows.length; i++) {
190
+ const kind = rows[i].kind;
191
+ if (kind !== "compact-summary") return !TOOL_GROUP_BOUNDARIES.has(kind);
192
+ }
193
+ return isStreaming;
194
+ }
175
195
  const REBASED = /* @__PURE__ */ new WeakMap();
176
196
  /**
177
197
  * A worker's (subagent's) own rows folded like an exchange of the main
@@ -6,7 +6,8 @@ import { dockRunReceipts, dotVariantFor, findLastStreamingRow, foldExchanges, fo
6
6
  import { FoldActionItem, FoldActionState, foldActionItems, toolAction } from "./fold-actions.js";
7
7
  import { nestToolCalls, nestedCallVisible } from "./nesting.js";
8
8
  import { PairingResult, ToolPairing, pairToolEvents } from "./pairing.js";
9
+ import { EMPTY_RAIL, RailExchange, RailModel, TranscriptRailState, TranscriptRailStore, computeRailModel, createTranscriptRailStore, dataRowSelector, plainPreview, sameRail } from "./rail.js";
9
10
  import { BashExitMeta, Cluster, DotVariant, ExchangeFoldStats, GroupCluster, Owned, Row, SpawnMeta, TaskInfo, ToolRowModel, firstRowId, parseBashExitMeta } from "./rows.js";
10
11
  import { RunFailure, failureTooltip, markRunFailures } from "./run-failures.js";
11
12
  import { SelectStops, computeSelectStops, rowTurnIds, stopForRow } from "./select-stops.js";
12
- export { type AuthCardPlan, type AuthFixes, type AuthSettingsTarget, type BashExitMeta, type Cluster, type DotVariant, type ExchangeFoldStats, type ExchangeMedium, type FoldActionItem, type FoldActionState, type GroupCluster, type MediaRef, type Owned, type PairingResult, type Row, type RunFailure, type SelectStops, type SpawnMeta, type TaskInfo, type ToolPairing, type ToolRowModel, authFailureDetails, batchTaskRuns, batchThinkingRuns, batchToolRuns, clusterByOwner, collapseEvents, computeSelectStops, createAuthFixes, dockRunReceipts, dotVariantFor, exchangesMedia, failureTooltip, findLastStreamingRow, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, inheritRowIdentity, isAuthFixed, markRunFailures, mediaRefsOf, mediumKey, nestToolCalls, nestedCallVisible, pairToolEvents, parseBashExitMeta, planAuthCard, refusedSpawn, rowTurnIds, stopForRow, toolAction, toolFailed };
13
+ export { type AuthCardPlan, type AuthFixes, type AuthSettingsTarget, type BashExitMeta, type Cluster, type DotVariant, EMPTY_RAIL, type ExchangeFoldStats, type ExchangeMedium, type FoldActionItem, type FoldActionState, type GroupCluster, type MediaRef, type Owned, type PairingResult, type RailExchange, type RailModel, type Row, type RunFailure, type SelectStops, type SpawnMeta, type TaskInfo, type ToolPairing, type ToolRowModel, type TranscriptRailState, type TranscriptRailStore, authFailureDetails, batchTaskRuns, batchThinkingRuns, batchToolRuns, clusterByOwner, collapseEvents, computeRailModel, computeSelectStops, createAuthFixes, createTranscriptRailStore, dataRowSelector, dockRunReceipts, dotVariantFor, exchangesMedia, failureTooltip, findLastStreamingRow, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, inheritRowIdentity, isAuthFixed, markRunFailures, mediaRefsOf, mediumKey, nestToolCalls, nestedCallVisible, pairToolEvents, parseBashExitMeta, plainPreview, planAuthCard, refusedSpawn, rowTurnIds, sameRail, stopForRow, toolAction, toolFailed };
@@ -6,7 +6,8 @@ import { dockRunReceipts, dotVariantFor, findLastStreamingRow, foldExchanges, fo
6
6
  import { foldActionItems, toolAction } from "./fold-actions.js";
7
7
  import { nestToolCalls, nestedCallVisible } from "./nesting.js";
8
8
  import { pairToolEvents } from "./pairing.js";
9
+ import { EMPTY_RAIL, computeRailModel, createTranscriptRailStore, dataRowSelector, plainPreview, sameRail } from "./rail.js";
9
10
  import { firstRowId, parseBashExitMeta } from "./rows.js";
10
11
  import { failureTooltip, markRunFailures } from "./run-failures.js";
11
12
  import { computeSelectStops, rowTurnIds, stopForRow } from "./select-stops.js";
12
- export { authFailureDetails, batchTaskRuns, batchThinkingRuns, batchToolRuns, clusterByOwner, collapseEvents, computeSelectStops, createAuthFixes, dockRunReceipts, dotVariantFor, exchangesMedia, failureTooltip, findLastStreamingRow, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, inheritRowIdentity, isAuthFixed, markRunFailures, mediaRefsOf, mediumKey, nestToolCalls, nestedCallVisible, pairToolEvents, parseBashExitMeta, planAuthCard, refusedSpawn, rowTurnIds, stopForRow, toolAction, toolFailed };
13
+ export { EMPTY_RAIL, authFailureDetails, batchTaskRuns, batchThinkingRuns, batchToolRuns, clusterByOwner, collapseEvents, computeRailModel, computeSelectStops, createAuthFixes, createTranscriptRailStore, dataRowSelector, dockRunReceipts, dotVariantFor, exchangesMedia, failureTooltip, findLastStreamingRow, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, inheritRowIdentity, isAuthFixed, markRunFailures, mediaRefsOf, mediumKey, nestToolCalls, nestedCallVisible, pairToolEvents, parseBashExitMeta, plainPreview, planAuthCard, refusedSpawn, rowTurnIds, sameRail, stopForRow, toolAction, toolFailed };