@datalayer/agent-runtimes 0.0.11 → 0.0.12

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.
Files changed (136) hide show
  1. package/README.md +2 -2
  2. package/lib/Agent.d.ts +29 -0
  3. package/lib/Agent.js +131 -0
  4. package/lib/AgentLexical.d.ts +34 -0
  5. package/lib/AgentLexical.js +296 -0
  6. package/lib/AgentNotebook.d.ts +19 -0
  7. package/lib/AgentNotebook.js +192 -0
  8. package/lib/agent-lexical-main.d.ts +1 -0
  9. package/lib/agent-lexical-main.js +11 -0
  10. package/lib/agent-main.d.ts +1 -0
  11. package/lib/agent-main.js +11 -0
  12. package/lib/agent-notebook-main.d.ts +1 -0
  13. package/lib/agent-notebook-main.js +12 -0
  14. package/lib/components/AgentConfiguration.d.ts +4 -22
  15. package/lib/components/AgentConfiguration.js +8 -8
  16. package/lib/components/chat/components/AgentDetails.d.ts +3 -1
  17. package/lib/components/chat/components/AgentDetails.js +6 -6
  18. package/lib/components/chat/components/Chat.d.ts +29 -3
  19. package/lib/components/chat/components/Chat.js +64 -59
  20. package/lib/components/chat/components/ChatFloating.d.ts +34 -12
  21. package/lib/components/chat/components/ChatFloating.js +54 -21
  22. package/lib/components/chat/components/ChatInline.d.ts +5 -1
  23. package/lib/components/chat/components/ChatInline.js +8 -1
  24. package/lib/components/chat/components/ChatSidebar.d.ts +6 -1
  25. package/lib/components/chat/components/ChatSidebar.js +2 -2
  26. package/lib/components/chat/components/ChatStandalone.d.ts +6 -1
  27. package/lib/components/chat/components/ChatStandalone.js +2 -2
  28. package/lib/components/chat/components/base/ChatBase.d.ts +49 -8
  29. package/lib/components/chat/components/base/ChatBase.js +544 -149
  30. package/lib/components/chat/components/base/InputPrompt.d.ts +42 -0
  31. package/lib/components/chat/components/base/InputPrompt.js +131 -0
  32. package/lib/components/chat/components/index.d.ts +3 -3
  33. package/lib/components/chat/components/index.js +1 -1
  34. package/lib/components/chat/components/parts/ReasoningPart.js +2 -4
  35. package/lib/components/chat/components/parts/TextPart.js +2 -70
  36. package/lib/components/chat/components/styles/streamdownStyles.d.ts +23 -0
  37. package/lib/components/chat/components/styles/streamdownStyles.js +319 -0
  38. package/lib/components/chat/index.d.ts +1 -1
  39. package/lib/components/chat/index.js +1 -1
  40. package/lib/components/chat/inference/DatalayerInferenceProvider.js +16 -12
  41. package/lib/components/chat/inference/SelfHostedInferenceProvider.js +16 -12
  42. package/lib/components/chat/protocols/AGUIAdapter.d.ts +10 -3
  43. package/lib/components/chat/protocols/AGUIAdapter.js +123 -44
  44. package/lib/components/chat/types/tool.d.ts +5 -2
  45. package/lib/components/index.d.ts +1 -18
  46. package/lib/components/index.js +0 -9
  47. package/lib/config/index.d.ts +0 -4
  48. package/lib/config/index.js +0 -4
  49. package/lib/examples/A2UiRestaurantExample.js +1 -1
  50. package/lib/examples/AgentRuntimeChatExample.d.ts +15 -0
  51. package/lib/examples/AgentRuntimeChatExample.js +126 -0
  52. package/lib/examples/{AgentSpaceFormExample.d.ts → AgentRuntimeFormExample.d.ts} +3 -3
  53. package/lib/examples/{AgentSpaceFormExample.js → AgentRuntimeFormExample.js} +10 -8
  54. package/lib/examples/AgentRuntimeLexicalExample.js +6 -3
  55. package/lib/examples/AgentRuntimeLexicalSidebarExample.js +8 -1
  56. package/lib/examples/AgentRuntimeNotebookExample.js +6 -5
  57. package/lib/examples/CopilotKitNotebookExample.js +2 -2
  58. package/lib/examples/JupyterNotebookExample.js +2 -2
  59. package/lib/{components → examples/components}/Header.d.ts +2 -1
  60. package/lib/{components → examples/components}/HeaderControls.js +1 -1
  61. package/lib/{components → examples/components}/LexicalEditor.d.ts +6 -1
  62. package/lib/{components → examples/components}/LexicalEditor.js +4 -4
  63. package/lib/{components → examples/components}/MainContent.d.ts +1 -1
  64. package/lib/{components → examples/components}/MainContent.js +7 -5
  65. package/lib/examples/components/index.d.ts +16 -0
  66. package/lib/examples/components/index.js +13 -0
  67. package/lib/examples/example-selector.js +2 -1
  68. package/lib/examples/index.d.ts +1 -1
  69. package/lib/examples/index.js +1 -1
  70. package/lib/examples/main.js +2 -2
  71. package/lib/examples/stores/examplesStore.d.ts +2 -23
  72. package/lib/index.d.ts +2 -1
  73. package/lib/index.js +1 -0
  74. package/lib/lexical/ChatInlinePlugin.d.ts +13 -2
  75. package/lib/lexical/ChatInlinePlugin.js +41 -179
  76. package/lib/lexical/index.d.ts +1 -0
  77. package/lib/lexical/index.js +1 -0
  78. package/lib/lexical/useChatInlineToolbarItems.d.ts +28 -0
  79. package/lib/lexical/useChatInlineToolbarItems.js +163 -0
  80. package/lib/runtime/useAgentRuntime.d.ts +1 -1
  81. package/lib/runtime/useAgentRuntime.js +1 -1
  82. package/lib/{config/agents/code-ai → specs/agents/codeai}/agents.d.ts +5 -2
  83. package/lib/specs/agents/codeai/agents.js +151 -0
  84. package/lib/{config → specs}/agents/codemode-paper/agents.d.ts +4 -2
  85. package/lib/{config → specs}/agents/codemode-paper/agents.js +39 -19
  86. package/lib/{config → specs}/agents/datalayer-ai/agents.d.ts +4 -2
  87. package/lib/{config → specs}/agents/datalayer-ai/agents.js +17 -2
  88. package/lib/{config → specs}/agents/index.d.ts +3 -1
  89. package/lib/{config → specs}/agents/index.js +12 -3
  90. package/lib/{config → specs}/envvars.d.ts +1 -0
  91. package/lib/{config → specs}/envvars.js +10 -0
  92. package/lib/specs/index.d.ts +5 -0
  93. package/lib/specs/index.js +9 -0
  94. package/lib/{config → specs}/mcpServers.d.ts +2 -1
  95. package/lib/{config → specs}/mcpServers.js +23 -1
  96. package/lib/specs/models.d.ts +68 -0
  97. package/lib/specs/models.js +239 -0
  98. package/lib/state/substates/AIAgentState.d.ts +0 -1
  99. package/lib/tools/adapters/agent-runtimes/AgentRuntimesToolAdapter.d.ts +11 -22
  100. package/lib/tools/adapters/agent-runtimes/AgentRuntimesToolAdapter.js +5 -5
  101. package/lib/tools/adapters/agent-runtimes/lexicalHooks.d.ts +6 -6
  102. package/lib/tools/adapters/agent-runtimes/lexicalHooks.js +4 -4
  103. package/lib/tools/adapters/agent-runtimes/notebookHooks.d.ts +6 -6
  104. package/lib/tools/adapters/agent-runtimes/notebookHooks.js +4 -4
  105. package/lib/{types.d.ts → types/Types.d.ts} +32 -6
  106. package/lib/types/index.d.ts +1 -0
  107. package/lib/types/index.js +1 -0
  108. package/package.json +11 -5
  109. package/scripts/codegen/generate_agents.py +53 -13
  110. package/scripts/codegen/generate_envvars.py +1 -1
  111. package/scripts/codegen/generate_mcp_servers.py +5 -5
  112. package/scripts/codegen/generate_models.py +486 -0
  113. package/scripts/codegen/generate_skills.py +2 -2
  114. package/style/primer-primitives.css +22 -0
  115. package/lib/components/chat/components/elements/ChatInputPrompt.d.ts +0 -37
  116. package/lib/components/chat/components/elements/ChatInputPrompt.js +0 -150
  117. package/lib/config/agents/code-ai/agents.js +0 -70
  118. /package/lib/{components → examples/components}/FooterMetrics.d.ts +0 -0
  119. /package/lib/{components → examples/components}/FooterMetrics.js +0 -0
  120. /package/lib/{components → examples/components}/Header.js +0 -0
  121. /package/lib/{components → examples/components}/HeaderControls.d.ts +0 -0
  122. /package/lib/{components → examples/components}/MockFileBrowser.d.ts +0 -0
  123. /package/lib/{components → examples/components}/MockFileBrowser.js +0 -0
  124. /package/lib/{components → examples/components}/SessionTabs.d.ts +0 -0
  125. /package/lib/{components → examples/components}/SessionTabs.js +0 -0
  126. /package/lib/{components → examples/components}/TimeTravel.d.ts +0 -0
  127. /package/lib/{components → examples/components}/TimeTravel.js +0 -0
  128. /package/lib/{config/agents/code-ai → specs/agents/codeai}/index.d.ts +0 -0
  129. /package/lib/{config/agents/code-ai → specs/agents/codeai}/index.js +0 -0
  130. /package/lib/{config → specs}/agents/codemode-paper/index.d.ts +0 -0
  131. /package/lib/{config → specs}/agents/codemode-paper/index.js +0 -0
  132. /package/lib/{config → specs}/agents/datalayer-ai/index.d.ts +0 -0
  133. /package/lib/{config → specs}/agents/datalayer-ai/index.js +0 -0
  134. /package/lib/{config → specs}/skills.d.ts +0 -0
  135. /package/lib/{config → specs}/skills.js +0 -0
  136. /package/lib/{types.js → types/Types.js} +0 -0
