@theia/ai-ide 1.63.0-next.0 → 1.63.0-next.52

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 (102) hide show
  1. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +1 -1
  2. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +1 -1
  3. package/lib/browser/ai-configuration/ai-configuration-widget.d.ts +2 -1
  4. package/lib/browser/ai-configuration/ai-configuration-widget.d.ts.map +1 -1
  5. package/lib/browser/ai-configuration/ai-configuration-widget.js +6 -1
  6. package/lib/browser/ai-configuration/ai-configuration-widget.js.map +1 -1
  7. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts +0 -1
  8. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts.map +1 -1
  9. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js +0 -1
  10. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js.map +1 -1
  11. package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts +1 -0
  12. package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts.map +1 -1
  13. package/lib/browser/ai-configuration/token-usage-configuration-widget.js +25 -3
  14. package/lib/browser/ai-configuration/token-usage-configuration-widget.js.map +1 -1
  15. package/lib/browser/ai-configuration/tools-configuration-widget.d.ts +28 -0
  16. package/lib/browser/ai-configuration/tools-configuration-widget.d.ts.map +1 -0
  17. package/lib/browser/ai-configuration/tools-configuration-widget.js +148 -0
  18. package/lib/browser/ai-configuration/tools-configuration-widget.js.map +1 -0
  19. package/lib/browser/app-tester-chat-agent.d.ts +36 -0
  20. package/lib/browser/app-tester-chat-agent.d.ts.map +1 -0
  21. package/lib/browser/app-tester-chat-agent.js +172 -0
  22. package/lib/browser/app-tester-chat-agent.js.map +1 -0
  23. package/lib/browser/architect-agent.d.ts.map +1 -1
  24. package/lib/browser/architect-agent.js +4 -1
  25. package/lib/browser/architect-agent.js.map +1 -1
  26. package/lib/browser/coder-agent.d.ts.map +1 -1
  27. package/lib/browser/coder-agent.js +3 -3
  28. package/lib/browser/coder-agent.js.map +1 -1
  29. package/lib/browser/file-changeset-functions.d.ts +25 -6
  30. package/lib/browser/file-changeset-functions.d.ts.map +1 -1
  31. package/lib/browser/file-changeset-functions.js +248 -106
  32. package/lib/browser/file-changeset-functions.js.map +1 -1
  33. package/lib/browser/frontend-module.d.ts +1 -0
  34. package/lib/browser/frontend-module.d.ts.map +1 -1
  35. package/lib/browser/frontend-module.js +21 -5
  36. package/lib/browser/frontend-module.js.map +1 -1
  37. package/lib/browser/summarize-session-command-contribution.d.ts +6 -1
  38. package/lib/browser/summarize-session-command-contribution.d.ts.map +1 -1
  39. package/lib/browser/summarize-session-command-contribution.js +53 -4
  40. package/lib/browser/summarize-session-command-contribution.js.map +1 -1
  41. package/lib/browser/task-context-file-storage-service.d.ts +4 -2
  42. package/lib/browser/task-context-file-storage-service.d.ts.map +1 -1
  43. package/lib/browser/task-context-file-storage-service.js +19 -9
  44. package/lib/browser/task-context-file-storage-service.js.map +1 -1
  45. package/lib/browser/workspace-functions.d.ts.map +1 -1
  46. package/lib/browser/workspace-functions.js +6 -10
  47. package/lib/browser/workspace-functions.js.map +1 -1
  48. package/lib/browser/workspace-preferences.d.ts +1 -0
  49. package/lib/browser/workspace-preferences.d.ts.map +1 -1
  50. package/lib/browser/workspace-preferences.js +9 -1
  51. package/lib/browser/workspace-preferences.js.map +1 -1
  52. package/lib/browser/workspace-search-provider.d.ts +7 -1
  53. package/lib/browser/workspace-search-provider.d.ts.map +1 -1
  54. package/lib/browser/workspace-search-provider.js +73 -11
  55. package/lib/browser/workspace-search-provider.js.map +1 -1
  56. package/lib/browser/workspace-search-provider.spec.d.ts +2 -0
  57. package/lib/browser/workspace-search-provider.spec.d.ts.map +1 -0
  58. package/lib/browser/workspace-search-provider.spec.js +227 -0
  59. package/lib/browser/workspace-search-provider.spec.js.map +1 -0
  60. package/lib/common/architect-prompt-template.d.ts +1 -0
  61. package/lib/common/architect-prompt-template.d.ts.map +1 -1
  62. package/lib/common/architect-prompt-template.js +166 -5
  63. package/lib/common/architect-prompt-template.js.map +1 -1
  64. package/lib/common/coder-replace-prompt-template.d.ts +4 -5
  65. package/lib/common/coder-replace-prompt-template.d.ts.map +1 -1
  66. package/lib/common/coder-replace-prompt-template.js +95 -67
  67. package/lib/common/coder-replace-prompt-template.js.map +1 -1
  68. package/lib/common/file-changeset-function-ids.d.ts +7 -0
  69. package/lib/common/file-changeset-function-ids.d.ts.map +1 -0
  70. package/lib/common/file-changeset-function-ids.js +25 -0
  71. package/lib/common/file-changeset-function-ids.js.map +1 -0
  72. package/lib/common/summarize-session-commands.d.ts +1 -0
  73. package/lib/common/summarize-session-commands.d.ts.map +1 -1
  74. package/lib/common/summarize-session-commands.js +5 -1
  75. package/lib/common/summarize-session-commands.js.map +1 -1
  76. package/lib/common/workspace-search-provider-util.d.ts +17 -0
  77. package/lib/common/workspace-search-provider-util.d.ts.map +1 -0
  78. package/lib/common/workspace-search-provider-util.js +51 -0
  79. package/lib/common/workspace-search-provider-util.js.map +1 -0
  80. package/package.json +19 -18
  81. package/src/browser/ai-configuration/ai-configuration-view-contribution.ts +1 -1
  82. package/src/browser/ai-configuration/ai-configuration-widget.tsx +6 -1
  83. package/src/browser/ai-configuration/prompt-fragments-configuration-widget.tsx +0 -1
  84. package/src/browser/ai-configuration/token-usage-configuration-widget.tsx +63 -4
  85. package/src/browser/ai-configuration/tools-configuration-widget.tsx +178 -0
  86. package/src/browser/app-tester-chat-agent.ts +178 -0
  87. package/src/browser/architect-agent.ts +5 -2
  88. package/src/browser/coder-agent.ts +5 -5
  89. package/src/browser/file-changeset-functions.ts +236 -89
  90. package/src/browser/frontend-module.ts +33 -10
  91. package/src/browser/style/index.css +84 -11
  92. package/src/browser/summarize-session-command-contribution.ts +58 -6
  93. package/src/browser/task-context-file-storage-service.ts +20 -10
  94. package/src/browser/workspace-functions.ts +7 -11
  95. package/src/browser/workspace-preferences.ts +9 -0
  96. package/src/browser/workspace-search-provider.spec.ts +255 -0
  97. package/src/browser/workspace-search-provider.ts +78 -11
  98. package/src/common/architect-prompt-template.ts +165 -5
  99. package/src/common/coder-replace-prompt-template.ts +101 -65
  100. package/src/common/file-changeset-function-ids.ts +22 -0
  101. package/src/common/summarize-session-commands.ts +5 -0
  102. package/src/common/workspace-search-provider-util.ts +50 -0
