zidane-ui 9.3.1 → 9.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/dist/adapters/live.d.ts +2 -0
  2. package/dist/adapters/live.js +3 -0
  3. package/dist/adapters/server-git-host.js +5 -2
  4. package/dist/adapters/server-host.js +17 -11
  5. package/dist/adapters/server-machines-host.js +7 -0
  6. package/dist/adapters/server-session-host.js +49 -0
  7. package/dist/adapters/server-settings-sections.js +4 -1
  8. package/dist/adapters/sse-host.js +3 -0
  9. package/dist/adapters/sse-protocol.d.ts +10 -0
  10. package/dist/appearance/ZoomIndicator.js +5 -8
  11. package/dist/chat/HostTranscript.js +15 -1
  12. package/dist/chat/SessionStreamsProvider.d.ts +1 -1
  13. package/dist/chat/Transcript.d.ts +3 -2
  14. package/dist/chat/Transcript.js +26 -7
  15. package/dist/chat/composer/ComposerEditor.js +1 -1
  16. package/dist/chat/composer/ModelOptionsPicker.js +6 -2
  17. package/dist/chat/composer/ModelPicker.d.ts +1 -1
  18. package/dist/chat/composer/PlacePicker.d.ts +3 -1
  19. package/dist/chat/composer/PlacePicker.js +5 -1
  20. package/dist/chat/composer/use-draft-target.js +15 -3
  21. package/dist/chat/headless/block-runs.js +26 -1
  22. package/dist/chat/headless/chip-views.js +1 -1
  23. package/dist/chat/headless/draft-target.d.ts +28 -1
  24. package/dist/chat/headless/draft-target.js +22 -1
  25. package/dist/chat/headless/hosts.d.ts +4 -0
  26. package/dist/chat/headless/index.d.ts +25 -25
  27. package/dist/chat/headless/index.js +6 -6
  28. package/dist/chat/headless/markdown-scan.d.ts +0 -2
  29. package/dist/chat/headless/markdown-scan.js +3 -8
  30. package/dist/chat/headless/markdown-stream.js +3 -3
  31. package/dist/chat/headless/prompt-origin.d.ts +2 -0
  32. package/dist/chat/headless/prompt-origin.js +6 -2
  33. package/dist/chat/headless/sidebar/directory.d.ts +10 -1
  34. package/dist/chat/headless/sidebar/directory.js +9 -1
  35. package/dist/chat/headless/sidebar/environment.d.ts +15 -4
  36. package/dist/chat/headless/sidebar/environment.js +27 -9
  37. package/dist/chat/headless/sidebar/index.d.ts +2 -2
  38. package/dist/chat/headless/sidebar/index.js +2 -2
  39. package/dist/chat/headless/sidebar/labels.d.ts +9 -2
  40. package/dist/chat/headless/sidebar/labels.js +8 -1
  41. package/dist/chat/headless/streams/actions.d.ts +2 -2
  42. package/dist/chat/headless/streams/actions.js +1 -1
  43. package/dist/chat/headless/streams/event-bytes.d.ts +12 -1
  44. package/dist/chat/headless/streams/event-bytes.js +13 -1
  45. package/dist/chat/headless/streams/store.d.ts +21 -5
  46. package/dist/chat/headless/streams/store.js +36 -7
  47. package/dist/chat/headless/streams/transcript-map.js +2 -5
  48. package/dist/chat/headless/streams/types.d.ts +2 -1
  49. package/dist/chat/headless/transcript/collapse.js +3 -0
  50. package/dist/chat/index.d.ts +2 -2
  51. package/dist/chat/index.js +2 -2
  52. package/dist/chat/sidebar/ProjectIcon.js +1 -1
  53. package/dist/chat/sidebar/RowChips.js +2 -2
  54. package/dist/chat/sidebar/SessionSidebar.d.ts +6 -0
  55. package/dist/chat/sidebar/SessionSidebar.js +23 -16
  56. package/dist/chat/sidebar/SidebarFilterMenu.js +0 -1
  57. package/dist/chat/sidebar/SidebarFold.js +17 -16
  58. package/dist/chat/sidebar/SidebarSessionRow.d.ts +7 -1
  59. package/dist/chat/sidebar/SidebarSessionRow.js +11 -8
  60. package/dist/chat/sidebar/session-menu.d.ts +4 -0
  61. package/dist/chat/sidebar/session-menu.js +14 -2
  62. package/dist/chat/sidebar/sidebar-live.js +28 -4
  63. package/dist/chat/sidebar/useInboxRows.js +6 -6
  64. package/dist/chat/sidebar/useInboxTriage.js +50 -47
  65. package/dist/chat/sidebar/useSessionSearch.js +19 -18
  66. package/dist/chat/transcript/FileChip.js +28 -0
  67. package/dist/chat/transcript/LazyRow.d.ts +1 -1
  68. package/dist/chat/transcript/LazyRow.js +3 -4
  69. package/dist/chat/transcript/PromptEcho.js +3 -11
  70. package/dist/chat/transcript/SessionChip.d.ts +11 -0
  71. package/dist/chat/transcript/SessionChip.js +34 -0
  72. package/dist/chat/transcript/TranscriptRail.d.ts +1 -1
  73. package/dist/chat/transcript/chip-details.d.ts +11 -0
  74. package/dist/chat/transcript/chip-details.js +17 -1
  75. package/dist/chat/transcript/fold-worker.js +2 -1
  76. package/dist/chat/transcript/fold.js +11 -3
  77. package/dist/chat/transcript/index.d.ts +2 -2
  78. package/dist/chat/transcript/index.js +2 -2
  79. package/dist/chat/transcript/markdown-cache.d.ts +10 -1
  80. package/dist/chat/transcript/markdown-cache.js +37 -4
  81. package/dist/chat/transcript/markdown.js +27 -34
  82. package/dist/chat/transcript/media-gallery.js +13 -16
  83. package/dist/chat/transcript/messages.js +5 -4
  84. package/dist/chat/transcript/prompt.d.ts +1 -1
  85. package/dist/chat/transcript/row-mount.d.ts +27 -8
  86. package/dist/chat/transcript/row-mount.js +114 -80
  87. package/dist/chat/transcript/row-parking.d.ts +27 -0
  88. package/dist/chat/transcript/row-parking.js +37 -1
  89. package/dist/chat/transcript/script-input.d.ts +1 -1
  90. package/dist/chat/transcript/tool-parts.js +0 -1
  91. package/dist/chat/transcript/use-transcript-rows.d.ts +1 -1
  92. package/dist/chat/transcript/useHistoryBackfill.d.ts +42 -0
  93. package/dist/chat/transcript/useHistoryBackfill.js +170 -0
  94. package/dist/chat/transcript/useTranscriptFind.js +2 -4
  95. package/dist/chat/transcript/useTranscriptScroll.d.ts +7 -4
  96. package/dist/chat/transcript/useTranscriptScroll.js +12 -1
  97. package/dist/chat/transcript/useTranscriptSearch.d.ts +2 -2
  98. package/dist/chat/transcript/useTranscriptSearch.js +6 -6
  99. package/dist/chat/transcript/useTranscriptSelectionCopy.d.ts +5 -5
  100. package/dist/chat/transcript/useTranscriptSelectionCopy.js +28 -7
  101. package/dist/code/editor/FileTree.d.ts +2 -0
  102. package/dist/code/editor/FileTree.js +1 -1
  103. package/dist/code/editor/FileView.js +16 -25
  104. package/dist/code/editor/find/useFind.js +17 -17
  105. package/dist/code/editor/useCodeDocument.js +22 -19
  106. package/dist/code/editor/useDetachCleanup.js +4 -3
  107. package/dist/code/use-highlighted-html.js +12 -13
  108. package/dist/components/IconButton.d.ts +3 -1
  109. package/dist/components/IconButton.js +7 -2
  110. package/dist/components/IconButtonTip.d.ts +3 -1
  111. package/dist/components/IconButtonTip.js +2 -1
  112. package/dist/components/RowActionsMenu.js +7 -14
  113. package/dist/components/Tooltip.d.ts +4 -1
  114. package/dist/components/Tooltip.js +8 -6
  115. package/dist/components/assign-ref.d.ts +8 -0
  116. package/dist/components/assign-ref.js +12 -0
  117. package/dist/components/floating/FloatingSurface.js +2 -2
  118. package/dist/components/floating/HoverCard.js +32 -14
  119. package/dist/components/floating/Popover.js +4 -7
  120. package/dist/components/floating/useAnchoredPosition.d.ts +5 -3
  121. package/dist/components/floating/useAnchoredPosition.js +7 -7
  122. package/dist/components/object-key.d.ts +7 -0
  123. package/dist/components/object-key.js +18 -0
  124. package/dist/components/palette/PaletteList.js +2 -7
  125. package/dist/components/tooltip-arming.d.ts +3 -0
  126. package/dist/components/tooltip-arming.js +8 -1
  127. package/dist/core.css +3 -3
  128. package/dist/dist/{index-C6-t1SS9.d.ts → index-BheVJOLc.d.ts} +1 -0
  129. package/dist/dist/index.d.ts +2 -2
  130. package/dist/files/FilesTab.js +0 -1
  131. package/dist/files/TreeColumn.d.ts +2 -4
  132. package/dist/files/TreeColumn.js +0 -5
  133. package/dist/files/headless/host.d.ts +3 -7
  134. package/dist/files/headless/labels.d.ts +0 -1
  135. package/dist/files/headless/labels.js +0 -1
  136. package/dist/files/headless/workspace-diff.js +1 -1
  137. package/dist/files/useCodeReview.js +1 -3
  138. package/dist/files/useFilesDiagnostics.d.ts +1 -1
  139. package/dist/files/useFilesDiagnostics.js +4 -11
  140. package/dist/files/useOpenFiles.js +9 -12
  141. package/dist/files/useWorkspace.d.ts +5 -7
  142. package/dist/files/useWorkspace.js +4 -15
  143. package/dist/git/GitBar.js +5 -3
  144. package/dist/git/MoveSessionDialog.d.ts +18 -8
  145. package/dist/git/MoveSessionDialog.js +32 -53
  146. package/dist/git/MoveToDialog.d.ts +61 -0
  147. package/dist/git/MoveToDialog.js +240 -0
  148. package/dist/git/SandboxManager.js +9 -4
  149. package/dist/git/SyncChip.js +11 -4
  150. package/dist/git/TeleportSessionDialog.d.ts +69 -0
  151. package/dist/git/TeleportSessionDialog.js +440 -0
  152. package/dist/git/headless/host.d.ts +14 -0
  153. package/dist/git/headless/index.d.ts +2 -1
  154. package/dist/git/headless/index.js +2 -1
  155. package/dist/git/headless/labels.d.ts +44 -1
  156. package/dist/git/headless/labels.js +50 -0
  157. package/dist/git/headless/sandboxes.d.ts +1 -1
  158. package/dist/git/headless/sandboxes.js +4 -3
  159. package/dist/git/headless/teleport.d.ts +76 -0
  160. package/dist/git/headless/teleport.js +19 -0
  161. package/dist/git/index.d.ts +4 -2
  162. package/dist/git/index.js +4 -2
  163. package/dist/git/useEnvironmentChoices.d.ts +5 -2
  164. package/dist/git/useEnvironmentChoices.js +12 -4
  165. package/dist/hooks/useLatest.d.ts +8 -0
  166. package/dist/hooks/useLatest.js +17 -0
  167. package/dist/hooks/useMinuteTick.d.ts +6 -2
  168. package/dist/hooks/useMinuteTick.js +12 -6
  169. package/dist/hooks/useNearViewport.js +11 -8
  170. package/dist/index.d.ts +3 -2
  171. package/dist/index.js +2 -1
  172. package/dist/keybindings/KeybindingsProvider.js +3 -4
  173. package/dist/keybindings/headless/catalog.d.ts +1 -1
  174. package/dist/keybindings/headless/catalog.js +18 -0
  175. package/dist/machines/AddServerForm.js +55 -3
  176. package/dist/machines/Banners.d.ts +2 -2
  177. package/dist/machines/Banners.js +3 -3
  178. package/dist/machines/DaemonMenu.js +1 -3
  179. package/dist/machines/HostsSection.js +5 -1
  180. package/dist/machines/OrganizationPanel.d.ts +25 -0
  181. package/dist/machines/OrganizationPanel.js +266 -0
  182. package/dist/machines/PersonalLayerPanel.d.ts +32 -0
  183. package/dist/machines/PersonalLayerPanel.js +360 -0
  184. package/dist/machines/headless/fixture-host.d.ts +10 -0
  185. package/dist/machines/headless/fixture-host.js +44 -0
  186. package/dist/machines/headless/host.d.ts +21 -1
  187. package/dist/machines/headless/index.d.ts +3 -1
  188. package/dist/machines/headless/index.js +3 -1
  189. package/dist/machines/headless/labels.d.ts +55 -0
  190. package/dist/machines/headless/labels.js +58 -1
  191. package/dist/machines/headless/layer.d.ts +64 -0
  192. package/dist/machines/headless/layer.js +56 -0
  193. package/dist/machines/headless/organization.d.ts +38 -0
  194. package/dist/machines/headless/organization.js +44 -0
  195. package/dist/machines/index.d.ts +3 -1
  196. package/dist/machines/index.js +3 -1
  197. package/dist/machines/testing/contract.d.ts +25 -1
  198. package/dist/machines/testing/contract.js +97 -1
  199. package/dist/motion/grow.js +12 -13
  200. package/dist/motion/swap.js +2 -5
  201. package/dist/motion/use-flip-list.d.ts +14 -0
  202. package/dist/motion/use-flip-list.js +17 -12
  203. package/dist/palette/headless/app-sources.js +37 -0
  204. package/dist/palette/headless/labels.js +3 -0
  205. package/dist/server/sse-handler.js +25 -2
  206. package/dist/session/DiffFileTree.js +1 -4
  207. package/dist/session/OpenSessionsDialog.d.ts +46 -0
  208. package/dist/session/OpenSessionsDialog.js +170 -0
  209. package/dist/session/PlanTracker.js +1 -2
  210. package/dist/session/ProjectHome.js +10 -9
  211. package/dist/session/RemindersPanel.js +10 -12
  212. package/dist/session/SecretsPanel.js +2 -1
  213. package/dist/session/SessionPeopleStack.d.ts +23 -0
  214. package/dist/session/SessionPeopleStack.js +65 -0
  215. package/dist/session/SessionPlaceMenu.js +5 -4
  216. package/dist/session/ShareSessionDialog.d.ts +32 -0
  217. package/dist/session/ShareSessionDialog.js +342 -0
  218. package/dist/session/TypingLine.d.ts +22 -0
  219. package/dist/session/TypingLine.js +31 -0
  220. package/dist/session/headless/host.d.ts +40 -1
  221. package/dist/session/headless/index.d.ts +4 -2
  222. package/dist/session/headless/index.js +3 -1
  223. package/dist/session/headless/labels.d.ts +49 -0
  224. package/dist/session/headless/labels.js +56 -0
  225. package/dist/session/headless/people.d.ts +29 -0
  226. package/dist/session/headless/people.js +53 -0
  227. package/dist/session/headless/place.d.ts +5 -0
  228. package/dist/session/headless/place.js +5 -1
  229. package/dist/session/headless/typing.d.ts +37 -0
  230. package/dist/session/headless/typing.js +60 -0
  231. package/dist/session/index.d.ts +5 -1
  232. package/dist/session/index.js +5 -1
  233. package/dist/settings/headless/search.d.ts +1 -1
  234. package/dist/settings/headless/sections-host.d.ts +7 -2
  235. package/dist/settings/section.d.ts +15 -3
  236. package/dist/settings/section.js +15 -3
  237. package/dist/settings/sections/environments/EnvironmentsSection.js +30 -6
  238. package/dist/settings/sections/keybindings/labels.d.ts +3 -0
  239. package/dist/settings/sections/keybindings/labels.js +3 -0
  240. package/dist/settings/sections/keybindings/rows.js +12 -0
  241. package/dist/settings/sections/logs/LogsSection.js +5 -8
  242. package/dist/styles.css +32 -7
  243. package/dist/terminal/HostTerminalSurface.js +28 -30
  244. package/dist/terminal/TerminalPanel.js +4 -12
  245. package/dist/terminal/TerminalProvider.d.ts +10 -2
  246. package/dist/terminal/TerminalProvider.js +10 -2
  247. package/dist/terminal/headless/labels.d.ts +0 -1
  248. package/dist/terminal/headless/labels.js +1 -2
  249. package/dist/terminal/headless/store.js +5 -1
  250. package/dist/workspace/LayoutBudget.js +1 -7
  251. package/package.json +2 -2
  252. package/src/styles/chat.css +3 -1
  253. package/src/styles/palette.css +3 -3
  254. package/src/styles/transcript.css +17 -3
  255. /package/dist/dist/{index-De9AbmxS.d.ts → index-ttmMvjgM.d.ts} +0 -0
