@theia/ai-core 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.
- package/README.md +1 -0
- package/data/prompttemplate.tmLanguage.json +3 -0
- package/package.json +9 -9
- package/src/browser/frontend-language-model-alias-registry.ts +11 -11
- package/src/common/agent-service.ts +6 -6
- package/src/common/prompt-service.ts +6 -2
- package/lib/browser/agent-completion-notification-service.d.ts +0 -69
- package/lib/browser/agent-completion-notification-service.d.ts.map +0 -1
- package/lib/browser/agent-completion-notification-service.js +0 -187
- package/lib/browser/agent-completion-notification-service.js.map +0 -1
- package/lib/browser/ai-activation-service.d.ts +0 -31
- package/lib/browser/ai-activation-service.d.ts.map +0 -1
- package/lib/browser/ai-activation-service.js +0 -56
- package/lib/browser/ai-activation-service.js.map +0 -1
- package/lib/browser/ai-command-handler-factory.d.ts +0 -4
- package/lib/browser/ai-command-handler-factory.d.ts.map +0 -1
- package/lib/browser/ai-command-handler-factory.js +0 -20
- package/lib/browser/ai-command-handler-factory.js.map +0 -1
- package/lib/browser/ai-core-command-contribution.d.ts +0 -8
- package/lib/browser/ai-core-command-contribution.d.ts.map +0 -1
- package/lib/browser/ai-core-command-contribution.js +0 -44
- package/lib/browser/ai-core-command-contribution.js.map +0 -1
- package/lib/browser/ai-core-frontend-application-contribution.d.ts +0 -10
- package/lib/browser/ai-core-frontend-application-contribution.d.ts.map +0 -1
- package/lib/browser/ai-core-frontend-application-contribution.js +0 -46
- package/lib/browser/ai-core-frontend-application-contribution.js.map +0 -1
- package/lib/browser/ai-core-frontend-module.d.ts +0 -4
- package/lib/browser/ai-core-frontend-module.d.ts.map +0 -1
- package/lib/browser/ai-core-frontend-module.js +0 -137
- package/lib/browser/ai-core-frontend-module.js.map +0 -1
- package/lib/browser/ai-settings-service.d.ts +0 -16
- package/lib/browser/ai-settings-service.d.ts.map +0 -1
- package/lib/browser/ai-settings-service.js +0 -78
- package/lib/browser/ai-settings-service.js.map +0 -1
- package/lib/browser/ai-variable-uri-label-provider.d.ts +0 -17
- package/lib/browser/ai-variable-uri-label-provider.d.ts.map +0 -1
- package/lib/browser/ai-variable-uri-label-provider.js +0 -85
- package/lib/browser/ai-variable-uri-label-provider.js.map +0 -1
- package/lib/browser/ai-view-contribution.d.ts +0 -14
- package/lib/browser/ai-view-contribution.d.ts.map +0 -1
- package/lib/browser/ai-view-contribution.js +0 -87
- package/lib/browser/ai-view-contribution.js.map +0 -1
- package/lib/browser/file-variable-contribution.d.ts +0 -23
- package/lib/browser/file-variable-contribution.d.ts.map +0 -1
- package/lib/browser/file-variable-contribution.js +0 -114
- package/lib/browser/file-variable-contribution.js.map +0 -1
- package/lib/browser/frontend-language-model-alias-registry.d.ts +0 -31
- package/lib/browser/frontend-language-model-alias-registry.d.ts.map +0 -1
- package/lib/browser/frontend-language-model-alias-registry.js +0 -170
- package/lib/browser/frontend-language-model-alias-registry.js.map +0 -1
- package/lib/browser/frontend-language-model-registry.d.ts +0 -49
- package/lib/browser/frontend-language-model-registry.d.ts.map +0 -1
- package/lib/browser/frontend-language-model-registry.js +0 -387
- package/lib/browser/frontend-language-model-registry.js.map +0 -1
- package/lib/browser/frontend-language-model-registry.spec.d.ts +0 -2
- package/lib/browser/frontend-language-model-registry.spec.d.ts.map +0 -1
- package/lib/browser/frontend-language-model-registry.spec.js +0 -248
- package/lib/browser/frontend-language-model-registry.spec.js.map +0 -1
- package/lib/browser/frontend-language-model-service.d.ts +0 -10
- package/lib/browser/frontend-language-model-service.d.ts.map +0 -1
- package/lib/browser/frontend-language-model-service.js +0 -66
- package/lib/browser/frontend-language-model-service.js.map +0 -1
- package/lib/browser/frontend-prompt-customization-service.d.ts +0 -271
- package/lib/browser/frontend-prompt-customization-service.d.ts.map +0 -1
- package/lib/browser/frontend-prompt-customization-service.js +0 -869
- package/lib/browser/frontend-prompt-customization-service.js.map +0 -1
- package/lib/browser/frontend-prompt-customization-service.spec.d.ts +0 -2
- package/lib/browser/frontend-prompt-customization-service.spec.d.ts.map +0 -1
- package/lib/browser/frontend-prompt-customization-service.spec.js +0 -127
- package/lib/browser/frontend-prompt-customization-service.spec.js.map +0 -1
- package/lib/browser/frontend-variable-service.d.ts +0 -61
- package/lib/browser/frontend-variable-service.d.ts.map +0 -1
- package/lib/browser/frontend-variable-service.js +0 -165
- package/lib/browser/frontend-variable-service.js.map +0 -1
- package/lib/browser/index.d.ts +0 -20
- package/lib/browser/index.d.ts.map +0 -1
- package/lib/browser/index.js +0 -38
- package/lib/browser/index.js.map +0 -1
- package/lib/browser/open-editors-variable-contribution.d.ts +0 -17
- package/lib/browser/open-editors-variable-contribution.d.ts.map +0 -1
- package/lib/browser/open-editors-variable-contribution.js +0 -84
- package/lib/browser/open-editors-variable-contribution.js.map +0 -1
- package/lib/browser/os-notification-service.d.ts +0 -96
- package/lib/browser/os-notification-service.d.ts.map +0 -1
- package/lib/browser/os-notification-service.js +0 -222
- package/lib/browser/os-notification-service.js.map +0 -1
- package/lib/browser/prompttemplate-contribution.d.ts +0 -29
- package/lib/browser/prompttemplate-contribution.d.ts.map +0 -1
- package/lib/browser/prompttemplate-contribution.js +0 -243
- package/lib/browser/prompttemplate-contribution.js.map +0 -1
- package/lib/browser/prompttemplate-parser.d.ts +0 -36
- package/lib/browser/prompttemplate-parser.d.ts.map +0 -1
- package/lib/browser/prompttemplate-parser.js +0 -94
- package/lib/browser/prompttemplate-parser.js.map +0 -1
- package/lib/browser/theia-variable-contribution.d.ts +0 -26
- package/lib/browser/theia-variable-contribution.d.ts.map +0 -1
- package/lib/browser/theia-variable-contribution.js +0 -146
- package/lib/browser/theia-variable-contribution.js.map +0 -1
- package/lib/browser/token-usage-frontend-service-impl.d.ts +0 -25
- package/lib/browser/token-usage-frontend-service-impl.d.ts.map +0 -1
- package/lib/browser/token-usage-frontend-service-impl.js +0 -138
- package/lib/browser/token-usage-frontend-service-impl.js.map +0 -1
- package/lib/browser/token-usage-frontend-service.d.ts +0 -33
- package/lib/browser/token-usage-frontend-service.d.ts.map +0 -1
- package/lib/browser/token-usage-frontend-service.js +0 -23
- package/lib/browser/token-usage-frontend-service.js.map +0 -1
- package/lib/browser/window-blink-service.d.ts +0 -41
- package/lib/browser/window-blink-service.d.ts.map +0 -1
- package/lib/browser/window-blink-service.js +0 -174
- package/lib/browser/window-blink-service.js.map +0 -1
- package/lib/common/agent-preferences.d.ts +0 -4
- package/lib/common/agent-preferences.d.ts.map +0 -1
- package/lib/common/agent-preferences.js +0 -84
- package/lib/common/agent-preferences.js.map +0 -1
- package/lib/common/agent-service.d.ts +0 -66
- package/lib/common/agent-service.d.ts.map +0 -1
- package/lib/common/agent-service.js +0 -104
- package/lib/common/agent-service.js.map +0 -1
- package/lib/common/agent.d.ts +0 -72
- package/lib/common/agent.d.ts.map +0 -1
- package/lib/common/agent.js +0 -20
- package/lib/common/agent.js.map +0 -1
- package/lib/common/agents-variable-contribution.d.ts +0 -19
- package/lib/common/agents-variable-contribution.d.ts.map +0 -1
- package/lib/common/agents-variable-contribution.js +0 -57
- package/lib/common/agents-variable-contribution.js.map +0 -1
- package/lib/common/ai-core-preferences.d.ts +0 -48
- package/lib/common/ai-core-preferences.d.ts.map +0 -1
- package/lib/common/ai-core-preferences.js +0 -204
- package/lib/common/ai-core-preferences.js.map +0 -1
- package/lib/common/ai-variable-resource.d.ts +0 -18
- package/lib/common/ai-variable-resource.d.ts.map +0 -1
- package/lib/common/ai-variable-resource.js +0 -103
- package/lib/common/ai-variable-resource.js.map +0 -1
- package/lib/common/configurable-in-memory-resources.d.ts +0 -47
- package/lib/common/configurable-in-memory-resources.d.ts.map +0 -1
- package/lib/common/configurable-in-memory-resources.js +0 -154
- package/lib/common/configurable-in-memory-resources.js.map +0 -1
- package/lib/common/index.d.ts +0 -22
- package/lib/common/index.d.ts.map +0 -1
- package/lib/common/index.js +0 -40
- package/lib/common/index.js.map +0 -1
- package/lib/common/language-model-alias.d.ts +0 -58
- package/lib/common/language-model-alias.d.ts.map +0 -1
- package/lib/common/language-model-alias.js +0 -20
- package/lib/common/language-model-alias.js.map +0 -1
- package/lib/common/language-model-delegate.d.ts +0 -25
- package/lib/common/language-model-delegate.d.ts.map +0 -1
- package/lib/common/language-model-delegate.js +0 -26
- package/lib/common/language-model-delegate.js.map +0 -1
- package/lib/common/language-model-interaction-model.d.ts +0 -74
- package/lib/common/language-model-interaction-model.d.ts.map +0 -1
- package/lib/common/language-model-interaction-model.js +0 -3
- package/lib/common/language-model-interaction-model.js.map +0 -1
- package/lib/common/language-model-service.d.ts +0 -38
- package/lib/common/language-model-service.d.ts.map +0 -1
- package/lib/common/language-model-service.js +0 -128
- package/lib/common/language-model-service.js.map +0 -1
- package/lib/common/language-model-util.d.ts +0 -17
- package/lib/common/language-model-util.d.ts.map +0 -1
- package/lib/common/language-model-util.js +0 -82
- package/lib/common/language-model-util.js.map +0 -1
- package/lib/common/language-model.d.ts +0 -285
- package/lib/common/language-model.d.ts.map +0 -1
- package/lib/common/language-model.js +0 -248
- package/lib/common/language-model.js.map +0 -1
- package/lib/common/language-model.spec.d.ts +0 -2
- package/lib/common/language-model.spec.d.ts.map +0 -1
- package/lib/common/language-model.spec.js +0 -62
- package/lib/common/language-model.spec.js.map +0 -1
- package/lib/common/notification-types.d.ts +0 -7
- package/lib/common/notification-types.d.ts.map +0 -1
- package/lib/common/notification-types.js +0 -29
- package/lib/common/notification-types.js.map +0 -1
- package/lib/common/prompt-service-util.d.ts +0 -8
- package/lib/common/prompt-service-util.d.ts.map +0 -1
- package/lib/common/prompt-service-util.js +0 -34
- package/lib/common/prompt-service-util.js.map +0 -1
- package/lib/common/prompt-service.d.ts +0 -466
- package/lib/common/prompt-service.d.ts.map +0 -1
- package/lib/common/prompt-service.js +0 -653
- package/lib/common/prompt-service.js.map +0 -1
- package/lib/common/prompt-service.spec.d.ts +0 -2
- package/lib/common/prompt-service.spec.d.ts.map +0 -1
- package/lib/common/prompt-service.spec.js +0 -431
- package/lib/common/prompt-service.spec.js.map +0 -1
- package/lib/common/prompt-text.d.ts +0 -8
- package/lib/common/prompt-text.d.ts.map +0 -1
- package/lib/common/prompt-text.js +0 -27
- package/lib/common/prompt-text.js.map +0 -1
- package/lib/common/prompt-variable-contribution.d.ts +0 -18
- package/lib/common/prompt-variable-contribution.d.ts.map +0 -1
- package/lib/common/prompt-variable-contribution.js +0 -207
- package/lib/common/prompt-variable-contribution.js.map +0 -1
- package/lib/common/prompt-variable-contribution.spec.d.ts +0 -2
- package/lib/common/prompt-variable-contribution.spec.d.ts.map +0 -1
- package/lib/common/prompt-variable-contribution.spec.js +0 -163
- package/lib/common/prompt-variable-contribution.spec.js.map +0 -1
- package/lib/common/protocol.d.ts +0 -25
- package/lib/common/protocol.d.ts.map +0 -1
- package/lib/common/protocol.js +0 -22
- package/lib/common/protocol.js.map +0 -1
- package/lib/common/settings-service.d.ts +0 -29
- package/lib/common/settings-service.d.ts.map +0 -1
- package/lib/common/settings-service.js +0 -5
- package/lib/common/settings-service.js.map +0 -1
- package/lib/common/today-variable-contribution.d.ts +0 -17
- package/lib/common/today-variable-contribution.d.ts.map +0 -1
- package/lib/common/today-variable-contribution.js +0 -68
- package/lib/common/today-variable-contribution.js.map +0 -1
- package/lib/common/token-usage-service.d.ts +0 -43
- package/lib/common/token-usage-service.d.ts.map +0 -1
- package/lib/common/token-usage-service.js +0 -20
- package/lib/common/token-usage-service.js.map +0 -1
- package/lib/common/tool-invocation-registry.d.ts +0 -66
- package/lib/common/tool-invocation-registry.d.ts.map +0 -1
- package/lib/common/tool-invocation-registry.js +0 -101
- package/lib/common/tool-invocation-registry.js.map +0 -1
- package/lib/common/variable-service.d.ts +0 -172
- package/lib/common/variable-service.d.ts.map +0 -1
- package/lib/common/variable-service.js +0 -287
- package/lib/common/variable-service.js.map +0 -1
- package/lib/common/variable-service.spec.d.ts +0 -2
- package/lib/common/variable-service.spec.d.ts.map +0 -1
- package/lib/common/variable-service.spec.js +0 -237
- package/lib/common/variable-service.spec.js.map +0 -1
- package/lib/node/ai-core-backend-module.d.ts +0 -4
- package/lib/node/ai-core-backend-module.d.ts.map +0 -1
- package/lib/node/ai-core-backend-module.js +0 -65
- package/lib/node/ai-core-backend-module.js.map +0 -1
- package/lib/node/backend-language-model-registry.d.ts +0 -13
- package/lib/node/backend-language-model-registry.d.ts.map +0 -1
- package/lib/node/backend-language-model-registry.js +0 -68
- package/lib/node/backend-language-model-registry.js.map +0 -1
- package/lib/node/language-model-frontend-delegate.d.ts +0 -18
- package/lib/node/language-model-frontend-delegate.d.ts.map +0 -1
- package/lib/node/language-model-frontend-delegate.js +0 -109
- package/lib/node/language-model-frontend-delegate.js.map +0 -1
- package/lib/node/token-usage-service-impl.d.ts +0 -23
- package/lib/node/token-usage-service-impl.d.ts.map +0 -1
- package/lib/node/token-usage-service-impl.js +0 -78
- package/lib/node/token-usage-service-impl.js.map +0 -1
- package/lib/node/tool-request-parameters.spec.d.ts +0 -2
- package/lib/node/tool-request-parameters.spec.d.ts.map +0 -1
- package/lib/node/tool-request-parameters.spec.js +0 -116
- package/lib/node/tool-request-parameters.spec.js.map +0 -1
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgentServiceImpl = exports.AgentService = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
// *****************************************************************************
|
|
6
|
-
// Copyright (C) 2024 EclipseSource GmbH.
|
|
7
|
-
//
|
|
8
|
-
// This program and the accompanying materials are made available under the
|
|
9
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
10
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
11
|
-
//
|
|
12
|
-
// This Source Code may also be made available under the following Secondary
|
|
13
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
14
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
15
|
-
// with the GNU Classpath Exception which is available at
|
|
16
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
17
|
-
//
|
|
18
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
19
|
-
// *****************************************************************************
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const core_1 = require("@theia/core");
|
|
22
|
-
const settings_service_1 = require("./settings-service");
|
|
23
|
-
const prompt_service_1 = require("./prompt-service");
|
|
24
|
-
exports.AgentService = Symbol('AgentService');
|
|
25
|
-
let AgentServiceImpl = class AgentServiceImpl {
|
|
26
|
-
constructor() {
|
|
27
|
-
this.disabledAgents = new Set();
|
|
28
|
-
this._agents = [];
|
|
29
|
-
this.onDidChangeAgentsEmitter = new core_1.Emitter();
|
|
30
|
-
this.onDidChangeAgents = this.onDidChangeAgentsEmitter.event;
|
|
31
|
-
}
|
|
32
|
-
init() {
|
|
33
|
-
var _a;
|
|
34
|
-
(_a = this.aiSettingsService) === null || _a === void 0 ? void 0 : _a.getSettings().then(settings => {
|
|
35
|
-
Object.entries(settings).forEach(([agentId, agentSettings]) => {
|
|
36
|
-
if (agentSettings.enable === false) {
|
|
37
|
-
this.disabledAgents.add(agentId);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
registerAgent(agent) {
|
|
43
|
-
this._agents.push(agent);
|
|
44
|
-
agent.prompts.forEach(prompt => {
|
|
45
|
-
var _a;
|
|
46
|
-
this.promptService.addBuiltInPromptFragment(prompt.defaultVariant, prompt.id, true);
|
|
47
|
-
(_a = prompt.variants) === null || _a === void 0 ? void 0 : _a.forEach(variant => {
|
|
48
|
-
this.promptService.addBuiltInPromptFragment(variant, prompt.id);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
this.onDidChangeAgentsEmitter.fire();
|
|
52
|
-
}
|
|
53
|
-
unregisterAgent(agentId) {
|
|
54
|
-
const agent = this._agents.find(a => a.id === agentId);
|
|
55
|
-
this._agents = this._agents.filter(a => a.id !== agentId);
|
|
56
|
-
this.onDidChangeAgentsEmitter.fire();
|
|
57
|
-
agent === null || agent === void 0 ? void 0 : agent.prompts.forEach(prompt => {
|
|
58
|
-
var _a;
|
|
59
|
-
this.promptService.removePromptFragment(prompt.defaultVariant.id);
|
|
60
|
-
(_a = prompt.variants) === null || _a === void 0 ? void 0 : _a.forEach(variant => {
|
|
61
|
-
this.promptService.removePromptFragment(variant.id);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
getAgents() {
|
|
66
|
-
return this._agents.filter(agent => this.isEnabled(agent.id));
|
|
67
|
-
}
|
|
68
|
-
getAllAgents() {
|
|
69
|
-
return this._agents;
|
|
70
|
-
}
|
|
71
|
-
enableAgent(agentId) {
|
|
72
|
-
var _a;
|
|
73
|
-
this.disabledAgents.delete(agentId);
|
|
74
|
-
(_a = this.aiSettingsService) === null || _a === void 0 ? void 0 : _a.updateAgentSettings(agentId, { enable: true });
|
|
75
|
-
}
|
|
76
|
-
disableAgent(agentId) {
|
|
77
|
-
var _a;
|
|
78
|
-
this.disabledAgents.add(agentId);
|
|
79
|
-
(_a = this.aiSettingsService) === null || _a === void 0 ? void 0 : _a.updateAgentSettings(agentId, { enable: false });
|
|
80
|
-
}
|
|
81
|
-
isEnabled(agentId) {
|
|
82
|
-
return !this.disabledAgents.has(agentId);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
exports.AgentServiceImpl = AgentServiceImpl;
|
|
86
|
-
tslib_1.__decorate([
|
|
87
|
-
(0, inversify_1.inject)(settings_service_1.AISettingsService),
|
|
88
|
-
(0, inversify_1.optional)(),
|
|
89
|
-
tslib_1.__metadata("design:type", Object)
|
|
90
|
-
], AgentServiceImpl.prototype, "aiSettingsService", void 0);
|
|
91
|
-
tslib_1.__decorate([
|
|
92
|
-
(0, inversify_1.inject)(prompt_service_1.PromptService),
|
|
93
|
-
tslib_1.__metadata("design:type", Object)
|
|
94
|
-
], AgentServiceImpl.prototype, "promptService", void 0);
|
|
95
|
-
tslib_1.__decorate([
|
|
96
|
-
(0, inversify_1.postConstruct)(),
|
|
97
|
-
tslib_1.__metadata("design:type", Function),
|
|
98
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
99
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
100
|
-
], AgentServiceImpl.prototype, "init", null);
|
|
101
|
-
exports.AgentServiceImpl = AgentServiceImpl = tslib_1.__decorate([
|
|
102
|
-
(0, inversify_1.injectable)()
|
|
103
|
-
], AgentServiceImpl);
|
|
104
|
-
//# sourceMappingURL=agent-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-service.js","sourceRoot":"","sources":["../../src/common/agent-service.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,4DAA2F;AAC3F,sCAA6C;AAE7C,yDAAuD;AACvD,qDAAiD;AAEpC,QAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAmD5C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAAtB;QAQO,mBAAc,GAAG,IAAI,GAAG,EAAU,CAAC;QAEnC,YAAO,GAAY,EAAE,CAAC;QAEf,6BAAwB,GAAG,IAAI,cAAO,EAAQ,CAAC;QACvD,sBAAiB,GAAG,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC;IA6DrE,CAAC;IA1Da,IAAI;;QACV,MAAA,IAAI,CAAC,iBAAiB,0CAAE,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE;YAClD,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE,EAAE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0,0 @@
|
|
|
1
|
-
import { LanguageModelRequirement } from './language-model';
|
|
2
|
-
import { BasePromptFragment } from './prompt-service';
|
|
3
|
-
export interface AgentSpecificVariables {
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
usedInPrompt: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface PromptVariantSet {
|
|
9
|
-
id: string;
|
|
10
|
-
defaultVariant: BasePromptFragment;
|
|
11
|
-
variants?: BasePromptFragment[];
|
|
12
|
-
}
|
|
13
|
-
export declare const Agent: unique symbol;
|
|
14
|
-
/**
|
|
15
|
-
* Agents represent the main functionality of the AI system. They are responsible for processing user input, collecting information from the environment,
|
|
16
|
-
* invoking and processing LLM responses, and providing the final response to the user while recording their actions in the AI history.
|
|
17
|
-
*
|
|
18
|
-
* Agents are meant to cover all use cases, from specialized scenarios to general purpose chat bots.
|
|
19
|
-
*
|
|
20
|
-
* Agents are encouraged to provide a detailed description of their functionality and their processed inputs.
|
|
21
|
-
* They can also declare their used prompt templates, which makes them configurable for the user.
|
|
22
|
-
*/
|
|
23
|
-
export interface Agent {
|
|
24
|
-
/**
|
|
25
|
-
* Used to identify an agent, e.g. when it is requesting language models, etc.
|
|
26
|
-
*
|
|
27
|
-
* @note This parameter might be removed in favor of `name`. Therefore, it is recommended to set `id` to the same value as `name` for now.
|
|
28
|
-
*/
|
|
29
|
-
readonly id: string;
|
|
30
|
-
/**
|
|
31
|
-
* Human-readable name shown to users to identify the agent. Must be unique.
|
|
32
|
-
* Use short names without "Agent" or "Chat" (see `tags` for adding further properties).
|
|
33
|
-
*/
|
|
34
|
-
readonly name: string;
|
|
35
|
-
/** A markdown description of its functionality and its privacy-relevant requirements, including function call handlers that access some data autonomously. */
|
|
36
|
-
readonly description: string;
|
|
37
|
-
/**
|
|
38
|
-
* The list of global variable identifiers that are always available to this agent during execution,
|
|
39
|
-
* regardless of whether they are referenced in prompts.
|
|
40
|
-
*
|
|
41
|
-
* This array is primarily used for documentation purposes in the AI Configuration View
|
|
42
|
-
* to show which variables are guaranteed to be available to the agent. Referenced variables are NOT automatically handed over by the framework,
|
|
43
|
-
* this must be explicitly done in the agent implementation.
|
|
44
|
-
*/
|
|
45
|
-
readonly variables: string[];
|
|
46
|
-
/** The prompts introduced and used by this agent. */
|
|
47
|
-
readonly prompts: PromptVariantSet[];
|
|
48
|
-
/** Required language models. This includes the purpose and optional language model selector arguments. See #47. */
|
|
49
|
-
readonly languageModelRequirements: LanguageModelRequirement[];
|
|
50
|
-
/** A list of tags to filter agents and to display capabilities in the UI */
|
|
51
|
-
readonly tags?: string[];
|
|
52
|
-
/**
|
|
53
|
-
* The list of local variable identifiers that can be made available to this agent during execution,
|
|
54
|
-
* these variables are context specific and do not exist for other agents.
|
|
55
|
-
*
|
|
56
|
-
* This array is primarily used for documentation purposes in the AI Configuration View
|
|
57
|
-
* to show which variables can be made available to the agent.
|
|
58
|
-
* Referenced variables are NOT automatically handed over by the framework,
|
|
59
|
-
* this must be explicitly done in the agent implementation or in prompts.
|
|
60
|
-
*/
|
|
61
|
-
readonly agentSpecificVariables: AgentSpecificVariables[];
|
|
62
|
-
/**
|
|
63
|
-
* The list of global function identifiers that are always available to this agent during execution,
|
|
64
|
-
* regardless of whether they are referenced in prompts.
|
|
65
|
-
*
|
|
66
|
-
* This array is primarily used for documentation purposes in the AI Configuration View
|
|
67
|
-
* to show which functions are guaranteed to be available to the agent. Referenced functions are NOT automatically handed over by the framework,
|
|
68
|
-
* this must be explicitly done in the agent implementation.
|
|
69
|
-
*/
|
|
70
|
-
readonly functions: string[];
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/common/agent.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,kBAAkB,CAAC;IACnC,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACnC;AAED,eAAO,MAAM,KAAK,eAAkB,CAAC;AACrC;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAK;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,8JAA8J;IAC9J,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;IAE7B,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAErC,mHAAmH;IACnH,QAAQ,CAAC,yBAAyB,EAAE,wBAAwB,EAAE,CAAC;IAE/D,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB;;;;;;;;OAQG;IACH,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,EAAE,CAAC;IAE1D;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;CAChC"}
|
package/lib/common/agent.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2024 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.Agent = void 0;
|
|
19
|
-
exports.Agent = Symbol('Agent');
|
|
20
|
-
//# sourceMappingURL=agent.js.map
|
package/lib/common/agent.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/common/agent.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;;;AAiBnE,QAAA,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AIVariable, AIVariableContext, AIVariableContribution, AIVariableResolutionRequest, AIVariableResolver, AIVariableService, ResolvedAIVariable } from './variable-service';
|
|
2
|
-
import { MaybePromise } from '@theia/core';
|
|
3
|
-
import { AgentService } from './agent-service';
|
|
4
|
-
export declare const AGENTS_VARIABLE: AIVariable;
|
|
5
|
-
export interface ResolvedAgentsVariable extends ResolvedAIVariable {
|
|
6
|
-
agents: AgentDescriptor[];
|
|
7
|
-
}
|
|
8
|
-
export interface AgentDescriptor {
|
|
9
|
-
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
description: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class AgentsVariableContribution implements AIVariableContribution, AIVariableResolver {
|
|
14
|
-
protected readonly agentService: AgentService;
|
|
15
|
-
registerVariables(service: AIVariableService): void;
|
|
16
|
-
canResolve(request: AIVariableResolutionRequest, _context: AIVariableContext): MaybePromise<number>;
|
|
17
|
-
resolve(request: AIVariableResolutionRequest, context: AIVariableContext): Promise<ResolvedAgentsVariable | undefined>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=agents-variable-contribution.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agents-variable-contribution.d.ts","sourceRoot":"","sources":["../../src/common/agents-variable-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACnL,OAAO,EAAE,YAAY,EAAO,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,eAAO,MAAM,eAAe,EAAE,UAI7B,CAAC;AAEF,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAC9D,MAAM,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,qBACa,0BAA2B,YAAW,sBAAsB,EAAE,kBAAkB;IAGzF,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAE9C,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAInD,UAAU,CAAC,OAAO,EAAE,2BAA2B,EAAE,QAAQ,EAAE,iBAAiB,GAAG,YAAY,CAAC,MAAM,CAAC;IAO7F,OAAO,CAAC,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;CAU/H"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgentsVariableContribution = exports.AGENTS_VARIABLE = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
// *****************************************************************************
|
|
6
|
-
// Copyright (C) 2024 EclipseSource GmbH.
|
|
7
|
-
//
|
|
8
|
-
// This program and the accompanying materials are made available under the
|
|
9
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
10
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
11
|
-
//
|
|
12
|
-
// This Source Code may also be made available under the following Secondary
|
|
13
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
14
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
15
|
-
// with the GNU Classpath Exception which is available at
|
|
16
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
17
|
-
//
|
|
18
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
19
|
-
// *****************************************************************************
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const core_1 = require("@theia/core");
|
|
22
|
-
const agent_service_1 = require("./agent-service");
|
|
23
|
-
exports.AGENTS_VARIABLE = {
|
|
24
|
-
id: 'agents',
|
|
25
|
-
name: 'agents',
|
|
26
|
-
description: core_1.nls.localize('theia/ai/core/agentsVariable/description', 'Returns the list of agents available in the system')
|
|
27
|
-
};
|
|
28
|
-
let AgentsVariableContribution = class AgentsVariableContribution {
|
|
29
|
-
registerVariables(service) {
|
|
30
|
-
service.registerResolver(exports.AGENTS_VARIABLE, this);
|
|
31
|
-
}
|
|
32
|
-
canResolve(request, _context) {
|
|
33
|
-
if (request.variable.name === exports.AGENTS_VARIABLE.name) {
|
|
34
|
-
return 1;
|
|
35
|
-
}
|
|
36
|
-
return -1;
|
|
37
|
-
}
|
|
38
|
-
async resolve(request, context) {
|
|
39
|
-
if (request.variable.name === exports.AGENTS_VARIABLE.name) {
|
|
40
|
-
const agents = this.agentService.getAgents().map(agent => ({
|
|
41
|
-
id: agent.id,
|
|
42
|
-
name: agent.name,
|
|
43
|
-
description: agent.description
|
|
44
|
-
}));
|
|
45
|
-
return { variable: exports.AGENTS_VARIABLE, agents, value: JSON.stringify(agents) };
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
exports.AgentsVariableContribution = AgentsVariableContribution;
|
|
50
|
-
tslib_1.__decorate([
|
|
51
|
-
(0, inversify_1.inject)(agent_service_1.AgentService),
|
|
52
|
-
tslib_1.__metadata("design:type", Object)
|
|
53
|
-
], AgentsVariableContribution.prototype, "agentService", void 0);
|
|
54
|
-
exports.AgentsVariableContribution = AgentsVariableContribution = tslib_1.__decorate([
|
|
55
|
-
(0, inversify_1.injectable)()
|
|
56
|
-
], AgentsVariableContribution);
|
|
57
|
-
//# sourceMappingURL=agents-variable-contribution.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agents-variable-contribution.js","sourceRoot":"","sources":["../../src/common/agents-variable-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;AAChF,4DAAkE;AAElE,sCAAgD;AAChD,mDAA+C;AAElC,QAAA,eAAe,GAAe;IACvC,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,0CAA0C,EAAE,oDAAoD,CAAC;CAC9H,CAAC;AAaK,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAKnC,iBAAiB,CAAC,OAA0B;QACxC,OAAO,CAAC,gBAAgB,CAAC,uBAAe,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IAED,UAAU,CAAC,OAAoC,EAAE,QAA2B;QACxE,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,uBAAe,CAAC,IAAI,EAAE,CAAC;YACjD,OAAO,CAAC,CAAC;QACb,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;IACd,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAoC,EAAE,OAA0B;QAC1E,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,uBAAe,CAAC,IAAI,EAAE,CAAC;YACjD,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACvD,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,WAAW,EAAE,KAAK,CAAC,WAAW;aACjC,CAAC,CAAC,CAAC;YACJ,OAAO,EAAE,QAAQ,EAAE,uBAAe,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAChF,CAAC;IACL,CAAC;CACJ,CAAA;AA1BY,gEAA0B;AAGhB;IADlB,IAAA,kBAAM,EAAC,4BAAY,CAAC;;gEACyB;qCAHrC,0BAA0B;IADtC,IAAA,sBAAU,GAAE;GACA,0BAA0B,CA0BtC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { PreferenceProxy } from '@theia/core/lib/common';
|
|
2
|
-
import { interfaces } from '@theia/core/shared/inversify';
|
|
3
|
-
import { NotificationType } from './notification-types';
|
|
4
|
-
import { PreferenceSchema } from '@theia/core/lib/common/preferences/preference-schema';
|
|
5
|
-
export declare const AI_CORE_PREFERENCES_TITLE: string;
|
|
6
|
-
export declare const PREFERENCE_NAME_PROMPT_TEMPLATES = "ai-features.promptTemplates.promptTemplatesFolder";
|
|
7
|
-
export declare const PREFERENCE_NAME_REQUEST_SETTINGS = "ai-features.modelSettings.requestSettings";
|
|
8
|
-
export declare const PREFERENCE_NAME_MAX_RETRIES = "ai-features.modelSettings.maxRetries";
|
|
9
|
-
export declare const PREFERENCE_NAME_DEFAULT_NOTIFICATION_TYPE = "ai-features.notifications.default";
|
|
10
|
-
export declare const LANGUAGE_MODEL_ALIASES_PREFERENCE = "ai-features.languageModelAliases";
|
|
11
|
-
export declare const aiCorePreferenceSchema: PreferenceSchema;
|
|
12
|
-
export interface AICoreConfiguration {
|
|
13
|
-
[PREFERENCE_NAME_PROMPT_TEMPLATES]: string | undefined;
|
|
14
|
-
[PREFERENCE_NAME_REQUEST_SETTINGS]: Array<RequestSetting> | undefined;
|
|
15
|
-
[PREFERENCE_NAME_MAX_RETRIES]: number | undefined;
|
|
16
|
-
[PREFERENCE_NAME_DEFAULT_NOTIFICATION_TYPE]: NotificationType | undefined;
|
|
17
|
-
}
|
|
18
|
-
export interface RequestSetting {
|
|
19
|
-
scope?: Scope;
|
|
20
|
-
clientSettings?: {
|
|
21
|
-
keepToolCalls: boolean;
|
|
22
|
-
keepThinking: boolean;
|
|
23
|
-
};
|
|
24
|
-
requestSettings?: {
|
|
25
|
-
[key: string]: unknown;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export interface Scope {
|
|
29
|
-
modelId?: string;
|
|
30
|
-
providerId?: string;
|
|
31
|
-
agentId?: string;
|
|
32
|
-
}
|
|
33
|
-
export declare const AICorePreferences: unique symbol;
|
|
34
|
-
export type AICorePreferences = PreferenceProxy<AICoreConfiguration>;
|
|
35
|
-
export declare function bindAICorePreferences(bind: interfaces.Bind): void;
|
|
36
|
-
/**
|
|
37
|
-
* Calculates the specificity score of a RequestSetting for a given scope.
|
|
38
|
-
* The score is calculated based on matching criteria:
|
|
39
|
-
* - Agent match: 100 points
|
|
40
|
-
* - Model match: 10 points
|
|
41
|
-
* - Provider match: 1 point
|
|
42
|
-
*
|
|
43
|
-
* @param setting RequestSetting object to check against
|
|
44
|
-
* @param scope Optional scope object containing modelId, providerId, and agentId
|
|
45
|
-
* @returns Specificity score (-1 for non-match, or sum of matching criteria points)
|
|
46
|
-
*/
|
|
47
|
-
export declare const getRequestSettingSpecificity: (setting: RequestSetting, scope?: Scope) => number;
|
|
48
|
-
//# sourceMappingURL=ai-core-preferences.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-core-preferences.d.ts","sourceRoot":"","sources":["../../src/common/ai-core-preferences.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAGH,gBAAgB,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AAExF,eAAO,MAAM,yBAAyB,QAAyE,CAAC;AAChH,eAAO,MAAM,gCAAgC,sDAAsD,CAAC;AACpG,eAAO,MAAM,gCAAgC,8CAA8C,CAAC;AAC5F,eAAO,MAAM,2BAA2B,yCAAyC,CAAC;AAClF,eAAO,MAAM,yCAAyC,sCAAsC,CAAC;AAE7F,eAAO,MAAM,iCAAiC,qCAAqC,CAAC;AAEpF,eAAO,MAAM,sBAAsB,EAAE,gBAkIpC,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAChC,CAAC,gCAAgC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvD,CAAC,gCAAgC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IACtE,CAAC,2BAA2B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClD,CAAC,yCAAyC,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAC7E;AAED,MAAM,WAAW,cAAc;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,cAAc,CAAC,EAAE;QAAE,aAAa,EAAE,OAAO,CAAC;QAAC,YAAY,EAAE,OAAO,CAAA;KAAE,CAAC;IACnE,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CAChD;AAED,MAAM,WAAW,KAAK;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;AAErE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAKjE;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,YAAa,cAAc,UAAU,KAAK,KAAG,MA0CrF,CAAC"}
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2024 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.getRequestSettingSpecificity = exports.bindAICorePreferences = exports.AICorePreferences = exports.aiCorePreferenceSchema = exports.LANGUAGE_MODEL_ALIASES_PREFERENCE = exports.PREFERENCE_NAME_DEFAULT_NOTIFICATION_TYPE = exports.PREFERENCE_NAME_MAX_RETRIES = exports.PREFERENCE_NAME_REQUEST_SETTINGS = exports.PREFERENCE_NAME_PROMPT_TEMPLATES = exports.AI_CORE_PREFERENCES_TITLE = void 0;
|
|
19
|
-
const core_1 = require("@theia/core");
|
|
20
|
-
const notification_types_1 = require("./notification-types");
|
|
21
|
-
exports.AI_CORE_PREFERENCES_TITLE = '✨ ' + core_1.nls.localize('theia/ai/core/prefs/title', 'AI Features [Beta]');
|
|
22
|
-
exports.PREFERENCE_NAME_PROMPT_TEMPLATES = 'ai-features.promptTemplates.promptTemplatesFolder';
|
|
23
|
-
exports.PREFERENCE_NAME_REQUEST_SETTINGS = 'ai-features.modelSettings.requestSettings';
|
|
24
|
-
exports.PREFERENCE_NAME_MAX_RETRIES = 'ai-features.modelSettings.maxRetries';
|
|
25
|
-
exports.PREFERENCE_NAME_DEFAULT_NOTIFICATION_TYPE = 'ai-features.notifications.default';
|
|
26
|
-
exports.LANGUAGE_MODEL_ALIASES_PREFERENCE = 'ai-features.languageModelAliases';
|
|
27
|
-
exports.aiCorePreferenceSchema = {
|
|
28
|
-
properties: {
|
|
29
|
-
[exports.PREFERENCE_NAME_PROMPT_TEMPLATES]: {
|
|
30
|
-
title: exports.AI_CORE_PREFERENCES_TITLE,
|
|
31
|
-
description: core_1.nls.localize('theia/ai/core/promptTemplates/description', 'Folder for storing customized prompt templates. If not customized the user config directory is used. Please consider to use a folder, which is\
|
|
32
|
-
under version control to manage your variants of prompt templates.'),
|
|
33
|
-
type: 'string',
|
|
34
|
-
default: '',
|
|
35
|
-
typeDetails: {
|
|
36
|
-
isFilepath: true,
|
|
37
|
-
selectionProps: {
|
|
38
|
-
openLabel: core_1.nls.localize('theia/ai/core/promptTemplates/openLabel', 'Select Folder'),
|
|
39
|
-
canSelectFiles: false,
|
|
40
|
-
canSelectFolders: true,
|
|
41
|
-
canSelectMany: false
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
[exports.PREFERENCE_NAME_REQUEST_SETTINGS]: {
|
|
46
|
-
title: core_1.nls.localize('theia/ai/core/requestSettings/title', 'Custom Request Settings'),
|
|
47
|
-
markdownDescription: core_1.nls.localize('theia/ai/core/requestSettings/mdDescription', 'Allows specifying custom request settings for multiple models.\n\
|
|
48
|
-
Each setting consists of:\n\
|
|
49
|
-
- `scope`: Defines when the setting applies:\n\
|
|
50
|
-
- `modelId` (optional): The model ID to match\n\
|
|
51
|
-
- `providerId` (optional): The provider ID to match (e.g., huggingface, openai, ollama, llamafile)\n\
|
|
52
|
-
- `agentId` (optional): The agent ID to match\n\
|
|
53
|
-
- `requestSettings`: Model-specific settings as key-value pairs\n\
|
|
54
|
-
- `clientSettings`: Client-side message handling settings:\n\
|
|
55
|
-
- `keepToolCalls` (boolean): Whether to keep tool calls in the context\n\
|
|
56
|
-
- `keepThinking` (boolean): Whether to keep thinking messages\n\
|
|
57
|
-
Settings are matched based on specificity (agent: 100, model: 10, provider: 1 points).\n\
|
|
58
|
-
Refer to [our documentation](https://theia-ide.org/docs/user_ai/#custom-request-settings) for more information.'),
|
|
59
|
-
type: 'array',
|
|
60
|
-
items: {
|
|
61
|
-
type: 'object',
|
|
62
|
-
properties: {
|
|
63
|
-
scope: {
|
|
64
|
-
type: 'object',
|
|
65
|
-
properties: {
|
|
66
|
-
modelId: {
|
|
67
|
-
type: 'string',
|
|
68
|
-
description: core_1.nls.localize('theia/ai/core/requestSettings/scope/modelId/description', 'The (optional) model id')
|
|
69
|
-
},
|
|
70
|
-
providerId: {
|
|
71
|
-
type: 'string',
|
|
72
|
-
description: core_1.nls.localize('theia/ai/core/requestSettings/scope/providerId/description', 'The (optional) provider id to apply the settings to.'),
|
|
73
|
-
},
|
|
74
|
-
agentId: {
|
|
75
|
-
type: 'string',
|
|
76
|
-
description: core_1.nls.localize('theia/ai/core/requestSettings/scope/agentId/description', 'The (optional) agent id to apply the settings to.'),
|
|
77
|
-
},
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
requestSettings: {
|
|
81
|
-
type: 'object',
|
|
82
|
-
additionalProperties: true,
|
|
83
|
-
description: core_1.nls.localize('theia/ai/core/requestSettings/modelSpecificSettings/description', 'Settings for the specific model ID.'),
|
|
84
|
-
},
|
|
85
|
-
clientSettings: {
|
|
86
|
-
type: 'object',
|
|
87
|
-
additionalProperties: false,
|
|
88
|
-
description: core_1.nls.localize('theia/ai/core/requestSettings/clientSettings/description', 'Client settings for how to handle messages that are send back to the llm.'),
|
|
89
|
-
properties: {
|
|
90
|
-
keepToolCalls: {
|
|
91
|
-
type: 'boolean',
|
|
92
|
-
default: true,
|
|
93
|
-
description: core_1.nls.localize('theia/ai/core/requestSettings/clientSettings/keepToolCalls/description', 'If set to false, all tool request and tool responses will be filtered \
|
|
94
|
-
before sending the next user request in a multi-turn conversation.')
|
|
95
|
-
},
|
|
96
|
-
keepThinking: {
|
|
97
|
-
type: 'boolean',
|
|
98
|
-
default: true,
|
|
99
|
-
description: core_1.nls.localize('theia/ai/core/requestSettings/clientSettings/keepThinking/description', 'If set to false, all thinking output will be filtered before sending the next user request in a multi-turn conversation.')
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
additionalProperties: false
|
|
105
|
-
},
|
|
106
|
-
default: [],
|
|
107
|
-
},
|
|
108
|
-
[exports.PREFERENCE_NAME_MAX_RETRIES]: {
|
|
109
|
-
title: core_1.nls.localize('theia/ai/core/maxRetries/title', 'Maximum Retries'),
|
|
110
|
-
markdownDescription: core_1.nls.localize('theia/ai/core/maxRetries/mdDescription', 'The maximum number of retry attempts when a request to an AI provider fails. A value of 0 means no retries.'),
|
|
111
|
-
type: 'number',
|
|
112
|
-
minimum: 0,
|
|
113
|
-
default: 3
|
|
114
|
-
},
|
|
115
|
-
[exports.PREFERENCE_NAME_DEFAULT_NOTIFICATION_TYPE]: {
|
|
116
|
-
title: core_1.nls.localize('theia/ai/core/defaultNotification/title', 'Default Notification Type'),
|
|
117
|
-
markdownDescription: core_1.nls.localize('theia/ai/core/defaultNotification/mdDescription', 'The default notification method used when an AI agent completes a task. Individual agents can override this setting.\n\
|
|
118
|
-
- `os-notification`: Show OS/system notifications\n\
|
|
119
|
-
- `message`: Show notifications in the status bar/message area\n\
|
|
120
|
-
- `blink`: Blink or highlight the UI\n\
|
|
121
|
-
- `off`: Disable all notifications'),
|
|
122
|
-
type: 'string',
|
|
123
|
-
enum: [...notification_types_1.NOTIFICATION_TYPES],
|
|
124
|
-
default: notification_types_1.NOTIFICATION_TYPE_OFF
|
|
125
|
-
},
|
|
126
|
-
[exports.LANGUAGE_MODEL_ALIASES_PREFERENCE]: {
|
|
127
|
-
title: core_1.nls.localize('theia/ai/core/preference/languageModelAliases/title', 'Language Model Aliases'),
|
|
128
|
-
markdownDescription: core_1.nls.localize('theia/ai/core/preference/languageModelAliases/description', 'Configure models for each language model alias in the \
|
|
129
|
-
[AI Configuration View]({0}). Alternatiely you can set the settings manually in the settings.json: \n\
|
|
130
|
-
```\n\
|
|
131
|
-
"default/code": {\n\
|
|
132
|
-
"selectedModel": "anthropic/claude-opus-4-20250514"\n\
|
|
133
|
-
}\n\```', 'command:aiConfiguration:open'),
|
|
134
|
-
type: 'object',
|
|
135
|
-
additionalProperties: {
|
|
136
|
-
type: 'object',
|
|
137
|
-
properties: {
|
|
138
|
-
selectedModel: {
|
|
139
|
-
type: 'string',
|
|
140
|
-
description: core_1.nls.localize('theia/ai/core/preference/languageModelAliases/selectedModel', 'The user-selected model for this alias.')
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
required: ['selectedModel'],
|
|
144
|
-
additionalProperties: false
|
|
145
|
-
},
|
|
146
|
-
default: {},
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
exports.AICorePreferences = Symbol('AICorePreferences');
|
|
151
|
-
function bindAICorePreferences(bind) {
|
|
152
|
-
bind(exports.AICorePreferences).toDynamicValue(ctx => {
|
|
153
|
-
const factory = ctx.container.get(core_1.PreferenceProxyFactory);
|
|
154
|
-
return factory(exports.aiCorePreferenceSchema);
|
|
155
|
-
}).inSingletonScope();
|
|
156
|
-
}
|
|
157
|
-
exports.bindAICorePreferences = bindAICorePreferences;
|
|
158
|
-
/**
|
|
159
|
-
* Calculates the specificity score of a RequestSetting for a given scope.
|
|
160
|
-
* The score is calculated based on matching criteria:
|
|
161
|
-
* - Agent match: 100 points
|
|
162
|
-
* - Model match: 10 points
|
|
163
|
-
* - Provider match: 1 point
|
|
164
|
-
*
|
|
165
|
-
* @param setting RequestSetting object to check against
|
|
166
|
-
* @param scope Optional scope object containing modelId, providerId, and agentId
|
|
167
|
-
* @returns Specificity score (-1 for non-match, or sum of matching criteria points)
|
|
168
|
-
*/
|
|
169
|
-
const getRequestSettingSpecificity = (setting, scope) => {
|
|
170
|
-
// If no scope is defined in the setting, return default specificity
|
|
171
|
-
if (!setting.scope) {
|
|
172
|
-
return 0;
|
|
173
|
-
}
|
|
174
|
-
// If no matching criteria are defined in the scope, return default specificity
|
|
175
|
-
if (!setting.scope.modelId && !setting.scope.providerId && !setting.scope.agentId) {
|
|
176
|
-
return 0;
|
|
177
|
-
}
|
|
178
|
-
// Check for explicit non-matches (return -1)
|
|
179
|
-
if ((scope === null || scope === void 0 ? void 0 : scope.modelId) && setting.scope.modelId && setting.scope.modelId !== scope.modelId) {
|
|
180
|
-
return -1;
|
|
181
|
-
}
|
|
182
|
-
if ((scope === null || scope === void 0 ? void 0 : scope.providerId) && setting.scope.providerId && setting.scope.providerId !== scope.providerId) {
|
|
183
|
-
return -1;
|
|
184
|
-
}
|
|
185
|
-
if ((scope === null || scope === void 0 ? void 0 : scope.agentId) && setting.scope.agentId && setting.scope.agentId !== scope.agentId) {
|
|
186
|
-
return -1;
|
|
187
|
-
}
|
|
188
|
-
let specificity = 0;
|
|
189
|
-
// Check provider match (1 point)
|
|
190
|
-
if ((scope === null || scope === void 0 ? void 0 : scope.providerId) && setting.scope.providerId === scope.providerId) {
|
|
191
|
-
specificity += 1;
|
|
192
|
-
}
|
|
193
|
-
// Check model match (10 points)
|
|
194
|
-
if ((scope === null || scope === void 0 ? void 0 : scope.modelId) && setting.scope.modelId === scope.modelId) {
|
|
195
|
-
specificity += 10;
|
|
196
|
-
}
|
|
197
|
-
// Check agent match (100 points)
|
|
198
|
-
if ((scope === null || scope === void 0 ? void 0 : scope.agentId) && setting.scope.agentId === scope.agentId) {
|
|
199
|
-
specificity += 100;
|
|
200
|
-
}
|
|
201
|
-
return specificity;
|
|
202
|
-
};
|
|
203
|
-
exports.getRequestSettingSpecificity = getRequestSettingSpecificity;
|
|
204
|
-
//# sourceMappingURL=ai-core-preferences.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-core-preferences.js","sourceRoot":"","sources":["../../src/common/ai-core-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,sCAA0D;AAG1D,6DAI8B;AAGjB,QAAA,yBAAyB,GAAG,IAAI,GAAG,UAAG,CAAC,QAAQ,CAAC,2BAA2B,EAAE,oBAAoB,CAAC,CAAC;AACnG,QAAA,gCAAgC,GAAG,mDAAmD,CAAC;AACvF,QAAA,gCAAgC,GAAG,2CAA2C,CAAC;AAC/E,QAAA,2BAA2B,GAAG,sCAAsC,CAAC;AACrE,QAAA,yCAAyC,GAAG,mCAAmC,CAAC;AAEhF,QAAA,iCAAiC,GAAG,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AC;IACvB,CAAC;IAED,OAAO,WAAW,CAAC;AACvB,CAAC,CAAC;AA1CW,QAAA,4BAA4B,gCA0CvC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Resource, URI } from '@theia/core';
|
|
2
|
-
import { AIVariableContext, AIVariableResolutionRequest } from './variable-service';
|
|
3
|
-
import { ConfigurableInMemoryResources, ConfigurableMutableReferenceResource } from './configurable-in-memory-resources';
|
|
4
|
-
export declare const AI_VARIABLE_RESOURCE_SCHEME = "ai-variable";
|
|
5
|
-
export declare const NO_CONTEXT_AUTHORITY = "context-free";
|
|
6
|
-
export declare class AIVariableResourceResolver {
|
|
7
|
-
protected readonly inMemoryResources: ConfigurableInMemoryResources;
|
|
8
|
-
protected init(): void;
|
|
9
|
-
protected readonly cache: Map<string, [Resource, AIVariableContext]>;
|
|
10
|
-
getOrCreate(request: AIVariableResolutionRequest, context: AIVariableContext, value: string): ConfigurableMutableReferenceResource;
|
|
11
|
-
protected toUri(request: AIVariableResolutionRequest, context: AIVariableContext): URI;
|
|
12
|
-
protected toAuthority(context: AIVariableContext): string;
|
|
13
|
-
fromUri(uri: URI): {
|
|
14
|
-
variableName: string;
|
|
15
|
-
arg: string | undefined;
|
|
16
|
-
} | undefined;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=ai-variable-resource.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-variable-resource.d.ts","sourceRoot":"","sources":["../../src/common/ai-variable-resource.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAgB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEpF,OAAO,EAAE,6BAA6B,EAAE,oCAAoC,EAAE,MAAM,oCAAoC,CAAC;AAEzH,eAAO,MAAM,2BAA2B,gBAAgB,CAAC;AACzD,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,qBACa,0BAA0B;IACI,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,6BAA6B,CAAC;IAG3G,SAAS,CAAC,IAAI,IAAI,IAAI;IAItB,SAAS,CAAC,QAAQ,CAAC,KAAK,6CAAoD;IAE5E,WAAW,CAAC,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,GAAG,oCAAoC;IAalI,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,iBAAiB,GAAG,GAAG;IAUtF,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM;IAezD,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GAAG,SAAS;CAUnF"}
|