@opengeni/react 0.12.0 → 0.13.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 (85) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-5TIXRCSI.js → chunk-NFYVQWIB.js} +150 -64
  3. package/dist/chunk-NFYVQWIB.js.map +1 -0
  4. package/dist/index.d.ts +760 -142
  5. package/dist/index.js +5345 -2146
  6. package/dist/index.js.map +1 -1
  7. package/dist/{machines-BeZ3bD3t.d.ts → machines-CnlMb7E-.d.ts} +5 -5
  8. package/dist/machines.d.ts +1 -1
  9. package/dist/machines.js +1 -1
  10. package/package.json +17 -12
  11. package/src/approvals.ts +16 -4
  12. package/src/client.ts +32 -5
  13. package/src/commands/index.ts +1 -7
  14. package/src/commands/registry.ts +46 -12
  15. package/src/components/chat-composer.tsx +135 -39
  16. package/src/components/code-editor.tsx +28 -36
  17. package/src/components/command-palette.tsx +26 -5
  18. package/src/components/desktop-viewer.tsx +29 -16
  19. package/src/components/diff-view.tsx +27 -189
  20. package/src/components/enrollment-consent.tsx +28 -10
  21. package/src/components/enrollment-device-flow.tsx +8 -5
  22. package/src/components/file-browser.tsx +190 -56
  23. package/src/components/fleet-tile.tsx +13 -4
  24. package/src/components/machine-card.tsx +16 -4
  25. package/src/components/machine-dock-bar.tsx +20 -8
  26. package/src/components/machine-metrics.tsx +31 -8
  27. package/src/components/machine-status-pill.tsx +26 -5
  28. package/src/components/machines-dashboard.tsx +8 -2
  29. package/src/components/markdown.tsx +39 -9
  30. package/src/components/message-timeline.tsx +633 -109
  31. package/src/components/pierre-diff.tsx +83 -15
  32. package/src/components/pierre-file.tsx +10 -9
  33. package/src/components/sandbox-files.tsx +110 -227
  34. package/src/components/sandbox-terminal.tsx +256 -88
  35. package/src/components/sandbox-workspace.tsx +823 -0
  36. package/src/components/session-status.tsx +28 -2
  37. package/src/components/workbench-changes.tsx +541 -0
  38. package/src/components/workspace-dock.tsx +85 -22
  39. package/src/hooks/internal.ts +5 -2
  40. package/src/hooks/use-available-models.ts +7 -2
  41. package/src/hooks/use-billing-usage.ts +4 -1
  42. package/src/hooks/use-codex-accounts.ts +74 -44
  43. package/src/hooks/use-composer.ts +57 -36
  44. package/src/hooks/use-environments.ts +92 -47
  45. package/src/hooks/use-file-attachments.ts +101 -55
  46. package/src/hooks/use-goal.ts +52 -16
  47. package/src/hooks/use-machine-chip.ts +134 -0
  48. package/src/hooks/use-machines.ts +34 -16
  49. package/src/hooks/use-packs.ts +24 -19
  50. package/src/hooks/use-relay-frame-stream.ts +5 -2
  51. package/src/hooks/use-rigs.ts +335 -0
  52. package/src/hooks/use-sandbox-files.ts +213 -39
  53. package/src/hooks/use-sandbox-git.ts +188 -11
  54. package/src/hooks/use-sandbox-terminal.ts +18 -14
  55. package/src/hooks/use-scheduled-tasks.ts +10 -2
  56. package/src/hooks/use-session-capabilities.ts +77 -20
  57. package/src/hooks/use-session-control.ts +49 -21
  58. package/src/hooks/use-session-events.ts +48 -20
  59. package/src/hooks/use-session-lineage.ts +119 -0
  60. package/src/hooks/use-session.ts +43 -28
  61. package/src/hooks/use-slash-commands.ts +6 -4
  62. package/src/hooks/use-turn-queue.ts +74 -147
  63. package/src/hooks/use-windowed-sections.ts +204 -0
  64. package/src/hooks/use-workspace-capture.ts +233 -0
  65. package/src/hooks/use-workspace-edit.ts +231 -0
  66. package/src/hooks/use-workspace-sessions.ts +48 -5
  67. package/src/hooks/use-workspaces.ts +18 -15
  68. package/src/index.ts +127 -23
  69. package/src/lib/format.ts +3 -3
  70. package/src/lib/xterm-renderer.ts +65 -0
  71. package/src/lib/xterm-theme.ts +224 -18
  72. package/src/machines.ts +13 -3
  73. package/src/provider.tsx +3 -1
  74. package/src/timeline/activity-rail.tsx +213 -54
  75. package/src/timeline/disclosure-context.tsx +12 -2
  76. package/src/timeline/index.ts +21 -2
  77. package/src/timeline/parsers.ts +44 -10
  78. package/src/timeline/projection.ts +388 -85
  79. package/src/timeline/shared.tsx +111 -24
  80. package/src/timeline/tool-diff.tsx +24 -20
  81. package/src/timeline/tool-renderers.tsx +98 -21
  82. package/src/timeline/turn-summary.tsx +76 -23
  83. package/src/timeline/types.ts +96 -12
  84. package/styles/tokens.css +2 -2
  85. package/dist/chunk-5TIXRCSI.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { C as ClientOverride, S as SessionClientLike } from './machines-BeZ3bD3t.js';
2
- export { a as CONNECTION_STATUS_META, b as ConnectionDot, c as ConnectionDotProps, d as ConnectionStatus, e as ConnectionStatusMeta, f as ConnectionStatusPill, g as ConnectionStatusPillProps, D as DeviceFlowPhase, E as EnrollmentConsent, h as EnrollmentConsentMachine, i as EnrollmentConsentPhase, j as EnrollmentConsentProps, k as EnrollmentDeviceFlow, l as EnrollmentDeviceFlowProps, M as MACHINE_STATE_BADGE_META, m as MachineCard, n as MachineCardProps, o as MachineDockBar, p as MachineDockBarProps, q as MachineMetrics, r as MachineMetricsProps, s as MachineStateBadgeMeta, t as MachineStatusPill, u as MachineStatusPillProps, v as MachinesClientLike, w as MachinesDashboard, x as MachinesDashboardProps, O as OpenGeniContextValue, y as OpenGeniProvider, z as OpenGeniProviderProps, A as SharedMachineDisclosure, B as SharedMachineDisclosureProps, U as UseMachinesOptions, F as UseMachinesResult, G as connectionStatusForState, H as useMachines, I as useOpenGeni, J as useOpenGeniClient } from './machines-BeZ3bD3t.js';
3
- import { SessionEvent, Session, ResourceRef, ToolRef, SessionStatus as SessionStatus$1, GitFileDiff, StreamConnectionState, SendMessageInput, FileAsset, FileResourceRef, SessionTurn, UpdateSessionTurnRequest, SessionGoal, ScheduledTask, WorkspaceEnvironment, CreateWorkspaceEnvironmentRequest, UpdateWorkspaceEnvironmentRequest, WorkspaceEnvironmentVariableMetadata, CapabilityPack, PackInstallation, RegisterCapabilityPackRequest, WorkspaceRegisteredPack, EnablePackRequest, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, BillingBalance, UsageEvent, ClientModel, SessionCapabilities, DesktopStreamCapability, DesktopConnectionState, DesktopRfbFactory, TerminalCapability, FsReadResponse, FsWriteResponse, Permission, CapabilityUnavailableReason, CodexAccountsResponse, CodexAccount, CodexRotationSettings } from '@opengeni/sdk';
1
+ import { C as ClientOverride, S as SessionClientLike } from './machines-CnlMb7E-.js';
2
+ export { a as CONNECTION_STATUS_META, b as ConnectionDot, c as ConnectionDotProps, d as ConnectionStatus, e as ConnectionStatusMeta, f as ConnectionStatusPill, g as ConnectionStatusPillProps, D as DeviceFlowPhase, E as EnrollmentConsent, h as EnrollmentConsentMachine, i as EnrollmentConsentPhase, j as EnrollmentConsentProps, k as EnrollmentDeviceFlow, l as EnrollmentDeviceFlowProps, M as MACHINE_STATE_BADGE_META, m as MachineCard, n as MachineCardProps, o as MachineDockBar, p as MachineDockBarProps, q as MachineMetrics, r as MachineMetricsProps, s as MachineStateBadgeMeta, t as MachineStatusPill, u as MachineStatusPillProps, v as MachinesClientLike, w as MachinesDashboard, x as MachinesDashboardProps, O as OpenGeniContextValue, y as OpenGeniProvider, z as OpenGeniProviderProps, A as SharedMachineDisclosure, B as SharedMachineDisclosureProps, U as UseMachinesOptions, F as UseMachinesResult, G as connectionStatusForState, H as useMachines, I as useOpenGeni, J as useOpenGeniClient } from './machines-CnlMb7E-.js';
3
+ import { SessionEvent, Session, ResourceRef, ToolRef, SessionStatus as SessionStatus$1, GitFileDiff, StreamConnectionState, SendMessageInput, FileAsset, FileResourceRef, SessionQueueSnapshot, SessionTurn, SessionGoal, ScheduledTask, SessionLineageResponse, VariableSet, CreateVariableSetRequest, UpdateVariableSetRequest, VariableSetVariableMetadata, RigChange, Rig, UpdateRigRequest, RigVersion, ProposeRigChangeRequest, CreateRigRequest, CapabilityPack, PackInstallation, RegisterCapabilityPackRequest, WorkspaceRegisteredPack, EnablePackRequest, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, BillingBalance, UsageEvent, ClientModel, SessionCapabilities, DesktopStreamCapability, DesktopConnectionState, DesktopRfbFactory, TerminalCapability, FsReadResponse, FsWriteResponse, WorkspaceCaptureManifest, WorkspaceCaptureDegradedReason, MachineState, Permission, CapabilityUnavailableReason, MachineView, CodexAccountsResponse, CodexAccount, CodexRotationSettings } from '@opengeni/sdk';
4
4
  export { MachineKind, MachineMetricsSeriesResponse, MachineState, MachineView, MachinesResponse, MetricSample } from '@opengeni/sdk';
5
5
  import * as react from 'react';
6
6
  import { ComponentType, ReactNode, RefObject, KeyboardEvent, ClipboardEvent } from 'react';
