@theia/ai-core 1.55.0-next.4 → 1.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts +1 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/agent-configuration-widget.js +7 -1
- package/lib/browser/ai-configuration/agent-configuration-widget.js.map +1 -1
- package/lib/browser/ai-configuration/template-settings-renderer.js +1 -1
- package/lib/browser/ai-configuration/template-settings-renderer.js.map +1 -1
- package/lib/browser/ai-core-frontend-application-contribution.d.ts +3 -1
- package/lib/browser/ai-core-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/ai-core-frontend-application-contribution.js +6 -6
- package/lib/browser/ai-core-frontend-application-contribution.js.map +1 -1
- package/lib/browser/frontend-prompt-customization-service.d.ts +6 -5
- package/lib/browser/frontend-prompt-customization-service.d.ts.map +1 -1
- package/lib/browser/frontend-prompt-customization-service.js +72 -35
- package/lib/browser/frontend-prompt-customization-service.js.map +1 -1
- package/lib/browser/prompttemplate-contribution.d.ts +1 -0
- package/lib/browser/prompttemplate-contribution.d.ts.map +1 -1
- package/lib/browser/prompttemplate-contribution.js +3 -2
- package/lib/browser/prompttemplate-contribution.js.map +1 -1
- package/lib/common/agent-service.d.ts +21 -3
- package/lib/common/agent-service.d.ts.map +1 -1
- package/lib/common/agent-service.js +17 -13
- package/lib/common/agent-service.js.map +1 -1
- package/lib/common/communication-recording-service.d.ts +3 -0
- package/lib/common/communication-recording-service.d.ts.map +1 -1
- package/lib/common/language-model-util.d.ts +11 -0
- package/lib/common/language-model-util.d.ts.map +1 -1
- package/lib/common/language-model-util.js +19 -2
- package/lib/common/language-model-util.js.map +1 -1
- package/lib/common/prompt-service.d.ts +33 -3
- package/lib/common/prompt-service.d.ts.map +1 -1
- package/lib/common/prompt-service.js +23 -1
- package/lib/common/prompt-service.js.map +1 -1
- package/package.json +12 -10
- package/src/browser/ai-configuration/agent-configuration-widget.tsx +8 -0
- package/src/browser/ai-configuration/template-settings-renderer.tsx +1 -1
- package/src/browser/ai-core-frontend-application-contribution.ts +7 -8
- package/src/browser/frontend-prompt-customization-service.ts +73 -35
- package/src/browser/prompttemplate-contribution.ts +3 -1
- package/src/browser/style/index.css +5 -0
- package/src/common/agent-service.ts +42 -13
- package/src/common/communication-recording-service.ts +5 -0
- package/src/common/language-model-util.ts +18 -1
- package/src/common/prompt-service.ts +51 -3
|
@@ -19,13 +19,15 @@ const tslib_1 = require("tslib");
|
|
|
19
19
|
// *****************************************************************************
|
|
20
20
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
21
|
const core_1 = require("@theia/core");
|
|
22
|
-
const agent_1 = require("./agent");
|
|
23
22
|
const settings_service_1 = require("./settings-service");
|
|
23
|
+
const prompt_service_1 = require("./prompt-service");
|
|
24
24
|
exports.AgentService = Symbol('AgentService');
|
|
25
25
|
let AgentServiceImpl = class AgentServiceImpl {
|
|
26
26
|
constructor() {
|
|
27
27
|
this.disabledAgents = new Set();
|
|
28
28
|
this._agents = [];
|
|
29
|
+
this.onDidChangeAgentsEmitter = new core_1.Emitter();
|
|
30
|
+
this.onDidChangeAgents = this.onDidChangeAgentsEmitter.event;
|
|
29
31
|
}
|
|
30
32
|
init() {
|
|
31
33
|
var _a;
|
|
@@ -37,19 +39,22 @@ let AgentServiceImpl = class AgentServiceImpl {
|
|
|
37
39
|
});
|
|
38
40
|
});
|
|
39
41
|
}
|
|
40
|
-
get agents() {
|
|
41
|
-
// We can't collect the contributions at @postConstruct because this will lead to a circular dependency
|
|
42
|
-
// with agents reusing the chat agent service (e.g. orchestrator) which in turn injects the agent service
|
|
43
|
-
return [...this.agentsProvider.getContributions(), ...this._agents];
|
|
44
|
-
}
|
|
45
42
|
registerAgent(agent) {
|
|
46
43
|
this._agents.push(agent);
|
|
44
|
+
agent.promptTemplates.forEach(template => this.promptService.storePrompt(template.id, template.template));
|
|
45
|
+
this.onDidChangeAgentsEmitter.fire();
|
|
46
|
+
}
|
|
47
|
+
unregisterAgent(agentId) {
|
|
48
|
+
const agent = this._agents.find(a => a.id === agentId);
|
|
49
|
+
this._agents = this._agents.filter(a => a.id !== agentId);
|
|
50
|
+
this.onDidChangeAgentsEmitter.fire();
|
|
51
|
+
agent === null || agent === void 0 ? void 0 : agent.promptTemplates.forEach(template => this.promptService.removePrompt(template.id));
|
|
47
52
|
}
|
|
48
53
|
getAgents() {
|
|
49
|
-
return this.
|
|
54
|
+
return this._agents.filter(agent => this.isEnabled(agent.id));
|
|
50
55
|
}
|
|
51
56
|
getAllAgents() {
|
|
52
|
-
return this.
|
|
57
|
+
return this._agents;
|
|
53
58
|
}
|
|
54
59
|
enableAgent(agentId) {
|
|
55
60
|
var _a;
|
|
@@ -66,16 +71,15 @@ let AgentServiceImpl = class AgentServiceImpl {
|
|
|
66
71
|
}
|
|
67
72
|
};
|
|
68
73
|
exports.AgentServiceImpl = AgentServiceImpl;
|
|
69
|
-
tslib_1.__decorate([
|
|
70
|
-
(0, inversify_1.inject)(core_1.ContributionProvider),
|
|
71
|
-
(0, inversify_1.named)(agent_1.Agent),
|
|
72
|
-
tslib_1.__metadata("design:type", Object)
|
|
73
|
-
], AgentServiceImpl.prototype, "agentsProvider", void 0);
|
|
74
74
|
tslib_1.__decorate([
|
|
75
75
|
(0, inversify_1.inject)(settings_service_1.AISettingsService),
|
|
76
76
|
(0, inversify_1.optional)(),
|
|
77
77
|
tslib_1.__metadata("design:type", Object)
|
|
78
78
|
], AgentServiceImpl.prototype, "aiSettingsService", void 0);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, inversify_1.inject)(prompt_service_1.PromptService),
|
|
81
|
+
tslib_1.__metadata("design:type", Object)
|
|
82
|
+
], AgentServiceImpl.prototype, "promptService", void 0);
|
|
79
83
|
tslib_1.__decorate([
|
|
80
84
|
(0, inversify_1.postConstruct)(),
|
|
81
85
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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;IAmDrE,CAAC;IAhDa,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;gBAC1D,IAAI,aAAa,CAAC,MAAM,KAAK,KAAK,EAAE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AAM,CAAC,OAAO,CAAC,CAAC;QACpC,MAAA,IAAI,CAAC,iBAAiB,0CAAE,mBAAmB,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,YAAY,CAAC,OAAe;;QACxB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACjC,MAAA,IAAI,CAAC,iBAAiB,0CAAE,mBAAmB,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,SAAS,CAAC,OAAe;QACrB,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;CACJ,CAAA;AAhEY,4CAAgB;AAGN;IADlB,IAAA,kBAAM,EAAC,oCAAiB,CAAC;IAAE,IAAA,oBAAQ,GAAE;;2DAC8B;AAGjD;IADlB,IAAA,kBAAM,EAAC,8BAAa,CAAC;;uDAC0B;AAUtC;IADT,IAAA,yBAAa,GAAE;;;;4CASf;2BAxBQ,gBAAgB;IAD5B,IAAA,sBAAU,GAAE;GACA,gBAAgB,CAgE5B"}
|
|
@@ -19,5 +19,8 @@ export interface CommunicationRecordingService {
|
|
|
19
19
|
recordResponse(responseEntry: CommunicationResponseEntry): void;
|
|
20
20
|
readonly onDidRecordResponse: Event<CommunicationResponseEntry>;
|
|
21
21
|
getHistory(agentId: string): CommunicationHistory;
|
|
22
|
+
getSessionHistory(sessionId: string): CommunicationHistory;
|
|
23
|
+
clearHistory(): void;
|
|
24
|
+
readonly onStructuralChange: Event<void>;
|
|
22
25
|
}
|
|
23
26
|
//# sourceMappingURL=communication-recording-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"communication-recording-service.d.ts","sourceRoot":"","sources":["../../src/common/communication-recording-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,EAAE,CAAC;AAE/D,MAAM,WAAW,yBAAyB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACxB;AAED,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,yBAAyB,EAAE,UAAU,GAAG,cAAc,CAAC,CAAC;AACrG,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC;AAEpF,eAAO,MAAM,6BAA6B,eAA0C,CAAC;AACrF,MAAM,WAAW,6BAA6B;IAC1C,aAAa,CAAC,YAAY,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC7D,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAE9D,cAAc,CAAC,aAAa,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAChE,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAEhE,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"communication-recording-service.d.ts","sourceRoot":"","sources":["../../src/common/communication-recording-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,EAAE,CAAC;AAE/D,MAAM,WAAW,yBAAyB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACxB;AAED,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,yBAAyB,EAAE,UAAU,GAAG,cAAc,CAAC,CAAC;AACrG,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC;AAEpF,eAAO,MAAM,6BAA6B,eAA0C,CAAC;AACrF,MAAM,WAAW,6BAA6B;IAC1C,aAAa,CAAC,YAAY,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC7D,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAE9D,cAAc,CAAC,aAAa,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAChE,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAEhE,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,oBAAoB,CAAC;IAElD,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,oBAAoB,CAAC;IAE3D,YAAY,IAAI,IAAI,CAAC;IACrB,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;CAC5C"}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { LanguageModelResponse, ToolRequest } from './language-model';
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves the text content from a `LanguageModelResponse` object.
|
|
4
|
+
*
|
|
5
|
+
* **Important:** For stream responses, the stream can only be consumed once. Calling this function multiple times on the same stream response will return an empty string (`''`)
|
|
6
|
+
* on subsequent calls, as the stream will have already been consumed.
|
|
7
|
+
*
|
|
8
|
+
* @param {LanguageModelResponse} response - The response object, which may contain a text, stream, or parsed response.
|
|
9
|
+
* @returns {Promise<string>} - A promise that resolves to the text content of the response.
|
|
10
|
+
* @throws {Error} - Throws an error if the response type is not supported or does not contain valid text content.
|
|
11
|
+
*/
|
|
2
12
|
export declare const getTextOfResponse: (response: LanguageModelResponse) => Promise<string>;
|
|
3
13
|
export declare const getJsonOfResponse: (response: LanguageModelResponse) => Promise<unknown>;
|
|
14
|
+
export declare const getJsonOfText: (text: string) => unknown;
|
|
4
15
|
export declare const toolRequestToPromptText: (toolRequest: ToolRequest) => string;
|
|
5
16
|
//# sourceMappingURL=language-model-util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"language-model-util.d.ts","sourceRoot":"","sources":["../../src/common/language-model-util.ts"],"names":[],"mappings":"AAgBA,OAAO,
|
|
1
|
+
{"version":3,"file":"language-model-util.d.ts","sourceRoot":"","sources":["../../src/common/language-model-util.ts"],"names":[],"mappings":"AAgBA,OAAO,EAA6F,qBAAqB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEjK;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,aAAoB,qBAAqB,KAAG,QAAQ,MAAM,CAavF,CAAC;AAEF,eAAO,MAAM,iBAAiB,aAAoB,qBAAqB,KAAG,QAAQ,OAAO,CAGxF,CAAC;AAEF,eAAO,MAAM,aAAa,SAAU,MAAM,KAAG,OAgB5C,CAAC;AAEF,eAAO,MAAM,uBAAuB,gBAAiB,WAAW,KAAG,MAiBlE,CAAC"}
|
|
@@ -15,8 +15,18 @@
|
|
|
15
15
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
16
|
// *****************************************************************************
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.toolRequestToPromptText = exports.getJsonOfResponse = exports.getTextOfResponse = void 0;
|
|
18
|
+
exports.toolRequestToPromptText = exports.getJsonOfText = exports.getJsonOfResponse = exports.getTextOfResponse = void 0;
|
|
19
19
|
const language_model_1 = require("./language-model");
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves the text content from a `LanguageModelResponse` object.
|
|
22
|
+
*
|
|
23
|
+
* **Important:** For stream responses, the stream can only be consumed once. Calling this function multiple times on the same stream response will return an empty string (`''`)
|
|
24
|
+
* on subsequent calls, as the stream will have already been consumed.
|
|
25
|
+
*
|
|
26
|
+
* @param {LanguageModelResponse} response - The response object, which may contain a text, stream, or parsed response.
|
|
27
|
+
* @returns {Promise<string>} - A promise that resolves to the text content of the response.
|
|
28
|
+
* @throws {Error} - Throws an error if the response type is not supported or does not contain valid text content.
|
|
29
|
+
*/
|
|
20
30
|
const getTextOfResponse = async (response) => {
|
|
21
31
|
var _a;
|
|
22
32
|
if ((0, language_model_1.isLanguageModelTextResponse)(response)) {
|
|
@@ -29,11 +39,18 @@ const getTextOfResponse = async (response) => {
|
|
|
29
39
|
}
|
|
30
40
|
return result;
|
|
31
41
|
}
|
|
42
|
+
else if ((0, language_model_1.isLanguageModelParsedResponse)(response)) {
|
|
43
|
+
return response.content;
|
|
44
|
+
}
|
|
32
45
|
throw new Error(`Invalid response type ${response}`);
|
|
33
46
|
};
|
|
34
47
|
exports.getTextOfResponse = getTextOfResponse;
|
|
35
48
|
const getJsonOfResponse = async (response) => {
|
|
36
49
|
const text = await (0, exports.getTextOfResponse)(response);
|
|
50
|
+
return (0, exports.getJsonOfText)(text);
|
|
51
|
+
};
|
|
52
|
+
exports.getJsonOfResponse = getJsonOfResponse;
|
|
53
|
+
const getJsonOfText = (text) => {
|
|
37
54
|
if (text.startsWith('```json')) {
|
|
38
55
|
const regex = /```json\s*([\s\S]*?)\s*```/g;
|
|
39
56
|
let match;
|
|
@@ -52,7 +69,7 @@ const getJsonOfResponse = async (response) => {
|
|
|
52
69
|
}
|
|
53
70
|
throw new Error('Invalid response format');
|
|
54
71
|
};
|
|
55
|
-
exports.
|
|
72
|
+
exports.getJsonOfText = getJsonOfText;
|
|
56
73
|
const toolRequestToPromptText = (toolRequest) => {
|
|
57
74
|
const parameters = toolRequest.parameters;
|
|
58
75
|
let paramsText = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"language-model-util.js","sourceRoot":"","sources":["../../src/common/language-model-util.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,
|
|
1
|
+
{"version":3,"file":"language-model-util.js","sourceRoot":"","sources":["../../src/common/language-model-util.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,qDAAiK;AAEjK;;;;;;;;;GASG;AACI,MAAM,iBAAiB,GAAG,KAAK,EAAE,QAA+B,EAAmB,EAAE;;IACxF,IAAI,IAAA,4CAA2B,EAAC,QAAQ,CAAC,EAAE,CAAC;QACxC,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;SAAM,IAAI,IAAA,8CAA6B,EAAC,QAAQ,CAAC,EAAE,CAAC;QACjD,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACxC,MAAM,IAAI,MAAA,KAAK,CAAC,OAAO,mCAAI,EAAE,CAAC;QAClC,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;SAAM,IAAI,IAAA,8CAA6B,EAAC,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC5B,CAAC;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AU,GAAG,EAAE,CAAC;IACpB,6GAA6G;IAC7G,IAAI,UAAU,EAAE,CAAC;QACb,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACzC,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;aAC/B,GAAG,CAAC,GAAG,CAAC,EAAE;YACP,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;YAC9B,OAAO,GAAG,GAAG,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;QACnC,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,MAAM,eAAe,GAAG,WAAW,CAAC,WAAW;QAC3C,CAAC,CAAC,KAAK,WAAW,CAAC,WAAW,EAAE;QAChC,CAAC,CAAC,EAAE,CAAC;IACT,OAAO,0BAA0B,WAAW,CAAC,EAAE,IAAI,UAAU,IAAI,eAAe,EAAE,CAAC;AACvF,CAAC,CAAC;AAjBW,QAAA,uBAAuB,2BAiBlC"}
|
|
@@ -39,16 +39,32 @@ export interface PromptService {
|
|
|
39
39
|
[key: string]: unknown;
|
|
40
40
|
}): Promise<ResolvedPromptTemplate | undefined>;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* Adds a prompt to the list of prompts.
|
|
43
43
|
* @param id the id of the prompt
|
|
44
44
|
* @param prompt the prompt template to store
|
|
45
45
|
*/
|
|
46
46
|
storePrompt(id: string, prompt: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Removes a prompt from the list of prompts.
|
|
49
|
+
* @param id the id of the prompt
|
|
50
|
+
*/
|
|
51
|
+
removePrompt(id: string): void;
|
|
47
52
|
/**
|
|
48
53
|
* Return all known prompts as a {@link PromptMap map}.
|
|
49
54
|
*/
|
|
50
55
|
getAllPrompts(): PromptMap;
|
|
51
56
|
}
|
|
57
|
+
export interface CustomAgentDescription {
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
description: string;
|
|
61
|
+
prompt: string;
|
|
62
|
+
defaultLLM: string;
|
|
63
|
+
}
|
|
64
|
+
export declare namespace CustomAgentDescription {
|
|
65
|
+
function is(entry: unknown): entry is CustomAgentDescription;
|
|
66
|
+
function equals(a: CustomAgentDescription, b: CustomAgentDescription): boolean;
|
|
67
|
+
}
|
|
52
68
|
export declare const PromptCustomizationService: unique symbol;
|
|
53
69
|
export interface PromptCustomizationService {
|
|
54
70
|
/**
|
|
@@ -67,9 +83,9 @@ export interface PromptCustomizationService {
|
|
|
67
83
|
* on the implementation. Implementation may for example decide to
|
|
68
84
|
* open an editor, or request more information from the user, ...
|
|
69
85
|
* @param id the template id.
|
|
70
|
-
* @param content optional content to
|
|
86
|
+
* @param content optional default content to initialize the template
|
|
71
87
|
*/
|
|
72
|
-
editTemplate(id: string,
|
|
88
|
+
editTemplate(id: string, defaultContent?: string): void;
|
|
73
89
|
/**
|
|
74
90
|
* Reset the template to its default value.
|
|
75
91
|
* @param id the template id.
|
|
@@ -84,6 +100,19 @@ export interface PromptCustomizationService {
|
|
|
84
100
|
* Event which is fired when the prompt template is changed.
|
|
85
101
|
*/
|
|
86
102
|
readonly onDidChangePrompt: Event<string>;
|
|
103
|
+
/**
|
|
104
|
+
* Return all custom agents.
|
|
105
|
+
* @returns all custom agents
|
|
106
|
+
*/
|
|
107
|
+
getCustomAgents(): Promise<CustomAgentDescription[]>;
|
|
108
|
+
/**
|
|
109
|
+
* Event which is fired when custom agents are modified.
|
|
110
|
+
*/
|
|
111
|
+
readonly onDidChangeCustomAgents: Event<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Open the custom agent yaml file.
|
|
114
|
+
*/
|
|
115
|
+
openCustomAgentYaml(): void;
|
|
87
116
|
}
|
|
88
117
|
export declare class PromptServiceImpl implements PromptService {
|
|
89
118
|
protected readonly customizationService: PromptCustomizationService | undefined;
|
|
@@ -97,5 +126,6 @@ export declare class PromptServiceImpl implements PromptService {
|
|
|
97
126
|
}): Promise<ResolvedPromptTemplate | undefined>;
|
|
98
127
|
getAllPrompts(): PromptMap;
|
|
99
128
|
storePrompt(id: string, prompt: string): void;
|
|
129
|
+
removePrompt(id: string): void;
|
|
100
130
|
}
|
|
101
131
|
//# sourceMappingURL=prompt-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-service.d.ts","sourceRoot":"","sources":["../../src/common/prompt-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IAAG,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,CAAA;CAAE;AAE3D,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,MAAM,WAAW,aAAa;IAC1B;;;OAGG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;IACrD;;;OAGG;IACH,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;IAC5D;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAA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************************
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.PromptServiceImpl = exports.PromptCustomizationService = exports.PromptService = void 0;
|
|
18
|
+
exports.PromptServiceImpl = exports.PromptCustomizationService = exports.CustomAgentDescription = exports.PromptService = void 0;
|
|
19
19
|
const tslib_1 = require("tslib");
|
|
20
20
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
21
|
const variable_service_1 = require("./variable-service");
|
|
@@ -23,6 +23,25 @@ const tool_invocation_registry_1 = require("./tool-invocation-registry");
|
|
|
23
23
|
const language_model_util_1 = require("./language-model-util");
|
|
24
24
|
const prompt_service_util_1 = require("./prompt-service-util");
|
|
25
25
|
exports.PromptService = Symbol('PromptService');
|
|
26
|
+
var CustomAgentDescription;
|
|
27
|
+
(function (CustomAgentDescription) {
|
|
28
|
+
function is(entry) {
|
|
29
|
+
// eslint-disable-next-line no-null/no-null
|
|
30
|
+
return typeof entry === 'object' && entry !== null
|
|
31
|
+
&& 'id' in entry && typeof entry.id === 'string'
|
|
32
|
+
&& 'name' in entry && typeof entry.name === 'string'
|
|
33
|
+
&& 'description' in entry && typeof entry.description === 'string'
|
|
34
|
+
&& 'prompt' in entry
|
|
35
|
+
&& typeof entry.prompt === 'string'
|
|
36
|
+
&& 'defaultLLM' in entry
|
|
37
|
+
&& typeof entry.defaultLLM === 'string';
|
|
38
|
+
}
|
|
39
|
+
CustomAgentDescription.is = is;
|
|
40
|
+
function equals(a, b) {
|
|
41
|
+
return a.id === b.id && a.name === b.name && a.description === b.description && a.prompt === b.prompt && a.defaultLLM === b.defaultLLM;
|
|
42
|
+
}
|
|
43
|
+
CustomAgentDescription.equals = equals;
|
|
44
|
+
})(CustomAgentDescription || (exports.CustomAgentDescription = CustomAgentDescription = {}));
|
|
26
45
|
exports.PromptCustomizationService = Symbol('PromptCustomizationService');
|
|
27
46
|
let PromptServiceImpl = class PromptServiceImpl {
|
|
28
47
|
constructor() {
|
|
@@ -116,6 +135,9 @@ let PromptServiceImpl = class PromptServiceImpl {
|
|
|
116
135
|
storePrompt(id, prompt) {
|
|
117
136
|
this._prompts[id] = { id, template: prompt };
|
|
118
137
|
}
|
|
138
|
+
removePrompt(id) {
|
|
139
|
+
delete this._prompts[id];
|
|
140
|
+
}
|
|
119
141
|
};
|
|
120
142
|
exports.PromptServiceImpl = PromptServiceImpl;
|
|
121
143
|
tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-service.js","sourceRoot":"","sources":["../../src/common/prompt-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;;;;AAGhF,4DAA4E;AAC5E,yDAAuD;AACvD,yEAAoE;AACpE,+DAAgE;AAEhE,+DAAqF;AAiBxE,QAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"prompt-service.js","sourceRoot":"","sources":["../../src/common/prompt-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;;;;AAGhF,4DAA4E;AAC5E,yDAAuD;AACvD,yEAAoE;AACpE,+DAAgE;AAEhE,+DAAqF;AAiBxE,QAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AA4CrD,IAAiB,sBAAsB,CAetC;AAfD,WAAiB,sBAAsB;IACnC,SAAgB,EAAE,CAAC,KAAc;QAC7B,2CAA2C;Q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AY,CAAC,EAAU;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;CACJ,CAAA;AArGY,8CAAiB;AAEP;IADlB,IAAA,kBAAM,EAAC,kCAA0B,CAAC;IAAE,IAAA,oBAAQ,GAAE;;+DACiC;AAG7D;IADlB,IAAA,kBAAM,EAAC,oCAAiB,CAAC;IAAE,IAAA,oBAAQ,GAAE;;0DAC4B;AAG/C;IADlB,IAAA,kBAAM,EAAC,iDAAsB,CAAC;IAAE,IAAA,oBAAQ,GAAE;;iEACmC;4BARrE,iBAAiB;IAD7B,IAAA,sBAAU,GAAE;GACA,iBAAiB,CAqG7B"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/ai-core",
|
|
3
|
-
"version": "1.55.0
|
|
3
|
+
"version": "1.55.0",
|
|
4
4
|
"description": "Theia - AI Core",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.55.0
|
|
7
|
-
"@theia/editor": "1.55.0
|
|
8
|
-
"@theia/filesystem": "1.55.0
|
|
9
|
-
"@theia/monaco": "1.55.0
|
|
6
|
+
"@theia/core": "1.55.0",
|
|
7
|
+
"@theia/editor": "1.55.0",
|
|
8
|
+
"@theia/filesystem": "1.55.0",
|
|
9
|
+
"@theia/monaco": "1.55.0",
|
|
10
10
|
"@theia/monaco-editor-core": "1.83.101",
|
|
11
|
-
"@theia/output": "1.55.0
|
|
12
|
-
"@theia/variable-resolver": "1.55.0
|
|
13
|
-
"@theia/workspace": "1.55.0
|
|
11
|
+
"@theia/output": "1.55.0",
|
|
12
|
+
"@theia/variable-resolver": "1.55.0",
|
|
13
|
+
"@theia/workspace": "1.55.0",
|
|
14
|
+
"@types/js-yaml": "^4.0.9",
|
|
15
|
+
"js-yaml": "^4.1.0",
|
|
14
16
|
"minimatch": "^5.1.0",
|
|
15
17
|
"tslib": "^2.6.2"
|
|
16
18
|
},
|
|
@@ -50,10 +52,10 @@
|
|
|
50
52
|
"watch": "theiaext watch"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
|
-
"@theia/ext-scripts": "1.
|
|
55
|
+
"@theia/ext-scripts": "1.55.0"
|
|
54
56
|
},
|
|
55
57
|
"nyc": {
|
|
56
58
|
"extends": "../../configs/nyc.json"
|
|
57
59
|
},
|
|
58
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "0e7a523b8e798679d2e098709c63bd7060e54c8a"
|
|
59
61
|
}
|
|
@@ -87,6 +87,7 @@ export class AIAgentConfigurationWidget extends ReactWidget {
|
|
|
87
87
|
|
|
88
88
|
this.aiSettingsService.onDidChange(() => this.update());
|
|
89
89
|
this.aiConfigurationSelectionService.onDidAgentChange(() => this.update());
|
|
90
|
+
this.agentService.onDidChangeAgents(() => this.update());
|
|
90
91
|
this.update();
|
|
91
92
|
}
|
|
92
93
|
|
|
@@ -100,6 +101,9 @@ export class AIAgentConfigurationWidget extends ReactWidget {
|
|
|
100
101
|
</li>
|
|
101
102
|
)}
|
|
102
103
|
</ul>
|
|
104
|
+
<div className='configuration-agents-add'>
|
|
105
|
+
<button style={{ marginLeft: 0 }} className='theia-button main' onClick={() => this.addCustomAgent()}>Add Custom Agent</button>
|
|
106
|
+
</div>
|
|
103
107
|
</div>
|
|
104
108
|
<div className='configuration-agent-panel preferences-editor-widget'>
|
|
105
109
|
{this.renderAgentDetails()}
|
|
@@ -205,6 +209,10 @@ export class AIAgentConfigurationWidget extends ReactWidget {
|
|
|
205
209
|
this.aiConfigurationSelectionService.selectConfigurationTab(AIVariableConfigurationWidget.ID);
|
|
206
210
|
}
|
|
207
211
|
|
|
212
|
+
protected addCustomAgent(): void {
|
|
213
|
+
this.promptCustomizationService.openCustomAgentYaml();
|
|
214
|
+
}
|
|
215
|
+
|
|
208
216
|
protected setActiveAgent(agent: Agent): void {
|
|
209
217
|
this.aiConfigurationSelectionService.setActiveAgent(agent);
|
|
210
218
|
this.update();
|
|
@@ -25,7 +25,7 @@ export interface TemplateSettingProps {
|
|
|
25
25
|
|
|
26
26
|
export const TemplateRenderer: React.FC<TemplateSettingProps> = ({ agentId, template, promptCustomizationService }) => {
|
|
27
27
|
const openTemplate = React.useCallback(async () => {
|
|
28
|
-
promptCustomizationService.editTemplate(template.id);
|
|
28
|
+
promptCustomizationService.editTemplate(template.id, template.template);
|
|
29
29
|
}, [template, promptCustomizationService]);
|
|
30
30
|
const resetTemplate = React.useCallback(async () => {
|
|
31
31
|
promptCustomizationService.resetTemplate(template.id);
|
|
@@ -15,23 +15,22 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
18
|
-
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
19
|
-
import {
|
|
18
|
+
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
19
|
+
import { Agent } from '../common';
|
|
20
20
|
import { AgentService } from '../common/agent-service';
|
|
21
|
+
import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
|
|
21
22
|
|
|
22
23
|
@injectable()
|
|
23
24
|
export class AICoreFrontendApplicationContribution implements FrontendApplicationContribution {
|
|
24
25
|
@inject(AgentService)
|
|
25
26
|
private readonly agentService: AgentService;
|
|
26
27
|
|
|
27
|
-
@inject(
|
|
28
|
-
|
|
28
|
+
@inject(ContributionProvider) @named(Agent)
|
|
29
|
+
protected readonly agentsProvider: ContributionProvider<Agent>;
|
|
29
30
|
|
|
30
31
|
onStart(): void {
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
this.promptService.storePrompt(t.id, t.template);
|
|
34
|
-
});
|
|
32
|
+
this.agentsProvider.getContributions().forEach(agent => {
|
|
33
|
+
this.agentService.registerAgent(agent);
|
|
35
34
|
});
|
|
36
35
|
}
|
|
37
36
|
|