@opengeni/react 0.48.0 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -2
- 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 +199 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/{chunk-NJ7M2B6Z.js → chunk-5UQPNLIO.js} +16 -8
- package/dist/{chunk-NJ7M2B6Z.js.map → chunk-5UQPNLIO.js.map} +1 -1
- package/dist/{chunk-LHLYWG5R.js → chunk-6KLX2RH5.js} +461 -38
- package/dist/chunk-6KLX2RH5.js.map +1 -0
- package/dist/chunk-7WCLAEFV.js +2828 -0
- package/dist/chunk-7WCLAEFV.js.map +1 -0
- package/dist/{chunk-I4MPFDRP.js → chunk-B6WPZSTT.js} +104 -104
- package/dist/{chunk-I4MPFDRP.js.map → chunk-B6WPZSTT.js.map} +1 -1
- package/dist/{chunk-EKZH6IDG.js → chunk-C5ZPSSS5.js} +111 -1
- package/dist/chunk-C5ZPSSS5.js.map +1 -0
- package/dist/{chunk-OL6QVXGF.js → chunk-HA46CYQK.js} +152 -8
- package/dist/chunk-HA46CYQK.js.map +1 -0
- package/dist/chunk-HUIKIDM5.js +2148 -0
- package/dist/chunk-HUIKIDM5.js.map +1 -0
- package/dist/{chunk-FWXGSNXT.js → chunk-IGC6A2ZI.js} +585 -34
- package/dist/chunk-IGC6A2ZI.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-LLOLUHVG.js +5937 -0
- package/dist/chunk-LLOLUHVG.js.map +1 -0
- package/dist/{chunk-WYA65Y3F.js → chunk-MKPIAGVL.js} +13 -3
- package/dist/chunk-MKPIAGVL.js.map +1 -0
- package/dist/chunk-PEI6RANI.js +3234 -0
- package/dist/chunk-PEI6RANI.js.map +1 -0
- package/dist/chunk-R3AZOAB5.js +933 -0
- package/dist/chunk-R3AZOAB5.js.map +1 -0
- package/dist/{chunk-O4VXOBGF.js → chunk-WSK7G5LE.js} +70 -2
- package/dist/chunk-WSK7G5LE.js.map +1 -0
- package/dist/{chunk-23EJ676W.js → chunk-XBZWOM2K.js} +9 -4
- package/dist/chunk-XBZWOM2K.js.map +1 -0
- package/dist/{chunk-XCNTXWBB.js → chunk-Y7OEDUJ5.js} +856 -338
- package/dist/chunk-Y7OEDUJ5.js.map +1 -0
- package/dist/client.d.ts +10 -2
- 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 +9 -0
- package/dist/components/artifacts/presentation-editor.d.ts +297 -0
- package/dist/components/artifacts/published-html-artifact-frame.d.ts +14 -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-input.d.ts +7 -0
- package/dist/components/browser-viewer.d.ts +30 -0
- package/dist/components/chat-composer.d.ts +8 -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 +2 -2
- package/dist/components/composer.d.ts +17 -17
- package/dist/components/computer-viewer.d.ts +24 -0
- package/dist/components/copy-button.d.ts +2 -2
- package/dist/components/desktop-viewer.d.ts +50 -22
- 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/interaction-intervention-banner.d.ts +11 -0
- 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 +3 -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 +2 -2
- package/dist/components/markdown.d.ts +1 -1
- package/dist/components/message-timeline.d.ts +12 -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 +3 -3
- package/dist/components/sandbox-terminal.d.ts +24 -4
- package/dist/components/sandbox-workspace.d.ts +28 -9
- 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 +1 -1
- package/dist/composer.d.ts +11 -11
- package/dist/composer.js +7 -7
- package/dist/hooks/internal.d.ts +1 -1
- package/dist/hooks/use-attached-browsers.d.ts +21 -0
- package/dist/hooks/use-auth-runs.d.ts +32 -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-downloads.d.ts +25 -0
- package/dist/hooks/use-browser-frame-stream.d.ts +28 -0
- package/dist/hooks/use-browser-identities.d.ts +30 -0
- package/dist/hooks/use-browser-session.d.ts +29 -0
- package/dist/hooks/use-browser-sessions.d.ts +32 -0
- package/dist/hooks/use-channels.d.ts +26 -0
- package/dist/hooks/use-codex-accounts.d.ts +2 -2
- 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 +29 -0
- package/dist/hooks/use-computer-sessions.d.ts +28 -0
- package/dist/hooks/use-desktop-stream.d.ts +5 -1
- package/dist/hooks/use-environments.d.ts +1 -1
- 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-interaction-interventions.d.ts +27 -0
- package/dist/hooks/use-interaction-invalidation.d.ts +19 -0
- 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 +4 -4
- package/dist/hooks/use-network-routes.d.ts +25 -0
- 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 +6 -4
- package/dist/hooks/use-sandbox-git.d.ts +6 -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-site-auth-connections.d.ts +25 -0
- package/dist/hooks/use-slash-commands.d.ts +1 -1
- package/dist/hooks/use-supergrok-accounts.d.ts +26 -0
- package/dist/hooks/use-terminal-stream.d.ts +11 -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 +1 -1
- 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 +162 -155
- package/dist/index.js +1822 -1703
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +33 -0
- package/dist/interaction.js +550 -0
- package/dist/interaction.js.map +1 -0
- package/dist/interactive-workbench-viewers-TOHBXJEE.js +15 -0
- package/dist/interactive-workbench-viewers-TOHBXJEE.js.map +1 -0
- package/dist/lib/host-platform.d.ts +5 -0
- package/dist/lib/relay-wire.d.ts +24 -1
- package/dist/lib/sandbox-liveness.d.ts +9 -0
- package/dist/lib/terminal-capability.d.ts +5 -0
- package/dist/lib/xterm-theme.d.ts +1 -1
- package/dist/machines.d.ts +30 -30
- package/dist/machines.js +2 -2
- package/dist/model-policy.d.ts +1 -1
- package/dist/model-policy.js +1 -1
- package/dist/provider.d.ts +6 -5
- package/dist/{queue-surface-implementation-U5JFG7HT.js → queue-surface-implementation-2KVJTYXH.js} +100 -48
- 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 +8 -8
- package/dist/realtime.d.ts +4 -4
- package/dist/realtime.js +38 -11
- package/dist/realtime.js.map +1 -1
- package/dist/session-context.d.ts +28 -2
- package/dist/session-ui.d.ts +14 -14
- package/dist/session-ui.js +5 -4
- package/dist/session.d.ts +28 -28
- package/dist/session.js +10 -10
- package/dist/timeline/activity-rail.d.ts +5 -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 +4 -1
- package/dist/timeline/projection.d.ts +3 -3
- package/dist/timeline/registry.d.ts +8 -2
- 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 +44 -3
- 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/package.json +36 -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 +89 -0
- package/src/client.ts +157 -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 +104 -0
- package/src/components/artifacts/presentation-editor.tsx +3148 -0
- package/src/components/artifacts/published-html-artifact-frame.tsx +38 -0
- package/src/components/artifacts/spreadsheet-canvas.ts +799 -0
- package/src/components/artifacts/spreadsheet-grid.tsx +2129 -0
- package/src/components/browser-input.ts +65 -0
- package/src/components/browser-viewer.tsx +2702 -0
- package/src/components/chat-composer.tsx +13 -0
- package/src/components/code-editor.tsx +89 -30
- package/src/components/composer-transcription-control.tsx +10 -6
- package/src/components/computer-viewer.tsx +1636 -0
- package/src/components/desktop-viewer.tsx +215 -74
- package/src/components/generated-video-player.tsx +89 -0
- package/src/components/interaction-intervention-banner.tsx +99 -0
- package/src/components/interactive-workbench-viewers.ts +2 -0
- package/src/components/machine-input-display.ts +3 -0
- package/src/components/machines/machine-detail.tsx +1 -1
- package/src/components/message-timeline.tsx +289 -32
- package/src/components/model-policy-picker.tsx +15 -0
- package/src/components/queue-surface-implementation.tsx +116 -60
- package/src/components/sandbox-files.tsx +2 -2
- package/src/components/sandbox-terminal.tsx +128 -46
- package/src/components/sandbox-workspace.tsx +256 -90
- package/src/components/session-chrome.tsx +53 -13
- 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/workbench-changes.tsx +188 -31
- package/src/components/workspace-dock.tsx +59 -5
- package/src/hooks/use-attached-browsers.ts +154 -0
- package/src/hooks/use-auth-runs.ts +278 -0
- package/src/hooks/use-browser-downloads.ts +218 -0
- package/src/hooks/use-browser-frame-stream.ts +425 -0
- package/src/hooks/use-browser-identities.ts +266 -0
- package/src/hooks/use-browser-session.ts +543 -0
- package/src/hooks/use-browser-sessions.ts +286 -0
- package/src/hooks/use-channels.ts +99 -0
- package/src/hooks/use-composer.ts +769 -24
- package/src/hooks/use-computer-frame-stream.ts +434 -0
- package/src/hooks/use-computer-session.ts +462 -0
- package/src/hooks/use-computer-sessions.ts +251 -0
- package/src/hooks/use-desktop-stream.ts +39 -7
- package/src/hooks/use-interaction-interventions.ts +242 -0
- package/src/hooks/use-interaction-invalidation.ts +66 -0
- package/src/hooks/use-machine-chip.ts +15 -3
- package/src/hooks/use-machines.ts +33 -3
- package/src/hooks/use-network-routes.ts +214 -0
- package/src/hooks/use-packs.ts +51 -0
- package/src/hooks/use-sandbox-files.ts +98 -55
- package/src/hooks/use-sandbox-git.ts +93 -38
- package/src/hooks/use-sandbox-terminal.ts +3 -2
- package/src/hooks/use-session-capabilities.ts +59 -46
- package/src/hooks/use-site-auth-connections.ts +226 -0
- package/src/hooks/use-supergrok-accounts.ts +81 -0
- package/src/hooks/use-terminal-stream.ts +359 -47
- package/src/hooks/use-video-artifact-playback.ts +28 -0
- package/src/hooks/use-workspace-edit.ts +2 -1
- package/src/index.ts +18 -0
- package/src/interaction.ts +101 -0
- package/src/lib/host-platform.ts +10 -0
- package/src/lib/relay-wire.ts +47 -4
- package/src/lib/sandbox-liveness.ts +11 -0
- package/src/lib/terminal-capability.ts +10 -0
- package/src/model-policy.ts +19 -4
- package/src/provider.tsx +133 -1
- package/src/realtime/realtime-control.tsx +34 -6
- package/src/session-context.ts +156 -1
- package/src/timeline/activity-rail.tsx +25 -3
- package/src/timeline/index.ts +3 -0
- package/src/timeline/parsers.ts +14 -1
- package/src/timeline/projection.ts +269 -14
- package/src/timeline/registry.ts +13 -1
- package/src/timeline/screenshot-lightbox.tsx +19 -9
- package/src/timeline/shared.tsx +56 -8
- package/src/timeline/tool-renderers.tsx +303 -50
- package/src/timeline/types.ts +57 -3
- package/styles/compiled.css +312 -21
- package/styles/index.css +15 -0
- package/styles/responsive.css +13 -1
- package/dist/chunk-23EJ676W.js.map +0 -1
- package/dist/chunk-EKZH6IDG.js.map +0 -1
- package/dist/chunk-FWXGSNXT.js.map +0 -1
- package/dist/chunk-LHLYWG5R.js.map +0 -1
- package/dist/chunk-O4VXOBGF.js.map +0 -1
- package/dist/chunk-OL6QVXGF.js.map +0 -1
- package/dist/chunk-WYA65Y3F.js.map +0 -1
- package/dist/chunk-XCNTXWBB.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-U5JFG7HT.js.map +0 -1
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
buildTimeline,
|
|
3
3
|
groupTimeline,
|
|
4
4
|
sessionStatusFromEvents
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6KLX2RH5.js";
|
|
6
6
|
import {
|
|
7
7
|
useDebouncedCallback,
|
|
8
8
|
useMutationRunner,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
useEmbeddedSessionLineage,
|
|
19
19
|
useEmbeddedSessionMcpApprovalPolicy,
|
|
20
20
|
useEmbeddedSessionRead
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-C5ZPSSS5.js";
|
|
22
22
|
|
|
23
23
|
// src/hooks/use-session.ts
|
|
24
24
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
@@ -1687,97 +1687,12 @@ function useGoal(sessionId, options = {}) {
|
|
|
1687
1687
|
};
|
|
1688
1688
|
}
|
|
1689
1689
|
|
|
1690
|
-
// src/hooks/use-session-lineage.ts
|
|
1691
|
-
import { useCallback as useCallback6, useEffect as useEffect6, useRef as useRef5 } from "react";
|
|
1692
|
-
function isLineageRefreshEvent(event) {
|
|
1693
|
-
if (event.type === "session.status.changed" || event.type === "session.created") {
|
|
1694
|
-
return true;
|
|
1695
|
-
}
|
|
1696
|
-
if (event.type === "agent.toolCall.output") {
|
|
1697
|
-
const payload = event.payload;
|
|
1698
|
-
const name = typeof payload?.name === "string" ? payload.name : typeof payload?.toolName === "string" ? payload.toolName : "";
|
|
1699
|
-
return name === "session_create" || name.endsWith("__session_create");
|
|
1700
|
-
}
|
|
1701
|
-
return false;
|
|
1702
|
-
}
|
|
1703
|
-
function isSessionCreateToolCallCreated(event) {
|
|
1704
|
-
if (event.type !== "agent.toolCall.created") {
|
|
1705
|
-
return false;
|
|
1706
|
-
}
|
|
1707
|
-
const payload = event.payload;
|
|
1708
|
-
const name = typeof payload?.name === "string" ? payload.name : typeof payload?.toolName === "string" ? payload.toolName : "";
|
|
1709
|
-
return name === "session_create" || name.endsWith("__session_create");
|
|
1710
|
-
}
|
|
1711
|
-
function useSessionLineage(sessionId, options = {}) {
|
|
1712
|
-
const { client, workspaceId, workspaceControlEvent, registerSessionReconciler } = useEmbeddedSessionLineage(options);
|
|
1713
|
-
const enabled = (options.enabled ?? true) && Boolean(sessionId);
|
|
1714
|
-
const load = useCallback6(
|
|
1715
|
-
async () => sessionId ? await client.getSessionLineage(workspaceId, sessionId) : { ancestors: [], children: [], truncated: false },
|
|
1716
|
-
[client, workspaceId, sessionId]
|
|
1717
|
-
);
|
|
1718
|
-
const state = usePolledValue(load, { pollIntervalMs: options.pollIntervalMs, enabled });
|
|
1719
|
-
const refresh = state.refresh;
|
|
1720
|
-
useEffect6(() => {
|
|
1721
|
-
if (enabled && workspaceControlEvent) void refresh();
|
|
1722
|
-
}, [enabled, refresh, workspaceControlEvent]);
|
|
1723
|
-
useEffect6(() => {
|
|
1724
|
-
if (!sessionId || !enabled) return;
|
|
1725
|
-
return registerSessionReconciler(sessionId, "lineage", refresh);
|
|
1726
|
-
}, [enabled, refresh, registerSessionReconciler, sessionId]);
|
|
1727
|
-
const refreshSoon = useDebouncedCallback(() => void refresh(), 150);
|
|
1728
|
-
const delayedChildRefreshRef = useRef5(null);
|
|
1729
|
-
useEffect6(() => {
|
|
1730
|
-
return () => {
|
|
1731
|
-
if (delayedChildRefreshRef.current !== null) {
|
|
1732
|
-
clearTimeout(delayedChildRefreshRef.current);
|
|
1733
|
-
delayedChildRefreshRef.current = null;
|
|
1734
|
-
}
|
|
1735
|
-
};
|
|
1736
|
-
}, [sessionId, workspaceId]);
|
|
1737
|
-
const refreshAfterChildCreate = useCallback6(() => {
|
|
1738
|
-
void refresh();
|
|
1739
|
-
if (delayedChildRefreshRef.current !== null) {
|
|
1740
|
-
clearTimeout(delayedChildRefreshRef.current);
|
|
1741
|
-
}
|
|
1742
|
-
delayedChildRefreshRef.current = setTimeout(() => {
|
|
1743
|
-
delayedChildRefreshRef.current = null;
|
|
1744
|
-
void refresh();
|
|
1745
|
-
}, 2500);
|
|
1746
|
-
}, [refresh]);
|
|
1747
|
-
useSessionEventTrigger(
|
|
1748
|
-
client,
|
|
1749
|
-
workspaceId,
|
|
1750
|
-
sessionId,
|
|
1751
|
-
isLineageRefreshEvent,
|
|
1752
|
-
refreshSoon,
|
|
1753
|
-
// SHARED-FEED ONLY: without a caller-provided events log the trigger would
|
|
1754
|
-
// open its OWN streamEvents tail — a second live SSE connection next to the
|
|
1755
|
-
// session route's useSessionEvents. A caller with no feed opts into polling
|
|
1756
|
-
// (pollIntervalMs), never a duplicate stream.
|
|
1757
|
-
{ events: options.events, enabled: enabled && options.events !== void 0 }
|
|
1758
|
-
);
|
|
1759
|
-
useSessionEventTrigger(
|
|
1760
|
-
client,
|
|
1761
|
-
workspaceId,
|
|
1762
|
-
sessionId,
|
|
1763
|
-
isSessionCreateToolCallCreated,
|
|
1764
|
-
refreshAfterChildCreate,
|
|
1765
|
-
{ events: options.events, enabled: enabled && options.events !== void 0 }
|
|
1766
|
-
);
|
|
1767
|
-
return {
|
|
1768
|
-
lineage: state.data,
|
|
1769
|
-
loading: state.loading,
|
|
1770
|
-
error: state.error,
|
|
1771
|
-
refresh
|
|
1772
|
-
};
|
|
1773
|
-
}
|
|
1774
|
-
|
|
1775
1690
|
// src/hooks/use-session-control.ts
|
|
1776
|
-
import { useCallback as
|
|
1691
|
+
import { useCallback as useCallback6, useLayoutEffect as useLayoutEffect2, useRef as useRef5 } from "react";
|
|
1777
1692
|
function useSessionControl(sessionId, options = {}) {
|
|
1778
1693
|
const { client, workspaceId } = useEmbeddedSession(options);
|
|
1779
1694
|
const approvalTargetKey = `${workspaceId}\0${sessionId ?? ""}`;
|
|
1780
|
-
const pendingApproval =
|
|
1695
|
+
const pendingApproval = useRef5(null);
|
|
1781
1696
|
useLayoutEffect2(() => {
|
|
1782
1697
|
if (pendingApproval.current?.targetKey !== approvalTargetKey) {
|
|
1783
1698
|
pendingApproval.current = null;
|
|
@@ -1795,7 +1710,7 @@ function useSessionControl(sessionId, options = {}) {
|
|
|
1795
1710
|
mutationError: approvalError,
|
|
1796
1711
|
clearMutationError: clearApprovalError
|
|
1797
1712
|
} = useMutationRunner(approvalTargetKey);
|
|
1798
|
-
const pause =
|
|
1713
|
+
const pause = useCallback6(
|
|
1799
1714
|
async (reason) => {
|
|
1800
1715
|
if (!sessionId) {
|
|
1801
1716
|
return null;
|
|
@@ -1806,7 +1721,7 @@ function useSessionControl(sessionId, options = {}) {
|
|
|
1806
1721
|
},
|
|
1807
1722
|
[client, workspaceId, sessionId, runControl]
|
|
1808
1723
|
);
|
|
1809
|
-
const resume =
|
|
1724
|
+
const resume = useCallback6(
|
|
1810
1725
|
async (reason) => {
|
|
1811
1726
|
if (!sessionId) return null;
|
|
1812
1727
|
return await runControl(
|
|
@@ -1815,7 +1730,7 @@ function useSessionControl(sessionId, options = {}) {
|
|
|
1815
1730
|
},
|
|
1816
1731
|
[client, workspaceId, sessionId, runControl]
|
|
1817
1732
|
);
|
|
1818
|
-
const decide =
|
|
1733
|
+
const decide = useCallback6(
|
|
1819
1734
|
async (approvalId, decision, message) => {
|
|
1820
1735
|
if (!sessionId) {
|
|
1821
1736
|
return null;
|
|
@@ -1844,16 +1759,16 @@ function useSessionControl(sessionId, options = {}) {
|
|
|
1844
1759
|
},
|
|
1845
1760
|
[approvalTargetKey, client, workspaceId, sessionId, runApproval]
|
|
1846
1761
|
);
|
|
1847
|
-
const approve =
|
|
1762
|
+
const approve = useCallback6(
|
|
1848
1763
|
async (approvalId, message) => await decide(approvalId, "approve", message),
|
|
1849
1764
|
[decide]
|
|
1850
1765
|
);
|
|
1851
|
-
const reject =
|
|
1766
|
+
const reject = useCallback6(
|
|
1852
1767
|
async (approvalId, message) => await decide(approvalId, "reject", message),
|
|
1853
1768
|
[decide]
|
|
1854
1769
|
);
|
|
1855
1770
|
const error = approvalError ?? controlError;
|
|
1856
|
-
const clearError =
|
|
1771
|
+
const clearError = useCallback6(() => {
|
|
1857
1772
|
clearControlError();
|
|
1858
1773
|
clearApprovalError();
|
|
1859
1774
|
}, [clearControlError, clearApprovalError]);
|
|
@@ -1870,7 +1785,7 @@ function useSessionControl(sessionId, options = {}) {
|
|
|
1870
1785
|
}
|
|
1871
1786
|
|
|
1872
1787
|
// src/hooks/use-session-mcp-approval-policy.ts
|
|
1873
|
-
import { useCallback as
|
|
1788
|
+
import { useCallback as useCallback7, useEffect as useEffect6, useLayoutEffect as useLayoutEffect3, useMemo as useMemo4, useRef as useRef6, useState as useState6 } from "react";
|
|
1874
1789
|
function isSessionMcpApprovalPolicyEvent(event, serverId) {
|
|
1875
1790
|
if (event.type !== "session.mcp.approval_policy.updated") {
|
|
1876
1791
|
return false;
|
|
@@ -1886,14 +1801,14 @@ function useSessionMcpApprovalPolicy(sessionId, serverId, options = {}) {
|
|
|
1886
1801
|
const enabled = (options.enabled ?? true) && Boolean(sessionId && serverId);
|
|
1887
1802
|
const [override, setOverride] = useState6(null);
|
|
1888
1803
|
const targetKey = `${workspaceId}\0${sessionId ?? ""}\0${serverId ?? ""}`;
|
|
1889
|
-
const authoritativeGeneration =
|
|
1804
|
+
const authoritativeGeneration = useRef6(0);
|
|
1890
1805
|
const mutationIdentity = useMemo4(() => ({ client, targetKey }), [client, targetKey]);
|
|
1891
1806
|
const { run, mutating, mutationError, clearMutationError } = useMutationRunner(mutationIdentity);
|
|
1892
1807
|
useLayoutEffect3(() => {
|
|
1893
1808
|
authoritativeGeneration.current += 1;
|
|
1894
1809
|
setOverride(null);
|
|
1895
1810
|
}, [client, targetKey]);
|
|
1896
|
-
const load =
|
|
1811
|
+
const load = useCallback7(async () => {
|
|
1897
1812
|
const generation = authoritativeGeneration.current;
|
|
1898
1813
|
if (!sessionId || !serverId) {
|
|
1899
1814
|
return { targetKey, generation, server: null };
|
|
@@ -1914,13 +1829,13 @@ function useSessionMcpApprovalPolicy(sessionId, serverId, options = {}) {
|
|
|
1914
1829
|
enabled,
|
|
1915
1830
|
pollIntervalMs: options.pollIntervalMs
|
|
1916
1831
|
});
|
|
1917
|
-
|
|
1832
|
+
useEffect6(() => {
|
|
1918
1833
|
if (data?.targetKey === targetKey && data.generation === authoritativeGeneration.current) {
|
|
1919
1834
|
setOverride(null);
|
|
1920
1835
|
}
|
|
1921
1836
|
}, [data, targetKey]);
|
|
1922
1837
|
const scheduleRefresh = useDebouncedCallback(() => void refresh());
|
|
1923
|
-
const matchesPolicyEvent =
|
|
1838
|
+
const matchesPolicyEvent = useCallback7(
|
|
1924
1839
|
(event) => isSessionMcpApprovalPolicyEvent(event, serverId ?? void 0),
|
|
1925
1840
|
[serverId]
|
|
1926
1841
|
);
|
|
@@ -1936,7 +1851,7 @@ function useSessionMcpApprovalPolicy(sessionId, serverId, options = {}) {
|
|
|
1936
1851
|
},
|
|
1937
1852
|
async () => await refresh()
|
|
1938
1853
|
);
|
|
1939
|
-
const update =
|
|
1854
|
+
const update = useCallback7(
|
|
1940
1855
|
async (policy) => {
|
|
1941
1856
|
if (!sessionId || !serverId) {
|
|
1942
1857
|
return null;
|
|
@@ -1970,6 +1885,91 @@ function useSessionMcpApprovalPolicy(sessionId, serverId, options = {}) {
|
|
|
1970
1885
|
};
|
|
1971
1886
|
}
|
|
1972
1887
|
|
|
1888
|
+
// src/hooks/use-session-lineage.ts
|
|
1889
|
+
import { useCallback as useCallback8, useEffect as useEffect7, useRef as useRef7 } from "react";
|
|
1890
|
+
function isLineageRefreshEvent(event) {
|
|
1891
|
+
if (event.type === "session.status.changed" || event.type === "session.created") {
|
|
1892
|
+
return true;
|
|
1893
|
+
}
|
|
1894
|
+
if (event.type === "agent.toolCall.output") {
|
|
1895
|
+
const payload = event.payload;
|
|
1896
|
+
const name = typeof payload?.name === "string" ? payload.name : typeof payload?.toolName === "string" ? payload.toolName : "";
|
|
1897
|
+
return name === "session_create" || name.endsWith("__session_create");
|
|
1898
|
+
}
|
|
1899
|
+
return false;
|
|
1900
|
+
}
|
|
1901
|
+
function isSessionCreateToolCallCreated(event) {
|
|
1902
|
+
if (event.type !== "agent.toolCall.created") {
|
|
1903
|
+
return false;
|
|
1904
|
+
}
|
|
1905
|
+
const payload = event.payload;
|
|
1906
|
+
const name = typeof payload?.name === "string" ? payload.name : typeof payload?.toolName === "string" ? payload.toolName : "";
|
|
1907
|
+
return name === "session_create" || name.endsWith("__session_create");
|
|
1908
|
+
}
|
|
1909
|
+
function useSessionLineage(sessionId, options = {}) {
|
|
1910
|
+
const { client, workspaceId, workspaceControlEvent, registerSessionReconciler } = useEmbeddedSessionLineage(options);
|
|
1911
|
+
const enabled = (options.enabled ?? true) && Boolean(sessionId);
|
|
1912
|
+
const load = useCallback8(
|
|
1913
|
+
async () => sessionId ? await client.getSessionLineage(workspaceId, sessionId) : { ancestors: [], children: [], truncated: false },
|
|
1914
|
+
[client, workspaceId, sessionId]
|
|
1915
|
+
);
|
|
1916
|
+
const state = usePolledValue(load, { pollIntervalMs: options.pollIntervalMs, enabled });
|
|
1917
|
+
const refresh = state.refresh;
|
|
1918
|
+
useEffect7(() => {
|
|
1919
|
+
if (enabled && workspaceControlEvent) void refresh();
|
|
1920
|
+
}, [enabled, refresh, workspaceControlEvent]);
|
|
1921
|
+
useEffect7(() => {
|
|
1922
|
+
if (!sessionId || !enabled) return;
|
|
1923
|
+
return registerSessionReconciler(sessionId, "lineage", refresh);
|
|
1924
|
+
}, [enabled, refresh, registerSessionReconciler, sessionId]);
|
|
1925
|
+
const refreshSoon = useDebouncedCallback(() => void refresh(), 150);
|
|
1926
|
+
const delayedChildRefreshRef = useRef7(null);
|
|
1927
|
+
useEffect7(() => {
|
|
1928
|
+
return () => {
|
|
1929
|
+
if (delayedChildRefreshRef.current !== null) {
|
|
1930
|
+
clearTimeout(delayedChildRefreshRef.current);
|
|
1931
|
+
delayedChildRefreshRef.current = null;
|
|
1932
|
+
}
|
|
1933
|
+
};
|
|
1934
|
+
}, [sessionId, workspaceId]);
|
|
1935
|
+
const refreshAfterChildCreate = useCallback8(() => {
|
|
1936
|
+
void refresh();
|
|
1937
|
+
if (delayedChildRefreshRef.current !== null) {
|
|
1938
|
+
clearTimeout(delayedChildRefreshRef.current);
|
|
1939
|
+
}
|
|
1940
|
+
delayedChildRefreshRef.current = setTimeout(() => {
|
|
1941
|
+
delayedChildRefreshRef.current = null;
|
|
1942
|
+
void refresh();
|
|
1943
|
+
}, 2500);
|
|
1944
|
+
}, [refresh]);
|
|
1945
|
+
useSessionEventTrigger(
|
|
1946
|
+
client,
|
|
1947
|
+
workspaceId,
|
|
1948
|
+
sessionId,
|
|
1949
|
+
isLineageRefreshEvent,
|
|
1950
|
+
refreshSoon,
|
|
1951
|
+
// SHARED-FEED ONLY: without a caller-provided events log the trigger would
|
|
1952
|
+
// open its OWN streamEvents tail — a second live SSE connection next to the
|
|
1953
|
+
// session route's useSessionEvents. A caller with no feed opts into polling
|
|
1954
|
+
// (pollIntervalMs), never a duplicate stream.
|
|
1955
|
+
{ events: options.events, enabled: enabled && options.events !== void 0 }
|
|
1956
|
+
);
|
|
1957
|
+
useSessionEventTrigger(
|
|
1958
|
+
client,
|
|
1959
|
+
workspaceId,
|
|
1960
|
+
sessionId,
|
|
1961
|
+
isSessionCreateToolCallCreated,
|
|
1962
|
+
refreshAfterChildCreate,
|
|
1963
|
+
{ events: options.events, enabled: enabled && options.events !== void 0 }
|
|
1964
|
+
);
|
|
1965
|
+
return {
|
|
1966
|
+
lineage: state.data,
|
|
1967
|
+
loading: state.loading,
|
|
1968
|
+
error: state.error,
|
|
1969
|
+
refresh
|
|
1970
|
+
};
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
1973
|
// src/approvals.ts
|
|
1974
1974
|
function approvalsFromRequiresAction(payload) {
|
|
1975
1975
|
const approvals = payload && typeof payload === "object" ? payload.approvals : void 0;
|
|
@@ -2146,11 +2146,11 @@ export {
|
|
|
2146
2146
|
useTurnQueue,
|
|
2147
2147
|
isGoalEvent,
|
|
2148
2148
|
useGoal,
|
|
2149
|
-
isLineageRefreshEvent,
|
|
2150
|
-
useSessionLineage,
|
|
2151
2149
|
useSessionControl,
|
|
2152
2150
|
isSessionMcpApprovalPolicyEvent,
|
|
2153
2151
|
useSessionMcpApprovalPolicy,
|
|
2152
|
+
isLineageRefreshEvent,
|
|
2153
|
+
useSessionLineage,
|
|
2154
2154
|
approvalsFromRequiresAction,
|
|
2155
2155
|
projectPendingApprovals,
|
|
2156
2156
|
humanInputRequestFromEvent,
|
|
@@ -2158,4 +2158,4 @@ export {
|
|
|
2158
2158
|
isHumanInputEvent,
|
|
2159
2159
|
useHumanInputRequests
|
|
2160
2160
|
};
|
|
2161
|
-
//# sourceMappingURL=chunk-
|
|
2161
|
+
//# sourceMappingURL=chunk-B6WPZSTT.js.map
|