@@ -0,0 +1,68 @@
1
+ /**
2
+ * AI Model Catalog
3
+ *
4
+ * Predefined AI model configurations.
5
+ *
6
+ * This file is AUTO-GENERATED from YAML specifications.
7
+ * DO NOT EDIT MANUALLY - run 'make specs' to regenerate.
8
+ */
9
+ export interface AIModel {
10
+ /** Unique model identifier (e.g., 'anthropic:claude-sonnet-4-5-20250514') */
11
+ id: string;
12
+ /** Display name for the model */
13
+ name: string;
14
+ /** Model description */
15
+ description: string;
16
+ /** Provider name (anthropic, openai, bedrock, azure-openai) */
17
+ provider: string;
18
+ /** Whether this is the default model */
19
+ default: boolean;
20
+ /** Required environment variable names */
21
+ requiredEnvVars: string[];
22
+ }
23
+ export declare const AIModels: {
24
+ readonly ANTHROPIC_CLAUDE_3_5_HAIKU_20241022: "anthropic:claude-3-5-haiku-20241022";
25
+ readonly ANTHROPIC_CLAUDE_OPUS_4_20250514: "anthropic:claude-opus-4-20250514";
26
+ readonly ANTHROPIC_CLAUDE_SONNET_4_5_20250514: "anthropic:claude-sonnet-4-5-20250514";
27
+ readonly ANTHROPIC_CLAUDE_SONNET_4_20250514: "anthropic:claude-sonnet-4-20250514";
28
+ readonly AZURE_OPENAI_GPT_4_1_MINI: "azure-openai:gpt-4.1-mini";
29
+ readonly AZURE_OPENAI_GPT_4_1_NANO: "azure-openai:gpt-4.1-nano";
30
+ readonly AZURE_OPENAI_GPT_4_1: "azure-openai:gpt-4.1";
31
+ readonly AZURE_OPENAI_GPT_4O_MINI: "azure-openai:gpt-4o-mini";
32
+ readonly AZURE_OPENAI_GPT_4O: "azure-openai:gpt-4o";
33
+ readonly BEDROCK_US_ANTHROPIC_CLAUDE_3_5_HAIKU_20241022_V1_0: "bedrock:us.anthropic.claude-3-5-haiku-20241022-v1:0";
34
+ readonly BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_6_V1_0: "bedrock:us.anthropic.claude-opus-4-6-v1:0";
35
+ readonly BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0: "bedrock:us.anthropic.claude-opus-4-20250514-v1:0";
36
+ readonly BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0: "bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0";
37
+ readonly BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0: "bedrock:us.anthropic.claude-sonnet-4-20250514-v1:0";
38
+ readonly OPENAI_GPT_4_1_MINI: "openai:gpt-4.1-mini";
39
+ readonly OPENAI_GPT_4_1_NANO: "openai:gpt-4.1-nano";
40
+ readonly OPENAI_GPT_4_1: "openai:gpt-4.1";
41
+ readonly OPENAI_GPT_4O_MINI: "openai:gpt-4o-mini";
42
+ readonly OPENAI_GPT_4O: "openai:gpt-4o";
43
+ readonly OPENAI_O3_MINI: "openai:o3-mini";
44
+ };
45
+ export type AIModelId = (typeof AIModels)[keyof typeof AIModels];
46
+ export declare const ANTHROPIC_CLAUDE_3_5_HAIKU_20241022: AIModel;
47
+ export declare const ANTHROPIC_CLAUDE_OPUS_4_20250514: AIModel;
48
+ export declare const ANTHROPIC_CLAUDE_SONNET_4_5_20250514: AIModel;
49
+ export declare const ANTHROPIC_CLAUDE_SONNET_4_20250514: AIModel;
50
+ export declare const AZURE_OPENAI_GPT_4_1_MINI: AIModel;
51
+ export declare const AZURE_OPENAI_GPT_4_1_NANO: AIModel;
52
+ export declare const AZURE_OPENAI_GPT_4_1: AIModel;
53
+ export declare const AZURE_OPENAI_GPT_4O_MINI: AIModel;
54
+ export declare const AZURE_OPENAI_GPT_4O: AIModel;
55
+ export declare const BEDROCK_US_ANTHROPIC_CLAUDE_3_5_HAIKU_20241022_V1_0: AIModel;
56
+ export declare const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_6_V1_0: AIModel;
57
+ export declare const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0: AIModel;
58
+ export declare const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0: AIModel;
59
+ export declare const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0: AIModel;
60
+ export declare const OPENAI_GPT_4_1_MINI: AIModel;
61
+ export declare const OPENAI_GPT_4_1_NANO: AIModel;
62
+ export declare const OPENAI_GPT_4_1: AIModel;
63
+ export declare const OPENAI_GPT_4O_MINI: AIModel;
64
+ export declare const OPENAI_GPT_4O: AIModel;
65
+ export declare const OPENAI_O3_MINI: AIModel;
66
+ export declare const AI_MODEL_CATALOGUE: Record<string, AIModel>;
67
+ export declare const DEFAULT_MODEL: AIModelId;
68
+ export declare const DEFAULT_MODEL_SPEC: AIModel;
@@ -0,0 +1,239 @@
1
+ /*
2
+ * Copyright (c) 2025-2026 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ // ============================================================================
6
+ // AIModels Enum
7
+ // ============================================================================
8
+ export const AIModels = {
9
+ ANTHROPIC_CLAUDE_3_5_HAIKU_20241022: 'anthropic:claude-3-5-haiku-20241022',
10
+ ANTHROPIC_CLAUDE_OPUS_4_20250514: 'anthropic:claude-opus-4-20250514',
11
+ ANTHROPIC_CLAUDE_SONNET_4_5_20250514: 'anthropic:claude-sonnet-4-5-20250514',
12
+ ANTHROPIC_CLAUDE_SONNET_4_20250514: 'anthropic:claude-sonnet-4-20250514',
13
+ AZURE_OPENAI_GPT_4_1_MINI: 'azure-openai:gpt-4.1-mini',
14
+ AZURE_OPENAI_GPT_4_1_NANO: 'azure-openai:gpt-4.1-nano',
15
+ AZURE_OPENAI_GPT_4_1: 'azure-openai:gpt-4.1',
16
+ AZURE_OPENAI_GPT_4O_MINI: 'azure-openai:gpt-4o-mini',
17
+ AZURE_OPENAI_GPT_4O: 'azure-openai:gpt-4o',
18
+ BEDROCK_US_ANTHROPIC_CLAUDE_3_5_HAIKU_20241022_V1_0: 'bedrock:us.anthropic.claude-3-5-haiku-20241022-v1:0',
19
+ BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_6_V1_0: 'bedrock:us.anthropic.claude-opus-4-6-v1:0',
20
+ BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0: 'bedrock:us.anthropic.claude-opus-4-20250514-v1:0',
21
+ BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
22
+ BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0: 'bedrock:us.anthropic.claude-sonnet-4-20250514-v1:0',
23
+ OPENAI_GPT_4_1_MINI: 'openai:gpt-4.1-mini',
24
+ OPENAI_GPT_4_1_NANO: 'openai:gpt-4.1-nano',
25
+ OPENAI_GPT_4_1: 'openai:gpt-4.1',
26
+ OPENAI_GPT_4O_MINI: 'openai:gpt-4o-mini',
27
+ OPENAI_GPT_4O: 'openai:gpt-4o',
28
+ OPENAI_O3_MINI: 'openai:o3-mini',
29
+ };
30
+ // ============================================================================
31
+ // AI Model Definitions
32
+ // ============================================================================
33
+ export const ANTHROPIC_CLAUDE_3_5_HAIKU_20241022 = {
34
+ id: 'anthropic:claude-3-5-haiku-20241022',
35
+ name: 'Anthropic Claude Haiku 3.5',
36
+ description: 'Claude Haiku 3.5 by Anthropic - fast and efficient',
37
+ provider: 'anthropic',
38
+ default: false,
39
+ requiredEnvVars: ['ANTHROPIC_API_KEY'],
40
+ };
41
+ export const ANTHROPIC_CLAUDE_OPUS_4_20250514 = {
42
+ id: 'anthropic:claude-opus-4-20250514',
43
+ name: 'Anthropic Claude Opus 4',
44
+ description: 'Claude Opus 4 by Anthropic - highest capability model',
45
+ provider: 'anthropic',
46
+ default: false,
47
+ requiredEnvVars: ['ANTHROPIC_API_KEY'],
48
+ };
49
+ export const ANTHROPIC_CLAUDE_SONNET_4_5_20250514 = {
50
+ id: 'anthropic:claude-sonnet-4-5-20250514',
51
+ name: 'Anthropic Claude Sonnet 4.5',
52
+ description: 'Claude Sonnet 4.5 by Anthropic - balanced performance and speed',
53
+ provider: 'anthropic',
54
+ default: false,
55
+ requiredEnvVars: ['ANTHROPIC_API_KEY'],
56
+ };
57
+ export const ANTHROPIC_CLAUDE_SONNET_4_20250514 = {
58
+ id: 'anthropic:claude-sonnet-4-20250514',
59
+ name: 'Anthropic Claude Sonnet 4',
60
+ description: 'Claude Sonnet 4 by Anthropic - strong reasoning and coding',
61
+ provider: 'anthropic',
62
+ default: false,
63
+ requiredEnvVars: ['ANTHROPIC_API_KEY'],
64
+ };
65
+ export const AZURE_OPENAI_GPT_4_1_MINI = {
66
+ id: 'azure-openai:gpt-4.1-mini',
67
+ name: 'Azure OpenAI GPT-4.1 Mini',
68
+ description: 'GPT-4.1 Mini via Azure OpenAI - compact version',
69
+ provider: 'azure-openai',
70
+ default: false,
71
+ requiredEnvVars: ['AZURE_OPENAI_API_KEY', 'AZURE_OPENAI_ENDPOINT'],
72
+ };
73
+ export const AZURE_OPENAI_GPT_4_1_NANO = {
74
+ id: 'azure-openai:gpt-4.1-nano',
75
+ name: 'Azure OpenAI GPT-4.1 Nano',
76
+ description: 'GPT-4.1 Nano via Azure OpenAI - smallest and fastest',
77
+ provider: 'azure-openai',
78
+ default: false,
79
+ requiredEnvVars: ['AZURE_OPENAI_API_KEY', 'AZURE_OPENAI_ENDPOINT'],
80
+ };
81
+ export const AZURE_OPENAI_GPT_4_1 = {
82
+ id: 'azure-openai:gpt-4.1',
83
+ name: 'Azure OpenAI GPT-4.1',
84
+ description: 'GPT-4.1 via Azure OpenAI - strong general purpose',
85
+ provider: 'azure-openai',
86
+ default: false,
87
+ requiredEnvVars: ['AZURE_OPENAI_API_KEY', 'AZURE_OPENAI_ENDPOINT'],
88
+ };
89
+ export const AZURE_OPENAI_GPT_4O_MINI = {
90
+ id: 'azure-openai:gpt-4o-mini',
91
+ name: 'Azure OpenAI GPT-4o Mini',
92
+ description: 'GPT-4o Mini via Azure OpenAI - compact enterprise deployment',
93
+ provider: 'azure-openai',
94
+ default: false,
95
+ requiredEnvVars: ['AZURE_OPENAI_API_KEY', 'AZURE_OPENAI_ENDPOINT'],
96
+ };
97
+ export const AZURE_OPENAI_GPT_4O = {
98
+ id: 'azure-openai:gpt-4o',
99
+ name: 'Azure OpenAI GPT-4o',
100
+ description: 'GPT-4o via Azure OpenAI - enterprise deployment',
101
+ provider: 'azure-openai',
102
+ default: false,
103
+ requiredEnvVars: ['AZURE_OPENAI_API_KEY', 'AZURE_OPENAI_ENDPOINT'],
104
+ };
105
+ export const BEDROCK_US_ANTHROPIC_CLAUDE_3_5_HAIKU_20241022_V1_0 = {
106
+ id: 'bedrock:us.anthropic.claude-3-5-haiku-20241022-v1:0',
107
+ name: 'Bedrock Claude Haiku 3.5',
108
+ description: 'Claude Haiku 3.5 via AWS Bedrock - fast and efficient',
109
+ provider: 'bedrock',
110
+ default: false,
111
+ requiredEnvVars: [
112
+ 'AWS_ACCESS_KEY_ID',
113
+ 'AWS_SECRET_ACCESS_KEY',
114
+ 'AWS_DEFAULT_REGION',
115
+ ],
116
+ };
117
+ export const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_6_V1_0 = {
118
+ id: 'bedrock:us.anthropic.claude-opus-4-6-v1:0',
119
+ name: 'Bedrock Claude Opus 4.6',
120
+ description: 'Claude Opus 4.6 via AWS Bedrock - latest flagship model',
121
+ provider: 'bedrock',
122
+ default: false,
123
+ requiredEnvVars: [
124
+ 'AWS_ACCESS_KEY_ID',
125
+ 'AWS_SECRET_ACCESS_KEY',
126
+ 'AWS_DEFAULT_REGION',
127
+ ],
128
+ };
129
+ export const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0 = {
130
+ id: 'bedrock:us.anthropic.claude-opus-4-20250514-v1:0',
131
+ name: 'Bedrock Claude Opus 4',
132
+ description: 'Claude Opus 4 via AWS Bedrock - highest capability',
133
+ provider: 'bedrock',
134
+ default: false,
135
+ requiredEnvVars: [
136
+ 'AWS_ACCESS_KEY_ID',
137
+ 'AWS_SECRET_ACCESS_KEY',
138
+ 'AWS_DEFAULT_REGION',
139
+ ],
140
+ };
141
+ export const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0 = {
142
+ id: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
143
+ name: 'Bedrock Claude Sonnet 4.5',
144
+ description: 'Claude Sonnet 4.5 via AWS Bedrock - balanced performance',
145
+ provider: 'bedrock',
146
+ default: true,
147
+ requiredEnvVars: [
148
+ 'AWS_ACCESS_KEY_ID',
149
+ 'AWS_SECRET_ACCESS_KEY',
150
+ 'AWS_DEFAULT_REGION',
151
+ ],
152
+ };
153
+ export const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0 = {
154
+ id: 'bedrock:us.anthropic.claude-sonnet-4-20250514-v1:0',
155
+ name: 'Bedrock Claude Sonnet 4',
156
+ description: 'Claude Sonnet 4 via AWS Bedrock - strong reasoning',
157
+ provider: 'bedrock',
158
+ default: false,
159
+ requiredEnvVars: [
160
+ 'AWS_ACCESS_KEY_ID',
161
+ 'AWS_SECRET_ACCESS_KEY',
162
+ 'AWS_DEFAULT_REGION',
163
+ ],
164
+ };
165
+ export const OPENAI_GPT_4_1_MINI = {
166
+ id: 'openai:gpt-4.1-mini',
167
+ name: 'OpenAI GPT-4.1 Mini',
168
+ description: 'GPT-4.1 Mini by OpenAI - compact version of GPT-4.1',
169
+ provider: 'openai',
170
+ default: false,
171
+ requiredEnvVars: ['OPENAI_API_KEY'],
172
+ };
173
+ export const OPENAI_GPT_4_1_NANO = {
174
+ id: 'openai:gpt-4.1-nano',
175
+ name: 'OpenAI GPT-4.1 Nano',
176
+ description: 'GPT-4.1 Nano by OpenAI - smallest and fastest',
177
+ provider: 'openai',
178
+ default: false,
179
+ requiredEnvVars: ['OPENAI_API_KEY'],
180
+ };
181
+ export const OPENAI_GPT_4_1 = {
182
+ id: 'openai:gpt-4.1',
183
+ name: 'OpenAI GPT-4.1',
184
+ description: 'GPT-4.1 by OpenAI - strong general purpose model',
185
+ provider: 'openai',
186
+ default: false,
187
+ requiredEnvVars: ['OPENAI_API_KEY'],
188
+ };
189
+ export const OPENAI_GPT_4O_MINI = {
190
+ id: 'openai:gpt-4o-mini',
191
+ name: 'OpenAI GPT-4o Mini',
192
+ description: 'GPT-4o Mini by OpenAI - compact and cost-effective',
193
+ provider: 'openai',
194
+ default: false,
195
+ requiredEnvVars: ['OPENAI_API_KEY'],
196
+ };
197
+ export const OPENAI_GPT_4O = {
198
+ id: 'openai:gpt-4o',
199
+ name: 'OpenAI GPT-4o',
200
+ description: 'GPT-4o by OpenAI - fast multimodal model',
201
+ provider: 'openai',
202
+ default: false,
203
+ requiredEnvVars: ['OPENAI_API_KEY'],
204
+ };
205
+ export const OPENAI_O3_MINI = {
206
+ id: 'openai:o3-mini',
207
+ name: 'OpenAI o3 Mini',
208
+ description: 'o3 Mini by OpenAI - reasoning-focused compact model',
209
+ provider: 'openai',
210
+ default: false,
211
+ requiredEnvVars: ['OPENAI_API_KEY'],
212
+ };
213
+ // ============================================================================
214
+ // AI Model Catalog
215
+ // ============================================================================
216
+ export const AI_MODEL_CATALOGUE = {
217
+ 'anthropic:claude-3-5-haiku-20241022': ANTHROPIC_CLAUDE_3_5_HAIKU_20241022,
218
+ 'anthropic:claude-opus-4-20250514': ANTHROPIC_CLAUDE_OPUS_4_20250514,
219
+ 'anthropic:claude-sonnet-4-5-20250514': ANTHROPIC_CLAUDE_SONNET_4_5_20250514,
220
+ 'anthropic:claude-sonnet-4-20250514': ANTHROPIC_CLAUDE_SONNET_4_20250514,
221
+ 'azure-openai:gpt-4.1-mini': AZURE_OPENAI_GPT_4_1_MINI,
222
+ 'azure-openai:gpt-4.1-nano': AZURE_OPENAI_GPT_4_1_NANO,
223
+ 'azure-openai:gpt-4.1': AZURE_OPENAI_GPT_4_1,
224
+ 'azure-openai:gpt-4o-mini': AZURE_OPENAI_GPT_4O_MINI,
225
+ 'azure-openai:gpt-4o': AZURE_OPENAI_GPT_4O,
226
+ 'bedrock:us.anthropic.claude-3-5-haiku-20241022-v1:0': BEDROCK_US_ANTHROPIC_CLAUDE_3_5_HAIKU_20241022_V1_0,
227
+ 'bedrock:us.anthropic.claude-opus-4-6-v1:0': BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_6_V1_0,
228
+ 'bedrock:us.anthropic.claude-opus-4-20250514-v1:0': BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0,
229
+ 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0': BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0,
230
+ 'bedrock:us.anthropic.claude-sonnet-4-20250514-v1:0': BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0,
231
+ 'openai:gpt-4.1-mini': OPENAI_GPT_4_1_MINI,
232
+ 'openai:gpt-4.1-nano': OPENAI_GPT_4_1_NANO,
233
+ 'openai:gpt-4.1': OPENAI_GPT_4_1,
234
+ 'openai:gpt-4o-mini': OPENAI_GPT_4O_MINI,
235
+ 'openai:gpt-4o': OPENAI_GPT_4O,
236
+ 'openai:o3-mini': OPENAI_O3_MINI,
237
+ };
238
+ export const DEFAULT_MODEL = AIModels.BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0;
239
+ export const DEFAULT_MODEL_SPEC = BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0;
@@ -1,6 +1,5 @@
1
1
  import type { Transport } from '../../components/chat/components/Chat';
2
2
  export type AgentStatus = 'running' | 'paused' | 'initializing' | 'error';
3
- export type { Transport };
4
3
  /**
5
4
  * Unified Agent model combining runtime tracking and UI state
6
5
  */
