@theia/ai-ide 1.77.0-next.7 → 1.77.0-next.71

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 (190) hide show
  1. package/lib/browser/{project-info-agent.d.ts → agents-md-agent.d.ts} +2 -2
  2. package/lib/browser/agents-md-agent.d.ts.map +1 -0
  3. package/lib/browser/{project-info-agent.js → agents-md-agent.js} +16 -15
  4. package/lib/browser/agents-md-agent.js.map +1 -0
  5. package/lib/browser/ai-configuration/ai-configuration-label-provider-contribution.js +1 -1
  6. package/lib/browser/ai-configuration/ai-configuration-label-provider-contribution.js.map +1 -1
  7. package/lib/browser/ai-configuration/ai-configuration-resource.js +2 -1
  8. package/lib/browser/ai-configuration/ai-configuration-resource.js.map +1 -1
  9. package/lib/browser/ai-configuration/ai-configuration-search-widget.js +1 -1
  10. package/lib/browser/ai-configuration/ai-configuration-search-widget.js.map +1 -1
  11. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.d.ts +11 -3
  12. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.d.ts.map +1 -1
  13. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.js +64 -29
  14. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.js.map +1 -1
  15. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.spec.js +480 -1
  16. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.spec.js.map +1 -1
  17. package/lib/browser/ai-configuration/categories/agent-detail-model.d.ts +10 -0
  18. package/lib/browser/ai-configuration/categories/agent-detail-model.d.ts.map +1 -1
  19. package/lib/browser/ai-configuration/categories/agent-detail-model.js +8 -0
  20. package/lib/browser/ai-configuration/categories/agent-detail-model.js.map +1 -1
  21. package/lib/browser/ai-configuration/categories/agent-detail-model.spec.d.ts +2 -0
  22. package/lib/browser/ai-configuration/categories/agent-detail-model.spec.d.ts.map +1 -0
  23. package/lib/browser/ai-configuration/categories/agent-detail-model.spec.js +74 -0
  24. package/lib/browser/ai-configuration/categories/agent-detail-model.spec.js.map +1 -0
  25. package/lib/browser/ai-configuration/categories/agent-detail-view.d.ts.map +1 -1
  26. package/lib/browser/ai-configuration/categories/agent-detail-view.js +3 -2
  27. package/lib/browser/ai-configuration/categories/agent-detail-view.js.map +1 -1
  28. package/lib/browser/ai-configuration/categories/agents-configuration-category.d.ts +6 -1
  29. package/lib/browser/ai-configuration/categories/agents-configuration-category.d.ts.map +1 -1
  30. package/lib/browser/ai-configuration/categories/agents-configuration-category.js +20 -2
  31. package/lib/browser/ai-configuration/categories/agents-configuration-category.js.map +1 -1
  32. package/lib/browser/ai-configuration/categories/provider-model-discovery-section.js +5 -4
  33. package/lib/browser/ai-configuration/categories/provider-model-discovery-section.js.map +1 -1
  34. package/lib/browser/ai-configuration/categories/provider-model-discovery-section.spec.js +2 -1
  35. package/lib/browser/ai-configuration/categories/provider-model-discovery-section.spec.js.map +1 -1
  36. package/lib/browser/ai-configuration/categories/token-usage-configuration-category.js +2 -2
  37. package/lib/browser/ai-configuration/categories/token-usage-configuration-category.js.map +1 -1
  38. package/lib/browser/ai-configuration/categories/tools-configuration-category.js +1 -1
  39. package/lib/browser/ai-configuration/categories/tools-configuration-category.js.map +1 -1
  40. package/lib/browser/ai-configuration/categories/variables-configuration-category.js +1 -1
  41. package/lib/browser/ai-configuration/categories/variables-configuration-category.js.map +1 -1
  42. package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +1 -1
  43. package/lib/browser/ai-configuration/language-model-renderer.js +8 -15
  44. package/lib/browser/ai-configuration/language-model-renderer.js.map +1 -1
  45. package/lib/browser/ai-configuration/language-model-renderer.spec.js +40 -1
  46. package/lib/browser/ai-configuration/language-model-renderer.spec.js.map +1 -1
  47. package/lib/browser/ai-sessions-widget.js +1 -1
  48. package/lib/browser/ai-sessions-widget.js.map +1 -1
  49. package/lib/browser/app-tester-prompt-template.d.ts.map +1 -1
  50. package/lib/browser/app-tester-prompt-template.js +4 -6
  51. package/lib/browser/app-tester-prompt-template.js.map +1 -1
  52. package/lib/browser/architect-prompt-template.d.ts.map +1 -1
  53. package/lib/browser/architect-prompt-template.js +20 -3
  54. package/lib/browser/architect-prompt-template.js.map +1 -1
  55. package/lib/browser/chat-session-item.js +2 -1
  56. package/lib/browser/chat-session-item.js.map +1 -1
  57. package/lib/browser/chat-sessions-welcome-message-provider.js +1 -1
  58. package/lib/browser/chat-sessions-welcome-message-provider.js.map +1 -1
  59. package/lib/browser/code-reviewer-prompt-template.d.ts.map +1 -1
  60. package/lib/browser/code-reviewer-prompt-template.js +2 -1
  61. package/lib/browser/code-reviewer-prompt-template.js.map +1 -1
  62. package/lib/browser/commit-message-agent.spec.js +2 -1
  63. package/lib/browser/commit-message-agent.spec.js.map +1 -1
  64. package/lib/browser/commit-message-runner.spec.js +2 -1
  65. package/lib/browser/commit-message-runner.spec.js.map +1 -1
  66. package/lib/browser/context-file-validation-service-impl.spec.js +2 -1
  67. package/lib/browser/context-file-validation-service-impl.spec.js.map +1 -1
  68. package/lib/browser/explore-prompt-template.d.ts.map +1 -1
  69. package/lib/browser/explore-prompt-template.js +2 -1
  70. package/lib/browser/explore-prompt-template.js.map +1 -1
  71. package/lib/browser/file-changeset-functions.d.ts +3 -1
  72. package/lib/browser/file-changeset-functions.d.ts.map +1 -1
  73. package/lib/browser/file-changeset-functions.js +60 -6
  74. package/lib/browser/file-changeset-functions.js.map +1 -1
  75. package/lib/browser/file-changeset-functions.spec.js +73 -9
  76. package/lib/browser/file-changeset-functions.spec.js.map +1 -1
  77. package/lib/browser/frontend-module.js +4 -4
  78. package/lib/browser/frontend-module.js.map +1 -1
  79. package/lib/browser/git-changes-tool.d.ts +3 -3
  80. package/lib/browser/git-changes-tool.d.ts.map +1 -1
  81. package/lib/browser/git-changes-tool.js +7 -11
  82. package/lib/browser/git-changes-tool.js.map +1 -1
  83. package/lib/browser/git-changes-tool.spec.js +16 -3
  84. package/lib/browser/git-changes-tool.spec.js.map +1 -1
  85. package/lib/browser/multi-root-paths.spec.d.ts +2 -0
  86. package/lib/browser/multi-root-paths.spec.d.ts.map +1 -0
  87. package/lib/browser/multi-root-paths.spec.js +293 -0
  88. package/lib/browser/multi-root-paths.spec.js.map +1 -0
  89. package/lib/browser/remember-command-contribution.d.ts +2 -2
  90. package/lib/browser/remember-command-contribution.js +6 -6
  91. package/lib/browser/remember-command-contribution.js.map +1 -1
  92. package/lib/browser/review/pr-review-prompt-template.d.ts.map +1 -1
  93. package/lib/browser/review/pr-review-prompt-template.js +3 -2
  94. package/lib/browser/review/pr-review-prompt-template.js.map +1 -1
  95. package/lib/browser/task-context-file-storage-service.d.ts.map +1 -1
  96. package/lib/browser/task-context-file-storage-service.js +1 -2
  97. package/lib/browser/task-context-file-storage-service.js.map +1 -1
  98. package/lib/browser/task-context-file-storage-service.spec.d.ts +2 -0
  99. package/lib/browser/task-context-file-storage-service.spec.d.ts.map +1 -0
  100. package/lib/browser/task-context-file-storage-service.spec.js +111 -0
  101. package/lib/browser/task-context-file-storage-service.spec.js.map +1 -0
  102. package/lib/browser/user-interaction-tool-renderer.js +1 -1
  103. package/lib/browser/user-interaction-tool-renderer.js.map +1 -1
  104. package/lib/browser/user-interaction-tool.d.ts +12 -1
  105. package/lib/browser/user-interaction-tool.d.ts.map +1 -1
  106. package/lib/browser/user-interaction-tool.js +35 -9
  107. package/lib/browser/user-interaction-tool.js.map +1 -1
  108. package/lib/browser/user-interaction-tool.spec.js +15 -2
  109. package/lib/browser/user-interaction-tool.spec.js.map +1 -1
  110. package/lib/browser/workspace-functions.d.ts +20 -17
  111. package/lib/browser/workspace-functions.d.ts.map +1 -1
  112. package/lib/browser/workspace-functions.js +77 -115
  113. package/lib/browser/workspace-functions.js.map +1 -1
  114. package/lib/browser/workspace-functions.spec.js +54 -60
  115. package/lib/browser/workspace-functions.spec.js.map +1 -1
  116. package/lib/browser/workspace-launch-provider.js +1 -1
  117. package/lib/browser/workspace-launch-provider.js.map +1 -1
  118. package/lib/browser/workspace-launch-provider.spec.js +5 -3
  119. package/lib/browser/workspace-launch-provider.spec.js.map +1 -1
  120. package/lib/browser/workspace-search-provider.spec.js +2 -1
  121. package/lib/browser/workspace-search-provider.spec.js.map +1 -1
  122. package/lib/browser/workspace-task-provider.js +1 -1
  123. package/lib/browser/workspace-task-provider.js.map +1 -1
  124. package/lib/browser/workspace-task-provider.spec.js +6 -4
  125. package/lib/browser/workspace-task-provider.spec.js.map +1 -1
  126. package/lib/common/agents-md-prompt-template.d.ts +6 -0
  127. package/lib/common/agents-md-prompt-template.d.ts.map +1 -0
  128. package/lib/common/agents-md-prompt-template.js +165 -0
  129. package/lib/common/agents-md-prompt-template.js.map +1 -0
  130. package/lib/common/coder-replace-prompt-template.d.ts.map +1 -1
  131. package/lib/common/coder-replace-prompt-template.js +4 -6
  132. package/lib/common/coder-replace-prompt-template.js.map +1 -1
  133. package/lib/common/command-prompt-template.js +1 -1
  134. package/lib/common/command-prompt-template.js.map +1 -1
  135. package/lib/common/orchestrator-prompt-template.js +1 -1
  136. package/lib/common/orchestrator-prompt-template.js.map +1 -1
  137. package/lib/common/universal-prompt-template.js +1 -1
  138. package/lib/common/universal-prompt-template.js.map +1 -1
  139. package/lib/common/workspace-preferences.d.ts +1 -0
  140. package/lib/common/workspace-preferences.d.ts.map +1 -1
  141. package/lib/common/workspace-preferences.js +10 -1
  142. package/lib/common/workspace-preferences.js.map +1 -1
  143. package/lib/package.spec.js +1 -0
  144. package/lib/package.spec.js.map +1 -1
  145. package/package.json +27 -28
  146. package/src/browser/{project-info-agent.ts → agents-md-agent.ts} +11 -10
  147. package/src/browser/ai-configuration/categories/agent-capabilities-settings.spec.ts +508 -2
  148. package/src/browser/ai-configuration/categories/agent-capabilities-settings.tsx +92 -33
  149. package/src/browser/ai-configuration/categories/agent-detail-model.spec.ts +78 -0
  150. package/src/browser/ai-configuration/categories/agent-detail-model.ts +18 -0
  151. package/src/browser/ai-configuration/categories/agent-detail-view.tsx +15 -12
  152. package/src/browser/ai-configuration/categories/agents-configuration-category.tsx +18 -3
  153. package/src/browser/ai-configuration/categories/provider-model-discovery-section.tsx +3 -3
  154. package/src/browser/ai-configuration/categories/token-usage-configuration-category.tsx +2 -2
  155. package/src/browser/ai-configuration/language-model-renderer.spec.ts +38 -0
  156. package/src/browser/ai-configuration/language-model-renderer.tsx +6 -15
  157. package/src/browser/app-tester-prompt-template.ts +4 -7
  158. package/src/browser/architect-prompt-template.ts +4 -4
  159. package/src/browser/code-reviewer-prompt-template.ts +2 -2
  160. package/src/browser/context-file-validation-service-impl.spec.ts +2 -1
  161. package/src/browser/explore-prompt-template.ts +2 -2
  162. package/src/browser/file-changeset-functions.spec.ts +91 -9
  163. package/src/browser/file-changeset-functions.ts +62 -7
  164. package/src/browser/frontend-module.ts +4 -4
  165. package/src/browser/git-changes-tool.spec.ts +16 -1
  166. package/src/browser/git-changes-tool.ts +6 -10
  167. package/src/browser/multi-root-paths.spec.ts +340 -0
  168. package/src/browser/remember-command-contribution.ts +7 -7
  169. package/src/browser/review/pr-review-prompt-template.ts +3 -3
  170. package/src/browser/style/index.css +15 -0
  171. package/src/browser/task-context-file-storage-service.spec.ts +125 -0
  172. package/src/browser/task-context-file-storage-service.ts +3 -4
  173. package/src/browser/user-interaction-tool.spec.ts +18 -1
  174. package/src/browser/user-interaction-tool.ts +34 -9
  175. package/src/browser/workspace-functions.spec.ts +54 -60
  176. package/src/browser/workspace-functions.ts +80 -125
  177. package/src/browser/workspace-launch-provider.spec.ts +3 -2
  178. package/src/browser/workspace-task-provider.spec.ts +4 -3
  179. package/src/common/{project-info-prompt-template.ts → agents-md-prompt-template.ts} +54 -46
  180. package/src/common/coder-replace-prompt-template.ts +5 -7
  181. package/src/common/command-prompt-template.ts +1 -1
  182. package/src/common/orchestrator-prompt-template.ts +1 -1
  183. package/src/common/universal-prompt-template.ts +1 -1
  184. package/src/common/workspace-preferences.ts +10 -0
  185. package/lib/browser/project-info-agent.d.ts.map +0 -1
  186. package/lib/browser/project-info-agent.js.map +0 -1
  187. package/lib/common/project-info-prompt-template.d.ts +0 -6
  188. package/lib/common/project-info-prompt-template.d.ts.map +0 -1
  189. package/lib/common/project-info-prompt-template.js +0 -146
  190. package/lib/common/project-info-prompt-template.js.map +0 -1