@@ -42,8 +42,6 @@ type UserMessageItem = {
42
42
  kind: "user-message";
43
43
  id: string;
44
44
  text: string;
45
- /** Queued for a future turn whose start has not appeared in the event log. */
46
- pending?: boolean;
47
45
  /** Resources attached to this message (file uploads, repositories). */
48
46
  resources: ResourceRef[];
49
47
  /** Tools requested for the turn this message starts. */
@@ -96,19 +94,27 @@ type WorkerItem = {
96
94
  id: string;
97
95
  turnId: string | null;
98
96
  callId: string | null;
99
- action: "spawn" | "message" | "interrupt";
97
+ action: "spawn" | "message";
100
98
  /** The worker's initial message / the message sent to it, when parseable. */
101
99
  prompt: string | null;
102
100
  /** The target/spawned worker session id, when parseable from args/output. */
103
101
  workerSessionId: string | null;
104
- /**
105
- * For an `interrupt` action, whether it stops the target (default) or steers
106
- * it (cancel the current turn, keep the goal). Absent on spawn/message.
107
- */
108
- mode?: "stop" | "steer";
109
102
  status: "running" | "complete" | "failed" | "cancelled";
110
103
  occurredAt: string;
111
104
  };
105
+ type WorkerCompletionItem = {
106
+ kind: "worker-completion";
107
+ id: string;
108
+ turnId: string | null;
109
+ occurredAt: string;
110
+ childSessionId: string;
111
+ childStatus: string;
112
+ goalStatus: string | null;
113
+ goalText: string | null;
114
+ evidence: string | null;
115
+ pausedReason: string | null;
116
+ text: string;
117
+ };
112
118
  type SandboxItem = {
113
119
  kind: "sandbox";
114
120
  id: string;
@@ -116,9 +122,45 @@ type SandboxItem = {
116
122
  name: string;
117
123
  command: string | null;
118
124
  output: string;
125
+ origin?: "created" | "restored" | "resumed" | null;
119
126
  status: "running" | "complete" | "failed" | "cancelled";
120
127
  occurredAt: string;
121
128
  };
129
+ /**
130
+ * A first-party workspace-memory write the agent made mid-turn — a `memory.saved`
131
+ * (it committed a new preference / fact / procedure / decision / history) or a
132
+ * `memory.corrected` (it updated or archived an existing one). A settled save is
133
+ * ordinary progress, not an exceptional state, so it renders as a calm NEUTRAL
134
+ * step on the rail (never accent/color). When the host app supplies an
135
+ * `onMemoryClick` handler the row also deep-links to the record in its memory
136
+ * pane; without one it is non-interactive rich content.
137
+ */
138
+ type MemoryItem = {
139
+ kind: "memory";
140
+ id: string;
141
+ turnId: string | null;
142
+ variant: "saved" | "corrected";
143
+ /** The memory's kind enum (`"preference" | "semantic" | …`); mapped to a human label at render. */
144
+ memoryKind: string;
145
+ /** The memory text, ellipsized to ≤120 chars server-side. For a supersede this is the OLD text. */
146
+ preview: string;
147
+ /** The save collapsed into an existing memory (no new row was written). Saved variant only. */
148
+ deduped?: boolean;
149
+ /** The NEW text when a correction superseded the memory with a replacement; absent = updated-in-place or archived. */
150
+ replacementPreview?: string;
151
+ /**
152
+ * What a `memory.corrected` did: `"superseded"` (replaced by a new record, see
153
+ * `replacementPreview`), `"updated"` (edited in place — the record lives on), or
154
+ * `"archived"` (retired). Distinguishes updated-in-place from archived when there
155
+ * is no replacement. Corrected variant only; read defensively (may be absent).
156
+ */
157
+ action?: string;
158
+ /** The saved / corrected memory's id — the deep-link target for a save. */
159
+ memoryId: string;
160
+ /** The replacement memory's id when a correction produced one — the LIVE record the deep-link targets. */
161
+ replacementMemoryId?: string;
162
+ occurredAt: string;
163
+ };
122
164
  type SessionStatusItem = {
123
165
  kind: "session-status";
124
166
  id: string;
@@ -128,7 +170,7 @@ type SessionStatusItem = {
128
170
  type GoalItem = {
129
171
  kind: "goal";
130
172
  id: string;
131
- action: "set" | "updated" | "completed" | "paused" | "resumed" | "continuation";
173
+ action: "set" | "updated" | "completed" | "paused" | "resumed" | "cleared" | "continuation";
132
174
  text: string | null;
133
175
  occurredAt: string;
134
176
  };
@@ -137,12 +179,45 @@ type NoticeItem = {
137
179
  id: string;
138
180
  tone: "waiting" | "cancelled" | "failed";
139
181
  text: string;
182
+ /** Optional evidence kept inspectable without overwhelming the main rail. */
183
+ details?: {
184
+ label: string;
185
+ value: unknown;
186
+ };
140
187
  action?: {
141
188
  label: string;
142
189
  url: string;
143
190
  };
144
191
  occurredAt: string;
145
192
  };
193
+ /**
194
+ * A tool call hit a connection whose credential lapsed — the broker asked the
195
+ * user to reconnect the provider before the turn can continue. Carries the
196
+ * structured `tool.auth_needed` payload so the renderer can draw a clean inline
197
+ * reconnect affordance (provider logo + one human line + a Reconnect button)
198
+ * and the app can start the right recovery flow (OAuth reconnect for the
199
+ * surviving connection, or credential re-entry for an api-key one). The `reason`
200
+ * shapes the human copy but is never shown raw.
201
+ */
202
+ type AuthNeededItem = {
203
+ kind: "auth-needed";
204
+ id: string;
205
+ turnId: string | null;
206
+ /** The connection's registrable domain, e.g. "linear.app". */
207
+ providerDomain: string;
208
+ /** The lapsed connection to reconnect, when the row survived. */
209
+ connectionId: string | null;
210
+ reason: "missing_connection" | "expired" | "insufficient_scope" | "refresh_failed" | null;
211
+ /** Scopes the provider now needs; may inform the copy, never shown as a raw label. */
212
+ scopes: string[];
213
+ /** The OAuth `resource` (RFC 8707) the reconnect should target, when supplied. */
214
+ resource: string | null;
215
+ /** The tool whose call triggered the reauth, for context. */
216
+ toolName: string | null;
217
+ /** A pre-minted authorization URL, when the broker already produced one. */
218
+ authorizationUrl: string | null;
219
+ occurredAt: string;
220
+ };
146
221
  type TurnOutcome = "complete" | "failed" | "cancelled";
147
222
  type TurnEndItem = {
148
223
  kind: "turn-end";
@@ -152,9 +227,9 @@ type TurnEndItem = {
152
227
  failureText: string | null;
153
228
  occurredAt: string;
154
229
  };
155
- type TimelineItem = UserMessageItem | AgentMessageItem | ReasoningItem | ToolCallItem | WorkerItem | SandboxItem | SessionStatusItem | GoalItem | NoticeItem | TurnEndItem;
156
- /** Activity items cluster between chat messages (reasoning, tools, workers, sandbox). */
157
- type ActivityItem = ReasoningItem | ToolCallItem | WorkerItem | SandboxItem;
230
+ type TimelineItem = UserMessageItem | AgentMessageItem | ReasoningItem | ToolCallItem | WorkerItem | WorkerCompletionItem | SandboxItem | SessionStatusItem | GoalItem | NoticeItem | AuthNeededItem | MemoryItem | TurnEndItem;
231
+ /** Activity items cluster between chat messages (reasoning, tools, workers, sandbox, memory). */
232
+ type ActivityItem = ReasoningItem | ToolCallItem | WorkerItem | SandboxItem | MemoryItem;
158
233
  type TimelineGroup = {
159
234
  kind: "item";
160
235
  item: TimelineItem;
@@ -191,7 +266,16 @@ declare function groupTimeline(items: TimelineItem[]): TimelineGroup[];
191
266
  * text: "{...}" }], structuredContent? }`).
192
267
  */
193
268
  declare function extractSessionRef(value: unknown, depth?: number): string | null;
194
- /** Readable label for a tool call ("session_create" -> "session create"). */
269
+ /**
270
+ * Readable label for a tool call ("session_create" -> "session create").
271
+ *
272
+ * MCP tools are namespaced `<serverId>__<toolName>` (see prefixedMcpToolName),
273
+ * and for catalog-imported servers that serverId is an opaque slug+hash
274
+ * ("mcp-integrations-sh-supabase-com-34ed9dcf1390-0i6tcf8"). De-slugging the
275
+ * whole thing leaked that id into the timeline; strip the server prefix and show
276
+ * just the tool ("list organizations"). Names without the `__` boundary (plain
277
+ * built-ins like "session_create") are unaffected.
278
+ */
195
279
  declare function toolDisplayName(name: string): string;
196
280
 
197
281
  type ToolRendererProps = {
@@ -244,11 +328,17 @@ type ActivityRailProps = {
244
328
  toolRegistry?: ToolRegistry | undefined;
245
329
  /** Drill into a spawned worker session. */
246
330
  onOpenSession?: ((sessionId: string) => void) | undefined;
331
+ /**
332
+ * Deep-link a memory row to its record in the host's memory pane. Opt-in: the
333
+ * library draws no "View in memory" affordance without a handler (the memory
334
+ * row is then non-interactive rich content). See {@link MessageTimelineProps}.
335
+ */
336
+ onMemoryClick?: ((memoryId: string) => void) | undefined;
247
337
  /** Drop the left rule + indent (used inside a folded turn summary). */
248
338
  bare?: boolean | undefined;
249
339
  className?: string | undefined;
250
340
  };
251
- declare function ActivityRail({ items, toolRegistry, onOpenSession, bare, className }: ActivityRailProps): react_jsx_runtime.JSX.Element;
341
+ declare function ActivityRail({ items, toolRegistry, onOpenSession, onMemoryClick, bare, className, }: ActivityRailProps): react_jsx_runtime.JSX.Element;
252
342
 
253
343
  /**
254
344
  * A subtle settle signal — see the CHIP DOCTRINE above. The closed tone set.
@@ -312,7 +402,7 @@ type ActivityDisclosureProps = {
312
402
  * the body mounts only when expanded.
313
403
  */
314
404
  declare function ActivityDisclosure({ icon, iconTone: iconToneProp, title, titleMono, running, preview, media, chip: chipProp, failed, cancelled, expandable, children, }: ActivityDisclosureProps): react_jsx_runtime.JSX.Element;
315
- declare function TermBlock({ command, workdir, output, live, tailLines, }: {
405
+ declare function TermBlock({ command, workdir, output, live, tailLines, failed, }: {
316
406
  /**
317
407
  * The command shown in the prompt header. Pass `null` when the row title
318
408
  * already carries it (e.g. an exec row titled `$ cmd`): the header then drops
@@ -324,6 +414,8 @@ declare function TermBlock({ command, workdir, output, live, tailLines, }: {
324
414
  /** The FULL output. TermBlock owns the tail/full slicing internally. */
325
415
  output: string;
326
416
  live?: boolean | undefined;
417
+ /** A non-zero exit / failed call — tints the left accent red (the one hue). */
418
+ failed?: boolean | undefined;
327
419
  /**
328
420
  * When the output exceeds the tail window, only the last `tailLines` are shown
329
421
  * with a "show full output" toggle. The component holds the full text, so the
@@ -331,13 +423,13 @@ declare function TermBlock({ command, workdir, output, live, tailLines, }: {
331
423
  */
332
424
  tailLines?: number | undefined;
333
425
  }): react_jsx_runtime.JSX.Element;
334
- declare function PayloadBlock({ label, value, failed }: {
426
+ declare function PayloadBlock({ label, value, failed, }: {
335
427
  label: string;
336
428
  value: unknown;
337
429
  failed?: boolean | undefined;
338
430
  }): react_jsx_runtime.JSX.Element | null;
339
431
  /** A quiet inline note inside an expanded body (lost output, empty frame, …). */
340
- declare function BodyNote({ children, tone }: {
432
+ declare function BodyNote({ children, tone, }: {
341
433
  children: ReactNode;
342
434
  tone?: "error" | "muted" | undefined;
343
435
  }): react_jsx_runtime.JSX.Element;
@@ -356,7 +448,7 @@ declare function MediaEmpty(): react_jsx_runtime.JSX.Element;
356
448
  * Outside one it degrades to a plain, non-interactive image — never a dead
357
449
  * "Expand" button that announces an action it cannot perform.
358
450
  */
359
- declare function Thumbnail({ src, caption, alt }: {
451
+ declare function Thumbnail({ src, caption, alt, }: {
360
452
  src: string;
361
453
  caption?: string | undefined;
362
454
  alt?: string;
@@ -367,7 +459,7 @@ declare function Thumbnail({ src, caption, alt }: {
367
459
  * so it never breaks the row layout. Like {@link Thumbnail}, it degrades to a
368
460
  * plain image outside a `LightboxProvider`.
369
461
  */
370
- declare function ScreenshotFigure({ src, caption, alt }: {
462
+ declare function ScreenshotFigure({ src, caption, alt, }: {
371
463
  src: string;
372
464
  caption?: string | undefined;
373
465
  alt?: string;
@@ -402,7 +494,7 @@ declare function LightboxProvider({ children }: {
402
494
  * Seed the initial open state of every timeline collapsible below this node.
403
495
  * Intended for screenshot/test instrumentation only; absent by default.
404
496
  */
405
- declare function DisclosureDefaultsProvider({ defaultOpen, children }: {
497
+ declare function DisclosureDefaultsProvider({ defaultOpen, children, }: {
406
498
  defaultOpen: boolean;
407
499
  children: ReactNode;
408
500
  }): react_jsx_runtime.JSX.Element;
@@ -422,10 +514,17 @@ type TurnSummaryProps = {
422
514
  durationMs?: number | undefined;
423
515
  /** Start expanded. */
424
516
  defaultOpen?: boolean | undefined;
517
+ /**
518
+ * A nested fold — a cluster or sub-turn INSIDE an already-expanded turn. It
519
+ * drops the bordered/filled chip and renders as a plain disclosure node on the
520
+ * parent's rail (chevron + glyph + facets), so expanding a turn reveals a thread
521
+ * of nodes, never a stack of boxes-in-boxes. The top-level fold stays a chip.
522
+ */
523
+ bare?: boolean | undefined;
425
524
  /** The rendered activity rail revealed on expand. */
426
525
  children: React.ReactNode;
427
526
  };
428
- declare function TurnSummary({ items, outcome, failureText, durationMs, defaultOpen, children }: TurnSummaryProps): react_jsx_runtime.JSX.Element;
527
+ declare function TurnSummary({ items, outcome, failureText, durationMs, defaultOpen, bare, children, }: TurnSummaryProps): react_jsx_runtime.JSX.Element;
429
528
 
430
529
  /** Recover the exit code from a sandbox exec banner (`Process exited with code N`). */
431
530
  declare function sandboxCommandExitCode(out: unknown): number | null;
@@ -540,9 +639,8 @@ declare function useSessionEvents(sessionId: string | null | undefined, options?
540
639
 
541
640
  type ComposerSendExtras = Omit<SendMessageInput, "text" | "clientEventId">;
542
641
  /**
543
- * Compose-time delivery choice. `queue` (the default) stacks the message
544
- * behind the running turn — visible, editable, reorderable until claimed.
545
- * `steer` interrupts the running turn and injects the message now.
642
+ * Enter appends a prompt; Cmd/Ctrl+Enter steers it to the head and supersedes
643
+ * the current inference.
546
644
  */
547
645
  type ComposerMode = "queue" | "steer";
548
646
  type UseComposerOptions = ClientOverride & {
@@ -554,27 +652,24 @@ type UseComposerOptions = ClientOverride & {
554
652
  * surrounding UI state (attachment pickers, model selectors, ...).
555
653
  */
556
654
  sendExtras?: ComposerSendExtras | (() => ComposerSendExtras) | undefined;
557
- /** Initial delivery mode. Defaults to `"queue"`. */
558
- defaultMode?: ComposerMode | undefined;
559
655
  };
560
656
  type ComposerState = {
561
657
  value: string;
562
658
  setValue: (value: string) => void;
563
- /** Send the draft (or an explicit text) using the current mode. */
564
- send: (text?: string) => Promise<boolean>;
659
+ /** Send the draft (or explicit text). Queue is the default; steer is explicit. */
660
+ send: (text?: string, mode?: ComposerMode) => Promise<boolean>;
565
661
  sending: boolean;
566
662
  canSend: boolean;
567
- /** Queue (default) vs steer the compose-time delivery choice. */
568
- mode: ComposerMode;
569
- setMode: (mode: ComposerMode) => void;
570
- /** Ask the agent to stop the current turn. */
571
- interrupt: (reason?: string) => Promise<void>;
572
- interrupting: boolean;
663
+ /** Pause the session without deleting its prompt queue. */
664
+ pause: (reason?: string) => Promise<void>;
665
+ pausing: boolean;
666
+ resume: (reason?: string) => Promise<void>;
667
+ resuming: boolean;
573
668
  error: Error | null;
574
669
  clearError: () => void;
575
670
  };
576
671
  /**
577
- * Draft + send + interrupt state for the chat composer — the only
672
+ * Draft + send + Pause/Resume state for the chat composer — the only
578
673
  * human-to-agent input surface. The draft survives a failed send (nothing is
579
674
  * more hostile than losing a typed message); each send carries a generated
580
675
  * `clientEventId` so retries stay idempotent server-side.
@@ -596,6 +691,8 @@ declare function composeSendInput(text: string, clientEventId: string, extras: C
596
691
  declare function shouldSubmitOnKey(event: {
597
692
  key: string;
598
693
  shiftKey: boolean;
694
+ metaKey?: boolean;
695
+ ctrlKey?: boolean;
599
696
  nativeEvent?: {
600
697
  isComposing?: boolean;
601
698
  };
@@ -659,55 +756,32 @@ type UseFileAttachmentsResult = {
659
756
  */
660
757
  declare function useFileAttachments(options?: UseFileAttachmentsOptions): UseFileAttachmentsResult;
661
758
 
662
- /** Event types that change the turn queue (queue/edit/reorder/claim/finish). */
759
+ /** Events that can change the authoritative prompt queue or its pause gates. */
663
760
  declare function isTurnQueueEvent(event: Pick<SessionEvent, "type">): boolean;
664
- /** Queued turns in execution order (position, then creation time). */
665
- declare function queueFromTurns(turns: SessionTurn[]): SessionTurn[];
666
- /** The turn currently holding the session (running or awaiting approval). */
667
- declare function activeTurnFromTurns(turns: SessionTurn[]): SessionTurn | null;
668
- /** Optimistic projection of a queued-turn edit. */
669
- declare function applyTurnEdit(turns: SessionTurn[], turnId: string, update: UpdateSessionTurnRequest): SessionTurn[];
670
- /**
671
- * Optimistic projection of a reorder, mirroring the server: the listed
672
- * queued turns get positions 1..n in the given order; everything else keeps
673
- * its position.
674
- */
675
- declare function applyTurnReorder(turns: SessionTurn[], turnIds: string[]): SessionTurn[];
676
- /** Optimistic projection of a queued-turn delete (server marks it cancelled). */
677
- declare function applyTurnRemoval(turns: SessionTurn[], turnId: string): SessionTurn[];
678
761
  type UseTurnQueueOptions = ClientOverride & SessionEventFeedOptions & {
679
- /** Optional safety-net polling (ms). Off by default — turn.* events drive updates. */
680
762
  pollIntervalMs?: number | undefined;
681
763
  };
682
764
  type UseTurnQueueResult = {
683
- /** All turns the API returned (history + queue), newest server view. */
684
- turns: SessionTurn[];
685
- /** Queued turns in execution order — render this as the editable queue. */
765
+ snapshot: SessionQueueSnapshot | null;
766
+ /** Human/API prompts exactly in server execution order. Never client-sorted. */
686
767
  queue: SessionTurn[];
687
- /** The running / requires_action turn, if any. */
688
- activeTurn: SessionTurn | null;
768
+ controlState: SessionQueueSnapshot["controlState"] | null;
769
+ controlGeneration: number | null;
770
+ workspaceInferenceState: SessionQueueSnapshot["workspaceInferenceState"] | null;
771
+ workspaceInferenceGeneration: number | null;
772
+ workspaceRunExceptionGeneration: number | null;
689
773
  loading: boolean;
690
774
  error: Error | null;
691
775
  refresh: () => Promise<void>;
692
- /** Edit a queued turn (optimistic; rolls back via refetch on failure). */
693
- editTurn: (turnId: string, update: UpdateSessionTurnRequest) => Promise<SessionTurn | null>;
694
- /** Reorder the queue to the given queued-turn id order (optimistic). */
695
- reorderTurns: (turnIds: string[]) => Promise<SessionTurn[] | null>;
696
- /** Delete (cancel) a queued turn before it is claimed (optimistic). */
697
- removeTurn: (turnId: string) => Promise<SessionTurn | null>;
698
- /** True while an edit/reorder/remove is in flight. */
776
+ /** Delete a waiting prompt before the worker claims it. */
777
+ removeTurn: (turnId: string) => Promise<boolean>;
699
778
  mutating: boolean;
700
- /** Last failed mutation, until the next mutation or clear. */
701
779
  mutationError: Error | null;
702
780
  clearMutationError: () => void;
703
781
  };
704
782
  /**
705
- * The live turn queue the heart of the queue-by-default interaction model.
706
- * Messages sent mid-turn stack up here, visible and editable/reorderable/
707
- * deletable until the worker claims them. Updates arrive over the session
708
- * event stream (`turn.*`), either shared via `options.events` (pass the log
709
- * from `useSessionEvents` to reuse its connection) or a dedicated tail
710
- * stream. All mutations apply optimistically and reconcile with the server.
783
+ * The single authoritative waiting-prompt queue. The server owns ordering; the
784
+ * client renders the returned array verbatim and supports deletion only.
711
785
  */
712
786
  declare function useTurnQueue(sessionId: string | null | undefined, options?: UseTurnQueueOptions): UseTurnQueueResult;
713
787
 
@@ -731,7 +805,11 @@ type UseGoalResult = {
731
805
  pause: (rationale?: string) => Promise<SessionGoal | null>;
732
806
  /** Resume a paused goal: resets counters and re-arms continuations. */
733
807
  resume: () => Promise<SessionGoal | null>;
734
- /** True while a pause/resume is in flight. */
808
+ /** Clear the session goal; goal-less sessions remain a successful no-op. */
809
+ clearGoal: () => Promise<void>;
810
+ /** Alias for `clearGoal`. */
811
+ deleteGoal: () => Promise<void>;
812
+ /** True while a pause/resume/clear is in flight. */
735
813
  updating: boolean;
736
814
  mutationError: Error | null;
737
815
  clearMutationError: () => void;
@@ -746,9 +824,9 @@ declare function useGoal(sessionId: string | null | undefined, options?: UseGoal
746
824
 
747
825
  type UseSessionControlOptions = ClientOverride;
748
826
  type UseSessionControlResult = {
749
- /** Interrupt the running turn (the explicit alternative to queueing). */
750
- interrupt: (reason?: string) => Promise<SessionEvent | null>;
751
- interrupting: boolean;
827
+ pause: (reason?: string) => Promise<SessionEvent | null>;
828
+ resume: (reason?: string) => Promise<SessionEvent | null>;
829
+ controlling: boolean;
752
830
  /** Approve a pending `requires_action` approval. */
753
831
  approve: (approvalId: string, message?: string) => Promise<SessionEvent | null>;
754
832
  /** Reject a pending `requires_action` approval. */
@@ -759,7 +837,7 @@ type UseSessionControlResult = {
759
837
  clearError: () => void;
760
838
  };
761
839
  /**
762
- * Session control events: interrupt and approval decisions. Pair with
840
+ * Session pause/resume and approval decisions. Pair with
763
841
  * `useSessionEvents` (for `session.requiresAction` payloads carrying the
764
842
  * `approvalId`) to render an approval bar.
765
843
  */
@@ -781,12 +859,22 @@ declare function useScheduledTasks(options?: UseScheduledTasksOptions): UseSched
781
859
 
782
860
  type UseWorkspaceSessionsOptions = ClientOverride & {
783
861
  limit?: number | undefined;
862
+ parentSessionId?: string | null | undefined;
863
+ cursor?: string | undefined;
864
+ search?: string | undefined;
784
865
  /** Refresh interval (ms) for fleet/manager views. Off by default. */
785
866
  pollIntervalMs?: number | undefined;
786
867
  enabled?: boolean | undefined;
787
868
  };
788
869
  type UseWorkspaceSessionsResult = {
870
+ /**
871
+ * All visible rows, with pins first. This preserves the pre-pinning hook
872
+ * contract for consumers that only read `sessions`.
873
+ */
789
874
  sessions: Session[];
875
+ /** The complete personal pinned section, also present in `sessions`. */
876
+ pinned: Session[];
877
+ nextCursor: string | null;
790
878
  loading: boolean;
791
879
  error: Error | null;
792
880
  refresh: () => Promise<void>;
@@ -794,32 +882,142 @@ type UseWorkspaceSessionsResult = {
794
882
  /** List the workspace's sessions — the data behind fleet and manager views. */
795
883
  declare function useWorkspaceSessions(options?: UseWorkspaceSessionsOptions): UseWorkspaceSessionsResult;
796
884
 
797
- type UseEnvironmentsOptions = ClientOverride & {
885
+ type UseSessionLineageOptions = ClientOverride & {
886
+ events?: SessionEvent[] | undefined;
887
+ /** Refresh interval (ms). Off by default. */
798
888
  pollIntervalMs?: number | undefined;
799
889
  enabled?: boolean | undefined;
800
890
  };
801
- type UseEnvironmentsResult = {
802
- environments: WorkspaceEnvironment[];
891
+ type UseSessionLineageResult = {
892
+ lineage: SessionLineageResponse | null;
803
893
  loading: boolean;
804
894
  error: Error | null;
805
895
  refresh: () => Promise<void>;
806
- create: (request: CreateWorkspaceEnvironmentRequest) => Promise<WorkspaceEnvironment | null>;
807
- update: (environmentId: string, request: UpdateWorkspaceEnvironmentRequest) => Promise<WorkspaceEnvironment | null>;
808
- remove: (environmentId: string) => Promise<boolean>;
896
+ };
897
+ declare function isLineageRefreshEvent(event: SessionEvent): boolean;
898
+ /** Read the ancestors + descendant tree for one session. Data-only; no UI state. */
899
+ declare function useSessionLineage(sessionId: string | null | undefined, options?: UseSessionLineageOptions): UseSessionLineageResult;
900
+
901
+ type UseVariableSetsOptions = ClientOverride & {
902
+ pollIntervalMs?: number | undefined;
903
+ enabled?: boolean | undefined;
904
+ };
905
+ type UseVariableSetsResult = {
906
+ variableSets: VariableSet[];
907
+ loading: boolean;
908
+ error: Error | null;
909
+ refresh: () => Promise<void>;
910
+ create: (request: CreateVariableSetRequest) => Promise<VariableSet | null>;
911
+ update: (variableSetId: string, request: UpdateVariableSetRequest) => Promise<VariableSet | null>;
912
+ remove: (variableSetId: string) => Promise<boolean>;
809
913
  /** Set/rotate a variable. Values are write-only — reads expose metadata only. */
810
- setVariable: (environmentId: string, name: string, value: string) => Promise<WorkspaceEnvironmentVariableMetadata | null>;
811
- deleteVariable: (environmentId: string, name: string) => Promise<boolean>;
914
+ setVariable: (variableSetId: string, name: string, value: string) => Promise<VariableSetVariableMetadata | null>;
915
+ deleteVariable: (variableSetId: string, name: string) => Promise<boolean>;
812
916
  mutating: boolean;
813
917
  mutationError: Error | null;
814
918
  clearMutationError: () => void;
815
919
  };
816
920
  /**
817
- * Workspace environments (named, encrypted variable sets attached to sessions
921
+ * Variable sets (named, encrypted variable sets attached to sessions
818
922
  * and scheduled tasks). Variable values are write-only end to end: this hook
819
923
  * never sees a value after it is sent.
820
924
  */
925
+ declare function useVariableSets(options?: UseVariableSetsOptions): UseVariableSetsResult;
926
+ /** @deprecated use UseVariableSetsOptions */
927
+ type UseEnvironmentsOptions = UseVariableSetsOptions;
928
+ /** @deprecated use UseVariableSetsResult */
929
+ type UseEnvironmentsResult = UseVariableSetsResult & {
930
+ environments: VariableSet[];
931
+ };
932
+ /** @deprecated use useVariableSets */
821
933
  declare function useEnvironments(options?: UseEnvironmentsOptions): UseEnvironmentsResult;
822
934
 
935
+ type UseRigsOptions = ClientOverride & {
936
+ pollIntervalMs?: number | undefined;
937
+ enabled?: boolean | undefined;
938
+ };
939
+ type UseRigsResult = {
940
+ rigs: Rig[];
941
+ loading: boolean;
942
+ error: Error | null;
943
+ refresh: () => Promise<void>;
944
+ create: (request: CreateRigRequest) => Promise<Rig | null>;
945
+ update: (rigId: string, request: UpdateRigRequest) => Promise<Rig | null>;
946
+ remove: (rigId: string) => Promise<boolean>;
947
+ listVersions: (rigId: string) => Promise<RigVersion[] | null>;
948
+ activateVersion: (rigId: string, versionId: string) => Promise<RigVersion | null>;
949
+ listChanges: (rigId: string) => Promise<RigChange[] | null>;
950
+ proposeChange: (rigId: string, request: ProposeRigChangeRequest) => Promise<RigChange | null>;
951
+ mutating: boolean;
952
+ mutationError: Error | null;
953
+ clearMutationError: () => void;
954
+ };
955
+ /**
956
+ * Rigs (workspace-scoped, versioned sandbox machine definitions). The list
957
+ * polls; version/change reads are on-demand (they are per-rig detail, not part
958
+ * of the list surface).
959
+ */
960
+ declare function useRigs(options?: UseRigsOptions): UseRigsResult;
961
+ type UseRigOptions = ClientOverride & {
962
+ pollIntervalMs?: number | undefined;
963
+ enabled?: boolean | undefined;
964
+ };
965
+ type UseRigResult = {
966
+ rig: Rig | null;
967
+ loading: boolean;
968
+ error: Error | null;
969
+ refresh: () => Promise<void>;
970
+ update: (request: UpdateRigRequest) => Promise<Rig | null>;
971
+ remove: () => Promise<boolean>;
972
+ activateVersion: (versionId: string) => Promise<RigVersion | null>;
973
+ proposeChange: (request: ProposeRigChangeRequest) => Promise<RigChange | null>;
974
+ /** Re-run verification for a change (asynchronous — poll for the outcome). */
975
+ verifyChange: (changeId: string) => Promise<RigChange | null>;
976
+ /** Promote a verified definition_edit into a new active version (rigs:manage). */
977
+ promoteChange: (changeId: string) => Promise<RigVersion | null>;
978
+ /** Re-verify the active version's checks in a clean throwaway sandbox. */
979
+ verify: () => Promise<{
980
+ ok: boolean;
981
+ versionId: string;
982
+ } | null>;
983
+ mutating: boolean;
984
+ mutationError: Error | null;
985
+ clearMutationError: () => void;
986
+ };
987
+ /**
988
+ * A single rig (its active version + counts), polled so verification and
989
+ * promotion state stay live. Owns the rig's write actions; the versions and
990
+ * changes lists are separate polled reads (`useRigVersions`/`useRigChanges`).
991
+ */
992
+ declare function useRig(rigId: string, options?: UseRigOptions): UseRigResult;
993
+ type UseRigVersionsOptions = ClientOverride & {
994
+ pollIntervalMs?: number | undefined;
995
+ enabled?: boolean | undefined;
996
+ };
997
+ type UseRigVersionsResult = {
998
+ versions: RigVersion[];
999
+ loading: boolean;
1000
+ error: Error | null;
1001
+ refresh: () => Promise<void>;
1002
+ };
1003
+ /** A rig's append-only version history, newest-first (polled). */
1004
+ declare function useRigVersions(rigId: string, options?: UseRigVersionsOptions): UseRigVersionsResult;
1005
+ type UseRigChangesOptions = ClientOverride & {
1006
+ pollIntervalMs?: number | undefined;
1007
+ enabled?: boolean | undefined;
1008
+ };
1009
+ type UseRigChangesResult = {
1010
+ changes: RigChange[];
1011
+ loading: boolean;
1012
+ error: Error | null;
1013
+ refresh: () => Promise<void>;
1014
+ };
1015
+ /**
1016
+ * A rig's change queue (polled). The default poll cadence lets a change move
1017
+ * through verifying → merged/rejected without a manual refresh.
1018
+ */
1019
+ declare function useRigChanges(rigId: string, options?: UseRigChangesOptions): UseRigChangesResult;
1020
+
823
1021
  type UsePacksOptions = ClientOverride & {
824
1022
  pollIntervalMs?: number | undefined;
825
1023
  enabled?: boolean | undefined;
@@ -914,7 +1112,7 @@ type UseAvailableModelsResult = {
914
1112
  */
915
1113
  declare function useAvailableModels(options?: UseAvailableModelsOptions): UseAvailableModelsResult;
916
1114
 
917
- type SessionCapabilitiesState = "idle" | "negotiating" | "ready" | "cold" | "error";
1115
+ type SessionCapabilitiesState = "idle" | "negotiating" | "ready" | "cold" | "on-demand" | "error";
918
1116
  type UseSessionCapabilitiesOptions = ClientOverride & {
919
1117
  /**
920
1118
  * Live event log to fold `stream.url.rotated` from (usually
@@ -940,15 +1138,18 @@ type UseSessionCapabilitiesOptions = ClientOverride & {
940
1138
  */
941
1139
  attachTerminal?: boolean | undefined;
942
1140
  /**
943
- * Whether to acquire a viewer holder purely to KEEP THE BOX WARM while the
944
- * structured Files surface is open. Shares the SAME viewer attach as the
945
- * desktop/terminal (one warm box, one holder) and — like the terminal — needs
946
- * NO un-redacted acknowledgment: listing/reading/writing files is the ordinary
947
- * Channel-A control plane, not the pixel plane. Default false: the Files tab
948
- * negotiates read-only and each op pays the cold-box resume (~5s). When true,
949
- * the holder warms the box once and heartbeats it, so subsequent fs ops are
950
- * ~100ms instead of re-resuming the box on every list/write. It folds NO live
951
- * URL (files ride the stateless HTTP plane) it only refcounts liveness.
1141
+ * Whether to acquire a viewer holder to warm the box for a FILE WRITE — the
1142
+ * wake-on-edit INTENT (a first keystroke in the editor), NOT passive browsing.
1143
+ * Shares the SAME viewer attach as the desktop/terminal (one warm box, one
1144
+ * holder) and — like the terminal — needs NO un-redacted acknowledgment:
1145
+ * reading/writing files is the ordinary Channel-A control plane, not the pixel
1146
+ * plane. It folds NO live URL (files ride the stateless HTTP plane) it only
1147
+ * refcounts liveness. Unlike desktop/terminal it warms even a COLD box: an edit
1148
+ * legitimately cold-creates (that IS the wake), so the write lands ~100ms warm
1149
+ * instead of paying the ~5s cold resume. Default false. IMPORTANT: merely
1150
+ * opening/reading the Files tab must NOT set this — browsing capture-served
1151
+ * trees/diffs needs no box, and warming one on a cold glance burns box-hours to
1152
+ * serve reads the capture already answers for free.
952
1153
  */
953
1154
  attachFiles?: boolean | undefined;
954
1155
  /** Hold off negotiating (e.g. the workbench panel is collapsed). Default true. */
@@ -1204,6 +1405,10 @@ type FileTreeNode = {
1204
1405
  children?: FileTreeNode[] | undefined;
1205
1406
  size?: number | null | undefined;
1206
1407
  status?: FileTreeStatus | undefined;
1408
+ /** A residue dir the capture COLLAPSED (node_modules, .git, dist, …): its
1409
+ * contents were never indexed. Cold, expanding it can't list children — the
1410
+ * UI shows an inline "contents on machine" row until the box is warm. */
1411
+ truncated?: boolean | undefined;
1207
1412
  };
1208
1413
  type UseSandboxFilesOptions = ClientOverride & {
1209
1414
  /** Live event log (usually `useSessionEvents().events`) — drives auto-refresh
@@ -1219,6 +1424,12 @@ type UseSandboxFilesOptions = ClientOverride & {
1219
1424
  * (with no `fs.changed` event) never re-lists. Passing liveness re-lists when
1220
1425
  * the box first becomes warm, so the tree populates as soon as the box is up. */
1221
1426
  liveness?: string | undefined;
1427
+ /** The latest turn-end workspace capture (from `useWorkspaceCapture`). When the
1428
+ * box is NOT warm, the tree paints INSTANTLY from this capture's tree index (the
1429
+ * <200ms cold first paint) instead of blocking on a Channel-A list. A warm box
1430
+ * always wins (live path unchanged). On the cold→warm transition the live list
1431
+ * is merged in place — no remount, no flash (dossier §10.4 / §12-A1/D1). */
1432
+ capture?: WorkspaceCaptureManifest | null | undefined;
1222
1433
  /** Called when an OPTIMISTIC mutation is reverted because its background
1223
1434
  * Channel-A op failed (e.g. a 409 rename collision). The host wires this to a
1224
1435
  * toast — the tree silently rolls the node back, the user sees why. */
@@ -1250,6 +1461,11 @@ type UseSandboxFilesResult = {
1250
1461
  }) => Promise<void>;
1251
1462
  /** Re-list the whole tree from the root. */
1252
1463
  refresh: () => Promise<void>;
1464
+ /** Which source the tree is currently served from: the live box, the turn-end
1465
+ * capture (cold/offline), or neither yet. M5's source badge reads this. */
1466
+ source: "live" | "capture" | null;
1467
+ /** When the served capture was taken (ISO), when `source === "capture"`. */
1468
+ capturedAt: string | null;
1253
1469
  loading: boolean;
1254
1470
  error: Error | null;
1255
1471
  };
@@ -1272,6 +1488,12 @@ type UseSandboxGitOptions = ClientOverride & {
1272
1488
  staged?: boolean | undefined;
1273
1489
  /** Hold off the initial fetch. Default true. */
1274
1490
  enabled?: boolean | undefined;
1491
+ /** Lease liveness ("warm" | "draining" | "cold"). When NOT warm, the diff is
1492
+ * served from the capture (cold/offline) instead of a live `gitDiff` RPC. */
1493
+ liveness?: string | undefined;
1494
+ /** The latest turn-end capture (from `useWorkspaceCapture`). Supplies the cold
1495
+ * diff for this repo. A warm box always wins (live `gitDiff` unchanged). */
1496
+ capture?: WorkspaceCaptureManifest | null | undefined;
1275
1497
  };
1276
1498
  type UseSandboxGitResult = {
1277
1499
  /** Working-tree (or staged) diff vs HEAD — the structured hunks the Pierre
@@ -1283,18 +1505,197 @@ type UseSandboxGitResult = {
1283
1505
  ahead: number;
1284
1506
  behind: number;
1285
1507
  refresh: () => Promise<void>;
1508
+ /** Which source the diff is served from: the live box or the turn-end capture. */
1509
+ source: "live" | "capture" | null;
1510
+ /** When the served capture was taken (ISO), when `source === "capture"`. */
1511
+ capturedAt: string | null;
1286
1512
  loading: boolean;
1287
1513
  error: Error | null;
1288
1514
  };
1289
1515
  /**
1290
1516
  * Project the Git service into the Pierre diff data contract: structured
1291
1517
  * `GitFileDiff[]` (per-file hunks with per-line old/new numbers, rename
1292
- * detection, binary flag, add/del counts) plus branch + ahead/behind. The
1293
- * `git diff` runs in-box (API-direct) and the hunks come back inline. Refreshes
1294
- * on `git.changed`.
1518
+ * detection, binary flag, add/del counts) plus branch + ahead/behind. When the
1519
+ * box is warm the `git diff` runs in-box (API-direct); when it is cold/offline the
1520
+ * diff is served from the turn-end capture instead (dossier §10.4). Refreshes on
1521
+ * `git.changed`; reconciles live in place on the cold→warm transition.
1295
1522
  */
1296
1523
  declare function useSandboxGit(sessionId: string | null | undefined, options?: UseSandboxGitOptions): UseSandboxGitResult;
1297
1524
 
1525
+ type UseWorkspaceCaptureOptions = ClientOverride & {
1526
+ /** Live event log (usually `useSessionEvents().events`) — a
1527
+ * `workspace.revision.captured` for a NEWER revision refreshes the manifest. */
1528
+ events?: SessionEvent[] | undefined;
1529
+ /** Hold off the mount fetch (e.g. the workbench panel is collapsed). Default true. */
1530
+ enabled?: boolean | undefined;
1531
+ };
1532
+ type UseWorkspaceCaptureResult = {
1533
+ /** The resolved manifest (tree index + per-repo diffs + file refs), or null when
1534
+ * no capture exists (falls back to the live/wake path — status quo). */
1535
+ capture: WorkspaceCaptureManifest | null;
1536
+ /** The loaded capture's monotonic revision, or null when unavailable. */
1537
+ revision: number | null;
1538
+ /** When the loaded capture was taken (ISO), for the "as of <time>" source badge. */
1539
+ capturedAt: string | null;
1540
+ /** Whether a capture is available at all (the `{available:false}` discriminator). */
1541
+ available: boolean;
1542
+ /** Why the newest durable revision is unavailable. null means no capture has
1543
+ * been attempted yet; a value means capture explicitly failed closed and
1544
+ * consumers must use the live box rather than trust an incomplete snapshot. */
1545
+ degradedReason: WorkspaceCaptureDegradedReason | null;
1546
+ /** The changed-file count from the capture's stats, resolved on the FIRST GET
1547
+ * (from the response's top-level `stats`, before any manifest-URL hop). null
1548
+ * until that first resolve; 0 when no capture exists. This is the pre-paint
1549
+ * "changes exist?" signal the dock uses to pick its default tab with no
1550
+ * embedder events-at-mount contract. */
1551
+ fileCount: number | null;
1552
+ /** A newer revision has been ANNOUNCED than the one currently loaded (a refresh
1553
+ * is in flight or pending). M5's source badge can show a subtle "updating…". */
1554
+ isStale: boolean;
1555
+ loading: boolean;
1556
+ error: Error | null;
1557
+ /** Force a re-fetch of the latest capture. */
1558
+ refresh: () => Promise<void>;
1559
+ };
1560
+ /**
1561
+ * The cold-paint data source: fetch the latest turn-end workspace capture with a
1562
+ * SINGLE api round-trip on mount (no machine, no Channel-A — this is the <200ms
1563
+ * first paint, dossier §10.4/§12-A1). The manifest is served inline in the common
1564
+ * case; a rare >2MB manifest comes back as a short-TTL signed URL we follow.
1565
+ *
1566
+ * Subscribes to the live event log: a `workspace.revision.captured` for a revision
1567
+ * newer than the one loaded triggers a background refresh (stale-while-revalidate).
1568
+ * `{available:false}` is a value, never a crash — consumers fall back to the
1569
+ * live/wake path exactly as before the capture feature existed.
1570
+ */
1571
+ declare function useWorkspaceCapture(sessionId: string | null | undefined, options?: UseWorkspaceCaptureOptions): UseWorkspaceCaptureResult;
1572
+
1573
+ /**
1574
+ * The wake-on-edit state machine (dossier §3 #5 / §10.4 / §12-C). M3 OWNS this
1575
+ * logic; M5 renders it. States are explicit and exhaustive:
1576
+ *
1577
+ * viewing-cold — cold snapshot open, no local edits (editable, cloud).
1578
+ * buffering — local edits buffered; the box is not warm and no warm is
1579
+ * yet in flight (the host has not attached).
1580
+ * warming — edits buffered; the box is actively coming up (the host
1581
+ * attached a viewer in response to `wantsWarm`).
1582
+ * flushing — the box is warm; the guarded write is in flight.
1583
+ * flushed — the buffer was written to the live box.
1584
+ * conflict — the live file diverged from the captured base between
1585
+ * capture and flush; NO write was issued (C2).
1586
+ * readonly-offline — a self-hosted machine that is offline; read-only, no wake.
1587
+ */
1588
+ type WorkspaceEditState = "viewing-cold" | "buffering" | "warming" | "flushing" | "flushed" | "conflict" | "readonly-offline";
1589
+ type WorkspaceEditConflict = {
1590
+ path: string;
1591
+ /** The capture-served content the edit was based on. */
1592
+ base: string;
1593
+ /** The live content found on the box at flush time (what would be overwritten). */
1594
+ live: string;
1595
+ };
1596
+ type UseWorkspaceEditOptions = ClientOverride & {
1597
+ /** The file being edited (workspace-relative). null disables the machine. */
1598
+ path?: string | null | undefined;
1599
+ /** The capture-served content loaded into the editor — the flush base (C2). */
1600
+ baseContent?: string | null | undefined;
1601
+ /** `capabilities.liveness` — "warm" | "draining" | "cold". Drives the flush. */
1602
+ liveness?: string | undefined;
1603
+ /** True while the host is actively warming the box (attach in flight, not warm
1604
+ * yet) — lifts `buffering` → `warming`. The host sets this after acting on
1605
+ * `wantsWarm` (e.g. flipping `attachFiles` on `useSessionCapabilities`). */
1606
+ warming?: boolean | undefined;
1607
+ /** A self-hosted machine that is OFFLINE: read-only, no remote wake possible. */
1608
+ offline?: boolean | undefined;
1609
+ /** Called once when the first cold edit needs the box warmed — the host wires
1610
+ * this to its liveness primitive (flip `attachFiles`/`attachViewer`). */
1611
+ onWarmRequested?: (() => void) | undefined;
1612
+ };
1613
+ type UseWorkspaceEditResult = {
1614
+ state: WorkspaceEditState;
1615
+ /** The editor should be read-only (self-hosted offline). */
1616
+ readOnly: boolean;
1617
+ /** The current buffered content (null = no local edit yet). */
1618
+ buffer: string | null;
1619
+ /** The host should warm the box (flip its attach primitive). Latches true from
1620
+ * the first cold edit until the buffer flushes or is discarded. */
1621
+ wantsWarm: boolean;
1622
+ /** Record an edit from the editor (idempotent per identical content). */
1623
+ edit: (content: string) => void;
1624
+ /** The conflict detail when `state === "conflict"`. */
1625
+ conflict: WorkspaceEditConflict | null;
1626
+ /** Flush the buffer regardless of the base guard (the user chose "overwrite"
1627
+ * from the conflict bar). Writes last-writer-wins. */
1628
+ overwrite: () => Promise<void>;
1629
+ /** Drop the local buffer and return to viewing the snapshot. */
1630
+ discard: () => void;
1631
+ error: Error | null;
1632
+ };
1633
+ /**
1634
+ * Cold-editing without a spinner: the editor opens instantly from the capture,
1635
+ * the first keystroke buffers locally AND signals the host to warm the box, and on
1636
+ * warm the buffer flushes IF the live file still matches the captured base — else a
1637
+ * non-blocking conflict is surfaced and nothing is overwritten (dossier §12-C2).
1638
+ *
1639
+ * The base guard compares the live content at flush time against `baseContent`
1640
+ * (the exact bytes the editor loaded). This is equivalent to the sha256 compare
1641
+ * the dossier describes — M1 leaves `baseHash` null, so the loaded content IS the
1642
+ * authoritative base — and avoids async Web Crypto in the render path.
1643
+ */
1644
+ declare function useWorkspaceEdit(sessionId: string | null | undefined, options?: UseWorkspaceEditOptions): UseWorkspaceEditResult;
1645
+
1646
+ /** The one truthful machine indicator (dossier §3 #10). Honest staleness beats
1647
+ * fake liveness: a cold/asleep box reads "offline — as of <time>", never "live". */
1648
+ type MachineChipState = "live" | "waking" | "offline";
1649
+ type MachineChip = {
1650
+ state: MachineChipState;
1651
+ /** A ready-to-render label ("Live" / "Waking…" / "Offline — as of 3m ago"). */
1652
+ label: string;
1653
+ /** The capture time backing an offline/stale label (ISO), or null. M4 may
1654
+ * reformat this; `label` already embeds a relative form. */
1655
+ asOf: string | null;
1656
+ };
1657
+ type DeriveMachineChipInput = {
1658
+ /** `capabilities.liveness` — "warm" | "draining" | "cold" (or null pre-negotiation). */
1659
+ liveness?: string | null | undefined;
1660
+ /** `useSessionCapabilities().state` — drives the "waking" (negotiating) read. */
1661
+ capabilitiesState?: SessionCapabilitiesState | null | undefined;
1662
+ /** The ACTIVE machine's connection state (from `useMachines`), when known. A
1663
+ * self-hosted machine that is `offline` cannot be remotely woken. */
1664
+ activeMachineState?: MachineState | null | undefined;
1665
+ /** Whether the active sandbox is a user-owned self-hosted machine (no remote wake). */
1666
+ activeIsSelfhosted?: boolean | undefined;
1667
+ /** An interaction (wake-on-edit, terminal focus) is actively warming the box. */
1668
+ wantsWarm?: boolean | undefined;
1669
+ /** The latest capture's `capturedAt` (ISO) — the "as of <time>" backing. */
1670
+ capturedAt?: string | null | undefined;
1671
+ /** Injectable clock for deterministic relative labels (defaults to Date.now). */
1672
+ now?: number | undefined;
1673
+ };
1674
+ /** Compact relative-time for the "as of" label. Pure, no Intl dependency. */
1675
+ declare function formatAsOf(capturedAt: string, now: number): string;
1676
+ /**
1677
+ * Derive the machine-state chip from the live capability/liveness surface, the
1678
+ * active machine's connection state, and the latest capture time. PURE (M4 renders
1679
+ * it; the whole point is a deterministic, testable projection).
1680
+ *
1681
+ * Precedence:
1682
+ * 1. warm/draining lease → **live** (a warm box always wins).
1683
+ * 2. actively warming (negotiating, wake-on-edit, or a reconnecting/enrolling
1684
+ * machine) → **waking**.
1685
+ * 3. everything else (a cold/asleep box, a self-hosted machine that's offline,
1686
+ * an error) → **offline**, labelled "as of <capture time>".
1687
+ */
1688
+ declare function deriveMachineChip(input: DeriveMachineChipInput): MachineChip;
1689
+ type UseMachineChipOptions = DeriveMachineChipInput;
1690
+ /**
1691
+ * Thin memoized wrapper over `deriveMachineChip` for the dock header (M4). The
1692
+ * dock already runs `useSessionCapabilities` + `useMachines` + `useWorkspace
1693
+ * capture`; it feeds their `liveness` / `state` / active-machine state /
1694
+ * `capturedAt` here. Pass a periodically-updated `now` if you want the relative
1695
+ * "as of" label to tick.
1696
+ */
1697
+ declare function useMachineChip(input: UseMachineChipOptions): MachineChip;
1698
+
1298
1699
  type PendingApproval = {
1299
1700
  /** The id to send back via `user.approvalDecision` (`approvalId`). */
1300
1701
  id: string;
@@ -1516,7 +1917,7 @@ type CommandPaletteProps = {
1516
1917
  * the opengeni#46 design tokens. Full keyboard nav lives in useSlashCommands;
1517
1918
  * this component is presentational + aria.
1518
1919
  */
1519
- declare function CommandPalette({ open, items, highlight, onHighlight, onRun, argHintText, listboxId }: CommandPaletteProps): react_jsx_runtime.JSX.Element;
1920
+ declare function CommandPalette({ open, items, highlight, onHighlight, onRun, argHintText, listboxId, }: CommandPaletteProps): react_jsx_runtime.JSX.Element;
1520
1921
 
1521
1922
  type ChatComposerProps = {
1522
1923
  composer: ComposerState;
@@ -1618,6 +2019,31 @@ type MessageTimelineProps = {
1618
2019
  renderMessageText?: ((text: string, item: AgentMessageItem | UserMessageItem) => ReactNode) | undefined;
1619
2020
  /** Drill into a spawned worker session. */
1620
2021
  onOpenSession?: ((sessionId: string) => void) | undefined;
2022
+ /**
2023
+ * Deep-link a memory row (a `memory.saved` / `memory.corrected` step) to its
2024
+ * record in the host's memory pane. Opt-in, exactly like `onReconnect`: the
2025
+ * library draws no "View in memory" affordance without a handler — the memory
2026
+ * row is then non-interactive rich content. This is the switch that makes the
2027
+ * deep-link a first-party OpenGeni capability without other SDK consumers
2028
+ * opting into it. The app supplies it (it owns routing to the memory pane).
2029
+ */
2030
+ onMemoryClick?: ((memoryId: string) => void) | undefined;
2031
+ /**
2032
+ * Start the reconnect flow when a tool needs its connection reauthorized. The
2033
+ * app supplies this (it owns the SDK client + workspace): it typically kicks
2034
+ * off `startConnectionOAuth` and redirects, or routes to credential entry.
2035
+ * Rejecting surfaces a calm inline error on the card; the library never draws
2036
+ * a Reconnect button without a handler to run it.
2037
+ */
2038
+ onReconnect?: ((item: AuthNeededItem) => void | Promise<void>) | undefined;
2039
+ /**
2040
+ * Resolve a provider domain (from a reconnect card) to a logo URL the host
2041
+ * serves itself — the app maps it through its catalog + `catalogAssetUrl`.
2042
+ * Return null/undefined to fall back to a calm monogram. The library never
2043
+ * fetches an off-origin favicon (CSP + privacy); an unresolved logo is a
2044
+ * monogram, not an external image.
2045
+ */
2046
+ resolveProviderLogo?: ((providerDomain: string) => string | null | undefined) | undefined;
1621
2047
  /**
1622
2048
  * The tool-renderer registry that resolves how each tool call is drawn.
1623
2049
  * Defaults to {@link defaultToolRegistry}; pass a registry from
@@ -1641,15 +2067,18 @@ type MessageTimelineProps = {
1641
2067
  * cards, goal markers, and status transitions. Owns stick-to-bottom scrolling
1642
2068
  * with a "jump to latest" affordance when the reader scrolls back.
1643
2069
  */
1644
- declare function MessageTimeline({ events, items, status, renderMessageText, onOpenSession, toolRegistry, autoFollow, hasOlder, loadingOlder, onLoadOlder, emptyState, className, }: MessageTimelineProps): react_jsx_runtime.JSX.Element;
2070
+ declare function MessageTimeline({ events, items, status, renderMessageText, onOpenSession, onMemoryClick, onReconnect, resolveProviderLogo, toolRegistry, autoFollow, hasOlder, loadingOlder, onLoadOlder, emptyState, className, }: MessageTimelineProps): react_jsx_runtime.JSX.Element;
1645
2071
  /**
1646
2072
  * Render one non-activity timeline item (chat message, status divider, goal
1647
2073
  * landmark, notice). Exported so the component demo draws the EXACT same rows as
1648
2074
  * the live app — no forked bubble/goal markup.
1649
2075
  */
1650
- declare function TimelineRow({ item, renderMessageText, }: {
2076
+ declare function TimelineRow({ item, renderMessageText, onReconnect, resolveProviderLogo, onOpenSession, }: {
1651
2077
  item: TimelineItem;
1652
2078
  renderMessageText?: ((text: string, item: AgentMessageItem | UserMessageItem) => ReactNode) | undefined;
2079
+ onReconnect?: ((item: AuthNeededItem) => void | Promise<void>) | undefined;
2080
+ resolveProviderLogo?: ((providerDomain: string) => string | null | undefined) | undefined;
2081
+ onOpenSession?: ((sessionId: string) => void) | undefined;
1653
2082
  }): react_jsx_runtime.JSX.Element | null;
1654
2083
 
1655
2084
  /**
@@ -1717,13 +2146,37 @@ declare function sessionDisplayTitle(session: Session): string;
1717
2146
  */
1718
2147
  declare function FleetTile({ session, title, subtitle, onOpen, className }: FleetTileProps): react_jsx_runtime.JSX.Element;
1719
2148
 
1720
- /** A subset of xterm.js's ITheme the tokens worth themeing from a host app. */
2149
+ type RendererTier = "webgl" | "canvas" | "dom";
2150
+
2151
+ /**
2152
+ * A COMPLETE xterm `ITheme` (subset by intent, but every field xterm colors a
2153
+ * cell with is present so it never falls back to its stock VGA palette). Built
2154
+ * from the og tokens via `xtermThemeFromTokens`.
2155
+ */
1721
2156
  type XtermTheme = {
1722
2157
  background?: string;
1723
2158
  foreground?: string;
1724
2159
  cursor?: string;
1725
2160
  cursorAccent?: string;
1726
2161
  selectionBackground?: string;
2162
+ selectionForeground?: string;
2163
+ selectionInactiveBackground?: string;
2164
+ black?: string;
2165
+ red?: string;
2166
+ green?: string;
2167
+ yellow?: string;
2168
+ blue?: string;
2169
+ magenta?: string;
2170
+ cyan?: string;
2171
+ white?: string;
2172
+ brightBlack?: string;
2173
+ brightRed?: string;
2174
+ brightGreen?: string;
2175
+ brightYellow?: string;
2176
+ brightBlue?: string;
2177
+ brightMagenta?: string;
2178
+ brightCyan?: string;
2179
+ brightWhite?: string;
1727
2180
  };
1728
2181
  type SandboxTerminalProps = {
1729
2182
  /** From `useSandboxTerminal(...)`. */
@@ -1738,9 +2191,21 @@ type SandboxTerminalProps = {
1738
2191
  * (`result.chunks`). Omit to force the legacy firehose-only behavior.
1739
2192
  */
1740
2193
  terminalCapability?: TerminalCapability | null | undefined;
2194
+ /**
2195
+ * Full xterm theme. When omitted the terminal self-derives it from the `--og-*`
2196
+ * tokens of its own container (correct even inside a nested `data-og-theme`
2197
+ * subtree). Passing it lets the host drive re-theme on a theme flip.
2198
+ */
1741
2199
  theme?: XtermTheme | undefined;
1742
2200
  fontFamily?: string | undefined;
1743
2201
  fontSize?: number | undefined;
2202
+ /**
2203
+ * Lease liveness (`cold` | `warming` | `warm` | `draining`). Drives the
2204
+ * boot-in-terminal status lines: once the user has focused the terminal and
2205
+ * the box is not yet warm, a styled "● waking machine — Ns…" line is rendered
2206
+ * INSIDE xterm (no overlay/spinner) until the live PTY connects.
2207
+ */
2208
+ liveness?: string | undefined;
1744
2209
  /**
1745
2210
  * Force read-only even when the PTY accepts stdin. Default: interactive
1746
2211
  * whenever a live pty-ws stream is connected OR `result.write !== null` (the box
@@ -1763,19 +2228,44 @@ type SandboxTerminalProps = {
1763
2228
  onActivate?: (() => void) | undefined;
1764
2229
  className?: string | undefined;
1765
2230
  };
2231
+ /** Debug seam (dev/evidence only, never a typed public API): a global hook the
2232
+ * screenshot harness reads to probe the settled renderer tier + resolved font
2233
+ * without mounting a real WebGL context in unit tests. */
2234
+ type TerminalDebugInfo = {
2235
+ renderer: RendererTier | null;
2236
+ fontFamily: string | undefined;
2237
+ fontSize: number | undefined;
2238
+ hasVarInFont: boolean;
2239
+ theme: XtermTheme | undefined;
2240
+ /** The live xterm instance (opaque) — the evidence harness reads its buffer to
2241
+ * prove screen preservation (E5) and drive the burst-responsiveness probe. */
2242
+ term: unknown;
2243
+ };
2244
+ declare global {
2245
+ var __OG_TERMINAL_DEBUG__: ((info: TerminalDebugInfo) => void) | undefined;
2246
+ var __OG_FORCE_RENDERER_FAIL__: string | undefined;
2247
+ }
1766
2248
  /**
1767
2249
  * An xterm.js terminal fed by the Channel-A event projection
1768
- * (`useSandboxTerminal`). xterm + the fit + web-links addons are lazy-imported
2250
+ * (`useSandboxTerminal`) or a live ttyd PTY. xterm + its addons are lazy-imported
1769
2251
  * inside an effect, so SSR renders the placeholder and the terminal mounts on
1770
- * hydration. Output chunks are written incrementally (tracking a written-cursor
1771
- * by chunk id so a re-render never re-writes). When `result.write` is non-null
1772
- * and not forced read-only, keystrokes pipe back through the PTY.
2252
+ * hydration.
2253
+ *
2254
+ * Renderer: WebGL (GPU-composited cells) with a canvas DOM fallback ladder
2255
+ * (`attachRenderer`), so bursty output stays smooth but a lost/blocklisted
2256
+ * context degrades gracefully. Font + theme are resolved to CONCRETE values
2257
+ * from the og tokens BEFORE construction (xterm measures glyphs in a canvas
2258
+ * where `var()` never resolves, and colors every cell from a full ANSI palette).
2259
+ *
2260
+ * The terminal is mounted ONCE and its data source is swapped in place: the
2261
+ * read-only firehose (`result.chunks`) → the live PTY. Stdin is toggled via
2262
+ * `term.options.disableStdin` at runtime (not a remount), so scrollback and the
2263
+ * visible screen survive the projection→PTY handoff.
1773
2264
  *
1774
2265
  * Resizes are tracked with a `ResizeObserver` on the container (not just
1775
- * `window.resize`) so dragging the dock handle refits the grid instead of
1776
- * leaving the terminal mis-sized.
2266
+ * `window.resize`) so dragging the dock handle refits the grid.
1777
2267
  */
1778
- declare function SandboxTerminal({ result, terminalCapability, theme, fontFamily, fontSize, readOnly, placeholder, showHeader, shell, onActivate, className, }: SandboxTerminalProps): react_jsx_runtime.JSX.Element;
2268
+ declare function SandboxTerminal({ result, terminalCapability, theme, fontFamily, fontSize, liveness, readOnly, placeholder, showHeader, shell, onActivate, className, }: SandboxTerminalProps): react_jsx_runtime.JSX.Element;
1779
2269
 
1780
2270
  type FileBrowserProps = {
1781
2271
  /** From `useSandboxFiles(...)`. */
@@ -1822,35 +2312,42 @@ type FileBrowserProps = {
1822
2312
  */
1823
2313
  declare function FileBrowser({ result, fallback, onSelectFile, selectedPath, renderNode, emptyState, editable, confirmDelete, className, }: FileBrowserProps): react_jsx_runtime.JSX.Element;
1824
2314
 
1825
- /** Theme tokens for the diff line backgrounds. */
2315
+ /**
2316
+ * @deprecated Use {@link PierreDiff} directly. Retained only as a thin,
2317
+ * back-compat alias that renders the Pierre (Shiki) renderer with a plain-text
2318
+ * degrade. The old hand-rolled hunk renderer was removed in Workbench v2 — the
2319
+ * workbench keeps exactly ONE diff renderer. This alias is removed next major.
2320
+ */
1826
2321
  type DiffTheme = {
1827
2322
  addBackground?: string;
1828
2323
  delBackground?: string;
1829
2324
  contextBackground?: string;
1830
2325
  metaForeground?: string;
1831
2326
  };
2327
+ /**
2328
+ * @deprecated Use {@link PierreDiff}. `theme`/`onSelectFile`/`emptyState` from the
2329
+ * removed hand-rolled renderer are accepted for source compatibility and ignored;
2330
+ * `fallback` still overrides the plain-text degrade.
2331
+ */
1832
2332
  type DiffViewProps = {
1833
- /** From `useSandboxGit().diff` — the structured per-file hunks. */
1834
2333
  diff: GitFileDiff[];
1835
- /** Rendered instead of the built-in diff (the Pierre-swap escape hatch). */
1836
2334
  fallback?: ReactNode | undefined;
1837
- /** unified | split. Default "unified". */
1838
2335
  layout?: "unified" | "split" | undefined;
2336
+ themeType?: "dark" | "light" | undefined;
2337
+ /** @deprecated line-background theming was part of the removed renderer. */
1839
2338
  theme?: DiffTheme | undefined;
2339
+ /** @deprecated the alias no longer renders a clickable file header. */
1840
2340
  onSelectFile?: ((path: string) => void) | undefined;
1841
- /** Distinguishes "no changes" from "no repository mounted". */
1842
2341
  isRepo?: boolean | undefined;
1843
2342
  emptyState?: ReactNode | undefined;
1844
2343
  className?: string | undefined;
1845
2344
  };
1846
2345
  /**
1847
- * The diff view, fed by the Git service via `useSandboxGit().diff`. This is our
1848
- * `PierreDiff` boundary: the built-in renderer delivers the same UX (per-file
1849
- * hunks, unified or side-by-side, old/new line numbers, add/del counts), and a
1850
- * consumer with Pierre's `@pierre/diffs` installed can swap it via `fallback`
1851
- * while keeping the same `GitFileDiff[]` data contract from the hook.
2346
+ * @deprecated Use {@link PierreDiff} directly. Thin alias: renders `PierreDiff`
2347
+ * (Shiki-highlighted, unified/split) with a plain-text fallback for a host
2348
+ * without `@pierre/diffs`. Removed next major.
1852
2349
  */
1853
- declare function DiffView({ diff, fallback, layout, theme, onSelectFile, isRepo, emptyState, className, }: DiffViewProps): react_jsx_runtime.JSX.Element;
2350
+ declare function DiffView({ diff, fallback, layout, themeType, isRepo, emptyState, className, }: DiffViewProps): react_jsx_runtime.JSX.Element;
1854
2351
 
1855
2352
  type PierreDiffProps = {
1856
2353
  diff: GitFileDiff[];
@@ -1867,15 +2364,23 @@ type PierreDiffProps = {
1867
2364
  loading?: ReactNode | undefined;
1868
2365
  /** Rendered if `@pierre/diffs/react` is not installed / fails to import. */
1869
2366
  fallback?: ReactNode | undefined;
2367
+ /** Skip the Shiki renderer entirely and show the plain-text degrade (the old
2368
+ * `usePierre={false}` path — one renderer, opted out of highlighting). */
2369
+ plain?: boolean | undefined;
2370
+ /** Long-line handling: `"wrap"` soft-wraps (the default — a diff in a narrow
2371
+ * dock pane should be readable without a horizontal-scroll tax), `"scroll"`
2372
+ * keeps lines on one row behind a horizontal scrollbar (better for a wide
2373
+ * viewport or pathological minified lines). */
2374
+ overflow?: "wrap" | "scroll" | undefined;
1870
2375
  className?: string | undefined;
1871
2376
  };
1872
2377
  /**
1873
2378
  * The Pierre-backed diff: Shiki-highlighted, virtualized, unified/split. Renders
1874
2379
  * one `PatchDiff` per changed file (a reconstructed unified patch from the
1875
- * `GitFileDiff` hunks). This sits behind `DiffView`'s `fallback` seam so a host
1876
- * that lacks `@pierre/diffs` keeps the hand-rolled renderer.
2380
+ * `GitFileDiff` hunks). The ONE workbench diff renderer; a host without
2381
+ * `@pierre/diffs` gets the built-in plain-text degrade (`PlainPatch`).
1877
2382
  */
1878
- declare function PierreDiff({ diff, layout, themeType, theme, disableWorkerPool, loading, fallback, className, }: PierreDiffProps): react_jsx_runtime.JSX.Element;
2383
+ declare function PierreDiff({ diff, layout, themeType, theme, disableWorkerPool, loading, fallback, plain, overflow, className, }: PierreDiffProps): react_jsx_runtime.JSX.Element;
1879
2384
 
1880
2385
  type PierreFileProps = {
1881
2386
  /** Workspace-relative path (used for the header + language inference). */
@@ -1915,6 +2420,10 @@ type CodeEditorProps = {
1915
2420
  initialContents: string;
1916
2421
  /** Persist the current buffer. Resolves when the write lands; rejects to surface an error. */
1917
2422
  onSave: (contents: string) => Promise<unknown>;
2423
+ /** Fired once when the buffer FIRST diverges from its baseline (the first real
2424
+ * keystroke) — the wake-on-edit intent. The host warms the box on this so the
2425
+ * eventual save lands fast; merely opening the file for reading never fires it. */
2426
+ onEditIntent?: (() => void) | undefined;
1918
2427
  /** Read-only mode (e.g. a truncated/too-large file shown for reference only). */
1919
2428
  readOnly?: boolean | undefined;
1920
2429
  themeType?: "dark" | "light" | undefined;
@@ -1936,33 +2445,38 @@ type CodeEditorProps = {
1936
2445
  * `readOnly` suppresses every mutation path so a truncated/binary file can never
1937
2446
  * be saved back (which would corrupt it by writing the truncated prefix).
1938
2447
  */
1939
- declare function CodeEditor({ path, initialContents, onSave, readOnly, themeType, loading, fallback, className, }: CodeEditorProps): react_jsx_runtime.JSX.Element;
2448
+ declare function CodeEditor({ path, initialContents, onSave, onEditIntent, readOnly, themeType, loading, fallback, className, }: CodeEditorProps): react_jsx_runtime.JSX.Element;
1940
2449
 
1941
2450
  type SandboxFilesProps = {
1942
2451
  /** From `useSandboxFiles(...)`. */
1943
2452
  files: UseSandboxFilesResult;
1944
- /** From `useSandboxGit(...)` — the working-tree diff. */
2453
+ /** From `useSandboxGit(...)` — drives the branch/dirty header only. */
1945
2454
  git: UseSandboxGitResult;
1946
- /** From a second `useSandboxGit(..., { staged: true })` the staged diff. */
2455
+ /** @deprecated Diffs live in the dedicated Changes tab now; accepted for
2456
+ * source-compat but unused (the Files surface is a browser + viewer). */
1947
2457
  stagedGit?: UseSandboxGitResult | undefined;
1948
2458
  /** Whether a FileSystem surface is advertised (drives the unavailable notice). */
1949
2459
  fileSystemAvailable?: boolean | undefined;
1950
- /** Use Pierre's Shiki-highlighted diff (default true; falls back to built-in). */
2460
+ /** Use Pierre's Shiki highlighter for the viewer (default true; plain fallback). */
1951
2461
  usePierre?: boolean | undefined;
1952
2462
  /** Allow in-place editing of tree files (CodeMirror). Default true. When false
1953
2463
  * the surface is review-only: every text file opens in the read-only viewer. */
1954
2464
  editable?: boolean | undefined;
2465
+ /** Fired once when the user first edits an open file (wake-on-edit intent). The
2466
+ * dock warms the box on this so the save lands fast; opening/reading never fires
2467
+ * it. Browsing the tree/diff must not warm a box. */
2468
+ onEditIntent?: (() => void) | undefined;
1955
2469
  themeType?: "dark" | "light" | undefined;
1956
2470
  className?: string | undefined;
1957
2471
  };
1958
2472
  /**
1959
- * The review-first Files surface: a sticky branch/dirty header, a "Changes"
1960
- * group (changed files vs HEAD, badged), the full lazy file tree for context,
1961
- * and an inline diff pane below for the selected changed file. The agent
1962
- * commits; the human reviews there is no stage/commit/push UI here (power-git
1963
- * lives in the terminal).
2473
+ * The Files surface: a branch/dirty header, the full lazy file tree, and a
2474
+ * viewer/editor pane for the selected file. This is the workspace BROWSER pick
2475
+ * a file to read or edit it. Diff review lives in the dedicated Changes tab (this
2476
+ * surface deliberately does NOT replicate the changed-files list, and does not
2477
+ * diff here one job per tab). The agent commits; the human reviews.
1964
2478
  */
1965
- declare function SandboxFiles({ files, git, stagedGit, fileSystemAvailable, usePierre, editable, themeType, className, }: SandboxFilesProps): react_jsx_runtime.JSX.Element;
2479
+ declare function SandboxFiles({ files, git, fileSystemAvailable, usePierre, editable, onEditIntent, themeType, className, }: SandboxFilesProps): react_jsx_runtime.JSX.Element;
1966
2480
 
1967
2481
  type DesktopViewerProps = {
1968
2482
  /** The desktop cell of the negotiated capabilities (`capabilities.DesktopStream`). */
@@ -2065,6 +2579,13 @@ type WorkspaceDockProps = {
2065
2579
  /** Controlled collapsed state for hosts that expose their own dock toggle. */
2066
2580
  collapsed?: boolean | undefined;
2067
2581
  onCollapsedChange?: ((collapsed: boolean) => void) | undefined;
2582
+ /** A status accessory pinned to the right of the tab strip, left of the
2583
+ * maximize/collapse controls (e.g. the machine-state chip). Renders in both
2584
+ * the docked header and the full-screen overlay header. */
2585
+ headerAccessory?: ReactNode | undefined;
2586
+ /** Optional host navigation shown at the start of the phone overlay header.
2587
+ * It is intentionally absent from desktop dock chrome. */
2588
+ mobileLeadingControl?: ReactNode | undefined;
2068
2589
  /** Persisted layout id (localStorage key) for react-resizable-panels. */
2069
2590
  autoSaveId?: string | undefined;
2070
2591
  /** Default dock width as a percent of the session area. */
@@ -2073,7 +2594,102 @@ type WorkspaceDockProps = {
2073
2594
  maxSize?: number | undefined;
2074
2595
  className?: string | undefined;
2075
2596
  };
2076
- declare function WorkspaceDock({ primary, tabs, activeTab, onActiveTabChange, collapsed: collapsedProp, onCollapsedChange, autoSaveId, defaultSize, minSize, maxSize, className, }: WorkspaceDockProps): react_jsx_runtime.JSX.Element;
2597
+ declare function WorkspaceDock({ primary, tabs, activeTab, onActiveTabChange, collapsed: collapsedProp, onCollapsedChange, headerAccessory, mobileLeadingControl, autoSaveId, defaultSize, minSize, maxSize, className, }: WorkspaceDockProps): react_jsx_runtime.JSX.Element;
2598
+
2599
+ /** A host-routed notification (replaces the app-only `sonner` toast coupling). */
2600
+ type WorkspaceNotification = {
2601
+ kind: "error" | "info";
2602
+ message: string;
2603
+ };
2604
+ /** The workbench's canonical tab ids (a host injects extras around these). */
2605
+ declare const WORKBENCH_TAB_CHANGES = "changes";
2606
+ declare const WORKBENCH_TAB_FILES = "files";
2607
+ /**
2608
+ * Decide a workspace tab from an already-local event log: the newest
2609
+ * `workspace.revision.captured` announce carries the change surface stats, so
2610
+ * "changes exist → Changes, else Files" needs zero machine round-trips. A host
2611
+ * `override` (e.g. a landing "run" tab) wins when supplied.
2612
+ *
2613
+ * NOTE: the dock no longer uses this for its default tab — `<SandboxWorkspace>`
2614
+ * now derives the default from its OWN capture fetch (`useWorkspaceCapture`'s
2615
+ * `fileCount`), so a pure embedder needs no events-at-mount contract (Refinement
2616
+ * 2). This remains exported as a standalone helper for hosts that already hold
2617
+ * the event log and want the same decision without the capture fetch.
2618
+ */
2619
+ declare function initialWorkspaceTab(events: SessionEvent[] | undefined, override?: string | null): string;
2620
+ type WorkspaceMachine = {
2621
+ /** The derived live/waking/offline chip model (dossier §3 #10). */
2622
+ chip: MachineChip;
2623
+ /** The machine these surfaces are bound to (the Modal group box or a
2624
+ * self-hosted machine), or null while the fleet is still resolving. */
2625
+ activeMachine: MachineView | null;
2626
+ loading: boolean;
2627
+ error: Error | null;
2628
+ refresh: () => Promise<void>;
2629
+ };
2630
+ type UseSandboxWorkspaceTabsOptions = ClientOverride & {
2631
+ sessionId: string;
2632
+ /** Live event log (usually `useSessionEvents().events`). */
2633
+ events: SessionEvent[];
2634
+ /** Override the capture-driven default tab (e.g. a host landing tab id). When
2635
+ * omitted the workbench picks Changes-vs-Files from its own capture fetch. */
2636
+ initialTab?: string | null | undefined;
2637
+ /** Host-routed notifications (mutation errors, desktop-consent failures). The
2638
+ * package never imports a toast library — the host decides how to surface. */
2639
+ onNotify?: ((notification: WorkspaceNotification) => void) | undefined;
2640
+ };
2641
+ type UseSandboxWorkspaceTabsResult = {
2642
+ /** Changes | Files | Terminal | Desktop (capability-gated where noted). */
2643
+ tabs: WorkspaceTab[];
2644
+ /** The capture-driven default tab: Changes when the session has changes, else
2645
+ * Files (a host `initialTab` overrides). null during the brief window before the
2646
+ * capture GET first resolves (and no host override was given) — consumers render
2647
+ * their dock's own first-tab fallback until it latches, which it does ONCE, so it
2648
+ * never causes a post-render switch. */
2649
+ defaultTab: string | null;
2650
+ /** The machine-state model for the dock-header chip. */
2651
+ machine: WorkspaceMachine;
2652
+ };
2653
+ /**
2654
+ * Build the workbench tabs + the machine-chip model for one session. This is the
2655
+ * dock "brain": capability negotiation, capture-backed cold reads, prewarm
2656
+ * flags, desktop consent, and the xterm theme observer — all package-local.
2657
+ */
2658
+ declare function useSandboxWorkspaceTabs(options: UseSandboxWorkspaceTabsOptions): UseSandboxWorkspaceTabsResult;
2659
+ type SandboxWorkspaceProps = ClientOverride & {
2660
+ sessionId: string;
2661
+ /** Live event log (usually `useSessionEvents().events`). */
2662
+ events: SessionEvent[];
2663
+ /** The chat / primary pane shown beside the dock. */
2664
+ primary: ReactNode;
2665
+ /** Host tabs injected BEFORE the workbench tabs (e.g. a "Run" landing tab). */
2666
+ leadingTabs?: WorkspaceTab[] | undefined;
2667
+ /** Host tabs injected AFTER the workbench tabs (e.g. a "Debug" tab). */
2668
+ trailingTabs?: WorkspaceTab[] | undefined;
2669
+ /** Override the pre-paint default tab (e.g. a host landing tab id). When
2670
+ * omitted the workbench decides Changes-vs-Files from local capture stats. */
2671
+ initialTab?: string | undefined;
2672
+ /** Host-routed notifications (no toast dependency in the package). */
2673
+ onNotify?: ((notification: WorkspaceNotification) => void) | undefined;
2674
+ /** Controlled collapsed state for hosts with their own dock toggle. */
2675
+ collapsed?: boolean | undefined;
2676
+ onCollapsedChange?: ((collapsed: boolean) => void) | undefined;
2677
+ /** Host navigation shown only in the phone workspace overlay header. */
2678
+ mobileLeadingControl?: ReactNode | undefined;
2679
+ autoSaveId?: string | undefined;
2680
+ defaultSize?: number | undefined;
2681
+ minSize?: number | undefined;
2682
+ maxSize?: number | undefined;
2683
+ className?: string | undefined;
2684
+ };
2685
+ /**
2686
+ * The whole session workspace, ready to mount: `<SandboxWorkspace>` assembles the
2687
+ * capability-gated tabs, pins the machine-state chip in the dock header, and
2688
+ * renders the resizable `<WorkspaceDock>`. Wrap the tree in `<OpenGeniProvider>`
2689
+ * (client + workspaceId) and import `@opengeni/react/styles.css`; that is the
2690
+ * entire integration (see `docs/embedding-workbench.md`).
2691
+ */
2692
+ declare function SandboxWorkspace(props: SandboxWorkspaceProps): ReactNode;
2077
2693
 
2078
2694
  /** Events that change which Codex account a session runs on (or just ran). */
2079
2695
  declare function isCodexAccountEvent(event: Pick<SessionEvent, "type">): boolean;
@@ -2151,12 +2767,14 @@ declare function useCodexAccounts(options?: UseCodexAccountsOptions): UseCodexAc
2151
2767
  declare function gitFileDiffToPatch(file: GitFileDiff): string;
2152
2768
 
2153
2769
  /**
2154
- * Derive an xterm `ITheme` subset from the live OKLCH `--og-*` token system.
2155
- * Reads the COMPUTED values so xterm which
2156
- * paints into a canvas and can't consume CSS vars gets concrete colors. Call
2157
- * on mount and re-derive on a `data-og-theme` flip.
2770
+ * Derive a COMPLETE xterm `ITheme` from the live `--og-*` token system on the
2771
+ * DOM. Reads the COMPUTED values so xterm gets concrete colors, detects the
2772
+ * active theme mode, and fills every ANSI slot. Call on mount + re-derive on a
2773
+ * `data-og-theme` flip. SSR-safe: returns undefined off the DOM.
2158
2774
  *
2159
- * SSR-safe: returns undefined off the DOM (the caller keeps xterm's defaults).
2775
+ * `root` should be an element INSIDE the themed subtree (e.g. the terminal
2776
+ * container) so nested `[data-og-theme]` themes resolve correctly; when omitted
2777
+ * it falls back to the nearest `[data-og-theme]` element, then documentElement.
2160
2778
  */
2161
2779
  declare function xtermThemeFromTokens(root?: HTMLElement | null): XtermTheme | undefined;
2162
2780
 
@@ -2205,4 +2823,4 @@ declare function isCreditExhaustion(input: {
2205
2823
  */
2206
2824
  declare function humanizeFailureReason(reason: string | null): string | null;
2207
2825
 
2208
- export { ActivityDisclosure, type ActivityDisclosureProps, type ActivityItem, ActivityRail, type ActivityRailProps, type AgentMessageItem, type ApplyPatchOperation, BodyNote, CREDIT_EXHAUSTION_MESSAGE, ChatComposer, type ChatComposerProps, ClientOverride, CodeEditor, type CodeEditorProps, type CodexAccountsClientLike, type CommandContext, CommandPalette, type CommandPaletteProps, type CommandResult, type ComposerMode, type ComposerSendExtras, type ComposerState, type ConfirmState, type CreateToolRegistryOptions, DesktopViewer, type DesktopViewerProps, type DesktopWebSocketFactory, type DesktopWebSocketLike, type DiffTheme, DiffView, type DiffViewProps, type DisclosureChip, DisclosureDefaultsProvider, FILE_ONLY_MESSAGE_TEXT, type FileAttachment, FileBrowser, type FileBrowserProps, type FileTreeNode, type FileTreeStatus, FleetTile, type FleetTileProps, type GoalItem, LightboxProvider, Markdown, type MarkdownProps, MediaEmpty, MediaSkeleton, MessageTimeline, type MessageTimelineProps, ModelPicker, type ModelPickerProps, type Notice, type NoticeItem, type ParsedCommandLine, PayloadBlock, type PendingApproval, PierreDiff, type PierreDiffProps, PierreFile, type PierreFileProps, type ReasoningItem, SESSION_STATUS_META, SandboxFiles, type SandboxFilesProps, type SandboxItem, SandboxTerminal, type SandboxTerminalProps, ScreenshotFigure, type SessionCapabilitiesState, SessionClientLike, type SessionEventsConnectionState, SessionStatus, type SessionStatusItem, type SessionStatusMeta, type SessionStatusProps, type SlashArg, type SlashCommand, type SlashCommandContext, type SlashCommandHandlers, StatusDot, type StatusDotProps, TermBlock, type TerminalChunk, type TerminalStreamStatus, Thumbnail, type TimelineGroup, type TimelineItem, TimelineRow, type ToolCallItem, type ToolRegistry, type ToolRegistryEntry, type ToolRenderer, type ToolRendererProps, type TurnEndItem, type TurnOutcome, TurnSummary, type TurnSummaryProps, type UseAvailableModelsOptions, type UseAvailableModelsResult, type UseBillingUsageOptions, type UseBillingUsageResult, type UseCodexAccountsOptions, type UseCodexAccountsResult, type UseComposerOptions, type UseDesktopStreamOptions, type UseDesktopStreamResult, type UseEnvironmentsOptions, type UseEnvironmentsResult, type UseFileAttachmentsOptions, type UseFileAttachmentsResult, type UseGoalOptions, type UseGoalResult, type UsePacksOptions, type UsePacksResult, type UseRelayFrameStreamOptions, type UseRelayFrameStreamResult, type UseSandboxFilesOptions, type UseSandboxFilesResult, type UseSandboxGitOptions, type UseSandboxGitResult, type UseSandboxTerminalOptions, type UseSandboxTerminalResult, type UseScheduledTasksOptions, type UseScheduledTasksResult, type UseSessionCapabilitiesOptions, type UseSessionCapabilitiesResult, type UseSessionControlOptions, type UseSessionControlResult, type UseSessionEventsOptions, type UseSessionEventsResult, type UseSessionOptions, type UseSessionResult, type UseSlashCommandsOptions, type UseSlashCommandsResult, type UseTerminalStreamOptions, type UseTerminalStreamResult, type UseTurnQueueOptions, type UseTurnQueueResult, type UseWorkspaceSessionsOptions, type UseWorkspaceSessionsResult, type UseWorkspacesOptions, type UseWorkspacesResult, type UserMessageItem, type WorkerItem, WorkspaceDock, type WorkspaceDockProps, type WorkspaceTab, type XtermTheme, activeTurnFromTurns, applyPatchOps, applyTurnEdit, applyTurnRemoval, applyTurnReorder, approvalsFromRequiresAction, argHint, buildTimeline, cn, composeSendInput, controlCaret, createDefaultToolRegistry, createToolRegistry, creditExhaustedFromEvents, defaultCommands, defaultToolRegistry, execTruncated, extractSessionRef, filterCommands, firstMissingRequiredArg, formatBytes, formatRelativeTime, gitFileDiffToPatch, groupTimeline, hasPermission, humanizeFailureReason, isApplyPatch, isCodexAccountEvent, isCreditExhaustion, isExecSessionLostBanner, isGoalEvent, isTitleEvent, isTurnQueueEvent, languageForPath, looksBinary, matchCommand, parseCommandLine, parseExecBannerSessionId, parseToolArgs, projectPendingApprovals, queueFromTurns, rawTypeOf, redactSecrets, sandboxCommandExitCode, sessionDisplayTitle, sessionStatusFromEvents, shouldSubmitOnKey, stringifyPayload, stripExecBanner, tailPeek, toolDisplayName, truncate, tryParseJson, unwrapMcpOutput, useAvailableModels, useBillingUsage, useCodexAccounts, useComposer, useDesktopStream, useEnvironments, useFileAttachments, useGoal, useLightbox, useLightboxOptional, usePacks, useRelayFrameStream, useSandboxFiles, useSandboxGit, useSandboxTerminal, useScheduledTasks, useSession, useSessionCapabilities, useSessionControl, useSessionEvents, useSlashCommands, useTerminalStream, useTurnQueue, useWorkspaceSessions, useWorkspaces, v4aToGitFileDiff, xtermThemeFromTokens };
2826
+ export { ActivityDisclosure, type ActivityDisclosureProps, type ActivityItem, ActivityRail, type ActivityRailProps, type AgentMessageItem, type ApplyPatchOperation, type AuthNeededItem, BodyNote, CREDIT_EXHAUSTION_MESSAGE, ChatComposer, type ChatComposerProps, ClientOverride, CodeEditor, type CodeEditorProps, type CodexAccountsClientLike, type CommandContext, CommandPalette, type CommandPaletteProps, type CommandResult, type ComposerMode, type ComposerSendExtras, type ComposerState, type ConfirmState, type CreateToolRegistryOptions, type DeriveMachineChipInput, DesktopViewer, type DesktopViewerProps, type DesktopWebSocketFactory, type DesktopWebSocketLike, type DiffTheme, DiffView, type DiffViewProps, type DisclosureChip, DisclosureDefaultsProvider, FILE_ONLY_MESSAGE_TEXT, type FileAttachment, FileBrowser, type FileBrowserProps, type FileTreeNode, type FileTreeStatus, FleetTile, type FleetTileProps, type GoalItem, LightboxProvider, type MachineChip, type MachineChipState, Markdown, type MarkdownProps, MediaEmpty, MediaSkeleton, MessageTimeline, type MessageTimelineProps, ModelPicker, type ModelPickerProps, type Notice, type NoticeItem, type ParsedCommandLine, PayloadBlock, type PendingApproval, PierreDiff, type PierreDiffProps, PierreFile, type PierreFileProps, type ReasoningItem, SESSION_STATUS_META, SandboxFiles, type SandboxFilesProps, type SandboxItem, SandboxTerminal, type SandboxTerminalProps, SandboxWorkspace, type SandboxWorkspaceProps, ScreenshotFigure, type SessionCapabilitiesState, SessionClientLike, type SessionEventsConnectionState, SessionStatus, type SessionStatusItem, type SessionStatusMeta, type SessionStatusProps, type SlashArg, type SlashCommand, type SlashCommandContext, type SlashCommandHandlers, StatusDot, type StatusDotProps, TermBlock, type TerminalChunk, type TerminalStreamStatus, Thumbnail, type TimelineGroup, type TimelineItem, TimelineRow, type ToolCallItem, type ToolRegistry, type ToolRegistryEntry, type ToolRenderer, type ToolRendererProps, type TurnEndItem, type TurnOutcome, TurnSummary, type TurnSummaryProps, type UseAvailableModelsOptions, type UseAvailableModelsResult, type UseBillingUsageOptions, type UseBillingUsageResult, type UseCodexAccountsOptions, type UseCodexAccountsResult, type UseComposerOptions, type UseDesktopStreamOptions, type UseDesktopStreamResult, type UseEnvironmentsOptions, type UseEnvironmentsResult, type UseFileAttachmentsOptions, type UseFileAttachmentsResult, type UseGoalOptions, type UseGoalResult, type UseMachineChipOptions, type UsePacksOptions, type UsePacksResult, type UseRelayFrameStreamOptions, type UseRelayFrameStreamResult, type UseRigChangesOptions, type UseRigChangesResult, type UseRigOptions, type UseRigResult, type UseRigVersionsOptions, type UseRigVersionsResult, type UseRigsOptions, type UseRigsResult, type UseSandboxFilesOptions, type UseSandboxFilesResult, type UseSandboxGitOptions, type UseSandboxGitResult, type UseSandboxTerminalOptions, type UseSandboxTerminalResult, type UseSandboxWorkspaceTabsOptions, type UseSandboxWorkspaceTabsResult, type UseScheduledTasksOptions, type UseScheduledTasksResult, type UseSessionCapabilitiesOptions, type UseSessionCapabilitiesResult, type UseSessionControlOptions, type UseSessionControlResult, type UseSessionEventsOptions, type UseSessionEventsResult, type UseSessionLineageOptions, type UseSessionLineageResult, type UseSessionOptions, type UseSessionResult, type UseSlashCommandsOptions, type UseSlashCommandsResult, type UseTerminalStreamOptions, type UseTerminalStreamResult, type UseTurnQueueOptions, type UseTurnQueueResult, type UseVariableSetsOptions, type UseVariableSetsResult, type UseWorkspaceCaptureOptions, type UseWorkspaceCaptureResult, type UseWorkspaceEditOptions, type UseWorkspaceEditResult, type UseWorkspaceSessionsOptions, type UseWorkspaceSessionsResult, type UseWorkspacesOptions, type UseWorkspacesResult, type UserMessageItem, WORKBENCH_TAB_CHANGES, WORKBENCH_TAB_FILES, type WorkerItem, WorkspaceDock, type WorkspaceDockProps, type WorkspaceEditConflict, type WorkspaceEditState, type WorkspaceMachine, type WorkspaceNotification, type WorkspaceTab, type XtermTheme, applyPatchOps, approvalsFromRequiresAction, argHint, buildTimeline, cn, composeSendInput, controlCaret, createDefaultToolRegistry, createToolRegistry, creditExhaustedFromEvents, defaultCommands, defaultToolRegistry, deriveMachineChip, execTruncated, extractSessionRef, filterCommands, firstMissingRequiredArg, formatAsOf, formatBytes, formatRelativeTime, gitFileDiffToPatch, groupTimeline, hasPermission, humanizeFailureReason, initialWorkspaceTab, isApplyPatch, isCodexAccountEvent, isCreditExhaustion, isExecSessionLostBanner, isGoalEvent, isLineageRefreshEvent, isTitleEvent, isTurnQueueEvent, languageForPath, looksBinary, matchCommand, parseCommandLine, parseExecBannerSessionId, parseToolArgs, projectPendingApprovals, rawTypeOf, redactSecrets, sandboxCommandExitCode, sessionDisplayTitle, sessionStatusFromEvents, shouldSubmitOnKey, stringifyPayload, stripExecBanner, tailPeek, toolDisplayName, truncate, tryParseJson, unwrapMcpOutput, useAvailableModels, useBillingUsage, useCodexAccounts, useComposer, useDesktopStream, useEnvironments, useFileAttachments, useGoal, useLightbox, useLightboxOptional, useMachineChip, usePacks, useRelayFrameStream, useRig, useRigChanges, useRigVersions, useRigs, useSandboxFiles, useSandboxGit, useSandboxTerminal, useSandboxWorkspaceTabs, useScheduledTasks, useSession, useSessionCapabilities, useSessionControl, useSessionEvents, useSessionLineage, useSlashCommands, useTerminalStream, useTurnQueue, useVariableSets, useWorkspaceCapture, useWorkspaceEdit, useWorkspaceSessions, useWorkspaces, v4aToGitFileDiff, xtermThemeFromTokens };