@jupyterlite/ai 0.18.0 → 0.19.0

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 (108) hide show
  1. package/lib/chat-commands/clear.d.ts +1 -0
  2. package/lib/chat-commands/index.d.ts +1 -0
  3. package/lib/chat-commands/skills.d.ts +2 -1
  4. package/lib/chat-model-handler.d.ts +3 -1
  5. package/lib/chat-model.d.ts +46 -8
  6. package/lib/chat-model.js +51 -21
  7. package/lib/completion/completion-provider.d.ts +3 -1
  8. package/lib/completion/completion-provider.js +1 -2
  9. package/lib/completion/index.d.ts +1 -0
  10. package/lib/components/clear-button.d.ts +1 -0
  11. package/lib/components/clear-button.js +3 -4
  12. package/lib/components/completion-status.d.ts +1 -0
  13. package/lib/components/completion-status.js +5 -4
  14. package/lib/components/index.d.ts +1 -0
  15. package/lib/components/model-select.d.ts +1 -0
  16. package/lib/components/model-select.js +62 -67
  17. package/lib/components/save-button.d.ts +1 -0
  18. package/lib/components/save-button.js +4 -5
  19. package/lib/components/stop-button.d.ts +1 -0
  20. package/lib/components/stop-button.js +3 -4
  21. package/lib/components/tool-select.d.ts +3 -1
  22. package/lib/components/tool-select.js +47 -60
  23. package/lib/components/usage-display.d.ts +4 -2
  24. package/lib/components/usage-display.js +50 -61
  25. package/lib/diff-manager.d.ts +3 -1
  26. package/lib/index.d.ts +3 -2
  27. package/lib/index.js +28 -17
  28. package/lib/models/settings-model.d.ts +3 -1
  29. package/lib/rendered-message-outputarea.d.ts +1 -0
  30. package/lib/tokens.d.ts +18 -640
  31. package/lib/tokens.js +2 -31
  32. package/lib/widgets/ai-settings.d.ts +3 -1
  33. package/lib/widgets/ai-settings.js +185 -349
  34. package/lib/widgets/main-area-chat.d.ts +1 -0
  35. package/lib/widgets/provider-config-dialog.d.ts +2 -1
  36. package/lib/widgets/provider-config-dialog.js +102 -167
  37. package/package.json +111 -258
  38. package/src/chat-commands/skills.ts +2 -2
  39. package/src/chat-model-handler.ts +6 -4
  40. package/src/chat-model.ts +66 -19
  41. package/src/completion/completion-provider.ts +6 -6
  42. package/src/components/clear-button.tsx +0 -2
  43. package/src/components/completion-status.tsx +2 -2
  44. package/src/components/model-select.tsx +1 -1
  45. package/src/components/stop-button.tsx +0 -2
  46. package/src/components/tool-select.tsx +10 -9
  47. package/src/components/usage-display.tsx +4 -2
  48. package/src/diff-manager.ts +4 -3
  49. package/src/index.ts +62 -44
  50. package/src/models/settings-model.ts +6 -6
  51. package/src/tokens.ts +23 -788
  52. package/src/widgets/ai-settings.tsx +14 -11
  53. package/src/widgets/provider-config-dialog.tsx +8 -8
  54. package/LICENSE +0 -30
  55. package/README.md +0 -49
  56. package/lib/agent.d.ts +0 -280
  57. package/lib/agent.js +0 -1103
  58. package/lib/icons.d.ts +0 -3
  59. package/lib/icons.js +0 -8
  60. package/lib/providers/built-in-providers.d.ts +0 -21
  61. package/lib/providers/built-in-providers.js +0 -233
  62. package/lib/providers/generated-model-info.d.ts +0 -8
  63. package/lib/providers/generated-model-info.js +0 -502
  64. package/lib/providers/model-info.d.ts +0 -6
  65. package/lib/providers/model-info.js +0 -91
  66. package/lib/providers/models.d.ts +0 -37
  67. package/lib/providers/models.js +0 -28
  68. package/lib/providers/provider-registry.d.ts +0 -49
  69. package/lib/providers/provider-registry.js +0 -72
  70. package/lib/providers/provider-tools.d.ts +0 -36
  71. package/lib/providers/provider-tools.js +0 -93
  72. package/lib/skills/index.d.ts +0 -4
  73. package/lib/skills/index.js +0 -7
  74. package/lib/skills/parse-skill.d.ts +0 -25
  75. package/lib/skills/parse-skill.js +0 -69
  76. package/lib/skills/skill-loader.d.ts +0 -25
  77. package/lib/skills/skill-loader.js +0 -133
  78. package/lib/skills/skill-registry.d.ts +0 -31
  79. package/lib/skills/skill-registry.js +0 -100
  80. package/lib/skills/types.d.ts +0 -29
  81. package/lib/skills/types.js +0 -5
  82. package/lib/tools/commands.d.ts +0 -11
  83. package/lib/tools/commands.js +0 -154
  84. package/lib/tools/skills.d.ts +0 -9
  85. package/lib/tools/skills.js +0 -73
  86. package/lib/tools/tool-registry.d.ts +0 -35
  87. package/lib/tools/tool-registry.js +0 -55
  88. package/lib/tools/web.d.ts +0 -8
  89. package/lib/tools/web.js +0 -196
  90. package/src/agent.ts +0 -1431
  91. package/src/icons.ts +0 -11
  92. package/src/providers/built-in-providers.ts +0 -241
  93. package/src/providers/generated-model-info.ts +0 -508
  94. package/src/providers/model-info.ts +0 -145
  95. package/src/providers/models.ts +0 -76
  96. package/src/providers/provider-registry.ts +0 -88
  97. package/src/providers/provider-tools.ts +0 -179
  98. package/src/skills/index.ts +0 -14
  99. package/src/skills/parse-skill.ts +0 -91
  100. package/src/skills/skill-loader.ts +0 -175
  101. package/src/skills/skill-registry.ts +0 -137
  102. package/src/skills/types.ts +0 -37
  103. package/src/tools/commands.ts +0 -210
  104. package/src/tools/skills.ts +0 -84
  105. package/src/tools/tool-registry.ts +0 -63
  106. package/src/tools/web.ts +0 -238
  107. package/src/types.d.ts +0 -4
  108. package/style/icons/jupyternaut-lite.svg +0 -7
