@theia/ai-ide 1.66.0-next.0 โ†’ 1.66.0-next.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/lib/browser/architect-agent.d.ts.map +1 -1
  2. package/lib/browser/architect-agent.js +1 -1
  3. package/lib/browser/architect-agent.js.map +1 -1
  4. package/lib/browser/frontend-module.d.ts.map +1 -1
  5. package/lib/browser/frontend-module.js +3 -0
  6. package/lib/browser/frontend-module.js.map +1 -1
  7. package/lib/browser/summarize-session-command-contribution.js +4 -4
  8. package/lib/browser/summarize-session-command-contribution.js.map +1 -1
  9. package/lib/browser/task-context-agent.d.ts +13 -0
  10. package/lib/browser/task-context-agent.d.ts.map +1 -0
  11. package/lib/browser/task-context-agent.js +45 -0
  12. package/lib/browser/task-context-agent.js.map +1 -0
  13. package/lib/common/architect-prompt-template.d.ts +0 -3
  14. package/lib/common/architect-prompt-template.d.ts.map +1 -1
  15. package/lib/common/architect-prompt-template.js +1 -199
  16. package/lib/common/architect-prompt-template.js.map +1 -1
  17. package/lib/common/coder-replace-prompt-template.d.ts.map +1 -1
  18. package/lib/common/coder-replace-prompt-template.js +8 -2
  19. package/lib/common/coder-replace-prompt-template.js.map +1 -1
  20. package/lib/common/task-context-prompt-template.d.ts +8 -0
  21. package/lib/common/task-context-prompt-template.d.ts.map +1 -0
  22. package/lib/common/task-context-prompt-template.js +217 -0
  23. package/lib/common/task-context-prompt-template.js.map +1 -0
  24. package/package.json +18 -18
  25. package/src/browser/architect-agent.ts +2 -2
  26. package/src/browser/frontend-module.ts +4 -0
  27. package/src/browser/summarize-session-command-contribution.ts +4 -4
  28. package/src/browser/task-context-agent.ts +40 -0
  29. package/src/common/architect-prompt-template.ts +11 -206
  30. package/src/common/coder-replace-prompt-template.ts +8 -2
  31. package/src/common/task-context-prompt-template.ts +229 -0
