@datalayer/agent-runtimes 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/lib/{examples/components → components}/AgentConfiguration.d.ts +54 -9
- package/lib/components/AgentConfiguration.js +585 -0
- package/lib/{examples/components → components}/FooterMetrics.d.ts +1 -2
- package/lib/{examples/components → components}/Header.d.ts +1 -6
- package/lib/{examples/components → components}/Header.js +5 -39
- package/lib/{examples/components → components}/HeaderControls.d.ts +1 -2
- package/lib/{examples/components → components}/HeaderControls.js +1 -1
- package/lib/{examples/components → components}/LexicalEditor.d.ts +2 -3
- package/lib/{examples/components → components}/LexicalEditor.js +2 -2
- package/lib/components/MainContent.d.ts +34 -0
- package/lib/{examples/components → components}/MainContent.js +18 -9
- package/lib/components/McpServerManager.d.ts +30 -0
- package/lib/components/McpServerManager.js +331 -0
- package/lib/{examples/components → components}/MockFileBrowser.d.ts +1 -2
- package/lib/{examples/components → components}/SessionTabs.d.ts +2 -3
- package/lib/{examples/components → components}/TimeTravel.d.ts +1 -2
- package/lib/components/chat/components/AgentDetails.d.ts +3 -1
- package/lib/components/chat/components/AgentDetails.js +472 -22
- package/lib/components/chat/components/Chat.d.ts +37 -3
- package/lib/components/chat/components/Chat.js +29 -10
- package/lib/components/chat/components/ChatFloating.d.ts +27 -2
- package/lib/components/chat/components/ChatFloating.js +17 -10
- package/lib/components/chat/components/ChatPopupStandalone.js +1 -1
- package/lib/components/chat/components/ChatSidebar.d.ts +1 -1
- package/lib/components/chat/components/ChatStandalone.d.ts +1 -1
- package/lib/components/chat/components/ChatStandalone.js +1 -1
- package/lib/components/chat/components/ContextDistribution.d.ts +70 -6
- package/lib/components/chat/components/ContextDistribution.js +13 -6
- package/lib/components/chat/components/ContextInspector.d.ts +81 -0
- package/lib/components/chat/components/ContextInspector.js +263 -0
- package/lib/components/chat/components/ContextPanel.d.ts +112 -0
- package/lib/components/chat/components/ContextPanel.js +368 -0
- package/lib/components/chat/components/base/ChatBase.d.ts +74 -19
- package/lib/components/chat/components/base/ChatBase.js +296 -37
- package/lib/components/chat/components/index.d.ts +3 -1
- package/lib/components/chat/components/index.js +2 -0
- package/lib/components/chat/extensions/ExtensionRegistry.d.ts +1 -1
- package/lib/components/chat/extensions/index.d.ts +1 -0
- package/lib/components/chat/index.d.ts +3 -3
- package/lib/components/chat/protocols/AGUIAdapter.js +24 -4
- package/lib/components/chat/protocols/VercelAIAdapter.js +35 -1
- package/lib/components/chat/store/chatStore.d.ts +2 -3
- package/lib/components/chat/store/conversationStore.d.ts +83 -0
- package/lib/components/chat/store/conversationStore.js +174 -0
- package/lib/components/chat/store/index.d.ts +2 -1
- package/lib/components/chat/store/index.js +1 -0
- package/lib/components/chat/types/inference.d.ts +17 -0
- package/lib/components/chat/types/protocol.d.ts +10 -0
- package/lib/components/index.d.ts +23 -0
- package/lib/components/index.js +11 -0
- package/lib/config/agents/code-ai/agents.d.ts +25 -0
- package/lib/config/agents/code-ai/agents.js +70 -0
- package/lib/config/agents/code-ai/index.d.ts +1 -0
- package/lib/config/agents/code-ai/index.js +5 -0
- package/lib/config/agents/codemode-paper/agents.d.ts +29 -0
- package/lib/config/agents/codemode-paper/agents.js +288 -0
- package/lib/config/agents/codemode-paper/index.d.ts +1 -0
- package/lib/config/agents/codemode-paper/index.js +5 -0
- package/lib/config/agents/datalayer-ai/agents.d.ts +29 -0
- package/lib/config/agents/datalayer-ai/agents.js +267 -0
- package/lib/config/agents/datalayer-ai/index.d.ts +1 -0
- package/lib/config/agents/datalayer-ai/index.js +5 -0
- package/lib/config/agents/index.d.ts +19 -0
- package/lib/config/agents/index.js +38 -0
- package/lib/config/envvars.d.ts +28 -0
- package/lib/config/envvars.js +115 -0
- package/lib/config/index.d.ts +5 -0
- package/lib/config/index.js +9 -0
- package/lib/config/mcpServers.d.ts +18 -0
- package/lib/config/mcpServers.js +153 -0
- package/lib/config/skills.d.ts +27 -0
- package/lib/config/skills.js +60 -0
- package/lib/{lib → config}/utils.d.ts +1 -1
- package/lib/{lib → config}/utils.js +2 -2
- package/lib/examples/AgentRuntimeLexical2Example.d.ts +1 -0
- package/lib/examples/AgentRuntimeLexical2Example.js +3 -2
- package/lib/examples/AgentRuntimeLexicalExample.d.ts +1 -0
- package/lib/examples/AgentRuntimeLexicalExample.js +5 -3
- package/lib/examples/AgentRuntimeLexicalSidebarExample.d.ts +1 -0
- package/lib/examples/AgentRuntimeLexicalSidebarExample.js +3 -3
- package/lib/examples/AgentRuntimeNotebookExample.js +1 -1
- package/lib/examples/AgentSpaceFormExample.d.ts +2 -2
- package/lib/examples/AgentSpaceFormExample.js +215 -35
- package/lib/examples/CopilotKitLexicalExample.d.ts +1 -0
- package/lib/examples/CopilotKitLexicalExample.js +3 -2
- package/lib/examples/index.d.ts +1 -0
- package/lib/examples/stores/notebooks/NotebookExample2.ipynb.json +43 -43
- package/lib/hooks/useAGUI.d.ts +1 -1
- package/lib/hooks/useAGUI.js +1 -1
- package/lib/identity/types.d.ts +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/runtime/index.d.ts +3 -0
- package/lib/runtime/runtimeStore.d.ts +3 -4
- package/lib/runtime/useAgentConnection.d.ts +2 -3
- package/lib/runtime/useAgentRuntime.d.ts +2 -3
- package/lib/stories/Cell.stories.js +1 -1
- package/lib/tools/adapters/agent-runtimes/notebookHooks.js +1 -0
- package/lib/tools/adapters/copilotkit/notebookHooks.js +1 -0
- package/lib/types.d.ts +158 -0
- package/package.json +5 -6
- package/scripts/apply-patches.sh +1 -1
- package/scripts/codegen/generate_agents.py +863 -0
- package/scripts/codegen/generate_envvars.py +302 -0
- package/scripts/codegen/generate_mcp_servers.py +436 -0
- package/scripts/codegen/generate_skills.py +334 -0
- package/scripts/download-ai-elements.py +35 -20
- package/scripts/sync-jupyter.sh +6 -0
- package/lib/components/ui/accordion.d.ts +0 -7
- package/lib/components/ui/accordion.js +0 -22
- package/lib/components/ui/alert-dialog.d.ts +0 -14
- package/lib/components/ui/alert-dialog.js +0 -43
- package/lib/components/ui/alert.d.ts +0 -9
- package/lib/components/ui/alert.js +0 -24
- package/lib/components/ui/aspect-ratio.d.ts +0 -3
- package/lib/components/ui/aspect-ratio.js +0 -11
- package/lib/components/ui/avatar.d.ts +0 -6
- package/lib/components/ui/avatar.js +0 -18
- package/lib/components/ui/badge.d.ts +0 -9
- package/lib/components/ui/badge.js +0 -22
- package/lib/components/ui/breadcrumb.d.ts +0 -11
- package/lib/components/ui/breadcrumb.js +0 -27
- package/lib/components/ui/button-group.d.ts +0 -11
- package/lib/components/ui/button-group.js +0 -31
- package/lib/components/ui/button.d.ts +0 -13
- package/lib/components/ui/button.js +0 -39
- package/lib/components/ui/calendar.d.ts +0 -8
- package/lib/components/ui/calendar.js +0 -80
- package/lib/components/ui/card.d.ts +0 -9
- package/lib/components/ui/card.js +0 -24
- package/lib/components/ui/carousel.d.ts +0 -19
- package/lib/components/ui/carousel.js +0 -95
- package/lib/components/ui/chart.d.ts +0 -53
- package/lib/components/ui/chart.js +0 -136
- package/lib/components/ui/checkbox.d.ts +0 -4
- package/lib/components/ui/checkbox.js +0 -13
- package/lib/components/ui/collapsible.d.ts +0 -5
- package/lib/components/ui/collapsible.js +0 -17
- package/lib/components/ui/command.d.ts +0 -18
- package/lib/components/ui/command.js +0 -38
- package/lib/components/ui/context-menu.d.ts +0 -25
- package/lib/components/ui/context-menu.js +0 -55
- package/lib/components/ui/dialog.d.ts +0 -15
- package/lib/components/ui/dialog.js +0 -40
- package/lib/components/ui/drawer.d.ts +0 -13
- package/lib/components/ui/drawer.js +0 -39
- package/lib/components/ui/dropdown-menu.d.ts +0 -25
- package/lib/components/ui/dropdown-menu.js +0 -55
- package/lib/components/ui/empty.d.ts +0 -11
- package/lib/components/ui/empty.js +0 -37
- package/lib/components/ui/field.d.ts +0 -24
- package/lib/components/ui/field.js +0 -80
- package/lib/components/ui/form.d.ts +0 -24
- package/lib/components/ui/form.js +0 -63
- package/lib/components/ui/hover-card.d.ts +0 -6
- package/lib/components/ui/hover-card.js +0 -18
- package/lib/components/ui/input-group.d.ts +0 -19
- package/lib/components/ui/input-group.js +0 -69
- package/lib/components/ui/input-otp.d.ts +0 -11
- package/lib/components/ui/input-otp.js +0 -25
- package/lib/components/ui/input.d.ts +0 -3
- package/lib/components/ui/input.js +0 -6
- package/lib/components/ui/item.d.ts +0 -23
- package/lib/components/ui/item.js +0 -66
- package/lib/components/ui/kbd.d.ts +0 -3
- package/lib/components/ui/kbd.js +0 -13
- package/lib/components/ui/label.d.ts +0 -4
- package/lib/components/ui/label.js +0 -12
- package/lib/components/ui/menubar.d.ts +0 -26
- package/lib/components/ui/menubar.js +0 -58
- package/lib/components/ui/navigation-menu.d.ts +0 -14
- package/lib/components/ui/navigation-menu.js +0 -31
- package/lib/components/ui/pagination.d.ts +0 -13
- package/lib/components/ui/pagination.js +0 -29
- package/lib/components/ui/popover.d.ts +0 -7
- package/lib/components/ui/popover.js +0 -21
- package/lib/components/ui/progress.d.ts +0 -4
- package/lib/components/ui/progress.js +0 -12
- package/lib/components/ui/radio-group.d.ts +0 -5
- package/lib/components/ui/radio-group.js +0 -16
- package/lib/components/ui/resizable.d.ts +0 -8
- package/lib/components/ui/resizable.js +0 -19
- package/lib/components/ui/scroll-area.d.ts +0 -5
- package/lib/components/ui/scroll-area.js +0 -17
- package/lib/components/ui/select.d.ts +0 -15
- package/lib/components/ui/select.js +0 -42
- package/lib/components/ui/separator.d.ts +0 -4
- package/lib/components/ui/separator.js +0 -12
- package/lib/components/ui/sheet.d.ts +0 -13
- package/lib/components/ui/sheet.js +0 -44
- package/lib/components/ui/sidebar.d.ts +0 -69
- package/lib/components/ui/sidebar.js +0 -216
- package/lib/components/ui/skeleton.d.ts +0 -2
- package/lib/components/ui/skeleton.js +0 -10
- package/lib/components/ui/slider.d.ts +0 -4
- package/lib/components/ui/slider.js +0 -18
- package/lib/components/ui/sonner.d.ts +0 -3
- package/lib/components/ui/sonner.js +0 -25
- package/lib/components/ui/spinner.d.ts +0 -2
- package/lib/components/ui/spinner.js +0 -11
- package/lib/components/ui/switch.d.ts +0 -4
- package/lib/components/ui/switch.js +0 -12
- package/lib/components/ui/table.d.ts +0 -10
- package/lib/components/ui/table.js +0 -32
- package/lib/components/ui/tabs.d.ts +0 -7
- package/lib/components/ui/tabs.js +0 -21
- package/lib/components/ui/textarea.d.ts +0 -3
- package/lib/components/ui/textarea.js +0 -6
- package/lib/components/ui/toast.d.ts +0 -15
- package/lib/components/ui/toast.js +0 -38
- package/lib/components/ui/toaster.d.ts +0 -1
- package/lib/components/ui/toaster.js +0 -14
- package/lib/components/ui/toggle-group.d.ts +0 -9
- package/lib/components/ui/toggle-group.js +0 -26
- package/lib/components/ui/toggle.d.ts +0 -9
- package/lib/components/ui/toggle.js +0 -30
- package/lib/components/ui/tooltip.d.ts +0 -7
- package/lib/components/ui/tooltip.js +0 -21
- package/lib/components/vercel-ai-elements/artifact.d.ts +0 -23
- package/lib/components/vercel-ai-elements/artifact.js +0 -24
- package/lib/components/vercel-ai-elements/code-block.d.ts +0 -17
- package/lib/components/vercel-ai-elements/code-block.js +0 -94
- package/lib/components/vercel-ai-elements/conversation.d.ts +0 -15
- package/lib/components/vercel-ai-elements/conversation.js +0 -21
- package/lib/components/vercel-ai-elements/loader.d.ts +0 -5
- package/lib/components/vercel-ai-elements/loader.js +0 -8
- package/lib/components/vercel-ai-elements/message.d.ts +0 -46
- package/lib/components/vercel-ai-elements/message.js +0 -109
- package/lib/components/vercel-ai-elements/model-selector.d.ts +0 -35
- package/lib/components/vercel-ai-elements/model-selector.js +0 -22
- package/lib/components/vercel-ai-elements/prompt-input.d.ts +0 -195
- package/lib/components/vercel-ai-elements/prompt-input.js +0 -589
- package/lib/components/vercel-ai-elements/reasoning.d.ts +0 -26
- package/lib/components/vercel-ai-elements/reasoning.js +0 -80
- package/lib/components/vercel-ai-elements/shimmer.d.ts +0 -9
- package/lib/components/vercel-ai-elements/shimmer.js +0 -22
- package/lib/components/vercel-ai-elements/sources.d.ts +0 -12
- package/lib/components/vercel-ai-elements/sources.js +0 -13
- package/lib/components/vercel-ai-elements/suggestion.d.ts +0 -10
- package/lib/components/vercel-ai-elements/suggestion.js +0 -16
- package/lib/components/vercel-ai-elements/tool.d.ts +0 -23
- package/lib/components/vercel-ai-elements/tool.js +0 -52
- package/lib/examples/components/AgentConfiguration.js +0 -382
- package/lib/examples/components/MainContent.d.ts +0 -19
- package/lib/examples/components/index.d.ts +0 -10
- package/lib/examples/components/index.js +0 -13
- package/lib/examples/vercel-ai-elements/VercelAiElementsShowcase.d.ts +0 -12
- package/lib/examples/vercel-ai-elements/VercelAiElementsShowcase.js +0 -69
- package/lib/examples/vercel-ai-elements/components/ArtifactShowcase.d.ts +0 -1
- package/lib/examples/vercel-ai-elements/components/ArtifactShowcase.js +0 -85
- package/lib/examples/vercel-ai-elements/components/CodeBlockShowcase.d.ts +0 -1
- package/lib/examples/vercel-ai-elements/components/CodeBlockShowcase.js +0 -62
- package/lib/examples/vercel-ai-elements/components/ConversationShowcase.d.ts +0 -1
- package/lib/examples/vercel-ai-elements/components/ConversationShowcase.js +0 -51
- package/lib/examples/vercel-ai-elements/components/LoaderShowcase.d.ts +0 -1
- package/lib/examples/vercel-ai-elements/components/LoaderShowcase.js +0 -9
- package/lib/examples/vercel-ai-elements/components/MessageShowcase.d.ts +0 -1
- package/lib/examples/vercel-ai-elements/components/MessageShowcase.js +0 -56
- package/lib/examples/vercel-ai-elements/components/ModelSelectorShowcase.d.ts +0 -1
- package/lib/examples/vercel-ai-elements/components/ModelSelectorShowcase.js +0 -50
- package/lib/examples/vercel-ai-elements/components/PromptInputShowcase.d.ts +0 -1
- package/lib/examples/vercel-ai-elements/components/PromptInputShowcase.js +0 -16
- package/lib/examples/vercel-ai-elements/components/ReasoningShowcase.d.ts +0 -1
- package/lib/examples/vercel-ai-elements/components/ReasoningShowcase.js +0 -72
- package/lib/examples/vercel-ai-elements/components/ShimmerShowcase.d.ts +0 -1
- package/lib/examples/vercel-ai-elements/components/ShimmerShowcase.js +0 -9
- package/lib/examples/vercel-ai-elements/components/SourcesShowcase.d.ts +0 -1
- package/lib/examples/vercel-ai-elements/components/SourcesShowcase.js +0 -43
- package/lib/examples/vercel-ai-elements/components/SuggestionShowcase.d.ts +0 -1
- package/lib/examples/vercel-ai-elements/components/SuggestionShowcase.js +0 -31
- package/lib/examples/vercel-ai-elements/components/ToolShowcase.d.ts +0 -1
- package/lib/examples/vercel-ai-elements/components/ToolShowcase.js +0 -54
- package/lib/examples/vercel-ai-elements/index.d.ts +0 -13
- package/lib/examples/vercel-ai-elements/index.js +0 -17
- package/lib/examples/vercel-ai-elements/main.d.ts +0 -1
- package/lib/examples/vercel-ai-elements/main.js +0 -9
- package/lib/examples/vercel-ai-elements/showcase.css +0 -128
- package/lib/hooks/useToast.d.ts +0 -44
- package/lib/hooks/useToast.js +0 -128
- package/patches/@datalayer+jupyter-lexical+1.0.8.patch +0 -11628
- package/patches/@datalayer+jupyter-react+2.0.2.patch +0 -5338
- package/style/showcase-vercel-ai.css +0 -137
- /package/lib/{examples/components → components}/FooterMetrics.js +0 -0
- /package/lib/{examples/components → components}/MockFileBrowser.js +0 -0
- /package/lib/{examples/components → components}/SessionTabs.js +0 -0
- /package/lib/{examples/components → components}/TimeTravel.js +0 -0
- /package/lib/{models → types}/AIAgent.d.ts +0 -0
- /package/lib/{models → types}/AIAgent.js +0 -0
- /package/lib/{models → types}/index.d.ts +0 -0
- /package/lib/{models → types}/index.js +0 -0
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
-
* Distributed under the terms of the Modified BSD License.
|
|
4
|
-
*/
|
|
5
|
-
'use client';
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
-
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
8
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '@/components/ui/collapsible';
|
|
9
|
-
import { cn } from '@/lib/utils';
|
|
10
|
-
import { BrainIcon, ChevronDownIcon } from 'lucide-react';
|
|
11
|
-
import { createContext, memo, useContext, useEffect, useState } from 'react';
|
|
12
|
-
import { Streamdown } from 'streamdown';
|
|
13
|
-
import { Shimmer } from './shimmer';
|
|
14
|
-
const ReasoningContext = createContext(null);
|
|
15
|
-
export const useReasoning = () => {
|
|
16
|
-
const context = useContext(ReasoningContext);
|
|
17
|
-
if (!context) {
|
|
18
|
-
throw new Error('Reasoning components must be used within Reasoning');
|
|
19
|
-
}
|
|
20
|
-
return context;
|
|
21
|
-
};
|
|
22
|
-
const AUTO_CLOSE_DELAY = 1000;
|
|
23
|
-
const MS_IN_S = 1000;
|
|
24
|
-
export const Reasoning = memo(({ className, isStreaming = false, open, defaultOpen = true, onOpenChange, duration: durationProp, children, ...props }) => {
|
|
25
|
-
const [isOpen, setIsOpen] = useControllableState({
|
|
26
|
-
prop: open,
|
|
27
|
-
defaultProp: defaultOpen,
|
|
28
|
-
onChange: onOpenChange,
|
|
29
|
-
});
|
|
30
|
-
const [duration, setDuration] = useControllableState({
|
|
31
|
-
prop: durationProp,
|
|
32
|
-
defaultProp: undefined,
|
|
33
|
-
});
|
|
34
|
-
const [hasAutoClosed, setHasAutoClosed] = useState(false);
|
|
35
|
-
const [startTime, setStartTime] = useState(null);
|
|
36
|
-
// Track duration when streaming starts and ends
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
if (isStreaming) {
|
|
39
|
-
if (startTime === null) {
|
|
40
|
-
setStartTime(Date.now());
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else if (startTime !== null) {
|
|
44
|
-
setDuration(Math.ceil((Date.now() - startTime) / MS_IN_S));
|
|
45
|
-
setStartTime(null);
|
|
46
|
-
}
|
|
47
|
-
}, [isStreaming, startTime, setDuration]);
|
|
48
|
-
// Auto-open when streaming starts, auto-close when streaming ends (once only)
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
if (defaultOpen && !isStreaming && isOpen && !hasAutoClosed) {
|
|
51
|
-
// Add a small delay before closing to allow user to see the content
|
|
52
|
-
const timer = setTimeout(() => {
|
|
53
|
-
setIsOpen(false);
|
|
54
|
-
setHasAutoClosed(true);
|
|
55
|
-
}, AUTO_CLOSE_DELAY);
|
|
56
|
-
return () => clearTimeout(timer);
|
|
57
|
-
}
|
|
58
|
-
}, [isStreaming, isOpen, defaultOpen, setIsOpen, hasAutoClosed]);
|
|
59
|
-
const handleOpenChange = (newOpen) => {
|
|
60
|
-
setIsOpen(newOpen);
|
|
61
|
-
};
|
|
62
|
-
return (_jsx(ReasoningContext.Provider, { value: { isStreaming, isOpen, setIsOpen, duration }, children: _jsx(Collapsible, { className: cn('not-prose mb-4', className), onOpenChange: handleOpenChange, open: isOpen, ...props, children: children }) }));
|
|
63
|
-
});
|
|
64
|
-
const defaultGetThinkingMessage = (isStreaming, duration) => {
|
|
65
|
-
if (isStreaming || duration === 0) {
|
|
66
|
-
return _jsx(Shimmer, { duration: 1, children: "Thinking..." });
|
|
67
|
-
}
|
|
68
|
-
if (duration === undefined) {
|
|
69
|
-
return _jsx("p", { children: "Thought for a few seconds" });
|
|
70
|
-
}
|
|
71
|
-
return _jsxs("p", { children: ["Thought for ", duration, " seconds"] });
|
|
72
|
-
};
|
|
73
|
-
export const ReasoningTrigger = memo(({ className, children, getThinkingMessage = defaultGetThinkingMessage, ...props }) => {
|
|
74
|
-
const { isStreaming, isOpen, duration } = useReasoning();
|
|
75
|
-
return (_jsx(CollapsibleTrigger, { className: cn('flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground', className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx(BrainIcon, { className: "size-4" }), getThinkingMessage(isStreaming, duration), _jsx(ChevronDownIcon, { className: cn('size-4 transition-transform', isOpen ? 'rotate-180' : 'rotate-0') })] })) }));
|
|
76
|
-
});
|
|
77
|
-
export const ReasoningContent = memo(({ className, children, ...props }) => (_jsx(CollapsibleContent, { className: cn('mt-4 text-sm', 'data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in', className), ...props, children: _jsx(Streamdown, { ...props, children: children }) })));
|
|
78
|
-
Reasoning.displayName = 'Reasoning';
|
|
79
|
-
ReasoningTrigger.displayName = 'ReasoningTrigger';
|
|
80
|
-
ReasoningContent.displayName = 'ReasoningContent';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type ElementType } from 'react';
|
|
2
|
-
export type TextShimmerProps = {
|
|
3
|
-
children: string;
|
|
4
|
-
as?: ElementType;
|
|
5
|
-
className?: string;
|
|
6
|
-
duration?: number;
|
|
7
|
-
spread?: number;
|
|
8
|
-
};
|
|
9
|
-
export declare const Shimmer: import("react").MemoExoticComponent<({ children, as: Component, className, duration, spread, }: TextShimmerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
-
* Distributed under the terms of the Modified BSD License.
|
|
4
|
-
*/
|
|
5
|
-
'use client';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import { cn } from '@/lib/utils';
|
|
8
|
-
import { motion } from 'motion/react';
|
|
9
|
-
import { memo, useMemo, } from 'react';
|
|
10
|
-
const ShimmerComponent = ({ children, as: Component = 'p', className, duration = 2, spread = 2, }) => {
|
|
11
|
-
const MotionComponent = motion.create(Component);
|
|
12
|
-
const dynamicSpread = useMemo(() => (children?.length ?? 0) * spread, [children, spread]);
|
|
13
|
-
return (_jsx(MotionComponent, { animate: { backgroundPosition: '0% center' }, className: cn('relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent', '[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]', className), initial: { backgroundPosition: '100% center' }, style: {
|
|
14
|
-
'--spread': `${dynamicSpread}px`,
|
|
15
|
-
backgroundImage: 'var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))',
|
|
16
|
-
}, transition: {
|
|
17
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
18
|
-
duration,
|
|
19
|
-
ease: 'linear',
|
|
20
|
-
}, children: children }));
|
|
21
|
-
};
|
|
22
|
-
export const Shimmer = memo(ShimmerComponent);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';
|
|
2
|
-
import type { ComponentProps } from 'react';
|
|
3
|
-
export type SourcesProps = ComponentProps<'div'>;
|
|
4
|
-
export declare const Sources: ({ className, ...props }: SourcesProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export type SourcesTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {
|
|
6
|
-
count: number;
|
|
7
|
-
};
|
|
8
|
-
export declare const SourcesTrigger: ({ className, count, children, ...props }: SourcesTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export type SourcesContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
10
|
-
export declare const SourcesContent: ({ className, ...props }: SourcesContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export type SourceProps = ComponentProps<'a'>;
|
|
12
|
-
export declare const Source: ({ href, title, children, ...props }: SourceProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
-
* Distributed under the terms of the Modified BSD License.
|
|
4
|
-
*/
|
|
5
|
-
'use client';
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '@/components/ui/collapsible';
|
|
8
|
-
import { cn } from '@/lib/utils';
|
|
9
|
-
import { BookIcon, ChevronDownIcon } from 'lucide-react';
|
|
10
|
-
export const Sources = ({ className, ...props }) => (_jsx(Collapsible, { className: cn('not-prose mb-4 text-primary text-xs', className), ...props }));
|
|
11
|
-
export const SourcesTrigger = ({ className, count, children, ...props }) => (_jsx(CollapsibleTrigger, { className: cn('flex items-center gap-2', className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsxs("p", { className: "font-medium", children: ["Used ", count, " sources"] }), _jsx(ChevronDownIcon, { className: "h-4 w-4" })] })) }));
|
|
12
|
-
export const SourcesContent = ({ className, ...props }) => (_jsx(CollapsibleContent, { className: cn('mt-3 flex w-fit flex-col gap-2', 'data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in', className), ...props }));
|
|
13
|
-
export const Source = ({ href, title, children, ...props }) => (_jsx("a", { className: "flex items-center gap-2", href: href, rel: "noreferrer", target: "_blank", ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx(BookIcon, { className: "h-4 w-4" }), _jsx("span", { className: "block font-medium", children: title })] })) }));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Button } from '@/components/ui/button';
|
|
2
|
-
import { ScrollArea } from '@/components/ui/scroll-area';
|
|
3
|
-
import type { ComponentProps } from 'react';
|
|
4
|
-
export type SuggestionsProps = ComponentProps<typeof ScrollArea>;
|
|
5
|
-
export declare const Suggestions: ({ className, children, ...props }: SuggestionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export type SuggestionProps = Omit<ComponentProps<typeof Button>, 'onClick'> & {
|
|
7
|
-
suggestion: string;
|
|
8
|
-
onClick?: (suggestion: string) => void;
|
|
9
|
-
};
|
|
10
|
-
export declare const Suggestion: ({ suggestion, onClick, className, variant, size, children, ...props }: SuggestionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
-
* Distributed under the terms of the Modified BSD License.
|
|
4
|
-
*/
|
|
5
|
-
'use client';
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { Button } from '@/components/ui/button';
|
|
8
|
-
import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area';
|
|
9
|
-
import { cn } from '@/lib/utils';
|
|
10
|
-
export const Suggestions = ({ className, children, ...props }) => (_jsxs(ScrollArea, { className: "w-full overflow-x-auto whitespace-nowrap", ...props, children: [_jsx("div", { className: cn('flex w-max flex-nowrap items-center gap-2', className), children: children }), _jsx(ScrollBar, { className: "hidden", orientation: "horizontal" })] }));
|
|
11
|
-
export const Suggestion = ({ suggestion, onClick, className, variant = 'outline', size = 'sm', children, ...props }) => {
|
|
12
|
-
const handleClick = () => {
|
|
13
|
-
onClick?.(suggestion);
|
|
14
|
-
};
|
|
15
|
-
return (_jsx(Button, { className: cn('cursor-pointer rounded-full px-4', className), onClick: handleClick, size: size, type: "button", variant: variant, ...props, children: children || suggestion }));
|
|
16
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Collapsible, CollapsibleContent } from '@/components/ui/collapsible';
|
|
2
|
-
import type { ToolUIPart } from 'ai';
|
|
3
|
-
import type { ComponentProps } from 'react';
|
|
4
|
-
export type ToolProps = ComponentProps<typeof Collapsible>;
|
|
5
|
-
export declare const Tool: ({ className, ...props }: ToolProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export type ToolHeaderProps = {
|
|
7
|
-
title?: string;
|
|
8
|
-
type: ToolUIPart['type'];
|
|
9
|
-
state: ToolUIPart['state'];
|
|
10
|
-
className?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare const ToolHeader: ({ className, title, type, state, ...props }: ToolHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export type ToolContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
14
|
-
export declare const ToolContent: ({ className, ...props }: ToolContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export type ToolInputProps = ComponentProps<'div'> & {
|
|
16
|
-
input: ToolUIPart['input'];
|
|
17
|
-
};
|
|
18
|
-
export declare const ToolInput: ({ className, input, ...props }: ToolInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export type ToolOutputProps = ComponentProps<'div'> & {
|
|
20
|
-
output: ToolUIPart['output'];
|
|
21
|
-
errorText: ToolUIPart['errorText'];
|
|
22
|
-
};
|
|
23
|
-
export declare const ToolOutput: ({ className, output, errorText, ...props }: ToolOutputProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
-
* Distributed under the terms of the Modified BSD License.
|
|
4
|
-
*/
|
|
5
|
-
'use client';
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { Badge } from '@/components/ui/badge';
|
|
8
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '@/components/ui/collapsible';
|
|
9
|
-
import { cn } from '@/lib/utils';
|
|
10
|
-
import { CheckCircleIcon, ChevronDownIcon, CircleIcon, ClockIcon, WrenchIcon, XCircleIcon, } from 'lucide-react';
|
|
11
|
-
import { isValidElement } from 'react';
|
|
12
|
-
import { CodeBlock } from './code-block';
|
|
13
|
-
export const Tool = ({ className, ...props }) => (_jsx(Collapsible, { className: cn('not-prose mb-4 w-full rounded-md border', className), ...props }));
|
|
14
|
-
const getStatusBadge = (status) => {
|
|
15
|
-
const labels = {
|
|
16
|
-
'input-streaming': 'Pending',
|
|
17
|
-
'input-available': 'Running',
|
|
18
|
-
'approval-requested': 'Awaiting Approval',
|
|
19
|
-
'approval-responded': 'Responded',
|
|
20
|
-
'output-available': 'Completed',
|
|
21
|
-
'output-error': 'Error',
|
|
22
|
-
'output-denied': 'Denied',
|
|
23
|
-
};
|
|
24
|
-
const icons = {
|
|
25
|
-
'input-streaming': _jsx(CircleIcon, { className: "size-4" }),
|
|
26
|
-
'input-available': _jsx(ClockIcon, { className: "size-4 animate-pulse" }),
|
|
27
|
-
'approval-requested': _jsx(ClockIcon, { className: "size-4 text-yellow-600" }),
|
|
28
|
-
'approval-responded': _jsx(CheckCircleIcon, { className: "size-4 text-blue-600" }),
|
|
29
|
-
'output-available': _jsx(CheckCircleIcon, { className: "size-4 text-green-600" }),
|
|
30
|
-
'output-error': _jsx(XCircleIcon, { className: "size-4 text-red-600" }),
|
|
31
|
-
'output-denied': _jsx(XCircleIcon, { className: "size-4 text-orange-600" }),
|
|
32
|
-
};
|
|
33
|
-
return (_jsxs(Badge, { className: "gap-1.5 rounded-full text-xs", variant: "secondary", children: [icons[status], labels[status]] }));
|
|
34
|
-
};
|
|
35
|
-
export const ToolHeader = ({ className, title, type, state, ...props }) => (_jsxs(CollapsibleTrigger, { className: cn('flex w-full items-center justify-between gap-4 p-3', className), ...props, children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(WrenchIcon, { className: "size-4 text-muted-foreground" }), _jsx("span", { className: "font-medium text-sm", children: title ?? type.split('-').slice(1).join('-') }), getStatusBadge(state)] }), _jsx(ChevronDownIcon, { className: "size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180" })] }));
|
|
36
|
-
export const ToolContent = ({ className, ...props }) => (_jsx(CollapsibleContent, { className: cn('data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in', className), ...props }));
|
|
37
|
-
export const ToolInput = ({ className, input, ...props }) => (_jsxs("div", { className: cn('space-y-2 overflow-hidden p-4', className), ...props, children: [_jsx("h4", { className: "font-medium text-muted-foreground text-xs uppercase tracking-wide", children: "Parameters" }), _jsx("div", { className: "rounded-md bg-muted/50", children: _jsx(CodeBlock, { code: JSON.stringify(input, null, 2), language: "json" }) })] }));
|
|
38
|
-
export const ToolOutput = ({ className, output, errorText, ...props }) => {
|
|
39
|
-
if (!(output || errorText)) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
let Output = _jsx("div", { children: output });
|
|
43
|
-
if (typeof output === 'object' && !isValidElement(output)) {
|
|
44
|
-
Output = (_jsx(CodeBlock, { code: JSON.stringify(output, null, 2), language: "json" }));
|
|
45
|
-
}
|
|
46
|
-
else if (typeof output === 'string') {
|
|
47
|
-
Output = _jsx(CodeBlock, { code: output, language: "json" });
|
|
48
|
-
}
|
|
49
|
-
return (_jsxs("div", { className: cn('space-y-2 p-4', className), ...props, children: [_jsx("h4", { className: "font-medium text-muted-foreground text-xs uppercase tracking-wide", children: errorText ? 'Error' : 'Result' }), _jsxs("div", { className: cn('overflow-x-auto rounded-md text-xs [&_table]:w-full', errorText
|
|
50
|
-
? 'bg-destructive/10 text-destructive'
|
|
51
|
-
: 'bg-muted/50 text-foreground'), children: [errorText && _jsx("div", { children: errorText }), Output] })] }));
|
|
52
|
-
};
|