@@ -1,40 +1,29 @@
1
1
  /**
2
- * Converts unified tool definitions to agent-runtimes ChatFloating tools format.
2
+ * Converts unified tool definitions to FrontendToolDefinition format
3
+ * for use with Chat, ChatFloating, and ChatBase components.
3
4
  *
4
- * This adapter enables integration with the ChatFloating component's built-in
5
- * tool handling via the AG-UI protocol.
5
+ * This adapter enables integration with the chat components' frontendTools prop
6
+ * via the AG-UI protocol.
6
7
  *
7
8
  * @module tools/adapters/agent-runtimes/AgentRuntimesToolAdapter
8
9
  */
9
10
  import type { ToolDefinition, ToolOperation, ToolExecutionContext } from '@datalayer/jupyter-react';
11
+ import type { FrontendToolDefinition } from '../../../components/chat/types/tool';
10
12
  /**
11
- * Agent-runtimes tool definition (matches ChatFloating tools prop)
12
- */
13
- export interface AgentRuntimesTool {
14
- /** Tool name */
15
- name: string;
16
- /** Description for AI model */
17
- description: string;
18
- /** Parameters (JSON Schema format) */
19
- parameters?: Record<string, unknown>;
20
- /** Handler function */
21
- handler: (args: unknown) => Promise<unknown>;
22
- }
23
- /**
24
- * Converts unified tool definition to agent-runtimes tool format
13
+ * Converts unified tool definition to FrontendToolDefinition format
25
14
  *
26
15
  * @param definition - Tool definition
27
16
  * @param operation - Core operation
28
17
  * @param context - Execution context (documentId + executor)
29
- * @returns Agent-runtimes tool
18
+ * @returns FrontendToolDefinition
30
19
  */