@@ -0,0 +1,217 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.taskContextUpdateVariants = exports.taskContextTemplateVariants = exports.taskContextSystemVariants = exports.TASK_CONTEXT_UPDATE_PROMPT_ID = exports.TASK_CONTEXT_TEMPLATE_PROMPT_ID = exports.TASK_CONTEXT_CREATE_PROMPT_ID = void 0;
4
+ const context_variables_1 = require("./context-variables");
5
+ exports.TASK_CONTEXT_CREATE_PROMPT_ID = 'task-context-create';
6
+ exports.TASK_CONTEXT_TEMPLATE_PROMPT_ID = 'task-context-template';
7
+ exports.TASK_CONTEXT_UPDATE_PROMPT_ID = 'task-context-update';
8
+ exports.taskContextSystemVariants = {
9
+ id: exports.TASK_CONTEXT_CREATE_PROMPT_ID,
10
+ defaultVariant: {
11
+ id: 'task-context-create-default',
12
+ template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
13
+ Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
14
+ https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
15
+
16
+ Your task is to analyze the current chat session and summarize it to prepare to complete the coding task.
17
+ Your instructions should be complete. They are used by a coding agent.
18
+ Include all necessary information.
19
+ Use unique identifiers such as file paths or URIs to artifacts.
20
+ Skip irrelevant information, e.g. for discussions, only sum up the final result.
21
+
22
+ ## Instructions
23
+ 1. Analyze the conversation carefully.
24
+ 2. Identify the main coding objective and requirements.
25
+ 3. Propose a clear approach to implement the requested functionality in task steps.
26
+ 4. If any part of the task is ambiguous, note the ambiguity so that it can be clarified later.
27
+ 5. If there are any relevant examples on how to implement something correctly, add them
28
+
29
+ Focus on providing actionable steps and implementation guidance. The coding agent needs practical help with this specific coding task.
30
+
31
+ Use the following template format:
32
+
33
+ {{prompt:${exports.TASK_CONTEXT_TEMPLATE_PROMPT_ID}}}
34
+ `
35
+ }
36
+ };
37
+ exports.taskContextTemplateVariants = {
38
+ id: exports.TASK_CONTEXT_TEMPLATE_PROMPT_ID,
39
+ defaultVariant: {
40
+ id: 'task-context-template-default',
41
+ template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
42
+ Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
43
+ https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
44
+
45
+ # Task Context: [Title Here]
46
+
47
+ ---
48
+
49
+ ## 1. ๐Ÿ“š Task Definition
50
+
51
+ **Problem Statement / Goal:**
52
+ [Describe what needs to be achieved and why.]
53
+
54
+ **Scope:**
55
+ - **In Scope:**
56
+ [Features, components, or behaviors to be included.]
57
+ - **Out of Scope:**
58
+ [What explicitly won't be part of this task.]
59
+
60
+ ---
61
+
62
+ ## 2. ๐Ÿง  Design and Implementation
63
+
64
+ **Design Overview:**
65
+ [Summary of architecture and major design decisions.]
66
+
67
+ **Implementation Plan:**
68
+ 1. [First major step]
69
+ 2. [Second major step]
70
+ 3. [Third major step]
71
+
72
+ **Technology Choices:**
73
+ - [Frameworks, libraries, services, tools]
74
+
75
+ **Files expected to be changed**
76
+ List all files that are expected to be changed (using relative file path) and quickly explain what is expected to be changed in this file.
77
+
78
+ ### Examples
79
+
80
+ List all examples of existing code that are useful to understand the design and do the implementation.
81
+ These examples are not the files supposed to be changed, but code that shows how to implement specific things.
82
+ Prefer to mention files instead of adding their content.
83
+ Explain the purpose of every example.
84
+
85
+ ---
86
+
87
+ ## 3. ๐Ÿงช Testing
88
+
89
+ ### 3.1 ๐Ÿ› ๏ธ Automated Testing (by Coder)
90
+
91
+ **Automated Test Strategy:**
92
+ [What should be covered by automated tests.]
93
+
94
+ **Test Cases Implemented:**
95
+ - [Unit test 1]
96
+ - [Integration test 1]
97
+ - [E2E test 1]
98
+
99
+ **Test Coverage Targets:**
100
+ [e.g., Minimum 80% code coverage, all workflows tested.]
101
+
102
+ ---
103
+
104
+ ### 3.2 ๐ŸŽฏ Manual Testing (by Tester)
105
+
106
+ **Manual Testing Strategy:**
107
+ [What manual tests will focus on (e.g., usability, edge cases, exploratory testing).]
108
+
109
+ **Test Setup Instructions:**
110
+ - [Environment setup steps, accounts needed, special configurations]
111
+
112
+ **Test Cases / Test Steps:**
113
+ 1. [Action 1]
114
+ 2. [Action 2]
115
+ 3. [Action 3]
116
+
117
+ **Expected Results:**
118
+ - [Expected behavior at each step]
119
+
120
+ **Known Risks / Focus Areas:**
121
+ - [Potential weak spots, UX concerns, edge cases]
122
+
123
+ ---
124
+
125
+ ## 4. ๐Ÿ“ฆ Deliverables
126
+
127
+ **Expected Artifacts:**
128
+ - [Code modules]
129
+ - [Documentation]
130
+ - [Configuration files]
131
+ - [Test reports]
132
+
133
+ **PR Information:**
134
+ - **PR Title:** [Suggested title for the pull request]
135
+ - **PR Description:** [What was implemented, high-level changes, decisions]
136
+ - **Verification Steps:** [Instructions for verifying the PR manually or automatically]
137
+
138
+ **Additional Notes:**
139
+ - [Dependencies]
140
+ - [Migration steps if needed]
141
+ - [Special reviewer instructions]
142
+
143
+ ---
144
+
145
+ ## 5. ๐Ÿ”„ Current Status
146
+
147
+ **Progress Summary:**
148
+ [Short free-text update about how far the task has progressed.]
149
+
150
+ **Completed Items:**
151
+ - [List of what has been fully implemented, tested, or merged.]
152
+
153
+ **Open Items:**
154
+ - [List of remaining tasks, missing parts.]
155
+
156
+ **Current Issues / Risks:**
157
+ - [Open problems, bugs found during testing, architectural blockers.]
158
+
159
+ **Next Steps:**
160
+ - [Immediate action items, who should act next.]
161
+ `
162
+ }
163
+ };
164
+ exports.taskContextUpdateVariants = {
165
+ id: exports.TASK_CONTEXT_UPDATE_PROMPT_ID,
166
+ defaultVariant: {
167
+ id: 'task-context-update-default',
168
+ template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
169
+ Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
170
+ https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
171
+ You are an AI assistant integrated into Theia IDE, designed to update task context files. You can interact provided task context file and propose changes.
172
+
173
+ # Task Document Update Instructions
174
+
175
+ You are an AI agent tasked with updating a technical document based on the current discussion.
176
+ Your job is to provide the COMPLETE UPDATED DOCUMENT as your response, not commentary about the document.
177
+
178
+ ## Analysis Requirements
179
+
180
+ 1. **Review the Current Discussion**:
181
+ - Analyze the entire conversation
182
+ - Identify new information, decisions, and changes
183
+
184
+ 2. **Examine the Existing Document**:
185
+ - Understand its structure and purpose
186
+ - Identify sections that need updates
187
+
188
+ 3. **Update the Document**:
189
+ - Maintain the original structure and formatting
190
+ - Add new information from the discussion
191
+ - Update existing information
192
+ - Remove outdated information if necessary
193
+ - Ensure coherence and organization
194
+
195
+ ## IMPORTANT: Response Format
196
+
197
+ YOUR ENTIRE RESPONSE MUST BE THE UPDATED DOCUMENT ONLY. Do not include:
198
+ - Any commentary about what you changed
199
+ - Introduction or explanation text
200
+ - Markdown fences or syntax indicators
201
+ - Clarifying questions
202
+
203
+ Simply output the complete updated document as plain text, which will directly replace the existing document.
204
+
205
+ ## Guidelines
206
+
207
+ - Be thorough in capturing all relevant information
208
+ - Maintain the original document's style and tone
209
+ - Use clear, concise language
210
+ - Preserve all formatting from the original document
211
+ - Ensure technical accuracy in all updates
212
+
213
+ {{${context_variables_1.TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
214
+ `
215
+ }
216
+ };
217
+ //# sourceMappingURL=task-context-prompt-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-context-prompt-template.js","sourceRoot":"","sources":["../../src/common/task-context-prompt-template.ts"],"names":[],"mappings":";;;AAWA,2DAAuE;AAE1D,QAAA,6BAA6B,GAAG,qBAAqB,CAAC;AACtD,QAAA,+BAA+B,GAAG,uBAAuB,CAAC;AAC1D,QAAA,6BAA6B,GAAG,qBAAqB,CAAC;AAEtD,QAAA,yBAAyB,GAAqB;IACvD,EAAE,EAAE,qCAA6B;IACjC,cAAc,EAAE;QACZ,EAAE,EAAE,6BAA6B;QACjC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;WAqBP,uCAA+B;CACzC;KACI;CACJ,CAAC;AAEW,QAAA,2BAA2B,GAAqB;IACzD,EAAE,EAAE,uCAA+B;IACnC,cAAc,EAAE;QACZ,EAAE,EAAE,+BAA+B;QACnC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwHjB;KACI;CACJ,CAAC;AAEW,QAAA,yBAAyB,GAAqB;IACvD,EAAE,EAAE,qCAA6B;IACjC,cAAc,EAAE;QACZ,EAAE,EAAE,6BAA6B;QACjC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6Cd,oDAAgC;CACnC;KACI;CACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/ai-ide",
3
- "version": "1.66.0-next.0+008c83404",
3
+ "version": "1.66.0-next.27+a9334fd8e",
4
4
  "description": "AI IDE Agents Extension",
5
5
  "license": "EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0",
6
6
  "repository": {
@@ -15,20 +15,20 @@
15
15
  "theia-extension"
16
16
  ],
17
17
  "dependencies": {
18
- "@theia/ai-chat": "1.66.0-next.0+008c83404",
19
- "@theia/ai-chat-ui": "1.66.0-next.0+008c83404",
20
- "@theia/ai-core": "1.66.0-next.0+008c83404",
21
- "@theia/ai-mcp": "1.66.0-next.0+008c83404",
22
- "@theia/core": "1.66.0-next.0+008c83404",
23
- "@theia/debug": "1.66.0-next.0+008c83404",
24
- "@theia/filesystem": "1.66.0-next.0+008c83404",
25
- "@theia/markers": "1.66.0-next.0+008c83404",
26
- "@theia/monaco": "1.66.0-next.0+008c83404",
27
- "@theia/navigator": "1.66.0-next.0+008c83404",
28
- "@theia/search-in-workspace": "1.66.0-next.0+008c83404",
29
- "@theia/task": "1.66.0-next.0+008c83404",
30
- "@theia/terminal": "1.66.0-next.0+008c83404",
31
- "@theia/workspace": "1.66.0-next.0+008c83404",
18
+ "@theia/ai-chat": "1.66.0-next.27+a9334fd8e",
19
+ "@theia/ai-chat-ui": "1.66.0-next.27+a9334fd8e",
20
+ "@theia/ai-core": "1.66.0-next.27+a9334fd8e",
21
+ "@theia/ai-mcp": "1.66.0-next.27+a9334fd8e",
22
+ "@theia/core": "1.66.0-next.27+a9334fd8e",
23
+ "@theia/debug": "1.66.0-next.27+a9334fd8e",
24
+ "@theia/filesystem": "1.66.0-next.27+a9334fd8e",
25
+ "@theia/markers": "1.66.0-next.27+a9334fd8e",
26
+ "@theia/monaco": "1.66.0-next.27+a9334fd8e",
27
+ "@theia/navigator": "1.66.0-next.27+a9334fd8e",
28
+ "@theia/search-in-workspace": "1.66.0-next.27+a9334fd8e",
29
+ "@theia/task": "1.66.0-next.27+a9334fd8e",
30
+ "@theia/terminal": "1.66.0-next.27+a9334fd8e",
31
+ "@theia/workspace": "1.66.0-next.27+a9334fd8e",
32
32
  "date-fns": "^4.1.0",
33
33
  "ignore": "^6.0.0",
34
34
  "js-yaml": "^4.1.0",
@@ -39,8 +39,8 @@
39
39
  "access": "public"
40
40
  },
41
41
  "devDependencies": {
42
- "@theia/cli": "1.66.0-next.0+008c83404",
43
- "@theia/test": "1.66.0-next.0+008c83404"
42
+ "@theia/cli": "1.66.0-next.27+a9334fd8e",
43
+ "@theia/test": "1.66.0-next.27+a9334fd8e"
44
44
  },
45
45
  "theiaExtensions": [
46
46
  {
@@ -64,5 +64,5 @@
64
64
  "nyc": {
65
65
  "extends": "../../configs/nyc.json"
66
66
  },
67
- "gitHead": "008c8340465f7e42298839881d814863bef0b039"
67
+ "gitHead": "a9334fd8e3fa0dfd9beccf1c2f0fe15c6c2c071d"
68
68
  }
@@ -16,7 +16,7 @@
16
16
  import { AbstractStreamParsingChatAgent, ChatRequestModel, ChatService, ChatSession, MutableChatModel, MutableChatRequestModel } from '@theia/ai-chat/lib/common';
17
17
  import { LanguageModelRequirement } from '@theia/ai-core';
18
18
  import { inject, injectable } from '@theia/core/shared/inversify';
19
- import { architectSystemVariants, architectTaskSummaryVariants } from '../common/architect-prompt-template';
19
+ import { architectSystemVariants } from '../common/architect-prompt-template';
20
20
  import { nls } from '@theia/core';
21
21
  import { MarkdownStringImpl } from '@theia/core/lib/common/markdown-rendering';
22
22
  import { AI_SUMMARIZE_SESSION_AS_TASK_FOR_CODER, AI_UPDATE_TASK_CONTEXT_COMMAND } from '../common/summarize-session-commands';
@@ -37,7 +37,7 @@ export class ArchitectAgent extends AbstractStreamParsingChatAgent {
37
37
  'An AI assistant integrated into Theia IDE, designed to assist software developers. This agent can access the users workspace, it can get a list of all available files \
38
38
  and folders and retrieve their content. It cannot modify files. It can therefore answer questions about the current project, project files and source code in the \
39
39
  workspace, such as how to build the project, where to put source code, where to find specific code or configurations, etc.');
40
- override prompts = [architectSystemVariants, architectTaskSummaryVariants];
40
+ override prompts = [architectSystemVariants];
41
41
  protected override systemPromptId: string | undefined = architectSystemVariants.id;
42
42
 
43
43
  override async invoke(request: MutableChatRequestModel): Promise<void> {
@@ -88,6 +88,7 @@ import { aiIdePreferenceSchema } from '../common/ai-ide-preferences';
88
88
  import { AIActivationService } from '@theia/ai-core/lib/browser';
89
89
  import { AIIdeActivationServiceImpl } from './ai-ide-activation-service';
90
90
  import { AiConfigurationPreferences } from '../common/ai-configuration-preferences';
91
+ import { TaskContextAgent } from './task-context-agent';
91
92
 
92
93
  export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
93
94
  bind(PreferenceContribution).toConstantValue({ schema: aiIdePreferenceSchema });
@@ -105,6 +106,9 @@ export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
105
106
  bind(Agent).toService(CoderAgent);
106
107
  bind(ChatAgent).toService(CoderAgent);
107
108
 
109
+ bind(TaskContextAgent).toSelf().inSingletonScope();
110
+ bind(Agent).toService(TaskContextAgent);
111
+
108
112
  bind(OrchestratorChatAgent).toSelf().inSingletonScope();
109
113
  bind(Agent).toService(OrchestratorChatAgent);
110
114
  bind(ChatAgent).toService(OrchestratorChatAgent);
@@ -21,7 +21,7 @@ import { injectable, inject } from '@theia/core/shared/inversify';
21
21
  import { AI_SUMMARIZE_SESSION_AS_TASK_FOR_CODER, AI_UPDATE_TASK_CONTEXT_COMMAND } from '../common/summarize-session-commands';
22
22
  import { CoderAgent } from './coder-agent';
23
23
  import { TASK_CONTEXT_VARIABLE } from '@theia/ai-chat/lib/browser/task-context-variable';
24
- import { ARCHITECT_TASK_SUMMARY_PROMPT_TEMPLATE_ID, ARCHITECT_TASK_SUMMARY_UPDATE_PROMPT_TEMPLATE_ID } from '../common/architect-prompt-template';
24
+ import { TASK_CONTEXT_CREATE_PROMPT_ID, TASK_CONTEXT_UPDATE_PROMPT_ID } from '../common/task-context-prompt-template';
25
25
  import { FILE_VARIABLE } from '@theia/ai-core/lib/browser/file-variable-contribution';
26
26
  import { AIVariableResolutionRequest } from '@theia/ai-core';
27
27
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
@@ -66,10 +66,10 @@ export class SummarizeSessionCommandContribution implements CommandContribution
66
66
  // Check if there is an existing summary for this session
67
67
  if (!this.taskContextService.hasSummary(activeSession)) {
68
68
  // If no summary exists, create one first
69
- await this.taskContextService.summarize(activeSession, ARCHITECT_TASK_SUMMARY_PROMPT_TEMPLATE_ID);
69
+ await this.taskContextService.summarize(activeSession, TASK_CONTEXT_CREATE_PROMPT_ID);
70
70
  } else {
71
71
  // Update existing summary
72
- await this.taskContextService.update(activeSession, ARCHITECT_TASK_SUMMARY_UPDATE_PROMPT_TEMPLATE_ID);
72
+ await this.taskContextService.update(activeSession, TASK_CONTEXT_UPDATE_PROMPT_ID);
73
73
  }
74
74
  }
75
75
  }));
@@ -82,7 +82,7 @@ export class SummarizeSessionCommandContribution implements CommandContribution
82
82
  return;
83
83
  }
84
84
 
85
- const summaryId = await this.taskContextService.summarize(activeSession, ARCHITECT_TASK_SUMMARY_PROMPT_TEMPLATE_ID);
85
+ const summaryId = await this.taskContextService.summarize(activeSession, TASK_CONTEXT_CREATE_PROMPT_ID);
86
86
 
87
87
  // Open the summary in a new editor
88
88
  await this.taskContextStorageService.open(summaryId);
@@ -0,0 +1,40 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 EclipseSource GmbH.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { Agent, LanguageModelRequirement } from '@theia/ai-core';
18
+ import { nls } from '@theia/core';
19
+ import { injectable } from '@theia/core/shared/inversify';
20
+ import { taskContextSystemVariants, taskContextTemplateVariants, taskContextUpdateVariants } from '../common/task-context-prompt-template';
21
+
22
+ @injectable()
23
+ export class TaskContextAgent implements Agent {
24
+ static ID = 'TaskContext';
25
+
26
+ id = TaskContextAgent.ID;
27
+ name = 'TaskContext';
28
+ description = nls.localize('theia/ai/taskcontext/taskContextAgent/description',
29
+ 'An AI assistant that analyzes chat sessions and creates structured task summaries for coding tasks. ' +
30
+ 'This agent specializes in extracting key information from conversations and formatting them into comprehensive task context documents that can be used by other agents.');
31
+
32
+ variables = [];
33
+ prompts = [taskContextSystemVariants, taskContextTemplateVariants, taskContextUpdateVariants];
34
+ languageModelRequirements: LanguageModelRequirement[] = [{
35
+ purpose: 'TaskContext Creation/Update',
36
+ identifier: 'default/code',
37
+ }];
38
+ agentSpecificVariables = [];
39
+ functions = [];
40
+ }
@@ -1,12 +1,17 @@
1
- /* eslint-disable @typescript-eslint/tslint/config */
2
1
  // *****************************************************************************
3
- // Copyright (C) 2025 EclipseSource GmbH and others.
2
+ // Copyright (C) 2024 EclipseSource GmbH.
4
3
  //
5
- // This file is licensed under the MIT License.
6
- // See LICENSE-MIT.txt in the project root for license information.
7
- // https://opensource.org/license/mit.
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
8
7
  //
9
- // SPDX-License-Identifier: MIT
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
10
15
  // *****************************************************************************
11
16
  import { PromptVariantSet } from '@theia/ai-core/lib/common';
12
17
  import {
@@ -16,9 +21,6 @@ import {
16
21
  import { CONTEXT_FILES_VARIABLE_ID, TASK_CONTEXT_SUMMARY_VARIABLE_ID } from './context-variables';
17
22
  import { UPDATE_CONTEXT_FILES_FUNCTION_ID } from './context-functions';
18
23
 
19
- export const ARCHITECT_TASK_SUMMARY_PROMPT_TEMPLATE_ID = 'architect-tasksummary-create';
20
- export const ARCHITECT_TASK_SUMMARY_UPDATE_PROMPT_TEMPLATE_ID = 'architect-tasksummary-update';
21
-
22
24
  export const architectSystemVariants = <PromptVariantSet>{
23
25
  id: 'architect-system',
24
26
  defaultVariant: {
@@ -92,200 +94,3 @@ Always look at the relevant files to understand your task using the function ~{$
92
94
  `
93
95
  }]
94
96
  };
95
-
96
- export const architectTaskSummaryVariants = <PromptVariantSet>{
97
- id: 'architect-tasksummary',
98
- defaultVariant: {
99
- id: ARCHITECT_TASK_SUMMARY_PROMPT_TEMPLATE_ID,
100
- template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
101
- Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
102
- https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
103
-
104
- Your task is to analyze the current chat session and summarize it to prepare to complete the coding task.
105
- Your instructions should be complete. They are used by a coding agent.
106
- Include all necessary information.
107
- Use unique identifiers such as file paths or URIs to artifacts.
108
- Skip irrelevant information, e.g. for discussions, only sum up the final result.
109
-
110
- ## Instructions
111
- 1. Analyze the conversation carefully.
112
- 2. Identify the main coding objective and requirements.
113
- 3. Propose a clear approach to implement the requested functionality in task steps.
114
- 4. If any part of the task is ambiguous, note the ambiguity so that it can be clarified later.
115
- 5. If there are any relevant examples on how to implement something correctly, add them
116
-
117
- Focus on providing actionable steps and implementation guidance. The coding agent needs practical help with this specific coding task.
118
-
119
- Use the following format, but only include the sections that were discussed in the conversation:
120
-
121
- # Task Context: [Title Here]
122
-
123
- ---
124
-
125
- ## 1. ๐Ÿ“š Task Definition
126
-
127
- **Problem Statement / Goal:**
128
- [Describe what needs to be achieved and why.]
129
-
130
- **Scope:**
131
- - **In Scope:**
132
- [Features, components, or behaviors to be included.]
133
- - **Out of Scope:**
134
- [What explicitly won't be part of this task.]
135
-
136
- ---
137
-
138
- ## 2. ๐Ÿง  Design and Implementation
139
-
140
- **Design Overview:**
141
- [Summary of architecture and major design decisions.]
142
-
143
- **Implementation Plan:**
144
- 1. [First major step]
145
- 2. [Second major step]
146
- 3. [Third major step]
147
-
148
- **Technology Choices:**
149
- - [Frameworks, libraries, services, tools]
150
-
151
- **Files expected to be changed**
152
- List all files that are expected to be changed (using relative file path) and quickly explain what is expected to be changed in this file.
153
-
154
- ### Examples
155
-
156
- List all examples of existing code that are useful to understand the design and do the implementation.
157
- These examples are not the files supposed to be changed, but code that shows how to implement specific things.
158
- Prefer to mention files instead of adding their content.
159
- Explain the purpose of every example.
160
-
161
- ---
162
-
163
- ## 3. ๐Ÿงช Testing
164
-
165
- ### 3.1 ๐Ÿ› ๏ธ Automated Testing (by Coder)
166
-
167
- **Automated Test Strategy:**
168
- [What should be covered by automated tests.]
169
-
170
- **Test Cases Implemented:**
171
- - [Unit test 1]
172
- - [Integration test 1]
173
- - [E2E test 1]
174
-
175
- **Test Coverage Targets:**
176
- [e.g., Minimum 80% code coverage, all workflows tested.]
177
-
178
- ---
179
-
180
- ### 3.2 ๐ŸŽฏ Manual Testing (by Tester)
181
-
182
- **Manual Testing Strategy:**
183
- [What manual tests will focus on (e.g., usability, edge cases, exploratory testing).]
184
-
185
- **Test Setup Instructions:**
186
- - [Environment setup steps, accounts needed, special configurations]
187
-
188
- **Test Cases / Test Steps:**
189
- 1. [Action 1]
190
- 2. [Action 2]
191
- 3. [Action 3]
192
-
193
- **Expected Results:**
194
- - [Expected behavior at each step]
195
-
196
- **Known Risks / Focus Areas:**
197
- - [Potential weak spots, UX concerns, edge cases]
198
-
199
- ---
200
-
201
- ## 4. ๐Ÿ“ฆ Deliverables
202
-
203
- **Expected Artifacts:**
204
- - [Code modules]
205
- - [Documentation]
206
- - [Configuration files]
207
- - [Test reports]
208
-
209
- **PR Information:**
210
- - **PR Title:** [Suggested title for the pull request]
211
- - **PR Description:** [What was implemented, high-level changes, decisions]
212
- - **Verification Steps:** [Instructions for verifying the PR manually or automatically]
213
-
214
- **Additional Notes:**
215
- - [Dependencies]
216
- - [Migration steps if needed]
217
- - [Special reviewer instructions]
218
-
219
- ---
220
-
221
- ## 5. ๐Ÿ”„ Current Status
222
-
223
- **Progress Summary:**
224
- [Short free-text update about how far the task has progressed.]
225
-
226
- **Completed Items:**
227
- - [List of what has been fully implemented, tested, or merged.]
228
-
229
- **Open Items:**
230
- - [List of remaining tasks, missing parts.]
231
-
232
- **Current Issues / Risks:**
233
- - [Open problems, bugs found during testing, architectural blockers.]
234
-
235
- **Next Steps:**
236
- - [Immediate action items, who should act next.]
237
- `
238
- },
239
- variants: [
240
-
241
- {
242
- id: ARCHITECT_TASK_SUMMARY_UPDATE_PROMPT_TEMPLATE_ID,
243
- template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
244
- Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
245
- https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
246
- You are an AI assistant integrated into Theia IDE, designed to update task context files. You can interact provided task context file and propose changes.
247
-
248
- # Task Document Update Instructions
249
-
250
- You are an AI agent tasked with updating a technical document based on the current discussion. Your job is to provide the COMPLETE UPDATED DOCUMENT as your response, not\
251
- commentary about the document.
252
-
253
- ## Analysis Requirements
254
-
255
- 1. **Review the Current Discussion**:
256
- - Analyze the entire conversation
257
- - Identify new information, decisions, and changes
258
-
259
- 2. **Examine the Existing Document**:
260
- - Understand its structure and purpose
261
- - Identify sections that need updates
262
-
263
- 3. **Update the Document**:
264
- - Maintain the original structure and formatting
265
- - Add new information from the discussion
266
- - Update existing information
267
- - Remove outdated information if necessary
268
- - Ensure coherence and organization
269
-
270
- ## IMPORTANT: Response Format
271
-
272
- YOUR ENTIRE RESPONSE MUST BE THE UPDATED DOCUMENT ONLY. Do not include:
273
- - Any commentary about what you changed
274
- - Introduction or explanation text
275
- - Markdown fences or syntax indicators
276
- - Clarifying questions
277
-
278
- Simply output the complete updated document as plain text, which will directly replace the existing document.
279
-
280
- ## Guidelines
281
-
282
- - Be thorough in capturing all relevant information
283
- - Maintain the original document's style and tone
284
- - Use clear, concise language
285
- - Preserve all formatting from the original document
286
- - Ensure technical accuracy in all updates
287
-
288
- {{${TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
289
- ` }
290
- ]
291
- };
@@ -76,7 +76,7 @@ Never guess or hallucinate file content or structure. Use tools for all workspac
76
76
  - ~{${GET_WORKSPACE_FILE_LIST_FUNCTION_ID}} โ€” list contents of a specific directory
77
77
  - ~{${FILE_CONTENT_FUNCTION_ID}} โ€” retrieve the content of a file
78
78
  - ~{${FIND_FILES_BY_PATTERN_FUNCTION_ID}} โ€” find files matching glob patterns (e.g., '**/*.ts' for all TypeScript files)
79
- - ~{${SEARCH_IN_WORKSPACE_FUNCTION_ID}}} โ€” locate references or patterns (only search if you are missing information, always prefer examples that are explicitly provided, never \
79
+ - ~{${SEARCH_IN_WORKSPACE_FUNCTION_ID}} โ€” locate references or patterns (only search if you are missing information, always prefer examples that are explicitly provided, never \
80
80
  search for files you already know the path for)
81
81
  - ~{${UPDATE_CONTEXT_FILES_FUNCTION_ID}} โ€” bookmark important files for context
82
82
 
@@ -89,6 +89,8 @@ search for files you already know the path for)
89
89
  - For incremental changes, use multiple ~{${WRITE_FILE_REPLACEMENTS_ID}} calls
90
90
  - If ~{${WRITE_FILE_REPLACEMENTS_ID}} continuously fails use ~{${WRITE_FILE_CONTENT_ID}}.
91
91
 
92
+ **IMPORTANT: Do not add comments explaining what you changed or why.**
93
+
92
94
  ### Validation
93
95
  - ~{${GET_FILE_DIAGNOSTICS_ID}} โ€” detect syntax, lint, or type errors
94
96
 
@@ -98,7 +100,7 @@ search for files you already know the path for)
98
100
 
