@datalayer/agent-runtimes 0.0.2
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/LICENSE +32 -0
- package/README.md +56 -0
- package/lib/App.css +47 -0
- package/lib/App.d.ts +3 -0
- package/lib/App.js +18 -0
- package/lib/components/chat/components/AgentDetails.d.ts +19 -0
- package/lib/components/chat/components/AgentDetails.js +170 -0
- package/lib/components/chat/components/Chat.d.ts +105 -0
- package/lib/components/chat/components/Chat.js +275 -0
- package/lib/components/chat/components/ChatFloating.d.ts +146 -0
- package/lib/components/chat/components/ChatFloating.js +381 -0
- package/lib/components/chat/components/ChatInline.d.ts +42 -0
- package/lib/components/chat/components/ChatInline.js +327 -0
- package/lib/components/chat/components/ChatPopupStandalone.d.ts +110 -0
- package/lib/components/chat/components/ChatPopupStandalone.js +422 -0
- package/lib/components/chat/components/ChatSidebar.d.ts +78 -0
- package/lib/components/chat/components/ChatSidebar.js +224 -0
- package/lib/components/chat/components/ChatStandalone.d.ts +105 -0
- package/lib/components/chat/components/ChatStandalone.js +320 -0
- package/lib/components/chat/components/base/ChatBase.d.ts +285 -0
- package/lib/components/chat/components/base/ChatBase.js +1192 -0
- package/lib/components/chat/components/display/ToolCallDisplay.d.ts +26 -0
- package/lib/components/chat/components/display/ToolCallDisplay.js +225 -0
- package/lib/components/chat/components/display/index.d.ts +6 -0
- package/lib/components/chat/components/display/index.js +10 -0
- package/lib/components/chat/components/elements/ChatHeader.d.ts +43 -0
- package/lib/components/chat/components/elements/ChatHeader.js +67 -0
- package/lib/components/chat/components/elements/ChatInputPrompt.d.ts +26 -0
- package/lib/components/chat/components/elements/ChatInputPrompt.js +145 -0
- package/lib/components/chat/components/elements/ChatMessages.d.ts +36 -0
- package/lib/components/chat/components/elements/ChatMessages.js +195 -0
- package/lib/components/chat/components/elements/FloatingBrandButton.d.ts +34 -0
- package/lib/components/chat/components/elements/FloatingBrandButton.js +88 -0
- package/lib/components/chat/components/elements/MessagePart.d.ts +50 -0
- package/lib/components/chat/components/elements/MessagePart.js +48 -0
- package/lib/components/chat/components/elements/PoweredByTag.d.ts +26 -0
- package/lib/components/chat/components/elements/PoweredByTag.js +33 -0
- package/lib/components/chat/components/elements/ToolApprovalDialog.d.ts +42 -0
- package/lib/components/chat/components/elements/ToolApprovalDialog.js +96 -0
- package/lib/components/chat/components/index.d.ts +21 -0
- package/lib/components/chat/components/index.js +34 -0
- package/lib/components/chat/components/parts/DynamicToolPart.d.ts +20 -0
- package/lib/components/chat/components/parts/DynamicToolPart.js +13 -0
- package/lib/components/chat/components/parts/ReasoningPart.d.ts +17 -0
- package/lib/components/chat/components/parts/ReasoningPart.js +69 -0
- package/lib/components/chat/components/parts/TextPart.d.ts +28 -0
- package/lib/components/chat/components/parts/TextPart.js +103 -0
- package/lib/components/chat/components/parts/ToolPart.d.ts +17 -0
- package/lib/components/chat/components/parts/ToolPart.js +163 -0
- package/lib/components/chat/components/parts/index.d.ts +9 -0
- package/lib/components/chat/components/parts/index.js +13 -0
- package/lib/components/chat/extensions/A2UIExtension.d.ts +87 -0
- package/lib/components/chat/extensions/A2UIExtension.js +312 -0
- package/lib/components/chat/extensions/ExtensionRegistry.d.ts +66 -0
- package/lib/components/chat/extensions/ExtensionRegistry.js +128 -0
- package/lib/components/chat/extensions/MCPUIExtension.d.ts +77 -0
- package/lib/components/chat/extensions/MCPUIExtension.js +212 -0
- package/lib/components/chat/extensions/index.d.ts +9 -0
- package/lib/components/chat/extensions/index.js +12 -0
- package/lib/components/chat/handler.d.ts +20 -0
- package/lib/components/chat/handler.js +56 -0
- package/lib/components/chat/index.d.ts +61 -0
- package/lib/components/chat/index.js +76 -0
- package/lib/components/chat/inference/BaseInferenceProvider.d.ts +57 -0
- package/lib/components/chat/inference/BaseInferenceProvider.js +69 -0
- package/lib/components/chat/inference/DatalayerInferenceProvider.d.ts +83 -0
- package/lib/components/chat/inference/DatalayerInferenceProvider.js +305 -0
- package/lib/components/chat/inference/SelfHostedInferenceProvider.d.ts +54 -0
- package/lib/components/chat/inference/SelfHostedInferenceProvider.js +246 -0
- package/lib/components/chat/inference/index.d.ts +9 -0
- package/lib/components/chat/inference/index.js +12 -0
- package/lib/components/chat/middleware/MiddlewarePipeline.d.ts +118 -0
- package/lib/components/chat/middleware/MiddlewarePipeline.js +255 -0
- package/lib/components/chat/middleware/index.d.ts +7 -0
- package/lib/components/chat/middleware/index.js +10 -0
- package/lib/components/chat/protocols/A2AAdapter.d.ts +79 -0
- package/lib/components/chat/protocols/A2AAdapter.js +388 -0
- package/lib/components/chat/protocols/ACPAdapter.d.ts +161 -0
- package/lib/components/chat/protocols/ACPAdapter.js +504 -0
- package/lib/components/chat/protocols/AGUIAdapter.d.ts +82 -0
- package/lib/components/chat/protocols/AGUIAdapter.js +518 -0
- package/lib/components/chat/protocols/BaseProtocolAdapter.d.ts +75 -0
- package/lib/components/chat/protocols/BaseProtocolAdapter.js +119 -0
- package/lib/components/chat/protocols/VercelAIAdapter.d.ts +77 -0
- package/lib/components/chat/protocols/VercelAIAdapter.js +252 -0
- package/lib/components/chat/protocols/index.d.ts +11 -0
- package/lib/components/chat/protocols/index.js +14 -0
- package/lib/components/chat/store/chatStore.d.ts +158 -0
- package/lib/components/chat/store/chatStore.js +313 -0
- package/lib/components/chat/store/index.d.ts +6 -0
- package/lib/components/chat/store/index.js +10 -0
- package/lib/components/chat/tools/ToolExecutor.d.ts +49 -0
- package/lib/components/chat/tools/ToolExecutor.js +151 -0
- package/lib/components/chat/tools/index.d.ts +8 -0
- package/lib/components/chat/tools/index.js +11 -0
- package/lib/components/chat/types/extension.d.ts +181 -0
- package/lib/components/chat/types/extension.js +46 -0
- package/lib/components/chat/types/index.d.ts +11 -0
- package/lib/components/chat/types/index.js +16 -0
- package/lib/components/chat/types/inference.d.ts +117 -0
- package/lib/components/chat/types/inference.js +5 -0
- package/lib/components/chat/types/message.d.ts +117 -0
- package/lib/components/chat/types/message.js +50 -0
- package/lib/components/chat/types/middleware.d.ts +153 -0
- package/lib/components/chat/types/middleware.js +32 -0
- package/lib/components/chat/types/protocol.d.ts +209 -0
- package/lib/components/chat/types/protocol.js +5 -0
- package/lib/components/chat/types/tool.d.ts +140 -0
- package/lib/components/chat/types/tool.js +23 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +6 -0
- package/lib/components/sparklines/Sparklines.d.ts +16 -0
- package/lib/components/sparklines/Sparklines.js +65 -0
- package/lib/components/sparklines/SparklinesLine.d.ts +8 -0
- package/lib/components/sparklines/SparklinesLine.js +37 -0
- package/lib/components/sparklines/dataProcessing.d.ts +25 -0
- package/lib/components/sparklines/dataProcessing.js +35 -0
- package/lib/components/sparklines/index.d.ts +4 -0
- package/lib/components/sparklines/index.js +7 -0
- package/lib/components/sparklines/types.d.ts +36 -0
- package/lib/components/sparklines/types.js +5 -0
- package/lib/components/ui/accordion.d.ts +7 -0
- package/lib/components/ui/accordion.js +22 -0
- package/lib/components/ui/alert-dialog.d.ts +14 -0
- package/lib/components/ui/alert-dialog.js +43 -0
- package/lib/components/ui/alert.d.ts +9 -0
- package/lib/components/ui/alert.js +24 -0
- package/lib/components/ui/aspect-ratio.d.ts +3 -0
- package/lib/components/ui/aspect-ratio.js +11 -0
- package/lib/components/ui/avatar.d.ts +6 -0
- package/lib/components/ui/avatar.js +18 -0
- package/lib/components/ui/badge.d.ts +9 -0
- package/lib/components/ui/badge.js +22 -0
- package/lib/components/ui/breadcrumb.d.ts +11 -0
- package/lib/components/ui/breadcrumb.js +27 -0
- package/lib/components/ui/button-group.d.ts +11 -0
- package/lib/components/ui/button-group.js +31 -0
- package/lib/components/ui/button.d.ts +13 -0
- package/lib/components/ui/button.js +39 -0
- package/lib/components/ui/calendar.d.ts +8 -0
- package/lib/components/ui/calendar.js +80 -0
- package/lib/components/ui/card.d.ts +9 -0
- package/lib/components/ui/card.js +24 -0
- package/lib/components/ui/carousel.d.ts +19 -0
- package/lib/components/ui/carousel.js +95 -0
- package/lib/components/ui/chart.d.ts +53 -0
- package/lib/components/ui/chart.js +136 -0
- package/lib/components/ui/checkbox.d.ts +4 -0
- package/lib/components/ui/checkbox.js +13 -0
- package/lib/components/ui/collapsible.d.ts +5 -0
- package/lib/components/ui/collapsible.js +17 -0
- package/lib/components/ui/command.d.ts +18 -0
- package/lib/components/ui/command.js +38 -0
- package/lib/components/ui/context-menu.d.ts +25 -0
- package/lib/components/ui/context-menu.js +55 -0
- package/lib/components/ui/dialog.d.ts +15 -0
- package/lib/components/ui/dialog.js +40 -0
- package/lib/components/ui/drawer.d.ts +13 -0
- package/lib/components/ui/drawer.js +39 -0
- package/lib/components/ui/dropdown-menu.d.ts +25 -0
- package/lib/components/ui/dropdown-menu.js +55 -0
- package/lib/components/ui/empty.d.ts +11 -0
- package/lib/components/ui/empty.js +37 -0
- package/lib/components/ui/field.d.ts +24 -0
- package/lib/components/ui/field.js +80 -0
- package/lib/components/ui/form.d.ts +24 -0
- package/lib/components/ui/form.js +63 -0
- package/lib/components/ui/hover-card.d.ts +6 -0
- package/lib/components/ui/hover-card.js +18 -0
- package/lib/components/ui/input-group.d.ts +19 -0
- package/lib/components/ui/input-group.js +69 -0
- package/lib/components/ui/input-otp.d.ts +11 -0
- package/lib/components/ui/input-otp.js +25 -0
- package/lib/components/ui/input.d.ts +3 -0
- package/lib/components/ui/input.js +6 -0
- package/lib/components/ui/item.d.ts +23 -0
- package/lib/components/ui/item.js +66 -0
- package/lib/components/ui/kbd.d.ts +3 -0
- package/lib/components/ui/kbd.js +13 -0
- package/lib/components/ui/label.d.ts +4 -0
- package/lib/components/ui/label.js +12 -0
- package/lib/components/ui/menubar.d.ts +26 -0
- package/lib/components/ui/menubar.js +58 -0
- package/lib/components/ui/navigation-menu.d.ts +14 -0
- package/lib/components/ui/navigation-menu.js +31 -0
- package/lib/components/ui/pagination.d.ts +13 -0
- package/lib/components/ui/pagination.js +29 -0
- package/lib/components/ui/popover.d.ts +7 -0
- package/lib/components/ui/popover.js +21 -0
- package/lib/components/ui/progress.d.ts +4 -0
- package/lib/components/ui/progress.js +12 -0
- package/lib/components/ui/radio-group.d.ts +5 -0
- package/lib/components/ui/radio-group.js +16 -0
- package/lib/components/ui/resizable.d.ts +8 -0
- package/lib/components/ui/resizable.js +19 -0
- package/lib/components/ui/scroll-area.d.ts +5 -0
- package/lib/components/ui/scroll-area.js +17 -0
- package/lib/components/ui/select.d.ts +15 -0
- package/lib/components/ui/select.js +42 -0
- package/lib/components/ui/separator.d.ts +4 -0
- package/lib/components/ui/separator.js +12 -0
- package/lib/components/ui/sheet.d.ts +13 -0
- package/lib/components/ui/sheet.js +44 -0
- package/lib/components/ui/sidebar.d.ts +69 -0
- package/lib/components/ui/sidebar.js +216 -0
- package/lib/components/ui/skeleton.d.ts +2 -0
- package/lib/components/ui/skeleton.js +10 -0
- package/lib/components/ui/slider.d.ts +4 -0
- package/lib/components/ui/slider.js +18 -0
- package/lib/components/ui/sonner.d.ts +3 -0
- package/lib/components/ui/sonner.js +25 -0
- package/lib/components/ui/spinner.d.ts +2 -0
- package/lib/components/ui/spinner.js +11 -0
- package/lib/components/ui/switch.d.ts +4 -0
- package/lib/components/ui/switch.js +12 -0
- package/lib/components/ui/table.d.ts +10 -0
- package/lib/components/ui/table.js +32 -0
- package/lib/components/ui/tabs.d.ts +7 -0
- package/lib/components/ui/tabs.js +21 -0
- package/lib/components/ui/textarea.d.ts +3 -0
- package/lib/components/ui/textarea.js +6 -0
- package/lib/components/ui/toast.d.ts +15 -0
- package/lib/components/ui/toast.js +38 -0
- package/lib/components/ui/toaster.d.ts +1 -0
- package/lib/components/ui/toaster.js +14 -0
- package/lib/components/ui/toggle-group.d.ts +9 -0
- package/lib/components/ui/toggle-group.js +26 -0
- package/lib/components/ui/toggle.d.ts +9 -0
- package/lib/components/ui/toggle.js +30 -0
- package/lib/components/ui/tooltip.d.ts +7 -0
- package/lib/components/ui/tooltip.js +21 -0
- package/lib/components/vercel-ai-elements/artifact.d.ts +23 -0
- package/lib/components/vercel-ai-elements/artifact.js +24 -0
- package/lib/components/vercel-ai-elements/code-block.d.ts +17 -0
- package/lib/components/vercel-ai-elements/code-block.js +94 -0
- package/lib/components/vercel-ai-elements/conversation.d.ts +15 -0
- package/lib/components/vercel-ai-elements/conversation.js +21 -0
- package/lib/components/vercel-ai-elements/loader.d.ts +5 -0
- package/lib/components/vercel-ai-elements/loader.js +8 -0
- package/lib/components/vercel-ai-elements/message.d.ts +46 -0
- package/lib/components/vercel-ai-elements/message.js +109 -0
- package/lib/components/vercel-ai-elements/model-selector.d.ts +35 -0
- package/lib/components/vercel-ai-elements/model-selector.js +22 -0
- package/lib/components/vercel-ai-elements/prompt-input.d.ts +195 -0
- package/lib/components/vercel-ai-elements/prompt-input.js +589 -0
- package/lib/components/vercel-ai-elements/reasoning.d.ts +26 -0
- package/lib/components/vercel-ai-elements/reasoning.js +80 -0
- package/lib/components/vercel-ai-elements/shimmer.d.ts +9 -0
- package/lib/components/vercel-ai-elements/shimmer.js +22 -0
- package/lib/components/vercel-ai-elements/sources.d.ts +12 -0
- package/lib/components/vercel-ai-elements/sources.js +13 -0
- package/lib/components/vercel-ai-elements/suggestion.d.ts +10 -0
- package/lib/components/vercel-ai-elements/suggestion.js +16 -0
- package/lib/components/vercel-ai-elements/tool.d.ts +23 -0
- package/lib/components/vercel-ai-elements/tool.js +52 -0
- package/lib/examples/A2UiRestaurantExample.d.ts +25 -0
- package/lib/examples/A2UiRestaurantExample.js +305 -0
- package/lib/examples/AgUiAgenticExample.d.ts +25 -0
- package/lib/examples/AgUiAgenticExample.js +63 -0
- package/lib/examples/AgUiBackendToolRenderingExample.d.ts +30 -0
- package/lib/examples/AgUiBackendToolRenderingExample.js +103 -0
- package/lib/examples/AgUiHaikuGenUIExample.d.ts +44 -0
- package/lib/examples/AgUiHaikuGenUIExample.js +151 -0
- package/lib/examples/AgUiHumanInTheLoopExample.d.ts +26 -0
- package/lib/examples/AgUiHumanInTheLoopExample.js +220 -0
- package/lib/examples/AgUiSharedStateExample.d.ts +25 -0
- package/lib/examples/AgUiSharedStateExample.js +181 -0
- package/lib/examples/AgUiToolsBasedGenUIExample.d.ts +25 -0
- package/lib/examples/AgUiToolsBasedGenUIExample.js +257 -0
- package/lib/examples/AgentRuntimeCustomExample.d.ts +9 -0
- package/lib/examples/AgentRuntimeCustomExample.js +68 -0
- package/lib/examples/AgentRuntimeLexical2Example.d.ts +42 -0
- package/lib/examples/AgentRuntimeLexical2Example.js +236 -0
- package/lib/examples/AgentRuntimeLexicalExample.d.ts +36 -0
- package/lib/examples/AgentRuntimeLexicalExample.js +260 -0
- package/lib/examples/AgentRuntimeLexicalSidebarExample.d.ts +41 -0
- package/lib/examples/AgentRuntimeLexicalSidebarExample.js +166 -0
- package/lib/examples/AgentRuntimeNotebookExample.d.ts +9 -0
- package/lib/examples/AgentRuntimeNotebookExample.js +148 -0
- package/lib/examples/AgentRuntimeNotebookSidebarExample.d.ts +13 -0
- package/lib/examples/AgentRuntimeNotebookSidebarExample.js +121 -0
- package/lib/examples/AgentRuntimeStandaloneExample.d.ts +21 -0
- package/lib/examples/AgentRuntimeStandaloneExample.js +158 -0
- package/lib/examples/AgentSpaceFormExample.d.ts +22 -0
- package/lib/examples/AgentSpaceFormExample.js +296 -0
- package/lib/examples/AgentSpaceHomeExample.d.ts +8 -0
- package/lib/examples/AgentSpaceHomeExample.js +171 -0
- package/lib/examples/CopilotKitLexicalExample.d.ts +38 -0
- package/lib/examples/CopilotKitLexicalExample.js +161 -0
- package/lib/examples/CopilotKitNotebookExample.d.ts +11 -0
- package/lib/examples/CopilotKitNotebookExample.js +70 -0
- package/lib/examples/DatalayerNotebookExample.d.ts +16 -0
- package/lib/examples/DatalayerNotebookExample.js +99 -0
- package/lib/examples/JupyterCellExample.d.ts +6 -0
- package/lib/examples/JupyterCellExample.js +19 -0
- package/lib/examples/JupyterNotebookExample.d.ts +6 -0
- package/lib/examples/JupyterNotebookExample.js +21 -0
- package/lib/examples/ag-ui/haiku/HaikuDisplay.d.ts +18 -0
- package/lib/examples/ag-ui/haiku/HaikuDisplay.js +110 -0
- package/lib/examples/ag-ui/haiku/InlineHaikuCard.d.ts +39 -0
- package/lib/examples/ag-ui/haiku/InlineHaikuCard.js +117 -0
- package/lib/examples/ag-ui/haiku/index.d.ts +11 -0
- package/lib/examples/ag-ui/haiku/index.js +15 -0
- package/lib/examples/ag-ui/index.d.ts +10 -0
- package/lib/examples/ag-ui/index.js +16 -0
- package/lib/examples/ag-ui/weather/InlineWeatherCard.d.ts +43 -0
- package/lib/examples/ag-ui/weather/InlineWeatherCard.js +180 -0
- package/lib/examples/ag-ui/weather/index.d.ts +9 -0
- package/lib/examples/ag-ui/weather/index.js +13 -0
- package/lib/examples/components/AgentConfiguration.d.ts +50 -0
- package/lib/examples/components/AgentConfiguration.js +115 -0
- package/lib/examples/components/AgentsDataTable.d.ts +13 -0
- package/lib/examples/components/AgentsDataTable.js +74 -0
- package/lib/examples/components/FooterMetrics.d.ts +12 -0
- package/lib/examples/components/FooterMetrics.js +17 -0
- package/lib/examples/components/Header.d.ts +27 -0
- package/lib/examples/components/Header.js +294 -0
- package/lib/examples/components/HeaderControls.d.ts +11 -0
- package/lib/examples/components/HeaderControls.js +24 -0
- package/lib/examples/components/LexicalEditor.d.ts +27 -0
- package/lib/examples/components/LexicalEditor.js +118 -0
- package/lib/examples/components/MainContent.d.ts +19 -0
- package/lib/examples/components/MainContent.js +68 -0
- package/lib/examples/components/MockFileBrowser.d.ts +12 -0
- package/lib/examples/components/MockFileBrowser.js +131 -0
- package/lib/examples/components/Rating.d.ts +14 -0
- package/lib/examples/components/Rating.js +12 -0
- package/lib/examples/components/SessionTabs.d.ts +21 -0
- package/lib/examples/components/SessionTabs.js +11 -0
- package/lib/examples/components/TimeTravel.d.ts +15 -0
- package/lib/examples/components/TimeTravel.js +23 -0
- package/lib/examples/components/index.d.ts +11 -0
- package/lib/examples/components/index.js +14 -0
- package/lib/examples/example-selector.d.ts +22 -0
- package/lib/examples/example-selector.js +62 -0
- package/lib/examples/index.d.ts +21 -0
- package/lib/examples/index.js +25 -0
- package/lib/examples/lexical/editorConfig.d.ts +76 -0
- package/lib/examples/lexical/editorConfig.js +55 -0
- package/lib/examples/lexical/lexical-theme.css +436 -0
- package/lib/examples/lexical/theme.d.ts +61 -0
- package/lib/examples/lexical/theme.js +72 -0
- package/lib/examples/main.d.ts +2 -0
- package/lib/examples/main.js +334 -0
- package/lib/examples/stores/agents/earthquake-detector.ipynb.json +111 -0
- package/lib/examples/stores/agents/earthquake-detector.json +13 -0
- package/lib/examples/stores/agents/earthquake-detector.lexical.json +2988 -0
- package/lib/examples/stores/agents/sales-forecaster.ipynb.json +111 -0
- package/lib/examples/stores/agents/sales-forecaster.json +13 -0
- package/lib/examples/stores/agents/sales-forecaster.lexical.json +2988 -0
- package/lib/examples/stores/agents/social-post-generator.ipynb.json +111 -0
- package/lib/examples/stores/agents/social-post-generator.json +13 -0
- package/lib/examples/stores/agents/social-post-generator.lexical.json +2988 -0
- package/lib/examples/stores/agents/stock-market.ipynb.json +56 -0
- package/lib/examples/stores/agents/stock-market.json +13 -0
- package/lib/examples/stores/agents/stock-market.lexical.json +1026 -0
- package/lib/examples/stores/examplesStore.d.ts +26 -0
- package/lib/examples/stores/examplesStore.js +60 -0
- package/lib/examples/stores/notebooks/Empty.ipynb.json +33 -0
- package/lib/examples/stores/notebooks/IPyWidgetsExample.ipynb.json +101 -0
- package/lib/examples/stores/notebooks/IPyWidgetsExampleWithState.ipynb.json +112 -0
- package/lib/examples/stores/notebooks/Lite.ipynb.json +128 -0
- package/lib/examples/stores/notebooks/Matplotlib.ipynb.json +137 -0
- package/lib/examples/stores/notebooks/NotebookExample1.ipynb.json +126 -0
- package/lib/examples/stores/notebooks/NotebookExample2.ipynb.json +48 -0
- package/lib/examples/stores/notebooks/NotebookOutputs.ipynb.json +49 -0
- package/lib/examples/stores/notebooks/NotebookToCExample.ipynb.json +102 -0
- package/lib/examples/stores/notebooks/OutputIPyWidgetsExample.d.ts +145 -0
- package/lib/examples/stores/notebooks/OutputIPyWidgetsExample.js +153 -0
- package/lib/examples/stores/notebooks/PyGWalker.ipynb.json +55 -0
- package/lib/examples/vercel-ai-elements/VercelAiElementsShowcase.d.ts +12 -0
- package/lib/examples/vercel-ai-elements/VercelAiElementsShowcase.js +69 -0
- package/lib/examples/vercel-ai-elements/components/ArtifactShowcase.d.ts +1 -0
- package/lib/examples/vercel-ai-elements/components/ArtifactShowcase.js +85 -0
- package/lib/examples/vercel-ai-elements/components/CodeBlockShowcase.d.ts +1 -0
- package/lib/examples/vercel-ai-elements/components/CodeBlockShowcase.js +62 -0
- package/lib/examples/vercel-ai-elements/components/ConversationShowcase.d.ts +1 -0
- package/lib/examples/vercel-ai-elements/components/ConversationShowcase.js +51 -0
- package/lib/examples/vercel-ai-elements/components/LoaderShowcase.d.ts +1 -0
- package/lib/examples/vercel-ai-elements/components/LoaderShowcase.js +9 -0
- package/lib/examples/vercel-ai-elements/components/MessageShowcase.d.ts +1 -0
- package/lib/examples/vercel-ai-elements/components/MessageShowcase.js +56 -0
- package/lib/examples/vercel-ai-elements/components/ModelSelectorShowcase.d.ts +1 -0
- package/lib/examples/vercel-ai-elements/components/ModelSelectorShowcase.js +50 -0
- package/lib/examples/vercel-ai-elements/components/PromptInputShowcase.d.ts +1 -0
- package/lib/examples/vercel-ai-elements/components/PromptInputShowcase.js +16 -0
- package/lib/examples/vercel-ai-elements/components/ReasoningShowcase.d.ts +1 -0
- package/lib/examples/vercel-ai-elements/components/ReasoningShowcase.js +72 -0
- package/lib/examples/vercel-ai-elements/components/ShimmerShowcase.d.ts +1 -0
- package/lib/examples/vercel-ai-elements/components/ShimmerShowcase.js +9 -0
- package/lib/examples/vercel-ai-elements/components/SourcesShowcase.d.ts +1 -0
- package/lib/examples/vercel-ai-elements/components/SourcesShowcase.js +43 -0
- package/lib/examples/vercel-ai-elements/components/SuggestionShowcase.d.ts +1 -0
- package/lib/examples/vercel-ai-elements/components/SuggestionShowcase.js +31 -0
- package/lib/examples/vercel-ai-elements/components/ToolShowcase.d.ts +1 -0
- package/lib/examples/vercel-ai-elements/components/ToolShowcase.js +54 -0
- package/lib/examples/vercel-ai-elements/index.d.ts +13 -0
- package/lib/examples/vercel-ai-elements/index.js +17 -0
- package/lib/examples/vercel-ai-elements/main.d.ts +1 -0
- package/lib/examples/vercel-ai-elements/main.js +9 -0
- package/lib/examples/vercel-ai-elements/showcase.css +128 -0
- package/lib/hooks/index.d.ts +68 -0
- package/lib/hooks/index.js +81 -0
- package/lib/hooks/useA2A.d.ts +75 -0
- package/lib/hooks/useA2A.js +368 -0
- package/lib/hooks/useAGUI.d.ts +63 -0
- package/lib/hooks/useAGUI.js +162 -0
- package/lib/hooks/useAcp.d.ts +121 -0
- package/lib/hooks/useAcp.js +459 -0
- package/lib/hooks/useAgents.d.ts +13 -0
- package/lib/hooks/useAgents.js +71 -0
- package/lib/hooks/useChat.d.ts +62 -0
- package/lib/hooks/useChat.js +363 -0
- package/lib/hooks/useKeyboardShortcuts.d.ts +47 -0
- package/lib/hooks/useKeyboardShortcuts.js +153 -0
- package/lib/hooks/useMobile.d.ts +1 -0
- package/lib/hooks/useMobile.js +19 -0
- package/lib/hooks/useNotebookAIAgent.d.ts +8 -0
- package/lib/hooks/useNotebookAIAgent.js +56 -0
- package/lib/hooks/useToast.d.ts +44 -0
- package/lib/hooks/useToast.js +128 -0
- package/lib/hooks/useTools.d.ts +107 -0
- package/lib/hooks/useTools.js +130 -0
- package/lib/hooks/useVercelChat.d.ts +45 -0
- package/lib/hooks/useVercelChat.js +62 -0
- package/lib/index.css +73 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +5 -0
- package/lib/lexical/ChatInlinePlugin.d.ts +21 -0
- package/lib/lexical/ChatInlinePlugin.js +379 -0
- package/lib/lexical/index.d.ts +6 -0
- package/lib/lexical/index.js +10 -0
- package/lib/lib/utils.d.ts +2 -0
- package/lib/lib/utils.js +9 -0
- package/lib/main.d.ts +1 -0
- package/lib/main.js +12 -0
- package/lib/models/AIAgent.d.ts +17 -0
- package/lib/models/AIAgent.js +5 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.js +5 -0
- package/lib/renderers/a2ui/components/A2UIRenderer.d.ts +7 -0
- package/lib/renderers/a2ui/components/A2UIRenderer.js +102 -0
- package/lib/renderers/a2ui/components/SurfaceRenderer.d.ts +7 -0
- package/lib/renderers/a2ui/components/SurfaceRenderer.js +101 -0
- package/lib/renderers/a2ui/components/content/AudioPlayer.d.ts +9 -0
- package/lib/renderers/a2ui/components/content/AudioPlayer.js +38 -0
- package/lib/renderers/a2ui/components/content/Divider.d.ts +9 -0
- package/lib/renderers/a2ui/components/content/Divider.js +35 -0
- package/lib/renderers/a2ui/components/content/Icon.d.ts +9 -0
- package/lib/renderers/a2ui/components/content/Icon.js +110 -0
- package/lib/renderers/a2ui/components/content/Image.d.ts +9 -0
- package/lib/renderers/a2ui/components/content/Image.js +61 -0
- package/lib/renderers/a2ui/components/content/Text.d.ts +9 -0
- package/lib/renderers/a2ui/components/content/Text.js +64 -0
- package/lib/renderers/a2ui/components/content/Video.d.ts +9 -0
- package/lib/renderers/a2ui/components/content/Video.js +37 -0
- package/lib/renderers/a2ui/components/content/index.d.ts +6 -0
- package/lib/renderers/a2ui/components/content/index.js +25 -0
- package/lib/renderers/a2ui/components/index.d.ts +5 -0
- package/lib/renderers/a2ui/components/index.js +24 -0
- package/lib/renderers/a2ui/components/interactive/Button.d.ts +11 -0
- package/lib/renderers/a2ui/components/interactive/Button.js +71 -0
- package/lib/renderers/a2ui/components/interactive/CheckBox.d.ts +9 -0
- package/lib/renderers/a2ui/components/interactive/CheckBox.js +48 -0
- package/lib/renderers/a2ui/components/interactive/DateTimeInput.d.ts +9 -0
- package/lib/renderers/a2ui/components/interactive/DateTimeInput.js +62 -0
- package/lib/renderers/a2ui/components/interactive/MultipleChoice.d.ts +9 -0
- package/lib/renderers/a2ui/components/interactive/MultipleChoice.js +73 -0
- package/lib/renderers/a2ui/components/interactive/Slider.d.ts +9 -0
- package/lib/renderers/a2ui/components/interactive/Slider.js +53 -0
- package/lib/renderers/a2ui/components/interactive/TextField.d.ts +9 -0
- package/lib/renderers/a2ui/components/interactive/TextField.js +72 -0
- package/lib/renderers/a2ui/components/interactive/index.d.ts +6 -0
- package/lib/renderers/a2ui/components/interactive/index.js +25 -0
- package/lib/renderers/a2ui/components/layout/Card.d.ts +11 -0
- package/lib/renderers/a2ui/components/layout/Card.js +30 -0
- package/lib/renderers/a2ui/components/layout/Column.d.ts +11 -0
- package/lib/renderers/a2ui/components/layout/Column.js +65 -0
- package/lib/renderers/a2ui/components/layout/List.d.ts +11 -0
- package/lib/renderers/a2ui/components/layout/List.js +55 -0
- package/lib/renderers/a2ui/components/layout/Modal.d.ts +11 -0
- package/lib/renderers/a2ui/components/layout/Modal.js +58 -0
- package/lib/renderers/a2ui/components/layout/Row.d.ts +11 -0
- package/lib/renderers/a2ui/components/layout/Row.js +65 -0
- package/lib/renderers/a2ui/components/layout/Tabs.d.ts +11 -0
- package/lib/renderers/a2ui/components/layout/Tabs.js +48 -0
- package/lib/renderers/a2ui/components/layout/index.d.ts +6 -0
- package/lib/renderers/a2ui/components/layout/index.js +25 -0
- package/lib/renderers/a2ui/context/A2UIContext.d.ts +17 -0
- package/lib/renderers/a2ui/context/A2UIContext.js +54 -0
- package/lib/renderers/a2ui/context/ThemeContext.d.ts +20 -0
- package/lib/renderers/a2ui/context/ThemeContext.js +333 -0
- package/lib/renderers/a2ui/hooks/useA2UI.d.ts +36 -0
- package/lib/renderers/a2ui/hooks/useA2UI.js +62 -0
- package/lib/renderers/a2ui/hooks/useDataBinding.d.ts +8 -0
- package/lib/renderers/a2ui/hooks/useDataBinding.js +83 -0
- package/lib/renderers/a2ui/index.d.ts +9 -0
- package/lib/renderers/a2ui/index.js +28 -0
- package/lib/renderers/a2ui/lib/utils.d.ts +11 -0
- package/lib/renderers/a2ui/lib/utils.js +38 -0
- package/lib/renderers/a2ui/types/index.d.ts +17 -0
- package/lib/renderers/a2ui/types/index.js +5 -0
- package/lib/renderers/index.d.ts +1 -0
- package/lib/renderers/index.js +5 -0
- package/lib/state/index.d.ts +1 -0
- package/lib/state/index.js +5 -0
- package/lib/state/substates/AIAgentState.d.ts +11 -0
- package/lib/state/substates/AIAgentState.js +42 -0
- package/lib/state/substates/index.d.ts +1 -0
- package/lib/state/substates/index.js +5 -0
- package/lib/stories/Button.d.ts +15 -0
- package/lib/stories/Button.js +13 -0
- package/lib/stories/Button.stories.d.ts +23 -0
- package/lib/stories/Button.stories.js +48 -0
- package/lib/stories/Cell.stories.d.ts +12 -0
- package/lib/stories/Cell.stories.js +123 -0
- package/lib/stories/Header.d.ts +12 -0
- package/lib/stories/Header.js +8 -0
- package/lib/stories/Header.stories.d.ts +18 -0
- package/lib/stories/Header.stories.js +30 -0
- package/lib/stories/Page.d.ts +3 -0
- package/lib/stories/Page.js +12 -0
- package/lib/stories/Page.stories.d.ts +12 -0
- package/lib/stories/Page.stories.js +28 -0
- package/lib/stories/assets/accessibility.png +0 -0
- package/lib/stories/assets/accessibility.svg +1 -0
- package/lib/stories/assets/addon-library.png +0 -0
- package/lib/stories/assets/assets.png +0 -0
- package/lib/stories/assets/context.png +0 -0
- package/lib/stories/assets/discord.svg +1 -0
- package/lib/stories/assets/docs.png +0 -0
- package/lib/stories/assets/figma-plugin.png +0 -0
- package/lib/stories/assets/github.svg +1 -0
- package/lib/stories/assets/share.png +0 -0
- package/lib/stories/assets/styling.png +0 -0
- package/lib/stories/assets/testing.png +0 -0
- package/lib/stories/assets/theming.png +0 -0
- package/lib/stories/assets/tutorials.svg +1 -0
- package/lib/stories/assets/youtube.svg +1 -0
- package/lib/stories/button.css +35 -0
- package/lib/stories/header.css +37 -0
- package/lib/stories/page.css +73 -0
- package/lib/test-setup.d.ts +1 -0
- package/lib/test-setup.js +80 -0
- package/lib/tools/adapters/agent-runtimes/AgentRuntimesToolAdapter.d.ts +40 -0
- package/lib/tools/adapters/agent-runtimes/AgentRuntimesToolAdapter.js +110 -0
- package/lib/tools/adapters/agent-runtimes/index.d.ts +9 -0
- package/lib/tools/adapters/agent-runtimes/index.js +13 -0
- package/lib/tools/adapters/agent-runtimes/lexicalHooks.d.ts +24 -0
- package/lib/tools/adapters/agent-runtimes/lexicalHooks.js +50 -0
- package/lib/tools/adapters/agent-runtimes/notebookHooks.d.ts +24 -0
- package/lib/tools/adapters/agent-runtimes/notebookHooks.js +51 -0
- package/lib/tools/adapters/copilotkit/CopilotKitToolAdapter.d.ts +73 -0
- package/lib/tools/adapters/copilotkit/CopilotKitToolAdapter.js +244 -0
- package/lib/tools/adapters/copilotkit/index.d.ts +10 -0
- package/lib/tools/adapters/copilotkit/index.js +14 -0
- package/lib/tools/adapters/copilotkit/lexicalHooks.d.ts +27 -0
- package/lib/tools/adapters/copilotkit/lexicalHooks.js +59 -0
- package/lib/tools/adapters/copilotkit/notebookHooks.d.ts +27 -0
- package/lib/tools/adapters/copilotkit/notebookHooks.js +58 -0
- package/lib/tools/adapters/index.d.ts +1 -0
- package/lib/tools/adapters/index.js +5 -0
- package/lib/tools/index.d.ts +6 -0
- package/lib/tools/index.js +18 -0
- package/lib/types.d.ts +5 -0
- package/lib/types.js +5 -0
- package/package.json +327 -0
- package/style/animation/Animation.module.css +174 -0
- package/style/base.css +204 -0
- package/style/index.css +6 -0
- package/style/showcase-vercel-ai.css +137 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
BSD 3-Clause License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2022, Datalayer
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
Redistribution and use in source and binary forms, with or without
|
|
8
|
+
modification, are permitted provided that the following conditions are met:
|
|
9
|
+
|
|
10
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
11
|
+
list of conditions and the following disclaimer.
|
|
12
|
+
|
|
13
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
14
|
+
this list of conditions and the following disclaimer in the documentation
|
|
15
|
+
and/or other materials provided with the distribution.
|
|
16
|
+
|
|
17
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
18
|
+
contributors may be used to endorse or promote products derived from
|
|
19
|
+
this software without specific prior written permission.
|
|
20
|
+
|
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
22
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
23
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
24
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
25
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
26
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
27
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
28
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
29
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
30
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
31
|
+
|
|
32
|
+
This contains code taken from https://github.com/jupyter/jupyter_core
|
package/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
~ Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
~
|
|
4
|
+
~ BSD 3-Clause License
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
So your goal is to require approval for all or only some tools on that MCP server? And then to present the approval to the user using the Vercel AI integration?
|
|
8
|
+
yes, that is my goal to implement https://github.com/datalayer/jupyter-ai-agents/issues/53
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
As you know, Vercel AI Element are just React UI components, it is up to the developer to implement such features.
|
|
12
|
+
I believe it's a little bit more than that because of the Data Stream Protocol they implement: https://ai-sdk.dev/docs/ai-sdk-ui/stream-protocol#data-stream-protocol, that we support as well: https://ai.pydantic.dev/ui/vercel-ai/, so you don't just get the components but also the automatic rendering of the chat interface based on the events that are coming from the server. Right?
|
|
13
|
+
The vercel ai-element tool approval has been merged 3 weeks ago https://github.com/vercel/ai-elements/pull/163
|
|
14
|
+
That's great! It doesn't look like they have events for that in the Data Stream Protocol yet though, so it's not clear how they expect agent backends to represent tool calls that require approval, or how they'll send approval to the backend...
|
|
15
|
+
I guess having a kind of reference implementation for common use cases/patterns will be good for the community. I would say that kind of case (external mcp server with tool approval like done by eg claude desktop) is quite common, or will become common
|
|
16
|
+
Definitely, which is partly why github.com/pydantic/pydantic-ai/issues/3295 exists, but there's currently a missing link in how approvals should be represented on the event stream going from agent to frontend, and in approval results going from frontend to agent. I'd expect Vercel AI to come up with something sooner rather than later since they have their own (TypeScript) agent SDK as well, which they'd then document in the Data Stream Protocol, which we can then support as well.
|
|
17
|
+
In the meantime, you could do something like this:
|
|
18
|
+
Wrap your MCPServer in ApprovalRequiredToolset (assuming all tools require approval). This means that when any of the tools are called, the agent run will end with a DeferredToolRequests object as result.output
|
|
19
|
+
When you use VercelAIAdapter.dispatch_request, you can add an on_complete handler that is passed the AgentRunResult and can yield additional Vercel AI events. In that handler, you can check result.output , and if it's DeferredToolRequests , you can yield a custom pydantic_ai.ui.vercel_ai.response_types.DataChunk wrapping those deferred tool requests, which will be sent to frontend
|
|
20
|
+
On the frontend you can handle that custom data part by showing the user the tool call that needs approval
|
|
21
|
+
When the user approves, you'll need to perform a new request to the backend containing that approval, by listing the approved tool_call_ids on the SubmitMessage payload (I'm not an expert on how this part of AI Elements works...)
|
|
22
|
+
In the backend endpoint, you then have to parse this value out of the SubmitMessage payload (similar to this: https://github.com/pydantic/ai-chat-ui/blob/b0ac18d2dbbef3cf1636c17a29fb7578a59b32c8/agent/chatbot/server.py#L115-L122), turn it into a DeferredToolResults object and pass it to the dispatch/run method as deferred_tool_results
|
|
23
|
+
|
|
24
|
+
-->
|
|
25
|
+
|
|
26
|
+
[](https://datalayer.io)
|
|
27
|
+
|
|
28
|
+
[](https://github.com/sponsors/datalayer)
|
|
29
|
+
|
|
30
|
+
# 🤖 Agent Runtimes
|
|
31
|
+
|
|
32
|
+
[](https://github.com/datalayer/code-sandboxes/actions/workflows/build.yml)
|
|
33
|
+
[](https://pypi.org/project/code-sandboxes)
|
|
34
|
+
|
|
35
|
+
**Agent Runtimes** is a flexible server framework for exposing AI agents through multiple protocols.
|
|
36
|
+
|
|
37
|
+
## 🌟 Features
|
|
38
|
+
|
|
39
|
+
### Multi-Protocol Support
|
|
40
|
+
- **ACP (Agent Client Protocol)**: WebSocket-based standard protocol
|
|
41
|
+
- **Vercel AI SDK**: Compatible with Vercel's AI SDK for React/Next.js
|
|
42
|
+
- **AG-UI**: Lightweight web interface (Pydantic AI native)
|
|
43
|
+
- **MCP-UI**: Interactive UI resources protocol with React/Web Components
|
|
44
|
+
- **A2A**: Agent-to-agent communication
|
|
45
|
+
|
|
46
|
+
### Multi-Agent Support
|
|
47
|
+
- **Pydantic AI**: Type-safe agents (fully implemented)
|
|
48
|
+
- **LangChain**: Complex workflows (adapter ready)
|
|
49
|
+
- **Jupyter AI**: Notebook integration (adapter ready)
|
|
50
|
+
|
|
51
|
+
### Built-in Features
|
|
52
|
+
- 🔌 **Adapter Architecture**: Easy to add new agents and protocols
|
|
53
|
+
- 🛠️ **Tool Support**: MCP, custom tools, built-in utilities
|
|
54
|
+
- 📊 **Observability**: OpenTelemetry integration
|
|
55
|
+
- 💾 **Persistence**: DBOS support for durable execution
|
|
56
|
+
- 🔒 **Context Optimization**: LLM context management
|
package/lib/App.css
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
#root {
|
|
7
|
+
max-width: 1280px;
|
|
8
|
+
margin: 0 auto;
|
|
9
|
+
padding: 2rem;
|
|
10
|
+
/* text-align: center; */
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.logo {
|
|
14
|
+
height: 6em;
|
|
15
|
+
padding: 1.5em;
|
|
16
|
+
will-change: filter;
|
|
17
|
+
transition: filter 300ms;
|
|
18
|
+
}
|
|
19
|
+
.logo:hover {
|
|
20
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
|
21
|
+
}
|
|
22
|
+
.logo.react:hover {
|
|
23
|
+
filter: drop-shadow(0 0 2em #61dafbaa);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@keyframes logo-spin {
|
|
27
|
+
from {
|
|
28
|
+
transform: rotate(0deg);
|
|
29
|
+
}
|
|
30
|
+
to {
|
|
31
|
+
transform: rotate(360deg);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
36
|
+
a:nth-of-type(2) .logo {
|
|
37
|
+
animation: logo-spin infinite 20s linear;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.card {
|
|
42
|
+
padding: 2em;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.read-the-docs {
|
|
46
|
+
color: #888;
|
|
47
|
+
}
|
package/lib/App.d.ts
ADDED
package/lib/App.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
import { useJupyter, JupyterReactTheme } from '@datalayer/jupyter-react';
|
|
7
|
+
import { JupyterCellExample } from './examples/JupyterCellExample';
|
|
8
|
+
import { JupyterNotebookExample } from './examples/JupyterNotebookExample';
|
|
9
|
+
import './App.css';
|
|
10
|
+
export function App() {
|
|
11
|
+
const { serviceManager } = useJupyter({
|
|
12
|
+
jupyterServerUrl: 'https://oss.datalayer.run/api/jupyter-server',
|
|
13
|
+
jupyterServerToken: '60c1661cc408f978c309d04157af55c9588ff9557c9380e4fb50785750703da6',
|
|
14
|
+
startDefaultKernel: true,
|
|
15
|
+
});
|
|
16
|
+
return (_jsxs(JupyterReactTheme, { children: [serviceManager && _jsx(JupyterCellExample, { serviceManager: serviceManager }), serviceManager && (_jsx(JupyterNotebookExample, { serviceManager: serviceManager }))] }));
|
|
17
|
+
}
|
|
18
|
+
export default App;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface AgentDetailsProps {
|
|
2
|
+
/** Agent name/title */
|
|
3
|
+
name?: string;
|
|
4
|
+
/** Protocol being used */
|
|
5
|
+
protocol: string;
|
|
6
|
+
/** Endpoint URL */
|
|
7
|
+
url: string;
|
|
8
|
+
/** Number of messages in conversation */
|
|
9
|
+
messageCount: number;
|
|
10
|
+
/** Agent ID */
|
|
11
|
+
agentId?: string;
|
|
12
|
+
/** Callback to go back to chat view */
|
|
13
|
+
onBack: () => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* AgentDetails component displays comprehensive information about the agent.
|
|
17
|
+
*/
|
|
18
|
+
export declare function AgentDetails({ name, protocol, url, messageCount, agentId, onBack, }: AgentDetailsProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default AgentDetails;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
// Distributed under the terms of the Modified BSD License.
|
|
4
|
+
/**
|
|
5
|
+
* AgentDetails component - Shows detailed information about the agent
|
|
6
|
+
* including name, protocol, URL, message count, and context details.
|
|
7
|
+
*/
|
|
8
|
+
import { ArrowLeftIcon, GlobeIcon, CommentDiscussionIcon, DatabaseIcon, FileIcon, ToolsIcon, ClockIcon, } from '@primer/octicons-react';
|
|
9
|
+
import { Box, Button, Heading, IconButton, Text, Label, ProgressBar, } from '@primer/react';
|
|
10
|
+
import { AiAgentIcon } from '@datalayer/icons-react';
|
|
11
|
+
// Mock context data for display
|
|
12
|
+
const MOCK_CONTEXT_DATA = {
|
|
13
|
+
name: 'Context',
|
|
14
|
+
totalTokens: 2520000,
|
|
15
|
+
usedTokens: 1523552,
|
|
16
|
+
children: [
|
|
17
|
+
{
|
|
18
|
+
name: 'Files',
|
|
19
|
+
value: 450000,
|
|
20
|
+
children: [
|
|
21
|
+
{ name: 'app.py', value: 125000 },
|
|
22
|
+
{ name: 'models.py', value: 98000 },
|
|
23
|
+
{ name: 'routes.py', value: 112000 },
|
|
24
|
+
{ name: 'utils.py', value: 115000 },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'Messages',
|
|
29
|
+
value: 380000,
|
|
30
|
+
children: [
|
|
31
|
+
{ name: 'User messages', value: 180000 },
|
|
32
|
+
{ name: 'Assistant responses', value: 200000 },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'Tools',
|
|
37
|
+
value: 220000,
|
|
38
|
+
children: [
|
|
39
|
+
{ name: 'Code execution', value: 95000 },
|
|
40
|
+
{ name: 'File operations', value: 75000 },
|
|
41
|
+
{ name: 'Search', value: 50000 },
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Memory',
|
|
46
|
+
value: 473552,
|
|
47
|
+
children: [
|
|
48
|
+
{ name: 'Short term', value: 150000 },
|
|
49
|
+
{ name: 'Long term', value: 323552 },
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Format token count for display
|
|
56
|
+
*/
|
|
57
|
+
function formatTokens(tokens) {
|
|
58
|
+
if (tokens >= 1000000) {
|
|
59
|
+
return `${(tokens / 1000000).toFixed(1)}M`;
|
|
60
|
+
}
|
|
61
|
+
if (tokens >= 1000) {
|
|
62
|
+
return `${(tokens / 1000).toFixed(1)}K`;
|
|
63
|
+
}
|
|
64
|
+
return tokens.toString();
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get icon for context category
|
|
68
|
+
*/
|
|
69
|
+
function getCategoryIcon(name) {
|
|
70
|
+
switch (name.toLowerCase()) {
|
|
71
|
+
case 'files':
|
|
72
|
+
return FileIcon;
|
|
73
|
+
case 'messages':
|
|
74
|
+
return CommentDiscussionIcon;
|
|
75
|
+
case 'tools':
|
|
76
|
+
return ToolsIcon;
|
|
77
|
+
case 'memory':
|
|
78
|
+
return DatabaseIcon;
|
|
79
|
+
default:
|
|
80
|
+
return ClockIcon;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* AgentDetails component displays comprehensive information about the agent.
|
|
85
|
+
*/
|
|
86
|
+
export function AgentDetails({ name = 'AI Agent', protocol, url, messageCount, agentId, onBack, }) {
|
|
87
|
+
const contextUsagePercent = (MOCK_CONTEXT_DATA.usedTokens / MOCK_CONTEXT_DATA.totalTokens) * 100;
|
|
88
|
+
return (_jsxs(Box, { sx: {
|
|
89
|
+
display: 'flex',
|
|
90
|
+
flexDirection: 'column',
|
|
91
|
+
height: '100%',
|
|
92
|
+
bg: 'canvas.default',
|
|
93
|
+
overflow: 'auto',
|
|
94
|
+
}, children: [_jsxs(Box, { sx: {
|
|
95
|
+
display: 'flex',
|
|
96
|
+
alignItems: 'center',
|
|
97
|
+
gap: 2,
|
|
98
|
+
p: 3,
|
|
99
|
+
borderBottom: '1px solid',
|
|
100
|
+
borderColor: 'border.default',
|
|
101
|
+
}, children: [_jsx(IconButton, { icon: ArrowLeftIcon, "aria-label": "Back to chat", variant: "invisible", onClick: onBack }), _jsx(Heading, { as: "h2", sx: { fontSize: 3, fontWeight: 'semibold' }, children: "Agent Details" })] }), _jsxs(Box, { sx: { p: 3, display: 'flex', flexDirection: 'column', gap: 4 }, children: [_jsxs(Box, { sx: {
|
|
102
|
+
display: 'flex',
|
|
103
|
+
alignItems: 'center',
|
|
104
|
+
gap: 3,
|
|
105
|
+
p: 3,
|
|
106
|
+
bg: 'canvas.subtle',
|
|
107
|
+
borderRadius: 2,
|
|
108
|
+
border: '1px solid',
|
|
109
|
+
borderColor: 'border.default',
|
|
110
|
+
}, children: [_jsx(Box, { sx: {
|
|
111
|
+
p: 2,
|
|
112
|
+
bg: 'accent.subtle',
|
|
113
|
+
borderRadius: 2,
|
|
114
|
+
}, children: _jsx(AiAgentIcon, { colored: true, size: 32 }) }), _jsxs(Box, { sx: { flex: 1 }, children: [_jsx(Heading, { as: "h3", sx: { fontSize: 2, fontWeight: 'semibold', mb: 1 }, children: name }), _jsxs(Box, { sx: { display: 'flex', gap: 2, alignItems: 'center' }, children: [_jsx(Label, { variant: "accent", size: "small", children: protocol.toUpperCase().replace(/-/g, ' ') }), agentId && (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["ID: ", agentId] }))] })] })] }), _jsxs(Box, { children: [_jsx(Heading, { as: "h4", sx: {
|
|
115
|
+
fontSize: 1,
|
|
116
|
+
fontWeight: 'semibold',
|
|
117
|
+
mb: 2,
|
|
118
|
+
color: 'fg.muted',
|
|
119
|
+
}, children: "Connection" }), _jsx(Box, { sx: {
|
|
120
|
+
p: 3,
|
|
121
|
+
bg: 'canvas.subtle',
|
|
122
|
+
borderRadius: 2,
|
|
123
|
+
border: '1px solid',
|
|
124
|
+
borderColor: 'border.default',
|
|
125
|
+
}, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(GlobeIcon, { size: 16 }), _jsx(Text, { sx: {
|
|
126
|
+
fontSize: 1,
|
|
127
|
+
fontFamily: 'mono',
|
|
128
|
+
wordBreak: 'break-all',
|
|
129
|
+
}, children: url })] }) })] }), _jsxs(Box, { children: [_jsx(Heading, { as: "h4", sx: {
|
|
130
|
+
fontSize: 1,
|
|
131
|
+
fontWeight: 'semibold',
|
|
132
|
+
mb: 2,
|
|
133
|
+
color: 'fg.muted',
|
|
134
|
+
}, children: "Conversation" }), _jsxs(Box, { sx: {
|
|
135
|
+
p: 3,
|
|
136
|
+
bg: 'canvas.subtle',
|
|
137
|
+
borderRadius: 2,
|
|
138
|
+
border: '1px solid',
|
|
139
|
+
borderColor: 'border.default',
|
|
140
|
+
display: 'flex',
|
|
141
|
+
alignItems: 'center',
|
|
142
|
+
gap: 2,
|
|
143
|
+
}, children: [_jsx(CommentDiscussionIcon, { size: 16 }), _jsxs(Text, { sx: { fontSize: 1 }, children: [_jsx(Text, { as: "span", sx: { fontWeight: 'semibold' }, children: messageCount }), ' ', messageCount === 1 ? 'message' : 'messages'] })] })] }), _jsxs(Box, { children: [_jsx(Heading, { as: "h4", sx: {
|
|
144
|
+
fontSize: 1,
|
|
145
|
+
fontWeight: 'semibold',
|
|
146
|
+
mb: 2,
|
|
147
|
+
color: 'fg.muted',
|
|
148
|
+
}, children: "Context Usage" }), _jsxs(Box, { sx: {
|
|
149
|
+
p: 3,
|
|
150
|
+
bg: 'canvas.subtle',
|
|
151
|
+
borderRadius: 2,
|
|
152
|
+
border: '1px solid',
|
|
153
|
+
borderColor: 'border.default',
|
|
154
|
+
}, children: [_jsxs(Box, { sx: { mb: 3 }, children: [_jsxs(Box, { sx: {
|
|
155
|
+
display: 'flex',
|
|
156
|
+
justifyContent: 'space-between',
|
|
157
|
+
mb: 1,
|
|
158
|
+
}, children: [_jsxs(Text, { sx: { fontSize: 1, fontWeight: 'semibold' }, children: [formatTokens(MOCK_CONTEXT_DATA.usedTokens), " /", ' ', formatTokens(MOCK_CONTEXT_DATA.totalTokens), " tokens"] }), _jsxs(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: [contextUsagePercent.toFixed(0), "%"] })] }), _jsx(ProgressBar, { progress: contextUsagePercent, sx: { height: 8 }, bg: contextUsagePercent > 80
|
|
159
|
+
? 'danger.emphasis'
|
|
160
|
+
: 'accent.emphasis' })] }), _jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: MOCK_CONTEXT_DATA.children.map(category => {
|
|
161
|
+
const CategoryIcon = getCategoryIcon(category.name);
|
|
162
|
+
const categoryPercent = (category.value / MOCK_CONTEXT_DATA.totalTokens) * 100;
|
|
163
|
+
return (_jsxs(Box, { sx: {
|
|
164
|
+
display: 'flex',
|
|
165
|
+
alignItems: 'center',
|
|
166
|
+
gap: 2,
|
|
167
|
+
}, children: [_jsx(Box, { sx: { color: 'fg.muted', width: 20 }, children: _jsx(CategoryIcon, { size: 16 }) }), _jsx(Text, { sx: { fontSize: 1, flex: 1 }, children: category.name }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', minWidth: 60 }, children: formatTokens(category.value) }), _jsx(Box, { sx: { width: 80 }, children: _jsx(ProgressBar, { progress: categoryPercent, sx: { height: 4 } }) })] }, category.name));
|
|
168
|
+
}) })] })] }), _jsx(Box, { sx: { mt: 2 }, children: _jsx(Button, { variant: "primary", onClick: onBack, sx: { width: '100%' }, children: "Back to Chat" }) })] })] }));
|
|
169
|
+
}
|
|
170
|
+
export default AgentDetails;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { type Suggestion } from './base/ChatBase';
|
|
2
|
+
/**
|
|
3
|
+
* Supported transports (communication transports)
|
|
4
|
+
*/
|
|
5
|
+
export type Transport = 'ag-ui' | 'a2a' | 'acp' | 'vercel-ai' | 'vercel-ai-jupyter';
|
|
6
|
+
/**
|
|
7
|
+
* Extension type for chat features
|
|
8
|
+
*/
|
|
9
|
+
export type Extension = 'mcp-ui' | 'a2ui';
|
|
10
|
+
/**
|
|
11
|
+
* Chat props
|
|
12
|
+
*/
|
|
13
|
+
export interface ChatProps {
|
|
14
|
+
/** Transport to use */
|
|
15
|
+
transport: Transport;
|
|
16
|
+
/** Extensions for chat features */
|
|
17
|
+
extensions?: Extension[];
|
|
18
|
+
/** Base URL of the server (for HTTP-based protocols) */
|
|
19
|
+
baseUrl?: string;
|
|
20
|
+
/** WebSocket URL (for WebSocket-based protocols like ACP) */
|
|
21
|
+
wsUrl?: string;
|
|
22
|
+
/** Agent ID */
|
|
23
|
+
agentId?: string;
|
|
24
|
+
/** Custom placeholder text */
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
/** Custom title */
|
|
27
|
+
title?: string;
|
|
28
|
+
/** Whether to auto-connect on mount */
|
|
29
|
+
autoConnect?: boolean;
|
|
30
|
+
/** Whether to use streaming (for protocols that support it) */
|
|
31
|
+
streaming?: boolean;
|
|
32
|
+
/** Callback when a message is sent */
|
|
33
|
+
onMessageSent?: (content: string) => void;
|
|
34
|
+
/** Callback when a response is received */
|
|
35
|
+
onMessageReceived?: (message: unknown) => void;
|
|
36
|
+
/** Callback when disconnect is clicked */
|
|
37
|
+
onDisconnect?: () => void;
|
|
38
|
+
/** Callback when logout is clicked */
|
|
39
|
+
onLogout?: () => void;
|
|
40
|
+
/** Callback when collapse panel is clicked */
|
|
41
|
+
onCollapsePanel?: () => void;
|
|
42
|
+
/** Custom styles */
|
|
43
|
+
className?: string;
|
|
44
|
+
/** Height of the chat container */
|
|
45
|
+
height?: string | number;
|
|
46
|
+
/** Show header with connection status */
|
|
47
|
+
showHeader?: boolean;
|
|
48
|
+
/** Show model selector (fetched from /configure endpoint) */
|
|
49
|
+
showModelSelector?: boolean;
|
|
50
|
+
/** Show tools menu (fetched from /configure endpoint) */
|
|
51
|
+
showToolsMenu?: boolean;
|
|
52
|
+
/** Clear messages when component mounts or agentId changes */
|
|
53
|
+
clearOnMount?: boolean;
|
|
54
|
+
/** Suggestions to show in empty state */
|
|
55
|
+
suggestions?: Suggestion[];
|
|
56
|
+
/** Whether to automatically submit the message when a suggestion is clicked */
|
|
57
|
+
submitOnSuggestionClick?: boolean;
|
|
58
|
+
/** Description shown in empty state */
|
|
59
|
+
description?: string;
|
|
60
|
+
/** Auto-focus the input on mount */
|
|
61
|
+
autoFocus?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Chat Component
|
|
65
|
+
*
|
|
66
|
+
* A unified chat interface that supports multiple transports.
|
|
67
|
+
* Uses ChatBase internally for consistent UI and behavior.
|
|
68
|
+
*
|
|
69
|
+
* Note: Different transports connect to different servers:
|
|
70
|
+
* - vercel-ai, vercel-ai-jupyter: Connect to Jupyter server (default: localhost:8888)
|
|
71
|
+
* - ag-ui, acp, a2a: Connect to agent-runtimes server (default: localhost:8765)
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* // AG-UI Transport (connects to agent-runtimes server)
|
|
76
|
+
* <Chat
|
|
77
|
+
* transport="ag-ui"
|
|
78
|
+
* baseUrl="http://localhost:8765"
|
|
79
|
+
* agentId="demo-agent"
|
|
80
|
+
* />
|
|
81
|
+
*
|
|
82
|
+
* // ACP Transport (WebSocket to agent-runtimes server)
|
|
83
|
+
* <Chat
|
|
84
|
+
* transport="acp"
|
|
85
|
+
* wsUrl="ws://localhost:8765/api/v1/acp/ws"
|
|
86
|
+
* agentId="demo-agent"
|
|
87
|
+
* />
|
|
88
|
+
*
|
|
89
|
+
* // Vercel AI Transport (connects to Jupyter server)
|
|
90
|
+
* <Chat
|
|
91
|
+
* transport="vercel-ai"
|
|
92
|
+
* baseUrl="http://localhost:8888"
|
|
93
|
+
* agentId="demo-agent"
|
|
94
|
+
* />
|
|
95
|
+
*
|
|
96
|
+
* // Vercel AI (Jupyter) Transport with model/tools selection
|
|
97
|
+
* <Chat
|
|
98
|
+
* transport="vercel-ai-jupyter"
|
|
99
|
+
* showModelSelector={true}
|
|
100
|
+
* showToolsMenu={true}
|
|
101
|
+
* />
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
export declare function Chat({ transport, extensions: _extensions, baseUrl, wsUrl, agentId, placeholder, title, autoConnect: _autoConnect, streaming: _streaming, onMessageSent: _onMessageSent, onMessageReceived: _onMessageReceived, onDisconnect, onLogout: _onLogout, onCollapsePanel: _onCollapsePanel, className, height, showHeader, showModelSelector, showToolsMenu, clearOnMount: _clearOnMount, suggestions, submitOnSuggestionClick, description, autoFocus, }: ChatProps): import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
export default Chat;
|