@@ -1,10 +1,9 @@
1
1
  import { BasePromptFragment } from '@theia/ai-core/lib/common';
2
2
  export declare const CODER_SYSTEM_PROMPT_ID = "coder-prompt";
3
- export declare const CODER_REWRITE_PROMPT_TEMPLATE_ID = "coder-rewrite";
4
- export declare const CODER_REPLACE_PROMPT_TEMPLATE_ID = "coder-search-replace";
5
- export declare const CODER_REPLACE_PROMPT_TEMPLATE_NEXT_ID = "coder-search-replace-next";
3
+ export declare const CODER_SIMPLE_EDIT_TEMPLATE_ID = "coder-simple-edit";
4
+ export declare const CODER_EDIT_TEMPLATE_ID = "coder-edit";
6
5
  export declare const CODER_AGENT_MODE_TEMPLATE_ID = "coder-agent-mode";
7
6
  export declare function getCoderAgentModePromptTemplate(): BasePromptFragment;
8
- export declare function getCoderReplacePromptTemplateNext(): BasePromptFragment;
9
- export declare function getCoderReplacePromptTemplate(withSearchAndReplace?: boolean): BasePromptFragment;
7
+ export declare function getCoderPromptTemplateEdit(): BasePromptFragment;
8
+ export declare function getCoderPromptTemplateSimpleEdit(): BasePromptFragment;
10
9
  //# 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,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"}
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;AAsB/D,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AAErD,eAAO,MAAM,6BAA6B,sBAAsB,CAAC;AACjE,eAAO,MAAM,sBAAsB,eAAe,CAAC;AACnD,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D,wBAAgB,+BAA+B,IAAI,kBAAkB,CAsHpE;AAED,wBAAgB,0BAA0B,IAAI,kBAAkB,CAmE/D;AAED,wBAAgB,gCAAgC,IAAI,kBAAkB,CA0DrE"}
@@ -10,21 +10,21 @@
10
10
  // SPDX-License-Identifier: MIT
11
11
  // *****************************************************************************
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
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;
13
+ exports.getCoderPromptTemplateSimpleEdit = exports.getCoderPromptTemplateEdit = exports.getCoderAgentModePromptTemplate = exports.CODER_AGENT_MODE_TEMPLATE_ID = exports.CODER_EDIT_TEMPLATE_ID = exports.CODER_SIMPLE_EDIT_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
+ const file_changeset_function_ids_1 = require("./file-changeset-function-ids");
18
19
  exports.CODER_SYSTEM_PROMPT_ID = 'coder-prompt';
19
- exports.CODER_REWRITE_PROMPT_TEMPLATE_ID = 'coder-rewrite';
20
- exports.CODER_REPLACE_PROMPT_TEMPLATE_ID = 'coder-search-replace';
21
- exports.CODER_REPLACE_PROMPT_TEMPLATE_NEXT_ID = 'coder-search-replace-next';
20
+ exports.CODER_SIMPLE_EDIT_TEMPLATE_ID = 'coder-simple-edit';
21
+ exports.CODER_EDIT_TEMPLATE_ID = 'coder-edit';
22
22
  exports.CODER_AGENT_MODE_TEMPLATE_ID = 'coder-agent-mode';
23
23
  function getCoderAgentModePromptTemplate() {
24
24
  return {
25
25
  id: exports.CODER_AGENT_MODE_TEMPLATE_ID,
26
26
  template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
27
- Made improvements or adaptations to this prompt template? Wed love for you to share it with the community! Contribute back here:
27
+ Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
28
28
  https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
29
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
30
  You must independently analyze, fix, validate, and finalize all changes — only yield control when all relevant tasks are completed.
@@ -34,6 +34,7 @@ You must independently analyze, fix, validate, and finalize all changes — only
34
34
  ## Autonomy and Persistence
35
35
  You are an agent. **Do not stop until** the entire task is complete:
36
36
  - All code changes are applied
37
+ - The build succeeds
37
38
  - All lint issues are resolved
38
39
  - All relevant tests pass
39
40
  - New tests are written when needed
@@ -55,31 +56,32 @@ After each tool call:
55
56
  Never guess or hallucinate file content or structure. Use tools for all workspace interactions:
56
57
 
57
58
  ### 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
59
+ - ~{${workspace_functions_1.GET_WORKSPACE_DIRECTORY_STRUCTURE_FUNCTION_ID}} — view overall structure
60
+ - ~{${workspace_functions_1.GET_WORKSPACE_FILE_LIST_FUNCTION_ID}} — list contents of a specific directory
61
+ - ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}} — retrieve the content of a file
62
+ - ~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}}}locate references or patterns (only search if you are missing information, always prefer examples that are explicitly provided, never \
63
+ search for files you already know the path for)
64
+ - ~{${context_functions_1.UPDATE_CONTEXT_FILES_FUNCTION_ID}} bookmark important files for context
65
+
66
+ ### Code Editing
68
67
  - Before editing, always retrieve file content
