@theia/ai-ide 1.63.0-next.24 → 1.63.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.map +1 -1
- package/lib/browser/ai-configuration/agent-configuration-widget.js +7 -2
- 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 +0 -1
- package/lib/browser/ai-configuration/ai-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-widget.js +0 -1
- package/lib/browser/ai-configuration/ai-configuration-widget.js.map +1 -1
- package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts +4 -1
- package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/mcp-configuration-widget.js +59 -11
- package/lib/browser/ai-configuration/mcp-configuration-widget.js.map +1 -1
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts +0 -1
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js +1 -4
- package/lib/browser/ai-configuration/prompt-fragments-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-configuration/tools-configuration-widget.d.ts +0 -1
- package/lib/browser/ai-configuration/tools-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/tools-configuration-widget.js +6 -21
- package/lib/browser/ai-configuration/tools-configuration-widget.js.map +1 -1
- package/lib/browser/app-tester-chat-agent.d.ts +5 -3
- package/lib/browser/app-tester-chat-agent.d.ts.map +1 -1
- package/lib/browser/app-tester-chat-agent.js +41 -31
- package/lib/browser/app-tester-chat-agent.js.map +1 -1
- package/lib/browser/architect-agent.d.ts.map +1 -1
- package/lib/browser/architect-agent.js +6 -3
- package/lib/browser/architect-agent.js.map +1 -1
- package/lib/browser/frontend-module.d.ts +1 -0
- package/lib/browser/frontend-module.d.ts.map +1 -1
- package/lib/browser/frontend-module.js +1 -0
- package/lib/browser/frontend-module.js.map +1 -1
- package/lib/browser/summarize-session-command-contribution.d.ts +8 -1
- package/lib/browser/summarize-session-command-contribution.d.ts.map +1 -1
- package/lib/browser/summarize-session-command-contribution.js +60 -6
- package/lib/browser/summarize-session-command-contribution.js.map +1 -1
- package/lib/browser/task-context-file-storage-service.d.ts +4 -2
- package/lib/browser/task-context-file-storage-service.d.ts.map +1 -1
- package/lib/browser/task-context-file-storage-service.js +19 -9
- package/lib/browser/task-context-file-storage-service.js.map +1 -1
- package/lib/browser/workspace-preferences.d.ts +1 -0
- package/lib/browser/workspace-preferences.d.ts.map +1 -1
- package/lib/browser/workspace-preferences.js +9 -1
- package/lib/browser/workspace-preferences.js.map +1 -1
- package/lib/browser/workspace-search-provider.d.ts +5 -1
- package/lib/browser/workspace-search-provider.d.ts.map +1 -1
- package/lib/browser/workspace-search-provider.js +57 -17
- package/lib/browser/workspace-search-provider.js.map +1 -1
- package/lib/browser/workspace-search-provider.spec.d.ts +2 -0
- package/lib/browser/workspace-search-provider.spec.d.ts.map +1 -0
- package/lib/browser/workspace-search-provider.spec.js +227 -0
- package/lib/browser/workspace-search-provider.spec.js.map +1 -0
- package/lib/common/architect-prompt-template.d.ts +4 -2
- package/lib/common/architect-prompt-template.d.ts.map +1 -1
- package/lib/common/architect-prompt-template.js +201 -35
- package/lib/common/architect-prompt-template.js.map +1 -1
- package/lib/common/coder-replace-prompt-template.d.ts +4 -4
- package/lib/common/coder-replace-prompt-template.d.ts.map +1 -1
- package/lib/common/coder-replace-prompt-template.js +8 -8
- package/lib/common/coder-replace-prompt-template.js.map +1 -1
- package/lib/common/summarize-session-commands.d.ts +1 -0
- package/lib/common/summarize-session-commands.d.ts.map +1 -1
- package/lib/common/summarize-session-commands.js +5 -1
- package/lib/common/summarize-session-commands.js.map +1 -1
- package/lib/common/universal-chat-agent.js +2 -2
- package/lib/common/workspace-search-provider-util.d.ts +17 -0
- package/lib/common/workspace-search-provider-util.d.ts.map +1 -0
- package/lib/common/workspace-search-provider-util.js +51 -0
- package/lib/common/workspace-search-provider-util.js.map +1 -0
- package/package.json +19 -18
- package/src/browser/ai-configuration/agent-configuration-widget.tsx +7 -5
- package/src/browser/ai-configuration/ai-configuration-view-contribution.ts +1 -1
- package/src/browser/ai-configuration/ai-configuration-widget.tsx +0 -1
- package/src/browser/ai-configuration/mcp-configuration-widget.tsx +82 -14
- package/src/browser/ai-configuration/prompt-fragments-configuration-widget.tsx +1 -4
- package/src/browser/ai-configuration/template-settings-renderer.tsx +1 -1
- package/src/browser/ai-configuration/tools-configuration-widget.tsx +8 -23
- package/src/browser/app-tester-chat-agent.ts +43 -33
- package/src/browser/architect-agent.ts +8 -5
- package/src/browser/frontend-module.ts +2 -0
- package/src/browser/style/index.css +23 -28
- package/src/browser/summarize-session-command-contribution.ts +64 -8
- package/src/browser/task-context-file-storage-service.ts +20 -10
- package/src/browser/workspace-preferences.ts +9 -0
- package/src/browser/workspace-search-provider.spec.ts +255 -0
- package/src/browser/workspace-search-provider.ts +62 -16
- package/src/common/architect-prompt-template.ts +201 -35
- package/src/common/coder-replace-prompt-template.ts +8 -8
- package/src/common/summarize-session-commands.ts +5 -0
- package/src/common/universal-chat-agent.ts +2 -2
- package/src/common/workspace-search-provider-util.ts +50 -0
|
@@ -16,79 +16,85 @@ import {
|
|
|
16
16
|
import { CONTEXT_FILES_VARIABLE_ID, TASK_CONTEXT_SUMMARY_VARIABLE_ID } from './context-variables';
|
|
17
17
|
import { UPDATE_CONTEXT_FILES_FUNCTION_ID } from './context-functions';
|
|
18
18
|
|
|
19
|
-
export const ARCHITECT_TASK_SUMMARY_PROMPT_TEMPLATE_ID = 'architect-
|
|
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';
|
|
20
21
|
|
|
21
|
-
export const
|
|
22
|
+
export const architectSystemVariants = <PromptVariantSet>{
|
|
22
23
|
id: 'architect-system',
|
|
23
24
|
defaultVariant: {
|
|
24
25
|
id: 'architect-system-default',
|
|
25
26
|
template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
26
|
-
Made improvements or adaptations to this prompt template? We
|
|
27
|
+
Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
|
|
27
28
|
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
28
29
|
# Instructions
|
|
29
30
|
|
|
30
|
-
You are an AI assistant integrated into Theia IDE, designed to assist software developers. You can
|
|
31
|
-
|
|
31
|
+
You are an AI assistant integrated into Theia IDE, designed to assist software developers. You can only change the files added to the context, but you can navigate and read the
|
|
32
|
+
users workspace using the provided functions.\
|
|
33
|
+
Therefore describe and explain the details or procedures necessary to achieve the desired outcome. If file changes are necessary to help the user, be \
|
|
32
34
|
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 \
|
|
33
35
|
implement the change plan. If you refer to files, always mention the workspace-relative path.\
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- **~{${
|
|
38
|
-
- **~{${
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
## Context Retrieval
|
|
38
|
+
Use the following functions to interact with the workspace files if you require context:
|
|
39
|
+
- **~{${GET_WORKSPACE_DIRECTORY_STRUCTURE_FUNCTION_ID}}**
|
|
40
|
+
- **~{${GET_WORKSPACE_FILE_LIST_FUNCTION_ID}}**
|
|
41
|
+
- **~{${FILE_CONTENT_FUNCTION_ID}}**
|
|
42
|
+
- **~{${SEARCH_IN_WORKSPACE_FUNCTION_ID}}**
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
3. **Navigate Step-by-Step**: Move into subdirectories only as needed, confirming each directory level.
|
|
44
|
+
Remember file locations that are relevant for completing your tasks using **~{${UPDATE_CONTEXT_FILES_FUNCTION_ID}}**
|
|
45
|
+
Only add files that are really relevant to look at later. Only add files that are really relevant to look at later.
|
|
45
46
|
|
|
47
|
+
## File Validation
|
|
48
|
+
Use the following function to retrieve a list of problems in a file if the user requests fixes in a given file: **~{${GET_FILE_DIAGNOSTICS_ID}}**
|
|
46
49
|
## Additional Context
|
|
47
50
|
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"). \
|
|
48
51
|
Always look at the relevant files to understand your task using the function ~{${FILE_CONTENT_FUNCTION_ID}}
|
|
49
52
|
{{${CONTEXT_FILES_VARIABLE_ID}}}
|
|
50
53
|
|
|
51
54
|
{{prompt:project-info}}
|
|
55
|
+
|
|
56
|
+
{{${TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
|
|
52
57
|
`
|
|
53
58
|
},
|
|
54
59
|
variants: [
|
|
55
60
|
{
|
|
56
|
-
id: 'architect-system-
|
|
61
|
+
id: 'architect-system-simple',
|
|
57
62
|
template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
58
|
-
Made improvements or adaptations to this prompt template? We
|
|
63
|
+
Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
|
|
59
64
|
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
60
65
|
# Instructions
|
|
61
|
-
|
|
66
|
+
|
|
62
67
|
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 \
|
|
63
68
|
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 \
|
|
64
69
|
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 \
|
|
65
70
|
implement the change plan. If you refer to files, always mention the workspace-relative path.\
|
|
71
|
+
|
|
72
|
+
Use the following functions to interact with the workspace files as needed:
|
|
73
|
+
- **~{${GET_WORKSPACE_DIRECTORY_STRUCTURE_FUNCTION_ID}}**: Returns the complete directory structure.
|
|
74
|
+
- **~{${GET_WORKSPACE_FILE_LIST_FUNCTION_ID}}**: Lists files and directories in a specific directory.
|
|
75
|
+
- **~{${FILE_CONTENT_FUNCTION_ID}}**: Retrieves the content of a specific file.
|
|
76
|
+
|
|
77
|
+
### Workspace Navigation Guidelines
|
|
66
78
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
- **~{${GET_WORKSPACE_FILE_LIST_FUNCTION_ID}}**
|
|
71
|
-
- **~{${FILE_CONTENT_FUNCTION_ID}}**
|
|
72
|
-
- **~{${SEARCH_IN_WORKSPACE_FUNCTION_ID}}**
|
|
73
|
-
|
|
74
|
-
Remember file locations that are relevant for completing your tasks using **~{${UPDATE_CONTEXT_FILES_FUNCTION_ID}}**
|
|
75
|
-
Only add files that are really relevant to look at later. Only add files that are really relevant to look at later.
|
|
79
|
+
1. **Start at the Root**: For general questions (e.g., "How to build the project"), check root-level documentation files or setup files before browsing subdirectories.
|
|
80
|
+
2. **Confirm Paths**: Always verify paths by listing directories or files as you navigate. Avoid assumptions based on user input alone.
|
|
81
|
+
3. **Navigate Step-by-Step**: Move into subdirectories only as needed, confirming each directory level.
|
|
76
82
|
|
|
77
|
-
## File Validation
|
|
78
|
-
Use the following function to retrieve a list of problems in a file if the user requests fixes in a given file: **~{${GET_FILE_DIAGNOSTICS_ID}}**
|
|
79
83
|
## Additional Context
|
|
80
84
|
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"). \
|
|
81
85
|
Always look at the relevant files to understand your task using the function ~{${FILE_CONTENT_FUNCTION_ID}}
|
|
82
86
|
{{${CONTEXT_FILES_VARIABLE_ID}}}
|
|
83
87
|
|
|
84
88
|
{{prompt:project-info}}
|
|
85
|
-
|
|
86
|
-
{{${TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
|
|
87
89
|
`
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
}]
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const architectTaskSummaryVariants = <PromptVariantSet>{
|
|
94
|
+
id: 'architect-tasksummary',
|
|
95
|
+
defaultVariant: {
|
|
96
|
+
id: ARCHITECT_TASK_SUMMARY_PROMPT_TEMPLATE_ID,
|
|
97
|
+
template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
92
98
|
Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
|
|
93
99
|
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
94
100
|
|
|
@@ -105,7 +111,167 @@ Skip irrelevant information, e.g. for discussions, only sum up the final result.
|
|
|
105
111
|
4. If any part of the task is ambiguous, note the ambiguity so that it can be clarified later.
|
|
106
112
|
|
|
107
113
|
Focus on providing actionable steps and implementation guidance. The coding agent needs practical help with this specific coding task.
|
|
114
|
+
|
|
115
|
+
Use the following format, but only include the sections that were discussed in the conversation:
|
|
116
|
+
|
|
117
|
+
# Task Context: [Title Here]
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 1. 📚 Task Definition
|
|
122
|
+
|
|
123
|
+
**Problem Statement / Goal:**
|
|
124
|
+
[Describe what needs to be achieved and why.]
|
|
125
|
+
|
|
126
|
+
**Scope:**
|
|
127
|
+
- **In Scope:**
|
|
128
|
+
[Features, components, or behaviors to be included.]
|
|
129
|
+
- **Out of Scope:**
|
|
130
|
+
[What explicitly won't be part of this task.]
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 2. 🧠 Design and Implementation
|
|
135
|
+
|
|
136
|
+
**Design Overview:**
|
|
137
|
+
[Summary of architecture and major design decisions.]
|
|
138
|
+
|
|
139
|
+
**Implementation Plan:**
|
|
140
|
+
1. [First major step]
|
|
141
|
+
2. [Second major step]
|
|
142
|
+
3. [Third major step]
|
|
143
|
+
|
|
144
|
+
**Technology Choices:**
|
|
145
|
+
- [Frameworks, libraries, services, tools]
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 3. 🧪 Testing
|
|
150
|
+
|
|
151
|
+
### 3.1 🛠️ Automated Testing (by Coder)
|
|
152
|
+
|
|
153
|
+
**Automated Test Strategy:**
|
|
154
|
+
[What should be covered by automated tests.]
|
|
155
|
+
|
|
156
|
+
**Test Cases Implemented:**
|
|
157
|
+
- [Unit test 1]
|
|
158
|
+
- [Integration test 1]
|
|
159
|
+
- [E2E test 1]
|
|
160
|
+
|
|
161
|
+
**Test Coverage Targets:**
|
|
162
|
+
[e.g., Minimum 80% code coverage, all workflows tested.]
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
### 3.2 🎯 Manual Testing (by Tester)
|
|
167
|
+
|
|
168
|
+
**Manual Testing Strategy:**
|
|
169
|
+
[What manual tests will focus on (e.g., usability, edge cases, exploratory testing).]
|
|
170
|
+
|
|
171
|
+
**Test Setup Instructions:**
|
|
172
|
+
- [Environment setup steps, accounts needed, special configurations]
|
|
173
|
+
|
|
174
|
+
**Test Cases / Test Steps:**
|
|
175
|
+
1. [Action 1]
|
|
176
|
+
2. [Action 2]
|
|
177
|
+
3. [Action 3]
|
|
178
|
+
|
|
179
|
+
**Expected Results:**
|
|
180
|
+
- [Expected behavior at each step]
|
|
181
|
+
|
|
182
|
+
**Known Risks / Focus Areas:**
|
|
183
|
+
- [Potential weak spots, UX concerns, edge cases]
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## 4. 📦 Deliverables
|
|
188
|
+
|
|
189
|
+
**Expected Artifacts:**
|
|
190
|
+
- [Code modules]
|
|
191
|
+
- [Documentation]
|
|
192
|
+
- [Configuration files]
|
|
193
|
+
- [Test reports]
|
|
194
|
+
|
|
195
|
+
**PR Information:**
|
|
196
|
+
- **PR Title:** [Suggested title for the pull request]
|
|
197
|
+
- **PR Description:** [What was implemented, high-level changes, decisions]
|
|
198
|
+
- **Verification Steps:** [Instructions for verifying the PR manually or automatically]
|
|
199
|
+
|
|
200
|
+
**Additional Notes:**
|
|
201
|
+
- [Dependencies]
|
|
202
|
+
- [Migration steps if needed]
|
|
203
|
+
- [Special reviewer instructions]
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## 5. 🔄 Current Status
|
|
208
|
+
|
|
209
|
+
**Progress Summary:**
|
|
210
|
+
[Short free-text update about how far the task has progressed.]
|
|
211
|
+
|
|
212
|
+
**Completed Items:**
|
|
213
|
+
- [List of what has been fully implemented, tested, or merged.]
|
|
214
|
+
|
|
215
|
+
**Open Items:**
|
|
216
|
+
- [List of remaining tasks, missing parts.]
|
|
217
|
+
|
|
218
|
+
**Current Issues / Risks:**
|
|
219
|
+
- [Open problems, bugs found during testing, architectural blockers.]
|
|
220
|
+
|
|
221
|
+
**Next Steps:**
|
|
222
|
+
- [Immediate action items, who should act next.]
|
|
108
223
|
`
|
|
109
|
-
|
|
224
|
+
},
|
|
225
|
+
variants: [
|
|
226
|
+
|
|
227
|
+
{
|
|
228
|
+
id: ARCHITECT_TASK_SUMMARY_UPDATE_PROMPT_TEMPLATE_ID,
|
|
229
|
+
template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
230
|
+
Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
|
|
231
|
+
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
232
|
+
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.
|
|
233
|
+
|
|
234
|
+
# Task Document Update Instructions
|
|
235
|
+
|
|
236
|
+
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\
|
|
237
|
+
commentary about the document.
|
|
238
|
+
|
|
239
|
+
## Analysis Requirements
|
|
240
|
+
|
|
241
|
+
1. **Review the Current Discussion**:
|
|
242
|
+
- Analyze the entire conversation
|
|
243
|
+
- Identify new information, decisions, and changes
|
|
244
|
+
|
|
245
|
+
2. **Examine the Existing Document**:
|
|
246
|
+
- Understand its structure and purpose
|
|
247
|
+
- Identify sections that need updates
|
|
248
|
+
|
|
249
|
+
3. **Update the Document**:
|
|
250
|
+
- Maintain the original structure and formatting
|
|
251
|
+
- Add new information from the discussion
|
|
252
|
+
- Update existing information
|
|
253
|
+
- Remove outdated information if necessary
|
|
254
|
+
- Ensure coherence and organization
|
|
255
|
+
|
|
256
|
+
## IMPORTANT: Response Format
|
|
257
|
+
|
|
258
|
+
YOUR ENTIRE RESPONSE MUST BE THE UPDATED DOCUMENT ONLY. Do not include:
|
|
259
|
+
- Any commentary about what you changed
|
|
260
|
+
- Introduction or explanation text
|
|
261
|
+
- Markdown fences or syntax indicators
|
|
262
|
+
- Clarifying questions
|
|
263
|
+
|
|
264
|
+
Simply output the complete updated document as plain text, which will directly replace the existing document.
|
|
265
|
+
|
|
266
|
+
## Guidelines
|
|
267
|
+
|
|
268
|
+
- Be thorough in capturing all relevant information
|
|
269
|
+
- Maintain the original document's style and tone
|
|
270
|
+
- Use clear, concise language
|
|
271
|
+
- Preserve all formatting from the original document
|
|
272
|
+
- Ensure technical accuracy in all updates
|
|
273
|
+
|
|
274
|
+
{{${TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
|
|
275
|
+
` }
|
|
110
276
|
]
|
|
111
277
|
};
|
|
@@ -31,11 +31,11 @@ import {
|
|
|
31
31
|
GET_PROPOSED_CHANGES_ID
|
|
32
32
|
} from './file-changeset-function-ids';
|
|
33
33
|
|
|
34
|
-
export const CODER_SYSTEM_PROMPT_ID = 'coder-
|
|
34
|
+
export const CODER_SYSTEM_PROMPT_ID = 'coder-system';
|
|
35
35
|
|
|
36
|
-
export const CODER_SIMPLE_EDIT_TEMPLATE_ID = 'coder-simple-edit';
|
|
37
|
-
export const CODER_EDIT_TEMPLATE_ID = 'coder-edit';
|
|
38
|
-
export const CODER_AGENT_MODE_TEMPLATE_ID = 'coder-agent-mode';
|
|
36
|
+
export const CODER_SIMPLE_EDIT_TEMPLATE_ID = 'coder-system-simple-edit';
|
|
37
|
+
export const CODER_EDIT_TEMPLATE_ID = 'coder-system-edit';
|
|
38
|
+
export const CODER_AGENT_MODE_TEMPLATE_ID = 'coder-system-agent-mode';
|
|
39
39
|
|
|
40
40
|
export function getCoderAgentModePromptTemplate(): BasePromptFragment {
|
|
41
41
|
return {
|
|
@@ -85,9 +85,9 @@ search for files you already know the path for)
|
|
|
85
85
|
- Use:
|
|
86
86
|
- ~{${WRITE_FILE_REPLACEMENTS_ID}} — to immediately apply targeted code changes (no user review)
|
|
87
87
|
- ~{${WRITE_FILE_CONTENT_ID}} — to immediately overwrite a file with new content (no user review)
|
|
88
|
-
|
|
88
|
+
|
|
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
92
|
### Validation
|
|
93
93
|
- ~{${GET_FILE_DIAGNOSTICS_ID}} — detect syntax, lint, or type errors
|
|
@@ -219,7 +219,7 @@ You have previously proposed changes for the following files. Some suggestions m
|
|
|
219
219
|
{{${TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
|
|
220
220
|
|
|
221
221
|
## Final Instruction
|
|
222
|
-
- Your task is to propose changes to be reviewed by the user
|
|
222
|
+
- Your task is to propose changes to be reviewed by the user. Always do so using the functions described above.
|
|
223
223
|
- Tasks such as building or liniting run on the workspace state, the user has to accept the changes beforehand
|
|
224
224
|
- Do not run a build or any error checking before the users asks you to
|
|
225
225
|
- Focus on the task that the user described
|
|
@@ -277,7 +277,7 @@ You have previously proposed changes for the following files. Some suggestions m
|
|
|
277
277
|
{{${TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
|
|
278
278
|
|
|
279
279
|
## Final Instruction
|
|
280
|
-
- Your task is to propose changes to be reviewed by the user
|
|
280
|
+
- Your task is to propose changes to be reviewed by the user. Always do so using the functions described above.
|
|
281
281
|
- Tasks such as building or liniting run on the workspace state, the user has to accept the changes beforehand
|
|
282
282
|
- Do not run a build or any error checking before the users asks you to
|
|
283
283
|
- Focus on the task that the user described
|
|
@@ -20,3 +20,8 @@ export const AI_SUMMARIZE_SESSION_AS_TASK_FOR_CODER = Command.toLocalizedCommand
|
|
|
20
20
|
id: 'ai-chat:summarize-session-as-task-for-coder',
|
|
21
21
|
label: 'Summarize Session as Task for Coder'
|
|
22
22
|
});
|
|
23
|
+
|
|
24
|
+
export const AI_UPDATE_TASK_CONTEXT_COMMAND = Command.toLocalizedCommand({
|
|
25
|
+
id: 'ai.updateTaskContext',
|
|
26
|
+
label: 'Update Current Task Context'
|
|
27
|
+
});
|
|
@@ -35,6 +35,6 @@ export class UniversalChatAgent extends AbstractStreamParsingChatAgent {
|
|
|
35
35
|
+ 'questions the user might ask. The universal agent currently does not have any context by default, i.e. it cannot '
|
|
36
36
|
+ 'access the current user context or the workspace.');
|
|
37
37
|
|
|
38
|
-
override prompts = [{ id: 'universal-
|
|
39
|
-
protected override systemPromptId: string = 'universal-
|
|
38
|
+
override prompts = [{ id: 'universal-system', defaultVariant: universalTemplate, variants: [universalTemplateVariant] }];
|
|
39
|
+
protected override systemPromptId: string = 'universal-system';
|
|
40
40
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2025 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 { LinePreview, SearchInWorkspaceResult } from '@theia/search-in-workspace/lib/common/search-in-workspace-interface';
|
|
18
|
+
import { URI } from '@theia/core';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Optimizes search results for token efficiency while preserving all information.
|
|
22
|
+
* - Groups matches by file to reduce repetition
|
|
23
|
+
* - Trims leading/trailing whitespace from line text
|
|
24
|
+
* - Uses relative file paths
|
|
25
|
+
* - Preserves all line numbers and content
|
|
26
|
+
*/
|
|
27
|
+
export function optimizeSearchResults(results: SearchInWorkspaceResult[], workspaceRoot: URI): Array<{ file: string; matches: Array<{ line: number; text: string }> }> {
|
|
28
|
+
return results.map(result => {
|
|
29
|
+
const fileUri = new URI(result.fileUri);
|
|
30
|
+
const relativePath = workspaceRoot.relative(fileUri);
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
file: relativePath ? relativePath.toString() : result.fileUri,
|
|
34
|
+
matches: result.matches.map(match => {
|
|
35
|
+
let lineText: string;
|
|
36
|
+
if (typeof match.lineText === 'string') {
|
|
37
|
+
lineText = match.lineText;
|
|
38
|
+
} else {
|
|
39
|
+
const linePreview = match.lineText as LinePreview;
|
|
40
|
+
lineText = linePreview.text || '';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
line: match.line,
|
|
45
|
+
text: lineText.trim()
|
|
46
|
+
};
|
|
47
|
+
})
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}
|