@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.
- package/lib/chat-commands/clear.d.ts +1 -0
- package/lib/chat-commands/index.d.ts +1 -0
- package/lib/chat-commands/skills.d.ts +2 -1
- package/lib/chat-model-handler.d.ts +3 -1
- package/lib/chat-model.d.ts +46 -8
- package/lib/chat-model.js +51 -21
- package/lib/completion/completion-provider.d.ts +3 -1
- package/lib/completion/completion-provider.js +1 -2
- package/lib/completion/index.d.ts +1 -0
- package/lib/components/clear-button.d.ts +1 -0
- package/lib/components/clear-button.js +3 -4
- package/lib/components/completion-status.d.ts +1 -0
- package/lib/components/completion-status.js +5 -4
- package/lib/components/index.d.ts +1 -0
- package/lib/components/model-select.d.ts +1 -0
- package/lib/components/model-select.js +62 -67
- package/lib/components/save-button.d.ts +1 -0
- package/lib/components/save-button.js +4 -5
- package/lib/components/stop-button.d.ts +1 -0
- package/lib/components/stop-button.js +3 -4
- package/lib/components/tool-select.d.ts +3 -1
- package/lib/components/tool-select.js +47 -60
- package/lib/components/usage-display.d.ts +4 -2
- package/lib/components/usage-display.js +50 -61
- package/lib/diff-manager.d.ts +3 -1
- package/lib/index.d.ts +3 -2
- package/lib/index.js +28 -17
- package/lib/models/settings-model.d.ts +3 -1
- package/lib/rendered-message-outputarea.d.ts +1 -0
- package/lib/tokens.d.ts +18 -640
- package/lib/tokens.js +2 -31
- package/lib/widgets/ai-settings.d.ts +3 -1
- package/lib/widgets/ai-settings.js +185 -349
- package/lib/widgets/main-area-chat.d.ts +1 -0
- package/lib/widgets/provider-config-dialog.d.ts +2 -1
- package/lib/widgets/provider-config-dialog.js +102 -167
- package/package.json +111 -258
- package/src/chat-commands/skills.ts +2 -2
- package/src/chat-model-handler.ts +6 -4
- package/src/chat-model.ts +66 -19
- package/src/completion/completion-provider.ts +6 -6
- package/src/components/clear-button.tsx +0 -2
- package/src/components/completion-status.tsx +2 -2
- package/src/components/model-select.tsx +1 -1
- package/src/components/stop-button.tsx +0 -2
- package/src/components/tool-select.tsx +10 -9
- package/src/components/usage-display.tsx +4 -2
- package/src/diff-manager.ts +4 -3
- package/src/index.ts +62 -44
- package/src/models/settings-model.ts +6 -6
- package/src/tokens.ts +23 -788
- package/src/widgets/ai-settings.tsx +14 -11
- package/src/widgets/provider-config-dialog.tsx +8 -8
- package/LICENSE +0 -30
- package/README.md +0 -49
- package/lib/agent.d.ts +0 -280
- package/lib/agent.js +0 -1103
- package/lib/icons.d.ts +0 -3
- package/lib/icons.js +0 -8
- package/lib/providers/built-in-providers.d.ts +0 -21
- package/lib/providers/built-in-providers.js +0 -233
- package/lib/providers/generated-model-info.d.ts +0 -8
- package/lib/providers/generated-model-info.js +0 -502
- package/lib/providers/model-info.d.ts +0 -6
- package/lib/providers/model-info.js +0 -91
- package/lib/providers/models.d.ts +0 -37
- package/lib/providers/models.js +0 -28
- package/lib/providers/provider-registry.d.ts +0 -49
- package/lib/providers/provider-registry.js +0 -72
- package/lib/providers/provider-tools.d.ts +0 -36
- package/lib/providers/provider-tools.js +0 -93
- package/lib/skills/index.d.ts +0 -4
- package/lib/skills/index.js +0 -7
- package/lib/skills/parse-skill.d.ts +0 -25
- package/lib/skills/parse-skill.js +0 -69
- package/lib/skills/skill-loader.d.ts +0 -25
- package/lib/skills/skill-loader.js +0 -133
- package/lib/skills/skill-registry.d.ts +0 -31
- package/lib/skills/skill-registry.js +0 -100
- package/lib/skills/types.d.ts +0 -29
- package/lib/skills/types.js +0 -5
- package/lib/tools/commands.d.ts +0 -11
- package/lib/tools/commands.js +0 -154
- package/lib/tools/skills.d.ts +0 -9
- package/lib/tools/skills.js +0 -73
- package/lib/tools/tool-registry.d.ts +0 -35
- package/lib/tools/tool-registry.js +0 -55
- package/lib/tools/web.d.ts +0 -8
- package/lib/tools/web.js +0 -196
- package/src/agent.ts +0 -1431
- package/src/icons.ts +0 -11
- package/src/providers/built-in-providers.ts +0 -241
- package/src/providers/generated-model-info.ts +0 -508
- package/src/providers/model-info.ts +0 -145
- package/src/providers/models.ts +0 -76
- package/src/providers/provider-registry.ts +0 -88
- package/src/providers/provider-tools.ts +0 -179
- package/src/skills/index.ts +0 -14
- package/src/skills/parse-skill.ts +0 -91
- package/src/skills/skill-loader.ts +0 -175
- package/src/skills/skill-registry.ts +0 -137
- package/src/skills/types.ts +0 -37
- package/src/tools/commands.ts +0 -210
- package/src/tools/skills.ts +0 -84
- package/src/tools/tool-registry.ts +0 -63
- package/src/tools/web.ts +0 -238
- package/src/types.d.ts +0 -4
- 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
|
-
};
|