@@ -86,7 +86,6 @@ export class WorkspaceFunctionScope {
86
86
  private gitignoreMatchers = new Map<string, ReturnType<typeof ignore> | undefined>();
87
87
  private gitignoreWatchersInitialized = new Set<string>();
88
88
 
89
- private _rootMapping: Map<string, URI> | undefined;
90
89
  private _allRootUris: URI[] | undefined;
91
90
 
92
91
  private homeDirUri: Promise<URI | undefined> | undefined;
@@ -96,7 +95,6 @@ export class WorkspaceFunctionScope {
96
95
  @postConstruct()
97
96
  protected init(): void {
98
97
  this.workspaceService.onWorkspaceChanged(() => {
99
- this._rootMapping = undefined;
100
98
  this._allRootUris = undefined;
101
99
  });
102
100
  }
@@ -114,56 +112,21 @@ export class WorkspaceFunctionScope {
114
112
  }
115
113
 
116
114
  /**
117
- * Returns a mapping of root names to root URIs.
115
+ * Returns a mapping of root names to root URIs, in workspace order.
118
116
  *
119
- * Root names are always the directory basename. When multiple roots share the
120
- * same basename, only the first (by URI sort order) is addressable by name —
121
- * the others are still reachable via the `resolveRelativePath` supra-relative
122
- * check (which examines path segments against all roots).
123
- *
124
- * **Known limitation:** duplicate basenames are not disambiguated with synthetic
125
- * suffixes because agents observe real filesystem paths in terminal output,
126
- * compiler errors, stack traces, etc. Synthetic names like `app-1` would
127
- * conflict with those observations and cause more confusion than they solve.
128
- * A future improvement could let users assign display names to roots.
117
+ * Root names are assigned by {@link WorkspaceService.getRootNames}: the directory basename, or for
118
+ * roots sharing a basename, the shortest tail of the path that tells them apart (e.g. `alice/app`
119
+ * and `bob/app`). Every root thus has a name, and names are always the ending of the real path.
129
120
  */
130
121
  getRootMapping(): Map<string, URI> {
131
- if (this._rootMapping) {
132
- return this._rootMapping;
133
- }
134
-
135
- const wsRoots = this.workspaceService.tryGetRoots();
136
- const sortedRoots = [...wsRoots].sort((a, b) => a.resource.toString().localeCompare(b.resource.toString()));
137
- const mapping = new Map<string, URI>();
138
-
139
- for (const root of sortedRoots) {
140
- const basename = root.resource.path.base;
141
- if (mapping.has(basename)) {
142
- this.logger.debug(
143
- `Multiple workspace roots share the basename '${basename}'. ` +
144
- `Only '${mapping.get(basename)!.toString()}' is addressable as '${basename}'. ` +
145
- `'${root.resource.toString()}' can still be accessed but may require full paths.`
146
- );
147
- continue;
148
- }
149
- mapping.set(basename, root.resource);
150
- }
151
-
152
- this._rootMapping = mapping;
153
- return mapping;
122
+ return new Map(this.workspaceService.getRootNames());
154
123
  }
155
124
 
156
125
  /**
157
- * Returns the root name for a given root URI based on the cached mapping.
126
+ * Returns the root name for a given root URI, see {@link WorkspaceService.getRootName}.
158
127
  */
159
128
  getRootName(rootUri: URI): string | undefined {
160
- const mapping = this.getRootMapping();
161
- for (const [name, uri] of mapping) {
162
- if (uri.toString() === rootUri.toString()) {
163
- return name;
164
- }
165
- }
166
- return undefined;
129
+ return this.workspaceService.getRootName(rootUri);
167
130
  }
168
131
 
169
132
  /**
@@ -185,26 +148,11 @@ export class WorkspaceFunctionScope {
185
148
  }
186
149
 
187
150
  /**
188
- * Converts a URI to a workspace-relative path with root name prefix.
151
+ * Converts a URI to a workspace-relative path with root name prefix, see {@link WorkspaceService.getRootPrefixedPath}.
189
152
  * Format: <rootName>/<relativePath>
190
153
  */
191
154
  toWorkspaceRelativePath(uri: URI): string | undefined {
192
- const containingRoot = this.getContainingRoot(uri);
193
- if (!containingRoot) {
194
- return undefined;
195
- }
196
-
197
- const rootName = this.getRootName(containingRoot);
198
- if (!rootName) {
199
- return undefined;
200
- }
201
-
202
- const relativePath = containingRoot.relative(uri);
203
- if (!relativePath || relativePath.toString() === '') {
204
- return rootName; // URI is the root itself
205
- }
206
-
207
- return `${rootName}/${relativePath.toString()}`;
155
+ return this.getContainingRoot(uri) ? this.workspaceService.getRootPrefixedPath(uri) : undefined;
208
156
  }
209
157
 
210
158
  // ── Path resolution ─────────────────────────────────────────────────
@@ -215,57 +163,33 @@ export class WorkspaceFunctionScope {
215
163
  * format. If the path cannot be resolved deterministically, an error is thrown.
216
164
  *
217
165
  * Resolution order:
218
- * 1. Root+relative: first segment matches a root name → resolve rest relative to that root.
166
+ * 1. Root+relative: the path starts with a root name → resolve the rest relative to that root.
219
167
  * 2. Supra-relative: a root's basename appears as a segment, and any preceding material
220
168
  * matches the preceding path components of the root → resolve the trailing portion.
169
+ * If this matches different files in several roots, the path is ambiguous.
221
170
  * 3. Single-root fallback: if exactly one workspace root, resolve relative to it.
222
171
  * 4. Error: tell the agent how to format the path.
223
172
  */
224
173
  resolveRelativePath(relativePath: string): URI {
225
174
  const normalizedPath = new Path(Path.normalizePathSeparator(relativePath)).normalize().toString();
226
- const mapping = this.getRootMapping();
227
175
  const roots = this.getAllRootUris();
228
- const segments = normalizedPath.split('/');
229
176
 
230
177
  // Phase 1 — Root+relative check:
231
- if (segments.length > 0) {
232
- const potentialRootName = segments[0];
233
- const rootUri = mapping.get(potentialRootName);
234
- if (rootUri) {
235
- const restOfPath = segments.slice(1).join('/');
236
- return restOfPath ? rootUri.resolve(restOfPath) : rootUri;
237
- }
178
+ const rootRelative = this.workspaceService.resolveRootPrefixedPath(normalizedPath);
179
+ if (rootRelative) {
180
+ return rootRelative;
238
181
  }
239
182
 
240
183
  // Phase 2 — Supra-relative check:
241
- for (const rootUri of roots) {
242
- const rootBasename = rootUri.path.base;
243
- for (let i = 0; i < segments.length; i++) {
244
- if (segments[i] !== rootBasename) {
245
- continue;
246
- }
247
- const rootPathSegments = rootUri.path.toString().split('/').filter(s => s.length > 0);
248
- const rootPrecedingSegments = rootPathSegments.slice(0, rootPathSegments.length - 1);
249
- const pathPrecedingSegments = segments.slice(0, i);
250
-
251
- let matches = true;
252
- if (pathPrecedingSegments.length > rootPrecedingSegments.length) {
253
- matches = false;
254
- } else {
255
- const rootTail = rootPrecedingSegments.slice(rootPrecedingSegments.length - pathPrecedingSegments.length);
256
- for (let j = 0; j < pathPrecedingSegments.length; j++) {
257
- if (pathPrecedingSegments[j] !== rootTail[j]) {
258
- matches = false;
259
- break;
260
- }
261
- }
262
- }
263
-
264
- if (matches) {
265
- const restOfPath = segments.slice(i + 1).join('/');
266
- return restOfPath ? rootUri.resolve(restOfPath) : rootUri;
267
- }
268
- }
184
+ const candidates = this.workspaceService.resolveSupraRelativePath(normalizedPath);
185
+ if (candidates.length === 1) {
186
+ return candidates[0];
187
+ }
188
+ if (candidates.length > 1) {
189
+ throw new Error(
190
+ `Path '${relativePath}' is ambiguous in this multi-root workspace. ` +
191
+ `Prefix it with one of the workspace root names: ${this.describeRoots()}`
192
+ );
269
193
  }
270
194
 
271
195
  // Phase 3 — Single-root fallback:
@@ -274,13 +198,19 @@ export class WorkspaceFunctionScope {
274
198
  }
275
199
 
276
200
  // Phase 4 — Error:
277
- const rootNames = Array.from(mapping.keys());
278
201
  throw new Error(
279
202
  `Could not resolve path '${relativePath}'. In a multi-root workspace, prefix paths with the workspace root name ` +
280
- `(e.g., 'rootName/path/to/file'). Available roots: ${rootNames.join(', ')}`
203
+ `(e.g., 'rootName/path/to/file'). Available roots: ${this.describeRoots()}`
281
204
  );
282
205
  }
283
206
 
207
+ /**
208
+ * Lists the workspace root names with their locations, for error messages.
209
+ */
210
+ protected describeRoots(): string {
211
+ return Array.from(this.getRootMapping(), ([name, uri]) => `${name} (${uri.path.fsPath()})`).join(', ');
212
+ }
213
+
284
214
  async resolveToUri(pathOrUri: string | URI): Promise<URI | undefined> {
285
215
  if (pathOrUri instanceof URI) {
286
216
  return pathOrUri;
@@ -658,7 +588,8 @@ export class GetWorkspaceDirectoryStructure implements ToolProvider {
658
588
  properties: {
659
589
  root: {
660
590
  type: 'string',
661
- description: 'Optional absolute path or `file://` URI to inspect instead of the workspace. ' +
591
+ description: 'Optional directory to inspect instead of the whole workspace: a workspace-relative path (\'rootName/path\'), ' +
592
+ 'an absolute path or a `file://` URI. ' +
662
593
  'Must point to a directory the tools may access, such as one listed in the `allowedExternalPaths` preference. ' +
663
594
  'When omitted, all workspace roots are returned.'
664
595
  }
@@ -1309,6 +1240,9 @@ export class FindFilesByPattern implements ToolProvider {
1309
1240
  @inject(FileSearchService)
1310
1241
  protected readonly fileSearchService: FileSearchService;
1311
1242
 
1243
+ @inject(WorkspaceService)
1244
+ protected readonly workspaceService: WorkspaceService;
1245
+
1312
1246
  getTool(): ToolRequest {
1313
1247
  return {
1314
1248
  id: FindFilesByPattern.ID,
@@ -1327,23 +1261,27 @@ export class FindFilesByPattern implements ToolProvider {
1327
1261
  properties: {
1328
1262
  pattern: {
1329
1263
  type: 'string',
1330
- description: 'Glob pattern to match files against. ' +
1264
+ description: 'Glob pattern to match files against, relative to each workspace root. ' +
1265
+ 'Start it with a root name, as in the returned paths, to match it relative to that root as well. ' +
1331
1266
  'Examples: \'**/*.ts\' (all TypeScript files), \'src/**/*.js\' (JS files in src), ' +
1267
+ '\'my-project/src/**/*.js\' (JS files in src of the my-project root, or in my-project/src of any root), ' +
1332
1268
  '\'**/*.{js,ts}\' (JS or TS files), \'**/test/**/*.spec.ts\' (test files).'
1333
1269
  },
1334
1270
  exclude: {
1335
1271
  type: 'array',
1336
1272
  items: { type: 'string' },
1337
- description: 'Optional glob patterns to exclude. ' +
1273
+ description: 'Optional glob patterns to exclude, relative to each workspace root or starting with a root name. ' +
1338
1274
  'Examples: [\'**/*.spec.ts\', \'**/node_modules/**\']. ' +
1339
1275
  'Common exclusions (node_modules, .git) are applied automatically via gitignore.'
1340
1276
  },
1341
1277
  searchRoot: {
1342
1278
  type: 'string',
1343
- description: 'Optional absolute path or `file://` URI to search instead of the workspace. ' +
1279
+ description: 'Optional directory to search instead of the whole workspace: a workspace-relative path ' +
1280
+ '(\'rootName/path\'), an absolute path or a `file://` URI. ' +
1344
1281
  'Must point to a directory the tools may access, such as one listed in the `allowedExternalPaths` preference. ' +
1345
- 'When set, results are returned as absolute paths so they can be passed back to getFileContent. ' +
1346
- 'When omitted (default), all workspace roots are searched and results are workspace-relative.'
1282
+ 'Results in the workspace are workspace-relative, results outside of it are absolute paths, ' +
1283
+ 'so they can be passed back to getFileContent. ' +
1284
+ 'When omitted (default), all workspace roots are searched.'
1347
1285
  }
1348
1286
  },
1349
1287
  required: ['pattern']
@@ -1385,54 +1323,59 @@ export class FindFilesByPattern implements ToolProvider {
1385
1323
  const maxResults = 200;
1386
1324
  const useGitIgnore = this.preferences.get(CONSIDER_GITIGNORE_PREF, true);
1387
1325
  const userExcludes = this.preferences.get<string[]>(USER_EXCLUDE_PATTERN_PREF, []);
1388
- const excludes = [...userExcludes, ...(excludePatterns ?? [])];
1389
1326
 
1390
1327
  // Resolve the set of roots to search and how each root's results should be rendered.
1391
- const targets: { rootUri: URI; rootName?: string; external: boolean }[] = [];
1328
+ const targets: { rootUri: URI; rootName?: string; external: boolean; patterns: string[] }[] = [];
1392
1329
  if (searchRoot) {
1393
1330
  const resolved = await this.workspaceScope.resolveAccessiblePath(searchRoot);
1394
- targets.push({ rootUri: resolved, external: !this.workspaceScope.isInWorkspace(resolved) });
1331
+ targets.push({ rootUri: resolved, external: !this.workspaceScope.isInWorkspace(resolved), patterns: [pattern] });
1395
1332
  } else {
1396
1333
  const rootMapping = this.workspaceScope.getRootMapping();
1397
1334
  if (rootMapping.size === 0) {
1398
1335
  return JSON.stringify({ error: 'No workspace has been opened yet' });
1399
1336
  }
1400
1337
  for (const [rootName, rootUri] of rootMapping) {
1401
- targets.push({ rootUri, rootName, external: false });
1338
+ targets.push({ rootUri, rootName, external: false, patterns: this.globsForRoot([pattern], rootUri) });
1402
1339
  }
1403
1340
  }
1404
1341
 
1405
1342
  // Delegate the actual traversal to the backend ripgrep-based file search.
1406
1343
  // It runs natively on the backend filesystem (no per-directory RPC) and applies
1407
1344
  // include/exclude globs.
1408
- const files: string[] = [];
1345
+ // A file in a nested root is found in the outer root as well, if the glob matches it relative to either.
1346
+ const found = new Map<string, { uri: URI; display: string }>();
1409
1347
  for (const target of targets) {
1410
1348
  if (cancellationToken?.isCancellationRequested) {
1411
1349
  return JSON.stringify({ error: 'Operation cancelled by user' });
1412
1350
  }
1413
- if (files.length > maxResults) {
1351
+ if (found.size > maxResults) {
1414
1352
  break;
1415
1353
  }
1354
+ const excludes = [...userExcludes, ...this.globsForRoot(excludePatterns ?? [], target.rootUri)];
1416
1355
  // `considerGitIgnore` is scoped to workspace roots (see its preference description),
1417
1356
  // so external allow-listed roots are searched with user/caller excludes only (plus
1418
1357
  // `.git`). Applying gitignore there would also leak the user's *global* gitignore
1419
1358
  // into an explicitly allow-listed directory and silently hide files.
1420
- // Request one extra result across all roots so we can detect truncation.
1359
+ // Request one extra result across all roots so we can detect truncation, besides the files
1360
+ // of this root that were found in a nested or outer root already.
1361
+ const foundInRoot = Array.from(found.values()).filter(file => target.rootUri.isEqualOrParent(file.uri)).length;
1421
1362
  const matches = await this.fileSearchService.find('', {
1422
1363
  rootUris: [target.rootUri.toString()],
1423
- includePatterns: [pattern],
1364
+ includePatterns: target.patterns,
1424
1365
  excludePatterns: target.external ? [...excludes, '.git'] : excludes,
1425
1366
  useGitIgnore: target.external ? false : useGitIgnore,
1426
1367
  fuzzyMatch: false,
1427
- limit: maxResults - files.length + 1
1368
+ limit: maxResults - found.size + 1 + foundInRoot
1428
1369
  }, cancellationToken);
1429
1370
  for (const match of matches) {
1430
- const display = this.toDisplayPath(new URI(match), target);
1371
+ const matchUri = new URI(match);
1372
+ const display = this.toDisplayPath(matchUri, target);
1431
1373
  if (display !== undefined) {
1432
- files.push(display);
1374
+ found.set(matchUri.toString(), { uri: matchUri, display });
1433
1375
  }
1434
1376
  }
1435
1377
  }
1378
+ const files = Array.from(found.values(), file => file.display);
1436
1379
 
1437
1380
  if (cancellationToken?.isCancellationRequested) {
1438
1381
  return JSON.stringify({ error: 'Operation cancelled by user' });
@@ -1452,19 +1395,31 @@ export class FindFilesByPattern implements ToolProvider {
1452
1395
  }
1453
1396
  }
1454
1397
 
1398
+ /**
1399
+ * Returns the caller's globs to match relative to the given root. A glob is relative to every root,
1400
+ * and if it starts with the name of this root, e.g. `backend/src/**\/*.ts` as in the paths this tool
1401
+ * returns, its rest is relative to this root as well, as the caller may mean either.
1402
+ */
1403
+ protected globsForRoot(globs: string[], rootUri: URI): string[] {
1404
+ const result: string[] = [];
1405
+ for (const glob of globs) {
1406
+ result.push(glob);
1407
+ const rootPrefixed = this.workspaceService.splitRootPrefixedPath(glob);
1408
+ if (rootPrefixed?.rest && rootPrefixed.rootUri.isEqual(rootUri)) {
1409
+ result.push(rootPrefixed.rest);
1410
+ }
1411
+ }
1412
+ return result;
1413
+ }
1414
+
1455
1415
  /**
1456
1416
  * Renders a search-result URI in the format expected by the caller: an absolute
1457
- * path for external roots, or a `<rootName>/<relativePath>` (or bare relative
1458
- * path when no root name is available) for workspace roots.
1417
+ * path for external roots, or a `<rootName>/<relativePath>` for workspace roots.
1459
1418
  */
1460
1419
  protected toDisplayPath(match: URI, target: { rootUri: URI; rootName?: string; external: boolean }): string | undefined {
1461
1420
  if (target.external) {
1462
1421
  return match.path.fsPath();
1463
1422
  }
1464
- const relativePath = target.rootUri.relative(match)?.toString();
1465
- if (relativePath === undefined) {
1466
- return undefined;
1467
- }
1468
- return target.rootName ? `${target.rootName}/${relativePath}` : relativePath;
1423
+ return this.workspaceScope.toWorkspaceRelativePath(match) ?? match.path.fsPath();
1469
1424
  }
1470
1425
  }
@@ -40,6 +40,7 @@ import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
40
40
  import { WorkspaceService } from '@theia/workspace/lib/browser';
41
41
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
42
42
  import { MockLogger } from '@theia/core/lib/common/test/mock-logger';
43
+ import { withWorkspaceServiceDefaults } from '@theia/workspace/lib/browser/test/with-workspace-service-defaults';
43
44
 
44
45
  const makeTrustAwareReader = (): AiConfigurationService => ({
45
46
  get: <T>(_name: string, fallback?: T) => fallback,
@@ -87,7 +88,7 @@ describe('Launch Management Tool Providers', () => {
87
88
  onWorkspaceChanged: () => ({ dispose: () => { } })
88
89
  } as unknown as WorkspaceService;
89
90
 
90
- container.bind(WorkspaceService).toConstantValue(mockWorkspaceService);
91
+ container.bind(WorkspaceService).toConstantValue(withWorkspaceServiceDefaults(mockWorkspaceService));
91
92
  container.bind(FileService).toConstantValue({} as FileService);
92
93
  container.bind(PreferenceService).toConstantValue({ get: () => false } as unknown as PreferenceService);
93
94
  container.bind(AiConfigurationService).toConstantValue(makeTrustAwareReader());
@@ -396,7 +397,7 @@ describe('Launch Management Tool Providers', () => {
396
397
  onWorkspaceChanged: () => ({ dispose: () => { } })
397
398
  } as unknown as WorkspaceService;
398
399
 
399
- multiRootContainer.bind(WorkspaceService).toConstantValue(multiRootWorkspaceService);
400
+ multiRootContainer.bind(WorkspaceService).toConstantValue(withWorkspaceServiceDefaults(multiRootWorkspaceService));
400
401
  multiRootContainer.bind(FileService).toConstantValue({} as FileService);
401
402
  multiRootContainer.bind(PreferenceService).toConstantValue({ get: () => false } as unknown as PreferenceService);
402
403
  multiRootContainer.bind(AiConfigurationService).toConstantValue(makeTrustAwareReader());
@@ -29,6 +29,7 @@ import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
29
29
  import { WorkspaceService } from '@theia/workspace/lib/browser';
30
30
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
31
31
  import { MockLogger } from '@theia/core/lib/common/test/mock-logger';
32
+ import { withWorkspaceServiceDefaults } from '@theia/workspace/lib/browser/test/with-workspace-service-defaults';
32
33
 
33
34
  const makeTrustAwareReader = (): AiConfigurationService => ({
34
35
  get: <T>(_name: string, fallback?: T) => fallback,
@@ -127,7 +128,7 @@ describe('Workspace Task Provider Cancellation Tests', () => {
127
128
  // Register mocks in the container
128
129
  container.bind(TaskService).toConstantValue(mockTaskService);
129
130
  container.bind(TerminalService).toConstantValue(mockTerminalService);
130
- container.bind(WorkspaceService).toConstantValue(mockWorkspaceService);
131
+ container.bind(WorkspaceService).toConstantValue(withWorkspaceServiceDefaults(mockWorkspaceService));
131
132
  container.bind(FileService).toConstantValue({} as FileService);
132
133
  container.bind(PreferenceService).toConstantValue({ get: () => false } as unknown as PreferenceService);
133
134
  container.bind(AiConfigurationService).toConstantValue(makeTrustAwareReader());
@@ -361,7 +362,7 @@ describe('Workspace Task Provider Cancellation Tests', () => {
361
362
 
362
363
  multiRootContainer.bind(TaskService).toConstantValue(multiRootTaskService);
363
364
  multiRootContainer.bind(TerminalService).toConstantValue(mockTerminalService);
364
- multiRootContainer.bind(WorkspaceService).toConstantValue(multiRootWorkspaceService);
365
+ multiRootContainer.bind(WorkspaceService).toConstantValue(withWorkspaceServiceDefaults(multiRootWorkspaceService));
365
366
  multiRootContainer.bind(FileService).toConstantValue({} as FileService);
366
367
  multiRootContainer.bind(PreferenceService).toConstantValue({ get: () => false } as unknown as PreferenceService);
367
368
  multiRootContainer.bind(AiConfigurationService).toConstantValue(makeTrustAwareReader());
@@ -409,7 +410,7 @@ describe('Workspace Task Provider Cancellation Tests', () => {
409
410
 
410
411
  multiRootContainer.bind(TaskService).toConstantValue(multiRootTaskService);
411
412
  multiRootContainer.bind(TerminalService).toConstantValue(mockTerminalService);
412
- multiRootContainer.bind(WorkspaceService).toConstantValue(multiRootWorkspaceService);
413
+ multiRootContainer.bind(WorkspaceService).toConstantValue(withWorkspaceServiceDefaults(multiRootWorkspaceService));
413
414
  multiRootContainer.bind(FileService).toConstantValue({} as FileService);
414
415
  multiRootContainer.bind(PreferenceService).toConstantValue({ get: () => false } as unknown as PreferenceService);
415
416
  multiRootContainer.bind(AiConfigurationService).toConstantValue(makeTrustAwareReader());
@@ -1,4 +1,4 @@
1
- /* eslint-disable @typescript-eslint/tslint/config */
1
+ /* eslint-disable @theia/file-header */
2
2
  // *****************************************************************************
3
3
  // Copyright (C) 2025 EclipseSource GmbH and others.
4
4
  //
@@ -8,7 +8,7 @@
8
8
  //
9
9
  // SPDX-License-Identifier: MIT
10
10
  // *****************************************************************************
11
- import { PromptVariantSet } from '@theia/ai-core/lib/common';
11
+ import { AGENTS_MD_FILE_NAME, PromptVariantSet } from '@theia/ai-core/lib/common';
12
12
  import {
13
13
  GET_WORKSPACE_FILE_LIST_FUNCTION_ID, FILE_CONTENT_FUNCTION_ID, SEARCH_IN_WORKSPACE_FUNCTION_ID,
14
14
  FIND_FILES_BY_PATTERN_FUNCTION_ID
@@ -22,65 +22,69 @@ import {
22
22
  CLEAR_FILE_CHANGES_ID
23
23
  } from './file-changeset-function-ids';
24
24
 
25
- export const PROJECT_INFO_SYSTEM_PROMPT_TEMPLATE_ID = 'project-info-system';
26
- export const PROJECT_INFO_TEMPLATE_PROMPT_ID = 'project-info-template';
25
+ export const AGENTS_MD_SYSTEM_PROMPT_TEMPLATE_ID = 'agents-md-system';
26
+ export const AGENTS_MD_TEMPLATE_PROMPT_ID = 'agents-md-template';
27
27
 
28
- export const projectInfoTemplateVariants = <PromptVariantSet>{
29
- id: PROJECT_INFO_TEMPLATE_PROMPT_ID,
28
+ export const agentsMdTemplateVariants = <PromptVariantSet>{
29
+ id: AGENTS_MD_TEMPLATE_PROMPT_ID,
30
30
  defaultVariant: {
31
- id: 'project-info-template-default',
32
- template: `## Project Info Template Structure
31
+ id: 'agents-md-template-default',
32
+ template: `## ${AGENTS_MD_FILE_NAME} Structure
33
33
 
34
- ### Architecture Overview
35
- [Brief description of what the project does, Key architectural decisions, patterns, and structure.]
34
+ ${AGENTS_MD_FILE_NAME} is schema-free Markdown; these headings are a starting point, not a contract.
35
+ Drop any section the project has nothing non-obvious to say about.
36
36
 
37
- ### Key Technologies
38
- [List of main technologies, frameworks, libraries]
39
-
40
- ### Essential Development Patterns
41
- Examples for key patterns (refer via relative file paths)
37
+ ### Project Overview
38
+ [What the project does, and the key architectural decisions and patterns that shape it.]
42
39
 
43
- ### File Structure
44
- [Important directories/packages and their contents]
40
+ ### Key Technologies
41
+ [Main technologies, frameworks and libraries, with the versions that matter.]
45
42
 
46
43
  ### Build & Development
47
- [How to build and run the project.]
44
+ [How to build, run and debug the project. Exact commands.]
48
45
 
49
46
  ### Testing
50
- [What kind of tests exist, test organization and test patterns. Examples for different types of tests (as relative file paths)]
47
+ [Which kinds of tests exist, how they are organized and how to run a single one. Examples as relative file paths.]
51
48
 
52
- ### Coding Guidelines
53
- [Coding standards, conventions, practices. Examples for key practices (as relative file paths), rules for imports, indentation]
49
+ ### Code Style
50
+ [Coding standards, conventions and practices. Rules for imports and formatting. Examples as relative file paths.]
51
+
52
+ ### Project Structure
53
+ [Important directories and packages, and what belongs in each.]
54
+
55
+ ### Essential Patterns
56
+ [Project-specific patterns an agent has to follow, each pointing at an example via a relative file path.]
54
57
 
55
58
  ### Additional Notes
56
- [Any other important information for agents to understand the project and write code for it. Important files with more information (as relative file paths)]
57
- \`\`\`
59
+ [Anything else needed to understand the project and write code for it, including further documentation as relative file paths.]
58
60
  `
59
61
  }
60
62
  };
61
63
 
62
- export const projectInfoSystemVariants = <PromptVariantSet>{
63
- id: PROJECT_INFO_SYSTEM_PROMPT_TEMPLATE_ID,
64
+ export const agentsMdSystemVariants = <PromptVariantSet>{
65
+ id: AGENTS_MD_SYSTEM_PROMPT_TEMPLATE_ID,
64
66
  defaultVariant: {
65
- id: 'project-info-system-default',
67
+ id: 'agents-md-system-default',
66
68
  template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
67
69
  Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
68
70
  https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
69
71
  # Instructions
70
72
 
71
- You are the ProjectInfo agent, an AI assistant specialized in managing project information files. Your role is to help users create, update,
72
- and maintain the \`.prompts/project-info.prompttemplate\` file which provides contextual information about the project to other AI agents.
73
+ You are the ${AGENTS_MD_FILE_NAME} agent, an AI assistant specialized in project context for AI agents. Your role is to help users create, update
74
+ and maintain the \`${AGENTS_MD_FILE_NAME}\` file at the root of the workspace, which follows the open [${AGENTS_MD_FILE_NAME} standard](https://agents.md/)
75
+ and provides project context to other AI agents. Because it is a standard, the file you produce is also read by other agentic tools the user may
76
+ use on the same repository — write it for agents in general, not for one particular tool.
73
77
 
74
- ## Project Info Guidelines
75
- The project info is an artifact that will be handed over to agents to understand the current workspace, project and codebase.
78
+ ## ${AGENTS_MD_FILE_NAME} Guidelines
79
+ ${AGENTS_MD_FILE_NAME} is handed to agents so they understand the current workspace, project and codebase.
76
80
  Do not include obvious instructions, generic information, generic development practices or things that can be very easily discovered.
77
81
  Focus on non-obvious and project-specific facts as well as specific guidelines and patterns.
78
- Try to keep the project info minimal and avoid duplicates.
82
+ Keep it minimal and avoid duplicates: every line costs context in every session that reads it.
79
83
 
80
84
  ## Your Capabilities
81
85
 
82
- ### Initially Create Project Info
83
- For initial project info creation, start by determining the user's preferred working mode:
86
+ ### Initially Create ${AGENTS_MD_FILE_NAME}
87
+ For initial creation, start by determining the user's preferred working mode:
84
88
 
85
89
  **Step 1: Define mode of working**
86
90
  Ask the user about the preferred working mode:
@@ -90,32 +94,32 @@ Ask the user about the preferred working mode:
90
94
 
91
95
  IMPORTANT: Remember the chosen mode and stick to it until the user requests otherwise!
92
96
 
93
- - In automatic mode, create an initial version of the project info yourself by exploring the workspace
97
+ - In automatic mode, create an initial version yourself by exploring the workspace
94
98
  - In manual mode, guide the user section by section and ask for additional information.
95
99
  Whenever you ask a question to the user, offer the option that you answer the question for them.
96
100
 
97
101
  **Step 2: Final tasks**
98
102
  After completing all sections or if you feel the user is done, offer the user to do an automatic refinement:
99
- "Would you like me to review and finalize the project information?",
100
- - In this final refinement, particularly focus on relevance and potential duplications and the "Project Info Guidelines"
103
+ "Would you like me to review and finalize the ${AGENTS_MD_FILE_NAME}?",
104
+ - In this final refinement, particularly focus on relevance and potential duplications and the "${AGENTS_MD_FILE_NAME} Guidelines"
101
105
  - Then, ask for final user review. Tell the user to provide any generic feedback and offer to incorporate it for them.
102
106
  - Finally remind them to accept the final version in the change set
103
107
 
104
- ### Complete Project Info
105
- - If a project info is incomplete, offer the user to complete it
108
+ ### Complete ${AGENTS_MD_FILE_NAME}
109
+ - If the file is incomplete, offer the user to complete it
106
110
 
107
- ### Update Project Info
108
- - Modify existing project info based on user requirements
111
+ ### Update ${AGENTS_MD_FILE_NAME}
112
+ - Modify the existing file based on user requirements
109
113
  - Do not use a specific workflow for this
110
114
 
111
115
  ## Workspace Analysis Guidelines
112
116
 
113
117
  **Auto-Discovery File Patterns**
114
118
  When auto-discovering project information or exploring the workspace structure, ALWAYS prioritize examining these file patterns that commonly contain agent instructions
115
- and project documentation:
119
+ and project documentation. Where a project already maintains one of them, treat it as a source to consolidate into \`${AGENTS_MD_FILE_NAME}\`,
120
+ and tell the user which files you drew from so they can decide whether to keep them:
116
121
  - .github/copilot-instructions.md
117
122
  - AGENT.md
118
- - AGENTS.md
119
123
  - CLAUDE.md
120
124
  - .cursorrules
121
125
  - .windsurfrules
@@ -140,13 +144,17 @@ Navigate step-by-step and confirm paths. Use **~{${UPDATE_CONTEXT_FILES_FUNCTION
140
144
 
141
145
  ## File Modification - SUGGEST ONLY
142
146
  Use these functions liberally to suggest file changes. All changes require user review and approval, so the user can reject them if needed.
147
+ Always target \`${AGENTS_MD_FILE_NAME}\` at the root of the workspace root the user is working in.
143
148
 
144
- - **~{${SUGGEST_FILE_CONTENT_ID}}**: Propose complete file content (for creating new templates or complete rewrites)
149
+ - **~{${SUGGEST_FILE_CONTENT_ID}}**: Propose complete file content (for creating a new file or complete rewrites)
145
150
  - **~{${SUGGEST_FILE_REPLACEMENTS_ID}}**: Propose targeted replacements of specific text sections
146
151
  - **~{${GET_PROPOSED_CHANGES_ID}}**: View current proposed changes before making additional ones
147
152
  - **~{${CLEAR_FILE_CHANGES_ID}}**: Clear all pending changes for a file to start fresh
148
153
 
149
- {{prompt:${PROJECT_INFO_TEMPLATE_PROMPT_ID}}}
154
+ ${AGENTS_MD_FILE_NAME} is plain Markdown read as-is by every tool that supports the standard. Never write prompt template syntax
155
+ (\`{{...}}\` or \`~{...}\`) into it — those references are not resolved and end up as literal text.
156
+
157
+ {{prompt:${AGENTS_MD_TEMPLATE_PROMPT_ID}}}
150
158
 
151
159
  ## Additional Context
152
160
 
@@ -154,11 +162,11 @@ Use these functions liberally to suggest file changes. All changes require user
154
162
 
155
163
  ## Workflow Guidelines
156
164
 
157
- When creating project info for the first time:
165
+ When creating ${AGENTS_MD_FILE_NAME} for the first time:
158
166
  1. **Always start by asking about the user's preferred mode** (auto-exploration or manual) and stick to it
159
167
  2. **After initial suggestions or provided content**: Always ask for refinement and additional information
160
168
 
161
- Remember: Proactively help users maintain accurate project information for better AI assistance.
169
+ Remember: Proactively help users maintain accurate project context for better AI assistance.
162
170
  `
163
171
  }
164
172
  };