99
101
  ### Test Authoring
100
102
  If no relevant tests exist:
101
- - Create new test files (propose using suggestFileContent)
103
+ - Create new test files (propose using ~{${WRITE_FILE_REPLACEMENTS_ID}} or ~{${WRITE_FILE_CONTENT_ID}})
102
104
  - Use patterns from existing tests
103
105
  - Ensure new tests validate new behavior or prevent regressions
104
106
 
@@ -195,6 +197,8 @@ This also applies for newly created files!
195
197
  The changes will be presented as an applicable diff to the user in any case. The user can then accept or reject each change individually. Before you run tasks that depend on the \
196
198
  changes beeing applied, you must wait for the user to review and accept the changes!
197
199
 
200
+ **IMPORTANT: Do not add comments explaining what you changed or why.**
201
+
198
202
  ## Tasks
199
203
 
200
204
  The user might want you to execute some task. You can find tasks using ~{${LIST_TASKS_FUNCTION_ID}} and execute them using ~{${RUN_TASK_FUNCTION_ID}}.
@@ -266,6 +270,8 @@ This also applies for newly created files!
266
270
  The changes will be presented as an applicable diff to the user in any case. The user can then accept or reject each change individually. Before you run tasks that depend on the \
267
271
  changes beeing applied, you must wait for the user to review and accept the changes!
268
272
 
273
+ **IMPORTANT: Do not add comments explaining what you changed or why.**
274
+
269
275
  ## Additional Context
270
276
 
271
277
  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"). \