@theia/ai-vercel-ai 1.67.0-next.13 → 1.67.0-next.56

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 (42) hide show
  1. package/README.md +1 -0
  2. package/package.json +6 -6
  3. package/lib/browser/vercel-ai-frontend-application-contribution.d.ts +0 -25
  4. package/lib/browser/vercel-ai-frontend-application-contribution.d.ts.map +0 -1
  5. package/lib/browser/vercel-ai-frontend-application-contribution.js +0 -191
  6. package/lib/browser/vercel-ai-frontend-application-contribution.js.map +0 -1
  7. package/lib/browser/vercel-ai-frontend-module.d.ts +0 -4
  8. package/lib/browser/vercel-ai-frontend-module.d.ts.map +0 -1
  9. package/lib/browser/vercel-ai-frontend-module.js +0 -33
  10. package/lib/browser/vercel-ai-frontend-module.js.map +0 -1
  11. package/lib/common/index.d.ts +0 -2
  12. package/lib/common/index.d.ts.map +0 -1
  13. package/lib/common/index.js +0 -20
  14. package/lib/common/index.js.map +0 -1
  15. package/lib/common/vercel-ai-language-models-manager.d.ts +0 -49
  16. package/lib/common/vercel-ai-language-models-manager.d.ts.map +0 -1
  17. package/lib/common/vercel-ai-language-models-manager.js +0 -21
  18. package/lib/common/vercel-ai-language-models-manager.js.map +0 -1
  19. package/lib/common/vercel-ai-preferences.d.ts +0 -8
  20. package/lib/common/vercel-ai-preferences.d.ts.map +0 -1
  21. package/lib/common/vercel-ai-preferences.js +0 -131
  22. package/lib/common/vercel-ai-preferences.js.map +0 -1
  23. package/lib/node/vercel-ai-backend-module.d.ts +0 -4
  24. package/lib/node/vercel-ai-backend-module.d.ts.map +0 -1
  25. package/lib/node/vercel-ai-backend-module.js +0 -35
  26. package/lib/node/vercel-ai-backend-module.js.map +0 -1
  27. package/lib/node/vercel-ai-language-model-factory.d.ts +0 -14
  28. package/lib/node/vercel-ai-language-model-factory.d.ts.map +0 -1
  29. package/lib/node/vercel-ai-language-model-factory.js +0 -73
  30. package/lib/node/vercel-ai-language-model-factory.js.map +0 -1
  31. package/lib/node/vercel-ai-language-model.d.ts +0 -53
  32. package/lib/node/vercel-ai-language-model.d.ts.map +0 -1
  33. package/lib/node/vercel-ai-language-model.js +0 -309
  34. package/lib/node/vercel-ai-language-model.js.map +0 -1
  35. package/lib/node/vercel-ai-language-models-manager-impl.d.ts +0 -19
  36. package/lib/node/vercel-ai-language-models-manager-impl.d.ts.map +0 -1
  37. package/lib/node/vercel-ai-language-models-manager-impl.js +0 -107
  38. package/lib/node/vercel-ai-language-models-manager-impl.js.map +0 -1
  39. package/lib/package.spec.d.ts +0 -1
  40. package/lib/package.spec.d.ts.map +0 -1
  41. package/lib/package.spec.js +0 -26
  42. package/lib/package.spec.js.map +0 -1
package/README.md CHANGED
@@ -17,6 +17,7 @@ The Vercel AI API key and the models to use can be configured via preferences.
17
17
 
18
18
  ## Additional Information
19
19
 