31
- export declare function createAgentRuntimesTool(definition: ToolDefinition, operation: ToolOperation<unknown, unknown>, context: ToolExecutionContext): AgentRuntimesTool;
20
+ export declare function createAgentRuntimesTool(definition: ToolDefinition, operation: ToolOperation<unknown, unknown>, context: ToolExecutionContext): FrontendToolDefinition;
32
21
  /**
33
- * Creates agent-runtimes tools from all tool definitions
22
+ * Creates FrontendToolDefinition[] from all tool definitions
34
23
  *
35
24
  * @param definitions - Tool definitions
36
25
  * @param operations - Core operations registry
37
26
  * @param context - Execution context (documentId + executor)
38
- * @returns Agent-runtimes tools array
27
+ * @returns FrontendToolDefinition array
39
28
  */
40
- export declare function createAllAgentRuntimesTools(definitions: ToolDefinition[], operations: Record<string, ToolOperation<unknown, unknown>>, context: ToolExecutionContext): AgentRuntimesTool[];
29
+ export declare function createAllAgentRuntimesTools(definitions: ToolDefinition[], operations: Record<string, ToolOperation<unknown, unknown>>, context: ToolExecutionContext): FrontendToolDefinition[];
@@ -67,12 +67,12 @@ function processParameters(params) {
67
67
  return processed;
68
68
  }
