@opengeni/react 0.12.0 → 0.15.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 +20 -14
- package/dist/chunk-TOJR776I.js +2280 -0
- package/dist/chunk-TOJR776I.js.map +1 -0
- package/dist/index.d.ts +1040 -363
- package/dist/index.js +10938 -6281
- package/dist/index.js.map +1 -1
- package/dist/{machines-BeZ3bD3t.d.ts → machines-BpdwuQcD.d.ts} +134 -14
- package/dist/machines.d.ts +1 -1
- package/dist/machines.js +23 -1
- package/package.json +20 -12
- package/src/approvals.ts +16 -4
- package/src/client.ts +41 -5
- package/src/commands/index.ts +1 -7
- package/src/commands/registry.ts +46 -12
- package/src/components/chat-composer.tsx +417 -69
- 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 +93 -15
- package/src/components/machine-dock-bar.tsx +20 -8
- package/src/components/machine-health-pill.tsx +68 -0
- package/src/components/machine-metrics.tsx +28 -19
- package/src/components/machine-status-pill.tsx +26 -5
- package/src/components/machines/health.ts +146 -0
- package/src/components/machines/machine-detail.tsx +220 -0
- package/src/components/machines/metric-history-chart.tsx +298 -0
- package/src/components/machines/metric-sparkline.tsx +76 -0
- package/src/components/machines/series.ts +113 -0
- package/src/components/machines-dashboard.tsx +21 -3
- 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/queue-surface.tsx +578 -0
- package/src/components/sandbox-files.tsx +193 -225
- package/src/components/sandbox-terminal.tsx +256 -88
- package/src/components/sandbox-workspace.tsx +957 -0
- package/src/components/session-status.tsx +22 -2
- package/src/components/workbench-changes.tsx +585 -0
- package/src/components/workspace-dock.tsx +213 -59
- 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 +414 -63
- 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 +50 -23
- package/src/hooks/use-session-events.ts +50 -21
- package/src/hooks/use-session-lineage.ts +128 -0
- package/src/hooks/use-session.ts +53 -30
- package/src/hooks/use-slash-commands.ts +6 -4
- package/src/hooks/use-turn-queue.ts +202 -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 +133 -23
- package/src/lib/format.ts +3 -3
- package/src/lib/xterm-renderer.ts +65 -0
- package/src/lib/xterm-theme.ts +224 -18
- package/src/machines.ts +29 -3
- package/src/provider.tsx +195 -6
- 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 +87 -16
- package/src/timeline/projection.ts +412 -87
- 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/index.css +22 -0
- package/styles/tokens.css +2 -2
- package/dist/chunk-5TIXRCSI.js +0 -1291
- package/dist/chunk-5TIXRCSI.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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,
|
|
3
|
-
import { SessionEvent, Session, ResourceRef, ToolRef, SessionStatus as SessionStatus$1, GitFileDiff, StreamConnectionState, SendMessageInput, FileAsset, FileResourceRef, SessionTurn,
|
|
1
|
+
import { C as ClientOverride, S as SessionClientLike } from './machines-BpdwuQcD.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, H as HEALTH_TOKEN, m as HealthLevel, n as HealthVerdict, M as MACHINE_STATE_BADGE_META, o as METRICS, p as METRIC_WINDOWS, q as MachineCard, r as MachineCardProps, s as MachineDetail, t as MachineDetailProps, u as MachineDockBar, v as MachineDockBarProps, w as MachineHealthPill, x as MachineHealthPillProps, y as MachineMetrics, z as MachineMetricsProps, A as MachineStateBadgeMeta, B as MachineStatusPill, F as MachineStatusPillProps, G as MachinesClientLike, I as MachinesDashboard, J as MachinesDashboardProps, K as MetricDef, L as MetricHistoryChart, N as MetricHistoryChartProps, O as MetricKey, P as MetricSparkline, Q as MetricSparklineProps, R as MetricWindow, T as OpenGeniContextValue, U as OpenGeniProvider, V as OpenGeniProviderProps, W as SeriesPoint, X as SharedMachineDisclosure, Y as SharedMachineDisclosureProps, Z as UseMachinesOptions, _ as UseMachinesResult, $ as WINDOW_LABEL, a0 as connectionStatusForState, a1 as deriveHealth, a2 as healthPulses, a3 as pointsFor, a4 as useMachines, a5 as useOpenGeni, a6 as useOpenGeniClient } from './machines-BpdwuQcD.js';
|
|
3
|
+
import { SessionEvent, Session, ResourceRef, ToolRef, SessionStatus as SessionStatus$1, GitFileDiff, StreamConnectionState, EffectiveControlResumeOption, ComposerDraft, SendMessageInput, EffectiveSessionControl, FileAsset, FileResourceRef, SessionQueueSnapshot, SessionTurn, Permission, ClientModel, SessionGoal, SessionControlResponse, ScheduledTask, SessionLineageResponse, VariableSet, CreateVariableSetRequest, UpdateVariableSetRequest, VariableSetVariableMetadata, RigChange, Rig, UpdateRigRequest, RigVersion, ProposeRigChangeRequest, CreateRigRequest, CapabilityPack, PackInstallation, RegisterCapabilityPackRequest, WorkspaceRegisteredPack, EnablePackRequest, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, BillingBalance, UsageEvent, SessionCapabilities, DesktopStreamCapability, DesktopConnectionState, DesktopRfbFactory, TerminalCapability, FsReadResponse, FsWriteResponse, WorkspaceCaptureManifest, WorkspaceCaptureDegradedReason, MachineState, CapabilityUnavailableReason, MachineView, CodexAccountsResponse, CodexAccount, CodexRotationSettings } from '@opengeni/sdk';
|
|
4
4
|
export { MachineKind, MachineMetricsSeriesResponse, MachineState, MachineView, MachinesResponse, MetricSample } from '@opengeni/sdk';
|
|
5
|
-
import * as react from 'react';
|
|
6
|
-
import { ComponentType, ReactNode, RefObject, KeyboardEvent, ClipboardEvent } from 'react';
|
|
7
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
+
import * as react from 'react';
|
|
7
|
+
import { ComponentType, ReactNode, KeyboardEvent, ClipboardEvent, RefObject } from 'react';
|
|
8
8
|
import { ClassValue } from 'clsx';
|
|
9
9
|
|
|
10
10
|
type SessionEventFeedOptions = {
|
|
@@ -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;
|
|
@@ -191,7 +266,16 @@ declare function groupTimeline(items: TimelineItem[]): TimelineGroup[];
|
|
|
191
266
|
* text: "{...}" }], structuredContent? }`).
|
|
192
267
|
*/
|
|
193
268
|
declare function extractSessionRef(value: unknown, depth?: number): string | null;
|
|
194
|
-
/**
|
|
269
|
+
/**
|
|
270
|
+
* Readable label for a tool call ("session_create" -> "session create").
|
|
271
|
+
*
|
|
272
|
+
* MCP tools are namespaced `<serverId>__<toolName>` (see prefixedMcpToolName),
|
|
273
|
+
* and for catalog-imported servers that serverId is an opaque slug+hash
|
|
274
|
+
* ("mcp-integrations-sh-supabase-com-34ed9dcf1390-0i6tcf8"). De-slugging the
|
|
275
|
+
* whole thing leaked that id into the timeline; strip the server prefix and show
|
|
276
|
+
* just the tool ("list organizations"). Names without the `__` boundary (plain
|
|
277
|
+
* built-ins like "session_create") are unaffected.
|
|
278
|
+
*/
|
|
195
279
|
declare function toolDisplayName(name: string): string;
|
|
196
280
|
|
|
197
281
|
type ToolRendererProps = {
|
|
@@ -244,11 +328,17 @@ type ActivityRailProps = {
|
|
|
244
328
|
toolRegistry?: ToolRegistry | undefined;
|
|
245
329
|
/** Drill into a spawned worker session. */
|
|
246
330
|
onOpenSession?: ((sessionId: string) => void) | undefined;
|
|
331
|
+
/**
|
|
332
|
+
* Deep-link a memory row to its record in the host's memory pane. Opt-in: the
|
|
333
|
+
* library draws no "View in memory" affordance without a handler (the memory
|
|
334
|
+
* row is then non-interactive rich content). See {@link MessageTimelineProps}.
|
|
335
|
+
*/
|
|
336
|
+
onMemoryClick?: ((memoryId: string) => void) | undefined;
|
|
247
337
|
/** Drop the left rule + indent (used inside a folded turn summary). */
|
|
248
338
|
bare?: boolean | undefined;
|
|
249
339
|
className?: string | undefined;
|
|
250
340
|
};
|
|
251
|
-
declare function ActivityRail({ items, toolRegistry, onOpenSession, bare, className }: ActivityRailProps): react_jsx_runtime.JSX.Element;
|
|
341
|
+
declare function ActivityRail({ items, toolRegistry, onOpenSession, onMemoryClick, bare, className, }: ActivityRailProps): react_jsx_runtime.JSX.Element;
|
|
252
342
|
|
|
253
343
|
/**
|
|
254
344
|
* A subtle settle signal — see the CHIP DOCTRINE above. The closed tone set.
|
|
@@ -312,7 +402,7 @@ type ActivityDisclosureProps = {
|
|
|
312
402
|
* the body mounts only when expanded.
|
|
313
403
|
*/
|
|
314
404
|
declare function ActivityDisclosure({ icon, iconTone: iconToneProp, title, titleMono, running, preview, media, chip: chipProp, failed, cancelled, expandable, children, }: ActivityDisclosureProps): react_jsx_runtime.JSX.Element;
|
|
315
|
-
declare function TermBlock({ command, workdir, output, live, tailLines, }: {
|
|
405
|
+
declare function TermBlock({ command, workdir, output, live, tailLines, failed, }: {
|
|
316
406
|
/**
|
|
317
407
|
* The command shown in the prompt header. Pass `null` when the row title
|
|
318
408
|
* already carries it (e.g. an exec row titled `$ cmd`): the header then drops
|
|
@@ -324,6 +414,8 @@ declare function TermBlock({ command, workdir, output, live, tailLines, }: {
|
|
|
324
414
|
/** The FULL output. TermBlock owns the tail/full slicing internally. */
|
|
325
415
|
output: string;
|
|
326
416
|
live?: boolean | undefined;
|
|
417
|
+
/** A non-zero exit / failed call — tints the left accent red (the one hue). */
|
|
418
|
+
failed?: boolean | undefined;
|
|
327
419
|
/**
|
|
328
420
|
* When the output exceeds the tail window, only the last `tailLines` are shown
|
|
329
421
|
* with a "show full output" toggle. The component holds the full text, so the
|
|
@@ -331,13 +423,13 @@ declare function TermBlock({ command, workdir, output, live, tailLines, }: {
|
|
|
331
423
|
*/
|
|
332
424
|
tailLines?: number | undefined;
|
|
333
425
|
}): react_jsx_runtime.JSX.Element;
|
|
334
|
-
declare function PayloadBlock({ label, value, failed }: {
|
|
426
|
+
declare function PayloadBlock({ label, value, failed, }: {
|
|
335
427
|
label: string;
|
|
336
428
|
value: unknown;
|
|
337
429
|
failed?: boolean | undefined;
|
|
338
430
|
}): react_jsx_runtime.JSX.Element | null;
|
|
339
431
|
/** A quiet inline note inside an expanded body (lost output, empty frame, …). */
|
|
340
|
-
declare function BodyNote({ children, tone }: {
|
|
432
|
+
declare function BodyNote({ children, tone, }: {
|
|
341
433
|
children: ReactNode;
|
|
342
434
|
tone?: "error" | "muted" | undefined;
|
|
343
435
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -356,7 +448,7 @@ declare function MediaEmpty(): react_jsx_runtime.JSX.Element;
|
|
|
356
448
|
* Outside one it degrades to a plain, non-interactive image — never a dead
|
|
357
449
|
* "Expand" button that announces an action it cannot perform.
|
|
358
450
|
*/
|
|
359
|
-
declare function Thumbnail({ src, caption, alt }: {
|
|
451
|
+
declare function Thumbnail({ src, caption, alt, }: {
|
|
360
452
|
src: string;
|
|
361
453
|
caption?: string | undefined;
|
|
362
454
|
alt?: string;
|
|
@@ -367,7 +459,7 @@ declare function Thumbnail({ src, caption, alt }: {
|
|
|
367
459
|
* so it never breaks the row layout. Like {@link Thumbnail}, it degrades to a
|
|
368
460
|
* plain image outside a `LightboxProvider`.
|
|
369
461
|
*/
|
|
370
|
-
declare function ScreenshotFigure({ src, caption, alt }: {
|
|
462
|
+
declare function ScreenshotFigure({ src, caption, alt, }: {
|
|
371
463
|
src: string;
|
|
372
464
|
caption?: string | undefined;
|
|
373
465
|
alt?: string;
|
|
@@ -402,7 +494,7 @@ declare function LightboxProvider({ children }: {
|
|
|
402
494
|
* Seed the initial open state of every timeline collapsible below this node.
|
|
403
495
|
* Intended for screenshot/test instrumentation only; absent by default.
|
|
404
496
|
*/
|
|
405
|
-
declare function DisclosureDefaultsProvider({ defaultOpen, children }: {
|
|
497
|
+
declare function DisclosureDefaultsProvider({ defaultOpen, children, }: {
|
|
406
498
|
defaultOpen: boolean;
|
|
407
499
|
children: ReactNode;
|
|
408
500
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -422,10 +514,17 @@ type TurnSummaryProps = {
|
|
|
422
514
|
durationMs?: number | undefined;
|
|
423
515
|
/** Start expanded. */
|
|
424
516
|
defaultOpen?: boolean | undefined;
|
|
517
|
+
/**
|
|
518
|
+
* A nested fold — a cluster or sub-turn INSIDE an already-expanded turn. It
|
|
519
|
+
* drops the bordered/filled chip and renders as a plain disclosure node on the
|
|
520
|
+
* parent's rail (chevron + glyph + facets), so expanding a turn reveals a thread
|
|
521
|
+
* of nodes, never a stack of boxes-in-boxes. The top-level fold stays a chip.
|
|
522
|
+
*/
|
|
523
|
+
bare?: boolean | undefined;
|
|
425
524
|
/** The rendered activity rail revealed on expand. */
|
|
426
525
|
children: React.ReactNode;
|
|
427
526
|
};
|
|
428
|
-
declare function TurnSummary({ items, outcome, failureText, durationMs, defaultOpen, children }: TurnSummaryProps): react_jsx_runtime.JSX.Element;
|
|
527
|
+
declare function TurnSummary({ items, outcome, failureText, durationMs, defaultOpen, bare, children, }: TurnSummaryProps): react_jsx_runtime.JSX.Element;
|
|
429
528
|
|
|
430
529
|
/** Recover the exit code from a sandbox exec banner (`Process exited with code N`). */
|
|
431
530
|
declare function sandboxCommandExitCode(out: unknown): number | null;
|
|
@@ -539,13 +638,7 @@ type UseSessionEventsResult = {
|
|
|
539
638
|
declare function useSessionEvents(sessionId: string | null | undefined, options?: UseSessionEventsOptions): UseSessionEventsResult;
|
|
540
639
|
|
|
541
640
|
type ComposerSendExtras = Omit<SendMessageInput, "text" | "clientEventId">;
|
|
542
|
-
|
|
543
|
-
* Compose-time delivery choice. `queue` (the default) stacks the message
|
|
544
|
-
* behind the running turn — visible, editable, reorderable until claimed.
|
|
545
|
-
* `steer` interrupts the running turn and injects the message now.
|
|
546
|
-
*/
|
|
547
|
-
type ComposerMode = "queue" | "steer";
|
|
548
|
-
type UseComposerOptions = ClientOverride & {
|
|
641
|
+
type UseComposerOptions = ClientOverride & SessionEventFeedOptions & {
|
|
549
642
|
/** Called with the accepted text after a successful send. */
|
|
550
643
|
onSent?: ((text: string) => void) | undefined;
|
|
551
644
|
/**
|
|
@@ -554,27 +647,42 @@ type UseComposerOptions = ClientOverride & {
|
|
|
554
647
|
* surrounding UI state (attachment pickers, model selectors, ...).
|
|
555
648
|
*/
|
|
556
649
|
sendExtras?: ComposerSendExtras | (() => ComposerSendExtras) | undefined;
|
|
557
|
-
/**
|
|
558
|
-
|
|
650
|
+
/** Latest server-derived workstream control; bound into Send/Steer OCC. */
|
|
651
|
+
effectiveControl?: EffectiveSessionControl | null | undefined;
|
|
652
|
+
/** Apply durable model/tool/reasoning settings in the host's controlled UI. */
|
|
653
|
+
onDraftApplied?: ((draft: ComposerDraft) => void) | undefined;
|
|
559
654
|
};
|
|
560
655
|
type ComposerState = {
|
|
561
656
|
value: string;
|
|
562
657
|
setValue: (value: string) => void;
|
|
563
|
-
/**
|
|
658
|
+
/** Append the draft behind prompts already visible in the queue. */
|
|
564
659
|
send: (text?: string) => Promise<boolean>;
|
|
660
|
+
/** Supersede current direction with the draft. */
|
|
661
|
+
steer: (text?: string) => Promise<boolean>;
|
|
565
662
|
sending: boolean;
|
|
566
663
|
canSend: boolean;
|
|
567
|
-
/**
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
664
|
+
/** Pause the session without deleting its prompt queue. */
|
|
665
|
+
pause: (reason?: string) => Promise<void>;
|
|
666
|
+
pausing: boolean;
|
|
667
|
+
resume: (reason?: string) => Promise<void>;
|
|
668
|
+
resumeScope: (option: EffectiveControlResumeOption) => Promise<void>;
|
|
669
|
+
resuming: boolean;
|
|
670
|
+
draft: ComposerDraft | null;
|
|
671
|
+
draftRevision: number;
|
|
672
|
+
draftLoading: boolean;
|
|
673
|
+
draftSaving: boolean;
|
|
674
|
+
draftConflict: Error | null;
|
|
675
|
+
/** Apply an atomic queue Edit checkout without a second read. */
|
|
676
|
+
applyDraft: (draft: ComposerDraft) => void;
|
|
677
|
+
reloadDraft: () => Promise<void>;
|
|
678
|
+
resolveDraftConflict: (choice: "keep_mine" | "use_remote") => Promise<void>;
|
|
679
|
+
restoredResources: ResourceRef[];
|
|
680
|
+
removeRestoredResource: (index: number) => void;
|
|
573
681
|
error: Error | null;
|
|
574
682
|
clearError: () => void;
|
|
575
683
|
};
|
|
576
684
|
/**
|
|
577
|
-
* Draft + send +
|
|
685
|
+
* Draft + send + Pause/Resume state for the chat composer — the only
|
|
578
686
|
* human-to-agent input surface. The draft survives a failed send (nothing is
|
|
579
687
|
* more hostile than losing a typed message); each send carries a generated
|
|
580
688
|
* `clientEventId` so retries stay idempotent server-side.
|
|
@@ -591,15 +699,22 @@ declare const FILE_ONLY_MESSAGE_TEXT = "(see attached files)";
|
|
|
591
699
|
* Merge the draft text + idempotency key with caller-provided extras. The
|
|
592
700
|
* text and clientEventId always win over extras. Exported for tests.
|
|
593
701
|
*/
|
|
594
|
-
declare function composeSendInput(text: string, clientEventId: string, extras: ComposerSendExtras | (() => ComposerSendExtras) | undefined): SendMessageInput;
|
|
702
|
+
declare function composeSendInput(text: string, clientEventId: string, extras: ComposerSendExtras | (() => ComposerSendExtras) | undefined, bound?: Partial<SendMessageInput>): SendMessageInput;
|
|
595
703
|
/** Submit on plain Enter; Shift+Enter inserts a newline. Exported for tests. */
|
|
596
704
|
declare function shouldSubmitOnKey(event: {
|
|
597
705
|
key: string;
|
|
598
706
|
shiftKey: boolean;
|
|
707
|
+
metaKey?: boolean;
|
|
708
|
+
ctrlKey?: boolean;
|
|
599
709
|
nativeEvent?: {
|
|
600
710
|
isComposing?: boolean;
|
|
601
711
|
};
|
|
602
712
|
}): boolean;
|
|
713
|
+
/** Cmd/Ctrl+Enter steers; ordinary Enter appends to the queue. */
|
|
714
|
+
declare function shouldSteerOnKey(event: {
|
|
715
|
+
metaKey?: boolean;
|
|
716
|
+
ctrlKey?: boolean;
|
|
717
|
+
}): boolean;
|
|
603
718
|
|
|
604
719
|
type UseFileAttachmentsOptions = ClientOverride & {
|
|
605
720
|
/**
|
|
@@ -659,58 +774,279 @@ type UseFileAttachmentsResult = {
|
|
|
659
774
|
*/
|
|
660
775
|
declare function useFileAttachments(options?: UseFileAttachmentsOptions): UseFileAttachmentsResult;
|
|
661
776
|
|
|
662
|
-
/**
|
|
777
|
+
/** Events that can change the authoritative prompt queue or effective control. */
|
|
663
778
|
declare function isTurnQueueEvent(event: Pick<SessionEvent, "type">): boolean;
|
|
664
|
-
|
|
665
|
-
declare function queueFromTurns(turns: SessionTurn[]): SessionTurn[];
|
|
666
|
-
/** The turn currently holding the session (running or awaiting approval). */
|
|
667
|
-
declare function activeTurnFromTurns(turns: SessionTurn[]): SessionTurn | null;
|
|
668
|
-
/** Optimistic projection of a queued-turn edit. */
|
|
669
|
-
declare function applyTurnEdit(turns: SessionTurn[], turnId: string, update: UpdateSessionTurnRequest): SessionTurn[];
|
|
670
|
-
/**
|
|
671
|
-
* Optimistic projection of a reorder, mirroring the server: the listed
|
|
672
|
-
* queued turns get positions 1..n in the given order; everything else keeps
|
|
673
|
-
* its position.
|
|
674
|
-
*/
|
|
675
|
-
declare function applyTurnReorder(turns: SessionTurn[], turnIds: string[]): SessionTurn[];
|
|
676
|
-
/** Optimistic projection of a queued-turn delete (server marks it cancelled). */
|
|
677
|
-
declare function applyTurnRemoval(turns: SessionTurn[], turnId: string): SessionTurn[];
|
|
779
|
+
type QueueMutationKind = "move" | "edit" | "steer" | "delete";
|
|
678
780
|
type UseTurnQueueOptions = ClientOverride & SessionEventFeedOptions & {
|
|
679
|
-
/** Optional safety-net polling (ms). Off by default — turn.* events drive updates. */
|
|
680
781
|
pollIntervalMs?: number | undefined;
|
|
681
782
|
};
|
|
682
783
|
type UseTurnQueueResult = {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
/** Queued turns in execution order — render this as the editable queue. */
|
|
784
|
+
snapshot: SessionQueueSnapshot | null;
|
|
785
|
+
/** Human/API prompts exactly in server execution order. Never client-sorted. */
|
|
686
786
|
queue: SessionTurn[];
|
|
687
|
-
|
|
688
|
-
activeTurn: SessionTurn | null;
|
|
787
|
+
effectiveControl: EffectiveSessionControl | null;
|
|
689
788
|
loading: boolean;
|
|
690
789
|
error: Error | null;
|
|
691
790
|
refresh: () => Promise<void>;
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
/**
|
|
791
|
+
moveTurn: (turnId: string, beforeTurnId: string | null) => Promise<boolean>;
|
|
792
|
+
/** Atomically withdraw a waiting prompt into the private durable composer draft. */
|
|
793
|
+
editTurn: (turnId: string, options: {
|
|
794
|
+
expectedDraftRevision: number;
|
|
795
|
+
replaceDraft: boolean;
|
|
796
|
+
}) => Promise<ComposerDraft | null>;
|
|
797
|
+
/** Advance the same durable waiting prompt; no duplicate prompt is created. */
|
|
798
|
+
steerTurn: (turnId: string) => Promise<boolean>;
|
|
799
|
+
removeTurn: (turnId: string) => Promise<boolean>;
|
|
800
|
+
pendingByTurn: Readonly<Record<string, QueueMutationKind>>;
|
|
801
|
+
mutationFor: (turnId: string) => QueueMutationKind | null;
|
|
699
802
|
mutating: boolean;
|
|
700
|
-
/** Last failed mutation, until the next mutation or clear. */
|
|
701
803
|
mutationError: Error | null;
|
|
702
804
|
clearMutationError: () => void;
|
|
703
805
|
};
|
|
704
806
|
/**
|
|
705
|
-
* The
|
|
706
|
-
*
|
|
707
|
-
*
|
|
708
|
-
* event stream (`turn.*`), either shared via `options.events` (pass the log
|
|
709
|
-
* from `useSessionEvents` to reuse its connection) or a dedicated tail
|
|
710
|
-
* stream. All mutations apply optimistically and reconcile with the server.
|
|
807
|
+
* The one authoritative human prompt queue. Every mutation carries the exact
|
|
808
|
+
* server versions the operator saw and accepts only monotonic snapshots. A
|
|
809
|
+
* conflict immediately reloads server truth; the client never invents order.
|
|
711
810
|
*/
|
|
712
811
|
declare function useTurnQueue(sessionId: string | null | undefined, options?: UseTurnQueueOptions): UseTurnQueueResult;
|
|
713
812
|
|
|
813
|
+
/** The sole human prompt queue: compact above Goal, Agents, and composer. */
|
|
814
|
+
type QueueSurfaceProps = {
|
|
815
|
+
queue: UseTurnQueueResult;
|
|
816
|
+
composer: ComposerState;
|
|
817
|
+
readOnly?: false | undefined;
|
|
818
|
+
} | {
|
|
819
|
+
queue: UseTurnQueueResult;
|
|
820
|
+
composer?: undefined;
|
|
821
|
+
readOnly: true;
|
|
822
|
+
};
|
|
823
|
+
declare function QueueSurface({ queue, composer, readOnly }: QueueSurfaceProps): react_jsx_runtime.JSX.Element | null;
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* The slash-command registry. A command is a SESSION / OPERATOR control — an
|
|
827
|
+
* action on the session or the UI (clear, compact, pause the goal, show help) —
|
|
828
|
+
* NOT a structured way to talk to the agent. The human↔agent channel stays
|
|
829
|
+
* plain chat; the palette only recognizes a leading "/" and never sends a
|
|
830
|
+
* command to the model.
|
|
831
|
+
*
|
|
832
|
+
* Two kinds, modeled by where the handler does its work:
|
|
833
|
+
* - CLIENT commands touch only the local UI (e.g. /help, /clear-view).
|
|
834
|
+
* - SERVER commands call the API through the SDK (e.g. /clear, /compact,
|
|
835
|
+
* /goal).
|
|
836
|
+
* Both are just `run(args, ctx)`; `ctx` exposes the client for server commands
|
|
837
|
+
* and the UI affordances (notice, openHelp, clearView, confirm) for both.
|
|
838
|
+
*/
|
|
839
|
+
/** A positional argument a command accepts after its name. */
|
|
840
|
+
type SlashArg = {
|
|
841
|
+
name: string;
|
|
842
|
+
/** Enter runs only once every required arg is present; otherwise autocompletes. */
|
|
843
|
+
required?: boolean;
|
|
844
|
+
/** Closed value set (rendered as a hint; validated by the command itself). */
|
|
845
|
+
oneOf?: readonly string[];
|
|
846
|
+
description?: string;
|
|
847
|
+
};
|
|
848
|
+
/** Transient feedback surfaced in the composer (generalized error line). */
|
|
849
|
+
type Notice = {
|
|
850
|
+
tone: "ok" | "error";
|
|
851
|
+
message: string;
|
|
852
|
+
};
|
|
853
|
+
/** Everything a command handler can reach. Assembled by the composer. */
|
|
854
|
+
type CommandContext = {
|
|
855
|
+
/** SDK-shaped client for server commands. */
|
|
856
|
+
client: SessionClientLike;
|
|
857
|
+
workspaceId: string;
|
|
858
|
+
/** Null before a session exists (server commands should guard on this). */
|
|
859
|
+
sessionId: string | null;
|
|
860
|
+
status: SessionStatus$1 | null;
|
|
861
|
+
/** The operator's permissions on this workspace (gates command visibility). */
|
|
862
|
+
permissions: Permission[];
|
|
863
|
+
/** Surface a transient ok/error notice in the composer. */
|
|
864
|
+
notice: (notice: Notice) => void;
|
|
865
|
+
/** Open the in-composer /help panel (rendered from the registry). */
|
|
866
|
+
openHelp: () => void;
|
|
867
|
+
/**
|
|
868
|
+
* Reset only the LOCAL timeline view — no server call. Returns whether a
|
|
869
|
+
* view-reset affordance was actually wired (and thus had an effect): the host
|
|
870
|
+
* surface supplies one via the composer's `onClearView` prop, and consoles
|
|
871
|
+
* that don't (no resettable local timeline) get `false`. The /clear-view
|
|
872
|
+
* command uses this to avoid reporting a false "cleared" success on a no-op.
|
|
873
|
+
*/
|
|
874
|
+
clearView: () => boolean;
|
|
875
|
+
/** Show the danger confirm bar; resolves true once the operator confirms. */
|
|
876
|
+
confirm: () => Promise<boolean>;
|
|
877
|
+
};
|
|
878
|
+
type CommandResult = {
|
|
879
|
+
status: "ok" | "error";
|
|
880
|
+
message?: string;
|
|
881
|
+
/**
|
|
882
|
+
* Keep the composer draft instead of clearing it on an ok result. Used when a
|
|
883
|
+
* command resolves to a no-op the operator may want to retry — e.g. canceling
|
|
884
|
+
* the /clear confirm bar returns ok (no error) but must NOT wipe the typed
|
|
885
|
+
* "/clear" draft. Default false: a successful command clears the draft.
|
|
886
|
+
*/
|
|
887
|
+
keepDraft?: boolean;
|
|
888
|
+
};
|
|
889
|
+
type SlashCommand = {
|
|
890
|
+
/** Primary token after the slash (no leading "/"). */
|
|
891
|
+
name: string;
|
|
892
|
+
/** Alternate tokens that resolve to this command. */
|
|
893
|
+
aliases?: readonly string[];
|
|
894
|
+
description: string;
|
|
895
|
+
args?: readonly SlashArg[];
|
|
896
|
+
/** Required permission; the command is hidden from the palette without it. */
|
|
897
|
+
permission?: Permission;
|
|
898
|
+
/** Destructive — the palette shows a confirm bar before running. */
|
|
899
|
+
danger?: boolean;
|
|
900
|
+
/**
|
|
901
|
+
* Dynamic availability beyond the permission gate (e.g. hide a server command
|
|
902
|
+
* until a session exists). Returning false hides the command.
|
|
903
|
+
*/
|
|
904
|
+
available?: (ctx: Pick<CommandContext, "sessionId" | "status" | "permissions">) => boolean;
|
|
905
|
+
/** Execute the command. Throwing is caught and surfaced as an error notice. */
|
|
906
|
+
run: (args: string[], ctx: CommandContext) => Promise<CommandResult> | CommandResult;
|
|
907
|
+
};
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* Context the composer supplies for command execution and visibility. The
|
|
911
|
+
* composer owns the UI affordances (notice/openHelp/clearView/confirm), so they
|
|
912
|
+
* are NOT part of this slice — the hook closes over them via `handlers`.
|
|
913
|
+
*/
|
|
914
|
+
type SlashCommandContext = Pick<CommandContext, "client" | "workspaceId" | "sessionId" | "status" | "permissions">;
|
|
915
|
+
/**
|
|
916
|
+
* UI affordances the composer supplies. `confirm` differs from the registry-
|
|
917
|
+
* facing {@link CommandContext.confirm} (which takes no args): the composer's
|
|
918
|
+
* confirm receives the command being run so the confirm bar renders from that
|
|
919
|
+
* exact command's identity. The hook bridges the two in {@link buildContext}.
|
|
920
|
+
*/
|
|
921
|
+
type SlashCommandHandlers = Pick<CommandContext, "notice" | "openHelp" | "clearView"> & {
|
|
922
|
+
confirm: (command: SlashCommand) => Promise<boolean>;
|
|
923
|
+
};
|
|
924
|
+
type ConfirmState = {
|
|
925
|
+
command: SlashCommand;
|
|
926
|
+
/** Resolve the pending confirm() promise. */
|
|
927
|
+
resolve: (confirmed: boolean) => void;
|
|
928
|
+
} | null;
|
|
929
|
+
type UseSlashCommandsOptions = {
|
|
930
|
+
commands: readonly SlashCommand[];
|
|
931
|
+
context: SlashCommandContext | undefined;
|
|
932
|
+
handlers: SlashCommandHandlers;
|
|
933
|
+
/** The current composer draft. */
|
|
934
|
+
value: string;
|
|
935
|
+
/** Replace the composer draft (autocomplete writes through this). */
|
|
936
|
+
setValue: (value: string) => void;
|
|
937
|
+
};
|
|
938
|
+
type UseSlashCommandsResult = {
|
|
939
|
+
/** Whether the palette is open (a command token is being typed). */
|
|
940
|
+
open: boolean;
|
|
941
|
+
/**
|
|
942
|
+
* Whether the draft is a slash-command attempt (matches a registered command)
|
|
943
|
+
* — true even after Escape dismisses the popover. The composer blocks its send
|
|
944
|
+
* path while this holds so a command can't be delivered to the agent as chat.
|
|
945
|
+
*/
|
|
946
|
+
isCommandDraft: boolean;
|
|
947
|
+
/** Commands shown for the current token + context, in display order. */
|
|
948
|
+
items: SlashCommand[];
|
|
949
|
+
/** Index into `items` of the highlighted row. */
|
|
950
|
+
highlight: number;
|
|
951
|
+
setHighlight: (index: number) => void;
|
|
952
|
+
/** The matched command once the name is closed by a space (arg-hint mode). */
|
|
953
|
+
activeCommand: SlashCommand | null;
|
|
954
|
+
/** The arg hint string for the active command (footer), or "". */
|
|
955
|
+
activeArgHint: string;
|
|
956
|
+
/**
|
|
957
|
+
* Key handler for the textarea. Returns true when it consumed the event
|
|
958
|
+
* (the composer must then NOT run its send path). Only consumes while open.
|
|
959
|
+
*/
|
|
960
|
+
onKeyDown: (event: KeyboardEvent<HTMLTextAreaElement>) => boolean;
|
|
961
|
+
/** Run the highlighted command (or the active command in arg-hint mode). */
|
|
962
|
+
runHighlighted: () => Promise<void>;
|
|
963
|
+
/**
|
|
964
|
+
* Run the command at an explicitly chosen index (a pointer click on a row).
|
|
965
|
+
* Bypasses the exact-match token heuristic that runHighlighted uses for
|
|
966
|
+
* keyboard Enter, so an explicit click always runs the clicked command.
|
|
967
|
+
*/
|
|
968
|
+
runAt: (index: number) => Promise<void>;
|
|
969
|
+
/** Autocomplete the highlighted command name + a trailing space. */
|
|
970
|
+
autocompleteHighlighted: () => void;
|
|
971
|
+
};
|
|
972
|
+
declare function useSlashCommands(options: UseSlashCommandsOptions): UseSlashCommandsResult;
|
|
973
|
+
|
|
974
|
+
type ChatComposerProps = {
|
|
975
|
+
composer: ComposerState;
|
|
976
|
+
/** Canonical workstream control, separate from lifecycle status. */
|
|
977
|
+
effectiveControl?: EffectiveSessionControl | null | undefined;
|
|
978
|
+
/** Waiting prompts already ahead of a normal Send. */
|
|
979
|
+
queuedAheadCount?: number | undefined;
|
|
980
|
+
/** Whether broader Workspace Resume is authorized for this viewer. */
|
|
981
|
+
canControlWorkspace?: boolean | undefined;
|
|
982
|
+
/** Optional host routes used to navigate from effective Pause blockers. */
|
|
983
|
+
controlLinks?: {
|
|
984
|
+
workspaceHref?: string | undefined;
|
|
985
|
+
sessionHref?: ((sessionId: string) => string) | undefined;
|
|
986
|
+
} | undefined;
|
|
987
|
+
placeholder?: string | undefined;
|
|
988
|
+
disabled?: boolean | undefined;
|
|
989
|
+
autoFocus?: boolean | undefined;
|
|
990
|
+
/** Replaces the default keyboard hint under the field. */
|
|
991
|
+
hint?: string | undefined;
|
|
992
|
+
/** App controls (model picker, attach button, ...) in the footer row, replacing the hint. */
|
|
993
|
+
controlsStart?: ReactNode | undefined;
|
|
994
|
+
/** Content rendered above the textarea, inside the field chrome (e.g. attachment chips). */
|
|
995
|
+
header?: ReactNode | undefined;
|
|
996
|
+
/** Paste hook on the textarea (e.g. paste-image-to-attach). */
|
|
997
|
+
onPaste?: ((event: ClipboardEvent<HTMLTextAreaElement>) => void) | undefined;
|
|
998
|
+
/**
|
|
999
|
+
* Opt-in file attachments. When supplied (e.g. from {@link useFileAttachments}),
|
|
1000
|
+
* the composer renders a built-in attach button (prepended to `controlsStart`),
|
|
1001
|
+
* an attachment-chips strip (above the textarea, before any host `header`),
|
|
1002
|
+
* routes paste through `addFromPaste` (image/* filter lives in the hook), and
|
|
1003
|
+
* gates send while `uploading` so a message never departs without its files.
|
|
1004
|
+
* Absent → no attachment UI renders and the composer behaves exactly as before.
|
|
1005
|
+
*/
|
|
1006
|
+
attachments?: UseFileAttachmentsResult | undefined;
|
|
1007
|
+
/**
|
|
1008
|
+
* Opt-in model picker. When supplied (e.g. from {@link useAvailableModels}),
|
|
1009
|
+
* the composer renders a {@link ModelPicker} at the start of `controlsStart`
|
|
1010
|
+
* so the operator can choose which host-exposed model serves the next message.
|
|
1011
|
+
* The host owns the selection (`selectedModel`/`onSelectModel`) and is
|
|
1012
|
+
* responsible for threading it into the composer's `sendExtras` (typically
|
|
1013
|
+
* `useComposer({ sendExtras: () => ({ model }) })`) so `composeSendInput`
|
|
1014
|
+
* carries it. Absent → no picker renders and the composer behaves as before.
|
|
1015
|
+
*/
|
|
1016
|
+
models?: ClientModel[] | undefined;
|
|
1017
|
+
/** The currently selected model id (the picker's controlled value). */
|
|
1018
|
+
selectedModel?: string | undefined;
|
|
1019
|
+
/** Called with the chosen model id when the operator picks one. */
|
|
1020
|
+
onSelectModel?: ((modelId: string) => void) | undefined;
|
|
1021
|
+
className?: string | undefined;
|
|
1022
|
+
/**
|
|
1023
|
+
* Slash-command palette. Defaults to the built-in {@link defaultCommands};
|
|
1024
|
+
* apps concat their own. Backward-compatible: when `commandContext` is absent
|
|
1025
|
+
* the palette is inert and behavior is identical to before.
|
|
1026
|
+
*/
|
|
1027
|
+
commands?: readonly SlashCommand[] | undefined;
|
|
1028
|
+
/**
|
|
1029
|
+
* Wiring the palette needs to run server commands and gate visibility. The
|
|
1030
|
+
* composer supplies notice/openHelp/clearView/confirm internally.
|
|
1031
|
+
*/
|
|
1032
|
+
commandContext?: SlashCommandContext | undefined;
|
|
1033
|
+
/** Reset the local timeline view (the /clear-view command target). */
|
|
1034
|
+
onClearView?: (() => void) | undefined;
|
|
1035
|
+
};
|
|
1036
|
+
declare const OPEN_WORKSTREAM_CONTROL_EVENT = "opengeni:open-workstream-control";
|
|
1037
|
+
/**
|
|
1038
|
+
* The chat composer — the only human-to-agent input surface. Plain chat in,
|
|
1039
|
+
* everything else is the agent's job. Enter sends, Shift+Enter breaks the
|
|
1040
|
+
* line, and the stop control appears while a turn is running (sending while
|
|
1041
|
+
* running is legitimate steering, so send stays available too).
|
|
1042
|
+
*
|
|
1043
|
+
* Typing a leading "/" opens the slash-command palette — SESSION/OPERATOR
|
|
1044
|
+
* controls (clear, compact, pause goal, help), never a structured channel to
|
|
1045
|
+
* the agent. The palette is purely additive: with no `commandContext` it is
|
|
1046
|
+
* inert and the composer behaves exactly as before.
|
|
1047
|
+
*/
|
|
1048
|
+
declare function ChatComposer({ composer, effectiveControl, queuedAheadCount, canControlWorkspace, controlLinks, placeholder, disabled, autoFocus, hint, controlsStart, header, onPaste, attachments, models, selectedModel, onSelectModel, className, commands, commandContext, onClearView, }: ChatComposerProps): react_jsx_runtime.JSX.Element;
|
|
1049
|
+
|
|
714
1050
|
/** Event types that change the session goal (set/updated/completed/paused/...). */
|
|
715
1051
|
declare function isGoalEvent(event: Pick<SessionEvent, "type">): boolean;
|
|
716
1052
|
type UseGoalOptions = ClientOverride & SessionEventFeedOptions & {
|
|
@@ -731,7 +1067,11 @@ type UseGoalResult = {
|
|
|
731
1067
|
pause: (rationale?: string) => Promise<SessionGoal | null>;
|
|
732
1068
|
/** Resume a paused goal: resets counters and re-arms continuations. */
|
|
733
1069
|
resume: () => Promise<SessionGoal | null>;
|
|
734
|
-
/**
|
|
1070
|
+
/** Clear the session goal; goal-less sessions remain a successful no-op. */
|
|
1071
|
+
clearGoal: () => Promise<void>;
|
|
1072
|
+
/** Alias for `clearGoal`. */
|
|
1073
|
+
deleteGoal: () => Promise<void>;
|
|
1074
|
+
/** True while a pause/resume/clear is in flight. */
|
|
735
1075
|
updating: boolean;
|
|
736
1076
|
mutationError: Error | null;
|
|
737
1077
|
clearMutationError: () => void;
|
|
@@ -746,9 +1086,9 @@ declare function useGoal(sessionId: string | null | undefined, options?: UseGoal
|
|
|
746
1086
|
|
|
747
1087
|
type UseSessionControlOptions = ClientOverride;
|
|
748
1088
|
type UseSessionControlResult = {
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
1089
|
+
pause: (reason?: string) => Promise<SessionControlResponse | null>;
|
|
1090
|
+
resume: (reason?: string) => Promise<SessionControlResponse | null>;
|
|
1091
|
+
controlling: boolean;
|
|
752
1092
|
/** Approve a pending `requires_action` approval. */
|
|
753
1093
|
approve: (approvalId: string, message?: string) => Promise<SessionEvent | null>;
|
|
754
1094
|
/** Reject a pending `requires_action` approval. */
|
|
@@ -759,7 +1099,7 @@ type UseSessionControlResult = {
|
|
|
759
1099
|
clearError: () => void;
|
|
760
1100
|
};
|
|
761
1101
|
/**
|
|
762
|
-
* Session
|
|
1102
|
+
* Session pause/resume and approval decisions. Pair with
|
|
763
1103
|
* `useSessionEvents` (for `session.requiresAction` payloads carrying the
|
|
764
1104
|
* `approvalId`) to render an approval bar.
|
|
765
1105
|
*/
|
|
@@ -781,12 +1121,22 @@ declare function useScheduledTasks(options?: UseScheduledTasksOptions): UseSched
|
|
|
781
1121
|
|
|
782
1122
|
type UseWorkspaceSessionsOptions = ClientOverride & {
|
|
783
1123
|
limit?: number | undefined;
|
|
1124
|
+
parentSessionId?: string | null | undefined;
|
|
1125
|
+
cursor?: string | undefined;
|
|
1126
|
+
search?: string | undefined;
|
|
784
1127
|
/** Refresh interval (ms) for fleet/manager views. Off by default. */
|
|
785
1128
|
pollIntervalMs?: number | undefined;
|
|
786
1129
|
enabled?: boolean | undefined;
|
|
787
1130
|
};
|
|
788
1131
|
type UseWorkspaceSessionsResult = {
|
|
1132
|
+
/**
|
|
1133
|
+
* All visible rows, with pins first. This preserves the pre-pinning hook
|
|
1134
|
+
* contract for consumers that only read `sessions`.
|
|
1135
|
+
*/
|
|
789
1136
|
sessions: Session[];
|
|
1137
|
+
/** The complete personal pinned section, also present in `sessions`. */
|
|
1138
|
+
pinned: Session[];
|
|
1139
|
+
nextCursor: string | null;
|
|
790
1140
|
loading: boolean;
|
|
791
1141
|
error: Error | null;
|
|
792
1142
|
refresh: () => Promise<void>;
|
|
@@ -794,32 +1144,142 @@ type UseWorkspaceSessionsResult = {
|
|
|
794
1144
|
/** List the workspace's sessions — the data behind fleet and manager views. */
|
|
795
1145
|
declare function useWorkspaceSessions(options?: UseWorkspaceSessionsOptions): UseWorkspaceSessionsResult;
|
|
796
1146
|
|
|
797
|
-
type
|
|
1147
|
+
type UseSessionLineageOptions = ClientOverride & {
|
|
1148
|
+
events?: SessionEvent[] | undefined;
|
|
1149
|
+
/** Refresh interval (ms). Off by default. */
|
|
798
1150
|
pollIntervalMs?: number | undefined;
|
|
799
1151
|
enabled?: boolean | undefined;
|
|
800
1152
|
};
|
|
801
|
-
type
|
|
802
|
-
|
|
1153
|
+
type UseSessionLineageResult = {
|
|
1154
|
+
lineage: SessionLineageResponse | null;
|
|
803
1155
|
loading: boolean;
|
|
804
1156
|
error: Error | null;
|
|
805
1157
|
refresh: () => Promise<void>;
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
1158
|
+
};
|
|
1159
|
+
declare function isLineageRefreshEvent(event: SessionEvent): boolean;
|
|
1160
|
+
/** Read the ancestors + descendant tree for one session. Data-only; no UI state. */
|
|
1161
|
+
declare function useSessionLineage(sessionId: string | null | undefined, options?: UseSessionLineageOptions): UseSessionLineageResult;
|
|
1162
|
+
|
|
1163
|
+
type UseVariableSetsOptions = ClientOverride & {
|
|
1164
|
+
pollIntervalMs?: number | undefined;
|
|
1165
|
+
enabled?: boolean | undefined;
|
|
1166
|
+
};
|
|
1167
|
+
type UseVariableSetsResult = {
|
|
1168
|
+
variableSets: VariableSet[];
|
|
1169
|
+
loading: boolean;
|
|
1170
|
+
error: Error | null;
|
|
1171
|
+
refresh: () => Promise<void>;
|
|
1172
|
+
create: (request: CreateVariableSetRequest) => Promise<VariableSet | null>;
|
|
1173
|
+
update: (variableSetId: string, request: UpdateVariableSetRequest) => Promise<VariableSet | null>;
|
|
1174
|
+
remove: (variableSetId: string) => Promise<boolean>;
|
|
809
1175
|
/** Set/rotate a variable. Values are write-only — reads expose metadata only. */
|
|
810
|
-
setVariable: (
|
|
811
|
-
deleteVariable: (
|
|
1176
|
+
setVariable: (variableSetId: string, name: string, value: string) => Promise<VariableSetVariableMetadata | null>;
|
|
1177
|
+
deleteVariable: (variableSetId: string, name: string) => Promise<boolean>;
|
|
812
1178
|
mutating: boolean;
|
|
813
1179
|
mutationError: Error | null;
|
|
814
1180
|
clearMutationError: () => void;
|
|
815
1181
|
};
|
|
816
1182
|
/**
|
|
817
|
-
*
|
|
1183
|
+
* Variable sets (named, encrypted variable sets attached to sessions
|
|
818
1184
|
* and scheduled tasks). Variable values are write-only end to end: this hook
|
|
819
1185
|
* never sees a value after it is sent.
|
|
820
1186
|
*/
|
|
1187
|
+
declare function useVariableSets(options?: UseVariableSetsOptions): UseVariableSetsResult;
|
|
1188
|
+
/** @deprecated use UseVariableSetsOptions */
|
|
1189
|
+
type UseEnvironmentsOptions = UseVariableSetsOptions;
|
|
1190
|
+
/** @deprecated use UseVariableSetsResult */
|
|
1191
|
+
type UseEnvironmentsResult = UseVariableSetsResult & {
|
|
1192
|
+
environments: VariableSet[];
|
|
1193
|
+
};
|
|
1194
|
+
/** @deprecated use useVariableSets */
|
|
821
1195
|
declare function useEnvironments(options?: UseEnvironmentsOptions): UseEnvironmentsResult;
|
|
822
1196
|
|
|
1197
|
+
type UseRigsOptions = ClientOverride & {
|
|
1198
|
+
pollIntervalMs?: number | undefined;
|
|
1199
|
+
enabled?: boolean | undefined;
|
|
1200
|
+
};
|
|
1201
|
+
type UseRigsResult = {
|
|
1202
|
+
rigs: Rig[];
|
|
1203
|
+
loading: boolean;
|
|
1204
|
+
error: Error | null;
|
|
1205
|
+
refresh: () => Promise<void>;
|
|
1206
|
+
create: (request: CreateRigRequest) => Promise<Rig | null>;
|
|
1207
|
+
update: (rigId: string, request: UpdateRigRequest) => Promise<Rig | null>;
|
|
1208
|
+
remove: (rigId: string) => Promise<boolean>;
|
|
1209
|
+
listVersions: (rigId: string) => Promise<RigVersion[] | null>;
|
|
1210
|
+
activateVersion: (rigId: string, versionId: string) => Promise<RigVersion | null>;
|
|
1211
|
+
listChanges: (rigId: string) => Promise<RigChange[] | null>;
|
|
1212
|
+
proposeChange: (rigId: string, request: ProposeRigChangeRequest) => Promise<RigChange | null>;
|
|
1213
|
+
mutating: boolean;
|
|
1214
|
+
mutationError: Error | null;
|
|
1215
|
+
clearMutationError: () => void;
|
|
1216
|
+
};
|
|
1217
|
+
/**
|
|
1218
|
+
* Rigs (workspace-scoped, versioned sandbox machine definitions). The list
|
|
1219
|
+
* polls; version/change reads are on-demand (they are per-rig detail, not part
|
|
1220
|
+
* of the list surface).
|
|
1221
|
+
*/
|
|
1222
|
+
declare function useRigs(options?: UseRigsOptions): UseRigsResult;
|
|
1223
|
+
type UseRigOptions = ClientOverride & {
|
|
1224
|
+
pollIntervalMs?: number | undefined;
|
|
1225
|
+
enabled?: boolean | undefined;
|
|
1226
|
+
};
|
|
1227
|
+
type UseRigResult = {
|
|
1228
|
+
rig: Rig | null;
|
|
1229
|
+
loading: boolean;
|
|
1230
|
+
error: Error | null;
|
|
1231
|
+
refresh: () => Promise<void>;
|
|
1232
|
+
update: (request: UpdateRigRequest) => Promise<Rig | null>;
|
|
1233
|
+
remove: () => Promise<boolean>;
|
|
1234
|
+
activateVersion: (versionId: string) => Promise<RigVersion | null>;
|
|
1235
|
+
proposeChange: (request: ProposeRigChangeRequest) => Promise<RigChange | null>;
|
|
1236
|
+
/** Re-run verification for a change (asynchronous — poll for the outcome). */
|
|
1237
|
+
verifyChange: (changeId: string) => Promise<RigChange | null>;
|
|
1238
|
+
/** Promote a verified definition_edit into a new active version (rigs:manage). */
|
|
1239
|
+
promoteChange: (changeId: string) => Promise<RigVersion | null>;
|
|
1240
|
+
/** Re-verify the active version's checks in a clean throwaway sandbox. */
|
|
1241
|
+
verify: () => Promise<{
|
|
1242
|
+
ok: boolean;
|
|
1243
|
+
versionId: string;
|
|
1244
|
+
} | null>;
|
|
1245
|
+
mutating: boolean;
|
|
1246
|
+
mutationError: Error | null;
|
|
1247
|
+
clearMutationError: () => void;
|
|
1248
|
+
};
|
|
1249
|
+
/**
|
|
1250
|
+
* A single rig (its active version + counts), polled so verification and
|
|
1251
|
+
* promotion state stay live. Owns the rig's write actions; the versions and
|
|
1252
|
+
* changes lists are separate polled reads (`useRigVersions`/`useRigChanges`).
|
|
1253
|
+
*/
|
|
1254
|
+
declare function useRig(rigId: string, options?: UseRigOptions): UseRigResult;
|
|
1255
|
+
type UseRigVersionsOptions = ClientOverride & {
|
|
1256
|
+
pollIntervalMs?: number | undefined;
|
|
1257
|
+
enabled?: boolean | undefined;
|
|
1258
|
+
};
|
|
1259
|
+
type UseRigVersionsResult = {
|
|
1260
|
+
versions: RigVersion[];
|
|
1261
|
+
loading: boolean;
|
|
1262
|
+
error: Error | null;
|
|
1263
|
+
refresh: () => Promise<void>;
|
|
1264
|
+
};
|
|
1265
|
+
/** A rig's append-only version history, newest-first (polled). */
|
|
1266
|
+
declare function useRigVersions(rigId: string, options?: UseRigVersionsOptions): UseRigVersionsResult;
|
|
1267
|
+
type UseRigChangesOptions = ClientOverride & {
|
|
1268
|
+
pollIntervalMs?: number | undefined;
|
|
1269
|
+
enabled?: boolean | undefined;
|
|
1270
|
+
};
|
|
1271
|
+
type UseRigChangesResult = {
|
|
1272
|
+
changes: RigChange[];
|
|
1273
|
+
loading: boolean;
|
|
1274
|
+
error: Error | null;
|
|
1275
|
+
refresh: () => Promise<void>;
|
|
1276
|
+
};
|
|
1277
|
+
/**
|
|
1278
|
+
* A rig's change queue (polled). The default poll cadence lets a change move
|
|
1279
|
+
* through verifying → merged/rejected without a manual refresh.
|
|
1280
|
+
*/
|
|
1281
|
+
declare function useRigChanges(rigId: string, options?: UseRigChangesOptions): UseRigChangesResult;
|
|
1282
|
+
|
|
823
1283
|
type UsePacksOptions = ClientOverride & {
|
|
824
1284
|
pollIntervalMs?: number | undefined;
|
|
825
1285
|
enabled?: boolean | undefined;
|
|
@@ -914,7 +1374,7 @@ type UseAvailableModelsResult = {
|
|
|
914
1374
|
*/
|
|
915
1375
|
declare function useAvailableModels(options?: UseAvailableModelsOptions): UseAvailableModelsResult;
|
|
916
1376
|
|
|
917
|
-
type SessionCapabilitiesState = "idle" | "negotiating" | "ready" | "cold" | "error";
|
|
1377
|
+
type SessionCapabilitiesState = "idle" | "negotiating" | "ready" | "cold" | "on-demand" | "error";
|
|
918
1378
|
type UseSessionCapabilitiesOptions = ClientOverride & {
|
|
919
1379
|
/**
|
|
920
1380
|
* Live event log to fold `stream.url.rotated` from (usually
|
|
@@ -940,15 +1400,18 @@ type UseSessionCapabilitiesOptions = ClientOverride & {
|
|
|
940
1400
|
*/
|
|
941
1401
|
attachTerminal?: boolean | undefined;
|
|
942
1402
|
/**
|
|
943
|
-
* Whether to acquire a viewer holder
|
|
944
|
-
*
|
|
945
|
-
* desktop/terminal (one warm box, one
|
|
946
|
-
* NO un-redacted acknowledgment:
|
|
947
|
-
* Channel-A control plane, not the pixel
|
|
948
|
-
*
|
|
949
|
-
*
|
|
950
|
-
*
|
|
951
|
-
*
|
|
1403
|
+
* Whether to acquire a viewer holder to warm the box for a FILE WRITE — the
|
|
1404
|
+
* wake-on-edit INTENT (a first keystroke in the editor), NOT passive browsing.
|
|
1405
|
+
* Shares the SAME viewer attach as the desktop/terminal (one warm box, one
|
|
1406
|
+
* holder) and — like the terminal — needs NO un-redacted acknowledgment:
|
|
1407
|
+
* reading/writing files is the ordinary Channel-A control plane, not the pixel
|
|
1408
|
+
* plane. It folds NO live URL (files ride the stateless HTTP plane) — it only
|
|
1409
|
+
* refcounts liveness. Unlike desktop/terminal it warms even a COLD box: an edit
|
|
1410
|
+
* legitimately cold-creates (that IS the wake), so the write lands ~100ms warm
|
|
1411
|
+
* instead of paying the ~5s cold resume. Default false. IMPORTANT: merely
|
|
1412
|
+
* opening/reading the Files tab must NOT set this — browsing capture-served
|
|
1413
|
+
* trees/diffs needs no box, and warming one on a cold glance burns box-hours to
|
|
1414
|
+
* serve reads the capture already answers for free.
|
|
952
1415
|
*/
|
|
953
1416
|
attachFiles?: boolean | undefined;
|
|
954
1417
|
/** Hold off negotiating (e.g. the workbench panel is collapsed). Default true. */
|
|
@@ -1204,6 +1667,10 @@ type FileTreeNode = {
|
|
|
1204
1667
|
children?: FileTreeNode[] | undefined;
|
|
1205
1668
|
size?: number | null | undefined;
|
|
1206
1669
|
status?: FileTreeStatus | undefined;
|
|
1670
|
+
/** A residue dir the capture COLLAPSED (node_modules, .git, dist, …): its
|
|
1671
|
+
* contents were never indexed. Cold, expanding it can't list children — the
|
|
1672
|
+
* UI shows an inline "contents on machine" row until the box is warm. */
|
|
1673
|
+
truncated?: boolean | undefined;
|
|
1207
1674
|
};
|
|
1208
1675
|
type UseSandboxFilesOptions = ClientOverride & {
|
|
1209
1676
|
/** Live event log (usually `useSessionEvents().events`) — drives auto-refresh
|
|
@@ -1219,6 +1686,12 @@ type UseSandboxFilesOptions = ClientOverride & {
|
|
|
1219
1686
|
* (with no `fs.changed` event) never re-lists. Passing liveness re-lists when
|
|
1220
1687
|
* the box first becomes warm, so the tree populates as soon as the box is up. */
|
|
1221
1688
|
liveness?: string | undefined;
|
|
1689
|
+
/** The latest turn-end workspace capture (from `useWorkspaceCapture`). When the
|
|
1690
|
+
* box is NOT warm, the tree paints INSTANTLY from this capture's tree index (the
|
|
1691
|
+
* <200ms cold first paint) instead of blocking on a Channel-A list. A warm box
|
|
1692
|
+
* always wins (live path unchanged). On the cold→warm transition the live list
|
|
1693
|
+
* is merged in place — no remount, no flash (dossier §10.4 / §12-A1/D1). */
|
|
1694
|
+
capture?: WorkspaceCaptureManifest | null | undefined;
|
|
1222
1695
|
/** Called when an OPTIMISTIC mutation is reverted because its background
|
|
1223
1696
|
* Channel-A op failed (e.g. a 409 rename collision). The host wires this to a
|
|
1224
1697
|
* toast — the tree silently rolls the node back, the user sees why. */
|
|
@@ -1250,6 +1723,11 @@ type UseSandboxFilesResult = {
|
|
|
1250
1723
|
}) => Promise<void>;
|
|
1251
1724
|
/** Re-list the whole tree from the root. */
|
|
1252
1725
|
refresh: () => Promise<void>;
|
|
1726
|
+
/** Which source the tree is currently served from: the live box, the turn-end
|
|
1727
|
+
* capture (cold/offline), or neither yet. M5's source badge reads this. */
|
|
1728
|
+
source: "live" | "capture" | null;
|
|
1729
|
+
/** When the served capture was taken (ISO), when `source === "capture"`. */
|
|
1730
|
+
capturedAt: string | null;
|
|
1253
1731
|
loading: boolean;
|
|
1254
1732
|
error: Error | null;
|
|
1255
1733
|
};
|
|
@@ -1272,6 +1750,12 @@ type UseSandboxGitOptions = ClientOverride & {
|
|
|
1272
1750
|
staged?: boolean | undefined;
|
|
1273
1751
|
/** Hold off the initial fetch. Default true. */
|
|
1274
1752
|
enabled?: boolean | undefined;
|
|
1753
|
+
/** Lease liveness ("warm" | "draining" | "cold"). When NOT warm, the diff is
|
|
1754
|
+
* served from the capture (cold/offline) instead of a live `gitDiff` RPC. */
|
|
1755
|
+
liveness?: string | undefined;
|
|
1756
|
+
/** The latest turn-end capture (from `useWorkspaceCapture`). Supplies the cold
|
|
1757
|
+
* diff for this repo. A warm box always wins (live `gitDiff` unchanged). */
|
|
1758
|
+
capture?: WorkspaceCaptureManifest | null | undefined;
|
|
1275
1759
|
};
|
|
1276
1760
|
type UseSandboxGitResult = {
|
|
1277
1761
|
/** Working-tree (or staged) diff vs HEAD — the structured hunks the Pierre
|
|
@@ -1283,18 +1767,197 @@ type UseSandboxGitResult = {
|
|
|
1283
1767
|
ahead: number;
|
|
1284
1768
|
behind: number;
|
|
1285
1769
|
refresh: () => Promise<void>;
|
|
1770
|
+
/** Which source the diff is served from: the live box or the turn-end capture. */
|
|
1771
|
+
source: "live" | "capture" | null;
|
|
1772
|
+
/** When the served capture was taken (ISO), when `source === "capture"`. */
|
|
1773
|
+
capturedAt: string | null;
|
|
1286
1774
|
loading: boolean;
|
|
1287
1775
|
error: Error | null;
|
|
1288
1776
|
};
|
|
1289
1777
|
/**
|
|
1290
1778
|
* Project the Git service into the Pierre diff data contract: structured
|
|
1291
1779
|
* `GitFileDiff[]` (per-file hunks with per-line old/new numbers, rename
|
|
1292
|
-
* detection, binary flag, add/del counts) plus branch + ahead/behind.
|
|
1293
|
-
* `git diff` runs in-box (API-direct)
|
|
1294
|
-
*
|
|
1780
|
+
* detection, binary flag, add/del counts) plus branch + ahead/behind. When the
|
|
1781
|
+
* box is warm the `git diff` runs in-box (API-direct); when it is cold/offline the
|
|
1782
|
+
* diff is served from the turn-end capture instead (dossier §10.4). Refreshes on
|
|
1783
|
+
* `git.changed`; reconciles live in place on the cold→warm transition.
|
|
1295
1784
|
*/
|
|
1296
1785
|
declare function useSandboxGit(sessionId: string | null | undefined, options?: UseSandboxGitOptions): UseSandboxGitResult;
|
|
1297
1786
|
|
|
1787
|
+
type UseWorkspaceCaptureOptions = ClientOverride & {
|
|
1788
|
+
/** Live event log (usually `useSessionEvents().events`) — a
|
|
1789
|
+
* `workspace.revision.captured` for a NEWER revision refreshes the manifest. */
|
|
1790
|
+
events?: SessionEvent[] | undefined;
|
|
1791
|
+
/** Hold off the mount fetch (e.g. the workbench panel is collapsed). Default true. */
|
|
1792
|
+
enabled?: boolean | undefined;
|
|
1793
|
+
};
|
|
1794
|
+
type UseWorkspaceCaptureResult = {
|
|
1795
|
+
/** The resolved manifest (tree index + per-repo diffs + file refs), or null when
|
|
1796
|
+
* no capture exists (falls back to the live/wake path — status quo). */
|
|
1797
|
+
capture: WorkspaceCaptureManifest | null;
|
|
1798
|
+
/** The loaded capture's monotonic revision, or null when unavailable. */
|
|
1799
|
+
revision: number | null;
|
|
1800
|
+
/** When the loaded capture was taken (ISO), for the "as of <time>" source badge. */
|
|
1801
|
+
capturedAt: string | null;
|
|
1802
|
+
/** Whether a capture is available at all (the `{available:false}` discriminator). */
|
|
1803
|
+
available: boolean;
|
|
1804
|
+
/** Why the newest durable revision is unavailable. null means no capture has
|
|
1805
|
+
* been attempted yet; a value means capture explicitly failed closed and
|
|
1806
|
+
* consumers must use the live box rather than trust an incomplete snapshot. */
|
|
1807
|
+
degradedReason: WorkspaceCaptureDegradedReason | null;
|
|
1808
|
+
/** The changed-file count from the capture's stats, resolved on the FIRST GET
|
|
1809
|
+
* (from the response's top-level `stats`, before any manifest-URL hop). null
|
|
1810
|
+
* until that first resolve; 0 when no capture exists. This is the pre-paint
|
|
1811
|
+
* "changes exist?" signal the dock uses to pick its default tab with no
|
|
1812
|
+
* embedder events-at-mount contract. */
|
|
1813
|
+
fileCount: number | null;
|
|
1814
|
+
/** A newer revision has been ANNOUNCED than the one currently loaded (a refresh
|
|
1815
|
+
* is in flight or pending). M5's source badge can show a subtle "updating…". */
|
|
1816
|
+
isStale: boolean;
|
|
1817
|
+
loading: boolean;
|
|
1818
|
+
error: Error | null;
|
|
1819
|
+
/** Force a re-fetch of the latest capture. */
|
|
1820
|
+
refresh: () => Promise<void>;
|
|
1821
|
+
};
|
|
1822
|
+
/**
|
|
1823
|
+
* The cold-paint data source: fetch the latest turn-end workspace capture with a
|
|
1824
|
+
* SINGLE api round-trip on mount (no machine, no Channel-A — this is the <200ms
|
|
1825
|
+
* first paint, dossier §10.4/§12-A1). The manifest is served inline in the common
|
|
1826
|
+
* case; a rare >2MB manifest comes back as a short-TTL signed URL we follow.
|
|
1827
|
+
*
|
|
1828
|
+
* Subscribes to the live event log: a `workspace.revision.captured` for a revision
|
|
1829
|
+
* newer than the one loaded triggers a background refresh (stale-while-revalidate).
|
|
1830
|
+
* `{available:false}` is a value, never a crash — consumers fall back to the
|
|
1831
|
+
* live/wake path exactly as before the capture feature existed.
|
|
1832
|
+
*/
|
|
1833
|
+
declare function useWorkspaceCapture(sessionId: string | null | undefined, options?: UseWorkspaceCaptureOptions): UseWorkspaceCaptureResult;
|
|
1834
|
+
|
|
1835
|
+
/**
|
|
1836
|
+
* The wake-on-edit state machine (dossier §3 #5 / §10.4 / §12-C). M3 OWNS this
|
|
1837
|
+
* logic; M5 renders it. States are explicit and exhaustive:
|
|
1838
|
+
*
|
|
1839
|
+
* viewing-cold — cold snapshot open, no local edits (editable, cloud).
|
|
1840
|
+
* buffering — local edits buffered; the box is not warm and no warm is
|
|
1841
|
+
* yet in flight (the host has not attached).
|
|
1842
|
+
* warming — edits buffered; the box is actively coming up (the host
|
|
1843
|
+
* attached a viewer in response to `wantsWarm`).
|
|
1844
|
+
* flushing — the box is warm; the guarded write is in flight.
|
|
1845
|
+
* flushed — the buffer was written to the live box.
|
|
1846
|
+
* conflict — the live file diverged from the captured base between
|
|
1847
|
+
* capture and flush; NO write was issued (C2).
|
|
1848
|
+
* readonly-offline — a self-hosted machine that is offline; read-only, no wake.
|
|
1849
|
+
*/
|
|
1850
|
+
type WorkspaceEditState = "viewing-cold" | "buffering" | "warming" | "flushing" | "flushed" | "conflict" | "readonly-offline";
|
|
1851
|
+
type WorkspaceEditConflict = {
|
|
1852
|
+
path: string;
|
|
1853
|
+
/** The capture-served content the edit was based on. */
|
|
1854
|
+
base: string;
|
|
1855
|
+
/** The live content found on the box at flush time (what would be overwritten). */
|
|
1856
|
+
live: string;
|
|
1857
|
+
};
|
|
1858
|
+
type UseWorkspaceEditOptions = ClientOverride & {
|
|
1859
|
+
/** The file being edited (workspace-relative). null disables the machine. */
|
|
1860
|
+
path?: string | null | undefined;
|
|
1861
|
+
/** The capture-served content loaded into the editor — the flush base (C2). */
|
|
1862
|
+
baseContent?: string | null | undefined;
|
|
1863
|
+
/** `capabilities.liveness` — "warm" | "draining" | "cold". Drives the flush. */
|
|
1864
|
+
liveness?: string | undefined;
|
|
1865
|
+
/** True while the host is actively warming the box (attach in flight, not warm
|
|
1866
|
+
* yet) — lifts `buffering` → `warming`. The host sets this after acting on
|
|
1867
|
+
* `wantsWarm` (e.g. flipping `attachFiles` on `useSessionCapabilities`). */
|
|
1868
|
+
warming?: boolean | undefined;
|
|
1869
|
+
/** A self-hosted machine that is OFFLINE: read-only, no remote wake possible. */
|
|
1870
|
+
offline?: boolean | undefined;
|
|
1871
|
+
/** Called once when the first cold edit needs the box warmed — the host wires
|
|
1872
|
+
* this to its liveness primitive (flip `attachFiles`/`attachViewer`). */
|
|
1873
|
+
onWarmRequested?: (() => void) | undefined;
|
|
1874
|
+
};
|
|
1875
|
+
type UseWorkspaceEditResult = {
|
|
1876
|
+
state: WorkspaceEditState;
|
|
1877
|
+
/** The editor should be read-only (self-hosted offline). */
|
|
1878
|
+
readOnly: boolean;
|
|
1879
|
+
/** The current buffered content (null = no local edit yet). */
|
|
1880
|
+
buffer: string | null;
|
|
1881
|
+
/** The host should warm the box (flip its attach primitive). Latches true from
|
|
1882
|
+
* the first cold edit until the buffer flushes or is discarded. */
|
|
1883
|
+
wantsWarm: boolean;
|
|
1884
|
+
/** Record an edit from the editor (idempotent per identical content). */
|
|
1885
|
+
edit: (content: string) => void;
|
|
1886
|
+
/** The conflict detail when `state === "conflict"`. */
|
|
1887
|
+
conflict: WorkspaceEditConflict | null;
|
|
1888
|
+
/** Flush the buffer regardless of the base guard (the user chose "overwrite"
|
|
1889
|
+
* from the conflict bar). Writes last-writer-wins. */
|
|
1890
|
+
overwrite: () => Promise<void>;
|
|
1891
|
+
/** Drop the local buffer and return to viewing the snapshot. */
|
|
1892
|
+
discard: () => void;
|
|
1893
|
+
error: Error | null;
|
|
1894
|
+
};
|
|
1895
|
+
/**
|
|
1896
|
+
* Cold-editing without a spinner: the editor opens instantly from the capture,
|
|
1897
|
+
* the first keystroke buffers locally AND signals the host to warm the box, and on
|
|
1898
|
+
* warm the buffer flushes IF the live file still matches the captured base — else a
|
|
1899
|
+
* non-blocking conflict is surfaced and nothing is overwritten (dossier §12-C2).
|
|
1900
|
+
*
|
|
1901
|
+
* The base guard compares the live content at flush time against `baseContent`
|
|
1902
|
+
* (the exact bytes the editor loaded). This is equivalent to the sha256 compare
|
|
1903
|
+
* the dossier describes — M1 leaves `baseHash` null, so the loaded content IS the
|
|
1904
|
+
* authoritative base — and avoids async Web Crypto in the render path.
|
|
1905
|
+
*/
|
|
1906
|
+
declare function useWorkspaceEdit(sessionId: string | null | undefined, options?: UseWorkspaceEditOptions): UseWorkspaceEditResult;
|
|
1907
|
+
|
|
1908
|
+
/** The one truthful machine indicator (dossier §3 #10). Honest staleness beats
|
|
1909
|
+
* fake liveness: a cold/asleep box reads "offline — as of <time>", never "live". */
|
|
1910
|
+
type MachineChipState = "live" | "waking" | "offline";
|
|
1911
|
+
type MachineChip = {
|
|
1912
|
+
state: MachineChipState;
|
|
1913
|
+
/** A ready-to-render label ("Live" / "Waking…" / "Offline — as of 3m ago"). */
|
|
1914
|
+
label: string;
|
|
1915
|
+
/** The capture time backing an offline/stale label (ISO), or null. M4 may
|
|
1916
|
+
* reformat this; `label` already embeds a relative form. */
|
|
1917
|
+
asOf: string | null;
|
|
1918
|
+
};
|
|
1919
|
+
type DeriveMachineChipInput = {
|
|
1920
|
+
/** `capabilities.liveness` — "warm" | "draining" | "cold" (or null pre-negotiation). */
|
|
1921
|
+
liveness?: string | null | undefined;
|
|
1922
|
+
/** `useSessionCapabilities().state` — drives the "waking" (negotiating) read. */
|
|
1923
|
+
capabilitiesState?: SessionCapabilitiesState | null | undefined;
|
|
1924
|
+
/** The ACTIVE machine's connection state (from `useMachines`), when known. A
|
|
1925
|
+
* self-hosted machine that is `offline` cannot be remotely woken. */
|
|
1926
|
+
activeMachineState?: MachineState | null | undefined;
|
|
1927
|
+
/** Whether the active sandbox is a user-owned self-hosted machine (no remote wake). */
|
|
1928
|
+
activeIsSelfhosted?: boolean | undefined;
|
|
1929
|
+
/** An interaction (wake-on-edit, terminal focus) is actively warming the box. */
|
|
1930
|
+
wantsWarm?: boolean | undefined;
|
|
1931
|
+
/** The latest capture's `capturedAt` (ISO) — the "as of <time>" backing. */
|
|
1932
|
+
capturedAt?: string | null | undefined;
|
|
1933
|
+
/** Injectable clock for deterministic relative labels (defaults to Date.now). */
|
|
1934
|
+
now?: number | undefined;
|
|
1935
|
+
};
|
|
1936
|
+
/** Compact relative-time for the "as of" label. Pure, no Intl dependency. */
|
|
1937
|
+
declare function formatAsOf(capturedAt: string, now: number): string;
|
|
1938
|
+
/**
|
|
1939
|
+
* Derive the machine-state chip from the live capability/liveness surface, the
|
|
1940
|
+
* active machine's connection state, and the latest capture time. PURE (M4 renders
|
|
1941
|
+
* it; the whole point is a deterministic, testable projection).
|
|
1942
|
+
*
|
|
1943
|
+
* Precedence:
|
|
1944
|
+
* 1. warm/draining lease → **live** (a warm box always wins).
|
|
1945
|
+
* 2. actively warming (negotiating, wake-on-edit, or a reconnecting/enrolling
|
|
1946
|
+
* machine) → **waking**.
|
|
1947
|
+
* 3. everything else (a cold/asleep box, a self-hosted machine that's offline,
|
|
1948
|
+
* an error) → **offline**, labelled "as of <capture time>".
|
|
1949
|
+
*/
|
|
1950
|
+
declare function deriveMachineChip(input: DeriveMachineChipInput): MachineChip;
|
|
1951
|
+
type UseMachineChipOptions = DeriveMachineChipInput;
|
|
1952
|
+
/**
|
|
1953
|
+
* Thin memoized wrapper over `deriveMachineChip` for the dock header (M4). The
|
|
1954
|
+
* dock already runs `useSessionCapabilities` + `useMachines` + `useWorkspace
|
|
1955
|
+
* capture`; it feeds their `liveness` / `state` / active-machine state /
|
|
1956
|
+
* `capturedAt` here. Pass a periodically-updated `now` if you want the relative
|
|
1957
|
+
* "as of" label to tick.
|
|
1958
|
+
*/
|
|
1959
|
+
declare function useMachineChip(input: UseMachineChipOptions): MachineChip;
|
|
1960
|
+
|
|
1298
1961
|
type PendingApproval = {
|
|
1299
1962
|
/** The id to send back via `user.approvalDecision` (`approvalId`). */
|
|
1300
1963
|
id: string;
|
|
@@ -1309,90 +1972,6 @@ declare function approvalsFromRequiresAction(payload: unknown): PendingApproval[
|
|
|
1309
1972
|
/** The approvals still awaiting a decision after replaying `events` in order. */
|
|
1310
1973
|
declare function projectPendingApprovals(events: SessionEvent[]): PendingApproval[];
|
|
1311
1974
|
|
|
1312
|
-
/**
|
|
1313
|
-
* The slash-command registry. A command is a SESSION / OPERATOR control — an
|
|
1314
|
-
* action on the session or the UI (clear, compact, pause the goal, show help) —
|
|
1315
|
-
* NOT a structured way to talk to the agent. The human↔agent channel stays
|
|
1316
|
-
* plain chat; the palette only recognizes a leading "/" and never sends a
|
|
1317
|
-
* command to the model.
|
|
1318
|
-
*
|
|
1319
|
-
* Two kinds, modeled by where the handler does its work:
|
|
1320
|
-
* - CLIENT commands touch only the local UI (e.g. /help, /clear-view).
|
|
1321
|
-
* - SERVER commands call the API through the SDK (e.g. /clear, /compact,
|
|
1322
|
-
* /goal).
|
|
1323
|
-
* Both are just `run(args, ctx)`; `ctx` exposes the client for server commands
|
|
1324
|
-
* and the UI affordances (notice, openHelp, clearView, confirm) for both.
|
|
1325
|
-
*/
|
|
1326
|
-
/** A positional argument a command accepts after its name. */
|
|
1327
|
-
type SlashArg = {
|
|
1328
|
-
name: string;
|
|
1329
|
-
/** Enter runs only once every required arg is present; otherwise autocompletes. */
|
|
1330
|
-
required?: boolean;
|
|
1331
|
-
/** Closed value set (rendered as a hint; validated by the command itself). */
|
|
1332
|
-
oneOf?: readonly string[];
|
|
1333
|
-
description?: string;
|
|
1334
|
-
};
|
|
1335
|
-
/** Transient feedback surfaced in the composer (generalized error line). */
|
|
1336
|
-
type Notice = {
|
|
1337
|
-
tone: "ok" | "error";
|
|
1338
|
-
message: string;
|
|
1339
|
-
};
|
|
1340
|
-
/** Everything a command handler can reach. Assembled by the composer. */
|
|
1341
|
-
type CommandContext = {
|
|
1342
|
-
/** SDK-shaped client for server commands. */
|
|
1343
|
-
client: SessionClientLike;
|
|
1344
|
-
workspaceId: string;
|
|
1345
|
-
/** Null before a session exists (server commands should guard on this). */
|
|
1346
|
-
sessionId: string | null;
|
|
1347
|
-
status: SessionStatus$1 | null;
|
|
1348
|
-
/** The operator's permissions on this workspace (gates command visibility). */
|
|
1349
|
-
permissions: Permission[];
|
|
1350
|
-
/** Surface a transient ok/error notice in the composer. */
|
|
1351
|
-
notice: (notice: Notice) => void;
|
|
1352
|
-
/** Open the in-composer /help panel (rendered from the registry). */
|
|
1353
|
-
openHelp: () => void;
|
|
1354
|
-
/**
|
|
1355
|
-
* Reset only the LOCAL timeline view — no server call. Returns whether a
|
|
1356
|
-
* view-reset affordance was actually wired (and thus had an effect): the host
|
|
1357
|
-
* surface supplies one via the composer's `onClearView` prop, and consoles
|
|
1358
|
-
* that don't (no resettable local timeline) get `false`. The /clear-view
|
|
1359
|
-
* command uses this to avoid reporting a false "cleared" success on a no-op.
|
|
1360
|
-
*/
|
|
1361
|
-
clearView: () => boolean;
|
|
1362
|
-
/** Show the danger confirm bar; resolves true once the operator confirms. */
|
|
1363
|
-
confirm: () => Promise<boolean>;
|
|
1364
|
-
};
|
|
1365
|
-
type CommandResult = {
|
|
1366
|
-
status: "ok" | "error";
|
|
1367
|
-
message?: string;
|
|
1368
|
-
/**
|
|
1369
|
-
* Keep the composer draft instead of clearing it on an ok result. Used when a
|
|
1370
|
-
* command resolves to a no-op the operator may want to retry — e.g. canceling
|
|
1371
|
-
* the /clear confirm bar returns ok (no error) but must NOT wipe the typed
|
|
1372
|
-
* "/clear" draft. Default false: a successful command clears the draft.
|
|
1373
|
-
*/
|
|
1374
|
-
keepDraft?: boolean;
|
|
1375
|
-
};
|
|
1376
|
-
type SlashCommand = {
|
|
1377
|
-
/** Primary token after the slash (no leading "/"). */
|
|
1378
|
-
name: string;
|
|
1379
|
-
/** Alternate tokens that resolve to this command. */
|
|
1380
|
-
aliases?: readonly string[];
|
|
1381
|
-
description: string;
|
|
1382
|
-
args?: readonly SlashArg[];
|
|
1383
|
-
/** Required permission; the command is hidden from the palette without it. */
|
|
1384
|
-
permission?: Permission;
|
|
1385
|
-
/** Destructive — the palette shows a confirm bar before running. */
|
|
1386
|
-
danger?: boolean;
|
|
1387
|
-
/**
|
|
1388
|
-
* Dynamic availability beyond the permission gate (e.g. hide a server command
|
|
1389
|
-
* until a session exists). Returning false hides the command.
|
|
1390
|
-
*/
|
|
1391
|
-
available?: (ctx: Pick<CommandContext, "sessionId" | "status" | "permissions">) => boolean;
|
|
1392
|
-
/** Execute the command. Throwing is caught and surfaced as an error notice. */
|
|
1393
|
-
run: (args: string[], ctx: CommandContext) => Promise<CommandResult> | CommandResult;
|
|
1394
|
-
};
|
|
1395
|
-
|
|
1396
1975
|
/**
|
|
1397
1976
|
* Parse a composer value into a command name + the rest. A command is
|
|
1398
1977
|
* recognized ONLY when the value's first character is "/" (the start token);
|
|
@@ -1432,71 +2011,6 @@ declare function firstMissingRequiredArg(command: SlashCommand, args: string[]):
|
|
|
1432
2011
|
*/
|
|
1433
2012
|
declare const defaultCommands: readonly SlashCommand[];
|
|
1434
2013
|
|
|
1435
|
-
/**
|
|
1436
|
-
* Context the composer supplies for command execution and visibility. The
|
|
1437
|
-
* composer owns the UI affordances (notice/openHelp/clearView/confirm), so they
|
|
1438
|
-
* are NOT part of this slice — the hook closes over them via `handlers`.
|
|
1439
|
-
*/
|
|
1440
|
-
type SlashCommandContext = Pick<CommandContext, "client" | "workspaceId" | "sessionId" | "status" | "permissions">;
|
|
1441
|
-
/**
|
|
1442
|
-
* UI affordances the composer supplies. `confirm` differs from the registry-
|
|
1443
|
-
* facing {@link CommandContext.confirm} (which takes no args): the composer's
|
|
1444
|
-
* confirm receives the command being run so the confirm bar renders from that
|
|
1445
|
-
* exact command's identity. The hook bridges the two in {@link buildContext}.
|
|
1446
|
-
*/
|
|
1447
|
-
type SlashCommandHandlers = Pick<CommandContext, "notice" | "openHelp" | "clearView"> & {
|
|
1448
|
-
confirm: (command: SlashCommand) => Promise<boolean>;
|
|
1449
|
-
};
|
|
1450
|
-
type ConfirmState = {
|
|
1451
|
-
command: SlashCommand;
|
|
1452
|
-
/** Resolve the pending confirm() promise. */
|
|
1453
|
-
resolve: (confirmed: boolean) => void;
|
|
1454
|
-
} | null;
|
|
1455
|
-
type UseSlashCommandsOptions = {
|
|
1456
|
-
commands: readonly SlashCommand[];
|
|
1457
|
-
context: SlashCommandContext | undefined;
|
|
1458
|
-
handlers: SlashCommandHandlers;
|
|
1459
|
-
/** The current composer draft. */
|
|
1460
|
-
value: string;
|
|
1461
|
-
/** Replace the composer draft (autocomplete writes through this). */
|
|
1462
|
-
setValue: (value: string) => void;
|
|
1463
|
-
};
|
|
1464
|
-
type UseSlashCommandsResult = {
|
|
1465
|
-
/** Whether the palette is open (a command token is being typed). */
|
|
1466
|
-
open: boolean;
|
|
1467
|
-
/**
|
|
1468
|
-
* Whether the draft is a slash-command attempt (matches a registered command)
|
|
1469
|
-
* — true even after Escape dismisses the popover. The composer blocks its send
|
|
1470
|
-
* path while this holds so a command can't be delivered to the agent as chat.
|
|
1471
|
-
*/
|
|
1472
|
-
isCommandDraft: boolean;
|
|
1473
|
-
/** Commands shown for the current token + context, in display order. */
|
|
1474
|
-
items: SlashCommand[];
|
|
1475
|
-
/** Index into `items` of the highlighted row. */
|
|
1476
|
-
highlight: number;
|
|
1477
|
-
setHighlight: (index: number) => void;
|
|
1478
|
-
/** The matched command once the name is closed by a space (arg-hint mode). */
|
|
1479
|
-
activeCommand: SlashCommand | null;
|
|
1480
|
-
/** The arg hint string for the active command (footer), or "". */
|
|
1481
|
-
activeArgHint: string;
|
|
1482
|
-
/**
|
|
1483
|
-
* Key handler for the textarea. Returns true when it consumed the event
|
|
1484
|
-
* (the composer must then NOT run its send path). Only consumes while open.
|
|
1485
|
-
*/
|
|
1486
|
-
onKeyDown: (event: KeyboardEvent<HTMLTextAreaElement>) => boolean;
|
|
1487
|
-
/** Run the highlighted command (or the active command in arg-hint mode). */
|
|
1488
|
-
runHighlighted: () => Promise<void>;
|
|
1489
|
-
/**
|
|
1490
|
-
* Run the command at an explicitly chosen index (a pointer click on a row).
|
|
1491
|
-
* Bypasses the exact-match token heuristic that runHighlighted uses for
|
|
1492
|
-
* keyboard Enter, so an explicit click always runs the clicked command.
|
|
1493
|
-
*/
|
|
1494
|
-
runAt: (index: number) => Promise<void>;
|
|
1495
|
-
/** Autocomplete the highlighted command name + a trailing space. */
|
|
1496
|
-
autocompleteHighlighted: () => void;
|
|
1497
|
-
};
|
|
1498
|
-
declare function useSlashCommands(options: UseSlashCommandsOptions): UseSlashCommandsResult;
|
|
1499
|
-
|
|
1500
2014
|
type CommandPaletteProps = {
|
|
1501
2015
|
open: boolean;
|
|
1502
2016
|
items: SlashCommand[];
|
|
@@ -1516,73 +2030,7 @@ type CommandPaletteProps = {
|
|
|
1516
2030
|
* the opengeni#46 design tokens. Full keyboard nav lives in useSlashCommands;
|
|
1517
2031
|
* this component is presentational + aria.
|
|
1518
2032
|
*/
|
|
1519
|
-
declare function CommandPalette({ open, items, highlight, onHighlight, onRun, argHintText, listboxId }: CommandPaletteProps): react_jsx_runtime.JSX.Element;
|
|
1520
|
-
|
|
1521
|
-
type ChatComposerProps = {
|
|
1522
|
-
composer: ComposerState;
|
|
1523
|
-
/** Current session status; shows the stop control while a turn runs. */
|
|
1524
|
-
status?: SessionStatus$1 | null | undefined;
|
|
1525
|
-
placeholder?: string | undefined;
|
|
1526
|
-
disabled?: boolean | undefined;
|
|
1527
|
-
autoFocus?: boolean | undefined;
|
|
1528
|
-
/** Replaces the default keyboard hint under the field. */
|
|
1529
|
-
hint?: string | undefined;
|
|
1530
|
-
/** App controls (model picker, attach button, ...) in the footer row, replacing the hint. */
|
|
1531
|
-
controlsStart?: ReactNode | undefined;
|
|
1532
|
-
/** Content rendered above the textarea, inside the field chrome (e.g. attachment chips). */
|
|
1533
|
-
header?: ReactNode | undefined;
|
|
1534
|
-
/** Paste hook on the textarea (e.g. paste-image-to-attach). */
|
|
1535
|
-
onPaste?: ((event: ClipboardEvent<HTMLTextAreaElement>) => void) | undefined;
|
|
1536
|
-
/**
|
|
1537
|
-
* Opt-in file attachments. When supplied (e.g. from {@link useFileAttachments}),
|
|
1538
|
-
* the composer renders a built-in attach button (prepended to `controlsStart`),
|
|
1539
|
-
* an attachment-chips strip (above the textarea, before any host `header`),
|
|
1540
|
-
* routes paste through `addFromPaste` (image/* filter lives in the hook), and
|
|
1541
|
-
* gates send while `uploading` so a message never departs without its files.
|
|
1542
|
-
* Absent → no attachment UI renders and the composer behaves exactly as before.
|
|
1543
|
-
*/
|
|
1544
|
-
attachments?: UseFileAttachmentsResult | undefined;
|
|
1545
|
-
/**
|
|
1546
|
-
* Opt-in model picker. When supplied (e.g. from {@link useAvailableModels}),
|
|
1547
|
-
* the composer renders a {@link ModelPicker} at the start of `controlsStart`
|
|
1548
|
-
* so the operator can choose which host-exposed model serves the next message.
|
|
1549
|
-
* The host owns the selection (`selectedModel`/`onSelectModel`) and is
|
|
1550
|
-
* responsible for threading it into the composer's `sendExtras` (typically
|
|
1551
|
-
* `useComposer({ sendExtras: () => ({ model }) })`) so `composeSendInput`
|
|
1552
|
-
* carries it. Absent → no picker renders and the composer behaves as before.
|
|
1553
|
-
*/
|
|
1554
|
-
models?: ClientModel[] | undefined;
|
|
1555
|
-
/** The currently selected model id (the picker's controlled value). */
|
|
1556
|
-
selectedModel?: string | undefined;
|
|
1557
|
-
/** Called with the chosen model id when the operator picks one. */
|
|
1558
|
-
onSelectModel?: ((modelId: string) => void) | undefined;
|
|
1559
|
-
className?: string | undefined;
|
|
1560
|
-
/**
|
|
1561
|
-
* Slash-command palette. Defaults to the built-in {@link defaultCommands};
|
|
1562
|
-
* apps concat their own. Backward-compatible: when `commandContext` is absent
|
|
1563
|
-
* the palette is inert and behavior is identical to before.
|
|
1564
|
-
*/
|
|
1565
|
-
commands?: readonly SlashCommand[] | undefined;
|
|
1566
|
-
/**
|
|
1567
|
-
* Wiring the palette needs to run server commands and gate visibility. The
|
|
1568
|
-
* composer supplies notice/openHelp/clearView/confirm internally.
|
|
1569
|
-
*/
|
|
1570
|
-
commandContext?: SlashCommandContext | undefined;
|
|
1571
|
-
/** Reset the local timeline view (the /clear-view command target). */
|
|
1572
|
-
onClearView?: (() => void) | undefined;
|
|
1573
|
-
};
|
|
1574
|
-
/**
|
|
1575
|
-
* The chat composer — the only human-to-agent input surface. Plain chat in,
|
|
1576
|
-
* everything else is the agent's job. Enter sends, Shift+Enter breaks the
|
|
1577
|
-
* line, and the stop control appears while a turn is running (sending while
|
|
1578
|
-
* running is legitimate steering, so send stays available too).
|
|
1579
|
-
*
|
|
1580
|
-
* Typing a leading "/" opens the slash-command palette — SESSION/OPERATOR
|
|
1581
|
-
* controls (clear, compact, pause goal, help), never a structured channel to
|
|
1582
|
-
* the agent. The palette is purely additive: with no `commandContext` it is
|
|
1583
|
-
* inert and the composer behaves exactly as before.
|
|
1584
|
-
*/
|
|
1585
|
-
declare function ChatComposer({ composer, status, placeholder, disabled, autoFocus, hint, controlsStart, header, onPaste, attachments, models, selectedModel, onSelectModel, className, commands, commandContext, onClearView, }: ChatComposerProps): react_jsx_runtime.JSX.Element;
|
|
2033
|
+
declare function CommandPalette({ open, items, highlight, onHighlight, onRun, argHintText, listboxId, }: CommandPaletteProps): react_jsx_runtime.JSX.Element;
|
|
1586
2034
|
|
|
1587
2035
|
type ModelPickerProps = {
|
|
1588
2036
|
/** The host-exposed models to choose from (typically {@link useAvailableModels}). */
|
|
@@ -1618,6 +2066,31 @@ type MessageTimelineProps = {
|
|
|
1618
2066
|
renderMessageText?: ((text: string, item: AgentMessageItem | UserMessageItem) => ReactNode) | undefined;
|
|
1619
2067
|
/** Drill into a spawned worker session. */
|
|
1620
2068
|
onOpenSession?: ((sessionId: string) => void) | undefined;
|
|
2069
|
+
/**
|
|
2070
|
+
* Deep-link a memory row (a `memory.saved` / `memory.corrected` step) to its
|
|
2071
|
+
* record in the host's memory pane. Opt-in, exactly like `onReconnect`: the
|
|
2072
|
+
* library draws no "View in memory" affordance without a handler — the memory
|
|
2073
|
+
* row is then non-interactive rich content. This is the switch that makes the
|
|
2074
|
+
* deep-link a first-party OpenGeni capability without other SDK consumers
|
|
2075
|
+
* opting into it. The app supplies it (it owns routing to the memory pane).
|
|
2076
|
+
*/
|
|
2077
|
+
onMemoryClick?: ((memoryId: string) => void) | undefined;
|
|
2078
|
+
/**
|
|
2079
|
+
* Start the reconnect flow when a tool needs its connection reauthorized. The
|
|
2080
|
+
* app supplies this (it owns the SDK client + workspace): it typically kicks
|
|
2081
|
+
* off `startConnectionOAuth` and redirects, or routes to credential entry.
|
|
2082
|
+
* Rejecting surfaces a calm inline error on the card; the library never draws
|
|
2083
|
+
* a Reconnect button without a handler to run it.
|
|
2084
|
+
*/
|
|
2085
|
+
onReconnect?: ((item: AuthNeededItem) => void | Promise<void>) | undefined;
|
|
2086
|
+
/**
|
|
2087
|
+
* Resolve a provider domain (from a reconnect card) to a logo URL the host
|
|
2088
|
+
* serves itself — the app maps it through its catalog + `catalogAssetUrl`.
|
|
2089
|
+
* Return null/undefined to fall back to a calm monogram. The library never
|
|
2090
|
+
* fetches an off-origin favicon (CSP + privacy); an unresolved logo is a
|
|
2091
|
+
* monogram, not an external image.
|
|
2092
|
+
*/
|
|
2093
|
+
resolveProviderLogo?: ((providerDomain: string) => string | null | undefined) | undefined;
|
|
1621
2094
|
/**
|
|
1622
2095
|
* The tool-renderer registry that resolves how each tool call is drawn.
|
|
1623
2096
|
* Defaults to {@link defaultToolRegistry}; pass a registry from
|
|
@@ -1641,15 +2114,18 @@ type MessageTimelineProps = {
|
|
|
1641
2114
|
* cards, goal markers, and status transitions. Owns stick-to-bottom scrolling
|
|
1642
2115
|
* with a "jump to latest" affordance when the reader scrolls back.
|
|
1643
2116
|
*/
|
|
1644
|
-
declare function MessageTimeline({ events, items, status, renderMessageText, onOpenSession, toolRegistry, autoFollow, hasOlder, loadingOlder, onLoadOlder, emptyState, className, }: MessageTimelineProps): react_jsx_runtime.JSX.Element;
|
|
2117
|
+
declare function MessageTimeline({ events, items, status, renderMessageText, onOpenSession, onMemoryClick, onReconnect, resolveProviderLogo, toolRegistry, autoFollow, hasOlder, loadingOlder, onLoadOlder, emptyState, className, }: MessageTimelineProps): react_jsx_runtime.JSX.Element;
|
|
1645
2118
|
/**
|
|
1646
2119
|
* Render one non-activity timeline item (chat message, status divider, goal
|
|
1647
2120
|
* landmark, notice). Exported so the component demo draws the EXACT same rows as
|
|
1648
2121
|
* the live app — no forked bubble/goal markup.
|
|
1649
2122
|
*/
|
|
1650
|
-
declare function TimelineRow({ item, renderMessageText, }: {
|
|
2123
|
+
declare function TimelineRow({ item, renderMessageText, onReconnect, resolveProviderLogo, onOpenSession, }: {
|
|
1651
2124
|
item: TimelineItem;
|
|
1652
2125
|
renderMessageText?: ((text: string, item: AgentMessageItem | UserMessageItem) => ReactNode) | undefined;
|
|
2126
|
+
onReconnect?: ((item: AuthNeededItem) => void | Promise<void>) | undefined;
|
|
2127
|
+
resolveProviderLogo?: ((providerDomain: string) => string | null | undefined) | undefined;
|
|
2128
|
+
onOpenSession?: ((sessionId: string) => void) | undefined;
|
|
1653
2129
|
}): react_jsx_runtime.JSX.Element | null;
|
|
1654
2130
|
|
|
1655
2131
|
/**
|
|
@@ -1717,13 +2193,37 @@ declare function sessionDisplayTitle(session: Session): string;
|
|
|
1717
2193
|
*/
|
|
1718
2194
|
declare function FleetTile({ session, title, subtitle, onOpen, className }: FleetTileProps): react_jsx_runtime.JSX.Element;
|
|
1719
2195
|
|
|
1720
|
-
|
|
2196
|
+
type RendererTier = "webgl" | "canvas" | "dom";
|
|
2197
|
+
|
|
2198
|
+
/**
|
|
2199
|
+
* A COMPLETE xterm `ITheme` (subset by intent, but every field xterm colors a
|
|
2200
|
+
* cell with is present so it never falls back to its stock VGA palette). Built
|
|
2201
|
+
* from the og tokens via `xtermThemeFromTokens`.
|
|
2202
|
+
*/
|
|
1721
2203
|
type XtermTheme = {
|
|
1722
2204
|
background?: string;
|
|
1723
2205
|
foreground?: string;
|
|
1724
2206
|
cursor?: string;
|
|
1725
2207
|
cursorAccent?: string;
|
|
1726
2208
|
selectionBackground?: string;
|
|
2209
|
+
selectionForeground?: string;
|
|
2210
|
+
selectionInactiveBackground?: string;
|
|
2211
|
+
black?: string;
|
|
2212
|
+
red?: string;
|
|
2213
|
+
green?: string;
|
|
2214
|
+
yellow?: string;
|
|
2215
|
+
blue?: string;
|
|
2216
|
+
magenta?: string;
|
|
2217
|
+
cyan?: string;
|
|
2218
|
+
white?: string;
|
|
2219
|
+
brightBlack?: string;
|
|
2220
|
+
brightRed?: string;
|
|
2221
|
+
brightGreen?: string;
|
|
2222
|
+
brightYellow?: string;
|
|
2223
|
+
brightBlue?: string;
|
|
2224
|
+
brightMagenta?: string;
|
|
2225
|
+
brightCyan?: string;
|
|
2226
|
+
brightWhite?: string;
|
|
1727
2227
|
};
|
|
1728
2228
|
type SandboxTerminalProps = {
|
|
1729
2229
|
/** From `useSandboxTerminal(...)`. */
|
|
@@ -1738,9 +2238,21 @@ type SandboxTerminalProps = {
|
|
|
1738
2238
|
* (`result.chunks`). Omit to force the legacy firehose-only behavior.
|
|
1739
2239
|
*/
|
|
1740
2240
|
terminalCapability?: TerminalCapability | null | undefined;
|
|
2241
|
+
/**
|
|
2242
|
+
* Full xterm theme. When omitted the terminal self-derives it from the `--og-*`
|
|
2243
|
+
* tokens of its own container (correct even inside a nested `data-og-theme`
|
|
2244
|
+
* subtree). Passing it lets the host drive re-theme on a theme flip.
|
|
2245
|
+
*/
|
|
1741
2246
|
theme?: XtermTheme | undefined;
|
|
1742
2247
|
fontFamily?: string | undefined;
|
|
1743
2248
|
fontSize?: number | undefined;
|
|
2249
|
+
/**
|
|
2250
|
+
* Lease liveness (`cold` | `warming` | `warm` | `draining`). Drives the
|
|
2251
|
+
* boot-in-terminal status lines: once the user has focused the terminal and
|
|
2252
|
+
* the box is not yet warm, a styled "● waking machine — Ns…" line is rendered
|
|
2253
|
+
* INSIDE xterm (no overlay/spinner) until the live PTY connects.
|
|
2254
|
+
*/
|
|
2255
|
+
liveness?: string | undefined;
|
|
1744
2256
|
/**
|
|
1745
2257
|
* Force read-only even when the PTY accepts stdin. Default: interactive
|
|
1746
2258
|
* whenever a live pty-ws stream is connected OR `result.write !== null` (the box
|
|
@@ -1763,19 +2275,44 @@ type SandboxTerminalProps = {
|
|
|
1763
2275
|
onActivate?: (() => void) | undefined;
|
|
1764
2276
|
className?: string | undefined;
|
|
1765
2277
|
};
|
|
2278
|
+
/** Debug seam (dev/evidence only, never a typed public API): a global hook the
|
|
2279
|
+
* screenshot harness reads to probe the settled renderer tier + resolved font
|
|
2280
|
+
* without mounting a real WebGL context in unit tests. */
|
|
2281
|
+
type TerminalDebugInfo = {
|
|
2282
|
+
renderer: RendererTier | null;
|
|
2283
|
+
fontFamily: string | undefined;
|
|
2284
|
+
fontSize: number | undefined;
|
|
2285
|
+
hasVarInFont: boolean;
|
|
2286
|
+
theme: XtermTheme | undefined;
|
|
2287
|
+
/** The live xterm instance (opaque) — the evidence harness reads its buffer to
|
|
2288
|
+
* prove screen preservation (E5) and drive the burst-responsiveness probe. */
|
|
2289
|
+
term: unknown;
|
|
2290
|
+
};
|
|
2291
|
+
declare global {
|
|
2292
|
+
var __OG_TERMINAL_DEBUG__: ((info: TerminalDebugInfo) => void) | undefined;
|
|
2293
|
+
var __OG_FORCE_RENDERER_FAIL__: string | undefined;
|
|
2294
|
+
}
|
|
1766
2295
|
/**
|
|
1767
2296
|
* An xterm.js terminal fed by the Channel-A event projection
|
|
1768
|
-
* (`useSandboxTerminal`)
|
|
2297
|
+
* (`useSandboxTerminal`) or a live ttyd PTY. xterm + its addons are lazy-imported
|
|
1769
2298
|
* inside an effect, so SSR renders the placeholder and the terminal mounts on
|
|
1770
|
-
* hydration.
|
|
1771
|
-
*
|
|
1772
|
-
*
|
|
2299
|
+
* hydration.
|
|
2300
|
+
*
|
|
2301
|
+
* Renderer: WebGL (GPU-composited cells) with a canvas → DOM fallback ladder
|
|
2302
|
+
* (`attachRenderer`), so bursty output stays smooth but a lost/blocklisted
|
|
2303
|
+
* context degrades gracefully. Font + theme are resolved to CONCRETE values
|
|
2304
|
+
* from the og tokens BEFORE construction (xterm measures glyphs in a canvas
|
|
2305
|
+
* where `var()` never resolves, and colors every cell from a full ANSI palette).
|
|
2306
|
+
*
|
|
2307
|
+
* The terminal is mounted ONCE and its data source is swapped in place: the
|
|
2308
|
+
* read-only firehose (`result.chunks`) → the live PTY. Stdin is toggled via
|
|
2309
|
+
* `term.options.disableStdin` at runtime (not a remount), so scrollback and the
|
|
2310
|
+
* visible screen survive the projection→PTY handoff.
|
|
1773
2311
|
*
|
|
1774
2312
|
* Resizes are tracked with a `ResizeObserver` on the container (not just
|
|
1775
|
-
* `window.resize`) so dragging the dock handle refits the grid
|
|
1776
|
-
* leaving the terminal mis-sized.
|
|
2313
|
+
* `window.resize`) so dragging the dock handle refits the grid.
|
|
1777
2314
|
*/
|
|
1778
|
-
declare function SandboxTerminal({ result, terminalCapability, theme, fontFamily, fontSize, readOnly, placeholder, showHeader, shell, onActivate, className, }: SandboxTerminalProps): react_jsx_runtime.JSX.Element;
|
|
2315
|
+
declare function SandboxTerminal({ result, terminalCapability, theme, fontFamily, fontSize, liveness, readOnly, placeholder, showHeader, shell, onActivate, className, }: SandboxTerminalProps): react_jsx_runtime.JSX.Element;
|
|
1779
2316
|
|
|
1780
2317
|
type FileBrowserProps = {
|
|
1781
2318
|
/** From `useSandboxFiles(...)`. */
|
|
@@ -1822,35 +2359,42 @@ type FileBrowserProps = {
|
|
|
1822
2359
|
*/
|
|
1823
2360
|
declare function FileBrowser({ result, fallback, onSelectFile, selectedPath, renderNode, emptyState, editable, confirmDelete, className, }: FileBrowserProps): react_jsx_runtime.JSX.Element;
|
|
1824
2361
|
|
|
1825
|
-
/**
|
|
2362
|
+
/**
|
|
2363
|
+
* @deprecated Use {@link PierreDiff} directly. Retained only as a thin,
|
|
2364
|
+
* back-compat alias that renders the Pierre (Shiki) renderer with a plain-text
|
|
2365
|
+
* degrade. The old hand-rolled hunk renderer was removed in Workbench v2 — the
|
|
2366
|
+
* workbench keeps exactly ONE diff renderer. This alias is removed next major.
|
|
2367
|
+
*/
|
|
1826
2368
|
type DiffTheme = {
|
|
1827
2369
|
addBackground?: string;
|
|
1828
2370
|
delBackground?: string;
|
|
1829
2371
|
contextBackground?: string;
|
|
1830
2372
|
metaForeground?: string;
|
|
1831
2373
|
};
|
|
2374
|
+
/**
|
|
2375
|
+
* @deprecated Use {@link PierreDiff}. `theme`/`onSelectFile`/`emptyState` from the
|
|
2376
|
+
* removed hand-rolled renderer are accepted for source compatibility and ignored;
|
|
2377
|
+
* `fallback` still overrides the plain-text degrade.
|
|
2378
|
+
*/
|
|
1832
2379
|
type DiffViewProps = {
|
|
1833
|
-
/** From `useSandboxGit().diff` — the structured per-file hunks. */
|
|
1834
2380
|
diff: GitFileDiff[];
|
|
1835
|
-
/** Rendered instead of the built-in diff (the Pierre-swap escape hatch). */
|
|
1836
2381
|
fallback?: ReactNode | undefined;
|
|
1837
|
-
/** unified | split. Default "unified". */
|
|
1838
2382
|
layout?: "unified" | "split" | undefined;
|
|
2383
|
+
themeType?: "dark" | "light" | undefined;
|
|
2384
|
+
/** @deprecated line-background theming was part of the removed renderer. */
|
|
1839
2385
|
theme?: DiffTheme | undefined;
|
|
2386
|
+
/** @deprecated the alias no longer renders a clickable file header. */
|
|
1840
2387
|
onSelectFile?: ((path: string) => void) | undefined;
|
|
1841
|
-
/** Distinguishes "no changes" from "no repository mounted". */
|
|
1842
2388
|
isRepo?: boolean | undefined;
|
|
1843
2389
|
emptyState?: ReactNode | undefined;
|
|
1844
2390
|
className?: string | undefined;
|
|
1845
2391
|
};
|
|
1846
2392
|
/**
|
|
1847
|
-
*
|
|
1848
|
-
*
|
|
1849
|
-
*
|
|
1850
|
-
* consumer with Pierre's `@pierre/diffs` installed can swap it via `fallback`
|
|
1851
|
-
* while keeping the same `GitFileDiff[]` data contract from the hook.
|
|
2393
|
+
* @deprecated Use {@link PierreDiff} directly. Thin alias: renders `PierreDiff`
|
|
2394
|
+
* (Shiki-highlighted, unified/split) with a plain-text fallback for a host
|
|
2395
|
+
* without `@pierre/diffs`. Removed next major.
|
|
1852
2396
|
*/
|
|
1853
|
-
declare function DiffView({ diff, fallback, layout,
|
|
2397
|
+
declare function DiffView({ diff, fallback, layout, themeType, isRepo, emptyState, className, }: DiffViewProps): react_jsx_runtime.JSX.Element;
|
|
1854
2398
|
|
|
1855
2399
|
type PierreDiffProps = {
|
|
1856
2400
|
diff: GitFileDiff[];
|
|
@@ -1867,15 +2411,23 @@ type PierreDiffProps = {
|
|
|
1867
2411
|
loading?: ReactNode | undefined;
|
|
1868
2412
|
/** Rendered if `@pierre/diffs/react` is not installed / fails to import. */
|
|
1869
2413
|
fallback?: ReactNode | undefined;
|
|
2414
|
+
/** Skip the Shiki renderer entirely and show the plain-text degrade (the old
|
|
2415
|
+
* `usePierre={false}` path — one renderer, opted out of highlighting). */
|
|
2416
|
+
plain?: boolean | undefined;
|
|
2417
|
+
/** Long-line handling: `"wrap"` soft-wraps (the default — a diff in a narrow
|
|
2418
|
+
* dock pane should be readable without a horizontal-scroll tax), `"scroll"`
|
|
2419
|
+
* keeps lines on one row behind a horizontal scrollbar (better for a wide
|
|
2420
|
+
* viewport or pathological minified lines). */
|
|
2421
|
+
overflow?: "wrap" | "scroll" | undefined;
|
|
1870
2422
|
className?: string | undefined;
|
|
1871
2423
|
};
|
|
1872
2424
|
/**
|
|
1873
2425
|
* The Pierre-backed diff: Shiki-highlighted, virtualized, unified/split. Renders
|
|
1874
2426
|
* one `PatchDiff` per changed file (a reconstructed unified patch from the
|
|
1875
|
-
* `GitFileDiff` hunks).
|
|
1876
|
-
*
|
|
2427
|
+
* `GitFileDiff` hunks). The ONE workbench diff renderer; a host without
|
|
2428
|
+
* `@pierre/diffs` gets the built-in plain-text degrade (`PlainPatch`).
|
|
1877
2429
|
*/
|
|
1878
|
-
declare function PierreDiff({ diff, layout, themeType, theme, disableWorkerPool, loading, fallback, className, }: PierreDiffProps): react_jsx_runtime.JSX.Element;
|
|
2430
|
+
declare function PierreDiff({ diff, layout, themeType, theme, disableWorkerPool, loading, fallback, plain, overflow, className, }: PierreDiffProps): react_jsx_runtime.JSX.Element;
|
|
1879
2431
|
|
|
1880
2432
|
type PierreFileProps = {
|
|
1881
2433
|
/** Workspace-relative path (used for the header + language inference). */
|
|
@@ -1915,6 +2467,10 @@ type CodeEditorProps = {
|
|
|
1915
2467
|
initialContents: string;
|
|
1916
2468
|
/** Persist the current buffer. Resolves when the write lands; rejects to surface an error. */
|
|
1917
2469
|
onSave: (contents: string) => Promise<unknown>;
|
|
2470
|
+
/** Fired once when the buffer FIRST diverges from its baseline (the first real
|
|
2471
|
+
* keystroke) — the wake-on-edit intent. The host warms the box on this so the
|
|
2472
|
+
* eventual save lands fast; merely opening the file for reading never fires it. */
|
|
2473
|
+
onEditIntent?: (() => void) | undefined;
|
|
1918
2474
|
/** Read-only mode (e.g. a truncated/too-large file shown for reference only). */
|
|
1919
2475
|
readOnly?: boolean | undefined;
|
|
1920
2476
|
themeType?: "dark" | "light" | undefined;
|
|
@@ -1936,33 +2492,46 @@ type CodeEditorProps = {
|
|
|
1936
2492
|
* `readOnly` suppresses every mutation path so a truncated/binary file can never
|
|
1937
2493
|
* be saved back (which would corrupt it by writing the truncated prefix).
|
|
1938
2494
|
*/
|
|
1939
|
-
declare function CodeEditor({ path, initialContents, onSave, readOnly, themeType, loading, fallback, className, }: CodeEditorProps): react_jsx_runtime.JSX.Element;
|
|
2495
|
+
declare function CodeEditor({ path, initialContents, onSave, onEditIntent, readOnly, themeType, loading, fallback, className, }: CodeEditorProps): react_jsx_runtime.JSX.Element;
|
|
1940
2496
|
|
|
1941
2497
|
type SandboxFilesProps = {
|
|
1942
2498
|
/** From `useSandboxFiles(...)`. */
|
|
1943
2499
|
files: UseSandboxFilesResult;
|
|
1944
|
-
/** From `useSandboxGit(...)` — the
|
|
2500
|
+
/** From `useSandboxGit(...)` — drives the branch/dirty header only. */
|
|
1945
2501
|
git: UseSandboxGitResult;
|
|
1946
|
-
/**
|
|
2502
|
+
/** @deprecated Diffs live in the dedicated Changes tab now; accepted for
|
|
2503
|
+
* source-compat but unused (the Files surface is a browser + viewer). */
|
|
1947
2504
|
stagedGit?: UseSandboxGitResult | undefined;
|
|
1948
2505
|
/** Whether a FileSystem surface is advertised (drives the unavailable notice). */
|
|
1949
2506
|
fileSystemAvailable?: boolean | undefined;
|
|
1950
|
-
/** Use Pierre's Shiki
|
|
2507
|
+
/** Use Pierre's Shiki highlighter for the viewer (default true; plain fallback). */
|
|
1951
2508
|
usePierre?: boolean | undefined;
|
|
1952
2509
|
/** Allow in-place editing of tree files (CodeMirror). Default true. When false
|
|
1953
2510
|
* the surface is review-only: every text file opens in the read-only viewer. */
|
|
1954
2511
|
editable?: boolean | undefined;
|
|
2512
|
+
/** Fired once when the user first edits an open file (wake-on-edit intent). The
|
|
2513
|
+
* dock warms the box on this so the save lands fast; opening/reading never fires
|
|
2514
|
+
* it. Browsing the tree/diff must not warm a box. */
|
|
2515
|
+
onEditIntent?: (() => void) | undefined;
|
|
2516
|
+
/** A guarded diff path routed here by the parent workspace. */
|
|
2517
|
+
requestedPath?: string | undefined;
|
|
2518
|
+
/** Identity for one guarded-file request. Increment this when the same path is
|
|
2519
|
+
* deliberately requested again; it also lets a pending request be consumed
|
|
2520
|
+
* without overriding later manual tree navigation. Defaults to the path. */
|
|
2521
|
+
requestedPathRequestId?: string | number | undefined;
|
|
2522
|
+
/** False while the parent is waking a cold sandbox for `requestedPath`. */
|
|
2523
|
+
requestedPathReady?: boolean | undefined;
|
|
1955
2524
|
themeType?: "dark" | "light" | undefined;
|
|
1956
2525
|
className?: string | undefined;
|
|
1957
2526
|
};
|
|
1958
2527
|
/**
|
|
1959
|
-
* The
|
|
1960
|
-
*
|
|
1961
|
-
*
|
|
1962
|
-
*
|
|
1963
|
-
*
|
|
2528
|
+
* The Files surface: a branch/dirty header, the full lazy file tree, and a
|
|
2529
|
+
* viewer/editor pane for the selected file. This is the workspace BROWSER — pick
|
|
2530
|
+
* a file to read or edit it. Diff review lives in the dedicated Changes tab (this
|
|
2531
|
+
* surface deliberately does NOT replicate the changed-files list, and does not
|
|
2532
|
+
* diff here — one job per tab). The agent commits; the human reviews.
|
|
1964
2533
|
*/
|
|
1965
|
-
declare function SandboxFiles({ files, git,
|
|
2534
|
+
declare function SandboxFiles({ files, git, fileSystemAvailable, usePierre, editable, onEditIntent, requestedPath, requestedPathRequestId, requestedPathReady, themeType, className, }: SandboxFilesProps): react_jsx_runtime.JSX.Element;
|
|
1966
2535
|
|
|
1967
2536
|
type DesktopViewerProps = {
|
|
1968
2537
|
/** The desktop cell of the negotiated capabilities (`capabilities.DesktopStream`). */
|
|
@@ -2065,6 +2634,13 @@ type WorkspaceDockProps = {
|
|
|
2065
2634
|
/** Controlled collapsed state for hosts that expose their own dock toggle. */
|
|
2066
2635
|
collapsed?: boolean | undefined;
|
|
2067
2636
|
onCollapsedChange?: ((collapsed: boolean) => void) | undefined;
|
|
2637
|
+
/** A status accessory pinned to the right of the tab strip, left of the
|
|
2638
|
+
* maximize/collapse controls (e.g. the machine-state chip). Renders in both
|
|
2639
|
+
* the docked header and the full-screen overlay header. */
|
|
2640
|
+
headerAccessory?: ReactNode | undefined;
|
|
2641
|
+
/** Optional host navigation shown at the start of the phone overlay header.
|
|
2642
|
+
* It is intentionally absent from desktop dock chrome. */
|
|
2643
|
+
mobileLeadingControl?: ReactNode | undefined;
|
|
2068
2644
|
/** Persisted layout id (localStorage key) for react-resizable-panels. */
|
|
2069
2645
|
autoSaveId?: string | undefined;
|
|
2070
2646
|
/** Default dock width as a percent of the session area. */
|
|
@@ -2073,7 +2649,106 @@ type WorkspaceDockProps = {
|
|
|
2073
2649
|
maxSize?: number | undefined;
|
|
2074
2650
|
className?: string | undefined;
|
|
2075
2651
|
};
|
|
2076
|
-
declare function WorkspaceDock({ primary, tabs, activeTab, onActiveTabChange, collapsed: collapsedProp, onCollapsedChange, autoSaveId, defaultSize, minSize, maxSize, className, }: WorkspaceDockProps): react_jsx_runtime.JSX.Element;
|
|
2652
|
+
declare function WorkspaceDock({ primary, tabs, activeTab, onActiveTabChange, collapsed: collapsedProp, onCollapsedChange, headerAccessory, mobileLeadingControl, autoSaveId, defaultSize, minSize, maxSize, className, }: WorkspaceDockProps): react_jsx_runtime.JSX.Element;
|
|
2653
|
+
|
|
2654
|
+
/** A host-routed notification (replaces the app-only `sonner` toast coupling). */
|
|
2655
|
+
type WorkspaceNotification = {
|
|
2656
|
+
kind: "error" | "info";
|
|
2657
|
+
message: string;
|
|
2658
|
+
};
|
|
2659
|
+
/** The workbench's canonical tab ids (a host injects extras around these). */
|
|
2660
|
+
declare const WORKBENCH_TAB_CHANGES = "changes";
|
|
2661
|
+
declare const WORKBENCH_TAB_FILES = "files";
|
|
2662
|
+
/**
|
|
2663
|
+
* Decide a workspace tab from an already-local event log: the newest
|
|
2664
|
+
* `workspace.revision.captured` announce carries the change surface stats, so
|
|
2665
|
+
* "changes exist → Changes, else Files" needs zero machine round-trips. A host
|
|
2666
|
+
* `override` (e.g. a landing "run" tab) wins when supplied.
|
|
2667
|
+
*
|
|
2668
|
+
* `<SandboxWorkspace>` uses this only as an optional early hint after its own
|
|
2669
|
+
* capture GET reports no durable capture. A pure embedder needs no events-at-mount
|
|
2670
|
+
* contract: it falls through to authoritative live Git instead.
|
|
2671
|
+
*/
|
|
2672
|
+
declare function initialWorkspaceTab(events: SessionEvent[] | undefined, override?: string | null): string;
|
|
2673
|
+
type WorkspaceMachine = {
|
|
2674
|
+
/** The derived live/waking/offline chip model (dossier §3 #10). */
|
|
2675
|
+
chip: MachineChip;
|
|
2676
|
+
/** The machine these surfaces are bound to (the Modal group box or a
|
|
2677
|
+
* self-hosted machine), or null while the fleet is still resolving. */
|
|
2678
|
+
activeMachine: MachineView | null;
|
|
2679
|
+
loading: boolean;
|
|
2680
|
+
error: Error | null;
|
|
2681
|
+
refresh: () => Promise<void>;
|
|
2682
|
+
};
|
|
2683
|
+
type UseSandboxWorkspaceTabsOptions = ClientOverride & {
|
|
2684
|
+
sessionId: string;
|
|
2685
|
+
/** Live event log (usually `useSessionEvents().events`). */
|
|
2686
|
+
events: SessionEvent[];
|
|
2687
|
+
/** Override the source-driven default tab (e.g. a host landing tab id). When
|
|
2688
|
+
* omitted the workbench picks Changes-vs-Files from capture or live Git. */
|
|
2689
|
+
initialTab?: string | null | undefined;
|
|
2690
|
+
/** Host-routed notifications (mutation errors, desktop-consent failures). The
|
|
2691
|
+
* package never imports a toast library — the host decides how to surface. */
|
|
2692
|
+
onNotify?: ((notification: WorkspaceNotification) => void) | undefined;
|
|
2693
|
+
/** File requested by a Changes guard. The Files surface defers the read until
|
|
2694
|
+
* the sandbox is live, then reveals this path. */
|
|
2695
|
+
requestedFilePath?: string | null | undefined;
|
|
2696
|
+
/** Unique identity for `requestedFilePath`, including repeated requests for the
|
|
2697
|
+
* same path. */
|
|
2698
|
+
requestedFileRequestId?: string | number | null | undefined;
|
|
2699
|
+
/** Route a guarded diff into the host's Files tab. */
|
|
2700
|
+
onOpenFile?: ((path: string) => void) | undefined;
|
|
2701
|
+
};
|
|
2702
|
+
type UseSandboxWorkspaceTabsResult = {
|
|
2703
|
+
/** Changes | Files | Terminal | Desktop (capability-gated where noted). */
|
|
2704
|
+
tabs: WorkspaceTab[];
|
|
2705
|
+
/** The source-driven default tab: Changes when the first authoritative capture
|
|
2706
|
+
* or live Git result has changes, else Files (a host `initialTab` overrides).
|
|
2707
|
+
* null while that source resolves; the choice latches once. */
|
|
2708
|
+
defaultTab: string | null;
|
|
2709
|
+
/** The machine-state model for the dock-header chip. */
|
|
2710
|
+
machine: WorkspaceMachine;
|
|
2711
|
+
};
|
|
2712
|
+
/**
|
|
2713
|
+
* Build the workbench tabs + the machine-chip model for one session. This is the
|
|
2714
|
+
* dock "brain": capability negotiation, capture-backed cold reads, prewarm
|
|
2715
|
+
* flags, desktop consent, and the xterm theme observer — all package-local.
|
|
2716
|
+
*/
|
|
2717
|
+
declare function useSandboxWorkspaceTabs(options: UseSandboxWorkspaceTabsOptions): UseSandboxWorkspaceTabsResult;
|
|
2718
|
+
type SandboxWorkspaceProps = ClientOverride & {
|
|
2719
|
+
sessionId: string;
|
|
2720
|
+
/** Live event log (usually `useSessionEvents().events`). */
|
|
2721
|
+
events: SessionEvent[];
|
|
2722
|
+
/** The chat / primary pane shown beside the dock. */
|
|
2723
|
+
primary: ReactNode;
|
|
2724
|
+
/** Host tabs injected BEFORE the workbench tabs (e.g. a "Run" landing tab). */
|
|
2725
|
+
leadingTabs?: WorkspaceTab[] | undefined;
|
|
2726
|
+
/** Host tabs injected AFTER the workbench tabs (e.g. a "Debug" tab). */
|
|
2727
|
+
trailingTabs?: WorkspaceTab[] | undefined;
|
|
2728
|
+
/** Override the pre-paint default tab (e.g. a host landing tab id). When
|
|
2729
|
+
* omitted the workbench decides from capture, then live Git when no capture exists. */
|
|
2730
|
+
initialTab?: string | undefined;
|
|
2731
|
+
/** Host-routed notifications (no toast dependency in the package). */
|
|
2732
|
+
onNotify?: ((notification: WorkspaceNotification) => void) | undefined;
|
|
2733
|
+
/** Controlled collapsed state for hosts with their own dock toggle. */
|
|
2734
|
+
collapsed?: boolean | undefined;
|
|
2735
|
+
onCollapsedChange?: ((collapsed: boolean) => void) | undefined;
|
|
2736
|
+
/** Host navigation shown only in the phone workspace overlay header. */
|
|
2737
|
+
mobileLeadingControl?: ReactNode | undefined;
|
|
2738
|
+
autoSaveId?: string | undefined;
|
|
2739
|
+
defaultSize?: number | undefined;
|
|
2740
|
+
minSize?: number | undefined;
|
|
2741
|
+
maxSize?: number | undefined;
|
|
2742
|
+
className?: string | undefined;
|
|
2743
|
+
};
|
|
2744
|
+
/**
|
|
2745
|
+
* The whole session workspace, ready to mount: `<SandboxWorkspace>` assembles the
|
|
2746
|
+
* capability-gated tabs, pins the machine-state chip in the dock header, and
|
|
2747
|
+
* renders the resizable `<WorkspaceDock>`. Wrap the tree in `<OpenGeniProvider>`
|
|
2748
|
+
* (client + workspaceId) and import `@opengeni/react/styles.css`; that is the
|
|
2749
|
+
* entire integration (see `docs/embedding-workbench.md`).
|
|
2750
|
+
*/
|
|
2751
|
+
declare function SandboxWorkspace(props: SandboxWorkspaceProps): ReactNode;
|
|
2077
2752
|
|
|
2078
2753
|
/** Events that change which Codex account a session runs on (or just ran). */
|
|
2079
2754
|
declare function isCodexAccountEvent(event: Pick<SessionEvent, "type">): boolean;
|
|
@@ -2151,12 +2826,14 @@ declare function useCodexAccounts(options?: UseCodexAccountsOptions): UseCodexAc
|
|
|
2151
2826
|
declare function gitFileDiffToPatch(file: GitFileDiff): string;
|
|
2152
2827
|
|
|
2153
2828
|
/**
|
|
2154
|
-
* Derive
|
|
2155
|
-
* Reads the COMPUTED values so xterm
|
|
2156
|
-
*
|
|
2157
|
-
*
|
|
2829
|
+
* Derive a COMPLETE xterm `ITheme` from the live `--og-*` token system on the
|
|
2830
|
+
* DOM. Reads the COMPUTED values so xterm gets concrete colors, detects the
|
|
2831
|
+
* active theme mode, and fills every ANSI slot. Call on mount + re-derive on a
|
|
2832
|
+
* `data-og-theme` flip. SSR-safe: returns undefined off the DOM.
|
|
2158
2833
|
*
|
|
2159
|
-
*
|
|
2834
|
+
* `root` should be an element INSIDE the themed subtree (e.g. the terminal
|
|
2835
|
+
* container) so nested `[data-og-theme]` themes resolve correctly; when omitted
|
|
2836
|
+
* it falls back to the nearest `[data-og-theme]` element, then documentElement.
|
|
2160
2837
|
*/
|
|
2161
2838
|
declare function xtermThemeFromTokens(root?: HTMLElement | null): XtermTheme | undefined;
|
|
2162
2839
|
|
|
@@ -2205,4 +2882,4 @@ declare function isCreditExhaustion(input: {
|
|
|
2205
2882
|
*/
|
|
2206
2883
|
declare function humanizeFailureReason(reason: string | null): string | null;
|
|
2207
2884
|
|
|
2208
|
-
export { ActivityDisclosure, type ActivityDisclosureProps, type ActivityItem, ActivityRail, type ActivityRailProps, type AgentMessageItem, type ApplyPatchOperation, BodyNote, CREDIT_EXHAUSTION_MESSAGE, ChatComposer, type ChatComposerProps, ClientOverride, CodeEditor, type CodeEditorProps, type CodexAccountsClientLike, type CommandContext, CommandPalette, type CommandPaletteProps, type CommandResult, type
|
|
2885
|
+
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 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, OPEN_WORKSTREAM_CONTROL_EVENT, type ParsedCommandLine, PayloadBlock, type PendingApproval, PierreDiff, type PierreDiffProps, PierreFile, type PierreFileProps, type QueueMutationKind, QueueSurface, type QueueSurfaceProps, 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, shouldSteerOnKey, 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 };
|