@datalayer/agent-runtimes 1.0.3 → 1.0.5
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 +35 -119
- package/lib/App.js +1 -1
- package/lib/agents/AgentDetails.d.ts +22 -1
- package/lib/agents/AgentDetails.js +34 -47
- package/lib/api/index.d.ts +0 -1
- package/lib/api/index.js +4 -2
- package/lib/chat/Chat.d.ts +5 -104
- package/lib/chat/Chat.js +4 -4
- package/lib/chat/ChatFloating.d.ts +7 -140
- package/lib/chat/ChatFloating.js +2 -2
- package/lib/chat/ChatPopupStandalone.d.ts +8 -47
- package/lib/chat/ChatPopupStandalone.js +3 -3
- package/lib/chat/ChatSidebar.d.ts +4 -69
- package/lib/chat/ChatSidebar.js +2 -2
- package/lib/chat/ChatStandalone.d.ts +4 -54
- package/lib/chat/ChatStandalone.js +3 -3
- package/lib/chat/base/ChatBase.js +1118 -141
- package/lib/chat/header/ChatHeaderBase.d.ts +11 -6
- package/lib/chat/header/ChatHeaderBase.js +18 -16
- package/lib/chat/indicators/McpStatusIndicator.d.ts +7 -4
- package/lib/chat/indicators/McpStatusIndicator.js +7 -32
- package/lib/chat/indicators/SandboxStatusIndicator.d.ts +4 -1
- package/lib/chat/indicators/SandboxStatusIndicator.js +9 -9
- package/lib/chat/indicators/SkillsStatusIndicator.d.ts +7 -0
- package/lib/chat/indicators/SkillsStatusIndicator.js +88 -0
- package/lib/chat/indicators/index.d.ts +1 -0
- package/lib/chat/indicators/index.js +1 -0
- package/lib/chat/messages/ChatMessageList.d.ts +1 -1
- package/lib/chat/messages/ChatMessageList.js +110 -102
- package/lib/chat/prompt/InputFooter.d.ts +19 -6
- package/lib/chat/prompt/InputFooter.js +71 -18
- package/lib/chat/prompt/InputPrompt.d.ts +3 -1
- package/lib/chat/prompt/InputPrompt.js +4 -4
- package/lib/chat/prompt/InputPromptFooter.js +1 -1
- package/lib/chat/prompt/InputPromptLexical.d.ts +3 -1
- package/lib/chat/prompt/InputPromptLexical.js +12 -5
- package/lib/chat/prompt/InputPromptText.d.ts +3 -1
- package/lib/chat/prompt/InputPromptText.js +2 -2
- package/lib/chat/tools/ToolApprovalBanner.js +1 -1
- package/lib/chat/tools/ToolCallDisplay.d.ts +3 -1
- package/lib/chat/tools/ToolCallDisplay.js +2 -2
- package/lib/chat/usage/TokenUsageBar.js +20 -2
- package/lib/client/AgentRuntimesClientContext.d.ts +53 -0
- package/lib/client/AgentRuntimesClientContext.js +55 -0
- package/lib/client/AgentsMixin.d.ts +48 -19
- package/lib/client/AgentsMixin.js +115 -30
- package/lib/client/IAgentRuntimesClient.d.ts +215 -0
- package/lib/client/IAgentRuntimesClient.js +5 -0
- package/lib/client/SdkAgentRuntimesClient.d.ts +151 -0
- package/lib/client/SdkAgentRuntimesClient.js +134 -0
- package/lib/client/index.d.ts +4 -1
- package/lib/client/index.js +3 -1
- package/lib/components/NotificationEventCard.js +55 -26
- package/lib/components/OutputCard.js +21 -7
- package/lib/components/ToolApprovalCard.js +20 -2
- package/lib/config/AgentConfiguration.js +3 -3
- package/lib/context/ContextDistribution.d.ts +3 -1
- package/lib/context/ContextDistribution.js +8 -27
- package/lib/context/ContextInspector.d.ts +3 -1
- package/lib/context/ContextInspector.js +19 -67
- package/lib/context/ContextPanel.d.ts +3 -1
- package/lib/context/ContextPanel.js +104 -64
- package/lib/context/ContextUsage.d.ts +3 -1
- package/lib/context/ContextUsage.js +3 -3
- package/lib/context/CostTracker.d.ts +9 -3
- package/lib/context/CostTracker.js +26 -47
- package/lib/context/CostUsageChart.d.ts +12 -0
- package/lib/context/CostUsageChart.js +378 -0
- package/lib/context/GraphFlowChart.d.ts +16 -0
- package/lib/context/GraphFlowChart.js +182 -0
- package/lib/context/TokenUsageChart.d.ts +8 -1
- package/lib/context/TokenUsageChart.js +349 -211
- package/lib/context/TurnGraphChart.d.ts +39 -0
- package/lib/context/TurnGraphChart.js +538 -0
- package/lib/context/otelWsPool.d.ts +20 -0
- package/lib/context/otelWsPool.js +69 -0
- package/lib/examples/A2UiComponentGalleryExample.d.ts +0 -17
- package/lib/examples/A2UiComponentGalleryExample.js +315 -522
- package/lib/examples/A2UiContactCardExample.d.ts +0 -18
- package/lib/examples/A2UiContactCardExample.js +154 -411
- package/lib/examples/A2UiRestaurantExample.d.ts +0 -30
- package/lib/examples/A2UiRestaurantExample.js +114 -212
- package/lib/examples/A2UiViewerExample.d.ts +0 -18
- package/lib/examples/A2UiViewerExample.js +283 -532
- package/lib/examples/AgUiBackendToolRenderingExample.js +1 -1
- package/lib/examples/AgUiHaikuGenUiExample.d.ts +1 -1
- package/lib/examples/AgUiHaikuGenUiExample.js +1 -1
- package/lib/examples/AgentCheckpointsExample.js +14 -34
- package/lib/examples/AgentCodemodeExample.d.ts +4 -6
- package/lib/examples/AgentCodemodeExample.js +591 -175
- package/lib/examples/AgentEvalsExample.js +13 -23
- package/lib/examples/AgentGuardrailsExample.js +371 -71
- package/lib/examples/AgentHooksExample.d.ts +3 -0
- package/lib/examples/AgentHooksExample.js +104 -0
- package/lib/examples/AgentMCPExample.d.ts +3 -0
- package/lib/examples/AgentMCPExample.js +480 -0
- package/lib/examples/AgentMemoryExample.js +14 -24
- package/lib/examples/AgentMonitoringExample.js +261 -206
- package/lib/examples/AgentNotificationsExample.js +50 -24
- package/lib/examples/AgentOtelExample.js +2 -3
- package/lib/examples/AgentOutputsExample.d.ts +11 -6
- package/lib/examples/AgentOutputsExample.js +383 -88
- package/lib/examples/AgentParametersExample.d.ts +3 -0
- package/lib/examples/AgentParametersExample.js +246 -0
- package/lib/examples/AgentSandboxExample.d.ts +2 -2
- package/lib/examples/AgentSandboxExample.js +69 -47
- package/lib/examples/AgentSkillsExample.js +92 -106
- package/lib/examples/{AgentspecExample.js → AgentSpecsExample.js} +10 -21
- package/lib/examples/AgentSubagentsExample.d.ts +14 -0
- package/lib/examples/AgentSubagentsExample.js +228 -0
- package/lib/examples/AgentToolApprovalsExample.js +30 -493
- package/lib/examples/AgentTriggersExample.js +1067 -246
- package/lib/examples/ChatCustomExample.js +11 -24
- package/lib/examples/ChatExample.js +9 -34
- package/lib/examples/CopilotKitLexicalExample.js +2 -1
- package/lib/examples/CopilotKitNotebookExample.js +2 -1
- package/lib/examples/HomeExample.d.ts +15 -0
- package/lib/examples/HomeExample.js +77 -0
- package/lib/examples/Lexical2Example.js +4 -2
- package/lib/examples/{LexicalExample.d.ts → LexicalAgentExample.d.ts} +4 -4
- package/lib/examples/{LexicalExample.js → LexicalAgentExample.js} +65 -16
- package/lib/examples/{LexicalSidebarExample.d.ts → LexicalAgentSidebarExample.d.ts} +5 -5
- package/lib/examples/LexicalAgentSidebarExample.js +261 -0
- package/lib/examples/NotebookAgentExample.d.ts +9 -0
- package/lib/examples/NotebookAgentExample.js +192 -0
- package/lib/examples/{NotebookSidebarExample.d.ts → NotebookAgentSidebarExample.d.ts} +2 -2
- package/lib/examples/NotebookAgentSidebarExample.js +221 -0
- package/lib/examples/{DatalayerNotebookExample.d.ts → NotebookCollaborationExample.d.ts} +4 -4
- package/lib/examples/{DatalayerNotebookExample.js → NotebookCollaborationExample.js} +3 -3
- package/lib/examples/NotebookExample.d.ts +4 -7
- package/lib/examples/NotebookExample.js +14 -146
- package/lib/examples/components/AuthRequiredView.d.ts +6 -0
- package/lib/examples/components/AuthRequiredView.js +33 -0
- package/lib/examples/components/ErrorView.d.ts +14 -0
- package/lib/examples/components/ErrorView.js +20 -0
- package/lib/examples/components/ExampleWrapper.d.ts +7 -0
- package/lib/examples/components/ExampleWrapper.js +25 -6
- package/lib/examples/{ag-ui → components}/haiku/HaikuDisplay.js +1 -1
- package/lib/examples/{ag-ui → components}/haiku/InlineHaikuCard.js +1 -1
- package/lib/examples/{ag-ui → components}/haiku/index.d.ts +1 -1
- package/lib/examples/{ag-ui → components}/haiku/index.js +1 -1
- package/lib/examples/components/index.d.ts +5 -0
- package/lib/examples/components/index.js +5 -0
- package/lib/examples/{ag-ui → components}/weather/index.d.ts +1 -1
- package/lib/examples/{ag-ui → components}/weather/index.js +1 -1
- package/lib/examples/example-selector.d.ts +17 -4
- package/lib/examples/example-selector.js +107 -41
- package/lib/examples/index.d.ts +9 -6
- package/lib/examples/index.js +9 -6
- package/lib/examples/main.d.ts +1 -0
- package/lib/examples/main.js +218 -27
- package/lib/examples/utils/a2ui.d.ts +18 -0
- package/lib/examples/utils/a2ui.js +69 -0
- package/lib/examples/utils/a2uiMarkdownProvider.d.ts +7 -0
- package/lib/examples/utils/a2uiMarkdownProvider.js +9 -0
- package/lib/examples/utils/agentId.d.ts +18 -0
- package/lib/examples/utils/agentId.js +54 -0
- package/lib/examples/utils/agents/earthquake-detector.json +11 -11
- package/lib/examples/utils/agents/sales-forecaster.json +11 -11
- package/lib/examples/utils/agents/social-post-generator.json +11 -11
- package/lib/examples/utils/agents/stock-market.json +11 -11
- package/lib/examples/utils/examplesStore.js +82 -27
- package/lib/hooks/index.d.ts +8 -8
- package/lib/hooks/index.js +7 -7
- package/lib/hooks/useA2A.d.ts +2 -3
- package/lib/hooks/useAIAgentsWebSocket.d.ts +43 -4
- package/lib/hooks/useAIAgentsWebSocket.js +118 -12
- package/lib/hooks/useAcp.d.ts +1 -2
- package/lib/hooks/useAgUi.d.ts +1 -1
- package/lib/hooks/{useAgents.d.ts → useAgentRuntimes.d.ts} +39 -2
- package/lib/hooks/{useAgents.js → useAgentRuntimes.js} +125 -15
- package/lib/hooks/useAgentsCatalog.js +1 -1
- package/lib/hooks/useAgentsService.d.ts +2 -2
- package/lib/hooks/useAgentsService.js +7 -7
- package/lib/hooks/useCheckpoints.js +1 -1
- package/lib/hooks/useConfig.d.ts +4 -1
- package/lib/hooks/useConfig.js +10 -3
- package/lib/hooks/useContextSnapshot.d.ts +9 -4
- package/lib/hooks/useContextSnapshot.js +9 -37
- package/lib/hooks/useMonitoring.js +3 -0
- package/lib/hooks/useSandbox.d.ts +20 -8
- package/lib/hooks/useSandbox.js +105 -40
- package/lib/hooks/useSkills.d.ts +23 -5
- package/lib/hooks/useSkills.js +94 -39
- package/lib/hooks/useToolApprovals.d.ts +60 -36
- package/lib/hooks/useToolApprovals.js +318 -69
- package/lib/hooks/useVercelAI.d.ts +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +1 -0
- package/lib/inference/index.d.ts +0 -1
- package/lib/middleware/index.d.ts +0 -1
- package/lib/protocols/AGUIAdapter.js +6 -0
- package/lib/protocols/VercelAIAdapter.d.ts +9 -0
- package/lib/protocols/VercelAIAdapter.js +144 -26
- package/lib/shims/json5.d.ts +4 -0
- package/lib/shims/json5.js +8 -0
- package/lib/specs/agents/agents.d.ts +10 -0
- package/lib/specs/agents/agents.js +752 -24
- package/lib/specs/envvars.d.ts +1 -0
- package/lib/specs/envvars.js +11 -0
- package/lib/specs/events.d.ts +1 -0
- package/lib/specs/events.js +1 -0
- package/lib/specs/index.d.ts +1 -0
- package/lib/specs/index.js +1 -0
- package/lib/specs/personas.d.ts +41 -0
- package/lib/specs/personas.js +168 -0
- package/lib/specs/skills.d.ts +2 -1
- package/lib/specs/skills.js +23 -5
- package/lib/specs/tools.js +3 -0
- package/lib/stores/agentRuntimeStore.d.ts +204 -0
- package/lib/stores/agentRuntimeStore.js +636 -0
- package/lib/stores/index.d.ts +1 -1
- package/lib/stores/index.js +1 -1
- package/lib/tools/adapters/copilotkit/lexicalHooks.d.ts +1 -2
- package/lib/tools/adapters/copilotkit/lexicalHooks.js +1 -3
- package/lib/tools/adapters/copilotkit/notebookHooks.d.ts +1 -2
- package/lib/tools/adapters/copilotkit/notebookHooks.js +1 -3
- package/lib/tools/index.d.ts +0 -2
- package/lib/tools/index.js +0 -1
- package/lib/types/agentspecs.d.ts +50 -1
- package/lib/types/chat.d.ts +309 -8
- package/lib/types/context.d.ts +27 -0
- package/lib/types/cost.d.ts +2 -2
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.js +2 -0
- package/lib/types/mcp.d.ts +8 -0
- package/lib/types/models.d.ts +2 -2
- package/lib/types/personas.d.ts +25 -0
- package/lib/types/personas.js +5 -0
- package/lib/types/skills.d.ts +43 -1
- package/lib/types/stream.d.ts +110 -0
- package/lib/types/stream.js +36 -0
- package/lib/types/tools.d.ts +2 -0
- package/lib/utils/utils.d.ts +9 -5
- package/lib/utils/utils.js +9 -5
- package/package.json +13 -9
- package/scripts/codegen/__pycache__/generate_agents.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_events.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/versioning.cpython-313.pyc +0 -0
- package/scripts/codegen/generate_agents.py +106 -7
- package/scripts/codegen/generate_events.py +47 -17
- package/scripts/codegen/generate_personas.py +319 -0
- package/scripts/codegen/generate_skills.py +9 -9
- package/scripts/codegen/generate_tools.py +20 -0
- package/scripts/sync-jupyter.sh +26 -7
- package/style/primer-primitives.css +1 -6
- package/lib/api/tool-approvals.d.ts +0 -62
- package/lib/api/tool-approvals.js +0 -145
- package/lib/examples/LexicalSidebarExample.js +0 -163
- package/lib/examples/NotebookSidebarExample.js +0 -119
- package/lib/examples/NotebookSimpleExample.d.ts +0 -6
- package/lib/examples/NotebookSimpleExample.js +0 -22
- package/lib/examples/ag-ui/index.d.ts +0 -10
- package/lib/examples/ag-ui/index.js +0 -16
- package/lib/hooks/useAgentsRegistry.d.ts +0 -10
- package/lib/hooks/useAgentsRegistry.js +0 -20
- package/lib/stores/agentsStore.d.ts +0 -123
- package/lib/stores/agentsStore.js +0 -270
- package/scripts/codegen/__pycache__/generate_envvars.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_evals.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_guardrails.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_mcp_servers.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_memory.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_models.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_notifications.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_outputs.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_skills.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_teams.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_tools.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_triggers.cpython-313.pyc +0 -0
- /package/lib/examples/{AgentspecExample.d.ts → AgentSpecsExample.d.ts} +0 -0
- /package/lib/examples/{ag-ui → components}/haiku/HaikuDisplay.d.ts +0 -0
- /package/lib/examples/{ag-ui → components}/haiku/InlineHaikuCard.d.ts +0 -0
- /package/lib/examples/{ag-ui → components}/weather/InlineWeatherCard.d.ts +0 -0
- /package/lib/examples/{ag-ui → components}/weather/InlineWeatherCard.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ToolExecutionContext } from '@datalayer/jupyter-react';
|
|
2
|
-
import { createAllCopilotKitActions
|
|
2
|
+
import { createAllCopilotKitActions } from './CopilotKitToolAdapter';
|
|
3
3
|
/**
|
|
4
4
|
* Hook that creates CopilotKit actions for notebook tools.
|
|
5
5
|
* Returns stable actions array that won't cause re-renders.
|
|
@@ -24,4 +24,3 @@ import { createAllCopilotKitActions, ActionRegistrar, type UseFrontendToolFn } f
|
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
export declare function useNotebookToolActions(documentId: string, contextOverrides?: Partial<Omit<ToolExecutionContext, 'executor' | 'documentId'>>): ReturnType<typeof createAllCopilotKitActions>;
|
|
27
|
-
export { ActionRegistrar, type UseFrontendToolFn };
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { useMemo } from 'react';
|
|
12
12
|
import { notebookStore, DefaultExecutor, notebookToolDefinitions, notebookToolOperations, } from '@datalayer/jupyter-react';
|
|
13
|
-
import { createAllCopilotKitActions
|
|
13
|
+
import { createAllCopilotKitActions } from './CopilotKitToolAdapter';
|
|
14
14
|
// Hook wrapper to get notebook store state
|
|
15
15
|
const useNotebookStore = () => notebookStore.getState();
|
|
16
16
|
/**
|
|
@@ -55,5 +55,3 @@ export function useNotebookToolActions(documentId, contextOverrides) {
|
|
|
55
55
|
// Create and return CopilotKit actions (stable reference)
|
|
56
56
|
return useMemo(() => createAllCopilotKitActions(notebookToolDefinitions, notebookToolOperations, context), [context]);
|
|
57
57
|
}
|
|
58
|
-
// Re-export shared types and components for convenience
|
|
59
|
-
export { ActionRegistrar };
|
package/lib/tools/index.d.ts
CHANGED
|
@@ -5,5 +5,3 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export * from './adapters/copilotkit';
|
|
7
7
|
export { ToolExecutor, createToolExecutor, type ToolExecutionContext, } from './ToolExecutor';
|
|
8
|
-
export type { ToolDefinition, FrontendToolDefinition, BackendToolDefinition, ToolLocation, ToolParameter, ToolRenderStatus, ToolRenderProps, ToolRenderAndWaitProps, ToolCallRequest, ToolExecutionResult, ToolRegistryEntry, } from '../types/tools';
|
|
9
|
-
export { isFrontendTool, isBackendTool, hasHitlRender } from '../types/tools';
|
package/lib/tools/index.js
CHANGED
|
@@ -57,7 +57,7 @@ export interface AgentSpec {
|
|
|
57
57
|
welcomeNotebook?: string;
|
|
58
58
|
/** Path to Lexical document to show on agent creation */
|
|
59
59
|
welcomeDocument?: string;
|
|
60
|
-
/** Sandbox variant to use for this agent ('
|
|
60
|
+
/** Sandbox variant to use for this agent ('eval', 'jupyter') */
|
|
61
61
|
sandboxVariant?: string;
|
|
62
62
|
/** User-facing objective for the agent */
|
|
63
63
|
goal?: string;
|
|
@@ -87,4 +87,53 @@ export interface AgentSpec {
|
|
|
87
87
|
notifications?: AgentNotificationConfig;
|
|
88
88
|
/** Memory backend identifier (e.g., 'ephemeral', 'mem0', 'memu', 'simplemem') */
|
|
89
89
|
memory?: string;
|
|
90
|
+
/** Pre-launch hooks (package installs and sandbox code). */
|
|
91
|
+
preHooks?: {
|
|
92
|
+
packages?: string[];
|
|
93
|
+
sandbox?: string | string[];
|
|
94
|
+
};
|
|
95
|
+
/** Post-stop hooks (sandbox cleanup code). */
|
|
96
|
+
postHooks?: {
|
|
97
|
+
sandbox?: string | string[];
|
|
98
|
+
};
|
|
99
|
+
/** JSON schema for launch-time parameter values. */
|
|
100
|
+
parameters?: Record<string, any>;
|
|
101
|
+
/** Subagent delegation configuration. */
|
|
102
|
+
subagents?: SubAgentsConfig;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Configuration for a subagent within an agent specification.
|
|
106
|
+
*/
|
|
107
|
+
export interface SubAgentSpecConfig {
|
|
108
|
+
/** Unique identifier for the subagent */
|
|
109
|
+
name: string;
|
|
110
|
+
/** Brief description shown to the parent agent */
|
|
111
|
+
description: string;
|
|
112
|
+
/** System prompt for the subagent */
|
|
113
|
+
instructions: string;
|
|
114
|
+
/** LLM model to use (defaults to parent agent's model) */
|
|
115
|
+
model?: string;
|
|
116
|
+
/** Whether the subagent can ask the parent for clarification */
|
|
117
|
+
canAskQuestions?: boolean;
|
|
118
|
+
/** Maximum questions the subagent may ask per task */
|
|
119
|
+
maxQuestions?: number;
|
|
120
|
+
/** Default execution mode preference */
|
|
121
|
+
preferredMode?: 'sync' | 'async' | 'auto';
|
|
122
|
+
/** Typical task complexity hint for auto-mode selection */
|
|
123
|
+
typicalComplexity?: 'simple' | 'moderate' | 'complex';
|
|
124
|
+
/** Whether this subagent typically needs user context */
|
|
125
|
+
typicallyNeedsContext?: boolean;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Top-level subagents configuration for an agent specification.
|
|
129
|
+
*/
|
|
130
|
+
export interface SubAgentsConfig {
|
|
131
|
+
/** List of subagent configurations */
|
|
132
|
+
subagents: SubAgentSpecConfig[];
|
|
133
|
+
/** Default model for subagents that don't specify one */
|
|
134
|
+
defaultModel?: string;
|
|
135
|
+
/** Include a general-purpose fallback subagent */
|
|
136
|
+
includeGeneralPurpose?: boolean;
|
|
137
|
+
/** Maximum depth for nested subagent delegation (0 = no nesting) */
|
|
138
|
+
maxNestingDepth?: number;
|
|
90
139
|
}
|
package/lib/types/chat.d.ts
CHANGED
|
@@ -9,8 +9,39 @@ import type { Protocol, ProtocolConfig } from './protocol';
|
|
|
9
9
|
import type { McpServerSelection } from './inference';
|
|
10
10
|
import type { MCPServerTool } from './mcp';
|
|
11
11
|
import type { AgentRuntimeConfig } from './config';
|
|
12
|
+
import type { SandboxWsStatus } from './sandbox';
|
|
12
13
|
import type { FrontendToolDefinition } from './tools';
|
|
13
14
|
import type { PoweredByTagProps } from '../chat/display/PoweredByTag';
|
|
15
|
+
/**
|
|
16
|
+
* Context passed to tool-call pre-hooks.
|
|
17
|
+
* Fires when a tool call starts executing (backend or frontend).
|
|
18
|
+
*/
|
|
19
|
+
export interface ToolCallStartContext {
|
|
20
|
+
/** The tool name as declared by the agent */
|
|
21
|
+
toolName: string;
|
|
22
|
+
/** Unique identifier for this tool invocation */
|
|
23
|
+
toolCallId: string;
|
|
24
|
+
/** Arguments passed to the tool */
|
|
25
|
+
args: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Context passed to tool-call post-hooks.
|
|
29
|
+
* Fires when a tool result is received.
|
|
30
|
+
*/
|
|
31
|
+
export interface ToolCallCompleteContext {
|
|
32
|
+
/** The tool name as declared by the agent */
|
|
33
|
+
toolName: string;
|
|
34
|
+
/** Unique identifier for this tool invocation */
|
|
35
|
+
toolCallId: string;
|
|
36
|
+
/** Arguments that were passed to the tool */
|
|
37
|
+
args: Record<string, unknown>;
|
|
38
|
+
/** The tool result (may be a string, object, or undefined on error) */
|
|
39
|
+
result: unknown;
|
|
40
|
+
/** Final status of the tool invocation */
|
|
41
|
+
status: DisplayToolCallStatus;
|
|
42
|
+
/** Error message, if the tool call failed */
|
|
43
|
+
error?: string;
|
|
44
|
+
}
|
|
14
45
|
/**
|
|
15
46
|
* View mode for the chat component.
|
|
16
47
|
* - 'floating': Full-height floating panel (pinned to the right edge with offset)
|
|
@@ -167,12 +198,197 @@ export interface MCPServerConfig {
|
|
|
167
198
|
isConfig?: boolean;
|
|
168
199
|
isRunning?: boolean;
|
|
169
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* Common props shared by all Chat wrapper components
|
|
203
|
+
* (Chat, ChatFloating, ChatSidebar, ChatStandalone, ChatPopupStandalone).
|
|
204
|
+
*
|
|
205
|
+
* These props represent the public API surface that consumers interact with.
|
|
206
|
+
* Wrapper components forward most of them to ChatBase and translate others
|
|
207
|
+
* (e.g. `showNewChatButton` → `headerButtons.showNewChat`).
|
|
208
|
+
*
|
|
209
|
+
* Each wrapper extends this interface with component-specific props
|
|
210
|
+
* (e.g. `position`, `defaultOpen`, `width` for floating variants).
|
|
211
|
+
*
|
|
212
|
+
* Use `panelProps` as an escape hatch to pass any ChatBase prop not
|
|
213
|
+
* directly surfaced in this interface.
|
|
214
|
+
*/
|
|
215
|
+
export interface ChatCommonProps {
|
|
216
|
+
/**
|
|
217
|
+
* Protocol type or full configuration.
|
|
218
|
+
*
|
|
219
|
+
* When a `Protocol` string is provided (e.g. `'vercel-ai'`), it is forwarded
|
|
220
|
+
* to ChatBase. When a full `ProtocolConfig` object is provided, it is used
|
|
221
|
+
* directly.
|
|
222
|
+
*
|
|
223
|
+
* @default 'vercel-ai'
|
|
224
|
+
*/
|
|
225
|
+
protocol?: Protocol | ProtocolConfig;
|
|
226
|
+
/**
|
|
227
|
+
* Use Zustand store for state management instead of protocol endpoint.
|
|
228
|
+
* @default true
|
|
229
|
+
*/
|
|
230
|
+
useStore?: boolean;
|
|
231
|
+
/** Chat title */
|
|
232
|
+
title?: string;
|
|
233
|
+
/** Chat subtitle (rendered under the title in the header) */
|
|
234
|
+
subtitle?: string;
|
|
235
|
+
/** Description shown in empty state */
|
|
236
|
+
description?: string;
|
|
237
|
+
/** Show header */
|
|
238
|
+
showHeader?: boolean;
|
|
239
|
+
/** Show input area */
|
|
240
|
+
showInput?: boolean;
|
|
241
|
+
/** Keep input visible but disabled */
|
|
242
|
+
disableInputPrompt?: boolean;
|
|
243
|
+
/** Custom class name */
|
|
244
|
+
className?: string;
|
|
245
|
+
/** Children to render in the messages area */
|
|
246
|
+
children?: ReactNode;
|
|
247
|
+
/** Custom brand icon for header / empty state */
|
|
248
|
+
brandIcon?: ReactNode;
|
|
249
|
+
/** Input placeholder */
|
|
250
|
+
placeholder?: string;
|
|
251
|
+
/** Show new chat button in header */
|
|
252
|
+
showNewChatButton?: boolean;
|
|
253
|
+
/** Show clear button in header */
|
|
254
|
+
showClearButton?: boolean;
|
|
255
|
+
/** Show settings button in header */
|
|
256
|
+
showSettingsButton?: boolean;
|
|
257
|
+
/** Show powered by tag */
|
|
258
|
+
showPoweredBy?: boolean;
|
|
259
|
+
/** Powered by tag props */
|
|
260
|
+
poweredByProps?: Partial<PoweredByTagProps>;
|
|
261
|
+
/** Callback when settings is clicked */
|
|
262
|
+
onSettingsClick?: () => void;
|
|
263
|
+
/** Callback when new chat is triggered */
|
|
264
|
+
onNewChat?: () => void;
|
|
265
|
+
/** Callback when the component opens */
|
|
266
|
+
onOpen?: () => void;
|
|
267
|
+
/** Callback when the component closes */
|
|
268
|
+
onClose?: () => void;
|
|
269
|
+
/**
|
|
270
|
+
* Custom message handler.
|
|
271
|
+
* When provided, uses this handler instead of protocol mode.
|
|
272
|
+
*/
|
|
273
|
+
onSendMessage?: MessageHandler;
|
|
274
|
+
/**
|
|
275
|
+
* Enable streaming mode for custom message handler.
|
|
276
|
+
* @default false
|
|
277
|
+
*/
|
|
278
|
+
enableStreaming?: boolean;
|
|
279
|
+
/** Show model selector */
|
|
280
|
+
showModelSelector?: boolean;
|
|
281
|
+
/** Show tools menu */
|
|
282
|
+
showToolsMenu?: boolean;
|
|
283
|
+
/** Show skills menu */
|
|
284
|
+
showSkillsMenu?: boolean;
|
|
285
|
+
/**
|
|
286
|
+
* Show token usage bar.
|
|
287
|
+
* @default true
|
|
288
|
+
*/
|
|
289
|
+
showTokenUsage?: boolean;
|
|
290
|
+
/** Indicate tools are accessed via Codemode meta-tools */
|
|
291
|
+
codemodeEnabled?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Callback fired when the user toggles codemode from the Tools menu.
|
|
294
|
+
* When omitted, the toggle renders in read-only mode.
|
|
295
|
+
*/
|
|
296
|
+
onToggleCodemode?: (enabled: boolean) => void | Promise<void>;
|
|
297
|
+
/** Initial model ID to select (e.g., 'openai:gpt-4o-mini') */
|
|
298
|
+
initialModel?: string;
|
|
299
|
+
/**
|
|
300
|
+
* Override the list of available models.
|
|
301
|
+
* When provided, replaces models returned by the config endpoint.
|
|
302
|
+
*/
|
|
303
|
+
availableModels?: ModelConfig[];
|
|
304
|
+
/** MCP server selections to enable (others disabled) */
|
|
305
|
+
mcpServers?: McpServerSelection[];
|
|
306
|
+
/** Initial skill IDs to enable */
|
|
307
|
+
initialSkills?: string[];
|
|
308
|
+
/** Custom render function for tool results */
|
|
309
|
+
renderToolResult?: RenderToolResult;
|
|
310
|
+
/** Frontend tool definitions to register with the chat */
|
|
311
|
+
frontendTools?: FrontendToolDefinition[];
|
|
312
|
+
/** Pre-hook: fires when a tool call starts executing */
|
|
313
|
+
onToolCallStart?: (context: ToolCallStartContext) => void;
|
|
314
|
+
/** Post-hook: fires when a tool result is received */
|
|
315
|
+
onToolCallComplete?: (context: ToolCallCompleteContext) => void;
|
|
316
|
+
/** Suggestions to show in empty state */
|
|
317
|
+
suggestions?: Suggestion[];
|
|
318
|
+
/**
|
|
319
|
+
* Whether to auto-submit when a suggestion is clicked.
|
|
320
|
+
* @default true
|
|
321
|
+
*/
|
|
322
|
+
submitOnSuggestionClick?: boolean;
|
|
323
|
+
/**
|
|
324
|
+
* Hide assistant messages that follow a rendered tool call UI.
|
|
325
|
+
* @default false
|
|
326
|
+
*/
|
|
327
|
+
hideMessagesAfterToolUI?: boolean;
|
|
328
|
+
/** Runtime ID for conversation persistence */
|
|
329
|
+
runtimeId?: string;
|
|
330
|
+
/** Optional legacy endpoint URL for fetching conversation history */
|
|
331
|
+
historyEndpoint?: string;
|
|
332
|
+
/** Auth token for the agent runtime */
|
|
333
|
+
authToken?: string;
|
|
334
|
+
/** Optional auth token for the legacy history endpoint */
|
|
335
|
+
historyAuthToken?: string;
|
|
336
|
+
/**
|
|
337
|
+
* A prompt to send after conversation history is loaded (sent once).
|
|
338
|
+
*/
|
|
339
|
+
pendingPrompt?: string;
|
|
340
|
+
/**
|
|
341
|
+
* Show the information icon in the header.
|
|
342
|
+
* @default false
|
|
343
|
+
*/
|
|
344
|
+
showInformation?: boolean;
|
|
345
|
+
/** Callback when the information icon is clicked */
|
|
346
|
+
onInformationClick?: () => void;
|
|
347
|
+
/** Current chat view mode for header segmented toggle */
|
|
348
|
+
chatViewMode?: ChatViewMode;
|
|
349
|
+
/** Callback when user switches chat view mode */
|
|
350
|
+
onChatViewModeChange?: (mode: ChatViewMode) => void;
|
|
351
|
+
/** External context snapshot data for the token usage bar */
|
|
352
|
+
contextSnapshot?: import('./context').ContextSnapshotData;
|
|
353
|
+
/** External MCP toolsets status data */
|
|
354
|
+
mcpStatusData?: import('./mcp').McpToolsetsStatusResponse | null;
|
|
355
|
+
/** External codemode status data (e.g. from WebSocket stream). */
|
|
356
|
+
codemodeStatusData?: import('./stream').CodemodeStatusData | null;
|
|
357
|
+
/** Optional sandbox status override for immediate UI updates. */
|
|
358
|
+
sandboxStatusData?: SandboxWsStatus | null;
|
|
359
|
+
/**
|
|
360
|
+
* Whether to render the top-of-chat tool approval banner when there are
|
|
361
|
+
* pending approvals. @default true
|
|
362
|
+
*/
|
|
363
|
+
showToolApprovalBanner?: boolean;
|
|
364
|
+
/** Pending tool approval requests to render in the top banner. */
|
|
365
|
+
pendingApprovals?: import('../chat/tools').PendingApproval[];
|
|
366
|
+
/** Called when the user approves a pending request. */
|
|
367
|
+
onApproveApproval?: (approvalId: string, note?: string) => void | Promise<boolean | void>;
|
|
368
|
+
/** Called when the user rejects a pending request. */
|
|
369
|
+
onRejectApproval?: (approvalId: string, note?: string) => void | Promise<boolean | void>;
|
|
370
|
+
/** Custom header content (rendered below title row) */
|
|
371
|
+
headerContent?: ReactNode;
|
|
372
|
+
/** Custom header actions (rendered in title row, right side) */
|
|
373
|
+
headerActions?: ReactNode;
|
|
374
|
+
/** Auto-focus the input on mount */
|
|
375
|
+
autoFocus?: boolean;
|
|
376
|
+
/** Callback for state updates */
|
|
377
|
+
onStateUpdate?: (state: unknown) => void;
|
|
378
|
+
/**
|
|
379
|
+
* Additional ChatBase props (escape hatch).
|
|
380
|
+
* Props set here are spread onto ChatBase as overrides.
|
|
381
|
+
*/
|
|
382
|
+
panelProps?: Partial<ChatBaseProps>;
|
|
383
|
+
}
|
|
170
384
|
/**
|
|
171
385
|
* ChatBase props
|
|
172
386
|
*/
|
|
173
387
|
export interface ChatBaseProps {
|
|
174
388
|
/** Chat title */
|
|
175
389
|
title?: string;
|
|
390
|
+
/** Chat subtitle (rendered under the title in the header) */
|
|
391
|
+
subtitle?: string;
|
|
176
392
|
/** Show header */
|
|
177
393
|
showHeader?: boolean;
|
|
178
394
|
/**
|
|
@@ -182,12 +398,39 @@ export interface ChatBaseProps {
|
|
|
182
398
|
* @default true
|
|
183
399
|
*/
|
|
184
400
|
showTokenUsage?: boolean;
|
|
401
|
+
/**
|
|
402
|
+
* External context snapshot data for the token usage bar.
|
|
403
|
+
* When provided, this overrides the built-in useContextSnapshot hook
|
|
404
|
+
* (which is a no-op since the REST endpoint was removed).
|
|
405
|
+
* Pass live data received from the monitoring WebSocket.
|
|
406
|
+
*/
|
|
407
|
+
contextSnapshot?: import('./context').ContextSnapshotData;
|
|
408
|
+
/**
|
|
409
|
+
* External MCP toolsets status data for the MCP indicator.
|
|
410
|
+
* When provided, the data is forwarded to the McpStatusIndicator
|
|
411
|
+
* so it shows live status instead of "No MCP Server defined".
|
|
412
|
+
*/
|
|
413
|
+
mcpStatusData?: import('./mcp').McpToolsetsStatusResponse | null;
|
|
414
|
+
/**
|
|
415
|
+
* External codemode status data. When provided, it is forwarded to
|
|
416
|
+
* AgentDetails so the info panel can render a live codemode status
|
|
417
|
+
* without waiting for the global WebSocket stream.
|
|
418
|
+
*/
|
|
419
|
+
codemodeStatusData?: import('./stream').CodemodeStatusData | null;
|
|
420
|
+
/**
|
|
421
|
+
* External sandbox status data for the sandbox indicator.
|
|
422
|
+
* When provided, this data is preferred over the indicator's local
|
|
423
|
+
* WebSocket state, which allows optimistic variant updates.
|
|
424
|
+
*/
|
|
425
|
+
sandboxStatusData?: SandboxWsStatus | null;
|
|
185
426
|
/** Show loading indicator */
|
|
186
427
|
showLoadingIndicator?: boolean;
|
|
187
428
|
/** Show error messages */
|
|
188
429
|
showErrors?: boolean;
|
|
189
430
|
/** Show input area */
|
|
190
431
|
showInput?: boolean;
|
|
432
|
+
/** Keep input visible but disabled */
|
|
433
|
+
disableInputPrompt?: boolean;
|
|
191
434
|
/** Show model selector (for protocols that support it) */
|
|
192
435
|
showModelSelector?: boolean;
|
|
193
436
|
/** Show tools menu (for protocols that support it) */
|
|
@@ -196,6 +439,11 @@ export interface ChatBaseProps {
|
|
|
196
439
|
showSkillsMenu?: boolean;
|
|
197
440
|
/** Indicate tools are accessed via Codemode meta-tools */
|
|
198
441
|
codemodeEnabled?: boolean;
|
|
442
|
+
/**
|
|
443
|
+
* Callback fired when the user toggles codemode from the Tools menu.
|
|
444
|
+
* When omitted, the toggle renders in read-only mode.
|
|
445
|
+
*/
|
|
446
|
+
onToggleCodemode?: (enabled: boolean) => void | Promise<void>;
|
|
199
447
|
/** Initial model ID to select (e.g., 'openai:gpt-4o-mini') */
|
|
200
448
|
initialModel?: string;
|
|
201
449
|
/**
|
|
@@ -392,20 +640,18 @@ export interface ChatBaseProps {
|
|
|
392
640
|
}>;
|
|
393
641
|
/**
|
|
394
642
|
* Runtime ID for conversation persistence.
|
|
395
|
-
* When provided, messages are
|
|
396
|
-
* and prevents message mixing between different agent runtimes.
|
|
643
|
+
* When provided, messages are restored from websocket snapshot data on
|
|
644
|
+
* reload and prevents message mixing between different agent runtimes.
|
|
397
645
|
*/
|
|
398
646
|
runtimeId?: string;
|
|
399
647
|
/**
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
* If not provided, defaults to `{protocol.endpoint}/api/v1/history`.
|
|
648
|
+
* Optional legacy endpoint URL for history backfill.
|
|
649
|
+
* History loading is websocket-first; this field is kept for
|
|
650
|
+
* compatibility with custom integrations.
|
|
404
651
|
*/
|
|
405
652
|
historyEndpoint?: string;
|
|
406
653
|
/**
|
|
407
|
-
*
|
|
408
|
-
* If not provided, uses the protocol's authToken.
|
|
654
|
+
* Optional auth token for the legacy history endpoint.
|
|
409
655
|
*/
|
|
410
656
|
historyAuthToken?: string;
|
|
411
657
|
/**
|
|
@@ -413,4 +659,59 @@ export interface ChatBaseProps {
|
|
|
413
659
|
* The message is shown in the chat and sent to the agent exactly once.
|
|
414
660
|
*/
|
|
415
661
|
pendingPrompt?: string;
|
|
662
|
+
/**
|
|
663
|
+
* Pre-hook: fires when a tool call starts executing.
|
|
664
|
+
* Called for both backend and frontend tools.
|
|
665
|
+
*
|
|
666
|
+
* @example
|
|
667
|
+
* ```tsx
|
|
668
|
+
* <Chat
|
|
669
|
+
* onToolCallStart={({ toolName, args }) => {
|
|
670
|
+
* console.log(`Tool ${toolName} started`, args);
|
|
671
|
+
* }}
|
|
672
|
+
* />
|
|
673
|
+
* ```
|
|
674
|
+
*/
|
|
675
|
+
onToolCallStart?: (context: ToolCallStartContext) => void;
|
|
676
|
+
/**
|
|
677
|
+
* Post-hook: fires when a tool result is received.
|
|
678
|
+
* Called for both backend and frontend tools.
|
|
679
|
+
* Use this to react to specific tool outcomes (e.g. update UI state
|
|
680
|
+
* when a `load_skill` tool completes).
|
|
681
|
+
*
|
|
682
|
+
* @example
|
|
683
|
+
* ```tsx
|
|
684
|
+
* <Chat
|
|
685
|
+
* onToolCallComplete={({ toolName, result, status }) => {
|
|
686
|
+
* if (toolName === 'load_skill' && status === 'complete') {
|
|
687
|
+
* // Update skills sidebar from load_skill result
|
|
688
|
+
* updateSkillsFromResult(result);
|
|
689
|
+
* }
|
|
690
|
+
* }}
|
|
691
|
+
* />
|
|
692
|
+
* ```
|
|
693
|
+
*/
|
|
694
|
+
onToolCallComplete?: (context: ToolCallCompleteContext) => void;
|
|
695
|
+
/**
|
|
696
|
+
* Whether to render the top-of-chat tool approval banner (and its review
|
|
697
|
+
* dialog) when `pendingApprovals` is non-empty. The banner/dialog render
|
|
698
|
+
* only when approvals are actually pending; this flag lets integrators opt
|
|
699
|
+
* out entirely.
|
|
700
|
+
* @default true
|
|
701
|
+
*/
|
|
702
|
+
showToolApprovalBanner?: boolean;
|
|
703
|
+
/**
|
|
704
|
+
* Pending tool approval requests to render in the built-in banner.
|
|
705
|
+
* Typically sourced from the approvals websocket in the hosting app.
|
|
706
|
+
*/
|
|
707
|
+
pendingApprovals?: import('../chat/tools').PendingApproval[];
|
|
708
|
+
/**
|
|
709
|
+
* Called when the user approves a pending request (from banner "Approve All"
|
|
710
|
+
* or from the review dialog).
|
|
711
|
+
*/
|
|
712
|
+
onApproveApproval?: (approvalId: string, note?: string) => void | Promise<boolean | void>;
|
|
713
|
+
/**
|
|
714
|
+
* Called when the user rejects a pending request from the review dialog.
|
|
715
|
+
*/
|
|
716
|
+
onRejectApproval?: (approvalId: string, note?: string) => void | Promise<boolean | void>;
|
|
416
717
|
}
|
package/lib/types/context.d.ts
CHANGED
|
@@ -54,6 +54,33 @@ export interface ContextSnapshotData {
|
|
|
54
54
|
turns: number;
|
|
55
55
|
durationSeconds: number;
|
|
56
56
|
} | null;
|
|
57
|
+
costUsage?: {
|
|
58
|
+
lastTurnCostUsd: number;
|
|
59
|
+
cumulativeCostUsd: number;
|
|
60
|
+
perRunBudgetUsd: number | null;
|
|
61
|
+
cumulativeBudgetUsd: number | null;
|
|
62
|
+
requestCount: number;
|
|
63
|
+
totalTokensUsed: number;
|
|
64
|
+
modelBreakdown: Array<{
|
|
65
|
+
model: string;
|
|
66
|
+
inputTokens: number;
|
|
67
|
+
outputTokens: number;
|
|
68
|
+
costUsd: number;
|
|
69
|
+
requests: number;
|
|
70
|
+
}>;
|
|
71
|
+
runs: Array<{
|
|
72
|
+
timestamp: string;
|
|
73
|
+
model: string;
|
|
74
|
+
inputTokens: number;
|
|
75
|
+
outputTokens: number;
|
|
76
|
+
runCostUsd: number;
|
|
77
|
+
cumulativeCostUsd: number;
|
|
78
|
+
pricePerInputToken: number | null;
|
|
79
|
+
pricePerOutputToken: number | null;
|
|
80
|
+
pricingResolved: boolean;
|
|
81
|
+
}>;
|
|
82
|
+
lastUpdated: string | null;
|
|
83
|
+
};
|
|
57
84
|
error?: string;
|
|
58
85
|
}
|
|
59
86
|
/**
|
package/lib/types/cost.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export interface ContextUsage {
|
|
|
15
15
|
summarizationCount: number;
|
|
16
16
|
}
|
|
17
17
|
export interface CostUsage {
|
|
18
|
-
/**
|
|
19
|
-
|
|
18
|
+
/** Last turn cost in USD */
|
|
19
|
+
lastTurnCostUsd: number;
|
|
20
20
|
/** Cumulative cost in USD */
|
|
21
21
|
cumulativeCostUsd: number;
|
|
22
22
|
/** Budget limit per run (from agentspec) */
|
package/lib/types/index.d.ts
CHANGED
|
@@ -26,9 +26,11 @@ export * from './middleware';
|
|
|
26
26
|
export * from './models';
|
|
27
27
|
export * from './notifications';
|
|
28
28
|
export * from './outputs';
|
|
29
|
+
export * from './personas';
|
|
29
30
|
export * from './protocol';
|
|
30
31
|
export * from './sandbox';
|
|
31
32
|
export * from './skills';
|
|
33
|
+
export * from './stream';
|
|
32
34
|
export * from './teams';
|
|
33
35
|
export * from './tool-approvals';
|
|
34
36
|
export * from './tools';
|
package/lib/types/index.js
CHANGED
|
@@ -30,9 +30,11 @@ export * from './middleware';
|
|
|
30
30
|
export * from './models';
|
|
31
31
|
export * from './notifications';
|
|
32
32
|
export * from './outputs';
|
|
33
|
+
export * from './personas';
|
|
33
34
|
export * from './protocol';
|
|
34
35
|
export * from './sandbox';
|
|
35
36
|
export * from './skills';
|
|
37
|
+
export * from './stream';
|
|
36
38
|
export * from './teams';
|
|
37
39
|
export * from './tool-approvals';
|
|
38
40
|
export * from './tools';
|
package/lib/types/mcp.d.ts
CHANGED
|
@@ -73,6 +73,11 @@ export interface McpServerStatus {
|
|
|
73
73
|
status: 'none' | 'not_started' | 'starting' | 'failed' | 'started';
|
|
74
74
|
error?: string;
|
|
75
75
|
tools_count?: number;
|
|
76
|
+
tools?: Array<{
|
|
77
|
+
name: string;
|
|
78
|
+
description?: string;
|
|
79
|
+
enabled?: boolean;
|
|
80
|
+
}>;
|
|
76
81
|
}
|
|
77
82
|
/**
|
|
78
83
|
* Full response from `/api/v1/configure/mcp-toolsets-status`.
|
|
@@ -84,6 +89,9 @@ export interface McpToolsetsStatusResponse {
|
|
|
84
89
|
ready_servers: string[];
|
|
85
90
|
failed_servers: Record<string, string>;
|
|
86
91
|
servers: McpServerStatus[];
|
|
92
|
+
enabled_tools_by_server?: Record<string, string[]>;
|
|
93
|
+
enabled_tools_count?: number;
|
|
94
|
+
approved_tools_by_server?: Record<string, string[]>;
|
|
87
95
|
}
|
|
88
96
|
/**
|
|
89
97
|
* Primer-addon indicator colours for each aggregate MCP status.
|
package/lib/types/models.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { MCPServer } from './mcp';
|
|
|
3
3
|
* Specification for an AI model from the catalog.
|
|
4
4
|
*/
|
|
5
5
|
export interface AIModel {
|
|
6
|
-
/** Unique model identifier (e.g., 'anthropic:claude-
|
|
6
|
+
/** Unique model identifier (e.g., 'anthropic:claude-3-5-haiku-20241022') */
|
|
7
7
|
id: string;
|
|
8
8
|
/** Model spec version */
|
|
9
9
|
version: string;
|
|
@@ -22,7 +22,7 @@ export interface AIModel {
|
|
|
22
22
|
* Configuration for an AI model runtime (as returned by the server).
|
|
23
23
|
*/
|
|
24
24
|
export interface AIModelRuntime {
|
|
25
|
-
/** Model identifier (e.g., 'anthropic:claude-
|
|
25
|
+
/** Model identifier (e.g., 'anthropic:claude-3-5-haiku-20241022') */
|
|
26
26
|
id: string;
|
|
27
27
|
/** Display name for the model */
|
|
28
28
|
name: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Specification for a Persona.
|
|
3
|
+
*
|
|
4
|
+
* A Persona is a lightweight identity built on top of an agent spec —
|
|
5
|
+
* it bundles a name, a description and a set of tags that describe the
|
|
6
|
+
* role and tone of the underlying agent.
|
|
7
|
+
*/
|
|
8
|
+
export interface PersonaSpec {
|
|
9
|
+
/** Unique persona identifier (e.g., 'tutor', 'sentinel') */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Persona spec version */
|
|
12
|
+
version: string;
|
|
13
|
+
/** Display name of the persona */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Short persona description */
|
|
16
|
+
description: string;
|
|
17
|
+
/** Categorization tags */
|
|
18
|
+
tags: string[];
|
|
19
|
+
/** Icon identifier */
|
|
20
|
+
icon?: string;
|
|
21
|
+
/** Emoji representation */
|
|
22
|
+
emoji?: string;
|
|
23
|
+
/** Optional reference to the underlying agent spec id */
|
|
24
|
+
agent?: string;
|
|
25
|
+
}
|
package/lib/types/skills.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Skill
|
|
2
|
+
* Skill status as tracked by the server-side skills area.
|
|
3
|
+
*
|
|
4
|
+
* - `available`: in catalog, not yet enabled
|
|
5
|
+
* - `enabled`: enabled, SKILL.md loading pending
|
|
6
|
+
* - `loaded`: SKILL.md loaded, included in the LLM system prompt
|
|
7
|
+
*/
|
|
8
|
+
export type SkillStatus = 'available' | 'enabled' | 'loaded';
|
|
9
|
+
/**
|
|
10
|
+
* Skill information from the WebSocket snapshot.
|
|
3
11
|
*/
|
|
4
12
|
export interface SkillInfo {
|
|
5
13
|
id: string;
|
|
@@ -9,6 +17,40 @@ export interface SkillInfo {
|
|
|
9
17
|
tags?: string[];
|
|
10
18
|
has_scripts?: boolean;
|
|
11
19
|
has_resources?: boolean;
|
|
20
|
+
/** Lifecycle status from the server-side skills area */
|
|
21
|
+
status?: SkillStatus;
|
|
22
|
+
/** Whether the skill is approved (defaults to true when omitted) */
|
|
23
|
+
approved?: boolean;
|
|
24
|
+
/** Raw SKILL.md content (populated once status is 'loaded') */
|
|
25
|
+
skill_definition?: string | null;
|
|
26
|
+
/** Discovery/source variant for this skill */
|
|
27
|
+
source_variant?: 'module' | 'package' | 'path' | 'unknown';
|
|
28
|
+
module?: string;
|
|
29
|
+
package?: string;
|
|
30
|
+
method?: string;
|
|
31
|
+
path?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Loaded skill normalized for UI/state consumption.
|
|
35
|
+
*
|
|
36
|
+
* This representation is resolved from an agent's active spec and optional
|
|
37
|
+
* catalog enrichment, then persisted per-agent in the runtime store.
|
|
38
|
+
*/
|
|
39
|
+
export interface LoadedSkillInfo {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
description: string;
|
|
43
|
+
variant: 'module' | 'package' | 'path' | 'unknown';
|
|
44
|
+
module?: string;
|
|
45
|
+
package?: string;
|
|
46
|
+
method?: string;
|
|
47
|
+
path?: string;
|
|
48
|
+
license?: string;
|
|
49
|
+
compatibility?: string;
|
|
50
|
+
allowedTools?: string[];
|
|
51
|
+
skillMetadata?: Record<string, string>;
|
|
52
|
+
tags?: string[];
|
|
53
|
+
emoji?: string;
|
|
12
54
|
}
|
|
13
55
|
/**
|
|
14
56
|
* Skills response from backend
|