@theia/ai-ide 1.62.0-next.3 → 1.62.1
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 +3 -3
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/agent-configuration-widget.js +24 -18
- package/lib/browser/ai-configuration/agent-configuration-widget.js.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +1 -1
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-widget.d.ts +2 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-widget.js +6 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.js.map +1 -1
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts +138 -0
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js +492 -0
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts +4 -5
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +1 -1
- package/lib/browser/ai-configuration/template-settings-renderer.js +15 -31
- package/lib/browser/ai-configuration/template-settings-renderer.js.map +1 -1
- package/lib/browser/architect-agent.d.ts +1 -1
- package/lib/browser/architect-agent.d.ts.map +1 -1
- package/lib/browser/architect-agent.js +2 -2
- package/lib/browser/architect-agent.js.map +1 -1
- package/lib/browser/coder-agent.d.ts +2 -2
- package/lib/browser/coder-agent.d.ts.map +1 -1
- package/lib/browser/coder-agent.js +7 -3
- package/lib/browser/coder-agent.js.map +1 -1
- package/lib/browser/file-changeset-functions.d.ts +14 -1
- package/lib/browser/file-changeset-functions.d.ts.map +1 -1
- package/lib/browser/file-changeset-functions.js +153 -14
- package/lib/browser/file-changeset-functions.js.map +1 -1
- package/lib/browser/frontend-module.d.ts.map +1 -1
- package/lib/browser/frontend-module.js +11 -1
- package/lib/browser/frontend-module.js.map +1 -1
- package/lib/browser/template-preference-contribution.d.ts +2 -2
- package/lib/browser/template-preference-contribution.d.ts.map +1 -1
- package/lib/browser/template-preference-contribution.js +2 -2
- package/lib/browser/template-preference-contribution.js.map +1 -1
- package/lib/browser/workspace-functions.d.ts +1 -1
- package/lib/browser/workspace-functions.js +13 -13
- package/lib/common/architect-prompt-template.d.ts +2 -3
- package/lib/common/architect-prompt-template.d.ts.map +1 -1
- package/lib/common/architect-prompt-template.js +49 -11
- package/lib/common/architect-prompt-template.js.map +1 -1
- package/lib/common/coder-replace-prompt-template.d.ts +6 -3
- package/lib/common/coder-replace-prompt-template.d.ts.map +1 -1
- package/lib/common/coder-replace-prompt-template.js +148 -22
- package/lib/common/coder-replace-prompt-template.js.map +1 -1
- package/lib/common/command-chat-agents.d.ts +1 -1
- package/lib/common/command-chat-agents.d.ts.map +1 -1
- package/lib/common/command-chat-agents.js +4 -4
- package/lib/common/command-chat-agents.js.map +1 -1
- package/lib/common/command-prompt-template.d.ts +2 -2
- package/lib/common/command-prompt-template.d.ts.map +1 -1
- package/lib/common/command-prompt-template.js +18 -15
- package/lib/common/command-prompt-template.js.map +1 -1
- package/lib/common/orchestrator-chat-agent.d.ts +2 -3
- package/lib/common/orchestrator-chat-agent.d.ts.map +1 -1
- package/lib/common/orchestrator-chat-agent.js +11 -26
- package/lib/common/orchestrator-chat-agent.js.map +1 -1
- package/lib/common/orchestrator-prompt-template.d.ts +2 -2
- package/lib/common/orchestrator-prompt-template.d.ts.map +1 -1
- package/lib/common/orchestrator-prompt-template.js +4 -1
- package/lib/common/orchestrator-prompt-template.js.map +1 -1
- package/lib/common/universal-chat-agent.d.ts +5 -1
- package/lib/common/universal-chat-agent.d.ts.map +1 -1
- package/lib/common/universal-chat-agent.js +2 -2
- package/lib/common/universal-chat-agent.js.map +1 -1
- package/lib/common/universal-prompt-template.d.ts +3 -3
- package/lib/common/universal-prompt-template.d.ts.map +1 -1
- package/lib/common/universal-prompt-template.js +1 -2
- package/lib/common/universal-prompt-template.js.map +1 -1
- package/package.json +17 -17
- package/src/browser/ai-configuration/agent-configuration-widget.tsx +31 -24
- package/src/browser/ai-configuration/ai-configuration-view-contribution.ts +1 -1
- package/src/browser/ai-configuration/ai-configuration-widget.tsx +6 -0
- package/src/browser/ai-configuration/prompt-fragments-configuration-widget.tsx +710 -0
- package/src/browser/ai-configuration/template-settings-renderer.tsx +18 -38
- package/src/browser/architect-agent.ts +3 -3
- package/src/browser/coder-agent.ts +10 -5
- package/src/browser/file-changeset-functions.ts +152 -14
- package/src/browser/frontend-module.ts +14 -2
- package/src/browser/style/index.css +320 -0
- package/src/browser/template-preference-contribution.ts +4 -4
- package/src/browser/workspace-functions.ts +3 -3
- package/src/common/architect-prompt-template.ts +54 -14
- package/src/common/coder-replace-prompt-template.ts +150 -24
- package/src/common/command-chat-agents.ts +4 -4
- package/src/common/command-prompt-template.ts +21 -18
- package/src/common/orchestrator-chat-agent.ts +12 -28
- package/src/common/orchestrator-prompt-template.ts +7 -4
- package/src/common/universal-chat-agent.ts +2 -2
- package/src/common/universal-prompt-template.ts +4 -5
|
@@ -82,8 +82,8 @@ tslib_1.__decorate([
|
|
|
82
82
|
tslib_1.__metadata("design:type", Object)
|
|
83
83
|
], TemplatePreferenceContribution.prototype, "preferenceService", void 0);
|
|
84
84
|
tslib_1.__decorate([
|
|
85
|
-
(0, inversify_1.inject)(frontend_prompt_customization_service_1.
|
|
86
|
-
tslib_1.__metadata("design:type", frontend_prompt_customization_service_1.
|
|
85
|
+
(0, inversify_1.inject)(frontend_prompt_customization_service_1.DefaultPromptFragmentCustomizationService),
|
|
86
|
+
tslib_1.__metadata("design:type", frontend_prompt_customization_service_1.DefaultPromptFragmentCustomizationService)
|
|
87
87
|
], TemplatePreferenceContribution.prototype, "customizationService", void 0);
|
|
88
88
|
tslib_1.__decorate([
|
|
89
89
|
(0, inversify_1.inject)(browser_2.WorkspaceService),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-preference-contribution.js","sourceRoot":"","sources":["../../src/browser/template-preference-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;;;;AAEhF,qDAA6F;AAC7F,4DAAkE;AAClE,
|
|
1
|
+
{"version":3,"file":"template-preference-contribution.js","sourceRoot":"","sources":["../../src/browser/template-preference-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;;;;AAEhF,qDAA6F;AAC7F,4DAAkE;AAClE,4HAAoK;AACpK,mEAIiC;AACjC,0DAAgE;AAChE,sCAAmC;AAG5B,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAWvC,OAAO;QACH,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YAC/E,sDAAsD;YACtD,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAE3B,gCAAgC;YAChC,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE;gBAC/C,IAAI,KAAK,CAAC,cAAc,KAAK,kEAA0C;oBACnE,KAAK,CAAC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AAC,iBAAiB,CAAC,GAAG,CAAW,kEAA0C,EAAE,EAAE,CAAC,CAAC;QACvH,CAAC;QAED,IAAI,CAAC,iBAAiB,IAAI,iBAAiB,KAAK,4DAAoC,EAAE,CAAC;YACnF,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAW,4DAAoC,EAAE,EAAE,CAAC,CAAC;YACzG,gBAAgB,CAAC,SAAS,GAAG,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;gBAC1D,MAAM,IAAI,GAAG,IAAI,WAAI,CAAC,QAAQ,CAAC,CAAC;gBAChC,MAAM,GAAG,GAAG,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACtD,OAAO,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC/B,CAAC,CAAC,CAAC;QACP,CAAC;QAED,MAAM,IAAI,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC1E,CAAC;CACJ,CAAA;AAtEY,wEAA8B;AAGpB;IADlB,IAAA,kBAAM,EAAC,2BAAiB,CAAC;;yEAC8B;AAGrC;IADlB,IAAA,kBAAM,EAAC,iFAAyC,CAAC;sCACT,iFAAyC;4EAAC;AAGhE;IADlB,IAAA,kBAAM,EAAC,0BAAgB,CAAC;sCACY,0BAAgB;wEAAC;yCAT7C,8BAA8B;IAD1C,IAAA,sBAAU,GAAE;GACA,8BAA8B,CAsE1C"}
|
|
@@ -48,7 +48,7 @@ export declare class GetWorkspaceFileList implements ToolProvider {
|
|
|
48
48
|
getProjectFileList(path?: string): Promise<string[]>;
|
|
49
49
|
private listFilesDirectly;
|
|
50
50
|
}
|
|
51
|
-
export declare class
|
|
51
|
+
export declare class FileDiagnosticProvider implements ToolProvider {
|
|
52
52
|
static ID: string;
|
|
53
53
|
protected readonly workspaceScope: WorkspaceFunctionScope;
|
|
54
54
|
protected readonly problemManager: ProblemManager;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var GetWorkspaceDirectoryStructure_1, FileContentFunction_1, GetWorkspaceFileList_1,
|
|
2
|
+
var GetWorkspaceDirectoryStructure_1, FileContentFunction_1, GetWorkspaceFileList_1, FileDiagnosticProvider_1;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.FileDiagnosticProvider = exports.GetWorkspaceFileList = exports.FileContentFunction = exports.GetWorkspaceDirectoryStructure = exports.WorkspaceFunctionScope = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
7
7
|
const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
|
|
@@ -310,11 +310,11 @@ tslib_1.__decorate([
|
|
|
310
310
|
exports.GetWorkspaceFileList = GetWorkspaceFileList = GetWorkspaceFileList_1 = tslib_1.__decorate([
|
|
311
311
|
(0, inversify_1.injectable)()
|
|
312
312
|
], GetWorkspaceFileList);
|
|
313
|
-
let
|
|
313
|
+
let FileDiagnosticProvider = FileDiagnosticProvider_1 = class FileDiagnosticProvider {
|
|
314
314
|
getTool() {
|
|
315
315
|
return {
|
|
316
|
-
id:
|
|
317
|
-
name:
|
|
316
|
+
id: FileDiagnosticProvider_1.ID,
|
|
317
|
+
name: FileDiagnosticProvider_1.ID,
|
|
318
318
|
description: 'A function to retrieve diagnostics associated with a specific file in the workspace. It will return a list of problems that includes the surrounding text \
|
|
319
319
|
a message describing the problem, and optionally a code and a codeDescription field describing that code.',
|
|
320
320
|
parameters: {
|
|
@@ -408,25 +408,25 @@ let FileDiagonsticProvider = FileDiagonsticProvider_1 = class FileDiagonsticProv
|
|
|
408
408
|
return { end: { character: Number.MAX_SAFE_INTEGER, line: endLine }, start: { character: 0, line: startLine } };
|
|
409
409
|
}
|
|
410
410
|
};
|
|
411
|
-
exports.
|
|
412
|
-
|
|
411
|
+
exports.FileDiagnosticProvider = FileDiagnosticProvider;
|
|
412
|
+
FileDiagnosticProvider.ID = workspace_functions_1.GET_FILE_DIAGNOSTICS_ID;
|
|
413
413
|
tslib_1.__decorate([
|
|
414
414
|
(0, inversify_1.inject)(WorkspaceFunctionScope),
|
|
415
415
|
tslib_1.__metadata("design:type", WorkspaceFunctionScope)
|
|
416
|
-
],
|
|
416
|
+
], FileDiagnosticProvider.prototype, "workspaceScope", void 0);
|
|
417
417
|
tslib_1.__decorate([
|
|
418
418
|
(0, inversify_1.inject)(browser_3.ProblemManager),
|
|
419
419
|
tslib_1.__metadata("design:type", browser_3.ProblemManager)
|
|
420
|
-
],
|
|
420
|
+
], FileDiagnosticProvider.prototype, "problemManager", void 0);
|
|
421
421
|
tslib_1.__decorate([
|
|
422
422
|
(0, inversify_1.inject)(monaco_text_model_service_1.MonacoTextModelService),
|
|
423
423
|
tslib_1.__metadata("design:type", monaco_text_model_service_1.MonacoTextModelService)
|
|
424
|
-
],
|
|
424
|
+
], FileDiagnosticProvider.prototype, "modelService", void 0);
|
|
425
425
|
tslib_1.__decorate([
|
|
426
426
|
(0, inversify_1.inject)(browser_2.OpenerService),
|
|
427
427
|
tslib_1.__metadata("design:type", Object)
|
|
428
|
-
],
|
|
429
|
-
exports.
|
|
428
|
+
], FileDiagnosticProvider.prototype, "openerService", void 0);
|
|
429
|
+
exports.FileDiagnosticProvider = FileDiagnosticProvider = FileDiagnosticProvider_1 = tslib_1.__decorate([
|
|
430
430
|
(0, inversify_1.injectable)()
|
|
431
|
-
],
|
|
431
|
+
], FileDiagnosticProvider);
|
|
432
432
|
//# sourceMappingURL=workspace-functions.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PromptVariantSet } from '@theia/ai-core/lib/common';
|
|
2
2
|
export declare const ARCHITECT_TASK_SUMMARY_PROMPT_TEMPLATE_ID = "architect-task-summary";
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const architectTaskSummaryPromptTemplate: PromptTemplate;
|
|
3
|
+
export declare const architectVariants: PromptVariantSet;
|
|
5
4
|
//# sourceMappingURL=architect-prompt-template.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"architect-prompt-template.d.ts","sourceRoot":"","sources":["../../src/common/architect-prompt-template.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"architect-prompt-template.d.ts","sourceRoot":"","sources":["../../src/common/architect-prompt-template.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAQ7D,eAAO,MAAM,yCAAyC,2BAA2B,CAAC;AAElF,eAAO,MAAM,iBAAiB,kBA0F7B,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.architectVariants = exports.ARCHITECT_TASK_SUMMARY_PROMPT_TEMPLATE_ID = void 0;
|
|
4
4
|
const workspace_functions_1 = require("./workspace-functions");
|
|
5
5
|
const context_variables_1 = require("./context-variables");
|
|
6
|
+
const context_functions_1 = require("./context-functions");
|
|
6
7
|
exports.ARCHITECT_TASK_SUMMARY_PROMPT_TEMPLATE_ID = 'architect-task-summary';
|
|
7
|
-
exports.
|
|
8
|
+
exports.architectVariants = {
|
|
8
9
|
id: 'architect-system',
|
|
9
|
-
|
|
10
|
+
defaultVariant: {
|
|
11
|
+
id: 'architect-system-default',
|
|
12
|
+
template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
10
13
|
Made improvements or adaptations to this prompt template? We’d love for you to share it with the community! Contribute back here:
|
|
11
14
|
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
12
15
|
# Instructions
|
|
@@ -28,17 +31,51 @@ Use the following functions to interact with the workspace files as needed:
|
|
|
28
31
|
3. **Navigate Step-by-Step**: Move into subdirectories only as needed, confirming each directory level.
|
|
29
32
|
|
|
30
33
|
## Additional Context
|
|
34
|
+
The following files have been provided for additional context. Some of them may also be referred to by the user (e.g. "this file" or "the attachment"). \
|
|
35
|
+
Always look at the relevant files to understand your task using the function ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}
|
|
36
|
+
{{${context_variables_1.CONTEXT_FILES_VARIABLE_ID}}}
|
|
37
|
+
|
|
38
|
+
{{prompt:project-info}}
|
|
39
|
+
`
|
|
40
|
+
},
|
|
41
|
+
variants: [
|
|
42
|
+
{
|
|
43
|
+
id: 'architect-system-next',
|
|
44
|
+
template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
45
|
+
Made improvements or adaptations to this prompt template? We’d love for you to share it with the community! Contribute back here:
|
|
46
|
+
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
47
|
+
# Instructions
|
|
48
|
+
|
|
49
|
+
You are an AI assistant integrated into Theia IDE, designed to assist software developers. You can't change any files, but you can navigate and read the users workspace using \
|
|
50
|
+
the provided functions. Therefore describe and explain the details or procedures necessary to achieve the desired outcome. If file changes are necessary to help the user, be \
|
|
51
|
+
aware that there is another agent called 'Coder' that can suggest file changes. In this case you can create a description on what to do and tell the user to ask '@Coder' to \
|
|
52
|
+
implement the change plan. If you refer to files, always mention the workspace-relative path.\
|
|
53
|
+
|
|
54
|
+
## Context Retrieval
|
|
55
|
+
Use the following functions to interact with the workspace files if you require context:
|
|
56
|
+
- **~{${workspace_functions_1.GET_WORKSPACE_DIRECTORY_STRUCTURE_FUNCTION_ID}}**
|
|
57
|
+
- **~{${workspace_functions_1.GET_WORKSPACE_FILE_LIST_FUNCTION_ID}}**
|
|
58
|
+
- **~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}**
|
|
59
|
+
- **~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}}**
|
|
60
|
+
|
|
61
|
+
Remember file locations that are relevant for completing your tasks using **~{${context_functions_1.UPDATE_CONTEXT_FILES_FUNCTION_ID}}**
|
|
62
|
+
Only add files that are really relevant to look at later. Only add files that are really relevant to look at later.
|
|
31
63
|
|
|
32
|
-
|
|
33
|
-
|
|
64
|
+
## File Validation
|
|
65
|
+
Use the following function to retrieve a list of problems in a file if the user requests fixes in a given file: **~{${workspace_functions_1.GET_FILE_DIAGNOSTICS_ID}}**
|
|
66
|
+
## Additional Context
|
|
67
|
+
The following files have been provided for additional context. Some of them may also be referred to by the user (e.g. "this file" or "the attachment"). \
|
|
68
|
+
Always look at the relevant files to understand your task using the function ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}
|
|
34
69
|
{{${context_variables_1.CONTEXT_FILES_VARIABLE_ID}}}
|
|
35
70
|
|
|
36
71
|
{{prompt:project-info}}
|
|
72
|
+
|
|
73
|
+
{{${context_variables_1.TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
|
|
37
74
|
`
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: exports.ARCHITECT_TASK_SUMMARY_PROMPT_TEMPLATE_ID,
|
|
78
|
+
template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
42
79
|
Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
|
|
43
80
|
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
44
81
|
|
|
@@ -55,7 +92,8 @@ Skip irrelevant information, e.g. for discussions, only sum up the final result.
|
|
|
55
92
|
4. If any part of the task is ambiguous, note the ambiguity so that it can be clarified later.
|
|
56
93
|
|
|
57
94
|
Focus on providing actionable steps and implementation guidance. The coding agent needs practical help with this specific coding task.
|
|
58
|
-
|
|
59
|
-
|
|
95
|
+
`
|
|
96
|
+
}
|
|
97
|
+
]
|
|
60
98
|
};
|
|
61
99
|
//# sourceMappingURL=architect-prompt-template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"architect-prompt-template.js","sourceRoot":"","sources":["../../src/common/architect-prompt-template.ts"],"names":[],"mappings":";;;AAWA,+
|
|
1
|
+
{"version":3,"file":"architect-prompt-template.js","sourceRoot":"","sources":["../../src/common/architect-prompt-template.ts"],"names":[],"mappings":";;;AAWA,+DAG+B;AAC/B,2DAAkG;AAClG,2DAAuE;AAE1D,QAAA,yCAAyC,GAAG,wBAAwB,CAAC;AAErE,QAAA,iBAAiB,GAAqB;IAC/C,EAAE,EAAE,kBAAkB;IACtB,cAAc,EAAE;QACZ,EAAE,EAAE,0BAA0B;QAC9B,QAAQ,EAAE;;;;;;;;;;;QAWV,mEAA6C;QAC7C,yDAAmC;QACnC,8CAAwB;;;;;;;;;;iFAUiD,8CAAwB;IACrG,6CAAyB;;;CAG5B;KACI;IACD,QAAQ,EAAE;QACN;YACI,EAAE,EAAE,uBAAuB;YAC3B,QAAQ,EAAE;;;;;;;;;;;;QAYd,mEAA6C;QAC7C,yDAAmC;QACnC,8CAAwB;QACxB,qDAA+B;;gFAEyC,oDAAgC;;;;sHAIM,6CAAuB;;;iFAG5D,8CAAwB;IACrG,6CAAyB;;;;IAIzB,oDAAgC;CACnC;SACQ;QACD;YACI,EAAE,EAAE,iDAAyC;YAC7C,QAAQ,EAAE;;;;;;;;;;;;;;;;;CAiBrB;SACQ;KACJ;CACJ,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BasePromptFragment } from '@theia/ai-core/lib/common';
|
|
2
|
+
export declare const CODER_SYSTEM_PROMPT_ID = "coder-prompt";
|
|
2
3
|
export declare const CODER_REWRITE_PROMPT_TEMPLATE_ID = "coder-rewrite";
|
|
3
4
|
export declare const CODER_REPLACE_PROMPT_TEMPLATE_ID = "coder-search-replace";
|
|
4
5
|
export declare const CODER_REPLACE_PROMPT_TEMPLATE_NEXT_ID = "coder-search-replace-next";
|
|
5
|
-
export declare
|
|
6
|
-
export declare function
|
|
6
|
+
export declare const CODER_AGENT_MODE_TEMPLATE_ID = "coder-agent-mode";
|
|
7
|
+
export declare function getCoderAgentModePromptTemplate(): BasePromptFragment;
|
|
8
|
+
export declare function getCoderReplacePromptTemplateNext(): BasePromptFragment;
|
|
9
|
+
export declare function getCoderReplacePromptTemplate(withSearchAndReplace?: boolean): BasePromptFragment;
|
|
7
10
|
//# sourceMappingURL=coder-replace-prompt-template.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coder-replace-prompt-template.d.ts","sourceRoot":"","sources":["../../src/common/coder-replace-prompt-template.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"coder-replace-prompt-template.d.ts","sourceRoot":"","sources":["../../src/common/coder-replace-prompt-template.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAc/D,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AACrD,eAAO,MAAM,gCAAgC,kBAAkB,CAAC;AAChE,eAAO,MAAM,gCAAgC,yBAAyB,CAAC;AACvE,eAAO,MAAM,qCAAqC,8BAA8B,CAAC;AACjF,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D,wBAAgB,+BAA+B,IAAI,kBAAkB,CAkHpE;AAED,wBAAgB,iCAAiC,IAAI,kBAAkB,CAuDtE;AACD,wBAAgB,6BAA6B,CAAC,oBAAoB,GAAE,OAAe,GAAG,kBAAkB,CA+CvG"}
|
|
@@ -10,14 +10,132 @@
|
|
|
10
10
|
// SPDX-License-Identifier: MIT
|
|
11
11
|
// *****************************************************************************
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.getCoderReplacePromptTemplate = exports.getCoderReplacePromptTemplateNext = exports.CODER_REPLACE_PROMPT_TEMPLATE_NEXT_ID = exports.CODER_REPLACE_PROMPT_TEMPLATE_ID = exports.CODER_REWRITE_PROMPT_TEMPLATE_ID = void 0;
|
|
13
|
+
exports.getCoderReplacePromptTemplate = exports.getCoderReplacePromptTemplateNext = exports.getCoderAgentModePromptTemplate = exports.CODER_AGENT_MODE_TEMPLATE_ID = exports.CODER_REPLACE_PROMPT_TEMPLATE_NEXT_ID = exports.CODER_REPLACE_PROMPT_TEMPLATE_ID = exports.CODER_REWRITE_PROMPT_TEMPLATE_ID = exports.CODER_SYSTEM_PROMPT_ID = void 0;
|
|
14
14
|
const ai_chat_1 = require("@theia/ai-chat");
|
|
15
15
|
const workspace_functions_1 = require("./workspace-functions");
|
|
16
16
|
const context_variables_1 = require("./context-variables");
|
|
17
17
|
const context_functions_1 = require("./context-functions");
|
|
18
|
+
exports.CODER_SYSTEM_PROMPT_ID = 'coder-prompt';
|
|
18
19
|
exports.CODER_REWRITE_PROMPT_TEMPLATE_ID = 'coder-rewrite';
|
|
19
20
|
exports.CODER_REPLACE_PROMPT_TEMPLATE_ID = 'coder-search-replace';
|
|
20
21
|
exports.CODER_REPLACE_PROMPT_TEMPLATE_NEXT_ID = 'coder-search-replace-next';
|
|
22
|
+
exports.CODER_AGENT_MODE_TEMPLATE_ID = 'coder-agent-mode';
|
|
23
|
+
function getCoderAgentModePromptTemplate() {
|
|
24
|
+
return {
|
|
25
|
+
id: exports.CODER_AGENT_MODE_TEMPLATE_ID,
|
|
26
|
+
template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
27
|
+
Made improvements or adaptations to this prompt template? We’d love for you to share it with the community! Contribute back here:
|
|
28
|
+
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
29
|
+
You are an **autonomous AI agent** embedded in the Theia IDE to assist developers with tasks like implementing features, fixing bugs, or improving code quality.
|
|
30
|
+
You must independently analyze, fix, validate, and finalize all changes — only yield control when all relevant tasks are completed.
|
|
31
|
+
|
|
32
|
+
# Agent Behavior
|
|
33
|
+
|
|
34
|
+
## Autonomy and Persistence
|
|
35
|
+
You are an agent. **Do not stop until** the entire task is complete:
|
|
36
|
+
- All code changes are applied
|
|
37
|
+
- All lint issues are resolved
|
|
38
|
+
- All relevant tests pass
|
|
39
|
+
- New tests are written when needed
|
|
40
|
+
|
|
41
|
+
You must act **without waiting** for user input unless explicitly required. Do not confirm intermediate steps — **only yield** when the entire problem is solved.
|
|
42
|
+
|
|
43
|
+
## Planning and Reflection
|
|
44
|
+
Before each function/tool call:
|
|
45
|
+
- Think step-by-step and explain your plan
|
|
46
|
+
- State your assumptions
|
|
47
|
+
- Justify why you're using a particular tool
|
|
48
|
+
|
|
49
|
+
After each tool call:
|
|
50
|
+
- Reflect on the result
|
|
51
|
+
- Adjust your plan if needed
|
|
52
|
+
- Continue to the next logical step
|
|
53
|
+
|
|
54
|
+
## Tool Usage Rules
|
|
55
|
+
Never guess or hallucinate file content or structure. Use tools for all workspace interactions:
|
|
56
|
+
|
|
57
|
+
### Workspace Exploration
|
|
58
|
+
- ~{getWorkspaceDirectoryStructure} — view overall structure
|
|
59
|
+
- ~{getWorkspaceFileList} — list contents of a specific directory
|
|
60
|
+
- ~{getFileContent} — retrieve the content of a file
|
|
61
|
+
- ~{context_addFile} — bookmark important files for context
|
|
62
|
+
|
|
63
|
+
### Search and Validation
|
|
64
|
+
- ~{searchInWorkspace} — locate references or patterns
|
|
65
|
+
- ~{getFileDiagnostics} — detect syntax, lint, or type errors
|
|
66
|
+
|
|
67
|
+
### ✍️ Code Editing
|
|
68
|
+
- Before editing, always retrieve file content
|
|
69
|
+
- Use:
|
|
70
|
+
- ~{changeSet_replaceContentInFile} — propose targeted code changes (multiple calls merge changes)
|
|
71
|
+
- ~{changeSet_writeChangeToFile} — completely rewrite a file when needed
|
|
72
|
+
- ~{changeSet_clearFileChanges} — clear all pending changes for a file
|
|
73
|
+
- For incremental changes, use multiple ~{changeSet_replaceContentInFile} calls
|
|
74
|
+
- Use the reset parameter with ~{changeSet_replaceContentInFile} to clear previous changes
|
|
75
|
+
|
|
76
|
+
### Testing & Tasks
|
|
77
|
+
- Use ~{listTasks} to discover available test and lint tasks
|
|
78
|
+
- Use ~{runTask} to run linting, building, or test suites
|
|
79
|
+
|
|
80
|
+
### Test Authoring
|
|
81
|
+
If no relevant tests exist:
|
|
82
|
+
- Create new test files (propose using changeSet_writeChangeToFile)
|
|
83
|
+
- Use patterns from existing tests
|
|
84
|
+
- Ensure new tests validate new behavior or prevent regressions
|
|
85
|
+
|
|
86
|
+
# Workflow Steps
|
|
87
|
+
|
|
88
|
+
## 1. Understand the Task
|
|
89
|
+
Analyze the user input, retrieve relevant files, and clarify the intent.
|
|
90
|
+
|
|
91
|
+
## 2. Investigate
|
|
92
|
+
Use directory listing, file retrieval, and search to gather all needed context.
|
|
93
|
+
|
|
94
|
+
## 3. Plan and Propose Fixes
|
|
95
|
+
Develop a step-by-step strategy. Modify relevant files via tool calls.
|
|
96
|
+
|
|
97
|
+
## 4. Run Validation Tools
|
|
98
|
+
Run linters and compilers:
|
|
99
|
+
- If issues are found, fix them and re-run
|
|
100
|
+
|
|
101
|
+
## 5. Test and Iterate
|
|
102
|
+
Run all relevant tests. If failures are found, debug and fix.
|
|
103
|
+
- If tests are missing, create them
|
|
104
|
+
- Ensure **100% success rate** before proceeding
|
|
105
|
+
|
|
106
|
+
## 6. Final Review
|
|
107
|
+
Reflect on whether all objectives are met:
|
|
108
|
+
- Code works
|
|
109
|
+
- Tests pass
|
|
110
|
+
- Code quality meets standards
|
|
111
|
+
|
|
112
|
+
Only when **everything is done**, end your turn.
|
|
113
|
+
|
|
114
|
+
# Additional Context
|
|
115
|
+
The following files have been provided for additional context. Some of them may also be referred to by the user (e.g. "this file" or "the attachment"). \
|
|
116
|
+
Always look at the relevant files to understand your task using the function ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}
|
|
117
|
+
{{${context_variables_1.CONTEXT_FILES_VARIABLE_ID}}}
|
|
118
|
+
|
|
119
|
+
# Previously Proposed Changes
|
|
120
|
+
|
|
121
|
+
{{changeSetSummary}}
|
|
122
|
+
|
|
123
|
+
# Project Info
|
|
124
|
+
|
|
125
|
+
{{prompt:project-info}}
|
|
126
|
+
|
|
127
|
+
# Final Instruction
|
|
128
|
+
You are an autonomous AI agent. Do not stop until:
|
|
129
|
+
- All errors are fixed
|
|
130
|
+
- Lint and build succeed
|
|
131
|
+
- Tests pass
|
|
132
|
+
- New tests are created if needed
|
|
133
|
+
- No further action is required
|
|
134
|
+
`,
|
|
135
|
+
...({ variantOf: exports.CODER_REPLACE_PROMPT_TEMPLATE_ID }),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
exports.getCoderAgentModePromptTemplate = getCoderAgentModePromptTemplate;
|
|
21
139
|
function getCoderReplacePromptTemplateNext() {
|
|
22
140
|
return {
|
|
23
141
|
id: exports.CODER_REPLACE_PROMPT_TEMPLATE_NEXT_ID,
|
|
@@ -28,28 +146,30 @@ You are an AI assistant integrated into Theia IDE, designed to assist software d
|
|
|
28
146
|
|
|
29
147
|
## Context Retrieval
|
|
30
148
|
Use the following functions to interact with the workspace files if you require context:
|
|
31
|
-
- **~{${workspace_functions_1.GET_WORKSPACE_DIRECTORY_STRUCTURE_FUNCTION_ID}}
|
|
32
|
-
- **~{${workspace_functions_1.GET_WORKSPACE_FILE_LIST_FUNCTION_ID}}
|
|
33
|
-
- **~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}
|
|
34
|
-
- **~{${
|
|
149
|
+
- **~{${workspace_functions_1.GET_WORKSPACE_DIRECTORY_STRUCTURE_FUNCTION_ID}}**
|
|
150
|
+
- **~{${workspace_functions_1.GET_WORKSPACE_FILE_LIST_FUNCTION_ID}}**
|
|
151
|
+
- **~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}**
|
|
152
|
+
- **~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}}**
|
|
153
|
+
|
|
154
|
+
Remember file locations that are relevant for completing your tasks using **~{${context_functions_1.UPDATE_CONTEXT_FILES_FUNCTION_ID}}**
|
|
155
|
+
Only add files that are really relevant to look at later.
|
|
35
156
|
|
|
36
157
|
## File Validation
|
|
37
|
-
Use the following function to retrieve a list of problems in a file if the user requests fixes in a given file:
|
|
38
|
-
- **~{${workspace_functions_1.GET_FILE_DIAGNOSTICS_ID}}**: Retrieves a list of problems identified in a given file by tool integrations such as language servers and linters.
|
|
158
|
+
Use the following function to retrieve a list of problems in a file if the user requests fixes in a given file: **~{${workspace_functions_1.GET_FILE_DIAGNOSTICS_ID}}**
|
|
39
159
|
|
|
40
160
|
## Propose Code Changes
|
|
41
161
|
To propose code changes or any file changes to the user, never print code or new file content in your response.
|
|
42
162
|
|
|
43
163
|
Instead, for each file you want to propose changes for:
|
|
44
|
-
- **Always Retrieve Current Content**: Use ${workspace_functions_1.FILE_CONTENT_FUNCTION_ID} to get the
|
|
45
|
-
- **
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
164
|
+
- **Always Retrieve Current Content**: Use ${workspace_functions_1.FILE_CONTENT_FUNCTION_ID} to get the original content of the target file.
|
|
165
|
+
- **View Pending Changes**: Use ~{changeSet_getProposedFileState} to see the current proposed state of a file, including all pending changes.
|
|
166
|
+
- **Change Content**: Use one of these methods to propose changes:
|
|
167
|
+
- ~{changeSet_replaceContentInFile}: For targeted replacements of specific text sections. Multiple calls will merge changes unless you set the reset parameter to true.
|
|
168
|
+
- ~{changeSet_writeChangeToFile}: For complete file rewrites when you need to replace the entire content.
|
|
169
|
+
- If ~{changeSet_replaceContentInFile} continuously fails use ~{changeSet_writeChangeToFile}.
|
|
170
|
+
- ~{changeSet_clearFileChanges}: To clear all pending changes for a file and start fresh.
|
|
51
171
|
|
|
52
|
-
|
|
172
|
+
The changes will be presented as an applicable diff to the user in any case.
|
|
53
173
|
|
|
54
174
|
## Tasks
|
|
55
175
|
|
|
@@ -57,7 +177,7 @@ The user might want you to execute some task. You can find tasks using ~{${works
|
|
|
57
177
|
|
|
58
178
|
## Additional Context
|
|
59
179
|
|
|
60
|
-
The following files have been provided for additional context. Some of them may also be referred to by the user. \
|
|
180
|
+
The following files have been provided for additional context. Some of them may also be referred to by the user (e.g. "this file" or "the attachment"). \
|
|
61
181
|
Always look at the relevant files to understand your task using the function ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}
|
|
62
182
|
{{${context_variables_1.CONTEXT_FILES_VARIABLE_ID}}}
|
|
63
183
|
|
|
@@ -66,6 +186,8 @@ You have previously proposed changes for the following files. Some suggestions m
|
|
|
66
186
|
{{${ai_chat_1.CHANGE_SET_SUMMARY_VARIABLE_ID}}}
|
|
67
187
|
|
|
68
188
|
{{prompt:project-info}}
|
|
189
|
+
|
|
190
|
+
{{${context_variables_1.TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
|
|
69
191
|
`,
|
|
70
192
|
...({ variantOf: exports.CODER_REPLACE_PROMPT_TEMPLATE_ID }),
|
|
71
193
|
};
|
|
@@ -94,15 +216,19 @@ Use the following function to retrieve a list of problems in a file if the user
|
|
|
94
216
|
To propose code changes or any file changes to the user, never print code or new file content in your response.
|
|
95
217
|
|
|
96
218
|
Instead, for each file you want to propose changes for:
|
|
97
|
-
- **Always Retrieve Current Content**: Use ${workspace_functions_1.FILE_CONTENT_FUNCTION_ID} to get the
|
|
98
|
-
- **
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
219
|
+
- **Always Retrieve Current Content**: Use ${workspace_functions_1.FILE_CONTENT_FUNCTION_ID} to get the original content of the target file.
|
|
220
|
+
- **View Pending Changes**: Use ~{changeSet_getProposedFileState} to see the current proposed state of a file, including all pending changes.
|
|
221
|
+
- **Change Content**: Use one of these methods to propose changes:
|
|
222
|
+
- ~{changeSet_replaceContentInFile}: For targeted replacements of specific text sections. Multiple calls will merge changes unless you set the reset parameter to true.
|
|
223
|
+
- ~{changeSet_writeChangeToFile}: For complete file rewrites when you need to replace the entire content.
|
|
224
|
+
- If ~{changeSet_replaceContentInFile} continuously fails use ~{changeSet_writeChangeToFile}.
|
|
225
|
+
- ~{changeSet_clearFileChanges}: To clear all pending changes for a file and start fresh.
|
|
226
|
+
|
|
227
|
+
The changes will be presented as an applicable diff to the user in any case.
|
|
102
228
|
|
|
103
229
|
## Additional Context
|
|
104
230
|
|
|
105
|
-
The following files have been provided for additional context. Some of them may also be referred to by the user. \
|
|
231
|
+
The following files have been provided for additional context. Some of them may also be referred to by the user (e.g. "this file" or "the attachment"). \
|
|
106
232
|
Always look at the relevant files to understand your task using the function ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}
|
|
107
233
|
{{${context_variables_1.CONTEXT_FILES_VARIABLE_ID}}}
|
|
108
234
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coder-replace-prompt-template.js","sourceRoot":"","sources":["../../src/common/coder-replace-prompt-template.ts"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,+CAA+C;AAC/C,mEAAmE;AACnE,sCAAsC;AACtC,EAAE;AACF,+BAA+B;AAC/B,gFAAgF;;;AAGhF,4CAAgE;AAChE,+DAQ+B;AAC/B,2DAAkG;AAClG,2DAAuE;AAE1D,QAAA,gCAAgC,GAAG,eAAe,CAAC;AACnD,QAAA,gCAAgC,GAAG,sBAAsB,CAAC;AAC1D,QAAA,qCAAqC,GAAG,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"coder-replace-prompt-template.js","sourceRoot":"","sources":["../../src/common/coder-replace-prompt-template.ts"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,+CAA+C;AAC/C,mEAAmE;AACnE,sCAAsC;AACtC,EAAE;AACF,+BAA+B;AAC/B,gFAAgF;;;AAGhF,4CAAgE;AAChE,+DAQ+B;AAC/B,2DAAkG;AAClG,2DAAuE;AAE1D,QAAA,sBAAsB,GAAG,cAAc,CAAC;AACxC,QAAA,gCAAgC,GAAG,eAAe,CAAC;AACnD,QAAA,gCAAgC,GAAG,sBAAsB,CAAC;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,CAAC,CAAC,EAAE,SAAS,EAAE,wCAAgC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpF,CAAC;AACN,CAAC;AA/CD,sEA+CC"}
|
|
@@ -16,7 +16,7 @@ export declare class CommandChatAgent extends AbstractTextToModelParsingChatAgen
|
|
|
16
16
|
languageModelRequirements: LanguageModelRequirement[];
|
|
17
17
|
protected defaultLanguageModelPurpose: string;
|
|
18
18
|
description: string;
|
|
19
|
-
|
|
19
|
+
prompts: import("@theia/ai-core").PromptVariantSet[];
|
|
20
20
|
agentSpecificVariables: {
|
|
21
21
|
name: string;
|
|
22
22
|
description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-chat-agents.d.ts","sourceRoot":"","sources":["../../src/common/command-chat-agents.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mCAAmC,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACtH,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EACH,uBAAuB,EACvB,mBAAmB,EAKtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,eAAe,EACf,cAAc,EAEjB,MAAM,aAAa,CAAC;AAIrB,UAAU,aAAa;IACnB,IAAI,EAAE,eAAe,GAAG,gBAAgB,GAAG,YAAY,CAAA;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBACa,gBAAiB,SAAQ,mCAAmC,CAAC,aAAa,CAAC;IAEpF,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAE3C,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAEzC,EAAE,EAAE,MAAM,CAAa;IACvB,IAAI,SAAa;IACjB,yBAAyB,EAAE,wBAAwB,EAAE,CAGlD;IACH,SAAS,CAAC,2BAA2B,EAAE,MAAM,CAAa;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OAAO,CAAC,IAAI,CAAC;CAI5E"}
|
|
@@ -34,7 +34,7 @@ let CommandChatAgent = class CommandChatAgent extends chat_agents_1.AbstractText
|
|
|
34
34
|
this.defaultLanguageModelPurpose = 'command';
|
|
35
35
|
this.description = 'This agent is aware of all commands that the user can execute within the Theia IDE, the tool that the user is currently working with. \
|
|
36
36
|
Based on the user request, it can find the right command and then let the user execute it.';
|
|
37
|
-
this.
|
|
37
|
+
this.prompts = [command_prompt_template_1.commandTemplate];
|
|
38
38
|
this.agentSpecificVariables = [{
|
|
39
39
|
name: 'command-ids',
|
|
40
40
|
description: 'The list of available commands in Theia.',
|
|
@@ -46,13 +46,13 @@ let CommandChatAgent = class CommandChatAgent extends chat_agents_1.AbstractText
|
|
|
46
46
|
for (const command of this.commandRegistry.getAllCommands()) {
|
|
47
47
|
knownCommands.push(`${command.id}: ${command.label}`);
|
|
48
48
|
}
|
|
49
|
-
const systemPrompt = await this.promptService.
|
|
49
|
+
const systemPrompt = await this.promptService.getResolvedPromptFragment(command_prompt_template_1.commandTemplate.id, {
|
|
50
50
|
'command-ids': knownCommands.join('\n')
|
|
51
51
|
}, context);
|
|
52
52
|
if (systemPrompt === undefined) {
|
|
53
|
-
throw new Error('Couldn\'t get
|
|
53
|
+
throw new Error('Couldn\'t get prompt ');
|
|
54
54
|
}
|
|
55
|
-
return chat_agents_1.SystemMessageDescription.
|
|
55
|
+
return chat_agents_1.SystemMessageDescription.fromResolvedPromptFragment(systemPrompt);
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* @param text the text received from the language model
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-chat-agents.js","sourceRoot":"","sources":["../../src/common/command-chat-agents.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,4DAAkE;AAClE,uEAAsH;AAEtH,qEAO8C;AAC9C,sCAIqB;AAErB,uEAA4D;AAUrD,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,iDAAkD;IAAjF;;QAMH,OAAE,GAAW,SAAS,CAAC;QACvB,SAAI,GAAG,SAAS,CAAC;QACjB,8BAAyB,GAA+B,CAAC;gBACrD,OAAO,EAAE,SAAS;gBAClB,UAAU,EAAE,eAAe;aAC9B,CAAC,CAAC;QACO,gCAA2B,GAAW,SAAS,CAAC;QAEjD,gBAAW,GAAG;+FACoE,CAAC;QACnF,
|
|
1
|
+
{"version":3,"file":"command-chat-agents.js","sourceRoot":"","sources":["../../src/common/command-chat-agents.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,4DAAkE;AAClE,uEAAsH;AAEtH,qEAO8C;AAC9C,sCAIqB;AAErB,uEAA4D;AAUrD,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,iDAAkD;IAAjF;;QAMH,OAAE,GAAW,SAAS,CAAC;QACvB,SAAI,GAAG,SAAS,CAAC;QACjB,8BAAyB,GAA+B,CAAC;gBACrD,OAAO,EAAE,SAAS;gBAClB,UAAU,EAAE,eAAe;aAC9B,CAAC,CAAC;QACO,gCAA2B,GAAW,SAAS,CAAC;QAEjD,gBAAW,GAAG;+FACoE,CAAC;QACnF,YAAO,GAAG,CAAC,yCAAe,CAAC,CAAC;QAC5B,2BAAsB,GAAG,CAAC;gBAC/B,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,0CAA0C;gBACv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C;QAC/G,CAAC;IACL,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,GAAG,WAAsB;QACrD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,gCAAgC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;4DAC3B,EAAE,QAAQ,CAAC,CAAC;IACpE,CAAC;CACJ,CAAA;AA7FY,4CAAgB;AAEf;IADT,IAAA,kBAAM,EAAC,sBAAe,CAAC;sCACG,sBAAe;yDAAC;AAEjC;IADT,IAAA,kBAAM,EAAC,qBAAc,CAAC;sCACG,qBAAc;wDAAC;2BAJhC,gBAAgB;IAD5B,IAAA,sBAAU,GAAE;GACA,gBAAgB,CA6F5B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const commandTemplate:
|
|
1
|
+
import { PromptVariantSet } from '@theia/ai-core';
|
|
2
|
+
export declare const commandTemplate: PromptVariantSet;
|
|
3
3
|
//# sourceMappingURL=command-prompt-template.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-prompt-template.d.ts","sourceRoot":"","sources":["../../src/common/command-prompt-template.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"command-prompt-template.d.ts","sourceRoot":"","sources":["../../src/common/command-prompt-template.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,eAAe,EAAE,gBAkN7B,CAAC"}
|