20
+ - [API documentation for `@theia/ai-vercel-ai`](https://eclipse-theia.github.io/theia/docs/next/modules/_theia_ai-vercel-ai.html)
20
21
  - [Theia - GitHub](https://github.com/eclipse-theia/theia)
21
22
  - [Theia - Website](https://theia-ide.org/)
22
23
 
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@theia/ai-vercel-ai",
3
- "version": "1.67.0-next.13+c409d5d18",
3
+ "version": "1.67.0-next.56+d8f18cc386c",
4
4
  "description": "Theia - Vercel AI SDK Integration",
5
5
  "dependencies": {
6
6
  "@ai-sdk/anthropic": "^1.2.10",
7
7
  "@ai-sdk/openai": "^1.3.21",
8
8
  "@ai-sdk/provider": "^1.1.3",
9
- "@theia/ai-core": "1.67.0-next.13+c409d5d18",
10
- "@theia/core": "1.67.0-next.13+c409d5d18",
11
- "@theia/filesystem": "1.67.0-next.13+c409d5d18",
12
- "@theia/workspace": "1.67.0-next.13+c409d5d18",
9
+ "@theia/ai-core": "1.67.0-next.56+d8f18cc386c",
10
+ "@theia/core": "1.67.0-next.56+d8f18cc386c",
11
+ "@theia/filesystem": "1.67.0-next.56+d8f18cc386c",
12
+ "@theia/workspace": "1.67.0-next.56+d8f18cc386c",
13
13
  "ai": "^4.3.13",
14
14
  "tslib": "^2.6.2"
15
15
  },
@@ -52,5 +52,5 @@
52
52
  "nyc": {
53
53
  "extends": "../../configs/nyc.json"
54
54
  },
55
- "gitHead": "c409d5d18d8c4f5a722f87b37ea9d6fd5af47ea8"
55
+ "gitHead": "d8f18cc386c45a736cd193d42eab02c8f64c6b10"
56
56
  }
@@ -1,25 +0,0 @@
1
- import { FrontendApplicationContribution } from '@theia/core/lib/browser';
2
- import { VercelAiLanguageModelsManager, VercelAiModelDescription, VercelAiProvider } from '../common';
3
- import { AICorePreferences } from '@theia/ai-core/lib/common/ai-core-preferences';
4
- import { PreferenceService, PreferenceChange } from '@theia/core';
5
- interface ModelConfig {
6
- id: string;
7
- model: string;
8
- provider: VercelAiProvider;
9
- }
10
- export declare class VercelAiFrontendApplicationContribution implements FrontendApplicationContribution {
11
- protected preferenceService: PreferenceService;
12
- protected manager: VercelAiLanguageModelsManager;
13
- protected aiCorePreferences: AICorePreferences;
14
- onStart(): void;
15
- protected handlePreferenceChange(event: PreferenceChange): void;
16
- protected handleModelChanges(event: PreferenceChange): void;
17
- protected handleCustomModelChanges(event: PreferenceChange): void;
18
- protected ensureModelConfigArray(value: unknown): ModelConfig[];
19
- protected ensureCustomModelArray(value: unknown): Partial<VercelAiModelDescription>[];
20
- protected updateAllModels(): void;
21
- protected createVercelAiModelDescription(modelInfo: ModelConfig): VercelAiModelDescription;
22
- protected createCustomModelDescriptionsFromPreferences(preferences: Partial<VercelAiModelDescription>[]): VercelAiModelDescription[];
23
- }
24
- export {};
25
- //# sourceMappingURL=vercel-ai-frontend-application-contribution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercel-ai-frontend-application-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/vercel-ai-frontend-application-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEtG,OAAO,EAAE,iBAAiB,EAA+B,MAAM,+CAA+C,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAElE,UAAU,WAAW;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,gBAAgB,CAAC;CAC9B;AAED,qBACa,uCAAwC,YAAW,+BAA+B;IAG3F,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAG/C,SAAS,CAAC,OAAO,EAAE,6BAA6B,CAAC;IAGjD,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE/C,OAAO,IAAI,IAAI;IAiCf,SAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAmB/D,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAc3D,SAAS,CAAC,wBAAwB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAsBjE,SAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,EAAE;IAiB/D,SAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC,EAAE;IAWrF,SAAS,CAAC,eAAe,IAAI,IAAI;IAQjC,SAAS,CAAC,8BAA8B,CAAC,SAAS,EAAE,WAAW,GAAG,wBAAwB;IAc1F,SAAS,CAAC,4CAA4C,CAClD,WAAW,EAAE,OAAO,CAAC,wBAAwB,CAAC,EAAE,GACjD,wBAAwB,EAAE;CA0BhC"}
@@ -1,191 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2025 EclipseSource GmbH.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.VercelAiFrontendApplicationContribution = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const common_1 = require("../common");
22
- const vercel_ai_preferences_1 = require("../common/vercel-ai-preferences");
23
- const ai_core_preferences_1 = require("@theia/ai-core/lib/common/ai-core-preferences");
24
- const core_1 = require("@theia/core");
25
- let VercelAiFrontendApplicationContribution = class VercelAiFrontendApplicationContribution {
26
- onStart() {
27
- this.preferenceService.ready.then(() => {
28
- // Set up provider-specific API keys
29
- const openaiApiKey = this.preferenceService.get(vercel_ai_preferences_1.OPENAI_API_KEY_PREF, undefined);
30
- const anthropicApiKey = this.preferenceService.get(vercel_ai_preferences_1.ANTHROPIC_API_KEY_PREF, undefined);
31
- // Set provider configs
32
- if (openaiApiKey) {
33
- this.manager.setProviderConfig('openai', { provider: 'openai', apiKey: openaiApiKey });
34
- }
35
- if (anthropicApiKey) {
36
- this.manager.setProviderConfig('anthropic', { provider: 'anthropic', apiKey: anthropicApiKey });
37
- }
38
- // Initial setup of models
39
- const models = this.preferenceService.get(vercel_ai_preferences_1.MODELS_PREF, []);
40
- this.manager.createOrUpdateLanguageModels(...models.map(model => this.createVercelAiModelDescription(model)));
41
- const customModels = this.preferenceService.get(vercel_ai_preferences_1.CUSTOM_ENDPOINTS_PREF, []);
42
- this.manager.createOrUpdateLanguageModels(...this.createCustomModelDescriptionsFromPreferences(customModels));
43
- // Set up listeners for preference changes
44
- this.preferenceService.onPreferenceChanged(this.handlePreferenceChange.bind(this));
45
- this.aiCorePreferences.onPreferenceChanged(event => {
46
- if (event.preferenceName === ai_core_preferences_1.PREFERENCE_NAME_MAX_RETRIES) {
47
- this.updateAllModels();
48
- }
49
- });
50
- });
51
- }
52
- handlePreferenceChange(event) {
53
- switch (event.preferenceName) {
54
- case vercel_ai_preferences_1.OPENAI_API_KEY_PREF:
55
- this.manager.setProviderConfig('openai', { provider: 'openai', apiKey: event.newValue });
56
- this.updateAllModels();
57
- break;
58
- case vercel_ai_preferences_1.ANTHROPIC_API_KEY_PREF:
59
- this.manager.setProviderConfig('anthropic', { provider: 'anthropic', apiKey: event.newValue });
60
- this.updateAllModels();
61
- break;
62
- case vercel_ai_preferences_1.MODELS_PREF:
63
- this.handleModelChanges(event);
64
- break;
65
- case vercel_ai_preferences_1.CUSTOM_ENDPOINTS_PREF:
66
- this.handleCustomModelChanges(event);
67
- break;
68
- }
69
- }
70
- handleModelChanges(event) {
71
- const newModels = this.ensureModelConfigArray(event.newValue);
72
- const oldModels = this.ensureModelConfigArray(event.oldValue);
73
- const oldModelIds = new Set(oldModels.map(m => m.id));
74
- const newModelIds = new Set(newModels.map(m => m.id));
75
- const modelsToRemove = [...oldModelIds].filter(modelId => !newModelIds.has(modelId));
76
- const modelsToAdd = newModels.filter(model => !oldModelIds.has(model.id));
77
- this.manager.removeLanguageModels(...modelsToRemove);
78
- this.manager.createOrUpdateLanguageModels(...modelsToAdd.map(model => this.createVercelAiModelDescription(model)));
79
- }
80
- handleCustomModelChanges(event) {
81
- const newCustomModels = this.ensureCustomModelArray(event.newValue);
82
- const oldCustomModels = this.ensureCustomModelArray(event.oldValue);
83
- const oldModels = this.createCustomModelDescriptionsFromPreferences(oldCustomModels);
84
- const newModels = this.createCustomModelDescriptionsFromPreferences(newCustomModels);
85
- const modelsToRemove = oldModels.filter(model => !newModels.some(newModel => newModel.id === model.id));
86
- const modelsToAddOrUpdate = newModels.filter(newModel => !oldModels.some(model => model.id === newModel.id &&
87
- model.model === newModel.model &&
88
- model.url === newModel.url &&
89
- model.apiKey === newModel.apiKey &&
90
- model.supportsStructuredOutput === newModel.supportsStructuredOutput &&
91
- model.enableStreaming === newModel.enableStreaming &&
92
- model.provider === newModel.provider));
93
- this.manager.removeLanguageModels(...modelsToRemove.map(model => model.id));
94
- this.manager.createOrUpdateLanguageModels(...modelsToAddOrUpdate);
95
- }
96
- ensureModelConfigArray(value) {
97
- if (!value || !Array.isArray(value)) {
98
- return [];
99
- }
100
- return value.filter(item => item &&
101
- typeof item === 'object' &&
102
- 'id' in item &&
103
- 'model' in item &&
104
- 'provider' in item &&
105
- typeof item.id === 'string' &&
106
- typeof item.model === 'string' &&
107
- (typeof item.provider === 'string' || item.provider === undefined));
108
- }
109
- ensureCustomModelArray(value) {
110
- if (!value || !Array.isArray(value)) {
111
- return [];
112
- }
113
- return value.filter(item => item &&
114
- typeof item === 'object');
115
- }
116
- updateAllModels() {
117
- const models = this.preferenceService.get(vercel_ai_preferences_1.MODELS_PREF, []);
118
- this.manager.createOrUpdateLanguageModels(...models.map(model => this.createVercelAiModelDescription(model)));
119
- const customModels = this.preferenceService.get(vercel_ai_preferences_1.CUSTOM_ENDPOINTS_PREF, []);
120
- this.manager.createOrUpdateLanguageModels(...this.createCustomModelDescriptionsFromPreferences(customModels));
121
- }
122
- createVercelAiModelDescription(modelInfo) {
123
- var _a;
124
- const maxRetries = (_a = this.aiCorePreferences.get(ai_core_preferences_1.PREFERENCE_NAME_MAX_RETRIES)) !== null && _a !== void 0 ? _a : 3;
125
- // The model ID already includes the 'vercel' prefix from preferences
126
- return {
127
- id: modelInfo.id,
128
- model: modelInfo.model,
129
- provider: modelInfo.provider,
130
- apiKey: true,
131
- enableStreaming: true,
132
- supportsStructuredOutput: modelsSupportingStructuredOutput.includes(modelInfo.model),
133
- maxRetries: maxRetries
134
- };
135
- }
136
- createCustomModelDescriptionsFromPreferences(preferences) {
137
- var _a;
138
- const maxRetries = (_a = this.aiCorePreferences.get(ai_core_preferences_1.PREFERENCE_NAME_MAX_RETRIES)) !== null && _a !== void 0 ? _a : 3;
139
- return preferences.reduce((acc, pref) => {
140
- var _a, _b, _c;
141
- if (!pref.model || !pref.url || typeof pref.model !== 'string' || typeof pref.url !== 'string') {
142
- return acc;
143
- }
144
- // Ensure custom model IDs have the 'vercel' prefix
145
- const modelId = pref.id && typeof pref.id === 'string' ? pref.id : pref.model;
146
- const prefixedId = modelId.startsWith('vercel/') ? modelId : `${vercel_ai_preferences_1.VERCEL_AI_PROVIDER_ID}/${modelId}`;
147
- return [
148
- ...acc,
149
- {
150
- id: prefixedId,
151
- model: pref.model,
152
- url: pref.url,
153
- provider: pref.provider || 'openai',
154
- apiKey: typeof pref.apiKey === 'string' || pref.apiKey === true ? pref.apiKey : undefined,
155
- supportsStructuredOutput: (_a = pref.supportsStructuredOutput) !== null && _a !== void 0 ? _a : true,
156
- enableStreaming: (_b = pref.enableStreaming) !== null && _b !== void 0 ? _b : true,
157
- maxRetries: (_c = pref.maxRetries) !== null && _c !== void 0 ? _c : maxRetries
158
- }
159
- ];
160
- }, []);
161
- }
162
- };
163
- exports.VercelAiFrontendApplicationContribution = VercelAiFrontendApplicationContribution;
164
- tslib_1.__decorate([
165
- (0, inversify_1.inject)(core_1.PreferenceService),
166
- tslib_1.__metadata("design:type", Object)
167
- ], VercelAiFrontendApplicationContribution.prototype, "preferenceService", void 0);
168
- tslib_1.__decorate([
169
- (0, inversify_1.inject)(common_1.VercelAiLanguageModelsManager),
170
- tslib_1.__metadata("design:type", Object)
171
- ], VercelAiFrontendApplicationContribution.prototype, "manager", void 0);
172
- tslib_1.__decorate([
173
- (0, inversify_1.inject)(ai_core_preferences_1.AICorePreferences),
174
- tslib_1.__metadata("design:type", Object)
175
- ], VercelAiFrontendApplicationContribution.prototype, "aiCorePreferences", void 0);
176
- exports.VercelAiFrontendApplicationContribution = VercelAiFrontendApplicationContribution = tslib_1.__decorate([
177
- (0, inversify_1.injectable)()
178
- ], VercelAiFrontendApplicationContribution);
179
- // List of models that support structured output via JSON schema
180
- const modelsSupportingStructuredOutput = [
181
- 'gpt-4.1',
182
- 'gpt-4.1-mini',
183
- 'gpt-4.1-nano',
184
- 'gpt-4o',
185
- 'gpt-4o-mini',
186
- 'gpt-4-turbo',
187
- 'claude-3-7-sonnet-20250219',
188
- 'claude-3-5-haiku-20241022',
189
- 'claude-3-opus-20240229'
190
- ];
191
- //# sourceMappingURL=vercel-ai-frontend-application-contribution.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercel-ai-frontend-application-contribution.js","sourceRoot":"","sources":["../../src/browser/vercel-ai-frontend-application-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAGhF,4DAAkE;AAClE,sCAAsG;AACtG,2EAAyJ;AACzJ,uFAA+G;AAC/G,sCAAkE;AAS3D,IAAM,uCAAuC,GAA7C,MAAM,uCAAuC;IAWhD,OAAO;QACH,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YACnC,oCAAoC;YACpC,MAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAS,2CAAmB,EAAE,SAAS,CAAC,CAAC;YACxF,MAAM,eAAe,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAS,8CAAsB,EAAE,SAAS,CAAC,CAAC;YAE9F,uBAAuB;YACvB,IAAI,YAAY,EAAE,CAAC;gBACf,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;YAC3F,CAAC;YAED,IAAI,eAAe,EAAE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AAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,6CAAqB,IAAI,OAAO,EAAE,CAAC;YAEnG,OAAO;gBACH,GAAG,GAAG;gBACN;oBACI,EAAE,EAAE,UAAU;oBACd,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,QAAQ;oBACnC,MAAM,EAAE,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;oBACzF,wBAAwB,EAAE,MAAA,IAAI,CAAC,wBAAwB,mCAAI,IAAI;oBAC/D,eAAe,EAAE,MAAA,IAAI,CAAC,eAAe,mCAAI,IAAI;oBAC7C,UAAU,EAAE,MAAA,IAAI,CAAC,UAAU,mCAAI,UAAU;iBAC5C;aACJ,CAAC;QACN,CAAC,EAAE,EAAE,CAAC,CAAC;IACX,CAAC;CACJ,CAAA;AAjLY,0FAAuC;AAGtC;IADT,IAAA,kBAAM,EAAC,wBAAiB,CAAC;;kFACqB;AAGrC;IADT,IAAA,kBAAM,EAAC,sCAA6B,CAAC;;wEACW;AAGvC;IADT,IAAA,kBAAM,EAAC,uCAAiB,CAAC;;kFACqB;kDATtC,uCAAuC;IADnD,IAAA,sBAAU,GAAE;GACA,uCAAuC,CAiLnD;AAED,gEAAgE;AAChE,MAAM,gCAAgC,GAAG;IACrC,SAAS;IACT,cAAc;IACd,cAAc;IACd,QAAQ;IACR,aAAa;IACb,aAAa;IACb,4BAA4B;IAC5B,2BAA2B;IAC3B,wBAAwB;CAC3B,CAAC"}
@@ -1,4 +0,0 @@
1
- import { ContainerModule } from '@theia/core/shared/inversify';
2
- declare const _default: ContainerModule;
3
- export default _default;
4
- //# sourceMappingURL=vercel-ai-frontend-module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercel-ai-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/vercel-ai-frontend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAO/D,wBAQG"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2025 EclipseSource GmbH.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- const inversify_1 = require("@theia/core/shared/inversify");
19
- const vercel_ai_preferences_1 = require("../common/vercel-ai-preferences");
20
- const browser_1 = require("@theia/core/lib/browser");
21
- const vercel_ai_frontend_application_contribution_1 = require("./vercel-ai-frontend-application-contribution");
22
- const common_1 = require("../common");
23
- const core_1 = require("@theia/core");
24
- exports.default = new inversify_1.ContainerModule(bind => {
25
- bind(core_1.PreferenceContribution).toConstantValue({ schema: vercel_ai_preferences_1.VercelAiPreferencesSchema });
26
- bind(vercel_ai_frontend_application_contribution_1.VercelAiFrontendApplicationContribution).toSelf().inSingletonScope();
27
- bind(browser_1.FrontendApplicationContribution).toService(vercel_ai_frontend_application_contribution_1.VercelAiFrontendApplicationContribution);
28
- bind(common_1.VercelAiLanguageModelsManager).toDynamicValue(ctx => {
29
- const provider = ctx.container.get(browser_1.RemoteConnectionProvider);
30
- return provider.createProxy(common_1.VERCEL_AI_LANGUAGE_MODELS_MANAGER_PATH);
31
- }).inSingletonScope();
32
- });
33
- //# sourceMappingURL=vercel-ai-frontend-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercel-ai-frontend-module.js","sourceRoot":"","sources":["../../src/browser/vercel-ai-frontend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,4DAA+D;AAC/D,2EAA4E;AAC5E,qDAA+H;AAC/H,+GAAwG;AACxG,sCAAkG;AAClG,sCAAqD;AAErD,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,6BAAsB,CAAC,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,iDAAyB,EAAE,CAAC,CAAC;IACpF,IAAI,CAAC,qFAAuC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC1E,IAAI,CAAC,yCAA+B,CAAC,CAAC,SAAS,CAAC,qFAAuC,CAAC,CAAC;IACzF,IAAI,CAAC,sCAA6B,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QACrD,MAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAA4B,kCAAwB,CAAC,CAAC;QACxF,OAAO,QAAQ,CAAC,WAAW,CAAgC,+CAAsC,CAAC,CAAC;IACvG,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './vercel-ai-language-models-manager';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAeA,cAAc,qCAAqC,CAAC"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- // *****************************************************************************
5
- // Copyright (C) 2025 EclipseSource GmbH.
6
- //
7
- // This program and the accompanying materials are made available under the
8
- // terms of the Eclipse Public License v. 2.0 which is available at
9
- // http://www.eclipse.org/legal/epl-2.0.
10
- //
11
- // This Source Code may also be made available under the following Secondary
12
- // Licenses when the conditions for such availability set forth in the Eclipse
13
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
14
- // with the GNU Classpath Exception which is available at
15
- // https://www.gnu.org/software/classpath/license.html.
16
- //
17
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
18
- // *****************************************************************************
19
- tslib_1.__exportStar(require("./vercel-ai-language-models-manager"), exports);
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,8EAAoD"}
@@ -1,49 +0,0 @@
1
- export declare const VERCEL_AI_LANGUAGE_MODELS_MANAGER_PATH = "/services/vercel-ai/language-model-manager";
2
- export type VercelAiProvider = 'openai' | 'anthropic';
3
- export interface VercelAiProviderConfig {
4
- provider: VercelAiProvider;
5
- apiKey?: string;
6
- baseURL?: string;
7
- }
8
- export interface VercelAiModelDescription {
9
- /**
10
- * The identifier of the model which will be shown in the UI.
11
- */
12
- id: string;
13
- /**
14
- * The model ID as used by the Vercel AI SDK.
15
- */
16
- model: string;
17
- /**
18
- * The provider of the model (openai, anthropic, etc.)
19
- */
20
- provider?: VercelAiProvider;
21
- /**
22
- * The API base URL where the model is hosted. If not provided the default provider endpoint will be used.
23
- */
24
- url?: string;
25
- /**
26
- * The key for the model. If 'true' is provided the global provider API key will be used.
27
- */
28
- apiKey: string | true | undefined;
29
- /**
30
- * Controls whether streaming is enabled for this model.
31
- */
32
- enableStreaming: boolean;
33
- /**
34
- * Flag to configure whether the model supports structured output. Default is `true`.
35
- */
36
- supportsStructuredOutput: boolean;
37
- /**
38
- * Maximum number of retry attempts when a request fails. Default is 3.
39
- */
40
- maxRetries: number;
41
- }
42
- export declare const VercelAiLanguageModelsManager: unique symbol;
43
- export interface VercelAiLanguageModelsManager {
44
- apiKey: string | undefined;
45
- setProviderConfig(provider: VercelAiProvider, config: Partial<VercelAiProviderConfig>): void;
46
- createOrUpdateLanguageModels(...models: VercelAiModelDescription[]): Promise<void>;
47
- removeLanguageModels(...modelIds: string[]): void;
48
- }
49
- //# sourceMappingURL=vercel-ai-language-models-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercel-ai-language-models-manager.d.ts","sourceRoot":"","sources":["../../src/common/vercel-ai-language-models-manager.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,sCAAsC,+CAA+C,CAAC;AAEnG,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACnC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,wBAAwB,EAAE,OAAO,CAAC;IAClC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,6BAA6B,eAA0C,CAAC;AACrF,MAAM,WAAW,6BAA6B;IAC1C,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,IAAI,CAAC;IAC7F,4BAA4B,CAAC,GAAG,MAAM,EAAE,wBAAwB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF,oBAAoB,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACrD"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VercelAiLanguageModelsManager = exports.VERCEL_AI_LANGUAGE_MODELS_MANAGER_PATH = void 0;
4
- // *****************************************************************************
5
- // Copyright (C) 2025 EclipseSource GmbH.
6
- //
7
- // This program and the accompanying materials are made available under the
8
- // terms of the Eclipse Public License v. 2.0 which is available at
9
- // http://www.eclipse.org/legal/epl-2.0.
10
- //
11
- // This Source Code may also be made available under the following Secondary
12
- // Licenses when the conditions for such availability set forth in the Eclipse
13
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
14
- // with the GNU Classpath Exception which is available at
15
- // https://www.gnu.org/software/classpath/license.html.
16
- //
17
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
18
- // *****************************************************************************
19
- exports.VERCEL_AI_LANGUAGE_MODELS_MANAGER_PATH = '/services/vercel-ai/language-model-manager';
20
- exports.VercelAiLanguageModelsManager = Symbol('VercelAiLanguageModelsManager');
21
- //# sourceMappingURL=vercel-ai-language-models-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercel-ai-language-models-manager.js","sourceRoot":"","sources":["../../src/common/vercel-ai-language-models-manager.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AACnE,QAAA,sCAAsC,GAAG,4CAA4C,CAAC;AA6CtF,QAAA,6BAA6B,GAAG,MAAM,CAAC,+BAA+B,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import { PreferenceSchema } from '@theia/core';
2
- export declare const OPENAI_API_KEY_PREF = "ai-features.vercelAi.openaiApiKey";
3
- export declare const ANTHROPIC_API_KEY_PREF = "ai-features.vercelAi.anthropicApiKey";
4
- export declare const MODELS_PREF = "ai-features.vercelAi.officialModels";
5
- export declare const CUSTOM_ENDPOINTS_PREF = "ai-features.vercelAi.customModels";
6
- export declare const VERCEL_AI_PROVIDER_ID = "vercel-ai";
7
- export declare const VercelAiPreferencesSchema: PreferenceSchema;
8
- //# sourceMappingURL=vercel-ai-preferences.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercel-ai-preferences.d.ts","sourceRoot":"","sources":["../../src/common/vercel-ai-preferences.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAO,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,eAAO,MAAM,mBAAmB,sCAAsC,CAAC;AACvE,eAAO,MAAM,sBAAsB,yCAAyC,CAAC;AAC7E,eAAO,MAAM,WAAW,wCAAwC,CAAC;AACjE,eAAO,MAAM,qBAAqB,sCAAsC,CAAC;AAEzE,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAEjD,eAAO,MAAM,yBAAyB,EAAE,gBA8GvC,CAAC"}
@@ -1,131 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2025 EclipseSource GmbH.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.VercelAiPreferencesSchema = exports.VERCEL_AI_PROVIDER_ID = exports.CUSTOM_ENDPOINTS_PREF = exports.MODELS_PREF = exports.ANTHROPIC_API_KEY_PREF = exports.OPENAI_API_KEY_PREF = void 0;
19
- const ai_core_preferences_1 = require("@theia/ai-core/lib/common/ai-core-preferences");
20
- const core_1 = require("@theia/core");
21
- exports.OPENAI_API_KEY_PREF = 'ai-features.vercelAi.openaiApiKey';
22
- exports.ANTHROPIC_API_KEY_PREF = 'ai-features.vercelAi.anthropicApiKey';
23
- exports.MODELS_PREF = 'ai-features.vercelAi.officialModels';
24
- exports.CUSTOM_ENDPOINTS_PREF = 'ai-features.vercelAi.customModels';
25
- exports.VERCEL_AI_PROVIDER_ID = 'vercel-ai';
26
- exports.VercelAiPreferencesSchema = {
27
- properties: {
28
- [exports.OPENAI_API_KEY_PREF]: {
29
- type: 'string',
30
- markdownDescription: core_1.nls.localize('theia/ai/vercelai/openaiApiKey/mdDescription', 'Enter an API Key for OpenAI models used by the Vercel AI SDK. \
31
- **Please note:** By using this preference the API key will be stored in clear text \
32
- on the machine running Theia. Use the environment variable `OPENAI_API_KEY` to set the key securely.'),
33
- title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
34
- },
35
- [exports.ANTHROPIC_API_KEY_PREF]: {
36
- type: 'string',
37
- markdownDescription: core_1.nls.localize('theia/ai/vercelai/anthropicApiKey/mdDescription', 'Enter an API Key for Anthropic models used by the Vercel AI SDK. \
38
- **Please note:** By using this preference the API key will be stored in clear text \
39
- on the machine running Theia. Use the environment variable `ANTHROPIC_API_KEY` to set the key securely.'),
40
- title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
41
- },
42
- [exports.MODELS_PREF]: {
43
- type: 'array',
44
- description: core_1.nls.localize('theia/ai/vercelai/models/description', 'Official models to use with Vercel AI SDK'),
45
- title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
46
- default: [
47
- { id: 'vercel/openai/gpt-4.1', model: 'gpt-4.1', provider: 'openai' },
48
- { id: 'vercel/openai/gpt-4.1-nano', model: 'gpt-4.1-nano', provider: 'openai' },
49
- { id: 'vercel/openai/gpt-4.1-mini', model: 'gpt-4.1-mini', provider: 'openai' },
50
- { id: 'vercel/openai/gpt-4-turbo', model: 'gpt-4-turbo', provider: 'openai' },
51
- { id: 'vercel/openai/gpt-4o', model: 'gpt-4o', provider: 'openai' },
52
- { id: 'vercel/openai/gpt-4o-mini', model: 'gpt-4o-mini', provider: 'openai' },
53
- { id: 'vercel/anthropic/claude-3-7-sonnet-20250219', model: 'claude-3-7-sonnet-20250219', provider: 'anthropic' },
54
- { id: 'vercel/anthropic/claude-3-5-haiku-20241022', model: 'claude-3-5-haiku-20241022', provider: 'anthropic' },
55
- { id: 'vercel/anthropic/claude-3-opus-20240229', model: 'claude-3-opus-20240229', provider: 'anthropic' }
56
- ],
57
- items: {
58
- type: 'object',
59
- properties: {
60
- id: {
61
- type: 'string',
62
- title: core_1.nls.localize('theia/ai/vercelai/models/id/title', 'Model ID')
63
- },
64
- model: {
65
- type: 'string',
66
- title: core_1.nls.localize('theia/ai/vercelai/models/model/title', 'Model Name')
67
- },
68
- provider: {
69
- type: 'string',
70
- enum: ['openai', 'anthropic'],
71
- title: core_1.nls.localize('theia/ai/vercelai/models/provider/title', 'Provider')
72
- }
73
- },
74
- required: ['id', 'model', 'provider']
75
- }
76
- },
77
- [exports.CUSTOM_ENDPOINTS_PREF]: {
78
- type: 'array',
79
- title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
80
- markdownDescription: core_1.nls.localize('theia/ai/vercelai/customEndpoints/mdDescription', 'Integrate custom models compatible with the Vercel AI SDK. The required attributes are `model` and `url`.\
81
- \n\
82
- Optionally, you can\
83
- \n\
84
- - specify a unique `id` to identify the custom model in the UI. If none is given `model` will be used as `id`.\
85
- \n\
86
- - provide an `apiKey` to access the API served at the given url. Use `true` to indicate the use of the global API key.\
87
- \n\
88
- - specify `supportsStructuredOutput: false` to indicate that structured output shall not be used.\
89
- \n\
90
- - specify `enableStreaming: false` to indicate that streaming shall not be used.\
91
- \n\
92
- - specify `provider` to indicate which provider the model is from (openai, anthropic).'),
93
- default: [],
94
- items: {
95
- type: 'object',
96
- properties: {
97
- model: {
98
- type: 'string',
99
- title: core_1.nls.localize('theia/ai/vercelai/customEndpoints/modelId/title', 'Model ID')
100
- },
101
- url: {
102
- type: 'string',
103
- title: core_1.nls.localize('theia/ai/vercelai/customEndpoints/url/title', 'The API endpoint where the model is hosted')
104
- },
105
- id: {
106
- type: 'string',
107
- title: core_1.nls.localize('theia/ai/vercelai/customEndpoints/id/title', 'A unique identifier which is used in the UI to identify the custom model'),
108
- },
109
- provider: {
110
- type: 'string',
111
- enum: ['openai', 'anthropic'],
112
- title: core_1.nls.localize('theia/ai/vercelai/customEndpoints/provider/title', 'Provider')
113
- },
114
- apiKey: {
115
- type: ['string', 'boolean'],
116
- title: core_1.nls.localize('theia/ai/vercelai/customEndpoints/apiKey/title', 'Either the key to access the API served at the given url or `true` to use the global API key'),
117
- },
118
- supportsStructuredOutput: {
119
- type: 'boolean',
120
- title: core_1.nls.localize('theia/ai/vercelai/customEndpoints/supportsStructuredOutput/title', 'Indicates whether the model supports structured output. `true` by default.'),
121
- },
122
- enableStreaming: {
123
- type: 'boolean',
124
- title: core_1.nls.localize('theia/ai/vercelai/customEndpoints/enableStreaming/title', 'Indicates whether the streaming API shall be used. `true` by default.'),
125
- }
126
- }
127
- }
128
- }
129
- }
130
- };
131
- //# sourceMappingURL=vercel-ai-preferences.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercel-ai-preferences.js","sourceRoot":"","sources":["../../src/common/vercel-ai-preferences.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,uFAA0F;AAC1F,sCAAoD;AAEvC,QAAA,mBAAmB,GAAG,mCAAmC,CAAC;AAC1D,QAAA,sBAAsB,GAAG,sCAAsC,CAAC;AAChE,QAAA,WAAW,GAAG,qCAAqC,CAAC;AACpD,QAAA,qBAAqB,GAAG,mCAAmC,CAAC;AAE5D,QAAA,qBAAqB,GAAG,WAAW,CAAC;AAEpC,QAAA,yBAAyB,GAAqB;IACvD,UAAU,EAAE;QACR,CAAC,2BAAmB,CAAC,EAAE;YACnB,IAAI,EAAE,QAAQ;YACd,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,8CAA8C,EAC5E;;qGAEqF,CAAC;YAC1F,KAAK,EAAE,+CAAyB;SACnC;QACD,CAAC,8BAAsB,CAAC,EAAE;YACtB,IAAI,EAAE,QAAQ;YACd,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,iDAAiD,EAC/E;;wGAEwF,CAAC;YAC7F,KAAK,EAAE,+CAAyB;SACnC;QACD,CAAC,mBAAW,CAAC,EAAE;YACX,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,sCAAsC,EAAE,2CAA2C,CAAC;YAC9G,KAAK,EAAE,+CAAyB;YAChC,OAAO,EAAE;gBACL,EAAE,EAAE,EAAE,uBAAuB,EAAE,KAA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AK,EAAE,UAAG,CAAC,QAAQ,CAAC,yDAAyD,EACzE,uEAAuE,CAAC;qBAC/E;iBACJ;aACJ;SACJ;KACJ;CACJ,CAAC"}
@@ -1,4 +0,0 @@
1
- import { ContainerModule } from '@theia/core/shared/inversify';
2
- declare const _default: ContainerModule;
3
- export default _default;
4
- //# sourceMappingURL=vercel-ai-backend-module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercel-ai-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/vercel-ai-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAiB/D,wBAGG"}