69
68
  - 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
69
+ - ~{${file_changeset_function_ids_1.WRITE_FILE_REPLACEMENTS_ID}}to immediately apply targeted code changes (no user review)
70
+ - ~{${file_changeset_function_ids_1.WRITE_FILE_CONTENT_ID}}to immediately overwrite a file with new content (no user review)
71
+
72
+ - For incremental changes, use multiple ~{${file_changeset_function_ids_1.WRITE_FILE_REPLACEMENTS_ID}} calls
73
+ - If ~{${file_changeset_function_ids_1.WRITE_FILE_REPLACEMENTS_ID}} continuously fails use ~{${file_changeset_function_ids_1.WRITE_FILE_CONTENT_ID}}.
74
+
75
+ ### Validation
76
+ - ~{${workspace_functions_1.GET_FILE_DIAGNOSTICS_ID}} — detect syntax, lint, or type errors
75
77
 
76
78
  ### Testing & Tasks
77
- - Use ~{listTasks} to discover available test and lint tasks
78
- - Use ~{runTask} to run linting, building, or test suites
79
+ - Use ~{${workspace_functions_1.LIST_TASKS_FUNCTION_ID}} to discover available test and lint tasks
80
+ - Use ~{${workspace_functions_1.RUN_TASK_FUNCTION_ID}} to run linting, building, or test suites
79
81
 
80
82
  ### Test Authoring
81
83
  If no relevant tests exist:
82
- - Create new test files (propose using changeSet_writeChangeToFile)
84
+ - Create new test files (propose using suggestFileContent)
83
85
  - Use patterns from existing tests
84
86
  - Ensure new tests validate new behavior or prevent regressions
85
87
 
@@ -116,7 +118,7 @@ The following files have been provided for additional context. Some of them may
116
118
  Always look at the relevant files to understand your task using the function ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}
117
119
  {{${context_variables_1.CONTEXT_FILES_VARIABLE_ID}}}
118
120
 
119
- # Previously Proposed Changes
121
+ # Previously Changed Files
120
122
 
121
123
  {{changeSetSummary}}
122
124
 