69
69
  /**
70
- * Converts unified tool definition to agent-runtimes tool format
70
+ * Converts unified tool definition to FrontendToolDefinition format
71
71
  *
72
72
  * @param definition - Tool definition
73
73
  * @param operation - Core operation
74
74
  * @param context - Execution context (documentId + executor)
75
- * @returns Agent-runtimes tool
75
+ * @returns FrontendToolDefinition
76
76
  */
77
77
  export function createAgentRuntimesTool(definition, operation, context) {
78
78
  // Create runner instance for this tool
@@ -118,12 +118,12 @@ export function createAgentRuntimesTool(definition, operation, context) {
118
118
  };
119
119
  }
120
120
  /**
121
- * Creates agent-runtimes tools from all tool definitions
121
+ * Creates FrontendToolDefinition[] from all tool definitions
122
122
  *
123
123
  * @param definitions - Tool definitions
124
124
  * @param operations - Core operations registry
125
125
  * @param context - Execution context (documentId + executor)
126
- * @returns Agent-runtimes tools array
126
+ * @returns FrontendToolDefinition array
127
127
  */
128
128
  export function createAllAgentRuntimesTools(definitions, operations, context) {
129
129
  const tools = [];
@@ -136,6 +136,6 @@ export function createAllAgentRuntimesTools(definitions, operations, context) {
136
136
  const tool = createAgentRuntimesTool(definition, operation, context);
137
137
  tools.push(tool);
138
138
  }
139
- console.log(`[agent-runtimes Tools] Created ${tools.length} agent-runtimes tools`);
139
+ console.log(`[agent-runtimes Tools] Created ${tools.length} frontend tools`);
140
140
  return tools;
141
141
  }
