@opengeni/react 0.28.2 → 0.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/dist/approvals.d.ts +14 -0
  2. package/dist/{chunk-M7X4JZOD.js → chunk-4QOQ2DSR.js} +8 -1
  3. package/dist/chunk-4QOQ2DSR.js.map +1 -0
  4. package/dist/{chunk-HQFPO7VX.js → chunk-7CJOAW3V.js} +24 -3
  5. package/dist/{chunk-HQFPO7VX.js.map → chunk-7CJOAW3V.js.map} +1 -1
  6. package/dist/{chunk-PMSGE233.js → chunk-A2WITZTI.js} +377 -113
  7. package/dist/chunk-A2WITZTI.js.map +1 -0
  8. package/dist/{chunk-BC6RKIHS.js → chunk-GZ4KR67U.js} +11 -11
  9. package/dist/{chunk-4F2YLLHP.js → chunk-KZRUYCL4.js} +14 -17
  10. package/dist/chunk-KZRUYCL4.js.map +1 -0
  11. package/dist/{chunk-OCHBZ2X7.js → chunk-TCCE5ZU5.js} +192 -28
  12. package/dist/chunk-TCCE5ZU5.js.map +1 -0
  13. package/dist/chunk-U255M5EZ.js +178 -0
  14. package/dist/chunk-U255M5EZ.js.map +1 -0
  15. package/dist/{chunk-XVVQP7A4.js → chunk-WY2QN2CX.js} +2539 -2174
  16. package/dist/chunk-WY2QN2CX.js.map +1 -0
  17. package/dist/chunk-ZNNE2VES.js +6413 -0
  18. package/dist/chunk-ZNNE2VES.js.map +1 -0
  19. package/dist/client.d.ts +33 -0
  20. package/dist/commands/index.d.ts +3 -0
  21. package/dist/commands/registry.d.ts +41 -0
  22. package/dist/commands/types.d.ts +85 -0
  23. package/dist/components/approval-surface.d.ts +28 -0
  24. package/dist/components/chat-composer.d.ts +51 -0
  25. package/dist/components/code-editor.d.ts +43 -0
  26. package/dist/components/command-palette.d.ts +25 -0
  27. package/dist/components/composer-transcription-control.d.ts +36 -0
  28. package/dist/components/composer.d.ts +277 -0
  29. package/dist/components/copy-button.d.ts +26 -0
  30. package/dist/components/desktop-viewer.d.ts +85 -0
  31. package/dist/components/diff-view.d.ts +38 -0
  32. package/dist/components/enrollment-consent.d.ts +33 -0
  33. package/dist/components/enrollment-device-flow.d.ts +27 -0
  34. package/dist/components/file-browser.d.ts +47 -0
  35. package/dist/components/fleet-tile.d.ts +18 -0
  36. package/dist/components/human-input-form.d.ts +47 -0
  37. package/dist/components/machine-card.d.ts +21 -0
  38. package/dist/components/machine-dock-bar.d.ts +31 -0
  39. package/dist/components/machine-health-pill.d.ts +9 -0
  40. package/dist/components/machine-metrics.d.ts +15 -0
  41. package/dist/components/machine-status-pill.d.ts +54 -0
  42. package/dist/components/machines/health.d.ts +25 -0
  43. package/dist/components/machines/machine-detail.d.ts +14 -0
  44. package/dist/components/machines/metric-history-chart.d.ts +24 -0
  45. package/dist/components/machines/metric-sparkline.d.ts +9 -0
  46. package/dist/components/machines/series.d.ts +24 -0
  47. package/dist/components/machines-dashboard.d.ts +30 -0
  48. package/dist/components/markdown.d.ts +31 -0
  49. package/dist/components/message-timeline.d.ts +98 -0
  50. package/dist/components/model-picker.d.ts +19 -0
  51. package/dist/components/pierre-diff.d.ts +34 -0
  52. package/dist/components/pierre-file.d.ts +27 -0
  53. package/dist/components/queue-draft-policy.d.ts +7 -0
  54. package/dist/components/queue-surface-implementation.d.ts +20 -0
  55. package/dist/components/queue-surface-state.d.ts +12 -0
  56. package/dist/components/queue-surface.d.ts +12 -0
  57. package/dist/components/sandbox-files.d.ts +49 -0
  58. package/dist/components/sandbox-terminal.d.ts +123 -0
  59. package/dist/components/sandbox-workspace.d.ts +128 -0
  60. package/dist/components/session-chrome.d.ts +70 -0
  61. package/dist/components/session-status.d.ts +25 -0
  62. package/dist/components/soften-streaming-markdown.d.ts +13 -0
  63. package/dist/components/stream-reveal.d.ts +37 -0
  64. package/dist/components/tip-follow.d.ts +139 -0
  65. package/dist/components/tooltip.d.ts +16 -0
  66. package/dist/components/workbench-changes.d.ts +34 -0
  67. package/dist/components/workspace-dock.d.ts +35 -0
  68. package/dist/composer.d.ts +11 -7
  69. package/dist/composer.js +9 -6
  70. package/dist/hooks/internal.d.ts +46 -0
  71. package/dist/hooks/use-available-models.d.ts +37 -0
  72. package/dist/hooks/use-billing-usage.d.ts +26 -0
  73. package/dist/hooks/use-codex-accounts.d.ts +69 -0
  74. package/dist/{use-composer-ClHy1rkL.d.ts → hooks/use-composer.d.ts} +16 -24
  75. package/dist/hooks/use-desktop-stream.d.ts +43 -0
  76. package/dist/hooks/use-environments.d.ts +35 -0
  77. package/dist/{use-file-attachments-BmT8WtqO.d.ts → hooks/use-file-attachments.d.ts} +6 -9
  78. package/dist/hooks/use-goal.d.ts +46 -0
  79. package/dist/hooks/use-human-input.d.ts +26 -0
  80. package/dist/hooks/use-last-started-turn-policy.d.ts +27 -0
  81. package/dist/hooks/use-machine-chip.d.ts +54 -0
  82. package/dist/hooks/use-machines.d.ts +81 -0
  83. package/dist/hooks/use-packs.d.ts +27 -0
  84. package/dist/hooks/use-relay-frame-stream.d.ts +53 -0
  85. package/dist/hooks/use-rigs.d.ts +87 -0
  86. package/dist/hooks/use-sandbox-files.d.ts +108 -0
  87. package/dist/hooks/use-sandbox-git.d.ts +58 -0
  88. package/dist/hooks/use-sandbox-terminal.d.ts +62 -0
  89. package/dist/hooks/use-scheduled-tasks.d.ts +15 -0
  90. package/dist/hooks/use-session-capabilities.d.ts +83 -0
  91. package/dist/hooks/use-session-control.d.ts +22 -0
  92. package/dist/hooks/use-session-events.d.ts +92 -0
  93. package/dist/hooks/use-session-lineage.d.ts +17 -0
  94. package/dist/hooks/use-session-mcp-approval-policy.d.ts +23 -0
  95. package/dist/hooks/use-session.d.ts +23 -0
  96. package/dist/hooks/use-slash-commands.d.ts +66 -0
  97. package/dist/hooks/use-terminal-stream.d.ts +46 -0
  98. package/dist/hooks/use-transcription.d.ts +73 -0
  99. package/dist/hooks/use-turn-queue.d.ts +44 -0
  100. package/dist/hooks/use-voice-input.d.ts +25 -0
  101. package/dist/hooks/use-windowed-sections.d.ts +42 -0
  102. package/dist/hooks/use-workspace-capture.d.ts +49 -0
  103. package/dist/hooks/use-workspace-edit.d.ts +73 -0
  104. package/dist/hooks/use-workspace-sessions.d.ts +30 -0
  105. package/dist/hooks/use-workspaces.d.ts +22 -0
  106. package/dist/human-input.d.ts +18 -0
  107. package/dist/index.d.ts +144 -2119
  108. package/dist/index.js +421 -324
  109. package/dist/index.js.map +1 -1
  110. package/dist/lib/clipboard.d.ts +7 -0
  111. package/dist/lib/cn.d.ts +3 -0
  112. package/dist/lib/format.d.ts +48 -0
  113. package/dist/lib/git-patch.d.ts +8 -0
  114. package/dist/lib/motion-inspect.d.ts +5 -0
  115. package/dist/lib/motion.d.ts +14 -0
  116. package/dist/lib/noto-sans-arabic-loader.d.ts +1 -0
  117. package/dist/lib/noto-sans-jp-loader.generated.d.ts +1 -0
  118. package/dist/lib/relay-wire.d.ts +30 -0
  119. package/dist/lib/use-portal-token-style.d.ts +9 -0
  120. package/dist/lib/use-theme-type.d.ts +5 -0
  121. package/dist/lib/use-unicode-fonts.d.ts +12 -0
  122. package/dist/lib/xterm-renderer.d.ts +19 -0
  123. package/dist/lib/xterm-theme.d.ts +75 -0
  124. package/dist/machines.d.ts +30 -413
  125. package/dist/machines.js +3 -3
  126. package/dist/model-policy.d.ts +32 -0
  127. package/dist/model-policy.js +33 -0
  128. package/dist/model-policy.js.map +1 -0
  129. package/dist/provider.d.ts +16 -0
  130. package/dist/{queue-surface-implementation-UQ535OKQ.js → queue-surface-implementation-THPAKGMD.js} +2 -2
  131. package/dist/{queue-surface-implementation-UQ535OKQ.js.map → queue-surface-implementation-THPAKGMD.js.map} +1 -1
  132. package/dist/session-context.d.ts +82 -0
  133. package/dist/session-ui.d.ts +10 -7
  134. package/dist/session-ui.js +9 -5
  135. package/dist/session.d.ts +28 -6
  136. package/dist/session.js +11 -11
  137. package/dist/timeline/activity-rail.d.ts +19 -0
  138. package/dist/timeline/disclosure-context.d.ts +14 -0
  139. package/dist/timeline/entrance.d.ts +14 -0
  140. package/dist/timeline/fleet-decision-projection.d.ts +9 -0
  141. package/dist/timeline/fleet-decision-row.d.ts +11 -0
  142. package/dist/timeline/fold-memory.d.ts +15 -0
  143. package/dist/timeline/index.d.ts +18 -0
  144. package/dist/timeline/parsers.d.ts +96 -0
  145. package/dist/timeline/projection.d.ts +38 -0
  146. package/dist/timeline/registry.d.ts +40 -0
  147. package/dist/timeline/screenshot-lightbox.d.ts +26 -0
  148. package/dist/timeline/seen-activity-ids.d.ts +2 -0
  149. package/dist/timeline/shared.d.ts +125 -0
  150. package/dist/timeline/tool-diff.d.ts +8 -0
  151. package/dist/timeline/tool-display-name.d.ts +10 -0
  152. package/dist/timeline/tool-renderers.d.ts +5 -0
  153. package/dist/timeline/turn-summary.d.ts +116 -0
  154. package/dist/{use-turn-queue-Drm_ypue.d.ts → timeline/types.d.ts} +57 -67
  155. package/dist/types/machines.d.ts +11 -0
  156. package/package.json +8 -4
  157. package/src/client.ts +1 -0
  158. package/src/components/composer-transcription-control.tsx +278 -130
  159. package/src/components/composer.tsx +20 -15
  160. package/src/components/copy-button.tsx +127 -0
  161. package/src/components/markdown.tsx +231 -32
  162. package/src/components/message-timeline.tsx +1382 -378
  163. package/src/components/model-picker.tsx +83 -43
  164. package/src/components/queue-surface-implementation.tsx +1 -1
  165. package/src/components/session-chrome.tsx +942 -0
  166. package/src/components/soften-streaming-markdown.ts +205 -0
  167. package/src/components/stream-reveal.ts +195 -0
  168. package/src/components/tip-follow.ts +459 -0
  169. package/src/components/tooltip.tsx +103 -0
  170. package/src/composer.ts +6 -0
  171. package/src/hooks/internal.ts +30 -4
  172. package/src/hooks/use-available-models.ts +51 -4
  173. package/src/hooks/use-composer.ts +24 -18
  174. package/src/hooks/use-last-started-turn-policy.ts +95 -0
  175. package/src/hooks/use-session-events.ts +359 -5
  176. package/src/hooks/use-voice-input.ts +232 -0
  177. package/src/index.ts +49 -1
  178. package/src/lib/clipboard.ts +58 -0
  179. package/src/lib/format.ts +18 -0
  180. package/src/lib/motion-inspect.ts +5 -0
  181. package/src/lib/motion.ts +80 -0
  182. package/src/model-policy.ts +210 -0
  183. package/src/session-ui.ts +7 -0
  184. package/src/session.ts +2 -0
  185. package/src/timeline/activity-rail.tsx +46 -7
  186. package/src/timeline/entrance.tsx +10 -0
  187. package/src/timeline/fold-memory.ts +52 -0
  188. package/src/timeline/index.ts +11 -1
  189. package/src/timeline/projection.ts +252 -47
  190. package/src/timeline/seen-activity-ids.ts +19 -0
  191. package/src/timeline/shared.tsx +1 -1
  192. package/src/timeline/tool-renderers.tsx +75 -6
  193. package/src/timeline/turn-summary.tsx +387 -97
  194. package/src/timeline/types.ts +47 -0
  195. package/styles/index.css +99 -7
  196. package/styles/tokens.css +44 -3
  197. package/dist/chunk-4F2YLLHP.js.map +0 -1
  198. package/dist/chunk-M7X4JZOD.js.map +0 -1
  199. package/dist/chunk-OCHBZ2X7.js.map +0 -1
  200. package/dist/chunk-PMSGE233.js.map +0 -1
  201. package/dist/chunk-WAA247AB.js +0 -3858
  202. package/dist/chunk-WAA247AB.js.map +0 -1
  203. package/dist/chunk-XVVQP7A4.js.map +0 -1
  204. package/dist/composer-BMzimGTO.d.ts +0 -528
  205. package/dist/session-C3tIXLim.d.ts +0 -264
  206. package/dist/session-context-CAjlaeZb.d.ts +0 -84
  207. package/dist/session-ui-B_7cfN5u.d.ts +0 -259
  208. /package/dist/{chunk-BC6RKIHS.js.map → chunk-GZ4KR67U.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,2119 +1,144 @@
1
- import { S as SessionClientLike, C as ClientOverride } from './session-context-CAjlaeZb.js';
2
- export { b as EmbeddedFileAttachmentClientLike, c as EmbeddedGoalClientLike, d as EmbeddedHumanInputSessionClientLike, e as EmbeddedSessionClientLike, f as EmbeddedSessionEventClientLike, g as EmbeddedSessionLineageClientLike, h as EmbeddedSessionMcpApprovalPolicyClientLike, i as EmbeddedSessionReadClientLike, O as OpenGeniContextValue, u as useOpenGeni, j as useOpenGeniClient } from './session-context-CAjlaeZb.js';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import { WorkspaceControlEvent, EffectiveSessionControl, ClientModel, ScheduledTask, Session, VariableSet, CreateVariableSetRequest, UpdateVariableSetRequest, VariableSetVariableMetadata, RigChange, Rig, UpdateRigRequest, RigVersion, ProposeRigChangeRequest, CreateRigRequest, CapabilityPack, PackInstallation, RegisterCapabilityPackRequest, WorkspaceRegisteredPack, EnablePackRequest, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, BillingBalance, UsageEvent, SessionEvent, SessionCapabilities, DesktopStreamCapability, DesktopConnectionState, DesktopRfbFactory, TerminalCapability, OpenGeniRequestOptions, FsReadResponse, FsWriteResponse, WorkspaceCaptureManifest, GitFileDiff, WorkspaceCaptureDegradedReason, MachineState, Permission, SessionStatus as SessionStatus$1, CapabilityUnavailableReason, MachineView, CodexAccountsResponse, CodexAccount, CodexRotationSettings } from '@opengeni/sdk';
5
- export { MachineKind, MachineMetricsSeriesResponse, MachineState, MachineView, MachinesResponse, MetricSample } from '@opengeni/sdk';
6
- import * as react from 'react';
7
- import { ReactNode, ClipboardEvent, RefObject } from 'react';
8
- import { P as PendingApproval } from './session-C3tIXLim.js';
9
- export { B as BrowserSessionEventWindow, a as PendingHumanInputRequest, S as SESSION_EVENT_BROWSER_MAX_BYTES, b as SESSION_EVENT_BROWSER_MAX_COUNT, c as SESSION_EVENT_BROWSER_PENDING_MAX_BYTES, d as SESSION_EVENT_BROWSER_PENDING_MAX_COUNT, e as SESSION_EVENT_BROWSER_SINGLE_EVENT_MAX_BYTES, f as SessionEventsConnectionState, U as UseGoalOptions, g as UseGoalResult, h as UseHumanInputRequestsOptions, i as UseHumanInputRequestsResult, j as UseSessionControlOptions, k as UseSessionControlResult, l as UseSessionEventsOptions, m as UseSessionEventsResult, n as UseSessionLineageOptions, o as UseSessionLineageResult, p as UseSessionMcpApprovalPolicyOptions, q as UseSessionMcpApprovalPolicyResult, r as UseSessionOptions, s as UseSessionResult, t as approvalsFromRequiresAction, u as boundBrowserSessionEventWindow, v as buildTimeline, w as creditExhaustedFromEvents, x as extractSessionRef, y as groupTimeline, z as humanInputRequestFromEvent, A as isGoalEvent, C as isHumanInputEvent, D as isLineageRefreshEvent, E as isSessionMcpApprovalPolicyEvent, F as isTitleEvent, G as projectPendingApprovals, H as projectPendingHumanInputRequests, I as sessionStatusFromEvents, J as toolDisplayName, K as useGoal, L as useHumanInputRequests, M as useSession, N as useSessionControl, O as useSessionEvents, Q as useSessionLineage, R as useSessionMcpApprovalPolicy } from './session-C3tIXLim.js';
10
- import { C as ComposerState, S as SessionEventFeedOptions } from './use-composer-ClHy1rkL.js';
11
- export { a as ComposerSendExtras, F as FILE_ONLY_MESSAGE_TEXT, U as UseComposerOptions, c as composeSendInput, s as shouldSteerOnKey, b as shouldSubmitOnKey, u as useComposer } from './use-composer-ClHy1rkL.js';
12
- import { C as ComposerControlLinks, a as ComposerTranscriptionControlProps, S as SlashCommand, b as SlashCommandContext, c as ChatComposerMessages, d as SlashArg, e as CommandContext } from './composer-BMzimGTO.js';
13
- export { f as CommandResult, g as ComposerTranscriptionControl, h as ComposerTranscriptionMessages, i as ConfirmState, I as INITIAL_TRANSCRIPTION_CONTROL_STATE, N as Notice, O as OPEN_WORKSTREAM_CONTROL_EVENT, j as SlashCommandHandlers, T as TranscriptionControlAction, k as TranscriptionControlState, l as TranscriptionControlTransition, U as UseSlashCommandsOptions, m as UseSlashCommandsResult, n as UseTranscriptionOptions, o as UseTranscriptionResult, p as appendFinalTranscript, q as defaultChatComposerMessages, t as transitionTranscriptionControl, u as useSlashCommands, r as useTranscription } from './composer-BMzimGTO.js';
14
- import { U as UseFileAttachmentsResult } from './use-file-attachments-BmT8WtqO.js';
15
- export { F as FileAttachment, a as UseFileAttachmentsOptions, u as useFileAttachments } from './use-file-attachments-BmT8WtqO.js';
16
- import { A as ActivityItem } from './use-turn-queue-Drm_ypue.js';
17
- export { a as AgentMessageItem, b as AuthNeededItem, G as GoalItem, N as NoticeItem, Q as QueueMutationKind, R as ReasoningItem, S as SandboxItem, c as SessionStatusItem, T as TimelineGroup, d as TimelineItem, e as ToolCallItem, f as TurnEndItem, g as TurnOutcome, U as UseTurnQueueOptions, h as UseTurnQueueResult, i as UserMessageItem, W as WorkerItem, j as isTurnQueueEvent, u as useTurnQueue } from './use-turn-queue-Drm_ypue.js';
18
- import { c as createToolRegistry, T as ToolRegistry } from './session-ui-B_7cfN5u.js';
19
- export { B as BUILT_IN_TURN_SUMMARY_FACET_IDS, a as BuiltInTurnSummaryFacetId, C as CreateToolRegistryOptions, H as HumanInputAnswerDraft, b as HumanInputForm, d as HumanInputFormMessages, e as HumanInputFormProps, M as MessageTimeline, f as MessageTimelineProps, Q as QueueSurface, g as QueueSurfaceProps, h as TimelineRow, i as ToolRegistryEntry, j as ToolRenderer, k as ToolRendererProps, l as TurnSummary, m as TurnSummaryContext, n as TurnSummaryFacet, o as TurnSummaryFacetConfiguration, p as TurnSummaryFacetResult, q as TurnSummaryOptions, r as TurnSummaryProps, s as answersFromDrafts, t as defaultHumanInputFormMessages, u as rawTypeOf } from './session-ui-B_7cfN5u.js';
20
- export { CONNECTION_STATUS_META, ConnectionDot, ConnectionDotProps, ConnectionStatus, ConnectionStatusMeta, ConnectionStatusPill, ConnectionStatusPillProps, DeviceFlowPhase, EnrollmentConsent, EnrollmentConsentMachine, EnrollmentConsentPhase, EnrollmentConsentProps, EnrollmentDeviceFlow, EnrollmentDeviceFlowProps, HEALTH_TOKEN, HealthLevel, HealthVerdict, MACHINE_STATE_BADGE_META, METRICS, METRIC_WINDOWS, MachineCard, MachineCardProps, MachineDetail, MachineDetailProps, MachineDockBar, MachineDockBarProps, MachineHealthPill, MachineHealthPillProps, MachineMetrics, MachineMetricsProps, MachineStateBadgeMeta, MachineStatusPill, MachineStatusPillProps, MachinesClientLike, MachinesDashboard, MachinesDashboardProps, MetricDef, MetricHistoryChart, MetricHistoryChartProps, MetricKey, MetricSparkline, MetricSparklineProps, MetricWindow, SeriesPoint, SharedMachineDisclosure, SharedMachineDisclosureProps, UseMachinesOptions, UseMachinesResult, WINDOW_LABEL, connectionStatusForState, deriveHealth, healthPulses, pointsFor, useMachines } from './machines.js';
21
- import { ClassValue } from 'clsx';
22
-
23
- type OpenGeniProviderProps = {
24
- client: SessionClientLike;
25
- workspaceId: string;
26
- onWorkspaceControlEvent?: ((event: WorkspaceControlEvent) => void) | undefined;
27
- children?: ReactNode;
28
- };
29
- /**
30
- * Supplies the OpenGeni client + workspace to all hooks below it. Hooks also
31
- * accept `{ client, workspaceId }` overrides per call for multi-workspace UIs.
32
- */
33
- declare function OpenGeniProvider({ client, workspaceId, onWorkspaceControlEvent, children, }: OpenGeniProviderProps): react_jsx_runtime.JSX.Element;
34
-
35
- type ChatComposerProps = {
36
- composer: ComposerState;
37
- /** Canonical workstream control, separate from lifecycle status. */
38
- effectiveControl?: EffectiveSessionControl | null | undefined;
39
- /** Waiting prompts already ahead of a normal Send. */
40
- queuedAheadCount?: number | undefined;
41
- /** Whether broader Workspace Resume is authorized for this viewer. */
42
- canControlWorkspace?: boolean | undefined;
43
- /** Optional host routes used to navigate from effective Pause blockers. */
44
- controlLinks?: ComposerControlLinks | undefined;
45
- placeholder?: string | undefined;
46
- disabled?: boolean | undefined;
47
- autoFocus?: boolean | undefined;
48
- /** Replaces the default keyboard hint under the field. */
49
- hint?: string | undefined;
50
- /** App controls in the footer row, replacing the hint. */
51
- controlsStart?: ReactNode | undefined;
52
- /** Provider-neutral speech capability. Provider configuration stays in workspace settings. */
53
- transcription?: ComposerTranscriptionControlProps | undefined;
54
- /** Content rendered above the textarea, inside the field chrome. */
55
- header?: ReactNode | undefined;
56
- /** Paste hook composed with the attachment paste path. */
57
- onPaste?: ((event: ClipboardEvent<HTMLTextAreaElement>) => void) | undefined;
58
- /** Opt-in file attachment state, typically from `useFileAttachments`. */
59
- attachments?: UseFileAttachmentsResult | undefined;
60
- /** Opt-in model picker choices. */
61
- models?: ClientModel[] | undefined;
62
- selectedModel?: string | undefined;
63
- onSelectModel?: ((modelId: string) => void) | undefined;
64
- className?: string | undefined;
65
- commands?: readonly SlashCommand[] | undefined;
66
- commandContext?: SlashCommandContext | undefined;
67
- onClearView?: (() => void) | undefined;
68
- /** Partial overrides for all composer-owned visible and accessible copy. */
69
- messages?: Partial<ChatComposerMessages> | undefined;
70
- };
71
- /**
72
- * Batteries-included chat composer. This preset is assembled exclusively from
73
- * the public controller and compound primitives exported by the composer
74
- * subpath, so custom and default layouts share one behavioral implementation.
75
- */
76
- declare function ChatComposer({ composer, effectiveControl, queuedAheadCount, canControlWorkspace, controlLinks, placeholder, disabled, autoFocus, hint, controlsStart, transcription, header, onPaste, attachments, models, selectedModel, onSelectModel, className, commands, commandContext, onClearView, messages, }: ChatComposerProps): react_jsx_runtime.JSX.Element;
77
-
78
- type UseScheduledTasksOptions = ClientOverride & {
79
- limit?: number | undefined;
80
- pollIntervalMs?: number | undefined;
81
- enabled?: boolean | undefined;
82
- };
83
- type UseScheduledTasksResult = {
84
- tasks: ScheduledTask[];
85
- loading: boolean;
86
- error: Error | null;
87
- refresh: () => Promise<void>;
88
- };
89
- /** List the workspace's scheduled tasks (drift checks, sentinels, reapers, ...). */
90
- declare function useScheduledTasks(options?: UseScheduledTasksOptions): UseScheduledTasksResult;
91
-
92
- type UseWorkspaceSessionsOptions = ClientOverride & {
93
- limit?: number | undefined;
94
- parentSessionId?: string | null | undefined;
95
- cursor?: string | undefined;
96
- search?: string | undefined;
97
- /** Return only the complete personal pinned projection. */
98
- pinsOnly?: boolean | undefined;
99
- /** Refresh interval (ms) for fleet/manager views. Off by default. */
100
- pollIntervalMs?: number | undefined;
101
- enabled?: boolean | undefined;
102
- };
103
- type UseWorkspaceSessionsResult = {
104
- /**
105
- * All visible rows, with pins first. This preserves the pre-pinning hook
106
- * contract for consumers that only read `sessions`.
107
- */
108
- sessions: Session[];
109
- /** The complete personal pinned section, also present in `sessions`. */
110
- pinned: Session[];
111
- /** True when the server omitted older pins from its bounded pinned section. */
112
- pinnedTruncated: boolean;
113
- nextCursor: string | null;
114
- loading: boolean;
115
- error: Error | null;
116
- refresh: () => Promise<void>;
117
- };
118
- /** List the workspace's sessions — the data behind fleet and manager views. */
119
- declare function useWorkspaceSessions(options?: UseWorkspaceSessionsOptions): UseWorkspaceSessionsResult;
120
-
121
- type UseVariableSetsOptions = ClientOverride & {
122
- pollIntervalMs?: number | undefined;
123
- enabled?: boolean | undefined;
124
- };
125
- type UseVariableSetsResult = {
126
- variableSets: VariableSet[];
127
- loading: boolean;
128
- error: Error | null;
129
- refresh: () => Promise<void>;
130
- create: (request: CreateVariableSetRequest) => Promise<VariableSet | null>;
131
- update: (variableSetId: string, request: UpdateVariableSetRequest) => Promise<VariableSet | null>;
132
- remove: (variableSetId: string) => Promise<boolean>;
133
- /** Set/rotate a variable. Values are write-only — reads expose metadata only. */
134
- setVariable: (variableSetId: string, name: string, value: string) => Promise<VariableSetVariableMetadata | null>;
135
- deleteVariable: (variableSetId: string, name: string) => Promise<boolean>;
136
- mutating: boolean;
137
- mutationError: Error | null;
138
- clearMutationError: () => void;
139
- };
140
- /**
141
- * Variable sets (named, encrypted variable sets attached to sessions
142
- * and scheduled tasks). Variable values are write-only end to end: this hook
143
- * never sees a value after it is sent.
144
- */
145
- declare function useVariableSets(options?: UseVariableSetsOptions): UseVariableSetsResult;
146
- /** @deprecated use UseVariableSetsOptions */
147
- type UseEnvironmentsOptions = UseVariableSetsOptions;
148
- /** @deprecated use UseVariableSetsResult */
149
- type UseEnvironmentsResult = UseVariableSetsResult & {
150
- environments: VariableSet[];
151
- };
152
- /** @deprecated use useVariableSets */
153
- declare function useEnvironments(options?: UseEnvironmentsOptions): UseEnvironmentsResult;
154
-
155
- type UseRigsOptions = ClientOverride & {
156
- pollIntervalMs?: number | undefined;
157
- enabled?: boolean | undefined;
158
- };
159
- type UseRigsResult = {
160
- rigs: Rig[];
161
- loading: boolean;
162
- error: Error | null;
163
- refresh: () => Promise<void>;
164
- create: (request: CreateRigRequest) => Promise<Rig | null>;
165
- update: (rigId: string, request: UpdateRigRequest) => Promise<Rig | null>;
166
- remove: (rigId: string) => Promise<boolean>;
167
- listVersions: (rigId: string) => Promise<RigVersion[] | null>;
168
- activateVersion: (rigId: string, versionId: string) => Promise<RigVersion | null>;
169
- listChanges: (rigId: string) => Promise<RigChange[] | null>;
170
- proposeChange: (rigId: string, request: ProposeRigChangeRequest) => Promise<RigChange | null>;
171
- mutating: boolean;
172
- mutationError: Error | null;
173
- clearMutationError: () => void;
174
- };
175
- /**
176
- * Rigs (workspace-scoped, versioned sandbox machine definitions). The list
177
- * polls; version/change reads are on-demand (they are per-rig detail, not part
178
- * of the list surface).
179
- */
180
- declare function useRigs(options?: UseRigsOptions): UseRigsResult;
181
- type UseRigOptions = ClientOverride & {
182
- pollIntervalMs?: number | undefined;
183
- enabled?: boolean | undefined;
184
- };
185
- type UseRigResult = {
186
- rig: Rig | null;
187
- loading: boolean;
188
- error: Error | null;
189
- refresh: () => Promise<void>;
190
- update: (request: UpdateRigRequest) => Promise<Rig | null>;
191
- remove: () => Promise<boolean>;
192
- activateVersion: (versionId: string) => Promise<RigVersion | null>;
193
- proposeChange: (request: ProposeRigChangeRequest) => Promise<RigChange | null>;
194
- /** Re-run verification for a change (asynchronous — poll for the outcome). */
195
- verifyChange: (changeId: string) => Promise<RigChange | null>;
196
- /** Promote a verified definition_edit into a new active version (rigs:manage). */
197
- promoteChange: (changeId: string) => Promise<RigVersion | null>;
198
- /** Re-verify the active version's checks in a clean throwaway sandbox. */
199
- verify: () => Promise<{
200
- ok: boolean;
201
- versionId: string;
202
- } | null>;
203
- mutating: boolean;
204
- mutationError: Error | null;
205
- clearMutationError: () => void;
206
- };
207
- /**
208
- * A single rig (its active version + counts), polled so verification and
209
- * promotion state stay live. Owns the rig's write actions; the versions and
210
- * changes lists are separate polled reads (`useRigVersions`/`useRigChanges`).
211
- */
212
- declare function useRig(rigId: string, options?: UseRigOptions): UseRigResult;
213
- type UseRigVersionsOptions = ClientOverride & {
214
- pollIntervalMs?: number | undefined;
215
- enabled?: boolean | undefined;
216
- };
217
- type UseRigVersionsResult = {
218
- versions: RigVersion[];
219
- loading: boolean;
220
- error: Error | null;
221
- refresh: () => Promise<void>;
222
- };
223
- /** A rig's append-only version history, newest-first (polled). */
224
- declare function useRigVersions(rigId: string, options?: UseRigVersionsOptions): UseRigVersionsResult;
225
- type UseRigChangesOptions = ClientOverride & {
226
- pollIntervalMs?: number | undefined;
227
- enabled?: boolean | undefined;
228
- };
229
- type UseRigChangesResult = {
230
- changes: RigChange[];
231
- loading: boolean;
232
- error: Error | null;
233
- refresh: () => Promise<void>;
234
- };
235
- /**
236
- * A rig's change queue (polled). The default poll cadence lets a change move
237
- * through verifying → merged/rejected without a manual refresh.
238
- */
239
- declare function useRigChanges(rigId: string, options?: UseRigChangesOptions): UseRigChangesResult;
240
-
241
- type UsePacksOptions = ClientOverride & {
242
- pollIntervalMs?: number | undefined;
243
- enabled?: boolean | undefined;
244
- };
245
- type UsePacksResult = {
246
- /** Built-in + registered packs available to the workspace. */
247
- packs: CapabilityPack[];
248
- /** Enable/disable state per pack. */
249
- installations: PackInstallation[];
250
- /** The installation for a pack id, if any. */
251
- installationFor: (packId: string) => PackInstallation | null;
252
- loading: boolean;
253
- error: Error | null;
254
- refresh: () => Promise<void>;
255
- /** Register (or replace) a workspace-scoped pack manifest. */
256
- register: (manifest: RegisterCapabilityPackRequest) => Promise<WorkspaceRegisteredPack | null>;
257
- enable: (packId: string, request?: EnablePackRequest) => Promise<PackInstallation | null>;
258
- /** Unregister a workspace-scoped pack (built-ins cannot be removed). */
259
- remove: (packId: string) => Promise<boolean>;
260
- mutating: boolean;
261
- mutationError: Error | null;
262
- clearMutationError: () => void;
263
- };
264
- /** Capability packs: catalog + installations + register/enable/unregister. */
265
- declare function usePacks(options?: UsePacksOptions): UsePacksResult;
266
-
267
- type UseWorkspacesOptions = Pick<ClientOverride, "client"> & {
268
- pollIntervalMs?: number | undefined;
269
- enabled?: boolean | undefined;
270
- };
271
- type UseWorkspacesResult = {
272
- workspaces: Workspace[];
273
- loading: boolean;
274
- error: Error | null;
275
- refresh: () => Promise<void>;
276
- create: (request: CreateWorkspaceRequest) => Promise<Workspace | null>;
277
- update: (workspaceId: string, request: UpdateWorkspaceRequest) => Promise<Workspace | null>;
278
- mutating: boolean;
279
- mutationError: Error | null;
280
- clearMutationError: () => void;
281
- };
282
- /**
283
- * The caller's workspaces (workspace switchers, onboarding). Not scoped to
284
- * the provider's workspace, so it only needs the client.
285
- */
286
- declare function useWorkspaces(options?: UseWorkspacesOptions): UseWorkspacesResult;
287
-
288
- type UseBillingUsageOptions = Pick<ClientOverride, "client"> & {
289
- /** Account to read. Defaults to the caller's default account server-side. */
290
- accountId?: string | undefined;
291
- /** Filter usage to one workspace. */
292
- workspaceId?: string | undefined;
293
- /** Refresh interval (ms) for live billing meters. Off by default. */
294
- pollIntervalMs?: number | undefined;
295
- enabled?: boolean | undefined;
296
- };
297
- type UseBillingUsageResult = {
298
- /** Prepaid credit balance (micro-USD), null until loaded. */
299
- balance: BillingBalance | null;
300
- /** Recent usage events (runs, tokens, cost, uploads, ...). */
301
- usage: UsageEvent[];
302
- loading: boolean;
303
- error: Error | null;
304
- refresh: () => Promise<void>;
305
- };
306
- /**
307
- * Account billing usage: credit balance + recent usage events — the data
308
- * behind per-call billing meters. Account-scoped, so it only needs the
309
- * client; pass `workspaceId` to narrow usage to one workspace.
310
- */
311
- declare function useBillingUsage(options?: UseBillingUsageOptions): UseBillingUsageResult;
312
-
313
- type UseAvailableModelsOptions = Pick<ClientOverride, "client"> & {
314
- /** Refresh interval (ms). Off by default — the host model list rarely moves. */
315
- pollIntervalMs?: number | undefined;
316
- enabled?: boolean | undefined;
317
- };
318
- type UseAvailableModelsResult = {
319
- /** The provider-grouped models the host exposes (empty until loaded). */
320
- models: ClientModel[];
321
- /** The deployment's default model id, null until loaded. */
322
- defaultModel: string | null;
323
- loading: boolean;
324
- error: Error | null;
325
- refresh: () => Promise<void>;
326
- };
327
- /**
328
- * The host-exposed model list for a <ModelPicker>: fetches the deployment's
329
- * public client config (`GET /v1/config/client`) and surfaces the richer
330
- * provider-grouped `models` plus the `defaultModel` the picker should preselect.
331
- * Deployment-scoped, so it only needs the client (no workspace).
332
- */
333
- declare function useAvailableModels(options?: UseAvailableModelsOptions): UseAvailableModelsResult;
334
-
335
- type SessionCapabilitiesState = "idle" | "negotiating" | "ready" | "cold" | "on-demand" | "error";
336
- type UseSessionCapabilitiesOptions = ClientOverride & {
337
- /**
338
- * Live event log to fold `stream.url.rotated` from (usually
339
- * `useSessionEvents().events`). When present the desktop socket stays fresh on
340
- * a box rollover without a round-trip; stale-epoch rotations are dropped.
341
- */
342
- events?: SessionEvent[] | undefined;
343
- /**
344
- * Whether to acquire a viewer holder for the desktop pixel plane. Requires the
345
- * un-redacted acknowledgment to have been recorded (else the attach 409s and
346
- * the hook surfaces the consent requirement). Default false: read-only
347
- * negotiation (no holder, no warm) — terminal/files/git work without it.
348
- */
349
- attachDesktop?: boolean | undefined;
350
- /**
351
- * Whether to acquire a viewer holder to warm the box for the REAL interactive
352
- * terminal (the ttyd pty-ws plane). Symmetric with `attachDesktop` and shares
353
- * the SAME viewer attach (one warm box serves both planes), but needs NO
354
- * un-redacted acknowledgment — a shell is interactive by nature, and the gate
355
- * is the scoped tunnel URL + stream token. Default false: the terminal stays on
356
- * the read-only Channel-A firehose until the user opens/focuses it. The attach
357
- * folds the minted `pty-ws` url+token into the `Terminal` cell.
358
- */
359
- attachTerminal?: boolean | undefined;
360
- /**
361
- * Whether to acquire a viewer holder to warm the box for a FILE WRITE — the
362
- * wake-on-edit INTENT (a first keystroke in the editor), NOT passive browsing.
363
- * Shares the SAME viewer attach as the desktop/terminal (one warm box, one
364
- * holder) and — like the terminal — needs NO un-redacted acknowledgment:
365
- * reading/writing files is the ordinary Channel-A control plane, not the pixel
366
- * plane. It folds NO live URL (files ride the stateless HTTP plane) — it only
367
- * refcounts liveness. Unlike desktop/terminal it warms even a COLD box: an edit
368
- * legitimately cold-creates (that IS the wake), so the write lands ~100ms warm
369
- * instead of paying the ~5s cold resume. Default false. IMPORTANT: merely
370
- * opening/reading the Files tab must NOT set this — browsing capture-served
371
- * trees/diffs needs no box, and warming one on a cold glance burns box-hours to
372
- * serve reads the capture already answers for free.
373
- */
374
- attachFiles?: boolean | undefined;
375
- /** Hold off negotiating (e.g. the workbench panel is collapsed). Default true. */
376
- enabled?: boolean | undefined;
377
- /** Poll cadence (ms) while the lease is cold/warming. Default 1500. */
378
- warmingPollMs?: number | undefined;
379
- /**
380
- * Give up waiting for `warm` after this long while polling (ms) and surface a
381
- * stalled error with a manual `renegotiate`. Default 30000. This is a UI
382
- * patience deadline, independent from the worker's sandbox warming timeout.
383
- * 0 disables the deadline.
384
- */
385
- warmingDeadlineMs?: number | undefined;
386
- };
387
- type UseSessionCapabilitiesResult = {
388
- /** The negotiated capability doc — the single source of UI truth. */
389
- capabilities: SessionCapabilities | null;
390
- state: SessionCapabilitiesState;
391
- error: Error | null;
392
- /**
393
- * 409 from the desktop attach: the un-redacted (or shared) plane needs explicit
394
- * acknowledgment before a viewer holder is granted. Drives the consent prompt.
395
- */
396
- acknowledgmentRequired: "unredacted" | "shared" | null;
397
- /** 429 from the desktop attach: the per-session viewer cap is reached. */
398
- viewerCapReached: boolean;
399
- /** The viewer holder id minted on a desktop attach (for detach/heartbeat). */
400
- viewerId: string | null;
401
- /** Force a re-negotiation (after acknowledging, a resolution change, etc.). */
402
- renegotiate: () => void;
403
- };
404
- /**
405
- * The capability-negotiation hook. Discovers what THIS session+backend+OS
406
- * supports (FileSystem/Terminal/Git always-ish; DesktopStream/Recording
407
- * sometimes), drives capability-gated rendering, and — when `attachDesktop` —
408
- * holds a viewer lease + heartbeats it so the box stays warm while watched.
409
- *
410
- * Degradation is a value, never a crash: an unsupported surface comes back
411
- * `available:false`/`transport:null` + a `reason`; the components render the
412
- * reason-aware empty state. 409 (consent) and 429 (viewer cap) are surfaced as
413
- * typed signals, not thrown.
414
- */
415
- declare function useSessionCapabilities(sessionId: string | null | undefined, options?: UseSessionCapabilitiesOptions): UseSessionCapabilitiesResult;
416
-
417
- /**
418
- * The minimal WebSocket surface the frame renderer drives. Lets tests (and a
419
- * future transport swap) inject a fake without a live socket — the exact
420
- * analogue of `DesktopRfbFactory` for the noVNC path. Structurally a subset of
421
- * the browser `WebSocket`.
422
- */
423
- interface DesktopWebSocketLike {
424
- binaryType: string;
425
- send(data: ArrayBuffer): void;
426
- close(): void;
427
- addEventListener(type: "open" | "message" | "error" | "close", listener: (ev: {
428
- data?: unknown;
429
- } & Record<string, unknown>) => void): void;
430
- removeEventListener(type: "open" | "message" | "error" | "close", listener: (ev: {
431
- data?: unknown;
432
- } & Record<string, unknown>) => void): void;
433
- }
434
- type DesktopWebSocketFactory = (url: string) => DesktopWebSocketLike;
435
- type UseRelayFrameStreamOptions = {
436
- /** The desktop cell of the negotiated capabilities (`capabilities.DesktopStream`). */
437
- capability: DesktopStreamCapability | null;
438
- /** The mount target. A `<canvas>` is appended here on connect. */
439
- containerRef: RefObject<HTMLDivElement | null>;
440
- /** Custom socket factory (tests / a transport swap). Defaults to `new WebSocket(url)`. */
441
- webSocketFactory?: DesktopWebSocketFactory | undefined;
442
- };
443
- type UseRelayFrameStreamResult = {
444
- state: DesktopConnectionState;
445
- error: Error | null;
446
- /** Tear down + reopen the socket (e.g. after a drop, once a fresh url arrives). */
447
- reconnect: () => void;
448
- };
449
- /**
450
- * VIEW-ONLY PNG-frame renderer for a SELF-HOSTED desktop stream — the relay
451
- * transport (`transport: "relay-frames"`, `client: "frames"`). The self-hosted
452
- * agent produces one PNG per frame as a protobuf datagram over the relay; there
453
- * is no RFB/noVNC here. This hook opens the relay DESKTOP channel as a CLIENT
454
- * (mirroring the proven diagnostic wire protocol), decodes each PNG onto a
455
- * `<canvas>` mounted into `containerRef`, and drives the connection state
456
- * machine: idle → connecting (ws opening) → connected (first painted frame) →
457
- * error (ws error/close/ack rejection).
458
- *
459
- * It is DORMANT for any other transport (or no url): it stays idle and touches
460
- * nothing, so the noVNC path owns the surface. SSR-safe: the socket + DOM attach
461
- * live inside `useEffect`.
462
- *
463
- * Backpressure (critical — frames are ~1.8MB at ~10fps): at most one frame is
464
- * decoded at a time; a frame arriving mid-decode replaces the pending one
465
- * (latest-wins), so a slow decode can never build an unbounded queue.
466
- */
467
- declare function useRelayFrameStream(options: UseRelayFrameStreamOptions): UseRelayFrameStreamResult;
468
-
469
- type UseDesktopStreamOptions = {
470
- /** The desktop cell of the negotiated capabilities (`capabilities.DesktopStream`). */
471
- capability: DesktopStreamCapability | null;
472
- /** The mount target. RFB (or the frame canvas) attaches here on connect. */
473
- containerRef: RefObject<HTMLDivElement | null>;
474
- /** Read-only by default (v1 ruling H). interactive only when cap.mode allows. */
475
- interactive?: boolean | undefined;
476
- scaleViewport?: boolean | undefined;
477
- /** Custom RFB factory (tests / a WebRTC swap). Defaults to a lazy @novnc/novnc. */
478
- rfbFactory?: DesktopRfbFactory | undefined;
479
- /** Custom socket factory for the `relay-frames` transport (tests). Defaults to
480
- * `new WebSocket(url)`. Mirrors `rfbFactory` for the frame renderer. */
481
- webSocketFactory?: DesktopWebSocketFactory | undefined;
482
- };
483
- type UseDesktopStreamResult = {
484
- state: DesktopConnectionState;
485
- error: Error | null;
486
- /** Manual reconnect (e.g. after a securityfailure once a fresh URL arrives). */
487
- reconnect: () => void;
488
- };
489
- /**
490
- * Drive the noVNC RFB lifecycle from a `DesktopStreamCapability`, using the
491
- * SDK's `desktop.ts` reducer + `desktopSocketUrl`. SSR-safe: the RFB import and
492
- * the DOM attach happen inside `useEffect`, so a server render is a no-op and
493
- * the component shows its placeholder until hydration.
494
- *
495
- * Read-only is enforced at three layers: `capability.mode` (server) →
496
- * `interactive` prop → `RFB.viewOnly`. v1 always resolves to read-only. On a
497
- * capability `url` change (a rotation), the old RFB disconnects and a fresh one
498
- * connects to the new URL — a brief "desktop blink", acceptable on rollover.
499
- *
500
- * Transport dispatch: a Modal box negotiates `transport: "vnc-ws"` and drives the
501
- * noVNC RFB below. A SELF-HOSTED machine negotiates `transport: "relay-frames"`
502
- * (PNG-per-frame over the relay, view-only) — that path is delegated to
503
- * `useRelayFrameStream`, which paints a `<canvas>`. Both hooks are ALWAYS called
504
- * (rules of hooks); each is dormant for the other's transport, and we return the
505
- * result of whichever owns the surface. The public interface is identical either
506
- * way, so `DesktopViewer` is transport-agnostic.
507
- */
508
- declare function useDesktopStream(options: UseDesktopStreamOptions): UseDesktopStreamResult;
509
-
510
- /** The ttyd connection lifecycle as surfaced to the component. */
511
- type TerminalStreamStatus = "connecting" | "open" | "closed" | "error";
512
- type UseTerminalStreamOptions = {
513
- /** The Terminal cell of the negotiated capabilities (`capabilities.Terminal`).
514
- * The stream connects ONLY when `transport === "pty-ws"` and `url` is set; on a
515
- * cold box (`transport === "sse-events"` / no url) it stays idle and the caller
516
- * falls back to the Channel-A read-only firehose. */
517
- capability: Pick<TerminalCapability, "transport" | "url" | "token"> | null;
518
- /** Called for each OUTPUT payload from ttyd (write verbatim into xterm). */
519
- onOutput?: ((data: string) => void) | undefined;
520
- /** Called when ttyd sends a SET_WINDOW_TITLE frame. */
521
- onTitle?: ((title: string) => void) | undefined;
522
- /** Initial PTY size to seed the ttyd auth frame + first resize. */
523
- initialCols?: number | undefined;
524
- initialRows?: number | undefined;
525
- };
526
- type UseTerminalStreamResult = {
527
- /** True once the ttyd socket is open (and the auth frame has been sent). */
528
- connected: boolean;
529
- status: TerminalStreamStatus;
530
- /** Pipe a keystroke/paste to the PTY stdin. No-op until the socket is open. */
531
- write: (data: string) => void;
532
- /** Tell ttyd the PTY window changed size (on xterm fit/resize). */
533
- resize: (cols: number, rows: number) => void;
534
- /** Tear the socket down (the effect also tears down on unmount / url change). */
535
- disconnect: () => void;
536
- };
537
- /**
538
- * Drive a ttyd PTY-over-websocket connection from a `pty-ws` Terminal capability,
539
- * symmetric with `use-desktop-stream` (the noVNC-over-tunnel hook). The scoped
540
- * stream token is already embedded in the minted tunnel `url`; the WebSocket is
541
- * opened with the REQUIRED ttyd subprotocol "tty".
542
- *
543
- * ttyd wire protocol (see `@opengeni/sdk/terminal`):
544
- * - first frame: `JSON.stringify({ AuthToken: "" })` (+ optional columns/rows).
545
- * - client→server: INPUT = "0"+data ; RESIZE = "1"+JSON({columns,rows}).
546
- * - server→client: "0" = OUTPUT (→ xterm) ; "1" = SET_WINDOW_TITLE ;
547
- * "2" = SET_PREFERENCES (ignored). Binary frames are decoded the same way.
548
- *
549
- * On a `url`/`token` rotation (a box rollover folds a fresh address into the cell)
550
- * the effect re-runs: the old socket closes and a fresh one connects — a brief
551
- * terminal blink, acceptable on rollover (mirrors the desktop's RFB hot-swap).
552
- * SSR-safe: the socket open lives in `useEffect`, so a server render is a no-op.
553
- */
554
- declare function useTerminalStream(options: UseTerminalStreamOptions): UseTerminalStreamResult;
555
-
556
- type TerminalChunk = {
557
- /** Stable key (the source event id) so the xterm writer tracks a written-cursor. */
558
- id: string;
559
- /** Raw output bytes (utf-8 lossy) — written verbatim into xterm. */
560
- text: string;
561
- /** stdout vs stderr (drives optional tinting). */
562
- stream: "stdout" | "stderr";
563
- /** Global ordering: the source event sequence. */
564
- seq: number;
565
- };
566
- type UseSandboxTerminalOptions = ClientOverride & {
567
- /** The live session event log (usually `useSessionEvents().events`). */
568
- events: SessionEvent[];
569
- /** Restrict to one PTY (by ptyId). Omit to interleave the agent firehose +
570
- * every PTY. */
571
- ptyId?: string | undefined;
572
- /** Include the agent's command-output firehose (sandbox.command.output.delta).
573
- * Default true — the read-only "terminal-as-events" the data path settled on. */
574
- includeAgentFirehose?: boolean | undefined;
575
- /**
576
- * OPEN an interactive PTY against the box so the user can type, not just watch.
577
- * When true (and the session is live) the hook calls `terminalPtyOpen` once,
578
- * tracks the returned ptyId, exposes `write` immediately (bound to that ptyId),
579
- * and closes the PTY on unmount. The PTY's banner + every output delta ride the
580
- * SSE spine (`terminal.pty.*`) back into `events`, so xterm fills in. Default
581
- * false — a caller that only wants the read-only firehose stays projection-only.
582
- */
583
- interactive?: boolean | undefined;
584
- /** Lease liveness ("cold" | "warm" | "draining"). The interactive PTY is only
585
- * opened once the box is warm — opening on a cold box (ptyCapable is advertised
586
- * cold too) races the box and leaves a dead read-only terminal. */
587
- liveness?: string | undefined;
588
- };
589
- type UseSandboxTerminalResult = {
590
- /** Ordered, deduped output chunks to write() into xterm.js. */
591
- chunks: TerminalChunk[];
592
- /** Whether a PTY is currently open (drives the prompt/cursor affordance). */
593
- running: boolean;
594
- /**
595
- * Interactive write fn when a PTY is open and the backend supports stdin
596
- * (`terminal.transport === "pty-ws"` / `PtyOpenResponse.supportsInput`). Null
597
- * in the read-only event-projection case (v1 default).
598
- */
599
- write: ((data: string) => void) | null;
600
- /** The active PTY id, if one is open. */
601
- activePtyId: string | null;
602
- /** Close the active PTY (no-op when none is open). */
603
- close: () => void;
604
- /** A PTY-open failure (interactive mode), if any. */
605
- error: Error | null;
606
- };
607
- /**
608
- * Project the Channel-A event log into an xterm-writable byte stream. The
609
- * terminal is "terminal-as-events": there is NO new socket in v1 — the agent's
610
- * command output (`sandbox.command.output.delta`) and any interactive PTY
611
- * (`terminal.pty.output.delta`) ride the existing SSE spine. When a PTY is open
612
- * and the backend accepts stdin, `write` pipes keystrokes via the SDK
613
- * `terminalPtyWrite` (the synchronous Channel-A control path).
614
- */
615
- declare function useSandboxTerminal(sessionId: string | null | undefined, options: UseSandboxTerminalOptions): UseSandboxTerminalResult;
616
-
617
- /** The git-status overlay a file row may carry (tints modified files in the tree). */
618
- type FileTreeStatus = "added" | "modified" | "deleted" | "renamed" | "untracked";
619
- type CapturedFileUnavailableReason = "not-captured" | "too-large" | "content-missing";
620
- /** A cold capture can index a path without retaining its contents. Components
621
- * use this typed result to offer an explicit wake action instead of silently
622
- * turning passive review into a live sandbox read. */
623
- declare class CapturedFileUnavailableError extends Error {
624
- readonly path: string;
625
- readonly reason: CapturedFileUnavailableReason;
626
- readonly code = "captured_file_unavailable";
627
- constructor(path: string, reason: CapturedFileUnavailableReason);
628
- }
629
- declare class FileWriteConflictError extends Error {
630
- readonly path: string;
631
- readonly expectedContent: string;
632
- readonly liveContent: string;
633
- readonly code = "file_write_conflict";
634
- constructor(path: string, expectedContent: string, liveContent: string);
635
- }
636
- type SandboxWriteFileOptions = {
637
- /** Exact text loaded into the editor. The live file is re-read before write;
638
- * divergence fails closed with FileWriteConflictError. */
639
- expectedContent?: string | undefined;
640
- /** Deliberately bypass the expected-content guard after a visible conflict. */
641
- force?: boolean | undefined;
642
- };
643
- /** A node in the Pierre file tree. `children === undefined` ⇒ an unexpanded dir
644
- * (lazy treeMode); `children: []` ⇒ an expanded-but-empty dir. */
645
- type FileTreeNode = {
646
- path: string;
647
- name: string;
648
- kind: "file" | "dir";
649
- children?: FileTreeNode[] | undefined;
650
- size?: number | null | undefined;
651
- status?: FileTreeStatus | undefined;
652
- /** A residue dir the capture COLLAPSED (node_modules, .git, dist, …): its
653
- * contents were never indexed. Cold, expanding it can't list children — the
654
- * UI shows an inline "contents on machine" row until the box is warm. */
655
- truncated?: boolean | undefined;
656
- };
657
- type UseSandboxFilesOptions = ClientOverride & {
658
- /** Live event log (usually `useSessionEvents().events`) — drives auto-refresh
659
- * on `fs.changed` / `git.changed`. */
660
- events?: SessionEvent[] | undefined;
661
- /** Initial path to list (workspace root by default). */
662
- rootPath?: string | undefined;
663
- /** Hold off the initial list (e.g. panel collapsed). Default true. */
664
- enabled?: boolean | undefined;
665
- /** The lease liveness ("cold" | "warm" | "draining"). The structured FileSystem
666
- * capability is advertised even on a COLD box, so the mount-time list can race
667
- * the box: it lists before the box is warm, gets an empty/errored result, and
668
- * (with no `fs.changed` event) never re-lists. Passing liveness re-lists when
669
- * the box first becomes warm, so the tree populates as soon as the box is up. */
670
- liveness?: string | undefined;
671
- /** The latest turn-end workspace capture (from `useWorkspaceCapture`). The tree
672
- * paints immediately from this durable index, then a warm box reconciles live
673
- * in place. If that live read fails, the capture remains a truthful read-only
674
- * fallback instead of turning into an empty error surface. */
675
- capture?: WorkspaceCaptureManifest | null | undefined;
676
- /** Called when an OPTIMISTIC mutation is reverted because its background
677
- * Channel-A op failed (e.g. a 409 rename collision). The host wires this to a
678
- * toast — the tree silently rolls the node back, the user sees why. */
679
- onMutationError?: ((error: Error, op: string) => void) | undefined;
680
- };
681
- type UseSandboxFilesResult = {
682
- /** The tree roots (the listed root's children). */
683
- tree: FileTreeNode[];
684
- /** Lazy-expand a directory node in place (lists its immediate children). */
685
- expand: (path: string) => Promise<void>;
686
- /** Paths whose lazy `fs.list` is currently in flight — the FileBrowser shows a
687
- * spinner on these nodes so a 2-3s Channel-A list never looks frozen. */
688
- expandingPaths: Set<string>;
689
- /** Read a file for the preview pane (text or base64-for-binary, size-capped). */
690
- readFile: (path: string, options?: OpenGeniRequestOptions) => Promise<FsReadResponse>;
691
- /** Write a file (overwrite, last-writer-wins) — the editor save path.
692
- * Optimistic: a brand-new file is spliced into the tree immediately and the
693
- * Channel-A write runs in the background; on failure the splice is reverted. */
694
- writeFile: (path: string, content: string, options?: SandboxWriteFileOptions) => Promise<FsWriteResponse>;
695
- /** Create a new empty file (refuses to clobber an existing path: overwrite=false). */
696
- createFile: (path: string) => Promise<void>;
697
- /** Create a directory (recursive by default). */
698
- createDir: (path: string) => Promise<void>;
699
- /** Delete a path (pass recursive=true for a non-empty directory). */
700
- deleteEntry: (path: string, recursive?: boolean) => Promise<void>;
701
- /** Move / rename a path (rename == move). Refuses to clobber unless overwrite=true. */
702
- moveEntry: (path: string, newPath: string, opts?: {
703
- overwrite?: boolean;
704
- }) => Promise<void>;
705
- /** Re-list the whole tree from the root. */
706
- refresh: () => Promise<void>;
707
- /** Which source the tree is currently served from: the live box, the turn-end
708
- * capture (cold/offline), or neither yet. M5's source badge reads this. */
709
- source: "live" | "capture" | null;
710
- /** When the served capture was taken (ISO), when `source === "capture"`. */
711
- capturedAt: string | null;
712
- loading: boolean;
713
- error: Error | null;
714
- };
715
- /**
716
- * Project the FileSystem service into a lazy-loaded Pierre tree. The initial
717
- * list pulls one level (depth 1); `expand(path)` lists a directory's immediate
718
- * children on demand (the fast lazy-tree UX). A git-status overlay tints
719
- * modified files. Auto-refreshes when an `fs.changed` / `git.changed` event
720
- * arrives on the live log.
721
- */
722
- declare function useSandboxFiles(sessionId: string | null | undefined, options?: UseSandboxFilesOptions): UseSandboxFilesResult;
723
-
724
- type UseSandboxGitOptions = ClientOverride & {
725
- /** Live event log (usually `useSessionEvents().events`) — drives auto-refresh
726
- * on `git.changed`. */
727
- events?: SessionEvent[] | undefined;
728
- /** Repo root within the workspace (multi-repo). Default: workspace root. */
729
- repoPath?: string | undefined;
730
- /** All repository roots in the workspace. When supplied, status and diff are
731
- * aggregated into one workspace-wide result and paths are workspace-relative. */
732
- repoPaths?: readonly string[] | undefined;
733
- /** Diff the staged index vs HEAD (`--cached`) instead of the working tree. */
734
- staged?: boolean | undefined;
735
- /** Hold off the initial fetch. Default true. */
736
- enabled?: boolean | undefined;
737
- /** Lease liveness ("warm" | "draining" | "cold"). When NOT warm, the diff is
738
- * served from the capture (cold/offline) instead of a live `gitDiff` RPC. */
739
- liveness?: string | undefined;
740
- /** The latest turn-end capture (from `useWorkspaceCapture`). Seeds the diff
741
- * immediately; a warm box reconciles live and leaves this durable review
742
- * surface in place if the live request is temporarily unavailable. */
743
- capture?: WorkspaceCaptureManifest | null | undefined;
744
- };
745
- /** A Git diff qualified into workspace scope. `repoRoot` is present for the
746
- * workspace-wide path and lets review UI group real repositories without
747
- * guessing from the first path segment. */
748
- type SandboxGitFileDiff = GitFileDiff & {
749
- repoRoot?: string | undefined;
750
- };
751
- type UseSandboxGitResult = {
752
- /** Working-tree (or staged) diff vs HEAD — the structured hunks the Pierre
753
- * diff view renders. */
754
- diff: SandboxGitFileDiff[];
755
- branch: string | null;
756
- /** Whether a repo is actually mounted (drives "no repository" vs "no changes"). */
757
- isRepo: boolean;
758
- ahead: number;
759
- behind: number;
760
- /** Number and workspace-relative roots of repositories represented here. */
761
- repoCount: number;
762
- repoRoots: string[];
763
- refresh: () => Promise<void>;
764
- /** Which source the diff is served from: the live box or the turn-end capture. */
765
- source: "live" | "capture" | null;
766
- /** When the served capture was taken (ISO), when `source === "capture"`. */
767
- capturedAt: string | null;
768
- loading: boolean;
769
- error: Error | null;
770
- };
771
- /**
772
- * Project the Git service into the Pierre diff data contract: structured
773
- * `GitFileDiff[]` (per-file hunks with per-line old/new numbers, rename
774
- * detection, binary flag, add/del counts) plus branch + ahead/behind. When the
775
- * box is warm the `git diff` runs in-box (API-direct); when it is cold/offline the
776
- * diff is served from the turn-end capture instead. Refreshes on
777
- * `git.changed`; reconciles live in place on the cold→warm transition.
778
- */
779
- declare function useSandboxGit(sessionId: string | null | undefined, options?: UseSandboxGitOptions): UseSandboxGitResult;
780
-
781
- type UseWorkspaceCaptureOptions = ClientOverride & {
782
- /** Live event log (usually `useSessionEvents().events`) — a
783
- * `workspace.revision.captured` for a NEWER revision refreshes the manifest. */
784
- events?: SessionEvent[] | undefined;
785
- /** Hold off the mount fetch (e.g. the workbench panel is collapsed). Default true. */
786
- enabled?: boolean | undefined;
787
- };
788
- type UseWorkspaceCaptureResult = {
789
- /** The resolved manifest (tree index + per-repo diffs + file refs), or null when
790
- * no capture exists (falls back to the live/wake path — status quo). */
791
- capture: WorkspaceCaptureManifest | null;
792
- /** The loaded capture's monotonic revision, or null when unavailable. */
793
- revision: number | null;
794
- /** When the loaded capture was taken (ISO), for the "as of <time>" source badge. */
795
- capturedAt: string | null;
796
- /** Whether a capture is available at all (the `{available:false}` discriminator). */
797
- available: boolean;
798
- /** Why the newest durable revision is unavailable. null means no capture has
799
- * been attempted yet; a value means capture explicitly failed closed and
800
- * consumers must use the live box rather than trust an incomplete snapshot. */
801
- degradedReason: WorkspaceCaptureDegradedReason | null;
802
- /** The changed-file count from the capture's stats, resolved on the FIRST GET
803
- * (from the response's top-level `stats`, before any manifest-URL hop). null
804
- * until that first resolve; 0 when no capture exists. This is the pre-paint
805
- * "changes exist?" signal the dock uses to pick its default tab with no
806
- * embedder events-at-mount contract. */
807
- fileCount: number | null;
808
- /** A newer revision has been ANNOUNCED than the one currently loaded (a refresh
809
- * is in flight or pending). M5's source badge can show a subtle "updating…". */
810
- isStale: boolean;
811
- loading: boolean;
812
- error: Error | null;
813
- /** Force a re-fetch of the latest capture. */
814
- refresh: () => Promise<void>;
815
- };
816
- /**
817
- * The cold-paint data source: fetch the latest turn-end workspace capture with a
818
- * SINGLE api round-trip on mount (no machine, no Channel-A — this is the <200ms
819
- * first paint). The manifest is served inline in the common
820
- * case; a rare >2MB manifest comes back as a short-TTL signed URL we follow.
821
- *
822
- * Subscribes to the live event log: a `workspace.revision.captured` for a revision
823
- * newer than the one loaded triggers a background refresh (stale-while-revalidate).
824
- * `{available:false}` is a value, never a crash — consumers fall back to the
825
- * live/wake path exactly as before the capture feature existed.
826
- */
827
- declare function useWorkspaceCapture(sessionId: string | null | undefined, options?: UseWorkspaceCaptureOptions): UseWorkspaceCaptureResult;
828
-
829
- /**
830
- * The wake-on-edit state machine. This hook owns the logic and the UI renders
831
- * its result. States are explicit and exhaustive:
832
- *
833
- * viewing-cold — cold snapshot open, no local edits (editable, cloud).
834
- * buffering — local edits buffered; the box is not warm and no warm is
835
- * yet in flight (the host has not attached).
836
- * warming — edits buffered; the box is actively coming up (the host
837
- * attached a viewer in response to `wantsWarm`).
838
- * flushing — the box is warm; the guarded write is in flight.
839
- * flushed — the buffer was written to the live box.
840
- * conflict — the live file diverged from the captured base between
841
- * capture and flush; NO write was issued (C2).
842
- * readonly-offline — a self-hosted machine that is offline; read-only, no wake.
843
- */
844
- type WorkspaceEditState = "viewing-cold" | "buffering" | "warming" | "flushing" | "flushed" | "conflict" | "readonly-offline";
845
- type WorkspaceEditConflict = {
846
- path: string;
847
- /** The capture-served content the edit was based on. */
848
- base: string;
849
- /** The live content found on the box at flush time (what would be overwritten). */
850
- live: string;
851
- };
852
- type UseWorkspaceEditOptions = ClientOverride & {
853
- /** The file being edited (workspace-relative). null disables the machine. */
854
- path?: string | null | undefined;
855
- /** The capture-served content loaded into the editor — the flush base (C2). */
856
- baseContent?: string | null | undefined;
857
- /** `capabilities.liveness` — "warm" | "draining" | "cold". Drives the flush. */
858
- liveness?: string | undefined;
859
- /** True while the host is actively warming the box (attach in flight, not warm
860
- * yet) — lifts `buffering` → `warming`. The host sets this after acting on
861
- * `wantsWarm` (e.g. flipping `attachFiles` on `useSessionCapabilities`). */
862
- warming?: boolean | undefined;
863
- /** A self-hosted machine that is OFFLINE: read-only, no remote wake possible. */
864
- offline?: boolean | undefined;
865
- /** Called once when the first cold edit needs the box warmed — the host wires
866
- * this to its liveness primitive (flip `attachFiles`/`attachViewer`). */
867
- onWarmRequested?: (() => void) | undefined;
868
- };
869
- type UseWorkspaceEditResult = {
870
- state: WorkspaceEditState;
871
- /** The editor should be read-only (self-hosted offline). */
872
- readOnly: boolean;
873
- /** The current buffered content (null = no local edit yet). */
874
- buffer: string | null;
875
- /** The host should warm the box (flip its attach primitive). Latches true from
876
- * the first cold edit until the buffer flushes or is discarded. */
877
- wantsWarm: boolean;
878
- /** Record an edit from the editor (idempotent per identical content). */
879
- edit: (content: string) => void;
880
- /** The conflict detail when `state === "conflict"`. */
881
- conflict: WorkspaceEditConflict | null;
882
- /** Flush the buffer regardless of the base guard (the user chose "overwrite"
883
- * from the conflict bar). Writes last-writer-wins. */
884
- overwrite: () => Promise<void>;
885
- /** Drop the local buffer and return to viewing the snapshot. */
886
- discard: () => void;
887
- error: Error | null;
888
- };
889
- /**
890
- * Cold-editing without a spinner: the editor opens instantly from the capture,
891
- * the first keystroke buffers locally AND signals the host to warm the box, and on
892
- * warm the buffer flushes IF the live file still matches the captured base — else a
893
- * non-blocking conflict is surfaced and nothing is overwritten.
894
- *
895
- * The base guard compares the live content at flush time against `baseContent`
896
- * (the exact bytes the editor loaded). This is equivalent to the sha256 compare
897
- * the design specifies — M1 leaves `baseHash` null, so the loaded content IS the
898
- * authoritative base — and avoids async Web Crypto in the render path.
899
- */
900
- declare function useWorkspaceEdit(sessionId: string | null | undefined, options?: UseWorkspaceEditOptions): UseWorkspaceEditResult;
901
-
902
- /** The one truthful machine indicator. Honest staleness beats
903
- * fake liveness: a cold/asleep box reads "offline — as of <time>", never "live". */
904
- type MachineChipState = "live" | "waking" | "offline";
905
- type MachineChip = {
906
- state: MachineChipState;
907
- /** A ready-to-render label ("Live" / "Waking…" / "Offline — as of 3m ago"). */
908
- label: string;
909
- /** The capture time backing an offline/stale label (ISO), or null. M4 may
910
- * reformat this; `label` already embeds a relative form. */
911
- asOf: string | null;
912
- };
913
- type DeriveMachineChipInput = {
914
- /** `capabilities.liveness` — "warm" | "draining" | "cold" (or null pre-negotiation). */
915
- liveness?: string | null | undefined;
916
- /** `useSessionCapabilities().state` — drives the "waking" (negotiating) read. */
917
- capabilitiesState?: SessionCapabilitiesState | null | undefined;
918
- /** The ACTIVE machine's connection state (from `useMachines`), when known. A
919
- * self-hosted machine that is `offline` cannot be remotely woken. */
920
- activeMachineState?: MachineState | null | undefined;
921
- /** Whether the active sandbox is a user-owned self-hosted machine (no remote wake). */
922
- activeIsSelfhosted?: boolean | undefined;
923
- /** An interaction (wake-on-edit, terminal focus) is actively warming the box. */
924
- wantsWarm?: boolean | undefined;
925
- /** The latest capture's `capturedAt` (ISO) — the "as of <time>" backing. */
926
- capturedAt?: string | null | undefined;
927
- /** Injectable clock for deterministic relative labels (defaults to Date.now). */
928
- now?: number | undefined;
929
- };
930
- /** Compact relative-time for the "as of" label. Pure, no Intl dependency. */
931
- declare function formatAsOf(capturedAt: string, now: number): string;
932
- /**
933
- * Derive the machine-state chip from the live capability/liveness surface, the
934
- * active machine's connection state, and the latest capture time. PURE (M4 renders
935
- * it; the whole point is a deterministic, testable projection).
936
- *
937
- * Precedence:
938
- * 1. warm/draining lease → **live** (a warm box always wins).
939
- * 2. actively warming (negotiating, wake-on-edit, or a reconnecting/enrolling
940
- * machine) → **waking**.
941
- * 3. everything else (a cold/asleep box, a self-hosted machine that's offline,
942
- * an error) → **offline**, labelled "as of <capture time>".
943
- */
944
- declare function deriveMachineChip(input: DeriveMachineChipInput): MachineChip;
945
- type UseMachineChipOptions = DeriveMachineChipInput;
946
- /**
947
- * Thin memoized wrapper over `deriveMachineChip` for the dock header (M4). The
948
- * dock already runs `useSessionCapabilities` + `useMachines` + `useWorkspace
949
- * capture`; it feeds their `liveness` / `state` / active-machine state /
950
- * `capturedAt` here. Pass a periodically-updated `now` if you want the relative
951
- * "as of" label to tick.
952
- */
953
- declare function useMachineChip(input: UseMachineChipOptions): MachineChip;
954
-
955
- type ApprovalSurfaceMessages = {
956
- title: string;
957
- description: string;
958
- approve: string;
959
- reject: string;
960
- approving: string;
961
- rejecting: string;
962
- formatToolName: (name: string) => string;
963
- };
964
- declare const defaultApprovalSurfaceMessages: ApprovalSurfaceMessages;
965
- type ApprovalSurfaceProps = {
966
- approvals: PendingApproval[];
967
- onApprove: (approval: PendingApproval) => void | Promise<void>;
968
- onReject: (approval: PendingApproval) => void | Promise<void>;
969
- responding?: boolean | undefined;
970
- error?: string | Error | null | undefined;
971
- messages?: Partial<ApprovalSurfaceMessages> | undefined;
972
- renderApproval?: ((approval: PendingApproval) => ReactNode) | undefined;
973
- className?: string | undefined;
974
- };
975
- /**
976
- * Host-neutral approval presentation backed by the native pending-approval
977
- * projection and control callbacks. It owns only presentation and duplicate
978
- * click fencing; OpenGeni remains the authority for approval state.
979
- */
980
- declare function ApprovalSurface({ approvals, onApprove, onReject, responding, error, messages: overrides, renderApproval, className, }: ApprovalSurfaceProps): react_jsx_runtime.JSX.Element | null;
981
-
982
- /** The built-in tool renderer registry: every first-party tool plus a fallback. */
983
- declare const defaultToolRegistry: ToolRegistry;
984
- /** Build a registry that extends the built-ins with consumer entries/fallback. */
985
- declare function createDefaultToolRegistry(options?: Parameters<typeof createToolRegistry>[2]): ToolRegistry;
986
-
987
- type ActivityRailProps = {
988
- items: ActivityItem[];
989
- /** Renderer registry for tool calls. Defaults to {@link defaultToolRegistry}. */
990
- toolRegistry?: ToolRegistry | undefined;
991
- /** Drill into a spawned worker session. */
992
- onOpenSession?: ((sessionId: string) => void) | undefined;
993
- /**
994
- * Deep-link a memory row to its record in the host's memory pane. Opt-in: the
995
- * library draws no "View in memory" affordance without a handler (the memory
996
- * row is then non-interactive rich content). See {@link MessageTimelineProps}.
997
- */
998
- onMemoryClick?: ((memoryId: string) => void) | undefined;
999
- /** Drop the left rule + indent (used inside a folded turn summary). */
1000
- bare?: boolean | undefined;
1001
- className?: string | undefined;
1002
- };
1003
- declare function ActivityRail({ items, toolRegistry, onOpenSession, onMemoryClick, bare, className, }: ActivityRailProps): react_jsx_runtime.JSX.Element;
1004
-
1005
- /**
1006
- * A subtle settle signal — see the CHIP DOCTRINE above. The closed tone set.
1007
- * `"interrupted"` is a calm neutral tone for cancelled items — no dot, same
1008
- * quiet weight as `"muted"`, but semantically distinct from metadata.
1009
- */
1010
- type DisclosureChip = {
1011
- tone: "ok" | "bad" | "muted" | "interrupted";
1012
- text: string;
1013
- };
1014
- type ActivityDisclosureProps = {
1015
- icon: ReactNode;
1016
- /** Icon tint. Defaults to the muted foreground; renderers pass accent/failed. */
1017
- iconTone?: "accent" | "failed" | "running" | "muted" | undefined;
1018
- title: ReactNode;
1019
- /** Render the title in the mono face (commands, paths). */
1020
- titleMono?: boolean | undefined;
1021
- /** Shimmer the title while the tool is in-flight. */
1022
- running?: boolean | undefined;
1023
- /**
1024
- * Quiet single-line secondary text (truncated). It is detail-on-demand: hidden
1025
- * when a media preview is set, AND hidden once the row is expanded (the body
1026
- * then owns the detail), so a stat/path never appears twice at once.
1027
- */
1028
- preview?: ReactNode | undefined;
1029
- /** A small inline media preview (a screenshot thumbnail) shown in place of `preview`. */
1030
- media?: ReactNode | undefined;
1031
- /** At most one quiet settle chip, right-aligned to the gutter. */
1032
- chip?: DisclosureChip | undefined;
1033
- /**
1034
- * When true the row carries the standard failure affordance: the icon is tinted
1035
- * red and a "failed" bad-chip appears in the right gutter (unless an explicit
1036
- * `chip` is already supplied — the caller's chip wins). Output is still visible
1037
- * on expand; this is a quiet status signal, not a blocking banner.
1038
- *
1039
- * Renderers should pass `failed={item.status === "failed"}` on their settled
1040
- * (non-running) paths so any tool with a failed status shows a consistent
1041
- * affordance without each renderer having to duplicate the logic.
1042
- */
1043
- failed?: boolean | undefined;
1044
- /**
1045
- * When true the row carries a calm "interrupted" affordance: the icon stays
1046
- * muted (no red) and a quiet "interrupted" chip appears in the right gutter
1047
- * (unless an explicit `chip` is already supplied — the caller's chip wins).
1048
- * This is the cancelled-status analogue of `failed`, but deliberately calm
1049
- * and neutral — it is NOT an error; the user chose to stop.
1050
- *
1051
- * Renderers should pass `cancelled={item.status === "cancelled"}` so any
1052
- * in-flight item that was interrupted on turn.cancelled reads consistently.
1053
- * `cancelled` is ignored when `failed` is also true (failure takes precedence).
1054
- */
1055
- cancelled?: boolean | undefined;
1056
- /** When false the row is a static line (no expand affordance). */
1057
- expandable?: boolean | undefined;
1058
- children?: ReactNode | undefined;
1059
- };
1060
- /**
1061
- * The one disclosure row shape every activity row reuses (tool calls, reasoning,
1062
- * sandbox ops): a chevron, a tinted icon, a title, an optional muted preview or
1063
- * inline media, and at most one right-gutter settle chip. Compact by default;
1064
- * the body mounts only when expanded.
1065
- */
1066
- declare function ActivityDisclosure({ icon, iconTone: iconToneProp, title, titleMono, running, preview, media, chip: chipProp, failed, cancelled, expandable, children, }: ActivityDisclosureProps): react_jsx_runtime.JSX.Element;
1067
- declare function TermBlock({ command, workdir, output, live, tailLines, failed, }: {
1068
- /**
1069
- * The command shown in the prompt header. Pass `null` when the row title
1070
- * already carries it (e.g. an exec row titled `$ cmd`): the header then drops
1071
- * the command — and the whole prompt line if there is no workdir either — so
1072
- * the command never reads twice, stacked, above the output.
1073
- */
1074
- command: string | null;
1075
- workdir?: string | null | undefined;
1076
- /** The FULL output. TermBlock owns the tail/full slicing internally. */
1077
- output: string;
1078
- live?: boolean | undefined;
1079
- /** A non-zero exit / failed call — tints the left accent red (the one hue). */
1080
- failed?: boolean | undefined;
1081
- /**
1082
- * When the output exceeds the tail window, only the last `tailLines` are shown
1083
- * with a "show full output" toggle. The component holds the full text, so the
1084
- * toggle reveals the rest (never a dead affordance). Defaults to 12.
1085
- */
1086
- tailLines?: number | undefined;
1087
- }): react_jsx_runtime.JSX.Element;
1088
- declare function PayloadBlock({ label, value, failed, }: {
1089
- label: string;
1090
- value: unknown;
1091
- failed?: boolean | undefined;
1092
- }): react_jsx_runtime.JSX.Element | null;
1093
- /** A quiet inline note inside an expanded body (lost output, empty frame, …). */
1094
- declare function BodyNote({ children, tone, }: {
1095
- children: ReactNode;
1096
- tone?: "error" | "muted" | undefined;
1097
- }): react_jsx_runtime.JSX.Element;
1098
- /**
1099
- * A loading screenshot placeholder. A faint camera glyph over a shimmering box,
1100
- * so a still frame of the running state reads unambiguously as "capturing" — not
1101
- * a broken thumbnail.
1102
- */
1103
- declare function MediaSkeleton(): react_jsx_runtime.JSX.Element;
1104
- /** A standardized "tool ran, produced no image" placeholder in the media slot. */
1105
- declare function MediaEmpty(): react_jsx_runtime.JSX.Element;
1106
- /**
1107
- * A small inline screenshot thumbnail that opens the app lightbox on click.
1108
- *
1109
- * Requires a `LightboxProvider` ancestor for the click-to-expand affordance.
1110
- * Outside one it degrades to a plain, non-interactive image — never a dead
1111
- * "Expand" button that announces an action it cannot perform.
1112
- */
1113
- declare function Thumbnail({ src, caption, alt, }: {
1114
- src: string;
1115
- caption?: string | undefined;
1116
- alt?: string;
1117
- }): react_jsx_runtime.JSX.Element;
1118
- /**
1119
- * The expanded screenshot inside a tool body: a contained, clickable preview
1120
- * (opens the lightbox) with a quiet caption. Constrained height + object-contain
1121
- * so it never breaks the row layout. Like {@link Thumbnail}, it degrades to a
1122
- * plain image outside a `LightboxProvider`.
1123
- */
1124
- declare function ScreenshotFigure({ src, caption, alt, }: {
1125
- src: string;
1126
- caption?: string | undefined;
1127
- alt?: string;
1128
- }): react_jsx_runtime.JSX.Element;
1129
-
1130
- type LightboxController = {
1131
- open: (src: string, caption?: string) => void;
1132
- };
1133
- /** Open the app-level screenshot lightbox. No-op outside a `LightboxProvider`. */
1134
- declare function useLightbox(): LightboxController;
1135
- /**
1136
- * The lightbox controller when one is mounted, or `null` outside a
1137
- * `LightboxProvider`. Lets a media primitive degrade to a non-interactive image
1138
- * (rather than a dead "Expand" button that announces an action it cannot do).
1139
- */
1140
- declare function useLightboxOptional(): LightboxController | null;
1141
- /**
1142
- * The app-level screenshot lightbox. Render once near the timeline; renderers
1143
- * call `useLightbox().open(src)`.
1144
- *
1145
- * Idempotent by design: when an ancestor `LightboxProvider` already exists (e.g.
1146
- * a `MessageTimeline` mounted inside an app that already wraps its shell), this
1147
- * one becomes a pass-through and does NOT mount a second focus-trapping Dialog.
1148
- * That keeps `MessageTimeline` self-sufficient (it owns its own provider) while
1149
- * composing cleanly when nested.
1150
- */
1151
- declare function LightboxProvider({ children }: {
1152
- children: ReactNode;
1153
- }): react_jsx_runtime.JSX.Element;
1154
-
1155
- /**
1156
- * Seed the initial open state of every timeline collapsible below this node.
1157
- * Intended for screenshot/test instrumentation only; absent by default.
1158
- */
1159
- declare function DisclosureDefaultsProvider({ defaultOpen, children, }: {
1160
- defaultOpen: boolean;
1161
- children: ReactNode;
1162
- }): react_jsx_runtime.JSX.Element;
1163
-
1164
- /** Recover the exit code from a sandbox exec banner (`Process exited with code N`). */
1165
- declare function sandboxCommandExitCode(out: unknown): number | null;
1166
- /**
1167
- * Recover the numeric exec-session id the sandbox embeds for a STILL-RUNNING
1168
- * (backgrounded) process (`Process running with session ID N`). A finished
1169
- * command emits `Process exited with code N` instead, which yields `null`.
1170
- */
1171
- declare function parseExecBannerSessionId(out: unknown): number | null;
1172
- /** Strip the exec banner (`Chunk ID ...\n...\nOutput:\n`) down to the command's stdout. */
1173
- declare function stripExecBanner(out: unknown): string;
1174
- /** The sandbox clamped the output (token/line truncation markers in the banner). */
1175
- declare function execTruncated(out: unknown): boolean;
1176
- /** A `write_stdin` whose target PTY vanished (`write_stdin failed: session not found: N`). */
1177
- declare function isExecSessionLostBanner(out: unknown): boolean;
1178
- /** True when the exec stdout looks binary/garbled (a NUL byte or ELF magic). */
1179
- declare function looksBinary(text: string): boolean;
1180
- /**
1181
- * Render unprintable control characters as caret notation (0x03 -> `^C`) so a
1182
- * `write_stdin` keystroke payload reads cleanly in the row title.
1183
- */
1184
- declare function controlCaret(printable: string): string;
1185
- /** One operation inside an `apply_patch_call` (a V4A file edit). */
1186
- type ApplyPatchOperation = {
1187
- /**
1188
- * The V4A op kind. The three canonical values are `create_file`,
1189
- * `update_file`, and `delete_file`; the open `string` tail tolerates a
1190
- * forward-compatible/unknown op kind from the provider without a type error
1191
- * (it falls through to the "Edited" treatment).
1192
- */
1193
- type: "create_file" | "update_file" | "delete_file" | (string & {});
1194
- path: string;
1195
- /** Rename target -- when present the op is a move/rename. */
1196
- moveTo?: string | null | undefined;
1197
- /** The V4A hunk string (`@@ ...` lines with `+`/`-`/context prefixes). */
1198
- diff?: string | undefined;
1199
- };
1200
- /**
1201
- * Parse a single V4A `apply_patch` operation into the SDK's `GitFileDiff` shape
1202
- * so it can flow into the SAME `DiffView` / `PierreDiff` the Files tab uses.
1203
- * Throws on a hunk string it cannot structure (no `@@` anchor on an update); the
1204
- * renderer catches and falls back to a raw-patch view.
1205
- */
1206
- declare function v4aToGitFileDiff(op: ApplyPatchOperation): GitFileDiff;
1207
- /**
1208
- * Extract the `apply_patch` operations from a provider-native tool item's `raw`
1209
- * payload, normalizing the two wire shapes (`raw.operations[]` for a multi-file
1210
- * patch, `raw.operation` for a single op). The single owner of this shape so the
1211
- * renderer and the turn-summary facet counter never drift.
1212
- */
1213
- declare function applyPatchOps(raw: unknown): ApplyPatchOperation[];
1214
- /**
1215
- * True when a tool item is an `apply_patch_call` — by its provider-native
1216
- * `raw.type` (the live-wire source of truth) or by tool `name` (first-party
1217
- * replays that omit `raw`). Centralizes the rawType-or-name check.
1218
- */
1219
- declare function isApplyPatch(item: {
1220
- name: string;
1221
- raw: unknown;
1222
- }): boolean;
1223
- /** Deep-redact secret-looking values so arguments never leak a key into the UI. */
1224
- declare function redactSecrets(value: unknown): unknown;
1225
- /** Parse tool arguments that may arrive as a JSON string or an object. */
1226
- declare function parseToolArgs(args: unknown): Record<string, unknown>;
1227
- /** The last non-empty line of a string -- the compact "what happened" peek. */
1228
- declare function tailPeek(text: string): string;
1229
- /**
1230
- * Unwrap an MCP tool result (`{ content: [{ type: "text", text }], isError? }`)
1231
- * into a flat `{ text, isError }`. Non-MCP outputs pass through as their string
1232
- * form.
1233
- */
1234
- declare function unwrapMcpOutput(output: unknown): {
1235
- text: string;
1236
- isError: boolean;
1237
- };
1238
-
1239
- /**
1240
- * Parse a composer value into a command name + the rest. A command is
1241
- * recognized ONLY when the value's first character is "/" (the start token);
1242
- * anything else is plain chat and returns null.
1243
- *
1244
- * "/cl" -> { name: "cl", rest: "", hasTrailingSpace: false }
1245
- * "/goal " -> { name: "goal", rest: "", hasTrailingSpace: true }
1246
- * "/goal pause"-> { name: "goal", rest: "pause", hasTrailingSpace: false }
1247
- */
1248
- type ParsedCommandLine = {
1249
- name: string;
1250
- rest: string;
1251
- /** True when the name token is closed by a space — arg-hint mode. */
1252
- hasTrailingSpace: boolean;
1253
- args: string[];
1254
- };
1255
- declare function parseCommandLine(value: string): ParsedCommandLine | null;
1256
- /** Whether the operator's permission set satisfies a command's gate. */
1257
- declare function hasPermission(required: Permission | undefined, permissions: Permission[]): boolean;
1258
- /** Match a command (by name or alias) against the value. */
1259
- declare function matchCommand(commands: readonly SlashCommand[], value: string): SlashCommand | null;
1260
- type FilterCtx = Pick<CommandContext, "sessionId" | "status" | "permissions">;
1261
- /**
1262
- * The commands visible for the current token + context. Permission-absent and
1263
- * `available()===false` commands are dropped entirely (a gated command is never
1264
- * shown, not shown-disabled). Filtering is a prefix match on name/alias.
1265
- */
1266
- declare function filterCommands(commands: readonly SlashCommand[], token: string, ctx: FilterCtx): SlashCommand[];
1267
- /** Render a command's arg hint for the palette footer / help, e.g. "<pause|resume>". */
1268
- declare function argHint(args: readonly SlashArg[] | undefined): string;
1269
- /** The first required arg that has not yet been supplied, if any. */
1270
- declare function firstMissingRequiredArg(command: SlashCommand, args: string[]): SlashArg | null;
1271
- /**
1272
- * The default command set. Adding a command is one object literal here; the
1273
- * palette list, filter, arg-hint footer, and /help all render from this array.
1274
- * Apps concat their own commands via the ChatComposer `commands` prop.
1275
- */
1276
- declare const defaultCommands: readonly SlashCommand[];
1277
-
1278
- type CommandPaletteProps = {
1279
- open: boolean;
1280
- items: SlashCommand[];
1281
- highlight: number;
1282
- /** Hover/click selects a row. */
1283
- onHighlight: (index: number) => void;
1284
- /** Click runs the row (same path as Enter). */
1285
- onRun: (index: number) => void;
1286
- /** Footer arg hint shown in arg-hint mode (e.g. "<pause|resume>"). */
1287
- argHintText: string;
1288
- /** id used for aria-activedescendant wiring from the textarea. */
1289
- listboxId: string;
1290
- /** Accessible list label. Defaults to "Slash commands". */
1291
- label?: string | undefined;
1292
- /** Badge shown for destructive commands. Defaults to "danger". */
1293
- dangerLabel?: string | undefined;
1294
- };
1295
- /**
1296
- * The slash-command palette: a popover anchored above the textarea, rendered
1297
- * entirely from the filtered registry. Dark-first, Linear/Vercel-calm, using
1298
- * the opengeni#46 design tokens. Full keyboard nav lives in useSlashCommands;
1299
- * this component is presentational + aria.
1300
- */
1301
- declare function CommandPalette({ open, items, highlight, onHighlight, onRun, argHintText, listboxId, label, dangerLabel, }: CommandPaletteProps): react_jsx_runtime.JSX.Element;
1302
-
1303
- type ModelPickerProps = {
1304
- /** The host-exposed models to choose from (typically {@link useAvailableModels}). */
1305
- models: ClientModel[];
1306
- /** Controlled selection — the model id, or undefined for "nothing chosen yet". */
1307
- value?: string | undefined;
1308
- /** Called with the chosen model id when the operator picks a row. */
1309
- onChange: (modelId: string) => void;
1310
- disabled?: boolean | undefined;
1311
- className?: string | undefined;
1312
- /** Visible-to-assistive-technology label. Defaults to "Model". */
1313
- label?: string | undefined;
1314
- };
1315
- /**
1316
- * The model picker — a compact dropdown for the composer footer, grouping the
1317
- * host-exposed models by `providerLabel` (so "OpenAI" and "Fireworks AI" head
1318
- * their own sections) and showing each model's display `label`. A native
1319
- * `<select>` keeps it keyboard- and screen-reader-accessible for free and
1320
- * themes via the package's og-* tokens; the chevron is a decorative overlay.
1321
- *
1322
- * Controlled: the host owns `value`/`onChange` and threads the selection into
1323
- * the send path. Renders nothing when no models are exposed, so a single-model
1324
- * deployment shows no chrome.
1325
- */
1326
- declare function ModelPicker({ models, value, onChange, disabled, className, label, }: ModelPickerProps): react_jsx_runtime.JSX.Element | null;
1327
-
1328
- /**
1329
- * The default renderer for chat message bodies in {@link MessageTimeline}.
1330
- *
1331
- * Agent (and user) messages arrive as GitHub-flavored markdown. This turns the
1332
- * raw text into styled HTML using `react-markdown` + `remark-gfm`, themed to the
1333
- * package's `og-*` design tokens so it reads as one cohesive dark surface — no
1334
- * stock Tailwind colors leak in.
1335
- *
1336
- * It re-parses on every render, which is exactly right for streaming: a body
1337
- * that is still arriving (an unterminated `**`, a half-open code fence, a table
1338
- * mid-row) renders as best-effort markdown and resolves cleanly as the rest of
1339
- * the tokens land. Consumers who want a different renderer can still pass
1340
- * `renderMessageText` to `MessageTimeline` to override this entirely.
1341
- */
1342
- type MarkdownProps = {
1343
- children: string;
1344
- className?: string | undefined;
1345
- };
1346
- declare function MarkdownImpl({ children, className }: MarkdownProps): react_jsx_runtime.JSX.Element;
1347
- /** Memoized so streaming re-renders of the parent don't re-parse settled bodies. */
1348
- declare const Markdown: react.MemoExoticComponent<typeof MarkdownImpl>;
1349
-
1350
- type SessionStatusMeta = {
1351
- label: string;
1352
- /** Token-backed color classes for the dot and tinted badge. */
1353
- dotClassName: string;
1354
- badgeClassName: string;
1355
- /** Live states breathe; terminal states hold still. */
1356
- pulse: boolean;
1357
- };
1358
- declare const SESSION_STATUS_META: Record<SessionStatus$1, SessionStatusMeta>;
1359
- type SessionStatusProps = {
1360
- status: SessionStatus$1;
1361
- /** Override the label ("Running" -> "Deploying", ...). */
1362
- label?: string | undefined;
1363
- size?: "sm" | "md" | undefined;
1364
- className?: string | undefined;
1365
- };
1366
- /** Status badge with a breathing dot for live states. */
1367
- declare function SessionStatus({ status, label, size, className }: SessionStatusProps): react_jsx_runtime.JSX.Element;
1368
- type StatusDotProps = {
1369
- status: SessionStatus$1;
1370
- className?: string | undefined;
1371
- };
1372
- /** Just the dot — for dense rows and tiles. */
1373
- declare function StatusDot({ status, className }: StatusDotProps): react_jsx_runtime.JSX.Element;
1374
-
1375
- type FleetTileProps = {
1376
- session: Session;
1377
- /** Overrides the derived title (metadata.title/name, else the initial message). */
1378
- title?: string | undefined;
1379
- /** Extra line under the title — e.g. "drift check" or the worker's task. */
1380
- subtitle?: string | undefined;
1381
- onOpen?: ((session: Session) => void) | undefined;
1382
- className?: string | undefined;
1383
- };
1384
- /** Best-effort display title for a session. */
1385
- declare function sessionDisplayTitle(session: Session): string;
1386
- /**
1387
- * One session in the fleet/manager view: title, live status, model, and
1388
- * recency — dense but calm. Running sessions carry a breathing status dot
1389
- * and a faint accent edge so the live ones read at a glance.
1390
- */
1391
- declare function FleetTile({ session, title, subtitle, onOpen, className }: FleetTileProps): react_jsx_runtime.JSX.Element;
1392
-
1393
- type RendererTier = "webgl" | "canvas" | "dom";
1394
-
1395
- /**
1396
- * A COMPLETE xterm `ITheme` (subset by intent, but every field xterm colors a
1397
- * cell with is present so it never falls back to its stock VGA palette). Built
1398
- * from the og tokens via `xtermThemeFromTokens`.
1399
- */
1400
- type XtermTheme = {
1401
- background?: string;
1402
- foreground?: string;
1403
- cursor?: string;
1404
- cursorAccent?: string;
1405
- selectionBackground?: string;
1406
- selectionForeground?: string;
1407
- selectionInactiveBackground?: string;
1408
- black?: string;
1409
- red?: string;
1410
- green?: string;
1411
- yellow?: string;
1412
- blue?: string;
1413
- magenta?: string;
1414
- cyan?: string;
1415
- white?: string;
1416
- brightBlack?: string;
1417
- brightRed?: string;
1418
- brightGreen?: string;
1419
- brightYellow?: string;
1420
- brightBlue?: string;
1421
- brightMagenta?: string;
1422
- brightCyan?: string;
1423
- brightWhite?: string;
1424
- };
1425
- type SandboxTerminalProps = {
1426
- /** From `useSandboxTerminal(...)`. */
1427
- result: UseSandboxTerminalResult;
1428
- /**
1429
- * The negotiated Terminal capability cell. When it advertises `transport:
1430
- * "pty-ws"` + a live `url` (a warm box with a viewer attached), the terminal is
1431
- * driven by a REAL bidirectional PTY over the Modal tunnel (ttyd-over-websocket)
1432
- * INSTEAD of the broken ptyWrite-over-HTTP path: xterm input → the socket, the
1433
- * socket's output → xterm, xterm resize → the socket. On a cold box / no url
1434
- * (`transport: "sse-events"`) it stays on the read-only Channel-A firehose
1435
- * (`result.chunks`). Omit to force the legacy firehose-only behavior.
1436
- */
1437
- terminalCapability?: TerminalCapability | null | undefined;
1438
- /**
1439
- * Full xterm theme. When omitted the terminal self-derives it from the `--og-*`
1440
- * tokens of its own container (correct even inside a nested `data-og-theme`
1441
- * subtree). Passing it lets the host drive re-theme on a theme flip.
1442
- */
1443
- theme?: XtermTheme | undefined;
1444
- fontFamily?: string | undefined;
1445
- fontSize?: number | undefined;
1446
- /**
1447
- * Lease liveness (`cold` | `warming` | `warm` | `draining`). Drives the
1448
- * boot-in-terminal status lines: once the user has focused the terminal and
1449
- * the box is not yet warm, a styled "● waking machine — Ns…" line is rendered
1450
- * INSIDE xterm (no overlay/spinner) until the live PTY connects.
1451
- */
1452
- liveness?: string | undefined;
1453
- /**
1454
- * Force read-only even when the PTY accepts stdin. Default: interactive
1455
- * whenever a live pty-ws stream is connected OR `result.write !== null` (the box
1456
- * advertises an interactive PTY); otherwise the read-only agent firehose.
1457
- */
1458
- readOnly?: boolean | undefined;
1459
- /** Shown on the server / before xterm hydrates (SSR-safe placeholder). */
1460
- placeholder?: ReactNode | undefined;
1461
- /** Render the small status header (pty/shell + running dot + read-only pill). */
1462
- showHeader?: boolean | undefined;
1463
- /** Shell label for the header (e.g. `/bin/bash`). */
1464
- shell?: string | undefined;
1465
- /**
1466
- * Fired the first time the user engages the terminal surface (focus or click).
1467
- * The host wires this to warm the box for the REAL pty-ws terminal (the viewer
1468
- * attach), so a cold box upgrades from the read-only firehose to a live PTY ON
1469
- * INTERACT — never on mere mount (which would force a box spin-up and regress
1470
- * the firehose-only default).
1471
- */
1472
- onActivate?: (() => void) | undefined;
1473
- className?: string | undefined;
1474
- };
1475
- /** Debug seam (dev/evidence only, never a typed public API): a global hook the
1476
- * screenshot harness reads to probe the settled renderer tier + resolved font
1477
- * without mounting a real WebGL context in unit tests. */
1478
- type TerminalDebugInfo = {
1479
- renderer: RendererTier | null;
1480
- fontFamily: string | undefined;
1481
- fontSize: number | undefined;
1482
- hasVarInFont: boolean;
1483
- theme: XtermTheme | undefined;
1484
- /** The live xterm instance (opaque) — the evidence harness reads its buffer to
1485
- * prove screen preservation (E5) and drive the burst-responsiveness probe. */
1486
- term: unknown;
1487
- };
1488
- declare global {
1489
- var __OG_TERMINAL_DEBUG__: ((info: TerminalDebugInfo) => void) | undefined;
1490
- var __OG_FORCE_RENDERER_FAIL__: string | undefined;
1491
- }
1492
- /**
1493
- * An xterm.js terminal fed by the Channel-A event projection
1494
- * (`useSandboxTerminal`) or a live ttyd PTY. xterm + its addons are lazy-imported
1495
- * inside an effect, so SSR renders the placeholder and the terminal mounts on
1496
- * hydration.
1497
- *
1498
- * Renderer: WebGL (GPU-composited cells) with a canvas → DOM fallback ladder
1499
- * (`attachRenderer`), so bursty output stays smooth but a lost/blocklisted
1500
- * context degrades gracefully. Font + theme are resolved to CONCRETE values
1501
- * from the og tokens BEFORE construction (xterm measures glyphs in a canvas
1502
- * where `var()` never resolves, and colors every cell from a full ANSI palette).
1503
- *
1504
- * The terminal is mounted ONCE and its data source is swapped in place: the
1505
- * read-only firehose (`result.chunks`) → the live PTY. Stdin is toggled via
1506
- * `term.options.disableStdin` at runtime (not a remount), so scrollback and the
1507
- * visible screen survive the projection→PTY handoff.
1508
- *
1509
- * Resizes are tracked with a `ResizeObserver` on the container (not just
1510
- * `window.resize`) so dragging the dock handle refits the grid.
1511
- */
1512
- declare function SandboxTerminal({ result, terminalCapability, theme, fontFamily, fontSize, liveness, readOnly, placeholder, showHeader, shell, onActivate, className, }: SandboxTerminalProps): react_jsx_runtime.JSX.Element;
1513
-
1514
- type FileBrowserProps = {
1515
- /** From `useSandboxFiles(...)`. */
1516
- result: UseSandboxFilesResult;
1517
- /**
1518
- * Rendered instead of the built-in tree when the file surface is unavailable
1519
- * (e.g. a `FileSystem.available === false` capability). Default: a quiet notice.
1520
- */
1521
- fallback?: ReactNode | undefined;
1522
- /** Selection callback for the preview pane. */
1523
- onSelectFile?: ((path: string) => void) | undefined;
1524
- selectedPath?: string | undefined;
1525
- /** Render-prop to theme/replace a row entirely (the Pierre-swap escape hatch). */
1526
- renderNode?: ((node: FileTreeNode, depth: number, expanded: boolean) => ReactNode) | undefined;
1527
- /** Shown when the tree is empty (no files / not loaded yet). */
1528
- emptyState?: ReactNode | undefined;
1529
- /**
1530
- * Enable the file-manager affordances (toolbar, context menu, drag-drop move,
1531
- * inline rename, delete, new file/folder). Defaults to `true` when the hook
1532
- * exposes the mutation methods; pass `false` for a strictly read-only tree.
1533
- */
1534
- editable?: boolean | undefined;
1535
- /**
1536
- * Confirm a (recursive) delete before it runs. Return `false` to cancel.
1537
- * The default is an accessible, non-blocking confirmation dialog. Supply this
1538
- * callback to delegate confirmation to a host-owned dialog.
1539
- */
1540
- confirmDelete?: ((node: FileTreeNode) => boolean | Promise<boolean>) | undefined;
1541
- className?: string | undefined;
1542
- };
1543
- /**
1544
- * The file MANAGER, fed by the FileSystem service via `useSandboxFiles`. This is
1545
- * a first-class editable tree (not a render-only view): lazy-expand with a
1546
- * spinner on the in-flight node, git-status tinting, full keyboard navigation,
1547
- * selection, and the mutating affordances wired straight to the hook —
1548
- *
1549
- * • drag-and-drop MOVE → `moveEntry(from, to)`
1550
- * • inline RENAME → `moveEntry(path, newPath)` (F2 / double-click / menu)
1551
- * • DELETE → `deleteEntry(path, recursive)` (Del / menu, confirmed)
1552
- * • NEW FILE / FOLDER → `createFile` / `createDir` (toolbar + menu), then open
1553
- * • right-click CONTEXT MENU
1554
- *
1555
- * `renderNode` is still honoured as the Pierre-swap escape hatch for the row
1556
- * chrome; the manager scaffolding (toolbar, dnd, menu, inline inputs) wraps it.
1557
- */
1558
- declare function FileBrowser({ result, fallback, onSelectFile, selectedPath, renderNode, emptyState, editable, confirmDelete, className, }: FileBrowserProps): react_jsx_runtime.JSX.Element;
1559
-
1560
- /**
1561
- * @deprecated Use {@link PierreDiff} directly. Retained only as a thin,
1562
- * back-compat alias that renders the Pierre (Shiki) renderer with a plain-text
1563
- * degrade. The old hand-rolled hunk renderer was removed in Workbench v2 — the
1564
- * workbench keeps exactly ONE diff renderer. This alias is removed next major.
1565
- */
1566
- type DiffTheme = {
1567
- addBackground?: string;
1568
- delBackground?: string;
1569
- contextBackground?: string;
1570
- metaForeground?: string;
1571
- };
1572
- /**
1573
- * @deprecated Use {@link PierreDiff}. `theme`/`onSelectFile`/`emptyState` from the
1574
- * removed hand-rolled renderer are accepted for source compatibility and ignored;
1575
- * `fallback` still overrides the plain-text degrade.
1576
- */
1577
- type DiffViewProps = {
1578
- diff: GitFileDiff[];
1579
- fallback?: ReactNode | undefined;
1580
- layout?: "unified" | "split" | undefined;
1581
- themeType?: "dark" | "light" | undefined;
1582
- /** @deprecated line-background theming was part of the removed renderer. */
1583
- theme?: DiffTheme | undefined;
1584
- /** @deprecated the alias no longer renders a clickable file header. */
1585
- onSelectFile?: ((path: string) => void) | undefined;
1586
- isRepo?: boolean | undefined;
1587
- emptyState?: ReactNode | undefined;
1588
- className?: string | undefined;
1589
- };
1590
- /**
1591
- * @deprecated Use {@link PierreDiff} directly. Thin alias: renders `PierreDiff`
1592
- * (Shiki-highlighted, unified/split) with a plain-text fallback for a host
1593
- * without `@pierre/diffs`. Removed next major.
1594
- */
1595
- declare function DiffView({ diff, fallback, layout, themeType, isRepo, emptyState, className, }: DiffViewProps): react_jsx_runtime.JSX.Element;
1596
-
1597
- type PierreDiffProps = {
1598
- diff: GitFileDiff[];
1599
- layout?: "unified" | "split" | undefined;
1600
- themeType?: "dark" | "light" | undefined;
1601
- /** Shiki bundled theme names (dark/light) — derived from the host palette. */
1602
- theme?: {
1603
- dark: string;
1604
- light: string;
1605
- } | undefined;
1606
- /** Disable Pierre's worker pool if its worker bundling fights the host bundler. */
1607
- disableWorkerPool?: boolean | undefined;
1608
- /** Rendered while the (lazy) Pierre bundle loads. */
1609
- loading?: ReactNode | undefined;
1610
- /** Rendered if `@pierre/diffs/react` is not installed / fails to import. */
1611
- fallback?: ReactNode | undefined;
1612
- /** Skip the Shiki renderer entirely and show the plain-text degrade (the old
1613
- * `usePierre={false}` path — one renderer, opted out of highlighting). */
1614
- plain?: boolean | undefined;
1615
- /** Long-line handling: `"wrap"` soft-wraps (the default — a diff in a narrow
1616
- * dock pane should be readable without a horizontal-scroll tax), `"scroll"`
1617
- * keeps lines on one row behind a horizontal scrollbar (better for a wide
1618
- * viewport or pathological minified lines). */
1619
- overflow?: "wrap" | "scroll" | undefined;
1620
- className?: string | undefined;
1621
- };
1622
- /**
1623
- * The Pierre-backed diff: Shiki-highlighted, virtualized, unified/split. Renders
1624
- * one `PatchDiff` per changed file (a reconstructed unified patch from the
1625
- * `GitFileDiff` hunks). The ONE workbench diff renderer; a host without
1626
- * `@pierre/diffs` gets the built-in plain-text degrade (`PlainPatch`).
1627
- */
1628
- declare function PierreDiff({ diff, layout, themeType, theme, disableWorkerPool, loading, fallback, plain, overflow, className, }: PierreDiffProps): react_jsx_runtime.JSX.Element;
1629
-
1630
- type PierreFileProps = {
1631
- /** Workspace-relative path (used for the header + language inference). */
1632
- path: string;
1633
- /** The decoded text contents. */
1634
- contents: string;
1635
- themeType?: "dark" | "light" | undefined;
1636
- /** Shiki bundled theme names (dark/light) — derived from the host palette. */
1637
- theme?: {
1638
- dark: string;
1639
- light: string;
1640
- } | undefined;
1641
- /** Disable Pierre's worker pool if its worker bundling fights the host bundler. */
1642
- disableWorkerPool?: boolean | undefined;
1643
- /** Rendered while the (lazy) Pierre bundle loads. */
1644
- loading?: ReactNode | undefined;
1645
- /** Rendered if `@pierre/diffs/react` is not installed / fails to import. */
1646
- fallback?: ReactNode | undefined;
1647
- className?: string | undefined;
1648
- };
1649
- /**
1650
- * The Pierre-backed single-file VIEWER: Shiki-highlighted, language inferred from
1651
- * the filename — the read complement of `PierreDiff`. Wired to `fs.read` so
1652
- * clicking any file in the tree shows its contents (NOT a diff; no repo needed).
1653
- * Falls back to a plain `<pre>` when `@pierre/diffs` is absent / fails to import.
1654
- */
1655
- declare function PierreFile({ path, contents, themeType, theme, disableWorkerPool, loading, fallback, className, }: PierreFileProps): react_jsx_runtime.JSX.Element;
1656
-
1657
- /** Language grammar loaders, keyed by the extension class we infer from the path. */
1658
- declare const LANGUAGE_LOADERS: Record<string, () => Promise<unknown>>;
1659
- /** Map a filename to a grammar key (or null for plain text — still fully editable). */
1660
- declare function languageForPath(path: string): keyof typeof LANGUAGE_LOADERS | null;
1661
- type CodeEditorProps = {
1662
- /** Workspace-relative path — drives language inference (and the save target upstream). */
1663
- path: string;
1664
- /** The decoded text contents to seed the editor with. */
1665
- initialContents: string;
1666
- /** Persist the current buffer. Resolves when the write lands; rejects to surface an error. */
1667
- onSave: (contents: string) => Promise<unknown>;
1668
- /** Explicitly overwrite after a visible expected-content conflict. */
1669
- onOverwrite?: ((contents: string) => Promise<unknown>) | undefined;
1670
- /** Re-read the selected file after a visible save conflict. */
1671
- onReload?: (() => void) | undefined;
1672
- /** Fired once when the buffer FIRST diverges from its baseline (the first real
1673
- * keystroke) — the wake-on-edit intent. The host warms the box on this so the
1674
- * eventual save lands fast; merely opening the file for reading never fires it. */
1675
- onEditIntent?: (() => void) | undefined;
1676
- /** Read-only mode (e.g. a truncated/too-large file shown for reference only). */
1677
- readOnly?: boolean | undefined;
1678
- themeType?: "dark" | "light" | undefined;
1679
- /** Rendered while the (lazy) CodeMirror bundle loads. */
1680
- loading?: ReactNode | undefined;
1681
- /** Rendered if `@uiw/react-codemirror` is not installed / fails to import. */
1682
- fallback?: ReactNode | undefined;
1683
- className?: string | undefined;
1684
- };
1685
- /**
1686
- * The EDITABLE single-file pane: CodeMirror 6 with a per-language grammar chosen
1687
- * from the filename, og-* themed, with dirty tracking and a save path wired to
1688
- * `Cmd/Ctrl+S` *and* an explicit Save button. The viewer (Pierre `File`) stays
1689
- * the read-only complement — this is only mounted when the user opts to edit.
1690
- *
1691
- * Save semantics: the buffer is "dirty" the moment it diverges from the last
1692
- * saved baseline; a successful `onSave` clears dirty and re-baselines. A failed
1693
- * save keeps the buffer dirty (nothing is lost) and surfaces the error inline.
1694
- * `readOnly` suppresses every mutation path so a truncated/binary file can never
1695
- * be saved back (which would corrupt it by writing the truncated prefix).
1696
- */
1697
- declare function CodeEditor({ path, initialContents, onSave, onOverwrite, onReload, onEditIntent, readOnly, themeType, loading, fallback, className, }: CodeEditorProps): react_jsx_runtime.JSX.Element;
1698
-
1699
- type SandboxFilesProps = {
1700
- /** From `useSandboxFiles(...)`. */
1701
- files: UseSandboxFilesResult;
1702
- /** From `useSandboxGit(...)` — drives the branch/dirty header only. */
1703
- git: UseSandboxGitResult;
1704
- /** @deprecated Diffs live in the dedicated Changes tab now; accepted for
1705
- * source-compat but unused (the Files surface is a browser + viewer). */
1706
- stagedGit?: UseSandboxGitResult | undefined;
1707
- /** Whether a FileSystem surface is advertised (drives the unavailable notice). */
1708
- fileSystemAvailable?: boolean | undefined;
1709
- /** Use Pierre's Shiki highlighter for the viewer (default true; plain fallback). */
1710
- usePierre?: boolean | undefined;
1711
- /** Allow in-place editing of tree files (CodeMirror). Default true. When false
1712
- * the surface is review-only: every text file opens in the read-only viewer. */
1713
- editable?: boolean | undefined;
1714
- /** Fired once when the user first edits an open file (wake-on-edit intent). The
1715
- * dock warms the box on this so the save lands fast; opening/reading never fires
1716
- * it. Browsing the tree/diff must not warm a box. */
1717
- onEditIntent?: (() => void) | undefined;
1718
- /** A guarded diff path routed here by the parent workspace. */
1719
- requestedPath?: string | undefined;
1720
- /** Identity for one guarded-file request. Increment this when the same path is
1721
- * deliberately requested again; it also lets a pending request be consumed
1722
- * without overriding later manual tree navigation. Defaults to the path. */
1723
- requestedPathRequestId?: string | number | undefined;
1724
- /** False while the parent is waking a cold sandbox for `requestedPath`. */
1725
- requestedPathReady?: boolean | undefined;
1726
- /** The machine is cold and no durable capture exists yet. Render an explicit
1727
- * wake gate instead of an empty-tree lie or an implicit Channel-A read. */
1728
- workspaceResting?: boolean | undefined;
1729
- /** A deliberate wake has started but the live file surface is not ready yet. */
1730
- workspaceWaking?: boolean | undefined;
1731
- /** Whether live reads are currently authoritative. */
1732
- liveWorkspaceReady?: boolean | undefined;
1733
- /** Deliberately wake the machine to read content absent from the capture. */
1734
- onWakeWorkspace?: (() => void) | undefined;
1735
- themeType?: "dark" | "light" | undefined;
1736
- className?: string | undefined;
1737
- };
1738
- /**
1739
- * The Files surface: a branch/dirty header, the full lazy file tree, and a
1740
- * viewer/editor pane for the selected file. This is the workspace BROWSER — pick
1741
- * a file to read or edit it. Diff review lives in the dedicated Changes tab (this
1742
- * surface deliberately does NOT replicate the changed-files list, and does not
1743
- * diff here — one job per tab). The agent commits; the human reviews.
1744
- */
1745
- declare function SandboxFiles({ files, git, fileSystemAvailable, usePierre, editable, onEditIntent, requestedPath, requestedPathRequestId, requestedPathReady, workspaceResting, workspaceWaking, liveWorkspaceReady, onWakeWorkspace, themeType, className, }: SandboxFilesProps): react_jsx_runtime.JSX.Element;
1746
-
1747
- type DesktopViewerProps = {
1748
- /** The desktop cell of the negotiated capabilities (`capabilities.DesktopStream`). */
1749
- capability: DesktopStreamCapability | null;
1750
- /**
1751
- * Initial control mode. Default false (watch). When the user flips
1752
- * "Take control" the viewer drives input — but only if `capability.mode`
1753
- * permits it (server-gated; a read-only deployment disables the toggle).
1754
- * Pass a value to control it externally; omit to let the viewer own the state.
1755
- */
1756
- interactive?: boolean | undefined;
1757
- /** Render the built-in Watching ⇄ Take control toggle (default true). */
1758
- showControlToggle?: boolean | undefined;
1759
- scaleViewport?: boolean | undefined;
1760
- /** Custom RFB factory (tests / a WebRTC swap). Defaults to lazy @novnc/novnc. */
1761
- rfbFactory?: DesktopRfbFactory | undefined;
1762
- /** Custom socket factory for the self-hosted `relay-frames` transport (tests).
1763
- * Defaults to `new WebSocket(url)`. Mirrors `rfbFactory`. */
1764
- webSocketFactory?: DesktopWebSocketFactory | undefined;
1765
- /**
1766
- * Consent gate for the un-redacted (and possibly shared) pixel plane. Rendered
1767
- * BEFORE connecting whenever the desktop requires acknowledgment that hasn't
1768
- * been given. Call `onAccept` to record consent (the host wires it to
1769
- * `client.acknowledgeStream` + a re-negotiate). When omitted, a default
1770
- * banner is shown.
1771
- */
1772
- renderConsentGate?: ((onAccept: () => void, shared: boolean) => ReactNode) | undefined;
1773
- /** Called when the default consent gate's accept button is pressed. */
1774
- onAcknowledge?: (() => void) | undefined;
1775
- /**
1776
- * Whether the host has the viewer attach engaged (i.e. the user has opted into
1777
- * watching — the parent's `watchDesktop`/`attachDesktop`). Drives the
1778
- * cold-state behaviour: when watching, a cold-but-warmable lease AUTO-WARMS
1779
- * (and re-warms when the box drains) instead of dead-ending. When omitted we
1780
- * infer it from a recorded consent (the default gate's accept), so the
1781
- * component still self-heals after the first acknowledgment.
1782
- */
1783
- watching?: boolean | undefined;
1784
- /**
1785
- * Request a (re)warm of the sandbox WITHOUT re-acknowledging (the consent has
1786
- * already been recorded — only the box drained). The host wires this to
1787
- * "engage the viewer attach + re-negotiate". Called automatically when a
1788
- * watched desktop is found cold-but-warmable, and behind the manual retry on
1789
- * the warming notice. Distinct from `onAcknowledge`, which is the FIRST,
1790
- * consent-bearing warm.
1791
- */
1792
- onWarm?: (() => void) | undefined;
1793
- /** Shown when transport is null (headless backend / degraded / disabled). */
1794
- renderUnavailable?: ((reason: CapabilityUnavailableReason | null) => ReactNode) | undefined;
1795
- /** Shown while the box is cold/warming (no live address yet). */
1796
- renderWarming?: (() => ReactNode) | undefined;
1797
- /** Shown when the per-session viewer cap (429) was hit. */
1798
- renderViewerCap?: (() => ReactNode) | undefined;
1799
- /** Surface the 429 cap state from `useSessionCapabilities().viewerCapReached`. */
1800
- viewerCapReached?: boolean | undefined;
1801
- /**
1802
- * Connect watchdog (ms): if a live url is present but the RFB hasn't connected
1803
- * within this window, surface a "Couldn't connect" + Reconnect instead of an
1804
- * eternal idle scrim. Default 13000. 0 disables the watchdog.
1805
- */
1806
- connectTimeoutMs?: number | undefined;
1807
- className?: string | undefined;
1808
- };
1809
- /**
1810
- * The desktop surface: a noVNC client connecting to the Channel-B scoped tunnel
1811
- * URL from the capability doc. Owns the mount `<div ref>`, drives
1812
- * `useDesktopStream` (SSR-safe lazy RFB), and renders a real
1813
- * cold → warming → connecting → connected → error state machine with live
1814
- * feedback (spinners, transitions) — never a dead black box with stale text.
1815
- *
1816
- * The read-only vs interactive decision is enforced server-first
1817
- * (`capability.mode`): when the deployment advertises mode "interactive" the
1818
- * viewer can TAKE CONTROL and drive the mouse & keyboard into the box's :0; a
1819
- * "read-only" deployment disables the take-control affordance (graceful, with a
1820
- * reason).
1821
- *
1822
- * Warming: a cold-but-warmable lease (`reason: "lease_cold"`) is NOT a dead end.
1823
- * When the user is watching (consented), the viewer asks the host to (re)warm
1824
- * the box (`onWarm`) and shows a "Warming…" spinner; if the box later drains to
1825
- * cold it re-warms. Genuinely-unavailable surfaces (headless/policy/os/backend)
1826
- * keep a clear, static unavailable notice.
1827
- */
1828
- declare function DesktopViewer({ capability, interactive, showControlToggle, scaleViewport, rfbFactory, webSocketFactory, renderConsentGate, onAcknowledge, watching, onWarm, renderUnavailable, renderWarming, renderViewerCap, viewerCapReached, connectTimeoutMs, className, }: DesktopViewerProps): react_jsx_runtime.JSX.Element;
1829
-
1830
- type WorkspaceTab = {
1831
- id: string;
1832
- label: ReactNode;
1833
- /** Rendered as the active surface. */
1834
- content: ReactNode;
1835
- /** A small badge after the label (e.g. dirty count, live pill). */
1836
- badge?: ReactNode | undefined;
1837
- };
1838
- type WorkspaceDockProps = {
1839
- /** The chat / primary pane shown beside the dock. */
1840
- primary: ReactNode;
1841
- tabs: WorkspaceTab[];
1842
- /** Controlled active tab. Falls back to the first tab. */
1843
- activeTab?: string | undefined;
1844
- onActiveTabChange?: ((id: string) => void) | undefined;
1845
- /** Controlled collapsed state for hosts that expose their own dock toggle. */
1846
- collapsed?: boolean | undefined;
1847
- onCollapsedChange?: ((collapsed: boolean) => void) | undefined;
1848
- /** A status accessory pinned to the right of the tab strip, left of the
1849
- * maximize/collapse controls (e.g. the machine-state chip). Renders in both
1850
- * the docked header and the full-screen overlay header. */
1851
- headerAccessory?: ReactNode | undefined;
1852
- /** Optional host navigation shown at the start of the phone overlay header.
1853
- * It is intentionally absent from desktop dock chrome. */
1854
- mobileLeadingControl?: ReactNode | undefined;
1855
- /** Persisted layout id (localStorage key) for react-resizable-panels. */
1856
- autoSaveId?: string | undefined;
1857
- /** Default dock width as a percent of the session area. */
1858
- defaultSize?: number | undefined;
1859
- minSize?: number | undefined;
1860
- maxSize?: number | undefined;
1861
- className?: string | undefined;
1862
- };
1863
- declare function WorkspaceDock({ primary, tabs, activeTab, onActiveTabChange, collapsed: collapsedProp, onCollapsedChange, headerAccessory, mobileLeadingControl, autoSaveId, defaultSize, minSize, maxSize, className, }: WorkspaceDockProps): react_jsx_runtime.JSX.Element;
1864
-
1865
- /** A host-routed notification (replaces the app-only `sonner` toast coupling). */
1866
- type WorkspaceNotification = {
1867
- kind: "error" | "info";
1868
- message: string;
1869
- };
1870
- /** The workbench's canonical tab ids (a host injects extras around these). */
1871
- declare const WORKBENCH_TAB_CHANGES = "changes";
1872
- declare const WORKBENCH_TAB_FILES = "files";
1873
- declare const WORKBENCH_TAB_TERMINAL = "terminal";
1874
- declare const WORKBENCH_TAB_DESKTOP = "desktop";
1875
- /**
1876
- * The built-in workbench surfaces in their canonical display order. Hosts can
1877
- * pass a subset through `surfaces`; omission preserves the complete standalone
1878
- * workbench.
1879
- */
1880
- declare const WORKBENCH_SURFACES: readonly ["changes", "files", "terminal", "desktop"];
1881
- type SandboxWorkspaceSurface = (typeof WORKBENCH_SURFACES)[number];
1882
- /**
1883
- * Decide a workspace tab from an already-local event log: the newest
1884
- * `workspace.revision.captured` announce carries the change surface stats, so
1885
- * "changes exist → Changes, else Files" needs zero machine round-trips. A host
1886
- * `override` (e.g. a landing "run" tab) wins when supplied.
1887
- *
1888
- * `<SandboxWorkspace>` uses this only as an optional early hint after its own
1889
- * capture GET reports no durable capture. A pure embedder needs no events-at-mount
1890
- * contract: it falls through to authoritative live Git instead.
1891
- */
1892
- declare function initialWorkspaceTab(events: SessionEvent[] | undefined, override?: string | null): string;
1893
- type WorkspaceMachine = {
1894
- /** Whether at least one built-in workbench surface is enabled. */
1895
- enabled: boolean;
1896
- /** The derived live/waking/offline chip model. */
1897
- chip: MachineChip;
1898
- /** The machine these surfaces are bound to (the Modal group box or a
1899
- * self-hosted machine), or null while the fleet is still resolving. */
1900
- activeMachine: MachineView | null;
1901
- loading: boolean;
1902
- error: Error | null;
1903
- refresh: () => Promise<void>;
1904
- };
1905
- type UseSandboxWorkspaceTabsOptions = ClientOverride & {
1906
- sessionId: string;
1907
- /** Live event log (usually `useSessionEvents().events`). */
1908
- events: SessionEvent[];
1909
- /**
1910
- * Built-in surfaces this host wants to expose. Omit for all four. A disabled
1911
- * surface is behaviorally dormant: its data hooks, warm intents, stream
1912
- * attachment, and navigation callbacks are not activated.
1913
- */
1914
- surfaces?: readonly SandboxWorkspaceSurface[] | undefined;
1915
- /** Override the source-driven default tab (e.g. a host landing tab id). When
1916
- * omitted the workbench picks Changes-vs-Files from capture or live Git. */
1917
- initialTab?: string | null | undefined;
1918
- /** Host-routed notifications (mutation errors, desktop-consent failures). The
1919
- * package never imports a toast library — the host decides how to surface. */
1920
- onNotify?: ((notification: WorkspaceNotification) => void) | undefined;
1921
- /** File requested by a Changes guard. The Files surface defers the read until
1922
- * the sandbox is live, then reveals this path. */
1923
- requestedFilePath?: string | null | undefined;
1924
- /** Unique identity for `requestedFilePath`, including repeated requests for the
1925
- * same path. */
1926
- requestedFileRequestId?: string | number | null | undefined;
1927
- /** Route a guarded diff into the host's Files tab. */
1928
- onOpenFile?: ((path: string) => void) | undefined;
1929
- };
1930
- type UseSandboxWorkspaceTabsResult = {
1931
- /** Changes | Files | Terminal | Desktop (capability-gated where noted). */
1932
- tabs: WorkspaceTab[];
1933
- /** The source-driven default tab: Changes when the first authoritative capture
1934
- * or live Git result has changes, else Files (a host `initialTab` overrides).
1935
- * null while that source resolves, or permanently when neither Changes nor
1936
- * Files is enabled; the choice latches once. */
1937
- defaultTab: string | null;
1938
- /** The machine-state model for the dock-header chip. */
1939
- machine: WorkspaceMachine;
1940
- };
1941
- /**
1942
- * Build the workbench tabs + the machine-chip model for one session. This is the
1943
- * dock "brain": capability negotiation, capture-backed cold reads, prewarm
1944
- * flags, desktop consent, and the xterm theme observer — all package-local.
1945
- */
1946
- declare function useSandboxWorkspaceTabs(options: UseSandboxWorkspaceTabsOptions): UseSandboxWorkspaceTabsResult;
1947
- type SandboxWorkspaceProps = ClientOverride & {
1948
- sessionId: string;
1949
- /** Live event log (usually `useSessionEvents().events`). */
1950
- events: SessionEvent[];
1951
- /** The chat / primary pane shown beside the dock. */
1952
- primary: ReactNode;
1953
- /**
1954
- * Built-in surfaces this host wants to expose. Omit for Changes, Files,
1955
- * Terminal, and Desktop. Disabled surfaces remain behaviorally dormant.
1956
- */
1957
- surfaces?: readonly SandboxWorkspaceSurface[] | undefined;
1958
- /** Host tabs injected BEFORE the workbench tabs (e.g. a "Run" landing tab). */
1959
- leadingTabs?: WorkspaceTab[] | undefined;
1960
- /** Host tabs injected AFTER the workbench tabs (e.g. a "Debug" tab). */
1961
- trailingTabs?: WorkspaceTab[] | undefined;
1962
- /** Override the pre-paint default tab (e.g. a host landing tab id). When
1963
- * omitted the workbench decides from capture, then live Git when no capture exists. */
1964
- initialTab?: string | undefined;
1965
- /** Host-routed notifications (no toast dependency in the package). */
1966
- onNotify?: ((notification: WorkspaceNotification) => void) | undefined;
1967
- /** Controlled collapsed state for hosts with their own dock toggle. */
1968
- collapsed?: boolean | undefined;
1969
- onCollapsedChange?: ((collapsed: boolean) => void) | undefined;
1970
- /** Host navigation shown only in the phone workspace overlay header. */
1971
- mobileLeadingControl?: ReactNode | undefined;
1972
- autoSaveId?: string | undefined;
1973
- defaultSize?: number | undefined;
1974
- minSize?: number | undefined;
1975
- maxSize?: number | undefined;
1976
- className?: string | undefined;
1977
- };
1978
- /**
1979
- * The whole session workspace, ready to mount: `<SandboxWorkspace>` assembles the
1980
- * capability-gated tabs, pins the machine-state chip in the dock header, and
1981
- * renders the resizable `<WorkspaceDock>`. Wrap the tree in `<OpenGeniProvider>`
1982
- * (client + workspaceId) and import `@opengeni/react/styles.css`; that is the
1983
- * entire integration (see `docs/embedding-workbench.md`).
1984
- */
1985
- declare function SandboxWorkspace(props: SandboxWorkspaceProps): ReactNode;
1986
-
1987
- /** Events that change which Codex account a session runs on (or just ran). */
1988
- declare function isCodexAccountEvent(event: Pick<SessionEvent, "type">): boolean;
1989
- /**
1990
- * The structural slice of the SDK client the Codex-accounts surface needs. Method
1991
- * NAMES + SIGNATURES match `OpenGeniClient` so the real client satisfies it
1992
- * directly; declared structurally (not a hard Pick) so a test/Geni client can
1993
- * stand in. `getSession` reads the session's pin/last; `pinSessionCodexAccount`
1994
- * is the optional mutation (absent ⇒ the indicator hides the switch affordance).
1995
- */
1996
- type CodexAccountsClientLike = {
1997
- listCodexAccounts: (workspaceId: string) => Promise<CodexAccountsResponse>;
1998
- getSession?: (workspaceId: string, sessionId: string) => Promise<{
1999
- codexPinnedCredentialId?: string | null;
2000
- codexLastCredentialId?: string | null;
2001
- }>;
2002
- pinSessionCodexAccount?: (workspaceId: string, sessionId: string, target: string) => Promise<{
2003
- pinned: string;
2004
- }>;
2005
- /** Optional (absent ⇒ the card hides live refresh): batched live /wham/usage refresh. */
2006
- refreshCodexUsage?: (workspaceId: string) => Promise<{
2007
- usage: Record<string, unknown>;
2008
- }>;
2009
- };
2010
- type UseCodexAccountsOptions = ClientOverride & SessionEventFeedOptions & {
2011
- pollIntervalMs?: number | undefined;
2012
- /** Scope to a session so the hook resolves the pin + the effective account. */
2013
- sessionId?: string | undefined;
2014
- /** Override the client with one implementing `CodexAccountsClientLike`. */
2015
- codexClient?: CodexAccountsClientLike | undefined;
2016
- };
2017
- type UseCodexAccountsResult = {
2018
- accounts: CodexAccount[];
2019
- /** The workspace ACTIVE account (used when a session is unpinned). */
2020
- activeAccountId: string | null;
2021
- /** The session's PINNED account (null ⇒ following workspace active). */
2022
- pinnedAccountId: string | null;
2023
- /** The account the next turn will run on: pin > workspace active. */
2024
- effectiveAccountId: string | null;
2025
- /** The account the session's last turn ACTUALLY ran on (the "Running on:" source). */
2026
- lastAccountId: string | null;
2027
- settings: CodexRotationSettings;
2028
- loading: boolean;
2029
- refresh: () => Promise<void>;
2030
- /**
2031
- * Trigger a LIVE batched /wham/usage refresh across all accounts, then re-read
2032
- * the cached metadata so the new windows land on `accounts`. Modeled on `pin`.
2033
- * No-op (resolves false) when the client can't refresh usage.
2034
- */
2035
- refreshUsage: () => Promise<boolean>;
2036
- /** True while a live usage refresh is in flight (drives the bar skeleton). */
2037
- refreshingUsage: boolean;
2038
- /** Pin (or unpin via "auto") the session's account; returns true on success. */
2039
- pin: (target: string) => Promise<boolean>;
2040
- pinning: boolean;
2041
- /** The target of the in-flight pin (for per-row spinner gating). */
2042
- pinningTarget: string | null;
2043
- mutationError: Error | null;
2044
- };
2045
- /**
2046
- * The workspace's Codex accounts + the per-workspace active pointer + (when
2047
- * session-scoped) the session pin and last-ran-on account. Composed like
2048
- * `useMachines`: slow polling (the realtime work is done by the
2049
- * `codex.account.switched` / `turn.started` event trigger) + a `pin` mutation.
2050
- * Dual-consumer safe via the structural `CodexAccountsClientLike` surface.
2051
- */
2052
- declare function useCodexAccounts(options?: UseCodexAccountsOptions): UseCodexAccountsResult;
2053
-
2054
- /**
2055
- * Reconstruct a unified-diff patch string for a single `GitFileDiff` so it can
2056
- * be fed to a generic patch renderer (e.g. Pierre's `PatchDiff`). The hook
2057
- * already carries per-line old/new numbers and a hunk header, so we emit a
2058
- * conventional `--- / +++ / @@` patch the parser understands.
2059
- */
2060
- declare function gitFileDiffToPatch(file: GitFileDiff): string;
2061
-
2062
- /**
2063
- * Derive a COMPLETE xterm `ITheme` from the live `--og-*` token system on the
2064
- * DOM. Reads the COMPUTED values so xterm gets concrete colors, detects the
2065
- * active theme mode, and fills every ANSI slot. Call on mount + re-derive on a
2066
- * `data-og-theme` flip. SSR-safe: returns undefined off the DOM.
2067
- *
2068
- * `root` should be an element INSIDE the themed subtree (e.g. the terminal
2069
- * container) so nested `[data-og-theme]` themes resolve correctly; when omitted
2070
- * it falls back to the nearest `[data-og-theme]` element, then documentElement.
2071
- */
2072
- declare function xtermThemeFromTokens(root?: HTMLElement | null): XtermTheme | undefined;
2073
-
2074
- /** Merge class names with Tailwind-aware conflict resolution. */
2075
- declare function cn(...inputs: ClassValue[]): string;
2076
-
2077
- /** Compact relative time: "now", "42s", "7m", "3h", "2d", then a date. */
2078
- declare function formatRelativeTime(iso: string, now?: Date): string;
2079
- /** Human-readable byte size: "512 B", "8.0 KB", "1.4 MB", "3 GB". */
2080
- declare function formatBytes(bytes: number): string;
2081
- /** Single-line preview of arbitrary text, for tiles and collapsed rows. */
2082
- declare function truncate(text: string, maxLength: number): string;
2083
- /** Render an unknown payload as readable text (pretty JSON when possible). */
2084
- declare function stringifyPayload(value: unknown): string;
2085
- /** JSON.parse that returns `undefined` instead of throwing. */
2086
- declare function tryParseJson(text: string): unknown;
2087
- /**
2088
- * The canonical credit-death sentence. Credit exhaustion is the one failure a
2089
- * user can fix themselves — the copy must say what happened (empty balance),
2090
- * what to do (add credits), and what is safe (nothing was lost). Crucially it
2091
- * must NOT say "send a message to revive": a revive turn burns credits the
2092
- * workspace no longer has.
2093
- */
2094
- declare const CREDIT_EXHAUSTION_MESSAGE = "Out of OpenGeni credits \u2014 this workspace's balance is empty. Add credits to continue; the conversation is preserved.";
2095
- /**
2096
- * Does this failure/completion payload (or raw error string) mean the
2097
- * workspace ran out of OpenGeni credits? Matches the engine's
2098
- * "insufficient OpenGeni credits" text (case-insensitive, substring — it
2099
- * arrives both bare and wrapped in "Activity task failed: …") and the
2100
- * budget-exhausted segment limit the engine stamps on a turn it ended early.
2101
- */
2102
- declare function isCreditExhaustion(input: {
2103
- error?: string | null;
2104
- detail?: string | null;
2105
- segmentLimit?: string | null;
2106
- } | string): boolean;
2107
- /**
2108
- * Humanize engine/provider failure text before it reaches the timeline or a
2109
- * failure banner. Raw provider errors leak the wrong audience's instructions —
2110
- * "Incorrect API key … find your API key at platform.openai.com" tells a
2111
- * managed-deployment USER to fix credentials only an OPERATOR controls (and is
2112
- * flatly wrong for Azure or subscription-backed engines). Auth, quota, and
2113
- * credit-exhaustion failures collapse to one neutral, honest sentence; every
2114
- * other reason passes through untouched. Raw payloads stay available in the
2115
- * debug surfaces.
2116
- */
2117
- declare function humanizeFailureReason(reason: string | null): string | null;
2118
-
2119
- export { ActivityDisclosure, type ActivityDisclosureProps, ActivityItem, ActivityRail, type ActivityRailProps, type ApplyPatchOperation, ApprovalSurface, type ApprovalSurfaceMessages, type ApprovalSurfaceProps, BodyNote, CREDIT_EXHAUSTION_MESSAGE, CapturedFileUnavailableError, type CapturedFileUnavailableReason, ChatComposer, ChatComposerMessages, type ChatComposerProps, ClientOverride, CodeEditor, type CodeEditorProps, type CodexAccountsClientLike, CommandContext, CommandPalette, type CommandPaletteProps, ComposerState, ComposerTranscriptionControlProps, type DeriveMachineChipInput, DesktopViewer, type DesktopViewerProps, type DesktopWebSocketFactory, type DesktopWebSocketLike, type DiffTheme, DiffView, type DiffViewProps, type DisclosureChip, DisclosureDefaultsProvider, FileBrowser, type FileBrowserProps, type FileTreeNode, type FileTreeStatus, FileWriteConflictError, FleetTile, type FleetTileProps, LightboxProvider, type MachineChip, type MachineChipState, Markdown, type MarkdownProps, MediaEmpty, MediaSkeleton, ModelPicker, type ModelPickerProps, OpenGeniProvider, type OpenGeniProviderProps, type ParsedCommandLine, PayloadBlock, PendingApproval, PierreDiff, type PierreDiffProps, PierreFile, type PierreFileProps, SESSION_STATUS_META, SandboxFiles, type SandboxFilesProps, type SandboxGitFileDiff, SandboxTerminal, type SandboxTerminalProps, SandboxWorkspace, type SandboxWorkspaceProps, type SandboxWorkspaceSurface, type SandboxWriteFileOptions, ScreenshotFigure, type SessionCapabilitiesState, SessionClientLike, SessionStatus, type SessionStatusMeta, type SessionStatusProps, SlashArg, SlashCommand, SlashCommandContext, StatusDot, type StatusDotProps, TermBlock, type TerminalChunk, type TerminalStreamStatus, Thumbnail, ToolRegistry, type UseAvailableModelsOptions, type UseAvailableModelsResult, type UseBillingUsageOptions, type UseBillingUsageResult, type UseCodexAccountsOptions, type UseCodexAccountsResult, type UseDesktopStreamOptions, type UseDesktopStreamResult, type UseEnvironmentsOptions, type UseEnvironmentsResult, UseFileAttachmentsResult, 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 UseTerminalStreamOptions, type UseTerminalStreamResult, type UseVariableSetsOptions, type UseVariableSetsResult, type UseWorkspaceCaptureOptions, type UseWorkspaceCaptureResult, type UseWorkspaceEditOptions, type UseWorkspaceEditResult, type UseWorkspaceSessionsOptions, type UseWorkspaceSessionsResult, type UseWorkspacesOptions, type UseWorkspacesResult, WORKBENCH_SURFACES, WORKBENCH_TAB_CHANGES, WORKBENCH_TAB_DESKTOP, WORKBENCH_TAB_FILES, WORKBENCH_TAB_TERMINAL, WorkspaceDock, type WorkspaceDockProps, type WorkspaceEditConflict, type WorkspaceEditState, type WorkspaceMachine, type WorkspaceNotification, type WorkspaceTab, type XtermTheme, applyPatchOps, argHint, cn, controlCaret, createDefaultToolRegistry, createToolRegistry, defaultApprovalSurfaceMessages, defaultCommands, defaultToolRegistry, deriveMachineChip, execTruncated, filterCommands, firstMissingRequiredArg, formatAsOf, formatBytes, formatRelativeTime, gitFileDiffToPatch, hasPermission, humanizeFailureReason, initialWorkspaceTab, isApplyPatch, isCodexAccountEvent, isCreditExhaustion, isExecSessionLostBanner, languageForPath, looksBinary, matchCommand, parseCommandLine, parseExecBannerSessionId, parseToolArgs, redactSecrets, sandboxCommandExitCode, sessionDisplayTitle, stringifyPayload, stripExecBanner, tailPeek, truncate, tryParseJson, unwrapMcpOutput, useAvailableModels, useBillingUsage, useCodexAccounts, useDesktopStream, useEnvironments, useLightbox, useLightboxOptional, useMachineChip, usePacks, useRelayFrameStream, useRig, useRigChanges, useRigVersions, useRigs, useSandboxFiles, useSandboxGit, useSandboxTerminal, useSandboxWorkspaceTabs, useScheduledTasks, useSessionCapabilities, useTerminalStream, useVariableSets, useWorkspaceCapture, useWorkspaceEdit, useWorkspaceSessions, useWorkspaces, v4aToGitFileDiff, xtermThemeFromTokens };
1
+ export type { EmbeddedFileAttachmentClientLike, EmbeddedGoalClientLike, EmbeddedHumanInputSessionClientLike, EmbeddedSessionEventClientLike, EmbeddedSessionLineageClientLike, EmbeddedSessionMcpApprovalPolicyClientLike, EmbeddedSessionReadClientLike, EmbeddedSessionClientLike, SessionClientLike, } from "./client";
2
+ export { OpenGeniProvider } from "./provider";
3
+ export type { OpenGeniProviderProps } from "./provider";
4
+ export { useOpenGeni, useOpenGeniClient } from "./session-context";
5
+ export type { ClientOverride, OpenGeniContextValue } from "./session-context";
6
+ export { useSession, isTitleEvent } from "./hooks/use-session";
7
+ export type { UseSessionOptions, UseSessionResult } from "./hooks/use-session";
8
+ export { SESSION_EVENT_BROWSER_MAX_BYTES, SESSION_EVENT_BROWSER_MAX_COUNT, SESSION_EVENT_BROWSER_PENDING_MAX_BYTES, SESSION_EVENT_BROWSER_PENDING_MAX_COUNT, SESSION_EVENT_BROWSER_SINGLE_EVENT_MAX_BYTES, boundBrowserSessionEventWindow, useSessionEvents, } from "./hooks/use-session-events";
9
+ export type { BrowserSessionEventWindow, SessionEventsConnectionState, UseSessionEventsOptions, UseSessionEventsResult, } from "./hooks/use-session-events";
10
+ export { useComposer, composeSendInput, shouldSteerOnKey, shouldSubmitOnKey, FILE_ONLY_MESSAGE_TEXT, } from "./hooks/use-composer";
11
+ export type { ComposerSendExtras, ComposerState, UseComposerOptions } from "./hooks/use-composer";
12
+ export { useVoiceInput } from "./hooks/use-voice-input";
13
+ export type { UseVoiceInputOptions, UseVoiceInputResult, VoiceInputStatus, } from "./hooks/use-voice-input";
14
+ export { COMPOSER_PAYMENT_REQUIRED_MESSAGE, composerSubmissionErrorMessage } from "./lib/format";
15
+ export { INITIAL_TRANSCRIPTION_CONTROL_STATE, appendFinalTranscript, transitionTranscriptionControl, useTranscription, } from "./hooks/use-transcription";
16
+ export type { TranscriptionControlAction, TranscriptionControlState, TranscriptionControlTransition, UseTranscriptionOptions, UseTranscriptionResult, } from "./hooks/use-transcription";
17
+ export { useFileAttachments } from "./hooks/use-file-attachments";
18
+ export type { FileAttachment, UseFileAttachmentsOptions, UseFileAttachmentsResult, } from "./hooks/use-file-attachments";
19
+ export { useTurnQueue, isTurnQueueEvent } from "./hooks/use-turn-queue";
20
+ export type { QueueMutationKind, UseTurnQueueOptions, UseTurnQueueResult, } from "./hooks/use-turn-queue";
21
+ export { useLastStartedTurnPolicy, isLastStartedTurnPolicyEvent, } from "./hooks/use-last-started-turn-policy";
22
+ export type { LastStartedTurnPolicy, UseLastStartedTurnPolicyOptions, UseLastStartedTurnPolicyResult, } from "./hooks/use-last-started-turn-policy";
23
+ export { QueueSurface } from "./components/queue-surface";
24
+ export type { QueueSurfaceProps } from "./components/queue-surface";
25
+ export { SessionChrome, sessionChromeGoalPillState } from "./components/session-chrome";
26
+ export type { SessionChromeAgentsSignal, SessionChromeProps, SessionChromeSignalId, SessionChromeSignalTone, } from "./components/session-chrome";
27
+ export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/tooltip";
28
+ export { OPEN_WORKSTREAM_CONTROL_EVENT } from "./components/chat-composer";
29
+ export { useGoal, isGoalEvent } from "./hooks/use-goal";
30
+ export type { UseGoalOptions, UseGoalResult } from "./hooks/use-goal";
31
+ export { useSessionControl } from "./hooks/use-session-control";
32
+ export type { UseSessionControlOptions, UseSessionControlResult, } from "./hooks/use-session-control";
33
+ export { isSessionMcpApprovalPolicyEvent, useSessionMcpApprovalPolicy, } from "./hooks/use-session-mcp-approval-policy";
34
+ export type { UseSessionMcpApprovalPolicyOptions, UseSessionMcpApprovalPolicyResult, } from "./hooks/use-session-mcp-approval-policy";
35
+ export { useScheduledTasks } from "./hooks/use-scheduled-tasks";
36
+ export type { UseScheduledTasksOptions, UseScheduledTasksResult, } from "./hooks/use-scheduled-tasks";
37
+ export { useWorkspaceSessions } from "./hooks/use-workspace-sessions";
38
+ export type { UseWorkspaceSessionsOptions, UseWorkspaceSessionsResult, } from "./hooks/use-workspace-sessions";
39
+ export { useSessionLineage, isLineageRefreshEvent } from "./hooks/use-session-lineage";
40
+ export type { UseSessionLineageOptions, UseSessionLineageResult, } from "./hooks/use-session-lineage";
41
+ export { useVariableSets, useEnvironments } from "./hooks/use-environments";
42
+ export type { UseVariableSetsOptions, UseVariableSetsResult, UseEnvironmentsOptions, UseEnvironmentsResult, } from "./hooks/use-environments";
43
+ export { useRigs, useRig, useRigVersions, useRigChanges } from "./hooks/use-rigs";
44
+ export type { UseRigsOptions, UseRigsResult, UseRigOptions, UseRigResult, UseRigVersionsOptions, UseRigVersionsResult, UseRigChangesOptions, UseRigChangesResult, } from "./hooks/use-rigs";
45
+ export { usePacks } from "./hooks/use-packs";
46
+ export type { UsePacksOptions, UsePacksResult } from "./hooks/use-packs";
47
+ export { useWorkspaces } from "./hooks/use-workspaces";
48
+ export type { UseWorkspacesOptions, UseWorkspacesResult } from "./hooks/use-workspaces";
49
+ export { useBillingUsage } from "./hooks/use-billing-usage";
50
+ export type { UseBillingUsageOptions, UseBillingUsageResult } from "./hooks/use-billing-usage";
51
+ export { useAvailableModels, useWorkspaceModelCatalog } from "./hooks/use-available-models";
52
+ export type { UseAvailableModelsOptions, UseAvailableModelsResult, UseWorkspaceModelCatalogOptions, UseWorkspaceModelCatalogResult, } from "./hooks/use-available-models";
53
+ export { useSessionCapabilities } from "./hooks/use-session-capabilities";
54
+ export type { SessionCapabilitiesState, UseSessionCapabilitiesOptions, UseSessionCapabilitiesResult, } from "./hooks/use-session-capabilities";
55
+ export { useDesktopStream } from "./hooks/use-desktop-stream";
56
+ export type { UseDesktopStreamOptions, UseDesktopStreamResult } from "./hooks/use-desktop-stream";
57
+ export { useRelayFrameStream } from "./hooks/use-relay-frame-stream";
58
+ export type { DesktopWebSocketFactory, DesktopWebSocketLike, UseRelayFrameStreamOptions, UseRelayFrameStreamResult, } from "./hooks/use-relay-frame-stream";
59
+ export { useTerminalStream } from "./hooks/use-terminal-stream";
60
+ export type { TerminalStreamStatus, UseTerminalStreamOptions, UseTerminalStreamResult, } from "./hooks/use-terminal-stream";
61
+ export { useSandboxTerminal } from "./hooks/use-sandbox-terminal";
62
+ export type { TerminalChunk, UseSandboxTerminalOptions, UseSandboxTerminalResult, } from "./hooks/use-sandbox-terminal";
63
+ export { CapturedFileUnavailableError, FileWriteConflictError, useSandboxFiles, } from "./hooks/use-sandbox-files";
64
+ export type { CapturedFileUnavailableReason, FileTreeNode, FileTreeStatus, SandboxWriteFileOptions, UseSandboxFilesOptions, UseSandboxFilesResult, } from "./hooks/use-sandbox-files";
65
+ export { useSandboxGit } from "./hooks/use-sandbox-git";
66
+ export type { SandboxGitFileDiff, UseSandboxGitOptions, UseSandboxGitResult, } from "./hooks/use-sandbox-git";
67
+ export { useWorkspaceCapture } from "./hooks/use-workspace-capture";
68
+ export type { UseWorkspaceCaptureOptions, UseWorkspaceCaptureResult, } from "./hooks/use-workspace-capture";
69
+ export { useWorkspaceEdit } from "./hooks/use-workspace-edit";
70
+ export type { UseWorkspaceEditOptions, UseWorkspaceEditResult, WorkspaceEditConflict, WorkspaceEditState, } from "./hooks/use-workspace-edit";
71
+ export { deriveMachineChip, formatAsOf, useMachineChip } from "./hooks/use-machine-chip";
72
+ export type { DeriveMachineChipInput, MachineChip, MachineChipState, UseMachineChipOptions, } from "./hooks/use-machine-chip";
73
+ export { approvalsFromRequiresAction, projectPendingApprovals } from "./approvals";
74
+ export type { PendingApproval } from "./approvals";
75
+ export { ApprovalSurface, defaultApprovalSurfaceMessages } from "./components/approval-surface";
76
+ export type { ApprovalSurfaceMessages, ApprovalSurfaceProps } from "./components/approval-surface";
77
+ export { humanInputRequestFromEvent, projectPendingHumanInputRequests } from "./human-input";
78
+ export type { PendingHumanInputRequest } from "./human-input";
79
+ export { isHumanInputEvent, useHumanInputRequests } from "./hooks/use-human-input";
80
+ export type { UseHumanInputRequestsOptions, UseHumanInputRequestsResult, } from "./hooks/use-human-input";
81
+ export { HumanInputForm, answersFromDrafts, defaultHumanInputFormMessages, } from "./components/human-input-form";
82
+ export type { HumanInputAnswerDraft, HumanInputFormMessages, HumanInputFormProps, } from "./components/human-input-form";
83
+ export { buildTimeline, creditExhaustedFromEvents, extractSessionRef, groupTimeline, sessionStatusFromEvents, toolDisplayName, } from "./timeline";
84
+ export type { ActivityItem, AgentMessageItem, AuthNeededItem, ContextCompactionItem, GoalItem, MachineInputBatchItem, MachineInputMember, NoticeItem, ReasoningItem, SandboxItem, SessionStatusItem, TimelineGroup, TimelineItem, TurnEndItem, ToolCallItem, UserMessageItem, WorkerItem, } from "./timeline";
85
+ export { createDefaultToolRegistry, createToolRegistry, defaultToolRegistry, rawTypeOf, } from "./timeline";
86
+ export type { CreateToolRegistryOptions, ToolRegistry, ToolRegistryEntry, ToolRenderer, ToolRendererProps, } from "./timeline";
87
+ export { ActivityDisclosure, ActivityRail, BodyNote, DisclosureDefaultsProvider, LightboxProvider, MediaEmpty, MediaSkeleton, PayloadBlock, ScreenshotFigure, TermBlock, Thumbnail, TurnSummary, BUILT_IN_TURN_SUMMARY_FACET_IDS, useLightbox, useLightboxOptional, } from "./timeline";
88
+ export type { ActivityDisclosureProps, ActivityRailProps, DisclosureChip, BuiltInTurnSummaryFacetId, TurnOutcome, TurnSummaryContext, TurnSummaryFacet, TurnSummaryFacetConfiguration, TurnSummaryFacetResult, TurnSummaryOptions, TurnSummaryProps, } from "./timeline";
89
+ export { applyPatchOps, controlCaret, execTruncated, isApplyPatch, isExecSessionLostBanner, looksBinary, parseExecBannerSessionId, parseToolArgs, redactSecrets, sandboxCommandExitCode, stripExecBanner, tailPeek, unwrapMcpOutput, v4aToGitFileDiff, } from "./timeline";
90
+ export type { ApplyPatchOperation } from "./timeline";
91
+ export { argHint, defaultCommands, filterCommands, firstMissingRequiredArg, hasPermission, matchCommand, parseCommandLine, } from "./commands/registry";
92
+ export type { ParsedCommandLine } from "./commands/registry";
93
+ export type { CommandContext, CommandResult, Notice, SlashArg, SlashCommand, } from "./commands/types";
94
+ export { useSlashCommands } from "./hooks/use-slash-commands";
95
+ export type { ConfirmState, SlashCommandContext, SlashCommandHandlers, UseSlashCommandsOptions, UseSlashCommandsResult, } from "./hooks/use-slash-commands";
96
+ export { CommandPalette } from "./components/command-palette";
97
+ export type { CommandPaletteProps } from "./components/command-palette";
98
+ export { ChatComposer } from "./components/chat-composer";
99
+ export type { ChatComposerProps } from "./components/chat-composer";
100
+ export { ComposerTranscriptionControl } from "./components/composer-transcription-control";
101
+ export type { ComposerTranscriptionControlProps, ComposerTranscriptionMessages, } from "./components/composer-transcription-control";
102
+ export { defaultChatComposerMessages } from "./components/composer";
103
+ export type { ChatComposerMessages } from "./components/composer";
104
+ export { ModelPicker } from "./components/model-picker";
105
+ export type { ModelPickerProps } from "./components/model-picker";
106
+ export { advancedSourceSummary, availabilityReasonLabel, billingClassForModel, billingClassLabel, coerceReasoningEffortForModel, defaultEffortForModel, effortOptionsForModel, findPickerRow, groupPickerRowsByBillingClass, labelLatencyMode, payerSummaryForModel, projectPickerRows, runnableLatencyModesForModel, sortPickerRows, } from "./model-policy";
107
+ export type { LatencyModeId, PickerBillingClass, PickerModelRow } from "./model-policy";
108
+ export { MessageTimeline, TimelineRow } from "./components/message-timeline";
109
+ export type { MessageTimelineProps } from "./components/message-timeline";
110
+ export { Markdown } from "./components/markdown";
111
+ export { CopyButton, CopyHoverFrame } from "./components/copy-button";
112
+ export { copyTextToClipboard, tableElementToTsv } from "./lib/clipboard";
113
+ export type { MarkdownProps } from "./components/markdown";
114
+ export { SessionStatus, StatusDot, SESSION_STATUS_META } from "./components/session-status";
115
+ export type { SessionStatusProps, StatusDotProps, SessionStatusMeta, } from "./components/session-status";
116
+ export { FleetTile, sessionDisplayTitle } from "./components/fleet-tile";
117
+ export type { FleetTileProps } from "./components/fleet-tile";
118
+ export { SandboxTerminal } from "./components/sandbox-terminal";
119
+ export type { SandboxTerminalProps, XtermTheme } from "./components/sandbox-terminal";
120
+ export { FileBrowser } from "./components/file-browser";
121
+ export type { FileBrowserProps } from "./components/file-browser";
122
+ export { DiffView } from "./components/diff-view";
123
+ export type { DiffViewProps, DiffTheme } from "./components/diff-view";
124
+ export { PierreDiff } from "./components/pierre-diff";
125
+ export type { PierreDiffProps } from "./components/pierre-diff";
126
+ export { PierreFile } from "./components/pierre-file";
127
+ export type { PierreFileProps } from "./components/pierre-file";
128
+ export { CodeEditor, languageForPath } from "./components/code-editor";
129
+ export type { CodeEditorProps } from "./components/code-editor";
130
+ export { SandboxFiles } from "./components/sandbox-files";
131
+ export type { SandboxFilesProps } from "./components/sandbox-files";
132
+ export { DesktopViewer } from "./components/desktop-viewer";
133
+ export type { DesktopViewerProps } from "./components/desktop-viewer";
134
+ export { WorkspaceDock } from "./components/workspace-dock";
135
+ export type { WorkspaceDockProps, WorkspaceTab } from "./components/workspace-dock";
136
+ export { SandboxWorkspace, useSandboxWorkspaceTabs, initialWorkspaceTab, WORKBENCH_TAB_CHANGES, WORKBENCH_TAB_FILES, WORKBENCH_TAB_TERMINAL, WORKBENCH_TAB_DESKTOP, WORKBENCH_SURFACES, } from "./components/sandbox-workspace";
137
+ export type { SandboxWorkspaceSurface, SandboxWorkspaceProps, UseSandboxWorkspaceTabsOptions, UseSandboxWorkspaceTabsResult, WorkspaceMachine, WorkspaceNotification, } from "./components/sandbox-workspace";
138
+ export * from "./machines";
139
+ export { useCodexAccounts, isCodexAccountEvent } from "./hooks/use-codex-accounts";
140
+ export type { CodexAccountsClientLike, UseCodexAccountsOptions, UseCodexAccountsResult, } from "./hooks/use-codex-accounts";
141
+ export { gitFileDiffToPatch } from "./lib/git-patch";
142
+ export { xtermThemeFromTokens } from "./lib/xterm-theme";
143
+ export { cn } from "./lib/cn";
144
+ export { CREDIT_EXHAUSTION_MESSAGE, formatBytes, formatRelativeTime, humanizeFailureReason, isCreditExhaustion, stringifyPayload, truncate, tryParseJson, } from "./lib/format";