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