@theia/ai-anthropic 1.65.0-next.19 → 1.65.0-next.39
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/browser/anthropic-frontend-application-contribution.d.ts +3 -2
- package/lib/browser/anthropic-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/anthropic-frontend-application-contribution.js +4 -4
- package/lib/browser/anthropic-frontend-application-contribution.js.map +1 -1
- package/lib/browser/anthropic-frontend-module.d.ts.map +1 -1
- package/lib/browser/anthropic-frontend-module.js +3 -2
- package/lib/browser/anthropic-frontend-module.js.map +1 -1
- package/lib/{browser → common}/anthropic-preferences.d.ts +1 -1
- package/lib/common/anthropic-preferences.d.ts.map +1 -0
- package/lib/{browser → common}/anthropic-preferences.js +1 -2
- package/lib/common/anthropic-preferences.js.map +1 -0
- package/lib/node/anthropic-backend-module.d.ts.map +1 -1
- package/lib/node/anthropic-backend-module.js +2 -0
- package/lib/node/anthropic-backend-module.js.map +1 -1
- package/package.json +4 -4
- package/src/browser/anthropic-frontend-application-contribution.ts +5 -4
- package/src/browser/anthropic-frontend-module.ts +3 -2
- package/src/{browser → common}/anthropic-preferences.ts +3 -5
- package/src/node/anthropic-backend-module.ts +3 -1
- package/lib/browser/anthropic-preferences.d.ts.map +0 -1
- package/lib/browser/anthropic-preferences.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FrontendApplicationContribution
|
|
1
|
+
import { FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
2
2
|
import { AnthropicLanguageModelsManager, AnthropicModelDescription } from '../common';
|
|
3
|
-
import { AICorePreferences } from '@theia/ai-core/lib/
|
|
3
|
+
import { AICorePreferences } from '@theia/ai-core/lib/common/ai-core-preferences';
|
|
4
|
+
import { PreferenceService } from '@theia/core';
|
|
4
5
|
export declare class AnthropicFrontendApplicationContribution implements FrontendApplicationContribution {
|
|
5
6
|
protected preferenceService: PreferenceService;
|
|
6
7
|
protected manager: AnthropicLanguageModelsManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-frontend-application-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/anthropic-frontend-application-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,+BAA+B,EAAE,
|
|
1
|
+
{"version":3,"file":"anthropic-frontend-application-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/anthropic-frontend-application-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAEtF,OAAO,EAAE,iBAAiB,EAA+B,MAAM,+CAA+C,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAchD,qBACa,wCAAyC,YAAW,+BAA+B;IAG5F,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAG/C,SAAS,CAAC,OAAO,EAAE,8BAA8B,CAAC;IAGlD,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE/C,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,CAAM;IAEpC,OAAO,IAAI,IAAI;IA0Bf,SAAS,CAAC,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAYvD,SAAS,CAAC,eAAe,IAAI,IAAI;IAKjC,SAAS,CAAC,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,yBAAyB;CAuBxF"}
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.AnthropicFrontendApplicationContribution = void 0;
|
|
19
19
|
const tslib_1 = require("tslib");
|
|
20
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
21
20
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
21
|
const common_1 = require("../common");
|
|
23
|
-
const anthropic_preferences_1 = require("
|
|
24
|
-
const ai_core_preferences_1 = require("@theia/ai-core/lib/
|
|
22
|
+
const anthropic_preferences_1 = require("../common/anthropic-preferences");
|
|
23
|
+
const ai_core_preferences_1 = require("@theia/ai-core/lib/common/ai-core-preferences");
|
|
24
|
+
const core_1 = require("@theia/core");
|
|
25
25
|
const ANTHROPIC_PROVIDER_ID = 'anthropic';
|
|
26
26
|
// Model-specific maxTokens values
|
|
27
27
|
const DEFAULT_MODEL_MAX_TOKENS = {
|
|
@@ -96,7 +96,7 @@ let AnthropicFrontendApplicationContribution = class AnthropicFrontendApplicatio
|
|
|
96
96
|
};
|
|
97
97
|
exports.AnthropicFrontendApplicationContribution = AnthropicFrontendApplicationContribution;
|
|
98
98
|
tslib_1.__decorate([
|
|
99
|
-
(0, inversify_1.inject)(
|
|
99
|
+
(0, inversify_1.inject)(core_1.PreferenceService),
|
|
100
100
|
tslib_1.__metadata("design:type", Object)
|
|
101
101
|
], AnthropicFrontendApplicationContribution.prototype, "preferenceService", void 0);
|
|
102
102
|
tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-frontend-application-contribution.js","sourceRoot":"","sources":["../../src/browser/anthropic-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;;;;
|
|
1
|
+
{"version":3,"file":"anthropic-frontend-application-contribution.js","sourceRoot":"","sources":["../../src/browser/anthropic-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,6E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":3,"file":"anthropic-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/anthropic-frontend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;
|
|
1
|
+
{"version":3,"file":"anthropic-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/anthropic-frontend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAO/D,wBAQG"}
|
|
@@ -16,12 +16,13 @@
|
|
|
16
16
|
// *****************************************************************************
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
|
-
const anthropic_preferences_1 = require("
|
|
19
|
+
const anthropic_preferences_1 = require("../common/anthropic-preferences");
|
|
20
20
|
const browser_1 = require("@theia/core/lib/browser");
|
|
21
21
|
const anthropic_frontend_application_contribution_1 = require("./anthropic-frontend-application-contribution");
|
|
22
22
|
const common_1 = require("../common");
|
|
23
|
+
const core_1 = require("@theia/core");
|
|
23
24
|
exports.default = new inversify_1.ContainerModule(bind => {
|
|
24
|
-
bind(
|
|
25
|
+
bind(core_1.PreferenceContribution).toConstantValue({ schema: anthropic_preferences_1.AnthropicPreferencesSchema });
|
|
25
26
|
bind(anthropic_frontend_application_contribution_1.AnthropicFrontendApplicationContribution).toSelf().inSingletonScope();
|
|
26
27
|
bind(browser_1.FrontendApplicationContribution).toService(anthropic_frontend_application_contribution_1.AnthropicFrontendApplicationContribution);
|
|
27
28
|
bind(common_1.AnthropicLanguageModelsManager).toDynamicValue(ctx => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-frontend-module.js","sourceRoot":"","sources":["../../src/browser/anthropic-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,
|
|
1
|
+
{"version":3,"file":"anthropic-frontend-module.js","sourceRoot":"","sources":["../../src/browser/anthropic-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,2EAA6E;AAC7E,qDAA+H;AAC/H,+GAAyG;AACzG,sCAAmG;AACnG,sCAAqD;AAErD,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,6BAAsB,CAAC,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,kDAA0B,EAAE,CAAC,CAAC;IACrF,IAAI,CAAC,sFAAwC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC3E,IAAI,CAAC,yCAA+B,CAAC,CAAC,SAAS,CAAC,sFAAwC,CAAC,CAAC;IAC1F,IAAI,CAAC,uCAA8B,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QACtD,MAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAA4B,kCAAwB,CAAC,CAAC;QACxF,OAAO,QAAQ,CAAC,WAAW,CAAiC,+CAAsC,CAAC,CAAC;IACxG,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PreferenceSchema } from '@theia/core
|
|
1
|
+
import { PreferenceSchema } from '@theia/core';
|
|
2
2
|
export declare const API_KEY_PREF = "ai-features.anthropic.AnthropicApiKey";
|
|
3
3
|
export declare const MODELS_PREF = "ai-features.anthropic.AnthropicModels";
|
|
4
4
|
export declare const AnthropicPreferencesSchema: PreferenceSchema;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic-preferences.d.ts","sourceRoot":"","sources":["../../src/common/anthropic-preferences.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAO,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,eAAO,MAAM,YAAY,0CAA0C,CAAC;AACpE,eAAO,MAAM,WAAW,0CAA0C,CAAC;AAEnE,eAAO,MAAM,0BAA0B,EAAE,gBAoBxC,CAAC"}
|
|
@@ -16,12 +16,11 @@
|
|
|
16
16
|
// *****************************************************************************
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.AnthropicPreferencesSchema = exports.MODELS_PREF = exports.API_KEY_PREF = void 0;
|
|
19
|
-
const ai_core_preferences_1 = require("@theia/ai-core/lib/
|
|
19
|
+
const ai_core_preferences_1 = require("@theia/ai-core/lib/common/ai-core-preferences");
|
|
20
20
|
const core_1 = require("@theia/core");
|
|
21
21
|
exports.API_KEY_PREF = 'ai-features.anthropic.AnthropicApiKey';
|
|
22
22
|
exports.MODELS_PREF = 'ai-features.anthropic.AnthropicModels';
|
|
23
23
|
exports.AnthropicPreferencesSchema = {
|
|
24
|
-
type: 'object',
|
|
25
24
|
properties: {
|
|
26
25
|
[exports.API_KEY_PREF]: {
|
|
27
26
|
type: 'string',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic-preferences.js","sourceRoot":"","sources":["../../src/common/anthropic-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,YAAY,GAAG,uCAAuC,CAAC;AACvD,QAAA,WAAW,GAAG,uCAAuC,CAAC;AAEtD,QAAA,0BAA0B,GAAqB;IACxD,UAAU,EAAE;QACR,CAAC,oBAAY,CAAC,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,uCAAuC,EACrE;oHACoG,CAAC;YACzG,KAAK,EAAE,+CAAyB;SACnC;QACD,CAAC,mBAAW,CAAC,EAAE;YACX,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,uCAAuC,EAAE,kCAAkC,CAAC;YACtG,KAAK,EAAE,+CAAyB;YAChC,OAAO,EAAE,CAAC,0BAA0B,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,wBAAwB;gBACzI,0BAA0B,CAAC;YAC/B,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB;SACJ;KACJ;CACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/anthropic-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;
|
|
1
|
+
{"version":3,"file":"anthropic-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/anthropic-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAgB/D,wBAGG"}
|
|
@@ -20,6 +20,7 @@ const anthropic_language_models_manager_1 = require("../common/anthropic-languag
|
|
|
20
20
|
const core_1 = require("@theia/core");
|
|
21
21
|
const anthropic_language_models_manager_impl_1 = require("./anthropic-language-models-manager-impl");
|
|
22
22
|
const connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
|
|
23
|
+
const anthropic_preferences_1 = require("../common/anthropic-preferences");
|
|
23
24
|
// We use a connection module to handle AI services separately for each frontend.
|
|
24
25
|
const anthropicConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind, bindBackendService, bindFrontendService }) => {
|
|
25
26
|
bind(anthropic_language_models_manager_impl_1.AnthropicLanguageModelsManagerImpl).toSelf().inSingletonScope();
|
|
@@ -27,6 +28,7 @@ const anthropicConnectionModule = connection_container_module_1.ConnectionContai
|
|
|
27
28
|
bind(core_1.ConnectionHandler).toDynamicValue(ctx => new core_1.RpcConnectionHandler(anthropic_language_models_manager_1.ANTHROPIC_LANGUAGE_MODELS_MANAGER_PATH, () => ctx.container.get(anthropic_language_models_manager_1.AnthropicLanguageModelsManager))).inSingletonScope();
|
|
28
29
|
});
|
|
29
30
|
exports.default = new inversify_1.ContainerModule(bind => {
|
|
31
|
+
bind(core_1.PreferenceContribution).toConstantValue({ schema: anthropic_preferences_1.AnthropicPreferencesSchema });
|
|
30
32
|
bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(anthropicConnectionModule);
|
|
31
33
|
});
|
|
32
34
|
//# sourceMappingURL=anthropic-backend-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-backend-module.js","sourceRoot":"","sources":["../../src/node/anthropic-backend-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,mGAAqI;AACrI,
|
|
1
|
+
{"version":3,"file":"anthropic-backend-module.js","sourceRoot":"","sources":["../../src/node/anthropic-backend-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,mGAAqI;AACrI,sCAA8F;AAC9F,qGAA8F;AAC9F,4GAAuG;AACvG,2EAA6E;AAE7E,iFAAiF;AACjF,MAAM,yBAAyB,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,EAAE,EAAE;IACrH,IAAI,CAAC,2EAAkC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACrE,IAAI,CAAC,kEAA8B,CAAC,CAAC,SAAS,CAAC,2EAAkC,CAAC,CAAC;IACnF,IAAI,CAAC,wBAAiB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CACzC,IAAI,2BAAoB,CAAC,0EAAsC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,kEAA8B,CAAC,CAAC,CAC5H,CAAC,gBAAgB,EAAE,CAAC;AACzB,CAAC,CAAC,CAAC;AAEH,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,6BAAsB,CAAC,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,kDAA0B,EAAE,CAAC,CAAC;IACrF,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAC/E,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/ai-anthropic",
|
|
3
|
-
"version": "1.65.0-next.
|
|
3
|
+
"version": "1.65.0-next.39+9fb7a8852",
|
|
4
4
|
"description": "Theia - Anthropic Integration",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@anthropic-ai/sdk": "^0.52.0",
|
|
7
|
-
"@theia/ai-core": "1.65.0-next.
|
|
8
|
-
"@theia/core": "1.65.0-next.
|
|
7
|
+
"@theia/ai-core": "1.65.0-next.39+9fb7a8852",
|
|
8
|
+
"@theia/core": "1.65.0-next.39+9fb7a8852"
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"nyc": {
|
|
47
47
|
"extends": "../../configs/nyc.json"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "9fb7a8852ad66d67570471b2e11bee5158f5c5d9"
|
|
50
50
|
}
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { FrontendApplicationContribution
|
|
17
|
+
import { FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
18
18
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
19
19
|
import { AnthropicLanguageModelsManager, AnthropicModelDescription } from '../common';
|
|
20
|
-
import { API_KEY_PREF, MODELS_PREF } from '
|
|
21
|
-
import { AICorePreferences, PREFERENCE_NAME_MAX_RETRIES } from '@theia/ai-core/lib/
|
|
20
|
+
import { API_KEY_PREF, MODELS_PREF } from '../common/anthropic-preferences';
|
|
21
|
+
import { AICorePreferences, PREFERENCE_NAME_MAX_RETRIES } from '@theia/ai-core/lib/common/ai-core-preferences';
|
|
22
|
+
import { PreferenceService } from '@theia/core';
|
|
22
23
|
|
|
23
24
|
const ANTHROPIC_PROVIDER_ID = 'anthropic';
|
|
24
25
|
|
|
@@ -57,7 +58,7 @@ export class AnthropicFrontendApplicationContribution implements FrontendApplica
|
|
|
57
58
|
|
|
58
59
|
this.preferenceService.onPreferenceChanged(event => {
|
|
59
60
|
if (event.preferenceName === API_KEY_PREF) {
|
|
60
|
-
this.manager.setApiKey(event.newValue);
|
|
61
|
+
this.manager.setApiKey(event.newValue as string);
|
|
61
62
|
this.updateAllModels();
|
|
62
63
|
} else if (event.preferenceName === MODELS_PREF) {
|
|
63
64
|
this.handleModelChanges(event.newValue as string[]);
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
18
|
-
import { AnthropicPreferencesSchema } from '
|
|
19
|
-
import { FrontendApplicationContribution,
|
|
18
|
+
import { AnthropicPreferencesSchema } from '../common/anthropic-preferences';
|
|
19
|
+
import { FrontendApplicationContribution, RemoteConnectionProvider, ServiceConnectionProvider } from '@theia/core/lib/browser';
|
|
20
20
|
import { AnthropicFrontendApplicationContribution } from './anthropic-frontend-application-contribution';
|
|
21
21
|
import { ANTHROPIC_LANGUAGE_MODELS_MANAGER_PATH, AnthropicLanguageModelsManager } from '../common';
|
|
22
|
+
import { PreferenceContribution } from '@theia/core';
|
|
22
23
|
|
|
23
24
|
export default new ContainerModule(bind => {
|
|
24
25
|
bind(PreferenceContribution).toConstantValue({ schema: AnthropicPreferencesSchema });
|
|
@@ -14,15 +14,13 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { nls } from '@theia/core';
|
|
17
|
+
import { AI_CORE_PREFERENCES_TITLE } from '@theia/ai-core/lib/common/ai-core-preferences';
|
|
18
|
+
import { nls, PreferenceSchema } from '@theia/core';
|
|
20
19
|
|
|
21
20
|
export const API_KEY_PREF = 'ai-features.anthropic.AnthropicApiKey';
|
|
22
21
|
export const MODELS_PREF = 'ai-features.anthropic.AnthropicModels';
|
|
23
22
|
|
|
24
23
|
export const AnthropicPreferencesSchema: PreferenceSchema = {
|
|
25
|
-
type: 'object',
|
|
26
24
|
properties: {
|
|
27
25
|
[API_KEY_PREF]: {
|
|
28
26
|
type: 'string',
|
|
@@ -36,7 +34,7 @@ export const AnthropicPreferencesSchema: PreferenceSchema = {
|
|
|
36
34
|
description: nls.localize('theia/ai/anthropic/models/description', 'Official Anthropic models to use'),
|
|
37
35
|
title: AI_CORE_PREFERENCES_TITLE,
|
|
38
36
|
default: ['claude-3-7-sonnet-latest', 'claude-3-5-sonnet-latest', 'claude-3-5-haiku-latest', 'claude-3-opus-latest', 'claude-opus-4-20250514',
|
|
39
|
-
|
|
37
|
+
'claude-sonnet-4-20250514'],
|
|
40
38
|
items: {
|
|
41
39
|
type: 'string'
|
|
42
40
|
}
|
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
18
18
|
import { ANTHROPIC_LANGUAGE_MODELS_MANAGER_PATH, AnthropicLanguageModelsManager } from '../common/anthropic-language-models-manager';
|
|
19
|
-
import { ConnectionHandler, RpcConnectionHandler } from '@theia/core';
|
|
19
|
+
import { ConnectionHandler, PreferenceContribution, RpcConnectionHandler } from '@theia/core';
|
|
20
20
|
import { AnthropicLanguageModelsManagerImpl } from './anthropic-language-models-manager-impl';
|
|
21
21
|
import { ConnectionContainerModule } from '@theia/core/lib/node/messaging/connection-container-module';
|
|
22
|
+
import { AnthropicPreferencesSchema } from '../common/anthropic-preferences';
|
|
22
23
|
|
|
23
24
|
// We use a connection module to handle AI services separately for each frontend.
|
|
24
25
|
const anthropicConnectionModule = ConnectionContainerModule.create(({ bind, bindBackendService, bindFrontendService }) => {
|
|
@@ -30,5 +31,6 @@ const anthropicConnectionModule = ConnectionContainerModule.create(({ bind, bind
|
|
|
30
31
|
});
|
|
31
32
|
|
|
32
33
|
export default new ContainerModule(bind => {
|
|
34
|
+
bind(PreferenceContribution).toConstantValue({ schema: AnthropicPreferencesSchema });
|
|
33
35
|
bind(ConnectionContainerModule).toConstantValue(anthropicConnectionModule);
|
|
34
36
|
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-preferences.d.ts","sourceRoot":"","sources":["../../src/browser/anthropic-preferences.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6DAA6D,CAAC;AAI/F,eAAO,MAAM,YAAY,0CAA0C,CAAC;AACpE,eAAO,MAAM,WAAW,0CAA0C,CAAC;AAEnE,eAAO,MAAM,0BAA0B,EAAE,gBAqBxC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-preferences.js","sourceRoot":"","sources":["../../src/browser/anthropic-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;;;AAGhF,wFAA2F;AAC3F,sCAAkC;AAErB,QAAA,YAAY,GAAG,uCAAuC,CAAC;AACvD,QAAA,WAAW,GAAG,uCAAuC,CAAC;AAEtD,QAAA,0BAA0B,GAAqB;IACxD,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,CAAC,oBAAY,CAAC,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,uCAAuC,EACrE;oHACoG,CAAC;YACzG,KAAK,EAAE,+CAAyB;SACnC;QACD,CAAC,mBAAW,CAAC,EAAE;YACX,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,uCAAuC,EAAE,kCAAkC,CAAC;YACtG,KAAK,EAAE,+CAAyB;YAChC,OAAO,EAAE,CAAC,0BAA0B,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,wBAAwB;gBACxI,0BAA0B,CAAC;YAChC,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB;SACJ;KACJ;CACJ,CAAC"}
|