@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
|
@@ -1,19 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip,
|
|
3
|
+
TooltipContent,
|
|
4
|
+
TooltipProvider,
|
|
5
|
+
TooltipTrigger
|
|
6
|
+
} from "./chunk-FK6VG4LL.js";
|
|
1
7
|
import {
|
|
2
8
|
EmptyQueueStateSurface,
|
|
9
|
+
TimelineAnnotationsChip,
|
|
3
10
|
requestQueueDraftEdit
|
|
4
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WSK7G5LE.js";
|
|
12
|
+
import {
|
|
13
|
+
usePortalTokenStyle
|
|
14
|
+
} from "./chunk-VZTQ73XT.js";
|
|
5
15
|
import {
|
|
6
16
|
buildTimeline,
|
|
7
17
|
groupTimeline,
|
|
8
18
|
mcpToolLeaf,
|
|
9
19
|
toolDisplayName
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
Tooltip,
|
|
13
|
-
TooltipContent,
|
|
14
|
-
TooltipProvider,
|
|
15
|
-
TooltipTrigger
|
|
16
|
-
} from "./chunk-U3CSCMWA.js";
|
|
20
|
+
} from "./chunk-JR3QFY6B.js";
|
|
17
21
|
import {
|
|
18
22
|
formatClockTime,
|
|
19
23
|
formatRelativeTime,
|
|
@@ -24,12 +28,16 @@ import {
|
|
|
24
28
|
import {
|
|
25
29
|
cn
|
|
26
30
|
} from "./chunk-22KP6LR5.js";
|
|
31
|
+
import {
|
|
32
|
+
copyTextToClipboard,
|
|
33
|
+
tableElementToTsv
|
|
34
|
+
} from "./chunk-JVYQRRC4.js";
|
|
27
35
|
|
|
28
36
|
// src/components/queue-surface.tsx
|
|
29
37
|
import { Loader2Icon } from "lucide-react";
|
|
30
38
|
import { lazy, Suspense } from "react";
|
|
31
39
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
32
|
-
var loadQueueSurface = () => import("./queue-surface-implementation-
|
|
40
|
+
var loadQueueSurface = () => import("./queue-surface-implementation-2KVJTYXH.js");
|
|
33
41
|
var QueueSurface = createQueueSurface(loadQueueSurface);
|
|
34
42
|
function createQueueSurface(loadImplementation) {
|
|
35
43
|
const LazyQueueSurface = lazy(async () => ({
|
|
@@ -221,6 +229,8 @@ function SessionChrome({
|
|
|
221
229
|
queuedTurns: currentTurnId ? turns.filter((turn) => turn.id !== currentTurnId) : turns
|
|
222
230
|
};
|
|
223
231
|
}, [composerSteering, queue.pendingByTurn, turns]);
|
|
232
|
+
const stoppingKind = composer?.stoppingAttempt ?? (queue.stoppingPreviousAttempt ? queue.effectiveControl?.state === "paused" ? "current" : "previous" : null);
|
|
233
|
+
const stopping = stoppingKind !== null;
|
|
224
234
|
const canMutateQueue = !readOnly && composer !== void 0;
|
|
225
235
|
const liveGoal = record?.status === "active" && record.continuation?.state === "running" && record.continuation.reason === "goal_turn_running";
|
|
226
236
|
const elapsed = useLiveElapsed(
|
|
@@ -243,13 +253,13 @@ function SessionChrome({
|
|
|
243
253
|
icon: /* @__PURE__ */ jsx2(InboxIcon, { className: "size-3" })
|
|
244
254
|
});
|
|
245
255
|
}
|
|
246
|
-
if (steering) {
|
|
256
|
+
if (steering || stopping) {
|
|
247
257
|
rows.push({
|
|
248
258
|
id: "steering",
|
|
249
|
-
label: "Changing direction\u2026",
|
|
250
|
-
detail: steering.text,
|
|
251
|
-
tone: "accent",
|
|
252
|
-
icon: steering
|
|
259
|
+
label: stopping ? stoppingKind === "current" ? "Stopping current work\u2026" : "Stopping previous work\u2026" : "Changing direction\u2026",
|
|
260
|
+
...steering?.text ? { detail: steering.text } : {},
|
|
261
|
+
tone: stopping ? "waiting" : "accent",
|
|
262
|
+
icon: steering?.phase === "submitting" || stopping ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx2(ZapIcon, { className: "size-3" })
|
|
253
263
|
});
|
|
254
264
|
}
|
|
255
265
|
if (queuedTurns.length > 0) {
|
|
@@ -288,7 +298,17 @@ function SessionChrome({
|
|
|
288
298
|
});
|
|
289
299
|
}
|
|
290
300
|
return rows;
|
|
291
|
-
}, [
|
|
301
|
+
}, [
|
|
302
|
+
agentsSignal,
|
|
303
|
+
elapsed,
|
|
304
|
+
goalState,
|
|
305
|
+
incoming,
|
|
306
|
+
queuedTurns,
|
|
307
|
+
record,
|
|
308
|
+
steering,
|
|
309
|
+
stopping,
|
|
310
|
+
stoppingKind
|
|
311
|
+
]);
|
|
292
312
|
const [activeUncontrolled, setActiveUncontrolled] = useState(
|
|
293
313
|
defaultActive
|
|
294
314
|
);
|
|
@@ -372,7 +392,14 @@ function SessionChrome({
|
|
|
372
392
|
const shellDuration = reduceMotion ? 0 : 0.22;
|
|
373
393
|
const crossfadeDuration = reduceMotion ? 0 : 0.18;
|
|
374
394
|
const ease = [0.22, 1, 0.36, 1];
|
|
375
|
-
const panelBody = active === "incoming" ? /* @__PURE__ */ jsx2(IncomingPanel, { inputs: incoming, onDismiss: onDismissIncoming }) : active === "steering" &&
|
|
395
|
+
const panelBody = active === "incoming" ? /* @__PURE__ */ jsx2(IncomingPanel, { inputs: incoming, onDismiss: onDismissIncoming }) : active === "steering" && (steering || stopping) ? /* @__PURE__ */ jsx2(
|
|
396
|
+
SteeringPanel,
|
|
397
|
+
{
|
|
398
|
+
phase: stopping ? "stopping" : steering?.phase ?? "accepted",
|
|
399
|
+
stoppingKind,
|
|
400
|
+
text: steering?.text
|
|
401
|
+
}
|
|
402
|
+
) : active === "queue" ? /* @__PURE__ */ jsx2(
|
|
376
403
|
QueuePanel,
|
|
377
404
|
{
|
|
378
405
|
turns: queuedTurns,
|
|
@@ -426,12 +453,12 @@ function SessionChrome({
|
|
|
426
453
|
"transition-[background-color,border-color,box-shadow] motion-reduce:transition-none"
|
|
427
454
|
),
|
|
428
455
|
style: {
|
|
429
|
-
borderRadius: "var(--
|
|
430
|
-
background: open ? "var(--
|
|
431
|
-
borderColor: open ? "var(--
|
|
456
|
+
borderRadius: "var(--_og-session-chrome-radius)",
|
|
457
|
+
background: open ? "var(--_og-session-chrome-surface-open)" : "var(--_og-session-chrome-surface)",
|
|
458
|
+
borderColor: open ? "var(--_og-session-chrome-border-open)" : "var(--_og-session-chrome-border)",
|
|
432
459
|
boxShadow: open ? "var(--og-session-chrome-shadow-open)" : "var(--og-session-chrome-shadow)",
|
|
433
460
|
transitionDuration: "var(--og-session-chrome-duration)",
|
|
434
|
-
transitionTimingFunction: "var(--
|
|
461
|
+
transitionTimingFunction: "var(--_og-session-chrome-ease)"
|
|
435
462
|
},
|
|
436
463
|
children: [
|
|
437
464
|
/* @__PURE__ */ jsx2(
|
|
@@ -459,8 +486,8 @@ function SessionChrome({
|
|
|
459
486
|
"aria-hidden": true,
|
|
460
487
|
className: "pointer-events-none absolute left-0 top-0 rounded-og-md",
|
|
461
488
|
style: {
|
|
462
|
-
background: "var(--
|
|
463
|
-
boxShadow: "inset 0 0 0 1px var(--
|
|
489
|
+
background: "var(--_og-session-chrome-highlight)",
|
|
490
|
+
boxShadow: "inset 0 0 0 1px var(--_og-session-chrome-highlight-ring)"
|
|
464
491
|
},
|
|
465
492
|
initial: false,
|
|
466
493
|
animate: {
|
|
@@ -489,7 +516,7 @@ function SessionChrome({
|
|
|
489
516
|
"data-og-session-chrome-signal": signal.id,
|
|
490
517
|
onClick: () => setActive(selected ? null : signal.id),
|
|
491
518
|
className: cn(
|
|
492
|
-
"group relative z-[1] inline-flex min-h-[var(--og-session-chrome-chip-min-height)] max-w-full items-center gap-1 rounded-og-md py-1 text-left text-og-xs outline-
|
|
519
|
+
"group relative z-[1] inline-flex min-h-[var(--og-session-chrome-chip-min-height)] max-w-full items-center gap-1 rounded-og-md py-1 text-left text-og-xs outline-hidden",
|
|
493
520
|
// Coarse pointers keep a 44px target (session-pins acceptance).
|
|
494
521
|
"pointer-coarse:min-h-11",
|
|
495
522
|
"transition-colors duration-150 motion-reduce:transition-none",
|
|
@@ -588,7 +615,7 @@ function IncomingPanel({
|
|
|
588
615
|
children: inputs.map((input) => /* @__PURE__ */ jsxs2(
|
|
589
616
|
"li",
|
|
590
617
|
{
|
|
591
|
-
className: "group flex items-start gap-1.5 rounded-og-sm px-1.5 py-1 transition-colors hover:bg-[var(--
|
|
618
|
+
className: "group flex items-start gap-1.5 rounded-og-sm px-1.5 py-1 transition-colors hover:bg-[var(--_og-session-chrome-row-hover)]",
|
|
592
619
|
children: [
|
|
593
620
|
/* @__PURE__ */ jsx2(
|
|
594
621
|
"span",
|
|
@@ -618,7 +645,11 @@ function IncomingPanel({
|
|
|
618
645
|
}
|
|
619
646
|
);
|
|
620
647
|
}
|
|
621
|
-
function SteeringPanel({
|
|
648
|
+
function SteeringPanel({
|
|
649
|
+
phase,
|
|
650
|
+
stoppingKind,
|
|
651
|
+
text
|
|
652
|
+
}) {
|
|
622
653
|
return /* @__PURE__ */ jsxs2(
|
|
623
654
|
"div",
|
|
624
655
|
{
|
|
@@ -627,10 +658,10 @@ function SteeringPanel({ phase, text }) {
|
|
|
627
658
|
"aria-live": "polite",
|
|
628
659
|
"data-og-session-chrome-panel": "steering",
|
|
629
660
|
children: [
|
|
630
|
-
/* @__PURE__ */ jsx2("span", { className: "mt-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-full bg-og-accent-soft text-og-accent", children: phase === "submitting" ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin", "aria-hidden": "true" }) : /* @__PURE__ */ jsx2(ZapIcon, { className: "size-3", "aria-hidden": "true" }) }),
|
|
661
|
+
/* @__PURE__ */ jsx2("span", { className: "mt-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-full bg-og-accent-soft text-og-accent", children: phase === "submitting" || phase === "stopping" ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin", "aria-hidden": "true" }) : /* @__PURE__ */ jsx2(ZapIcon, { className: "size-3", "aria-hidden": "true" }) }),
|
|
631
662
|
/* @__PURE__ */ jsxs2("div", { className: "min-w-0", children: [
|
|
632
|
-
/* @__PURE__ */ jsx2("p", { className: "truncate text-og-xs font-medium leading-4 text-og-fg", children: text }),
|
|
633
|
-
/* @__PURE__ */ jsx2("p", { className: "mt-0.5 text-[10px] leading-4 text-og-fg-muted", children: phase === "submitting" ? "Sending your latest direction\u2026" : "Direction accepted. The agent will continue from it." })
|
|
663
|
+
text ? /* @__PURE__ */ jsx2("p", { className: "truncate text-og-xs font-medium leading-4 text-og-fg", children: text }) : null,
|
|
664
|
+
/* @__PURE__ */ jsx2("p", { className: cn(text && "mt-0.5", "text-[10px] leading-4 text-og-fg-muted"), children: phase === "submitting" ? "Sending your latest direction\u2026" : phase === "stopping" ? stoppingKind === "previous" ? "Direction saved. Waiting for the previous command to stop safely." : "Waiting for the current command to stop safely." : "Direction accepted. The agent will continue from it." })
|
|
634
665
|
] })
|
|
635
666
|
]
|
|
636
667
|
}
|
|
@@ -666,7 +697,7 @@ function QueuePanel({
|
|
|
666
697
|
"li",
|
|
667
698
|
{
|
|
668
699
|
"data-queue-turn-id": turn.id,
|
|
669
|
-
className: "group flex flex-col gap-1 rounded-og-sm px-1.5 py-1 transition-colors hover:bg-[var(--
|
|
700
|
+
className: "group flex flex-col gap-1 rounded-og-sm px-1.5 py-1 transition-colors hover:bg-[var(--_og-session-chrome-row-hover)]",
|
|
670
701
|
children: [
|
|
671
702
|
/* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-1.5", children: [
|
|
672
703
|
voice ? /* @__PURE__ */ jsx2(
|
|
@@ -811,7 +842,7 @@ function GoalPanel({
|
|
|
811
842
|
type: "button",
|
|
812
843
|
disabled: goal.updating,
|
|
813
844
|
onClick: () => void (record.status === "paused" ? goal.resume() : goal.pause("Paused from session chrome")),
|
|
814
|
-
className: "inline-flex h-6 items-center gap-1 rounded-og-sm px-1.5 text-og-xs font-medium text-og-fg-muted outline-
|
|
845
|
+
className: "inline-flex h-6 items-center gap-1 rounded-og-sm px-1.5 text-og-xs font-medium text-og-fg-muted outline-hidden transition-colors hover:bg-og-surface-3/70 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:opacity-50",
|
|
815
846
|
children: [
|
|
816
847
|
goal.updating ? /* @__PURE__ */ jsx2(Loader2Icon2, { className: "size-3 animate-og-spin" }) : record.status === "paused" ? /* @__PURE__ */ jsx2(PlayIcon, { className: "size-3" }) : /* @__PURE__ */ jsx2(PauseIcon, { className: "size-3" }),
|
|
817
848
|
record.status === "paused" ? "Resume" : "Pause"
|
|
@@ -824,7 +855,7 @@ function GoalPanel({
|
|
|
824
855
|
type: "button",
|
|
825
856
|
disabled: goal.updating,
|
|
826
857
|
onClick: () => void goal.deleteGoal(),
|
|
827
|
-
className: "inline-flex h-6 items-center gap-1 rounded-og-sm px-1.5 text-og-xs font-medium text-og-fg-subtle outline-
|
|
858
|
+
className: "inline-flex h-6 items-center gap-1 rounded-og-sm px-1.5 text-og-xs font-medium text-og-fg-subtle outline-hidden transition-colors hover:bg-og-surface-3/70 hover:text-og-danger focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:opacity-50",
|
|
828
859
|
children: [
|
|
829
860
|
/* @__PURE__ */ jsx2(Trash2Icon, { className: "size-3" }),
|
|
830
861
|
"Clear"
|
|
@@ -858,7 +889,7 @@ function IconAction({
|
|
|
858
889
|
disabled,
|
|
859
890
|
onClick,
|
|
860
891
|
className: cn(
|
|
861
|
-
"inline-flex size-6 items-center justify-center rounded-og-sm text-og-fg-subtle outline-
|
|
892
|
+
"inline-flex size-6 items-center justify-center rounded-og-sm text-og-fg-subtle outline-hidden transition-colors",
|
|
862
893
|
"hover:bg-og-surface-2 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/40",
|
|
863
894
|
"disabled:pointer-events-none disabled:opacity-40 pointer-coarse:size-9",
|
|
864
895
|
danger && "hover:text-og-danger"
|
|
@@ -1275,7 +1306,7 @@ function QuestionControls({
|
|
|
1275
1306
|
"aria-describedby": describedBy,
|
|
1276
1307
|
autoFocus,
|
|
1277
1308
|
rows: 2,
|
|
1278
|
-
className: "min-h-14 w-full resize-y rounded-og-md border border-og-border bg-og-surface-1 px-3 py-2 text-og-sm text-og-fg outline-
|
|
1309
|
+
className: "min-h-14 w-full resize-y rounded-og-md border border-og-border bg-og-surface-1 px-3 py-2 text-og-sm text-og-fg outline-hidden placeholder:text-og-fg-subtle focus:border-og-accent"
|
|
1279
1310
|
}
|
|
1280
1311
|
) : /* @__PURE__ */ jsxs3(
|
|
1281
1312
|
"div",
|
|
@@ -1354,7 +1385,7 @@ function QuestionControls({
|
|
|
1354
1385
|
...current,
|
|
1355
1386
|
other: event.target.value
|
|
1356
1387
|
})),
|
|
1357
|
-
className: "mt-1.5 w-full rounded-og-sm border border-og-border bg-og-surface-1 px-2 py-1.5 text-og-sm text-og-fg outline-
|
|
1388
|
+
className: "mt-1.5 w-full rounded-og-sm border border-og-border bg-og-surface-1 px-2 py-1.5 text-og-sm text-og-fg outline-hidden focus:border-og-accent disabled:opacity-50"
|
|
1358
1389
|
}
|
|
1359
1390
|
)
|
|
1360
1391
|
] })
|
|
@@ -1517,7 +1548,10 @@ function createToolRegistry(baseEntries, baseFallback, options = {}) {
|
|
|
1517
1548
|
}
|
|
1518
1549
|
|
|
1519
1550
|
// src/timeline/parsers.ts
|
|
1520
|
-
import {
|
|
1551
|
+
import {
|
|
1552
|
+
normalizeMcpOutput,
|
|
1553
|
+
parseGeneratedImageReceipt
|
|
1554
|
+
} from "@opengeni/sdk";
|
|
1521
1555
|
function sandboxCommandExitCode(out) {
|
|
1522
1556
|
const match = String(out ?? "").match(/Process exited with code (-?\d+)/);
|
|
1523
1557
|
return match ? Number(match[1]) : null;
|
|
@@ -1822,20 +1856,6 @@ function isApplyPatch(item) {
|
|
|
1822
1856
|
const name = item.name;
|
|
1823
1857
|
return name === "apply_patch_call" || name === "apply_patch" || name.endsWith("__apply_patch");
|
|
1824
1858
|
}
|
|
1825
|
-
var SECRET_KEY = /^(value|secret|token|password|api[_-]?key|signing[_-]?key)$/i;
|
|
1826
|
-
function redactSecrets(value) {
|
|
1827
|
-
if (Array.isArray(value)) {
|
|
1828
|
-
return value.map(redactSecrets);
|
|
1829
|
-
}
|
|
1830
|
-
if (value && typeof value === "object") {
|
|
1831
|
-
const out = {};
|
|
1832
|
-
for (const [k, v] of Object.entries(value)) {
|
|
1833
|
-
out[k] = SECRET_KEY.test(k) ? "\u2022\u2022\u2022\u2022" : redactSecrets(v);
|
|
1834
|
-
}
|
|
1835
|
-
return out;
|
|
1836
|
-
}
|
|
1837
|
-
return value;
|
|
1838
|
-
}
|
|
1839
1859
|
function parseToolArgs(args) {
|
|
1840
1860
|
if (args == null) {
|
|
1841
1861
|
return {};
|
|
@@ -1907,6 +1927,29 @@ function screenshotDataUrl(out) {
|
|
|
1907
1927
|
}
|
|
1908
1928
|
return null;
|
|
1909
1929
|
}
|
|
1930
|
+
function retainedScreenshotMetadata(out) {
|
|
1931
|
+
if (typeof out === "string" && (out.startsWith("{") || out.startsWith("["))) {
|
|
1932
|
+
const parsed = tryParseJson(out);
|
|
1933
|
+
if (parsed !== void 0 && parsed !== out) return retainedScreenshotMetadata(parsed);
|
|
1934
|
+
}
|
|
1935
|
+
if (Array.isArray(out)) {
|
|
1936
|
+
for (const entry of out) {
|
|
1937
|
+
const metadata = retainedScreenshotMetadata(entry);
|
|
1938
|
+
if (metadata) return metadata;
|
|
1939
|
+
}
|
|
1940
|
+
return null;
|
|
1941
|
+
}
|
|
1942
|
+
if (!out || typeof out !== "object") return null;
|
|
1943
|
+
const value = out;
|
|
1944
|
+
if (typeof value.artifactId !== "string" || typeof value.available !== "boolean") return null;
|
|
1945
|
+
if (!value.available) {
|
|
1946
|
+
return typeof value.reason === "string" ? value : null;
|
|
1947
|
+
}
|
|
1948
|
+
return value.kind === "computer_screenshot" && value.contentType === "image/png" && typeof value.originalBytes === "number" && typeof value.sha256 === "string" && value.dimensions !== null && typeof value.dimensions === "object" && value.retention !== null && typeof value.retention === "object" && value.retention.policy === "session_screenshot" ? value : null;
|
|
1949
|
+
}
|
|
1950
|
+
function generatedImageReceipt(out) {
|
|
1951
|
+
return parseGeneratedImageReceipt(out);
|
|
1952
|
+
}
|
|
1910
1953
|
function mediaPreviewFact(out) {
|
|
1911
1954
|
if (typeof out === "string" && (out.startsWith("{") || out.startsWith("["))) {
|
|
1912
1955
|
const parsed = tryParseJson(out);
|
|
@@ -1998,13 +2041,23 @@ function LightboxProvider({ children }) {
|
|
|
1998
2041
|
}
|
|
1999
2042
|
function LightboxRoot({ children }) {
|
|
2000
2043
|
const [state, setState] = useState3(null);
|
|
2001
|
-
const
|
|
2002
|
-
|
|
2044
|
+
const [tokenSource, setTokenSource] = useState3(null);
|
|
2045
|
+
const portalStyle = usePortalTokenStyle(tokenSource);
|
|
2046
|
+
const open = useCallback(
|
|
2047
|
+
(src, caption, source, label = "Screenshot") => {
|
|
2048
|
+
setTokenSource(source ?? null);
|
|
2049
|
+
setState(caption ? { src, caption, label } : { src, label });
|
|
2050
|
+
},
|
|
2051
|
+
[]
|
|
2052
|
+
);
|
|
2053
|
+
const close = useCallback(() => {
|
|
2054
|
+
setState(null);
|
|
2055
|
+
setTokenSource(null);
|
|
2003
2056
|
}, []);
|
|
2004
2057
|
const controller = useMemo3(() => ({ open }), [open]);
|
|
2005
2058
|
return /* @__PURE__ */ jsxs4(LightboxContext.Provider, { value: controller, children: [
|
|
2006
2059
|
children,
|
|
2007
|
-
/* @__PURE__ */ jsx6(Dialog.Root, { open: state !== null, onOpenChange: (next) => !next &&
|
|
2060
|
+
/* @__PURE__ */ jsx6(Dialog.Root, { open: state !== null, onOpenChange: (next) => !next && close(), children: /* @__PURE__ */ jsx6(AnimatePresence2, { children: state !== null ? /* @__PURE__ */ jsxs4(Dialog.Portal, { forceMount: true, children: [
|
|
2008
2061
|
/* @__PURE__ */ jsx6(Dialog.Overlay, { asChild: true, forceMount: true, children: /* @__PURE__ */ jsx6(
|
|
2009
2062
|
motion2.div,
|
|
2010
2063
|
{
|
|
@@ -2012,7 +2065,8 @@ function LightboxRoot({ children }) {
|
|
|
2012
2065
|
animate: { opacity: 1 },
|
|
2013
2066
|
exit: { opacity: 0 },
|
|
2014
2067
|
transition: { duration: 0.15 },
|
|
2015
|
-
className: "og-root fixed inset-0 z-50 bg-black/90 backdrop-blur-md"
|
|
2068
|
+
className: "og-root fixed inset-0 z-50 bg-black/90 backdrop-blur-md",
|
|
2069
|
+
style: portalStyle
|
|
2016
2070
|
}
|
|
2017
2071
|
) }),
|
|
2018
2072
|
/* @__PURE__ */ jsx6(
|
|
@@ -2020,7 +2074,7 @@ function LightboxRoot({ children }) {
|
|
|
2020
2074
|
{
|
|
2021
2075
|
asChild: true,
|
|
2022
2076
|
forceMount: true,
|
|
2023
|
-
"aria-label":
|
|
2077
|
+
"aria-label": state.label,
|
|
2024
2078
|
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
2025
2079
|
children: /* @__PURE__ */ jsxs4(
|
|
2026
2080
|
motion2.div,
|
|
@@ -2031,19 +2085,21 @@ function LightboxRoot({ children }) {
|
|
|
2031
2085
|
transition: { duration: 0.18, ease: [0.16, 1, 0.3, 1] },
|
|
2032
2086
|
onClick: (event) => {
|
|
2033
2087
|
if (event.target === event.currentTarget) {
|
|
2034
|
-
|
|
2088
|
+
close();
|
|
2035
2089
|
}
|
|
2036
2090
|
},
|
|
2037
2091
|
className: "og-root fixed inset-0 z-50 flex items-center justify-center p-6 sm:p-12",
|
|
2092
|
+
style: portalStyle,
|
|
2038
2093
|
children: [
|
|
2039
|
-
/* @__PURE__ */ jsx6(Dialog.Title, { className: "sr-only", children:
|
|
2094
|
+
/* @__PURE__ */ jsx6(Dialog.Title, { className: "sr-only", children: state.label }),
|
|
2095
|
+
/* @__PURE__ */ jsx6(Dialog.Description, { className: "sr-only", children: state.caption ?? `Expanded ${state.label.toLowerCase()}` }),
|
|
2040
2096
|
/* @__PURE__ */ jsxs4("figure", { className: "m-0 flex max-h-full max-w-5xl flex-col items-center gap-3", children: [
|
|
2041
2097
|
/* @__PURE__ */ jsxs4("div", { className: "relative flex min-h-0 w-fit max-w-full", children: [
|
|
2042
2098
|
/* @__PURE__ */ jsx6(
|
|
2043
2099
|
"img",
|
|
2044
2100
|
{
|
|
2045
2101
|
src: state.src,
|
|
2046
|
-
alt: state.caption ??
|
|
2102
|
+
alt: state.caption ?? state.label,
|
|
2047
2103
|
className: "min-h-0 max-h-[82vh] w-auto max-w-full rounded-og-md border border-white/10 object-contain shadow-og-lg"
|
|
2048
2104
|
}
|
|
2049
2105
|
),
|
|
@@ -2073,8 +2129,15 @@ function LightboxRoot({ children }) {
|
|
|
2073
2129
|
|
|
2074
2130
|
// src/timeline/shared.tsx
|
|
2075
2131
|
import { CameraIcon, CameraOffIcon, ChevronRightIcon } from "lucide-react";
|
|
2076
|
-
import { useState as useState4 } from "react";
|
|
2132
|
+
import { createContext as createContext3, useContext as useContext3, useState as useState4 } from "react";
|
|
2077
2133
|
import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2134
|
+
var ToolCallTruncationContext = createContext3(null);
|
|
2135
|
+
function ToolCallTruncationProvider({
|
|
2136
|
+
value,
|
|
2137
|
+
children
|
|
2138
|
+
}) {
|
|
2139
|
+
return /* @__PURE__ */ jsx7(ToolCallTruncationContext.Provider, { value, children });
|
|
2140
|
+
}
|
|
2078
2141
|
var ICON_TONE = {
|
|
2079
2142
|
accent: "text-og-accent",
|
|
2080
2143
|
failed: "text-og-status-failed",
|
|
@@ -2093,13 +2156,15 @@ function ActivityDisclosure({
|
|
|
2093
2156
|
failed,
|
|
2094
2157
|
cancelled,
|
|
2095
2158
|
expandable = true,
|
|
2159
|
+
defaultOpen,
|
|
2096
2160
|
children
|
|
2097
2161
|
}) {
|
|
2098
2162
|
const iconTone = failed && iconToneProp === "muted" ? "failed" : iconToneProp;
|
|
2099
2163
|
const chip = chipProp ?? (failed ? { tone: "bad", text: "failed" } : cancelled ? { tone: "interrupted", text: "interrupted" } : void 0);
|
|
2100
2164
|
const forcedDefaultOpen = useForcedDefaultOpen();
|
|
2101
|
-
const [open, setOpen] = useState4(forcedDefaultOpen ?? false);
|
|
2102
|
-
const
|
|
2165
|
+
const [open, setOpen] = useState4(defaultOpen ?? forcedDefaultOpen ?? false);
|
|
2166
|
+
const truncation = useContext3(ToolCallTruncationContext);
|
|
2167
|
+
const hasBody = expandable && (children != null || truncation != null);
|
|
2103
2168
|
const previewVisible = preview != null && !open;
|
|
2104
2169
|
const rowClass = cn(
|
|
2105
2170
|
"group/disclosure flex w-full min-w-0 items-center gap-2 rounded-og-sm px-1.5 py-1.5 text-left text-og-base",
|
|
@@ -2109,7 +2174,7 @@ function ActivityDisclosure({
|
|
|
2109
2174
|
"pointer-coarse:min-h-11 pointer-coarse:py-2.5"
|
|
2110
2175
|
);
|
|
2111
2176
|
const inner = /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
2112
|
-
hasBody ? /* @__PURE__ */ jsx7(ChevronRightIcon, { className: "size-3.5 shrink-0 text-og-fg-subtle transition-transform duration-[var(--
|
|
2177
|
+
hasBody ? /* @__PURE__ */ jsx7(ChevronRightIcon, { className: "size-3.5 shrink-0 text-og-fg-subtle transition-transform duration-[var(--_og-duration-disclose)] ease-og-in-out group-data-[state=open]/disclosure:rotate-90" }) : /* @__PURE__ */ jsx7("span", { className: "size-3.5 shrink-0" }),
|
|
2113
2178
|
/* @__PURE__ */ jsx7("span", { className: cn("shrink-0", ICON_TONE[iconTone]), children: icon }),
|
|
2114
2179
|
/* @__PURE__ */ jsx7(
|
|
2115
2180
|
"span",
|
|
@@ -2123,7 +2188,7 @@ function ActivityDisclosure({
|
|
|
2123
2188
|
}
|
|
2124
2189
|
),
|
|
2125
2190
|
previewVisible && !media ? /* @__PURE__ */ jsx7("span", { className: "min-w-0 flex-1 truncate text-og-sm text-og-fg-subtle", children: preview }) : /* @__PURE__ */ jsx7("span", { className: "flex-1" }),
|
|
2126
|
-
media ? /* @__PURE__ */ jsx7("span", { className: "ml-auto flex shrink-0 items-center gap-2 pl-2", children: media }) : chip && !open ? /* @__PURE__ */ jsx7("span", { className: "ml-auto shrink-0 pl-2", children: /* @__PURE__ */ jsx7(Chip, { chip }) }) : null
|
|
2191
|
+
media && !open ? /* @__PURE__ */ jsx7("span", { className: "ml-auto flex shrink-0 items-center gap-2 pl-2", children: media }) : chip && !open ? /* @__PURE__ */ jsx7("span", { className: "ml-auto shrink-0 pl-2", children: /* @__PURE__ */ jsx7(Chip, { chip }) }) : null
|
|
2127
2192
|
] });
|
|
2128
2193
|
const dataStatus = cancelled ? "cancelled" : failed ? "failed" : void 0;
|
|
2129
2194
|
if (!hasBody) {
|
|
@@ -2147,13 +2212,28 @@ function ActivityDisclosure({
|
|
|
2147
2212
|
"data-status": dataStatus,
|
|
2148
2213
|
className: cn(
|
|
2149
2214
|
rowClass,
|
|
2150
|
-
"cursor-pointer outline-
|
|
2215
|
+
"cursor-pointer outline-hidden hover:bg-og-surface-1 hover:text-og-fg",
|
|
2151
2216
|
"focus-visible:ring-2 focus-visible:ring-og-accent focus-visible:ring-offset-0"
|
|
2152
2217
|
),
|
|
2153
2218
|
children: inner
|
|
2154
2219
|
}
|
|
2155
2220
|
),
|
|
2156
|
-
open ? /* @__PURE__ */
|
|
2221
|
+
open ? /* @__PURE__ */ jsxs5("div", { className: "mb-2 ml-7 mt-1.5 flex flex-col gap-2 overflow-hidden animate-og-expand", children: [
|
|
2222
|
+
children,
|
|
2223
|
+
truncation ? /* @__PURE__ */ jsx7(ToolCallTruncationNotice, { truncation }) : null
|
|
2224
|
+
] }) : null
|
|
2225
|
+
] });
|
|
2226
|
+
}
|
|
2227
|
+
function ToolCallTruncationNotice({ truncation }) {
|
|
2228
|
+
const fullEvidence = truncation.fullEvidence.available ? "retained" : truncation.fullEvidence.reason ?? "unavailable";
|
|
2229
|
+
return /* @__PURE__ */ jsxs5("div", { "data-og-tool-output-truncation": "", className: "text-og-sm leading-5 text-og-fg-subtle", children: [
|
|
2230
|
+
"Output bounded at ",
|
|
2231
|
+
/* @__PURE__ */ jsx7("code", { className: "font-og-mono", children: truncation.surface }),
|
|
2232
|
+
truncation.omittedBytes != null && truncation.omittedBytes > 0 ? ` \xB7 ${truncation.omittedBytes.toLocaleString()} bytes omitted` : null,
|
|
2233
|
+
" \xB7 reason ",
|
|
2234
|
+
/* @__PURE__ */ jsx7("code", { className: "font-og-mono", children: truncation.reason }),
|
|
2235
|
+
" \xB7 full evidence ",
|
|
2236
|
+
/* @__PURE__ */ jsx7("code", { className: "font-og-mono", children: fullEvidence })
|
|
2157
2237
|
] });
|
|
2158
2238
|
}
|
|
2159
2239
|
function Chip({ chip }) {
|
|
@@ -2282,7 +2362,9 @@ function MediaEmpty() {
|
|
|
2282
2362
|
function Thumbnail({
|
|
2283
2363
|
src,
|
|
2284
2364
|
caption,
|
|
2285
|
-
alt = "screenshot"
|
|
2365
|
+
alt = "screenshot",
|
|
2366
|
+
expandLabel = "Expand screenshot",
|
|
2367
|
+
lightboxLabel = "Screenshot"
|
|
2286
2368
|
}) {
|
|
2287
2369
|
const lightbox = useLightboxOptional();
|
|
2288
2370
|
const [failed, setFailed] = useState4(false);
|
|
@@ -2307,7 +2389,7 @@ function Thumbnail({
|
|
|
2307
2389
|
type: "button",
|
|
2308
2390
|
onClick: (event) => {
|
|
2309
2391
|
event.stopPropagation();
|
|
2310
|
-
lightbox.open(src, caption);
|
|
2392
|
+
lightbox.open(src, caption, event.currentTarget, lightboxLabel);
|
|
2311
2393
|
},
|
|
2312
2394
|
onKeyDown: (event) => {
|
|
2313
2395
|
if (event.key === "Enter" || event.key === " ") {
|
|
@@ -2316,10 +2398,10 @@ function Thumbnail({
|
|
|
2316
2398
|
},
|
|
2317
2399
|
className: cn(
|
|
2318
2400
|
MEDIA_BOX,
|
|
2319
|
-
"group/thumb relative inline-flex overflow-hidden bg-og-bg outline-
|
|
2401
|
+
"group/thumb relative inline-flex overflow-hidden bg-og-bg outline-hidden",
|
|
2320
2402
|
"focus-visible:ring-2 focus-visible:ring-og-accent"
|
|
2321
2403
|
),
|
|
2322
|
-
"aria-label":
|
|
2404
|
+
"aria-label": expandLabel,
|
|
2323
2405
|
children: img
|
|
2324
2406
|
}
|
|
2325
2407
|
);
|
|
@@ -2327,7 +2409,9 @@ function Thumbnail({
|
|
|
2327
2409
|
function ScreenshotFigure({
|
|
2328
2410
|
src,
|
|
2329
2411
|
caption,
|
|
2330
|
-
alt = "screenshot"
|
|
2412
|
+
alt = "screenshot",
|
|
2413
|
+
expandLabel = "Expand screenshot",
|
|
2414
|
+
lightboxLabel = "Screenshot"
|
|
2331
2415
|
}) {
|
|
2332
2416
|
const lightbox = useLightboxOptional();
|
|
2333
2417
|
const [failed, setFailed] = useState4(false);
|
|
@@ -2346,9 +2430,9 @@ function ScreenshotFigure({
|
|
|
2346
2430
|
"button",
|
|
2347
2431
|
{
|
|
2348
2432
|
type: "button",
|
|
2349
|
-
onClick: () => lightbox.open(src, caption),
|
|
2433
|
+
onClick: (event) => lightbox.open(src, caption, event.currentTarget, lightboxLabel),
|
|
2350
2434
|
className: surface,
|
|
2351
|
-
"aria-label":
|
|
2435
|
+
"aria-label": expandLabel,
|
|
2352
2436
|
children: img
|
|
2353
2437
|
}
|
|
2354
2438
|
) : /* @__PURE__ */ jsx7("div", { className: surface, children: img }),
|
|
@@ -2536,15 +2620,17 @@ import {
|
|
|
2536
2620
|
Share2Icon,
|
|
2537
2621
|
TargetIcon,
|
|
2538
2622
|
TerminalIcon,
|
|
2623
|
+
VideoIcon,
|
|
2539
2624
|
WrenchIcon
|
|
2540
2625
|
} from "lucide-react";
|
|
2626
|
+
import { useEffect as useEffect6, useRef as useRef4, useState as useState8 } from "react";
|
|
2541
2627
|
|
|
2542
2628
|
// src/timeline/compute-label.tsx
|
|
2543
|
-
import { createContext as
|
|
2544
|
-
var TimelineComputeLabelContext =
|
|
2629
|
+
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
2630
|
+
var TimelineComputeLabelContext = createContext4(null);
|
|
2545
2631
|
var TimelineComputeLabelProvider = TimelineComputeLabelContext.Provider;
|
|
2546
2632
|
function useTimelineComputeLabel() {
|
|
2547
|
-
return
|
|
2633
|
+
return useContext4(TimelineComputeLabelContext);
|
|
2548
2634
|
}
|
|
2549
2635
|
|
|
2550
2636
|
// src/timeline/tool-diff.tsx
|
|
@@ -2991,7 +3077,7 @@ function asComputerArgs(args) {
|
|
|
2991
3077
|
...typeof record.button === "string" ? { button: record.button } : {}
|
|
2992
3078
|
};
|
|
2993
3079
|
}
|
|
2994
|
-
function ComputerCallRenderer({ item }) {
|
|
3080
|
+
function ComputerCallRenderer({ item, loadRetainedScreenshot }) {
|
|
2995
3081
|
const raw = item.raw ?? {};
|
|
2996
3082
|
const functionAction = !raw.action && item.name.startsWith("computer_") && item.name !== "computer_call" ? { type: item.name.slice("computer_".length), ...asComputerArgs(item.arguments) } : void 0;
|
|
2997
3083
|
const action = raw.action ?? functionAction;
|
|
@@ -3002,6 +3088,7 @@ function ComputerCallRenderer({ item }) {
|
|
|
3002
3088
|
const rejected = raw.providerData?.approvalStatus === "rejected";
|
|
3003
3089
|
const readOnly = typeof out === "string" && out.includes("read-only");
|
|
3004
3090
|
const shotUrl = screenshotDataUrl(out);
|
|
3091
|
+
const retained = retainedScreenshotMetadata(out);
|
|
3005
3092
|
const omittedMedia = mediaPreviewFact(out);
|
|
3006
3093
|
const empty = out === "" || out == null;
|
|
3007
3094
|
const batched = actions.length > 1 ? actions.map((a) => computerVerb(a)).join(" \xB7 ") : null;
|
|
@@ -3047,6 +3134,45 @@ function ComputerCallRenderer({ item }) {
|
|
|
3047
3134
|
}
|
|
3048
3135
|
const isFailed = item.status === "failed";
|
|
3049
3136
|
const isCancelled = item.status === "cancelled";
|
|
3137
|
+
if (retained) {
|
|
3138
|
+
if (!retained.available) {
|
|
3139
|
+
const state = retained.reason === "expired" || retained.reason === "deleted" ? retained.reason : "unavailable";
|
|
3140
|
+
return /* @__PURE__ */ jsx10(
|
|
3141
|
+
ActivityDisclosure,
|
|
3142
|
+
{
|
|
3143
|
+
icon: /* @__PURE__ */ jsx10(CameraOffIcon2, { className: ICON_SIZE }),
|
|
3144
|
+
iconTone: isFailed ? "failed" : "muted",
|
|
3145
|
+
title: `${verb}${countSuffix} \xB7 ${state}`,
|
|
3146
|
+
failed: isFailed,
|
|
3147
|
+
cancelled: isCancelled,
|
|
3148
|
+
preview: `screenshot ${state}`,
|
|
3149
|
+
media: /* @__PURE__ */ jsx10(MediaEmpty, {}),
|
|
3150
|
+
children: /* @__PURE__ */ jsxs7(BodyNote, { tone: isFailed ? "error" : void 0, children: [
|
|
3151
|
+
"Screenshot ",
|
|
3152
|
+
state,
|
|
3153
|
+
": ",
|
|
3154
|
+
retained.reason.replaceAll("_", " "),
|
|
3155
|
+
"."
|
|
3156
|
+
] })
|
|
3157
|
+
}
|
|
3158
|
+
);
|
|
3159
|
+
}
|
|
3160
|
+
return /* @__PURE__ */ jsx10(
|
|
3161
|
+
RetainedSessionImageDisclosure,
|
|
3162
|
+
{
|
|
3163
|
+
artifact: retained,
|
|
3164
|
+
load: loadRetainedScreenshot,
|
|
3165
|
+
title: `${verb}${countSuffix}`,
|
|
3166
|
+
caption: `${verb}${countSuffix}`,
|
|
3167
|
+
noun: "screenshot",
|
|
3168
|
+
icon: /* @__PURE__ */ jsx10(CameraIcon2, { className: ICON_SIZE }),
|
|
3169
|
+
lightboxLabel: "Screenshot",
|
|
3170
|
+
batched,
|
|
3171
|
+
failed: isFailed,
|
|
3172
|
+
cancelled: isCancelled
|
|
3173
|
+
}
|
|
3174
|
+
);
|
|
3175
|
+
}
|
|
3050
3176
|
if (shotUrl) {
|
|
3051
3177
|
const caption = `${verb}${actions.length > 1 ? ` (+${actions.length - 1} more)` : ""}`;
|
|
3052
3178
|
return /* @__PURE__ */ jsxs7(
|
|
@@ -3121,6 +3247,249 @@ function ComputerCallRenderer({ item }) {
|
|
|
3121
3247
|
}
|
|
3122
3248
|
);
|
|
3123
3249
|
}
|
|
3250
|
+
function useRetainedImageObjectUrl(artifact, load) {
|
|
3251
|
+
const [state, setState] = useState8({ kind: "loading" });
|
|
3252
|
+
const artifactValue = retainedArtifactValue(artifact);
|
|
3253
|
+
const stableArtifactRef = useRef4({ value: artifactValue, artifact });
|
|
3254
|
+
if (stableArtifactRef.current.value !== artifactValue) {
|
|
3255
|
+
stableArtifactRef.current = { value: artifactValue, artifact };
|
|
3256
|
+
}
|
|
3257
|
+
const stableArtifact = stableArtifactRef.current.artifact;
|
|
3258
|
+
useEffect6(() => {
|
|
3259
|
+
if (!load) {
|
|
3260
|
+
setState({ kind: "unavailable", label: "retrieval is not configured" });
|
|
3261
|
+
return;
|
|
3262
|
+
}
|
|
3263
|
+
const controller = new AbortController();
|
|
3264
|
+
let objectUrl = null;
|
|
3265
|
+
setState({ kind: "loading" });
|
|
3266
|
+
void load(stableArtifact, controller.signal).then((source) => {
|
|
3267
|
+
if (controller.signal.aborted) return;
|
|
3268
|
+
if (!source) {
|
|
3269
|
+
setState({ kind: "unavailable", label: "bytes are unavailable" });
|
|
3270
|
+
return;
|
|
3271
|
+
}
|
|
3272
|
+
if (!(source instanceof Uint8Array)) {
|
|
3273
|
+
if (!source.url.trim()) {
|
|
3274
|
+
setState({ kind: "unavailable", label: "URL is unavailable" });
|
|
3275
|
+
return;
|
|
3276
|
+
}
|
|
3277
|
+
setState({ kind: "ready", url: source.url });
|
|
3278
|
+
return;
|
|
3279
|
+
}
|
|
3280
|
+
objectUrl = URL.createObjectURL(
|
|
3281
|
+
new Blob([source], { type: stableArtifact.contentType })
|
|
3282
|
+
);
|
|
3283
|
+
setState({ kind: "ready", url: objectUrl });
|
|
3284
|
+
}).catch((error) => {
|
|
3285
|
+
if (controller.signal.aborted) return;
|
|
3286
|
+
const status = error && typeof error === "object" && "status" in error ? Number(error.status) : null;
|
|
3287
|
+
setState(
|
|
3288
|
+
status === 404 ? { kind: "unavailable", label: "deleted" } : status === 410 ? { kind: "unavailable", label: "expired or unavailable" } : { kind: "error", message: "retrieval failed" }
|
|
3289
|
+
);
|
|
3290
|
+
});
|
|
3291
|
+
return () => {
|
|
3292
|
+
controller.abort();
|
|
3293
|
+
if (objectUrl) URL.revokeObjectURL(objectUrl);
|
|
3294
|
+
};
|
|
3295
|
+
}, [stableArtifact, load]);
|
|
3296
|
+
return state;
|
|
3297
|
+
}
|
|
3298
|
+
function retainedArtifactValue(artifact) {
|
|
3299
|
+
return [
|
|
3300
|
+
artifact.artifactId,
|
|
3301
|
+
artifact.kind,
|
|
3302
|
+
artifact.contentType,
|
|
3303
|
+
artifact.originalBytes,
|
|
3304
|
+
artifact.sha256,
|
|
3305
|
+
artifact.retainedAt,
|
|
3306
|
+
artifact.dimensions?.width ?? "",
|
|
3307
|
+
artifact.dimensions?.height ?? "",
|
|
3308
|
+
artifact.retention.policy,
|
|
3309
|
+
artifact.retention.expiresAt ?? "",
|
|
3310
|
+
artifact.retrieval.method,
|
|
3311
|
+
artifact.retrieval.path,
|
|
3312
|
+
artifact.retrieval.acceptRanges,
|
|
3313
|
+
artifact.retrieval.maxRangeBytes
|
|
3314
|
+
].join("\0");
|
|
3315
|
+
}
|
|
3316
|
+
function RetainedSessionImageDisclosure({
|
|
3317
|
+
artifact,
|
|
3318
|
+
load,
|
|
3319
|
+
title,
|
|
3320
|
+
caption,
|
|
3321
|
+
noun,
|
|
3322
|
+
icon,
|
|
3323
|
+
lightboxLabel,
|
|
3324
|
+
batched,
|
|
3325
|
+
failed,
|
|
3326
|
+
cancelled
|
|
3327
|
+
}) {
|
|
3328
|
+
const state = useRetainedImageObjectUrl(artifact, load);
|
|
3329
|
+
return /* @__PURE__ */ jsxs7(
|
|
3330
|
+
ActivityDisclosure,
|
|
3331
|
+
{
|
|
3332
|
+
icon,
|
|
3333
|
+
iconTone: failed ? "failed" : state.kind === "ready" ? "accent" : "muted",
|
|
3334
|
+
title,
|
|
3335
|
+
failed,
|
|
3336
|
+
cancelled,
|
|
3337
|
+
preview: state.kind === "loading" ? `loading retained ${noun}\u2026` : state.kind === "error" ? `${noun} retrieval failed` : state.kind === "unavailable" ? `${noun} ${state.label}` : void 0,
|
|
3338
|
+
media: state.kind === "ready" ? /* @__PURE__ */ jsx10(
|
|
3339
|
+
Thumbnail,
|
|
3340
|
+
{
|
|
3341
|
+
src: state.url,
|
|
3342
|
+
caption,
|
|
3343
|
+
alt: caption,
|
|
3344
|
+
expandLabel: `Expand ${noun}`,
|
|
3345
|
+
lightboxLabel
|
|
3346
|
+
}
|
|
3347
|
+
) : state.kind === "loading" ? /* @__PURE__ */ jsx10(MediaSkeleton, {}) : /* @__PURE__ */ jsx10(MediaEmpty, {}),
|
|
3348
|
+
children: [
|
|
3349
|
+
state.kind === "ready" ? /* @__PURE__ */ jsx10(
|
|
3350
|
+
ScreenshotFigure,
|
|
3351
|
+
{
|
|
3352
|
+
src: state.url,
|
|
3353
|
+
caption,
|
|
3354
|
+
alt: caption,
|
|
3355
|
+
expandLabel: `Expand ${noun}`,
|
|
3356
|
+
lightboxLabel
|
|
3357
|
+
}
|
|
3358
|
+
) : state.kind === "loading" ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
|
|
3359
|
+
"Loading the retained ",
|
|
3360
|
+
noun,
|
|
3361
|
+
"\u2026"
|
|
3362
|
+
] }) : state.kind === "unavailable" ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
|
|
3363
|
+
noun === "screenshot" ? "Screenshot" : "Image",
|
|
3364
|
+
" ",
|
|
3365
|
+
state.label,
|
|
3366
|
+
"."
|
|
3367
|
+
] }) : /* @__PURE__ */ jsxs7(BodyNote, { tone: "error", children: [
|
|
3368
|
+
noun === "screenshot" ? "Screenshot" : "Image",
|
|
3369
|
+
" retrieval failed: ",
|
|
3370
|
+
state.message
|
|
3371
|
+
] }),
|
|
3372
|
+
batched ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
|
|
3373
|
+
"batched: ",
|
|
3374
|
+
batched
|
|
3375
|
+
] }) : null
|
|
3376
|
+
]
|
|
3377
|
+
}
|
|
3378
|
+
);
|
|
3379
|
+
}
|
|
3380
|
+
function GeneratedImageRenderer({ item, loadRetainedArtifact }) {
|
|
3381
|
+
const args = parseToolArgs(item.arguments);
|
|
3382
|
+
const prompt = typeof args.prompt === "string" ? args.prompt : "";
|
|
3383
|
+
const raw = item.raw && typeof item.raw === "object" && !Array.isArray(item.raw) ? item.raw : null;
|
|
3384
|
+
const receipt = generatedImageReceipt(item.output) ?? generatedImageReceipt(raw?.output);
|
|
3385
|
+
if (item.status === "running") {
|
|
3386
|
+
return /* @__PURE__ */ jsx10(
|
|
3387
|
+
ActivityDisclosure,
|
|
3388
|
+
{
|
|
3389
|
+
icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
|
|
3390
|
+
iconTone: "running",
|
|
3391
|
+
title: "Generating image",
|
|
3392
|
+
running: true,
|
|
3393
|
+
preview: /* @__PURE__ */ jsx10(RunningPreview, { children: truncatePreview(prompt, 72) || "creating\u2026" }),
|
|
3394
|
+
media: /* @__PURE__ */ jsx10(MediaSkeleton, {}),
|
|
3395
|
+
children: prompt ? /* @__PURE__ */ jsx10(BodyNote, { children: prompt }) : null
|
|
3396
|
+
}
|
|
3397
|
+
);
|
|
3398
|
+
}
|
|
3399
|
+
if (!receipt) return /* @__PURE__ */ jsx10(GenericRenderer, { item });
|
|
3400
|
+
return /* @__PURE__ */ jsx10(
|
|
3401
|
+
GeneratedImageDisclosure,
|
|
3402
|
+
{
|
|
3403
|
+
receipt,
|
|
3404
|
+
load: loadRetainedArtifact,
|
|
3405
|
+
prompt,
|
|
3406
|
+
failed: item.status === "failed",
|
|
3407
|
+
cancelled: item.status === "cancelled"
|
|
3408
|
+
}
|
|
3409
|
+
);
|
|
3410
|
+
}
|
|
3411
|
+
function GeneratedVideoRenderer({ item }) {
|
|
3412
|
+
const args = parseToolArgs(item.arguments);
|
|
3413
|
+
const prompt = typeof args.prompt === "string" ? args.prompt : "";
|
|
3414
|
+
const parsedOutput = typeof item.output === "string" ? tryParseJson(item.output) : item.output;
|
|
3415
|
+
const accepted = parsedOutput && typeof parsedOutput === "object" && !Array.isArray(parsedOutput) && parsedOutput.status === "accepted";
|
|
3416
|
+
const failed = item.status === "failed";
|
|
3417
|
+
const cancelled = item.status === "cancelled";
|
|
3418
|
+
const running = item.status === "running";
|
|
3419
|
+
return /* @__PURE__ */ jsxs7(
|
|
3420
|
+
ActivityDisclosure,
|
|
3421
|
+
{
|
|
3422
|
+
icon: /* @__PURE__ */ jsx10(VideoIcon, { className: ICON_SIZE }),
|
|
3423
|
+
iconTone: failed ? "failed" : running ? "running" : accepted ? "accent" : "muted",
|
|
3424
|
+
title: running ? "Starting video generation" : accepted ? "Generating video" : "Generate video",
|
|
3425
|
+
running,
|
|
3426
|
+
failed,
|
|
3427
|
+
cancelled,
|
|
3428
|
+
preview: truncatePreview(prompt, 88) || (accepted ? "request accepted" : void 0),
|
|
3429
|
+
children: [
|
|
3430
|
+
prompt ? /* @__PURE__ */ jsx10(BodyNote, { children: prompt }) : null,
|
|
3431
|
+
accepted ? /* @__PURE__ */ jsx10(BodyNote, { children: "The video will appear here when it is ready." }) : item.output !== void 0 ? /* @__PURE__ */ jsx10(PayloadBlock, { label: "Output", value: item.output }) : null
|
|
3432
|
+
]
|
|
3433
|
+
}
|
|
3434
|
+
);
|
|
3435
|
+
}
|
|
3436
|
+
function GeneratedImageDisclosure({
|
|
3437
|
+
receipt,
|
|
3438
|
+
load,
|
|
3439
|
+
prompt,
|
|
3440
|
+
failed,
|
|
3441
|
+
cancelled
|
|
3442
|
+
}) {
|
|
3443
|
+
const state = useRetainedImageObjectUrl(receipt.artifact, load);
|
|
3444
|
+
const dimensions = receipt.artifact.dimensions;
|
|
3445
|
+
const title = failed ? "Image generation failed" : "Generated image";
|
|
3446
|
+
const caption = prompt || `Generated image \xB7 ${dimensions.width}\xD7${dimensions.height}`;
|
|
3447
|
+
return /* @__PURE__ */ jsxs7(
|
|
3448
|
+
ActivityDisclosure,
|
|
3449
|
+
{
|
|
3450
|
+
icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
|
|
3451
|
+
iconTone: failed ? "failed" : state.kind === "ready" ? "accent" : "muted",
|
|
3452
|
+
title,
|
|
3453
|
+
defaultOpen: !failed && !cancelled,
|
|
3454
|
+
failed,
|
|
3455
|
+
cancelled,
|
|
3456
|
+
preview: state.kind === "loading" ? "loading image\u2026" : state.kind === "error" ? "image retrieval failed" : state.kind === "unavailable" ? `image ${state.label}` : truncatePreview(prompt, 88) || `${dimensions.width}\xD7${dimensions.height}`,
|
|
3457
|
+
media: state.kind === "ready" ? /* @__PURE__ */ jsx10(
|
|
3458
|
+
Thumbnail,
|
|
3459
|
+
{
|
|
3460
|
+
src: state.url,
|
|
3461
|
+
caption,
|
|
3462
|
+
alt: caption,
|
|
3463
|
+
expandLabel: "Expand generated image",
|
|
3464
|
+
lightboxLabel: "Generated image"
|
|
3465
|
+
}
|
|
3466
|
+
) : state.kind === "loading" ? /* @__PURE__ */ jsx10(MediaSkeleton, {}) : /* @__PURE__ */ jsx10(MediaEmpty, {}),
|
|
3467
|
+
children: [
|
|
3468
|
+
state.kind === "ready" ? /* @__PURE__ */ jsx10(
|
|
3469
|
+
ScreenshotFigure,
|
|
3470
|
+
{
|
|
3471
|
+
src: state.url,
|
|
3472
|
+
caption,
|
|
3473
|
+
alt: caption,
|
|
3474
|
+
expandLabel: "Expand generated image",
|
|
3475
|
+
lightboxLabel: "Generated image"
|
|
3476
|
+
}
|
|
3477
|
+
) : state.kind === "loading" ? /* @__PURE__ */ jsx10(BodyNote, { children: "Loading the generated image\u2026" }) : state.kind === "unavailable" ? /* @__PURE__ */ jsxs7(BodyNote, { children: [
|
|
3478
|
+
"Image ",
|
|
3479
|
+
state.label,
|
|
3480
|
+
"."
|
|
3481
|
+
] }) : /* @__PURE__ */ jsx10(BodyNote, { tone: "error", children: "Image retrieval failed." }),
|
|
3482
|
+
/* @__PURE__ */ jsxs7(BodyNote, { children: [
|
|
3483
|
+
dimensions.width,
|
|
3484
|
+
"\xD7",
|
|
3485
|
+
dimensions.height,
|
|
3486
|
+
" \xB7 ",
|
|
3487
|
+
receipt.sandboxPath
|
|
3488
|
+
] })
|
|
3489
|
+
]
|
|
3490
|
+
}
|
|
3491
|
+
);
|
|
3492
|
+
}
|
|
3124
3493
|
function webSearchQueryFromArguments(args) {
|
|
3125
3494
|
if (typeof args === "string") {
|
|
3126
3495
|
const trimmed = args.trim();
|
|
@@ -3219,11 +3588,12 @@ var VIEW_IMAGE_ERRORS = [
|
|
|
3219
3588
|
"is not a supported image",
|
|
3220
3589
|
"unable to read image"
|
|
3221
3590
|
];
|
|
3222
|
-
function ViewImageRenderer({ item }) {
|
|
3591
|
+
function ViewImageRenderer({ item, loadRetainedScreenshot }) {
|
|
3223
3592
|
const args = parseToolArgs(item.arguments);
|
|
3224
3593
|
const path = typeof args.path === "string" ? args.path : "";
|
|
3225
3594
|
const out = item.output;
|
|
3226
3595
|
const text = typeof out === "string" ? out : "";
|
|
3596
|
+
const retained = retainedScreenshotMetadata(out);
|
|
3227
3597
|
const omittedMedia = mediaPreviewFact(out);
|
|
3228
3598
|
if (item.status === "running") {
|
|
3229
3599
|
return /* @__PURE__ */ jsx10(
|
|
@@ -3241,6 +3611,46 @@ function ViewImageRenderer({ item }) {
|
|
|
3241
3611
|
}
|
|
3242
3612
|
const viewFailed = item.status === "failed";
|
|
3243
3613
|
const viewCancelled = item.status === "cancelled";
|
|
3614
|
+
if (retained) {
|
|
3615
|
+
const title = `Viewed ${basename(path)}`;
|
|
3616
|
+
if (!retained.available) {
|
|
3617
|
+
const state = retained.reason === "expired" || retained.reason === "deleted" ? retained.reason : "unavailable";
|
|
3618
|
+
return /* @__PURE__ */ jsx10(
|
|
3619
|
+
ActivityDisclosure,
|
|
3620
|
+
{
|
|
3621
|
+
icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
|
|
3622
|
+
iconTone: viewFailed ? "failed" : "muted",
|
|
3623
|
+
title: `${title} \xB7 ${state}`,
|
|
3624
|
+
failed: viewFailed,
|
|
3625
|
+
cancelled: viewCancelled,
|
|
3626
|
+
preview: `image ${state}`,
|
|
3627
|
+
media: /* @__PURE__ */ jsx10(MediaEmpty, {}),
|
|
3628
|
+
children: /* @__PURE__ */ jsxs7(BodyNote, { tone: viewFailed ? "error" : void 0, children: [
|
|
3629
|
+
"Image ",
|
|
3630
|
+
state,
|
|
3631
|
+
": ",
|
|
3632
|
+
retained.reason.replaceAll("_", " "),
|
|
3633
|
+
"."
|
|
3634
|
+
] })
|
|
3635
|
+
}
|
|
3636
|
+
);
|
|
3637
|
+
}
|
|
3638
|
+
return /* @__PURE__ */ jsx10(
|
|
3639
|
+
RetainedSessionImageDisclosure,
|
|
3640
|
+
{
|
|
3641
|
+
artifact: retained,
|
|
3642
|
+
load: loadRetainedScreenshot,
|
|
3643
|
+
title,
|
|
3644
|
+
caption: path || title,
|
|
3645
|
+
noun: "image",
|
|
3646
|
+
icon: /* @__PURE__ */ jsx10(ImageIcon, { className: ICON_SIZE }),
|
|
3647
|
+
lightboxLabel: "Image",
|
|
3648
|
+
batched: null,
|
|
3649
|
+
failed: viewFailed,
|
|
3650
|
+
cancelled: viewCancelled
|
|
3651
|
+
}
|
|
3652
|
+
);
|
|
3653
|
+
}
|
|
3244
3654
|
const errMatch = VIEW_IMAGE_ERRORS.find((p) => text.includes(p));
|
|
3245
3655
|
if (errMatch) {
|
|
3246
3656
|
const tooBig = text.includes("exceeded the allowed size");
|
|
@@ -3331,7 +3741,7 @@ function SecretSetRenderer({ item }) {
|
|
|
3331
3741
|
title: `Set ${name}`,
|
|
3332
3742
|
running: true,
|
|
3333
3743
|
preview: /* @__PURE__ */ jsx10(RunningPreview, { children: "setting\u2026" }),
|
|
3334
|
-
children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value:
|
|
3744
|
+
children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args })
|
|
3335
3745
|
}
|
|
3336
3746
|
);
|
|
3337
3747
|
}
|
|
@@ -3346,7 +3756,7 @@ function SecretSetRenderer({ item }) {
|
|
|
3346
3756
|
failed: true,
|
|
3347
3757
|
preview: errorText ?? "variable write failed",
|
|
3348
3758
|
children: [
|
|
3349
|
-
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value:
|
|
3759
|
+
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args }),
|
|
3350
3760
|
errorText ? /* @__PURE__ */ jsx10(PayloadBlock, { label: "Error", value: errorText, failed: true }) : /* @__PURE__ */ jsx10(BodyNote, { tone: "error", children: "the tool call failed with no output." })
|
|
3351
3761
|
]
|
|
3352
3762
|
}
|
|
@@ -3359,10 +3769,10 @@ function SecretSetRenderer({ item }) {
|
|
|
3359
3769
|
iconTone: "muted",
|
|
3360
3770
|
title: `Set ${name}`,
|
|
3361
3771
|
cancelled: item.status === "cancelled",
|
|
3362
|
-
preview: "value
|
|
3772
|
+
preview: "exact value preserved",
|
|
3363
3773
|
children: [
|
|
3364
|
-
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value:
|
|
3365
|
-
/* @__PURE__ */ jsx10(BodyNote, { children: "
|
|
3774
|
+
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args }),
|
|
3775
|
+
/* @__PURE__ */ jsx10(BodyNote, { children: "The configured value is preserved exactly and available through authorized secret reads." })
|
|
3366
3776
|
]
|
|
3367
3777
|
}
|
|
3368
3778
|
);
|
|
@@ -3472,7 +3882,7 @@ function ToolSearchRenderer({ item }) {
|
|
|
3472
3882
|
"capability query: ",
|
|
3473
3883
|
query2
|
|
3474
3884
|
] }) : null,
|
|
3475
|
-
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value:
|
|
3885
|
+
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: parseToolArgs(item.arguments) })
|
|
3476
3886
|
]
|
|
3477
3887
|
}
|
|
3478
3888
|
);
|
|
@@ -3492,7 +3902,7 @@ function ToolSearchRenderer({ item }) {
|
|
|
3492
3902
|
"capability query: ",
|
|
3493
3903
|
query2
|
|
3494
3904
|
] }) : null,
|
|
3495
|
-
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value:
|
|
3905
|
+
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: parseToolArgs(item.arguments) }),
|
|
3496
3906
|
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Error", value: outText, failed: true })
|
|
3497
3907
|
]
|
|
3498
3908
|
}
|
|
@@ -3524,7 +3934,7 @@ function ToolSearchRenderer({ item }) {
|
|
|
3524
3934
|
" more"
|
|
3525
3935
|
] }) : null
|
|
3526
3936
|
] }) : tools && tools.length === 0 ? /* @__PURE__ */ jsx10(BodyNote, { children: "no deferred tools matched this capability query." }) : null,
|
|
3527
|
-
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value:
|
|
3937
|
+
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: parseToolArgs(item.arguments) }),
|
|
3528
3938
|
tools == null && outText ? /* @__PURE__ */ jsx10(PayloadBlock, { label: "Result", value: outText }) : null
|
|
3529
3939
|
]
|
|
3530
3940
|
}
|
|
@@ -3544,7 +3954,7 @@ function DocsSearchRenderer({ item }) {
|
|
|
3544
3954
|
title,
|
|
3545
3955
|
running: true,
|
|
3546
3956
|
preview: /* @__PURE__ */ jsx10(RunningPreview, { children: "Searching\u2026" }),
|
|
3547
|
-
children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value:
|
|
3957
|
+
children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args })
|
|
3548
3958
|
}
|
|
3549
3959
|
);
|
|
3550
3960
|
}
|
|
@@ -3559,7 +3969,7 @@ function DocsSearchRenderer({ item }) {
|
|
|
3559
3969
|
failed: true,
|
|
3560
3970
|
preview: truncatePreview(outText, 80) || "Search failed",
|
|
3561
3971
|
children: [
|
|
3562
|
-
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value:
|
|
3972
|
+
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args }),
|
|
3563
3973
|
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Error", value: outText, failed: true })
|
|
3564
3974
|
]
|
|
3565
3975
|
}
|
|
@@ -3580,7 +3990,7 @@ function DocsSearchRenderer({ item }) {
|
|
|
3580
3990
|
/* @__PURE__ */ jsx10("div", { className: "truncate text-og-sm font-medium text-og-fg", children: hit.title }),
|
|
3581
3991
|
hit.snippet ? /* @__PURE__ */ jsx10("div", { className: "mt-0.5 line-clamp-2 text-og-xs text-og-fg-muted", children: hit.snippet }) : null
|
|
3582
3992
|
] }, `${hit.title}\0${hit.snippet}`)) }) : null,
|
|
3583
|
-
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value:
|
|
3993
|
+
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args }),
|
|
3584
3994
|
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Result", value: outText })
|
|
3585
3995
|
]
|
|
3586
3996
|
}
|
|
@@ -3601,7 +4011,7 @@ function SetSessionTitleRenderer({ item }) {
|
|
|
3601
4011
|
title: display,
|
|
3602
4012
|
running: true,
|
|
3603
4013
|
preview: previewTitle ? /* @__PURE__ */ jsx10(RunningPreview, { children: previewTitle }) : /* @__PURE__ */ jsx10(RunningPreview, { children: "Setting title\u2026" }),
|
|
3604
|
-
children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value:
|
|
4014
|
+
children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args })
|
|
3605
4015
|
}
|
|
3606
4016
|
);
|
|
3607
4017
|
}
|
|
@@ -3616,7 +4026,7 @@ function SetSessionTitleRenderer({ item }) {
|
|
|
3616
4026
|
failed: true,
|
|
3617
4027
|
preview: truncatePreview(outText, 80) || "Rename failed",
|
|
3618
4028
|
children: [
|
|
3619
|
-
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value:
|
|
4029
|
+
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args }),
|
|
3620
4030
|
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Error", value: outText, failed: true })
|
|
3621
4031
|
]
|
|
3622
4032
|
}
|
|
@@ -3641,7 +4051,7 @@ function SetSessionTitleRenderer({ item }) {
|
|
|
3641
4051
|
cancelled: item.status === "cancelled",
|
|
3642
4052
|
preview: item.status === "cancelled" ? void 0 : settledTitle || void 0,
|
|
3643
4053
|
children: [
|
|
3644
|
-
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value:
|
|
4054
|
+
/* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args }),
|
|
3645
4055
|
outText ? /* @__PURE__ */ jsx10(PayloadBlock, { label: "Result", value: outText }) : null
|
|
3646
4056
|
]
|
|
3647
4057
|
}
|
|
@@ -3677,7 +4087,7 @@ function MemoryProposeRenderer({ item }) {
|
|
|
3677
4087
|
title,
|
|
3678
4088
|
running: true,
|
|
3679
4089
|
preview: /* @__PURE__ */ jsx10(RunningPreview, { children: "Proposing\u2026" }),
|
|
3680
|
-
children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value:
|
|
4090
|
+
children: /* @__PURE__ */ jsx10(PayloadBlock, { label: "Arguments", value: args })
|
|
3681
4091
|
}
|
|
3682
4092
|
);
|
|
3683
4093
|
}
|
|
@@ -3732,7 +4142,7 @@ function askToolPreview(args) {
|
|
|
3732
4142
|
return questions.length > 1 ? `${preview} \xB7 ${questions.length} questions` : preview;
|
|
3733
4143
|
}
|
|
3734
4144
|
function AskRenderer({ item }) {
|
|
3735
|
-
const args =
|
|
4145
|
+
const args = parseToolArgs(item.arguments);
|
|
3736
4146
|
const preview = askToolPreview(args);
|
|
3737
4147
|
const icon = /* @__PURE__ */ jsx10(MessageCircleQuestionIcon2, { className: ICON_SIZE });
|
|
3738
4148
|
const title = "Ask";
|
|
@@ -3808,7 +4218,7 @@ function runOnOpPreview(args) {
|
|
|
3808
4218
|
}
|
|
3809
4219
|
function RunOnRenderer({ item }) {
|
|
3810
4220
|
const parsedArgs = parseToolArgs(item.arguments);
|
|
3811
|
-
const args =
|
|
4221
|
+
const args = parsedArgs;
|
|
3812
4222
|
const targetName = runOnTargetName(item.output);
|
|
3813
4223
|
const title = targetName ? `Run on ${targetName}` : "Run on";
|
|
3814
4224
|
const opPreview = runOnOpPreview(parsedArgs);
|
|
@@ -3860,7 +4270,7 @@ function RunOnRenderer({ item }) {
|
|
|
3860
4270
|
}
|
|
3861
4271
|
function GenericRenderer({ item }) {
|
|
3862
4272
|
const running = item.status === "running";
|
|
3863
|
-
const args =
|
|
4273
|
+
const args = parseToolArgs(item.arguments);
|
|
3864
4274
|
const display = toolDisplayName(item.name);
|
|
3865
4275
|
const icon = /* @__PURE__ */ jsx10(GenericToolIcon, { name: item.name });
|
|
3866
4276
|
const goalPreview = goalToolPreview(item.name, args);
|
|
@@ -3938,7 +4348,6 @@ var BASE_ENTRIES = [
|
|
|
3938
4348
|
// truth and is consulted first by the registry.
|
|
3939
4349
|
{ match: "rawType", type: "apply_patch_call", render: ApplyPatchRenderer },
|
|
3940
4350
|
{ match: "rawType", type: "computer_call", render: ComputerCallRenderer },
|
|
3941
|
-
{ match: "rawType", type: "hosted_tool_call", render: WebSearchRenderer },
|
|
3942
4351
|
{ match: "rawType", type: "tool_search_call", render: ToolSearchRenderer },
|
|
3943
4352
|
// First-party sandbox + MCP tools resolve by name (exact or MCP leaf).
|
|
3944
4353
|
{ match: "name", name: "exec_command", render: ExecRenderer },
|
|
@@ -3958,6 +4367,9 @@ var BASE_ENTRIES = [
|
|
|
3958
4367
|
{ match: "name", name: "computer_keypress", render: ComputerCallRenderer },
|
|
3959
4368
|
{ match: "name", name: "computer_drag", render: ComputerCallRenderer },
|
|
3960
4369
|
{ match: "name", name: "web_search_call", render: WebSearchRenderer },
|
|
4370
|
+
{ match: "name", name: "image_generation_call", render: GeneratedImageRenderer },
|
|
4371
|
+
{ match: "name", name: "generate_image", render: GeneratedImageRenderer },
|
|
4372
|
+
{ match: "name", name: "generate_video", render: GeneratedVideoRenderer },
|
|
3961
4373
|
{ match: "name", name: "tool_search", render: ToolSearchRenderer },
|
|
3962
4374
|
{ match: "name", name: "view_image", render: ViewImageRenderer },
|
|
3963
4375
|
{ match: "name", name: "environment_set_variable", render: SecretSetRenderer },
|
|
@@ -3973,57 +4385,9 @@ function createDefaultToolRegistry(options = {}) {
|
|
|
3973
4385
|
return createToolRegistry(BASE_ENTRIES, GenericRenderer, options);
|
|
3974
4386
|
}
|
|
3975
4387
|
|
|
3976
|
-
// src/lib/clipboard.ts
|
|
3977
|
-
async function copyTextToClipboard(text) {
|
|
3978
|
-
const value = text.replace(/\u00a0/g, " ");
|
|
3979
|
-
if (value.length === 0) {
|
|
3980
|
-
return false;
|
|
3981
|
-
}
|
|
3982
|
-
try {
|
|
3983
|
-
if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
|
|
3984
|
-
await navigator.clipboard.writeText(value);
|
|
3985
|
-
return true;
|
|
3986
|
-
}
|
|
3987
|
-
} catch {
|
|
3988
|
-
}
|
|
3989
|
-
if (typeof document === "undefined") {
|
|
3990
|
-
return false;
|
|
3991
|
-
}
|
|
3992
|
-
try {
|
|
3993
|
-
const area = document.createElement("textarea");
|
|
3994
|
-
area.value = value;
|
|
3995
|
-
area.setAttribute("readonly", "");
|
|
3996
|
-
area.style.position = "fixed";
|
|
3997
|
-
area.style.left = "-9999px";
|
|
3998
|
-
area.style.top = "0";
|
|
3999
|
-
document.body.appendChild(area);
|
|
4000
|
-
area.select();
|
|
4001
|
-
const ok = document.execCommand("copy");
|
|
4002
|
-
document.body.removeChild(area);
|
|
4003
|
-
return ok;
|
|
4004
|
-
} catch {
|
|
4005
|
-
return false;
|
|
4006
|
-
}
|
|
4007
|
-
}
|
|
4008
|
-
function tableElementToTsv(table) {
|
|
4009
|
-
if (!table) {
|
|
4010
|
-
return "";
|
|
4011
|
-
}
|
|
4012
|
-
const rows = Array.from(table.querySelectorAll("tr"));
|
|
4013
|
-
return rows.map(
|
|
4014
|
-
(row) => Array.from(row.querySelectorAll("th,td")).map((cell) => {
|
|
4015
|
-
const raw = (cell.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
4016
|
-
if (/[\t\n"]/.test(raw)) {
|
|
4017
|
-
return `"${raw.replace(/"/g, '""')}"`;
|
|
4018
|
-
}
|
|
4019
|
-
return raw;
|
|
4020
|
-
}).join(" ")
|
|
4021
|
-
).filter((line) => line.length > 0).join("\n");
|
|
4022
|
-
}
|
|
4023
|
-
|
|
4024
4388
|
// src/components/copy-button.tsx
|
|
4025
4389
|
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
4026
|
-
import { useEffect as
|
|
4390
|
+
import { useEffect as useEffect7, useRef as useRef5, useState as useState9 } from "react";
|
|
4027
4391
|
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
4028
4392
|
var COPIED_MS = 1600;
|
|
4029
4393
|
function CopyButton({
|
|
@@ -4032,10 +4396,10 @@ function CopyButton({
|
|
|
4032
4396
|
className,
|
|
4033
4397
|
reveal = "group-hover"
|
|
4034
4398
|
}) {
|
|
4035
|
-
const [copied, setCopied] =
|
|
4036
|
-
const [tipOpen, setTipOpen] =
|
|
4037
|
-
const timerRef =
|
|
4038
|
-
|
|
4399
|
+
const [copied, setCopied] = useState9(false);
|
|
4400
|
+
const [tipOpen, setTipOpen] = useState9(false);
|
|
4401
|
+
const timerRef = useRef5(null);
|
|
4402
|
+
useEffect7(() => {
|
|
4039
4403
|
return () => {
|
|
4040
4404
|
if (timerRef.current !== null) {
|
|
4041
4405
|
clearTimeout(timerRef.current);
|
|
@@ -4089,7 +4453,7 @@ function CopyButton({
|
|
|
4089
4453
|
"inline-flex size-7 shrink-0 items-center justify-center rounded-og-sm pointer-coarse:size-11",
|
|
4090
4454
|
"text-og-fg-subtle transition-[opacity,color,background-color] duration-150",
|
|
4091
4455
|
"hover:bg-og-surface-2/80 hover:text-og-fg",
|
|
4092
|
-
"focus-visible:opacity-100 focus-visible:outline-
|
|
4456
|
+
"focus-visible:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
|
|
4093
4457
|
reveal === "group-hover" && "opacity-0 group-hover/copy:opacity-100 group-focus-within/copy:opacity-100 pointer-coarse:opacity-70",
|
|
4094
4458
|
copied && "opacity-100 text-og-accent",
|
|
4095
4459
|
className
|
|
@@ -4136,10 +4500,10 @@ import {
|
|
|
4136
4500
|
Children,
|
|
4137
4501
|
isValidElement,
|
|
4138
4502
|
memo,
|
|
4139
|
-
useEffect as
|
|
4503
|
+
useEffect as useEffect8,
|
|
4140
4504
|
useReducer,
|
|
4141
|
-
useRef as
|
|
4142
|
-
useState as
|
|
4505
|
+
useRef as useRef6,
|
|
4506
|
+
useState as useState10
|
|
4143
4507
|
} from "react";
|
|
4144
4508
|
import ReactMarkdown from "react-markdown";
|
|
4145
4509
|
import remarkGfm from "remark-gfm";
|
|
@@ -4599,7 +4963,7 @@ function MarkdownCodeBlock({ children }) {
|
|
|
4599
4963
|
] });
|
|
4600
4964
|
}
|
|
4601
4965
|
function MarkdownTable({ children, className, ...props }) {
|
|
4602
|
-
const tableRef =
|
|
4966
|
+
const tableRef = useRef6(null);
|
|
4603
4967
|
return /* @__PURE__ */ jsxs9("div", { className: "group/copy relative mt-3 max-w-full first:mt-0", children: [
|
|
4604
4968
|
/* @__PURE__ */ jsx12("div", { className: "pointer-events-none absolute top-0 right-0 z-10", children: /* @__PURE__ */ jsx12("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsx12(
|
|
4605
4969
|
CopyButton,
|
|
@@ -4621,11 +4985,11 @@ function MarkdownTable({ children, className, ...props }) {
|
|
|
4621
4985
|
] });
|
|
4622
4986
|
}
|
|
4623
4987
|
function MarkdownImpl({ children, className, streaming = false }) {
|
|
4624
|
-
const revealRef =
|
|
4625
|
-
const bodyRef =
|
|
4988
|
+
const revealRef = useRef6(null);
|
|
4989
|
+
const bodyRef = useRef6(null);
|
|
4626
4990
|
const [, bump] = useReducer((n) => n + 1, 0);
|
|
4627
|
-
const [settling, setSettling] =
|
|
4628
|
-
const hadRevealRef =
|
|
4991
|
+
const [settling, setSettling] = useState10(false);
|
|
4992
|
+
const hadRevealRef = useRef6(false);
|
|
4629
4993
|
const now = typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
4630
4994
|
const crystallize = (mutate) => {
|
|
4631
4995
|
mutate();
|
|
@@ -4645,7 +5009,7 @@ function MarkdownImpl({ children, className, streaming = false }) {
|
|
|
4645
5009
|
}
|
|
4646
5010
|
const revealActive = reveal !== null && (streaming || reveal.hasActive(now));
|
|
4647
5011
|
const rehypePlugins = revealActive && reveal !== null ? [[rehypeStreamReveal, { reveal, now }]] : void 0;
|
|
4648
|
-
|
|
5012
|
+
useEffect8(() => {
|
|
4649
5013
|
if (streaming || revealRef.current === null) {
|
|
4650
5014
|
return;
|
|
4651
5015
|
}
|
|
@@ -4671,8 +5035,8 @@ function MarkdownImpl({ children, className, streaming = false }) {
|
|
|
4671
5035
|
}
|
|
4672
5036
|
};
|
|
4673
5037
|
}, [streaming]);
|
|
4674
|
-
const wasStreamingRef =
|
|
4675
|
-
|
|
5038
|
+
const wasStreamingRef = useRef6(streaming);
|
|
5039
|
+
useEffect8(() => {
|
|
4676
5040
|
const ended = wasStreamingRef.current && !streaming;
|
|
4677
5041
|
wasStreamingRef.current = streaming;
|
|
4678
5042
|
if (!ended || revealRef.current !== null || prefersReducedMotion()) {
|
|
@@ -4714,28 +5078,28 @@ import {
|
|
|
4714
5078
|
BrainIcon,
|
|
4715
5079
|
SquareTerminalIcon
|
|
4716
5080
|
} from "lucide-react";
|
|
4717
|
-
import { lazy as lazy3, Suspense as Suspense3, useLayoutEffect as useLayoutEffect2, useRef as
|
|
5081
|
+
import { lazy as lazy3, Suspense as Suspense3, useLayoutEffect as useLayoutEffect2, useRef as useRef8 } from "react";
|
|
4718
5082
|
import { jsx as rowJsx, jsxs as rowJsxs } from "react/jsx-runtime";
|
|
4719
5083
|
|
|
4720
5084
|
// src/timeline/entrance.tsx
|
|
4721
|
-
import { createContext as
|
|
4722
|
-
var EntranceAnimationContext =
|
|
5085
|
+
import { createContext as createContext5, useContext as useContext5, useRef as useRef7 } from "react";
|
|
5086
|
+
var EntranceAnimationContext = createContext5(true);
|
|
4723
5087
|
var EntranceAnimationProvider = EntranceAnimationContext.Provider;
|
|
4724
5088
|
function useEntranceAnimationLive() {
|
|
4725
|
-
return
|
|
5089
|
+
return useContext5(EntranceAnimationContext);
|
|
4726
5090
|
}
|
|
4727
5091
|
function useEntranceAnimation() {
|
|
4728
|
-
const enabled =
|
|
4729
|
-
const captured =
|
|
5092
|
+
const enabled = useContext5(EntranceAnimationContext);
|
|
5093
|
+
const captured = useRef7(enabled);
|
|
4730
5094
|
return captured.current;
|
|
4731
5095
|
}
|
|
4732
5096
|
|
|
4733
5097
|
// src/timeline/seen-activity-ids.ts
|
|
4734
|
-
import { createContext as
|
|
4735
|
-
var SeenActivityIdsContext =
|
|
5098
|
+
import { createContext as createContext6, useContext as useContext6 } from "react";
|
|
5099
|
+
var SeenActivityIdsContext = createContext6(null);
|
|
4736
5100
|
var SeenActivityIdsProvider = SeenActivityIdsContext.Provider;
|
|
4737
5101
|
function useSeenActivityIds() {
|
|
4738
|
-
return
|
|
5102
|
+
return useContext6(SeenActivityIdsContext);
|
|
4739
5103
|
}
|
|
4740
5104
|
|
|
4741
5105
|
// src/timeline/activity-rail.tsx
|
|
@@ -4752,6 +5116,8 @@ function ActivityRail({
|
|
|
4752
5116
|
toolRegistry = defaultToolRegistry,
|
|
4753
5117
|
onOpenSession,
|
|
4754
5118
|
onMemoryClick,
|
|
5119
|
+
loadRetainedScreenshot,
|
|
5120
|
+
loadRetainedArtifact,
|
|
4755
5121
|
bare,
|
|
4756
5122
|
className
|
|
4757
5123
|
}) {
|
|
@@ -4759,7 +5125,7 @@ function ActivityRail({
|
|
|
4759
5125
|
const enterLive = useEntranceAnimationLive();
|
|
4760
5126
|
const seenIds = useSeenActivityIds();
|
|
4761
5127
|
const enter = seenIds ? enterLive : enterMounted;
|
|
4762
|
-
const previousIdsRef =
|
|
5128
|
+
const previousIdsRef = useRef8(null);
|
|
4763
5129
|
const enteringIds = /* @__PURE__ */ new Set();
|
|
4764
5130
|
if (enter) {
|
|
4765
5131
|
for (const item of items) {
|
|
@@ -4796,11 +5162,19 @@ function ActivityRail({
|
|
|
4796
5162
|
),
|
|
4797
5163
|
children: items.map((item, index) => {
|
|
4798
5164
|
const newFamily = index > 0 && familyOf(item) !== familyOf(items[index - 1]);
|
|
4799
|
-
const row = renderActivity(
|
|
5165
|
+
const row = renderActivity(
|
|
5166
|
+
item,
|
|
5167
|
+
toolRegistry,
|
|
5168
|
+
onOpenSession,
|
|
5169
|
+
onMemoryClick,
|
|
5170
|
+
loadRetainedScreenshot,
|
|
5171
|
+
loadRetainedArtifact
|
|
5172
|
+
);
|
|
4800
5173
|
return /* @__PURE__ */ jsx13(
|
|
4801
5174
|
"div",
|
|
4802
5175
|
{
|
|
4803
5176
|
"data-og-timeline-row-anchor": "",
|
|
5177
|
+
"data-og-annotation-source-key": item.kind === "tool-call" ? item.annotationSource?.eventId : void 0,
|
|
4804
5178
|
className: cn(newFamily && "mt-3", enteringIds.has(item.id) && "animate-og-row-enter"),
|
|
4805
5179
|
children: row
|
|
4806
5180
|
},
|
|
@@ -4813,13 +5187,20 @@ function ActivityRail({
|
|
|
4813
5187
|
function assertNever(item) {
|
|
4814
5188
|
throw new Error(`ActivityRail: unhandled activity item ${JSON.stringify(item)}`);
|
|
4815
5189
|
}
|
|
4816
|
-
function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick) {
|
|
5190
|
+
function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick, loadRetainedScreenshot, loadRetainedArtifact) {
|
|
4817
5191
|
switch (item.kind) {
|
|
4818
5192
|
case "reasoning":
|
|
4819
5193
|
return /* @__PURE__ */ jsx13(ReasoningRow, { item });
|
|
4820
5194
|
case "tool-call": {
|
|
4821
5195
|
const Renderer = toolRegistry.resolve(item);
|
|
4822
|
-
return /* @__PURE__ */ jsx13(
|
|
5196
|
+
return /* @__PURE__ */ jsx13(ToolCallTruncationProvider, { value: item.truncation ?? null, children: /* @__PURE__ */ jsx13(
|
|
5197
|
+
Renderer,
|
|
5198
|
+
{
|
|
5199
|
+
item,
|
|
5200
|
+
loadRetainedScreenshot,
|
|
5201
|
+
loadRetainedArtifact
|
|
5202
|
+
}
|
|
5203
|
+
) });
|
|
4823
5204
|
}
|
|
4824
5205
|
case "worker":
|
|
4825
5206
|
return /* @__PURE__ */ jsx13(WorkerRow, { item, onOpenSession });
|
|
@@ -4908,7 +5289,7 @@ function MemoryRow({
|
|
|
4908
5289
|
onClick: () => onMemoryClick?.(targetId),
|
|
4909
5290
|
className: cn(
|
|
4910
5291
|
"group/memlink -mx-1 inline-flex w-fit items-center gap-1 rounded-og-sm px-1 py-0.5 text-left text-og-sm text-og-fg-subtle",
|
|
4911
|
-
"outline-
|
|
5292
|
+
"outline-hidden transition-colors duration-150 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent"
|
|
4912
5293
|
),
|
|
4913
5294
|
children: [
|
|
4914
5295
|
"View in memory",
|
|
@@ -4994,7 +5375,7 @@ function WorkerRow({
|
|
|
4994
5375
|
onClick: () => onOpenSession(sessionId),
|
|
4995
5376
|
className: cn(
|
|
4996
5377
|
"group/worker -mx-1.5 flex w-full items-start gap-2 rounded-og-sm px-1.5 py-1.5 text-left",
|
|
4997
|
-
"outline-
|
|
5378
|
+
"outline-hidden transition-colors duration-150 hover:bg-og-surface-1 focus-visible:ring-2 focus-visible:ring-og-accent",
|
|
4998
5379
|
"pointer-coarse:min-h-11 pointer-coarse:py-2.5"
|
|
4999
5380
|
),
|
|
5000
5381
|
children: inner
|
|
@@ -5008,21 +5389,21 @@ function WorkerRow({
|
|
|
5008
5389
|
import { ChevronRightIcon as ChevronRightIcon2, CircleSlashIcon, TriangleAlertIcon as TriangleAlertIcon2 } from "lucide-react";
|
|
5009
5390
|
import {
|
|
5010
5391
|
Component,
|
|
5011
|
-
createContext as
|
|
5012
|
-
useContext as
|
|
5013
|
-
useEffect as
|
|
5392
|
+
createContext as createContext8,
|
|
5393
|
+
useContext as useContext8,
|
|
5394
|
+
useEffect as useEffect9,
|
|
5014
5395
|
useMemo as useMemo4,
|
|
5015
|
-
useRef as
|
|
5016
|
-
useState as
|
|
5396
|
+
useRef as useRef9,
|
|
5397
|
+
useState as useState11
|
|
5017
5398
|
} from "react";
|
|
5018
5399
|
import { Collapsible } from "radix-ui";
|
|
5019
5400
|
|
|
5020
5401
|
// src/timeline/fold-memory.ts
|
|
5021
|
-
import { createContext as
|
|
5022
|
-
var FoldMemoryContext =
|
|
5402
|
+
import { createContext as createContext7, useContext as useContext7 } from "react";
|
|
5403
|
+
var FoldMemoryContext = createContext7(null);
|
|
5023
5404
|
var FoldMemoryProvider = FoldMemoryContext.Provider;
|
|
5024
5405
|
function useFoldMemory() {
|
|
5025
|
-
return
|
|
5406
|
+
return useContext7(FoldMemoryContext);
|
|
5026
5407
|
}
|
|
5027
5408
|
function inheritFoldRestingState(memory, targetKey, sourceKeys) {
|
|
5028
5409
|
if (memory.has(targetKey) || sourceKeys.length !== 1) {
|
|
@@ -5036,9 +5417,9 @@ function inheritFoldRestingState(memory, targetKey, sourceKeys) {
|
|
|
5036
5417
|
|
|
5037
5418
|
// src/timeline/turn-summary.tsx
|
|
5038
5419
|
import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
5039
|
-
var TurnSettleChromeContext =
|
|
5420
|
+
var TurnSettleChromeContext = createContext8(false);
|
|
5040
5421
|
function useTurnSettleOpen() {
|
|
5041
|
-
return
|
|
5422
|
+
return useContext8(TurnSettleChromeContext);
|
|
5042
5423
|
}
|
|
5043
5424
|
var BUILT_IN_TURN_SUMMARY_FACET_IDS = [
|
|
5044
5425
|
"steps",
|
|
@@ -5071,16 +5452,16 @@ function TurnSummary({
|
|
|
5071
5452
|
const remembered = foldKey !== void 0 ? foldMemory?.get(foldKey) : void 0;
|
|
5072
5453
|
const restingOpen = remembered === "closed" ? false : remembered === "open" ? true : defaultOpen ?? forcedDefaultOpen ?? false;
|
|
5073
5454
|
const initialSettle = Boolean(settleFold) && !restingOpen && remembered === void 0;
|
|
5074
|
-
const [settling, setSettling] =
|
|
5075
|
-
const [open, setOpen] =
|
|
5076
|
-
const [settlePhase, setSettlePhase] =
|
|
5077
|
-
const [nestSuppressLatch, setNestSuppressLatch] =
|
|
5078
|
-
const [expandReady, setExpandReady] =
|
|
5079
|
-
const settleTimerRef =
|
|
5080
|
-
const settleCloseDoneRef =
|
|
5081
|
-
const nestLatchClearRef =
|
|
5082
|
-
const settleFoldSeenRef =
|
|
5083
|
-
const settleArmedRef =
|
|
5455
|
+
const [settling, setSettling] = useState11(initialSettle);
|
|
5456
|
+
const [open, setOpen] = useState11(initialSettle ? true : restingOpen);
|
|
5457
|
+
const [settlePhase, setSettlePhase] = useState11(initialSettle);
|
|
5458
|
+
const [nestSuppressLatch, setNestSuppressLatch] = useState11(initialSettle);
|
|
5459
|
+
const [expandReady, setExpandReady] = useState11(!initialSettle);
|
|
5460
|
+
const settleTimerRef = useRef9(null);
|
|
5461
|
+
const settleCloseDoneRef = useRef9(null);
|
|
5462
|
+
const nestLatchClearRef = useRef9(null);
|
|
5463
|
+
const settleFoldSeenRef = useRef9(Boolean(settleFold));
|
|
5464
|
+
const settleArmedRef = useRef9(false);
|
|
5084
5465
|
const clearNestLatchTimer = () => {
|
|
5085
5466
|
if (nestLatchClearRef.current !== null) {
|
|
5086
5467
|
clearTimeout(nestLatchClearRef.current);
|
|
@@ -5128,8 +5509,8 @@ function TurnSummary({
|
|
|
5128
5509
|
}, SETTLE_COLLAPSE_MS);
|
|
5129
5510
|
}, SETTLE_FOLD_BEAT_MS);
|
|
5130
5511
|
};
|
|
5131
|
-
const mountSettleRef =
|
|
5132
|
-
|
|
5512
|
+
const mountSettleRef = useRef9(initialSettle);
|
|
5513
|
+
useEffect9(() => {
|
|
5133
5514
|
if (mountSettleRef.current) {
|
|
5134
5515
|
armSettleCollapse();
|
|
5135
5516
|
}
|
|
@@ -5138,7 +5519,7 @@ function TurnSummary({
|
|
|
5138
5519
|
settleArmedRef.current = false;
|
|
5139
5520
|
};
|
|
5140
5521
|
}, []);
|
|
5141
|
-
|
|
5522
|
+
useEffect9(() => {
|
|
5142
5523
|
const was = settleFoldSeenRef.current;
|
|
5143
5524
|
settleFoldSeenRef.current = Boolean(settleFold);
|
|
5144
5525
|
if (!was && settleFold) {
|
|
@@ -5173,7 +5554,7 @@ function TurnSummary({
|
|
|
5173
5554
|
}
|
|
5174
5555
|
};
|
|
5175
5556
|
const enter = useEntranceAnimation();
|
|
5176
|
-
const [allowEnterAnimation] =
|
|
5557
|
+
const [allowEnterAnimation] = useState11(
|
|
5177
5558
|
() => Boolean(enter && !bare && !initialSettle && !restingOpen)
|
|
5178
5559
|
);
|
|
5179
5560
|
const context = useMemo4(
|
|
@@ -5242,7 +5623,7 @@ function TurnSummary({
|
|
|
5242
5623
|
{
|
|
5243
5624
|
className: cn(
|
|
5244
5625
|
"size-3.5 shrink-0 text-og-fg-subtle transition-transform ease-og-in-out group-data-[state=open]:rotate-90",
|
|
5245
|
-
settlePhase ? "duration-[var(--
|
|
5626
|
+
settlePhase ? "duration-[var(--_og-duration-disclose-settle)]" : "duration-[var(--_og-duration-disclose)]"
|
|
5246
5627
|
)
|
|
5247
5628
|
}
|
|
5248
5629
|
),
|
|
@@ -5465,13 +5846,13 @@ function formatDurationFacet(durationMs) {
|
|
|
5465
5846
|
|
|
5466
5847
|
// src/components/user-message-body.tsx
|
|
5467
5848
|
import {
|
|
5468
|
-
createContext as
|
|
5849
|
+
createContext as createContext9,
|
|
5469
5850
|
useCallback as useCallback2,
|
|
5470
|
-
useContext as
|
|
5851
|
+
useContext as useContext9,
|
|
5471
5852
|
useId as useId3,
|
|
5472
5853
|
useLayoutEffect as useLayoutEffect3,
|
|
5473
|
-
useRef as
|
|
5474
|
-
useState as
|
|
5854
|
+
useRef as useRef10,
|
|
5855
|
+
useState as useState12
|
|
5475
5856
|
} from "react";
|
|
5476
5857
|
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5477
5858
|
var FALLBACK_LINE_THRESHOLD = 12;
|
|
@@ -5553,7 +5934,7 @@ function collectInteractionBoundaries(root) {
|
|
|
5553
5934
|
function isFullyInsideVisiblePreview(rect, clipRect) {
|
|
5554
5935
|
return rect.width > 0 && rect.height > 0 && rect.top >= clipRect.top - 1 && rect.bottom <= clipRect.bottom + 1 && rect.left >= clipRect.left - 1 && rect.right <= clipRect.right + 1;
|
|
5555
5936
|
}
|
|
5556
|
-
var UserMessageDisclosureContext =
|
|
5937
|
+
var UserMessageDisclosureContext = createContext9(null);
|
|
5557
5938
|
function UserMessageDisclosureProvider({
|
|
5558
5939
|
value,
|
|
5559
5940
|
children
|
|
@@ -5565,17 +5946,17 @@ function userMessageLikelyNeedsDisclosure(text) {
|
|
|
5565
5946
|
return lines.length > FALLBACK_LINE_THRESHOLD || text.length > FALLBACK_TEXT_THRESHOLD || lines.some((line) => line.length > FALLBACK_UNBROKEN_THRESHOLD);
|
|
5566
5947
|
}
|
|
5567
5948
|
function UserMessageBody({ messageId, text, children, className }) {
|
|
5568
|
-
const disclosure =
|
|
5569
|
-
const [expanded, setExpanded] =
|
|
5949
|
+
const disclosure = useContext9(UserMessageDisclosureContext);
|
|
5950
|
+
const [expanded, setExpanded] = useState12(
|
|
5570
5951
|
() => disclosure?.expandedByMessageId.get(messageId) ?? false
|
|
5571
5952
|
);
|
|
5572
|
-
const [collapsible, setCollapsible] =
|
|
5573
|
-
const rootRef =
|
|
5574
|
-
const clipRef =
|
|
5575
|
-
const contentRef =
|
|
5576
|
-
const thresholdRef =
|
|
5577
|
-
const pendingRestoreRef =
|
|
5578
|
-
const managedInertDescendantsRef =
|
|
5953
|
+
const [collapsible, setCollapsible] = useState12(() => userMessageLikelyNeedsDisclosure(text));
|
|
5954
|
+
const rootRef = useRef10(null);
|
|
5955
|
+
const clipRef = useRef10(null);
|
|
5956
|
+
const contentRef = useRef10(null);
|
|
5957
|
+
const thresholdRef = useRef10(null);
|
|
5958
|
+
const pendingRestoreRef = useRef10(null);
|
|
5959
|
+
const managedInertDescendantsRef = useRef10(/* @__PURE__ */ new Set());
|
|
5579
5960
|
const contentId = `og-user-message-${useId3().replace(/:/g, "")}`;
|
|
5580
5961
|
const collapsed = collapsible && !expanded;
|
|
5581
5962
|
const restoreManagedInertDescendants = useCallback2(() => {
|
|
@@ -5724,7 +6105,7 @@ function UserMessageBody({ messageId, text, children, className }) {
|
|
|
5724
6105
|
"aria-controls": contentId,
|
|
5725
6106
|
"aria-expanded": expanded,
|
|
5726
6107
|
"data-og-user-message-disclosure": "",
|
|
5727
|
-
className: "mt-1.5 inline-flex min-h-7 items-center rounded-og-sm px-1.5 text-og-xs font-medium text-og-fg-muted outline-
|
|
6108
|
+
className: "mt-1.5 inline-flex min-h-7 items-center rounded-og-sm px-1.5 text-og-xs font-medium text-og-fg-muted outline-hidden transition-colors hover:bg-og-surface-3/60 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/45 pointer-coarse:min-h-11",
|
|
5728
6109
|
onClick: (event) => toggle(event.currentTarget),
|
|
5729
6110
|
children: expanded ? "Show less" : "Show more"
|
|
5730
6111
|
}
|
|
@@ -5734,8 +6115,82 @@ function UserMessageBody({ messageId, text, children, className }) {
|
|
|
5734
6115
|
);
|
|
5735
6116
|
}
|
|
5736
6117
|
|
|
6118
|
+
// src/components/generated-video-player.tsx
|
|
6119
|
+
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
6120
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
6121
|
+
function GeneratedVideoPlayer({
|
|
6122
|
+
receipt,
|
|
6123
|
+
loadPlaybackSource,
|
|
6124
|
+
className,
|
|
6125
|
+
label = "Generated video"
|
|
6126
|
+
}) {
|
|
6127
|
+
const [retry, setRetry] = useState13(0);
|
|
6128
|
+
const [state, setState] = useState13({ kind: "loading" });
|
|
6129
|
+
useEffect10(() => {
|
|
6130
|
+
const controller = new AbortController();
|
|
6131
|
+
setState({ kind: "loading" });
|
|
6132
|
+
void loadPlaybackSource(receipt.artifact.artifactId, controller.signal).then(
|
|
6133
|
+
(source) => {
|
|
6134
|
+
if (!controller.signal.aborted) setState({ kind: "ready", source });
|
|
6135
|
+
},
|
|
6136
|
+
(error) => {
|
|
6137
|
+
if (controller.signal.aborted) return;
|
|
6138
|
+
setState({
|
|
6139
|
+
kind: "error",
|
|
6140
|
+
message: error instanceof Error ? error.message : "Playback is unavailable."
|
|
6141
|
+
});
|
|
6142
|
+
}
|
|
6143
|
+
);
|
|
6144
|
+
return () => controller.abort();
|
|
6145
|
+
}, [loadPlaybackSource, receipt.artifact.artifactId, retry]);
|
|
6146
|
+
if (state.kind === "loading") {
|
|
6147
|
+
return /* @__PURE__ */ jsx16(
|
|
6148
|
+
"div",
|
|
6149
|
+
{
|
|
6150
|
+
"aria-label": `Loading ${label.toLowerCase()}`,
|
|
6151
|
+
className: cn(
|
|
6152
|
+
"aspect-video w-full animate-pulse rounded-og-md bg-og-surface-2 motion-reduce:animate-none",
|
|
6153
|
+
className
|
|
6154
|
+
)
|
|
6155
|
+
}
|
|
6156
|
+
);
|
|
6157
|
+
}
|
|
6158
|
+
if (state.kind === "error") {
|
|
6159
|
+
return /* @__PURE__ */ jsx16(
|
|
6160
|
+
"div",
|
|
6161
|
+
{
|
|
6162
|
+
role: "status",
|
|
6163
|
+
className: cn(
|
|
6164
|
+
"rounded-og-md border border-og-status-failed/30 bg-og-status-failed/5 px-3 py-2 text-og-sm text-og-status-failed",
|
|
6165
|
+
className
|
|
6166
|
+
),
|
|
6167
|
+
children: state.message
|
|
6168
|
+
}
|
|
6169
|
+
);
|
|
6170
|
+
}
|
|
6171
|
+
return /* @__PURE__ */ jsx16(
|
|
6172
|
+
"video",
|
|
6173
|
+
{
|
|
6174
|
+
"aria-label": label,
|
|
6175
|
+
className: cn(
|
|
6176
|
+
"max-h-[32rem] w-full rounded-og-md bg-black object-contain shadow-sm",
|
|
6177
|
+
className
|
|
6178
|
+
),
|
|
6179
|
+
controls: true,
|
|
6180
|
+
playsInline: true,
|
|
6181
|
+
preload: "metadata",
|
|
6182
|
+
src: state.source.url,
|
|
6183
|
+
onError: () => {
|
|
6184
|
+
if (retry === 0) setRetry(1);
|
|
6185
|
+
else setState({ kind: "error", message: "Video playback failed." });
|
|
6186
|
+
}
|
|
6187
|
+
},
|
|
6188
|
+
state.source.url
|
|
6189
|
+
);
|
|
6190
|
+
}
|
|
6191
|
+
|
|
5737
6192
|
// src/components/session-status.tsx
|
|
5738
|
-
import { jsx as
|
|
6193
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
5739
6194
|
var SESSION_STATUS_META = {
|
|
5740
6195
|
queued: {
|
|
5741
6196
|
label: "Queued",
|
|
@@ -5799,7 +6254,7 @@ function SessionStatus({ status, label, size = "md", className }) {
|
|
|
5799
6254
|
className
|
|
5800
6255
|
),
|
|
5801
6256
|
children: [
|
|
5802
|
-
/* @__PURE__ */
|
|
6257
|
+
/* @__PURE__ */ jsx17(StatusDot, { status, className: size === "sm" ? "size-1" : "size-1.5" }),
|
|
5803
6258
|
label ?? meta.label
|
|
5804
6259
|
]
|
|
5805
6260
|
}
|
|
@@ -5807,7 +6262,7 @@ function SessionStatus({ status, label, size = "md", className }) {
|
|
|
5807
6262
|
}
|
|
5808
6263
|
function StatusDot({ status, className }) {
|
|
5809
6264
|
const meta = SESSION_STATUS_META[status];
|
|
5810
|
-
return /* @__PURE__ */
|
|
6265
|
+
return /* @__PURE__ */ jsx17(
|
|
5811
6266
|
"span",
|
|
5812
6267
|
{
|
|
5813
6268
|
className: cn(
|
|
@@ -5815,7 +6270,7 @@ function StatusDot({ status, className }) {
|
|
|
5815
6270
|
meta.dotClassName,
|
|
5816
6271
|
className
|
|
5817
6272
|
),
|
|
5818
|
-
children: meta.pulse ? /* @__PURE__ */
|
|
6273
|
+
children: meta.pulse ? /* @__PURE__ */ jsx17("span", { className: cn("absolute inset-0 animate-og-pulse rounded-full", meta.dotClassName) }) : null
|
|
5819
6274
|
}
|
|
5820
6275
|
);
|
|
5821
6276
|
}
|
|
@@ -5844,13 +6299,15 @@ import { AnimatePresence as AnimatePresence3, motion as motion3 } from "motion/r
|
|
|
5844
6299
|
import { Collapsible as Collapsible2 } from "radix-ui";
|
|
5845
6300
|
import {
|
|
5846
6301
|
Component as Component2,
|
|
6302
|
+
Suspense as Suspense4,
|
|
6303
|
+
lazy as lazy4,
|
|
5847
6304
|
memo as memo2,
|
|
5848
6305
|
useCallback as useCallback3,
|
|
5849
|
-
useEffect as
|
|
6306
|
+
useEffect as useEffect11,
|
|
5850
6307
|
useLayoutEffect as useLayoutEffect4,
|
|
5851
6308
|
useMemo as useMemo5,
|
|
5852
|
-
useRef as
|
|
5853
|
-
useState as
|
|
6309
|
+
useRef as useRef11,
|
|
6310
|
+
useState as useState14
|
|
5854
6311
|
} from "react";
|
|
5855
6312
|
|
|
5856
6313
|
// src/components/tip-follow.ts
|
|
@@ -6126,7 +6583,8 @@ var MACHINE_INPUT_META = {
|
|
|
6126
6583
|
goal_continuation: "Goal continued",
|
|
6127
6584
|
agent_message: "Agent update",
|
|
6128
6585
|
agent_steer_instruction: "Agent direction",
|
|
6129
|
-
child_terminal_result: "Agent finished"
|
|
6586
|
+
child_terminal_result: "Agent finished",
|
|
6587
|
+
media_generation_result: "Video update"
|
|
6130
6588
|
};
|
|
6131
6589
|
function machineInputBatchLabel(members) {
|
|
6132
6590
|
if (members.length === 0) return "Updates";
|
|
@@ -6148,6 +6606,8 @@ function machineInputBatchLabel(members) {
|
|
|
6148
6606
|
return n === 1 ? "Agent update" : `${n} agent updates`;
|
|
6149
6607
|
case "agent_steer_instruction":
|
|
6150
6608
|
return n === 1 ? "Agent direction" : `${n} agent directions`;
|
|
6609
|
+
case "media_generation_result":
|
|
6610
|
+
return n === 1 ? "Video ready" : `${n} video updates`;
|
|
6151
6611
|
}
|
|
6152
6612
|
}
|
|
6153
6613
|
const parts = [...counts.entries()].map(([kind, count]) => {
|
|
@@ -6179,7 +6639,8 @@ function machineInputSummaryIsUseful(kind, cleanedSummary) {
|
|
|
6179
6639
|
}
|
|
6180
6640
|
|
|
6181
6641
|
// src/components/message-timeline.tsx
|
|
6182
|
-
import { Fragment as Fragment7, jsx as
|
|
6642
|
+
import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6643
|
+
var TimelineAnnotationSelection = lazy4(() => import("./timeline-annotation-selection-3L7LHGG2.js"));
|
|
6183
6644
|
var PIN_THRESHOLD_PX = 48;
|
|
6184
6645
|
var OLDER_PREFETCH_MARGIN_PX = 400;
|
|
6185
6646
|
var OLDER_PREFETCH_ROOT_MARGIN = `${OLDER_PREFETCH_MARGIN_PX}px 0px 0px 0px`;
|
|
@@ -6226,11 +6687,16 @@ function MessageTimeline({
|
|
|
6226
6687
|
onOpenSession,
|
|
6227
6688
|
onMemoryClick,
|
|
6228
6689
|
onReconnect,
|
|
6690
|
+
shouldRenderAuthNeeded,
|
|
6229
6691
|
resolveProviderLogo,
|
|
6230
6692
|
toolRegistry = defaultToolRegistry,
|
|
6693
|
+
loadRetainedScreenshot,
|
|
6694
|
+
loadRetainedArtifact,
|
|
6695
|
+
loadVideoArtifactPlayback,
|
|
6231
6696
|
computeLabel = null,
|
|
6232
6697
|
turnSummary,
|
|
6233
6698
|
autoFollow = true,
|
|
6699
|
+
onAnnotate,
|
|
6234
6700
|
hasOlder = false,
|
|
6235
6701
|
loadingOlder = false,
|
|
6236
6702
|
onLoadOlder,
|
|
@@ -6240,46 +6706,62 @@ function MessageTimeline({
|
|
|
6240
6706
|
loadingNewer = false,
|
|
6241
6707
|
onLoadNewer,
|
|
6242
6708
|
onJumpToLatest,
|
|
6709
|
+
trailingState,
|
|
6243
6710
|
emptyState,
|
|
6244
6711
|
className
|
|
6245
6712
|
}) {
|
|
6246
|
-
const resolvedItems = useMemo5(() =>
|
|
6713
|
+
const resolvedItems = useMemo5(() => {
|
|
6714
|
+
const projected = items ?? buildTimeline(events ?? []);
|
|
6715
|
+
if (!shouldRenderAuthNeeded) {
|
|
6716
|
+
return projected;
|
|
6717
|
+
}
|
|
6718
|
+
return projected.filter((item) => item.kind !== "auth-needed" || shouldRenderAuthNeeded(item));
|
|
6719
|
+
}, [items, events, shouldRenderAuthNeeded]);
|
|
6247
6720
|
const allGroups = useMemo5(() => groupTimeline(resolvedItems), [resolvedItems]);
|
|
6721
|
+
const annotationSources = useMemo5(() => {
|
|
6722
|
+
const sources = /* @__PURE__ */ new Map();
|
|
6723
|
+
for (const item of resolvedItems) {
|
|
6724
|
+
if ((item.kind === "user-message" || item.kind === "agent-message" || item.kind === "tool-call") && item.annotationSource) {
|
|
6725
|
+
sources.set(item.annotationSource.eventId, item.annotationSource);
|
|
6726
|
+
}
|
|
6727
|
+
}
|
|
6728
|
+
return sources;
|
|
6729
|
+
}, [resolvedItems]);
|
|
6248
6730
|
const groups = useStableTimelineGroupKeys(allGroups);
|
|
6249
|
-
const scrollRef =
|
|
6250
|
-
const topSentinelRef =
|
|
6251
|
-
const bottomSentinelRef =
|
|
6252
|
-
const previousBulkFirstKeyRef =
|
|
6253
|
-
const [pinned, setPinned] =
|
|
6254
|
-
const [bulkActive, setBulkActive] =
|
|
6255
|
-
const olderPrefetchArmedRef =
|
|
6256
|
-
const [olderPrefetchArmed, setOlderPrefetchArmed] =
|
|
6257
|
-
const olderLoadGateRef =
|
|
6258
|
-
const resizeFollowRafRef =
|
|
6731
|
+
const scrollRef = useRef11(null);
|
|
6732
|
+
const topSentinelRef = useRef11(null);
|
|
6733
|
+
const bottomSentinelRef = useRef11(null);
|
|
6734
|
+
const previousBulkFirstKeyRef = useRef11(void 0);
|
|
6735
|
+
const [pinned, setPinned] = useState14(true);
|
|
6736
|
+
const [bulkActive, setBulkActive] = useState14(true);
|
|
6737
|
+
const olderPrefetchArmedRef = useRef11(false);
|
|
6738
|
+
const [olderPrefetchArmed, setOlderPrefetchArmed] = useState14(false);
|
|
6739
|
+
const olderLoadGateRef = useRef11("armed");
|
|
6740
|
+
const resizeFollowRafRef = useRef11(null);
|
|
6259
6741
|
const firstGroupKey = allGroups[0] ? timelineGroupKey(allGroups[0]) : null;
|
|
6260
|
-
const [revealed, setRevealed] =
|
|
6261
|
-
const pinnedRef =
|
|
6262
|
-
const hasNewerRef =
|
|
6742
|
+
const [revealed, setRevealed] = useState14(false);
|
|
6743
|
+
const pinnedRef = useRef11(true);
|
|
6744
|
+
const hasNewerRef = useRef11(hasNewer);
|
|
6263
6745
|
hasNewerRef.current = hasNewer;
|
|
6264
|
-
const wantPinRef =
|
|
6265
|
-
const pendingJumpToStartRef =
|
|
6266
|
-
const jumpToStartSeqRef =
|
|
6267
|
-
const previousFirstItemIdRef =
|
|
6268
|
-
const previousScrollHeightRef =
|
|
6269
|
-
const lastScrollTopRef =
|
|
6270
|
-
const lastMaxScrollRef =
|
|
6271
|
-
const lastScrollHeightRef =
|
|
6272
|
-
const lastClientHeightRef =
|
|
6273
|
-
const readerIntentArmRef =
|
|
6274
|
-
const programmaticScrollRef =
|
|
6275
|
-
const disclosureKeepsUnpinnedRef =
|
|
6276
|
-
const pendingReaderLeaveRef =
|
|
6277
|
-
const leaveFallbackRafRef =
|
|
6278
|
-
const foldMemoryRef =
|
|
6279
|
-
const userMessageDisclosureMemoryRef =
|
|
6280
|
-
const seenActivityIdsRef =
|
|
6281
|
-
const groupKeyByItemIdRef =
|
|
6282
|
-
const groupOffsetByKeyRef =
|
|
6746
|
+
const wantPinRef = useRef11(false);
|
|
6747
|
+
const pendingJumpToStartRef = useRef11(false);
|
|
6748
|
+
const jumpToStartSeqRef = useRef11(0);
|
|
6749
|
+
const previousFirstItemIdRef = useRef11(null);
|
|
6750
|
+
const previousScrollHeightRef = useRef11(0);
|
|
6751
|
+
const lastScrollTopRef = useRef11(0);
|
|
6752
|
+
const lastMaxScrollRef = useRef11(0);
|
|
6753
|
+
const lastScrollHeightRef = useRef11(0);
|
|
6754
|
+
const lastClientHeightRef = useRef11(0);
|
|
6755
|
+
const readerIntentArmRef = useRef11(false);
|
|
6756
|
+
const programmaticScrollRef = useRef11(0);
|
|
6757
|
+
const disclosureKeepsUnpinnedRef = useRef11(false);
|
|
6758
|
+
const pendingReaderLeaveRef = useRef11(false);
|
|
6759
|
+
const leaveFallbackRafRef = useRef11(null);
|
|
6760
|
+
const foldMemoryRef = useRef11(/* @__PURE__ */ new Map());
|
|
6761
|
+
const userMessageDisclosureMemoryRef = useRef11(/* @__PURE__ */ new Map());
|
|
6762
|
+
const seenActivityIdsRef = useRef11(/* @__PURE__ */ new Set());
|
|
6763
|
+
const groupKeyByItemIdRef = useRef11(/* @__PURE__ */ new Map());
|
|
6764
|
+
const groupOffsetByKeyRef = useRef11(/* @__PURE__ */ new Map());
|
|
6283
6765
|
const firstItemId = resolvedItems[0]?.id ?? null;
|
|
6284
6766
|
const firstKeyChangedForBulk = previousBulkFirstKeyRef.current !== void 0 && previousBulkFirstKeyRef.current !== firstGroupKey;
|
|
6285
6767
|
const bulkRender = allGroups.length > 0 && (bulkActive || firstKeyChangedForBulk);
|
|
@@ -6289,10 +6771,10 @@ function MessageTimeline({
|
|
|
6289
6771
|
setPinned(value);
|
|
6290
6772
|
}
|
|
6291
6773
|
}, []);
|
|
6292
|
-
const revealedRef =
|
|
6774
|
+
const revealedRef = useRef11(revealed);
|
|
6293
6775
|
revealedRef.current = revealed;
|
|
6294
|
-
const followRef =
|
|
6295
|
-
const followFrameRef =
|
|
6776
|
+
const followRef = useRef11(createTipFollowState());
|
|
6777
|
+
const followFrameRef = useRef11(null);
|
|
6296
6778
|
const syncScrollBaseline = useCallback3((node) => {
|
|
6297
6779
|
lastScrollTopRef.current = node.scrollTop;
|
|
6298
6780
|
lastMaxScrollRef.current = maxScrollOf(node);
|
|
@@ -6479,7 +6961,7 @@ function MessageTimeline({
|
|
|
6479
6961
|
}),
|
|
6480
6962
|
[beginUserMessageDisclosureChange]
|
|
6481
6963
|
);
|
|
6482
|
-
const driveFollowRef =
|
|
6964
|
+
const driveFollowRef = useRef11(() => void 0);
|
|
6483
6965
|
const driveFollow = useCallback3(
|
|
6484
6966
|
(node, nowMs) => {
|
|
6485
6967
|
if (!pinnedRef.current || hasNewerRef.current) {
|
|
@@ -6568,8 +7050,8 @@ function MessageTimeline({
|
|
|
6568
7050
|
[cancelLeaveFallback, stopFollow, syncScrollBaseline, writeScrollTop]
|
|
6569
7051
|
);
|
|
6570
7052
|
driveFollowRef.current = driveFollow;
|
|
6571
|
-
|
|
6572
|
-
|
|
7053
|
+
useEffect11(() => stopFollow, [stopFollow]);
|
|
7054
|
+
useEffect11(() => () => cancelLeaveFallback(), [cancelLeaveFallback]);
|
|
6573
7055
|
useLayoutEffect4(() => {
|
|
6574
7056
|
const node = scrollRef.current;
|
|
6575
7057
|
if (!node) {
|
|
@@ -6722,7 +7204,7 @@ function MessageTimeline({
|
|
|
6722
7204
|
const frame = requestFrame(() => setBulkActive(false));
|
|
6723
7205
|
return () => cancelFrame(frame);
|
|
6724
7206
|
}, [bulkRender, firstGroupKey]);
|
|
6725
|
-
|
|
7207
|
+
useEffect11(() => {
|
|
6726
7208
|
const root = scrollRef.current;
|
|
6727
7209
|
const target = topSentinelRef.current;
|
|
6728
7210
|
if (!root || !target || !olderPrefetchArmed || !hasOlder || loadingOlder || !onLoadOlder || typeof IntersectionObserver === "undefined") {
|
|
@@ -6746,7 +7228,7 @@ function MessageTimeline({
|
|
|
6746
7228
|
observer.observe(target);
|
|
6747
7229
|
return () => observer.disconnect();
|
|
6748
7230
|
}, [olderPrefetchArmed, hasOlder, loadingOlder, onLoadOlder, firstGroupKey]);
|
|
6749
|
-
|
|
7231
|
+
useEffect11(() => {
|
|
6750
7232
|
const root = scrollRef.current;
|
|
6751
7233
|
const target = bottomSentinelRef.current;
|
|
6752
7234
|
if (!root || !target || !hasNewer || loadingNewer || !onLoadNewer || typeof IntersectionObserver === "undefined") {
|
|
@@ -6763,7 +7245,7 @@ function MessageTimeline({
|
|
|
6763
7245
|
observer.observe(target);
|
|
6764
7246
|
return () => observer.disconnect();
|
|
6765
7247
|
}, [hasNewer, loadingNewer, onLoadNewer, firstGroupKey]);
|
|
6766
|
-
|
|
7248
|
+
useEffect11(() => {
|
|
6767
7249
|
const node = scrollRef.current;
|
|
6768
7250
|
const inner = node?.firstElementChild;
|
|
6769
7251
|
if (!node || !inner || typeof ResizeObserver === "undefined") {
|
|
@@ -6799,7 +7281,7 @@ function MessageTimeline({
|
|
|
6799
7281
|
}
|
|
6800
7282
|
};
|
|
6801
7283
|
}, [autoFollow, driveFollow, snapToBottom]);
|
|
6802
|
-
|
|
7284
|
+
useEffect11(() => {
|
|
6803
7285
|
if (hasNewer) {
|
|
6804
7286
|
stopFollow();
|
|
6805
7287
|
applyPinned(false);
|
|
@@ -6922,8 +7404,16 @@ function MessageTimeline({
|
|
|
6922
7404
|
}
|
|
6923
7405
|
releasePinAfterScrollSettled(node);
|
|
6924
7406
|
};
|
|
6925
|
-
return /* @__PURE__ */
|
|
6926
|
-
/* @__PURE__ */
|
|
7407
|
+
return /* @__PURE__ */ jsx18(LightboxProvider, { children: /* @__PURE__ */ jsx18(FoldMemoryProvider, { value: foldMemoryRef.current, children: /* @__PURE__ */ jsx18(SeenActivityIdsProvider, { value: seenActivityIdsRef.current, children: /* @__PURE__ */ jsx18(TimelineComputeLabelProvider, { value: computeLabel ?? null, children: /* @__PURE__ */ jsx18(EntranceAnimationProvider, { value: !bulkRender, children: /* @__PURE__ */ jsx18(TooltipProvider, { delayDuration: 400, children: /* @__PURE__ */ jsxs14("div", { className: cn("og-root relative flex min-h-0 flex-col", className), children: [
|
|
7408
|
+
onAnnotate ? /* @__PURE__ */ jsx18(Suspense4, { fallback: null, children: /* @__PURE__ */ jsx18(
|
|
7409
|
+
TimelineAnnotationSelection,
|
|
7410
|
+
{
|
|
7411
|
+
rootRef: scrollRef,
|
|
7412
|
+
sources: annotationSources,
|
|
7413
|
+
onAnnotate
|
|
7414
|
+
}
|
|
7415
|
+
) }) : null,
|
|
7416
|
+
/* @__PURE__ */ jsx18(
|
|
6927
7417
|
"div",
|
|
6928
7418
|
{
|
|
6929
7419
|
ref: scrollRef,
|
|
@@ -6939,15 +7429,15 @@ function MessageTimeline({
|
|
|
6939
7429
|
className: cn(
|
|
6940
7430
|
// tabIndex=-1 is programmatic only — never paint a focus ring on
|
|
6941
7431
|
// the whole scroller (click + Shift used to flash a blue outline).
|
|
6942
|
-
"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-6 sm:px-6 outline-
|
|
7432
|
+
"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-6 sm:px-6 outline-hidden",
|
|
6943
7433
|
autoFollow && pinned && !hasNewer ? "[overflow-anchor:none]" : "[overflow-anchor:auto]"
|
|
6944
7434
|
),
|
|
6945
7435
|
children: /* @__PURE__ */ jsxs14("div", { className: "relative mx-auto flex w-full max-w-3xl flex-col gap-5", children: [
|
|
6946
|
-
groups.length === 0 ? emptyState ?? /* @__PURE__ */
|
|
7436
|
+
groups.length === 0 ? emptyState ?? /* @__PURE__ */ jsx18("p", { className: "py-10 text-center text-og-menu text-og-fg-subtle", children: "No activity yet." }) : null,
|
|
6947
7437
|
hasOlder && olderPrefetchArmed ? (
|
|
6948
7438
|
// Overlaid, not a layout row: mounting/unmounting the sentinel
|
|
6949
7439
|
// must never shift content (that shift was itself a wobble).
|
|
6950
|
-
/* @__PURE__ */
|
|
7440
|
+
/* @__PURE__ */ jsx18(
|
|
6951
7441
|
"div",
|
|
6952
7442
|
{
|
|
6953
7443
|
ref: topSentinelRef,
|
|
@@ -6961,7 +7451,7 @@ function MessageTimeline({
|
|
|
6961
7451
|
groups.map(({ group, key }, index) => {
|
|
6962
7452
|
const next = groups[index + 1]?.group;
|
|
6963
7453
|
const contextCompactionCount = group.kind === "turn" ? group.contextCompactionCount ?? 0 : group.kind === "activity" && next?.kind === "item" && next.item.kind === "context-compaction" && next.item.phase === "compacted" ? 1 : 0;
|
|
6964
|
-
return /* @__PURE__ */
|
|
7454
|
+
return /* @__PURE__ */ jsx18("div", { "data-og-timeline-group-anchor": "", "data-og-group-key": key, children: /* @__PURE__ */ jsx18(
|
|
6965
7455
|
TimelineGroupRenderBoundary,
|
|
6966
7456
|
{
|
|
6967
7457
|
resetKeys: [
|
|
@@ -6972,9 +7462,12 @@ function MessageTimeline({
|
|
|
6972
7462
|
onReconnect,
|
|
6973
7463
|
resolveProviderLogo,
|
|
6974
7464
|
toolRegistry,
|
|
7465
|
+
loadRetainedScreenshot,
|
|
7466
|
+
loadRetainedArtifact,
|
|
7467
|
+
loadVideoArtifactPlayback,
|
|
6975
7468
|
turnSummary
|
|
6976
7469
|
],
|
|
6977
|
-
children: /* @__PURE__ */
|
|
7470
|
+
children: /* @__PURE__ */ jsx18(UserMessageDisclosureProvider, { value: userMessageDisclosureContext, children: /* @__PURE__ */ jsx18(
|
|
6978
7471
|
TimelineGroupView,
|
|
6979
7472
|
{
|
|
6980
7473
|
group,
|
|
@@ -6984,6 +7477,9 @@ function MessageTimeline({
|
|
|
6984
7477
|
onReconnect,
|
|
6985
7478
|
resolveProviderLogo,
|
|
6986
7479
|
toolRegistry,
|
|
7480
|
+
loadRetainedScreenshot,
|
|
7481
|
+
loadRetainedArtifact,
|
|
7482
|
+
loadVideoArtifactPlayback,
|
|
6987
7483
|
turnSummary,
|
|
6988
7484
|
foldLiveCluster: isAgentProgress(next),
|
|
6989
7485
|
trailingAgentText: trailingAgentTextAfterTurn(group, next),
|
|
@@ -6993,7 +7489,8 @@ function MessageTimeline({
|
|
|
6993
7489
|
}
|
|
6994
7490
|
) }, key);
|
|
6995
7491
|
}),
|
|
6996
|
-
|
|
7492
|
+
groups.length > 0 && trailingState ? /* @__PURE__ */ jsx18("div", { "data-og-timeline-trailing-state": "", children: trailingState }) : null,
|
|
7493
|
+
hasNewer ? /* @__PURE__ */ jsx18(
|
|
6997
7494
|
"div",
|
|
6998
7495
|
{
|
|
6999
7496
|
ref: bottomSentinelRef,
|
|
@@ -7006,7 +7503,7 @@ function MessageTimeline({
|
|
|
7006
7503
|
] })
|
|
7007
7504
|
}
|
|
7008
7505
|
),
|
|
7009
|
-
/* @__PURE__ */
|
|
7506
|
+
/* @__PURE__ */ jsx18(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed ? (
|
|
7010
7507
|
// Floating over the scroller (not a timeline row) so showing and
|
|
7011
7508
|
// hiding it never reflows history under the reader.
|
|
7012
7509
|
/* @__PURE__ */ jsxs14(
|
|
@@ -7020,7 +7517,7 @@ function MessageTimeline({
|
|
|
7020
7517
|
"aria-live": "polite",
|
|
7021
7518
|
className: "absolute inset-x-0 top-3 z-10 flex justify-center gap-2",
|
|
7022
7519
|
children: [
|
|
7023
|
-
loadingOlder || loadingOldest ? /* @__PURE__ */
|
|
7520
|
+
loadingOlder || loadingOldest ? /* @__PURE__ */ jsx18("span", { className: "pointer-events-none inline-flex items-center rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1 text-og-control font-medium shadow-og-md backdrop-blur", children: /* @__PURE__ */ jsx18("span", { className: "og-shimmer-text", children: loadingOldest ? "Jumping to start\u2026" : "Loading earlier activity\u2026" }) }) : null,
|
|
7024
7521
|
hasOlder && onJumpToStart && !loadingOldest ? /* @__PURE__ */ jsxs14(
|
|
7025
7522
|
"button",
|
|
7026
7523
|
{
|
|
@@ -7057,7 +7554,7 @@ function MessageTimeline({
|
|
|
7057
7554
|
"hover:border-og-border-strong disabled:opacity-60"
|
|
7058
7555
|
),
|
|
7059
7556
|
children: [
|
|
7060
|
-
/* @__PURE__ */
|
|
7557
|
+
/* @__PURE__ */ jsx18(ArrowUpToLineIcon, { className: "size-3.5" }),
|
|
7061
7558
|
"Jump to start"
|
|
7062
7559
|
]
|
|
7063
7560
|
}
|
|
@@ -7066,7 +7563,7 @@ function MessageTimeline({
|
|
|
7066
7563
|
}
|
|
7067
7564
|
)
|
|
7068
7565
|
) : null }),
|
|
7069
|
-
/* @__PURE__ */
|
|
7566
|
+
/* @__PURE__ */ jsx18(AnimatePresence3, { children: loadingNewer ? /* @__PURE__ */ jsx18(
|
|
7070
7567
|
motion3.div,
|
|
7071
7568
|
{
|
|
7072
7569
|
initial: { opacity: 0, y: 6 },
|
|
@@ -7076,10 +7573,10 @@ function MessageTimeline({
|
|
|
7076
7573
|
"data-og-loading-newer": "",
|
|
7077
7574
|
"aria-live": "polite",
|
|
7078
7575
|
className: "pointer-events-none absolute inset-x-0 bottom-14 z-10 flex justify-center",
|
|
7079
|
-
children: /* @__PURE__ */
|
|
7576
|
+
children: /* @__PURE__ */ jsx18("span", { className: "inline-flex items-center rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1 text-og-control font-medium shadow-og-md backdrop-blur", children: /* @__PURE__ */ jsx18("span", { className: "og-shimmer-text", children: "Loading later activity\u2026" }) })
|
|
7080
7577
|
}
|
|
7081
7578
|
) : null }),
|
|
7082
|
-
/* @__PURE__ */
|
|
7579
|
+
/* @__PURE__ */ jsx18(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer) && autoFollow ? /* @__PURE__ */ jsxs14(
|
|
7083
7580
|
motion3.button,
|
|
7084
7581
|
{
|
|
7085
7582
|
type: "button",
|
|
@@ -7118,13 +7615,13 @@ function MessageTimeline({
|
|
|
7118
7615
|
}
|
|
7119
7616
|
},
|
|
7120
7617
|
className: cn(
|
|
7121
|
-
"absolute bottom-4
|
|
7618
|
+
"absolute inset-x-0 bottom-4 mx-auto w-fit",
|
|
7122
7619
|
"inline-flex items-center gap-1.5 rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1.5",
|
|
7123
7620
|
"text-og-control font-medium text-og-fg shadow-og-md backdrop-blur",
|
|
7124
7621
|
"hover:border-og-border-strong"
|
|
7125
7622
|
),
|
|
7126
7623
|
children: [
|
|
7127
|
-
/* @__PURE__ */
|
|
7624
|
+
/* @__PURE__ */ jsx18(ArrowDownIcon2, { className: "size-3.5" }),
|
|
7128
7625
|
"Jump to latest"
|
|
7129
7626
|
]
|
|
7130
7627
|
}
|
|
@@ -7132,7 +7629,7 @@ function MessageTimeline({
|
|
|
7132
7629
|
] }) }) }) }) }) }) });
|
|
7133
7630
|
}
|
|
7134
7631
|
function useStableTimelineGroupKeys(allGroups) {
|
|
7135
|
-
const previousRef =
|
|
7632
|
+
const previousRef = useRef11([]);
|
|
7136
7633
|
const keyedGroups = useMemo5(() => {
|
|
7137
7634
|
const previousByItemId = /* @__PURE__ */ new Map();
|
|
7138
7635
|
for (const previous of previousRef.current) {
|
|
@@ -7206,10 +7703,10 @@ var TimelineGroupRenderBoundary = class extends Component2 {
|
|
|
7206
7703
|
role: "status",
|
|
7207
7704
|
className: "flex items-start gap-2 rounded-lg border border-og-border bg-og-surface-muted px-3 py-2 text-og-menu text-og-fg-muted",
|
|
7208
7705
|
children: [
|
|
7209
|
-
/* @__PURE__ */
|
|
7706
|
+
/* @__PURE__ */ jsx18(TriangleAlertIcon3, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
|
|
7210
7707
|
/* @__PURE__ */ jsxs14("div", { children: [
|
|
7211
|
-
/* @__PURE__ */
|
|
7212
|
-
/* @__PURE__ */
|
|
7708
|
+
/* @__PURE__ */ jsx18("p", { className: "font-medium text-og-fg", children: "Timeline item unavailable" }),
|
|
7709
|
+
/* @__PURE__ */ jsx18("p", { children: "This item could not be displayed. The rest of the conversation is still available." })
|
|
7213
7710
|
] })
|
|
7214
7711
|
]
|
|
7215
7712
|
}
|
|
@@ -7226,6 +7723,9 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7226
7723
|
onReconnect,
|
|
7227
7724
|
resolveProviderLogo,
|
|
7228
7725
|
toolRegistry,
|
|
7726
|
+
loadRetainedScreenshot,
|
|
7727
|
+
loadRetainedArtifact,
|
|
7728
|
+
loadVideoArtifactPlayback,
|
|
7229
7729
|
turnSummary,
|
|
7230
7730
|
insideTurn = false,
|
|
7231
7731
|
nestClusterChips = false,
|
|
@@ -7237,8 +7737,9 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7237
7737
|
const settleChrome = useTurnSettleOpen();
|
|
7238
7738
|
const foldMemory = useFoldMemory();
|
|
7239
7739
|
const activityShouldFold = group.kind === "activity" && Boolean(group.outcome || foldLiveCluster && clusterIsSettled(group));
|
|
7740
|
+
const containsGeneratedImage = timelineGroupContainsGeneratedImage(group);
|
|
7240
7741
|
const liveActivitySettle = useLiveSettleFold(activityShouldFold && !insideTurn);
|
|
7241
|
-
const turnDefaultOpen = !insideTurn && group.kind === "turn" && (group.outcome === "failed" || timelineGroupContainsAuthNeeded(group));
|
|
7742
|
+
const turnDefaultOpen = !insideTurn && group.kind === "turn" && (group.outcome === "failed" || timelineGroupContainsAuthNeeded(group) || containsGeneratedImage);
|
|
7242
7743
|
if (group.kind === "turn" && foldMemory && !insideTurn) {
|
|
7243
7744
|
inheritFoldRestingState(
|
|
7244
7745
|
foldMemory,
|
|
@@ -7250,20 +7751,22 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7250
7751
|
switch (group.kind) {
|
|
7251
7752
|
case "activity":
|
|
7252
7753
|
if (insideTurn) {
|
|
7253
|
-
const useNestedChip = nestClusterChips && activityShouldFold;
|
|
7754
|
+
const useNestedChip = nestClusterChips && activityShouldFold && !containsGeneratedImage;
|
|
7254
7755
|
if (!useNestedChip) {
|
|
7255
|
-
return /* @__PURE__ */
|
|
7756
|
+
return /* @__PURE__ */ jsx18(
|
|
7256
7757
|
ActivityRail,
|
|
7257
7758
|
{
|
|
7258
7759
|
items: group.items,
|
|
7259
7760
|
onOpenSession,
|
|
7260
7761
|
onMemoryClick,
|
|
7261
7762
|
toolRegistry,
|
|
7763
|
+
loadRetainedScreenshot,
|
|
7764
|
+
loadRetainedArtifact,
|
|
7262
7765
|
bare: true
|
|
7263
7766
|
}
|
|
7264
7767
|
);
|
|
7265
7768
|
}
|
|
7266
|
-
return /* @__PURE__ */
|
|
7769
|
+
return /* @__PURE__ */ jsx18(
|
|
7267
7770
|
TurnSummary,
|
|
7268
7771
|
{
|
|
7269
7772
|
items: group.items,
|
|
@@ -7274,13 +7777,15 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7274
7777
|
foldKey: group.id,
|
|
7275
7778
|
facets: turnSummary?.facets,
|
|
7276
7779
|
contextCompactionCount,
|
|
7277
|
-
children: /* @__PURE__ */
|
|
7780
|
+
children: /* @__PURE__ */ jsx18(
|
|
7278
7781
|
ActivityRail,
|
|
7279
7782
|
{
|
|
7280
7783
|
items: group.items,
|
|
7281
7784
|
onOpenSession,
|
|
7282
7785
|
onMemoryClick,
|
|
7283
7786
|
toolRegistry,
|
|
7787
|
+
loadRetainedScreenshot,
|
|
7788
|
+
loadRetainedArtifact,
|
|
7284
7789
|
bare: true
|
|
7285
7790
|
}
|
|
7286
7791
|
)
|
|
@@ -7288,7 +7793,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7288
7793
|
settleChrome ? "settle" : "rest"
|
|
7289
7794
|
);
|
|
7290
7795
|
}
|
|
7291
|
-
return /* @__PURE__ */
|
|
7796
|
+
return /* @__PURE__ */ jsx18(
|
|
7292
7797
|
TurnSummary,
|
|
7293
7798
|
{
|
|
7294
7799
|
items: group.items,
|
|
@@ -7299,13 +7804,15 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7299
7804
|
facets: turnSummary?.facets,
|
|
7300
7805
|
settleFold,
|
|
7301
7806
|
contextCompactionCount,
|
|
7302
|
-
children: /* @__PURE__ */
|
|
7807
|
+
children: /* @__PURE__ */ jsx18(FoldBody, { children: /* @__PURE__ */ jsx18(TurnRailFrame, { children: /* @__PURE__ */ jsx18(
|
|
7303
7808
|
ActivityRail,
|
|
7304
7809
|
{
|
|
7305
7810
|
items: group.items,
|
|
7306
7811
|
onOpenSession,
|
|
7307
7812
|
onMemoryClick,
|
|
7308
7813
|
toolRegistry,
|
|
7814
|
+
loadRetainedScreenshot,
|
|
7815
|
+
loadRetainedArtifact,
|
|
7309
7816
|
bare: true
|
|
7310
7817
|
}
|
|
7311
7818
|
) }) })
|
|
@@ -7317,7 +7824,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7317
7824
|
const turnCopyText = collectTurnCopyText(group.groups, trailingAgentText);
|
|
7318
7825
|
const body = group.groups.map((child) => {
|
|
7319
7826
|
const key = timelineGroupKey(child);
|
|
7320
|
-
return /* @__PURE__ */
|
|
7827
|
+
return /* @__PURE__ */ jsx18(
|
|
7321
7828
|
TimelineGroupRenderBoundary,
|
|
7322
7829
|
{
|
|
7323
7830
|
resetKeys: [
|
|
@@ -7328,9 +7835,12 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7328
7835
|
onReconnect,
|
|
7329
7836
|
resolveProviderLogo,
|
|
7330
7837
|
toolRegistry,
|
|
7838
|
+
loadRetainedScreenshot,
|
|
7839
|
+
loadRetainedArtifact,
|
|
7840
|
+
loadVideoArtifactPlayback,
|
|
7331
7841
|
turnSummary
|
|
7332
7842
|
],
|
|
7333
|
-
children: /* @__PURE__ */
|
|
7843
|
+
children: /* @__PURE__ */ jsx18(
|
|
7334
7844
|
TimelineGroupView2,
|
|
7335
7845
|
{
|
|
7336
7846
|
group: child,
|
|
@@ -7340,6 +7850,9 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7340
7850
|
onReconnect,
|
|
7341
7851
|
resolveProviderLogo,
|
|
7342
7852
|
toolRegistry,
|
|
7853
|
+
loadRetainedScreenshot,
|
|
7854
|
+
loadRetainedArtifact,
|
|
7855
|
+
loadVideoArtifactPlayback,
|
|
7343
7856
|
turnSummary,
|
|
7344
7857
|
insideTurn: true,
|
|
7345
7858
|
nestClusterChips: nestClusters
|
|
@@ -7349,7 +7862,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7349
7862
|
key
|
|
7350
7863
|
);
|
|
7351
7864
|
});
|
|
7352
|
-
return /* @__PURE__ */
|
|
7865
|
+
return /* @__PURE__ */ jsx18(
|
|
7353
7866
|
TurnSummary,
|
|
7354
7867
|
{
|
|
7355
7868
|
items: activityItems,
|
|
@@ -7363,36 +7876,37 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
7363
7876
|
settleFold,
|
|
7364
7877
|
copyText: insideTurn ? void 0 : turnCopyText,
|
|
7365
7878
|
contextCompactionCount: contextCompactionCount ?? group.contextCompactionCount,
|
|
7366
|
-
children: /* @__PURE__ */
|
|
7879
|
+
children: /* @__PURE__ */ jsx18(FoldBody, { children: insideTurn ? (
|
|
7367
7880
|
// A nested turn is already on an ancestor rail — its body just stacks
|
|
7368
7881
|
// flush (the bare-node body already indents it), so no second rule.
|
|
7369
|
-
/* @__PURE__ */
|
|
7370
|
-
) : /* @__PURE__ */
|
|
7882
|
+
/* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-4", children: body })
|
|
7883
|
+
) : /* @__PURE__ */ jsx18(TurnRailFrame, { children: body }) })
|
|
7371
7884
|
}
|
|
7372
7885
|
);
|
|
7373
7886
|
}
|
|
7374
7887
|
case "item":
|
|
7375
|
-
return /* @__PURE__ */
|
|
7888
|
+
return /* @__PURE__ */ jsx18(
|
|
7376
7889
|
TimelineRow,
|
|
7377
7890
|
{
|
|
7378
7891
|
item: group.item,
|
|
7379
7892
|
renderMessageText,
|
|
7380
7893
|
onReconnect,
|
|
7381
7894
|
resolveProviderLogo,
|
|
7382
|
-
onOpenSession
|
|
7895
|
+
onOpenSession,
|
|
7896
|
+
loadVideoArtifactPlayback
|
|
7383
7897
|
}
|
|
7384
7898
|
);
|
|
7385
7899
|
}
|
|
7386
7900
|
});
|
|
7387
7901
|
function FoldBody({ children }) {
|
|
7388
|
-
return /* @__PURE__ */
|
|
7902
|
+
return /* @__PURE__ */ jsx18(Fragment7, { children });
|
|
7389
7903
|
}
|
|
7390
7904
|
function TurnRailFrame({ children }) {
|
|
7391
|
-
return /* @__PURE__ */
|
|
7905
|
+
return /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-4 border-l-2 border-og-border pl-3 sm:pl-4", children });
|
|
7392
7906
|
}
|
|
7393
7907
|
function useLiveSettleFold(folded) {
|
|
7394
|
-
const previousFoldedRef =
|
|
7395
|
-
const latchedRef =
|
|
7908
|
+
const previousFoldedRef = useRef11(folded);
|
|
7909
|
+
const latchedRef = useRef11(false);
|
|
7396
7910
|
if (!previousFoldedRef.current && folded) {
|
|
7397
7911
|
latchedRef.current = true;
|
|
7398
7912
|
}
|
|
@@ -7421,6 +7935,18 @@ function timelineGroupContainsAuthNeeded(group) {
|
|
|
7421
7935
|
return group.groups.some(timelineGroupContainsAuthNeeded);
|
|
7422
7936
|
}
|
|
7423
7937
|
}
|
|
7938
|
+
function timelineGroupContainsGeneratedImage(group) {
|
|
7939
|
+
switch (group.kind) {
|
|
7940
|
+
case "item":
|
|
7941
|
+
return false;
|
|
7942
|
+
case "activity":
|
|
7943
|
+
return group.items.some(
|
|
7944
|
+
(item) => item.kind === "tool-call" && item.name === "generate_image"
|
|
7945
|
+
);
|
|
7946
|
+
case "turn":
|
|
7947
|
+
return group.groups.some(timelineGroupContainsGeneratedImage);
|
|
7948
|
+
}
|
|
7949
|
+
}
|
|
7424
7950
|
function timelineGroupItemIds(group) {
|
|
7425
7951
|
switch (group.kind) {
|
|
7426
7952
|
case "item":
|
|
@@ -7546,27 +8072,28 @@ function TimelineRow({
|
|
|
7546
8072
|
renderMessageText,
|
|
7547
8073
|
onReconnect,
|
|
7548
8074
|
resolveProviderLogo,
|
|
7549
|
-
onOpenSession
|
|
8075
|
+
onOpenSession,
|
|
8076
|
+
loadVideoArtifactPlayback
|
|
7550
8077
|
}) {
|
|
7551
8078
|
switch (item.kind) {
|
|
7552
8079
|
case "user-message":
|
|
7553
|
-
return /* @__PURE__ */
|
|
8080
|
+
return /* @__PURE__ */ jsx18(UserMessageRow, { item, renderMessageText });
|
|
7554
8081
|
case "agent-message":
|
|
7555
|
-
return /* @__PURE__ */
|
|
8082
|
+
return /* @__PURE__ */ jsx18(AgentMessageRow, { item, renderMessageText });
|
|
7556
8083
|
case "worker-completion":
|
|
7557
|
-
return /* @__PURE__ */
|
|
8084
|
+
return /* @__PURE__ */ jsx18(WorkerCompletionRow, { item, onOpenSession });
|
|
7558
8085
|
case "session-status":
|
|
7559
|
-
return /* @__PURE__ */
|
|
8086
|
+
return /* @__PURE__ */ jsx18(SessionStatusRow, { item });
|
|
7560
8087
|
case "goal":
|
|
7561
|
-
return /* @__PURE__ */
|
|
8088
|
+
return /* @__PURE__ */ jsx18(GoalRow, { item });
|
|
7562
8089
|
case "machine-input-batch":
|
|
7563
|
-
return /* @__PURE__ */
|
|
8090
|
+
return /* @__PURE__ */ jsx18(MachineInputBatchRow, { item, loadVideoArtifactPlayback });
|
|
7564
8091
|
case "notice":
|
|
7565
|
-
return /* @__PURE__ */
|
|
8092
|
+
return /* @__PURE__ */ jsx18(NoticeRow, { item });
|
|
7566
8093
|
case "context-compaction":
|
|
7567
|
-
return /* @__PURE__ */
|
|
8094
|
+
return /* @__PURE__ */ jsx18(CompactionRow, { item });
|
|
7568
8095
|
case "auth-needed":
|
|
7569
|
-
return /* @__PURE__ */
|
|
8096
|
+
return /* @__PURE__ */ jsx18(
|
|
7570
8097
|
AuthNeededRow,
|
|
7571
8098
|
{
|
|
7572
8099
|
item,
|
|
@@ -7592,7 +8119,7 @@ function CompactionRow({ item }) {
|
|
|
7592
8119
|
const title = item.phase === "started" ? "Compacting conversation history\u2026" : item.phase === "compacted" ? before && after ? `Conversation history compacted \xB7 ~${before} \u2192 ~${after} estimated history tokens` : "Conversation history compacted" : "Couldn\u2019t compact conversation history";
|
|
7593
8120
|
const subtitle = item.phase === "compacted" ? "Chat history above is unchanged" : item.phase === "skipped" ? compactionSkipSubtitle(item.skipReason) : null;
|
|
7594
8121
|
const pill = item.phase === "skipped" && item.skipReason === "summarization_failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.phase === "started" ? "border-og-status-waiting/35 bg-og-status-waiting/10 text-og-status-waiting" : "border-og-border bg-og-surface-1 text-og-fg-muted";
|
|
7595
|
-
return /* @__PURE__ */
|
|
8122
|
+
return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs14(
|
|
7596
8123
|
"div",
|
|
7597
8124
|
{
|
|
7598
8125
|
className: cn(
|
|
@@ -7602,13 +8129,13 @@ function CompactionRow({ item }) {
|
|
|
7602
8129
|
role: "status",
|
|
7603
8130
|
children: [
|
|
7604
8131
|
/* @__PURE__ */ jsxs14("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
|
|
7605
|
-
/* @__PURE__ */
|
|
8132
|
+
/* @__PURE__ */ jsx18(ShrinkIcon, { className: "size-3.5 shrink-0" }),
|
|
7606
8133
|
/* @__PURE__ */ jsxs14("span", { className: "truncate", children: [
|
|
7607
8134
|
title,
|
|
7608
8135
|
trigger ? ` \xB7 ${trigger}` : ""
|
|
7609
8136
|
] })
|
|
7610
8137
|
] }),
|
|
7611
|
-
subtitle ? /* @__PURE__ */
|
|
8138
|
+
subtitle ? /* @__PURE__ */ jsx18("span", { className: "truncate text-og-xs opacity-80", children: subtitle }) : null
|
|
7612
8139
|
]
|
|
7613
8140
|
}
|
|
7614
8141
|
) });
|
|
@@ -7628,7 +8155,7 @@ function compactionSkipSubtitle(reason) {
|
|
|
7628
8155
|
}
|
|
7629
8156
|
}
|
|
7630
8157
|
function MessageFooterTime({ occurredAt }) {
|
|
7631
|
-
return /* @__PURE__ */
|
|
8158
|
+
return /* @__PURE__ */ jsx18(
|
|
7632
8159
|
"time",
|
|
7633
8160
|
{
|
|
7634
8161
|
dateTime: occurredAt,
|
|
@@ -7646,34 +8173,68 @@ function UserMessageRow({
|
|
|
7646
8173
|
renderMessageText
|
|
7647
8174
|
}) {
|
|
7648
8175
|
const enter = useEntranceAnimation();
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
8176
|
+
const deliveryLabel = item.delivery?.state === "sending" ? "Sending\u2026" : item.delivery?.state === "queued" ? "Queued" : item.delivery?.state === "failed" ? "Not sent" : null;
|
|
8177
|
+
return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "flex justify-end"), children: /* @__PURE__ */ jsxs14("div", { className: "flex max-w-[85%] min-w-0 flex-col items-end gap-1", children: [
|
|
8178
|
+
/* @__PURE__ */ jsx18(
|
|
8179
|
+
CopyHoverFrame,
|
|
8180
|
+
{
|
|
8181
|
+
copyText: item.text || (item.annotations ?? []).map((annotation) => `${annotation.quote}
|
|
8182
|
+
${annotation.note}`).join("\n\n"),
|
|
8183
|
+
label: "Copy message",
|
|
8184
|
+
className: "w-fit max-w-full min-w-0",
|
|
8185
|
+
trailing: /* @__PURE__ */ jsx18(MessageFooterTime, { occurredAt: item.occurredAt }),
|
|
8186
|
+
children: /* @__PURE__ */ jsxs14("div", { className: "w-fit max-w-full min-w-0 rounded-og-lg rounded-br-og-xs border border-og-border bg-og-surface-2 px-4 py-2.5 text-og-md leading-6 text-og-fg", children: [
|
|
8187
|
+
item.text ? /* @__PURE__ */ jsx18("div", { "data-og-annotation-source-key": item.annotationSource?.eventId, children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx18(UserMessageBody, { messageId: item.id, text: item.text, children: /* @__PURE__ */ jsx18(Markdown, { children: item.text }) }) }) : null,
|
|
8188
|
+
(item.annotations?.length ?? 0) > 0 ? /* @__PURE__ */ jsx18(
|
|
8189
|
+
TimelineAnnotationsChip,
|
|
8190
|
+
{
|
|
8191
|
+
annotations: item.annotations ?? [],
|
|
8192
|
+
className: item.text ? "mt-2" : void 0
|
|
8193
|
+
}
|
|
8194
|
+
) : null
|
|
8195
|
+
] })
|
|
8196
|
+
}
|
|
8197
|
+
),
|
|
8198
|
+
deliveryLabel ? /* @__PURE__ */ jsxs14("div", { className: "flex max-w-full items-center gap-2 px-1 text-og-xs text-og-fg-subtle", children: [
|
|
8199
|
+
/* @__PURE__ */ jsx18("span", { title: item.delivery?.error, children: deliveryLabel }),
|
|
8200
|
+
item.delivery?.state === "failed" && item.delivery.onRetry ? /* @__PURE__ */ jsx18(
|
|
8201
|
+
"button",
|
|
8202
|
+
{
|
|
8203
|
+
type: "button",
|
|
8204
|
+
className: "font-medium text-og-fg underline decoration-og-border underline-offset-2 hover:text-og-fg-strong",
|
|
8205
|
+
onClick: item.delivery.onRetry,
|
|
8206
|
+
children: "Retry"
|
|
8207
|
+
}
|
|
8208
|
+
) : null,
|
|
8209
|
+
item.delivery?.state === "failed" && item.delivery.onRemove ? /* @__PURE__ */ jsx18(
|
|
8210
|
+
"button",
|
|
8211
|
+
{
|
|
8212
|
+
type: "button",
|
|
8213
|
+
className: "font-medium text-og-fg-subtle underline decoration-og-border underline-offset-2 hover:text-og-fg",
|
|
8214
|
+
onClick: item.delivery.onRemove,
|
|
8215
|
+
children: "Remove"
|
|
8216
|
+
}
|
|
8217
|
+
) : null
|
|
8218
|
+
] }) : null
|
|
8219
|
+
] }) });
|
|
7659
8220
|
}
|
|
7660
8221
|
function AgentMessageRow({
|
|
7661
8222
|
item,
|
|
7662
8223
|
renderMessageText
|
|
7663
8224
|
}) {
|
|
7664
8225
|
const enter = useEntranceAnimation();
|
|
7665
|
-
const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */
|
|
7666
|
-
return /* @__PURE__ */
|
|
8226
|
+
const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx18(Markdown, { streaming: item.streaming, children: item.text });
|
|
8227
|
+
return /* @__PURE__ */ jsx18("div", { "data-og-annotation-source-key": item.annotationSource?.eventId, children: /* @__PURE__ */ jsx18(
|
|
7667
8228
|
CopyHoverFrame,
|
|
7668
8229
|
{
|
|
7669
8230
|
copyText: item.text,
|
|
7670
8231
|
label: "Copy message",
|
|
7671
8232
|
align: "start",
|
|
7672
8233
|
className: cn(enter && "animate-og-enter", "min-w-0 text-og-md leading-7 text-og-fg"),
|
|
7673
|
-
trailing: item.streaming ? null : /* @__PURE__ */
|
|
8234
|
+
trailing: item.streaming ? null : /* @__PURE__ */ jsx18(MessageFooterTime, { occurredAt: item.occurredAt }),
|
|
7674
8235
|
children: body
|
|
7675
8236
|
}
|
|
7676
|
-
);
|
|
8237
|
+
) });
|
|
7677
8238
|
}
|
|
7678
8239
|
function workerCompletionMeta(item) {
|
|
7679
8240
|
if (item.childStatus === "failed") {
|
|
@@ -7712,7 +8273,7 @@ function WorkerCompletionRow({
|
|
|
7712
8273
|
onOpenSession
|
|
7713
8274
|
}) {
|
|
7714
8275
|
const enter = useEntranceAnimation();
|
|
7715
|
-
const [open, setOpen] =
|
|
8276
|
+
const [open, setOpen] = useState14(false);
|
|
7716
8277
|
const meta = workerCompletionMeta(item);
|
|
7717
8278
|
const Icon = meta.icon;
|
|
7718
8279
|
const showPausedReason = item.childStatus !== "failed" && item.goalStatus === "paused" && Boolean(item.pausedReason?.trim());
|
|
@@ -7722,11 +8283,11 @@ function WorkerCompletionRow({
|
|
|
7722
8283
|
...showPausedReason ? [{ label: "Paused because", value: item.pausedReason.trim(), muted: true }] : []
|
|
7723
8284
|
];
|
|
7724
8285
|
const hasDetails = details.length > 0;
|
|
7725
|
-
return /* @__PURE__ */
|
|
8286
|
+
return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "min-w-0"), children: /* @__PURE__ */ jsxs14("div", { className: cn("flex flex-col gap-2 border-l-2 pl-3", meta.accentClass), children: [
|
|
7726
8287
|
/* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-2.5", children: [
|
|
7727
|
-
/* @__PURE__ */
|
|
7728
|
-
/* @__PURE__ */
|
|
7729
|
-
/* @__PURE__ */
|
|
8288
|
+
/* @__PURE__ */ jsx18("span", { className: cn("mt-0.5 shrink-0", meta.iconClass), children: /* @__PURE__ */ jsx18(Icon, { className: "size-4" }) }),
|
|
8289
|
+
/* @__PURE__ */ jsx18("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs14("p", { className: "text-og-base leading-5 text-og-fg", children: [
|
|
8290
|
+
/* @__PURE__ */ jsx18("span", { className: "font-medium", children: meta.label }),
|
|
7730
8291
|
item.goalText ? /* @__PURE__ */ jsxs14("span", { className: "text-og-fg-muted", children: [
|
|
7731
8292
|
" \xB7 ",
|
|
7732
8293
|
truncate(item.goalText, 90)
|
|
@@ -7739,34 +8300,34 @@ function WorkerCompletionRow({
|
|
|
7739
8300
|
onClick: () => onOpenSession(item.childSessionId),
|
|
7740
8301
|
className: cn(
|
|
7741
8302
|
"-my-0.5 -mr-1 inline-flex shrink-0 items-center gap-1 rounded-og-sm px-2 py-1 text-og-sm font-medium text-og-fg-muted pointer-coarse:py-2",
|
|
7742
|
-
"outline-
|
|
8303
|
+
"outline-hidden transition-colors duration-150 hover:bg-og-surface-2 hover:text-og-fg",
|
|
7743
8304
|
"focus-visible:ring-2 focus-visible:ring-og-accent"
|
|
7744
8305
|
),
|
|
7745
8306
|
children: [
|
|
7746
8307
|
"View session",
|
|
7747
|
-
/* @__PURE__ */
|
|
8308
|
+
/* @__PURE__ */ jsx18(ArrowRightIcon2, { className: "size-3.5" })
|
|
7748
8309
|
]
|
|
7749
8310
|
}
|
|
7750
8311
|
) : null
|
|
7751
8312
|
] }),
|
|
7752
8313
|
hasDetails ? /* @__PURE__ */ jsxs14(Collapsible2.Root, { open, onOpenChange: setOpen, children: [
|
|
7753
|
-
/* @__PURE__ */
|
|
8314
|
+
/* @__PURE__ */ jsx18(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs14(
|
|
7754
8315
|
"button",
|
|
7755
8316
|
{
|
|
7756
8317
|
type: "button",
|
|
7757
8318
|
className: cn(
|
|
7758
8319
|
"group/wc -mx-1 inline-flex w-fit items-center gap-1 rounded-og-sm px-1 py-0.5 text-og-xs font-medium text-og-fg-subtle",
|
|
7759
|
-
"outline-
|
|
8320
|
+
"outline-hidden transition-colors duration-150 hover:text-og-fg-muted focus-visible:ring-2 focus-visible:ring-og-accent"
|
|
7760
8321
|
),
|
|
7761
8322
|
children: [
|
|
7762
|
-
/* @__PURE__ */
|
|
8323
|
+
/* @__PURE__ */ jsx18(ChevronRightIcon3, { className: "size-3 transition-transform duration-150 ease-og-in-out group-data-[state=open]/wc:rotate-90" }),
|
|
7763
8324
|
open ? "Hide details" : "Show details"
|
|
7764
8325
|
]
|
|
7765
8326
|
}
|
|
7766
8327
|
) }),
|
|
7767
|
-
/* @__PURE__ */
|
|
7768
|
-
/* @__PURE__ */
|
|
7769
|
-
/* @__PURE__ */
|
|
8328
|
+
/* @__PURE__ */ jsx18(Collapsible2.Content, { className: "overflow-hidden data-[state=closed]:animate-og-collapse data-[state=open]:animate-og-expand", children: /* @__PURE__ */ jsx18("div", { className: "ml-1 mt-1.5 flex flex-col gap-2.5", children: details.map((detail) => /* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
|
|
8329
|
+
/* @__PURE__ */ jsx18("p", { className: "mb-1 text-og-xs font-medium uppercase tracking-[0.08em] text-og-fg-subtle", children: detail.label }),
|
|
8330
|
+
/* @__PURE__ */ jsx18(
|
|
7770
8331
|
"p",
|
|
7771
8332
|
{
|
|
7772
8333
|
className: cn(
|
|
@@ -7792,14 +8353,14 @@ function SessionStatusRow({ item }) {
|
|
|
7792
8353
|
),
|
|
7793
8354
|
role: "status",
|
|
7794
8355
|
children: [
|
|
7795
|
-
/* @__PURE__ */
|
|
8356
|
+
/* @__PURE__ */ jsx18("span", { className: "h-px flex-1 bg-og-border" }),
|
|
7796
8357
|
/* @__PURE__ */ jsxs14("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
7797
|
-
/* @__PURE__ */
|
|
8358
|
+
/* @__PURE__ */ jsx18(StatusDot, { status: item.status, className: "size-1" }),
|
|
7798
8359
|
meta.label.toLowerCase(),
|
|
7799
8360
|
" \xB7 ",
|
|
7800
8361
|
formatRelativeTime(item.occurredAt)
|
|
7801
8362
|
] }),
|
|
7802
|
-
/* @__PURE__ */
|
|
8363
|
+
/* @__PURE__ */ jsx18("span", { className: "h-px flex-1 bg-og-border" })
|
|
7803
8364
|
]
|
|
7804
8365
|
}
|
|
7805
8366
|
);
|
|
@@ -7829,7 +8390,7 @@ var GOAL_META = {
|
|
|
7829
8390
|
function GoalRow({ item }) {
|
|
7830
8391
|
const enter = useEntranceAnimation();
|
|
7831
8392
|
const { label, pill, icon: Icon } = GOAL_META[item.action];
|
|
7832
|
-
return /* @__PURE__ */
|
|
8393
|
+
return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs14(
|
|
7833
8394
|
"span",
|
|
7834
8395
|
{
|
|
7835
8396
|
className: cn(
|
|
@@ -7837,7 +8398,7 @@ function GoalRow({ item }) {
|
|
|
7837
8398
|
pill
|
|
7838
8399
|
),
|
|
7839
8400
|
children: [
|
|
7840
|
-
/* @__PURE__ */
|
|
8401
|
+
/* @__PURE__ */ jsx18(Icon, { className: "size-3.5 shrink-0" }),
|
|
7841
8402
|
/* @__PURE__ */ jsxs14("span", { className: "truncate", children: [
|
|
7842
8403
|
label,
|
|
7843
8404
|
item.text ? `: ${truncate(item.text, 90)}` : ""
|
|
@@ -7846,15 +8407,27 @@ function GoalRow({ item }) {
|
|
|
7846
8407
|
}
|
|
7847
8408
|
) });
|
|
7848
8409
|
}
|
|
7849
|
-
function MachineInputBatchRow({
|
|
8410
|
+
function MachineInputBatchRow({
|
|
8411
|
+
item,
|
|
8412
|
+
loadVideoArtifactPlayback
|
|
8413
|
+
}) {
|
|
7850
8414
|
const enter = useEntranceAnimation();
|
|
7851
8415
|
const label = machineInputBatchLabel(item.members);
|
|
7852
8416
|
const single = item.members.length === 1 ? item.members[0] : null;
|
|
8417
|
+
if (single?.kind === "media_generation_result" && single.result) {
|
|
8418
|
+
return /* @__PURE__ */ jsx18(
|
|
8419
|
+
VideoGenerationResultRow,
|
|
8420
|
+
{
|
|
8421
|
+
result: single.result,
|
|
8422
|
+
loadVideoArtifactPlayback
|
|
8423
|
+
}
|
|
8424
|
+
);
|
|
8425
|
+
}
|
|
7853
8426
|
const singleSummary = single ? cleanMachineInputSummary(single.summary) : "";
|
|
7854
8427
|
const showCollapsedSummary = single != null && machineInputSummaryIsUseful(single.kind, singleSummary);
|
|
7855
8428
|
return /* @__PURE__ */ jsxs14("div", { className: cn(enter && "animate-og-enter", "flex flex-col items-center gap-1.5"), children: [
|
|
7856
8429
|
/* @__PURE__ */ jsxs14("details", { className: "group w-full max-w-full", "data-og-machine-input-batch": "", children: [
|
|
7857
|
-
/* @__PURE__ */
|
|
8430
|
+
/* @__PURE__ */ jsx18("summary", { className: "flex cursor-pointer list-none justify-center [&::-webkit-details-marker]:hidden", children: /* @__PURE__ */ jsxs14(
|
|
7858
8431
|
"span",
|
|
7859
8432
|
{
|
|
7860
8433
|
className: cn(
|
|
@@ -7862,37 +8435,122 @@ function MachineInputBatchRow({ item }) {
|
|
|
7862
8435
|
NEUTRAL_PILL
|
|
7863
8436
|
),
|
|
7864
8437
|
children: [
|
|
7865
|
-
/* @__PURE__ */
|
|
8438
|
+
/* @__PURE__ */ jsx18(
|
|
7866
8439
|
ChevronRightIcon3,
|
|
7867
8440
|
{
|
|
7868
8441
|
"aria-hidden": true,
|
|
7869
8442
|
className: "size-3.5 shrink-0 transition-transform group-open:rotate-90"
|
|
7870
8443
|
}
|
|
7871
8444
|
),
|
|
7872
|
-
/* @__PURE__ */
|
|
8445
|
+
/* @__PURE__ */ jsx18("span", { className: "truncate", children: label })
|
|
7873
8446
|
]
|
|
7874
8447
|
}
|
|
7875
8448
|
) }),
|
|
7876
|
-
/* @__PURE__ */
|
|
8449
|
+
/* @__PURE__ */ jsx18("div", { className: "mx-auto mt-2 w-full max-w-lg space-y-2 border-t border-og-border/50 pt-2", children: item.members.map((member) => /* @__PURE__ */ jsx18(
|
|
8450
|
+
MachineInputRow,
|
|
8451
|
+
{
|
|
8452
|
+
member,
|
|
8453
|
+
loadVideoArtifactPlayback
|
|
8454
|
+
},
|
|
8455
|
+
member.id
|
|
8456
|
+
)) })
|
|
7877
8457
|
] }),
|
|
7878
|
-
showCollapsedSummary ? /* @__PURE__ */
|
|
8458
|
+
showCollapsedSummary ? /* @__PURE__ */ jsx18("p", { className: "max-w-lg px-3 text-center text-og-xs leading-4 text-og-fg-subtle", children: truncate(singleSummary, 160) }) : null
|
|
7879
8459
|
] });
|
|
7880
8460
|
}
|
|
7881
|
-
function MachineInputRow({
|
|
8461
|
+
function MachineInputRow({
|
|
8462
|
+
member,
|
|
8463
|
+
loadVideoArtifactPlayback
|
|
8464
|
+
}) {
|
|
8465
|
+
if (member.kind === "media_generation_result" && member.result) {
|
|
8466
|
+
return /* @__PURE__ */ jsx18(
|
|
8467
|
+
VideoGenerationResultRow,
|
|
8468
|
+
{
|
|
8469
|
+
result: member.result,
|
|
8470
|
+
loadVideoArtifactPlayback,
|
|
8471
|
+
compact: true
|
|
8472
|
+
}
|
|
8473
|
+
);
|
|
8474
|
+
}
|
|
7882
8475
|
const source = readableMachineInputSource(member.sourceId);
|
|
7883
8476
|
const summary = cleanMachineInputSummary(member.summary);
|
|
7884
8477
|
return /* @__PURE__ */ jsxs14("div", { className: "flex min-w-0 items-start gap-2.5", children: [
|
|
7885
|
-
/* @__PURE__ */
|
|
8478
|
+
/* @__PURE__ */ jsx18("span", { className: "mt-2 size-1.5 shrink-0 rounded-full bg-og-fg-subtle", "aria-hidden": true }),
|
|
7886
8479
|
/* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
|
|
7887
|
-
/* @__PURE__ */
|
|
8480
|
+
/* @__PURE__ */ jsx18("span", { className: "text-og-control font-medium text-og-fg-muted", children: MACHINE_INPUT_META[member.kind] }),
|
|
7888
8481
|
source && /* @__PURE__ */ jsxs14("span", { className: "ml-1.5 text-og-control text-og-fg-subtle", children: [
|
|
7889
8482
|
"from ",
|
|
7890
8483
|
source
|
|
7891
8484
|
] }),
|
|
7892
|
-
summary ? /* @__PURE__ */
|
|
8485
|
+
summary ? /* @__PURE__ */ jsx18("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-og-menu leading-5 text-og-fg", children: truncate(summary, 320) }) : null
|
|
7893
8486
|
] })
|
|
7894
8487
|
] });
|
|
7895
8488
|
}
|
|
8489
|
+
function VideoGenerationResultRow({
|
|
8490
|
+
result,
|
|
8491
|
+
loadVideoArtifactPlayback,
|
|
8492
|
+
compact = false
|
|
8493
|
+
}) {
|
|
8494
|
+
const enter = useEntranceAnimation();
|
|
8495
|
+
if (result.status !== "ready") {
|
|
8496
|
+
return /* @__PURE__ */ jsxs14(
|
|
8497
|
+
"div",
|
|
8498
|
+
{
|
|
8499
|
+
className: cn(
|
|
8500
|
+
enter && "animate-og-enter",
|
|
8501
|
+
"mx-auto w-full max-w-lg rounded-og-md border border-og-status-failed/30 bg-og-status-failed/5 px-3.5 py-3"
|
|
8502
|
+
),
|
|
8503
|
+
children: [
|
|
8504
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 text-og-sm font-medium text-og-status-failed", children: [
|
|
8505
|
+
/* @__PURE__ */ jsx18(XCircleIcon, { "aria-hidden": true, className: "size-4" }),
|
|
8506
|
+
"Video generation failed"
|
|
8507
|
+
] }),
|
|
8508
|
+
/* @__PURE__ */ jsx18("p", { className: "mt-1 text-og-sm leading-5 text-og-fg-muted", children: result.boundedPublicReason })
|
|
8509
|
+
]
|
|
8510
|
+
}
|
|
8511
|
+
);
|
|
8512
|
+
}
|
|
8513
|
+
const { receipt } = result;
|
|
8514
|
+
const facts = receipt.video;
|
|
8515
|
+
return /* @__PURE__ */ jsxs14(
|
|
8516
|
+
"section",
|
|
8517
|
+
{
|
|
8518
|
+
"aria-label": "Generated video",
|
|
8519
|
+
className: cn(
|
|
8520
|
+
enter && "animate-og-enter",
|
|
8521
|
+
"mx-auto w-full max-w-2xl overflow-hidden rounded-og-lg border border-og-border bg-og-surface-1 shadow-sm",
|
|
8522
|
+
compact && "max-w-lg"
|
|
8523
|
+
),
|
|
8524
|
+
children: [
|
|
8525
|
+
loadVideoArtifactPlayback ? /* @__PURE__ */ jsx18(
|
|
8526
|
+
GeneratedVideoPlayer,
|
|
8527
|
+
{
|
|
8528
|
+
receipt,
|
|
8529
|
+
loadPlaybackSource: loadVideoArtifactPlayback,
|
|
8530
|
+
className: "rounded-none border-0 shadow-none"
|
|
8531
|
+
}
|
|
8532
|
+
) : /* @__PURE__ */ jsx18("div", { className: "flex aspect-video items-center justify-center bg-og-surface-2 text-og-fg-subtle", children: /* @__PURE__ */ jsx18(PlayIcon2, { "aria-hidden": true, className: "size-6" }) }),
|
|
8533
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between gap-4 px-3.5 py-2.5", children: [
|
|
8534
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
|
|
8535
|
+
/* @__PURE__ */ jsx18("p", { className: "text-og-sm font-medium text-og-fg", children: "Generated video" }),
|
|
8536
|
+
/* @__PURE__ */ jsxs14("p", { className: "truncate text-og-xs text-og-fg-subtle", children: [
|
|
8537
|
+
facts.width,
|
|
8538
|
+
"\xD7",
|
|
8539
|
+
facts.height,
|
|
8540
|
+
" \xB7 ",
|
|
8541
|
+
formatVideoDuration(facts.durationSeconds),
|
|
8542
|
+
facts.hasAudio ? " \xB7 Audio" : ""
|
|
8543
|
+
] })
|
|
8544
|
+
] }),
|
|
8545
|
+
/* @__PURE__ */ jsx18(CheckCircle2Icon, { "aria-label": "Ready", className: "size-4 shrink-0 text-og-status-success" })
|
|
8546
|
+
] })
|
|
8547
|
+
]
|
|
8548
|
+
}
|
|
8549
|
+
);
|
|
8550
|
+
}
|
|
8551
|
+
function formatVideoDuration(seconds) {
|
|
8552
|
+
return `${Math.round(seconds * 10) / 10}s`;
|
|
8553
|
+
}
|
|
7896
8554
|
function NoticeRow({ item }) {
|
|
7897
8555
|
const enter = useEntranceAnimation();
|
|
7898
8556
|
const tone = item.tone === "failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.tone === "waiting" ? "border-og-status-waiting/35 bg-og-status-waiting/10 text-og-status-waiting" : "border-og-border bg-og-surface-1 text-og-fg-muted";
|
|
@@ -7906,20 +8564,20 @@ function NoticeRow({ item }) {
|
|
|
7906
8564
|
),
|
|
7907
8565
|
role: "status",
|
|
7908
8566
|
children: [
|
|
7909
|
-
/* @__PURE__ */
|
|
8567
|
+
/* @__PURE__ */ jsx18(
|
|
7910
8568
|
TriangleAlertIcon3,
|
|
7911
8569
|
{
|
|
7912
8570
|
className: cn("mt-0.5 size-4 shrink-0", item.tone === "cancelled" && "opacity-60")
|
|
7913
8571
|
}
|
|
7914
8572
|
),
|
|
7915
8573
|
/* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
|
|
7916
|
-
/* @__PURE__ */
|
|
8574
|
+
/* @__PURE__ */ jsx18("span", { className: "whitespace-pre-wrap break-words", children: item.text }),
|
|
7917
8575
|
item.details ? /* @__PURE__ */ jsxs14("details", { className: "mt-2 text-og-control", children: [
|
|
7918
|
-
/* @__PURE__ */
|
|
7919
|
-
/* @__PURE__ */
|
|
8576
|
+
/* @__PURE__ */ jsx18("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
|
|
8577
|
+
/* @__PURE__ */ jsx18("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-og-sm bg-black/5 p-2 font-mono dark:bg-white/5", children: JSON.stringify(item.details.value, null, 2) })
|
|
7920
8578
|
] }) : null
|
|
7921
8579
|
] }),
|
|
7922
|
-
item.action ? /* @__PURE__ */
|
|
8580
|
+
item.action ? /* @__PURE__ */ jsx18(
|
|
7923
8581
|
"a",
|
|
7924
8582
|
{
|
|
7925
8583
|
className: "shrink-0 rounded-og-sm border border-current/25 px-2 py-1 text-og-control font-medium hover:bg-current/10",
|
|
@@ -7939,12 +8597,15 @@ function AuthNeededRow({
|
|
|
7939
8597
|
resolveProviderLogo
|
|
7940
8598
|
}) {
|
|
7941
8599
|
const enter = useEntranceAnimation();
|
|
7942
|
-
const [busy, setBusy] =
|
|
7943
|
-
const [failed, setFailed] =
|
|
7944
|
-
const
|
|
8600
|
+
const [busy, setBusy] = useState14(false);
|
|
8601
|
+
const [failed, setFailed] = useState14(false);
|
|
8602
|
+
const recommendation = item.capability ?? null;
|
|
8603
|
+
const provider = recommendation?.name ?? (item.serverId === "codex_apps" ? "Codex Apps" : providerLabel(item.providerDomain));
|
|
7945
8604
|
const unavailable = item.reason === "personal_authority_unavailable" || item.reason === "unsupported_auth" || item.reason === "resource_scope_unavailable";
|
|
7946
8605
|
const missing = item.reason === "missing_connection";
|
|
7947
|
-
const actionLabel = missing ? "Connect" : "Reconnect";
|
|
8606
|
+
const actionLabel = recommendation ? recommendation.action === "connect" ? "Connect" : "Review" : missing ? "Connect" : "Reconnect";
|
|
8607
|
+
const title = recommendation ? recommendation.action === "connect" ? `Connect ${provider}` : recommendation.action === "add_credentials" ? `Set up ${provider}` : `Enable ${provider}` : unavailable ? `${provider} tools unavailable` : `${actionLabel} ${provider}`;
|
|
8608
|
+
const reasonLine = recommendation?.rationale ?? authReasonLine(item.reason);
|
|
7948
8609
|
const start = async () => {
|
|
7949
8610
|
if (!onReconnect || busy) {
|
|
7950
8611
|
return;
|
|
@@ -7962,7 +8623,7 @@ function AuthNeededRow({
|
|
|
7962
8623
|
return /* @__PURE__ */ jsxs14("div", { className: cn(enter && "animate-og-enter", "flex flex-col gap-2"), role: "status", children: [
|
|
7963
8624
|
/* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-3 rounded-og-lg border border-og-border bg-og-surface-1 px-3.5 py-3 sm:flex-row sm:items-center", children: [
|
|
7964
8625
|
/* @__PURE__ */ jsxs14("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
7965
|
-
/* @__PURE__ */
|
|
8626
|
+
/* @__PURE__ */ jsx18(
|
|
7966
8627
|
AuthProviderLogo,
|
|
7967
8628
|
{
|
|
7968
8629
|
src: resolveProviderLogo?.(item.providerDomain) ?? null,
|
|
@@ -7970,8 +8631,16 @@ function AuthNeededRow({
|
|
|
7970
8631
|
}
|
|
7971
8632
|
),
|
|
7972
8633
|
/* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
|
|
7973
|
-
/* @__PURE__ */
|
|
7974
|
-
/* @__PURE__ */
|
|
8634
|
+
/* @__PURE__ */ jsx18("p", { className: "truncate text-og-md font-medium text-og-fg", children: title }),
|
|
8635
|
+
/* @__PURE__ */ jsx18("p", { className: "line-clamp-2 text-og-sm text-og-fg-subtle", children: reasonLine }),
|
|
8636
|
+
recommendation ? /* @__PURE__ */ jsxs14("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
|
|
8637
|
+
"Provider: ",
|
|
8638
|
+
item.providerDomain
|
|
8639
|
+
] }) : null,
|
|
8640
|
+
recommendation && recommendation.requiredVariables.length > 0 ? /* @__PURE__ */ jsxs14("p", { className: "mt-1 truncate text-og-xs text-og-fg-muted", children: [
|
|
8641
|
+
"Needs variables: ",
|
|
8642
|
+
recommendation.requiredVariables.join(", ")
|
|
8643
|
+
] }) : null
|
|
7975
8644
|
] })
|
|
7976
8645
|
] }),
|
|
7977
8646
|
!unavailable && onReconnect ? /* @__PURE__ */ jsxs14(
|
|
@@ -7985,7 +8654,7 @@ function AuthNeededRow({
|
|
|
7985
8654
|
"transition-colors hover:bg-og-accent-strong disabled:opacity-70 pointer-coarse:min-h-9"
|
|
7986
8655
|
),
|
|
7987
8656
|
children: [
|
|
7988
|
-
/* @__PURE__ */
|
|
8657
|
+
/* @__PURE__ */ jsx18(RefreshCwIcon, { className: cn("size-3.5", busy && "animate-og-spin"), "aria-hidden": true }),
|
|
7989
8658
|
busy ? "Opening\u2026" : actionLabel
|
|
7990
8659
|
]
|
|
7991
8660
|
}
|
|
@@ -8000,17 +8669,13 @@ function AuthNeededRow({
|
|
|
8000
8669
|
"transition-colors hover:bg-og-accent-strong pointer-coarse:min-h-9"
|
|
8001
8670
|
),
|
|
8002
8671
|
children: [
|
|
8003
|
-
/* @__PURE__ */
|
|
8672
|
+
/* @__PURE__ */ jsx18(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
8004
8673
|
actionLabel
|
|
8005
8674
|
]
|
|
8006
8675
|
}
|
|
8007
8676
|
) : null
|
|
8008
8677
|
] }),
|
|
8009
|
-
!unavailable ? /* @__PURE__ */
|
|
8010
|
-
"This tool call wasn't replayed. After ",
|
|
8011
|
-
missing ? "connecting" : "reconnecting",
|
|
8012
|
-
", send a new message to try again."
|
|
8013
|
-
] }) : null,
|
|
8678
|
+
!unavailable ? /* @__PURE__ */ jsx18("p", { className: "px-1 text-og-xs text-og-fg-subtle", children: recommendation ? "No access has been granted. Review and confirm the provider before continuing." : `This tool call wasn't replayed. After ${missing ? "connecting" : "reconnecting"}, send a new message to try again.` }) : null,
|
|
8014
8679
|
failed ? /* @__PURE__ */ jsxs14("p", { className: "px-1 text-og-xs text-og-status-failed", children: [
|
|
8015
8680
|
"Couldn't start ",
|
|
8016
8681
|
missing ? "connecting" : "reconnecting",
|
|
@@ -8021,15 +8686,15 @@ function AuthNeededRow({
|
|
|
8021
8686
|
] });
|
|
8022
8687
|
}
|
|
8023
8688
|
function AuthProviderLogo({ src, label }) {
|
|
8024
|
-
const [failed, setFailed] =
|
|
8025
|
-
|
|
8689
|
+
const [failed, setFailed] = useState14(false);
|
|
8690
|
+
useEffect11(() => setFailed(false), [src]);
|
|
8026
8691
|
const showImage = src && !failed;
|
|
8027
|
-
return /* @__PURE__ */
|
|
8692
|
+
return /* @__PURE__ */ jsx18(
|
|
8028
8693
|
"span",
|
|
8029
8694
|
{
|
|
8030
8695
|
className: "relative flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-og-md border border-og-border bg-og-surface-2 text-og-menu font-semibold text-og-fg-muted",
|
|
8031
8696
|
"aria-hidden": true,
|
|
8032
|
-
children: showImage ? /* @__PURE__ */
|
|
8697
|
+
children: showImage ? /* @__PURE__ */ jsx18(
|
|
8033
8698
|
"img",
|
|
8034
8699
|
{
|
|
8035
8700
|
src,
|
|
@@ -8039,7 +8704,7 @@ function AuthProviderLogo({ src, label }) {
|
|
|
8039
8704
|
className: "size-full object-contain p-1.5",
|
|
8040
8705
|
onError: () => setFailed(true)
|
|
8041
8706
|
}
|
|
8042
|
-
) : /* @__PURE__ */
|
|
8707
|
+
) : /* @__PURE__ */ jsx18("span", { children: monogram(label) })
|
|
8043
8708
|
}
|
|
8044
8709
|
);
|
|
8045
8710
|
}
|
|
@@ -8103,7 +8768,6 @@ export {
|
|
|
8103
8768
|
applyPatchOps,
|
|
8104
8769
|
applyPatchOpsFromToolItem,
|
|
8105
8770
|
isApplyPatch,
|
|
8106
|
-
redactSecrets,
|
|
8107
8771
|
parseToolArgs,
|
|
8108
8772
|
tailPeek,
|
|
8109
8773
|
unwrapMcpOutput,
|
|
@@ -8124,8 +8788,6 @@ export {
|
|
|
8124
8788
|
PierreDiff,
|
|
8125
8789
|
defaultToolRegistry,
|
|
8126
8790
|
createDefaultToolRegistry,
|
|
8127
|
-
copyTextToClipboard,
|
|
8128
|
-
tableElementToTsv,
|
|
8129
8791
|
CopyButton,
|
|
8130
8792
|
CopyHoverFrame,
|
|
8131
8793
|
Markdown,
|
|
@@ -8134,10 +8796,11 @@ export {
|
|
|
8134
8796
|
TurnSummary,
|
|
8135
8797
|
userMessageLikelyNeedsDisclosure,
|
|
8136
8798
|
UserMessageBody,
|
|
8799
|
+
GeneratedVideoPlayer,
|
|
8137
8800
|
SESSION_STATUS_META,
|
|
8138
8801
|
SessionStatus,
|
|
8139
8802
|
StatusDot,
|
|
8140
8803
|
MessageTimeline,
|
|
8141
8804
|
TimelineRow
|
|
8142
8805
|
};
|
|
8143
|
-
//# sourceMappingURL=chunk-
|
|
8806
|
+
//# sourceMappingURL=chunk-JAGDUCZQ.js.map
|