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