@@ -124,6 +126,8 @@ Always look at the relevant files to understand your task using the function ~{$
124
126
 
125
127
  {{prompt:project-info}}
126
128
 
129
+ {{${context_variables_1.TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
130
+
127
131
  # Final Instruction
128
132
  You are an autonomous AI agent. Do not stop until:
129
133
  - All errors are fixed
@@ -132,48 +136,56 @@ You are an autonomous AI agent. Do not stop until:
132
136
  - New tests are created if needed
133
137
  - No further action is required
134
138
  `,
135
- ...({ variantOf: exports.CODER_REPLACE_PROMPT_TEMPLATE_ID }),
139
+ ...({ variantOf: exports.CODER_EDIT_TEMPLATE_ID }),
136
140
  };
137
141
  }
138
142
  exports.getCoderAgentModePromptTemplate = getCoderAgentModePromptTemplate;
139
- function getCoderReplacePromptTemplateNext() {
143
+ function getCoderPromptTemplateEdit() {
140
144
  return {
141
- id: exports.CODER_REPLACE_PROMPT_TEMPLATE_NEXT_ID,
145
+ id: exports.CODER_EDIT_TEMPLATE_ID,
142
146
  template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
143
- Made improvements or adaptations to this prompt template? Wed love for you to share it with the community! Contribute back here:
147
+ Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
144
148
  https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
145
- You are an AI assistant integrated into Theia IDE, designed to assist software developers with code tasks. You can interact with the code base and suggest changes.
149
+ You are an AI assistant integrated into Theia IDE, designed to assist software developers with code tasks. You can interact with the code base and suggest changes, \
150
+ which will be reviewed and accepted by the user.
146
151
 
147
152
  ## Context Retrieval
148
153
  Use the following functions to interact with the workspace files if you require context:
149
154
  - **~{${workspace_functions_1.GET_WORKSPACE_DIRECTORY_STRUCTURE_FUNCTION_ID}}**
150
155
  - **~{${workspace_functions_1.GET_WORKSPACE_FILE_LIST_FUNCTION_ID}}**
151
156
  - **~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}**
152
- - **~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}}**
157
+ - **~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}}** (only search if you are missing information, always prefer examples that are explicitly provided, never search for files \
158
+ you already know the path for)
153
159
 
154
160
  Remember file locations that are relevant for completing your tasks using **~{${context_functions_1.UPDATE_CONTEXT_FILES_FUNCTION_ID}}**
155
161
  Only add files that are really relevant to look at later.
156
162
 
157
- ## File Validation
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}}**
159
-
160
163
  ## Propose Code Changes
161
- To propose code changes or any file changes to the user, never print code or new file content in your response.
164
+ To propose code changes or any file changes to the user, never just output them as part of your response, but use the following functions for each file you want to propose \
165
+ changes for.
166
+ This also applies for newly created files!
162
167
 
163
- Instead, for each file you want to propose changes for:
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.
168
+ - **Always Retrieve Current Content**: Use getFileContent to get the original content of the target file.
169
+ - **View Pending Changes**: Use ~{${file_changeset_function_ids_1.GET_PROPOSED_CHANGES_ID}} to see the current proposed state of a file, including all pending changes.
166
170
  - **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.
171
+ - ~{${file_changeset_function_ids_1.SUGGEST_FILE_REPLACEMENTS_ID}}: For targeted replacements of specific text sections. Multiple calls will merge changes unless you set the reset parameter to true.
172
+ - ~{${file_changeset_function_ids_1.SUGGEST_FILE_CONTENT_ID}}: For complete file rewrites when you need to replace the entire content.
173
+ - If ~{${file_changeset_function_ids_1.SUGGEST_FILE_REPLACEMENTS_ID}} continuously fails use ~{${file_changeset_function_ids_1.SUGGEST_FILE_CONTENT_ID}}.
174
+ - ~{${file_changeset_function_ids_1.CLEAR_FILE_CHANGES_ID}}: To clear all pending changes for a file and start fresh.
171
175
 
172
- The changes will be presented as an applicable diff to the user in any case.
176
+ 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 \
177
+ changes beeing applied, you must wait for the user to review and accept the changes!
173
178
 
174
179
  ## Tasks
175
180
 
176
181
  The user might want you to execute some task. You can find tasks using ~{${workspace_functions_1.LIST_TASKS_FUNCTION_ID}} and execute them using ~{${workspace_functions_1.RUN_TASK_FUNCTION_ID}}.
182
+ Be aware that tasks operate on the workspace. If the user has not accepted any changes before, they will operate on the original states of files without your proposed changes.
183
+ Never execute a task without confirming with the user whether this is wanted!
184
+
185
+ ## File Validation
186
+
187
+ 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}}**
188
+ Be aware this function operates on the workspace. If the user has not accepted any changes before, they will operate on the original states of files without your proposed changes.
177
189
 
178
190
  ## Additional Context
179
191
 
@@ -188,43 +200,51 @@ You have previously proposed changes for the following files. Some suggestions m
188
200
  {{prompt:project-info}}
189
201
 
190
202
  {{${context_variables_1.TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
191
- `,
192
- ...({ variantOf: exports.CODER_REPLACE_PROMPT_TEMPLATE_ID }),
203
+
204
+ ## Final Instruction
205
+ - Your task is to propose changes to be reviewed by the user
206
+ - Tasks such as building or liniting run on the workspace state, the user has to accept the changes beforehand
207
+ - Do not run a build or any error checking before the users asks you to
208
+ - Focus on the task that the user described
209
+ `
193
210
  };
194
211
  }
195
- exports.getCoderReplacePromptTemplateNext = getCoderReplacePromptTemplateNext;
196
- function getCoderReplacePromptTemplate(withSearchAndReplace = false) {
212
+ exports.getCoderPromptTemplateEdit = getCoderPromptTemplateEdit;
213
+ function getCoderPromptTemplateSimpleEdit() {
197
214
  return {
198
- id: withSearchAndReplace ? exports.CODER_REPLACE_PROMPT_TEMPLATE_ID : exports.CODER_REWRITE_PROMPT_TEMPLATE_ID,
215
+ id: exports.CODER_SIMPLE_EDIT_TEMPLATE_ID,
199
216
  template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
200
- Made improvements or adaptations to this prompt template? Wed love for you to share it with the community! Contribute back here:
217
+ Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
201
218
  https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
202
- You are an AI assistant integrated into Theia IDE, designed to assist software developers with code tasks. You can interact with the code base and suggest changes.
219
+ You are an AI assistant integrated into Theia IDE, designed to assist software developers with code tasks. You can interact with the code base and suggest changes \
220
+ which will be reviewed and accepted by the user.
203
221
 
204
222
  ## Context Retrieval
205
223
  Use the following functions to interact with the workspace files if you require context:
206
- - **~{${workspace_functions_1.GET_WORKSPACE_DIRECTORY_STRUCTURE_FUNCTION_ID}}**: Returns the complete directory structure.
207
- - **~{${workspace_functions_1.GET_WORKSPACE_FILE_LIST_FUNCTION_ID}}**: Lists files and directories in a specific directory.
208
- - **~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}**: Retrieves the content of a specific file.
209
- - **~{${context_functions_1.UPDATE_CONTEXT_FILES_FUNCTION_ID}}**: Remember file locations that are relevant for completing your tasks. Only add files that are really relevant to look at later.
224
+ - **~{${workspace_functions_1.GET_WORKSPACE_DIRECTORY_STRUCTURE_FUNCTION_ID}}**
225
+ - **~{${workspace_functions_1.GET_WORKSPACE_FILE_LIST_FUNCTION_ID}}**
226
+ - **~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}**
227
+ - **~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}}** (only search if you are missing information, always prefer examples that are explicitly provided, never search for files \
228
+ you already know the path for)
210
229
 
211
- ## File Validation
212
- Use the following function to retrieve a list of problems in a file if the user requests fixes in a given file:
213
- - **~{${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.
230
+ Remember file locations that are relevant for completing your tasks using **~{${context_functions_1.UPDATE_CONTEXT_FILES_FUNCTION_ID}}**
231
+ Only add files that are really relevant to look at later.
214
232
 
215
233
  ## Propose Code Changes
216
- To propose code changes or any file changes to the user, never print code or new file content in your response.
234
+ To propose code changes or any file changes to the user, never just output them as part of your response, but use the following functions for each file you want to propose \
235
+ changes for.
236
+ This also applies for newly created files!
217
237
 
218
- Instead, for each file you want to propose changes for:
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.
238
+ - **Always Retrieve Current Content**: Use getFileContent to get the original content of the target file.
239
+ - **View Pending Changes**: Use ~{${file_changeset_function_ids_1.GET_PROPOSED_CHANGES_ID}} to see the current proposed state of a file, including all pending changes.
221
240
  - **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.
241
+ - ~{${file_changeset_function_ids_1.SUGGEST_FILE_REPLACEMENTS_ID}}: For targeted replacements of specific text sections. Multiple calls will merge changes unless you set the reset parameter to true.
242
+ - ~{${file_changeset_function_ids_1.SUGGEST_FILE_CONTENT_ID}}: For complete file rewrites when you need to replace the entire content.
243
+ - If ~{${file_changeset_function_ids_1.SUGGEST_FILE_REPLACEMENTS_ID}} continuously fails use ~{${file_changeset_function_ids_1.SUGGEST_FILE_CONTENT_ID}}.
244
+ - ~{${file_changeset_function_ids_1.CLEAR_FILE_CHANGES_ID}}: To clear all pending changes for a file and start fresh.
226
245
 
227
- The changes will be presented as an applicable diff to the user in any case.
246
+ 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 \
247
+ changes beeing applied, you must wait for the user to review and accept the changes!
228
248
 
229
249
  ## Additional Context
230
250
 
@@ -232,14 +252,22 @@ The following files have been provided for additional context. Some of them may
232
252
  Always look at the relevant files to understand your task using the function ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}
233
253
  {{${context_variables_1.CONTEXT_FILES_VARIABLE_ID}}}
234
254
 
255
+ ## Previously Proposed Changes
256
+ You have previously proposed changes for the following files. Some suggestions may have been accepted by the user, while others may still be pending.
235
257
  {{${ai_chat_1.CHANGE_SET_SUMMARY_VARIABLE_ID}}}
236
258
 
237
259
  {{prompt:project-info}}
238
260
 
239
261
  {{${context_variables_1.TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
262
+
263
+ ## Final Instruction
264
+ - Your task is to propose changes to be reviewed by the user
265
+ - Tasks such as building or liniting run on the workspace state, the user has to accept the changes beforehand
266
+ - Do not run a build or any error checking before the users asks you to
267
+ - Focus on the task that the user described
240
268
  `,
241
- ...(!withSearchAndReplace ? { variantOf: exports.CODER_REPLACE_PROMPT_TEMPLATE_ID } : {}),
269
+ ...({ variantOf: exports.CODER_EDIT_TEMPLATE_ID }),
242
270
  };
243
271
  }
244
- exports.getCoderReplacePromptTemplate = getCoderReplacePromptTemplate;
272
+ exports.getCoderPromptTemplateSimpleEdit = getCoderPromptTemplateSimpleEdit;
245
273
  //# sourceMappingURL=coder-replace-prompt-template.js.map
@@ -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,sBAAsB,GAAG,cAAc,CAAC;AACxC,QAAA,gCAAgC,GAAG,eAAe,CAAC;AACnD,QAAA,gCAAgC,GAAG,sBAAsB,CAAC;AAC1D,QAAA,qCAAqC,GAAG,2BAA2B,CAAC;AACpE,QAAA,4BAA4B,GAAG,kBAAkB,CAAC;AAE/D,SAAgB,+BAA+B;IAC3C,OAAO;QACH,EAAE,EAAE,oCAA4B;QAChC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iFA0F+D,8CAAwB;IACrG,6CAAyB;;;;;;;;;;;;;;;;;CAiB5B;QACO,GAAG,CAAC,EAAE,SAAS,EAAE,wCAAgC,EAAE,CAAC;KACvD,CAAC;AACN,CAAC;AAlHD,0EAkHC;AAED,SAAgB,iCAAiC;IAC7C,OAAO;QACH,EAAE,EAAE,6CAAqC;QACzC,QAAQ,EAAE;;;;;;;QAOV,mEAA6C;QAC7C,yDAAmC;QACnC,8CAAwB;QACxB,qDAA+B;;gFAEyC,oDAAgC;;;;sHAIM,6CAAuB;;;;;;6CAMhG,8CAAwB;;;;;;;;;;;;2EAYM,4CAAsB,8BAA8B,0CAAoB;;;;;iFAKlE,8CAAwB;IACrG,6CAAyB;;;;IAIzB,wCAA8B;;;;IAI9B,oDAAgC;CACnC;QACO,GAAG,CAAC,EAAE,SAAS,EAAE,wCAAgC,EAAE,CAAC;KACvD,CAAC;AACN,CAAC;AAvDD,8EAuDC;AACD,SAAgB,6BAA6B,CAAC,uBAAgC,KAAK;IAC/E,OAAO;QACH,EAAE,EAAE,oBAAoB,CAAC,CAAC,CAAC,wCAAgC,CAAC,CAAC,CAAC,wCAAgC;QAC9F,QAAQ,EAAE;;;;;;;QAOV,mEAA6C;QAC7C,yDAAmC;QACnC,8CAAwB;QACxB,oDAAgC;;;;QAIhC,6CAAuB;;;;;;6CAMc,8CAAwB;;;;;;;;;;;;;iFAaY,8CAAwB;IACrG,6CAAyB;;IAEzB,wCAA8B;;;;IAI9B,oDAAgC;CACnC;QACO,GAAG,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,wCAAgC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpF,CAAC;AACN,CAAC;AA/CD,sEA+CC"}
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;AACvE,+EAOuC;AAE1B,QAAA,sBAAsB,GAAG,cAAc,CAAC;AAExC,QAAA,6BAA6B,GAAG,mBAAmB,CAAC;AACpD,QAAA,sBAAsB,GAAG,YAAY,CAAC;AACtC,QAAA,4BAA4B,GAAG,kBAAkB,CAAC;AAE/D,SAAgB,+BAA+B;IAC3C,OAAO;QACH,EAAE,EAAE,oCAA4B;QAChC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiCZ,mEAA6C;MAC7C,yDAAmC;MACnC,8CAAwB;MACxB,qDAA+B;;MAE/B,oDAAgC;;;;;QAK9B,wDAA0B;QAC1B,mDAAqB;;4CAEe,wDAA0B;SAC7D,wDAA0B,8BAA8B,mDAAqB;;;MAGhF,6CAAuB;;;UAGnB,4CAAsB;UACtB,0CAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iFAsCmD,8CAAwB;IACrG,6CAAyB;;;;;;;;;;IAUzB,oDAAgC;;;;;;;;;CASnC;QACO,GAAG,CAAC,EAAE,SAAS,EAAE,8BAAsB,EAAE,CAAC;KAC7C,CAAC;AACN,CAAC;AAtHD,0EAsHC;AAED,SAAgB,0BAA0B;IACtC,OAAO;QACH,EAAE,EAAE,8BAAsB;QAC1B,QAAQ,EAAE;;;;;;;;QAQV,mEAA6C;QAC7C,yDAAmC;QACnC,8CAAwB;QACxB,qDAA+B;;;gFAGyC,oDAAgC;;;;;;;;;oCAS5E,qDAAuB;;QAEnD,0DAA4B;QAC5B,qDAAuB;WACpB,0DAA4B,8BAA8B,qDAAuB;QACpF,mDAAqB;;;;;;;2EAO8C,4CAAsB,8BAA8B,0CAAoB;;;;;;sHAM7B,6CAAuB;;;;;;iFAM5D,8CAAwB;IACrG,6CAAyB;;;;IAIzB,wCAA8B;;;;IAI9B,oDAAgC;;;;;;;CAOnC;KAAC,CAAC;AACH,CAAC;AAnED,gEAmEC;AAED,SAAgB,gCAAgC;IAC5C,OAAO;QACH,EAAE,EAAE,qCAA6B;QACjC,QAAQ,EAAE;;;;;;;;QAQV,mEAA6C;QAC7C,yDAAmC;QACnC,8CAAwB;QACxB,qDAA+B;;;gFAGyC,oDAAgC;;;;;;;;;oCAS5E,qDAAuB;;QAEnD,0DAA4B;QAC5B,qDAAuB;WACpB,0DAA4B,8BAA8B,qDAAuB;QACpF,mDAAqB;;;;;;;;iFAQoD,8CAAwB;IACrG,6CAAyB;;;;IAIzB,wCAA8B;;;;IAI9B,oDAAgC;;;;;;;CAOnC;QACO,GAAG,CAAC,EAAE,SAAS,EAAE,8BAAsB,EAAE,CAAC;KAC7C,CAAC;AACN,CAAC;AA1DD,4EA0DC"}
@@ -0,0 +1,7 @@
1
+ export declare const SUGGEST_FILE_CONTENT_ID = "suggestFileContent";
2
+ export declare const WRITE_FILE_CONTENT_ID = "writeFileContent";
3
+ export declare const SUGGEST_FILE_REPLACEMENTS_ID = "suggestFileReplacements";
4
+ export declare const WRITE_FILE_REPLACEMENTS_ID = "writeFileReplacements";
5
+ export declare const CLEAR_FILE_CHANGES_ID = "clearFileChanges";
6
+ export declare const GET_PROPOSED_CHANGES_ID = "getProposedFileState";
7
+ //# sourceMappingURL=file-changeset-function-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-changeset-function-ids.d.ts","sourceRoot":"","sources":["../../src/common/file-changeset-function-ids.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAC5D,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AACxD,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AACtE,eAAO,MAAM,0BAA0B,0BAA0B,CAAC;AAClE,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AACxD,eAAO,MAAM,uBAAuB,yBAAyB,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 EclipseSource GmbH.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.GET_PROPOSED_CHANGES_ID = exports.CLEAR_FILE_CHANGES_ID = exports.WRITE_FILE_REPLACEMENTS_ID = exports.SUGGEST_FILE_REPLACEMENTS_ID = exports.WRITE_FILE_CONTENT_ID = exports.SUGGEST_FILE_CONTENT_ID = void 0;
19
+ exports.SUGGEST_FILE_CONTENT_ID = 'suggestFileContent';
20
+ exports.WRITE_FILE_CONTENT_ID = 'writeFileContent';
21
+ exports.SUGGEST_FILE_REPLACEMENTS_ID = 'suggestFileReplacements';
22
+ exports.WRITE_FILE_REPLACEMENTS_ID = 'writeFileReplacements';
23
+ exports.CLEAR_FILE_CHANGES_ID = 'clearFileChanges';
24
+ exports.GET_PROPOSED_CHANGES_ID = 'getProposedFileState';
25
+ //# sourceMappingURL=file-changeset-function-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-changeset-function-ids.js","sourceRoot":"","sources":["../../src/common/file-changeset-function-ids.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;;;AAEnE,QAAA,uBAAuB,GAAG,oBAAoB,CAAC;AAC/C,QAAA,qBAAqB,GAAG,kBAAkB,CAAC;AAC3C,QAAA,4BAA4B,GAAG,yBAAyB,CAAC;AACzD,QAAA,0BAA0B,GAAG,uBAAuB,CAAC;AACrD,QAAA,qBAAqB,GAAG,kBAAkB,CAAC;AAC3C,QAAA,uBAAuB,GAAG,sBAAsB,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import { Command } from '@theia/core';
2
2
  export declare const AI_SUMMARIZE_SESSION_AS_TASK_FOR_CODER: Command;
3
+ export declare const AI_UPDATE_TASK_CONTEXT_COMMAND: Command;
3
4
  //# sourceMappingURL=summarize-session-commands.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"summarize-session-commands.d.ts","sourceRoot":"","sources":["../../src/common/summarize-session-commands.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,eAAO,MAAM,sCAAsC,SAGjD,CAAC"}
1
+ {"version":3,"file":"summarize-session-commands.d.ts","sourceRoot":"","sources":["../../src/common/summarize-session-commands.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,eAAO,MAAM,sCAAsC,SAGjD,CAAC;AAEH,eAAO,MAAM,8BAA8B,SAGzC,CAAC"}
@@ -15,10 +15,14 @@
15
15
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
16
  // *****************************************************************************
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.AI_SUMMARIZE_SESSION_AS_TASK_FOR_CODER = void 0;
18
+ exports.AI_UPDATE_TASK_CONTEXT_COMMAND = exports.AI_SUMMARIZE_SESSION_AS_TASK_FOR_CODER = void 0;
19
19
  const core_1 = require("@theia/core");
20
20
  exports.AI_SUMMARIZE_SESSION_AS_TASK_FOR_CODER = core_1.Command.toLocalizedCommand({
21
21
  id: 'ai-chat:summarize-session-as-task-for-coder',
22
22
  label: 'Summarize Session as Task for Coder'
23
23
  });
24
+ exports.AI_UPDATE_TASK_CONTEXT_COMMAND = core_1.Command.toLocalizedCommand({
25
+ id: 'ai.updateTaskContext',
26
+ label: 'Update Current Task Context'
27
+ });
24
28
  //# sourceMappingURL=summarize-session-commands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"summarize-session-commands.js","sourceRoot":"","sources":["../../src/common/summarize-session-commands.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,sCAAsC;AAEzB,QAAA,sCAAsC,GAAG,cAAO,CAAC,kBAAkB,CAAC;IAC7E,EAAE,EAAE,6CAA6C;IACjD,KAAK,EAAE,qCAAqC;CAC/C,CAAC,CAAC"}
1
+ {"version":3,"file":"summarize-session-commands.js","sourceRoot":"","sources":["../../src/common/summarize-session-commands.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,sCAAsC;AAEzB,QAAA,sCAAsC,GAAG,cAAO,CAAC,kBAAkB,CAAC;IAC7E,EAAE,EAAE,6CAA6C;IACjD,KAAK,EAAE,qCAAqC;CAC/C,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAG,cAAO,CAAC,kBAAkB,CAAC;IACrE,EAAE,EAAE,sBAAsB;IAC1B,KAAK,EAAE,6BAA6B;CACvC,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { SearchInWorkspaceResult } from '@theia/search-in-workspace/lib/common/search-in-workspace-interface';
2
+ import { URI } from '@theia/core';
3
+ /**
4
+ * Optimizes search results for token efficiency while preserving all information.
5
+ * - Groups matches by file to reduce repetition
6
+ * - Trims leading/trailing whitespace from line text
7
+ * - Uses relative file paths
8
+ * - Preserves all line numbers and content
9
+ */
10
+ export declare function optimizeSearchResults(results: SearchInWorkspaceResult[], workspaceRoot: URI): Array<{
11
+ file: string;
12
+ matches: Array<{
13
+ line: number;
14
+ text: string;
15
+ }>;
16
+ }>;
17
+ //# sourceMappingURL=workspace-search-provider-util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-search-provider-util.d.ts","sourceRoot":"","sources":["../../src/common/workspace-search-provider-util.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAe,uBAAuB,EAAE,MAAM,qEAAqE,CAAC;AAC3H,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,uBAAuB,EAAE,EAAE,aAAa,EAAE,GAAG,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAuBrK"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 EclipseSource GmbH.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.optimizeSearchResults = void 0;
19
+ const core_1 = require("@theia/core");
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
+ function optimizeSearchResults(results, workspaceRoot) {
28
+ return results.map(result => {
29
+ const fileUri = new core_1.URI(result.fileUri);
30
+ const relativePath = workspaceRoot.relative(fileUri);
31
+ return {
32
+ file: relativePath ? relativePath.toString() : result.fileUri,
33
+ matches: result.matches.map(match => {
34
+ let lineText;
35
+ if (typeof match.lineText === 'string') {
36
+ lineText = match.lineText;
37
+ }
38
+ else {
39
+ const linePreview = match.lineText;
40
+ lineText = linePreview.text || '';
41
+ }
42
+ return {
43
+ line: match.line,
44
+ text: lineText.trim()
45
+ };
46
+ })
47
+ };
48
+ });
49
+ }
50
+ exports.optimizeSearchResults = optimizeSearchResults;
51
+ //# sourceMappingURL=workspace-search-provider-util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-search-provider-util.js","sourceRoot":"","sources":["../../src/common/workspace-search-provider-util.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAGhF,sCAAkC;AAElC;;;;;;GAMG;AACH,SAAgB,qBAAqB,CAAC,OAAkC,EAAE,aAAkB;IACxF,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QACxB,MAAM,OAAO,GAAG,IAAI,UAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACxC,MAAM,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAErD,OAAO;YACH,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO;YAC7D,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;gBAChC,IAAI,QAAgB,CAAC;gBACrB,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;oBACrC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;gBAC9B,CAAC;qBAAM,CAAC;oBACJ,MAAM,WAAW,GAAG,KAAK,CAAC,QAAuB,CAAC;oBAClD,QAAQ,GAAG,WAAW,CAAC,IAAI,IAAI,EAAE,CAAC;gBACtC,CAAC;gBAED,OAAO;oBACH,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE;iBACxB,CAAC;YACN,CAAC,CAAC;SACL,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC;AAvBD,sDAuBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/ai-ide",
3
- "version": "1.63.0-next.0+c02e6a4f5",
3
+ "version": "1.63.0-next.52+176018e53",
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,19 +15,19 @@
15
15
  "theia-extension"
16
16
  ],
17
17
  "dependencies": {
18
- "@theia/ai-chat": "1.63.0-next.0+c02e6a4f5",
19
- "@theia/ai-chat-ui": "1.63.0-next.0+c02e6a4f5",
20
- "@theia/ai-core": "1.63.0-next.0+c02e6a4f5",
21
- "@theia/ai-mcp": "1.63.0-next.0+c02e6a4f5",
22
- "@theia/core": "1.63.0-next.0+c02e6a4f5",
23
- "@theia/filesystem": "1.63.0-next.0+c02e6a4f5",
24
- "@theia/markers": "1.63.0-next.0+c02e6a4f5",
25
- "@theia/monaco": "1.63.0-next.0+c02e6a4f5",
26
- "@theia/navigator": "1.63.0-next.0+c02e6a4f5",
27
- "@theia/search-in-workspace": "1.63.0-next.0+c02e6a4f5",
28
- "@theia/task": "1.63.0-next.0+c02e6a4f5",
29
- "@theia/terminal": "1.63.0-next.0+c02e6a4f5",
30
- "@theia/workspace": "1.63.0-next.0+c02e6a4f5",
18
+ "@theia/ai-chat": "1.63.0-next.52+176018e53",
19
+ "@theia/ai-chat-ui": "1.63.0-next.52+176018e53",
20
+ "@theia/ai-core": "1.63.0-next.52+176018e53",
21
+ "@theia/ai-mcp": "1.63.0-next.52+176018e53",
22
+ "@theia/core": "1.63.0-next.52+176018e53",
23
+ "@theia/filesystem": "1.63.0-next.52+176018e53",
24
+ "@theia/markers": "1.63.0-next.52+176018e53",
25
+ "@theia/monaco": "1.63.0-next.52+176018e53",
26
+ "@theia/navigator": "1.63.0-next.52+176018e53",
27
+ "@theia/search-in-workspace": "1.63.0-next.52+176018e53",
28
+ "@theia/task": "1.63.0-next.52+176018e53",
29
+ "@theia/terminal": "1.63.0-next.52+176018e53",
30
+ "@theia/workspace": "1.63.0-next.52+176018e53",
31
31
  "date-fns": "^4.1.0",
32
32
  "ignore": "^6.0.0",
33
33
  "js-yaml": "^4.1.0",
@@ -37,12 +37,13 @@
37
37
  "access": "public"
38
38
  },
39
39
  "devDependencies": {
40
- "@theia/cli": "1.63.0-next.0+c02e6a4f5",
41
- "@theia/test": "1.63.0-next.0+c02e6a4f5"
40
+ "@theia/cli": "1.63.0-next.52+176018e53",
41
+ "@theia/test": "1.63.0-next.52+176018e53"
42
42
  },
43
43
  "theiaExtensions": [
44
44
  {
45
- "frontend": "lib/browser/frontend-module"
45
+ "frontend": "lib/browser/frontend-module",
46
+ "secondaryWindow": "lib/browser/frontend-module"
46
47
  }
47
48
  ],
48
49
  "files": [
@@ -60,5 +61,5 @@
60
61
  "nyc": {
61
62
  "extends": "../../configs/nyc.json"
62
63
  },
63
- "gitHead": "c02e6a4f58728b4067cbd267d598550192abb249"
64
+ "gitHead": "176018e53e62cafec9b25b23ac9f0b4826b6d0f7"
64
65
  }
@@ -35,7 +35,7 @@ export class AIAgentConfigurationViewContribution extends AIViewContribution<AIC
35
35
  widgetId: AIConfigurationContainerWidget.ID,
36
36
  widgetName: AIConfigurationContainerWidget.LABEL,
37
37
  defaultWidgetOptions: {
38
- area: 'bottom',
38
+ area: 'main',
39
39
  rank: 100
40
40
  },
41
41
  toggleCommandId: AI_CONFIGURATION_TOGGLE_COMMAND_ID
@@ -17,9 +17,9 @@
17
17
  import { BaseWidget, BoxLayout, codicon, DockPanel, WidgetManager } from '@theia/core/lib/browser';
18
18
  import { TheiaDockPanel } from '@theia/core/lib/browser/shell/theia-dock-panel';
19
19
  import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
20
- import '../../../src/browser/style/index.css';
21
20
  import { AIAgentConfigurationWidget } from './agent-configuration-widget';
22
21
  import { AIVariableConfigurationWidget } from './variable-configuration-widget';
22
+ import { AIToolsConfigurationWidget } from './tools-configuration-widget';
23
23
  import { AIConfigurationSelectionService } from './ai-configuration-service';
24
24
  import { nls } from '@theia/core';
25
25
  import { AIMCPConfigurationWidget } from './mcp-configuration-widget';
@@ -45,6 +45,7 @@ export class AIConfigurationContainerWidget extends BaseWidget {
45
45
  protected mcpWidget: AIMCPConfigurationWidget;
46
46
  protected tokenUsageWidget: AITokenUsageConfigurationWidget;
47
47
  protected promptFragmentsWidget: AIPromptFragmentsConfigurationWidget;
48
+ protected toolsWidget: AIToolsConfigurationWidget;
48
49
 
49
50
  @postConstruct()
50
51
  protected init(): void {
@@ -72,12 +73,14 @@ export class AIConfigurationContainerWidget extends BaseWidget {
72
73
  this.mcpWidget = await this.widgetManager.getOrCreateWidget(AIMCPConfigurationWidget.ID);
73
74
  this.tokenUsageWidget = await this.widgetManager.getOrCreateWidget(AITokenUsageConfigurationWidget.ID);
74
75
  this.promptFragmentsWidget = await this.widgetManager.getOrCreateWidget(AIPromptFragmentsConfigurationWidget.ID);
76
+ this.toolsWidget = await this.widgetManager.getOrCreateWidget(AIToolsConfigurationWidget.ID);
75
77
 
76
78
  this.dockpanel.addWidget(this.agentsWidget);
77
79
  this.dockpanel.addWidget(this.variablesWidget, { mode: 'tab-after', ref: this.agentsWidget });
78
80
  this.dockpanel.addWidget(this.mcpWidget, { mode: 'tab-after', ref: this.variablesWidget });
79
81
  this.dockpanel.addWidget(this.tokenUsageWidget, { mode: 'tab-after', ref: this.mcpWidget });
80
82
  this.dockpanel.addWidget(this.promptFragmentsWidget, { mode: 'tab-after', ref: this.tokenUsageWidget });
83
+ this.dockpanel.addWidget(this.toolsWidget, { mode: 'tab-after', ref: this.promptFragmentsWidget });
81
84
 
82
85
  this.update();
83
86
  }
@@ -94,6 +97,8 @@ export class AIConfigurationContainerWidget extends BaseWidget {
94
97
  this.dockpanel.activateWidget(this.tokenUsageWidget);
95
98
  } else if (widgetId === AIPromptFragmentsConfigurationWidget.ID) {
96
99
  this.dockpanel.activateWidget(this.promptFragmentsWidget);
100
+ } else if (widgetId === AIToolsConfigurationWidget.ID) {
101
+ this.dockpanel.activateWidget(this.toolsWidget);
97
102
  }
98
103
  });
99
104
  }
@@ -26,7 +26,6 @@ import {
26
26
  BasePromptFragment
27
27
  } from '@theia/ai-core/lib/common/prompt-service';
28
28
  import * as React from '@theia/core/shared/react';
29
- import '../../../src/browser/style/index.css';
30
29
  import { AgentService } from '@theia/ai-core/lib/common/agent-service';
31
30
  import { Agent } from '@theia/ai-core/lib/common/agent';
32
31
  import { CustomizationSource } from '@theia/ai-core/lib/browser/frontend-prompt-customization-service';