@datalayer/agent-runtimes 1.0.10 → 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 +429 -39
- package/lib/chat/display/EmptyState.js +21 -21
- package/lib/chat/document/EphemeralDocument.d.ts +23 -0
- package/lib/chat/document/EphemeralDocument.js +270 -0
- package/lib/chat/header/ChatHeaderBase.d.ts +12 -2
- package/lib/chat/header/ChatHeaderBase.js +78 -23
- package/lib/chat/index.d.ts +1 -0
- package/lib/chat/index.js +2 -0
- package/lib/chat/notebook/EphemeralNotebook.d.ts +24 -0
- package/lib/chat/notebook/EphemeralNotebook.js +252 -0
- package/lib/chat/prompt/InputFooter.js +4 -1
- package/lib/client/AgentRuntimesClient.d.ts +127 -0
- package/lib/client/AgentRuntimesClient.js +36 -0
- package/lib/client/AgentsMixin.js +28 -28
- package/lib/client/SdkAgentRuntimesClient.d.ts +1 -1
- package/lib/client/SdkAgentRuntimesClient.js +1 -1
- package/lib/client/mixins/RuntimesMixin.d.ts +93 -0
- package/lib/client/mixins/RuntimesMixin.js +229 -0
- package/lib/client/mixins/SpacerMixin.d.ts +210 -0
- package/lib/client/mixins/SpacerMixin.js +615 -0
- package/lib/client/utils/spacerUtils.d.ts +18 -0
- package/lib/client/utils/spacerUtils.js +32 -0
- package/lib/collaboration/DatalayerCollaboration.d.ts +13 -0
- package/lib/collaboration/DatalayerCollaboration.js +28 -0
- package/lib/collaboration/DatalayerCollaborationProvider.d.ts +58 -0
- package/lib/collaboration/DatalayerCollaborationProvider.js +148 -0
- package/lib/collaboration/index.d.ts +2 -0
- package/lib/collaboration/index.js +6 -0
- package/lib/components/AgentSummary.d.ts +19 -0
- package/lib/components/AgentSummary.js +89 -0
- package/lib/components/a2ui/A2uiSurfaceComposed.d.ts +13 -0
- package/lib/components/a2ui/A2uiSurfaceComposed.js +110 -0
- package/lib/components/a2ui/index.d.ts +2 -0
- package/lib/components/a2ui/index.js +6 -0
- package/lib/components/a2ui/styles.d.ts +14 -0
- package/lib/components/a2ui/styles.js +142 -0
- package/lib/components/context/SpaceSelect.d.ts +2 -0
- package/lib/components/context/SpaceSelect.js +42 -0
- package/lib/components/flashes/FlashDisclaimer.d.ts +2 -0
- package/lib/components/flashes/FlashDisclaimer.js +17 -0
- package/lib/components/icons/ArtifactIcon.d.ts +10 -0
- package/lib/components/icons/ArtifactIcon.js +58 -0
- package/lib/components/icons/index.d.ts +1 -0
- package/lib/components/icons/index.js +5 -0
- package/lib/components/index.d.ts +5 -0
- package/lib/components/index.js +5 -0
- package/lib/components/nbgrader/NbGradesDetails.d.ts +5 -0
- package/lib/components/nbgrader/NbGradesDetails.js +19 -0
- package/lib/components/nbgrader/index.d.ts +1 -0
- package/lib/components/nbgrader/index.js +5 -0
- package/lib/components/progress/CreditsIndicator.d.ts +33 -0
- package/lib/components/progress/CreditsIndicator.js +23 -0
- package/lib/components/progress/index.d.ts +2 -0
- package/lib/components/progress/index.js +6 -0
- package/lib/components/runtimes/RuntimeCellVariables.d.ts +39 -0
- package/lib/components/runtimes/RuntimeCellVariables.js +172 -0
- package/lib/components/runtimes/RuntimeCellVariablesDialog.d.ts +37 -0
- package/lib/components/runtimes/RuntimeCellVariablesDialog.js +101 -0
- package/lib/components/runtimes/RuntimeLauncherDialog.d.ts +57 -0
- package/lib/components/runtimes/RuntimeLauncherDialog.js +275 -0
- package/lib/components/runtimes/RuntimePickerBase.d.ts +69 -0
- package/lib/components/runtimes/RuntimePickerBase.js +122 -0
- package/lib/components/runtimes/RuntimePickerCell.d.ts +34 -0
- package/lib/components/runtimes/RuntimePickerCell.js +104 -0
- package/lib/components/runtimes/RuntimePickerNotebook.d.ts +42 -0
- package/lib/components/runtimes/RuntimePickerNotebook.js +232 -0
- package/lib/components/runtimes/RuntimeReservationControl.d.ts +47 -0
- package/lib/components/runtimes/RuntimeReservationControl.js +42 -0
- package/lib/components/runtimes/RuntimeSimplePicker.d.ts +38 -0
- package/lib/components/runtimes/RuntimeSimplePicker.js +155 -0
- package/lib/components/runtimes/RuntimeTransfer.d.ts +16 -0
- package/lib/components/runtimes/RuntimeTransfer.js +5 -0
- package/lib/components/runtimes/RuntimeUtils.d.ts +17 -0
- package/lib/components/runtimes/RuntimeUtils.js +178 -0
- package/lib/components/runtimes/RuntimeVariables.d.ts +38 -0
- package/lib/components/runtimes/RuntimeVariables.js +75 -0
- package/lib/components/runtimes/index.d.ts +11 -0
- package/lib/components/runtimes/index.js +15 -0
- package/lib/components/scheduler/ScheduleMenu.d.ts +54 -0
- package/lib/components/scheduler/ScheduleMenu.js +154 -0
- package/lib/components/scheduler/index.d.ts +1 -0
- package/lib/components/scheduler/index.js +5 -0
- package/lib/components/snapshots/SandboxSnapshotMenu.d.ts +33 -0
- package/lib/components/snapshots/SandboxSnapshotMenu.js +169 -0
- package/lib/components/snapshots/index.d.ts +1 -0
- package/lib/components/snapshots/index.js +5 -0
- package/lib/components/snippets/SnippetDialog.d.ts +42 -0
- package/lib/components/snippets/SnippetDialog.js +42 -0
- package/lib/components/students/StudentItemStatus.d.ts +7 -0
- package/lib/components/students/StudentItemStatus.js +68 -0
- package/lib/components/students/index.d.ts +1 -0
- package/lib/components/students/index.js +5 -0
- package/lib/components/tokens/SpaceVariantToken.d.ts +5 -0
- package/lib/components/tokens/SpaceVariantToken.js +23 -0
- package/lib/components/tokens/index.d.ts +1 -0
- package/lib/components/tokens/index.js +5 -0
- package/lib/components/toolbars/AssignmentEditorToolbar.d.ts +4 -0
- package/lib/components/toolbars/AssignmentEditorToolbar.js +18 -0
- package/lib/components/toolbars/DocumentEditorToolbar.d.ts +2 -0
- package/lib/components/toolbars/DocumentEditorToolbar.js +12 -0
- package/lib/components/toolbars/NotebookEditorToolbar.d.ts +29 -0
- package/lib/components/toolbars/NotebookEditorToolbar.js +30 -0
- package/lib/context/ContextInspector.d.ts +1 -14
- package/lib/context/ContextInspector.js +3 -73
- package/lib/context/CostUsageChart.d.ts +4 -3
- package/lib/context/CostUsageChart.js +236 -35
- package/lib/context/MessageHistory.d.ts +30 -0
- package/lib/context/MessageHistory.js +129 -0
- package/lib/context/TokenUsageChart.d.ts +4 -3
- package/lib/context/TokenUsageChart.js +180 -30
- package/lib/context/TurnGraphChart.d.ts +1 -1
- package/lib/context/TurnGraphChart.js +6 -6
- package/lib/examples/A2UiAgentExample.d.ts +22 -0
- package/lib/examples/A2UiAgentExample.js +442 -0
- package/lib/examples/A2UiComponentsGalleryExample.d.ts +3 -0
- package/lib/examples/A2UiComponentsGalleryExample.js +863 -0
- package/lib/examples/A2UiContactCardExample.js +9 -5
- package/lib/examples/A2UiRestaurantExample.js +23 -8
- package/lib/examples/A2UiViewerExample.js +75 -3
- package/lib/examples/AgUiAgenticExample.d.ts +1 -12
- package/lib/examples/AgUiAgenticExample.js +52 -8
- package/lib/examples/AgUiBackendToolRenderingExample.d.ts +1 -16
- package/lib/examples/AgUiBackendToolRenderingExample.js +32 -17
- package/lib/examples/AgUiHaikuGenUiExample.d.ts +1 -17
- package/lib/examples/AgUiHaikuGenUiExample.js +49 -33
- package/lib/examples/AgUiHumanInTheLoopExample.d.ts +1 -12
- package/lib/examples/AgUiHumanInTheLoopExample.js +21 -6
- package/lib/examples/AgUiSharedStateExample.d.ts +1 -14
- package/lib/examples/AgUiSharedStateExample.js +21 -6
- package/lib/examples/AgUiToolsBasedGenUiExample.d.ts +1 -14
- package/lib/examples/AgUiToolsBasedGenUiExample.js +21 -6
- package/lib/examples/AgentCheckpointsExample.d.ts +1 -1
- package/lib/examples/AgentCheckpointsExample.js +9 -10
- package/lib/examples/AgentCodemodeExample.js +3 -3
- package/lib/examples/AgentEvalsExample.js +5 -5
- package/lib/examples/AgentGuardrailsExample.js +17 -12
- package/lib/examples/AgentHooksExample.js +14 -55
- package/lib/examples/AgentInferenceProviderExample.js +4 -4
- package/lib/examples/AgentLoopExample.d.ts +10 -0
- package/lib/examples/AgentLoopExample.js +304 -0
- package/lib/examples/AgentMCPExample.js +7 -7
- package/lib/examples/AgentMemoryExample.js +4 -4
- package/lib/examples/AgentMonitoringExample.js +114 -44
- package/lib/examples/AgentNotificationsExample.js +4 -4
- package/lib/examples/AgentOtelExample.d.ts +3 -3
- package/lib/examples/AgentOtelExample.js +15 -10
- package/lib/examples/AgentOutputsExample.js +6 -6
- package/lib/examples/AgentParametersExample.js +21 -33
- package/lib/examples/AgentSandboxExample.js +5 -5
- package/lib/examples/AgentSkillsExample.js +7 -7
- package/lib/examples/AgentSubagentsExample.js +4 -4
- package/lib/examples/AgentToolApprovalsExample.js +5 -5
- package/lib/examples/AgentTriggersExample.js +9 -9
- package/lib/examples/AgentspecsExample.js +63 -41
- package/lib/examples/ChatCustomExample.js +23 -77
- package/lib/examples/ChatExample.js +13 -44
- package/lib/examples/LexicalAgentExample.js +43 -91
- package/lib/examples/LexicalAgentSidebarExample.js +45 -73
- package/lib/examples/NotebookAgentExample.js +52 -81
- package/lib/examples/NotebookAgentSidebarExample.js +43 -71
- package/lib/examples/NotebookCollaborationExample.js +11 -9
- package/lib/examples/NotebookExample.js +5 -2
- package/lib/examples/components/AuthRequiredView.js +1 -1
- package/lib/examples/components/ExampleErrorBoundary.d.ts +46 -0
- package/lib/examples/components/ExampleErrorBoundary.js +67 -0
- package/lib/examples/components/haiku/haiku-card.css +11 -0
- package/lib/examples/components/weather/weather-card.css +11 -0
- package/lib/examples/example-selector.js +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 +186 -27
- package/lib/hooks/useAgentsService.js +5 -5
- package/lib/hooks/useCellOutputshot.d.ts +4 -0
- package/lib/hooks/useCellOutputshot.js +25 -0
- package/lib/hooks/useCheckpoints.d.ts +8 -8
- package/lib/hooks/useCheckpoints.js +36 -26
- package/lib/hooks/useConfig.d.ts +1 -1
- package/lib/hooks/useMonitoring.d.ts +7 -5
- package/lib/hooks/useMonitoring.js +16 -10
- package/lib/hooks/useNotifications.d.ts +11 -11
- package/lib/hooks/useNotifications.js +1 -1
- package/lib/hooks/useProgressStore.d.ts +25 -0
- package/lib/hooks/useProgressStore.js +58 -0
- package/lib/hooks/useProgressTask.d.ts +9 -0
- package/lib/hooks/useProgressTask.js +41 -0
- package/lib/hooks/useProjects.d.ts +628 -0
- package/lib/hooks/useProjects.js +190 -0
- package/lib/hooks/useRuntimes.d.ts +5 -0
- package/lib/hooks/useRuntimes.js +34 -0
- package/lib/hooks/useToolApprovals.d.ts +6 -6
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/jupyter/exec/Python.d.ts +5 -0
- package/lib/jupyter/exec/Python.js +100 -0
- package/lib/jupyter/exec/Snippets.d.ts +105 -0
- package/lib/jupyter/exec/Snippets.js +101 -0
- package/lib/jupyter/exec/index.d.ts +2 -0
- package/lib/jupyter/exec/index.js +6 -0
- package/lib/jupyter/index.d.ts +2 -0
- package/lib/jupyter/index.js +6 -0
- package/lib/jupyter/kernelsHandler.d.ts +8 -0
- package/lib/jupyter/kernelsHandler.js +39 -0
- package/lib/mocks/models/CourseMock.d.ts +6 -0
- package/lib/mocks/models/CourseMock.js +29 -0
- package/lib/mocks/models/SpaceMock.d.ts +6 -0
- package/lib/mocks/models/SpaceMock.js +25 -0
- package/lib/models/Assignment.d.ts +7 -0
- package/lib/models/Assignment.js +5 -0
- package/lib/models/Cell.d.ts +8 -0
- package/lib/models/Cell.js +5 -0
- package/lib/models/CodeBlock.d.ts +10 -0
- package/lib/models/CodeBlock.js +5 -0
- package/lib/models/CodeSandboxSnapshot.d.ts +92 -0
- package/lib/models/CodeSandboxSnapshot.js +13 -0
- package/lib/models/CodeSandboxSnapshotDTO.d.ts +173 -0
- package/lib/models/CodeSandboxSnapshotDTO.js +139 -0
- package/lib/models/CodefeedBlocks.d.ts +7 -0
- package/lib/models/CodefeedBlocks.js +5 -0
- package/lib/models/Content.d.ts +5 -0
- package/lib/models/Content.js +5 -0
- package/lib/models/Course.d.ts +17 -0
- package/lib/models/Course.js +5 -0
- package/lib/models/Dataset.d.ts +16 -0
- package/lib/models/Dataset.js +5 -0
- package/lib/models/Document.d.ts +8 -0
- package/lib/models/Document.js +5 -0
- package/lib/models/Environment.d.ts +86 -0
- package/lib/models/Environment.js +5 -0
- package/lib/models/EnvironmentDTO.d.ts +125 -0
- package/lib/models/EnvironmentDTO.js +88 -0
- package/lib/models/Exercise.d.ts +16 -0
- package/lib/models/Exercise.js +5 -0
- package/lib/models/Item.d.ts +20 -0
- package/lib/models/Item.js +5 -0
- package/lib/models/ItemDTO.d.ts +74 -0
- package/lib/models/ItemDTO.js +186 -0
- package/lib/models/ItemType.d.ts +2 -0
- package/lib/models/ItemType.js +5 -0
- package/lib/models/Lesson.d.ts +5 -0
- package/lib/models/Lesson.js +5 -0
- package/lib/models/LexicalDTO.d.ts +155 -0
- package/lib/models/LexicalDTO.js +157 -0
- package/lib/models/Library.d.ts +10 -0
- package/lib/models/Library.js +5 -0
- package/lib/models/Notebook.d.ts +11 -0
- package/lib/models/Notebook.js +5 -0
- package/lib/models/NotebookDTO.d.ts +96 -0
- package/lib/models/NotebookDTO.js +153 -0
- package/lib/models/Page.d.ts +41 -0
- package/lib/models/Page.js +25 -0
- package/lib/models/PageTag.d.ts +19 -0
- package/lib/models/PageTag.js +94 -0
- package/lib/models/ProjectDTO.d.ts +89 -0
- package/lib/models/ProjectDTO.js +131 -0
- package/lib/models/Runtime.d.ts +160 -0
- package/lib/models/Runtime.js +18 -0
- package/lib/models/RuntimeDTO.d.ts +172 -0
- package/lib/models/RuntimeDTO.js +204 -0
- package/lib/models/Space.d.ts +35 -0
- package/lib/models/Space.js +66 -0
- package/lib/models/SpaceDTO.d.ts +334 -0
- package/lib/models/SpaceDTO.js +244 -0
- package/lib/models/SpaceItem.d.ts +10 -0
- package/lib/models/SpaceItem.js +5 -0
- package/lib/models/SpaceMember.d.ts +6 -0
- package/lib/models/SpaceMember.js +5 -0
- package/lib/models/StudentItem.d.ts +21 -0
- package/lib/models/StudentItem.js +5 -0
- package/lib/models/index.d.ts +32 -0
- package/lib/models/index.js +39 -0
- package/lib/protocols/AGUIAdapter.js +1 -1
- package/lib/runtimes/actions.d.ts +102 -0
- package/lib/runtimes/actions.js +249 -0
- package/lib/runtimes/apis.d.ts +273 -0
- package/lib/runtimes/apis.js +5 -0
- package/lib/runtimes/index.d.ts +5 -0
- package/lib/runtimes/index.js +9 -0
- package/lib/runtimes/settings.d.ts +15 -0
- package/lib/runtimes/settings.js +31 -0
- package/lib/runtimes/snapshots.d.ts +25 -0
- package/lib/runtimes/snapshots.js +150 -0
- package/lib/runtimes/utils.d.ts +7 -0
- package/lib/runtimes/utils.js +14 -0
- package/lib/services/DatalayerServiceManager.d.ts +23 -0
- package/lib/services/DatalayerServiceManager.js +90 -0
- package/lib/services/reconnectToRuntime.d.ts +32 -0
- package/lib/services/reconnectToRuntime.js +59 -0
- package/lib/services/sandboxServiceManagers.d.ts +31 -0
- package/lib/services/sandboxServiceManagers.js +57 -0
- package/lib/specs/agents/agents.d.ts +70 -26
- package/lib/specs/agents/agents.js +3994 -1639
- package/lib/specs/index.d.ts +1 -0
- package/lib/specs/index.js +1 -0
- package/lib/specs/loops.d.ts +34 -0
- package/lib/specs/loops.js +188 -0
- package/lib/specs/mcpServers.d.ts +1 -0
- package/lib/specs/mcpServers.js +17 -0
- package/lib/specs/models.d.ts +4 -0
- package/lib/specs/models.js +30 -0
- package/lib/specs/skills.d.ts +1 -0
- package/lib/specs/skills.js +18 -0
- package/lib/specs/tools.d.ts +15 -0
- package/lib/specs/tools.js +285 -0
- package/lib/state/index.d.ts +4 -0
- package/lib/state/index.js +10 -0
- package/lib/state/substates/CellState.d.ts +12 -0
- package/lib/state/substates/CellState.js +22 -0
- package/lib/state/substates/DocumentState.d.ts +10 -0
- package/lib/state/substates/DocumentState.js +14 -0
- package/lib/state/substates/GradeState.d.ts +10 -0
- package/lib/state/substates/GradeState.js +14 -0
- package/lib/state/substates/JupyterLabState.d.ts +16 -0
- package/lib/state/substates/JupyterLabState.js +17 -0
- package/lib/state/substates/NbformatState.d.ts +13 -0
- package/lib/state/substates/NbformatState.js +16 -0
- package/lib/state/substates/RuntimesState.d.ts +87 -0
- package/lib/state/substates/RuntimesState.js +192 -0
- package/lib/state/substates/SpaceState.d.ts +11 -0
- package/lib/state/substates/SpaceState.js +16 -0
- package/lib/state/substates/index.d.ts +8 -0
- package/lib/state/substates/index.js +14 -0
- package/lib/stores/agentRuntimeStore.d.ts +25 -2
- package/lib/stores/agentRuntimeStore.js +114 -19
- package/lib/stories/Button.stories.d.ts +1 -1
- package/lib/stories/Header.stories.d.ts +3 -3
- package/lib/test-setup.js +10 -0
- package/lib/types/agents-lifecycle.d.ts +5 -5
- package/lib/types/agents.d.ts +3 -3
- package/lib/types/agentspecs.d.ts +3 -1
- package/lib/types/chat.d.ts +135 -3
- package/lib/types/config.d.ts +19 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/loops.d.ts +64 -0
- package/lib/types/loops.js +5 -0
- package/lib/types/tools.d.ts +16 -0
- package/lib/utils/Cells.d.ts +2 -0
- package/lib/utils/Cells.js +28 -0
- package/package.json +24 -18
- package/scripts/codegen/__pycache__/versioning.cpython-313.pyc +0 -0
- package/scripts/codegen/generate_agents.py +21 -4
- package/scripts/codegen/generate_loops.py +443 -0
- package/lib/examples/A2UiComponentGalleryExample.d.ts +0 -3
- package/lib/examples/A2UiComponentGalleryExample.js +0 -361
- /package/lib/{agent-lexical-main.d.ts → agent-document-main.d.ts} +0 -0
package/lib/types/chat.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module types/chat
|
|
5
5
|
*/
|
|
6
|
-
import type { ReactNode } from 'react';
|
|
6
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
7
7
|
import type { ChatMessage, MessageHandler } from './messages';
|
|
8
8
|
import type { Protocol, ProtocolConfig } from './protocol';
|
|
9
9
|
import type { McpServerSelection } from './inference';
|
|
@@ -49,6 +49,14 @@ export interface ToolCallCompleteContext {
|
|
|
49
49
|
* - 'sidebar': Docked sidebar panel
|
|
50
50
|
*/
|
|
51
51
|
export type ChatViewMode = 'floating' | 'floating-small' | 'sidebar';
|
|
52
|
+
/**
|
|
53
|
+
* Companion "ephemeral surface" shown next to the chat.
|
|
54
|
+
* - 'none': chat only, no companion surface
|
|
55
|
+
* - 'notebook': in-memory Jupyter notebook
|
|
56
|
+
* - 'document': in-memory Lexical rich-text document
|
|
57
|
+
*/
|
|
58
|
+
export type EphemeralSurfaceMode = 'none' | 'notebook' | 'document';
|
|
59
|
+
export type EphemeralNotebookToolbarComponent = ComponentType<any>;
|
|
52
60
|
/**
|
|
53
61
|
* Tool call status for tool rendering
|
|
54
62
|
*/
|
|
@@ -240,6 +248,23 @@ export interface ChatCommonProps {
|
|
|
240
248
|
showInput?: boolean;
|
|
241
249
|
/** Keep input visible but disabled */
|
|
242
250
|
disableInputPrompt?: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Whether the underlying agent runtime is still launching. When true, the
|
|
253
|
+
* chat shell is rendered with the input and controls disabled and a spinner
|
|
254
|
+
* overlay is shown, so the plain chat view appears as soon as the agent
|
|
255
|
+
* starts being created and stays interactive-disabled until it is ready.
|
|
256
|
+
*/
|
|
257
|
+
launching?: boolean;
|
|
258
|
+
/**
|
|
259
|
+
* Optional message shown next to the spinner while `launching` is true.
|
|
260
|
+
*/
|
|
261
|
+
launchingMessage?: ReactNode;
|
|
262
|
+
/**
|
|
263
|
+
* Optional overlay rendered above the chat surface (messages + input).
|
|
264
|
+
* Use this to show a gating UI such as a sign-in form for anonymous users
|
|
265
|
+
* while keeping the chat visible and its controls disabled behind it.
|
|
266
|
+
*/
|
|
267
|
+
overlay?: ReactNode;
|
|
243
268
|
/** Custom class name */
|
|
244
269
|
className?: string;
|
|
245
270
|
/** Children to render in the messages area */
|
|
@@ -294,7 +319,7 @@ export interface ChatCommonProps {
|
|
|
294
319
|
* When omitted, the toggle renders in read-only mode.
|
|
295
320
|
*/
|
|
296
321
|
onToggleCodemode?: (enabled: boolean) => void | Promise<void>;
|
|
297
|
-
/** Initial model ID to select (e.g., '
|
|
322
|
+
/** Initial model ID to select (e.g., 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0') */
|
|
298
323
|
initialModel?: string;
|
|
299
324
|
/**
|
|
300
325
|
* Override the list of available models.
|
|
@@ -309,6 +334,38 @@ export interface ChatCommonProps {
|
|
|
309
334
|
renderToolResult?: RenderToolResult;
|
|
310
335
|
/** Frontend tool definitions to register with the chat */
|
|
311
336
|
frontendTools?: FrontendToolDefinition[];
|
|
337
|
+
/**
|
|
338
|
+
* Show an in-memory "ephemeral notebook" next to the chat, toggled from the
|
|
339
|
+
* input footer. The notebook model lives purely in memory (never persisted)
|
|
340
|
+
* and its frontend tools are registered while visible. @default true
|
|
341
|
+
*/
|
|
342
|
+
enableEphemeralNotebook?: boolean;
|
|
343
|
+
/**
|
|
344
|
+
* Enable the in-memory "ephemeral document" (Lexical rich-text) companion
|
|
345
|
+
* surface. When enabled it appears as an option in the companion-surface
|
|
346
|
+
* segmented control alongside the notebook. @default false
|
|
347
|
+
*/
|
|
348
|
+
enableEphemeralDocument?: boolean;
|
|
349
|
+
/**
|
|
350
|
+
* Initial companion surface shown next to the chat. Defaults to 'notebook'
|
|
351
|
+
* when `enableEphemeralNotebook` is true, otherwise 'none'.
|
|
352
|
+
*/
|
|
353
|
+
initialEphemeralSurfaceMode?: EphemeralSurfaceMode;
|
|
354
|
+
/** Controlled callback for companion surface mode changes. */
|
|
355
|
+
onEphemeralSurfaceModeChange?: (mode: EphemeralSurfaceMode) => void;
|
|
356
|
+
/** Initial open state of the ephemeral notebook. @default true */
|
|
357
|
+
initialEphemeralNotebookOpen?: boolean;
|
|
358
|
+
/** Controlled callback for ephemeral notebook open-state changes. */
|
|
359
|
+
onEphemeralNotebookOpenChange?: (open: boolean) => void;
|
|
360
|
+
/** Collapse chat panel while keeping the ephemeral notebook visible. */
|
|
361
|
+
collapsed?: boolean;
|
|
362
|
+
/** Callback to reopen chat panel from collapsed notebook mode. */
|
|
363
|
+
onExpandFromCollapsed?: () => void;
|
|
364
|
+
/**
|
|
365
|
+
* Optional toolbar component used by the ephemeral notebook.
|
|
366
|
+
* Defaults to the toolbar from `@datalayer/jupyter-react` when omitted.
|
|
367
|
+
*/
|
|
368
|
+
ephemeralNotebookToolbar?: EphemeralNotebookToolbarComponent;
|
|
312
369
|
/** Pre-hook: fires when a tool call starts executing */
|
|
313
370
|
onToolCallStart?: (context: ToolCallStartContext) => void;
|
|
314
371
|
/** Post-hook: fires when a tool result is received */
|
|
@@ -356,6 +413,18 @@ export interface ChatCommonProps {
|
|
|
356
413
|
codemodeStatusData?: import('./stream').CodemodeStatusData | null;
|
|
357
414
|
/** Optional sandbox status override for immediate UI updates. */
|
|
358
415
|
sandboxStatusData?: SandboxWsStatus | null;
|
|
416
|
+
/**
|
|
417
|
+
* Live kernel connection of the companion notebook/document sandbox.
|
|
418
|
+
* When provided, it is forwarded to the chat header's `<KernelIndicator>`
|
|
419
|
+
* so the indicator reflects the surface's runtime.
|
|
420
|
+
*/
|
|
421
|
+
kernel?: import('@jupyterlab/services/lib/kernel/kernel').IKernelConnection | null;
|
|
422
|
+
/**
|
|
423
|
+
* Disable ChatBase's internal JupyterReactTheme wrapper.
|
|
424
|
+
* Use this when the host page already provides a JupyterReactTheme boundary.
|
|
425
|
+
* @default false
|
|
426
|
+
*/
|
|
427
|
+
disableInternalJupyterTheme?: boolean;
|
|
359
428
|
/**
|
|
360
429
|
* Whether to render the top-of-chat tool approval banner when there are
|
|
361
430
|
* pending approvals. @default true
|
|
@@ -431,6 +500,26 @@ export interface ChatBaseProps {
|
|
|
431
500
|
showInput?: boolean;
|
|
432
501
|
/** Keep input visible but disabled */
|
|
433
502
|
disableInputPrompt?: boolean;
|
|
503
|
+
/**
|
|
504
|
+
* Whether the underlying agent runtime is still launching. When true, the
|
|
505
|
+
* chat shell renders with input and controls disabled and a spinner overlay.
|
|
506
|
+
*/
|
|
507
|
+
launching?: boolean;
|
|
508
|
+
/** Optional message shown next to the spinner while `launching` is true. */
|
|
509
|
+
launchingMessage?: React.ReactNode;
|
|
510
|
+
/**
|
|
511
|
+
* Whether to auto-connect the chat protocol adapter on mount. Defaults to
|
|
512
|
+
* `true`. Set to `false` to render the chat shell (header, disabled input,
|
|
513
|
+
* companion notebook/document, launching overlay) without opening a protocol
|
|
514
|
+
* connection — e.g. while the agent runtime endpoint is still being created.
|
|
515
|
+
*/
|
|
516
|
+
autoConnect?: boolean;
|
|
517
|
+
/**
|
|
518
|
+
* Optional overlay rendered above the chat surface (messages + input).
|
|
519
|
+
* Use this to show a gating UI such as a sign-in form for anonymous users
|
|
520
|
+
* while keeping the chat visible and its controls disabled behind it.
|
|
521
|
+
*/
|
|
522
|
+
overlay?: React.ReactNode;
|
|
434
523
|
/** Show model selector (for protocols that support it) */
|
|
435
524
|
showModelSelector?: boolean;
|
|
436
525
|
/** Show tools menu (for protocols that support it) */
|
|
@@ -444,7 +533,7 @@ export interface ChatBaseProps {
|
|
|
444
533
|
* When omitted, the toggle renders in read-only mode.
|
|
445
534
|
*/
|
|
446
535
|
onToggleCodemode?: (enabled: boolean) => void | Promise<void>;
|
|
447
|
-
/** Initial model ID to select (e.g., '
|
|
536
|
+
/** Initial model ID to select (e.g., 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0') */
|
|
448
537
|
initialModel?: string;
|
|
449
538
|
/**
|
|
450
539
|
* Override the list of available models.
|
|
@@ -470,6 +559,12 @@ export interface ChatBaseProps {
|
|
|
470
559
|
* the colour and tooltip remain in sync with the notebook runtime.
|
|
471
560
|
*/
|
|
472
561
|
kernel?: import('@jupyterlab/services/lib/kernel/kernel').IKernelConnection | null;
|
|
562
|
+
/**
|
|
563
|
+
* Disable ChatBase's internal JupyterReactTheme wrapper.
|
|
564
|
+
* Use this when the host page already provides a JupyterReactTheme boundary.
|
|
565
|
+
* @default false
|
|
566
|
+
*/
|
|
567
|
+
disableInternalJupyterTheme?: boolean;
|
|
473
568
|
/** Optional environment name displayed in kernel indicator details. */
|
|
474
569
|
kernelEnvironmentName?: string;
|
|
475
570
|
/** Optional CPU info displayed in kernel indicator details. */
|
|
@@ -614,6 +709,43 @@ export interface ChatBaseProps {
|
|
|
614
709
|
* These tools execute in the browser and their results are sent back to the agent.
|
|
615
710
|
*/
|
|
616
711
|
frontendTools?: FrontendToolDefinition[];
|
|
712
|
+
/**
|
|
713
|
+
* Enable the "Ephemeral Notebook" feature. When true, a toggle is rendered in
|
|
714
|
+
* the input footer that shows/hides an in-memory notebook next to the chat.
|
|
715
|
+
* The notebook model lives purely in memory (never persisted) and is backed
|
|
716
|
+
* by a sandbox kernel. While visible, its frontend tools are registered so
|
|
717
|
+
* the agent can drive the notebook cells. @default true
|
|
718
|
+
*/
|
|
719
|
+
enableEphemeralNotebook?: boolean;
|
|
720
|
+
/**
|
|
721
|
+
* Enable the in-memory "ephemeral document" (Lexical rich-text) companion
|
|
722
|
+
* surface. When enabled it appears as an option in the companion-surface
|
|
723
|
+
* segmented control alongside the notebook. @default false
|
|
724
|
+
*/
|
|
725
|
+
enableEphemeralDocument?: boolean;
|
|
726
|
+
/**
|
|
727
|
+
* Initial companion surface shown next to the chat. Defaults to 'notebook'
|
|
728
|
+
* when `enableEphemeralNotebook` is true, otherwise 'none'.
|
|
729
|
+
*/
|
|
730
|
+
initialEphemeralSurfaceMode?: EphemeralSurfaceMode;
|
|
731
|
+
/** Controlled callback for companion surface mode changes. */
|
|
732
|
+
onEphemeralSurfaceModeChange?: (mode: EphemeralSurfaceMode) => void;
|
|
733
|
+
/**
|
|
734
|
+
* Initial open state of the ephemeral notebook toggle. Only relevant when
|
|
735
|
+
* `enableEphemeralNotebook` is true. @default true
|
|
736
|
+
*/
|
|
737
|
+
initialEphemeralNotebookOpen?: boolean;
|
|
738
|
+
/** Controlled callback for ephemeral notebook open-state changes. */
|
|
739
|
+
onEphemeralNotebookOpenChange?: (open: boolean) => void;
|
|
740
|
+
/** Collapse chat panel while keeping the ephemeral notebook visible. */
|
|
741
|
+
collapsed?: boolean;
|
|
742
|
+
/** Callback to reopen chat panel from collapsed notebook mode. */
|
|
743
|
+
onExpandFromCollapsed?: () => void;
|
|
744
|
+
/**
|
|
745
|
+
* Optional toolbar component used by the ephemeral notebook.
|
|
746
|
+
* Defaults to the toolbar from `@datalayer/jupyter-react` when omitted.
|
|
747
|
+
*/
|
|
748
|
+
ephemeralNotebookToolbar?: EphemeralNotebookToolbarComponent;
|
|
617
749
|
/**
|
|
618
750
|
* Callback when the agent requests authorization for an external service.
|
|
619
751
|
* This is called when a tool needs OAuth access to a service like GitHub.
|
package/lib/types/config.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { BuiltinTool } from './models';
|
|
|
6
6
|
/**
|
|
7
7
|
* Default agent configuration values.
|
|
8
8
|
*/
|
|
9
|
-
export declare const DEFAULT_AGENT_CONFIG: Required<AgentConfig
|
|
9
|
+
export declare const DEFAULT_AGENT_CONFIG: Required<Pick<AgentConfig, 'name' | 'description' | 'model' | 'systemPrompt' | 'agentLibrary' | 'protocol'>>;
|
|
10
10
|
/**
|
|
11
11
|
* Configuration for creating an agent on a runtime.
|
|
12
12
|
*/
|
|
@@ -23,6 +23,22 @@ export interface AgentConfig {
|
|
|
23
23
|
agentLibrary?: AgentLibrary;
|
|
24
24
|
/** Transport protocol (defaults to `ag-ui`). */
|
|
25
25
|
protocol?: Protocol;
|
|
26
|
+
/** Optional agent spec ID for server-side spec-based creation. */
|
|
27
|
+
agentSpecId?: string;
|
|
28
|
+
/** Optional custom tools payload. */
|
|
29
|
+
tools?: unknown[];
|
|
30
|
+
/** Enable skills for this agent. */
|
|
31
|
+
enableSkills?: boolean;
|
|
32
|
+
/** Optional inference provider override (e.g. local, datalayer). */
|
|
33
|
+
inferenceProvider?: string;
|
|
34
|
+
/** Enable codemode if supported by the selected spec/runtime. */
|
|
35
|
+
enableCodemode?: boolean;
|
|
36
|
+
/** Optional sandbox variant (e.g. eval, jupyter). */
|
|
37
|
+
sandboxVariant?: string;
|
|
38
|
+
/** Optional Jupyter sandbox URL for jupyter-backed sandbox mode. */
|
|
39
|
+
jupyterSandbox?: string;
|
|
40
|
+
/** Additional raw request fields merged into POST /api/v1/agents payload. */
|
|
41
|
+
createPayload?: Record<string, unknown>;
|
|
26
42
|
}
|
|
27
43
|
/**
|
|
28
44
|
* Remote configuration from server
|
|
@@ -32,6 +48,8 @@ export interface RemoteConfig {
|
|
|
32
48
|
defaultModel?: string;
|
|
33
49
|
builtinTools: BuiltinTool[];
|
|
34
50
|
mcpServers?: MCPServerConfig[];
|
|
51
|
+
suggestions?: string[];
|
|
52
|
+
welcomeMessage?: string;
|
|
35
53
|
}
|
|
36
54
|
/**
|
|
37
55
|
* Configuration for connecting to an agent runtime.
|
package/lib/types/index.d.ts
CHANGED
package/lib/types/index.js
CHANGED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the human participates in (or around) an agent execution loop.
|
|
3
|
+
*/
|
|
4
|
+
export interface LoopHuman {
|
|
5
|
+
/** Human interaction pattern: none, initiate, approve, feedback, or tool */
|
|
6
|
+
mode: string;
|
|
7
|
+
/** Whether the loop pauses for human approval before sensitive actions */
|
|
8
|
+
approvalRequired: boolean;
|
|
9
|
+
/** Actions that require explicit human approval */
|
|
10
|
+
approvalFor: string[];
|
|
11
|
+
/** Description of the human-in-the-loop behaviour */
|
|
12
|
+
description: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* When and how an agent execution loop stops iterating.
|
|
16
|
+
*/
|
|
17
|
+
export interface LoopTermination {
|
|
18
|
+
/** Maximum iterations before the loop is stopped */
|
|
19
|
+
maxIterations: number;
|
|
20
|
+
/** Conditions that mark the goal as reached */
|
|
21
|
+
successCriteria: string[];
|
|
22
|
+
/** Conditions that mark the loop as failed */
|
|
23
|
+
failureCriteria: string[];
|
|
24
|
+
/** What to do when blocked: ask-human, retry, or abort */
|
|
25
|
+
onBlocked: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Specification for an agent execution loop.
|
|
29
|
+
*
|
|
30
|
+
* A framework-agnostic description of how an agent progresses from one
|
|
31
|
+
* decision to the next: the control cycle (observe/think/act/evaluate), the
|
|
32
|
+
* objective, constraints, where state lives, human participation, and the
|
|
33
|
+
* termination policy.
|
|
34
|
+
*/
|
|
35
|
+
export interface LoopSpec {
|
|
36
|
+
/** Unique loop identifier (e.g., 'data-analysis') */
|
|
37
|
+
id: string;
|
|
38
|
+
/** Version */
|
|
39
|
+
version: string;
|
|
40
|
+
/** Display name for the loop */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Loop description */
|
|
43
|
+
description: string;
|
|
44
|
+
/** Default goal/objective the loop works toward */
|
|
45
|
+
objective: string;
|
|
46
|
+
/** Loop strategy family */
|
|
47
|
+
strategy: string;
|
|
48
|
+
/** Ordered phase names that make up one iteration */
|
|
49
|
+
phases: string[];
|
|
50
|
+
/** Boundaries the agent must respect */
|
|
51
|
+
constraints: string[];
|
|
52
|
+
/** Termination policy */
|
|
53
|
+
termination?: LoopTermination;
|
|
54
|
+
/** Human-in-the-loop participation settings */
|
|
55
|
+
human?: LoopHuman;
|
|
56
|
+
/** Where loop state lives between iterations */
|
|
57
|
+
stateBackends: string[];
|
|
58
|
+
/** Categorization tags */
|
|
59
|
+
tags: string[];
|
|
60
|
+
/** Icon identifier */
|
|
61
|
+
icon: string;
|
|
62
|
+
/** Emoji representation */
|
|
63
|
+
emoji: string;
|
|
64
|
+
}
|
package/lib/types/tools.d.ts
CHANGED
|
@@ -38,6 +38,22 @@ export interface ToolSpec {
|
|
|
38
38
|
/** Emoji identifier */
|
|
39
39
|
emoji?: string;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Binds a backend tool to a frontend renderer.
|
|
43
|
+
*
|
|
44
|
+
* Lets an agent declare, in its spec, which backend tool results should be
|
|
45
|
+
* rendered inline by the frontend, which renderer to use, and an optional CSS
|
|
46
|
+
* file to load. Frontend examples read this instead of hardcoding the tool
|
|
47
|
+
* name or CSS filename.
|
|
48
|
+
*/
|
|
49
|
+
export interface FrontendRenderToolSpec {
|
|
50
|
+
/** Name of the backend tool whose result is rendered inline */
|
|
51
|
+
tool: string;
|
|
52
|
+
/** Renderer key the frontend maps to a component */
|
|
53
|
+
renderer: string;
|
|
54
|
+
/** Optional CSS filename the frontend loads for this renderer */
|
|
55
|
+
css?: string;
|
|
56
|
+
}
|
|
41
57
|
/**
|
|
42
58
|
* Specification for a frontend tool set.
|
|
43
59
|
*/
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
export const getDatasetCell = (dataset) => {
|
|
6
|
+
switch (dataset.contentType) {
|
|
7
|
+
case 'application/vnd.ms-excel':
|
|
8
|
+
case 'text/csv':
|
|
9
|
+
return `# --- ✅ Load the ${dataset.fileName}.${dataset.datasetExtension} dataset (${dataset.mimeType})
|
|
10
|
+
import pandas as pd
|
|
11
|
+
${dataset.fileName}_${dataset.datasetExtension} = pd.read_csv("${dataset.cdnUrl}")
|
|
12
|
+
${dataset.fileName}_${dataset.datasetExtension}
|
|
13
|
+
|
|
14
|
+
`;
|
|
15
|
+
case 'image/png':
|
|
16
|
+
case 'image/jpg':
|
|
17
|
+
case 'image/jpeg':
|
|
18
|
+
return `# --- ✅ Display the ${dataset.fileName}.${dataset.datasetExtension} dataset (${dataset.mimeType})
|
|
19
|
+
from IPython.display import Image
|
|
20
|
+
url = "${dataset.cdnUrl}"
|
|
21
|
+
Image(url, width=300)
|
|
22
|
+
|
|
23
|
+
`;
|
|
24
|
+
default:
|
|
25
|
+
return `# --- 😞 File of type ${dataset.contentType} is not supported for now.
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datalayer/agent-runtimes",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
".",
|
|
@@ -68,11 +68,13 @@
|
|
|
68
68
|
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
|
|
69
69
|
"create:patches": "bash scripts/create-patches.sh",
|
|
70
70
|
"examples": "run-p server:start server:start:codemode jupyter:start examples:vite",
|
|
71
|
+
"examples2": "run-p server:start server:start:codemode jupyter:start examples2:vite",
|
|
71
72
|
"examples:proxy": "make examples:proxy",
|
|
72
73
|
"examples:fresh": "npm run clean:cache && npm run examples",
|
|
73
74
|
"examples:jupyter": "run-p jupyter:start server:start server:start:codemode examples:vite",
|
|
74
75
|
"examples:nextjs": "npm run dev --workspace=nextjs-notebook-example",
|
|
75
|
-
"examples:vite": "
|
|
76
|
+
"examples:vite": "VITE_DATALAYER_URL=${VITE_DATALAYER_URL:-https://r1.datalayer.run} VITE_DATALAYER_RUNTIMES_URL=${VITE_DATALAYER_RUNTIMES_URL:-https://r1.datalayer.run} VITE_DATALAYER_AGENT_RUNTIMES_URL=${VITE_DATALAYER_AGENT_RUNTIMES_URL:-https://r1.datalayer.run} VITE_APP_TARGET=examples vite",
|
|
77
|
+
"examples2:vite": "VITE_DATALAYER_URL=${VITE_DATALAYER_URL:-https://r1.datalayer.run} VITE_DATALAYER_RUNTIMES_URL=${VITE_DATALAYER_RUNTIMES_URL:-https://r1.datalayer.run} VITE_DATALAYER_AGENT_RUNTIMES_URL=${VITE_DATALAYER_AGENT_RUNTIMES_URL:-https://r1.datalayer.run} VITE_APP_TARGET=examples2 vite",
|
|
76
78
|
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,json,md}\" \"examples/**/*.{js,jsx,ts,tsx,css,json,md,mjs}\"",
|
|
77
79
|
"format:all": "npm run format && npm run format --workspaces --if-present",
|
|
78
80
|
"format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx,css,json,md}\" \"examples/**/*.{js,jsx,ts,tsx,css,json,md,mjs}\"",
|
|
@@ -104,8 +106,8 @@
|
|
|
104
106
|
"start:agent-node:vite": "vite --open /html/agent-node.html",
|
|
105
107
|
"start:agent-notebook": "run-p server:start jupyter:start start:agent-notebook:vite",
|
|
106
108
|
"start:agent-notebook:vite": "vite --open /html/agent-notebook.html",
|
|
107
|
-
"start:agent-
|
|
108
|
-
"start:agent-
|
|
109
|
+
"start:agent-document": "run-p server:start jupyter:start start:agent-document:vite",
|
|
110
|
+
"start:agent-document:vite": "vite --open /html/agent-document.html",
|
|
109
111
|
"storybook": "storybook dev -p 6006",
|
|
110
112
|
"sync:jupyter": "bash scripts/sync-jupyter.sh",
|
|
111
113
|
"sync:jupyter:watch": "bash scripts/sync-jupyter.sh --watch",
|
|
@@ -126,15 +128,17 @@
|
|
|
126
128
|
},
|
|
127
129
|
"dependencies": {
|
|
128
130
|
"@a2a-js/sdk": "^0.3.6",
|
|
129
|
-
"@a2ui/
|
|
131
|
+
"@a2ui/markdown-it": "^0.1.0",
|
|
132
|
+
"@a2ui/react": "^0.10.1",
|
|
133
|
+
"@a2ui/web_core": "^0.10.4",
|
|
130
134
|
"@ag-ui/client": "^0.0.42",
|
|
131
|
-
"@ag-ui/core": "^0.0.
|
|
132
|
-
"@ag-ui/encoder": "^0.0.
|
|
133
|
-
"@ag-ui/proto": "^0.0.
|
|
135
|
+
"@ag-ui/core": "^0.0.57",
|
|
136
|
+
"@ag-ui/encoder": "^0.0.57",
|
|
137
|
+
"@ag-ui/proto": "^0.0.57",
|
|
134
138
|
"@agentclientprotocol/sdk": "^0.8.0",
|
|
135
|
-
"@ai-sdk/react": "
|
|
139
|
+
"@ai-sdk/react": "4.0.23",
|
|
136
140
|
"@anthropic-ai/sdk": "^0.52.0",
|
|
137
|
-
"@datalayer/core": "^1.
|
|
141
|
+
"@datalayer/core": "^1.1.48",
|
|
138
142
|
"@datalayer/icons-react": "^1.0.7",
|
|
139
143
|
"@datalayer/jupyter-lexical": "^1.0.16",
|
|
140
144
|
"@datalayer/jupyter-react": "^2.0.7",
|
|
@@ -164,9 +168,9 @@
|
|
|
164
168
|
"@primer/behaviors": "^1.8.4",
|
|
165
169
|
"@primer/brand-primitives": "^0.51.0",
|
|
166
170
|
"@primer/css": "^21.5.1",
|
|
167
|
-
"@primer/octicons-react": "^19.
|
|
168
|
-
"@primer/primitives": "^10.
|
|
169
|
-
"@primer/react": "^37.
|
|
171
|
+
"@primer/octicons-react": "^19.29.1",
|
|
172
|
+
"@primer/primitives": "^10.7.0",
|
|
173
|
+
"@primer/react": "^37.31.0",
|
|
170
174
|
"@primer/react-brand": "^0.58.0",
|
|
171
175
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
172
176
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
@@ -199,7 +203,7 @@
|
|
|
199
203
|
"@tanstack/react-query": "^5.90.6",
|
|
200
204
|
"@toon-format/toon": "^1.3.0",
|
|
201
205
|
"@xyflow/react": "^12.10.0",
|
|
202
|
-
"ai": "^7.0.
|
|
206
|
+
"ai": "^7.0.22",
|
|
203
207
|
"ansi-to-html": "^0.7.2",
|
|
204
208
|
"axios": "^1.7.7",
|
|
205
209
|
"boring-avatars": "^2.0.1",
|
|
@@ -307,8 +311,9 @@
|
|
|
307
311
|
"vitest": "^3.2.4"
|
|
308
312
|
},
|
|
309
313
|
"resolutions": {
|
|
314
|
+
"@a2ui/web_core": "^0.10.4",
|
|
310
315
|
"@langchain/core": "^0.3.80",
|
|
311
|
-
"@ai-sdk/react": "
|
|
316
|
+
"@ai-sdk/react": "4.0.23",
|
|
312
317
|
"@microsoft/fast-colors": "5.3.1",
|
|
313
318
|
"@microsoft/fast-components": "2.30.6",
|
|
314
319
|
"@microsoft/fast-element": "1.13.0",
|
|
@@ -318,15 +323,16 @@
|
|
|
318
323
|
"@microsoft/load-themed-styles": "1.10.295",
|
|
319
324
|
"@types/react": "18.3.20",
|
|
320
325
|
"@types/react-dom": "18.3.6",
|
|
321
|
-
"ai": "^7.0.
|
|
326
|
+
"ai": "^7.0.22",
|
|
322
327
|
"pyodide": "0.28.0",
|
|
323
328
|
"react": "18.3.1",
|
|
324
329
|
"react-dom": "18.3.1",
|
|
325
330
|
"typescript": "^5.8.3"
|
|
326
331
|
},
|
|
327
332
|
"overrides": {
|
|
333
|
+
"@a2ui/web_core": "^0.10.4",
|
|
328
334
|
"@langchain/core": "^0.3.80",
|
|
329
|
-
"@ai-sdk/react": "
|
|
335
|
+
"@ai-sdk/react": "4.0.23",
|
|
330
336
|
"@microsoft/fast-colors": "5.3.1",
|
|
331
337
|
"@microsoft/fast-components": "2.30.6",
|
|
332
338
|
"@microsoft/fast-element": "1.13.0",
|
|
@@ -336,7 +342,7 @@
|
|
|
336
342
|
"@microsoft/load-themed-styles": "1.10.295",
|
|
337
343
|
"@types/react": "18.3.20",
|
|
338
344
|
"@types/react-dom": "18.3.6",
|
|
339
|
-
"ai": "^7.0.
|
|
345
|
+
"ai": "^7.0.22",
|
|
340
346
|
"pyodide": "0.28.0",
|
|
341
347
|
"react": "18.3.1",
|
|
342
348
|
"react-dom": "18.3.1",
|
|
Binary file
|
|
@@ -222,6 +222,12 @@ from agent_runtimes.types import Agentspec, SubAgentspecConfig, SubAgentsConfig
|
|
|
222
222
|
versioned_ref(*split_spec_ref(ft))
|
|
223
223
|
for ft in spec.get("frontend_tools", [])
|
|
224
224
|
]
|
|
225
|
+
frontend_render_tools = spec.get("frontend_render_tools") or []
|
|
226
|
+
frontend_render_tools_py_line = (
|
|
227
|
+
f" frontend_render_tools={_fmt_py_literal(frontend_render_tools)},\n"
|
|
228
|
+
if frontend_render_tools
|
|
229
|
+
else ""
|
|
230
|
+
)
|
|
225
231
|
|
|
226
232
|
# Format optional fields
|
|
227
233
|
icon = f'"{spec.get("icon")}"' if spec.get("icon") else "None"
|
|
@@ -262,6 +268,7 @@ from agent_runtimes.types import Agentspec, SubAgentspecConfig, SubAgentsConfig
|
|
|
262
268
|
.strip()
|
|
263
269
|
.replace('"', '\\"')
|
|
264
270
|
)
|
|
271
|
+
display_name = spec.get("title", spec["name"]).replace('"', '\\"')
|
|
265
272
|
|
|
266
273
|
# Use triple quotes for multiline system prompts
|
|
267
274
|
system_prompt_str = f'"""{system_prompt}"""' if system_prompt else "None"
|
|
@@ -363,7 +370,7 @@ from agent_runtimes.types import Agentspec, SubAgentspecConfig, SubAgentsConfig
|
|
|
363
370
|
code += f'''{const_name} = Agentspec(
|
|
364
371
|
id="{full_agent_id}",
|
|
365
372
|
version="{version}",
|
|
366
|
-
|
|
373
|
+
name="{display_name}",
|
|
367
374
|
description="{description}",
|
|
368
375
|
tags={_fmt_list(spec.get("tags", []))},
|
|
369
376
|
enabled={spec.get("enabled", True)},
|
|
@@ -373,7 +380,7 @@ from agent_runtimes.types import Agentspec, SubAgentspecConfig, SubAgentsConfig
|
|
|
373
380
|
skills={_fmt_list(skill_refs)},
|
|
374
381
|
tools={_fmt_list(tool_refs)},
|
|
375
382
|
{disable_tool_approvals_line} frontend_tools={_fmt_list(frontend_tool_refs)},
|
|
376
|
-
environment_name="{spec.get("environment_name", "ai-agents-env")}",
|
|
383
|
+
{frontend_render_tools_py_line} environment_name="{spec.get("environment_name", "ai-agents-env")}",
|
|
377
384
|
icon={icon},
|
|
378
385
|
emoji={emoji},
|
|
379
386
|
color={color},
|
|
@@ -817,6 +824,14 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
|
|
|
817
824
|
else:
|
|
818
825
|
frontend_tools_str = ""
|
|
819
826
|
|
|
827
|
+
# Frontend render tools - inline structured data read verbatim
|
|
828
|
+
frontend_render_tools = spec.get("frontend_render_tools") or []
|
|
829
|
+
frontend_render_tools_ts_line = (
|
|
830
|
+
f" frontendRenderTools: {_fmt_ts_literal(frontend_render_tools)},\n"
|
|
831
|
+
if frontend_render_tools
|
|
832
|
+
else ""
|
|
833
|
+
)
|
|
834
|
+
|
|
820
835
|
# Format tags and suggestions as arrays
|
|
821
836
|
tags = spec.get("tags", [])
|
|
822
837
|
tags_str = "[" + ", ".join(f"'{t}'" for t in tags) + "]"
|
|
@@ -855,6 +870,7 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
|
|
|
855
870
|
description = (
|
|
856
871
|
spec["description"].replace("\n", " ").replace(" ", " ").strip()
|
|
857
872
|
)
|
|
873
|
+
display_name = spec.get("title", spec["name"]).replace("'", "\\'")
|
|
858
874
|
|
|
859
875
|
# Model field
|
|
860
876
|
model_id = spec.get("model")
|
|
@@ -921,7 +937,7 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
|
|
|
921
937
|
code += f"""export const {const_name}: Agentspec = {{
|
|
922
938
|
id: '{full_agent_id}',
|
|
923
939
|
version: '{version}',
|
|
924
|
-
|
|
940
|
+
name: '{display_name}',
|
|
925
941
|
description: `{description}`,
|
|
926
942
|
tags: {tags_str},
|
|
927
943
|
enabled: {str(spec.get("enabled", True)).lower()},
|
|
@@ -930,7 +946,7 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
|
|
|
930
946
|
skills: [{skills_str}].filter(Boolean) as SkillSpec[],
|
|
931
947
|
tools: [{tools_str}],
|
|
932
948
|
{disable_tool_approvals_line} frontendTools: [{frontend_tools_str}],
|
|
933
|
-
environmentName: '{spec.get("environment_name", "ai-agents-env")}',
|
|
949
|
+
{frontend_render_tools_ts_line} environmentName: '{spec.get("environment_name", "ai-agents-env")}',
|
|
934
950
|
icon: {icon},
|
|
935
951
|
emoji: {emoji},
|
|
936
952
|
color: {color},
|
|
@@ -1376,6 +1392,7 @@ export * from './teams';
|
|
|
1376
1392
|
export * from './envvars';
|
|
1377
1393
|
export * from './evals';
|
|
1378
1394
|
export * from './guardrails';
|
|
1395
|
+
export * from './loops';
|
|
1379
1396
|
export * from './mcpServers';
|
|
1380
1397
|
export * from './memory';
|
|
1381
1398
|
export * from './models';
|