@@ -76,8 +76,11 @@ const DEFAULT_SIDEBAR_LABELS = {
76
76
  environmentGone: (where, error) => `${where}. Gone${error ? `: ${error}` : "."}`,
77
77
  /** It broke after setup: not answering, and the host stopped reconnecting (`unreachable`). */
78
78
  environmentNotAnswering: (where, error) => `${where}. Not answering${error ? `: ${error}` : "."}`,
79
- environmentPaused: (where) => `${where}. Paused while idle, resumes on your next prompt.`,
79
+ environmentPaused: (where) => `${where}. Paused, resumes on your next prompt.`,
80
80
  environmentResuming: (where) => `${where}. Resuming…`,
81
+ environmentPausing: (where) => `${where}. Pausing…`,
82
+ environmentDeletingSandbox: (where) => `${where}. Deleting the sandbox…`,
83
+ environmentRunningAction: (where, action) => `${where}. ${action ? `${action}…` : "Working…"}`,
81
84
  environmentRemoved: (where) => `${where}. Sandbox deleted, a new one is set up on your next prompt.`,
82
85
  menuRename: "Rename",
83
86
  menuAddFavorite: "Add to favorites",
@@ -92,6 +95,10 @@ const DEFAULT_SIDEBAR_LABELS = {
92
95
  menuRetryEnvironment: "Retry environment setup",
93
96
  menuWakeEnvironment: "Wake up environment",
94
97
  menuMoveTo: "Move to…",
98
+ menuTeleportTo: "Teleport to…",
99
+ menuShare: "Share…",
100
+ /** The open session was teleported to a host this app does not know. */
101
+ sessionMovedTo: (host) => `This session moved to ${host}.`,
95
102
  menuMoveToSpace: "Move to space",
96
103
  menuDelete: "Delete",
97
104
  newSessionIn: (project) => `New session in ${project}`,
@@ -43,8 +43,8 @@ export interface SessionStreamActions<K extends string = string> {
43
43
  setEventsPage: (sessionId: K, page: SessionStreamPage) => void;
44
44
  /** Brings the session's window back in step after its signals may have gone missing (the reconnect ladder's last steps). */
45
45
  resync: (sessionId: K) => void;
46
- /** Seeds the session's `SYSTEM.md` override. */
47
- seedSystemMd: (sessionId: K, file: SystemMdFile | null) => void;
46
+ /** Seeds the session's `SYSTEM.md` override from `read`, unless a signal lands first. */
47
+ seedSystemMd: (sessionId: K, read: () => Promise<SystemMdFile | null | undefined>) => Promise<void>;
48
48
  /** Names the session the user reads: its run-end compaction waits until it is backgrounded. */
49
49
  noteActiveSession: (sessionId: K | null) => void;
50
50
  /** Fetches and splices the page before the window. `false` when no fetch started. */
@@ -13,7 +13,7 @@ function createSessionStreamActions(streams) {
13
13
  evictExcept: (keep) => streams.evictExcept(keep),
14
14
  setEventsPage: (sessionId, page) => streams.setEventsPage(sessionId, page),
15
15
  resync: (sessionId) => streams.resync(sessionId),
16
- seedSystemMd: (sessionId, file) => store.seedSystemMd(sessionId, file),
16
+ seedSystemMd: (sessionId, read) => store.seedSystemMd(sessionId, read),
17
17
  loadEarlier: (sessionId, options) => streams.loadEarlier(sessionId, options),
18
18
  appendUserPrompt: (sessionId, text, refs, attachments, clientMessageId) => store.appendUserPrompt(sessionId, text, refs, attachments, clientMessageId),
19
19
  dropPendingEcho: (sessionId, text) => store.dropPendingEcho(sessionId, text),
@@ -3,4 +3,15 @@
3
3
  *
4
4
  * @param events - A session's rows.
5
5
  */
6
- export declare function eventsBytes(events: readonly unknown[]): number;
6
+ export declare function eventsBytes(events: readonly unknown[]): number;
7
+ /**
8
+ * The approximate size of a transcript store's rows: each settled exchange is measured once.
9
+ *
10
+ * @param transcript - The open exchange (`tail`) and the settled ones (`chunks`).
11
+ * @param transcript.tail - The open exchange.
12
+ * @param transcript.chunks - The settled exchanges.
13
+ */
14
+ export declare function transcriptBytes(transcript: {
15
+ tail: readonly unknown[];
16
+ chunks: readonly (readonly unknown[])[];
17
+ }): number;
@@ -31,4 +31,16 @@ function eventsBytes(events) {
31
31
  }
32
32
  return bytes;
33
33
  }
34
- export { eventsBytes };
34
+ /**
35
+ * The approximate size of a transcript store's rows: each settled exchange is measured once.
36
+ *
37
+ * @param transcript - The open exchange (`tail`) and the settled ones (`chunks`).
38
+ * @param transcript.tail - The open exchange.
39
+ * @param transcript.chunks - The settled exchanges.
40
+ */
41
+ function transcriptBytes(transcript) {
42
+ let bytes = eventsBytes(transcript.tail);
43
+ for (const chunk of transcript.chunks) bytes += eventsBytes(chunk);
44
+ return bytes;
45
+ }
46
+ export { eventsBytes, transcriptBytes };
@@ -16,7 +16,7 @@ import { DrainPlan } from "./pacer.js";
16
16
  import { FrameScheduler } from "./scheduler.js";
17
17
  import { OtherStreamSignal, SessionFallbackModel, SessionPageState, SessionRetryState, SessionStreamPage, SessionStreamSignal } from "./types.js";
18
18
  import { HistoryChange, HistorySince, MarkdownDeltaOptions, PromptSegmentRef, TranscriptEvents } from "zidane/chat/pure";
19
- import { SystemMdFile } from "zidane/chat";
19
+ import { Owner, SystemMdFile } from "zidane/chat";
20
20
  /** A prompt this client appended optimistically, awaiting its host echo (`SessionStreamStore.pendingEchoes`). */
21
21
  export interface PendingEcho {
22
22
  /** The prompt text. */
@@ -93,6 +93,8 @@ export declare class SessionStreamStore<K extends string = string> {
93
93
  * guidance — and does so without erroring.
94
94
  */
95
95
  private _systemMd;
96
+ /** How many `system-md` signals each session got: a seed read that one landed during is older than it (`seedSystemMd`). */
97
+ private _systemMdSignals;
96
98
  /**
97
99
  * Per-session provider-retry state. Cleared on `run:end` rather than
98
100
  * `run:start`: a terminal stream failure never streams again, so run end is
@@ -215,13 +217,15 @@ export declare class SessionStreamStore<K extends string = string> {
215
217
  * most common flow rather than an edge case, which is the wrong direction
216
218
  * for a warning that the built-in doctrine has been replaced.
217
219
  *
218
- * Skipped while a live signal already holds a value for the session: the
219
- * push is authoritative and may have landed while this fetch was in flight.
220
+ * Every show reads again, and the answer replaces what the store holds: a
221
+ * window not subscribed to the session missed the signals of its rebuilds
222
+ * (`SIGNAL_SCOPE`), so a value held from before can be stale. Dropped when
223
+ * a live signal landed while the read was in flight: the push is newer.
220
224
  *
221
225
  * @param sessionId - The session.
222
- * @param file - The override, or `null` for none.
226
+ * @param read - Reads the override: `null` for none, `undefined` when the host has no answer (no live agent).
223
227
  */
224
- seedSystemMd(sessionId: K, file: SystemMdFile | null): void;
228
+ seedSystemMd(sessionId: K, read: () => Promise<SystemMdFile | null | undefined>): Promise<void>;
225
229
  /**
226
230
  * Stable-reference snapshot of the active `SYSTEM.md` override, for
227
231
  * `useSyncExternalStore` (compared by identity, and the stored object is the
@@ -558,6 +562,18 @@ export declare class SessionStreamStore<K extends string = string> {
558
562
  * turned on. A row that a reload replaced is left alone.
559
563
  */
560
564
  private _bindLocalPrompt;
565
+ /**
566
+ * The loop changed a turn's text after it streamed (`turn:end.text`): the
567
+ * owner's streamed markdown rows of the turn become the saved text blocks,
568
+ * as a reload shows them. A turn with no streamed row here is left alone.
569
+ *
570
+ * @param sessionId - The session.
571
+ * @param owner - `'parent'` or the subagent's id.
572
+ * @param turnId - The turn whose text changed.
573
+ * @param text - The saved text blocks, in order.
574
+ */
575
+ replaceTurnText(sessionId: K, owner: Owner, turnId: string, text: readonly string[]): void;
576
+ private _replaceTurnText;
561
577
  /** Drop a stalled attempt's reasoning lane: the retry (or next model) streams its own, and the saved turn never holds it. */
562
578
  private _discardThinking;
563
579
  /**
@@ -4,7 +4,7 @@ import { mergeLiveTail } from "./merge.js";
4
4
  import { mergePromptPreviews, missingPreviewData } from "./prompt-previews.js";
5
5
  import { defaultFrameScheduler } from "./scheduler.js";
6
6
  import { TranscriptMap } from "./transcript-map.js";
7
- import { appendTranscriptEvent, applyHistoryOp, applyHistorySince, dedupeEnvironmentSetups, readFreshness, reconcileEvents, transcriptDiscardThinking } from "zidane/chat/pure";
7
+ import { appendTranscriptEvent, applyHistoryOp, applyHistorySince, dedupeEnvironmentSetups, readFreshness, reconcileEvents, transcriptDiscardThinking, transcriptReplaceTurnText } from "zidane/chat/pure";
8
8
  // src/chat/headless/streams/store.ts
9
9
  const PARENT_OWNER = "parent";
10
10
  /** Numberings a window remembers leaving (`_retiredHistoryIds`). */
@@ -109,6 +109,8 @@ var SessionStreamStore = class {
109
109
  * guidance — and does so without erroring.
110
110
  */
111
111
  _systemMd = /* @__PURE__ */ new Map();
112
+ /** How many `system-md` signals each session got: a seed read that one landed during is older than it (`seedSystemMd`). */
113
+ _systemMdSignals = /* @__PURE__ */ new Map();
112
114
  /**
113
115
  * Per-session provider-retry state. Cleared on `run:end` rather than
114
116
  * `run:start`: a terminal stream failure never streams again, so run end is
@@ -253,14 +255,18 @@ var SessionStreamStore = class {
253
255
  * most common flow rather than an edge case, which is the wrong direction
254
256
  * for a warning that the built-in doctrine has been replaced.
255
257
  *
256
- * Skipped while a live signal already holds a value for the session: the
257
- * push is authoritative and may have landed while this fetch was in flight.
258
+ * Every show reads again, and the answer replaces what the store holds: a
259
+ * window not subscribed to the session missed the signals of its rebuilds
260
+ * (`SIGNAL_SCOPE`), so a value held from before can be stale. Dropped when
261
+ * a live signal landed while the read was in flight: the push is newer.
258
262
  *
259
263
  * @param sessionId - The session.
260
- * @param file - The override, or `null` for none.
264
+ * @param read - Reads the override: `null` for none, `undefined` when the host has no answer (no live agent).
261
265
  */
262
- seedSystemMd(sessionId, file) {
263
- if (this._systemMd.has(sessionId)) return;
266
+ async seedSystemMd(sessionId, read) {
267
+ const signals = this._systemMdSignals.get(sessionId) ?? 0;
268
+ const file = await read();
269
+ if (file === void 0 || (this._systemMdSignals.get(sessionId) ?? 0) !== signals || this._systemMd.get(sessionId) === file) return;
264
270
  this._systemMd.set(sessionId, file);
265
271
  this._notifySession(sessionId);
266
272
  }
@@ -891,9 +897,10 @@ var SessionStreamStore = class {
891
897
  return;
892
898
  }
893
899
  case "turn:end": {
894
- const prior = this._events.transcriptOrEmpty(signal.sessionId);
895
900
  const owner = signal.childId ?? PARENT_OWNER;
896
901
  const had = this._events.has(signal.sessionId);
902
+ if (signal.text && signal.turnId) this._replaceTurnText(signal.sessionId, owner, signal.turnId, signal.text);
903
+ const prior = this._events.transcriptOrEmpty(signal.sessionId);
897
904
  this._events.setTranscript(signal.sessionId, endTurnInTranscript(prior, owner));
898
905
  this._notifySession(signal.sessionId);
899
906
  if (!had) this._notifyHas();
@@ -953,6 +960,7 @@ var SessionStreamStore = class {
953
960
  return;
954
961
  case "system-md":
955
962
  this._systemMd.set(signal.sessionId, signal.file);
963
+ this._systemMdSignals.set(signal.sessionId, (this._systemMdSignals.get(signal.sessionId) ?? 0) + 1);
956
964
  this._notifySession(signal.sessionId);
957
965
  }
958
966
  }
@@ -1088,6 +1096,27 @@ var SessionStreamStore = class {
1088
1096
  this._events.set(sessionId, next);
1089
1097
  this._notifySession(sessionId);
1090
1098
  }
1099
+ /**
1100
+ * The loop changed a turn's text after it streamed (`turn:end.text`): the
1101
+ * owner's streamed markdown rows of the turn become the saved text blocks,
1102
+ * as a reload shows them. A turn with no streamed row here is left alone.
1103
+ *
1104
+ * @param sessionId - The session.
1105
+ * @param owner - `'parent'` or the subagent's id.
1106
+ * @param turnId - The turn whose text changed.
1107
+ * @param text - The saved text blocks, in order.
1108
+ */
1109
+ replaceTurnText(sessionId, owner, turnId, text) {
1110
+ if (this._replaceTurnText(sessionId, owner, turnId, text)) this._notifySession(sessionId);
1111
+ }
1112
+ _replaceTurnText(sessionId, owner, turnId, text) {
1113
+ const events = this._events.transcript(sessionId);
1114
+ if (!events) return false;
1115
+ const next = transcriptReplaceTurnText(events, owner, turnId, text);
1116
+ if (next === events) return false;
1117
+ this._events.setTranscript(sessionId, next);
1118
+ return true;
1119
+ }
1091
1120
  /** Drop a stalled attempt's reasoning lane: the retry (or next model) streams its own, and the saved turn never holds it. */
1092
1121
  _discardThinking(sessionId, source, turnId) {
1093
1122
  const events = this._events.transcript(sessionId);
@@ -1,4 +1,4 @@
1
- import { eventsBytes } from "./event-bytes.js";
1
+ import { transcriptBytes } from "./event-bytes.js";
2
2
  import { emptyTranscript, transcriptArray, transcriptFromArray } from "zidane/chat/pure";
3
3
  // src/chat/headless/streams/transcript-map.ts
4
4
  /**
@@ -67,10 +67,7 @@ var TranscriptMap = class {
67
67
  */
68
68
  bytes(sessionId) {
69
69
  const transcript = this.map.get(sessionId);
70
- if (!transcript) return 0;
71
- let bytes = eventsBytes(transcript.tail);
72
- for (const chunk of transcript.chunks) bytes += eventsBytes(chunk);
73
- return bytes;
70
+ return transcript ? transcriptBytes(transcript) : 0;
74
71
  }
75
72
  has(sessionId) {
76
73
  return this.map.has(sessionId);
@@ -69,13 +69,14 @@ export type SessionStreamSignal<K extends string = string> = {
69
69
  error?: string;
70
70
  detail?: StreamEvent['detail'];
71
71
  } |
72
- /** A turn of the parent (or of the subagent `childId`) ended: its streaming markdown is final. */
72
+ /** A turn of the parent (or of the subagent `childId`) ended: its streaming markdown is final, and is `text` when the host sends it (the saved text blocks, when the loop changed them after they streamed). */
73
73
  {
74
74
  kind: 'turn:end';
75
75
  sessionId: K;
76
76
  turnId?: string;
77
77
  childId?: string;
78
78
  depth?: number;
79
+ text?: string[];
79
80
  } |
80
81
  /** A transcript event; `echo` marks the host repeating a prompt this client may have shown already. */
81
82
  {
@@ -135,6 +135,9 @@ function markdownRow(event, mid) {
135
135
  /**
136
136
  * The one row of the thinking run `events[start..end)`, whose first event has text.
137
137
  *
138
+ * @param events - The events the run is in.
139
+ * @param start - The index of the run's first event.
140
+ * @param end - The index after the run's last event.
138
141
  * @param kid - The run's row id, its per-(turn, owner) ordinal.
139
142
  */
140
143
  function thinkingRow(events, start, end, kid) {
@@ -111,7 +111,7 @@ import { AuthFailureCard, AuthFailureCardProps } from "./transcript/AuthFailureC
111
111
  import { BadgeEffectContext, BadgeMenuBrowser, BadgeMenuComposer, BadgeMenuProvider, BadgeMenuProviderProps, BadgeMenuSystem, OpenBadgeMenu, useBadgeMenu } from "./transcript/BadgeMenu.js";
112
112
  import { BADGE_GLYPH, FileBadgeIcon, FileBadgeIconProps, LinkBadge, LinkBadgeProps, LinkIcon, LinkIconProps, fileBadgeName, fileBadgeSpec, linkGlyph, siteIconValue } from "./transcript/badges.js";
113
113
  import { CardMarkdown, CardMarkdownProps } from "./transcript/CardMarkdown.js";
114
- import { useCommand, useCommitInfo, useReferencedSession, useSkill } from "./transcript/chip-details.js";
114
+ import { useCommand, useCommitInfo, useReferencedSession, useSkill, useTokenSession } from "./transcript/chip-details.js";
115
115
  import { useChipResolution, useResolveChipNow } from "./transcript/chip-resolve.js";
116
116
  import { CHIP_CARD_WIDTH, ChipCard, ChipCardProps, ChipHover, ChipHoverProps } from "./transcript/ChipCard.js";
117
117
  import { CommandCard, CommandCardProps, CommitCard, CommitCardProps, SessionCard, SessionCardProps, SkillCard, SkillCardProps, SkillGroupCard, SkillGroupCardProps } from "./transcript/ChipCards.js";
@@ -177,4 +177,4 @@ import { useWheelHoverPause } from "./transcript/useWheelHoverPause.js";
177
177
  import { MarkdownViews, MarkdownViewsProps } from "./transcript/view-scope.js";
178
178
  import "./transcript/index.js";
179
179
  import { useChatLabels } from "./useChatLabels.js";
180
- export { ATTACHMENT_NOTICE_MS, AUTO_FILL_PAGES, AgentPicker, AgentPickerDialog, AgentPickerDialogProps, AgentPickerProps, AgentProfile, AnsiSpans, type AnsiSpansProps, AnsiText, type AnsiTextProps, AnsweredQuestions, AnsweredQuestionsProps, ApprovalDock, ApprovalDockProps, ArchivedBanner, ArchivedBannerProps, AttachmentIcon, AttachmentIconProps, AttachmentLabelFn, AttachmentLabelParts, AttachmentNotices, AttachmentNoticesProps, AttachmentRefusedError, AttachmentRow, AttachmentRowProps, AttachmentTextState, AttachmentTiles, AttachmentTilesProps, AuthFailureCard, AuthFailureCardProps, BADGE_GLYPH, BadgeEffectContext, BadgeMenuBrowser, BadgeMenuComposer, BadgeMenuProvider, BadgeMenuProviderProps, BadgeMenuSystem, CHIP_CARD_WIDTH, CODE_PANEL, COMMAND_DETAIL_LINE, CardMarkdown, CardMarkdownProps, Caret, CaretProps, ChatProvider, ChatProviderProps, ChipCard, ChipCardProps, ChipHover, ChipHoverProps, ChipOpener, CodeBlockSlotProps, CodemodeScript, type CodemodeScriptProps, CommandCard, CommandCardProps, CommandDetailRow, CommandDetailRowProps, CommandNoteRow, CommandNoteRowProps, CommandScope, CommandScopeContext, CommitCard, CommitCardProps, CompactSummaryRow, CompactSummaryRowProps, Composer, type ComposerAttachment, ComposerBadge, ComposerBadgeTone, ComposerBadges, ComposerBadgesProps, ComposerControls, ComposerControlsProps, ComposerDefaults, ComposerDock, ComposerDockProps, ComposerDraft, ComposerHandle, ComposerHostProvider, ComposerHostProviderProps, ComposerProps, ComposerResult, ComposerRetry, ComposerSearch, ComposerStatusPills, ComposerStatusPillsProps, ComposerSubmit, ComposerTarget, ContextBreakdown, type ContextBreakdownData, ContextBreakdownProps, ContextCost, ContextGauge, ContextOrb, ContextOrbProps, ContextUsage, ConversationBadges, ConversationBadgesProps, Cursor, CvRow, CvRowProps, CycleAgentOptions, DEFAULT_BADGE_ORDER, DEFAULT_TRANSCRIPT_OPTIONS, DEFAULT_TRANSCRIPT_RENDERERS, DaemonOrb, DaemonOrbButton, DaemonOrbButtonProps, DaemonOrbProps, DefaultInlineText, DefaultInlineTextProps, DefaultMarkdown, DefaultMarkdownProps, DefaultPrompt, DefaultPromptProps, DefaultSessionTitle, DefaultSessionTitleProps, DiffLines, DiffLinesProps, DockCard, DockCardProps, DockRow, DockRowProps, Dot, DotProps, DraftPickers, DraftPickersProps, DraftServer, DraftTarget, DraftTargetOptions, DraftTargetRequest, EFFORT_LEVELS, EditDiffBlock, EditDiffBlockProps, EffortLevel, EffortPickerDialog, EffortPickerDialogProps, ElicitationCard, ElicitationCardProps, EnvironmentSetupDetails, EnvironmentSetupDetailsProps, EnvironmentSetupRow, EnvironmentSetupRowProps, ErrorRow, ErrorRowProps, ExchangeFoldRow, ExchangeFoldRowProps, FILL_MIN_PROMPTS, FailedMark, FailedMarkProps, FailureRow, FailureRowProps, FileBadgeIcon, FileBadgeIconProps, FoldHeader, FoldHeaderProps, ForcedRows, GUTTER_STEP_PX, GroupGlyph, GroupGlyphProps, HostAgentPicker, HostAgentPickerProps, HostBadge, HostBadgeProps, HostComposer, HostComposerProps, HostContextOrb, HostContextOrbProps, HostInteractions, HostInteractionsProps, HostModelChainList, HostModelChainListProps, HostModelImages, HostModelOptionsPicker, HostModelOptionsPickerProps, HostModelPicker, HostModelPickerProps, HostPicker, HostPickerProps, HostStatusDot, HostStatusDotProps, HostTranscript, HostTranscriptProps, HostTurnMenuOptions, INLINE_CODE_CLASS, ImageGenerationBlock, ImageGenerationBlockProps, ImageModelList, ImageModelListProps, type ImageModelRow, InboxPanel, InboxPanelProps, InfoRow, InfoRowProps, InlineChipText, InlineChipTextProps, InlineCode, InlineCodeProps, InlineTextSlotProps, InteractionCard, InteractionCardProps, InteractionTool, InteractionToolBody, InteractionToolBodyProps, LazyRow, LazyRowProps, LineState, LinkBadge, LinkBadgeProps, LinkIcon, LinkIconProps, LiveOutput, type LiveOutputProps, LiveScriptsContext, LoadEarlierRow, LoadEarlierRowProps, LoadFullOutputButton, LoadFullOutputButtonProps, MAX_FILE_ATTACHMENT_BYTES, MAX_IMAGE_ATTACHMENT_BYTES, MAX_MATCHES, MAX_MEDIA_ATTACHMENT_BYTES, MAX_TEXT_PREVIEW_BYTES, Markdown, MarkdownContext, MarkdownContextValue, MarkdownDiagrams, MarkdownDiagramsProps, MarkdownImageProps, MarkdownLinkProps, MarkdownProps, MarkdownSlotProps, MarkdownViews, type MarkdownViewsProps, MentionItem, MermaidDiagram, type MermaidDiagramProps, MessageGroupRow, MessageGroupRowProps, type ModelCatalogRow, ModelCatalogState, ModelChainFooter, ModelChainFooterProps, ModelChainHeader, ModelChainHeaderProps, ModelChainImages, ModelChainList, ModelChainListProps, ModelChainPopover, ModelChainPopoverProps, ModelChainRow, ModelChainRowProps, ModelChainRows, ModelChainRowsProps, ModelChainTooltip, ModelChainTooltipProps, ModelChoice, ModelFlag, ModelFlagProps, ModelGroupHeader, ModelGroupHeaderProps, ModelKind, ModelMeta, ModelMetaProps, ModelOption, ModelOptionsPicker, ModelOptionsPickerProps, type ModelPickRef, ModelPicker, ModelPickerDialog, ModelPickerDialogProps, ModelPickerFrame, ModelPickerFrameProps, ModelPickerProps, ModelProviderChip, ModelProviderChipProps, ModelProviderPills, ModelProviderPillsProps, ModelReasoning, ModelReasoningProps, ModelVerdict, ModelVerdictProps, ModelWindow, ModelWindowProps, NO_COMPOSER_HINT, NestedToolCalls, NestedToolCallsProps, NewChatsDefault, NewSessionDefaults, NewSessionModelSource, NoticeRow, NoticeRowProps, OPTION_ICON, OpenBadgeMenu, OpenSessionContext, OrbState, OrderedBadge, PASTE_FOLD_CHAR_THRESHOLD, PASTE_FOLD_LINE_THRESHOLD, ParsedRef, ParsedReferenceUrl, PdfPreview, PdfPreviewProps, PickerGroup, PickerPill, PickerPillProps, PlacePicker, PlacePickerHosts, PlacePickerProps, PlanBody, PlanBodyProps, PlanCard, PlanCardProps, ProjectMenu, ProjectMenuProps, PromptEcho, PromptEchoProps, PromptHistoryProvider, PromptHistoryProviderProps, PromptHistoryValue, PromptLines, PromptLinesProps, PromptSlotProps, ProseMarkdown, ProseMarkdownProps, QuestionField, QuestionFieldProps, QuestionForm, QuestionFormProps, ReadFileBlock, ReadFileBlockProps, RefChip, RefChipProps, RefMatch, ReferenceChip, ReferenceChipProps, ReferenceText, ReferenceTextProps, RepairedRow, RepairedRowProps, RetryPill, RetryPillProps, type RowActionItem, RowContext, RowFrame, RowFrameProps, RowIconsContext, RowPlace, RunEstimateChip, RunEstimateChipProps, RunEstimatesProvider, RunEstimatesProviderProps, RunReceiptInline, RunReceiptInlineProps, RunStatusChip, RunStatusChipProps, RunSummaryRow, RunSummaryRowProps, RunnableCodeBlock, type RunnableCodeBlockProps, ScopeToggle, ScopeToggleProps, ScrollPosition, SearchHighlightStyle, SecretInput, SecretInputProps, SelectCursor, SelectCursorProps, SelectTurnCommands, SelectTurnExit, SelectTurnHint, SelectTurnHintKeys, SelectTurnHintKeysProps, type SelectTurnHintProps, SelectTurnKeysOptions, SelectTurnProvider, SelectTurnProviderProps, SelectTurnState, SelectTurnValue, SendButton, SendButtonProps, SendPromptControls, SendPromptOptions, SendRoute, ServerScopeToggle, ServerScopeToggleProps, SessionActivityFilter, SessionArchiveFilter, SessionCard, SessionCardProps, SessionDotState, SessionEventRow, SessionEventRowProps, SessionFilterAction, SessionFilterAxis, SessionFilterExtra, SessionFilterMenu, SessionFilterMenuProps, SessionFilterPlacement, SessionGroupHeader, SessionGroupHeaderProps, SessionHostHeader, SessionHostHeaderProps, SessionList, SessionListProps, SessionListRow, SessionListRowProps, SessionMeters, SessionMetersTarget, SessionProjectAxis, SessionStreamsProvider, SessionStreamsProviderProps, SessionTitleSlotProps, SessionView, ShellBlockProvider, type ShellBlockProviderProps, type ShellBlockScope, ShowMoreRow, ShowMoreRowProps, SkillCard, SkillCardProps, SkillGroupCard, SkillGroupCardProps, SlotEntry, SpawnEndRow, SpawnEndRowProps, SpawnStartRow, SpawnStartRowProps, StatusDot, StatusDotProps, StatusOrb, StatusOrbProps, StickToBottomOptions, SubagentBlock, SubagentBlockProps, SuggestionKind, SuggestionPopup, SuggestionPopupProps, SuggestionSource, SuggestionState, THINKING_LEVELS, TRANSCRIPT_OPTION_KEYS, TRIGGER, TaskBatchRow, TaskBatchRowProps, TaskRow, TaskRowProps, TextPreview, TextPreviewProps, TextPreviewSlotProps, TextRow, TextRowProps, ThinkingBatchRow, ThinkingBatchRowProps, ThinkingLevel, ThinkingRow, ThinkingRowProps, Throbber, ThrobberProps, ThrobberVariant, ToolBatchRow, ToolBatchRowProps, ToolBodySlotProps, ToolDetails, ToolDetailsProps, ToolGlyph, ToolGlyphProps, ToolInput, ToolInputProps, ToolMedia, type ToolMediaItem, ToolMediaProps, ToolRow, ToolRowProps, ToolTiming, ToolTimingProps, Transcript, TranscriptAccounts, TranscriptActions, TranscriptActionsProvider, TranscriptActionsProviderProps, TranscriptFind, TranscriptFindKeyOptions, TranscriptFindOptions, TranscriptFindTarget, TranscriptOptions, TranscriptProps, TranscriptRail, type TranscriptRailProps, TranscriptRailProvider, type TranscriptRailProviderProps, TranscriptRenderers, TranscriptRenderersProvider, type TranscriptRenderersProviderProps, TranscriptRow, TranscriptRowProps, TranscriptRowSlot, TranscriptRowSlotProps, TranscriptRows, TranscriptRowsInput, TranscriptScrollInputs, TranscriptSearch, TranscriptSearchOptions, TranscriptSearchProps, TranscriptSearchState, TranscriptSelection, TranscriptSettling, TranscriptSource, TranscriptTurnMenu, TurnCommands, TurnCommandsOptions, TurnMenuActions, TurnMenuTarget, UserBashRow, UserBashRowProps, UserPromptAttachments, UserPromptAttachmentsProps, UserPromptRow, UserPromptRowProps, WORK_HOLD_MS, WORK_SHOW_MS, WorkerDetails, WorkerDetailsProps, __resetComposerScopesForTests, attachmentErrorText, attachmentLightboxItems, attachmentSrcOf, catalogFromProviders, claimComposerFocus, classifyInlineRef, colorForCategory, compactWindow, contextGauge, copyPromptLines, createTurnCommands, decodeDataUrlAsText, defaultAttachmentLabel, defaultAttachmentTileLabel, detectLanguage, dotStateFor, drawsImageGeneration, effectiveImageModel, fileBadgeName, fileBadgeSpec, findModel, findRefs, focusComposer, focusComposerWhenReady, formatBytes, groupKeyOf, hasComposerFor, hasFocusedComposer, hasInteractionBody, holdForceMountRows, imageCatalogRows, imageModelKey, imageRequestsOf, isAudioAttachment, isCaretAtEnd, isCaretAtStart, isFocusedComposer, isHiddenRow, isPdfAttachment, isRequired, isTextLike, isVideoAttachment, lineStateOf, lineupKeyOf, linkGlyph, mergeBadgeOrder, modelKey, modelLineup, modelNameOf, modelSearchScore, nextProfileId, numberRef, offCatalogRows, onComposerAttachment, onComposerDraft, onComposerFocus, onComposerInsert, onComposerMention, onComposerPrompt, optionTitle, orbState, orderComposerBadges, parseRefUrl, parseReferenceUrl, parseToolMedia, pastedTextFilename, pickRefOf, pickerGroups, plainTextToDocJson, providerAccountLabel, providerColor, providerHue, providerTint, pushComposerAttachment, pushComposerDraft, pushComposerInsert, pushComposerMention, pushComposerPrompt, readAttachment, refHref, refKey, referenceUrl, registerComposerScope, remarkReferences, remarkRefs, resolveChain, resolvePick, resourceErrorText, revealRow, rowKey, savedPaths, seedDefaults, shouldFoldPasteToAttachment, siteIconValue, suggestionExtension, takePendingComposerFocus, textAttachment, toolMediaSrcOf, turnViewsOf, unresolveChain, useAgentProfiles, useAllInteractions, useAttachmentIngest, useAttachmentNotices, useAttachmentRemoval, useAttachmentText, useBackgroundMount, useBadgeMenu, useCacheHints, useCaptureRunState, useChatHost, useChatLabels, useChipResolution, useClearDraftKnobs, useCommand, useCommitInfo, useComposerFor, useComposerHost, useComposerLabels, useComposerModelName, useComposerProviderLabel, useComposerSearch, useCycleAgent, useDraftKnobs, useDraftTarget, useFillViewportScrollback, useForceMountRows, useForcedRows, useFullOutput, useFullToolCall, useHasFocusedComposer, useHasSessionEvents, useHostResource, useHostSessions, useHostTurnMenu, useInteractionHead, useIsSessionHydrated, useJoinedRunProgress, useModelCatalog, useModelKnobs, useModelName, useModelPickerPrefs, useModelPickerPrefsStore, useNewChatsDefault, useNewSessionDefaults, useOptionalChatHost, useOptionalSessionStreamActions, usePeekRunSeq, usePeekSessionEvents, usePeekSessionRunning, usePendingInteractions, usePromptHistory, useProviderReadyPoll, useRailOutline, useReferenceMatches, useReferenceProviders, useReferenceView, useReferencedSession, useRememberedKnobs, useResolveChipNow, useRowIcons, useRunAccruedCost, useRunElapsedSec, useRunEstimate, useRunMeterValue, useRunOutputTokens, useRunProgress, useRunStartedAt, useSelectStops, useSelectTurn, useSelectTurnKeys, useSendPrompt, useSessionContextStatus, useSessionEdits, useSessionEvents, useSessionEventsSelector, useSessionFallbackModel, useSessionMeters, useSessionPage, useSessionRetry, useSessionRunning, useSessionStreamActions, useSessionStreams, useSessionSystemMd, useSessionTranscript, useSettledReveal, useShellBlockScope, useSiteIcon, useSkill, useStickToBottom, useSustainedWork, useToolMedia, useTranscriptActions, useTranscriptFind, useTranscriptFindKey, useTranscriptOptions, useTranscriptRailStore, useTranscriptRenderers, useTranscriptRows, useTranscriptScroll, useTranscriptSearch, useTranscriptSelectionCopy, useTurnCommands, useTurnMenu, useWheelHoverPause, withPrimary, workShowDelay };
180
+ export { ATTACHMENT_NOTICE_MS, AUTO_FILL_PAGES, AgentPicker, AgentPickerDialog, AgentPickerDialogProps, AgentPickerProps, AgentProfile, AnsiSpans, type AnsiSpansProps, AnsiText, type AnsiTextProps, AnsweredQuestions, AnsweredQuestionsProps, ApprovalDock, ApprovalDockProps, ArchivedBanner, ArchivedBannerProps, AttachmentIcon, AttachmentIconProps, AttachmentLabelFn, AttachmentLabelParts, AttachmentNotices, AttachmentNoticesProps, AttachmentRefusedError, AttachmentRow, AttachmentRowProps, AttachmentTextState, AttachmentTiles, AttachmentTilesProps, AuthFailureCard, AuthFailureCardProps, BADGE_GLYPH, BadgeEffectContext, BadgeMenuBrowser, BadgeMenuComposer, BadgeMenuProvider, BadgeMenuProviderProps, BadgeMenuSystem, CHIP_CARD_WIDTH, CODE_PANEL, COMMAND_DETAIL_LINE, CardMarkdown, CardMarkdownProps, Caret, CaretProps, ChatProvider, ChatProviderProps, ChipCard, ChipCardProps, ChipHover, ChipHoverProps, ChipOpener, CodeBlockSlotProps, CodemodeScript, type CodemodeScriptProps, CommandCard, CommandCardProps, CommandDetailRow, CommandDetailRowProps, CommandNoteRow, CommandNoteRowProps, CommandScope, CommandScopeContext, CommitCard, CommitCardProps, CompactSummaryRow, CompactSummaryRowProps, Composer, type ComposerAttachment, ComposerBadge, ComposerBadgeTone, ComposerBadges, ComposerBadgesProps, ComposerControls, ComposerControlsProps, ComposerDefaults, ComposerDock, ComposerDockProps, ComposerDraft, ComposerHandle, ComposerHostProvider, ComposerHostProviderProps, ComposerProps, ComposerResult, ComposerRetry, ComposerSearch, ComposerStatusPills, ComposerStatusPillsProps, ComposerSubmit, ComposerTarget, ContextBreakdown, type ContextBreakdownData, ContextBreakdownProps, ContextCost, ContextGauge, ContextOrb, ContextOrbProps, ContextUsage, ConversationBadges, ConversationBadgesProps, Cursor, CvRow, CvRowProps, CycleAgentOptions, DEFAULT_BADGE_ORDER, DEFAULT_TRANSCRIPT_OPTIONS, DEFAULT_TRANSCRIPT_RENDERERS, DaemonOrb, DaemonOrbButton, DaemonOrbButtonProps, DaemonOrbProps, DefaultInlineText, DefaultInlineTextProps, DefaultMarkdown, DefaultMarkdownProps, DefaultPrompt, DefaultPromptProps, DefaultSessionTitle, DefaultSessionTitleProps, DiffLines, DiffLinesProps, DockCard, DockCardProps, DockRow, DockRowProps, Dot, DotProps, DraftPickers, DraftPickersProps, DraftServer, DraftTarget, DraftTargetOptions, DraftTargetRequest, EFFORT_LEVELS, EditDiffBlock, EditDiffBlockProps, EffortLevel, EffortPickerDialog, EffortPickerDialogProps, ElicitationCard, ElicitationCardProps, EnvironmentSetupDetails, EnvironmentSetupDetailsProps, EnvironmentSetupRow, EnvironmentSetupRowProps, ErrorRow, ErrorRowProps, ExchangeFoldRow, ExchangeFoldRowProps, FILL_MIN_PROMPTS, FailedMark, FailedMarkProps, FailureRow, FailureRowProps, FileBadgeIcon, FileBadgeIconProps, FoldHeader, FoldHeaderProps, ForcedRows, GUTTER_STEP_PX, GroupGlyph, GroupGlyphProps, HostAgentPicker, HostAgentPickerProps, HostBadge, HostBadgeProps, HostComposer, HostComposerProps, HostContextOrb, HostContextOrbProps, HostInteractions, HostInteractionsProps, HostModelChainList, HostModelChainListProps, HostModelImages, HostModelOptionsPicker, HostModelOptionsPickerProps, HostModelPicker, HostModelPickerProps, HostPicker, HostPickerProps, HostStatusDot, HostStatusDotProps, HostTranscript, HostTranscriptProps, HostTurnMenuOptions, INLINE_CODE_CLASS, ImageGenerationBlock, ImageGenerationBlockProps, ImageModelList, ImageModelListProps, type ImageModelRow, InboxPanel, InboxPanelProps, InfoRow, InfoRowProps, InlineChipText, InlineChipTextProps, InlineCode, InlineCodeProps, InlineTextSlotProps, InteractionCard, InteractionCardProps, InteractionTool, InteractionToolBody, InteractionToolBodyProps, LazyRow, LazyRowProps, LineState, LinkBadge, LinkBadgeProps, LinkIcon, LinkIconProps, LiveOutput, type LiveOutputProps, LiveScriptsContext, LoadEarlierRow, LoadEarlierRowProps, LoadFullOutputButton, LoadFullOutputButtonProps, MAX_FILE_ATTACHMENT_BYTES, MAX_IMAGE_ATTACHMENT_BYTES, MAX_MATCHES, MAX_MEDIA_ATTACHMENT_BYTES, MAX_TEXT_PREVIEW_BYTES, Markdown, MarkdownContext, MarkdownContextValue, MarkdownDiagrams, MarkdownDiagramsProps, MarkdownImageProps, MarkdownLinkProps, MarkdownProps, MarkdownSlotProps, MarkdownViews, type MarkdownViewsProps, MentionItem, MermaidDiagram, type MermaidDiagramProps, MessageGroupRow, MessageGroupRowProps, type ModelCatalogRow, ModelCatalogState, ModelChainFooter, ModelChainFooterProps, ModelChainHeader, ModelChainHeaderProps, ModelChainImages, ModelChainList, ModelChainListProps, ModelChainPopover, ModelChainPopoverProps, ModelChainRow, ModelChainRowProps, ModelChainRows, ModelChainRowsProps, ModelChainTooltip, ModelChainTooltipProps, ModelChoice, ModelFlag, ModelFlagProps, ModelGroupHeader, ModelGroupHeaderProps, ModelKind, ModelMeta, ModelMetaProps, ModelOption, ModelOptionsPicker, ModelOptionsPickerProps, type ModelPickRef, ModelPicker, ModelPickerDialog, ModelPickerDialogProps, ModelPickerFrame, ModelPickerFrameProps, ModelPickerProps, ModelProviderChip, ModelProviderChipProps, ModelProviderPills, ModelProviderPillsProps, ModelReasoning, ModelReasoningProps, ModelVerdict, ModelVerdictProps, ModelWindow, ModelWindowProps, NO_COMPOSER_HINT, NestedToolCalls, NestedToolCallsProps, NewChatsDefault, NewSessionDefaults, NewSessionModelSource, NoticeRow, NoticeRowProps, OPTION_ICON, OpenBadgeMenu, OpenSessionContext, OrbState, OrderedBadge, PASTE_FOLD_CHAR_THRESHOLD, PASTE_FOLD_LINE_THRESHOLD, ParsedRef, ParsedReferenceUrl, PdfPreview, PdfPreviewProps, PickerGroup, PickerPill, PickerPillProps, PlacePicker, PlacePickerHosts, PlacePickerProps, PlanBody, PlanBodyProps, PlanCard, PlanCardProps, ProjectMenu, ProjectMenuProps, PromptEcho, PromptEchoProps, PromptHistoryProvider, PromptHistoryProviderProps, PromptHistoryValue, PromptLines, PromptLinesProps, PromptSlotProps, ProseMarkdown, ProseMarkdownProps, QuestionField, QuestionFieldProps, QuestionForm, QuestionFormProps, ReadFileBlock, ReadFileBlockProps, RefChip, RefChipProps, RefMatch, ReferenceChip, ReferenceChipProps, ReferenceText, ReferenceTextProps, RepairedRow, RepairedRowProps, RetryPill, RetryPillProps, type RowActionItem, RowContext, RowFrame, RowFrameProps, RowIconsContext, RowPlace, RunEstimateChip, RunEstimateChipProps, RunEstimatesProvider, RunEstimatesProviderProps, RunReceiptInline, RunReceiptInlineProps, RunStatusChip, RunStatusChipProps, RunSummaryRow, RunSummaryRowProps, RunnableCodeBlock, type RunnableCodeBlockProps, ScopeToggle, ScopeToggleProps, ScrollPosition, SearchHighlightStyle, SecretInput, SecretInputProps, SelectCursor, SelectCursorProps, SelectTurnCommands, SelectTurnExit, SelectTurnHint, SelectTurnHintKeys, SelectTurnHintKeysProps, type SelectTurnHintProps, SelectTurnKeysOptions, SelectTurnProvider, SelectTurnProviderProps, SelectTurnState, SelectTurnValue, SendButton, SendButtonProps, SendPromptControls, SendPromptOptions, SendRoute, ServerScopeToggle, ServerScopeToggleProps, SessionActivityFilter, SessionArchiveFilter, SessionCard, SessionCardProps, SessionDotState, SessionEventRow, SessionEventRowProps, SessionFilterAction, SessionFilterAxis, SessionFilterExtra, SessionFilterMenu, SessionFilterMenuProps, SessionFilterPlacement, SessionGroupHeader, SessionGroupHeaderProps, SessionHostHeader, SessionHostHeaderProps, SessionList, SessionListProps, SessionListRow, SessionListRowProps, SessionMeters, SessionMetersTarget, SessionProjectAxis, SessionStreamsProvider, SessionStreamsProviderProps, SessionTitleSlotProps, SessionView, ShellBlockProvider, type ShellBlockProviderProps, type ShellBlockScope, ShowMoreRow, ShowMoreRowProps, SkillCard, SkillCardProps, SkillGroupCard, SkillGroupCardProps, SlotEntry, SpawnEndRow, SpawnEndRowProps, SpawnStartRow, SpawnStartRowProps, StatusDot, StatusDotProps, StatusOrb, StatusOrbProps, StickToBottomOptions, SubagentBlock, SubagentBlockProps, SuggestionKind, SuggestionPopup, SuggestionPopupProps, SuggestionSource, SuggestionState, THINKING_LEVELS, TRANSCRIPT_OPTION_KEYS, TRIGGER, TaskBatchRow, TaskBatchRowProps, TaskRow, TaskRowProps, TextPreview, TextPreviewProps, TextPreviewSlotProps, TextRow, TextRowProps, ThinkingBatchRow, ThinkingBatchRowProps, ThinkingLevel, ThinkingRow, ThinkingRowProps, Throbber, ThrobberProps, ThrobberVariant, ToolBatchRow, ToolBatchRowProps, ToolBodySlotProps, ToolDetails, ToolDetailsProps, ToolGlyph, ToolGlyphProps, ToolInput, ToolInputProps, ToolMedia, type ToolMediaItem, ToolMediaProps, ToolRow, ToolRowProps, ToolTiming, ToolTimingProps, Transcript, TranscriptAccounts, TranscriptActions, TranscriptActionsProvider, TranscriptActionsProviderProps, TranscriptFind, TranscriptFindKeyOptions, TranscriptFindOptions, TranscriptFindTarget, TranscriptOptions, TranscriptProps, TranscriptRail, type TranscriptRailProps, TranscriptRailProvider, type TranscriptRailProviderProps, TranscriptRenderers, TranscriptRenderersProvider, type TranscriptRenderersProviderProps, TranscriptRow, TranscriptRowProps, TranscriptRowSlot, TranscriptRowSlotProps, TranscriptRows, TranscriptRowsInput, TranscriptScrollInputs, TranscriptSearch, TranscriptSearchOptions, TranscriptSearchProps, TranscriptSearchState, TranscriptSelection, TranscriptSettling, TranscriptSource, TranscriptTurnMenu, TurnCommands, TurnCommandsOptions, TurnMenuActions, TurnMenuTarget, UserBashRow, UserBashRowProps, UserPromptAttachments, UserPromptAttachmentsProps, UserPromptRow, UserPromptRowProps, WORK_HOLD_MS, WORK_SHOW_MS, WorkerDetails, WorkerDetailsProps, __resetComposerScopesForTests, attachmentErrorText, attachmentLightboxItems, attachmentSrcOf, catalogFromProviders, claimComposerFocus, classifyInlineRef, colorForCategory, compactWindow, contextGauge, copyPromptLines, createTurnCommands, decodeDataUrlAsText, defaultAttachmentLabel, defaultAttachmentTileLabel, detectLanguage, dotStateFor, drawsImageGeneration, effectiveImageModel, fileBadgeName, fileBadgeSpec, findModel, findRefs, focusComposer, focusComposerWhenReady, formatBytes, groupKeyOf, hasComposerFor, hasFocusedComposer, hasInteractionBody, holdForceMountRows, imageCatalogRows, imageModelKey, imageRequestsOf, isAudioAttachment, isCaretAtEnd, isCaretAtStart, isFocusedComposer, isHiddenRow, isPdfAttachment, isRequired, isTextLike, isVideoAttachment, lineStateOf, lineupKeyOf, linkGlyph, mergeBadgeOrder, modelKey, modelLineup, modelNameOf, modelSearchScore, nextProfileId, numberRef, offCatalogRows, onComposerAttachment, onComposerDraft, onComposerFocus, onComposerInsert, onComposerMention, onComposerPrompt, optionTitle, orbState, orderComposerBadges, parseRefUrl, parseReferenceUrl, parseToolMedia, pastedTextFilename, pickRefOf, pickerGroups, plainTextToDocJson, providerAccountLabel, providerColor, providerHue, providerTint, pushComposerAttachment, pushComposerDraft, pushComposerInsert, pushComposerMention, pushComposerPrompt, readAttachment, refHref, refKey, referenceUrl, registerComposerScope, remarkReferences, remarkRefs, resolveChain, resolvePick, resourceErrorText, revealRow, rowKey, savedPaths, seedDefaults, shouldFoldPasteToAttachment, siteIconValue, suggestionExtension, takePendingComposerFocus, textAttachment, toolMediaSrcOf, turnViewsOf, unresolveChain, useAgentProfiles, useAllInteractions, useAttachmentIngest, useAttachmentNotices, useAttachmentRemoval, useAttachmentText, useBackgroundMount, useBadgeMenu, useCacheHints, useCaptureRunState, useChatHost, useChatLabels, useChipResolution, useClearDraftKnobs, useCommand, useCommitInfo, useComposerFor, useComposerHost, useComposerLabels, useComposerModelName, useComposerProviderLabel, useComposerSearch, useCycleAgent, useDraftKnobs, useDraftTarget, useFillViewportScrollback, useForceMountRows, useForcedRows, useFullOutput, useFullToolCall, useHasFocusedComposer, useHasSessionEvents, useHostResource, useHostSessions, useHostTurnMenu, useInteractionHead, useIsSessionHydrated, useJoinedRunProgress, useModelCatalog, useModelKnobs, useModelName, useModelPickerPrefs, useModelPickerPrefsStore, useNewChatsDefault, useNewSessionDefaults, useOptionalChatHost, useOptionalSessionStreamActions, usePeekRunSeq, usePeekSessionEvents, usePeekSessionRunning, usePendingInteractions, usePromptHistory, useProviderReadyPoll, useRailOutline, useReferenceMatches, useReferenceProviders, useReferenceView, useReferencedSession, useRememberedKnobs, useResolveChipNow, useRowIcons, useRunAccruedCost, useRunElapsedSec, useRunEstimate, useRunMeterValue, useRunOutputTokens, useRunProgress, useRunStartedAt, useSelectStops, useSelectTurn, useSelectTurnKeys, useSendPrompt, useSessionContextStatus, useSessionEdits, useSessionEvents, useSessionEventsSelector, useSessionFallbackModel, useSessionMeters, useSessionPage, useSessionRetry, useSessionRunning, useSessionStreamActions, useSessionStreams, useSessionSystemMd, useSessionTranscript, useSettledReveal, useShellBlockScope, useSiteIcon, useSkill, useStickToBottom, useSustainedWork, useTokenSession, useToolMedia, useTranscriptActions, useTranscriptFind, useTranscriptFindKey, useTranscriptOptions, useTranscriptRailStore, useTranscriptRenderers, useTranscriptRows, useTranscriptScroll, useTranscriptSearch, useTranscriptSelectionCopy, useTurnCommands, useTurnMenu, useWheelHoverPause, withPrimary, workShowDelay };
@@ -5,11 +5,11 @@ import { DaemonOrb, DaemonOrbButton, StatusOrb, orbState } from "./DaemonOrb.js"
5
5
  import { BadgeMenuProvider, useBadgeMenu } from "./transcript/BadgeMenu.js";
6
6
  import { useSiteIcon } from "./transcript/site-icons.js";
7
7
  import { BADGE_GLYPH, FileBadgeIcon, LinkBadge, LinkIcon, fileBadgeName, fileBadgeSpec, linkGlyph, siteIconValue } from "./transcript/badges.js";
8
+ import { useCommand, useCommitInfo, useReferencedSession, useSkill, useTokenSession } from "./transcript/chip-details.js";
8
9
  import { useChipResolution, useResolveChipNow } from "./transcript/chip-resolve.js";
9
10
  import { CommandScopeContext, INLINE_CODE_CLASS, MarkdownContext, OpenSessionContext } from "./transcript/markdown-context.js";
10
11
  import { CardMarkdown } from "./transcript/CardMarkdown.js";
11
12
  import { CHIP_CARD_WIDTH, ChipCard, ChipHover } from "./transcript/ChipCard.js";
12
- import { useCommand, useCommitInfo, useReferencedSession, useSkill } from "./transcript/chip-details.js";
13
13
  import { CommandCard, CommitCard, SessionCard, SkillCard, SkillGroupCard } from "./transcript/ChipCards.js";
14
14
  import { useReferenceMatches, useReferenceProviders, useReferenceView } from "./transcript/references.js";
15
15
  import { ReferenceChip, ReferenceText } from "./transcript/ReferenceText.js";
@@ -164,4 +164,4 @@ import { useTranscriptFindKey } from "./transcript/useTranscriptFindKey.js";
164
164
  import { useTranscriptFind } from "./transcript/useTranscriptFind.js";
165
165
  import { useWheelHoverPause } from "./transcript/useWheelHoverPause.js";
166
166
  import { useTranscriptScroll } from "./transcript/useTranscriptScroll.js";
167
- export { ATTACHMENT_NOTICE_MS, AUTO_FILL_PAGES, AgentPicker, AgentPickerDialog, AnsiSpans, AnsiText, AnsweredQuestions, ApprovalDock, ArchivedBanner, AttachmentIcon, AttachmentNotices, AttachmentRefusedError, AttachmentRow, AttachmentTiles, AuthFailureCard, BADGE_GLYPH, BadgeMenuProvider, CHIP_CARD_WIDTH, CODE_PANEL, COMMAND_DETAIL_LINE, CardMarkdown, Caret, ChatProvider, ChipCard, ChipHover, CodemodeScript, CommandCard, CommandDetailRow, CommandNoteRow, CommandScopeContext, CommitCard, CompactSummaryRow, Composer, ComposerBadges, ComposerControls, ComposerDock, ComposerHostProvider, ComposerStatusPills, ContextBreakdown, ContextOrb, ConversationBadges, CvRow, DEFAULT_BADGE_ORDER, DEFAULT_TRANSCRIPT_OPTIONS, DEFAULT_TRANSCRIPT_RENDERERS, DaemonOrb, DaemonOrbButton, DefaultInlineText, DefaultMarkdown, DefaultPrompt, DefaultSessionTitle, DiffLines, DockCard, DockRow, Dot, DraftPickers, EFFORT_LEVELS, EditDiffBlock, EffortPickerDialog, ElicitationCard, EnvironmentSetupDetails, EnvironmentSetupRow, ErrorRow, ExchangeFoldRow, FILL_MIN_PROMPTS, FailedMark, FailureRow, FileBadgeIcon, FoldHeader, GUTTER_STEP_PX, GroupGlyph, HostAgentPicker, HostBadge, HostComposer, HostContextOrb, HostInteractions, HostModelChainList, HostModelOptionsPicker, HostModelPicker, HostPicker, HostStatusDot, HostTranscript, INLINE_CODE_CLASS, ImageGenerationBlock, ImageModelList, InboxPanel, InfoRow, InlineChipText, InlineCode, InteractionCard, InteractionToolBody, LazyRow, LinkBadge, LinkIcon, LiveOutput, LiveScriptsContext, LoadEarlierRow, LoadFullOutputButton, MAX_FILE_ATTACHMENT_BYTES, MAX_IMAGE_ATTACHMENT_BYTES, MAX_MATCHES, MAX_MEDIA_ATTACHMENT_BYTES, MAX_TEXT_PREVIEW_BYTES, Markdown, MarkdownContext, MarkdownDiagrams, MarkdownViews, MermaidDiagram, MessageGroupRow, ModelChainFooter, ModelChainHeader, ModelChainList, ModelChainPopover, ModelChainRow, ModelChainRows, ModelChainTooltip, ModelFlag, ModelGroupHeader, ModelMeta, ModelOptionsPicker, ModelPicker, ModelPickerDialog, ModelPickerFrame, ModelProviderChip, ModelProviderPills, ModelReasoning, ModelVerdict, ModelWindow, NO_COMPOSER_HINT, NestedToolCalls, NoticeRow, OPTION_ICON, OpenSessionContext, PASTE_FOLD_CHAR_THRESHOLD, PASTE_FOLD_LINE_THRESHOLD, PdfPreview, PickerPill, PlacePicker, PlanBody, PlanCard, ProjectMenu, PromptEcho, PromptHistoryProvider, PromptLines, ProseMarkdown, QuestionField, QuestionForm, ReadFileBlock, RefChip, ReferenceChip, ReferenceText, RepairedRow, RetryPill, RowFrame, RowIconsContext, RunEstimateChip, RunEstimatesProvider, RunReceiptInline, RunStatusChip, RunSummaryRow, RunnableCodeBlock, ScopeToggle, SearchHighlightStyle, SecretInput, SelectCursor, SelectTurnExit, SelectTurnHint, SelectTurnHintKeys, SelectTurnProvider, SendButton, ServerScopeToggle, SessionCard, SessionEventRow, SessionFilterMenu, SessionGroupHeader, SessionHostHeader, SessionList, SessionListRow, SessionStreamsProvider, ShellBlockProvider, ShowMoreRow, SkillCard, SkillGroupCard, SpawnEndRow, SpawnStartRow, StatusDot, StatusOrb, SubagentBlock, SuggestionPopup, THINKING_LEVELS, TRANSCRIPT_OPTION_KEYS, TRIGGER, TaskBatchRow, TaskRow, TextPreview, TextRow, ThinkingBatchRow, ThinkingRow, Throbber, ToolBatchRow, ToolDetails, ToolGlyph, ToolInput, ToolMedia, ToolRow, ToolTiming, Transcript, TranscriptActionsProvider, TranscriptRail, TranscriptRailProvider, TranscriptRenderersProvider, TranscriptRow, TranscriptRowSlot, TranscriptSearch, TranscriptSettling, UserBashRow, UserPromptAttachments, UserPromptRow, WORK_HOLD_MS, WORK_SHOW_MS, WorkerDetails, __resetComposerScopesForTests, attachmentErrorText, attachmentLightboxItems, attachmentSrcOf, catalogFromProviders, claimComposerFocus, classifyInlineRef, colorForCategory, compactWindow, contextGauge, copyPromptLines, createTurnCommands, decodeDataUrlAsText, defaultAttachmentLabel, defaultAttachmentTileLabel, detectLanguage, dotStateFor, drawsImageGeneration, effectiveImageModel, fileBadgeName, fileBadgeSpec, findModel, findRefs, focusComposer, focusComposerWhenReady, formatBytes, groupKeyOf, hasComposerFor, hasFocusedComposer, hasInteractionBody, holdForceMountRows, imageCatalogRows, imageModelKey, imageRequestsOf, isAudioAttachment, isCaretAtEnd, isCaretAtStart, isFocusedComposer, isHiddenRow, isPdfAttachment, isRequired, isTextLike, isVideoAttachment, lineStateOf, lineupKeyOf, linkGlyph, mergeBadgeOrder, modelKey, modelLineup, modelNameOf, modelSearchScore, nextProfileId, numberRef, offCatalogRows, onComposerAttachment, onComposerDraft, onComposerFocus, onComposerInsert, onComposerMention, onComposerPrompt, optionTitle, orbState, orderComposerBadges, parseRefUrl, parseReferenceUrl, parseToolMedia, pastedTextFilename, pickRefOf, pickerGroups, plainTextToDocJson, providerAccountLabel, providerColor, providerHue, providerTint, pushComposerAttachment, pushComposerDraft, pushComposerInsert, pushComposerMention, pushComposerPrompt, readAttachment, refHref, refKey, referenceUrl, registerComposerScope, remarkReferences, remarkRefs, resolveChain, resolvePick, resourceErrorText, revealRow, rowKey, savedPaths, seedDefaults, shouldFoldPasteToAttachment, siteIconValue, suggestionExtension, takePendingComposerFocus, textAttachment, toolMediaSrcOf, turnViewsOf, unresolveChain, useAgentProfiles, useAllInteractions, useAttachmentIngest, useAttachmentNotices, useAttachmentRemoval, useAttachmentText, useBackgroundMount, useBadgeMenu, useCacheHints, useCaptureRunState, useChatHost, useChatLabels, useChipResolution, useClearDraftKnobs, useCommand, useCommitInfo, useComposerFor, useComposerHost, useComposerLabels, useComposerModelName, useComposerProviderLabel, useComposerSearch, useCycleAgent, useDraftKnobs, useDraftTarget, useFillViewportScrollback, useForceMountRows, useForcedRows, useFullOutput, useFullToolCall, useHasFocusedComposer, useHasSessionEvents, useHostResource, useHostSessions, useHostTurnMenu, useInteractionHead, useIsSessionHydrated, useJoinedRunProgress, useModelCatalog, useModelKnobs, useModelName, useModelPickerPrefs, useModelPickerPrefsStore, useNewChatsDefault, useNewSessionDefaults, useOptionalChatHost, useOptionalSessionStreamActions, usePeekRunSeq, usePeekSessionEvents, usePeekSessionRunning, usePendingInteractions, usePromptHistory, useProviderReadyPoll, useRailOutline, useReferenceMatches, useReferenceProviders, useReferenceView, useReferencedSession, useRememberedKnobs, useResolveChipNow, useRowIcons, useRunAccruedCost, useRunElapsedSec, useRunEstimate, useRunMeterValue, useRunOutputTokens, useRunProgress, useRunStartedAt, useSelectStops, useSelectTurn, useSelectTurnKeys, useSendPrompt, useSessionContextStatus, useSessionEdits, useSessionEvents, useSessionEventsSelector, useSessionFallbackModel, useSessionMeters, useSessionPage, useSessionRetry, useSessionRunning, useSessionStreamActions, useSessionStreams, useSessionSystemMd, useSessionTranscript, useSettledReveal, useShellBlockScope, useSiteIcon, useSkill, useStickToBottom, useSustainedWork, useToolMedia, useTranscriptActions, useTranscriptFind, useTranscriptFindKey, useTranscriptOptions, useTranscriptRailStore, useTranscriptRenderers, useTranscriptRows, useTranscriptScroll, useTranscriptSearch, useTranscriptSelectionCopy, useTurnCommands, useTurnMenu, useWheelHoverPause, withPrimary, workShowDelay };
167
+ export { ATTACHMENT_NOTICE_MS, AUTO_FILL_PAGES, AgentPicker, AgentPickerDialog, AnsiSpans, AnsiText, AnsweredQuestions, ApprovalDock, ArchivedBanner, AttachmentIcon, AttachmentNotices, AttachmentRefusedError, AttachmentRow, AttachmentTiles, AuthFailureCard, BADGE_GLYPH, BadgeMenuProvider, CHIP_CARD_WIDTH, CODE_PANEL, COMMAND_DETAIL_LINE, CardMarkdown, Caret, ChatProvider, ChipCard, ChipHover, CodemodeScript, CommandCard, CommandDetailRow, CommandNoteRow, CommandScopeContext, CommitCard, CompactSummaryRow, Composer, ComposerBadges, ComposerControls, ComposerDock, ComposerHostProvider, ComposerStatusPills, ContextBreakdown, ContextOrb, ConversationBadges, CvRow, DEFAULT_BADGE_ORDER, DEFAULT_TRANSCRIPT_OPTIONS, DEFAULT_TRANSCRIPT_RENDERERS, DaemonOrb, DaemonOrbButton, DefaultInlineText, DefaultMarkdown, DefaultPrompt, DefaultSessionTitle, DiffLines, DockCard, DockRow, Dot, DraftPickers, EFFORT_LEVELS, EditDiffBlock, EffortPickerDialog, ElicitationCard, EnvironmentSetupDetails, EnvironmentSetupRow, ErrorRow, ExchangeFoldRow, FILL_MIN_PROMPTS, FailedMark, FailureRow, FileBadgeIcon, FoldHeader, GUTTER_STEP_PX, GroupGlyph, HostAgentPicker, HostBadge, HostComposer, HostContextOrb, HostInteractions, HostModelChainList, HostModelOptionsPicker, HostModelPicker, HostPicker, HostStatusDot, HostTranscript, INLINE_CODE_CLASS, ImageGenerationBlock, ImageModelList, InboxPanel, InfoRow, InlineChipText, InlineCode, InteractionCard, InteractionToolBody, LazyRow, LinkBadge, LinkIcon, LiveOutput, LiveScriptsContext, LoadEarlierRow, LoadFullOutputButton, MAX_FILE_ATTACHMENT_BYTES, MAX_IMAGE_ATTACHMENT_BYTES, MAX_MATCHES, MAX_MEDIA_ATTACHMENT_BYTES, MAX_TEXT_PREVIEW_BYTES, Markdown, MarkdownContext, MarkdownDiagrams, MarkdownViews, MermaidDiagram, MessageGroupRow, ModelChainFooter, ModelChainHeader, ModelChainList, ModelChainPopover, ModelChainRow, ModelChainRows, ModelChainTooltip, ModelFlag, ModelGroupHeader, ModelMeta, ModelOptionsPicker, ModelPicker, ModelPickerDialog, ModelPickerFrame, ModelProviderChip, ModelProviderPills, ModelReasoning, ModelVerdict, ModelWindow, NO_COMPOSER_HINT, NestedToolCalls, NoticeRow, OPTION_ICON, OpenSessionContext, PASTE_FOLD_CHAR_THRESHOLD, PASTE_FOLD_LINE_THRESHOLD, PdfPreview, PickerPill, PlacePicker, PlanBody, PlanCard, ProjectMenu, PromptEcho, PromptHistoryProvider, PromptLines, ProseMarkdown, QuestionField, QuestionForm, ReadFileBlock, RefChip, ReferenceChip, ReferenceText, RepairedRow, RetryPill, RowFrame, RowIconsContext, RunEstimateChip, RunEstimatesProvider, RunReceiptInline, RunStatusChip, RunSummaryRow, RunnableCodeBlock, ScopeToggle, SearchHighlightStyle, SecretInput, SelectCursor, SelectTurnExit, SelectTurnHint, SelectTurnHintKeys, SelectTurnProvider, SendButton, ServerScopeToggle, SessionCard, SessionEventRow, SessionFilterMenu, SessionGroupHeader, SessionHostHeader, SessionList, SessionListRow, SessionStreamsProvider, ShellBlockProvider, ShowMoreRow, SkillCard, SkillGroupCard, SpawnEndRow, SpawnStartRow, StatusDot, StatusOrb, SubagentBlock, SuggestionPopup, THINKING_LEVELS, TRANSCRIPT_OPTION_KEYS, TRIGGER, TaskBatchRow, TaskRow, TextPreview, TextRow, ThinkingBatchRow, ThinkingRow, Throbber, ToolBatchRow, ToolDetails, ToolGlyph, ToolInput, ToolMedia, ToolRow, ToolTiming, Transcript, TranscriptActionsProvider, TranscriptRail, TranscriptRailProvider, TranscriptRenderersProvider, TranscriptRow, TranscriptRowSlot, TranscriptSearch, TranscriptSettling, UserBashRow, UserPromptAttachments, UserPromptRow, WORK_HOLD_MS, WORK_SHOW_MS, WorkerDetails, __resetComposerScopesForTests, attachmentErrorText, attachmentLightboxItems, attachmentSrcOf, catalogFromProviders, claimComposerFocus, classifyInlineRef, colorForCategory, compactWindow, contextGauge, copyPromptLines, createTurnCommands, decodeDataUrlAsText, defaultAttachmentLabel, defaultAttachmentTileLabel, detectLanguage, dotStateFor, drawsImageGeneration, effectiveImageModel, fileBadgeName, fileBadgeSpec, findModel, findRefs, focusComposer, focusComposerWhenReady, formatBytes, groupKeyOf, hasComposerFor, hasFocusedComposer, hasInteractionBody, holdForceMountRows, imageCatalogRows, imageModelKey, imageRequestsOf, isAudioAttachment, isCaretAtEnd, isCaretAtStart, isFocusedComposer, isHiddenRow, isPdfAttachment, isRequired, isTextLike, isVideoAttachment, lineStateOf, lineupKeyOf, linkGlyph, mergeBadgeOrder, modelKey, modelLineup, modelNameOf, modelSearchScore, nextProfileId, numberRef, offCatalogRows, onComposerAttachment, onComposerDraft, onComposerFocus, onComposerInsert, onComposerMention, onComposerPrompt, optionTitle, orbState, orderComposerBadges, parseRefUrl, parseReferenceUrl, parseToolMedia, pastedTextFilename, pickRefOf, pickerGroups, plainTextToDocJson, providerAccountLabel, providerColor, providerHue, providerTint, pushComposerAttachment, pushComposerDraft, pushComposerInsert, pushComposerMention, pushComposerPrompt, readAttachment, refHref, refKey, referenceUrl, registerComposerScope, remarkReferences, remarkRefs, resolveChain, resolvePick, resourceErrorText, revealRow, rowKey, savedPaths, seedDefaults, shouldFoldPasteToAttachment, siteIconValue, suggestionExtension, takePendingComposerFocus, textAttachment, toolMediaSrcOf, turnViewsOf, unresolveChain, useAgentProfiles, useAllInteractions, useAttachmentIngest, useAttachmentNotices, useAttachmentRemoval, useAttachmentText, useBackgroundMount, useBadgeMenu, useCacheHints, useCaptureRunState, useChatHost, useChatLabels, useChipResolution, useClearDraftKnobs, useCommand, useCommitInfo, useComposerFor, useComposerHost, useComposerLabels, useComposerModelName, useComposerProviderLabel, useComposerSearch, useCycleAgent, useDraftKnobs, useDraftTarget, useFillViewportScrollback, useForceMountRows, useForcedRows, useFullOutput, useFullToolCall, useHasFocusedComposer, useHasSessionEvents, useHostResource, useHostSessions, useHostTurnMenu, useInteractionHead, useIsSessionHydrated, useJoinedRunProgress, useModelCatalog, useModelKnobs, useModelName, useModelPickerPrefs, useModelPickerPrefsStore, useNewChatsDefault, useNewSessionDefaults, useOptionalChatHost, useOptionalSessionStreamActions, usePeekRunSeq, usePeekSessionEvents, usePeekSessionRunning, usePendingInteractions, usePromptHistory, useProviderReadyPoll, useRailOutline, useReferenceMatches, useReferenceProviders, useReferenceView, useReferencedSession, useRememberedKnobs, useResolveChipNow, useRowIcons, useRunAccruedCost, useRunElapsedSec, useRunEstimate, useRunMeterValue, useRunOutputTokens, useRunProgress, useRunStartedAt, useSelectStops, useSelectTurn, useSelectTurnKeys, useSendPrompt, useSessionContextStatus, useSessionEdits, useSessionEvents, useSessionEventsSelector, useSessionFallbackModel, useSessionMeters, useSessionPage, useSessionRetry, useSessionRunning, useSessionStreamActions, useSessionStreams, useSessionSystemMd, useSessionTranscript, useSettledReveal, useShellBlockScope, useSiteIcon, useSkill, useStickToBottom, useSustainedWork, useTokenSession, useToolMedia, useTranscriptActions, useTranscriptFind, useTranscriptFindKey, useTranscriptOptions, useTranscriptRailStore, useTranscriptRenderers, useTranscriptRows, useTranscriptScroll, useTranscriptSearch, useTranscriptSelectionCopy, useTurnCommands, useTurnMenu, useWheelHoverPause, withPrimary, workShowDelay };
@@ -156,7 +156,7 @@ function ProjectIconButton({ fullPath, label, icon, isGitRepo, defaultGlyph, tit
156
156
  surfaceRef.current = node;
157
157
  },
158
158
  open: popover.open,
159
- anchor: { element: triggerRef.current },
159
+ anchor: { ref: triggerRef },
160
160
  side: "bottom",
161
161
  align: "start",
162
162
  offset: 4,
@@ -1,7 +1,7 @@
1
1
  import { useTooltip } from "../../components/Tooltip.js";
2
2
  import { environmentKindIcon } from "../../git/headless/environment.js";
3
3
  import { sessionPlaceTone } from "../../session/headless/place.js";
4
- import { environmentKindLabel, environmentSummaryText } from "../headless/sidebar/environment.js";
4
+ import { environmentLabel, environmentSummaryText } from "../headless/sidebar/environment.js";
5
5
  import { useSidebarLabels } from "./useSidebarLabels.js";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  // src/chat/sidebar/RowChips.tsx
@@ -31,7 +31,7 @@ function EnvironmentChip({ environment, className = "", style }) {
31
31
  }), /* @__PURE__ */ jsx("span", {
32
32
  dir: "auto",
33
33
  className: `min-w-0 max-w-[14ch] truncate ${environment.branch ? "zg-meta" : ""}`,
34
- children: environment.branch || environmentKindLabel(environment.kind, labels)
34
+ children: environment.branch || environmentLabel(environment, labels)
35
35
  })]
36
36
  }), tip.tip] });
37
37
  }
@@ -101,6 +101,12 @@ export interface SessionSidebarProps<S extends SidebarRowSession> {
101
101
  onMoveToSpace?: (sessionId: S['id'], spaceId: string) => Promise<unknown>;
102
102
  /** Moves a session to another environment of its host (`useMoveSession`, `zidane-ui/git`). Absent: no "Move to…". */
103
103
  onMoveSession?: (sessionId: S['id']) => void;
104
+ /** Teleports a session to another host (`useTeleportSession`, `zidane-ui/git`). Absent: no "Teleport to…". */
105
+ onTeleportSession?: (sessionId: S['id']) => void;
106
+ /** Opens who shares a session (`useShareSession`, `zidane-ui/session`). Absent: no "Share…". */
107
+ onShareSession?: (sessionId: S['id']) => void;
108
+ /** Whether a session can be shared (its server signs its users in). Absent: every session with `onShareSession`. */
109
+ canShareSession?: (sessionId: S['id']) => boolean;
104
110
  /** Moves a project to a space. Absent: no move rows on the headers. */
105
111
  onMoveProjectToSpace?: (project: SidebarProject, spaceId: string) => Promise<unknown>;
106
112
  /** Archives a project's conversations (`useProjectSessionActions`). */
@@ -155,15 +155,15 @@ const NO_DECORATIONS = [];
155
155
  * @param props - The directory's view, the app's actions, the live row parts, the footer and the frame.
156
156
  */
157
157
  function SessionSidebar(props) {
158
- const { sessions: allSessions, hosts, groupBy, sortBy, archiveFilter, activeSessionId, onActivate, orchestration, spacesOn, spaces, listSpaceId, spaceSlide: lastSpaceSwitch, search, live, runDetails = true, artifactBadges = true, onNewSession, onNewSessionIn: newSessionIn, onOpenProject, openProject, onOpenChats, chatsOpen = false, onRename, onSetArchived, onSetFavorite, onSetInboxState, layout = "groups", inboxEarlierAfterMs = INBOX_EARLIER_AFTER_MS, inboxGroupBy: inboxGroupByProp, onDelete, onMoveToSpace, onMoveSession, onMoveProjectToSpace, onArchiveProject, onDeleteProject: deleteProject, keyboardBlocked, query, onViewChange, agentNames: agentNamesProp, onOpenItem, filter, footer, collapsed, width, onWidthCommit, chromeInset, ariaLabel, className, style } = props;
158
+ const { sessions: allSessions, hosts, groupBy, sortBy, archiveFilter, activeSessionId, onActivate, orchestration, spacesOn, spaces, listSpaceId, spaceSlide: lastSpaceSwitch, search, live, runDetails = true, artifactBadges = true, onNewSession, onNewSessionIn: newSessionIn, onOpenProject, openProject, onOpenChats, chatsOpen = false, onRename, onSetArchived, onSetFavorite, onSetInboxState, layout = "groups", inboxEarlierAfterMs = INBOX_EARLIER_AFTER_MS, inboxGroupBy: inboxGroupByProp, onDelete, onMoveToSpace, onMoveSession, onTeleportSession, onShareSession, canShareSession, onMoveProjectToSpace, onArchiveProject, onDeleteProject: deleteProject, keyboardBlocked, query, onViewChange, agentNames: agentNamesProp, onOpenItem, filter, footer, collapsed, width, onWidthCommit, chromeInset, ariaLabel, className, style } = props;
159
159
  const labels = useSidebarLabels();
160
160
  const notify = useSidebarNotice();
161
161
  const environment = useEnvironmentCommands();
162
162
  const slideDirection = lastSpaceSwitch?.spaceId === listSpaceId ? lastSpaceSwitch.direction : null;
163
163
  const slideOffset = slideDirection === "next" ? 1 : slideDirection === "prev" ? -1 : 0;
164
- const lastSlideKey = useRef("list");
165
- if (spacesOn && lastSpaceSwitch?.spaceId === listSpaceId) lastSlideKey.current = lastSpaceSwitch.spaceId;
166
- const listKey = lastSlideKey.current;
164
+ const [listKey, setListKey] = useState("list");
165
+ const switchedTo = spacesOn && lastSpaceSwitch?.spaceId === listSpaceId ? lastSpaceSwitch.spaceId : null;
166
+ if (switchedTo !== null && switchedTo !== listKey) setListKey(switchedTo);
167
167
  const slideTransition = useWithFade("slide", SPACE_SLIDE_S);
168
168
  const listSlide = useMemo(() => ({
169
169
  dir: slideOffset,
@@ -361,17 +361,21 @@ function SessionSidebar(props) {
361
361
  rowLimit,
362
362
  viewKey
363
363
  });
364
- const shape = flipShape.current;
365
- const folded = shape.collapsedGroups !== collapsedGroups || shape.collapsedShelves !== collapsedShelves || shape.collapsedFolders !== collapsedFolders;
366
- const foldAroundOpen = folded && lastToggle.current !== null && activeSessionId != null && (inbox ? inboxRows.some((r) => r.kind === "session" && r.id === activeSessionId && (r.section === lastToggle.current || r.folder === lastToggle.current)) : groupHolds(rows, lastToggle.current, activeSessionId));
367
- const flipAnimate = !searchMode && shape.searchMode === searchMode && shape.rowLimit === rowLimit && (!folded || foldAroundOpen);
368
- const flipMode = foldAroundOpen ? "fold" : shape.viewKey !== viewKey ? "swap" : "list";
364
+ const planFlip = () => {
365
+ const shape = flipShape.current;
366
+ const folded = shape.collapsedGroups !== collapsedGroups || shape.collapsedShelves !== collapsedShelves || shape.collapsedFolders !== collapsedFolders;
367
+ const toggled = lastToggle.current;
368
+ const foldAroundOpen = folded && toggled !== null && activeSessionId != null && (inbox ? inboxRows.some((r) => r.kind === "session" && r.id === activeSessionId && (r.section === toggled || r.folder === toggled)) : groupHolds(rows, toggled, activeSessionId));
369
+ return {
370
+ animate: !searchMode && shape.searchMode === searchMode && shape.rowLimit === rowLimit && (!folded || foldAroundOpen),
371
+ mode: foldAroundOpen ? "fold" : shape.viewKey !== viewKey ? "swap" : "list"
372
+ };
373
+ };
369
374
  const flip = useFlipList(layoutKey, {
370
375
  selector: "li",
371
376
  keyOf: flipKeyOf,
372
377
  isSticky: isStickyHead,
373
- animate: flipAnimate,
374
- mode: flipMode
378
+ plan: planFlip
375
379
  });
376
380
  useLayoutEffect(() => {
377
381
  flipShape.current = {
@@ -563,6 +567,9 @@ function SessionSidebar(props) {
563
567
  onRunEnvironmentAction: environment.run,
564
568
  onMoveToSpace: onRowMoveToSpace,
565
569
  ...onMoveSession ? { onMoveSession } : {},
570
+ ...onTeleportSession ? { onTeleportSession } : {},
571
+ ...onShareSession ? { onShareSession } : {},
572
+ ...canShareSession ? { canShareSession } : {},
566
573
  onOpenMenu: onRowOpenMenu,
567
574
  onCloseMenu: onRowCloseMenu,
568
575
  live
@@ -577,6 +584,9 @@ function SessionSidebar(props) {
577
584
  environment,
578
585
  onRowMoveToSpace,
579
586
  onMoveSession,
587
+ onTeleportSession,
588
+ onShareSession,
589
+ canShareSession,
580
590
  onRowOpenMenu,
581
591
  onRowCloseMenu,
582
592
  live
@@ -602,9 +612,7 @@ function SessionSidebar(props) {
602
612
  useEffect(() => {
603
613
  setMenuForId(null);
604
614
  }, [activeSessionId]);
605
- useEffect(() => {
606
- if (collapsed) setRenamingId(null);
607
- }, [collapsed]);
615
+ if (collapsed && renamingId !== null) setRenamingId(null);
608
616
  const onNewSessionIn = useCallback((fullPath) => newSessionIn(fullPath), [newSessionIn]);
609
617
  const handleNewSession = useCallback(() => {
610
618
  commitImmediate(null);
@@ -834,8 +842,7 @@ function SessionSidebar(props) {
834
842
  children: /* @__PURE__ */ jsxs(FlipSnapshot, {
835
843
  flip: flip.controller,
836
844
  layoutKey,
837
- animate: flipAnimate,
838
- mode: flipMode,
845
+ plan: planFlip,
839
846
  children: [searchMode ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
840
847
  titleMatches.map((session) => searchRow(session)),
841
848
  contentMatches.map(({ session, hit }) => searchRow(session, hit.excerpt)),
@@ -277,7 +277,6 @@ function SidebarFilterMenu({ view, projects, onChange, hosts = false, agents, ag
277
277
  space,
278
278
  groups,
279
279
  sorts,
280
- groupChoice,
281
280
  sortChoice,
282
281
  defaultLayout,
283
282
  layout,
@@ -1,6 +1,6 @@
1
1
  import { FLIP_CLIP_ATTR } from "../../motion/flip-list.js";
2
2
  import { readMotionMs, usePresence } from "../../motion/presence.js";
3
- import { Children, useEffect, useRef } from "react";
3
+ import { Children, useState } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  // src/chat/sidebar/SidebarFold.tsx
6
6
  const readSettleMs = () => readMotionMs("settle");
@@ -9,24 +9,25 @@ function SidebarFold({ open, folded, children, className, style }) {
9
9
  const has = Children.count(children) > 0;
10
10
  const shown = open && has;
11
11
  const staying = usePresence(shown, { exitMs: readSettleMs }).mounted;
12
- const last = useRef(null);
13
- if (shown) last.current = children;
14
- const was = useRef({
12
+ const [fold, setFold] = useState({
15
13
  shown,
16
- folded
14
+ folded,
15
+ last: shown ? children : null,
16
+ instant: false,
17
+ emptied: false
17
18
  });
18
- const byRows = folded !== void 0 && was.current.folded === folded;
19
- const instant = shown !== was.current.shown && byRows;
20
- const emptied = useRef(false);
21
- if (shown) emptied.current = false;
22
- else if (was.current.shown && byRows) emptied.current = true;
23
- const rows = shown ? children : staying && !emptied.current ? last.current : null;
24
- useEffect(() => {
25
- was.current = {
19
+ if (fold.shown !== shown || fold.folded !== folded || shown && fold.last !== children) {
20
+ const byRows = folded !== void 0 && fold.folded === folded;
21
+ setFold({
26
22
  shown,
27
- folded
28
- };
29
- });
23
+ folded,
24
+ last: shown ? children : fold.last,
25
+ instant: shown !== fold.shown && byRows,
26
+ emptied: shown ? false : fold.shown && byRows || fold.emptied
27
+ });
28
+ }
29
+ const { instant, emptied } = fold;
30
+ const rows = shown ? children : staying && !emptied ? fold.last : null;
30
31
  return /* @__PURE__ */ jsx("li", {
31
32
  className: `zg-fold zg-collapsible${className ? ` ${className}` : ""}`,
32
33
  style,
@@ -44,6 +44,12 @@ export interface SidebarRowHandlers {
44
44
  onMoveToSpace: (sessionId: string, spaceId: string) => void;
45
45
  /** Moves it to another environment of its host ("Move to…"). Absent: no row. */
46
46
  onMoveSession?: (sessionId: string) => void;
47
+ /** Teleports it to another host ("Teleport to…"). Absent: no row. */
48
+ onTeleportSession?: (sessionId: string) => void;
49
+ /** Opens who shares it ("Share…"). Absent: no row. */
50
+ onShareSession?: (sessionId: string) => void;
51
+ /** Whether this session can be shared. Absent: it can, when `onShareSession` is given. */
52
+ canShareSession?: (sessionId: string) => boolean;
47
53
  /** Its menu opened. */
48
54
  onOpenMenu: (sessionId: string) => void;
49
55
  /** Its menu closed. */
@@ -124,4 +130,4 @@ export interface SidebarSessionRowProps extends SidebarRowHandlers {
124
130
  style?: CSSProperties;
125
131
  }
126
132
  /** Renders one session of the sidebar list. Memoized: keep every prop stable. */
127
- export declare const SidebarSessionRow: import("react").MemoExoticComponent<({ sessionId, title, cwd, hostId, hostBadge, spaceId, isMain, isActive, isRenaming, archived, favorite, scheduled, startedFromKey, renameValue, menuOpen, onSelect, onRenameValueChange, onRenameCommit, onRenameCancel, onStartRename, onDelete, onSetArchived, onSetFavorite, onRetryEnvironment, onWakeEnvironment, onRunEnvironmentAction, onMoveToSpace, onMoveSession, onOpenMenu, onCloseMenu, excerpt, excerptQuery, project, updatedAt, environment, runDetails, artifactBadges, spaces, live, decoration, inboxSection, inboxHandlers, snoozedUntil, woke, recede, selected, swept, className, style }: SidebarSessionRowProps) => import("react").JSX.Element | null>;
133
+ export declare const SidebarSessionRow: import("react").MemoExoticComponent<({ sessionId, title, cwd, hostId, hostBadge, spaceId, isMain, isActive, isRenaming, archived, favorite, scheduled, startedFromKey, renameValue, menuOpen, onSelect, onRenameValueChange, onRenameCommit, onRenameCancel, onStartRename, onDelete, onSetArchived, onSetFavorite, onRetryEnvironment, onWakeEnvironment, onRunEnvironmentAction, onMoveToSpace, onMoveSession, onTeleportSession, onShareSession, canShareSession, onOpenMenu, onCloseMenu, excerpt, excerptQuery, project, updatedAt, environment, runDetails, artifactBadges, spaces, live, decoration, inboxSection, inboxHandlers, snoozedUntil, woke, recede, selected, swept, className, style }: SidebarSessionRowProps) => import("react").JSX.Element | null>;