@@ -5,26 +5,26 @@
5
5
  * @module tools/adapters/agent-runtimes/lexicalHooks
6
6
  */
7
7
  import type { ToolExecutionContext } from '@datalayer/jupyter-react';
8
- import { type AgentRuntimesTool } from './AgentRuntimesToolAdapter';
8
+ import type { FrontendToolDefinition } from '../../../components/chat/types/tool';
9
9
  /**
10
10
  * Hook that creates agent-runtimes tools for lexical operations.
11
11
  * Returns stable tools array that won't cause re-renders.
12
12
  *
13
13
  * @param documentId - Document ID (lexical document identifier)
14
14
  * @param contextOverrides - Optional context overrides (format, extras, etc.)
15
- * @returns Agent-runtimes tools array for ChatFloating
15
+ * @returns Frontend tools array for ChatFloating / Chat
16
16
  *
17
17
  * @example
18
18
  * ```typescript
19
19
  * // Default context (toon format for AI)
20
- * const tools = useLexicalTools("doc-123");
20
+ * const frontendTools = useLexicalTools("doc-123");
21
21
  *
22
22
  * // Use with ChatFloating
23
23
  * <ChatFloating
24
24
  * endpoint="http://localhost:8765/api/v1/ag-ui/agent/"
25
- * tools={tools}
25
+ * frontendTools={frontendTools}
26
26
  * />
27
27
  * ```
28
28
  */
