@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
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Runtime Example Component
|
|
3
|
+
*
|
|
4
|
+
* Demonstrates the multi-transport, multi-agent architecture of agent-runtimes.
|
|
5
|
+
*
|
|
6
|
+
* Features:
|
|
7
|
+
* - Agent library selection (Pydantic AI, LangChain, Simple AI)
|
|
8
|
+
* - Transport selection (ACP, AG-UI, A2A)
|
|
9
|
+
* - Configurable WebSocket URL and Agent ID
|
|
10
|
+
* - Real-time streaming responses
|
|
11
|
+
* - Permission request handling
|
|
12
|
+
* - Connection state management
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* 1. Start the agent-runtimes server: `npm run start:acp`
|
|
16
|
+
* 2. The UI will automatically connect to the ACP server
|
|
17
|
+
* 3. Select your agent library and transport
|
|
18
|
+
* 4. Enter the WebSocket URL and Agent ID (or use defaults)
|
|
19
|
+
* 5. Click Connect and start chatting!
|
|
20
|
+
*/
|
|
21
|
+
declare const AgentSpaceFormExample: React.FC;
|
|
22
|
+
export default AgentSpaceFormExample;
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
/// <reference types="vite/client" />
|
|
7
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
8
|
+
import { PageLayout, IconButton } from '@primer/react';
|
|
9
|
+
import { SidebarCollapseIcon, SidebarExpandIcon } from '@primer/octicons-react';
|
|
10
|
+
import { AiAgentIcon } from '@datalayer/icons-react';
|
|
11
|
+
import { Blankslate } from '@primer/react/experimental';
|
|
12
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
13
|
+
import { Box } from '@datalayer/primer-addons';
|
|
14
|
+
import { datalayerTheme, DatalayerThemeProvider } from '@datalayer/core';
|
|
15
|
+
import { Chat } from '../components/chat';
|
|
16
|
+
import { useAgentsStore } from './stores/examplesStore';
|
|
17
|
+
import { MockFileBrowser, MainContent, Header, FooterMetrics, AgentConfiguration, } from './components';
|
|
18
|
+
// Create a query client for React Query
|
|
19
|
+
const queryClient = new QueryClient({
|
|
20
|
+
defaultOptions: {
|
|
21
|
+
queries: {
|
|
22
|
+
staleTime: 1000 * 60 * 5, // 5 minutes
|
|
23
|
+
gcTime: 1000 * 60 * 10, // 10 minutes
|
|
24
|
+
retry: 1,
|
|
25
|
+
refetchOnWindowFocus: false,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
// Default configuration - use environment variable if available
|
|
30
|
+
// Note: Vercel AI connects to Jupyter server (8888), other protocols connect to agent-runtimes server (8765)
|
|
31
|
+
const DEFAULT_WS_URL = import.meta.env.VITE_ACP_WS_URL || 'ws://localhost:8765/api/v1/acp/ws';
|
|
32
|
+
const DEFAULT_BASE_URL = import.meta.env.VITE_BASE_URL || 'http://localhost:8765';
|
|
33
|
+
const DEFAULT_AGENT_ID = 'demo-agent';
|
|
34
|
+
/**
|
|
35
|
+
* Agent Runtime Example Component
|
|
36
|
+
*
|
|
37
|
+
* Demonstrates the multi-transport, multi-agent architecture of agent-runtimes.
|
|
38
|
+
*
|
|
39
|
+
* Features:
|
|
40
|
+
* - Agent library selection (Pydantic AI, LangChain, Simple AI)
|
|
41
|
+
* - Transport selection (ACP, AG-UI, A2A)
|
|
42
|
+
* - Configurable WebSocket URL and Agent ID
|
|
43
|
+
* - Real-time streaming responses
|
|
44
|
+
* - Permission request handling
|
|
45
|
+
* - Connection state management
|
|
46
|
+
*
|
|
47
|
+
* Usage:
|
|
48
|
+
* 1. Start the agent-runtimes server: `npm run start:acp`
|
|
49
|
+
* 2. The UI will automatically connect to the ACP server
|
|
50
|
+
* 3. Select your agent library and transport
|
|
51
|
+
* 4. Enter the WebSocket URL and Agent ID (or use defaults)
|
|
52
|
+
* 5. Click Connect and start chatting!
|
|
53
|
+
*/
|
|
54
|
+
const AgentSpaceFormExample = () => {
|
|
55
|
+
const [wsUrl, setWsUrl] = useState(DEFAULT_WS_URL);
|
|
56
|
+
const [baseUrl, setBaseUrl] = useState(DEFAULT_BASE_URL);
|
|
57
|
+
const [agentName, setAgentName] = useState(DEFAULT_AGENT_ID);
|
|
58
|
+
const [selectedAgentId, setSelectedAgentId] = useState('new-agent');
|
|
59
|
+
const [agentLibrary, setAgentLibrary] = useState('pydantic-ai');
|
|
60
|
+
const [transport, setTransport] = useState('ag-ui');
|
|
61
|
+
const [extensions, setExtensions] = useState([]);
|
|
62
|
+
const [isConfigured, setIsConfigured] = useState(false);
|
|
63
|
+
// UI state
|
|
64
|
+
const [activeSession, setActiveSession] = useState('session-1');
|
|
65
|
+
const [richEditor, setRichEditor] = useState(false);
|
|
66
|
+
const [durable, setDurable] = useState(true);
|
|
67
|
+
const [codemode, setCodemode] = useState(false);
|
|
68
|
+
const [showContextTree, setShowContextTree] = useState(false);
|
|
69
|
+
const [showNotebook] = useState(true);
|
|
70
|
+
const [leftPaneVisible, setLeftPaneVisible] = useState(true);
|
|
71
|
+
const [rightPaneVisible, setRightPaneVisible] = useState(true);
|
|
72
|
+
const [timeTravel, setTimeTravel] = useState(0);
|
|
73
|
+
const [isCreatingAgent, setIsCreatingAgent] = useState(false);
|
|
74
|
+
const [createError, setCreateError] = useState(null);
|
|
75
|
+
// Get agents and current agent from store
|
|
76
|
+
const agents = useAgentsStore(state => state.agents);
|
|
77
|
+
const currentAgent = useAgentsStore(state => state.getAgentById(selectedAgentId));
|
|
78
|
+
const toggleAgentStatus = useAgentsStore(state => state.toggleAgentStatus);
|
|
79
|
+
// Initialize transport from selected agent on mount
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (currentAgent) {
|
|
82
|
+
setTransport(currentAgent.transport);
|
|
83
|
+
setAgentName(currentAgent.id);
|
|
84
|
+
}
|
|
85
|
+
}, [currentAgent]);
|
|
86
|
+
const handleAgentSelect = (agentId) => {
|
|
87
|
+
setSelectedAgentId(agentId);
|
|
88
|
+
setCreateError(null);
|
|
89
|
+
if (agentId === 'new-agent') {
|
|
90
|
+
// Reset to defaults for new agent
|
|
91
|
+
setAgentName(DEFAULT_AGENT_ID);
|
|
92
|
+
setTransport('ag-ui');
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const agent = agents.find(a => a.id === agentId);
|
|
96
|
+
if (agent) {
|
|
97
|
+
setAgentName(agent.id);
|
|
98
|
+
setTransport(agent.transport);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Create a new agent via the API
|
|
104
|
+
*/
|
|
105
|
+
const createAgentOnServer = useCallback(async () => {
|
|
106
|
+
setIsCreatingAgent(true);
|
|
107
|
+
setCreateError(null);
|
|
108
|
+
try {
|
|
109
|
+
const response = await fetch(`${baseUrl}/api/v1/agents`, {
|
|
110
|
+
method: 'POST',
|
|
111
|
+
headers: {
|
|
112
|
+
'Content-Type': 'application/json',
|
|
113
|
+
},
|
|
114
|
+
body: JSON.stringify({
|
|
115
|
+
name: agentName,
|
|
116
|
+
description: `Agent created via UI (${agentLibrary})`,
|
|
117
|
+
agent_library: agentLibrary,
|
|
118
|
+
transport: transport,
|
|
119
|
+
model: 'openai:gpt-4o-mini',
|
|
120
|
+
system_prompt: 'You are a helpful AI assistant.',
|
|
121
|
+
}),
|
|
122
|
+
});
|
|
123
|
+
if (!response.ok) {
|
|
124
|
+
const errorData = await response
|
|
125
|
+
.json()
|
|
126
|
+
.catch(() => ({ detail: 'Unknown error' }));
|
|
127
|
+
throw new Error(errorData.detail || `Failed to create agent: ${response.status}`);
|
|
128
|
+
}
|
|
129
|
+
const data = await response.json();
|
|
130
|
+
console.log('[AgentRuntimeExample] Agent created:', data);
|
|
131
|
+
return data.id;
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
const errorMessage = error instanceof Error ? error.message : 'Failed to create agent';
|
|
135
|
+
console.error('[AgentRuntimeExample] Error creating agent:', errorMessage);
|
|
136
|
+
setCreateError(errorMessage);
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
finally {
|
|
140
|
+
setIsCreatingAgent(false);
|
|
141
|
+
}
|
|
142
|
+
}, [baseUrl, agentName, agentLibrary, transport]);
|
|
143
|
+
/**
|
|
144
|
+
* Delete an agent via the API
|
|
145
|
+
*/
|
|
146
|
+
const deleteAgentOnServer = useCallback(async (agentId) => {
|
|
147
|
+
try {
|
|
148
|
+
const response = await fetch(`${baseUrl}/api/v1/agents/${agentId}`, {
|
|
149
|
+
method: 'DELETE',
|
|
150
|
+
});
|
|
151
|
+
if (!response.ok) {
|
|
152
|
+
console.warn(`[AgentRuntimeExample] Failed to delete agent: ${response.status}`);
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
console.log('[AgentRuntimeExample] Agent deleted:', agentId);
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
console.warn('[AgentRuntimeExample] Error deleting agent:', error);
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
}, [baseUrl]);
|
|
163
|
+
const handleConnect = async () => {
|
|
164
|
+
// For existing agents (not new-agent), ensure transport and agentName are set
|
|
165
|
+
if (selectedAgentId !== 'new-agent') {
|
|
166
|
+
const agent = agents.find(a => a.id === selectedAgentId);
|
|
167
|
+
if (agent) {
|
|
168
|
+
setTransport(agent.transport);
|
|
169
|
+
setAgentName(agent.id);
|
|
170
|
+
}
|
|
171
|
+
setIsConfigured(true);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
// For vercel-ai-jupyter, no server-side agent creation needed
|
|
175
|
+
// It uses Jupyter server's built-in agent endpoint
|
|
176
|
+
if (transport === 'vercel-ai-jupyter') {
|
|
177
|
+
setIsConfigured(true);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
// For new agents, first create the agent on the server
|
|
181
|
+
if (transport === 'acp' && wsUrl && agentName) {
|
|
182
|
+
const createdAgentId = await createAgentOnServer();
|
|
183
|
+
if (createdAgentId) {
|
|
184
|
+
setAgentName(createdAgentId);
|
|
185
|
+
setIsConfigured(true);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
else if ((transport === 'ag-ui' ||
|
|
189
|
+
transport === 'vercel-ai' ||
|
|
190
|
+
transport === 'a2a') &&
|
|
191
|
+
baseUrl &&
|
|
192
|
+
agentName) {
|
|
193
|
+
const createdAgentId = await createAgentOnServer();
|
|
194
|
+
if (createdAgentId) {
|
|
195
|
+
setAgentName(createdAgentId);
|
|
196
|
+
setIsConfigured(true);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
const handleReset = async () => {
|
|
201
|
+
// Delete the agent from the server if we created it
|
|
202
|
+
if (selectedAgentId === 'new-agent' && agentName) {
|
|
203
|
+
await deleteAgentOnServer(agentName);
|
|
204
|
+
}
|
|
205
|
+
setIsConfigured(false);
|
|
206
|
+
};
|
|
207
|
+
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(DatalayerThemeProvider, { theme: datalayerTheme, children: _jsxs(PageLayout, { containerWidth: "full", children: [_jsx(Header, { activeSession: activeSession, agentName: selectedAgentId === 'new-agent' ? undefined : currentAgent?.name, agentDescription: selectedAgentId === 'new-agent'
|
|
208
|
+
? undefined
|
|
209
|
+
: currentAgent?.description, agentStatus: currentAgent?.status, richEditor: richEditor, durable: durable, codemode: codemode, showContextTree: showContextTree, isNewAgent: selectedAgentId === 'new-agent', isConfigured: isConfigured, onSessionChange: setActiveSession, onRichEditorChange: setRichEditor, onDurableChange: setDurable, onCodemodeChange: setCodemode, onToggleContextTree: () => setShowContextTree(!showContextTree), onToggleStatus: currentAgent
|
|
210
|
+
? () => toggleAgentStatus(currentAgent.id)
|
|
211
|
+
: undefined }), leftPaneVisible ? (_jsxs(_Fragment, { children: [_jsx(Box, { sx: {
|
|
212
|
+
position: 'fixed',
|
|
213
|
+
left: 0,
|
|
214
|
+
top: '50%',
|
|
215
|
+
transform: 'translateY(-50%)',
|
|
216
|
+
zIndex: 100,
|
|
217
|
+
}, children: _jsx(IconButton, { icon: SidebarCollapseIcon, "aria-label": "Collapse left pane", size: "small", onClick: () => setLeftPaneVisible(false), sx: {
|
|
218
|
+
borderRadius: '0 6px 6px 0',
|
|
219
|
+
bg: 'canvas.default',
|
|
220
|
+
border: '1px solid',
|
|
221
|
+
borderLeft: 'none',
|
|
222
|
+
borderColor: 'border.default',
|
|
223
|
+
} }) }), _jsx(PageLayout.Pane, { position: "start", resizable: true, sticky: true, width: { min: '250px', default: '300px', max: '90px' }, children: selectedAgentId === 'new-agent' ? (_jsxs(Blankslate, { border: true, spacious: true, narrow: true, children: [_jsx(Blankslate.Visual, { children: _jsx(AiAgentIcon, { colored: true, size: 48 }) }), _jsx(Blankslate.Heading, { children: "New Agent" }), _jsx(Box, { sx: { textAlign: 'center' }, children: _jsx(Blankslate.Description, { children: "Configure your new agent using the settings on the right" }) })] })) : (_jsx(MockFileBrowser, { codemode: codemode })) })] })) : (_jsx(Box, { sx: {
|
|
224
|
+
position: 'fixed',
|
|
225
|
+
left: 0,
|
|
226
|
+
top: '50%',
|
|
227
|
+
transform: 'translateY(-50%)',
|
|
228
|
+
zIndex: 100,
|
|
229
|
+
}, children: _jsx(IconButton, { icon: SidebarExpandIcon, "aria-label": "Expand left pane", size: "small", onClick: () => setLeftPaneVisible(true), sx: {
|
|
230
|
+
borderRadius: '0 6px 6px 0',
|
|
231
|
+
bg: 'canvas.default',
|
|
232
|
+
border: '1px solid',
|
|
233
|
+
borderLeft: 'none',
|
|
234
|
+
borderColor: 'border.default',
|
|
235
|
+
} }) })), _jsx(PageLayout.Content, { children: _jsx(MainContent, { showNotebook: showNotebook, timeTravel: timeTravel, onTimeTravelChange: setTimeTravel, richEditor: richEditor, notebookFile: currentAgent?.notebookFile, lexicalFile: currentAgent?.lexicalFile, isNewAgent: selectedAgentId === 'new-agent' }) }), rightPaneVisible ? (_jsxs(_Fragment, { children: [_jsx(Box, { sx: {
|
|
236
|
+
position: 'fixed',
|
|
237
|
+
right: 0,
|
|
238
|
+
top: '50%',
|
|
239
|
+
transform: 'translateY(-50%)',
|
|
240
|
+
zIndex: 100,
|
|
241
|
+
}, children: _jsx(IconButton, { icon: SidebarCollapseIcon, "aria-label": "Collapse right pane", size: "small", onClick: () => setRightPaneVisible(false), sx: {
|
|
242
|
+
borderRadius: '6px 0 0 6px',
|
|
243
|
+
bg: 'canvas.default',
|
|
244
|
+
border: '1px solid',
|
|
245
|
+
borderRight: 'none',
|
|
246
|
+
borderColor: 'border.default',
|
|
247
|
+
} }) }), _jsx(PageLayout.Pane, { position: "end", width: "large", resizable: true, sticky: true, children: _jsx(Box, { sx: {
|
|
248
|
+
height: '100%',
|
|
249
|
+
display: 'flex',
|
|
250
|
+
flexDirection: 'column',
|
|
251
|
+
p: 2,
|
|
252
|
+
}, children: !isConfigured ? (_jsx(AgentConfiguration, { agentLibrary: agentLibrary, transport: currentAgent?.transport || transport, extensions: extensions, wsUrl: wsUrl, baseUrl: baseUrl, agentName: agentName, agents: agents, selectedAgentId: selectedAgentId, isCreatingAgent: isCreatingAgent, createError: createError, onAgentLibraryChange: setAgentLibrary, onTransportChange: setTransport, onExtensionsChange: setExtensions, onWsUrlChange: setWsUrl, onBaseUrlChange: setBaseUrl, onAgentNameChange: setAgentName, onAgentSelect: handleAgentSelect, onConnect: handleConnect })) : (
|
|
253
|
+
/* Chat Interface */
|
|
254
|
+
_jsx(Box, { sx: { flex: 1 }, children: _jsx(Chat, { transport: currentAgent?.transport || transport, extensions: extensions, wsUrl: wsUrl, baseUrl: baseUrl, agentId: currentAgent?.id || agentName, title: currentAgent?.name || agentName || 'AI Assistant', autoConnect: true, autoFocus: true, placeholder: "Type your message to the agent...", height: "calc(100vh - 250px)", suggestions: [
|
|
255
|
+
{
|
|
256
|
+
title: '👋 Say hello',
|
|
257
|
+
message: 'Hello! What can you help me with today?',
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
title: '💡 Get ideas',
|
|
261
|
+
message: 'Can you suggest some creative project ideas?',
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
title: '📝 Explain concepts',
|
|
265
|
+
message: 'Can you explain how AI agents work?',
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
title: '🔧 Help with code',
|
|
269
|
+
message: 'Can you help me write some Python code?',
|
|
270
|
+
},
|
|
271
|
+
], onDisconnect: handleReset, onMessageSent: (_content) => {
|
|
272
|
+
// Message sent
|
|
273
|
+
}, onMessageReceived: (_message) => {
|
|
274
|
+
// Message received
|
|
275
|
+
} }) })) }) })] })) : (_jsx(Box, { sx: {
|
|
276
|
+
position: 'fixed',
|
|
277
|
+
right: 0,
|
|
278
|
+
top: '50%',
|
|
279
|
+
transform: 'translateY(-50%)',
|
|
280
|
+
zIndex: 100,
|
|
281
|
+
}, children: _jsx(IconButton, { icon: SidebarExpandIcon, "aria-label": "Expand right pane", size: "small", onClick: () => setRightPaneVisible(true), sx: {
|
|
282
|
+
borderRadius: '6px 0 0 6px',
|
|
283
|
+
bg: 'canvas.default',
|
|
284
|
+
border: '1px solid',
|
|
285
|
+
borderRight: 'none',
|
|
286
|
+
borderColor: 'border.default',
|
|
287
|
+
} }) })), _jsx(PageLayout.Footer, { divider: "line", sx: {
|
|
288
|
+
position: 'fixed',
|
|
289
|
+
bottom: 0,
|
|
290
|
+
left: 0,
|
|
291
|
+
right: 0,
|
|
292
|
+
bg: 'canvas.default',
|
|
293
|
+
zIndex: 10,
|
|
294
|
+
}, children: selectedAgentId !== 'new-agent' && (_jsx(FooterMetrics, { tokens: 1523552, cost: 2.01 })) })] }) }) }));
|
|
295
|
+
};
|
|
296
|
+
export default AgentSpaceFormExample;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 { useState } from 'react';
|
|
7
|
+
import { PageHeader, Button, TextInput, ActionMenu, ActionList, Box, Avatar, SegmentedControl, } from '@primer/react';
|
|
8
|
+
import { PlusIcon, SearchIcon, KebabHorizontalIcon, TriangleDownIcon, CircleIcon, PauseIcon, } from '@primer/octicons-react';
|
|
9
|
+
import { datalayerTheme, DatalayerThemeProvider } from '@datalayer/core';
|
|
10
|
+
import { useAgentsStore } from './stores/examplesStore';
|
|
11
|
+
import { AgentsDataTable } from './components/AgentsDataTable';
|
|
12
|
+
import { Rating } from './components/Rating';
|
|
13
|
+
const AgentTile = ({ type, title, description, author, lastEdited, screenshot, status, avatarUrl, stars = 0, notifications = 0, onClick, }) => {
|
|
14
|
+
if (type === 'create') {
|
|
15
|
+
return (_jsxs(Box, { onClick: onClick, style: {
|
|
16
|
+
width: '300px',
|
|
17
|
+
height: '200px',
|
|
18
|
+
border: '2px dashed var(--borderColor-default)',
|
|
19
|
+
borderRadius: '8px',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
flexDirection: 'column',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
justifyContent: 'center',
|
|
24
|
+
cursor: 'pointer',
|
|
25
|
+
transition: 'all 0.2s',
|
|
26
|
+
background: 'var(--bgColor-default)',
|
|
27
|
+
}, onMouseEnter: e => {
|
|
28
|
+
e.currentTarget.style.borderColor =
|
|
29
|
+
'var(--borderColor-accent-emphasis)';
|
|
30
|
+
e.currentTarget.style.background = 'var(--bgColor-muted)';
|
|
31
|
+
}, onMouseLeave: e => {
|
|
32
|
+
e.currentTarget.style.borderColor = 'var(--borderColor-default)';
|
|
33
|
+
e.currentTarget.style.background = 'var(--bgColor-default)';
|
|
34
|
+
}, children: [_jsx(Box, { style: { color: 'var(--fgColor-muted)' }, children: _jsx(PlusIcon, { size: 48 }) }), _jsx(Box, { style: {
|
|
35
|
+
marginTop: '12px',
|
|
36
|
+
fontSize: '14px',
|
|
37
|
+
color: 'var(--fgColor-muted)',
|
|
38
|
+
fontWeight: 600,
|
|
39
|
+
}, children: "Create new agent space" })] }));
|
|
40
|
+
}
|
|
41
|
+
return (_jsxs(Box, { onClick: onClick, style: {
|
|
42
|
+
width: '300px',
|
|
43
|
+
border: '1px solid var(--borderColor-default)',
|
|
44
|
+
borderRadius: '8px',
|
|
45
|
+
overflow: 'visible',
|
|
46
|
+
cursor: 'pointer',
|
|
47
|
+
transition: 'all 0.2s',
|
|
48
|
+
background: 'var(--bgColor-default)',
|
|
49
|
+
position: 'relative',
|
|
50
|
+
}, onMouseEnter: e => {
|
|
51
|
+
e.currentTarget.style.boxShadow = '0 4px 12px rgba(0,0,0,0.1)';
|
|
52
|
+
e.currentTarget.style.transform = 'translateY(-2px)';
|
|
53
|
+
}, onMouseLeave: e => {
|
|
54
|
+
e.currentTarget.style.boxShadow = 'none';
|
|
55
|
+
e.currentTarget.style.transform = 'translateY(0)';
|
|
56
|
+
}, children: [notifications > 0 && (_jsx(Box, { style: {
|
|
57
|
+
position: 'absolute',
|
|
58
|
+
top: '-8px',
|
|
59
|
+
right: '-8px',
|
|
60
|
+
minWidth: '24px',
|
|
61
|
+
height: '24px',
|
|
62
|
+
padding: '0 6px',
|
|
63
|
+
borderRadius: '12px',
|
|
64
|
+
background: '#ef4444',
|
|
65
|
+
color: 'white',
|
|
66
|
+
fontSize: '13px',
|
|
67
|
+
fontWeight: 700,
|
|
68
|
+
display: 'flex',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
justifyContent: 'center',
|
|
71
|
+
boxShadow: '0 2px 8px rgba(0,0,0,0.3)',
|
|
72
|
+
border: '2px solid var(--bgColor-default)',
|
|
73
|
+
zIndex: 10,
|
|
74
|
+
}, children: notifications })), _jsxs(Box, { style: {
|
|
75
|
+
width: '100%',
|
|
76
|
+
height: '150px',
|
|
77
|
+
background: screenshot
|
|
78
|
+
? `url(${screenshot}) center/cover`
|
|
79
|
+
: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
80
|
+
display: 'flex',
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
justifyContent: 'center',
|
|
83
|
+
color: 'white',
|
|
84
|
+
fontSize: '18px',
|
|
85
|
+
fontWeight: 600,
|
|
86
|
+
position: 'relative',
|
|
87
|
+
}, children: [!screenshot && title, status && (_jsx(Box, { style: {
|
|
88
|
+
position: 'absolute',
|
|
89
|
+
top: '8px',
|
|
90
|
+
right: '8px',
|
|
91
|
+
display: 'flex',
|
|
92
|
+
alignItems: 'center',
|
|
93
|
+
gap: '4px',
|
|
94
|
+
padding: '4px 8px',
|
|
95
|
+
borderRadius: '4px',
|
|
96
|
+
background: 'rgba(255, 255, 255, 0.9)',
|
|
97
|
+
fontSize: '12px',
|
|
98
|
+
fontWeight: 600,
|
|
99
|
+
color: status === 'running'
|
|
100
|
+
? 'var(--fgColor-success)'
|
|
101
|
+
: 'var(--fgColor-attention)',
|
|
102
|
+
}, children: status === 'running' ? (_jsxs(_Fragment, { children: [_jsx(CircleIcon, { size: 12, fill: "var(--fgColor-success)" }), _jsx("span", { children: "Running" })] })) : (_jsxs(_Fragment, { children: [_jsx(PauseIcon, { size: 12 }), _jsx("span", { children: "Paused" })] })) }))] }), _jsxs(Box, { style: { padding: '12px' }, children: [_jsx(Box, { style: {
|
|
103
|
+
fontSize: '16px',
|
|
104
|
+
fontWeight: 600,
|
|
105
|
+
color: 'var(--fgColor-default)',
|
|
106
|
+
marginBottom: '8px',
|
|
107
|
+
}, children: title }), description && (_jsx(Box, { style: {
|
|
108
|
+
fontSize: '13px',
|
|
109
|
+
color: 'var(--fgColor-muted)',
|
|
110
|
+
marginBottom: '8px',
|
|
111
|
+
lineHeight: '1.4',
|
|
112
|
+
}, children: description })), _jsxs(Box, { style: {
|
|
113
|
+
display: 'flex',
|
|
114
|
+
alignItems: 'center',
|
|
115
|
+
gap: '12px',
|
|
116
|
+
}, children: [avatarUrl && _jsx(Avatar, { src: avatarUrl, size: 40 }), _jsxs(Box, { style: { display: 'flex', flexDirection: 'column', gap: '2px' }, children: [_jsxs(Box, { style: {
|
|
117
|
+
fontSize: '12px',
|
|
118
|
+
color: 'var(--fgColor-muted)',
|
|
119
|
+
}, children: ["by ", author] }), _jsxs(Box, { style: {
|
|
120
|
+
fontSize: '12px',
|
|
121
|
+
color: 'var(--fgColor-muted)',
|
|
122
|
+
}, children: ["Edited ", lastEdited] }), stars > 0 && (_jsx(Box, { style: { marginTop: '4px' }, children: _jsx(Rating, { value: stars, size: 12 }) }))] })] })] })] }));
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Agent Runtimes Example Component
|
|
126
|
+
*
|
|
127
|
+
* Displays a page with agent tiles using Primer PageHeader component.
|
|
128
|
+
*/
|
|
129
|
+
const AgentSpaceHomeExample = () => {
|
|
130
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
131
|
+
const [lastEditedFilter, setLastEditedFilter] = useState('Last edited');
|
|
132
|
+
const [visibilityFilter, setVisibilityFilter] = useState('Any visibility');
|
|
133
|
+
const [statusFilter, setStatusFilter] = useState('Any status');
|
|
134
|
+
const [analystFilter, setAnalystFilter] = useState('All analysts');
|
|
135
|
+
const [viewMode, setViewMode] = useState('tiles');
|
|
136
|
+
// Get agents from store
|
|
137
|
+
const agents = useAgentsStore(state => state.agents);
|
|
138
|
+
const handleCreateAgent = () => {
|
|
139
|
+
// Handle create new agent
|
|
140
|
+
};
|
|
141
|
+
const handleAgentClick = (agentName) => {
|
|
142
|
+
// Handle agent click
|
|
143
|
+
void agentName;
|
|
144
|
+
};
|
|
145
|
+
return (_jsx(DatalayerThemeProvider, { theme: datalayerTheme, children: _jsxs(Box, { style: {
|
|
146
|
+
minHeight: '100vh',
|
|
147
|
+
background: 'var(--bgColor-default)',
|
|
148
|
+
padding: '24px',
|
|
149
|
+
}, children: [_jsxs(PageHeader, { role: "banner", "aria-label": "Agent Spaces", sx: { borderBottom: 'none' }, children: [_jsx(PageHeader.TitleArea, { children: _jsx(PageHeader.Title, { children: "Agent Spaces" }) }), _jsx(PageHeader.Actions, { children: _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Button, { variant: "invisible", leadingVisual: KebabHorizontalIcon, "aria-label": "More options" }) }), _jsx(ActionMenu.Overlay, { children: _jsx(ActionList, { children: _jsx(ActionList.Item, { onSelect: () => {
|
|
150
|
+
// Handle add folder
|
|
151
|
+
}, children: "Add folder" }) }) })] }) })] }), _jsxs(Box, { style: { padding: '24px' }, children: [_jsxs(Box, { style: {
|
|
152
|
+
display: 'flex',
|
|
153
|
+
gap: '12px',
|
|
154
|
+
marginBottom: '24px',
|
|
155
|
+
flexWrap: 'wrap',
|
|
156
|
+
alignItems: 'center',
|
|
157
|
+
justifyContent: 'space-between',
|
|
158
|
+
}, children: [_jsxs(Box, { style: {
|
|
159
|
+
display: 'flex',
|
|
160
|
+
gap: '12px',
|
|
161
|
+
flexWrap: 'wrap',
|
|
162
|
+
alignItems: 'center',
|
|
163
|
+
flex: 1,
|
|
164
|
+
}, children: [_jsx(Box, { style: { flex: '1 1 300px', minWidth: '200px' }, children: _jsx(TextInput, { leadingVisual: SearchIcon, placeholder: "Search agent spaces...", value: searchQuery, onChange: e => setSearchQuery(e.target.value), sx: { width: '100%' } }) }), _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Button, { trailingAction: TriangleDownIcon, children: lastEditedFilter }), _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { selectionVariant: "single", children: [_jsx(ActionList.Item, { selected: lastEditedFilter === 'Last edited', onSelect: () => setLastEditedFilter('Last edited'), children: "Last edited" }), _jsx(ActionList.Item, { selected: lastEditedFilter === 'Created date', onSelect: () => setLastEditedFilter('Created date'), children: "Created date" }), _jsx(ActionList.Item, { selected: lastEditedFilter === 'Name', onSelect: () => setLastEditedFilter('Name'), children: "Name" })] }) })] }), _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Button, { trailingAction: TriangleDownIcon, children: visibilityFilter }), _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { selectionVariant: "single", children: [_jsx(ActionList.Item, { selected: visibilityFilter === 'Any visibility', onSelect: () => setVisibilityFilter('Any visibility'), children: "Any visibility" }), _jsx(ActionList.Item, { selected: visibilityFilter === 'Public', onSelect: () => setVisibilityFilter('Public'), children: "Public" }), _jsx(ActionList.Item, { selected: visibilityFilter === 'Private', onSelect: () => setVisibilityFilter('Private'), children: "Private" })] }) })] }), _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Button, { trailingAction: TriangleDownIcon, children: statusFilter }), _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { selectionVariant: "single", children: [_jsx(ActionList.Item, { selected: statusFilter === 'Any status', onSelect: () => setStatusFilter('Any status'), children: "Any status" }), _jsx(ActionList.Item, { selected: statusFilter === 'Active', onSelect: () => setStatusFilter('Active'), children: "Active" }), _jsx(ActionList.Item, { selected: statusFilter === 'Draft', onSelect: () => setStatusFilter('Draft'), children: "Draft" }), _jsx(ActionList.Item, { selected: statusFilter === 'Archived', onSelect: () => setStatusFilter('Archived'), children: "Archived" })] }) })] }), _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Button, { trailingAction: TriangleDownIcon, children: analystFilter }), _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { selectionVariant: "single", children: [_jsx(ActionList.Item, { selected: analystFilter === 'All analysts', onSelect: () => setAnalystFilter('All analysts'), children: "All analysts" }), _jsx(ActionList.Item, { selected: analystFilter === 'Eric Charles', onSelect: () => setAnalystFilter('Eric Charles'), children: "Eric Charles" }), _jsx(ActionList.Item, { selected: analystFilter === 'Other users', onSelect: () => setAnalystFilter('Other users'), children: "Other users" })] }) })] })] }), _jsxs(SegmentedControl, { "aria-label": "View mode", onChange: index => setViewMode(index === 0 ? 'tiles' : 'table'), children: [_jsx(SegmentedControl.Button, { selected: viewMode === 'tiles', children: "Tiles" }), _jsx(SegmentedControl.Button, { selected: viewMode === 'table', children: "Table" })] })] }), viewMode === 'tiles' && (_jsxs(Box, { style: {
|
|
165
|
+
display: 'grid',
|
|
166
|
+
gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',
|
|
167
|
+
gap: '24px',
|
|
168
|
+
marginBottom: '48px',
|
|
169
|
+
}, children: [_jsx(AgentTile, { type: "create", onClick: handleCreateAgent }), agents.map(agent => (_jsx(AgentTile, { type: "agent", title: agent.name, description: agent.description, author: agent.author, lastEdited: agent.lastEdited, screenshot: agent.screenshot, status: agent.status, avatarUrl: agent.avatarUrl, stars: agent.stars, notifications: agent.notifications, onClick: () => handleAgentClick(agent.name) }, agent.id)))] })), viewMode === 'table' && (_jsx(Box, { children: _jsx(AgentsDataTable, {}) }))] })] }) }));
|
|
170
|
+
};
|
|
171
|
+
export default AgentSpaceHomeExample;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CopilotKit Lexical Example with CopilotKit Integration.
|
|
3
|
+
*
|
|
4
|
+
* To run this example, create a .env file in the core directory with:
|
|
5
|
+
* - VITE_DATALAYER_API_TOKEN: Get from https://datalayer.app/settings/iam/tokens
|
|
6
|
+
* - VITE_COPILOT_KIT_API_KEY: Get from https://cloud.copilotkit.ai/dashboard
|
|
7
|
+
*
|
|
8
|
+
* You also will need to connect copilot kit to some sort of LLM Add LLM Provider API Key.
|
|
9
|
+
*
|
|
10
|
+
* https://docs.copilotkit.ai/reference/hooks/useFrontendTool
|
|
11
|
+
*
|
|
12
|
+
* @module examples/CopilotKitLexicalExample
|
|
13
|
+
*/
|
|
14
|
+
import 'prismjs';
|
|
15
|
+
import 'prismjs/components/prism-clike';
|
|
16
|
+
import 'prismjs/components/prism-javascript';
|
|
17
|
+
import 'prismjs/components/prism-markup';
|
|
18
|
+
import 'prismjs/components/prism-markdown';
|
|
19
|
+
import 'prismjs/components/prism-c';
|
|
20
|
+
import 'prismjs/components/prism-css';
|
|
21
|
+
import 'prismjs/components/prism-objectivec';
|
|
22
|
+
import 'prismjs/components/prism-sql';
|
|
23
|
+
import 'prismjs/components/prism-python';
|
|
24
|
+
import 'prismjs/components/prism-rust';
|
|
25
|
+
import 'prismjs/components/prism-swift';
|
|
26
|
+
import type { ServiceManager } from '@jupyterlab/services';
|
|
27
|
+
import '@datalayer/jupyter-lexical/style/index.css';
|
|
28
|
+
import '@copilotkit/react-ui/styles.css';
|
|
29
|
+
import './lexical/lexical-theme.css';
|
|
30
|
+
/**
|
|
31
|
+
* Main CopilotKit lexical example component
|
|
32
|
+
*/
|
|
33
|
+
interface CopilotKitLexicalExampleProps {
|
|
34
|
+
content?: string;
|
|
35
|
+
serviceManager?: ServiceManager.IManager;
|
|
36
|
+
}
|
|
37
|
+
declare function CopilotKitLexicalExample({ content, serviceManager, }: CopilotKitLexicalExampleProps): JSX.Element;
|
|
38
|
+
export default CopilotKitLexicalExample;
|