@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,204 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Runtime domain model for the Datalayer Client.
|
|
7
|
+
*
|
|
8
|
+
* @module models/RuntimeDTO
|
|
9
|
+
*/
|
|
10
|
+
import { updateRuntime } from '../api/runtimes/runtimes';
|
|
11
|
+
import { validateJSON } from '@datalayer/core/lib/api/utils/validation';
|
|
12
|
+
/**
|
|
13
|
+
* Runtime domain model that wraps API responses with convenient methods.
|
|
14
|
+
* Provides state management and lifecycle operations for computational runtimes.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const runtime = await client.createRuntime({ environment_name: 'python-cpu' });
|
|
19
|
+
* await runtime.waitUntilReady();
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export class RuntimeDTO {
|
|
23
|
+
/** @internal */
|
|
24
|
+
_data;
|
|
25
|
+
_client;
|
|
26
|
+
_deleted = false;
|
|
27
|
+
/**
|
|
28
|
+
* Create a Runtime instance.
|
|
29
|
+
*
|
|
30
|
+
* @param data - Runtime data from API
|
|
31
|
+
* @param client - Client instance
|
|
32
|
+
*/
|
|
33
|
+
constructor(data, client) {
|
|
34
|
+
this._data = data;
|
|
35
|
+
this._client = client;
|
|
36
|
+
}
|
|
37
|
+
// ========================================================================
|
|
38
|
+
// Helper Methods
|
|
39
|
+
// ========================================================================
|
|
40
|
+
/**
|
|
41
|
+
* Check if this runtime has been deleted and throw error if so.
|
|
42
|
+
* @throws Error if deleted
|
|
43
|
+
*/
|
|
44
|
+
_checkDeleted() {
|
|
45
|
+
if (this._deleted) {
|
|
46
|
+
throw new Error(`Runtime ${this._data.pod_name} has been deleted and no longer exists`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// ========================================================================
|
|
50
|
+
// Static Properties (set at creation, never change)
|
|
51
|
+
// ========================================================================
|
|
52
|
+
/** Kubernetes pod name for the runtime instance. */
|
|
53
|
+
get podName() {
|
|
54
|
+
this._checkDeleted();
|
|
55
|
+
return this._data.pod_name;
|
|
56
|
+
}
|
|
57
|
+
/** Unique identifier for the runtime. */
|
|
58
|
+
get uid() {
|
|
59
|
+
this._checkDeleted();
|
|
60
|
+
return this._data.uid;
|
|
61
|
+
}
|
|
62
|
+
/** Name of the environment this runtime is based on. */
|
|
63
|
+
get environmentName() {
|
|
64
|
+
this._checkDeleted();
|
|
65
|
+
return this._data.environment_name;
|
|
66
|
+
}
|
|
67
|
+
/** Ingress URL for accessing the runtime. */
|
|
68
|
+
get ingress() {
|
|
69
|
+
this._checkDeleted();
|
|
70
|
+
return this._data.ingress;
|
|
71
|
+
}
|
|
72
|
+
/** Authentication token for accessing the runtime. */
|
|
73
|
+
get token() {
|
|
74
|
+
this._checkDeleted();
|
|
75
|
+
return this._data.token;
|
|
76
|
+
}
|
|
77
|
+
/** Credits consumed per second. */
|
|
78
|
+
get burningRate() {
|
|
79
|
+
this._checkDeleted();
|
|
80
|
+
return this._data.burning_rate;
|
|
81
|
+
}
|
|
82
|
+
/** User-friendly name for the runtime. */
|
|
83
|
+
get givenName() {
|
|
84
|
+
this._checkDeleted();
|
|
85
|
+
return this._data.given_name;
|
|
86
|
+
}
|
|
87
|
+
/** Type of runtime (notebook, terminal, or job). */
|
|
88
|
+
get type() {
|
|
89
|
+
this._checkDeleted();
|
|
90
|
+
return this._data.type;
|
|
91
|
+
}
|
|
92
|
+
/** When the runtime started. */
|
|
93
|
+
get startedAt() {
|
|
94
|
+
this._checkDeleted();
|
|
95
|
+
return new Date(Number(this._data.started_at) * 1000);
|
|
96
|
+
}
|
|
97
|
+
/** When the runtime will expire. */
|
|
98
|
+
get expiredAt() {
|
|
99
|
+
this._checkDeleted();
|
|
100
|
+
return new Date(Number(this._data.expired_at) * 1000);
|
|
101
|
+
}
|
|
102
|
+
/** Environment title for display. */
|
|
103
|
+
get environmentTitle() {
|
|
104
|
+
this._checkDeleted();
|
|
105
|
+
return this._data.environment_title || '';
|
|
106
|
+
}
|
|
107
|
+
// ========================================================================
|
|
108
|
+
// Action Methods
|
|
109
|
+
// ========================================================================
|
|
110
|
+
/**
|
|
111
|
+
* Delete this runtime permanently.
|
|
112
|
+
* After deletion, subsequent calls to dynamic methods will throw errors.
|
|
113
|
+
*/
|
|
114
|
+
async delete() {
|
|
115
|
+
await this._client.deleteRuntime(this.podName);
|
|
116
|
+
this._deleted = true;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Update runtime from a snapshot.
|
|
120
|
+
*
|
|
121
|
+
* @param from - Snapshot identifier to restore from
|
|
122
|
+
* @returns Updated Runtime instance
|
|
123
|
+
*/
|
|
124
|
+
async update(from) {
|
|
125
|
+
this._checkDeleted();
|
|
126
|
+
const updated = await updateRuntime(this._client.getToken(), this.podName, from, this._client.getRuntimesUrl());
|
|
127
|
+
return new RuntimeDTO(updated, this._client);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Create a snapshot of this runtime.
|
|
131
|
+
*
|
|
132
|
+
* @param name - Name for the snapshot
|
|
133
|
+
* @param description - Optional description
|
|
134
|
+
* @param stop - Whether to stop runtime after snapshotting
|
|
135
|
+
* @returns Created Snapshot instance
|
|
136
|
+
*/
|
|
137
|
+
async createSnapshot(name, description, stop) {
|
|
138
|
+
this._checkDeleted();
|
|
139
|
+
return await this._client.createSnapshot(this.podName, name, description, stop);
|
|
140
|
+
}
|
|
141
|
+
// ========================================================================
|
|
142
|
+
// Utility Methods
|
|
143
|
+
// ========================================================================
|
|
144
|
+
/**
|
|
145
|
+
* Get runtime data in camelCase format.
|
|
146
|
+
* Returns only the core fields that consumers need.
|
|
147
|
+
* This provides a stable interface regardless of API changes.
|
|
148
|
+
* Returns the current cached state - call getState() first if you need fresh data.
|
|
149
|
+
*
|
|
150
|
+
* @returns Core runtime data with camelCase properties
|
|
151
|
+
*/
|
|
152
|
+
toJSON() {
|
|
153
|
+
this._checkDeleted();
|
|
154
|
+
// Safely convert dates to ISO strings, handling invalid dates
|
|
155
|
+
const safeToISO = (date) => {
|
|
156
|
+
try {
|
|
157
|
+
const iso = date.toISOString();
|
|
158
|
+
return iso;
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
// If date is invalid, return empty string or current time
|
|
162
|
+
return new Date().toISOString();
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
const obj = {
|
|
166
|
+
// Core identifiers
|
|
167
|
+
uid: this.uid,
|
|
168
|
+
podName: this.podName,
|
|
169
|
+
givenName: this.givenName,
|
|
170
|
+
// Environment info
|
|
171
|
+
environmentName: this.environmentName,
|
|
172
|
+
environmentTitle: this.environmentTitle,
|
|
173
|
+
// State and type
|
|
174
|
+
type: this.type,
|
|
175
|
+
// Burning
|
|
176
|
+
burningRate: this.burningRate,
|
|
177
|
+
// URLs and tokens
|
|
178
|
+
// FIXME: Consider renaming? jupyterServerUrl and jupyterServerToken
|
|
179
|
+
ingress: this.ingress,
|
|
180
|
+
token: this.token,
|
|
181
|
+
// Timing
|
|
182
|
+
startedAt: safeToISO(this.startedAt),
|
|
183
|
+
expiredAt: safeToISO(this.expiredAt),
|
|
184
|
+
};
|
|
185
|
+
validateJSON(obj, 'Runtime');
|
|
186
|
+
return obj;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Get the raw runtime data exactly as received from the API.
|
|
190
|
+
* This preserves the original snake_case naming from the API response.
|
|
191
|
+
* Returns the current cached state - call getState() first if you need fresh data.
|
|
192
|
+
*
|
|
193
|
+
* @returns Raw runtime data from API
|
|
194
|
+
*/
|
|
195
|
+
rawData() {
|
|
196
|
+
this._checkDeleted();
|
|
197
|
+
return this._data;
|
|
198
|
+
}
|
|
199
|
+
/** String representation of the runtime. */
|
|
200
|
+
toString() {
|
|
201
|
+
this._checkDeleted();
|
|
202
|
+
return `Runtime(${this.podName}, ${this.environmentName})`;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SpaceMember } from './SpaceMember';
|
|
2
|
+
import { ISpaceItem } from './SpaceItem';
|
|
3
|
+
import { ICourse as ICourse } from './Course';
|
|
4
|
+
import { IOrganization } from '@datalayer/core/lib/models/Organization';
|
|
5
|
+
import { IUser } from '@datalayer/core/lib/models/User';
|
|
6
|
+
/**
|
|
7
|
+
* Convert the raw space object to {@link ISpace}.
|
|
8
|
+
*
|
|
9
|
+
* @param user Raw space object from DB
|
|
10
|
+
* @returns Space
|
|
11
|
+
*/
|
|
12
|
+
export declare const asSpace: (raw_space: any) => ISpace;
|
|
13
|
+
export type ISpaceVariant = 'default' | 'course' | 'project';
|
|
14
|
+
export type IAnySpace = ISpace | ICourse;
|
|
15
|
+
export type IBaseSpace = {
|
|
16
|
+
id: string;
|
|
17
|
+
handle: string;
|
|
18
|
+
type: string;
|
|
19
|
+
variant: ISpaceVariant;
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
creationDate: Date;
|
|
23
|
+
public: boolean;
|
|
24
|
+
owner: IUser;
|
|
25
|
+
organization?: Partial<IOrganization>;
|
|
26
|
+
members?: SpaceMember[];
|
|
27
|
+
sharedOwnerUserUids?: string[];
|
|
28
|
+
};
|
|
29
|
+
export type ISpace = IBaseSpace & {
|
|
30
|
+
type: 'space';
|
|
31
|
+
variant: 'default';
|
|
32
|
+
items?: Array<ISpaceItem>;
|
|
33
|
+
itemIds?: Array<string>;
|
|
34
|
+
};
|
|
35
|
+
export default ISpace;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
import { asUser } from '@datalayer/core/lib/models/User';
|
|
6
|
+
import { asArray } from '@datalayer/core/lib/utils';
|
|
7
|
+
/**
|
|
8
|
+
* Convert the raw space object to {@link ISpace}.
|
|
9
|
+
*
|
|
10
|
+
* @param user Raw space object from DB
|
|
11
|
+
* @returns Space
|
|
12
|
+
*/
|
|
13
|
+
export const asSpace = (raw_space) => {
|
|
14
|
+
const sharedOwnerUserUids = asArray(raw_space?.shared_owner_user_uids_ss ||
|
|
15
|
+
raw_space?.shared_ower_user_uids_ss ||
|
|
16
|
+
[]).filter((uid) => typeof uid === 'string' && uid.length > 0);
|
|
17
|
+
// The backend resolves the canonical (friendly) account handles and exposes
|
|
18
|
+
// them as `space.owner` and `space.organization`. Trust those single sources
|
|
19
|
+
// of truth; do not invent fallbacks here.
|
|
20
|
+
const organizationHandle = raw_space?.organization?.handle;
|
|
21
|
+
const owner = raw_space?.owner
|
|
22
|
+
? asUser(raw_space.owner)
|
|
23
|
+
: {
|
|
24
|
+
id: '',
|
|
25
|
+
handle: '',
|
|
26
|
+
email: '',
|
|
27
|
+
firstName: '',
|
|
28
|
+
lastName: '',
|
|
29
|
+
initials: '',
|
|
30
|
+
displayName: '',
|
|
31
|
+
roles: [],
|
|
32
|
+
iamProviders: [],
|
|
33
|
+
setRoles: () => { },
|
|
34
|
+
unsubscribedFromOutbounds: false,
|
|
35
|
+
onboarding: {},
|
|
36
|
+
events: [],
|
|
37
|
+
settings: {},
|
|
38
|
+
};
|
|
39
|
+
let members = new Array();
|
|
40
|
+
if (raw_space.members) {
|
|
41
|
+
members = asArray(raw_space.members).map(m => {
|
|
42
|
+
const member = asUser(m);
|
|
43
|
+
return member;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const space = {
|
|
47
|
+
id: raw_space.uid,
|
|
48
|
+
handle: raw_space.handle_s,
|
|
49
|
+
type: 'space',
|
|
50
|
+
variant: raw_space.variant_s,
|
|
51
|
+
name: raw_space.name_t,
|
|
52
|
+
description: raw_space.description_t,
|
|
53
|
+
public: raw_space.public_b,
|
|
54
|
+
members,
|
|
55
|
+
creationDate: new Date(raw_space.creation_ts_dt),
|
|
56
|
+
owner,
|
|
57
|
+
organization: organizationHandle
|
|
58
|
+
? { handle: organizationHandle }
|
|
59
|
+
: undefined,
|
|
60
|
+
sharedOwnerUserUids,
|
|
61
|
+
// Preserve raw Solr fields so consumers can access dynamic fields
|
|
62
|
+
// (e.g. attached_agent_pod_name_s for project-agent assignment)
|
|
63
|
+
...raw_space,
|
|
64
|
+
};
|
|
65
|
+
return space;
|
|
66
|
+
};
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import type { AgentRuntimesClient as DatalayerClient } from '../client/AgentRuntimesClient';
|
|
2
|
+
import { NotebookDTO, type NotebookJSON } from './NotebookDTO';
|
|
3
|
+
import { NotebookData } from './NotebookDTO';
|
|
4
|
+
import { LexicalDTO, type LexicalJSON } from './LexicalDTO';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a workspace or project space in Datalayer
|
|
7
|
+
* @interface SpaceData
|
|
8
|
+
*/
|
|
9
|
+
export interface SpaceData {
|
|
10
|
+
uid: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
name_t: string;
|
|
13
|
+
handle_s: string;
|
|
14
|
+
variant_s: string;
|
|
15
|
+
description_t: string;
|
|
16
|
+
tags_ss?: string[];
|
|
17
|
+
members?: any[];
|
|
18
|
+
items?: any[];
|
|
19
|
+
public_b?: boolean;
|
|
20
|
+
creation_ts_dt?: string;
|
|
21
|
+
attached_agent_pod_name_s?: string;
|
|
22
|
+
attached_agent_spec_id_s?: string;
|
|
23
|
+
attached_agent_given_name_s?: string;
|
|
24
|
+
shared_owner_user_uids_ss?: string[];
|
|
25
|
+
shared_ower_user_uids_ss?: string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Stable public interface for Space data.
|
|
29
|
+
* This is the contract that Client consumers can rely on.
|
|
30
|
+
* The raw API may change, but this interface remains stable.
|
|
31
|
+
*/
|
|
32
|
+
export interface SpaceJSON {
|
|
33
|
+
/** ulid for the space */
|
|
34
|
+
uid: string;
|
|
35
|
+
/** Name of the space */
|
|
36
|
+
name: string;
|
|
37
|
+
/** Handle for the space */
|
|
38
|
+
handle: string;
|
|
39
|
+
/** Variant of the space */
|
|
40
|
+
variant: string;
|
|
41
|
+
/** Description of the space */
|
|
42
|
+
description: string;
|
|
43
|
+
/** Items contained in the space (as JSON) */
|
|
44
|
+
items: Array<NotebookJSON | LexicalJSON>;
|
|
45
|
+
/** Owner user UIDs for this space */
|
|
46
|
+
ownerUserUids?: string[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Space domain model that wraps API responses with convenient methods.
|
|
50
|
+
* Provides workspace management with data refresh and content creation operations.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const space = spaces[0];
|
|
55
|
+
* const items = await space.getItems();
|
|
56
|
+
* const notebook = await space.createNotebook({ name: 'Analysis' });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare class SpaceDTO {
|
|
60
|
+
protected _data: SpaceData;
|
|
61
|
+
private _client;
|
|
62
|
+
private _items;
|
|
63
|
+
private _deleted;
|
|
64
|
+
/**
|
|
65
|
+
* Create a Space instance.
|
|
66
|
+
*
|
|
67
|
+
* @param data - Space data from API
|
|
68
|
+
* @param client - Client instance
|
|
69
|
+
*/
|
|
70
|
+
constructor(data: SpaceData, client: DatalayerClient);
|
|
71
|
+
/**
|
|
72
|
+
* Check if this space has been deleted and throw error if so.
|
|
73
|
+
* @throws Error if deleted
|
|
74
|
+
*/
|
|
75
|
+
private _checkDeleted;
|
|
76
|
+
/**
|
|
77
|
+
* Refresh space data from the API by fetching user's spaces.
|
|
78
|
+
*/
|
|
79
|
+
refresh(): Promise<void>;
|
|
80
|
+
/** Unique identifier for the space. */
|
|
81
|
+
get uid(): string;
|
|
82
|
+
/** URL-friendly handle for the space. */
|
|
83
|
+
get handle(): string;
|
|
84
|
+
/** Space variant type. */
|
|
85
|
+
get variant(): string;
|
|
86
|
+
/**
|
|
87
|
+
* The name of the space.
|
|
88
|
+
*/
|
|
89
|
+
get name(): string;
|
|
90
|
+
/**
|
|
91
|
+
* The description of the space.
|
|
92
|
+
*/
|
|
93
|
+
get description(): string;
|
|
94
|
+
/**
|
|
95
|
+
* Helper method to create items in this space.
|
|
96
|
+
*
|
|
97
|
+
* @param itemType - Type of item to create
|
|
98
|
+
* @param data - Creation configuration
|
|
99
|
+
* @returns Created model instance
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
private _createItem;
|
|
103
|
+
/**
|
|
104
|
+
* Get all items in this space as model instances.
|
|
105
|
+
*
|
|
106
|
+
* @returns Array of Notebook and Lexical model instances
|
|
107
|
+
*/
|
|
108
|
+
getItems(): Promise<(NotebookDTO | LexicalDTO)[]>;
|
|
109
|
+
/**
|
|
110
|
+
* Create a new notebook in this space.
|
|
111
|
+
*
|
|
112
|
+
* @param data - Notebook creation configuration
|
|
113
|
+
* @returns Created Notebook instance
|
|
114
|
+
*/
|
|
115
|
+
createNotebook(data: {
|
|
116
|
+
name: string;
|
|
117
|
+
description: string;
|
|
118
|
+
file?: File | Blob;
|
|
119
|
+
}): Promise<NotebookDTO>;
|
|
120
|
+
/**
|
|
121
|
+
* Create a new lexical document in this space.
|
|
122
|
+
*
|
|
123
|
+
* @param data - Lexical creation configuration
|
|
124
|
+
* @returns Created Lexical instance
|
|
125
|
+
*/
|
|
126
|
+
createLexical(data: {
|
|
127
|
+
name: string;
|
|
128
|
+
description: string;
|
|
129
|
+
file?: File | Blob;
|
|
130
|
+
}): Promise<LexicalDTO>;
|
|
131
|
+
/**
|
|
132
|
+
* Get raw space data object.
|
|
133
|
+
* Returns cached data without refreshing.
|
|
134
|
+
*
|
|
135
|
+
* @returns Raw space data object
|
|
136
|
+
*/
|
|
137
|
+
/**
|
|
138
|
+
* Get space data in camelCase format.
|
|
139
|
+
* Returns only the core fields that consumers need.
|
|
140
|
+
* This provides a stable interface regardless of API changes.
|
|
141
|
+
*
|
|
142
|
+
* @returns Core space data with camelCase properties
|
|
143
|
+
*/
|
|
144
|
+
toJSON(): SpaceJSON;
|
|
145
|
+
/**
|
|
146
|
+
* Get the raw space data exactly as received from the API.
|
|
147
|
+
* This preserves the original snake_case naming from the API response.
|
|
148
|
+
*
|
|
149
|
+
* @returns Raw space data from API
|
|
150
|
+
*/
|
|
151
|
+
rawData(): SpaceData;
|
|
152
|
+
/** String representation of the space. */
|
|
153
|
+
toString(): string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Request payload for creating a new space
|
|
157
|
+
* @interface CreateSpaceRequest
|
|
158
|
+
*/
|
|
159
|
+
export interface CreateSpaceRequest {
|
|
160
|
+
name: string;
|
|
161
|
+
description: string;
|
|
162
|
+
variant: string;
|
|
163
|
+
spaceHandle: string;
|
|
164
|
+
organizationId: string;
|
|
165
|
+
seedSpaceId: string;
|
|
166
|
+
public: boolean;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Response from getting a collaboration session ID
|
|
170
|
+
* @interface CollaborationSessionResponse
|
|
171
|
+
*/
|
|
172
|
+
export interface CollaborationSessionResponse {
|
|
173
|
+
success: boolean;
|
|
174
|
+
sessionId?: string;
|
|
175
|
+
error?: string;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Response from creating a space
|
|
179
|
+
* @interface CreateSpaceResponse
|
|
180
|
+
*/
|
|
181
|
+
export interface CreateSpaceResponse {
|
|
182
|
+
success: boolean;
|
|
183
|
+
message: string;
|
|
184
|
+
space?: SpaceData;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Request payload for creating a new notebook (multipart/form-data)
|
|
188
|
+
* @interface CreateNotebookRequest
|
|
189
|
+
*/
|
|
190
|
+
export interface CreateNotebookRequest {
|
|
191
|
+
spaceId: string;
|
|
192
|
+
notebookType: string;
|
|
193
|
+
name: string;
|
|
194
|
+
description: string;
|
|
195
|
+
file?: File | Blob;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Response from creating a notebook
|
|
199
|
+
* @interface CreateNotebookResponse
|
|
200
|
+
*/
|
|
201
|
+
export interface CreateNotebookResponse {
|
|
202
|
+
success: boolean;
|
|
203
|
+
message: string;
|
|
204
|
+
notebook?: NotebookData;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Response from getting a notebook
|
|
208
|
+
* @interface GetNotebookResponse
|
|
209
|
+
*/
|
|
210
|
+
export interface GetNotebookResponse {
|
|
211
|
+
success: boolean;
|
|
212
|
+
message: string;
|
|
213
|
+
notebook?: NotebookData;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Request payload for updating a notebook
|
|
217
|
+
* @interface UpdateNotebookRequest
|
|
218
|
+
*/
|
|
219
|
+
export interface UpdateNotebookRequest {
|
|
220
|
+
name?: string;
|
|
221
|
+
description?: string;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Response from updating a notebook
|
|
225
|
+
* @interface UpdateNotebookResponse
|
|
226
|
+
*/
|
|
227
|
+
export interface UpdateNotebookResponse {
|
|
228
|
+
success: boolean;
|
|
229
|
+
message: string;
|
|
230
|
+
notebook?: NotebookData;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Represents an item within a space
|
|
234
|
+
* @interface SpaceItem
|
|
235
|
+
*/
|
|
236
|
+
export interface SpaceItem {
|
|
237
|
+
id: string;
|
|
238
|
+
type_s: 'notebook' | 'lexical';
|
|
239
|
+
space_id: string;
|
|
240
|
+
item_id: string;
|
|
241
|
+
name: string;
|
|
242
|
+
created_at: string;
|
|
243
|
+
updated_at?: string;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Response from getting space items
|
|
247
|
+
* @interface GetSpaceItemsResponse
|
|
248
|
+
*/
|
|
249
|
+
export interface GetSpaceItemsResponse {
|
|
250
|
+
success: boolean;
|
|
251
|
+
message: string;
|
|
252
|
+
items: SpaceItem[];
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Response from deleting a space item
|
|
256
|
+
* @interface DeleteSpaceItemResponse
|
|
257
|
+
*/
|
|
258
|
+
export interface DeleteSpaceItemResponse {
|
|
259
|
+
success: boolean;
|
|
260
|
+
message: string;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Response from getting a single space item
|
|
264
|
+
* @interface GetSpaceItemResponse
|
|
265
|
+
*/
|
|
266
|
+
export interface GetSpaceItemResponse {
|
|
267
|
+
success: boolean;
|
|
268
|
+
message: string;
|
|
269
|
+
item?: any;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Response from getting spaces for a user
|
|
273
|
+
* @interface SpacesForUserResponse
|
|
274
|
+
*/
|
|
275
|
+
export interface SpacesForUserResponse {
|
|
276
|
+
success: boolean;
|
|
277
|
+
message: string;
|
|
278
|
+
spaces: SpaceData[];
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Request payload for updating a space.
|
|
282
|
+
* Supports arbitrary Solr fields via index signature.
|
|
283
|
+
* @interface UpdateSpaceRequest
|
|
284
|
+
*/
|
|
285
|
+
export interface UpdateSpaceRequest {
|
|
286
|
+
name?: string;
|
|
287
|
+
description?: string;
|
|
288
|
+
[key: string]: unknown;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Response from getting a space by ID
|
|
292
|
+
* @interface GetSpaceResponse
|
|
293
|
+
*/
|
|
294
|
+
export interface GetSpaceResponse {
|
|
295
|
+
success: boolean;
|
|
296
|
+
message: string;
|
|
297
|
+
space?: SpaceData;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Response from updating a space
|
|
301
|
+
* @interface UpdateSpaceResponse
|
|
302
|
+
*/
|
|
303
|
+
export interface UpdateSpaceResponse {
|
|
304
|
+
success: boolean;
|
|
305
|
+
message: string;
|
|
306
|
+
space?: SpaceData;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Response from deleting a space
|
|
310
|
+
* @interface DeleteSpaceResponse
|
|
311
|
+
*/
|
|
312
|
+
export interface DeleteSpaceResponse {
|
|
313
|
+
success: boolean;
|
|
314
|
+
message: string;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Response from getting default items for a space
|
|
318
|
+
* @interface GetSpaceDefaultItemsResponse
|
|
319
|
+
*/
|
|
320
|
+
export interface GetSpaceDefaultItemsResponse {
|
|
321
|
+
success: boolean;
|
|
322
|
+
message: string;
|
|
323
|
+
default_notebook_uid: string | null;
|
|
324
|
+
default_document_uid: string | null;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Response from getting spaces by type
|
|
328
|
+
* @interface GetSpacesByTypeResponse
|
|
329
|
+
*/
|
|
330
|
+
export interface GetSpacesByTypeResponse {
|
|
331
|
+
success: boolean;
|
|
332
|
+
message: string;
|
|
333
|
+
spaces: SpaceData[];
|
|
334
|
+
}
|