@datalayer/agent-runtimes 1.0.9 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -1
- package/lib/{AgentLexical.d.ts → AgentDocument.d.ts} +5 -5
- package/lib/{AgentLexical.js → AgentDocument.js} +156 -26
- package/lib/AgentNode.js +32 -31
- package/lib/AgentNotebook.js +172 -17
- package/lib/AppExamples2.css +47 -0
- package/lib/AppExamples2.d.ts +3 -0
- package/lib/AppExamples2.js +21 -0
- package/lib/{agent-lexical-main.js → agent-document-main.js} +2 -2
- package/lib/agents/AgentRuntimeChat.d.ts +73 -0
- package/lib/agents/AgentRuntimeChat.js +198 -0
- package/lib/api/index.d.ts +12 -0
- package/lib/api/index.js +46 -0
- package/lib/api/runtimes/checkpoints.d.ts +122 -0
- package/lib/api/runtimes/checkpoints.js +118 -0
- package/lib/api/runtimes/environments.d.ts +9 -0
- package/lib/api/runtimes/environments.js +29 -0
- package/lib/api/runtimes/healthz.d.ts +15 -0
- package/lib/api/runtimes/healthz.js +44 -0
- package/lib/api/runtimes/index.d.ts +12 -0
- package/lib/api/runtimes/index.js +16 -0
- package/lib/api/runtimes/runtimes.d.ts +138 -0
- package/lib/api/runtimes/runtimes.js +230 -0
- package/lib/api/runtimes/snapshots.d.ts +38 -0
- package/lib/api/runtimes/snapshots.js +82 -0
- package/lib/api/scheduler/index.d.ts +6 -0
- package/lib/api/scheduler/index.js +10 -0
- package/lib/api/scheduler/schedules.d.ts +85 -0
- package/lib/api/scheduler/schedules.js +78 -0
- package/lib/api/spacer/documents.d.ts +12 -0
- package/lib/api/spacer/documents.js +43 -0
- package/lib/api/spacer/healthz.d.ts +15 -0
- package/lib/api/spacer/healthz.js +44 -0
- package/lib/api/spacer/index.d.ts +15 -0
- package/lib/api/spacer/index.js +19 -0
- package/lib/api/spacer/items.d.ts +25 -0
- package/lib/api/spacer/items.js +55 -0
- package/lib/api/spacer/lexicals.d.ts +34 -0
- package/lib/api/spacer/lexicals.js +89 -0
- package/lib/api/spacer/notebooks.d.ts +34 -0
- package/lib/api/spacer/notebooks.js +89 -0
- package/lib/api/spacer/spaces.d.ts +84 -0
- package/lib/api/spacer/spaces.js +170 -0
- package/lib/api/spacer/users.d.ts +9 -0
- package/lib/api/spacer/users.js +29 -0
- package/lib/chat/Chat.d.ts +1 -1
- package/lib/chat/Chat.js +54 -54
- package/lib/chat/ChatFloating.d.ts +2 -2
- package/lib/chat/ChatFloating.js +136 -25
- package/lib/chat/ChatSidebar.js +20 -22
- package/lib/chat/base/ChatBase.js +468 -40
- package/lib/chat/display/EmptyState.js +21 -21
- package/lib/chat/document/EphemeralDocument.d.ts +23 -0
- package/lib/chat/document/EphemeralDocument.js +270 -0
- package/lib/chat/header/ChatHeaderBase.d.ts +12 -2
- package/lib/chat/header/ChatHeaderBase.js +78 -23
- package/lib/chat/index.d.ts +1 -0
- package/lib/chat/index.js +2 -0
- package/lib/chat/notebook/EphemeralNotebook.d.ts +24 -0
- package/lib/chat/notebook/EphemeralNotebook.js +252 -0
- package/lib/chat/prompt/InputFooter.js +4 -1
- package/lib/client/AgentRuntimesClient.d.ts +127 -0
- package/lib/client/AgentRuntimesClient.js +36 -0
- package/lib/client/AgentsMixin.d.ts +4 -4
- package/lib/client/AgentsMixin.js +35 -35
- package/lib/client/SdkAgentRuntimesClient.d.ts +1 -1
- package/lib/client/SdkAgentRuntimesClient.js +1 -1
- package/lib/client/mixins/RuntimesMixin.d.ts +93 -0
- package/lib/client/mixins/RuntimesMixin.js +229 -0
- package/lib/client/mixins/SpacerMixin.d.ts +210 -0
- package/lib/client/mixins/SpacerMixin.js +615 -0
- package/lib/client/utils/spacerUtils.d.ts +18 -0
- package/lib/client/utils/spacerUtils.js +32 -0
- package/lib/collaboration/DatalayerCollaboration.d.ts +13 -0
- package/lib/collaboration/DatalayerCollaboration.js +28 -0
- package/lib/collaboration/DatalayerCollaborationProvider.d.ts +58 -0
- package/lib/collaboration/DatalayerCollaborationProvider.js +148 -0
- package/lib/collaboration/index.d.ts +2 -0
- package/lib/collaboration/index.js +6 -0
- package/lib/components/AgentSummary.d.ts +19 -0
- package/lib/components/AgentSummary.js +89 -0
- package/lib/components/ToolApprovalCard.js +13 -3
- package/lib/components/a2ui/A2uiSurfaceComposed.d.ts +13 -0
- package/lib/components/a2ui/A2uiSurfaceComposed.js +110 -0
- package/lib/components/a2ui/index.d.ts +2 -0
- package/lib/components/a2ui/index.js +6 -0
- package/lib/components/a2ui/styles.d.ts +14 -0
- package/lib/components/a2ui/styles.js +142 -0
- package/lib/components/context/SpaceSelect.d.ts +2 -0
- package/lib/components/context/SpaceSelect.js +42 -0
- package/lib/components/flashes/FlashDisclaimer.d.ts +2 -0
- package/lib/components/flashes/FlashDisclaimer.js +17 -0
- package/lib/components/icons/ArtifactIcon.d.ts +10 -0
- package/lib/components/icons/ArtifactIcon.js +58 -0
- package/lib/components/icons/index.d.ts +1 -0
- package/lib/components/icons/index.js +5 -0
- package/lib/components/index.d.ts +5 -0
- package/lib/components/index.js +5 -0
- package/lib/components/nbgrader/NbGradesDetails.d.ts +5 -0
- package/lib/components/nbgrader/NbGradesDetails.js +19 -0
- package/lib/components/nbgrader/index.d.ts +1 -0
- package/lib/components/nbgrader/index.js +5 -0
- package/lib/components/progress/CreditsIndicator.d.ts +33 -0
- package/lib/components/progress/CreditsIndicator.js +23 -0
- package/lib/components/progress/index.d.ts +2 -0
- package/lib/components/progress/index.js +6 -0
- package/lib/components/runtimes/RuntimeCellVariables.d.ts +39 -0
- package/lib/components/runtimes/RuntimeCellVariables.js +172 -0
- package/lib/components/runtimes/RuntimeCellVariablesDialog.d.ts +37 -0
- package/lib/components/runtimes/RuntimeCellVariablesDialog.js +101 -0
- package/lib/components/runtimes/RuntimeLauncherDialog.d.ts +57 -0
- package/lib/components/runtimes/RuntimeLauncherDialog.js +275 -0
- package/lib/components/runtimes/RuntimePickerBase.d.ts +69 -0
- package/lib/components/runtimes/RuntimePickerBase.js +122 -0
- package/lib/components/runtimes/RuntimePickerCell.d.ts +34 -0
- package/lib/components/runtimes/RuntimePickerCell.js +104 -0
- package/lib/components/runtimes/RuntimePickerNotebook.d.ts +42 -0
- package/lib/components/runtimes/RuntimePickerNotebook.js +232 -0
- package/lib/components/runtimes/RuntimeReservationControl.d.ts +47 -0
- package/lib/components/runtimes/RuntimeReservationControl.js +42 -0
- package/lib/components/runtimes/RuntimeSimplePicker.d.ts +38 -0
- package/lib/components/runtimes/RuntimeSimplePicker.js +155 -0
- package/lib/components/runtimes/RuntimeTransfer.d.ts +16 -0
- package/lib/components/runtimes/RuntimeTransfer.js +5 -0
- package/lib/components/runtimes/RuntimeUtils.d.ts +17 -0
- package/lib/components/runtimes/RuntimeUtils.js +178 -0
- package/lib/components/runtimes/RuntimeVariables.d.ts +38 -0
- package/lib/components/runtimes/RuntimeVariables.js +75 -0
- package/lib/components/runtimes/index.d.ts +11 -0
- package/lib/components/runtimes/index.js +15 -0
- package/lib/components/scheduler/ScheduleMenu.d.ts +54 -0
- package/lib/components/scheduler/ScheduleMenu.js +154 -0
- package/lib/components/scheduler/index.d.ts +1 -0
- package/lib/components/scheduler/index.js +5 -0
- package/lib/components/snapshots/SandboxSnapshotMenu.d.ts +33 -0
- package/lib/components/snapshots/SandboxSnapshotMenu.js +169 -0
- package/lib/components/snapshots/index.d.ts +1 -0
- package/lib/components/snapshots/index.js +5 -0
- package/lib/components/snippets/SnippetDialog.d.ts +42 -0
- package/lib/components/snippets/SnippetDialog.js +42 -0
- package/lib/components/students/StudentItemStatus.d.ts +7 -0
- package/lib/components/students/StudentItemStatus.js +68 -0
- package/lib/components/students/index.d.ts +1 -0
- package/lib/components/students/index.js +5 -0
- package/lib/components/tokens/SpaceVariantToken.d.ts +5 -0
- package/lib/components/tokens/SpaceVariantToken.js +23 -0
- package/lib/components/tokens/index.d.ts +1 -0
- package/lib/components/tokens/index.js +5 -0
- package/lib/components/toolbars/AssignmentEditorToolbar.d.ts +4 -0
- package/lib/components/toolbars/AssignmentEditorToolbar.js +18 -0
- package/lib/components/toolbars/DocumentEditorToolbar.d.ts +2 -0
- package/lib/components/toolbars/DocumentEditorToolbar.js +12 -0
- package/lib/components/toolbars/NotebookEditorToolbar.d.ts +29 -0
- package/lib/components/toolbars/NotebookEditorToolbar.js +30 -0
- package/lib/config/AgentConfiguration.d.ts +2 -2
- package/lib/config/index.d.ts +1 -1
- package/lib/context/ContextInspector.d.ts +1 -14
- package/lib/context/ContextInspector.js +3 -73
- package/lib/context/CostUsageChart.d.ts +4 -3
- package/lib/context/CostUsageChart.js +236 -35
- package/lib/context/MessageHistory.d.ts +30 -0
- package/lib/context/MessageHistory.js +129 -0
- package/lib/context/TokenUsageChart.d.ts +4 -3
- package/lib/context/TokenUsageChart.js +180 -30
- package/lib/context/TurnGraphChart.d.ts +1 -1
- package/lib/context/TurnGraphChart.js +6 -6
- package/lib/examples/A2UiAgentExample.d.ts +22 -0
- package/lib/examples/A2UiAgentExample.js +442 -0
- package/lib/examples/A2UiComponentsGalleryExample.d.ts +3 -0
- package/lib/examples/A2UiComponentsGalleryExample.js +863 -0
- package/lib/examples/A2UiContactCardExample.js +9 -5
- package/lib/examples/A2UiRestaurantExample.js +23 -8
- package/lib/examples/A2UiViewerExample.js +75 -3
- package/lib/examples/AgUiAgenticExample.d.ts +1 -12
- package/lib/examples/AgUiAgenticExample.js +52 -8
- package/lib/examples/AgUiBackendToolRenderingExample.d.ts +1 -16
- package/lib/examples/AgUiBackendToolRenderingExample.js +32 -17
- package/lib/examples/AgUiHaikuGenUiExample.d.ts +1 -17
- package/lib/examples/AgUiHaikuGenUiExample.js +49 -33
- package/lib/examples/AgUiHumanInTheLoopExample.d.ts +1 -12
- package/lib/examples/AgUiHumanInTheLoopExample.js +21 -6
- package/lib/examples/AgUiSharedStateExample.d.ts +1 -14
- package/lib/examples/AgUiSharedStateExample.js +21 -6
- package/lib/examples/AgUiToolsBasedGenUiExample.d.ts +1 -14
- package/lib/examples/AgUiToolsBasedGenUiExample.js +21 -6
- package/lib/examples/AgentCheckpointsExample.d.ts +1 -1
- package/lib/examples/AgentCheckpointsExample.js +21 -22
- package/lib/examples/AgentCodemodeExample.js +3 -3
- package/lib/examples/AgentEvalsExample.js +8 -8
- package/lib/examples/AgentGuardrailsExample.js +22 -17
- package/lib/examples/AgentHooksExample.js +16 -57
- package/lib/examples/AgentInferenceProviderExample.js +8 -8
- package/lib/examples/AgentLoopExample.d.ts +10 -0
- package/lib/examples/AgentLoopExample.js +304 -0
- package/lib/examples/AgentMCPExample.js +9 -9
- package/lib/examples/AgentMemoryExample.js +6 -6
- package/lib/examples/AgentMonitoringExample.js +116 -46
- package/lib/examples/AgentNotificationsExample.js +6 -6
- package/lib/examples/AgentOtelExample.d.ts +3 -3
- package/lib/examples/AgentOtelExample.js +20 -15
- package/lib/examples/AgentOutputsExample.js +8 -8
- package/lib/examples/AgentParametersExample.js +24 -36
- package/lib/examples/AgentSandboxExample.js +7 -7
- package/lib/examples/AgentSkillsExample.js +9 -9
- package/lib/examples/AgentSubagentsExample.js +6 -6
- package/lib/examples/AgentToolApprovalsExample.js +37 -11
- package/lib/examples/AgentTriggersExample.js +12 -12
- package/lib/examples/AgentspecsExample.js +63 -41
- package/lib/examples/ChatCustomExample.js +23 -77
- package/lib/examples/ChatExample.js +15 -46
- package/lib/examples/LexicalAgentExample.js +43 -91
- package/lib/examples/LexicalAgentSidebarExample.js +45 -73
- package/lib/examples/NotebookAgentExample.js +52 -81
- package/lib/examples/NotebookAgentSidebarExample.js +43 -71
- package/lib/examples/NotebookCollaborationExample.js +11 -9
- package/lib/examples/NotebookExample.js +5 -2
- package/lib/examples/components/AuthRequiredView.js +1 -1
- package/lib/examples/components/ExampleErrorBoundary.d.ts +46 -0
- package/lib/examples/components/ExampleErrorBoundary.js +67 -0
- package/lib/examples/components/haiku/haiku-card.css +11 -0
- package/lib/examples/components/weather/weather-card.css +11 -0
- package/lib/examples/example-selector.js +3 -1
- package/lib/examples/hooks/useExampleAgentRuntime.d.ts +35 -0
- package/lib/examples/hooks/useExampleAgentRuntime.js +82 -0
- package/lib/examples/hooks/useSpecRenderToolResult.d.ts +30 -0
- package/lib/examples/hooks/useSpecRenderToolResult.js +61 -0
- package/lib/examples/index.d.ts +3 -1
- package/lib/examples/index.js +3 -1
- package/lib/examples/main.js +340 -93
- package/lib/examples/utils/a2ui.d.ts +2 -0
- package/lib/examples/utils/a2ui.js +97 -2
- package/lib/examples/utils/agentSummaryStore.d.ts +21 -0
- package/lib/examples/utils/agentSummaryStore.js +23 -0
- package/lib/examples/utils/notebooks/Empty.ipynb.json +30 -30
- package/lib/examples/utils/runtimeTargetStore.d.ts +9 -0
- package/lib/examples/utils/runtimeTargetStore.js +27 -0
- package/lib/examples/utils/teardownAgents.d.ts +13 -0
- package/lib/examples/utils/teardownAgents.js +78 -0
- package/lib/examples/utils/useExampleAgentRuntimesUrl.d.ts +2 -0
- package/lib/examples/utils/useExampleAgentRuntimesUrl.js +26 -7
- package/lib/examples2/CellExample.d.ts +6 -0
- package/lib/examples2/CellExample.js +20 -0
- package/lib/examples2/DatalayerNotebookExample.d.ts +16 -0
- package/lib/examples2/DatalayerNotebookExample.js +109 -0
- package/lib/examples2/NativeNavigationExample.d.ts +8 -0
- package/lib/examples2/NativeNavigationExample.js +97 -0
- package/lib/examples2/NotebookExample.d.ts +6 -0
- package/lib/examples2/NotebookExample.js +19 -0
- package/lib/examples2/NotebookMutationsKernel.d.ts +2 -0
- package/lib/examples2/NotebookMutationsKernel.js +105 -0
- package/lib/examples2/NotebookMutationsServiceManager.d.ts +2 -0
- package/lib/examples2/NotebookMutationsServiceManager.js +109 -0
- package/lib/examples2/ReactRouterExample.d.ts +6 -0
- package/lib/examples2/ReactRouterExample.js +175 -0
- package/lib/examples2/example-selector.d.ts +22 -0
- package/lib/examples2/example-selector.js +45 -0
- package/lib/examples2/index.d.ts +2 -0
- package/lib/examples2/index.js +6 -0
- package/lib/examples2/lexical-theme.css +436 -0
- package/lib/examples2/main.d.ts +2 -0
- package/lib/examples2/main.js +330 -0
- package/lib/examples2/notebooks/IPyWidgetsExample.ipynb.json +101 -0
- package/lib/examples2/notebooks/IPyWidgetsExampleWithState.ipynb.json +112 -0
- package/lib/examples2/notebooks/Lite.ipynb.json +128 -0
- package/lib/examples2/notebooks/Matplotlib.ipynb.json +137 -0
- package/lib/examples2/notebooks/NotebookExample1.ipynb.json +126 -0
- package/lib/examples2/notebooks/NotebookExample2.ipynb.json +48 -0
- package/lib/examples2/notebooks/NotebookOutputs.ipynb.json +49 -0
- package/lib/examples2/notebooks/NotebookToCExample.ipynb.json +102 -0
- package/lib/examples2/notebooks/OutputIPyWidgetsExample.d.ts +145 -0
- package/lib/examples2/notebooks/OutputIPyWidgetsExample.js +153 -0
- package/lib/examples2/notebooks/PyGWalker.ipynb.json +55 -0
- package/lib/hooks/index.d.ts +9 -1
- package/lib/hooks/index.js +13 -1
- package/lib/hooks/useAIAgentsWebSocket.d.ts +1 -1
- package/lib/hooks/useAIAgentsWebSocket.js +39 -3
- package/lib/hooks/useAgentRuntimes.d.ts +15 -3
- package/lib/hooks/useAgentRuntimes.js +188 -29
- package/lib/hooks/useAgentsCatalog.d.ts +3 -3
- package/lib/hooks/useAgentsCatalog.js +4 -4
- package/lib/hooks/useAgentsService.js +5 -5
- package/lib/hooks/useCellOutputshot.d.ts +4 -0
- package/lib/hooks/useCellOutputshot.js +25 -0
- package/lib/hooks/useCheckpoints.d.ts +8 -8
- package/lib/hooks/useCheckpoints.js +38 -28
- package/lib/hooks/useConfig.d.ts +1 -1
- package/lib/hooks/useMonitoring.d.ts +7 -5
- package/lib/hooks/useMonitoring.js +16 -10
- package/lib/hooks/useNotifications.d.ts +11 -11
- package/lib/hooks/useNotifications.js +1 -1
- package/lib/hooks/useProgressStore.d.ts +25 -0
- package/lib/hooks/useProgressStore.js +58 -0
- package/lib/hooks/useProgressTask.d.ts +9 -0
- package/lib/hooks/useProgressTask.js +41 -0
- package/lib/hooks/useProjects.d.ts +628 -0
- package/lib/hooks/useProjects.js +190 -0
- package/lib/hooks/useRuntimes.d.ts +5 -0
- package/lib/hooks/useRuntimes.js +34 -0
- package/lib/hooks/useToolApprovals.d.ts +14 -6
- package/lib/hooks/useToolApprovals.js +20 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +1 -0
- package/lib/jupyter/exec/Python.d.ts +5 -0
- package/lib/jupyter/exec/Python.js +100 -0
- package/lib/jupyter/exec/Snippets.d.ts +105 -0
- package/lib/jupyter/exec/Snippets.js +101 -0
- package/lib/jupyter/exec/index.d.ts +2 -0
- package/lib/jupyter/exec/index.js +6 -0
- package/lib/jupyter/index.d.ts +2 -0
- package/lib/jupyter/index.js +6 -0
- package/lib/jupyter/kernelsHandler.d.ts +8 -0
- package/lib/jupyter/kernelsHandler.js +39 -0
- package/lib/mocks/models/CourseMock.d.ts +6 -0
- package/lib/mocks/models/CourseMock.js +29 -0
- package/lib/mocks/models/SpaceMock.d.ts +6 -0
- package/lib/mocks/models/SpaceMock.js +25 -0
- package/lib/models/Assignment.d.ts +7 -0
- package/lib/models/Assignment.js +5 -0
- package/lib/models/Cell.d.ts +8 -0
- package/lib/models/Cell.js +5 -0
- package/lib/models/CodeBlock.d.ts +10 -0
- package/lib/models/CodeBlock.js +5 -0
- package/lib/models/CodeSandboxSnapshot.d.ts +92 -0
- package/lib/models/CodeSandboxSnapshot.js +13 -0
- package/lib/models/CodeSandboxSnapshotDTO.d.ts +173 -0
- package/lib/models/CodeSandboxSnapshotDTO.js +139 -0
- package/lib/models/CodefeedBlocks.d.ts +7 -0
- package/lib/models/CodefeedBlocks.js +5 -0
- package/lib/models/Content.d.ts +5 -0
- package/lib/models/Content.js +5 -0
- package/lib/models/Course.d.ts +17 -0
- package/lib/models/Course.js +5 -0
- package/lib/models/Dataset.d.ts +16 -0
- package/lib/models/Dataset.js +5 -0
- package/lib/models/Document.d.ts +8 -0
- package/lib/models/Document.js +5 -0
- package/lib/models/Environment.d.ts +86 -0
- package/lib/models/Environment.js +5 -0
- package/lib/models/EnvironmentDTO.d.ts +125 -0
- package/lib/models/EnvironmentDTO.js +88 -0
- package/lib/models/Exercise.d.ts +16 -0
- package/lib/models/Exercise.js +5 -0
- package/lib/models/Item.d.ts +20 -0
- package/lib/models/Item.js +5 -0
- package/lib/models/ItemDTO.d.ts +74 -0
- package/lib/models/ItemDTO.js +186 -0
- package/lib/models/ItemType.d.ts +2 -0
- package/lib/models/ItemType.js +5 -0
- package/lib/models/Lesson.d.ts +5 -0
- package/lib/models/Lesson.js +5 -0
- package/lib/models/LexicalDTO.d.ts +155 -0
- package/lib/models/LexicalDTO.js +157 -0
- package/lib/models/Library.d.ts +10 -0
- package/lib/models/Library.js +5 -0
- package/lib/models/Notebook.d.ts +11 -0
- package/lib/models/Notebook.js +5 -0
- package/lib/models/NotebookDTO.d.ts +96 -0
- package/lib/models/NotebookDTO.js +153 -0
- package/lib/models/Page.d.ts +41 -0
- package/lib/models/Page.js +25 -0
- package/lib/models/PageTag.d.ts +19 -0
- package/lib/models/PageTag.js +94 -0
- package/lib/models/ProjectDTO.d.ts +89 -0
- package/lib/models/ProjectDTO.js +131 -0
- package/lib/models/Runtime.d.ts +160 -0
- package/lib/models/Runtime.js +18 -0
- package/lib/models/RuntimeDTO.d.ts +172 -0
- package/lib/models/RuntimeDTO.js +204 -0
- package/lib/models/Space.d.ts +35 -0
- package/lib/models/Space.js +66 -0
- package/lib/models/SpaceDTO.d.ts +334 -0
- package/lib/models/SpaceDTO.js +244 -0
- package/lib/models/SpaceItem.d.ts +10 -0
- package/lib/models/SpaceItem.js +5 -0
- package/lib/models/SpaceMember.d.ts +6 -0
- package/lib/models/SpaceMember.js +5 -0
- package/lib/models/StudentItem.d.ts +21 -0
- package/lib/models/StudentItem.js +5 -0
- package/lib/models/index.d.ts +32 -0
- package/lib/models/index.js +39 -0
- package/lib/protocols/AGUIAdapter.js +1 -1
- package/lib/runtimes/actions.d.ts +102 -0
- package/lib/runtimes/actions.js +249 -0
- package/lib/runtimes/apis.d.ts +273 -0
- package/lib/runtimes/apis.js +5 -0
- package/lib/runtimes/index.d.ts +5 -0
- package/lib/runtimes/index.js +9 -0
- package/lib/runtimes/settings.d.ts +15 -0
- package/lib/runtimes/settings.js +31 -0
- package/lib/runtimes/snapshots.d.ts +25 -0
- package/lib/runtimes/snapshots.js +150 -0
- package/lib/runtimes/utils.d.ts +7 -0
- package/lib/runtimes/utils.js +14 -0
- package/lib/services/DatalayerServiceManager.d.ts +23 -0
- package/lib/services/DatalayerServiceManager.js +90 -0
- package/lib/services/reconnectToRuntime.d.ts +32 -0
- package/lib/services/reconnectToRuntime.js +59 -0
- package/lib/services/sandboxServiceManagers.d.ts +31 -0
- package/lib/services/sandboxServiceManagers.js +57 -0
- package/lib/specs/agents/agents.d.ts +95 -50
- package/lib/specs/agents/agents.js +4037 -1669
- package/lib/specs/agents/index.d.ts +5 -5
- package/lib/specs/agents/index.js +9 -9
- package/lib/specs/index.d.ts +1 -0
- package/lib/specs/index.js +1 -0
- package/lib/specs/loops.d.ts +34 -0
- package/lib/specs/loops.js +188 -0
- package/lib/specs/mcpServers.d.ts +1 -0
- package/lib/specs/mcpServers.js +17 -0
- package/lib/specs/models.d.ts +4 -0
- package/lib/specs/models.js +30 -0
- package/lib/specs/skills.d.ts +1 -0
- package/lib/specs/skills.js +18 -0
- package/lib/specs/tools.d.ts +15 -0
- package/lib/specs/tools.js +285 -0
- package/lib/state/index.d.ts +4 -0
- package/lib/state/index.js +10 -0
- package/lib/state/substates/CellState.d.ts +12 -0
- package/lib/state/substates/CellState.js +22 -0
- package/lib/state/substates/DocumentState.d.ts +10 -0
- package/lib/state/substates/DocumentState.js +14 -0
- package/lib/state/substates/GradeState.d.ts +10 -0
- package/lib/state/substates/GradeState.js +14 -0
- package/lib/state/substates/JupyterLabState.d.ts +16 -0
- package/lib/state/substates/JupyterLabState.js +17 -0
- package/lib/state/substates/NbformatState.d.ts +13 -0
- package/lib/state/substates/NbformatState.js +16 -0
- package/lib/state/substates/RuntimesState.d.ts +87 -0
- package/lib/state/substates/RuntimesState.js +192 -0
- package/lib/state/substates/SpaceState.d.ts +11 -0
- package/lib/state/substates/SpaceState.js +16 -0
- package/lib/state/substates/index.d.ts +8 -0
- package/lib/state/substates/index.js +14 -0
- package/lib/stores/agentRuntimeStore.d.ts +25 -2
- package/lib/stores/agentRuntimeStore.js +114 -19
- package/lib/stories/Button.stories.d.ts +1 -1
- package/lib/stories/Header.stories.d.ts +3 -3
- package/lib/test-setup.js +10 -0
- package/lib/types/agents-lifecycle.d.ts +5 -5
- package/lib/types/agents.d.ts +6 -6
- package/lib/types/agentspecs.d.ts +8 -4
- package/lib/types/chat.d.ts +135 -3
- package/lib/types/config.d.ts +19 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/loops.d.ts +64 -0
- package/lib/types/loops.js +5 -0
- package/lib/types/teams.d.ts +2 -2
- package/lib/types/tools.d.ts +16 -0
- package/lib/utils/Cells.d.ts +2 -0
- package/lib/utils/Cells.js +28 -0
- package/package.json +24 -18
- package/scripts/codegen/generate_agents.py +96 -61
- package/scripts/codegen/generate_loops.py +443 -0
- package/scripts/codegen/generate_teams.py +4 -4
- package/lib/examples/A2UiComponentGalleryExample.d.ts +0 -3
- package/lib/examples/A2UiComponentGalleryExample.js +0 -361
- package/scripts/codegen/__pycache__/generate_agents.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_benchmarks.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_evals.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_events.cpython-313.pyc +0 -0
- /package/lib/{agent-lexical-main.d.ts → agent-document-main.d.ts} +0 -0
|
@@ -154,7 +154,7 @@ Generated from YAML specifications in specs/agents/
|
|
|
154
154
|
from typing import Dict
|
|
155
155
|
|
|
156
156
|
from agent_runtimes.mcp.catalog_mcp_servers import MCP_SERVER_CATALOG
|
|
157
|
-
from agent_runtimes.types import
|
|
157
|
+
from agent_runtimes.types import Agentspec, SubAgentspecConfig, SubAgentsConfig
|
|
158
158
|
|
|
159
159
|
# ============================================================================
|
|
160
160
|
# Agent Specs
|
|
@@ -191,15 +191,15 @@ from agent_runtimes.types import AgentSpec, SubAgentSpecConfig, SubAgentsConfig
|
|
|
191
191
|
version = spec["version"]
|
|
192
192
|
# Prefix agent ID with folder name for uniqueness
|
|
193
193
|
full_agent_id = f"{folder}/{agent_id}" if folder else agent_id
|
|
194
|
-
# Create constant name: e.g., "data-acquisition" -> "
|
|
195
|
-
# But if id already ends with "-agent", don't duplicate: "github-agent" -> "
|
|
194
|
+
# Create constant name: e.g., "data-acquisition" -> "DATA_ACQUISITION_AGENTSPEC"
|
|
195
|
+
# But if id already ends with "-agent", don't duplicate: "github-agent" -> "GITHUB_AGENTSPEC"
|
|
196
196
|
# NO folder prefix for Python constants
|
|
197
197
|
base_name = agent_id.upper().replace("-", "_")
|
|
198
198
|
|
|
199
199
|
if agent_id.endswith("-agent"):
|
|
200
200
|
const_name = base_name + "_SPEC"
|
|
201
201
|
else:
|
|
202
|
-
const_name = base_name + "
|
|
202
|
+
const_name = base_name + "_AGENTSPEC"
|
|
203
203
|
const_name += version_suffix(version)
|
|
204
204
|
agent_ids.append((full_agent_id, const_name, folder))
|
|
205
205
|
|
|
@@ -222,6 +222,12 @@ from agent_runtimes.types import AgentSpec, SubAgentSpecConfig, SubAgentsConfig
|
|
|
222
222
|
versioned_ref(*split_spec_ref(ft))
|
|
223
223
|
for ft in spec.get("frontend_tools", [])
|
|
224
224
|
]
|
|
225
|
+
frontend_render_tools = spec.get("frontend_render_tools") or []
|
|
226
|
+
frontend_render_tools_py_line = (
|
|
227
|
+
f" frontend_render_tools={_fmt_py_literal(frontend_render_tools)},\n"
|
|
228
|
+
if frontend_render_tools
|
|
229
|
+
else ""
|
|
230
|
+
)
|
|
225
231
|
|
|
226
232
|
# Format optional fields
|
|
227
233
|
icon = f'"{spec.get("icon")}"' if spec.get("icon") else "None"
|
|
@@ -262,6 +268,7 @@ from agent_runtimes.types import AgentSpec, SubAgentSpecConfig, SubAgentsConfig
|
|
|
262
268
|
.strip()
|
|
263
269
|
.replace('"', '\\"')
|
|
264
270
|
)
|
|
271
|
+
display_name = spec.get("title", spec["name"]).replace('"', '\\"')
|
|
265
272
|
|
|
266
273
|
# Use triple quotes for multiline system prompts
|
|
267
274
|
system_prompt_str = f'"""{system_prompt}"""' if system_prompt else "None"
|
|
@@ -278,6 +285,14 @@ from agent_runtimes.types import AgentSpec, SubAgentSpecConfig, SubAgentsConfig
|
|
|
278
285
|
inference_provider_str = (
|
|
279
286
|
f'"{inference_provider}"' if inference_provider else "None"
|
|
280
287
|
)
|
|
288
|
+
disable_tool_approvals = spec.get(
|
|
289
|
+
"disable_tool_approvals", spec.get("disableToolApprovals")
|
|
290
|
+
)
|
|
291
|
+
disable_tool_approvals_line = (
|
|
292
|
+
f" disable_tool_approvals={str(bool(disable_tool_approvals))},\n"
|
|
293
|
+
if disable_tool_approvals is not None
|
|
294
|
+
else ""
|
|
295
|
+
)
|
|
281
296
|
|
|
282
297
|
# Sandbox variant field
|
|
283
298
|
sandbox_variant = spec.get("sandbox_variant")
|
|
@@ -335,7 +350,7 @@ from agent_runtimes.types import AgentSpec, SubAgentSpecConfig, SubAgentsConfig
|
|
|
335
350
|
opt_val = sa.get(opt_key)
|
|
336
351
|
if opt_val is not None:
|
|
337
352
|
sa_fields.append(f"{opt_key}={_fmt_py_literal(opt_val)}")
|
|
338
|
-
sa_items.append("
|
|
353
|
+
sa_items.append("SubAgentspecConfig(" + ", ".join(sa_fields) + ")")
|
|
339
354
|
sa_list_str = "[" + ", ".join(sa_items) + "]"
|
|
340
355
|
cfg_parts = [f"subagents={sa_list_str}"]
|
|
341
356
|
if subagents_val.get("default_model") is not None:
|
|
@@ -352,10 +367,10 @@ from agent_runtimes.types import AgentSpec, SubAgentSpecConfig, SubAgentsConfig
|
|
|
352
367
|
)
|
|
353
368
|
subagents_str = "SubAgentsConfig(" + ", ".join(cfg_parts) + ")"
|
|
354
369
|
|
|
355
|
-
code += f'''{const_name} =
|
|
370
|
+
code += f'''{const_name} = Agentspec(
|
|
356
371
|
id="{full_agent_id}",
|
|
357
372
|
version="{version}",
|
|
358
|
-
|
|
373
|
+
name="{display_name}",
|
|
359
374
|
description="{description}",
|
|
360
375
|
tags={_fmt_list(spec.get("tags", []))},
|
|
361
376
|
enabled={spec.get("enabled", True)},
|
|
@@ -364,8 +379,8 @@ from agent_runtimes.types import AgentSpec, SubAgentSpecConfig, SubAgentsConfig
|
|
|
364
379
|
mcp_servers=[{mcp_servers_str}],
|
|
365
380
|
skills={_fmt_list(skill_refs)},
|
|
366
381
|
tools={_fmt_list(tool_refs)},
|
|
367
|
-
frontend_tools={_fmt_list(frontend_tool_refs)},
|
|
368
|
-
environment_name="{spec.get("environment_name", "ai-agents-env")}",
|
|
382
|
+
{disable_tool_approvals_line} frontend_tools={_fmt_list(frontend_tool_refs)},
|
|
383
|
+
{frontend_render_tools_py_line} environment_name="{spec.get("environment_name", "ai-agents-env")}",
|
|
369
384
|
icon={icon},
|
|
370
385
|
emoji={emoji},
|
|
371
386
|
color={color},
|
|
@@ -405,7 +420,7 @@ from agent_runtimes.types import AgentSpec, SubAgentSpecConfig, SubAgentsConfig
|
|
|
405
420
|
# Agent Specs Registry
|
|
406
421
|
# ============================================================================
|
|
407
422
|
|
|
408
|
-
|
|
423
|
+
AGENTSPECS: Dict[str, Agentspec] = {
|
|
409
424
|
"""
|
|
410
425
|
|
|
411
426
|
# Sort by folder for organized registry
|
|
@@ -421,7 +436,7 @@ AGENT_SPECS: Dict[str, AgentSpec] = {
|
|
|
421
436
|
code += """}
|
|
422
437
|
|
|
423
438
|
|
|
424
|
-
def get_agent_spec(agent_id: str) ->
|
|
439
|
+
def get_agent_spec(agent_id: str) -> Agentspec | None:
|
|
425
440
|
\"\"\"
|
|
426
441
|
Get an agent specification by ID (accepts both bare and versioned refs).
|
|
427
442
|
|
|
@@ -429,18 +444,18 @@ def get_agent_spec(agent_id: str) -> AgentSpec | None:
|
|
|
429
444
|
agent_id: The unique identifier of the agent.
|
|
430
445
|
|
|
431
446
|
Returns:
|
|
432
|
-
The
|
|
447
|
+
The Agentspec configuration, or None if not found.
|
|
433
448
|
\"\"\"
|
|
434
|
-
spec =
|
|
449
|
+
spec = AGENTSPECS.get(agent_id)
|
|
435
450
|
if spec is not None:
|
|
436
451
|
return spec
|
|
437
452
|
base, _, ver = agent_id.rpartition(':')
|
|
438
453
|
if base and '.' in ver:
|
|
439
|
-
return
|
|
454
|
+
return AGENTSPECS.get(base)
|
|
440
455
|
return None
|
|
441
456
|
|
|
442
457
|
|
|
443
|
-
def
|
|
458
|
+
def list_agentspecs(prefix: str | None = None) -> list[Agentspec]:
|
|
444
459
|
\"\"\"
|
|
445
460
|
List all available agent specifications.
|
|
446
461
|
|
|
@@ -448,9 +463,9 @@ def list_agent_specs(prefix: str | None = None) -> list[AgentSpec]:
|
|
|
448
463
|
prefix: If provided, only return specs whose ID starts with this prefix.
|
|
449
464
|
|
|
450
465
|
Returns:
|
|
451
|
-
List of all
|
|
466
|
+
List of all Agentspec configurations.
|
|
452
467
|
\"\"\"
|
|
453
|
-
specs = list(
|
|
468
|
+
specs = list(AGENTSPECS.values())
|
|
454
469
|
if prefix is not None:
|
|
455
470
|
specs = [s for s in specs if s.id.startswith(prefix)]
|
|
456
471
|
return specs
|
|
@@ -618,7 +633,7 @@ def generate_typescript_code(
|
|
|
618
633
|
* Generated from YAML specifications in specs/agents/
|
|
619
634
|
*/
|
|
620
635
|
|
|
621
|
-
import type {
|
|
636
|
+
import type { Agentspec } from '"""
|
|
622
637
|
code += types_import_path
|
|
623
638
|
code += """';
|
|
624
639
|
"""
|
|
@@ -752,15 +767,15 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
|
|
|
752
767
|
version = spec["version"]
|
|
753
768
|
# Prefix agent ID with folder name for uniqueness
|
|
754
769
|
full_agent_id = f"{folder}/{agent_id}" if folder else agent_id
|
|
755
|
-
# Create constant name: e.g., "data-acquisition" -> "
|
|
756
|
-
# But if id already ends with "-agent", don't duplicate: "github-agent" -> "
|
|
770
|
+
# Create constant name: e.g., "data-acquisition" -> "DATA_ACQUISITION_AGENTSPEC"
|
|
771
|
+
# But if id already ends with "-agent", don't duplicate: "github-agent" -> "GITHUB_AGENTSPEC"
|
|
757
772
|
# NO folder prefix for TypeScript constants
|
|
758
773
|
base_name = agent_id.upper().replace("-", "_")
|
|
759
774
|
|
|
760
775
|
if agent_id.endswith("-agent"):
|
|
761
776
|
const_name = base_name + "_SPEC"
|
|
762
777
|
else:
|
|
763
|
-
const_name = base_name + "
|
|
778
|
+
const_name = base_name + "_AGENTSPEC"
|
|
764
779
|
const_name += version_suffix(version)
|
|
765
780
|
agent_ids.append((full_agent_id, const_name, folder))
|
|
766
781
|
|
|
@@ -809,6 +824,14 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
|
|
|
809
824
|
else:
|
|
810
825
|
frontend_tools_str = ""
|
|
811
826
|
|
|
827
|
+
# Frontend render tools - inline structured data read verbatim
|
|
828
|
+
frontend_render_tools = spec.get("frontend_render_tools") or []
|
|
829
|
+
frontend_render_tools_ts_line = (
|
|
830
|
+
f" frontendRenderTools: {_fmt_ts_literal(frontend_render_tools)},\n"
|
|
831
|
+
if frontend_render_tools
|
|
832
|
+
else ""
|
|
833
|
+
)
|
|
834
|
+
|
|
812
835
|
# Format tags and suggestions as arrays
|
|
813
836
|
tags = spec.get("tags", [])
|
|
814
837
|
tags_str = "[" + ", ".join(f"'{t}'" for t in tags) + "]"
|
|
@@ -847,6 +870,7 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
|
|
|
847
870
|
description = (
|
|
848
871
|
spec["description"].replace("\n", " ").replace(" ", " ").strip()
|
|
849
872
|
)
|
|
873
|
+
display_name = spec.get("title", spec["name"]).replace("'", "\\'")
|
|
850
874
|
|
|
851
875
|
# Model field
|
|
852
876
|
model_id = spec.get("model")
|
|
@@ -855,6 +879,14 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
|
|
|
855
879
|
inference_provider_ts = (
|
|
856
880
|
f"'{inference_provider}'" if inference_provider else "undefined"
|
|
857
881
|
)
|
|
882
|
+
disable_tool_approvals = spec.get(
|
|
883
|
+
"disable_tool_approvals", spec.get("disableToolApprovals")
|
|
884
|
+
)
|
|
885
|
+
disable_tool_approvals_line = (
|
|
886
|
+
f" disableToolApprovals: {'true' if bool(disable_tool_approvals) else 'false'},\n"
|
|
887
|
+
if disable_tool_approvals is not None
|
|
888
|
+
else ""
|
|
889
|
+
)
|
|
858
890
|
|
|
859
891
|
# Sandbox variant field
|
|
860
892
|
sandbox_variant = spec.get("sandbox_variant")
|
|
@@ -902,10 +934,10 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
|
|
|
902
934
|
else ""
|
|
903
935
|
)
|
|
904
936
|
|
|
905
|
-
code += f"""export const {const_name}:
|
|
937
|
+
code += f"""export const {const_name}: Agentspec = {{
|
|
906
938
|
id: '{full_agent_id}',
|
|
907
939
|
version: '{version}',
|
|
908
|
-
|
|
940
|
+
name: '{display_name}',
|
|
909
941
|
description: `{description}`,
|
|
910
942
|
tags: {tags_str},
|
|
911
943
|
enabled: {str(spec.get("enabled", True)).lower()},
|
|
@@ -913,8 +945,8 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
|
|
|
913
945
|
{inference_provider_line} mcpServers: [{mcp_servers_str}],
|
|
914
946
|
skills: [{skills_str}].filter(Boolean) as SkillSpec[],
|
|
915
947
|
tools: [{tools_str}],
|
|
916
|
-
frontendTools: [{frontend_tools_str}],
|
|
917
|
-
environmentName: '{spec.get("environment_name", "ai-agents-env")}',
|
|
948
|
+
{disable_tool_approvals_line} frontendTools: [{frontend_tools_str}],
|
|
949
|
+
{frontend_render_tools_ts_line} environmentName: '{spec.get("environment_name", "ai-agents-env")}',
|
|
918
950
|
icon: {icon},
|
|
919
951
|
emoji: {emoji},
|
|
920
952
|
color: {color},
|
|
@@ -953,7 +985,7 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
|
|
|
953
985
|
// Agent Specs Registry
|
|
954
986
|
// ============================================================================
|
|
955
987
|
|
|
956
|
-
export const
|
|
988
|
+
export const AGENTSPECS: Record<string, Agentspec> = {
|
|
957
989
|
"""
|
|
958
990
|
|
|
959
991
|
# Sort by folder for organized registry
|
|
@@ -969,11 +1001,11 @@ export const AGENT_SPECS: Record<string, AgentSpec> = {
|
|
|
969
1001
|
code += """};
|
|
970
1002
|
|
|
971
1003
|
function resolveAgentId(agentId: string): string {
|
|
972
|
-
if (agentId in
|
|
1004
|
+
if (agentId in AGENTSPECS) return agentId;
|
|
973
1005
|
const idx = agentId.lastIndexOf(':');
|
|
974
1006
|
if (idx > 0) {
|
|
975
1007
|
const base = agentId.slice(0, idx);
|
|
976
|
-
if (base in
|
|
1008
|
+
if (base in AGENTSPECS) return base;
|
|
977
1009
|
}
|
|
978
1010
|
return agentId;
|
|
979
1011
|
}
|
|
@@ -981,8 +1013,8 @@ function resolveAgentId(agentId: string): string {
|
|
|
981
1013
|
/**
|
|
982
1014
|
* Get an agent specification by ID.
|
|
983
1015
|
*/
|
|
984
|
-
export function
|
|
985
|
-
return
|
|
1016
|
+
export function getAgentspecs(agentId: string): Agentspec | undefined {
|
|
1017
|
+
return AGENTSPECS[resolveAgentId(agentId)];
|
|
986
1018
|
}
|
|
987
1019
|
|
|
988
1020
|
/**
|
|
@@ -990,8 +1022,8 @@ export function getAgentSpecs(agentId: string): AgentSpec | undefined {
|
|
|
990
1022
|
*
|
|
991
1023
|
* @param prefix - If provided, only return specs whose ID starts with this prefix.
|
|
992
1024
|
*/
|
|
993
|
-
export function
|
|
994
|
-
const specs = Object.values(
|
|
1025
|
+
export function listAgentspecs(prefix?: string): Agentspec[] {
|
|
1026
|
+
const specs = Object.values(AGENTSPECS);
|
|
995
1027
|
return prefix !== undefined ? specs.filter(s => s.id.startsWith(prefix)) : specs;
|
|
996
1028
|
}
|
|
997
1029
|
|
|
@@ -1001,7 +1033,7 @@ export function listAgentSpecs(prefix?: string): AgentSpec[] {
|
|
|
1001
1033
|
* Iterates over the spec's MCP servers and skills and returns the
|
|
1002
1034
|
* deduplicated union of their `requiredEnvVars` arrays.
|
|
1003
1035
|
*/
|
|
1004
|
-
export function
|
|
1036
|
+
export function getAgentspecRequiredEnvVars(spec: Agentspec): string[] {
|
|
1005
1037
|
const vars = new Set<string>();
|
|
1006
1038
|
const baseEnvVar = (v: string): string => v.split(':')[0] ?? v;
|
|
1007
1039
|
for (const server of spec.mcpServers) {
|
|
@@ -1039,7 +1071,7 @@ def update_init_file(
|
|
|
1039
1071
|
if agent_id.endswith("-agent"):
|
|
1040
1072
|
const_name = base_name + "_SPEC"
|
|
1041
1073
|
else:
|
|
1042
|
-
const_name = base_name + "
|
|
1074
|
+
const_name = base_name + "_AGENTSPEC"
|
|
1043
1075
|
const_names.append(const_name)
|
|
1044
1076
|
|
|
1045
1077
|
# Sort for consistent ordering
|
|
@@ -1056,11 +1088,11 @@ def update_init_file(
|
|
|
1056
1088
|
pattern = r"(from \.agents import \(\n)(.*?)(\n\))"
|
|
1057
1089
|
|
|
1058
1090
|
# Build new imports
|
|
1059
|
-
new_imports = "
|
|
1091
|
+
new_imports = " AGENTSPECS,\n"
|
|
1060
1092
|
for const_name in const_names:
|
|
1061
1093
|
new_imports += f" {const_name},\n"
|
|
1062
1094
|
new_imports += " get_agent_spec,\n"
|
|
1063
|
-
new_imports += "
|
|
1095
|
+
new_imports += " list_agentspecs,"
|
|
1064
1096
|
|
|
1065
1097
|
# Replace the imports
|
|
1066
1098
|
new_content = re.sub(pattern, r"\1" + new_imports + r"\3", content, flags=re.DOTALL)
|
|
@@ -1128,15 +1160,15 @@ def generate_subfolder_structure(specs: List[tuple[str, Dict[str, Any]]], args):
|
|
|
1128
1160
|
|
|
1129
1161
|
from .agents import *
|
|
1130
1162
|
|
|
1131
|
-
__all__ = ["
|
|
1163
|
+
__all__ = ["AGENTSPECS", "get_agent_spec", "list_agentspecs"]
|
|
1132
1164
|
""")
|
|
1133
1165
|
|
|
1134
1166
|
# Collect imports for main index
|
|
1135
1167
|
if is_root:
|
|
1136
|
-
all_python_imports.append("from .agents import
|
|
1168
|
+
all_python_imports.append("from .agents import AGENTSPECS as ROOT_AGENTS")
|
|
1137
1169
|
else:
|
|
1138
1170
|
all_python_imports.append(
|
|
1139
|
-
f"from .{folder_python_name} import
|
|
1171
|
+
f"from .{folder_python_name} import AGENTSPECS as {folder_python_name.upper()}_AGENTS"
|
|
1140
1172
|
)
|
|
1141
1173
|
|
|
1142
1174
|
# Create TypeScript output file
|
|
@@ -1187,7 +1219,7 @@ THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY.
|
|
|
1187
1219
|
\"\"\"
|
|
1188
1220
|
|
|
1189
1221
|
from typing import Dict
|
|
1190
|
-
from agent_runtimes.types import
|
|
1222
|
+
from agent_runtimes.types import Agentspec
|
|
1191
1223
|
|
|
1192
1224
|
"""
|
|
1193
1225
|
|
|
@@ -1198,43 +1230,43 @@ from agent_runtimes.types import AgentSpec
|
|
|
1198
1230
|
# Merge all agent specs
|
|
1199
1231
|
python_index_content += """
|
|
1200
1232
|
# Merge all agent specs from subfolders
|
|
1201
|
-
|
|
1233
|
+
AGENTSPECS: Dict[str, Agentspec] = {}
|
|
1202
1234
|
"""
|
|
1203
1235
|
|
|
1204
1236
|
for folder in sorted(specs_by_folder.keys()):
|
|
1205
1237
|
if folder:
|
|
1206
1238
|
folder_python_name = folder.replace("-", "_")
|
|
1207
1239
|
python_index_content += (
|
|
1208
|
-
f"
|
|
1240
|
+
f"AGENTSPECS.update({folder_python_name.upper()}_AGENTS)\n"
|
|
1209
1241
|
)
|
|
1210
1242
|
else:
|
|
1211
|
-
python_index_content += "
|
|
1243
|
+
python_index_content += "AGENTSPECS.update(ROOT_AGENTS)\n"
|
|
1212
1244
|
|
|
1213
1245
|
python_index_content += """
|
|
1214
1246
|
|
|
1215
|
-
def get_agent_spec(agent_id: str) ->
|
|
1247
|
+
def get_agent_spec(agent_id: str) -> Agentspec | None:
|
|
1216
1248
|
\"\"\"Get an agent specification by ID.\"\"\"
|
|
1217
|
-
spec =
|
|
1249
|
+
spec = AGENTSPECS.get(agent_id)
|
|
1218
1250
|
if spec is not None:
|
|
1219
1251
|
return spec
|
|
1220
1252
|
base, _, ver = agent_id.rpartition(':')
|
|
1221
1253
|
if base and '.' in ver:
|
|
1222
|
-
return
|
|
1254
|
+
return AGENTSPECS.get(base)
|
|
1223
1255
|
return None
|
|
1224
1256
|
|
|
1225
1257
|
|
|
1226
|
-
def
|
|
1258
|
+
def list_agentspecs(prefix: str | None = None) -> list[Agentspec]:
|
|
1227
1259
|
\"\"\"List all available agent specifications.
|
|
1228
1260
|
|
|
1229
1261
|
Args:
|
|
1230
1262
|
prefix: If provided, only return specs whose ID starts with this prefix.
|
|
1231
1263
|
\"\"\"
|
|
1232
|
-
specs = list(
|
|
1264
|
+
specs = list(AGENTSPECS.values())
|
|
1233
1265
|
if prefix is not None:
|
|
1234
1266
|
specs = [s for s in specs if s.id.startswith(prefix)]
|
|
1235
1267
|
return specs
|
|
1236
1268
|
|
|
1237
|
-
__all__ = ["
|
|
1269
|
+
__all__ = ["AGENTSPECS", "get_agent_spec", "list_agentspecs"]
|
|
1238
1270
|
"""
|
|
1239
1271
|
|
|
1240
1272
|
with open(python_index, "w") as f:
|
|
@@ -1253,23 +1285,25 @@ __all__ = ["AGENT_SPECS", "get_agent_spec", "list_agent_specs"]
|
|
|
1253
1285
|
* THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY.
|
|
1254
1286
|
*/
|
|
1255
1287
|
|
|
1256
|
-
import type {
|
|
1288
|
+
import type { Agentspec } from '../../types';
|
|
1257
1289
|
|
|
1258
1290
|
"""
|
|
1259
1291
|
|
|
1260
|
-
# Import
|
|
1292
|
+
# Import AGENTSPECS from each subfolder
|
|
1261
1293
|
for folder in sorted(specs_by_folder.keys()):
|
|
1262
1294
|
if folder:
|
|
1263
1295
|
folder_const = folder.replace("-", "_").upper()
|
|
1264
|
-
typescript_index_content +=
|
|
1296
|
+
typescript_index_content += (
|
|
1297
|
+
f"import {{ AGENTSPECS as {folder_const}_AGENTS }} from './{folder}';\n"
|
|
1298
|
+
)
|
|
1265
1299
|
else:
|
|
1266
1300
|
typescript_index_content += (
|
|
1267
|
-
"import {
|
|
1301
|
+
"import { AGENTSPECS as ROOT_AGENTS } from './agents';\n"
|
|
1268
1302
|
)
|
|
1269
1303
|
|
|
1270
1304
|
typescript_index_content += """
|
|
1271
1305
|
// Merge all agent specs from subfolders
|
|
1272
|
-
export const
|
|
1306
|
+
export const AGENTSPECS: Record<string, Agentspec> = {
|
|
1273
1307
|
"""
|
|
1274
1308
|
|
|
1275
1309
|
for folder in sorted(specs_by_folder.keys()):
|
|
@@ -1282,11 +1316,11 @@ export const AGENT_SPECS: Record<string, AgentSpec> = {
|
|
|
1282
1316
|
typescript_index_content += """};
|
|
1283
1317
|
|
|
1284
1318
|
function resolveAgentId(agentId: string): string {
|
|
1285
|
-
if (agentId in
|
|
1319
|
+
if (agentId in AGENTSPECS) return agentId;
|
|
1286
1320
|
const idx = agentId.lastIndexOf(':');
|
|
1287
1321
|
if (idx > 0) {
|
|
1288
1322
|
const base = agentId.slice(0, idx);
|
|
1289
|
-
if (base in
|
|
1323
|
+
if (base in AGENTSPECS) return base;
|
|
1290
1324
|
}
|
|
1291
1325
|
return agentId;
|
|
1292
1326
|
}
|
|
@@ -1294,8 +1328,8 @@ function resolveAgentId(agentId: string): string {
|
|
|
1294
1328
|
/**
|
|
1295
1329
|
* Get an agent specification by ID.
|
|
1296
1330
|
*/
|
|
1297
|
-
export function
|
|
1298
|
-
return
|
|
1331
|
+
export function getAgentspecs(agentId: string): Agentspec | undefined {
|
|
1332
|
+
return AGENTSPECS[resolveAgentId(agentId)];
|
|
1299
1333
|
}
|
|
1300
1334
|
|
|
1301
1335
|
/**
|
|
@@ -1303,15 +1337,15 @@ export function getAgentSpecs(agentId: string): AgentSpec | undefined {
|
|
|
1303
1337
|
*
|
|
1304
1338
|
* @param prefix - If provided, only return specs whose ID starts with this prefix.
|
|
1305
1339
|
*/
|
|
1306
|
-
export function
|
|
1307
|
-
const specs = Object.values(
|
|
1340
|
+
export function listAgentspecs(prefix?: string): Agentspec[] {
|
|
1341
|
+
const specs = Object.values(AGENTSPECS);
|
|
1308
1342
|
return prefix !== undefined ? specs.filter(s => s.id.startsWith(prefix)) : specs;
|
|
1309
1343
|
}
|
|
1310
1344
|
|
|
1311
1345
|
/**
|
|
1312
1346
|
* Collect all required environment variables for an agent spec.
|
|
1313
1347
|
*/
|
|
1314
|
-
export function
|
|
1348
|
+
export function getAgentspecRequiredEnvVars(spec: Agentspec): string[] {
|
|
1315
1349
|
const vars = new Set<string>();
|
|
1316
1350
|
for (const server of spec.mcpServers) {
|
|
1317
1351
|
for (const v of server.requiredEnvVars ?? []) {
|
|
@@ -1358,6 +1392,7 @@ export * from './teams';
|
|
|
1358
1392
|
export * from './envvars';
|
|
1359
1393
|
export * from './evals';
|
|
1360
1394
|
export * from './guardrails';
|
|
1395
|
+
export * from './loops';
|
|
1361
1396
|
export * from './mcpServers';
|
|
1362
1397
|
export * from './memory';
|
|
1363
1398
|
export * from './models';
|