29
- export declare function useLexicalTools(documentId: string, contextOverrides?: Partial<Omit<ToolExecutionContext, 'executor' | 'documentId'>>): AgentRuntimesTool[];
30
- export type { AgentRuntimesTool };
29
+ export declare function useLexicalTools(documentId: string, contextOverrides?: Partial<Omit<ToolExecutionContext, 'executor' | 'documentId'>>): FrontendToolDefinition[];
30
+ export type { FrontendToolDefinition };
@@ -3,24 +3,24 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { useLexicalStore, DefaultExecutor as LexicalDefaultExecutor, lexicalToolDefinitions, lexicalToolOperations, } from '@datalayer/jupyter-lexical';
6
- import { createAllAgentRuntimesTools, } from './AgentRuntimesToolAdapter';
6
+ import { createAllAgentRuntimesTools } from './AgentRuntimesToolAdapter';
7
7
  /**
8
8
  * Hook that creates agent-runtimes tools for lexical operations.
9
9
  * Returns stable tools array that won't cause re-renders.
10
10
  *
11
11
  * @param documentId - Document ID (lexical document identifier)
12
12
  * @param contextOverrides - Optional context overrides (format, extras, etc.)
13
- * @returns Agent-runtimes tools array for ChatFloating
13
+ * @returns Frontend tools array for ChatFloating / Chat
14
14
  *
15
15
  * @example
16
16
  * ```typescript
17
17
  * // Default context (toon format for AI)
18
- * const tools = useLexicalTools("doc-123");
18
+ * const frontendTools = useLexicalTools("doc-123");
19
19
  *
20
20
  * // Use with ChatFloating
21
21
  * <ChatFloating
22
22
  * endpoint="http://localhost:8765/api/v1/ag-ui/agent/"
23
- * tools={tools}
23
+ * frontendTools={frontendTools}
24
24
  * />
25
25
  * ```
26
26
  */
@@ -1,24 +1,24 @@
1
1
  import type { ToolExecutionContext } from '@datalayer/jupyter-react';
2
- import { type AgentRuntimesTool } from './AgentRuntimesToolAdapter';
2
+ import type { FrontendToolDefinition } from '../../../components/chat/types/tool';
3
3
  /**
4
4
  * Hook that creates agent-runtimes tools for notebook operations.
5
5
  * Returns stable tools array that won't cause re-renders.
6
6
  *
7
7
  * @param documentId - Document ID (notebook identifier)
8
8
  * @param contextOverrides - Optional context overrides (format, extras, etc.)
9
- * @returns Agent-runtimes tools array for ChatFloating
9
+ * @returns Frontend tools array for ChatFloating / Chat
10
10
  *
11
11
  * @example
12
12
  * ```typescript
13
13
  * // Default context (toon format for AI)
14
- * const tools = useNotebookTools("my-notebook-id");
14
+ * const frontendTools = useNotebookTools("my-notebook-id");
15
15
  *
16
16
  * // Use with ChatFloating
17
17
  * <ChatFloating
18
18
  * endpoint="http://localhost:8765/api/v1/ag-ui/agent/"
19
- * tools={tools}
19
+ * frontendTools={frontendTools}
20
20
  * />
21
21
  * ```
22
22
  */
23
- export declare function useNotebookTools(documentId: string, contextOverrides?: Partial<Omit<ToolExecutionContext, 'executor' | 'documentId'>>): AgentRuntimesTool[];
24
- export type { AgentRuntimesTool };
23
+ export declare function useNotebookTools(documentId: string, contextOverrides?: Partial<Omit<ToolExecutionContext, 'executor' | 'documentId'>>): FrontendToolDefinition[];
24
+ export type { FrontendToolDefinition };
@@ -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 { createAllAgentRuntimesTools, } from './AgentRuntimesToolAdapter';
13
+ import { createAllAgentRuntimesTools } from './AgentRuntimesToolAdapter';
14
14
  // Hook wrapper to get notebook store state
15
15
  const useNotebookStore = () => notebookStore.getState();
16
16
  /**
@@ -19,17 +19,17 @@ const useNotebookStore = () => notebookStore.getState();
19
19
  *
20
20
  * @param documentId - Document ID (notebook identifier)
21
21
  * @param contextOverrides - Optional context overrides (format, extras, etc.)
22
- * @returns Agent-runtimes tools array for ChatFloating
22
+ * @returns Frontend tools array for ChatFloating / Chat
23
23
  *
24
24
  * @example
25
25
  * ```typescript
26
26
  * // Default context (toon format for AI)
27
- * const tools = useNotebookTools("my-notebook-id");
27
+ * const frontendTools = useNotebookTools("my-notebook-id");
28
28
  *
29
29
  * // Use with ChatFloating
30
30
  * <ChatFloating
31
31
  * endpoint="http://localhost:8765/api/v1/ag-ui/agent/"
32
- * tools={tools}
32
+ * frontendTools={frontendTools}
33
33
  * />
34
34
  * ```
35
35
  */
