@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
|
@@ -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,14 +29,14 @@ 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';
|
|
36
36
|
const queryClient = new QueryClient();
|
|
37
37
|
// ─── Defaults ──────────────────────────────────────────────────────────────
|
|
38
|
-
const
|
|
39
|
-
const DEMO_AGENT_NAME =
|
|
38
|
+
const AGENTSPEC_ID = 'monitor-sales-kpis';
|
|
39
|
+
const DEMO_AGENT_NAME = AGENTSPEC_ID;
|
|
40
40
|
const LIGHT_CHECKPOINT_MESSAGES = [
|
|
41
41
|
'[Checkpoint] Captured message history snapshot',
|
|
42
42
|
'[Checkpoint] Saved conversational context for lightweight resume',
|
|
@@ -45,7 +45,7 @@ const LIGHT_CHECKPOINT_MESSAGES = [
|
|
|
45
45
|
* Agent spec attributes displayed in the sidebar.
|
|
46
46
|
* In production this would be fetched from the agentspecs service.
|
|
47
47
|
*/
|
|
48
|
-
const
|
|
48
|
+
const AGENTSPEC = {
|
|
49
49
|
id: 'monitor-sales-kpis',
|
|
50
50
|
name: 'Monitor Sales KPIs',
|
|
51
51
|
description: 'Monitor and analyze sales KPIs from the CRM system. Generate daily reports, identify trends, and flag anomalies.',
|
|
@@ -86,9 +86,9 @@ const SpecRow = ({ icon: Icon, label, value }) => (_jsxs(Box, { sx: {
|
|
|
86
86
|
// ─── Inner component (rendered after auth) ─────────────────────────────────
|
|
87
87
|
const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
88
88
|
const { runtime, status: runtimeStatus, endpoint: _agentEndpoint, isReady, error: hookError, launchRuntime, connectToRuntime, disconnect, } = useAgentRuntimes({
|
|
89
|
-
agentSpecId:
|
|
89
|
+
agentSpecId: AGENTSPEC_ID,
|
|
90
90
|
autoStart: false,
|
|
91
|
-
agentSpec:
|
|
91
|
+
agentSpec: AGENTSPEC,
|
|
92
92
|
agentConfig: {
|
|
93
93
|
name: DEMO_AGENT_NAME,
|
|
94
94
|
model: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
@@ -97,8 +97,8 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
97
97
|
},
|
|
98
98
|
});
|
|
99
99
|
const { pause, resume, terminate, refreshCheckpoints, checkpoints } = useAgentLifecycle({
|
|
100
|
-
agentSpecId:
|
|
101
|
-
agentSpec:
|
|
100
|
+
agentSpecId: AGENTSPEC_ID,
|
|
101
|
+
agentSpec: AGENTSPEC,
|
|
102
102
|
runtime,
|
|
103
103
|
connectToRuntime,
|
|
104
104
|
disconnect,
|
|
@@ -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);
|
|
@@ -120,7 +119,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
120
119
|
const autoConnectAttemptRef = useRef(null);
|
|
121
120
|
const displayError = hookError || actionError;
|
|
122
121
|
const podName = runtime?.podName || '(launching…)';
|
|
123
|
-
const agentId = runtime?.agentId ||
|
|
122
|
+
const agentId = runtime?.agentId || AGENTSPEC_ID;
|
|
124
123
|
const agentBaseUrl = runtime?.agentBaseUrl || '';
|
|
125
124
|
const handleLaunch = useCallback(async () => {
|
|
126
125
|
setIsStarting(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: {
|
|
@@ -319,7 +318,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
319
318
|
p: 3,
|
|
320
319
|
borderBottom: '1px solid',
|
|
321
320
|
borderColor: 'border.default',
|
|
322
|
-
}, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2, mb: 2 }, children: [_jsx(Text, { sx: { fontSize: '20px' }, children:
|
|
321
|
+
}, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2, mb: 2 }, children: [_jsx(Text, { sx: { fontSize: '20px' }, children: AGENTSPEC.emoji }), _jsx(Heading, { as: "h4", sx: { fontSize: 2, m: 0 }, children: AGENTSPEC.name })] }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', display: 'block', mb: 3 }, children: AGENTSPEC.description }), _jsx(SpecRow, { icon: AiModelIcon, label: "Model", value: AGENTSPEC.model }), _jsx(SpecRow, { icon: GlobeIcon, label: "Protocol", value: AGENTSPEC.protocol }), _jsx(SpecRow, { icon: ZapIcon, label: "Memory", value: AGENTSPEC.memory }), _jsx(SpecRow, { icon: GraphIcon, label: "Environment", value: AGENTSPEC.environment_name }), _jsx(SpecRow, { icon: ClockIcon, label: "Trigger", value: AGENTSPEC.trigger.description }), _jsx(SpecRow, { icon: TagIcon, label: "Tags", value: AGENTSPEC.tags.join(', ') }), _jsxs(Box, { sx: {
|
|
323
322
|
mt: 2,
|
|
324
323
|
pt: 2,
|
|
325
324
|
borderTop: '1px solid',
|
|
@@ -329,7 +328,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
329
328
|
fontSize: 0,
|
|
330
329
|
display: 'block',
|
|
331
330
|
mb: 1,
|
|
332
|
-
}, children: "Advanced" }), _jsx(SpecRow, { label: "Cost limit", value:
|
|
331
|
+
}, children: "Advanced" }), _jsx(SpecRow, { label: "Cost limit", value: AGENTSPEC.advanced.cost_limit }), _jsx(SpecRow, { label: "Time limit", value: AGENTSPEC.advanced.time_limit }), _jsx(SpecRow, { label: "Max iterations", value: String(AGENTSPEC.advanced.max_iterations) }), _jsx(SpecRow, { label: "Checkpoint interval", value: `${AGENTSPEC.advanced.checkpoint_interval}s` }), _jsx(SpecRow, { label: "Temperature", value: String(AGENTSPEC.model_config.temperature) }), _jsx(SpecRow, { label: "Max tokens", value: String(AGENTSPEC.model_config.max_tokens) })] })] }), _jsxs(Box, { sx: {
|
|
333
332
|
order: 2,
|
|
334
333
|
p: 3,
|
|
335
334
|
borderBottom: '1px solid',
|
|
@@ -426,7 +425,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
426
425
|
height: '100%',
|
|
427
426
|
gap: 3,
|
|
428
427
|
}, children: [_jsx(Spinner, { size: "large" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: runtimeStatus === 'launching'
|
|
429
|
-
? `Launching runtime for ${
|
|
428
|
+
? `Launching runtime for ${AGENTSPEC_ID}…`
|
|
430
429
|
: 'Creating agent on runtime…' })] })) : showNoAgentRunningView ? (_jsxs(Box, { sx: {
|
|
431
430
|
display: 'flex',
|
|
432
431
|
flexDirection: 'column',
|
|
@@ -435,8 +434,8 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
435
434
|
height: '100%',
|
|
436
435
|
gap: 3,
|
|
437
436
|
px: 3,
|
|
438
|
-
}, 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:
|
|
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:
|
|
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') &&
|
|
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]);
|
|
@@ -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]);
|
|
@@ -31,7 +31,7 @@ import { useAgentRuntimes } from '../hooks/useAgentRuntimes';
|
|
|
31
31
|
const queryClient = new QueryClient();
|
|
32
32
|
// ─── Constants ─────────────────────────────────────────────────────────────
|
|
33
33
|
const AGENT_NAME = 'eval-example-agent';
|
|
34
|
-
const
|
|
34
|
+
const AGENTSPEC_ID = 'example-evals';
|
|
35
35
|
const DEFAULT_EXECUTION_TARGET = (import.meta.env.VITE_AGENT_EVALS_TARGET || 'cloud').toLowerCase() === 'local'
|
|
36
36
|
? 'local'
|
|
37
37
|
: 'cloud';
|
|
@@ -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,9 +91,9 @@ 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
|
-
agentSpecId:
|
|
96
|
+
agentSpecId: AGENTSPEC_ID,
|
|
97
97
|
autoStart: executionTarget === 'cloud',
|
|
98
98
|
runtimeCreationTarget: executionTarget === 'local' ? 'local-agent-runtimes' : 'backend-services',
|
|
99
99
|
runtimeCreationBaseUrl: executionTarget === 'local' ? localRuntimeBaseUrl : cloudRuntimeBaseUrl,
|
|
@@ -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;
|
|
@@ -182,7 +182,7 @@ const AgentEvalsInner = ({ onLogout, executionTarget, onExecutionTargetChange })
|
|
|
182
182
|
description: 'Agent with evaluation and quality scoring',
|
|
183
183
|
agent_library: 'pydantic-ai',
|
|
184
184
|
transport: 'vercel-ai',
|
|
185
|
-
agent_spec_id:
|
|
185
|
+
agent_spec_id: AGENTSPEC_ID,
|
|
186
186
|
enable_skills: true,
|
|
187
187
|
tools: [],
|
|
188
188
|
}),
|
|
@@ -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]);
|