@datalayer/agent-runtimes 1.0.10 → 1.0.18
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 +82 -1
- package/lib/{AgentLexical.d.ts → AgentDocument.d.ts} +5 -5
- package/lib/{AgentLexical.js → AgentDocument.js} +156 -26
- package/lib/AgentNode.js +32 -31
- package/lib/AgentNotebook.js +172 -17
- package/lib/AppExamples2.css +47 -0
- package/lib/AppExamples2.d.ts +3 -0
- package/lib/AppExamples2.js +21 -0
- package/lib/{agent-lexical-main.js → agent-document-main.js} +2 -2
- package/lib/agents/AgentRuntimeChat.d.ts +73 -0
- package/lib/agents/AgentRuntimeChat.js +198 -0
- package/lib/api/index.d.ts +12 -0
- package/lib/api/index.js +46 -0
- package/lib/api/runtimes/checkpoints.d.ts +122 -0
- package/lib/api/runtimes/checkpoints.js +118 -0
- package/lib/api/runtimes/environments.d.ts +9 -0
- package/lib/api/runtimes/environments.js +29 -0
- package/lib/api/runtimes/healthz.d.ts +15 -0
- package/lib/api/runtimes/healthz.js +44 -0
- package/lib/api/runtimes/index.d.ts +12 -0
- package/lib/api/runtimes/index.js +16 -0
- package/lib/api/runtimes/runtimes.d.ts +138 -0
- package/lib/api/runtimes/runtimes.js +230 -0
- package/lib/api/runtimes/snapshots.d.ts +38 -0
- package/lib/api/runtimes/snapshots.js +82 -0
- package/lib/api/scheduler/index.d.ts +6 -0
- package/lib/api/scheduler/index.js +10 -0
- package/lib/api/scheduler/schedules.d.ts +85 -0
- package/lib/api/scheduler/schedules.js +78 -0
- package/lib/api/spacer/documents.d.ts +12 -0
- package/lib/api/spacer/documents.js +43 -0
- package/lib/api/spacer/healthz.d.ts +15 -0
- package/lib/api/spacer/healthz.js +44 -0
- package/lib/api/spacer/index.d.ts +15 -0
- package/lib/api/spacer/index.js +19 -0
- package/lib/api/spacer/items.d.ts +25 -0
- package/lib/api/spacer/items.js +55 -0
- package/lib/api/spacer/lexicals.d.ts +34 -0
- package/lib/api/spacer/lexicals.js +89 -0
- package/lib/api/spacer/notebooks.d.ts +34 -0
- package/lib/api/spacer/notebooks.js +89 -0
- package/lib/api/spacer/spaces.d.ts +84 -0
- package/lib/api/spacer/spaces.js +170 -0
- package/lib/api/spacer/users.d.ts +9 -0
- package/lib/api/spacer/users.js +29 -0
- package/lib/chat/Chat.d.ts +1 -1
- package/lib/chat/Chat.js +54 -54
- package/lib/chat/ChatFloating.d.ts +2 -2
- package/lib/chat/ChatFloating.js +136 -25
- package/lib/chat/ChatSidebar.js +20 -22
- package/lib/chat/base/ChatBase.js +429 -39
- package/lib/chat/display/EmptyState.js +21 -21
- package/lib/chat/document/EphemeralDocument.d.ts +23 -0
- package/lib/chat/document/EphemeralDocument.js +270 -0
- package/lib/chat/header/ChatHeaderBase.d.ts +12 -2
- package/lib/chat/header/ChatHeaderBase.js +78 -23
- package/lib/chat/index.d.ts +1 -0
- package/lib/chat/index.js +2 -0
- package/lib/chat/notebook/EphemeralNotebook.d.ts +24 -0
- package/lib/chat/notebook/EphemeralNotebook.js +252 -0
- package/lib/chat/prompt/InputFooter.js +4 -1
- package/lib/client/AgentRuntimesClient.d.ts +127 -0
- package/lib/client/AgentRuntimesClient.js +36 -0
- package/lib/client/AgentsMixin.js +28 -28
- package/lib/client/SdkAgentRuntimesClient.d.ts +1 -1
- package/lib/client/SdkAgentRuntimesClient.js +1 -1
- package/lib/client/mixins/RuntimesMixin.d.ts +93 -0
- package/lib/client/mixins/RuntimesMixin.js +229 -0
- package/lib/client/mixins/SpacerMixin.d.ts +210 -0
- package/lib/client/mixins/SpacerMixin.js +615 -0
- package/lib/client/utils/spacerUtils.d.ts +18 -0
- package/lib/client/utils/spacerUtils.js +32 -0
- package/lib/collaboration/DatalayerCollaboration.d.ts +13 -0
- package/lib/collaboration/DatalayerCollaboration.js +28 -0
- package/lib/collaboration/DatalayerCollaborationProvider.d.ts +58 -0
- package/lib/collaboration/DatalayerCollaborationProvider.js +148 -0
- package/lib/collaboration/index.d.ts +2 -0
- package/lib/collaboration/index.js +6 -0
- package/lib/components/AgentSummary.d.ts +19 -0
- package/lib/components/AgentSummary.js +89 -0
- package/lib/components/a2ui/A2uiSurfaceComposed.d.ts +13 -0
- package/lib/components/a2ui/A2uiSurfaceComposed.js +110 -0
- package/lib/components/a2ui/index.d.ts +2 -0
- package/lib/components/a2ui/index.js +6 -0
- package/lib/components/a2ui/styles.d.ts +14 -0
- package/lib/components/a2ui/styles.js +142 -0
- package/lib/components/context/SpaceSelect.d.ts +2 -0
- package/lib/components/context/SpaceSelect.js +42 -0
- package/lib/components/flashes/FlashDisclaimer.d.ts +2 -0
- package/lib/components/flashes/FlashDisclaimer.js +17 -0
- package/lib/components/icons/ArtifactIcon.d.ts +10 -0
- package/lib/components/icons/ArtifactIcon.js +58 -0
- package/lib/components/icons/index.d.ts +1 -0
- package/lib/components/icons/index.js +5 -0
- package/lib/components/index.d.ts +5 -0
- package/lib/components/index.js +5 -0
- package/lib/components/nbgrader/NbGradesDetails.d.ts +5 -0
- package/lib/components/nbgrader/NbGradesDetails.js +19 -0
- package/lib/components/nbgrader/index.d.ts +1 -0
- package/lib/components/nbgrader/index.js +5 -0
- package/lib/components/progress/CreditsIndicator.d.ts +33 -0
- package/lib/components/progress/CreditsIndicator.js +23 -0
- package/lib/components/progress/index.d.ts +2 -0
- package/lib/components/progress/index.js +6 -0
- package/lib/components/runtimes/RuntimeCellVariables.d.ts +39 -0
- package/lib/components/runtimes/RuntimeCellVariables.js +172 -0
- package/lib/components/runtimes/RuntimeCellVariablesDialog.d.ts +37 -0
- package/lib/components/runtimes/RuntimeCellVariablesDialog.js +101 -0
- package/lib/components/runtimes/RuntimeLauncherDialog.d.ts +57 -0
- package/lib/components/runtimes/RuntimeLauncherDialog.js +275 -0
- package/lib/components/runtimes/RuntimePickerBase.d.ts +69 -0
- package/lib/components/runtimes/RuntimePickerBase.js +122 -0
- package/lib/components/runtimes/RuntimePickerCell.d.ts +34 -0
- package/lib/components/runtimes/RuntimePickerCell.js +104 -0
- package/lib/components/runtimes/RuntimePickerNotebook.d.ts +42 -0
- package/lib/components/runtimes/RuntimePickerNotebook.js +232 -0
- package/lib/components/runtimes/RuntimeReservationControl.d.ts +47 -0
- package/lib/components/runtimes/RuntimeReservationControl.js +42 -0
- package/lib/components/runtimes/RuntimeSimplePicker.d.ts +38 -0
- package/lib/components/runtimes/RuntimeSimplePicker.js +155 -0
- package/lib/components/runtimes/RuntimeTransfer.d.ts +16 -0
- package/lib/components/runtimes/RuntimeTransfer.js +5 -0
- package/lib/components/runtimes/RuntimeUtils.d.ts +17 -0
- package/lib/components/runtimes/RuntimeUtils.js +178 -0
- package/lib/components/runtimes/RuntimeVariables.d.ts +38 -0
- package/lib/components/runtimes/RuntimeVariables.js +75 -0
- package/lib/components/runtimes/index.d.ts +11 -0
- package/lib/components/runtimes/index.js +15 -0
- package/lib/components/scheduler/ScheduleMenu.d.ts +54 -0
- package/lib/components/scheduler/ScheduleMenu.js +154 -0
- package/lib/components/scheduler/index.d.ts +1 -0
- package/lib/components/scheduler/index.js +5 -0
- package/lib/components/snapshots/SandboxSnapshotMenu.d.ts +33 -0
- package/lib/components/snapshots/SandboxSnapshotMenu.js +169 -0
- package/lib/components/snapshots/index.d.ts +1 -0
- package/lib/components/snapshots/index.js +5 -0
- package/lib/components/snippets/SnippetDialog.d.ts +42 -0
- package/lib/components/snippets/SnippetDialog.js +42 -0
- package/lib/components/students/StudentItemStatus.d.ts +7 -0
- package/lib/components/students/StudentItemStatus.js +68 -0
- package/lib/components/students/index.d.ts +1 -0
- package/lib/components/students/index.js +5 -0
- package/lib/components/tokens/SpaceVariantToken.d.ts +5 -0
- package/lib/components/tokens/SpaceVariantToken.js +23 -0
- package/lib/components/tokens/index.d.ts +1 -0
- package/lib/components/tokens/index.js +5 -0
- package/lib/components/toolbars/AssignmentEditorToolbar.d.ts +4 -0
- package/lib/components/toolbars/AssignmentEditorToolbar.js +18 -0
- package/lib/components/toolbars/DocumentEditorToolbar.d.ts +2 -0
- package/lib/components/toolbars/DocumentEditorToolbar.js +12 -0
- package/lib/components/toolbars/NotebookEditorToolbar.d.ts +29 -0
- package/lib/components/toolbars/NotebookEditorToolbar.js +30 -0
- package/lib/context/ContextInspector.d.ts +1 -14
- package/lib/context/ContextInspector.js +3 -73
- package/lib/context/CostUsageChart.d.ts +4 -3
- package/lib/context/CostUsageChart.js +236 -35
- package/lib/context/MessageHistory.d.ts +30 -0
- package/lib/context/MessageHistory.js +129 -0
- package/lib/context/TokenUsageChart.d.ts +4 -3
- package/lib/context/TokenUsageChart.js +180 -30
- package/lib/context/TurnGraphChart.d.ts +1 -1
- package/lib/context/TurnGraphChart.js +6 -6
- package/lib/examples/A2UiAgentExample.d.ts +22 -0
- package/lib/examples/A2UiAgentExample.js +442 -0
- package/lib/examples/A2UiComponentsGalleryExample.d.ts +3 -0
- package/lib/examples/A2UiComponentsGalleryExample.js +863 -0
- package/lib/examples/A2UiContactCardExample.js +9 -5
- package/lib/examples/A2UiRestaurantExample.js +23 -8
- package/lib/examples/A2UiViewerExample.js +75 -3
- package/lib/examples/AgUiAgenticExample.d.ts +1 -12
- package/lib/examples/AgUiAgenticExample.js +52 -8
- package/lib/examples/AgUiBackendToolRenderingExample.d.ts +1 -16
- package/lib/examples/AgUiBackendToolRenderingExample.js +32 -17
- package/lib/examples/AgUiHaikuGenUiExample.d.ts +1 -17
- package/lib/examples/AgUiHaikuGenUiExample.js +49 -33
- package/lib/examples/AgUiHumanInTheLoopExample.d.ts +1 -12
- package/lib/examples/AgUiHumanInTheLoopExample.js +21 -6
- package/lib/examples/AgUiSharedStateExample.d.ts +1 -14
- package/lib/examples/AgUiSharedStateExample.js +21 -6
- package/lib/examples/AgUiToolsBasedGenUiExample.d.ts +1 -14
- package/lib/examples/AgUiToolsBasedGenUiExample.js +21 -6
- package/lib/examples/AgentCheckpointsExample.d.ts +1 -1
- package/lib/examples/AgentCheckpointsExample.js +9 -10
- package/lib/examples/AgentCodeSandboxesExample.d.ts +3 -0
- package/lib/examples/AgentCodeSandboxesExample.js +192 -0
- package/lib/examples/AgentCodemodeExample.js +3 -3
- package/lib/examples/AgentEvalsExample.js +5 -5
- package/lib/examples/AgentGuardrailsExample.js +17 -12
- package/lib/examples/AgentHooksExample.js +14 -55
- package/lib/examples/AgentInferenceProviderExample.js +4 -4
- package/lib/examples/AgentLoopExample.d.ts +10 -0
- package/lib/examples/AgentLoopExample.js +304 -0
- package/lib/examples/AgentMCPExample.js +7 -7
- package/lib/examples/AgentMemoryExample.js +4 -4
- package/lib/examples/AgentMonitoringExample.js +114 -44
- package/lib/examples/AgentNotificationsExample.js +4 -4
- package/lib/examples/AgentOtelExample.d.ts +3 -3
- package/lib/examples/AgentOtelExample.js +15 -10
- package/lib/examples/AgentOutputsExample.js +6 -6
- package/lib/examples/AgentParametersExample.js +21 -33
- package/lib/examples/AgentSandboxExample.js +5 -5
- package/lib/examples/AgentSkillsExample.js +7 -7
- package/lib/examples/AgentSubagentsExample.js +4 -4
- package/lib/examples/AgentToolApprovalsExample.js +5 -5
- package/lib/examples/AgentTriggersExample.js +9 -9
- package/lib/examples/AgentspecsExample.js +63 -41
- package/lib/examples/ChatCustomExample.js +23 -77
- package/lib/examples/ChatExample.js +13 -44
- package/lib/examples/LexicalAgentExample.js +43 -91
- package/lib/examples/LexicalAgentSidebarExample.js +45 -73
- package/lib/examples/NotebookAgentExample.js +52 -81
- package/lib/examples/NotebookAgentSidebarExample.js +43 -71
- package/lib/examples/NotebookCollaborationExample.js +11 -9
- package/lib/examples/NotebookExample.js +5 -2
- package/lib/examples/components/AuthRequiredView.js +1 -1
- package/lib/examples/components/ExampleErrorBoundary.d.ts +46 -0
- package/lib/examples/components/ExampleErrorBoundary.js +67 -0
- package/lib/examples/components/haiku/haiku-card.css +11 -0
- package/lib/examples/components/weather/weather-card.css +11 -0
- package/lib/examples/example-selector.js +4 -1
- package/lib/examples/hooks/useExampleAgentRuntime.d.ts +35 -0
- package/lib/examples/hooks/useExampleAgentRuntime.js +82 -0
- package/lib/examples/hooks/useSpecRenderToolResult.d.ts +30 -0
- package/lib/examples/hooks/useSpecRenderToolResult.js +61 -0
- package/lib/examples/index.d.ts +4 -1
- package/lib/examples/index.js +4 -1
- package/lib/examples/main.js +340 -93
- package/lib/examples/utils/a2ui.d.ts +2 -0
- package/lib/examples/utils/a2ui.js +97 -2
- package/lib/examples/utils/agentSummaryStore.d.ts +21 -0
- package/lib/examples/utils/agentSummaryStore.js +23 -0
- package/lib/examples/utils/notebooks/Empty.ipynb.json +30 -30
- package/lib/examples/utils/runtimeTargetStore.d.ts +9 -0
- package/lib/examples/utils/runtimeTargetStore.js +27 -0
- package/lib/examples/utils/teardownAgents.d.ts +13 -0
- package/lib/examples/utils/teardownAgents.js +78 -0
- package/lib/examples/utils/useExampleAgentRuntimesUrl.d.ts +2 -0
- package/lib/examples/utils/useExampleAgentRuntimesUrl.js +26 -7
- package/lib/examples2/CellExample.d.ts +6 -0
- package/lib/examples2/CellExample.js +20 -0
- package/lib/examples2/DatalayerNotebookExample.d.ts +16 -0
- package/lib/examples2/DatalayerNotebookExample.js +109 -0
- package/lib/examples2/NativeNavigationExample.d.ts +8 -0
- package/lib/examples2/NativeNavigationExample.js +97 -0
- package/lib/examples2/NotebookExample.d.ts +6 -0
- package/lib/examples2/NotebookExample.js +19 -0
- package/lib/examples2/NotebookMutationsKernel.d.ts +2 -0
- package/lib/examples2/NotebookMutationsKernel.js +105 -0
- package/lib/examples2/NotebookMutationsServiceManager.d.ts +2 -0
- package/lib/examples2/NotebookMutationsServiceManager.js +109 -0
- package/lib/examples2/ReactRouterExample.d.ts +6 -0
- package/lib/examples2/ReactRouterExample.js +175 -0
- package/lib/examples2/example-selector.d.ts +22 -0
- package/lib/examples2/example-selector.js +45 -0
- package/lib/examples2/index.d.ts +2 -0
- package/lib/examples2/index.js +6 -0
- package/lib/examples2/lexical-theme.css +436 -0
- package/lib/examples2/main.d.ts +2 -0
- package/lib/examples2/main.js +330 -0
- package/lib/examples2/notebooks/IPyWidgetsExample.ipynb.json +101 -0
- package/lib/examples2/notebooks/IPyWidgetsExampleWithState.ipynb.json +112 -0
- package/lib/examples2/notebooks/Lite.ipynb.json +128 -0
- package/lib/examples2/notebooks/Matplotlib.ipynb.json +137 -0
- package/lib/examples2/notebooks/NotebookExample1.ipynb.json +126 -0
- package/lib/examples2/notebooks/NotebookExample2.ipynb.json +48 -0
- package/lib/examples2/notebooks/NotebookOutputs.ipynb.json +49 -0
- package/lib/examples2/notebooks/NotebookToCExample.ipynb.json +102 -0
- package/lib/examples2/notebooks/OutputIPyWidgetsExample.d.ts +145 -0
- package/lib/examples2/notebooks/OutputIPyWidgetsExample.js +153 -0
- package/lib/examples2/notebooks/PyGWalker.ipynb.json +55 -0
- package/lib/hooks/index.d.ts +9 -1
- package/lib/hooks/index.js +13 -1
- package/lib/hooks/useAIAgentsWebSocket.d.ts +1 -1
- package/lib/hooks/useAIAgentsWebSocket.js +39 -3
- package/lib/hooks/useAgentRuntimes.d.ts +15 -3
- package/lib/hooks/useAgentRuntimes.js +186 -27
- package/lib/hooks/useAgentsService.js +5 -5
- package/lib/hooks/useCellOutputshot.d.ts +4 -0
- package/lib/hooks/useCellOutputshot.js +25 -0
- package/lib/hooks/useCheckpoints.d.ts +8 -8
- package/lib/hooks/useCheckpoints.js +36 -26
- package/lib/hooks/useConfig.d.ts +1 -1
- package/lib/hooks/useMonitoring.d.ts +7 -5
- package/lib/hooks/useMonitoring.js +16 -10
- package/lib/hooks/useNotifications.d.ts +11 -11
- package/lib/hooks/useNotifications.js +1 -1
- package/lib/hooks/useProgressStore.d.ts +25 -0
- package/lib/hooks/useProgressStore.js +58 -0
- package/lib/hooks/useProgressTask.d.ts +9 -0
- package/lib/hooks/useProgressTask.js +41 -0
- package/lib/hooks/useProjects.d.ts +628 -0
- package/lib/hooks/useProjects.js +190 -0
- package/lib/hooks/useRuntimes.d.ts +5 -0
- package/lib/hooks/useRuntimes.js +34 -0
- package/lib/hooks/useToolApprovals.d.ts +6 -6
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/jupyter/exec/Python.d.ts +5 -0
- package/lib/jupyter/exec/Python.js +100 -0
- package/lib/jupyter/exec/Snippets.d.ts +105 -0
- package/lib/jupyter/exec/Snippets.js +101 -0
- package/lib/jupyter/exec/index.d.ts +2 -0
- package/lib/jupyter/exec/index.js +6 -0
- package/lib/jupyter/index.d.ts +2 -0
- package/lib/jupyter/index.js +6 -0
- package/lib/jupyter/kernelsHandler.d.ts +8 -0
- package/lib/jupyter/kernelsHandler.js +39 -0
- package/lib/mocks/models/CourseMock.d.ts +6 -0
- package/lib/mocks/models/CourseMock.js +29 -0
- package/lib/mocks/models/SpaceMock.d.ts +6 -0
- package/lib/mocks/models/SpaceMock.js +25 -0
- package/lib/models/Assignment.d.ts +7 -0
- package/lib/models/Assignment.js +5 -0
- package/lib/models/Cell.d.ts +8 -0
- package/lib/models/Cell.js +5 -0
- package/lib/models/CodeBlock.d.ts +10 -0
- package/lib/models/CodeBlock.js +5 -0
- package/lib/models/CodeSandboxSnapshot.d.ts +92 -0
- package/lib/models/CodeSandboxSnapshot.js +13 -0
- package/lib/models/CodeSandboxSnapshotDTO.d.ts +173 -0
- package/lib/models/CodeSandboxSnapshotDTO.js +139 -0
- package/lib/models/CodefeedBlocks.d.ts +7 -0
- package/lib/models/CodefeedBlocks.js +5 -0
- package/lib/models/Content.d.ts +5 -0
- package/lib/models/Content.js +5 -0
- package/lib/models/Course.d.ts +17 -0
- package/lib/models/Course.js +5 -0
- package/lib/models/Dataset.d.ts +16 -0
- package/lib/models/Dataset.js +5 -0
- package/lib/models/Document.d.ts +8 -0
- package/lib/models/Document.js +5 -0
- package/lib/models/Environment.d.ts +86 -0
- package/lib/models/Environment.js +5 -0
- package/lib/models/EnvironmentDTO.d.ts +125 -0
- package/lib/models/EnvironmentDTO.js +88 -0
- package/lib/models/Exercise.d.ts +16 -0
- package/lib/models/Exercise.js +5 -0
- package/lib/models/Item.d.ts +20 -0
- package/lib/models/Item.js +5 -0
- package/lib/models/ItemDTO.d.ts +74 -0
- package/lib/models/ItemDTO.js +186 -0
- package/lib/models/ItemType.d.ts +2 -0
- package/lib/models/ItemType.js +5 -0
- package/lib/models/Lesson.d.ts +5 -0
- package/lib/models/Lesson.js +5 -0
- package/lib/models/LexicalDTO.d.ts +155 -0
- package/lib/models/LexicalDTO.js +157 -0
- package/lib/models/Library.d.ts +10 -0
- package/lib/models/Library.js +5 -0
- package/lib/models/Notebook.d.ts +11 -0
- package/lib/models/Notebook.js +5 -0
- package/lib/models/NotebookDTO.d.ts +96 -0
- package/lib/models/NotebookDTO.js +153 -0
- package/lib/models/Page.d.ts +41 -0
- package/lib/models/Page.js +25 -0
- package/lib/models/PageTag.d.ts +19 -0
- package/lib/models/PageTag.js +94 -0
- package/lib/models/ProjectDTO.d.ts +89 -0
- package/lib/models/ProjectDTO.js +131 -0
- package/lib/models/Runtime.d.ts +160 -0
- package/lib/models/Runtime.js +18 -0
- package/lib/models/RuntimeDTO.d.ts +172 -0
- package/lib/models/RuntimeDTO.js +204 -0
- package/lib/models/Space.d.ts +35 -0
- package/lib/models/Space.js +66 -0
- package/lib/models/SpaceDTO.d.ts +334 -0
- package/lib/models/SpaceDTO.js +244 -0
- package/lib/models/SpaceItem.d.ts +10 -0
- package/lib/models/SpaceItem.js +5 -0
- package/lib/models/SpaceMember.d.ts +6 -0
- package/lib/models/SpaceMember.js +5 -0
- package/lib/models/StudentItem.d.ts +21 -0
- package/lib/models/StudentItem.js +5 -0
- package/lib/models/index.d.ts +32 -0
- package/lib/models/index.js +39 -0
- package/lib/protocols/AGUIAdapter.js +1 -1
- package/lib/runtimes/actions.d.ts +102 -0
- package/lib/runtimes/actions.js +249 -0
- package/lib/runtimes/apis.d.ts +273 -0
- package/lib/runtimes/apis.js +5 -0
- package/lib/runtimes/index.d.ts +5 -0
- package/lib/runtimes/index.js +9 -0
- package/lib/runtimes/settings.d.ts +15 -0
- package/lib/runtimes/settings.js +31 -0
- package/lib/runtimes/snapshots.d.ts +25 -0
- package/lib/runtimes/snapshots.js +150 -0
- package/lib/runtimes/utils.d.ts +7 -0
- package/lib/runtimes/utils.js +14 -0
- package/lib/services/DatalayerServiceManager.d.ts +23 -0
- package/lib/services/DatalayerServiceManager.js +90 -0
- package/lib/services/reconnectToRuntime.d.ts +32 -0
- package/lib/services/reconnectToRuntime.js +59 -0
- package/lib/services/sandboxServiceManagers.d.ts +31 -0
- package/lib/services/sandboxServiceManagers.js +57 -0
- package/lib/specs/agents/agents.d.ts +78 -26
- package/lib/specs/agents/agents.js +4434 -1639
- package/lib/specs/index.d.ts +1 -0
- package/lib/specs/index.js +1 -0
- package/lib/specs/loops.d.ts +34 -0
- package/lib/specs/loops.js +188 -0
- package/lib/specs/mcpServers.d.ts +1 -0
- package/lib/specs/mcpServers.js +17 -0
- package/lib/specs/models.d.ts +4 -0
- package/lib/specs/models.js +30 -0
- package/lib/specs/skills.d.ts +1 -0
- package/lib/specs/skills.js +18 -0
- package/lib/specs/tools.d.ts +15 -0
- package/lib/specs/tools.js +285 -0
- package/lib/state/index.d.ts +4 -0
- package/lib/state/index.js +10 -0
- package/lib/state/substates/CellState.d.ts +12 -0
- package/lib/state/substates/CellState.js +22 -0
- package/lib/state/substates/DocumentState.d.ts +10 -0
- package/lib/state/substates/DocumentState.js +14 -0
- package/lib/state/substates/GradeState.d.ts +10 -0
- package/lib/state/substates/GradeState.js +14 -0
- package/lib/state/substates/JupyterLabState.d.ts +16 -0
- package/lib/state/substates/JupyterLabState.js +17 -0
- package/lib/state/substates/NbformatState.d.ts +13 -0
- package/lib/state/substates/NbformatState.js +16 -0
- package/lib/state/substates/RuntimesState.d.ts +87 -0
- package/lib/state/substates/RuntimesState.js +192 -0
- package/lib/state/substates/SpaceState.d.ts +11 -0
- package/lib/state/substates/SpaceState.js +16 -0
- package/lib/state/substates/index.d.ts +8 -0
- package/lib/state/substates/index.js +14 -0
- package/lib/stores/agentRuntimeStore.d.ts +25 -2
- package/lib/stores/agentRuntimeStore.js +114 -19
- package/lib/stories/Button.stories.d.ts +1 -1
- package/lib/stories/Header.stories.d.ts +3 -3
- package/lib/test-setup.js +10 -0
- package/lib/types/agents-lifecycle.d.ts +5 -5
- package/lib/types/agents.d.ts +3 -3
- package/lib/types/agentspecs.d.ts +4 -2
- package/lib/types/chat.d.ts +135 -3
- package/lib/types/config.d.ts +19 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/loops.d.ts +64 -0
- package/lib/types/loops.js +5 -0
- package/lib/types/tools.d.ts +16 -0
- package/lib/utils/Cells.d.ts +2 -0
- package/lib/utils/Cells.js +28 -0
- package/package.json +24 -18
- package/scripts/codegen/__pycache__/generate_sandbox_agents.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/versioning.cpython-313.pyc +0 -0
- package/scripts/codegen/generate_agents.py +21 -4
- package/scripts/codegen/generate_loops.py +443 -0
- package/scripts/codegen/generate_sandbox_agents.py +145 -0
- package/lib/examples/A2UiComponentGalleryExample.d.ts +0 -3
- package/lib/examples/A2UiComponentGalleryExample.js +0 -361
- /package/lib/{agent-lexical-main.d.ts → agent-document-main.d.ts} +0 -0
|
@@ -5,22 +5,11 @@
|
|
|
5
5
|
* Human in the Loop example backend. This shows how to implement
|
|
6
6
|
* approval workflows where the human must approve generated plans.
|
|
7
7
|
*
|
|
8
|
-
* Backend:
|
|
8
|
+
* Backend: managed AG-UI agent runtime (agentspec: example-human-in-the-loop)
|
|
9
9
|
*
|
|
10
10
|
* Pattern: Uses renderToolResult with respond callback for human-in-the-loop
|
|
11
11
|
* interactions, matching the CopilotKit useHumanInTheLoop pattern.
|
|
12
12
|
*/
|
|
13
13
|
import React from 'react';
|
|
14
|
-
/**
|
|
15
|
-
* AgUiHumanInTheLoopExample Component
|
|
16
|
-
*
|
|
17
|
-
* Demonstrates human-in-the-loop approval patterns with AG-UI.
|
|
18
|
-
* The agent generates task steps that require human approval before proceeding.
|
|
19
|
-
*
|
|
20
|
-
* Features demonstrated:
|
|
21
|
-
* - Tool call rendering with Reject/Confirm buttons
|
|
22
|
-
* - respond callback for sending user decisions back to the agent
|
|
23
|
-
* - UI state changes based on user actions
|
|
24
|
-
*/
|
|
25
14
|
declare const AgUiHumanInTheLoopExample: React.FC;
|
|
26
15
|
export default AgUiHumanInTheLoopExample;
|
|
@@ -10,19 +10,20 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
10
10
|
* Human in the Loop example backend. This shows how to implement
|
|
11
11
|
* approval workflows where the human must approve generated plans.
|
|
12
12
|
*
|
|
13
|
-
* Backend:
|
|
13
|
+
* Backend: managed AG-UI agent runtime (agentspec: example-human-in-the-loop)
|
|
14
14
|
*
|
|
15
15
|
* Pattern: Uses renderToolResult with respond callback for human-in-the-loop
|
|
16
16
|
* interactions, matching the CopilotKit useHumanInTheLoop pattern.
|
|
17
17
|
*/
|
|
18
|
-
import { useState, useEffect } from 'react';
|
|
18
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
19
19
|
import { Text, Checkbox, FormControl, Label, ProgressBar, Button, } from '@primer/react';
|
|
20
20
|
import { Box } from '@datalayer/primer-addons';
|
|
21
21
|
import { ThemedProvider, useThemeBrandColor } from './utils/themedProvider';
|
|
22
22
|
import { ChatFloating } from '../chat';
|
|
23
|
+
import { useExampleAgentRuntimesUrl } from './utils/useExampleAgentRuntimesUrl';
|
|
24
|
+
import { uniqueAgentId } from './utils/agentId';
|
|
25
|
+
import { useExampleAgentRuntime } from './hooks/useExampleAgentRuntime';
|
|
23
26
|
import { TasklistIcon, CheckCircleFillIcon, XCircleFillIcon, } from '@primer/octicons-react';
|
|
24
|
-
// AG-UI endpoint for human in the loop example
|
|
25
|
-
const HUMAN_IN_THE_LOOP_ENDPOINT = 'http://localhost:8765/api/v1/examples/human_in_the_loop/';
|
|
26
27
|
/**
|
|
27
28
|
* StepsFeedback Component
|
|
28
29
|
*
|
|
@@ -177,8 +178,22 @@ const renderTaskStepsTool = (context) => {
|
|
|
177
178
|
* - respond callback for sending user decisions back to the agent
|
|
178
179
|
* - UI state changes based on user actions
|
|
179
180
|
*/
|
|
181
|
+
const AGENT_NAME = 'ag-ui-human-in-the-loop';
|
|
182
|
+
const AGENTSPEC_ID = 'example-human-in-the-loop';
|
|
180
183
|
const AgUiHumanInTheLoopExample = () => {
|
|
181
184
|
const brandColor = useThemeBrandColor();
|
|
185
|
+
const baseUrl = useExampleAgentRuntimesUrl();
|
|
186
|
+
const agentName = useMemo(() => uniqueAgentId(AGENT_NAME), []);
|
|
187
|
+
const { agentId } = useExampleAgentRuntime({
|
|
188
|
+
exampleId: 'AgUiHumanInTheLoopExample',
|
|
189
|
+
agentName,
|
|
190
|
+
specId: AGENTSPEC_ID,
|
|
191
|
+
agentConfig: {
|
|
192
|
+
protocol: 'ag-ui',
|
|
193
|
+
agentSpecId: AGENTSPEC_ID,
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
const humanInTheLoopEndpoint = agentId != null ? `${baseUrl}/api/v1/ag-ui/${agentId}/` : undefined;
|
|
182
197
|
return (_jsx(ThemedProvider, { children: _jsxs(Box, { sx: {
|
|
183
198
|
minHeight: '100vh',
|
|
184
199
|
backgroundColor: 'canvas.default',
|
|
@@ -207,7 +222,7 @@ const AgUiHumanInTheLoopExample = () => {
|
|
|
207
222
|
borderRadius: 2,
|
|
208
223
|
border: '1px solid',
|
|
209
224
|
borderColor: 'accent.muted',
|
|
210
|
-
}, children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 2 }, children: "Key Concept: respond() Callback" }), _jsxs(Text, { as: "p", sx: { fontSize: 1, color: 'fg.default' }, children: ["The ", _jsx("code", { children: "renderToolResult" }), " function receives a", ' ', _jsx("code", { children: "respond" }), " callback when the tool status is \"executing\". Calling ", _jsxs("code", { children: ["respond(", '{ accepted: true, steps: [...] }', ")"] }), ' ', "sends the user's decision back to the agent, completing the human-in-the-loop interaction."] })] })] }), _jsx(ChatFloating, { protocol: "ag-ui", endpoint:
|
|
225
|
+
}, children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 2 }, children: "Key Concept: respond() Callback" }), _jsxs(Text, { as: "p", sx: { fontSize: 1, color: 'fg.default' }, children: ["The ", _jsx("code", { children: "renderToolResult" }), " function receives a", ' ', _jsx("code", { children: "respond" }), " callback when the tool status is \"executing\". Calling ", _jsxs("code", { children: ["respond(", '{ accepted: true, steps: [...] }', ")"] }), ' ', "sends the user's decision back to the agent, completing the human-in-the-loop interaction."] })] })] }), humanInTheLoopEndpoint && (_jsx(ChatFloating, { protocol: "ag-ui", endpoint: humanInTheLoopEndpoint, title: "Task Planner", description: "I can help you plan tasks. I'll generate steps for your review.", position: "bottom-right", brandColor: brandColor, renderToolResult: renderTaskStepsTool, hideMessagesAfterToolUI: true, suggestions: [
|
|
211
226
|
{
|
|
212
227
|
title: 'Plan a trip',
|
|
213
228
|
message: 'Plan a weekend trip to Paris.',
|
|
@@ -216,6 +231,6 @@ const AgUiHumanInTheLoopExample = () => {
|
|
|
216
231
|
title: 'Organize party',
|
|
217
232
|
message: 'Plan a birthday party for next Saturday.',
|
|
218
233
|
},
|
|
219
|
-
] })] }) }));
|
|
234
|
+
] }))] }) }));
|
|
220
235
|
};
|
|
221
236
|
export default AgUiHumanInTheLoopExample;
|
|
@@ -5,21 +5,8 @@
|
|
|
5
5
|
* and the AI agent using AG-UI. This example shows a recipe builder where
|
|
6
6
|
* both the user and the AI can modify the shared state.
|
|
7
7
|
*
|
|
8
|
-
* Backend:
|
|
8
|
+
* Backend: managed AG-UI agent runtime (agentspec: example-shared-state)
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
-
/**
|
|
12
|
-
* AgUiSharedStateExample Component
|
|
13
|
-
*
|
|
14
|
-
* Demonstrates bidirectional shared state with AG-UI.
|
|
15
|
-
* Both the frontend and the AI agent can modify the recipe state,
|
|
16
|
-
* with changes synchronized via STATE_SNAPSHOT events.
|
|
17
|
-
*
|
|
18
|
-
* Features demonstrated:
|
|
19
|
-
* - Bidirectional state synchronization
|
|
20
|
-
* - StateDeps for passing state to agent
|
|
21
|
-
* - STATE_SNAPSHOT for receiving state from agent
|
|
22
|
-
* - Editable UI that updates shared state
|
|
23
|
-
*/
|
|
24
11
|
declare const AgUiSharedStateExample: React.FC;
|
|
25
12
|
export default AgUiSharedStateExample;
|
|
@@ -10,16 +10,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
10
10
|
* and the AI agent using AG-UI. This example shows a recipe builder where
|
|
11
11
|
* both the user and the AI can modify the shared state.
|
|
12
12
|
*
|
|
13
|
-
* Backend:
|
|
13
|
+
* Backend: managed AG-UI agent runtime (agentspec: example-shared-state)
|
|
14
14
|
*/
|
|
15
|
-
import { useState, useCallback } from 'react';
|
|
15
|
+
import { useState, useCallback, useMemo } from 'react';
|
|
16
16
|
import { Text, Button, TextInput, Label } from '@primer/react';
|
|
17
17
|
import { Box } from '@datalayer/primer-addons';
|
|
18
18
|
import { ThemedProvider, useThemeBrandColor } from './utils/themedProvider';
|
|
19
19
|
import { ChatFloating } from '../chat';
|
|
20
|
+
import { useExampleAgentRuntimesUrl } from './utils/useExampleAgentRuntimesUrl';
|
|
21
|
+
import { uniqueAgentId } from './utils/agentId';
|
|
22
|
+
import { useExampleAgentRuntime } from './hooks/useExampleAgentRuntime';
|
|
20
23
|
import { PlusIcon, XIcon, BeakerIcon, ClockIcon, PersonIcon, } from '@primer/octicons-react';
|
|
21
|
-
// AG-UI endpoint for shared state example
|
|
22
|
-
const SHARED_STATE_ENDPOINT = 'http://localhost:8765/api/v1/examples/shared_state/';
|
|
23
24
|
const DEFAULT_RECIPE = {
|
|
24
25
|
title: '',
|
|
25
26
|
description: '',
|
|
@@ -103,8 +104,22 @@ const RecipeDisplay = ({ recipe, onUpdate }) => {
|
|
|
103
104
|
* - STATE_SNAPSHOT for receiving state from agent
|
|
104
105
|
* - Editable UI that updates shared state
|
|
105
106
|
*/
|
|
107
|
+
const AGENT_NAME = 'ag-ui-shared-state';
|
|
108
|
+
const AGENTSPEC_ID = 'example-shared-state';
|
|
106
109
|
const AgUiSharedStateExample = () => {
|
|
107
110
|
const brandColor = useThemeBrandColor();
|
|
111
|
+
const baseUrl = useExampleAgentRuntimesUrl();
|
|
112
|
+
const agentName = useMemo(() => uniqueAgentId(AGENT_NAME), []);
|
|
113
|
+
const { agentId } = useExampleAgentRuntime({
|
|
114
|
+
exampleId: 'AgUiSharedStateExample',
|
|
115
|
+
agentName,
|
|
116
|
+
specId: AGENTSPEC_ID,
|
|
117
|
+
agentConfig: {
|
|
118
|
+
protocol: 'ag-ui',
|
|
119
|
+
agentSpecId: AGENTSPEC_ID,
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
const sharedStateEndpoint = agentId != null ? `${baseUrl}/api/v1/ag-ui/${agentId}/` : undefined;
|
|
108
123
|
const [recipe, setRecipe] = useState(DEFAULT_RECIPE);
|
|
109
124
|
// Handle state updates from AG-UI
|
|
110
125
|
const handleStateUpdate = useCallback((state) => {
|
|
@@ -169,7 +184,7 @@ const AgUiSharedStateExample = () => {
|
|
|
169
184
|
marginTop: 1,
|
|
170
185
|
fontSize: 1,
|
|
171
186
|
color: 'fg.muted',
|
|
172
|
-
}, children: [_jsx("li", { children: "\"Create a recipe for chocolate chip cookies\"" }), _jsx("li", { children: "\"Add butter and sugar to the ingredients\"" }), _jsx("li", { children: "\"Update the prep time to 20 minutes\"" }), _jsx("li", { children: "\"Suggest 3 more ingredients for my recipe\"" })] })] })] })] }), _jsx(ChatFloating, { protocol: "ag-ui", endpoint:
|
|
187
|
+
}, children: [_jsx("li", { children: "\"Create a recipe for chocolate chip cookies\"" }), _jsx("li", { children: "\"Add butter and sugar to the ingredients\"" }), _jsx("li", { children: "\"Update the prep time to 20 minutes\"" }), _jsx("li", { children: "\"Suggest 3 more ingredients for my recipe\"" })] })] })] })] }), sharedStateEndpoint && (_jsx(ChatFloating, { protocol: "ag-ui", endpoint: sharedStateEndpoint, title: "Recipe Assistant", description: "Let's build a recipe together! I can add ingredients, instructions, and more.", position: "bottom-right", brandColor: brandColor, onStateUpdate: handleStateUpdate, suggestions: [
|
|
173
188
|
{
|
|
174
189
|
title: 'Pasta recipe',
|
|
175
190
|
message: 'Help me create a simple pasta recipe.',
|
|
@@ -178,6 +193,6 @@ const AgUiSharedStateExample = () => {
|
|
|
178
193
|
title: 'Add ingredient',
|
|
179
194
|
message: 'Add tomatoes to the recipe.',
|
|
180
195
|
},
|
|
181
|
-
] })] }) }));
|
|
196
|
+
] }))] }) }));
|
|
182
197
|
};
|
|
183
198
|
export default AgUiSharedStateExample;
|
|
@@ -5,21 +5,8 @@
|
|
|
5
5
|
* that render UI components. Unlike frontend tools, these are backend
|
|
6
6
|
* tools that return structured data to be rendered on the frontend.
|
|
7
7
|
*
|
|
8
|
-
* Backend:
|
|
8
|
+
* Backend: managed AG-UI agent runtime (agentspec: example-agentic-generative-ui)
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
-
/**
|
|
12
|
-
* AgUiToolsBasedGenUiExample Component
|
|
13
|
-
*
|
|
14
|
-
* Demonstrates tool-based generative UI with AG-UI.
|
|
15
|
-
* The agent uses tools (create_plan, update_plan_step) that emit
|
|
16
|
-
* STATE_SNAPSHOT and STATE_DELTA events to update the UI.
|
|
17
|
-
*
|
|
18
|
-
* Features demonstrated:
|
|
19
|
-
* - STATE_SNAPSHOT events for full state updates
|
|
20
|
-
* - STATE_DELTA events with JSON Patch for incremental updates
|
|
21
|
-
* - Real-time UI updates as agent works
|
|
22
|
-
* - Interactive step selection with Confirm/Reject buttons
|
|
23
|
-
*/
|
|
24
11
|
declare const AgUiToolsBasedGenUiExample: React.FC;
|
|
25
12
|
export default AgUiToolsBasedGenUiExample;
|
|
@@ -10,16 +10,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
10
10
|
* that render UI components. Unlike frontend tools, these are backend
|
|
11
11
|
* tools that return structured data to be rendered on the frontend.
|
|
12
12
|
*
|
|
13
|
-
* Backend:
|
|
13
|
+
* Backend: managed AG-UI agent runtime (agentspec: example-agentic-generative-ui)
|
|
14
14
|
*/
|
|
15
|
-
import { useState, useCallback } from 'react';
|
|
15
|
+
import { useState, useCallback, useMemo } from 'react';
|
|
16
16
|
import { Text, ProgressBar, Button } from '@primer/react';
|
|
17
17
|
import { Box } from '@datalayer/primer-addons';
|
|
18
18
|
import { ThemedProvider, useThemeBrandColor } from './utils/themedProvider';
|
|
19
19
|
import { ChatFloating } from '../chat';
|
|
20
|
+
import { useExampleAgentRuntimesUrl } from './utils/useExampleAgentRuntimesUrl';
|
|
21
|
+
import { uniqueAgentId } from './utils/agentId';
|
|
22
|
+
import { useExampleAgentRuntime } from './hooks/useExampleAgentRuntime';
|
|
20
23
|
import { CheckCircleIcon, CircleIcon, DotFillIcon, CheckIcon, XIcon, } from '@primer/octicons-react';
|
|
21
|
-
// AG-UI endpoint for agentic generative UI example
|
|
22
|
-
const AGENTIC_GENERATIVE_UI_ENDPOINT = 'http://localhost:8765/api/v1/examples/agentic_generative_ui/';
|
|
23
24
|
/**
|
|
24
25
|
* PlanStepItem Component
|
|
25
26
|
* Renders a single plan step with status indicator and optional click handler
|
|
@@ -168,8 +169,22 @@ const PlanDisplay = ({ plan, isInteractive = true, onStepToggle, onConfirm, onRe
|
|
|
168
169
|
* - Real-time UI updates as agent works
|
|
169
170
|
* - Interactive step selection with Confirm/Reject buttons
|
|
170
171
|
*/
|
|
172
|
+
const AGENT_NAME = 'ag-ui-generative-ui';
|
|
173
|
+
const AGENTSPEC_ID = 'example-agentic-generative-ui';
|
|
171
174
|
const AgUiToolsBasedGenUiExample = () => {
|
|
172
175
|
const brandColor = useThemeBrandColor();
|
|
176
|
+
const baseUrl = useExampleAgentRuntimesUrl();
|
|
177
|
+
const agentName = useMemo(() => uniqueAgentId(AGENT_NAME), []);
|
|
178
|
+
const { agentId } = useExampleAgentRuntime({
|
|
179
|
+
exampleId: 'AgUiToolsBasedGenUiExample',
|
|
180
|
+
agentName,
|
|
181
|
+
specId: AGENTSPEC_ID,
|
|
182
|
+
agentConfig: {
|
|
183
|
+
protocol: 'ag-ui',
|
|
184
|
+
agentSpecId: AGENTSPEC_ID,
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
const agenticGenerativeUiEndpoint = agentId != null ? `${baseUrl}/api/v1/ag-ui/${agentId}/` : undefined;
|
|
173
188
|
const [plan, setPlan] = useState(null);
|
|
174
189
|
const [decision, setDecision] = useState(null);
|
|
175
190
|
// Handle state updates from AG-UI events
|
|
@@ -244,7 +259,7 @@ const AgUiToolsBasedGenUiExample = () => {
|
|
|
244
259
|
marginTop: 1,
|
|
245
260
|
fontSize: 1,
|
|
246
261
|
color: 'fg.muted',
|
|
247
|
-
}, children: [_jsx("li", { children: "STATE_SNAPSHOT - Full state replacement" }), _jsx("li", { children: "STATE_DELTA - Incremental JSON Patch updates (RFC 6902)" }), _jsx("li", { children: "TOOL_CALL_START / TOOL_CALL_END - Tool execution tracking" })] })] })] })] }), _jsx(ChatFloating, { protocol: "ag-ui", endpoint:
|
|
262
|
+
}, children: [_jsx("li", { children: "STATE_SNAPSHOT - Full state replacement" }), _jsx("li", { children: "STATE_DELTA - Incremental JSON Patch updates (RFC 6902)" }), _jsx("li", { children: "TOOL_CALL_START / TOOL_CALL_END - Tool execution tracking" })] })] })] })] }), agenticGenerativeUiEndpoint && (_jsx(ChatFloating, { protocol: "ag-ui", endpoint: agenticGenerativeUiEndpoint, title: "Plan Generator", description: "I can create detailed plans and update them in real-time.", position: "bottom-right", brandColor: brandColor, onStateUpdate: handleStateUpdate, suggestions: [
|
|
248
263
|
{
|
|
249
264
|
title: 'Project plan',
|
|
250
265
|
message: 'Create a project plan for building a mobile app.',
|
|
@@ -253,6 +268,6 @@ const AgUiToolsBasedGenUiExample = () => {
|
|
|
253
268
|
title: 'Marketing strategy',
|
|
254
269
|
message: 'Generate a marketing strategy for a new product launch.',
|
|
255
270
|
},
|
|
256
|
-
] })] }) }));
|
|
271
|
+
] }))] }) }));
|
|
257
272
|
};
|
|
258
273
|
export default AgUiToolsBasedGenUiExample;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* 3. Provides pause/resume/terminate lifecycle backed by CRIU
|
|
12
12
|
*
|
|
13
13
|
* Prerequisites:
|
|
14
|
-
* - Datalayer core configuration (
|
|
14
|
+
* - Datalayer core configuration (runtimesUrl, aiAgentsUrl)
|
|
15
15
|
* - Valid IAM token (set via SignInSimple or iamStore)
|
|
16
16
|
*/
|
|
17
17
|
import React from 'react';
|
|
@@ -16,7 +16,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
16
16
|
* 3. Provides pause/resume/terminate lifecycle backed by CRIU
|
|
17
17
|
*
|
|
18
18
|
* Prerequisites:
|
|
19
|
-
* - Datalayer core configuration (
|
|
19
|
+
* - Datalayer core configuration (runtimesUrl, aiAgentsUrl)
|
|
20
20
|
* - Valid IAM token (set via SignInSimple or iamStore)
|
|
21
21
|
*/
|
|
22
22
|
/// <reference types="vite/client" />
|
|
@@ -29,7 +29,7 @@ import { AuthRequiredView, ErrorView } from './components';
|
|
|
29
29
|
import { ThemedProvider } from './utils/themedProvider';
|
|
30
30
|
import { useSimpleAuthStore } from '@datalayer/core/lib/views/otel';
|
|
31
31
|
import { Chat } from '../chat';
|
|
32
|
-
import { useAgentRuntimes, useAgentRuntimesQuery, useRefreshAgentRuntimes,
|
|
32
|
+
import { useAgentsRuntimes, useAgentRuntimes, useAgentRuntimesQuery, useRefreshAgentRuntimes, } from '../hooks/useAgentRuntimes';
|
|
33
33
|
import { useAgentLifecycle } from '../hooks/useCheckpoints';
|
|
34
34
|
import { useDeletePausedAgentRuntime } from '../hooks/useCheckpoints';
|
|
35
35
|
import { AGENT_STATUS_COLORS } from '../types/agents';
|
|
@@ -106,10 +106,9 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
106
106
|
});
|
|
107
107
|
// Agent runtimes from the focused hook
|
|
108
108
|
const { data: agentRuntimes } = useAgentRuntimesQuery();
|
|
109
|
+
const { terminateRuntimeByPod } = useAgentsRuntimes();
|
|
109
110
|
const refetchRuntimes = useRefreshAgentRuntimes();
|
|
110
|
-
const deleteRuntimeMutation = useDeleteAgentRuntime();
|
|
111
111
|
const deletePausedRuntimeMutation = useDeletePausedAgentRuntime();
|
|
112
|
-
const deleteRuntimeByPod = deleteRuntimeMutation.mutateAsync;
|
|
113
112
|
const deletePausedRuntimeByPod = deletePausedRuntimeMutation.mutateAsync;
|
|
114
113
|
const [isStarting, setIsStarting] = useState(false);
|
|
115
114
|
const [sidebarOpen, setSidebarOpen] = useState(true);
|
|
@@ -246,7 +245,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
246
245
|
await deletePausedRuntimeByPod(agent.podName);
|
|
247
246
|
}
|
|
248
247
|
else {
|
|
249
|
-
await
|
|
248
|
+
await terminateRuntimeByPod(agent.podName);
|
|
250
249
|
}
|
|
251
250
|
// Ensure sidebar terminate resets to the home state like header terminate.
|
|
252
251
|
if (isCurrentRuntime || isLastKnownRuntime) {
|
|
@@ -262,7 +261,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
262
261
|
}
|
|
263
262
|
}, [
|
|
264
263
|
deletePausedRuntimeByPod,
|
|
265
|
-
|
|
264
|
+
terminateRuntimeByPod,
|
|
266
265
|
refreshAgents,
|
|
267
266
|
refreshCheckpoints,
|
|
268
267
|
runningAgents,
|
|
@@ -286,7 +285,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
286
285
|
}
|
|
287
286
|
// ── Running / Paused ─────────────────────────────────────────────────────
|
|
288
287
|
return (_jsxs(Box, { sx: {
|
|
289
|
-
height: '
|
|
288
|
+
height: '100%',
|
|
290
289
|
display: 'flex',
|
|
291
290
|
flexDirection: 'column',
|
|
292
291
|
}, children: [_jsxs(Box, { sx: {
|
|
@@ -436,7 +435,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
436
435
|
gap: 3,
|
|
437
436
|
px: 3,
|
|
438
437
|
}, children: [_jsx(AgentIcon, { size: 48 }), _jsx(Heading, { as: "h2", sx: { fontSize: 3 }, children: "Checkpoint Agent" }), _jsxs(Text, { sx: { color: 'fg.muted', textAlign: 'center', maxWidth: 560 }, children: ["Launch a cloud agent runtime with pause/resume checkpointing. The agent will be deployed from the", ' ', _jsx("strong", { children: AGENTSPEC_ID }), " spec."] }), displayError && (_jsx(Flash, { variant: "danger", sx: { maxWidth: 560, width: '100%' }, children: displayError })), _jsx(Button, { variant: "primary", size: "large", leadingVisual: PlayIcon, onClick: handleLaunch, children: "Launch Agent" })] })) : (isReady || runtimeStatus === 'resumed') &&
|
|
439
|
-
runtimeStatus !== 'paused' ? (_jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, title: "Monitor Sales KPI Agent", brandIcon: _jsx(AgentIcon, { size: 16 }), placeholder: "Ask about sales KPIs\u2026", description: "Monitor Sales KPI agent with pause/resume checkpointing", showHeader:
|
|
438
|
+
runtimeStatus !== 'paused' ? (_jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, title: "Monitor Sales KPI Agent", brandIcon: _jsx(AgentIcon, { size: 16 }), placeholder: "Ask about sales KPIs\u2026", description: "Monitor Sales KPI agent with pause/resume checkpointing", showHeader: true, showTokenUsage: true, autoFocus: true, height: "100%", runtimeId: podName, historyEndpoint: `${agentBaseUrl}/api/v1/history`, suggestions: [
|
|
440
439
|
{
|
|
441
440
|
title: 'KPIs',
|
|
442
441
|
message: "Show me today's sales KPI dashboard",
|
|
@@ -464,7 +463,7 @@ const AgentCheckpointsExample = () => {
|
|
|
464
463
|
useEffect(() => {
|
|
465
464
|
if (token && !hasSynced.current) {
|
|
466
465
|
hasSynced.current = true;
|
|
467
|
-
import('
|
|
466
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
468
467
|
iamStore.setState({ token });
|
|
469
468
|
});
|
|
470
469
|
}
|
|
@@ -474,7 +473,7 @@ const AgentCheckpointsExample = () => {
|
|
|
474
473
|
const handleLogout = useCallback(() => {
|
|
475
474
|
clearAuth();
|
|
476
475
|
hasSynced.current = false;
|
|
477
|
-
import('
|
|
476
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
478
477
|
iamStore.setState({ token: undefined });
|
|
479
478
|
});
|
|
480
479
|
}, [clearAuth]);
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
/// <reference types="vite/client" />
|
|
7
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
8
|
+
import { Box } from '@datalayer/primer-addons';
|
|
9
|
+
import { Button, Heading, Label, Spinner, Text } from '@primer/react';
|
|
10
|
+
import { PackageIcon } from '@primer/octicons-react';
|
|
11
|
+
import { useSimpleAuthStore } from '@datalayer/core/lib/views/otel';
|
|
12
|
+
import { ThemedProvider } from './utils/themedProvider';
|
|
13
|
+
import { AuthRequiredView, ErrorView } from './components';
|
|
14
|
+
import { uniqueAgentId } from './utils/agentId';
|
|
15
|
+
import { useExampleAgentRuntimesUrl } from './utils/useExampleAgentRuntimesUrl';
|
|
16
|
+
import { Chat } from '../chat';
|
|
17
|
+
const SANDBOX_SPEC_OPTIONS = [
|
|
18
|
+
{
|
|
19
|
+
variant: 'eval',
|
|
20
|
+
specId: 'example-sandbox-eval',
|
|
21
|
+
title: 'Eval Sandbox',
|
|
22
|
+
description: 'In-process Python execution for quick local iteration.',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
variant: 'jupyter',
|
|
26
|
+
specId: 'example-sandbox-jupyter',
|
|
27
|
+
title: 'Jupyter Sandbox',
|
|
28
|
+
description: 'Kernel-backed execution with notebook-compatible behavior.',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
variant: 'docker',
|
|
32
|
+
specId: 'example-sandbox-docker',
|
|
33
|
+
title: 'Docker Sandbox',
|
|
34
|
+
description: 'Containerized execution for stronger process isolation.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
variant: 'datalayer',
|
|
38
|
+
specId: 'example-sandbox-datalayer',
|
|
39
|
+
title: 'Datalayer Sandbox',
|
|
40
|
+
description: 'Cloud sandbox runtime powered by Datalayer environments.',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
variant: 'colab',
|
|
44
|
+
specId: 'example-sandbox-colab',
|
|
45
|
+
title: 'Colab Sandbox',
|
|
46
|
+
description: 'Google Colab runtime connector (reuse an already-running kernel).',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
variant: 'kaggle',
|
|
50
|
+
specId: 'example-sandbox-kaggle',
|
|
51
|
+
title: 'Kaggle Sandbox',
|
|
52
|
+
description: 'Kaggle runtime connector (create kernel with API token or attach existing).',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
variant: 'monty',
|
|
56
|
+
specId: 'example-sandbox-monty',
|
|
57
|
+
title: 'Monty Sandbox',
|
|
58
|
+
description: 'Secure in-process interpreter focused on safe snippets.',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
variant: 'modal',
|
|
62
|
+
specId: 'example-sandbox-modal',
|
|
63
|
+
title: 'Modal Sandbox',
|
|
64
|
+
description: 'Modal cloud sandbox for scalable remote code execution.',
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
const AgentCodeSandboxesInner = ({ onLogout, }) => {
|
|
68
|
+
const { token } = useSimpleAuthStore();
|
|
69
|
+
const baseUrl = useExampleAgentRuntimesUrl();
|
|
70
|
+
const [selectedSpecId, setSelectedSpecId] = useState(SANDBOX_SPEC_OPTIONS[0].specId);
|
|
71
|
+
const [agentId, setAgentId] = useState(null);
|
|
72
|
+
const [activeSpecId, setActiveSpecId] = useState(null);
|
|
73
|
+
const [isLaunching, setIsLaunching] = useState(false);
|
|
74
|
+
const [error, setError] = useState(null);
|
|
75
|
+
const selectedOption = useMemo(() => SANDBOX_SPEC_OPTIONS.find(option => option.specId === selectedSpecId) ??
|
|
76
|
+
SANDBOX_SPEC_OPTIONS[0], [selectedSpecId]);
|
|
77
|
+
const activeOption = useMemo(() => SANDBOX_SPEC_OPTIONS.find(option => option.specId === activeSpecId) ??
|
|
78
|
+
selectedOption, [activeSpecId, selectedOption]);
|
|
79
|
+
const authFetch = useCallback((url, opts = {}) => fetch(url, {
|
|
80
|
+
...opts,
|
|
81
|
+
headers: {
|
|
82
|
+
'Content-Type': 'application/json',
|
|
83
|
+
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
|
84
|
+
...(opts.headers ?? {}),
|
|
85
|
+
},
|
|
86
|
+
}), [token]);
|
|
87
|
+
const launchAgent = useCallback(async () => {
|
|
88
|
+
setIsLaunching(true);
|
|
89
|
+
setError(null);
|
|
90
|
+
try {
|
|
91
|
+
if (agentId) {
|
|
92
|
+
await authFetch(`${baseUrl}/api/v1/agents/${agentId}`, {
|
|
93
|
+
method: 'DELETE',
|
|
94
|
+
}).catch(() => {
|
|
95
|
+
// Ignore teardown errors while switching specs.
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const agentName = uniqueAgentId(`code-sandbox-${selectedOption.variant}`);
|
|
99
|
+
const response = await authFetch(`${baseUrl}/api/v1/agents`, {
|
|
100
|
+
method: 'POST',
|
|
101
|
+
body: JSON.stringify({
|
|
102
|
+
name: agentName,
|
|
103
|
+
description: `Code sandbox demo (${selectedOption.variant})`,
|
|
104
|
+
agent_library: 'pydantic-ai',
|
|
105
|
+
transport: 'vercel-ai',
|
|
106
|
+
agent_spec_id: selectedOption.specId,
|
|
107
|
+
enable_codemode: true,
|
|
108
|
+
enable_skills: true,
|
|
109
|
+
tools: [],
|
|
110
|
+
}),
|
|
111
|
+
});
|
|
112
|
+
if (!response.ok) {
|
|
113
|
+
const contentType = response.headers.get('content-type') || '';
|
|
114
|
+
let detail = '';
|
|
115
|
+
if (contentType.includes('application/json')) {
|
|
116
|
+
const payload = await response.json().catch(() => null);
|
|
117
|
+
detail =
|
|
118
|
+
(typeof payload?.detail === 'string' && payload.detail) ||
|
|
119
|
+
(typeof payload?.message === 'string' && payload.message) ||
|
|
120
|
+
'';
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
detail = await response.text().catch(() => '');
|
|
124
|
+
}
|
|
125
|
+
throw new Error(detail || `Failed to create agent (${response.status})`);
|
|
126
|
+
}
|
|
127
|
+
const payload = await response.json();
|
|
128
|
+
const createdAgentId = payload?.id || agentName;
|
|
129
|
+
setAgentId(createdAgentId);
|
|
130
|
+
setActiveSpecId(selectedOption.specId);
|
|
131
|
+
}
|
|
132
|
+
catch (e) {
|
|
133
|
+
setError(e instanceof Error ? e.message : 'Failed to launch agent');
|
|
134
|
+
}
|
|
135
|
+
finally {
|
|
136
|
+
setIsLaunching(false);
|
|
137
|
+
}
|
|
138
|
+
}, [agentId, authFetch, baseUrl, selectedOption]);
|
|
139
|
+
if (!agentId) {
|
|
140
|
+
return (_jsxs(Box, { sx: {
|
|
141
|
+
maxWidth: 840,
|
|
142
|
+
mx: 'auto',
|
|
143
|
+
mt: 6,
|
|
144
|
+
px: 3,
|
|
145
|
+
py: 3,
|
|
146
|
+
border: '1px solid',
|
|
147
|
+
borderColor: 'border.default',
|
|
148
|
+
borderRadius: 2,
|
|
149
|
+
display: 'flex',
|
|
150
|
+
flexDirection: 'column',
|
|
151
|
+
gap: 3,
|
|
152
|
+
bg: 'canvas.subtle',
|
|
153
|
+
}, children: [_jsx(Text, { sx: { fontSize: 0, fontWeight: 'bold', color: 'fg.muted' }, children: "SANDBOX VARIANT DEMO" }), _jsx(Heading, { as: "h2", sx: { fontSize: 3 }, children: "Agent Code Sandboxes" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Choose a sandbox variant-backed spec, launch the agent, then run code from chat to compare behavior across sandboxes." }), _jsxs(Box, { sx: { display: 'flex', gap: 2, flexWrap: 'wrap' }, children: [_jsxs(Label, { variant: "accent", children: ["Spec: ", selectedOption.specId] }), _jsxs(Label, { variant: "secondary", children: ["Variant: ", selectedOption.variant] }), _jsx(Label, { variant: "success", children: "Codemode: enabled" })] }), _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 600 }, children: "Sandbox Variant" }), _jsx("select", { value: selectedSpecId, onChange: event => {
|
|
154
|
+
setSelectedSpecId(event.target.value);
|
|
155
|
+
}, style: {
|
|
156
|
+
width: '100%',
|
|
157
|
+
maxWidth: 420,
|
|
158
|
+
padding: '8px 10px',
|
|
159
|
+
borderRadius: '6px',
|
|
160
|
+
border: '1px solid var(--borderColor-default)',
|
|
161
|
+
background: 'var(--bgColor-default)',
|
|
162
|
+
color: 'var(--fgColor-default)',
|
|
163
|
+
}, children: SANDBOX_SPEC_OPTIONS.map(option => (_jsxs("option", { value: option.specId, children: [option.title, " (", option.variant, ")"] }, option.specId))) }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: selectedOption.description })] }), _jsx(Button, { variant: "primary", onClick: () => {
|
|
164
|
+
void launchAgent();
|
|
165
|
+
}, disabled: isLaunching, sx: { width: '100%', maxWidth: 420 }, children: isLaunching ? (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "small" }), " Launching..."] })) : (`Launch ${selectedOption.title}`) }), error && _jsx(ErrorView, { error: error, onLogout: onLogout })] }));
|
|
166
|
+
}
|
|
167
|
+
return (_jsx(Chat, { protocol: "vercel-ai", baseUrl: baseUrl, agentId: agentId, runtimeId: agentId, title: `Code Sandboxes: ${activeOption.title}`, description: `Spec ${activeOption.specId} (${activeOption.variant})`, brandIcon: _jsx(PackageIcon, { size: 16 }), showHeader: true, showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, autoFocus: true, height: "100vh", historyEndpoint: `${baseUrl}/api/v1/history`, suggestions: [
|
|
168
|
+
{
|
|
169
|
+
title: 'Identify sandbox variant',
|
|
170
|
+
message: 'Use execute_code to print(os.getenv("DATALAYER_CODE_SANDBOX_VARIANT")) and summarize the result.',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
title: 'Run numeric workload',
|
|
174
|
+
message: 'Use execute_code to compute sum(i*i for i in range(10000)) and report timing and result.',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
title: 'Check package availability',
|
|
178
|
+
message: 'Use execute_code to import pandas and print(pandas.__version__).',
|
|
179
|
+
},
|
|
180
|
+
], submitOnSuggestionClick: true }));
|
|
181
|
+
};
|
|
182
|
+
const AgentCodeSandboxesExample = () => {
|
|
183
|
+
const { token, clearAuth } = useSimpleAuthStore();
|
|
184
|
+
const handleLogout = useCallback(() => {
|
|
185
|
+
clearAuth();
|
|
186
|
+
}, [clearAuth]);
|
|
187
|
+
if (!token) {
|
|
188
|
+
return _jsx(AuthRequiredView, {});
|
|
189
|
+
}
|
|
190
|
+
return (_jsx(ThemedProvider, { children: _jsx(AgentCodeSandboxesInner, { onLogout: handleLogout }) }));
|
|
191
|
+
};
|
|
192
|
+
export default AgentCodeSandboxesExample;
|
|
@@ -529,7 +529,7 @@ const AgentCodemodeInner = ({ onLogout, }) => {
|
|
|
529
529
|
return null;
|
|
530
530
|
}
|
|
531
531
|
return (_jsxs(Box, { sx: {
|
|
532
|
-
height: '
|
|
532
|
+
height: '100%',
|
|
533
533
|
display: 'flex',
|
|
534
534
|
flexDirection: 'column',
|
|
535
535
|
}, children: [_jsxs(Box, { sx: {
|
|
@@ -662,7 +662,7 @@ const AgentCodemodeInner = ({ onLogout, }) => {
|
|
|
662
662
|
})())] })] }));
|
|
663
663
|
};
|
|
664
664
|
const syncTokenToIamStore = (token) => {
|
|
665
|
-
import('
|
|
665
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
666
666
|
iamStore.setState({ token });
|
|
667
667
|
});
|
|
668
668
|
};
|
|
@@ -678,7 +678,7 @@ const AgentCodemodeExample = () => {
|
|
|
678
678
|
const handleLogout = useCallback(() => {
|
|
679
679
|
clearAuth();
|
|
680
680
|
hasSynced.current = false;
|
|
681
|
-
import('
|
|
681
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
682
682
|
iamStore.setState({ token: undefined });
|
|
683
683
|
});
|
|
684
684
|
}, [clearAuth]);
|
|
@@ -80,7 +80,7 @@ const AgentEvalsInner = ({ onLogout, executionTarget, onExecutionTargetChange })
|
|
|
80
80
|
const cloudRuntimeBaseUrl = useMemo(() => {
|
|
81
81
|
const envRuntimesUrl = normalizeHttpUrl(import.meta.env.VITE_DATALAYER_RUNTIMES_URL);
|
|
82
82
|
const envAgentRuntimesUrl = normalizeHttpUrl(import.meta.env.VITE_DATALAYER_AGENT_RUNTIMES_URL);
|
|
83
|
-
const configuredRuntimesUrl = normalizeHttpUrl(configuration?.
|
|
83
|
+
const configuredRuntimesUrl = normalizeHttpUrl(configuration?.runtimesUrl);
|
|
84
84
|
if (envRuntimesUrl && !isLocalhostUrl(envRuntimesUrl)) {
|
|
85
85
|
return envRuntimesUrl;
|
|
86
86
|
}
|
|
@@ -91,7 +91,7 @@ const AgentEvalsInner = ({ onLogout, executionTarget, onExecutionTargetChange })
|
|
|
91
91
|
return envAgentRuntimesUrl;
|
|
92
92
|
}
|
|
93
93
|
return 'https://r1.datalayer.run';
|
|
94
|
-
}, [configuration?.
|
|
94
|
+
}, [configuration?.runtimesUrl]);
|
|
95
95
|
const { runtime, status: runtimeStatus, isReady, error: hookError, runtimeCreationBaseUrl, } = useAgentRuntimes({
|
|
96
96
|
agentSpecId: AGENTSPEC_ID,
|
|
97
97
|
autoStart: executionTarget === 'cloud',
|
|
@@ -123,7 +123,7 @@ const AgentEvalsInner = ({ onLogout, executionTarget, onExecutionTargetChange })
|
|
|
123
123
|
? `local:${agentId}`
|
|
124
124
|
: runtime?.podName || '(launching…)';
|
|
125
125
|
const controlPlaneBaseUrl = import.meta.env.VITE_RUN_URL ||
|
|
126
|
-
configuration?.
|
|
126
|
+
configuration?.datalayerUrl ||
|
|
127
127
|
(cloudAgentBaseUrl ? new URL(cloudAgentBaseUrl).origin : '');
|
|
128
128
|
const isAgentReady = executionTarget === 'local' ? localStatus === 'ready' : isReady;
|
|
129
129
|
const agentStatus = executionTarget === 'local' ? localStatus : runtimeStatus;
|
|
@@ -466,7 +466,7 @@ const AgentEvalsInner = ({ onLogout, executionTarget, onExecutionTargetChange })
|
|
|
466
466
|
};
|
|
467
467
|
// ─── Sync token to core IAM store ──────────────────────────────────────────
|
|
468
468
|
const syncTokenToIamStore = (token) => {
|
|
469
|
-
import('
|
|
469
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
470
470
|
iamStore.setState({ token });
|
|
471
471
|
});
|
|
472
472
|
};
|
|
@@ -484,7 +484,7 @@ const AgentEvalsExample = () => {
|
|
|
484
484
|
const handleLogout = useCallback(() => {
|
|
485
485
|
clearAuth();
|
|
486
486
|
hasSynced.current = false;
|
|
487
|
-
import('
|
|
487
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
488
488
|
iamStore.setState({ token: undefined });
|
|
489
489
|
});
|
|
490
490
|
}, [clearAuth]);
|