@@ -1,3 +1,29 @@
1
+ /**
2
+ * Status of an agent.
3
+ */
4
+ export type AgentStatus = 'starting' | 'running' | 'paused' | 'terminated' | 'archived';
5
+ export type Transport = 'acp' | 'ag-ui' | 'vercel-ai' | 'a2a';
6
+ export interface Agent {
7
+ id: string;
8
+ name: string;
9
+ description: string;
10
+ author: string;
11
+ lastEdited: string;
12
+ screenshot: string;
13
+ status?: AgentStatus;
14
+ transport: Transport;
15
+ avatarUrl: string;
16
+ notebookFile: string;
17
+ lexicalFile: string;
18
+ stars: number;
19
+ notifications: number;
20
+ }
21
+ export type AgentsState = {
22
+ agents: readonly Agent[];
23
+ getAgentById: (id: string) => Agent | undefined;
24
+ updateAgentStatus: (id: string, status: AgentStatus) => void;
25
+ toggleAgentStatus: (id: string) => void;
26
+ };
1
27
  export interface ConversationEntry {
2
28
  id: string;
3
29
  firstMessage?: string;
@@ -69,10 +95,6 @@ export interface AgentSkillSpec {
69
95
  /** Environment variables required by this skill (e.g., API keys) */
70
96
  requiredEnvVars?: string[];
71
97
  }
72
- /**
73
- * Status of an agent space.
74
- */
75
- export type AgentStatus = 'starting' | 'running' | 'paused' | 'terminated' | 'archived';
76
98
  /**
77
99
  * Specification for an AI agent.
78
100
  *
@@ -94,6 +116,8 @@ export interface AgentSpec {
94
116
  tags: string[];
95
117
  /** Whether the agent is enabled */
96
118
  enabled: boolean;
119
+ /** AI model identifier to use for this agent */
120
+ model?: string;
97
121
  /** MCP servers used by this agent */
98
122
  mcpServers: MCPServer[];
99
123
  /** Skills available to this agent */
@@ -114,11 +138,13 @@ export interface AgentSpec {
114
138
  welcomeNotebook?: string;
115
139
  /** Path to Lexical document to show on agent creation */
116
140
  welcomeDocument?: string;
141
+ /** Sandbox variant to use for this agent ('local-eval', 'jupyter', 'local-jupyter') */
142
+ sandboxVariant?: string;
117
143
  }
118
144
  /**
119
145
  * Configuration for an AI model.
120
146
  */
121
- export interface AIModel {
147
+ export interface AIModelRuntime {
122
148
  /** Model identifier (e.g., 'anthropic:claude-sonnet-4-5') */
123
149
  id: string;
124
150
  /** Display name for the model */
@@ -144,7 +170,7 @@ export interface BuiltinTool {
144
170
  */
145
171
  export interface FrontendConfig {
146
172
  /** Available AI models */
147
- models: AIModel[];
173
+ models: AIModelRuntime[];
148
174
  /** Available builtin tools */
149
175
  builtinTools: BuiltinTool[];
150
176
  /** Configured MCP servers */
@@ -1 +1,2 @@
1
1
  export * from './AIAgent';
2
+ export * from './Types';
@@ -3,3 +3,4 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  export * from './AIAgent';
6
+ export * from './Types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -67,7 +67,7 @@
67
67
  "clean:dist": "rimraf dist",
68
68
  "clean:lib": "rimraf lib tsconfig.tsbuildinfo",
69
69
  "create:patches": "bash scripts/create-patches.sh",
70
- "examples": "run-p server:start examples:vite",
70
+ "examples": "run-p server:start jupyter:start examples:vite",
71
71
  "examples:fresh": "npm run clean:cache && npm run examples",
72
72
  "examples:jupyter": "run-p jupyter:start server:start examples:vite",
73
73
  "examples:nextjs": "npm run dev --workspace=nextjs-notebook-example",
@@ -94,6 +94,12 @@
94
94
  "start:acp": "run-p server:start start:acp:vite",
95
95
  "start:acp:prod": "run-p server start:acp:vite",
96
96
  "start:acp:vite": "VITE_ACP_WS_URL=ws://localhost:8765/api/v1/acp/ws vite",
97
+ "start:agent": "run-p server:start start:agent:vite",
98
+ "start:agent:vite": "vite --open /html/agent.html",
99
+ "start:agent-notebook": "run-p server:start jupyter:start start:agent-notebook:vite",
100
+ "start:agent-notebook:vite": "vite --open /html/agent-notebook.html",
101
+ "start:agent-lexical": "run-p server:start jupyter:start start:agent-lexical:vite",
102
+ "start:agent-lexical:vite": "vite --open /html/agent-lexical.html",
97
103
  "storybook": "storybook dev -p 6006",
98
104
  "sync:jupyter": "bash scripts/sync-jupyter.sh",
99
105
  "sync:jupyter:watch": "bash scripts/sync-jupyter.sh --watch",
@@ -122,11 +128,11 @@
122
128
  "@agentclientprotocol/sdk": "^0.8.0",
123
129
  "@ai-sdk/react": "3.0.30",
124
130
  "@anthropic-ai/sdk": "^0.52.0",
125
- "@datalayer/core": "^0.0.27",
131
+ "@datalayer/core": "^1.0.1",
126
132
  "@datalayer/icons-react": "^1.0.6",
127
- "@datalayer/jupyter-lexical": "^1.0.9",
133
+ "@datalayer/jupyter-lexical": "^1.0.11",
128
134
  "@datalayer/jupyter-react": "^2.0.3",
129
- "@datalayer/primer-addons": "^1.0.4",
135
+ "@datalayer/primer-addons": "^1.0.7",
130
136
  "@datalayer/primer-rjsf": "^1.0.1",
131
137
  "@jupyter-widgets/base-manager": "^1.0.12",
132
138
  "@jupyter-widgets/schema": "^0.5.6",