@datalayer/agent-runtimes 1.0.9 → 1.0.17
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 +468 -40
- 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.d.ts +4 -4
- package/lib/client/AgentsMixin.js +35 -35
- 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/ToolApprovalCard.js +13 -3
- 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/config/AgentConfiguration.d.ts +2 -2
- package/lib/config/index.d.ts +1 -1
- 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 +21 -22
- package/lib/examples/AgentCodemodeExample.js +3 -3
- package/lib/examples/AgentEvalsExample.js +8 -8
- package/lib/examples/AgentGuardrailsExample.js +22 -17
- package/lib/examples/AgentHooksExample.js +16 -57
- package/lib/examples/AgentInferenceProviderExample.js +8 -8
- package/lib/examples/AgentLoopExample.d.ts +10 -0
- package/lib/examples/AgentLoopExample.js +304 -0
- package/lib/examples/AgentMCPExample.js +9 -9
- package/lib/examples/AgentMemoryExample.js +6 -6
- package/lib/examples/AgentMonitoringExample.js +116 -46
- package/lib/examples/AgentNotificationsExample.js +6 -6
- package/lib/examples/AgentOtelExample.d.ts +3 -3
- package/lib/examples/AgentOtelExample.js +20 -15
- package/lib/examples/AgentOutputsExample.js +8 -8
- package/lib/examples/AgentParametersExample.js +24 -36
- package/lib/examples/AgentSandboxExample.js +7 -7
- package/lib/examples/AgentSkillsExample.js +9 -9
- package/lib/examples/AgentSubagentsExample.js +6 -6
- package/lib/examples/AgentToolApprovalsExample.js +37 -11
- package/lib/examples/AgentTriggersExample.js +12 -12
- package/lib/examples/AgentspecsExample.js +63 -41
- package/lib/examples/ChatCustomExample.js +23 -77
- package/lib/examples/ChatExample.js +15 -46
- 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 +3 -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 +3 -1
- package/lib/examples/index.js +3 -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 +188 -29
- package/lib/hooks/useAgentsCatalog.d.ts +3 -3
- package/lib/hooks/useAgentsCatalog.js +4 -4
- 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 +38 -28
- 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 +14 -6
- package/lib/hooks/useToolApprovals.js +20 -1
- package/lib/index.d.ts +2 -1
- 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 +95 -50
- package/lib/specs/agents/agents.js +4037 -1669
- package/lib/specs/agents/index.d.ts +5 -5
- package/lib/specs/agents/index.js +9 -9
- 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 +6 -6
- package/lib/types/agentspecs.d.ts +8 -4
- 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/teams.d.ts +2 -2
- 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/generate_agents.py +96 -61
- package/scripts/codegen/generate_loops.py +443 -0
- package/scripts/codegen/generate_teams.py +4 -4
- package/lib/examples/A2UiComponentGalleryExample.d.ts +0 -3
- package/lib/examples/A2UiComponentGalleryExample.js +0 -361
- package/scripts/codegen/__pycache__/generate_agents.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_benchmarks.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_evals.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_events.cpython-313.pyc +0 -0
- /package/lib/{agent-lexical-main.d.ts → agent-document-main.d.ts} +0 -0
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
4
4
|
* Distributed under the terms of the Modified BSD License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { useMemo, useState } from 'react';
|
|
7
7
|
import { Box, setupPrimerPortals } from '@datalayer/primer-addons';
|
|
8
8
|
import { Button, Heading, Label, Spinner, Text } from '@primer/react';
|
|
9
9
|
import { FileIcon } from '@primer/octicons-react';
|
|
@@ -12,10 +12,11 @@ import { Form, yamlSchemaToJsonSchema } from '@datalayer/primer-rjsf';
|
|
|
12
12
|
import { ThemedProvider } from './utils/themedProvider';
|
|
13
13
|
import { uniqueAgentId } from './utils/agentId';
|
|
14
14
|
import { useExampleAgentRuntimesUrl } from './utils/useExampleAgentRuntimesUrl';
|
|
15
|
+
import { useExampleAgentRuntime } from './hooks/useExampleAgentRuntime';
|
|
15
16
|
import { ErrorView } from './components';
|
|
16
17
|
import { Chat } from '../chat';
|
|
17
18
|
setupPrimerPortals();
|
|
18
|
-
const
|
|
19
|
+
const AGENTSPEC_ID = 'example-parameters';
|
|
19
20
|
const AGENT_NAME = 'parameters-demo';
|
|
20
21
|
function isRecord(value) {
|
|
21
22
|
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
@@ -103,14 +104,24 @@ function hasRequiredValues(schema, formData) {
|
|
|
103
104
|
}
|
|
104
105
|
const AgentParametersExample = () => {
|
|
105
106
|
const baseUrl = useExampleAgentRuntimesUrl();
|
|
107
|
+
const [agentName] = useState(() => uniqueAgentId(AGENT_NAME));
|
|
106
108
|
const [showSchemaForm, setShowSchemaForm] = useState(false);
|
|
107
109
|
const [isSchemaLoading, setIsSchemaLoading] = useState(false);
|
|
108
110
|
const [schema, setSchema] = useState(null);
|
|
109
111
|
const [formData, setFormData] = useState({});
|
|
110
|
-
const [agentId, setAgentId] = useState(null);
|
|
111
112
|
const [isCreating, setIsCreating] = useState(false);
|
|
112
113
|
const [error, setError] = useState(null);
|
|
113
114
|
const [formTouched, setFormTouched] = useState(false);
|
|
115
|
+
const { agentId, error: runtimeError, createAgent, } = useExampleAgentRuntime({
|
|
116
|
+
exampleId: 'AgentParametersExample',
|
|
117
|
+
agentName,
|
|
118
|
+
specId: AGENTSPEC_ID,
|
|
119
|
+
autoCreateAgent: false,
|
|
120
|
+
agentConfig: {
|
|
121
|
+
protocol: 'vercel-ai',
|
|
122
|
+
agentSpecId: AGENTSPEC_ID,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
114
125
|
const hasRequired = useMemo(() => hasRequiredValues(schema, formData), [schema, formData]);
|
|
115
126
|
const canLaunch = useMemo(() => {
|
|
116
127
|
return showSchemaForm && schema !== null && !isSchemaLoading && hasRequired;
|
|
@@ -123,7 +134,7 @@ const AgentParametersExample = () => {
|
|
|
123
134
|
setIsSchemaLoading(true);
|
|
124
135
|
setError(null);
|
|
125
136
|
try {
|
|
126
|
-
const response = await fetch(`${baseUrl}/api/v1/agents/library/${
|
|
137
|
+
const response = await fetch(`${baseUrl}/api/v1/agents/library/${AGENTSPEC_ID}`);
|
|
127
138
|
if (!response.ok) {
|
|
128
139
|
throw new Error(`Failed to load schema: ${response.status}`);
|
|
129
140
|
}
|
|
@@ -148,25 +159,14 @@ const AgentParametersExample = () => {
|
|
|
148
159
|
setIsCreating(true);
|
|
149
160
|
setError(null);
|
|
150
161
|
try {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
name,
|
|
157
|
-
agent_spec_id: AGENT_SPEC_ID,
|
|
158
|
-
transport: 'vercel-ai',
|
|
162
|
+
await createAgent({
|
|
163
|
+
name: agentName,
|
|
164
|
+
protocol: 'vercel-ai',
|
|
165
|
+
agentSpecId: AGENTSPEC_ID,
|
|
166
|
+
createPayload: {
|
|
159
167
|
agent_parameters: formData,
|
|
160
|
-
}
|
|
168
|
+
},
|
|
161
169
|
});
|
|
162
|
-
if (!response.ok) {
|
|
163
|
-
const data = await response
|
|
164
|
-
.json()
|
|
165
|
-
.catch(() => ({ detail: 'Unknown error' }));
|
|
166
|
-
throw new Error(data.detail || `Failed to create agent: ${response.status}`);
|
|
167
|
-
}
|
|
168
|
-
const data = await response.json();
|
|
169
|
-
setAgentId(data.id);
|
|
170
170
|
}
|
|
171
171
|
catch (err) {
|
|
172
172
|
setError(err instanceof Error ? err.message : 'Failed to launch agent');
|
|
@@ -175,18 +175,7 @@ const AgentParametersExample = () => {
|
|
|
175
175
|
setIsCreating(false);
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
|
-
|
|
179
|
-
return () => {
|
|
180
|
-
if (!agentId) {
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
void fetch(`${baseUrl}/api/v1/agents/${encodeURIComponent(agentId)}`, {
|
|
184
|
-
method: 'DELETE',
|
|
185
|
-
}).catch(() => {
|
|
186
|
-
// Ignore teardown failures in example mode.
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
}, [agentId, baseUrl]);
|
|
178
|
+
const effectiveError = error || runtimeError;
|
|
190
179
|
if (!agentId) {
|
|
191
180
|
return (_jsx(ThemedProvider, { children: _jsxs(Box, { sx: {
|
|
192
181
|
maxWidth: 760,
|
|
@@ -206,7 +195,7 @@ const AgentParametersExample = () => {
|
|
|
206
195
|
alignItems: 'center',
|
|
207
196
|
gap: 2,
|
|
208
197
|
flexWrap: 'wrap',
|
|
209
|
-
}, children: [_jsxs(Label, { variant: "accent", children: ["Spec: ",
|
|
198
|
+
}, children: [_jsxs(Label, { variant: "accent", children: ["Spec: ", AGENTSPEC_ID] }), _jsx(Label, { variant: "secondary", children: "Transport: vercel-ai" })] }), _jsxs(Box, { sx: { display: 'flex', gap: 2, flexWrap: 'wrap' }, children: [_jsx(Button, { variant: "primary", size: "small", type: "button", onClick: loadSchemaForm, disabled: isSchemaLoading, children: isSchemaLoading ? (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "small" }), " Loading Schema..."] })) : ('Show Parameter Form') }), schema && (_jsx(Button, { variant: "invisible", size: "small", type: "button", onClick: () => {
|
|
210
199
|
setShowSchemaForm(v => !v);
|
|
211
200
|
}, children: showSchemaForm ? 'Hide Form' : 'Show Form' }))] }), schema && (_jsxs(Box, { sx: {
|
|
212
201
|
display: 'flex',
|
|
@@ -231,8 +220,7 @@ const AgentParametersExample = () => {
|
|
|
231
220
|
}, onSubmit: (_, event) => {
|
|
232
221
|
event?.preventDefault();
|
|
233
222
|
event?.stopPropagation();
|
|
234
|
-
|
|
235
|
-
}, noHtml5Validate: true }) })), _jsx(Button, { variant: "primary", size: "small", type: "button", onClick: launchAgent, disabled: !canLaunch || isCreating, sx: { width: '100%' }, children: isCreating ? (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "small" }), " Launching..."] })) : ('Launch Agent') }), schema && formTouched && (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Parameters are sent as agent_parameters in the create-agent request." })), error && _jsx(ErrorView, { error: "Launch failed", detail: error })] }) }));
|
|
223
|
+
}, noHtml5Validate: true }) })), _jsx(Button, { variant: "primary", size: "small", type: "button", onClick: launchAgent, disabled: !canLaunch || isCreating, sx: { width: '100%' }, children: isCreating ? (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "small" }), " Launching..."] })) : ('Launch Agent') }), schema && formTouched && (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Parameters are sent as agent_parameters in the create-agent request." })), effectiveError && (_jsx(ErrorView, { error: "Launch failed", detail: effectiveError }))] }) }));
|
|
236
224
|
}
|
|
237
225
|
return (_jsx(Chat, { protocol: "vercel-ai", baseUrl: baseUrl, agentId: agentId, title: `Parameterized Agent: ${String(formData.project ?? 'Project')}`, brandIcon: _jsx(FileIcon, { size: 16 }), placeholder: "Ask something about your configured project...", description: `Role: ${String(formData.role ?? 'n/a')} · Tone: ${String(formData.tone ?? 'n/a')}`, showHeader: true, showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, autoFocus: true, height: "100vh", runtimeId: agentId, historyEndpoint: `${baseUrl}/api/v1/history`, suggestions: [
|
|
238
226
|
{
|
|
@@ -27,13 +27,13 @@ import { CodeIcon, StopIcon, TerminalIcon } from '@primer/octicons-react';
|
|
|
27
27
|
import { useSimpleAuthStore } from '@datalayer/core/lib/views/otel';
|
|
28
28
|
import { ThemedProvider } from './utils/themedProvider';
|
|
29
29
|
import { uniqueAgentId } from './utils/agentId';
|
|
30
|
+
import { useExampleAgentRuntimesUrl } from './utils/useExampleAgentRuntimesUrl';
|
|
30
31
|
import { Chat } from '../chat';
|
|
31
32
|
import { SANDBOX_STATUS_COLORS, SANDBOX_STATUS_LABELS } from '../types/sandbox';
|
|
32
33
|
// ─── Constants ─────────────────────────────────────────────────────────────
|
|
33
34
|
const queryClient = new QueryClient();
|
|
34
35
|
const AGENT_NAME = 'sandbox-example-agent';
|
|
35
|
-
const
|
|
36
|
-
const DEFAULT_LOCAL_BASE_URL = import.meta.env.VITE_BASE_URL || 'http://localhost:8765';
|
|
36
|
+
const AGENTSPEC_ID = 'example-full';
|
|
37
37
|
let _logId = 0;
|
|
38
38
|
function tsNow() {
|
|
39
39
|
return new Date().toISOString().slice(11, 23); // HH:MM:SS.mmm
|
|
@@ -63,7 +63,7 @@ const AgentSandboxInner = ({ onLogout, }) => {
|
|
|
63
63
|
const { token } = useSimpleAuthStore();
|
|
64
64
|
const agentName = useRef(uniqueAgentId(AGENT_NAME)).current;
|
|
65
65
|
const chatAuthToken = token === null ? undefined : token;
|
|
66
|
-
const agentBaseUrl =
|
|
66
|
+
const agentBaseUrl = useExampleAgentRuntimesUrl();
|
|
67
67
|
// ── Agent lifecycle ──
|
|
68
68
|
const [runtimeStatus, setRuntimeStatus] = useState('launching');
|
|
69
69
|
const [isReady, setIsReady] = useState(false);
|
|
@@ -120,7 +120,7 @@ const AgentSandboxInner = ({ onLogout, }) => {
|
|
|
120
120
|
description: 'Agent with sandbox code execution',
|
|
121
121
|
agent_library: 'pydantic-ai',
|
|
122
122
|
transport: 'vercel-ai',
|
|
123
|
-
agent_spec_id:
|
|
123
|
+
agent_spec_id: AGENTSPEC_ID,
|
|
124
124
|
system_prompt: 'You are a helpful AI assistant with a Python execution sandbox. ' +
|
|
125
125
|
'When asked to run code, count, loop, assign variables, compute, or ' +
|
|
126
126
|
'perform any programming task, use the execute_code tool to run ' +
|
|
@@ -463,7 +463,7 @@ const AgentSandboxInner = ({ onLogout, }) => {
|
|
|
463
463
|
py: 1,
|
|
464
464
|
borderBottom: '1px solid',
|
|
465
465
|
borderColor: 'border.default',
|
|
466
|
-
}, children: _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: "Agent already running \u2014 reconnected." }) })), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsxs(Box, { sx: { position: 'relative', height: '100%' }, children: [_jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: "Sandbox Agent", brandIcon: _jsx(TerminalIcon, { size: 16 }), placeholder: "Ask the agent to write and run code\u2026", showHeader: true, showNewChatButton: true, showClearButton:
|
|
466
|
+
}, children: _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: "Agent already running \u2014 reconnected." }) })), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsxs(Box, { sx: { position: 'relative', height: '100%' }, children: [_jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: "Sandbox Agent", brandIcon: _jsx(TerminalIcon, { size: 16 }), placeholder: "Ask the agent to write and run code\u2026", showHeader: true, showNewChatButton: true, showClearButton: true, showTokenUsage: true, autoFocus: true, height: "100%", runtimeId: agentId, historyEndpoint: `${agentBaseUrl}/api/v1/history`, headerActions: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsxs(SegmentedControl, { "aria-label": "Sandbox variant", size: "small", onChange: index => {
|
|
467
467
|
if (isTransitionLocked)
|
|
468
468
|
return;
|
|
469
469
|
void switchVariant(index === 0 ? 'eval' : 'jupyter');
|
|
@@ -491,7 +491,7 @@ const AgentSandboxInner = ({ onLogout, }) => {
|
|
|
491
491
|
};
|
|
492
492
|
// ─── Auth wrapper ──────────────────────────────────────────────────────────
|
|
493
493
|
const syncTokenToIamStore = (newToken) => {
|
|
494
|
-
import('
|
|
494
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
495
495
|
iamStore.setState({ token: newToken });
|
|
496
496
|
});
|
|
497
497
|
};
|
|
@@ -507,7 +507,7 @@ const AgentSandboxExample = () => {
|
|
|
507
507
|
const handleLogout = useCallback(() => {
|
|
508
508
|
clearAuth();
|
|
509
509
|
hasSynced.current = false;
|
|
510
|
-
import('
|
|
510
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
511
511
|
iamStore.setState({ token: undefined });
|
|
512
512
|
});
|
|
513
513
|
}, [clearAuth]);
|
|
@@ -13,12 +13,12 @@ import { BriefcaseIcon, FileIcon } from '@primer/octicons-react';
|
|
|
13
13
|
import { useSimpleAuthStore } from '@datalayer/core/lib/views/otel';
|
|
14
14
|
import { ThemedProvider } from './utils/themedProvider';
|
|
15
15
|
import { uniqueAgentId } from './utils/agentId';
|
|
16
|
+
import { useExampleAgentRuntimesUrl } from './utils/useExampleAgentRuntimesUrl';
|
|
16
17
|
import { Chat } from '../chat';
|
|
17
18
|
import { useSkills, useSkillActions } from '../hooks';
|
|
18
19
|
const queryClient = new QueryClient();
|
|
19
20
|
const AGENT_NAME = 'skills-example-agent';
|
|
20
|
-
const
|
|
21
|
-
const DEFAULT_LOCAL_BASE_URL = import.meta.env.VITE_BASE_URL || 'http://localhost:8765';
|
|
21
|
+
const AGENTSPEC_ID = 'example-skills';
|
|
22
22
|
const SkillCard = ({ skill, onToggle, onToggleApproval }) => {
|
|
23
23
|
const [showDefinition, setShowDefinition] = useState(false);
|
|
24
24
|
const sourceVariant = skill.source_variant ?? 'unknown';
|
|
@@ -68,7 +68,7 @@ const AgentSkillsInner = ({ onLogout }) => {
|
|
|
68
68
|
const [hookError, setHookError] = useState(null);
|
|
69
69
|
const [agentId, setAgentId] = useState(agentName);
|
|
70
70
|
const [isReconnectedAgent, setIsReconnectedAgent] = useState(false);
|
|
71
|
-
const agentBaseUrl =
|
|
71
|
+
const agentBaseUrl = useExampleAgentRuntimesUrl();
|
|
72
72
|
const chatAuthToken = token === null ? undefined : token;
|
|
73
73
|
// WS-sourced skills (reads from codemodeStatus pushed via monitoring WS)
|
|
74
74
|
const skillsQuery = useSkills(isReady);
|
|
@@ -120,7 +120,7 @@ const AgentSkillsInner = ({ onLogout }) => {
|
|
|
120
120
|
description: 'Agent with skills example - module, package and file based skills',
|
|
121
121
|
agent_library: 'pydantic-ai',
|
|
122
122
|
transport: 'vercel-ai',
|
|
123
|
-
agent_spec_id:
|
|
123
|
+
agent_spec_id: AGENTSPEC_ID,
|
|
124
124
|
enable_skills: true,
|
|
125
125
|
tools: [],
|
|
126
126
|
}),
|
|
@@ -176,7 +176,7 @@ const AgentSkillsInner = ({ onLogout }) => {
|
|
|
176
176
|
flexDirection: 'column',
|
|
177
177
|
alignItems: 'center',
|
|
178
178
|
justifyContent: 'center',
|
|
179
|
-
height: '
|
|
179
|
+
height: '100%',
|
|
180
180
|
gap: 3,
|
|
181
181
|
}, children: [_jsx(Spinner, { size: "large" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "Launching skills example agent..." })] }));
|
|
182
182
|
}
|
|
@@ -184,7 +184,7 @@ const AgentSkillsInner = ({ onLogout }) => {
|
|
|
184
184
|
return _jsx(ErrorView, { error: hookError, onLogout: onLogout });
|
|
185
185
|
}
|
|
186
186
|
return (_jsxs(Box, { sx: {
|
|
187
|
-
height: '
|
|
187
|
+
height: '100%',
|
|
188
188
|
display: 'flex',
|
|
189
189
|
flexDirection: 'column',
|
|
190
190
|
}, children: [isReconnectedAgent && (_jsx(Box, { sx: {
|
|
@@ -192,7 +192,7 @@ const AgentSkillsInner = ({ onLogout }) => {
|
|
|
192
192
|
py: 1,
|
|
193
193
|
borderBottom: '1px solid',
|
|
194
194
|
borderColor: 'border.default',
|
|
195
|
-
}, children: _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: "Agent already running - reconnected." }) })), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: `Skills Demo Agent`, brandIcon: _jsx(BriefcaseIcon, { size: 16 }), placeholder: "Ask the agent to use its skills...", showHeader: true, showNewChatButton: true, showClearButton:
|
|
195
|
+
}, children: _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: "Agent already running - reconnected." }) })), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: `Skills Demo Agent`, brandIcon: _jsx(BriefcaseIcon, { size: 16 }), placeholder: "Ask the agent to use its skills...", showHeader: true, showNewChatButton: true, showClearButton: true, showTokenUsage: true, showSkillsMenu: true, autoFocus: true, height: "100%", runtimeId: agentId, historyEndpoint: `${agentBaseUrl}/api/v1/history`, headerActions: _jsx(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: _jsxs(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: ["Skills: ", skills.length] }) }), suggestions: [
|
|
196
196
|
{
|
|
197
197
|
title: 'List available skills',
|
|
198
198
|
message: 'List all your available skills and what they can do.',
|
|
@@ -248,7 +248,7 @@ const AgentSkillsInner = ({ onLogout }) => {
|
|
|
248
248
|
}, children: [_jsx(Heading, { as: "h5", sx: { fontSize: 0, mb: 1 }, children: "Skill Statuses" }), _jsxs(Box, { sx: { fontSize: 0, color: 'fg.muted' }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, mb: 1 }, children: [_jsx(Label, { size: "small", variant: "secondary", children: "available" }), _jsx(Text, { children: "In catalog, not yet enabled" })] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, mb: 1 }, children: [_jsx(Label, { size: "small", variant: "attention", children: "enabled" }), _jsx(Text, { children: "Enabled, loading pending" })] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1 }, children: [_jsx(Label, { size: "small", variant: "success", children: "loaded" }), _jsx(Text, { children: "SKILL.md loaded, in system prompt" })] })] })] })] })] })] })] }));
|
|
249
249
|
};
|
|
250
250
|
const syncTokenToIamStore = (token) => {
|
|
251
|
-
import('
|
|
251
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
252
252
|
iamStore.setState({ token });
|
|
253
253
|
});
|
|
254
254
|
};
|
|
@@ -264,7 +264,7 @@ const AgentSkillsExample = () => {
|
|
|
264
264
|
const handleLogout = useCallback(() => {
|
|
265
265
|
clearAuth();
|
|
266
266
|
hasSynced.current = false;
|
|
267
|
-
import('
|
|
267
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
268
268
|
iamStore.setState({ token: undefined });
|
|
269
269
|
});
|
|
270
270
|
}, [clearAuth]);
|
|
@@ -24,9 +24,9 @@ import { ThemedProvider } from './utils/themedProvider';
|
|
|
24
24
|
import { uniqueAgentId } from './utils/agentId';
|
|
25
25
|
import { useSimpleAuthStore } from '@datalayer/core/lib/views/otel';
|
|
26
26
|
import { Chat } from '../chat';
|
|
27
|
+
import { useExampleAgentRuntimesUrl } from './utils/useExampleAgentRuntimesUrl';
|
|
27
28
|
const AGENT_NAME = 'subagents-example-agent';
|
|
28
|
-
const
|
|
29
|
-
const DEFAULT_LOCAL_BASE_URL = import.meta.env.VITE_BASE_URL || 'http://localhost:8765';
|
|
29
|
+
const AGENTSPEC_ID = 'example-subagents';
|
|
30
30
|
const SUBAGENTS = [
|
|
31
31
|
{
|
|
32
32
|
name: 'researcher',
|
|
@@ -51,7 +51,7 @@ const AgentSubagentsInner = ({ onLogout, }) => {
|
|
|
51
51
|
const [hookError, setHookError] = useState(null);
|
|
52
52
|
const [agentId, setAgentId] = useState(agentName);
|
|
53
53
|
const [isReconnectedAgent, setIsReconnectedAgent] = useState(false);
|
|
54
|
-
const agentBaseUrl =
|
|
54
|
+
const agentBaseUrl = useExampleAgentRuntimesUrl();
|
|
55
55
|
const chatAuthToken = token === null ? undefined : token;
|
|
56
56
|
const authFetch = useCallback((url, opts = {}) => fetch(url, {
|
|
57
57
|
...opts,
|
|
@@ -76,7 +76,7 @@ const AgentSubagentsInner = ({ onLogout, }) => {
|
|
|
76
76
|
description: 'Subagents example – multi-agent delegation with researcher and writer',
|
|
77
77
|
agent_library: 'pydantic-ai',
|
|
78
78
|
transport: 'vercel-ai',
|
|
79
|
-
agent_spec_id:
|
|
79
|
+
agent_spec_id: AGENTSPEC_ID,
|
|
80
80
|
enable_skills: true,
|
|
81
81
|
tools: [],
|
|
82
82
|
}),
|
|
@@ -132,7 +132,7 @@ const AgentSubagentsInner = ({ onLogout, }) => {
|
|
|
132
132
|
flexDirection: 'column',
|
|
133
133
|
alignItems: 'center',
|
|
134
134
|
justifyContent: 'center',
|
|
135
|
-
height: '
|
|
135
|
+
height: '100%',
|
|
136
136
|
gap: 3,
|
|
137
137
|
}, children: [_jsx(Spinner, { size: "large" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "Launching subagents example agent..." })] }));
|
|
138
138
|
}
|
|
@@ -140,7 +140,7 @@ const AgentSubagentsInner = ({ onLogout, }) => {
|
|
|
140
140
|
return _jsx(ErrorView, { error: hookError, onLogout: onLogout });
|
|
141
141
|
}
|
|
142
142
|
return (_jsxs(Box, { sx: {
|
|
143
|
-
height: '
|
|
143
|
+
height: '100%',
|
|
144
144
|
display: 'flex',
|
|
145
145
|
flexDirection: 'column',
|
|
146
146
|
}, children: [_jsxs(Box, { sx: {
|
|
@@ -13,13 +13,13 @@ import { CheckCircleIcon } from '@primer/octicons-react';
|
|
|
13
13
|
import { useSimpleAuthStore } from '@datalayer/core/lib/views/otel';
|
|
14
14
|
import { ThemedProvider } from './utils/themedProvider';
|
|
15
15
|
import { uniqueAgentId } from './utils/agentId';
|
|
16
|
+
import { useExampleAgentRuntimesUrl } from './utils/useExampleAgentRuntimesUrl';
|
|
16
17
|
import { Chat } from '../chat';
|
|
17
18
|
import { useAgentRuntimeApprovals } from '../stores/agentRuntimeStore';
|
|
18
19
|
const queryClient = new QueryClient();
|
|
19
20
|
const AGENT_NAME_PREFIX = 'tool-approval-example-agent';
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const getSelectedAgentSpecIdFromUi = () => {
|
|
21
|
+
const DEFAULT_AGENTSPEC_ID = 'example-tool-approvals';
|
|
22
|
+
const getSelectedAgentspecIdFromUi = () => {
|
|
23
23
|
const params = new URLSearchParams(window.location.search);
|
|
24
24
|
const directKeys = [
|
|
25
25
|
'agent_spec_id',
|
|
@@ -41,7 +41,7 @@ const getSelectedAgentSpecIdFromUi = () => {
|
|
|
41
41
|
return specId;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
return
|
|
44
|
+
return DEFAULT_AGENTSPEC_ID;
|
|
45
45
|
};
|
|
46
46
|
const buildAgentNameForSpec = (specId) => {
|
|
47
47
|
const slug = specId
|
|
@@ -52,22 +52,34 @@ const buildAgentNameForSpec = (specId) => {
|
|
|
52
52
|
const base = slug ? `${AGENT_NAME_PREFIX}-${slug}` : AGENT_NAME_PREFIX;
|
|
53
53
|
return uniqueAgentId(base);
|
|
54
54
|
};
|
|
55
|
+
const parseDisableToolApprovalsFromUi = () => {
|
|
56
|
+
const params = new URLSearchParams(window.location.search);
|
|
57
|
+
const raw = params.get('disable_tool_approvals') ??
|
|
58
|
+
params.get('disableToolApprovals') ??
|
|
59
|
+
'';
|
|
60
|
+
const normalized = raw.trim().toLowerCase();
|
|
61
|
+
return ['1', 'true', 'yes', 'on'].includes(normalized);
|
|
62
|
+
};
|
|
55
63
|
const AgentToolApprovalsInner = ({ onLogout, }) => {
|
|
56
64
|
const { token } = useSimpleAuthStore();
|
|
57
|
-
const [selectedSpecId] = useState(() =>
|
|
58
|
-
const
|
|
65
|
+
const [selectedSpecId] = useState(() => getSelectedAgentspecIdFromUi());
|
|
66
|
+
const [disableToolApprovals, setDisableToolApprovals] = useState(() => parseDisableToolApprovalsFromUi());
|
|
67
|
+
const agentName = useMemo(() => buildAgentNameForSpec(`${selectedSpecId}-${disableToolApprovals ? 'no-approvals' : 'approvals'}`), [selectedSpecId, disableToolApprovals]);
|
|
59
68
|
const [runtimeStatus, setRuntimeStatus] = useState('launching');
|
|
60
69
|
const [isReady, setIsReady] = useState(false);
|
|
61
70
|
const [hookError, setHookError] = useState(null);
|
|
62
71
|
const [agentId, setAgentId] = useState(agentName);
|
|
63
72
|
const [isReconnectedAgent, setIsReconnectedAgent] = useState(false);
|
|
64
73
|
const chatAuthToken = token === null ? undefined : token;
|
|
65
|
-
const agentBaseUrl =
|
|
74
|
+
const agentBaseUrl = useExampleAgentRuntimesUrl();
|
|
66
75
|
const podName = 'localhost';
|
|
67
76
|
const approvals = useAgentRuntimeApprovals();
|
|
68
77
|
const pendingApprovalCount = useMemo(() => approvals.filter(approval => approval.status === 'pending' &&
|
|
69
78
|
(!agentId || approval.agent_id === agentId)).length, [approvals, agentId]);
|
|
70
79
|
const createAttemptedRef = useRef(false);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
createAttemptedRef.current = false;
|
|
82
|
+
}, [agentName]);
|
|
71
83
|
const authFetch = useCallback((url, opts = {}) => fetch(url, {
|
|
72
84
|
...opts,
|
|
73
85
|
headers: {
|
|
@@ -99,6 +111,7 @@ const AgentToolApprovalsInner = ({ onLogout, }) => {
|
|
|
99
111
|
enable_skills: false,
|
|
100
112
|
skills: [],
|
|
101
113
|
tools: ['runtime-echo', 'runtime-sensitive-echo'],
|
|
114
|
+
disableToolApprovals: disableToolApprovals,
|
|
102
115
|
}),
|
|
103
116
|
});
|
|
104
117
|
let resolvedAgentId = agentName;
|
|
@@ -145,7 +158,13 @@ const AgentToolApprovalsInner = ({ onLogout, }) => {
|
|
|
145
158
|
return () => {
|
|
146
159
|
isCancelled = true;
|
|
147
160
|
};
|
|
148
|
-
}, [
|
|
161
|
+
}, [
|
|
162
|
+
agentBaseUrl,
|
|
163
|
+
authFetch,
|
|
164
|
+
agentName,
|
|
165
|
+
disableToolApprovals,
|
|
166
|
+
selectedSpecId,
|
|
167
|
+
]);
|
|
149
168
|
if (!isReady && runtimeStatus !== 'error') {
|
|
150
169
|
return (_jsxs(Box, { sx: {
|
|
151
170
|
display: 'flex',
|
|
@@ -169,7 +188,14 @@ const AgentToolApprovalsInner = ({ onLogout, }) => {
|
|
|
169
188
|
py: 1,
|
|
170
189
|
borderBottom: '1px solid',
|
|
171
190
|
borderColor: 'border.default',
|
|
172
|
-
}, children: _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: "Agent already running - reconnected." }) })), _jsx(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: _jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: `Tool Approval Agent - ${podName}`, brandIcon: _jsx(CheckCircleIcon, { size: 16 }), placeholder: "Ask for actions that require approval...", showHeader: true, showNewChatButton: true, showClearButton:
|
|
191
|
+
}, children: _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: "Agent already running - reconnected." }) })), _jsx(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: _jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: `Tool Approval Agent - ${podName}`, brandIcon: _jsx(CheckCircleIcon, { size: 16 }), placeholder: "Ask for actions that require approval...", showHeader: true, showNewChatButton: true, showClearButton: true, showTokenUsage: true, autoFocus: true, height: "100%", runtimeId: agentId, historyEndpoint: `${agentBaseUrl}/api/v1/history`, headerActions: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsxs(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: ["Pending: ", pendingApprovalCount] }), _jsxs("label", { style: {
|
|
192
|
+
display: 'flex',
|
|
193
|
+
alignItems: 'center',
|
|
194
|
+
gap: 6,
|
|
195
|
+
color: 'var(--fgColor-muted)',
|
|
196
|
+
fontSize: 12,
|
|
197
|
+
cursor: 'pointer',
|
|
198
|
+
}, children: [_jsx("input", { type: "checkbox", checked: disableToolApprovals, onChange: event => setDisableToolApprovals(event.currentTarget.checked) }), "Disable tool approvals"] })] }), suggestions: [
|
|
173
199
|
{
|
|
174
200
|
title: 'List your tools',
|
|
175
201
|
message: 'list your tools',
|
|
@@ -197,7 +223,7 @@ const AgentToolApprovalsInner = ({ onLogout, }) => {
|
|
|
197
223
|
], submitOnSuggestionClick: true }) }) })] }));
|
|
198
224
|
};
|
|
199
225
|
const syncTokenToIamStore = (token) => {
|
|
200
|
-
import('
|
|
226
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
201
227
|
iamStore.setState({ token });
|
|
202
228
|
});
|
|
203
229
|
};
|
|
@@ -213,7 +239,7 @@ const AgentToolApprovalsExample = () => {
|
|
|
213
239
|
const handleLogout = useCallback(() => {
|
|
214
240
|
clearAuth();
|
|
215
241
|
hasSynced.current = false;
|
|
216
|
-
import('
|
|
242
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
217
243
|
iamStore.setState({ token: undefined });
|
|
218
244
|
});
|
|
219
245
|
}, [clearAuth]);
|
|
@@ -25,6 +25,7 @@ import { ThemedProvider } from './utils/themedProvider';
|
|
|
25
25
|
import { uniqueAgentId } from './utils/agentId';
|
|
26
26
|
import { useSimpleAuthStore } from '@datalayer/core/lib/views/otel';
|
|
27
27
|
import { Chat } from '../chat';
|
|
28
|
+
import { useExampleAgentRuntimesUrl } from './utils/useExampleAgentRuntimesUrl';
|
|
28
29
|
import { useConnectedIdentities } from '../identity';
|
|
29
30
|
import { ToolApprovalBanner, ToolApprovalDialog, } from '../chat/tools';
|
|
30
31
|
import { useAgentEvents, useDeleteAgentEvent, useMarkEventRead, useMarkEventUnread, useAIAgentsWebSocket, } from '../hooks';
|
|
@@ -33,12 +34,11 @@ import { createUserMessage } from '../types/messages';
|
|
|
33
34
|
const queryClient = new QueryClient();
|
|
34
35
|
// ─── Constants ─────────────────────────────────────────────────────────────
|
|
35
36
|
const AGENT_NAME = 'trigger-example-agent';
|
|
36
|
-
const
|
|
37
|
-
const APPROVAL_AGENT_NAME = 'trigger-approval-
|
|
38
|
-
const
|
|
37
|
+
const AGENTSPEC_ID = 'example-one-trigger';
|
|
38
|
+
const APPROVAL_AGENT_NAME = 'trigger-approval-agent';
|
|
39
|
+
const APPROVAL_AGENTSPEC_ID = 'example-tool-approvals';
|
|
39
40
|
const ONCE_TRIGGER_PROMPT = "List the user's top 3 public and top 3 private GitHub repositories, ranked by recent activity, and provide a brief summary of each. Execute exactly two tool calls: run_skill_script(skill_name='github', script_name='list_repos', kwargs={visibility:'public', sort:'updated', limit:3, format:'json'}) and run_skill_script(skill_name='github', script_name='list_repos', kwargs={visibility:'private', sort:'updated', limit:3, format:'json'}). Do not call list_skills/load_skill/read_skill_resource. Do not retry. If a tool call fails, report failure_reason/error/stderr exactly as returned.";
|
|
40
41
|
const ONCE_TRIGGER_APPROVAL_PROMPT = 'Use the runtime_sensitive_echo tool once.';
|
|
41
|
-
const DEFAULT_LOCAL_BASE_URL = import.meta.env.VITE_BASE_URL || 'http://localhost:8765';
|
|
42
42
|
const DEFAULT_CRON = '0 8 * * *'; // daily at 08:00 UTC
|
|
43
43
|
// ─── Inner component (rendered after auth) ─────────────────────────────────
|
|
44
44
|
const AgentTriggerInner = ({ onLogout, }) => {
|
|
@@ -58,7 +58,7 @@ const AgentTriggerInner = ({ onLogout, }) => {
|
|
|
58
58
|
const [isReady, setIsReady] = useState(false);
|
|
59
59
|
const [hookError, setHookError] = useState(null);
|
|
60
60
|
const [agentId, setAgentId] = useState(agentName);
|
|
61
|
-
const agentBaseUrl =
|
|
61
|
+
const agentBaseUrl = useExampleAgentRuntimesUrl();
|
|
62
62
|
const chatAuthToken = token === null ? undefined : token;
|
|
63
63
|
// Cron state
|
|
64
64
|
const [cronExpr, setCronExpr] = useState(DEFAULT_CRON);
|
|
@@ -232,7 +232,7 @@ const AgentTriggerInner = ({ onLogout, }) => {
|
|
|
232
232
|
description: 'Agent with cron, webhook, event, and manual triggers',
|
|
233
233
|
agent_library: 'pydantic-ai',
|
|
234
234
|
transport: 'vercel-ai',
|
|
235
|
-
agent_spec_id:
|
|
235
|
+
agent_spec_id: AGENTSPEC_ID,
|
|
236
236
|
}),
|
|
237
237
|
});
|
|
238
238
|
let resolvedAgentId = agentName;
|
|
@@ -390,7 +390,7 @@ const AgentTriggerInner = ({ onLogout, }) => {
|
|
|
390
390
|
description: 'Agent with once trigger and tool approval',
|
|
391
391
|
agent_library: 'pydantic-ai',
|
|
392
392
|
transport: 'vercel-ai',
|
|
393
|
-
agent_spec_id:
|
|
393
|
+
agent_spec_id: APPROVAL_AGENTSPEC_ID,
|
|
394
394
|
enable_codemode: false,
|
|
395
395
|
}),
|
|
396
396
|
});
|
|
@@ -807,7 +807,7 @@ const AgentTriggerInner = ({ onLogout, }) => {
|
|
|
807
807
|
flexDirection: 'column',
|
|
808
808
|
alignItems: 'center',
|
|
809
809
|
justifyContent: 'center',
|
|
810
|
-
height: '
|
|
810
|
+
height: '100%',
|
|
811
811
|
gap: 3,
|
|
812
812
|
}, children: [_jsx(Spinner, { size: "large" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "Launching runtime for trigger agent..." })] }));
|
|
813
813
|
}
|
|
@@ -822,7 +822,7 @@ const AgentTriggerInner = ({ onLogout, }) => {
|
|
|
822
822
|
padding: 0,
|
|
823
823
|
minWidth: 0,
|
|
824
824
|
}, children: _jsxs(Box, { sx: {
|
|
825
|
-
height: '
|
|
825
|
+
height: '100%',
|
|
826
826
|
display: 'flex',
|
|
827
827
|
flexDirection: 'column',
|
|
828
828
|
}, children: [_jsxs(Box, { sx: {
|
|
@@ -855,7 +855,7 @@ const AgentTriggerInner = ({ onLogout, }) => {
|
|
|
855
855
|
setActiveApproval(null);
|
|
856
856
|
}
|
|
857
857
|
}
|
|
858
|
-
}, onClose: () => setActiveApproval(null) }), approvalError && (_jsx(Box, { sx: { px: 3, py: 1 }, children: _jsx(Text, { sx: { color: 'danger.fg', fontSize: 0 }, children: approvalError }) })), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: isReady ? (_jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: "Trigger Agent", brandIcon: _jsx(ZapIcon, { size: 16 }), description: `View-only trigger output. Cron: ${cronExpr} | Webhook: ${webhookEnabled ? 'on' : 'off'} | Event: ${eventSubscribed ? eventTopic : 'none'}`, showHeader: true, autoFocus: false, height: "100%", runtimeId: agentId, showInput: true, disableInputPrompt: true, showModelSelector:
|
|
858
|
+
}, onClose: () => setActiveApproval(null) }), approvalError && (_jsx(Box, { sx: { px: 3, py: 1 }, children: _jsx(Text, { sx: { color: 'danger.fg', fontSize: 0 }, children: approvalError }) })), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: isReady ? (_jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: "Trigger Agent", brandIcon: _jsx(ZapIcon, { size: 16 }), description: `View-only trigger output. Cron: ${cronExpr} | Webhook: ${webhookEnabled ? 'on' : 'off'} | Event: ${eventSubscribed ? eventTopic : 'none'}`, showHeader: true, autoFocus: false, height: "100%", runtimeId: agentId, showInput: true, disableInputPrompt: true, showModelSelector: true, showToolsMenu: true, showSkillsMenu: true })) : (_jsx(Box, { sx: {
|
|
859
859
|
height: '100%',
|
|
860
860
|
display: 'flex',
|
|
861
861
|
alignItems: 'center',
|
|
@@ -1315,7 +1315,7 @@ const AgentTriggerInner = ({ onLogout, }) => {
|
|
|
1315
1315
|
};
|
|
1316
1316
|
// ─── Sync token to core IAM store ──────────────────────────────────────────
|
|
1317
1317
|
const syncTokenToIamStore = (token) => {
|
|
1318
|
-
import('
|
|
1318
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
1319
1319
|
iamStore.setState({ token });
|
|
1320
1320
|
});
|
|
1321
1321
|
};
|
|
@@ -1332,7 +1332,7 @@ const AgentTriggersExample = () => {
|
|
|
1332
1332
|
const handleLogout = useCallback(() => {
|
|
1333
1333
|
clearAuth();
|
|
1334
1334
|
hasSynced.current = false;
|
|
1335
|
-
import('
|
|
1335
|
+
import('../state/substates').then(({ iamStore }) => {
|
|
1336
1336
|
iamStore.setState({ token: undefined });
|
|
1337
1337
|
});
|
|
1338
1338
|
}, [clearAuth]);
|