package/src/icons.ts DELETED
@@ -1,11 +0,0 @@
1
- import { LabIcon } from '@jupyterlab/ui-components';
2
-
3
- import jupyternautSvg from '../style/icons/jupyternaut-lite.svg';
4
-
5
- export const jupyternautIcon = new LabIcon({
6
- name: '@jupyterlite/ai:jupyternaut',
7
- svgstr: jupyternautSvg
8
- });
9
-
10
- const AI_AVATAR_BASE64 = btoa(jupyternautIcon.svgstr);
11
- export const AI_AVATAR = `data:image/svg+xml;base64,${AI_AVATAR_BASE64}`;
@@ -1,241 +0,0 @@
1
- import { createAnthropic } from '@ai-sdk/anthropic';
2
- import { createGoogleGenerativeAI } from '@ai-sdk/google';
3
- import { createMistral } from '@ai-sdk/mistral';
4
- import { createOpenAI } from '@ai-sdk/openai';
5
- import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
6
-
7
- import { BUILT_IN_PROVIDER_MODEL_INFO } from './generated-model-info';
8
- import type { IProviderInfo } from '../tokens';
9
- import type { IModelOptions } from './models';
10
-
11
- /**
12
- * Anthropic provider
13
- */
14
- export const anthropicProvider: IProviderInfo = {
15
- id: 'anthropic',
16
- name: 'Anthropic Claude',
17
- apiKeyRequirement: 'required',
18
- defaultModels: [
19
- 'claude-opus-4-6',
20
- 'claude-sonnet-4-6',
21
- 'claude-opus-4-5',
22
- 'claude-opus-4-5-20251101',
23
- 'claude-sonnet-4-5',
24
- 'claude-sonnet-4-5-20250929',
25
- 'claude-haiku-4-5',
26
- 'claude-haiku-4-5-20251001',
27
- 'claude-opus-4-1',
28
- 'claude-opus-4-1-20250805',
29
- 'claude-opus-4-0',
30
- 'claude-opus-4-20250514',
31
- 'claude-sonnet-4-0',
32
- 'claude-sonnet-4-20250514'
33
- ],
34
- modelInfo: BUILT_IN_PROVIDER_MODEL_INFO.anthropic,
35
- supportsBaseURL: true,
36
- supportsHeaders: true,
37
- providerToolCapabilities: {
38
- webSearch: { implementation: 'anthropic' },
39
- webFetch: { implementation: 'anthropic' }
40
- },
41
- factory: (options: IModelOptions) => {
42
- if (!options.apiKey) {
43
- throw new Error('API key required for Anthropic');
44
- }
45
- const anthropic = createAnthropic({
46
- apiKey: options.apiKey,
47
- headers: {
48
- 'anthropic-dangerous-direct-browser-access': 'true',
49
- ...options.headers
50
- },
51
- ...(options.baseURL && { baseURL: options.baseURL })
52
- });
53
- const modelName = options.model ?? '';
54
- return anthropic(modelName);
55
- }
56
- };
57
-
58
- /**
59
- * Google Generative AI provider
60
- */
61
- export const googleProvider: IProviderInfo = {
62
- id: 'google',
63
- name: 'Google Generative AI',
64
- apiKeyRequirement: 'required',
65
- defaultModels: [
66
- 'gemini-3.1-pro-preview',
67
- 'gemini-3.1-pro-preview-customtools',
68
- 'gemini-3.1-flash-image-preview',
69
- 'gemini-3.1-flash-lite-preview',
70
- 'gemini-3-pro-image-preview',
71
- 'gemini-3-flash-preview',
72
- 'gemini-2.5-pro',
73
- 'gemini-2.5-flash',
74
- 'gemini-2.5-flash-image',
75
- 'gemini-2.5-flash-lite',
76
- 'gemini-2.5-computer-use-preview-10-2025',
77
- 'deep-research-pro-preview-12-2025',
78
- 'gemini-pro-latest',
79
- 'gemini-flash-latest',
80
- 'gemini-flash-lite-latest'
81
- ],
82
- modelInfo: BUILT_IN_PROVIDER_MODEL_INFO.google,
83
- supportsBaseURL: true,
84
- factory: (options: IModelOptions) => {
85
- if (!options.apiKey) {
86
- throw new Error('API key required for Google Generative AI');
87
- }
88
- const google = createGoogleGenerativeAI({
89
- apiKey: options.apiKey,
90
- ...(options.baseURL && { baseURL: options.baseURL })
91
- });
92
- const modelName = options.model || 'gemini-2.5-flash';
93
- return google(modelName);
94
- }
95
- };
96
-
97
- /**
98
- * Mistral provider
99
- */
100
- export const mistralProvider: IProviderInfo = {
101
- id: 'mistral',
102
- name: 'Mistral AI',
103
- apiKeyRequirement: 'required',
104
- defaultModels: [
105
- 'mistral-large-latest',
106
- 'mistral-medium-latest',
107
- 'mistral-medium-2508',
108
- 'mistral-small-latest',
109
- 'mistral-small-2506',
110
- 'ministral-3b-latest',
111
- 'ministral-8b-latest',
112
- 'ministral-14b-latest',
113
- 'magistral-small-latest',
114
- 'magistral-medium-latest',
115
- 'pixtral-large-latest',
116
- 'codestral-latest',
117
- 'devstral-latest'
118
- ],
119
- modelInfo: BUILT_IN_PROVIDER_MODEL_INFO.mistral,
120
- supportsBaseURL: true,
121
- factory: (options: IModelOptions) => {
122
- if (!options.apiKey) {
123
- throw new Error('API key required for Mistral');
124
- }
125
- const mistral = createMistral({
126
- apiKey: options.apiKey,
127
- ...(options.baseURL && { baseURL: options.baseURL })
128
- });
129
- const modelName = options.model || 'mistral-large-latest';
130
- return mistral(modelName);
131
- }
132
- };
133
-
134
- /**
135
- * OpenAI provider
136
- */
137
- export const openaiProvider: IProviderInfo = {
138
- id: 'openai',
139
- name: 'OpenAI',
140
- apiKeyRequirement: 'required',
141
- defaultModels: [
142
- 'gpt-5.4',
143
- 'gpt-5.4-mini',
144
- 'gpt-5.4-nano',
145
- 'gpt-5.2',
146
- 'gpt-5.2-2025-12-11',
147
- 'gpt-5.2-chat-latest',
148
- 'gpt-5.2-pro',
149
- 'gpt-5.2-pro-2025-12-11',
150
- 'gpt-5.2-codex',
151
- 'gpt-5.1',
152
- 'gpt-5.1-2025-11-13',
153
- 'gpt-5.1-chat-latest',
154
- 'gpt-5',
155
- 'gpt-5-2025-08-07',
156
- 'gpt-5-chat-latest',
157
- 'gpt-5-mini',
158
- 'gpt-5-mini-2025-08-07',
159
- 'gpt-5-nano',
160
- 'gpt-5-nano-2025-08-07',
161
- 'o4-mini',
162
- 'o4-mini-2025-04-16',
163
- 'o3-pro',
164
- 'o3',
165
- 'o3-2025-04-16',
166
- 'o3-mini',
167
- 'o3-mini-2025-01-31',
168
- 'o1',
169
- 'o1-2024-12-17',
170
- 'gpt-4.1',
171
- 'gpt-4.1-2025-04-14',
172
- 'gpt-4.1-mini',
173
- 'gpt-4.1-mini-2025-04-14',
174
- 'gpt-4.1-nano',
175
- 'gpt-4.1-nano-2025-04-14',
176
- 'gpt-4o',
177
- 'gpt-4o-2024-05-13',
178
- 'gpt-4o-2024-08-06',
179
- 'gpt-4o-2024-11-20',
180
- 'gpt-4o-mini',
181
- 'gpt-4o-mini-2024-07-18',
182
- 'gpt-4o-search-preview',
183
- 'gpt-4o-search-preview-2025-03-11',
184
- 'gpt-4o-mini-search-preview',
185
- 'gpt-4o-mini-search-preview-2025-03-11',
186
- 'gpt-3.5-turbo',
187
- 'gpt-3.5-turbo-0125'
188
- ],
189
- modelInfo: BUILT_IN_PROVIDER_MODEL_INFO.openai,
190
- supportsBaseURL: true,
191
- supportsHeaders: true,
192
- providerToolCapabilities: {
193
- webSearch: { implementation: 'openai' }
194
- },
195
- factory: (options: IModelOptions) => {
196
- if (!options.apiKey) {
197
- throw new Error('API key required for OpenAI');
198
- }
199
- const openai = createOpenAI({
200
- apiKey: options.apiKey,
201
- ...(options.baseURL && { baseURL: options.baseURL }),
202
- ...(options.headers && { headers: options.headers })
203
- });
204
- const modelName = options.model || 'gpt-4o';
205
- return openai(modelName);
206
- }
207
- };
208
-
209
- /**
210
- * Generic OpenAI-compatible provider
211
- */
212
- export const genericProvider: IProviderInfo = {
213
- id: 'generic',
214
- name: 'Generic (OpenAI-compatible)',
215
- apiKeyRequirement: 'optional',
216
- defaultModels: [],
217
- supportsBaseURL: true,
218
- supportsHeaders: true,
219
- supportsToolCalling: true,
220
- description: 'Uses /chat/completions endpoint',
221
- baseUrls: [
222
- {
223
- url: 'http://localhost:4000',
224
- description: 'Default for local LiteLLM server'
225
- },
226
- {
227
- url: 'http://localhost:11434/v1',
228
- description: 'Default for local Ollama server'
229
- }
230
- ],
231
- factory: (options: IModelOptions) => {
232
- const openaiCompatible = createOpenAICompatible({
233
- name: options.provider,
234
- apiKey: options.apiKey || 'dummy',
235
- baseURL: options.baseURL ?? '',
236
- ...(options.headers && { headers: options.headers })
237
- });
238
- const modelName = options.model || 'gpt-4o';
239
- return openaiCompatible(modelName);
240
- }
241
- };