@datalayer/agent-runtimes 1.0.19 → 1.0.21
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 +11 -3
- package/lib/AgentNode.js +141 -40
- package/lib/App.js +2 -2
- package/lib/agent-node/AgentNodeGallery.js +188 -25
- package/lib/api/runtimes/runtimes.d.ts +57 -0
- package/lib/api/runtimes/runtimes.js +55 -1
- package/lib/chat/Chat.d.ts +1 -1
- package/lib/chat/Chat.js +2 -2
- package/lib/chat/base/ChatBase.js +50 -13
- package/lib/chat/document/EphemeralDocument.d.ts +5 -1
- package/lib/chat/document/EphemeralDocument.js +7 -5
- package/lib/chat/header/ChatHeaderBase.d.ts +3 -1
- package/lib/chat/header/ChatHeaderBase.js +5 -3
- package/lib/chat/messages/ChatMessageList.d.ts +19 -0
- package/lib/chat/messages/ChatMessageList.js +180 -9
- package/lib/chat/notebook/EphemeralNotebook.d.ts +5 -1
- package/lib/chat/notebook/EphemeralNotebook.js +9 -6
- package/lib/chat/prompt/InputPrompt.js +1 -1
- package/lib/chat/tools/SubagentActivity.d.ts +20 -0
- package/lib/chat/tools/SubagentActivity.js +154 -0
- package/lib/chat/tools/index.d.ts +1 -0
- package/lib/chat/tools/index.js +1 -0
- package/lib/chat/usage/TokenUsageBar.js +3 -3
- package/lib/client/AgentRuntimesClient.d.ts +5 -0
- package/lib/client/AgentsMixin.js +3 -1
- package/lib/client/mixins/RuntimesMixin.d.ts +12 -0
- package/lib/client/mixins/RuntimesMixin.js +24 -1
- package/lib/components/AgentSummary.d.ts +1 -0
- package/lib/components/AgentSummary.js +66 -10
- package/lib/components/runtimes/RuntimePickerBase.js +64 -29
- package/lib/components/runtimes/RuntimePickerCell.js +1 -1
- package/lib/components/runtimes/RuntimePickerNotebook.js +1 -1
- package/lib/components/runtimes/RuntimeSimplePicker.js +3 -2
- package/lib/components/runtimes/RuntimeUtils.js +2 -2
- package/lib/context/GraphFlowChart.js +1 -1
- package/lib/context/TokenUsageChart.js +1 -1
- package/lib/context/TurnGraphChart.js +2 -2
- package/lib/examples/A2UiAgentExample.js +4 -4
- package/lib/examples/A2UiComponentsGalleryExample.js +3 -3
- package/lib/examples/A2UiContactCardExample.js +3 -3
- package/lib/examples/A2UiRestaurantExample.js +2 -2
- package/lib/examples/A2UiViewerExample.js +3 -3
- package/lib/examples/AgUiAgenticExample.js +3 -3
- package/lib/examples/AgUiBackendToolRenderingExample.js +2 -2
- package/lib/examples/AgUiHaikuGenUiExample.js +3 -3
- package/lib/examples/AgUiHumanInTheLoopExample.js +5 -5
- package/lib/examples/AgUiSharedStateExample.js +3 -3
- package/lib/examples/AgUiToolsBasedGenUiExample.js +7 -5
- package/lib/examples/AgentCheckpointsExample.js +6 -5
- package/lib/examples/{AgentSandboxExample.d.ts → AgentCodeSandboxExample.d.ts} +4 -4
- package/lib/examples/{AgentSandboxExample.js → AgentCodeSandboxExample.js} +10 -9
- package/lib/examples/AgentCodeSandboxesExample.js +2 -2
- package/lib/examples/AgentCodemodeExample.js +3 -3
- package/lib/examples/AgentCompactionExample.d.ts +12 -0
- package/lib/examples/AgentCompactionExample.js +244 -0
- package/lib/examples/AgentEvalsExample.js +10 -20
- package/lib/examples/AgentGuardrailsExample.js +2 -2
- package/lib/examples/AgentHooksExample.js +1 -1
- package/lib/examples/AgentInferenceProviderExample.js +6 -8
- package/lib/examples/AgentLoopExample.js +3 -3
- package/lib/examples/AgentMCPExample.js +3 -3
- package/lib/examples/AgentMemoryExample.d.ts +4 -2
- package/lib/examples/AgentMemoryExample.js +93 -10
- package/lib/examples/AgentMonitoringExample.js +2 -2
- package/lib/examples/AgentNotificationsExample.js +1 -1
- package/lib/examples/AgentOtelExample.d.ts +2 -3
- package/lib/examples/AgentOtelExample.js +7 -12
- package/lib/examples/AgentOutputsExample.js +5 -5
- package/lib/examples/AgentParametersExample.js +3 -3
- package/lib/examples/AgentSkillsExample.js +4 -4
- package/lib/examples/AgentSubagentsExample.d.ts +2 -2
- package/lib/examples/AgentSubagentsExample.js +43 -34
- package/lib/examples/AgentToolApprovalsExample.js +1 -1
- package/lib/examples/AgentTriggersExample.js +9 -11
- package/lib/examples/AgentspecsExample.js +13 -5
- package/lib/examples/CellExample.d.ts +6 -0
- package/lib/examples/CellExample.js +84 -0
- package/lib/examples/ChatCustomExample.js +1 -1
- package/lib/examples/ChatExample.js +1 -1
- package/lib/examples/ChatStandaloneExample.js +2 -2
- package/lib/examples/HomeExample.js +29 -28
- package/lib/examples/Lexical2Example.js +2 -2
- package/lib/examples/LexicalAgentExample.js +1 -1
- package/lib/examples/LexicalAgentSidebarExample.js +2 -2
- package/lib/examples/NotebookAgentSidebarExample.d.ts +1 -1
- package/lib/examples/NotebookAgentSidebarExample.js +5 -4
- package/lib/examples/NotebookCollaborationExample.js +3 -3
- package/lib/examples/NotebookExample.js +2 -2
- package/lib/examples/components/ExampleWrapper.js +5 -0
- package/lib/examples/components/Header.js +2 -2
- package/lib/examples/components/HeaderControls.js +1 -1
- package/lib/examples/components/LexicalEditor.js +1 -1
- package/lib/examples/components/MainContent.js +1 -1
- package/lib/examples/components/MockFileBrowser.js +8 -8
- package/lib/examples/components/TimeTravel.js +1 -1
- package/lib/examples/components/haiku/HaikuDisplay.js +2 -2
- package/lib/examples/example-selector.js +4 -3
- package/lib/examples/hooks/useExampleAgentRuntime.js +11 -1
- package/lib/examples/hooks/useExampleAgentRuntimes.d.ts +7 -0
- package/lib/examples/hooks/useExampleAgentRuntimes.js +82 -0
- package/lib/examples/index.d.ts +2 -1
- package/lib/examples/index.js +2 -1
- package/lib/examples/main.js +359 -46
- package/lib/examples/utils/agentSummaryStore.d.ts +17 -0
- package/lib/examples/utils/themedProvider.js +32 -2
- package/lib/examples/utils/useExampleAgentRuntimesUrl.js +2 -1
- package/lib/examples2/NotebookMutationsKernel.js +6 -3
- package/lib/examples2/NotebookMutationsServiceManager.js +6 -3
- package/lib/examples2/ReactRouterExample.js +5 -5
- package/lib/examples2/main.js +38 -0
- package/lib/hooks/useAIAgentsWebSocket.js +35 -0
- package/lib/hooks/useAgentRuntimes.d.ts +22 -0
- package/lib/hooks/useAgentRuntimes.js +192 -5
- package/lib/hooks/useCheckpoints.js +2 -2
- package/lib/hooks/useToolApprovals.d.ts +10 -4
- package/lib/hooks/useToolApprovals.js +11 -5
- package/lib/models/Runtime.d.ts +10 -8
- package/lib/models/RuntimeDTO.d.ts +5 -3
- package/lib/models/RuntimeDTO.js +3 -3
- package/lib/runtimes/actions.js +3 -1
- package/lib/runtimes/apis.d.ts +7 -0
- package/lib/specs/agents/agents.d.ts +51 -0
- package/lib/specs/agents/agents.js +3389 -94
- package/lib/specs/models.d.ts +2 -0
- package/lib/specs/models.js +37 -0
- package/lib/stores/agentRuntimeStore.d.ts +32 -1
- package/lib/stores/agentRuntimeStore.js +65 -1
- package/lib/stores/index.d.ts +1 -1
- package/lib/stores/index.js +1 -1
- package/lib/types/agents.d.ts +9 -3
- package/lib/types/agentspecs.d.ts +2 -0
- package/lib/types/chat.d.ts +12 -0
- package/lib/types/models.d.ts +5 -0
- package/lib/types/stream.d.ts +58 -1
- package/package.json +4 -4
- package/scripts/codegen/__pycache__/versioning.cpython-313.pyc +0 -0
- package/scripts/codegen/generate_agents.py +7 -0
- package/scripts/codegen/generate_models.py +22 -9
- package/scripts/gen_workers.py +340 -0
- package/lib/examples/CellSimpleExample.d.ts +0 -6
- package/lib/examples/CellSimpleExample.js +0 -20
package/lib/specs/models.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare const AIModels: {
|
|
|
22
22
|
readonly BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_8: "bedrock:us.anthropic.claude-opus-4-8";
|
|
23
23
|
readonly BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0: "bedrock:us.anthropic.claude-opus-4-20250514-v1:0";
|
|
24
24
|
readonly BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0: "bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0";
|
|
25
|
+
readonly BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_6: "bedrock:us.anthropic.claude-sonnet-4-6";
|
|
25
26
|
readonly BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0: "bedrock:us.anthropic.claude-sonnet-4-20250514-v1:0";
|
|
26
27
|
readonly OPENAI_GPT_4_1_MINI: "openai:gpt-4.1-mini";
|
|
27
28
|
readonly OPENAI_GPT_4_1_NANO: "openai:gpt-4.1-nano";
|
|
@@ -45,6 +46,7 @@ export declare const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_6_V1_0_0_1: AIModel;
|
|
|
45
46
|
export declare const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_8_0_0_1: AIModel;
|
|
46
47
|
export declare const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0_0_0_1: AIModel;
|
|
47
48
|
export declare const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0_0_0_1: AIModel;
|
|
49
|
+
export declare const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_6_0_0_1: AIModel;
|
|
48
50
|
export declare const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0_0_0_1: AIModel;
|
|
49
51
|
export declare const OPENAI_GPT_4_1_MINI_0_0_1: AIModel;
|
|
50
52
|
export declare const OPENAI_GPT_4_1_NANO_0_0_1: AIModel;
|
package/lib/specs/models.js
CHANGED
|
@@ -20,6 +20,7 @@ export const AIModels = {
|
|
|
20
20
|
BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_8: 'bedrock:us.anthropic.claude-opus-4-8',
|
|
21
21
|
BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0: 'bedrock:us.anthropic.claude-opus-4-20250514-v1:0',
|
|
22
22
|
BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
23
|
+
BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_6: 'bedrock:us.anthropic.claude-sonnet-4-6',
|
|
23
24
|
BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0: 'bedrock:us.anthropic.claude-sonnet-4-20250514-v1:0',
|
|
24
25
|
OPENAI_GPT_4_1_MINI: 'openai:gpt-4.1-mini',
|
|
25
26
|
OPENAI_GPT_4_1_NANO: 'openai:gpt-4.1-nano',
|
|
@@ -39,6 +40,7 @@ export const ANTHROPIC_CLAUDE_3_5_HAIKU_20241022_0_0_1 = {
|
|
|
39
40
|
provider: 'anthropic',
|
|
40
41
|
default: false,
|
|
41
42
|
requiredEnvVars: ['ANTHROPIC_API_KEY'],
|
|
43
|
+
tokensLimit: 8192,
|
|
42
44
|
};
|
|
43
45
|
export const ANTHROPIC_CLAUDE_OPUS_4_20250514_0_0_1 = {
|
|
44
46
|
id: 'anthropic:claude-opus-4-20250514',
|
|
@@ -48,6 +50,7 @@ export const ANTHROPIC_CLAUDE_OPUS_4_20250514_0_0_1 = {
|
|
|
48
50
|
provider: 'anthropic',
|
|
49
51
|
default: false,
|
|
50
52
|
requiredEnvVars: ['ANTHROPIC_API_KEY'],
|
|
53
|
+
tokensLimit: 32000,
|
|
51
54
|
};
|
|
52
55
|
export const ANTHROPIC_CLAUDE_SONNET_4_5_20250514_0_0_1 = {
|
|
53
56
|
id: 'anthropic:claude-sonnet-4-5-20250514',
|
|
@@ -57,6 +60,7 @@ export const ANTHROPIC_CLAUDE_SONNET_4_5_20250514_0_0_1 = {
|
|
|
57
60
|
provider: 'anthropic',
|
|
58
61
|
default: false,
|
|
59
62
|
requiredEnvVars: ['ANTHROPIC_API_KEY'],
|
|
63
|
+
tokensLimit: 64000,
|
|
60
64
|
};
|
|
61
65
|
export const ANTHROPIC_CLAUDE_SONNET_4_20250514_0_0_1 = {
|
|
62
66
|
id: 'anthropic:claude-sonnet-4-20250514',
|
|
@@ -66,6 +70,7 @@ export const ANTHROPIC_CLAUDE_SONNET_4_20250514_0_0_1 = {
|
|
|
66
70
|
provider: 'anthropic',
|
|
67
71
|
default: false,
|
|
68
72
|
requiredEnvVars: ['ANTHROPIC_API_KEY'],
|
|
73
|
+
tokensLimit: 64000,
|
|
69
74
|
};
|
|
70
75
|
export const AZURE_OPENAI_GPT_4_1_MINI_0_0_1 = {
|
|
71
76
|
id: 'azure-openai:gpt-4.1-mini',
|
|
@@ -75,6 +80,7 @@ export const AZURE_OPENAI_GPT_4_1_MINI_0_0_1 = {
|
|
|
75
80
|
provider: 'azure-openai',
|
|
76
81
|
default: false,
|
|
77
82
|
requiredEnvVars: ['AZURE_OPENAI_API_KEY', 'AZURE_OPENAI_ENDPOINT'],
|
|
83
|
+
tokensLimit: 32768,
|
|
78
84
|
};
|
|
79
85
|
export const AZURE_OPENAI_GPT_4_1_NANO_0_0_1 = {
|
|
80
86
|
id: 'azure-openai:gpt-4.1-nano',
|
|
@@ -84,6 +90,7 @@ export const AZURE_OPENAI_GPT_4_1_NANO_0_0_1 = {
|
|
|
84
90
|
provider: 'azure-openai',
|
|
85
91
|
default: false,
|
|
86
92
|
requiredEnvVars: ['AZURE_OPENAI_API_KEY', 'AZURE_OPENAI_ENDPOINT'],
|
|
93
|
+
tokensLimit: 32768,
|
|
87
94
|
};
|
|
88
95
|
export const AZURE_OPENAI_GPT_4_1_0_0_1 = {
|
|
89
96
|
id: 'azure-openai:gpt-4.1',
|
|
@@ -93,6 +100,7 @@ export const AZURE_OPENAI_GPT_4_1_0_0_1 = {
|
|
|
93
100
|
provider: 'azure-openai',
|
|
94
101
|
default: false,
|
|
95
102
|
requiredEnvVars: ['AZURE_OPENAI_API_KEY', 'AZURE_OPENAI_ENDPOINT'],
|
|
103
|
+
tokensLimit: 32768,
|
|
96
104
|
};
|
|
97
105
|
export const AZURE_OPENAI_GPT_4O_MINI_0_0_1 = {
|
|
98
106
|
id: 'azure-openai:gpt-4o-mini',
|
|
@@ -102,6 +110,7 @@ export const AZURE_OPENAI_GPT_4O_MINI_0_0_1 = {
|
|
|
102
110
|
provider: 'azure-openai',
|
|
103
111
|
default: false,
|
|
104
112
|
requiredEnvVars: ['AZURE_OPENAI_API_KEY', 'AZURE_OPENAI_ENDPOINT'],
|
|
113
|
+
tokensLimit: 16384,
|
|
105
114
|
};
|
|
106
115
|
export const AZURE_OPENAI_GPT_4O_0_0_1 = {
|
|
107
116
|
id: 'azure-openai:gpt-4o',
|
|
@@ -111,6 +120,7 @@ export const AZURE_OPENAI_GPT_4O_0_0_1 = {
|
|
|
111
120
|
provider: 'azure-openai',
|
|
112
121
|
default: false,
|
|
113
122
|
requiredEnvVars: ['AZURE_OPENAI_API_KEY', 'AZURE_OPENAI_ENDPOINT'],
|
|
123
|
+
tokensLimit: 16384,
|
|
114
124
|
};
|
|
115
125
|
export const BEDROCK_US_ANTHROPIC_CLAUDE_FABLE_5_0_0_1 = {
|
|
116
126
|
id: 'bedrock:us.anthropic.claude-fable-5',
|
|
@@ -124,6 +134,7 @@ export const BEDROCK_US_ANTHROPIC_CLAUDE_FABLE_5_0_0_1 = {
|
|
|
124
134
|
'AWS_SECRET_ACCESS_KEY',
|
|
125
135
|
'AWS_DEFAULT_REGION',
|
|
126
136
|
],
|
|
137
|
+
tokensLimit: 64000,
|
|
127
138
|
};
|
|
128
139
|
export const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_6_V1_0_0_1 = {
|
|
129
140
|
id: 'bedrock:us.anthropic.claude-opus-4-6-v1',
|
|
@@ -137,6 +148,7 @@ export const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_6_V1_0_0_1 = {
|
|
|
137
148
|
'AWS_SECRET_ACCESS_KEY',
|
|
138
149
|
'AWS_DEFAULT_REGION',
|
|
139
150
|
],
|
|
151
|
+
tokensLimit: 32000,
|
|
140
152
|
};
|
|
141
153
|
export const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_8_0_0_1 = {
|
|
142
154
|
id: 'bedrock:us.anthropic.claude-opus-4-8',
|
|
@@ -150,6 +162,7 @@ export const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_8_0_0_1 = {
|
|
|
150
162
|
'AWS_SECRET_ACCESS_KEY',
|
|
151
163
|
'AWS_DEFAULT_REGION',
|
|
152
164
|
],
|
|
165
|
+
tokensLimit: 32000,
|
|
153
166
|
};
|
|
154
167
|
export const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0_0_0_1 = {
|
|
155
168
|
id: 'bedrock:us.anthropic.claude-opus-4-20250514-v1:0',
|
|
@@ -163,6 +176,7 @@ export const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0_0_0_1 = {
|
|
|
163
176
|
'AWS_SECRET_ACCESS_KEY',
|
|
164
177
|
'AWS_DEFAULT_REGION',
|
|
165
178
|
],
|
|
179
|
+
tokensLimit: 32000,
|
|
166
180
|
};
|
|
167
181
|
export const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0_0_0_1 = {
|
|
168
182
|
id: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
@@ -176,6 +190,21 @@ export const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0_0_0_1 = {
|
|
|
176
190
|
'AWS_SECRET_ACCESS_KEY',
|
|
177
191
|
'AWS_DEFAULT_REGION',
|
|
178
192
|
],
|
|
193
|
+
tokensLimit: 64000,
|
|
194
|
+
};
|
|
195
|
+
export const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_6_0_0_1 = {
|
|
196
|
+
id: 'bedrock:us.anthropic.claude-sonnet-4-6',
|
|
197
|
+
version: '0.0.1',
|
|
198
|
+
name: 'Bedrock Claude Sonnet 4.6',
|
|
199
|
+
description: 'Claude Sonnet 4.6 via AWS Bedrock - balanced performance',
|
|
200
|
+
provider: 'bedrock',
|
|
201
|
+
default: true,
|
|
202
|
+
requiredEnvVars: [
|
|
203
|
+
'AWS_ACCESS_KEY_ID',
|
|
204
|
+
'AWS_SECRET_ACCESS_KEY',
|
|
205
|
+
'AWS_DEFAULT_REGION',
|
|
206
|
+
],
|
|
207
|
+
tokensLimit: 64000,
|
|
179
208
|
};
|
|
180
209
|
export const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0_0_0_1 = {
|
|
181
210
|
id: 'bedrock:us.anthropic.claude-sonnet-4-20250514-v1:0',
|
|
@@ -189,6 +218,7 @@ export const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0_0_0_1 = {
|
|
|
189
218
|
'AWS_SECRET_ACCESS_KEY',
|
|
190
219
|
'AWS_DEFAULT_REGION',
|
|
191
220
|
],
|
|
221
|
+
tokensLimit: 64000,
|
|
192
222
|
};
|
|
193
223
|
export const OPENAI_GPT_4_1_MINI_0_0_1 = {
|
|
194
224
|
id: 'openai:gpt-4.1-mini',
|
|
@@ -198,6 +228,7 @@ export const OPENAI_GPT_4_1_MINI_0_0_1 = {
|
|
|
198
228
|
provider: 'openai',
|
|
199
229
|
default: false,
|
|
200
230
|
requiredEnvVars: ['OPENAI_API_KEY'],
|
|
231
|
+
tokensLimit: 32768,
|
|
201
232
|
};
|
|
202
233
|
export const OPENAI_GPT_4_1_NANO_0_0_1 = {
|
|
203
234
|
id: 'openai:gpt-4.1-nano',
|
|
@@ -207,6 +238,7 @@ export const OPENAI_GPT_4_1_NANO_0_0_1 = {
|
|
|
207
238
|
provider: 'openai',
|
|
208
239
|
default: false,
|
|
209
240
|
requiredEnvVars: ['OPENAI_API_KEY'],
|
|
241
|
+
tokensLimit: 32768,
|
|
210
242
|
};
|
|
211
243
|
export const OPENAI_GPT_4_1_0_0_1 = {
|
|
212
244
|
id: 'openai:gpt-4.1',
|
|
@@ -216,6 +248,7 @@ export const OPENAI_GPT_4_1_0_0_1 = {
|
|
|
216
248
|
provider: 'openai',
|
|
217
249
|
default: false,
|
|
218
250
|
requiredEnvVars: ['OPENAI_API_KEY'],
|
|
251
|
+
tokensLimit: 32768,
|
|
219
252
|
};
|
|
220
253
|
export const OPENAI_GPT_4O_MINI_0_0_1 = {
|
|
221
254
|
id: 'openai:gpt-4o-mini',
|
|
@@ -225,6 +258,7 @@ export const OPENAI_GPT_4O_MINI_0_0_1 = {
|
|
|
225
258
|
provider: 'openai',
|
|
226
259
|
default: false,
|
|
227
260
|
requiredEnvVars: ['OPENAI_API_KEY'],
|
|
261
|
+
tokensLimit: 16384,
|
|
228
262
|
};
|
|
229
263
|
export const OPENAI_GPT_4O_0_0_1 = {
|
|
230
264
|
id: 'openai:gpt-4o',
|
|
@@ -234,6 +268,7 @@ export const OPENAI_GPT_4O_0_0_1 = {
|
|
|
234
268
|
provider: 'openai',
|
|
235
269
|
default: false,
|
|
236
270
|
requiredEnvVars: ['OPENAI_API_KEY'],
|
|
271
|
+
tokensLimit: 16384,
|
|
237
272
|
};
|
|
238
273
|
export const OPENAI_O3_MINI_0_0_1 = {
|
|
239
274
|
id: 'openai:o3-mini',
|
|
@@ -243,6 +278,7 @@ export const OPENAI_O3_MINI_0_0_1 = {
|
|
|
243
278
|
provider: 'openai',
|
|
244
279
|
default: false,
|
|
245
280
|
requiredEnvVars: ['OPENAI_API_KEY'],
|
|
281
|
+
tokensLimit: 100000,
|
|
246
282
|
};
|
|
247
283
|
// ============================================================================
|
|
248
284
|
// AI Model Catalog
|
|
@@ -262,6 +298,7 @@ export const AI_MODEL_CATALOGUE = {
|
|
|
262
298
|
'bedrock:us.anthropic.claude-opus-4-8': BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_8_0_0_1,
|
|
263
299
|
'bedrock:us.anthropic.claude-opus-4-20250514-v1:0': BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0_0_0_1,
|
|
264
300
|
'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0': BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0_0_0_1,
|
|
301
|
+
'bedrock:us.anthropic.claude-sonnet-4-6': BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_6_0_0_1,
|
|
265
302
|
'bedrock:us.anthropic.claude-sonnet-4-20250514-v1:0': BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0_0_0_1,
|
|
266
303
|
'openai:gpt-4.1-mini': OPENAI_GPT_4_1_MINI_0_0_1,
|
|
267
304
|
'openai:gpt-4.1-nano': OPENAI_GPT_4_1_NANO_0_0_1,
|
|
@@ -2,7 +2,7 @@ import type { ServiceManager } from '@jupyterlab/services';
|
|
|
2
2
|
import type { INotebookContent } from '@jupyterlab/nbformat';
|
|
3
3
|
import type { IRuntimeOptions } from '../runtimes/apis';
|
|
4
4
|
import type { AgentStatus, AgentConnection, AgentConfig, Protocol } from '../types';
|
|
5
|
-
import type { AgentStreamSnapshotPayload, AgentStreamToolApprovalPayload, CodemodeStatusData } from '../types/stream';
|
|
5
|
+
import type { AgentStreamSnapshotPayload, AgentStreamSubagentPayload, AgentStreamCompactionPayload, AgentStreamToolApprovalPayload, CodemodeStatusData } from '../types/stream';
|
|
6
6
|
import type { ContextSnapshotData } from '../types/context';
|
|
7
7
|
import type { McpToolsetsStatusResponse } from '../types/mcp';
|
|
8
8
|
import type { LoadedSkillInfo } from '../types/skills';
|
|
@@ -54,6 +54,17 @@ export interface AgentRuntimeStoreState {
|
|
|
54
54
|
wsState: AgentRuntimeWsState;
|
|
55
55
|
approvals: AgentStreamToolApprovalPayload[];
|
|
56
56
|
pendingApprovalCount: number;
|
|
57
|
+
/**
|
|
58
|
+
* Live subagent (`delegate_task`) activity keyed by the parent delegation
|
|
59
|
+
* tool call id. Each entry is the ordered stream of interaction events for
|
|
60
|
+
* that subagent run.
|
|
61
|
+
*/
|
|
62
|
+
subagentActivity: Record<string, AgentStreamSubagentPayload[]>;
|
|
63
|
+
/**
|
|
64
|
+
* Latest history-compaction activity for the connected agent, or `null` when
|
|
65
|
+
* no compaction has occurred on the current stream.
|
|
66
|
+
*/
|
|
67
|
+
compaction: AgentStreamCompactionPayload | null;
|
|
57
68
|
contextSnapshot: ContextSnapshotData | null;
|
|
58
69
|
costUsage: ContextSnapshotData['costUsage'] | null;
|
|
59
70
|
mcpStatus: McpToolsetsStatusResponse | null;
|
|
@@ -113,6 +124,9 @@ export interface AgentRuntimeStoreActions {
|
|
|
113
124
|
setWsState: (state: AgentRuntimeWsState) => void;
|
|
114
125
|
setWs: (ws: WebSocket | null, agentId?: string) => void;
|
|
115
126
|
applySnapshot: (payload: AgentStreamSnapshotPayload) => void;
|
|
127
|
+
appendSubagentEvent: (event: AgentStreamSubagentPayload) => void;
|
|
128
|
+
clearSubagentActivity: () => void;
|
|
129
|
+
setCompaction: (payload: AgentStreamCompactionPayload | null) => void;
|
|
116
130
|
upsertApproval: (approval: AgentStreamToolApprovalPayload) => void;
|
|
117
131
|
removeApproval: (approvalId: string) => void;
|
|
118
132
|
sendDecision: (approvalId: string, approved: boolean, note?: string, toolCallId?: string, agentId?: string) => boolean;
|
|
@@ -221,6 +235,23 @@ export declare const useAgentRuntimeCostUsage: () => {
|
|
|
221
235
|
export declare const useAgentRuntimeCodemodeStatus: () => CodemodeStatusData | null;
|
|
222
236
|
export declare const useAgentRuntimeWsState: () => AgentRuntimeWsState;
|
|
223
237
|
export declare const useAgentRuntimeLoadedSkills: (agentId?: string) => LoadedSkillInfo[];
|
|
238
|
+
/** Live subagent activity for a given parent `delegate_task` tool call id. */
|
|
239
|
+
export declare const useAgentRuntimeSubagentActivity: (toolCallId?: string) => readonly AgentStreamSubagentPayload[];
|
|
240
|
+
/**
|
|
241
|
+
* Live subagent activity resolved by tool-call id with a subagent-name
|
|
242
|
+
* fallback. The backend keys events by the parent run's `tool_call_id`, which
|
|
243
|
+
* can differ from the id surfaced in the chat transport stream; when the id
|
|
244
|
+
* misses we fall back to the most recent run for the named subagent.
|
|
245
|
+
*/
|
|
246
|
+
export declare const useAgentRuntimeSubagentActivityByToolCall: (toolCallId?: string, subagentName?: string) => readonly AgentStreamSubagentPayload[];
|
|
247
|
+
/**
|
|
248
|
+
* Key of the currently active (running) subagent run, or `null` when none is
|
|
249
|
+
* active. A run is active while its event list has no `end`/`error` phase; when
|
|
250
|
+
* several are active the most recently started one wins.
|
|
251
|
+
*/
|
|
252
|
+
export declare const useAgentRuntimeActiveSubagentToolCallId: () => string | null;
|
|
253
|
+
/** Latest history-compaction activity for the connected agent. */
|
|
254
|
+
export declare const useAgentRuntimeCompaction: () => AgentStreamCompactionPayload | null;
|
|
224
255
|
export declare const getAgentRuntimeState: () => AgentRuntimeStore;
|
|
225
256
|
export declare const subscribeToAgentRuntime: {
|
|
226
257
|
(listener: (selectedState: AgentRuntimeStore, previousSelectedState: AgentRuntimeStore) => void): () => void;
|
|
@@ -106,6 +106,8 @@ const initialWsState = {
|
|
|
106
106
|
wsState: 'closed',
|
|
107
107
|
approvals: [],
|
|
108
108
|
pendingApprovalCount: 0,
|
|
109
|
+
subagentActivity: {},
|
|
110
|
+
compaction: null,
|
|
109
111
|
contextSnapshot: null,
|
|
110
112
|
costUsage: null,
|
|
111
113
|
mcpStatus: null,
|
|
@@ -332,7 +334,7 @@ export const agentRuntimeStore = createStore()(subscribeWithSelector(persist((se
|
|
|
332
334
|
const agentBaseUrl = jupyterBaseUrl.replace('/jupyter/server/', '/agent-runtimes/');
|
|
333
335
|
const conn = {
|
|
334
336
|
podName: runtimePod.pod_name,
|
|
335
|
-
environmentName: runtimePod.
|
|
337
|
+
environmentName: runtimePod.environment.name,
|
|
336
338
|
jupyterBaseUrl,
|
|
337
339
|
agentBaseUrl,
|
|
338
340
|
status: 'ready',
|
|
@@ -400,6 +402,18 @@ export const agentRuntimeStore = createStore()(subscribeWithSelector(persist((se
|
|
|
400
402
|
codemodeStatus: payload.codemodeStatus ?? null,
|
|
401
403
|
fullContext: payload.fullContext ?? null,
|
|
402
404
|
})),
|
|
405
|
+
appendSubagentEvent: event => set(state => {
|
|
406
|
+
const key = event.toolCallId ?? event.subagentName;
|
|
407
|
+
const existing = state.subagentActivity[key] ?? [];
|
|
408
|
+
return {
|
|
409
|
+
subagentActivity: {
|
|
410
|
+
...state.subagentActivity,
|
|
411
|
+
[key]: [...existing, event],
|
|
412
|
+
},
|
|
413
|
+
};
|
|
414
|
+
}),
|
|
415
|
+
clearSubagentActivity: () => set({ subagentActivity: {} }),
|
|
416
|
+
setCompaction: payload => set({ compaction: payload }),
|
|
403
417
|
upsertApproval: approval => set(state => {
|
|
404
418
|
const filtered = state.approvals.filter(a => a.id !== approval.id);
|
|
405
419
|
const approvals = [approval, ...filtered];
|
|
@@ -738,6 +752,56 @@ export const useAgentRuntimeCostUsage = () => useAgentRuntimeStore(s => s.costUs
|
|
|
738
752
|
export const useAgentRuntimeCodemodeStatus = () => useAgentRuntimeStore(s => s.codemodeStatus);
|
|
739
753
|
export const useAgentRuntimeWsState = () => useAgentRuntimeStore(s => s.wsState);
|
|
740
754
|
export const useAgentRuntimeLoadedSkills = (agentId) => useAgentRuntimeStore(s => agentId ? (s.loadedSkillsByAgentId[agentId] ?? []) : []);
|
|
755
|
+
const EMPTY_SUBAGENT_EVENTS = [];
|
|
756
|
+
/** Live subagent activity for a given parent `delegate_task` tool call id. */
|
|
757
|
+
export const useAgentRuntimeSubagentActivity = (toolCallId) => useAgentRuntimeStore(s => toolCallId
|
|
758
|
+
? (s.subagentActivity[toolCallId] ?? EMPTY_SUBAGENT_EVENTS)
|
|
759
|
+
: EMPTY_SUBAGENT_EVENTS);
|
|
760
|
+
/**
|
|
761
|
+
* Live subagent activity resolved by tool-call id with a subagent-name
|
|
762
|
+
* fallback. The backend keys events by the parent run's `tool_call_id`, which
|
|
763
|
+
* can differ from the id surfaced in the chat transport stream; when the id
|
|
764
|
+
* misses we fall back to the most recent run for the named subagent.
|
|
765
|
+
*/
|
|
766
|
+
export const useAgentRuntimeSubagentActivityByToolCall = (toolCallId, subagentName) => useAgentRuntimeStore(s => {
|
|
767
|
+
if (toolCallId) {
|
|
768
|
+
const byId = s.subagentActivity[toolCallId];
|
|
769
|
+
if (byId && byId.length > 0)
|
|
770
|
+
return byId;
|
|
771
|
+
}
|
|
772
|
+
if (subagentName) {
|
|
773
|
+
const byNameKey = s.subagentActivity[subagentName];
|
|
774
|
+
if (byNameKey && byNameKey.length > 0)
|
|
775
|
+
return byNameKey;
|
|
776
|
+
let match;
|
|
777
|
+
for (const events of Object.values(s.subagentActivity)) {
|
|
778
|
+
if (events.length > 0 && events[0]?.subagentName === subagentName) {
|
|
779
|
+
match = events;
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
if (match)
|
|
783
|
+
return match;
|
|
784
|
+
}
|
|
785
|
+
return EMPTY_SUBAGENT_EVENTS;
|
|
786
|
+
});
|
|
787
|
+
/**
|
|
788
|
+
* Key of the currently active (running) subagent run, or `null` when none is
|
|
789
|
+
* active. A run is active while its event list has no `end`/`error` phase; when
|
|
790
|
+
* several are active the most recently started one wins.
|
|
791
|
+
*/
|
|
792
|
+
export const useAgentRuntimeActiveSubagentToolCallId = () => useAgentRuntimeStore(s => {
|
|
793
|
+
let activeKey = null;
|
|
794
|
+
for (const [key, events] of Object.entries(s.subagentActivity)) {
|
|
795
|
+
if (events.length === 0)
|
|
796
|
+
continue;
|
|
797
|
+
const done = events.some(e => e.phase === 'end' || e.phase === 'error');
|
|
798
|
+
if (!done)
|
|
799
|
+
activeKey = key;
|
|
800
|
+
}
|
|
801
|
+
return activeKey;
|
|
802
|
+
});
|
|
803
|
+
/** Latest history-compaction activity for the connected agent. */
|
|
804
|
+
export const useAgentRuntimeCompaction = () => useAgentRuntimeStore(s => s.compaction);
|
|
741
805
|
// ---------------------------------------------------------------------------
|
|
742
806
|
// Non-React access
|
|
743
807
|
// ---------------------------------------------------------------------------
|
package/lib/stores/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module store
|
|
5
5
|
*/
|
|
6
|
-
export { agentRuntimeStore, useAgentRuntimeStore, useAgentRuntimeConnection, useAgentRuntimeStatus, useAgentRuntimeError, useAgentRuntimeIsLaunching, useAgentRuntimeApprovals, useAgentRuntimePendingCount, useAgentRuntimeMcpStatus, useAgentRuntimeFullContext, useAgentRuntimeContextSnapshot, useAgentRuntimeCostUsage, useAgentRuntimeCodemodeStatus, useAgentRuntimeWsState, useAgentRuntimeLoadedSkills, getAgentRuntimeState, subscribeToAgentRuntime, type AgentRegistryEntry, type AgentRuntimeWsState, type AgentRuntimeStoreState, type AgentRuntimeStoreActions, type AgentRuntimeStore, } from './agentRuntimeStore';
|
|
6
|
+
export { agentRuntimeStore, useAgentRuntimeStore, useAgentRuntimeConnection, useAgentRuntimeStatus, useAgentRuntimeError, useAgentRuntimeIsLaunching, useAgentRuntimeApprovals, useAgentRuntimePendingCount, useAgentRuntimeMcpStatus, useAgentRuntimeFullContext, useAgentRuntimeContextSnapshot, useAgentRuntimeCostUsage, useAgentRuntimeCodemodeStatus, useAgentRuntimeWsState, useAgentRuntimeLoadedSkills, useAgentRuntimeActiveSubagentToolCallId, useAgentRuntimeSubagentActivity, useAgentRuntimeSubagentActivityByToolCall, useAgentRuntimeCompaction, getAgentRuntimeState, subscribeToAgentRuntime, type AgentRegistryEntry, type AgentRuntimeWsState, type AgentRuntimeStoreState, type AgentRuntimeStoreActions, type AgentRuntimeStore, } from './agentRuntimeStore';
|
|
7
7
|
export { useChatStore, useChatMessages, useChatLoading, useChatStreaming, useChatError, useChatTools, useChatOpen, useChatConfig, useChatReady, useChatInferenceProvider, useChatExtensionRegistry, defaultChatConfig, type ChatStore, type ChatState, type ChatActions, type ChatConfig, type ToolCallState, } from './chatStore';
|
|
8
8
|
export { useConversationStore, useConversationMessages, useNeedsFetch, useIsFetching, type ConversationStore, type ConversationData, } from './conversationStore';
|
package/lib/stores/index.js
CHANGED
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module store
|
|
9
9
|
*/
|
|
10
|
-
export { agentRuntimeStore, useAgentRuntimeStore, useAgentRuntimeConnection, useAgentRuntimeStatus, useAgentRuntimeError, useAgentRuntimeIsLaunching, useAgentRuntimeApprovals, useAgentRuntimePendingCount, useAgentRuntimeMcpStatus, useAgentRuntimeFullContext, useAgentRuntimeContextSnapshot, useAgentRuntimeCostUsage, useAgentRuntimeCodemodeStatus, useAgentRuntimeWsState, useAgentRuntimeLoadedSkills, getAgentRuntimeState, subscribeToAgentRuntime, } from './agentRuntimeStore';
|
|
10
|
+
export { agentRuntimeStore, useAgentRuntimeStore, useAgentRuntimeConnection, useAgentRuntimeStatus, useAgentRuntimeError, useAgentRuntimeIsLaunching, useAgentRuntimeApprovals, useAgentRuntimePendingCount, useAgentRuntimeMcpStatus, useAgentRuntimeFullContext, useAgentRuntimeContextSnapshot, useAgentRuntimeCostUsage, useAgentRuntimeCodemodeStatus, useAgentRuntimeWsState, useAgentRuntimeLoadedSkills, useAgentRuntimeActiveSubagentToolCallId, useAgentRuntimeSubagentActivity, useAgentRuntimeSubagentActivityByToolCall, useAgentRuntimeCompaction, getAgentRuntimeState, subscribeToAgentRuntime, } from './agentRuntimeStore';
|
|
11
11
|
export { useChatStore, useChatMessages, useChatLoading, useChatStreaming, useChatError, useChatTools, useChatOpen, useChatConfig, useChatReady, useChatInferenceProvider, useChatExtensionRegistry, defaultChatConfig, } from './chatStore';
|
|
12
12
|
export { useConversationStore, useConversationMessages, useNeedsFetch, useIsFetching, } from './conversationStore';
|
package/lib/types/agents.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface AgentRuntimeState {
|
|
|
30
30
|
/**
|
|
31
31
|
* Agent Runtime data type (mapped from runtimes service).
|
|
32
32
|
*
|
|
33
|
-
* Backend RuntimePod fields: pod_name,
|
|
33
|
+
* Backend RuntimePod fields: pod_name, environment{name,title,cpu,memory,gpu,resources}, uid,
|
|
34
34
|
* type, given_name, token, ingress, reservation_id, started_at, expired_at, burning_rate.
|
|
35
35
|
*
|
|
36
36
|
* We map `ingress` to `url` for consistency with the UI.
|
|
@@ -39,8 +39,14 @@ export type AgentRuntimeData = {
|
|
|
39
39
|
pod_name: string;
|
|
40
40
|
id: string;
|
|
41
41
|
name: string;
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
environment: {
|
|
43
|
+
name: string;
|
|
44
|
+
title?: string;
|
|
45
|
+
cpu?: string;
|
|
46
|
+
memory?: string;
|
|
47
|
+
gpu?: string;
|
|
48
|
+
resources?: Record<string, string>;
|
|
49
|
+
};
|
|
44
50
|
given_name: string;
|
|
45
51
|
type: string;
|
|
46
52
|
started_at?: string;
|
|
@@ -29,6 +29,8 @@ export interface Agentspec {
|
|
|
29
29
|
systemPromptCodemodeAddons?: string;
|
|
30
30
|
/** Tags for categorization */
|
|
31
31
|
tags: string[];
|
|
32
|
+
/** Domain used to group agents in the gallery */
|
|
33
|
+
domain?: string;
|
|
32
34
|
/** Whether the agent is enabled */
|
|
33
35
|
enabled: boolean;
|
|
34
36
|
/** AI model identifier to use for this agent */
|
package/lib/types/chat.d.ts
CHANGED
|
@@ -444,6 +444,8 @@ export interface ChatCommonProps {
|
|
|
444
444
|
codemodeStatusData?: import('./stream').CodemodeStatusData | null;
|
|
445
445
|
/** Optional sandbox status override for immediate UI updates. */
|
|
446
446
|
sandboxStatusData?: SandboxWsStatus | null;
|
|
447
|
+
/** Horizontal placement for the header kernel indicator. @default 'left' */
|
|
448
|
+
kernelIndicatorPlacement?: 'left' | 'center' | 'right';
|
|
447
449
|
/**
|
|
448
450
|
* Live kernel connection of the companion notebook/document sandbox.
|
|
449
451
|
* When provided, it is forwarded to the chat header's `<KernelIndicator>`
|
|
@@ -462,6 +464,10 @@ export interface ChatCommonProps {
|
|
|
462
464
|
kernelMemory?: string;
|
|
463
465
|
/** Optional GPU info displayed in the chat header's kernel indicator. */
|
|
464
466
|
kernelGpu?: string;
|
|
467
|
+
/** Optional theme variant override for companion notebook/document surfaces. */
|
|
468
|
+
themeVariant?: string;
|
|
469
|
+
/** Optional color mode override for companion notebook/document surfaces. */
|
|
470
|
+
colorMode?: 'light' | 'dark' | 'auto';
|
|
465
471
|
/**
|
|
466
472
|
* Disable ChatBase's internal JupyterReactTheme wrapper.
|
|
467
473
|
* Use this when the host page already provides a JupyterReactTheme boundary.
|
|
@@ -596,6 +602,8 @@ export interface ChatBaseProps {
|
|
|
596
602
|
headerActions?: React.ReactNode;
|
|
597
603
|
/** Notebook kernel indicator state override for the chat header. */
|
|
598
604
|
kernelIndicatorState?: import('@datalayer/jupyter-react').ExecutionState;
|
|
605
|
+
/** Horizontal placement for the header kernel indicator. @default 'left' */
|
|
606
|
+
kernelIndicatorPlacement?: 'left' | 'center' | 'right';
|
|
599
607
|
/**
|
|
600
608
|
* Live notebook kernel connection. When provided, the chat header
|
|
601
609
|
* renders the same `<KernelIndicator>` as the notebook toolbar so
|
|
@@ -616,6 +624,10 @@ export interface ChatBaseProps {
|
|
|
616
624
|
kernelMemory?: string;
|
|
617
625
|
/** Optional GPU info displayed in kernel indicator details. */
|
|
618
626
|
kernelGpu?: string;
|
|
627
|
+
/** Optional theme variant override for companion notebook/document surfaces. */
|
|
628
|
+
themeVariant?: string;
|
|
629
|
+
/** Optional color mode override for companion notebook/document surfaces. */
|
|
630
|
+
colorMode?: 'light' | 'dark' | 'auto';
|
|
619
631
|
/**
|
|
620
632
|
* Current chat view mode.
|
|
621
633
|
* When provided, a segmented view-mode toggle is rendered in the header
|
package/lib/types/models.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ export interface AIModel {
|
|
|
17
17
|
default: boolean;
|
|
18
18
|
/** Required environment variable names */
|
|
19
19
|
requiredEnvVars: string[];
|
|
20
|
+
/**
|
|
21
|
+
* Maximum output tokens the model can generate in a single run
|
|
22
|
+
* (maps to pydantic-ai output_tokens_limit).
|
|
23
|
+
*/
|
|
24
|
+
tokensLimit?: number;
|
|
20
25
|
}
|
|
21
26
|
/**
|
|
22
27
|
* Configuration for an AI model runtime (as returned by the server).
|
package/lib/types/stream.d.ts
CHANGED
|
@@ -1,7 +1,64 @@
|
|
|
1
1
|
import type { ContextSnapshotData } from './context';
|
|
2
2
|
import type { McpToolsetsStatusResponse } from './mcp';
|
|
3
3
|
import type { SkillStatus } from './skills';
|
|
4
|
-
export type AgentStreamEventType = 'agent.snapshot' | 'tool_approval_created' | 'tool_approval_approved' | 'tool_approval_rejected';
|
|
4
|
+
export type AgentStreamEventType = 'agent.snapshot' | 'agent.subagent' | 'agent.compaction' | 'tool_approval_created' | 'tool_approval_approved' | 'tool_approval_rejected';
|
|
5
|
+
/** Phase of a streamed history-compaction interaction. */
|
|
6
|
+
export type AgentCompactionPhase = 'start' | 'end';
|
|
7
|
+
/**
|
|
8
|
+
* History-compaction activity pushed on the agent's monitoring stream when the
|
|
9
|
+
* conversation is summarized to stay under the configured token budget. A
|
|
10
|
+
* `start` event precedes summarization; the matching `end` event reports the
|
|
11
|
+
* before/after token and message counts plus the elapsed time.
|
|
12
|
+
*/
|
|
13
|
+
export interface AgentStreamCompactionPayload {
|
|
14
|
+
/** Interaction phase. */
|
|
15
|
+
phase: AgentCompactionPhase;
|
|
16
|
+
/** Token ceiling driving compaction. */
|
|
17
|
+
budget: number;
|
|
18
|
+
/** Estimated history tokens before compaction. */
|
|
19
|
+
beforeTokens: number;
|
|
20
|
+
/** Estimated history tokens after compaction (`end`). */
|
|
21
|
+
afterTokens?: number;
|
|
22
|
+
/** Message count before compaction. */
|
|
23
|
+
beforeMessages: number;
|
|
24
|
+
/** Message count after compaction (`end`). */
|
|
25
|
+
afterMessages?: number;
|
|
26
|
+
/** Elapsed summarization time in milliseconds (`end`). */
|
|
27
|
+
durationMs?: number;
|
|
28
|
+
/** Cumulative number of compactions performed (`end`). */
|
|
29
|
+
compactionCount?: number;
|
|
30
|
+
/** Whether history was actually reduced (`end`). */
|
|
31
|
+
reduced?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** Phase of a streamed subagent interaction. */
|
|
34
|
+
export type AgentSubagentPhase = 'start' | 'text' | 'thinking' | 'tool_call' | 'tool_result' | 'end' | 'error';
|
|
35
|
+
/**
|
|
36
|
+
* Incremental subagent activity pushed on the parent agent's monitoring
|
|
37
|
+
* stream while a `delegate_task` call runs. Consumers key events by
|
|
38
|
+
* `toolCallId` (the parent delegation tool call) to render a live timeline.
|
|
39
|
+
*/
|
|
40
|
+
export interface AgentStreamSubagentPayload {
|
|
41
|
+
/** Name of the subagent producing the activity. */
|
|
42
|
+
subagentName: string;
|
|
43
|
+
/** Parent `delegate_task` tool call id, when resolvable. */
|
|
44
|
+
toolCallId?: string | null;
|
|
45
|
+
/** Interaction phase. */
|
|
46
|
+
phase: AgentSubagentPhase;
|
|
47
|
+
/** Delegated task description (`start`). */
|
|
48
|
+
task?: string;
|
|
49
|
+
/** Text or thinking delta (`text` / `thinking`). */
|
|
50
|
+
text?: string;
|
|
51
|
+
/** Tool name (`tool_call` / `tool_result`). */
|
|
52
|
+
toolName?: string;
|
|
53
|
+
/** Tool call arguments (`tool_call`). */
|
|
54
|
+
toolArgs?: Record<string, unknown>;
|
|
55
|
+
/** Tool result preview (`tool_result`). */
|
|
56
|
+
result?: string;
|
|
57
|
+
/** Final subagent output (`end`). */
|
|
58
|
+
output?: string;
|
|
59
|
+
/** Failure message (`error`). */
|
|
60
|
+
error?: string;
|
|
61
|
+
}
|
|
5
62
|
export interface AgentStreamMessage<TPayload = Record<string, unknown>> {
|
|
6
63
|
version: string;
|
|
7
64
|
type: AgentStreamEventType | string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datalayer/agent-runtimes",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
".",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"create:patches": "bash scripts/create-patches.sh",
|
|
70
70
|
"examples": "run-p server:start server:start:codemode jupyter:start examples:vite",
|
|
71
71
|
"examples2": "run-p server:start server:start:codemode jupyter:start examples2:vite",
|
|
72
|
-
"
|
|
72
|
+
"example-local": "make example-local",
|
|
73
73
|
"examples:fresh": "npm run clean:cache && npm run examples",
|
|
74
74
|
"examples:jupyter": "run-p jupyter:start server:start server:start:codemode examples:vite",
|
|
75
75
|
"examples:nextjs": "npm run dev --workspace=nextjs-notebook-example",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"start:agent": "run-p server:start start:agent:vite",
|
|
104
104
|
"start:agent:vite": "vite --open /html/agent.html",
|
|
105
105
|
"start:agent-node": "run-p server:start:agent-node jupyter:start start:agent-node:vite",
|
|
106
|
-
"start:agent-node:vite": "VITE_JUPYTER_SANDBOX_URL=${VITE_JUPYTER_SANDBOX_URL:-http://
|
|
106
|
+
"start:agent-node:vite": "VITE_JUPYTER_SANDBOX_URL=${VITE_JUPYTER_SANDBOX_URL:-http://0.0.0.0:8888/api/jupyter-server?token=60c1661cc408f978c309d04157af55c9588ff9557c9380e4fb50785750703da6} vite --open /html/agent-node.html",
|
|
107
107
|
"start:agent-notebook": "run-p server:start jupyter:start start:agent-notebook:vite",
|
|
108
108
|
"start:agent-notebook:vite": "vite --open /html/agent-notebook.html",
|
|
109
109
|
"start:agent-document": "run-p server:start jupyter:start start:agent-document:vite",
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
"playwright": "^1.53.2",
|
|
301
301
|
"prettier": "^3.6.2",
|
|
302
302
|
"react-router-dom": "^6.22.3",
|
|
303
|
-
"rimraf": "^6.
|
|
303
|
+
"rimraf": "^6.1.3",
|
|
304
304
|
"storybook": "^9.1.1",
|
|
305
305
|
"typedoc-plugin-markdown": "^4.0.0",
|
|
306
306
|
"typescript": "^5.8.3",
|
|
Binary file
|
|
@@ -367,12 +367,15 @@ from agent_runtimes.types import Agentspec, SubAgentspecConfig, SubAgentsConfig
|
|
|
367
367
|
)
|
|
368
368
|
subagents_str = "SubAgentsConfig(" + ", ".join(cfg_parts) + ")"
|
|
369
369
|
|
|
370
|
+
domain_value = spec.get("domain") or spec.get("vertical")
|
|
371
|
+
|
|
370
372
|
code += f'''{const_name} = Agentspec(
|
|
371
373
|
id="{full_agent_id}",
|
|
372
374
|
version="{version}",
|
|
373
375
|
name="{display_name}",
|
|
374
376
|
description="{description}",
|
|
375
377
|
tags={_fmt_list(spec.get("tags", []))},
|
|
378
|
+
domain={f'"{domain_value}"' if domain_value else "None"},
|
|
376
379
|
enabled={spec.get("enabled", True)},
|
|
377
380
|
model={model_str},
|
|
378
381
|
inference_provider={inference_provider_str},
|
|
@@ -836,6 +839,9 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
|
|
|
836
839
|
tags = spec.get("tags", [])
|
|
837
840
|
tags_str = "[" + ", ".join(f"'{t}'" for t in tags) + "]"
|
|
838
841
|
|
|
842
|
+
domain_val = spec.get("domain") or spec.get("vertical")
|
|
843
|
+
domain_ts = f"'{domain_val}'" if domain_val else "undefined"
|
|
844
|
+
|
|
839
845
|
suggestions = spec.get("suggestions", [])
|
|
840
846
|
# Escape single quotes in suggestions for TypeScript
|
|
841
847
|
escaped_suggestions = [s.replace("'", "\\'") for s in suggestions]
|
|
@@ -940,6 +946,7 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
|
|
|
940
946
|
name: '{display_name}',
|
|
941
947
|
description: `{description}`,
|
|
942
948
|
tags: {tags_str},
|
|
949
|
+
domain: {domain_ts},
|
|
943
950
|
enabled: {str(spec.get("enabled", True)).lower()},
|
|
944
951
|
model: {model_ts},
|
|
945
952
|
{inference_provider_line} mcpServers: [{mcp_servers_str}],
|