@opengeni/react 0.46.1 → 0.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -14
- package/dist/artifacts-document.d.ts +3 -0
- package/dist/artifacts-document.js +17 -0
- package/dist/artifacts-document.js.map +1 -0
- package/dist/artifacts-presentation.d.ts +3 -0
- package/dist/artifacts-presentation.js +17 -0
- package/dist/artifacts-presentation.js.map +1 -0
- package/dist/artifacts-spreadsheet.d.ts +3 -0
- package/dist/artifacts-spreadsheet.js +17 -0
- package/dist/artifacts-spreadsheet.js.map +1 -0
- package/dist/artifacts.d.ts +2 -0
- package/dist/artifacts.js +170 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/chunk-6BBWWOOU.js +82 -0
- package/dist/chunk-6BBWWOOU.js.map +1 -0
- package/dist/{chunk-HFO4ERGQ.js → chunk-724BW4TW.js} +586 -35
- package/dist/chunk-724BW4TW.js.map +1 -0
- package/dist/chunk-7I2KB3OK.js +3895 -0
- package/dist/chunk-7I2KB3OK.js.map +1 -0
- package/dist/chunk-7WCLAEFV.js +2828 -0
- package/dist/chunk-7WCLAEFV.js.map +1 -0
- package/dist/{chunk-U3CSCMWA.js → chunk-FK6VG4LL.js} +9 -13
- package/dist/chunk-FK6VG4LL.js.map +1 -0
- package/dist/{chunk-SRFUT2ZU.js → chunk-FWS3KC3Z.js} +120 -64
- package/dist/chunk-FWS3KC3Z.js.map +1 -0
- package/dist/{chunk-EKZH6IDG.js → chunk-HDBG7XGO.js} +62 -1
- package/dist/chunk-HDBG7XGO.js.map +1 -0
- package/dist/chunk-HUIKIDM5.js +2148 -0
- package/dist/chunk-HUIKIDM5.js.map +1 -0
- package/dist/{chunk-LGVMUIRV.js → chunk-JAGDUCZQ.js} +1053 -390
- package/dist/chunk-JAGDUCZQ.js.map +1 -0
- package/dist/{chunk-LWR4MXSS.js → chunk-JR3QFY6B.js} +420 -35
- package/dist/chunk-JR3QFY6B.js.map +1 -0
- package/dist/chunk-JVYQRRC4.js +53 -0
- package/dist/chunk-JVYQRRC4.js.map +1 -0
- package/dist/chunk-KCGXPP5V.js +157 -0
- package/dist/chunk-KCGXPP5V.js.map +1 -0
- package/dist/{chunk-EB67J347.js → chunk-KZ73RL76.js} +111 -31
- package/dist/chunk-KZ73RL76.js.map +1 -0
- package/dist/chunk-PEI6RANI.js +3234 -0
- package/dist/chunk-PEI6RANI.js.map +1 -0
- package/dist/{chunk-3PB7MIT6.js → chunk-ROIRTM37.js} +220 -72
- package/dist/chunk-ROIRTM37.js.map +1 -0
- package/dist/chunk-VZTQ73XT.js +86 -0
- package/dist/chunk-VZTQ73XT.js.map +1 -0
- package/dist/{chunk-VCBFUSUZ.js → chunk-WSK7G5LE.js} +72 -4
- package/dist/chunk-WSK7G5LE.js.map +1 -0
- package/dist/{chunk-FGZUCXZF.js → chunk-WYA65Y3F.js} +16 -16
- package/dist/chunk-WYA65Y3F.js.map +1 -0
- package/dist/{chunk-6EDV6YFE.js → chunk-X4S56Y2H.js} +147 -35
- package/dist/chunk-X4S56Y2H.js.map +1 -0
- package/dist/client.d.ts +7 -1
- package/dist/clipboard.d.ts +1 -0
- package/dist/clipboard.js +7 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/commands/index.d.ts +3 -3
- package/dist/commands/registry.d.ts +1 -1
- package/dist/commands/types.d.ts +1 -1
- package/dist/components/approval-surface.d.ts +2 -2
- package/dist/components/artifacts/artifact-surface.d.ts +18 -0
- package/dist/components/artifacts/document-editor.d.ts +172 -0
- package/dist/components/artifacts/editable-artifact-ui.d.ts +13 -0
- package/dist/components/artifacts/editable-artifact-workbench.d.ts +49 -0
- package/dist/components/artifacts/editable-document.d.ts +24 -0
- package/dist/components/artifacts/editable-presentation.d.ts +24 -0
- package/dist/components/artifacts/editable-spreadsheet.d.ts +32 -0
- package/dist/components/artifacts/index.d.ts +8 -0
- package/dist/components/artifacts/presentation-editor.d.ts +297 -0
- package/dist/components/artifacts/spreadsheet-canvas.d.ts +120 -0
- package/dist/components/artifacts/spreadsheet-grid.d.ts +113 -0
- package/dist/components/browser-viewer.d.ts +29 -0
- package/dist/components/chat-composer.d.ts +13 -8
- package/dist/components/code-editor.d.ts +25 -3
- package/dist/components/command-palette.d.ts +2 -2
- package/dist/components/composer-transcription-control.d.ts +4 -2
- package/dist/components/composer.d.ts +29 -15
- package/dist/components/computer-viewer.d.ts +23 -0
- package/dist/components/copy-button.d.ts +2 -2
- package/dist/components/desktop-viewer.d.ts +25 -21
- package/dist/components/diff-view.d.ts +1 -1
- package/dist/components/enrollment-consent.d.ts +1 -1
- package/dist/components/enrollment-device-flow.d.ts +1 -1
- package/dist/components/file-browser.d.ts +2 -2
- package/dist/components/fleet-tile.d.ts +1 -1
- package/dist/components/generated-video-player.d.ts +10 -0
- package/dist/components/human-input-form.d.ts +1 -1
- package/dist/components/human-input-surface.d.ts +2 -2
- package/dist/components/interactive-workbench-viewers.d.ts +2 -0
- package/dist/components/machine-card.d.ts +2 -2
- package/dist/components/machine-dock-bar.d.ts +3 -3
- package/dist/components/machine-health-pill.d.ts +2 -2
- package/dist/components/machine-input-display.d.ts +1 -1
- package/dist/components/machine-metrics.d.ts +2 -2
- package/dist/components/machine-status-pill.d.ts +4 -4
- package/dist/components/machines/health.d.ts +1 -1
- package/dist/components/machines/machine-detail.d.ts +5 -3
- package/dist/components/machines/metric-history-chart.d.ts +1 -1
- package/dist/components/machines/metric-sparkline.d.ts +2 -2
- package/dist/components/machines/series.d.ts +2 -2
- package/dist/components/machines-dashboard.d.ts +5 -5
- package/dist/components/markdown.d.ts +1 -1
- package/dist/components/message-timeline.d.ts +22 -5
- package/dist/components/model-picker.d.ts +2 -2
- package/dist/components/model-policy-picker.d.ts +7 -7
- package/dist/components/pierre-diff.d.ts +1 -1
- package/dist/components/pierre-file.d.ts +1 -1
- package/dist/components/queue-draft-policy.d.ts +1 -1
- package/dist/components/queue-surface-implementation.d.ts +3 -3
- package/dist/components/queue-surface-state.d.ts +4 -4
- package/dist/components/queue-surface.d.ts +5 -5
- package/dist/components/sandbox-files.d.ts +5 -5
- package/dist/components/sandbox-terminal.d.ts +50 -4
- package/dist/components/sandbox-workspace.d.ts +30 -10
- package/dist/components/session-chrome.d.ts +4 -4
- package/dist/components/session-status.d.ts +2 -2
- package/dist/components/timeline-annotation-selection.d.ts +9 -0
- package/dist/components/timeline-annotations-dialog.d.ts +16 -0
- package/dist/components/timeline-annotations.d.ts +13 -0
- package/dist/components/tooltip.d.ts +4 -4
- package/dist/components/user-message-body.d.ts +2 -2
- package/dist/components/workbench-changes.d.ts +2 -2
- package/dist/components/workspace-dock.d.ts +3 -1
- package/dist/composer.d.ts +11 -11
- package/dist/composer.js +7 -7
- package/dist/hooks/internal.d.ts +7 -1
- package/dist/hooks/use-attached-browsers.d.ts +21 -0
- package/dist/hooks/use-available-models.d.ts +2 -2
- package/dist/hooks/use-billing-usage.d.ts +1 -1
- package/dist/hooks/use-browser-frame-stream.d.ts +28 -0
- package/dist/hooks/use-browser-identities.d.ts +26 -0
- package/dist/hooks/use-browser-session.d.ts +28 -0
- package/dist/hooks/use-browser-sessions.d.ts +32 -0
- package/dist/hooks/use-codex-accounts.d.ts +3 -3
- package/dist/hooks/use-composer.d.ts +36 -9
- package/dist/hooks/use-computer-frame-stream.d.ts +24 -0
- package/dist/hooks/use-computer-session.d.ts +28 -0
- package/dist/hooks/use-computer-sessions.d.ts +28 -0
- package/dist/hooks/use-desktop-stream.d.ts +1 -1
- package/dist/hooks/use-environments.d.ts +11 -5
- package/dist/hooks/use-file-attachments.d.ts +1 -1
- package/dist/hooks/use-goal.d.ts +2 -2
- package/dist/hooks/use-human-input.d.ts +2 -2
- package/dist/hooks/use-last-started-turn-policy.d.ts +2 -2
- package/dist/hooks/use-machine-chip.d.ts +2 -2
- package/dist/hooks/use-machines.d.ts +10 -3
- package/dist/hooks/use-packs.d.ts +7 -2
- package/dist/hooks/use-rigs.d.ts +1 -1
- package/dist/hooks/use-sandbox-files.d.ts +25 -4
- package/dist/hooks/use-sandbox-git.d.ts +13 -5
- package/dist/hooks/use-sandbox-terminal.d.ts +1 -1
- package/dist/hooks/use-scheduled-tasks.d.ts +1 -1
- package/dist/hooks/use-session-capabilities.d.ts +5 -4
- package/dist/hooks/use-session-control.d.ts +1 -1
- package/dist/hooks/use-session-events.d.ts +2 -2
- package/dist/hooks/use-session-lineage.d.ts +1 -1
- package/dist/hooks/use-session-mcp-approval-policy.d.ts +2 -2
- package/dist/hooks/use-session.d.ts +2 -2
- package/dist/hooks/use-slash-commands.d.ts +1 -1
- package/dist/hooks/use-terminal-stream.d.ts +8 -2
- package/dist/hooks/use-transcription.d.ts +2 -2
- package/dist/hooks/use-turn-queue.d.ts +2 -2
- package/dist/hooks/use-video-artifact-playback.d.ts +9 -0
- package/dist/hooks/use-voice-input.d.ts +6 -4
- package/dist/hooks/use-workspace-capture.d.ts +1 -1
- package/dist/hooks/use-workspace-edit.d.ts +1 -1
- package/dist/hooks/use-workspace-sessions.d.ts +1 -1
- package/dist/hooks/use-workspaces.d.ts +1 -1
- package/dist/index.d.ts +158 -154
- package/dist/index.js +1718 -908
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +23 -0
- package/dist/interaction.js +36 -0
- package/dist/interaction.js.map +1 -0
- package/dist/interactive-workbench-viewers-KHNOHWQE.js +13 -0
- package/dist/interactive-workbench-viewers-KHNOHWQE.js.map +1 -0
- package/dist/lib/composer-responsive-context.d.ts +9 -0
- package/dist/lib/relay-wire.d.ts +4 -0
- package/dist/lib/sandbox-liveness.d.ts +9 -0
- package/dist/lib/terminal-capability.d.ts +5 -0
- package/dist/lib/use-portal-token-style.d.ts +14 -3
- package/dist/lib/xterm-theme.d.ts +1 -1
- package/dist/machines.d.ts +30 -30
- package/dist/machines.js +3 -3
- package/dist/provider.d.ts +4 -4
- package/dist/{queue-surface-implementation-J4XJFKRW.js → queue-surface-implementation-2KVJTYXH.js} +117 -64
- package/dist/queue-surface-implementation-2KVJTYXH.js.map +1 -0
- package/dist/realtime/dropdown-menu.d.ts +8 -8
- package/dist/realtime/realtime-control.d.ts +15 -6
- package/dist/realtime.d.ts +4 -4
- package/dist/realtime.js +30 -33
- package/dist/realtime.js.map +1 -1
- package/dist/session-context.d.ts +19 -1
- package/dist/session-ui.d.ts +14 -14
- package/dist/session-ui.js +6 -5
- package/dist/session.d.ts +28 -28
- package/dist/session.js +5 -5
- package/dist/timeline/activity-rail.d.ts +6 -3
- package/dist/timeline/disclosure-context.d.ts +1 -1
- package/dist/timeline/fleet-decision-projection.d.ts +1 -1
- package/dist/timeline/fleet-decision-row.d.ts +3 -3
- package/dist/timeline/index.d.ts +19 -19
- package/dist/timeline/parsers.d.ts +6 -3
- package/dist/timeline/projection.d.ts +3 -3
- package/dist/timeline/registry.d.ts +10 -1
- package/dist/timeline/screenshot-lightbox.d.ts +2 -2
- package/dist/timeline/shared.d.ts +21 -10
- package/dist/timeline/tool-diff.d.ts +2 -2
- package/dist/timeline/tool-renderers.d.ts +1 -1
- package/dist/timeline/turn-summary.d.ts +3 -3
- package/dist/timeline/types.d.ts +42 -2
- package/dist/timeline-annotation-selection-3L7LHGG2.js +187 -0
- package/dist/timeline-annotation-selection-3L7LHGG2.js.map +1 -0
- package/dist/timeline-annotations-dialog-U7EVLR75.js +196 -0
- package/dist/timeline-annotations-dialog-U7EVLR75.js.map +1 -0
- package/dist/voice-recording-store.d.ts +8 -2
- package/package.json +52 -7
- package/src/artifacts-document.ts +31 -0
- package/src/artifacts-presentation.ts +36 -0
- package/src/artifacts-spreadsheet.ts +21 -0
- package/src/artifacts.ts +86 -0
- package/src/client.ts +90 -1
- package/src/clipboard.ts +2 -0
- package/src/components/artifacts/artifact-surface.tsx +93 -0
- package/src/components/artifacts/document-editor.tsx +2255 -0
- package/src/components/artifacts/editable-artifact-ui.tsx +89 -0
- package/src/components/artifacts/editable-artifact-workbench.tsx +203 -0
- package/src/components/artifacts/editable-document.tsx +657 -0
- package/src/components/artifacts/editable-presentation.tsx +1020 -0
- package/src/components/artifacts/editable-spreadsheet.tsx +733 -0
- package/src/components/artifacts/index.ts +99 -0
- package/src/components/artifacts/presentation-editor.tsx +3148 -0
- package/src/components/artifacts/spreadsheet-canvas.ts +799 -0
- package/src/components/artifacts/spreadsheet-grid.tsx +2129 -0
- package/src/components/browser-viewer.tsx +1592 -0
- package/src/components/chat-composer.tsx +25 -2
- package/src/components/code-editor.tsx +90 -31
- package/src/components/command-palette.tsx +1 -1
- package/src/components/composer-transcription-control.tsx +51 -22
- package/src/components/composer.tsx +49 -23
- package/src/components/computer-viewer.tsx +1139 -0
- package/src/components/copy-button.tsx +1 -1
- package/src/components/desktop-viewer.tsx +103 -75
- package/src/components/file-browser.tsx +39 -17
- package/src/components/generated-video-player.tsx +89 -0
- package/src/components/human-input-form.tsx +2 -2
- package/src/components/interactive-workbench-viewers.ts +2 -0
- package/src/components/machine-card.tsx +1 -1
- package/src/components/machine-input-display.ts +3 -0
- package/src/components/machines/machine-detail.tsx +39 -15
- package/src/components/machines-dashboard.tsx +7 -6
- package/src/components/message-timeline.tsx +327 -37
- package/src/components/model-picker.tsx +2 -2
- package/src/components/model-policy-picker.tsx +16 -15
- package/src/components/queue-surface-implementation.tsx +135 -75
- package/src/components/queue-surface-state.tsx +2 -2
- package/src/components/sandbox-files.tsx +142 -62
- package/src/components/sandbox-terminal.tsx +119 -35
- package/src/components/sandbox-workspace.tsx +394 -228
- package/src/components/session-chrome.tsx +67 -27
- package/src/components/timeline-annotation-selection.tsx +221 -0
- package/src/components/timeline-annotations-dialog.tsx +213 -0
- package/src/components/timeline-annotations.tsx +84 -0
- package/src/components/tooltip.tsx +13 -16
- package/src/components/user-message-body.tsx +1 -1
- package/src/components/workbench-changes.tsx +192 -35
- package/src/components/workspace-dock.tsx +13 -5
- package/src/composer.ts +3 -0
- package/src/hooks/internal.ts +132 -38
- package/src/hooks/use-attached-browsers.ts +152 -0
- package/src/hooks/use-browser-frame-stream.ts +316 -0
- package/src/hooks/use-browser-identities.ts +225 -0
- package/src/hooks/use-browser-session.ts +476 -0
- package/src/hooks/use-browser-sessions.ts +281 -0
- package/src/hooks/use-codex-accounts.ts +4 -4
- package/src/hooks/use-composer.ts +769 -24
- package/src/hooks/use-computer-frame-stream.ts +311 -0
- package/src/hooks/use-computer-session.ts +442 -0
- package/src/hooks/use-computer-sessions.ts +245 -0
- package/src/hooks/use-environments.ts +24 -5
- package/src/hooks/use-file-attachments.ts +70 -32
- package/src/hooks/use-goal.ts +17 -5
- package/src/hooks/use-machine-chip.ts +5 -3
- package/src/hooks/use-machines.ts +79 -3
- package/src/hooks/use-packs.ts +51 -0
- package/src/hooks/use-sandbox-files.ts +382 -88
- package/src/hooks/use-sandbox-git.ts +208 -46
- package/src/hooks/use-sandbox-terminal.ts +3 -2
- package/src/hooks/use-session-capabilities.ts +94 -70
- package/src/hooks/use-session-events.ts +18 -4
- package/src/hooks/use-terminal-stream.ts +102 -23
- package/src/hooks/use-transcription.ts +4 -14
- package/src/hooks/use-turn-queue.ts +17 -5
- package/src/hooks/use-video-artifact-playback.ts +28 -0
- package/src/hooks/use-voice-input.ts +163 -19
- package/src/hooks/use-windowed-sections.ts +9 -7
- package/src/hooks/use-workspace-edit.ts +2 -1
- package/src/index.ts +21 -6
- package/src/interaction.ts +71 -0
- package/src/lib/composer-responsive-context.ts +15 -0
- package/src/lib/relay-wire.ts +4 -0
- package/src/lib/sandbox-liveness.ts +11 -0
- package/src/lib/terminal-capability.ts +10 -0
- package/src/lib/use-portal-token-style.ts +60 -15
- package/src/provider.tsx +52 -7
- package/src/realtime/dropdown-menu.tsx +15 -19
- package/src/realtime/realtime-control.tsx +16 -5
- package/src/session-context.ts +90 -0
- package/src/timeline/activity-rail.tsx +31 -6
- package/src/timeline/index.ts +4 -1
- package/src/timeline/parsers.ts +46 -20
- package/src/timeline/projection.ts +233 -13
- package/src/timeline/registry.ts +19 -0
- package/src/timeline/screenshot-lightbox.tsx +30 -9
- package/src/timeline/shared.tsx +59 -11
- package/src/timeline/tool-renderers.tsx +421 -24
- package/src/timeline/turn-summary.tsx +2 -2
- package/src/timeline/types.ts +58 -2
- package/src/voice-recording-store.ts +15 -0
- package/styles/compiled.css +5298 -0
- package/styles/compiled.d.ts +2 -0
- package/styles/effective-tokens.css +27 -0
- package/styles/index.css +18 -0
- package/styles/responsive.css +208 -0
- package/styles/responsive.d.ts +2 -0
- package/styles/tokens.css +50 -17
- package/dist/chunk-3PB7MIT6.js.map +0 -1
- package/dist/chunk-6EDV6YFE.js.map +0 -1
- package/dist/chunk-EB67J347.js.map +0 -1
- package/dist/chunk-EKZH6IDG.js.map +0 -1
- package/dist/chunk-FGZUCXZF.js.map +0 -1
- package/dist/chunk-HFO4ERGQ.js.map +0 -1
- package/dist/chunk-JB5725BI.js +0 -48
- package/dist/chunk-JB5725BI.js.map +0 -1
- package/dist/chunk-LGVMUIRV.js.map +0 -1
- package/dist/chunk-LWR4MXSS.js.map +0 -1
- package/dist/chunk-SRFUT2ZU.js.map +0 -1
- package/dist/chunk-U3CSCMWA.js.map +0 -1
- package/dist/chunk-VCBFUSUZ.js.map +0 -1
- package/dist/fleet-decision-projection-SLNZMS42.js +0 -241
- package/dist/fleet-decision-projection-SLNZMS42.js.map +0 -1
- package/dist/queue-surface-implementation-J4XJFKRW.js.map +0 -1
|
@@ -12,6 +12,7 @@ import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } fr
|
|
|
12
12
|
import { useEmbeddedSession, type EmbeddedSessionClientOverride } from "../session-context";
|
|
13
13
|
import {
|
|
14
14
|
useDebouncedCallback,
|
|
15
|
+
usePageLiveActivity,
|
|
15
16
|
useSessionEventTrigger,
|
|
16
17
|
type SessionEventFeedOptions,
|
|
17
18
|
} from "./internal";
|
|
@@ -91,6 +92,7 @@ export function useTurnQueue(
|
|
|
91
92
|
useEmbeddedSession(options);
|
|
92
93
|
const enabled = (options.enabled ?? true) && Boolean(sessionId);
|
|
93
94
|
const targetKey = `${workspaceId}\u0000${sessionId ?? ""}`;
|
|
95
|
+
const pageLive = usePageLiveActivity();
|
|
94
96
|
const [snapshot, setSnapshot] = useState<SessionQueueSnapshot | null>(null);
|
|
95
97
|
const [stateTargetKey, setStateTargetKey] = useState(targetKey);
|
|
96
98
|
const [loading, setLoading] = useState(enabled);
|
|
@@ -174,24 +176,34 @@ export function useTurnQueue(
|
|
|
174
176
|
);
|
|
175
177
|
|
|
176
178
|
useEffect(() => {
|
|
177
|
-
if (!enabled) {
|
|
179
|
+
if (!enabled || !pageLive) {
|
|
178
180
|
setLoading(false);
|
|
179
181
|
return;
|
|
180
182
|
}
|
|
181
183
|
setLoading(true);
|
|
182
|
-
void load();
|
|
183
184
|
const pollIntervalMs = options.pollIntervalMs;
|
|
184
185
|
if (pollIntervalMs === undefined || pollIntervalMs <= 0) {
|
|
186
|
+
void load();
|
|
185
187
|
return () => {
|
|
186
188
|
readGeneration.current += 1;
|
|
187
189
|
};
|
|
188
190
|
}
|
|
189
|
-
|
|
191
|
+
let cancelled = false;
|
|
192
|
+
let timer: ReturnType<typeof setTimeout> | null = null;
|
|
193
|
+
const schedule = () => {
|
|
194
|
+
if (cancelled) return;
|
|
195
|
+
timer = setTimeout(() => {
|
|
196
|
+
timer = null;
|
|
197
|
+
void load().finally(schedule);
|
|
198
|
+
}, pollIntervalMs);
|
|
199
|
+
};
|
|
200
|
+
void load().finally(schedule);
|
|
190
201
|
return () => {
|
|
191
|
-
|
|
202
|
+
cancelled = true;
|
|
203
|
+
if (timer !== null) clearTimeout(timer);
|
|
192
204
|
readGeneration.current += 1;
|
|
193
205
|
};
|
|
194
|
-
}, [load, enabled, options.pollIntervalMs]);
|
|
206
|
+
}, [load, enabled, pageLive, options.pollIntervalMs]);
|
|
195
207
|
|
|
196
208
|
useEffect(() => {
|
|
197
209
|
if (enabled && workspaceControlEvent) void load();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import type { VideoArtifactPlaybackLoader } from "../timeline";
|
|
3
|
+
import { useOpenGeni, type ClientOverride } from "../session-context";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Bind the current public SDK client/workspace to MessageTimeline's renewable
|
|
7
|
+
* video-source boundary. Proxy hosts may omit the method until they support
|
|
8
|
+
* retained video; the failure remains local to the player instead of loading
|
|
9
|
+
* any video bytes through React.
|
|
10
|
+
*/
|
|
11
|
+
export function useVideoArtifactPlaybackLoader(
|
|
12
|
+
options: ClientOverride = {},
|
|
13
|
+
): VideoArtifactPlaybackLoader {
|
|
14
|
+
const { client, workspaceId } = useOpenGeni(options);
|
|
15
|
+
return useMemo(
|
|
16
|
+
() => async (artifactId: string, signal?: AbortSignal) => {
|
|
17
|
+
if (typeof client.createVideoArtifactPlaybackSource !== "function") {
|
|
18
|
+
throw new Error("This OpenGeni host does not expose retained-video playback.");
|
|
19
|
+
}
|
|
20
|
+
return await client.createVideoArtifactPlaybackSource(
|
|
21
|
+
workspaceId,
|
|
22
|
+
artifactId,
|
|
23
|
+
signal ? { signal } : {},
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
[client, workspaceId],
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { OpenGeniApiError, type ClientVoiceInputConfig, type OpenGeniClient } from "@opengeni/sdk";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import {
|
|
4
4
|
IndexedDbVoiceRecordingStore,
|
|
@@ -21,6 +21,7 @@ export type VoiceInputStatus =
|
|
|
21
21
|
| "recording"
|
|
22
22
|
| "saving"
|
|
23
23
|
| "transcribing"
|
|
24
|
+
| "retrying"
|
|
24
25
|
| "recovered"
|
|
25
26
|
| "transcript-ready"
|
|
26
27
|
| "error";
|
|
@@ -39,6 +40,8 @@ export type UseVoiceInputOptions = {
|
|
|
39
40
|
createRecordingId?: (() => string) | undefined;
|
|
40
41
|
createOwnerId?: (() => string) | undefined;
|
|
41
42
|
now?: (() => Date) | undefined;
|
|
43
|
+
/** Test/embed seam. Production uses bounded exponential recovery backoff. */
|
|
44
|
+
automaticRetryDelayMilliseconds?: number | undefined;
|
|
42
45
|
};
|
|
43
46
|
|
|
44
47
|
type ResumableVoiceInputClient = Pick<
|
|
@@ -86,7 +89,6 @@ export const VOICE_RECORDING_RESUMABLE_CLIENT_MAX_DURATION_SECONDS = 8 * 60 * 60
|
|
|
86
89
|
export const VOICE_RECORDING_RECOVERY_STATUS_POLL_MILLISECONDS = 2_000;
|
|
87
90
|
export const VOICE_RECORDING_RECOVERY_MAX_MUTATION_DELAY_MILLISECONDS = 30_000;
|
|
88
91
|
const TRANSCRIPTION_RECORDING_RECOVERY_RETRY_AFTER_MILLISECONDS = 5_000;
|
|
89
|
-
|
|
90
92
|
const MIME_PREFERENCES = ["audio/webm;codecs=opus", "audio/mp4", "audio/ogg;codecs=opus"];
|
|
91
93
|
const createDefaultVoiceRecordingId = () => crypto.randomUUID();
|
|
92
94
|
const currentDate = () => new Date();
|
|
@@ -132,6 +134,7 @@ export function useVoiceInput({
|
|
|
132
134
|
createRecordingId = createDefaultVoiceRecordingId,
|
|
133
135
|
createOwnerId,
|
|
134
136
|
now = currentDate,
|
|
137
|
+
automaticRetryDelayMilliseconds,
|
|
135
138
|
}: UseVoiceInputOptions): UseVoiceInputResult {
|
|
136
139
|
const [status, setStatus] = useState<VoiceInputStatus>("idle");
|
|
137
140
|
const [error, setError] = useState<string | null>(null);
|
|
@@ -156,6 +159,8 @@ export function useVoiceInput({
|
|
|
156
159
|
const recorderRef = useRef<MediaRecorder | null>(null);
|
|
157
160
|
const streamRef = useRef<MediaStream | null>(null);
|
|
158
161
|
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
162
|
+
const automaticRetryTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
163
|
+
const automaticRetryAttemptRef = useRef(0);
|
|
159
164
|
const ownerHeartbeatTimerRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
|
160
165
|
const controllerRef = useRef<AbortController | null>(null);
|
|
161
166
|
const valueRef = useRef(value);
|
|
@@ -211,6 +216,7 @@ export function useVoiceInput({
|
|
|
211
216
|
setRecordingId(null);
|
|
212
217
|
setDurationSeconds(0);
|
|
213
218
|
setLocallySaved(false);
|
|
219
|
+
automaticRetryAttemptRef.current = 0;
|
|
214
220
|
}, [stopOwnerHeartbeat]);
|
|
215
221
|
|
|
216
222
|
const ensureStore = useCallback(async (): Promise<VoiceRecordingStore> => {
|
|
@@ -348,7 +354,9 @@ export function useVoiceInput({
|
|
|
348
354
|
setStatus(
|
|
349
355
|
claimed.finalizationState === "transcript-ready" && claimed.transcriptText !== null
|
|
350
356
|
? "transcript-ready"
|
|
351
|
-
: "
|
|
357
|
+
: claimed.recoveryMode === "automatic"
|
|
358
|
+
? "retrying"
|
|
359
|
+
: "recovered",
|
|
352
360
|
);
|
|
353
361
|
setError(null);
|
|
354
362
|
return;
|
|
@@ -415,7 +423,12 @@ export function useVoiceInput({
|
|
|
415
423
|
if (chunks.length === 0) {
|
|
416
424
|
const retained = await store.updateManifest(
|
|
417
425
|
transcribing.recordingId,
|
|
418
|
-
{
|
|
426
|
+
{
|
|
427
|
+
uploadState: "retrying",
|
|
428
|
+
transcriptionState: "retrying",
|
|
429
|
+
recoveryMode: "manual",
|
|
430
|
+
handoffMode: "explicit",
|
|
431
|
+
},
|
|
419
432
|
readNow().toISOString(),
|
|
420
433
|
ownerIdRef.current ?? undefined,
|
|
421
434
|
);
|
|
@@ -447,6 +460,14 @@ export function useVoiceInput({
|
|
|
447
460
|
if (!active()) return;
|
|
448
461
|
rememberManifest(ready);
|
|
449
462
|
|
|
463
|
+
automaticRetryAttemptRef.current = 0;
|
|
464
|
+
if (ready.handoffMode === "explicit") {
|
|
465
|
+
setStatus("transcript-ready");
|
|
466
|
+
setError("handoff_uncertain");
|
|
467
|
+
focusInput();
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
|
|
450
471
|
const next = appendFinalTranscript(valueRef.current, response.text);
|
|
451
472
|
if (next !== valueRef.current) {
|
|
452
473
|
valueRef.current = next;
|
|
@@ -490,16 +511,22 @@ export function useVoiceInput({
|
|
|
490
511
|
await loadNextRecoverable(generation);
|
|
491
512
|
} catch (reason) {
|
|
492
513
|
if (!active()) return;
|
|
514
|
+
const code = controller.signal.aborted ? null : errorCode(reason);
|
|
515
|
+
const retryable = !controller.signal.aborted && isRetryableVoiceInputError(reason);
|
|
493
516
|
const retained = await updateManifestBestEffort(transcribing, {
|
|
494
517
|
uploadState: "retrying",
|
|
495
518
|
transcriptionState: "retrying",
|
|
519
|
+
recoveryMode: retryable ? "automatic" : "manual",
|
|
520
|
+
handoffMode: "explicit",
|
|
496
521
|
});
|
|
497
522
|
if (!active()) return;
|
|
498
|
-
|
|
499
|
-
retained
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
523
|
+
if (retryable) {
|
|
524
|
+
rememberManifest(retained);
|
|
525
|
+
setStatus("retrying");
|
|
526
|
+
setError(code);
|
|
527
|
+
} else {
|
|
528
|
+
await preserveForRetry(retained, code, generation);
|
|
529
|
+
}
|
|
503
530
|
} finally {
|
|
504
531
|
if (controllerRef.current === controller) controllerRef.current = null;
|
|
505
532
|
}
|
|
@@ -519,6 +546,61 @@ export function useVoiceInput({
|
|
|
519
546
|
workspaceId,
|
|
520
547
|
],
|
|
521
548
|
);
|
|
549
|
+
// Live session renders must not postpone a durable retry deadline. Execute the
|
|
550
|
+
// latest finalizer without making its callback identity part of the timer key.
|
|
551
|
+
const finalizePersistedRecordingRef = useRef(finalizePersistedRecording);
|
|
552
|
+
finalizePersistedRecordingRef.current = finalizePersistedRecording;
|
|
553
|
+
const clientAvailable = client !== null && client !== undefined;
|
|
554
|
+
|
|
555
|
+
useEffect(() => {
|
|
556
|
+
if (
|
|
557
|
+
status !== "retrying" ||
|
|
558
|
+
!manifestRef.current ||
|
|
559
|
+
manifestRef.current.recoveryMode !== "automatic" ||
|
|
560
|
+
manifestRef.current.workspaceId !== workspaceId ||
|
|
561
|
+
!clientAvailable ||
|
|
562
|
+
disabled ||
|
|
563
|
+
!enabled
|
|
564
|
+
) {
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
const generation = generationRef.current;
|
|
568
|
+
let started = false;
|
|
569
|
+
const run = () => {
|
|
570
|
+
if (
|
|
571
|
+
started ||
|
|
572
|
+
generation !== generationRef.current ||
|
|
573
|
+
statusRef.current !== "retrying" ||
|
|
574
|
+
workspaceIdRef.current !== workspaceId
|
|
575
|
+
) {
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
started = true;
|
|
579
|
+
if (automaticRetryTimerRef.current) clearTimeout(automaticRetryTimerRef.current);
|
|
580
|
+
automaticRetryTimerRef.current = null;
|
|
581
|
+
automaticRetryAttemptRef.current += 1;
|
|
582
|
+
void finalizePersistedRecordingRef.current(generation);
|
|
583
|
+
};
|
|
584
|
+
const onOnline = () => run();
|
|
585
|
+
globalThis.addEventListener?.("online", onOnline);
|
|
586
|
+
if (typeof navigator !== "undefined" && navigator.onLine === false) {
|
|
587
|
+
return () => globalThis.removeEventListener?.("online", onOnline);
|
|
588
|
+
}
|
|
589
|
+
const delay = Math.max(
|
|
590
|
+
0,
|
|
591
|
+
automaticRetryDelayMilliseconds ??
|
|
592
|
+
transcriptionRecoveryMutationDelayMilliseconds(
|
|
593
|
+
TRANSCRIPTION_RECORDING_RECOVERY_RETRY_AFTER_MILLISECONDS,
|
|
594
|
+
automaticRetryAttemptRef.current,
|
|
595
|
+
),
|
|
596
|
+
);
|
|
597
|
+
automaticRetryTimerRef.current = setTimeout(run, delay);
|
|
598
|
+
return () => {
|
|
599
|
+
globalThis.removeEventListener?.("online", onOnline);
|
|
600
|
+
if (automaticRetryTimerRef.current) clearTimeout(automaticRetryTimerRef.current);
|
|
601
|
+
automaticRetryTimerRef.current = null;
|
|
602
|
+
};
|
|
603
|
+
}, [automaticRetryDelayMilliseconds, clientAvailable, disabled, enabled, status, workspaceId]);
|
|
522
604
|
|
|
523
605
|
const stop = useCallback(() => {
|
|
524
606
|
const recorder = recorderRef.current;
|
|
@@ -540,6 +622,7 @@ export function useVoiceInput({
|
|
|
540
622
|
status === "recording" ||
|
|
541
623
|
status === "saving" ||
|
|
542
624
|
status === "transcribing" ||
|
|
625
|
+
status === "retrying" ||
|
|
543
626
|
!navigator.mediaDevices?.getUserMedia ||
|
|
544
627
|
typeof MediaRecorder === "undefined"
|
|
545
628
|
) {
|
|
@@ -716,11 +799,19 @@ export function useVoiceInput({
|
|
|
716
799
|
}
|
|
717
800
|
rememberManifest(stopped);
|
|
718
801
|
if (attemptPersistenceError) {
|
|
719
|
-
await
|
|
802
|
+
const retained = await updateManifestBestEffort(stopped, {
|
|
803
|
+
recoveryMode: "manual",
|
|
804
|
+
handoffMode: "explicit",
|
|
805
|
+
});
|
|
806
|
+
await preserveForRetry(retained, "storage_unavailable", generation);
|
|
720
807
|
return;
|
|
721
808
|
}
|
|
722
809
|
if (attemptCaptureLimitError) {
|
|
723
|
-
await
|
|
810
|
+
const retained = await updateManifestBestEffort(stopped, {
|
|
811
|
+
recoveryMode: "manual",
|
|
812
|
+
handoffMode: "explicit",
|
|
813
|
+
});
|
|
814
|
+
await preserveForRetry(retained, attemptCaptureLimitError, generation);
|
|
724
815
|
return;
|
|
725
816
|
}
|
|
726
817
|
await finalizePersistedRecording(generation);
|
|
@@ -826,9 +917,29 @@ export function useVoiceInput({
|
|
|
826
917
|
}
|
|
827
918
|
const generation = ++generationRef.current;
|
|
828
919
|
controllerRef.current?.abort();
|
|
920
|
+
if (automaticRetryTimerRef.current) clearTimeout(automaticRetryTimerRef.current);
|
|
921
|
+
automaticRetryTimerRef.current = null;
|
|
922
|
+
automaticRetryAttemptRef.current = 0;
|
|
829
923
|
setError(null);
|
|
830
|
-
|
|
831
|
-
|
|
924
|
+
const manifest = manifestRef.current;
|
|
925
|
+
void updateManifestBestEffort(manifest, {
|
|
926
|
+
recoveryMode: "automatic",
|
|
927
|
+
handoffMode: "append",
|
|
928
|
+
}).then((retained) => {
|
|
929
|
+
if (generation !== generationRef.current) return;
|
|
930
|
+
rememberManifest(retained);
|
|
931
|
+
void finalizePersistedRecording(generation);
|
|
932
|
+
});
|
|
933
|
+
}, [
|
|
934
|
+
client,
|
|
935
|
+
disabled,
|
|
936
|
+
enabled,
|
|
937
|
+
finalizePersistedRecording,
|
|
938
|
+
rememberManifest,
|
|
939
|
+
status,
|
|
940
|
+
updateManifestBestEffort,
|
|
941
|
+
workspaceId,
|
|
942
|
+
]);
|
|
832
943
|
|
|
833
944
|
const insertSavedTranscript = useCallback(async (): Promise<void> => {
|
|
834
945
|
const manifest = manifestRef.current;
|
|
@@ -951,10 +1062,12 @@ export function useVoiceInput({
|
|
|
951
1062
|
void discard();
|
|
952
1063
|
return;
|
|
953
1064
|
}
|
|
954
|
-
if (status === "saving" || status === "transcribing") {
|
|
1065
|
+
if (status === "saving" || status === "transcribing" || status === "retrying") {
|
|
955
1066
|
const generation = ++generationRef.current;
|
|
956
1067
|
controllerRef.current?.abort();
|
|
957
1068
|
controllerRef.current = null;
|
|
1069
|
+
if (automaticRetryTimerRef.current) clearTimeout(automaticRetryTimerRef.current);
|
|
1070
|
+
automaticRetryTimerRef.current = null;
|
|
958
1071
|
const captureSettled = status === "saving" ? captureSettledRef.current : Promise.resolve();
|
|
959
1072
|
void captureSettled.then(async () => {
|
|
960
1073
|
const manifest = manifestRef.current;
|
|
@@ -963,6 +1076,8 @@ export function useVoiceInput({
|
|
|
963
1076
|
captureState: "stopped",
|
|
964
1077
|
uploadState: "retrying",
|
|
965
1078
|
transcriptionState: "retrying",
|
|
1079
|
+
recoveryMode: "manual",
|
|
1080
|
+
handoffMode: "explicit",
|
|
966
1081
|
});
|
|
967
1082
|
await preserveForRetry(retained, null, generation);
|
|
968
1083
|
});
|
|
@@ -996,7 +1111,12 @@ export function useVoiceInput({
|
|
|
996
1111
|
{
|
|
997
1112
|
...(current.captureState === "capturing" ? { captureState: "stopped" as const } : {}),
|
|
998
1113
|
...(wasProcessing
|
|
999
|
-
? {
|
|
1114
|
+
? {
|
|
1115
|
+
uploadState: "retrying" as const,
|
|
1116
|
+
transcriptionState: "retrying" as const,
|
|
1117
|
+
recoveryMode: "automatic" as const,
|
|
1118
|
+
handoffMode: "explicit" as const,
|
|
1119
|
+
}
|
|
1000
1120
|
: {}),
|
|
1001
1121
|
ownerId: null,
|
|
1002
1122
|
ownerHeartbeatAt: null,
|
|
@@ -1028,7 +1148,8 @@ export function useVoiceInput({
|
|
|
1028
1148
|
(status === "requesting-permission" ||
|
|
1029
1149
|
status === "recording" ||
|
|
1030
1150
|
status === "saving" ||
|
|
1031
|
-
status === "transcribing"
|
|
1151
|
+
status === "transcribing" ||
|
|
1152
|
+
status === "retrying")
|
|
1032
1153
|
) {
|
|
1033
1154
|
event.preventDefault();
|
|
1034
1155
|
cancel();
|
|
@@ -1043,6 +1164,8 @@ export function useVoiceInput({
|
|
|
1043
1164
|
generationRef.current += 1;
|
|
1044
1165
|
controllerRef.current?.abort();
|
|
1045
1166
|
controllerRef.current = null;
|
|
1167
|
+
if (automaticRetryTimerRef.current) clearTimeout(automaticRetryTimerRef.current);
|
|
1168
|
+
automaticRetryTimerRef.current = null;
|
|
1046
1169
|
const manifest = manifestRef.current;
|
|
1047
1170
|
const ownerReady = ownerIdPromiseRef.current;
|
|
1048
1171
|
stopOwnerHeartbeat();
|
|
@@ -1061,7 +1184,9 @@ export function useVoiceInput({
|
|
|
1061
1184
|
const store = storeRef.current;
|
|
1062
1185
|
if (store && manifest && ownerId) {
|
|
1063
1186
|
const wasProcessing =
|
|
1064
|
-
statusRef.current === "saving" ||
|
|
1187
|
+
statusRef.current === "saving" ||
|
|
1188
|
+
statusRef.current === "transcribing" ||
|
|
1189
|
+
statusRef.current === "retrying";
|
|
1065
1190
|
await store
|
|
1066
1191
|
.updateManifest(
|
|
1067
1192
|
manifest.recordingId,
|
|
@@ -1073,6 +1198,8 @@ export function useVoiceInput({
|
|
|
1073
1198
|
? {
|
|
1074
1199
|
uploadState: "retrying" as const,
|
|
1075
1200
|
transcriptionState: "retrying" as const,
|
|
1201
|
+
recoveryMode: "automatic" as const,
|
|
1202
|
+
handoffMode: "explicit" as const,
|
|
1076
1203
|
}
|
|
1077
1204
|
: {}),
|
|
1078
1205
|
ownerId: null,
|
|
@@ -1232,7 +1359,7 @@ async function transcribePersistedRecording(input: {
|
|
|
1232
1359
|
break;
|
|
1233
1360
|
case "failed": {
|
|
1234
1361
|
if (!remote.recording.retryable) {
|
|
1235
|
-
throw { code: remote.recording.errorCode ?? "unknown" };
|
|
1362
|
+
throw { code: remote.recording.errorCode ?? "unknown", retryable: false };
|
|
1236
1363
|
}
|
|
1237
1364
|
const retried =
|
|
1238
1365
|
remote.recording.segmentCount === 0
|
|
@@ -1247,7 +1374,10 @@ async function transcribePersistedRecording(input: {
|
|
|
1247
1374
|
{ signal: input.signal },
|
|
1248
1375
|
);
|
|
1249
1376
|
if (retried.recording.state === "failed") {
|
|
1250
|
-
throw {
|
|
1377
|
+
throw {
|
|
1378
|
+
code: retried.recording.errorCode ?? "unknown",
|
|
1379
|
+
retryable: retried.recording.retryable,
|
|
1380
|
+
};
|
|
1251
1381
|
}
|
|
1252
1382
|
remote = retried;
|
|
1253
1383
|
scheduleRecoveryMutation(remote);
|
|
@@ -1350,6 +1480,9 @@ function chooseMimeType(accepted: string[]): string | undefined {
|
|
|
1350
1480
|
}
|
|
1351
1481
|
|
|
1352
1482
|
function errorCode(error: unknown): string {
|
|
1483
|
+
if (error instanceof OpenGeniApiError && typeof error.details?.transcriptionCode === "string") {
|
|
1484
|
+
return error.details.transcriptionCode;
|
|
1485
|
+
}
|
|
1353
1486
|
if (error && typeof error === "object" && "code" in error && typeof error.code === "string") {
|
|
1354
1487
|
return error.code;
|
|
1355
1488
|
}
|
|
@@ -1357,3 +1490,14 @@ function errorCode(error: unknown): string {
|
|
|
1357
1490
|
if (error instanceof DOMException && error.name === "NotSupportedError") return "not_supported";
|
|
1358
1491
|
return "unknown";
|
|
1359
1492
|
}
|
|
1493
|
+
|
|
1494
|
+
function isRetryableVoiceInputError(error: unknown): boolean {
|
|
1495
|
+
if (error instanceof OpenGeniApiError) {
|
|
1496
|
+
return error.retryable && error.status !== 409;
|
|
1497
|
+
}
|
|
1498
|
+
if (error instanceof TypeError) return true;
|
|
1499
|
+
if (error && typeof error === "object" && "retryable" in error) {
|
|
1500
|
+
return error.retryable === true;
|
|
1501
|
+
}
|
|
1502
|
+
return false;
|
|
1503
|
+
}
|
|
@@ -108,16 +108,18 @@ export function useWindowedSections(opts: {
|
|
|
108
108
|
Array.from({ length: count }, (_, i) => estimateHeight(i)),
|
|
109
109
|
);
|
|
110
110
|
|
|
111
|
-
// Re-seed
|
|
112
|
-
//
|
|
111
|
+
// Re-seed when the estimate function changes as well as when the count changes.
|
|
112
|
+
// A replacement diff can contain the same number of files but radically
|
|
113
|
+
// different section sizes; retaining measurements by index would then place
|
|
114
|
+
// every unvisited section at an offset belonging to the previous diff.
|
|
113
115
|
useEffect(() => {
|
|
114
116
|
setHeights((prev) => {
|
|
115
|
-
|
|
116
|
-
return
|
|
117
|
+
const next = Array.from({ length: count }, (_, i) => estimateHeight(i));
|
|
118
|
+
return prev.length === next.length && prev.every((height, index) => height === next[index])
|
|
119
|
+
? prev
|
|
120
|
+
: next;
|
|
117
121
|
});
|
|
118
|
-
|
|
119
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
120
|
-
}, [count]);
|
|
122
|
+
}, [count, estimateHeight]);
|
|
121
123
|
|
|
122
124
|
const heightsRef = useRef(heights);
|
|
123
125
|
heightsRef.current = heights;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
2
|
import { useOpenGeni, type ClientOverride } from "../provider";
|
|
3
|
+
import { sandboxAcceptsLiveIo } from "../lib/sandbox-liveness";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* The wake-on-edit state machine. This hook owns the logic and the UI renders
|
|
@@ -73,7 +74,7 @@ export type UseWorkspaceEditResult = {
|
|
|
73
74
|
};
|
|
74
75
|
|
|
75
76
|
function isLive(liveness: string | undefined): boolean {
|
|
76
|
-
return liveness
|
|
77
|
+
return sandboxAcceptsLiveIo(liveness);
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
/**
|
package/src/index.ts
CHANGED
|
@@ -3,14 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
// @opengeni/react — hooks + styled components on @opengeni/sdk.
|
|
5
5
|
//
|
|
6
|
-
// Import the styles once
|
|
7
|
-
//
|
|
8
|
-
//
|
|
6
|
+
// Import the ready-to-use styles once:
|
|
7
|
+
// import "@opengeni/react/compiled.css";
|
|
8
|
+
// Tailwind v4 hosts may instead use the additive styles.css + @source bridge;
|
|
9
|
+
// container-responsive composers additionally import responsive.css.
|
|
9
10
|
|
|
10
11
|
export type {
|
|
12
|
+
EmbeddedBrowserInteractionClientLike,
|
|
13
|
+
EmbeddedComputerInteractionClientLike,
|
|
11
14
|
EmbeddedFileAttachmentClientLike,
|
|
12
15
|
EmbeddedGoalClientLike,
|
|
13
16
|
EmbeddedHumanInputSessionClientLike,
|
|
17
|
+
EmbeddedInteractionClientLike,
|
|
14
18
|
EmbeddedSessionEventClientLike,
|
|
15
19
|
EmbeddedSessionLineageClientLike,
|
|
16
20
|
EmbeddedSessionMcpApprovalPolicyClientLike,
|
|
@@ -21,7 +25,9 @@ export type {
|
|
|
21
25
|
export { OpenGeniProvider } from "./provider";
|
|
22
26
|
export type { OpenGeniProviderProps } from "./provider";
|
|
23
27
|
export { useOpenGeni, useOpenGeniClient } from "./session-context";
|
|
28
|
+
export { useVideoArtifactPlaybackLoader } from "./hooks/use-video-artifact-playback";
|
|
24
29
|
export type { ClientOverride, OpenGeniContextValue } from "./session-context";
|
|
30
|
+
export { usePageLiveActivity } from "./hooks/internal";
|
|
25
31
|
|
|
26
32
|
// Hooks
|
|
27
33
|
export { useSession, isTitleEvent } from "./hooks/use-session";
|
|
@@ -79,7 +85,9 @@ export type {
|
|
|
79
85
|
VoiceRecordingChunk,
|
|
80
86
|
VoiceRecordingChunkUploadState,
|
|
81
87
|
VoiceRecordingFinalizationState,
|
|
88
|
+
VoiceRecordingHandoffMode,
|
|
82
89
|
VoiceRecordingManifest,
|
|
90
|
+
VoiceRecordingRecoveryMode,
|
|
83
91
|
VoiceRecordingStore,
|
|
84
92
|
VoiceRecordingTranscriptionState,
|
|
85
93
|
VoiceRecordingUploadState,
|
|
@@ -229,12 +237,14 @@ export type {
|
|
|
229
237
|
CapturedFileUnavailableReason,
|
|
230
238
|
FileTreeNode,
|
|
231
239
|
FileTreeStatus,
|
|
240
|
+
SandboxFilesGitSummary,
|
|
232
241
|
SandboxWriteFileOptions,
|
|
233
242
|
UseSandboxFilesOptions,
|
|
234
243
|
UseSandboxFilesResult,
|
|
235
244
|
} from "./hooks/use-sandbox-files";
|
|
236
245
|
export { useSandboxGit } from "./hooks/use-sandbox-git";
|
|
237
246
|
export type {
|
|
247
|
+
SandboxGitComparison,
|
|
238
248
|
SandboxGitFileDiff,
|
|
239
249
|
UseSandboxGitOptions,
|
|
240
250
|
UseSandboxGitResult,
|
|
@@ -326,6 +336,9 @@ export {
|
|
|
326
336
|
} from "./timeline";
|
|
327
337
|
export type {
|
|
328
338
|
CreateToolRegistryOptions,
|
|
339
|
+
RetainedArtifactLoader,
|
|
340
|
+
RetainedScreenshotLoader,
|
|
341
|
+
VideoArtifactPlaybackLoader,
|
|
329
342
|
ToolRegistry,
|
|
330
343
|
ToolRegistryEntry,
|
|
331
344
|
ToolRenderer,
|
|
@@ -364,7 +377,7 @@ export type {
|
|
|
364
377
|
TurnSummaryProps,
|
|
365
378
|
} from "./timeline";
|
|
366
379
|
|
|
367
|
-
// Pure provider-shape parsers (exec banner, V4A diff,
|
|
380
|
+
// Pure provider-shape parsers (exec banner, V4A diff, tool arguments, …)
|
|
368
381
|
export {
|
|
369
382
|
applyPatchOps,
|
|
370
383
|
applyPatchOpsFromToolItem,
|
|
@@ -376,7 +389,6 @@ export {
|
|
|
376
389
|
parseExecBannerSessionId,
|
|
377
390
|
parseFreeformApplyPatch,
|
|
378
391
|
parseToolArgs,
|
|
379
|
-
redactSecrets,
|
|
380
392
|
sandboxCommandExitCode,
|
|
381
393
|
stripExecBanner,
|
|
382
394
|
tailPeek,
|
|
@@ -423,7 +435,7 @@ export type {
|
|
|
423
435
|
ComposerTranscriptionMessages,
|
|
424
436
|
} from "./components/composer-transcription-control";
|
|
425
437
|
export { defaultChatComposerMessages } from "./components/composer";
|
|
426
|
-
export type { ChatComposerMessages } from "./components/composer";
|
|
438
|
+
export type { ChatComposerMessages, ResponsiveBasis } from "./components/composer";
|
|
427
439
|
export { ModelPicker } from "./components/model-picker";
|
|
428
440
|
export type { ModelPickerProps } from "./components/model-picker";
|
|
429
441
|
export {
|
|
@@ -459,6 +471,8 @@ export {
|
|
|
459
471
|
} from "./model-policy";
|
|
460
472
|
export type { LatencyModeId, PickerBillingClass, PickerModelRow } from "./model-policy";
|
|
461
473
|
export { MessageTimeline, TimelineRow } from "./components/message-timeline";
|
|
474
|
+
export { GeneratedVideoPlayer } from "./components/generated-video-player";
|
|
475
|
+
export type { GeneratedVideoPlayerProps } from "./components/generated-video-player";
|
|
462
476
|
export type { MessageTimelineProps } from "./components/message-timeline";
|
|
463
477
|
export { UserMessageBody, userMessageLikelyNeedsDisclosure } from "./components/user-message-body";
|
|
464
478
|
export type { UserMessageBodyProps } from "./components/user-message-body";
|
|
@@ -506,6 +520,7 @@ export {
|
|
|
506
520
|
WORKBENCH_TAB_CHANGES,
|
|
507
521
|
WORKBENCH_TAB_FILES,
|
|
508
522
|
WORKBENCH_TAB_TERMINAL,
|
|
523
|
+
WORKBENCH_TAB_BROWSER,
|
|
509
524
|
WORKBENCH_TAB_DESKTOP,
|
|
510
525
|
WORKBENCH_SURFACES,
|
|
511
526
|
} from "./components/sandbox-workspace";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// @opengeni/react/interaction — standalone Browser/Computer resource UI.
|
|
2
|
+
// Framework hosts may pass a narrow structural client instead of the full provider.
|
|
3
|
+
export type {
|
|
4
|
+
EmbeddedBrowserInteractionClientLike,
|
|
5
|
+
EmbeddedComputerInteractionClientLike,
|
|
6
|
+
EmbeddedInteractionClientLike,
|
|
7
|
+
} from "./client";
|
|
8
|
+
export {
|
|
9
|
+
useEmbeddedBrowserInteraction,
|
|
10
|
+
useEmbeddedComputerInteraction,
|
|
11
|
+
useEmbeddedInteraction,
|
|
12
|
+
} from "./session-context";
|
|
13
|
+
export type {
|
|
14
|
+
EmbeddedBrowserInteractionClientOverride,
|
|
15
|
+
EmbeddedComputerInteractionClientOverride,
|
|
16
|
+
EmbeddedInteractionClientOverride,
|
|
17
|
+
} from "./session-context";
|
|
18
|
+
export { useAttachedBrowsers } from "./hooks/use-attached-browsers";
|
|
19
|
+
export type {
|
|
20
|
+
AttachedBrowsersClient,
|
|
21
|
+
UseAttachedBrowsersOptions,
|
|
22
|
+
UseAttachedBrowsersResult,
|
|
23
|
+
} from "./hooks/use-attached-browsers";
|
|
24
|
+
export { useBrowserSessions } from "./hooks/use-browser-sessions";
|
|
25
|
+
export type {
|
|
26
|
+
BrowserSessionsClient,
|
|
27
|
+
UseBrowserSessionsOptions,
|
|
28
|
+
UseBrowserSessionsResult,
|
|
29
|
+
} from "./hooks/use-browser-sessions";
|
|
30
|
+
export { useBrowserIdentities } from "./hooks/use-browser-identities";
|
|
31
|
+
export type {
|
|
32
|
+
BrowserIdentitiesClient,
|
|
33
|
+
UseBrowserIdentitiesOptions,
|
|
34
|
+
UseBrowserIdentitiesResult,
|
|
35
|
+
} from "./hooks/use-browser-identities";
|
|
36
|
+
export { useBrowserSession } from "./hooks/use-browser-session";
|
|
37
|
+
export type {
|
|
38
|
+
UseBrowserSessionOptions,
|
|
39
|
+
UseBrowserSessionResult,
|
|
40
|
+
} from "./hooks/use-browser-session";
|
|
41
|
+
export { useBrowserFrameStream } from "./hooks/use-browser-frame-stream";
|
|
42
|
+
export type {
|
|
43
|
+
BrowserFrameConnectionState,
|
|
44
|
+
BrowserFrameWebSocket,
|
|
45
|
+
BrowserFrameWebSocketFactory,
|
|
46
|
+
UseBrowserFrameStreamOptions,
|
|
47
|
+
UseBrowserFrameStreamResult,
|
|
48
|
+
} from "./hooks/use-browser-frame-stream";
|
|
49
|
+
export { BrowserViewer } from "./components/browser-viewer";
|
|
50
|
+
export type { BrowserViewerNotification, BrowserViewerProps } from "./components/browser-viewer";
|
|
51
|
+
export { useComputerSessions } from "./hooks/use-computer-sessions";
|
|
52
|
+
export type {
|
|
53
|
+
ComputerSessionsClient,
|
|
54
|
+
UseComputerSessionsOptions,
|
|
55
|
+
UseComputerSessionsResult,
|
|
56
|
+
} from "./hooks/use-computer-sessions";
|
|
57
|
+
export { useComputerSession } from "./hooks/use-computer-session";
|
|
58
|
+
export type {
|
|
59
|
+
UseComputerSessionOptions,
|
|
60
|
+
UseComputerSessionResult,
|
|
61
|
+
} from "./hooks/use-computer-session";
|
|
62
|
+
export { useComputerFrameStream } from "./hooks/use-computer-frame-stream";
|
|
63
|
+
export type {
|
|
64
|
+
ComputerFrameConnectionState,
|
|
65
|
+
ComputerFrameWebSocket,
|
|
66
|
+
ComputerFrameWebSocketFactory,
|
|
67
|
+
UseComputerFrameStreamOptions,
|
|
68
|
+
UseComputerFrameStreamResult,
|
|
69
|
+
} from "./hooks/use-computer-frame-stream";
|
|
70
|
+
export { ComputerViewer } from "./components/computer-viewer";
|
|
71
|
+
export type { ComputerViewerNotification, ComputerViewerProps } from "./components/computer-viewer";
|