@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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
import { CopilotIcon, ZapIcon } from '@primer/octicons-react';
|
|
6
|
+
export const PAGE_TAGE_NONE = {
|
|
7
|
+
id: '0',
|
|
8
|
+
text: undefined,
|
|
9
|
+
Icon: CopilotIcon,
|
|
10
|
+
color: 'pink',
|
|
11
|
+
};
|
|
12
|
+
const PAGE_TAGE_AGENT = {
|
|
13
|
+
id: '9',
|
|
14
|
+
text: 'agent',
|
|
15
|
+
Icon: CopilotIcon,
|
|
16
|
+
color: 'teal',
|
|
17
|
+
};
|
|
18
|
+
const PAGE_TAGE_AI = {
|
|
19
|
+
id: '1',
|
|
20
|
+
text: 'ai',
|
|
21
|
+
Icon: CopilotIcon,
|
|
22
|
+
color: 'pink',
|
|
23
|
+
};
|
|
24
|
+
const PAGE_TAGE_AI_AGENT = {
|
|
25
|
+
id: '10',
|
|
26
|
+
text: 'ai-agent',
|
|
27
|
+
Icon: CopilotIcon,
|
|
28
|
+
color: 'purple',
|
|
29
|
+
};
|
|
30
|
+
const PAGE_TAGE_DEEP_LEARNING = {
|
|
31
|
+
id: '2',
|
|
32
|
+
text: 'deep-learning',
|
|
33
|
+
Icon: ZapIcon,
|
|
34
|
+
color: 'blue',
|
|
35
|
+
};
|
|
36
|
+
const PAGE_TAGE_EXAMPLE = {
|
|
37
|
+
id: '3',
|
|
38
|
+
text: 'example',
|
|
39
|
+
Icon: CopilotIcon,
|
|
40
|
+
color: 'lime',
|
|
41
|
+
};
|
|
42
|
+
const PAGE_TAGE_LLM = {
|
|
43
|
+
id: '4',
|
|
44
|
+
text: 'llm',
|
|
45
|
+
Icon: CopilotIcon,
|
|
46
|
+
color: 'coral',
|
|
47
|
+
};
|
|
48
|
+
const PAGE_TAGE_NOTEBOOK = {
|
|
49
|
+
id: '11',
|
|
50
|
+
text: 'notebook',
|
|
51
|
+
Icon: CopilotIcon,
|
|
52
|
+
color: 'blue',
|
|
53
|
+
};
|
|
54
|
+
const PAGE_TAGE_PYTHON = {
|
|
55
|
+
id: '5',
|
|
56
|
+
text: 'python',
|
|
57
|
+
Icon: CopilotIcon,
|
|
58
|
+
color: 'gray',
|
|
59
|
+
metadata: { fillColor: 'var(--base-color-green-0)' },
|
|
60
|
+
};
|
|
61
|
+
const PAGE_TAGE_PYTORCH = {
|
|
62
|
+
id: '6',
|
|
63
|
+
text: 'pytorch',
|
|
64
|
+
Icon: CopilotIcon,
|
|
65
|
+
color: 'green',
|
|
66
|
+
};
|
|
67
|
+
const PAGE_TAGE_SPATIAL = {
|
|
68
|
+
id: '7',
|
|
69
|
+
text: 'spatial',
|
|
70
|
+
Icon: CopilotIcon,
|
|
71
|
+
color: 'lemon',
|
|
72
|
+
};
|
|
73
|
+
const PAGE_TAGE_TUTORIAL = {
|
|
74
|
+
id: '8',
|
|
75
|
+
text: 'tutorial',
|
|
76
|
+
Icon: CopilotIcon,
|
|
77
|
+
color: 'orange',
|
|
78
|
+
metadata: { fillColor: 'yellow' },
|
|
79
|
+
};
|
|
80
|
+
export const PAGE_TAGS = [
|
|
81
|
+
PAGE_TAGE_AGENT,
|
|
82
|
+
PAGE_TAGE_AI,
|
|
83
|
+
PAGE_TAGE_AI_AGENT,
|
|
84
|
+
PAGE_TAGE_DEEP_LEARNING,
|
|
85
|
+
PAGE_TAGE_EXAMPLE,
|
|
86
|
+
PAGE_TAGE_LLM,
|
|
87
|
+
PAGE_TAGE_NOTEBOOK,
|
|
88
|
+
PAGE_TAGE_PYTHON,
|
|
89
|
+
PAGE_TAGE_PYTORCH,
|
|
90
|
+
PAGE_TAGE_SPATIAL,
|
|
91
|
+
PAGE_TAGE_TUTORIAL,
|
|
92
|
+
];
|
|
93
|
+
export const PAGE_TAGS_BY_NAME_MAP = new Map(PAGE_TAGS.map(t => [t.text, t]));
|
|
94
|
+
export const PAGE_TAGS_BY_COLOR_MAP = new Map(PAGE_TAGS.map(t => [t.color, t]));
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project domain model for the Datalayer Client.
|
|
3
|
+
*
|
|
4
|
+
* Projects are spaces with variant='project' that can have attached agents.
|
|
5
|
+
* This is a standalone model (no inheritance from SpaceDTO) to avoid
|
|
6
|
+
* circular dependency issues in the module graph.
|
|
7
|
+
*
|
|
8
|
+
* @module models/ProjectDTO
|
|
9
|
+
*/
|
|
10
|
+
import type { SpaceData } from './SpaceDTO';
|
|
11
|
+
/**
|
|
12
|
+
* Stable public interface for Project data.
|
|
13
|
+
*/
|
|
14
|
+
export interface ProjectJSON {
|
|
15
|
+
uid: string;
|
|
16
|
+
id: string;
|
|
17
|
+
handle: string;
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
variant: string;
|
|
21
|
+
isPublic: boolean;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
attachedAgentPodName: string | null;
|
|
24
|
+
attachedAgentSpecId: string | null;
|
|
25
|
+
attachedAgentGivenName: string | null;
|
|
26
|
+
hasAgent: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Default items (notebook UID and document UID) for a project.
|
|
30
|
+
*/
|
|
31
|
+
export interface ProjectDefaultItems {
|
|
32
|
+
defaultNotebookUid: string | null;
|
|
33
|
+
defaultDocumentUid: string | null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Project domain model wrapping raw space data with project-specific accessors.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const projects = await client.getProjects();
|
|
41
|
+
* const project = projects[0];
|
|
42
|
+
* console.log(project.hasAgent); // false
|
|
43
|
+
* await client.assignAgent(project.uid, 'my-agent-pod');
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare class ProjectDTO {
|
|
47
|
+
private _data;
|
|
48
|
+
private _deleted;
|
|
49
|
+
private _createdAt;
|
|
50
|
+
constructor(data: SpaceData);
|
|
51
|
+
/** Unique identifier for the project. */
|
|
52
|
+
get uid(): string;
|
|
53
|
+
/** Internal numeric/string ID from the backend. Falls back to UID when not present. SDK client methods accept `uid` directly. */
|
|
54
|
+
get id(): string;
|
|
55
|
+
/** URL-friendly handle. */
|
|
56
|
+
get handle(): string;
|
|
57
|
+
/** Project name. */
|
|
58
|
+
get name(): string;
|
|
59
|
+
/** Project description. */
|
|
60
|
+
get description(): string;
|
|
61
|
+
/** Space variant (should be 'project'). */
|
|
62
|
+
get variant(): string;
|
|
63
|
+
/** Whether the project is public. */
|
|
64
|
+
get isPublic(): boolean;
|
|
65
|
+
/** Creation date (stable across calls). */
|
|
66
|
+
get createdAt(): Date;
|
|
67
|
+
/** Attached agent runtime pod name, if any. */
|
|
68
|
+
get attachedAgentPodName(): string | undefined;
|
|
69
|
+
/** Attached agentspec ID (e.g., 'data-acquisition'), if any. */
|
|
70
|
+
get attachedAgentSpecId(): string | undefined;
|
|
71
|
+
/** Human-readable name of the attached agent runtime, if any. */
|
|
72
|
+
get attachedAgentGivenName(): string | undefined;
|
|
73
|
+
/** Whether an agent is currently attached to this project. */
|
|
74
|
+
get hasAgent(): boolean;
|
|
75
|
+
/** Mark this project as deleted. */
|
|
76
|
+
markDeleted(): void;
|
|
77
|
+
/** Whether this project has been deleted. */
|
|
78
|
+
get isDeleted(): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Get project data in camelCase format.
|
|
81
|
+
* @returns Project data with camelCase properties
|
|
82
|
+
*/
|
|
83
|
+
toJSON(): ProjectJSON;
|
|
84
|
+
/** Get raw space data as received from the API. */
|
|
85
|
+
rawData(): SpaceData;
|
|
86
|
+
/** String representation of the project. */
|
|
87
|
+
toString(): string;
|
|
88
|
+
private _checkDeleted;
|
|
89
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Project domain model wrapping raw space data with project-specific accessors.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const projects = await client.getProjects();
|
|
11
|
+
* const project = projects[0];
|
|
12
|
+
* console.log(project.hasAgent); // false
|
|
13
|
+
* await client.assignAgent(project.uid, 'my-agent-pod');
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export class ProjectDTO {
|
|
17
|
+
_data;
|
|
18
|
+
_deleted = false;
|
|
19
|
+
_createdAt;
|
|
20
|
+
constructor(data) {
|
|
21
|
+
this._data = data;
|
|
22
|
+
// Cache creation date at construction to ensure stable value
|
|
23
|
+
this._createdAt = data.creation_ts_dt
|
|
24
|
+
? new Date(data.creation_ts_dt)
|
|
25
|
+
: new Date();
|
|
26
|
+
}
|
|
27
|
+
/** Unique identifier for the project. */
|
|
28
|
+
get uid() {
|
|
29
|
+
this._checkDeleted();
|
|
30
|
+
return this._data.uid;
|
|
31
|
+
}
|
|
32
|
+
/** Internal numeric/string ID from the backend. Falls back to UID when not present. SDK client methods accept `uid` directly. */
|
|
33
|
+
get id() {
|
|
34
|
+
this._checkDeleted();
|
|
35
|
+
return this._data.id ?? this._data.uid;
|
|
36
|
+
}
|
|
37
|
+
/** URL-friendly handle. */
|
|
38
|
+
get handle() {
|
|
39
|
+
this._checkDeleted();
|
|
40
|
+
return this._data.handle_s;
|
|
41
|
+
}
|
|
42
|
+
/** Project name. */
|
|
43
|
+
get name() {
|
|
44
|
+
this._checkDeleted();
|
|
45
|
+
return this._data.name_t;
|
|
46
|
+
}
|
|
47
|
+
/** Project description. */
|
|
48
|
+
get description() {
|
|
49
|
+
this._checkDeleted();
|
|
50
|
+
return this._data.description_t ?? '';
|
|
51
|
+
}
|
|
52
|
+
/** Space variant (should be 'project'). */
|
|
53
|
+
get variant() {
|
|
54
|
+
this._checkDeleted();
|
|
55
|
+
return this._data.variant_s;
|
|
56
|
+
}
|
|
57
|
+
/** Whether the project is public. */
|
|
58
|
+
get isPublic() {
|
|
59
|
+
this._checkDeleted();
|
|
60
|
+
return this._data.public_b ?? false;
|
|
61
|
+
}
|
|
62
|
+
/** Creation date (stable across calls). */
|
|
63
|
+
get createdAt() {
|
|
64
|
+
this._checkDeleted();
|
|
65
|
+
return this._createdAt;
|
|
66
|
+
}
|
|
67
|
+
/** Attached agent runtime pod name, if any. */
|
|
68
|
+
get attachedAgentPodName() {
|
|
69
|
+
this._checkDeleted();
|
|
70
|
+
return this._data.attached_agent_pod_name_s || undefined;
|
|
71
|
+
}
|
|
72
|
+
/** Attached agentspec ID (e.g., 'data-acquisition'), if any. */
|
|
73
|
+
get attachedAgentSpecId() {
|
|
74
|
+
this._checkDeleted();
|
|
75
|
+
return this._data.attached_agent_spec_id_s || undefined;
|
|
76
|
+
}
|
|
77
|
+
/** Human-readable name of the attached agent runtime, if any. */
|
|
78
|
+
get attachedAgentGivenName() {
|
|
79
|
+
this._checkDeleted();
|
|
80
|
+
return this._data.attached_agent_given_name_s || undefined;
|
|
81
|
+
}
|
|
82
|
+
/** Whether an agent is currently attached to this project. */
|
|
83
|
+
get hasAgent() {
|
|
84
|
+
this._checkDeleted();
|
|
85
|
+
return !!this._data.attached_agent_pod_name_s;
|
|
86
|
+
}
|
|
87
|
+
/** Mark this project as deleted. */
|
|
88
|
+
markDeleted() {
|
|
89
|
+
this._deleted = true;
|
|
90
|
+
}
|
|
91
|
+
/** Whether this project has been deleted. */
|
|
92
|
+
get isDeleted() {
|
|
93
|
+
return this._deleted;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Get project data in camelCase format.
|
|
97
|
+
* @returns Project data with camelCase properties
|
|
98
|
+
*/
|
|
99
|
+
toJSON() {
|
|
100
|
+
this._checkDeleted();
|
|
101
|
+
return {
|
|
102
|
+
uid: this.uid,
|
|
103
|
+
id: this.id,
|
|
104
|
+
handle: this.handle,
|
|
105
|
+
name: this.name,
|
|
106
|
+
description: this.description,
|
|
107
|
+
variant: this.variant,
|
|
108
|
+
isPublic: this.isPublic,
|
|
109
|
+
createdAt: this.createdAt.toISOString(),
|
|
110
|
+
attachedAgentPodName: this.attachedAgentPodName ?? null,
|
|
111
|
+
attachedAgentSpecId: this.attachedAgentSpecId ?? null,
|
|
112
|
+
attachedAgentGivenName: this.attachedAgentGivenName ?? null,
|
|
113
|
+
hasAgent: this.hasAgent,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/** Get raw space data as received from the API. */
|
|
117
|
+
rawData() {
|
|
118
|
+
this._checkDeleted();
|
|
119
|
+
return this._data;
|
|
120
|
+
}
|
|
121
|
+
/** String representation of the project. */
|
|
122
|
+
toString() {
|
|
123
|
+
this._checkDeleted();
|
|
124
|
+
return `Project(${this._data.uid}, ${this._data.name_t})`;
|
|
125
|
+
}
|
|
126
|
+
_checkDeleted() {
|
|
127
|
+
if (this._deleted) {
|
|
128
|
+
throw new Error(`Project ${this._data.uid} has been deleted and no longer exists`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Kernel } from '@jupyterlab/services';
|
|
2
|
+
export declare const BACKWARDS_COMPATIBLE_KERNEL_TYPES_MAP: {
|
|
3
|
+
default: IRuntimeType;
|
|
4
|
+
snippet: IRuntimeType;
|
|
5
|
+
notebook: IRuntimeType;
|
|
6
|
+
cell: IRuntimeType;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Error thrown when a runtime has been created
|
|
10
|
+
* but it can ont be reached.
|
|
11
|
+
*/
|
|
12
|
+
export declare class RuntimeUnreachable extends Error {
|
|
13
|
+
name: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Runtime location.
|
|
17
|
+
*/
|
|
18
|
+
export type IRuntimeLocation = 'browser' | 'local' | string;
|
|
19
|
+
/**
|
|
20
|
+
* A live runtime.
|
|
21
|
+
*
|
|
22
|
+
* Composition of the control-plane runtime pod ({@link IRuntimePod}) and the
|
|
23
|
+
* JupyterLab kernel model ({@link Kernel.IModel}, e.g. `id`, `name`,
|
|
24
|
+
* `execution_state`). This is the canonical shape used across the app once a
|
|
25
|
+
* pod has an attached kernel: `IRuntimePod` supplies the pod/control-plane
|
|
26
|
+
* fields (snake_case) and `Kernel.IModel` supplies the live kernel fields.
|
|
27
|
+
*
|
|
28
|
+
* Note on identity: `Kernel.IModel.id` is the *kernel* id (only present once a
|
|
29
|
+
* kernel is attached), while {@link IRuntimePod.uid} is the stable *pod* id.
|
|
30
|
+
* Prefer `uid` for pod identity and `id` for kernel identity.
|
|
31
|
+
*/
|
|
32
|
+
export interface IRuntimeModel extends IRuntimePod, Kernel.IModel {
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A runtime pod as returned by the Datalayer control-plane.
|
|
36
|
+
*
|
|
37
|
+
* This is the canonical snake_case transport shape for a runtime pod. The
|
|
38
|
+
* Datalayer Client's `RuntimeData` (see `RuntimeDTO.ts`) is a type alias of
|
|
39
|
+
* this interface, so there is a single source of truth for the pod payload.
|
|
40
|
+
* It is the source of the pod-level fields composed into {@link IRuntimeModel}.
|
|
41
|
+
*
|
|
42
|
+
* It is distinct from {@link IRuntimeDesc}, which is the camelCase,
|
|
43
|
+
* location-agnostic UI descriptor used by pickers/launchers - do not merge the
|
|
44
|
+
* two (see `IRuntimeDesc`).
|
|
45
|
+
*/
|
|
46
|
+
export interface IRuntimePod {
|
|
47
|
+
/**
|
|
48
|
+
* Stable runtime pod identifier (ULID) assigned by the control-plane.
|
|
49
|
+
*
|
|
50
|
+
* Distinct from the kernel `id` carried by {@link Kernel.IModel}: a pod may
|
|
51
|
+
* exist before a kernel is attached, so prefer `uid` for pod identity.
|
|
52
|
+
*/
|
|
53
|
+
uid: string;
|
|
54
|
+
/**
|
|
55
|
+
* Environment display name
|
|
56
|
+
*/
|
|
57
|
+
environment_title: string;
|
|
58
|
+
/**
|
|
59
|
+
* Environment name
|
|
60
|
+
*/
|
|
61
|
+
environment_name: string;
|
|
62
|
+
/**
|
|
63
|
+
* Runtime name
|
|
64
|
+
*/
|
|
65
|
+
pod_name: string;
|
|
66
|
+
/**
|
|
67
|
+
* Runtime ingress URL
|
|
68
|
+
*/
|
|
69
|
+
ingress: string;
|
|
70
|
+
/**
|
|
71
|
+
* Runtime user given name
|
|
72
|
+
*/
|
|
73
|
+
given_name: string;
|
|
74
|
+
/**
|
|
75
|
+
* Runtime type
|
|
76
|
+
*/
|
|
77
|
+
type: IRuntimeType;
|
|
78
|
+
/**
|
|
79
|
+
* Server authentication token
|
|
80
|
+
*/
|
|
81
|
+
token: string;
|
|
82
|
+
/**
|
|
83
|
+
* Credits burning rate per second
|
|
84
|
+
*/
|
|
85
|
+
burning_rate: number;
|
|
86
|
+
/**
|
|
87
|
+
* Kernel reservation ID
|
|
88
|
+
*/
|
|
89
|
+
reservation_id?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Runtime usage starting timestamp
|
|
92
|
+
*/
|
|
93
|
+
started_at: string;
|
|
94
|
+
/**
|
|
95
|
+
* Runtime credits reservation expiration timestamp
|
|
96
|
+
*/
|
|
97
|
+
expired_at?: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Runtime description (UI layer).
|
|
101
|
+
*
|
|
102
|
+
* A lightweight, camelCase, location-agnostic descriptor used by the runtime
|
|
103
|
+
* pickers/launchers to describe a *desired or selected* runtime across all
|
|
104
|
+
* locations (browser / local / remote). It is intentionally kept separate from
|
|
105
|
+
* {@link IRuntimePod}:
|
|
106
|
+
* - naming: camelCase (UI) vs snake_case (backend transport);
|
|
107
|
+
* - scope: spans all {@link IRuntimeLocation}s vs remote pod only;
|
|
108
|
+
* - lifecycle: a selection/description (may not exist yet) vs a concrete
|
|
109
|
+
* running pod.
|
|
110
|
+
* Map between the two at the boundary (e.g. `podName` <-> `pod_name`,
|
|
111
|
+
* `burningRate` <-> `burning_rate`) rather than merging them.
|
|
112
|
+
*/
|
|
113
|
+
export interface IRuntimeDesc {
|
|
114
|
+
/**
|
|
115
|
+
* Runtime ID.
|
|
116
|
+
*/
|
|
117
|
+
id?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Runtime Kernel ID.
|
|
120
|
+
*/
|
|
121
|
+
kernelId?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Runtime name.
|
|
124
|
+
*/
|
|
125
|
+
name: string;
|
|
126
|
+
/**
|
|
127
|
+
* Runtime language.
|
|
128
|
+
*/
|
|
129
|
+
language: string;
|
|
130
|
+
/**
|
|
131
|
+
* Runtime location.
|
|
132
|
+
*/
|
|
133
|
+
location: IRuntimeLocation;
|
|
134
|
+
/**
|
|
135
|
+
* Runtime display name.
|
|
136
|
+
*/
|
|
137
|
+
displayName?: string;
|
|
138
|
+
/**
|
|
139
|
+
* Runtime parameters.
|
|
140
|
+
*/
|
|
141
|
+
params?: Record<string, any>;
|
|
142
|
+
/**
|
|
143
|
+
* Runtime credits burning rate.
|
|
144
|
+
*/
|
|
145
|
+
burningRate?: number;
|
|
146
|
+
/**
|
|
147
|
+
* Runtime Pod name (if applicable).
|
|
148
|
+
*/
|
|
149
|
+
podName?: string;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Runtime type.
|
|
153
|
+
*
|
|
154
|
+
* TODO refactor with type `IRuntimeLocation`
|
|
155
|
+
*/
|
|
156
|
+
export type IRuntimeType = 'notebook' | 'cell';
|
|
157
|
+
/**
|
|
158
|
+
* Runtime optional capabilities.
|
|
159
|
+
*/
|
|
160
|
+
export type IRuntimeCapabilities = 'user_storage';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
export const BACKWARDS_COMPATIBLE_KERNEL_TYPES_MAP = {
|
|
6
|
+
// Backwards compatible mapping.
|
|
7
|
+
default: 'notebook',
|
|
8
|
+
snippet: 'cell',
|
|
9
|
+
notebook: 'notebook',
|
|
10
|
+
cell: 'cell',
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Error thrown when a runtime has been created
|
|
14
|
+
* but it can ont be reached.
|
|
15
|
+
*/
|
|
16
|
+
export class RuntimeUnreachable extends Error {
|
|
17
|
+
name = 'RuntimeUnreachable';
|
|
18
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import type { AgentRuntimesClient as DatalayerClient } from '../client/AgentRuntimesClient';
|
|
2
|
+
import { CodeSandboxSnapshotDTO } from './CodeSandboxSnapshotDTO';
|
|
3
|
+
import type { IRuntimePod } from './Runtime';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a running instance of a computing environment.
|
|
6
|
+
*
|
|
7
|
+
* Alias of the canonical {@link IRuntimePod} (see `Runtime.ts`) so the raw
|
|
8
|
+
* snake_case pod payload is defined in a single place. Kept as a named export
|
|
9
|
+
* for the Datalayer Client's public API surface.
|
|
10
|
+
*/
|
|
11
|
+
export type RuntimeData = IRuntimePod;
|
|
12
|
+
/**
|
|
13
|
+
* Stable public interface for Runtime data.
|
|
14
|
+
* This is the contract that Client consumers can rely on.
|
|
15
|
+
* The raw API may change, but this interface remains stable.
|
|
16
|
+
*/
|
|
17
|
+
export interface RuntimeJSON {
|
|
18
|
+
/** ulid for the runtime */
|
|
19
|
+
uid: string;
|
|
20
|
+
/** Kubernetes pod name for the runtime instance */
|
|
21
|
+
podName: string;
|
|
22
|
+
/** User-friendly name for the runtime */
|
|
23
|
+
givenName: string;
|
|
24
|
+
/** Name of the environment this runtime is based on */
|
|
25
|
+
environmentName: string;
|
|
26
|
+
/** Title of the environment for display */
|
|
27
|
+
environmentTitle: string;
|
|
28
|
+
/** Type of runtime - notebook, terminal, or job */
|
|
29
|
+
type: string;
|
|
30
|
+
/** Credits consumed per second */
|
|
31
|
+
burningRate: number;
|
|
32
|
+
/** Credits allocated/available to this runtime */
|
|
33
|
+
ingress: string;
|
|
34
|
+
/** Authentication token for accessing the runtime */
|
|
35
|
+
token: string;
|
|
36
|
+
/** When the runtime was started */
|
|
37
|
+
startedAt: string;
|
|
38
|
+
/** When the runtime will expire */
|
|
39
|
+
expiredAt: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Request payload for creating a new runtime
|
|
43
|
+
* @interface CreateRuntimeRequest
|
|
44
|
+
*/
|
|
45
|
+
export interface CreateRuntimeRequest {
|
|
46
|
+
/** Name of the environment to use */
|
|
47
|
+
environment_name: string;
|
|
48
|
+
/** Type of runtime (e.g., 'notebook', 'terminal', 'job') */
|
|
49
|
+
type?: 'notebook' | 'terminal' | 'job';
|
|
50
|
+
/** Optional given name for the runtime */
|
|
51
|
+
given_name?: string;
|
|
52
|
+
/** Maximum credits this runtime can consume */
|
|
53
|
+
credits_limit?: number;
|
|
54
|
+
/** Optional capabilities for the runtime */
|
|
55
|
+
capabilities?: string[];
|
|
56
|
+
/** Optional source to create runtime from (e.g., snapshot ID) */
|
|
57
|
+
from?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Response from creating a new runtime
|
|
61
|
+
* @interface CreateRuntimeResponse
|
|
62
|
+
*/
|
|
63
|
+
export interface CreateRuntimeResponse {
|
|
64
|
+
/** Whether the request was successful */
|
|
65
|
+
success: boolean;
|
|
66
|
+
/** Response message from the server */
|
|
67
|
+
message: string;
|
|
68
|
+
/** The created runtime instance */
|
|
69
|
+
runtime: RuntimeData;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Response from listing runtimes
|
|
73
|
+
* @interface ListRuntimesResponse
|
|
74
|
+
*/
|
|
75
|
+
export interface ListRuntimesResponse {
|
|
76
|
+
/** Whether the request was successful */
|
|
77
|
+
success: boolean;
|
|
78
|
+
/** Response message from the server */
|
|
79
|
+
message: string;
|
|
80
|
+
/** Array of runtime instances */
|
|
81
|
+
runtimes: RuntimeData[];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Runtime domain model that wraps API responses with convenient methods.
|
|
85
|
+
* Provides state management and lifecycle operations for computational runtimes.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const runtime = await client.createRuntime({ environment_name: 'python-cpu' });
|
|
90
|
+
* await runtime.waitUntilReady();
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare class RuntimeDTO {
|
|
94
|
+
/** @internal */
|
|
95
|
+
_data: RuntimeData;
|
|
96
|
+
private _client;
|
|
97
|
+
private _deleted;
|
|
98
|
+
/**
|
|
99
|
+
* Create a Runtime instance.
|
|
100
|
+
*
|
|
101
|
+
* @param data - Runtime data from API
|
|
102
|
+
* @param client - Client instance
|
|
103
|
+
*/
|
|
104
|
+
constructor(data: RuntimeData, client: DatalayerClient);
|
|
105
|
+
/**
|
|
106
|
+
* Check if this runtime has been deleted and throw error if so.
|
|
107
|
+
* @throws Error if deleted
|
|
108
|
+
*/
|
|
109
|
+
private _checkDeleted;
|
|
110
|
+
/** Kubernetes pod name for the runtime instance. */
|
|
111
|
+
get podName(): string;
|
|
112
|
+
/** Unique identifier for the runtime. */
|
|
113
|
+
get uid(): string;
|
|
114
|
+
/** Name of the environment this runtime is based on. */
|
|
115
|
+
get environmentName(): string;
|
|
116
|
+
/** Ingress URL for accessing the runtime. */
|
|
117
|
+
get ingress(): string;
|
|
118
|
+
/** Authentication token for accessing the runtime. */
|
|
119
|
+
get token(): string;
|
|
120
|
+
/** Credits consumed per second. */
|
|
121
|
+
get burningRate(): number;
|
|
122
|
+
/** User-friendly name for the runtime. */
|
|
123
|
+
get givenName(): string;
|
|
124
|
+
/** Type of runtime (notebook, terminal, or job). */
|
|
125
|
+
get type(): string;
|
|
126
|
+
/** When the runtime started. */
|
|
127
|
+
get startedAt(): Date;
|
|
128
|
+
/** When the runtime will expire. */
|
|
129
|
+
get expiredAt(): Date;
|
|
130
|
+
/** Environment title for display. */
|
|
131
|
+
get environmentTitle(): string;
|
|
132
|
+
/**
|
|
133
|
+
* Delete this runtime permanently.
|
|
134
|
+
* After deletion, subsequent calls to dynamic methods will throw errors.
|
|
135
|
+
*/
|
|
136
|
+
delete(): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Update runtime from a snapshot.
|
|
139
|
+
*
|
|
140
|
+
* @param from - Snapshot identifier to restore from
|
|
141
|
+
* @returns Updated Runtime instance
|
|
142
|
+
*/
|
|
143
|
+
update(from: string): Promise<RuntimeDTO>;
|
|
144
|
+
/**
|
|
145
|
+
* Create a snapshot of this runtime.
|
|
146
|
+
*
|
|
147
|
+
* @param name - Name for the snapshot
|
|
148
|
+
* @param description - Optional description
|
|
149
|
+
* @param stop - Whether to stop runtime after snapshotting
|
|
150
|
+
* @returns Created Snapshot instance
|
|
151
|
+
*/
|
|
152
|
+
createSnapshot(name: string, description?: string, stop?: boolean): Promise<CodeSandboxSnapshotDTO>;
|
|
153
|
+
/**
|
|
154
|
+
* Get runtime data in camelCase format.
|
|
155
|
+
* Returns only the core fields that consumers need.
|
|
156
|
+
* This provides a stable interface regardless of API changes.
|
|
157
|
+
* Returns the current cached state - call getState() first if you need fresh data.
|
|
158
|
+
*
|
|
159
|
+
* @returns Core runtime data with camelCase properties
|
|
160
|
+
*/
|
|
161
|
+
toJSON(): RuntimeJSON;
|
|
162
|
+
/**
|
|
163
|
+
* Get the raw runtime data exactly as received from the API.
|
|
164
|
+
* This preserves the original snake_case naming from the API response.
|
|
165
|
+
* Returns the current cached state - call getState() first if you need fresh data.
|
|
166
|
+
*
|
|
167
|
+
* @returns Raw runtime data from API
|
|
168
|
+
*/
|
|
169
|
+
rawData(): RuntimeData;
|
|
170
|
+
/** String representation of the runtime. */
|
|
171
|
+
toString(): string;
|
|
172
|
+
}
|