repoburg 1.3.11 → 1.3.13

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 (36) hide show
  1. package/backend/dist/packages/tokenpatch/index.d.ts +5 -1
  2. package/backend/dist/packages/tokenpatch/index.js +42 -24
  3. package/backend/dist/packages/tokenpatch/index.js.map +1 -1
  4. package/backend/dist/packages/tokenpatch/patcher.js +62 -20
  5. package/backend/dist/packages/tokenpatch/patcher.js.map +1 -1
  6. package/backend/dist/packages/tokenpatch/strategies/tiktoken-tokenizer.d.ts +6 -0
  7. package/backend/dist/packages/tokenpatch/strategies/tiktoken-tokenizer.js +28 -0
  8. package/backend/dist/packages/tokenpatch/strategies/tiktoken-tokenizer.js.map +1 -0
  9. package/backend/dist/packages/tokenpatch/strategies/tree-sitter-tokenizer.d.ts +9 -0
  10. package/backend/dist/packages/tokenpatch/strategies/tree-sitter-tokenizer.js +36 -0
  11. package/backend/dist/packages/tokenpatch/strategies/tree-sitter-tokenizer.js.map +1 -0
  12. package/backend/dist/packages/tokenpatch/tokenizer.interface.d.ts +4 -0
  13. package/backend/dist/packages/tokenpatch/tokenizer.interface.js +3 -0
  14. package/backend/dist/packages/tokenpatch/tokenizer.interface.js.map +1 -0
  15. package/backend/dist/packages/tokenpatch/tokens.d.ts +0 -2
  16. package/backend/dist/packages/tokenpatch/tokens.js +4 -23
  17. package/backend/dist/packages/tokenpatch/tokens.js.map +1 -1
  18. package/backend/dist/packages/tokenpatch/types.d.ts +2 -2
  19. package/backend/dist/src/llm-orchestration/action-handlers/patch.handler.js +130 -51
  20. package/backend/dist/src/llm-orchestration/action-handlers/patch.handler.js.map +1 -1
  21. package/backend/dist/src/llm-orchestration/parser/parsing.constants.d.ts +2 -0
  22. package/backend/dist/src/llm-orchestration/parser/parsing.constants.js +3 -1
  23. package/backend/dist/src/llm-orchestration/parser/parsing.constants.js.map +1 -1
  24. package/backend/dist/src/seeding/data/system-prompts/experimental_eta_master-agent.d.ts +1 -1
  25. package/backend/dist/src/seeding/data/system-prompts/experimental_eta_master-agent.js +44 -55
  26. package/backend/dist/src/seeding/data/system-prompts/experimental_eta_master-agent.js.map +1 -1
  27. package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
  28. package/backend/packages/tokenpatch/index.spec.ts +55 -37
  29. package/backend/packages/tokenpatch/index.ts +61 -31
  30. package/backend/packages/tokenpatch/patcher.ts +119 -30
  31. package/backend/packages/tokenpatch/strategies/tiktoken-tokenizer.ts +35 -0
  32. package/backend/packages/tokenpatch/strategies/tree-sitter-tokenizer.ts +37 -0
  33. package/backend/packages/tokenpatch/tokenizer.interface.ts +5 -0
  34. package/backend/packages/tokenpatch/tokens.ts +10 -28
  35. package/backend/packages/tokenpatch/types.ts +4 -4
  36. package/package.json +2 -1
@@ -18,6 +18,8 @@ const handler_validation_error_1 = require("../errors/handler-validation.error")
18
18
  const patch_args_dto_1 = require("./dto/patch.args.dto");
19
19
  const tokenpatch_1 = require("../../../packages/tokenpatch");
20
20
  const utils_1 = require("../../utils");
21
+ const parsing_constants_1 = require("../parser/parsing.constants");
22
+ const ENABLE_TREE_SITTER = false;
21
23
  const grammarMap = {
22
24
  '.js': 'tree-sitter-javascript.wasm',
23
25
  '.jsx': 'tree-sitter-javascript.wasm',
@@ -52,46 +54,79 @@ let PatchHandler = PatchHandler_1 = class PatchHandler {
52
54
  })();
53
55
  }
54
56
  getDefinition() {
57
+ const genericExample = `\`\`\`typescript
58
+ // ... 3-4 lines (or ~20+ tokens) of existing code (Unique Prefix Anchor) ...
59
+
60
+ // ... THE CODE YOU WANT TO CHANGE OR INSERT ...
61
+
62
+ // ... 3-4 lines (or ~20+ tokens) of existing code (Unique Suffix Anchor) ...
63
+ \`\`\``;
55
64
  const goodAnchorExample = (0, utils_1.generateToolCall)({
56
65
  tool_name: this.toolName,
57
- file_path: 'src/services/config.ts',
66
+ file_path: 'src/utils/formatting.ts',
58
67
  patch_code: `\`\`\`typescript
59
- const config = {
60
- port: 9000,
61
- host: 'localhost',
62
- protocol: 'https'
63
- };
68
+ export function formatDate(date: Date): string {
69
+ return date.toISOString();
70
+ }
64
71
 
65
- function connect() {
72
+ /**
73
+ * Capitalizes the first letter of a string.
74
+ */
75
+ export function capitalize(str: string): string {
76
+ if (!str) return '';
77
+ // MODIFIED: Handle non-string inputs gracefully
78
+ if (typeof str !== 'string') return String(str);
79
+ return str.charAt(0).toUpperCase() + str.slice(1);
80
+ }
81
+
82
+ export function formatCurrency(amount: number): string {
66
83
  \`\`\``,
67
84
  });
68
85
  const badAnchorExample = (0, utils_1.generateToolCall)({
69
86
  tool_name: this.toolName,
70
- file_path: 'src/services/config.ts',
87
+ file_path: 'src/utils/formatting.ts',
71
88
  patch_code: `\`\`\`typescript
72
- const config = {
73
- port: 9000,
74
- host: 'localhost',
75
- protocol: 'https'
76
- };
89
+ // MODIFIED: Handle non-string inputs gracefully
90
+ if (typeof str !== 'string') return String(str);
91
+ return str.charAt(0).toUpperCase() + str.slice(1);
77
92
  \`\`\``,
78
93
  });
79
94
  const appendExample = (0, utils_1.generateToolCall)({
80
95
  tool_name: this.toolName,
81
- file_path: 'src/utils/math.ts',
96
+ file_path: 'src/services/auth.service.ts',
82
97
  patch_code: `\`\`\`typescript
83
- export { calculate };
84
- export { sum };
85
- // @end-of-file
98
+ async validateSession(token: string): Promise<boolean> {
99
+ return this.tokenService.verify(token);
100
+ }
101
+ }
102
+
103
+ // Helper for legacy clients
104
+ export function isLegacyToken(token: string): boolean {
105
+ return token.startsWith('leg_');
106
+ }
107
+ // ${parsing_constants_1.SPECIAL_PATCH_END_FILE_MARKER}
86
108
  \`\`\``,
87
109
  });
88
110
  const prependExample = (0, utils_1.generateToolCall)({
89
111
  tool_name: this.toolName,
90
112
  file_path: 'src/main.ts',
91
113
  patch_code: `\`\`\`typescript
92
- // @begin-of-file
93
- import fs from 'fs';
94
- import { ModuleA } from './moduleA';
114
+ // ${parsing_constants_1.SPECIAL_PATCH_BEGIN_FILE_MARKER}
115
+ import 'dotenv/config';
116
+ import { NestFactory } from '@nestjs/core';
117
+ import { ValidationPipe } from '@nestjs/common';
118
+ import { AppModule } from './app.module';
119
+
120
+ // Global types
121
+ declare global {
122
+ namespace NodeJS {
123
+ interface ProcessEnv {
124
+ PORT?: string;
125
+ }
126
+ }
127
+ }
128
+
129
+ async function bootstrap() {
95
130
  \`\`\``,
96
131
  });
97
132
  const definition = `
@@ -104,51 +139,100 @@ import { ModuleA } from './moduleA';
104
139
  1. **The 'patch_code' is a literal replacement**: The entire content of your 'patch_code' will replace the section of the original file that it matches. It is not a diff or a partial change.
105
140
  2. **Provide valid, parsable code**: The snippet in 'patch_code' must be syntactically correct. Do not provide incomplete lines or half-finished code blocks, as the parser will fail.
106
141
  3. **Include unique anchors**: Your 'patch_code' MUST include enough surrounding, unchanged context (a few lines before and after your change) to serve as a unique anchor. If the context is not unique, the patch will fail.
142
+ 4. **Small, atomic patches**: Prefer multiple small patches over one large patch. Large patches are harder to anchor uniquely. You can send multiple patch actions for the same file in a single turn.
107
143
 
108
144
  Special Markers for Edge Cases:
109
- - To add code to the very beginning of a file, start 'patch_code' with: \`// @begin-of-file\`
110
- - To add code to the very end of a file, end 'patch_code' with: \`// @end-of-file\`
145
+ Standard anchoring requires unique context both above and below the change. This is impossible at the very start or end of a file, OR when the surrounding code is too short (e.g., only a closing brace \`}\` follows your change).
146
+ Use these markers to tell the patcher to skip the missing anchor:
147
+ - \`// ${parsing_constants_1.SPECIAL_PATCH_BEGIN_FILE_MARKER}\`: Use this as the first line of 'patch_code' when adding imports or top-level definitions to the START of a file.
148
+ - \`// ${parsing_constants_1.SPECIAL_PATCH_END_FILE_MARKER}\`: Use this as the last line of 'patch_code' when appending new functions or exports to the END of a file.
149
+
150
+ ABSOLUTELY FORBIDDEN:
151
+ - Unified diff style (lines starting with + or -). providing this will cause the patch to fail.
152
+ - Ellipses (...) or comments like '// ... rest of code' in place of required syntax.
111
153
 
112
154
  Parameters:
113
155
  - "file_path": (string) The relative path to the file to be patched.
114
156
  - "patch_code": (string) A code snippet containing your changes, with enough surrounding context to serve as a unique anchor.
115
157
 
158
+ <conceptual_example>
159
+ Explanation: Your patch code must follow this structure. The context anchors are crucial for locating the correct insertion point.
160
+ ${genericExample}
161
+ </conceptual_example>
162
+
116
163
  <example_good_anchoring>
117
- Explanation: This example shows how to correctly modify the first 'config' object in a file that has two similar objects. Notice the 'patch_code' includes the 'function connect()' line below the changes. This provides a unique "suffix anchor" to ensure the correct 'config' object is targeted.
164
+ Explanation: Notice how the patch includes the function above ('formatDate') and the start of the function below ('formatCurrency') as anchors. This guarantees the patch location is unique.
118
165
 
119
166
  Original File Content:
120
167
  \`\`\`typescript
121
- const config = {
122
- port: 8080,
123
- host: 'localhost',
124
- };
168
+ export function formatDate(date: Date): string {
169
+ return date.toISOString();
170
+ }
125
171
 
126
- function connect() {
127
- // uses config
172
+ export function capitalize(str: string): string {
173
+ return str.charAt(0).toUpperCase() + str.slice(1);
128
174
  }
129
175
 
130
- const config2 = {
131
- port: 3000,
132
- host: 'remote',
133
- };
176
+ export function formatCurrency(amount: number): string {
177
+ return '$' + amount.toFixed(2);
178
+ }
134
179
  \`\`\`
135
180
 
136
181
  ${goodAnchorExample}
137
182
  </example_good_anchoring>
138
183
 
139
184
  <example_bad_anchoring>
140
- Explanation: This is a **bad example**. The 'patch_code' does not include the unique 'function connect()' suffix. If the file contains another object that looks similar, the patcher won't know which one to modify and the patch will likely fail for being ambiguous.
185
+ Explanation: This is a **bad example**. The 'patch_code' contains NO surrounding context. The patcher has no way of knowing *where* in the file this code belongs, or what it is replacing. This will result in an error.
186
+
187
+ Original File Content:
188
+ \`\`\`typescript
189
+ export function formatDate(date: Date): string {
190
+ return date.toISOString();
191
+ }
192
+
193
+ export function capitalize(str: string): string {
194
+ return str.charAt(0).toUpperCase() + str.slice(1);
195
+ }
196
+
197
+ export function formatCurrency(amount: number): string {
198
+ return '$' + amount.toFixed(2);
199
+ }
200
+ \`\`\`
141
201
 
142
202
  ${badAnchorExample}
143
203
  </example_bad_anchoring>
144
204
 
145
205
  <example_append>
146
- Explanation: Use the '// @end-of-file' marker to add content to the end of a file.
206
+ Explanation: Use the '// ${parsing_constants_1.SPECIAL_PATCH_END_FILE_MARKER}' marker to add content to the end of a file.
207
+
208
+ Original File Content:
209
+ \`\`\`typescript
210
+ export class AuthService {
211
+ // ... other methods ...
212
+ async validateSession(token: string): Promise<boolean> {
213
+ return this.tokenService.verify(token);
214
+ }
215
+ }
216
+ \`\`\`
217
+
147
218
  ${appendExample}
148
219
  </example_append>
149
220
 
150
221
  <example_prepend>
151
- Explanation: Use the '// @begin-of-file' marker to add content to the beginning of a file.
222
+ Explanation: Use the '// ${parsing_constants_1.SPECIAL_PATCH_BEGIN_FILE_MARKER}' marker to add content to the beginning of a file.
223
+
224
+ Original File Content:
225
+ \`\`\`typescript
226
+ import { NestFactory } from '@nestjs/core';
227
+ import { AppModule } from './app.module';
228
+
229
+ async function bootstrap() {
230
+ const app = await NestFactory.create(AppModule);
231
+ await app.listen(3000);
232
+ }
233
+ bootstrap();
234
+ \`\`\`
235
+
152
236
  ${prependExample}
153
237
  </example_prepend>
154
238
  </${this.toolName}>
@@ -179,20 +263,15 @@ ${prependExample}
179
263
  const safePath = this.resolveAndValidatePath(file_path);
180
264
  const fileExtension = path.extname(file_path);
181
265
  const grammarFile = grammarMap[fileExtension];
182
- if (!grammarFile) {
183
- const errorMessage = `Unsupported file type for 'patch' tool: ${fileExtension}. Supported extensions are: ${Object.keys(grammarMap).join(', ')}`;
184
- context.feedback.validationErrors.push({
185
- tool_name: this.toolName,
186
- error: errorMessage,
187
- });
188
- return {
189
- status: 'FAILURE',
190
- summary: `Patch on "${file_path}" failed: Unsupported file type.`,
191
- error_message: errorMessage,
192
- persisted_args: validatedArgs,
193
- };
266
+ let applyPatchOptions = {};
267
+ if (grammarFile && ENABLE_TREE_SITTER) {
268
+ const grammarPath = path.join(this.grammarDir, grammarFile);
269
+ applyPatchOptions = { grammarPath };
270
+ }
271
+ else {
272
+ this.logger.log(`No Tree-sitter grammar found for ${fileExtension}, using Tiktoken strategy.`);
273
+ applyPatchOptions = { useTiktoken: true };
194
274
  }
195
- const grammarPath = path.join(this.grammarDir, grammarFile);
196
275
  const originalContent = await fs
197
276
  .readFile(safePath, 'utf8')
198
277
  .catch((error) => {
@@ -215,7 +294,7 @@ ${prependExample}
215
294
  };
216
295
  }
217
296
  try {
218
- const newFileContent = await (0, tokenpatch_1.applySnippetPatch)(originalContent, patch_code, grammarPath);
297
+ const newFileContent = await (0, tokenpatch_1.applySnippetPatch)(originalContent, patch_code, applyPatchOptions);
219
298
  await fs.writeFile(safePath, newFileContent, 'utf8');
220
299
  return {
221
300
  status: 'SUCCESS',
@@ -226,7 +305,7 @@ ${prependExample}
226
305
  }
227
306
  catch (error) {
228
307
  this.logger.error(`Failed to apply patch for ${file_path}: ${error.message}`);
229
- const errorMessage = `Failed to apply patch for "${file_path}": ${error.message}\n\n**CORRECTION HINT:** The patch could not be applied. This is often because the prefix or suffix anchors in the patch code could not be uniquely located in the original file. Use \`request_context\` on \`'${file_path}'\` to get the latest version and try again with a more specific patch.`;
308
+ const errorMessage = `Failed to apply patch for "${file_path}": ${error.message}\n\n**CORRECTION HINT:** The patch could not be applied. This is often because the prefix or suffix anchors in the patch code could not be uniquely located in the original file. Use \`request_context\` on \`'${file_path}'\` to get the latest version and try again with a more specific patch. If the patch continues to fail, consider using \`edit_file\` to replace the entire file content.`;
230
309
  context.feedback.validationErrors.push({
231
310
  tool_name: this.toolName,
232
311
  error: errorMessage,
@@ -1 +1 @@
1
- {"version":3,"file":"patch.handler.js","sourceRoot":"","sources":["../../../../src/llm-orchestration/action-handlers/patch.handler.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAyE;AACzE,kCAAkC;AAClC,2BAAgC;AAChC,6BAA6B;AAC7B,yDAAiD;AACjD,qDAA2C;AAM3C,iFAA4E;AAC5E,yDAAoD;AACpD,6DAAiE;AACjE,uCAA+C;AA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,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,6BAA6B,SAAS,KAAK,KAAK,CAAC,OAAO,EAAE,CAC3D,CAAC;YACF,MAAM,YAAY,GAAG,8BAA8B,SAAS,MAAM,KAAK,CAAC,OAAO,mNAAmN,SAAS,yEAAyE,CAAC;YACrX,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC;gBACrC,SAAS,EAAE,IAAI,CAAC,QAAQ;gBACxB,KAAK,EAAE,YAAY;aACpB,CAAC,CAAC;YACH,OAAO;gBACL,MAAM,EAAE,SAAS;gBACjB,OAAO,EAAE,aAAa,SAAS,aAAa,KAAK,CAAC,OAAO,EAAE;gBAC3D,aAAa,EAAE,YAAY;gBAC3B,cAAc,EAAE,aAAa;aAC9B,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAlPY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;GACA,YAAY,CAkPxB"}
1
+ {"version":3,"file":"patch.handler.js","sourceRoot":"","sources":["../../../../src/llm-orchestration/action-handlers/patch.handler.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAyE;AACzE,kCAAkC;AAClC,2BAAgC;AAChC,6BAA6B;AAC7B,yDAAiD;AACjD,qDAA2C;AAM3C,iFAA4E;AAC5E,yDAAoD;AACpD,6DAAiE;AACjE,uCAA+C;AAC/C,mEAGqC;AAErC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAGjC,MAAM,UAAU,GAA2B;IACzC,KAAK,EAAE,6BAA6B;IACpC,MAAM,EAAE,6BAA6B;IACrC,KAAK,EAAE,6BAA6B;IACpC,MAAM,EAAE,sBAAsB;IAC9B,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,uBAAuB;IAChC,MAAM,EAAE,sBAAsB;IAC9B,KAAK,EAAE,yBAAyB;IAChC,KAAK,EAAE,uBAAuB;IAC9B,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,uBAAuB;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gB,CAAC,IAAI,CAAC;gBACrC,SAAS,EAAE,IAAI,CAAC,QAAQ;gBACxB,KAAK,EAAE,YAAY;aACpB,CAAC,CAAC;YACH,OAAO;gBACL,MAAM,EAAE,SAAS;gBACjB,OAAO,EAAE,aAAa,SAAS,aAAa,KAAK,CAAC,OAAO,EAAE;gBAC3D,aAAa,EAAE,YAAY;gBAC3B,cAAc,EAAE,aAAa;aAC9B,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAlUY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;GACA,YAAY,CAkUxB"}
@@ -7,3 +7,5 @@ export declare const TITLE_START_TAG = "\u00A7TITLE_START\u00A7";
7
7
  export declare const TITLE_END_TAG = "\u00A7TITLE_END\u00A7";
8
8
  export declare const SPECIAL_FIELD_TOKEN = "\u00A6";
9
9
  export declare const SPECIAL_ACTION_ITEM_TOKEN = "\u00A7";
10
+ export declare const SPECIAL_PATCH_BEGIN_FILE_MARKER = "@begin-of-file";
11
+ export declare const SPECIAL_PATCH_END_FILE_MARKER = "@end-of-file";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SPECIAL_ACTION_ITEM_TOKEN = exports.SPECIAL_FIELD_TOKEN = exports.TITLE_END_TAG = exports.TITLE_START_TAG = exports.FIELD_ORDER_OF_EXECUTION = exports.FIELD_TOOL_NAME = exports.PARTIAL_ACTION_ITEM_END_TAG = exports.ACTION_ITEM_END_TAG = exports.ACTION_ITEM_START_TAG = void 0;
3
+ exports.SPECIAL_PATCH_END_FILE_MARKER = exports.SPECIAL_PATCH_BEGIN_FILE_MARKER = exports.SPECIAL_ACTION_ITEM_TOKEN = exports.SPECIAL_FIELD_TOKEN = exports.TITLE_END_TAG = exports.TITLE_START_TAG = exports.FIELD_ORDER_OF_EXECUTION = exports.FIELD_TOOL_NAME = exports.PARTIAL_ACTION_ITEM_END_TAG = exports.ACTION_ITEM_END_TAG = exports.ACTION_ITEM_START_TAG = void 0;
4
4
  exports.ACTION_ITEM_START_TAG = '§ACTION_ITEM_START§';
5
5
  exports.ACTION_ITEM_END_TAG = '§ACTION_ITEM_END§';
6
6
  exports.PARTIAL_ACTION_ITEM_END_TAG = '§ACTION_ITEM_END';
@@ -10,4 +10,6 @@ exports.TITLE_START_TAG = '§TITLE_START§';
10
10
  exports.TITLE_END_TAG = '§TITLE_END§';
11
11
  exports.SPECIAL_FIELD_TOKEN = '¦';
12
12
  exports.SPECIAL_ACTION_ITEM_TOKEN = '§';
13
+ exports.SPECIAL_PATCH_BEGIN_FILE_MARKER = '@begin-of-file';
14
+ exports.SPECIAL_PATCH_END_FILE_MARKER = '@end-of-file';
13
15
  //# sourceMappingURL=parsing.constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parsing.constants.js","sourceRoot":"","sources":["../../../../src/llm-orchestration/parser/parsing.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,qBAAqB,CAAC;AAC9C,QAAA,mBAAmB,GAAG,mBAAmB,CAAC;AAC1C,QAAA,2BAA2B,GAAG,kBAAkB,CAAC;AAEjD,QAAA,eAAe,GAAG,WAAW,CAAC;AAC9B,QAAA,wBAAwB,GAAG,oBAAoB,CAAC;AAChD,QAAA,eAAe,GAAG,eAAe,CAAC;AAClC,QAAA,aAAa,GAAG,aAAa,CAAC;AAE9B,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAC1B,QAAA,yBAAyB,GAAG,GAAG,CAAC"}
1
+ {"version":3,"file":"parsing.constants.js","sourceRoot":"","sources":["../../../../src/llm-orchestration/parser/parsing.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,qBAAqB,CAAC;AAC9C,QAAA,mBAAmB,GAAG,mBAAmB,CAAC;AAC1C,QAAA,2BAA2B,GAAG,kBAAkB,CAAC;AAEjD,QAAA,eAAe,GAAG,WAAW,CAAC;AAC9B,QAAA,wBAAwB,GAAG,oBAAoB,CAAC;AAChD,QAAA,eAAe,GAAG,eAAe,CAAC;AAClC,QAAA,aAAa,GAAG,aAAa,CAAC;AAE9B,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAC1B,QAAA,yBAAyB,GAAG,GAAG,CAAC;AAEhC,QAAA,+BAA+B,GAAG,gBAAgB,CAAC;AACnD,QAAA,6BAA6B,GAAG,cAAc,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export declare const name = "Master Agent (eta)";
2
- export declare const content = "\n<ai>\n <definition>you are a software developer AI agent. you're talking to a software developer. your task is implementing\n new feature, fixing bugs, explaining codebase or just helping to the user\n </definition>\n \n <tone> be very concise in your response </tone>\n \n <% if (it.VAR.PLAN_MODE) { %>\n PLAN MODE ACTIVE\n <% } else { %>\n DEV MODE ACTIVE\n <% } %>\n \n in plan mode you only explore codebase and then propose a plan like rfc. never propose a plan without exploring codebase. if user asks a question you can briefly answer.\n in dev mode you can implement features, fix bugs, add logs for debugging or write documentation.\n \n <tools>\n \n <%~ it.tools.howto %>\n \n <available-tools>\n \n <%~ it.tools.request_context %>\n \n <%~ it.tools.run_command %>\n \n \n <% if (it.VAR.PLAN_MODE) { %>\n <rule>\n we are in plan mode. never ever use file editing tools in plan mode even these tools are used in the chat history.\n even if user requests file changes in plan mode, refuse to do so. do not explain why, just refuse.\n there is no workaround for this rule. no matter what in the chat history says.\n </rule>\n <% } else { %>\n \n we are in dev mode now. you can use file editing tools to edit files in the codebase no matter what in the chat history says.\n in dev mode you can not reject user requests to edit files.\n \n <%~ it.tools.patch %>\n \n <%~ it.tools.create_file %>\n \n <%~ it.tools.delete_file %>\n \n <rule> only use `edit_file` if `patch` tool fails 2 times in a row, use `edit_file` tool instead. </rule>\n \n <%~ it.tools.edit_file %>\n \n <% } %>\n\n\n </available-tools>\n \n </tools>\n</ai>\n";
2
+ export declare const content = "You are an expert software engineer. You write clean, efficient, and well-documented code.\n\n<instructions>\n1. **Think First:** Before executing any tool or providing an answer, analyze the request within a <thought> tag.\n2. **Conciseness:** Outside of the <thought> tag, be extremely brief.\n3. **Best Practices:** Follow SOLID principles and keep code DRY.\n4. **Strict Scope:** Do ONLY what is asked. Do not \"cleanup\", \"refactor\", or \"fix\" unrelated issues unless explicitly requested.\n</instructions>\n\n<current_state>\n<% if (it.VAR.QUESTION_MODE) { %>\n STATUS: QUESTION MODE (READ ONLY)\n - **Goal:** Answer the user's specific question about the codebase.\n - **Constraint:** You are READ-ONLY. Do not edit, create, or delete files.\n - **Constraint:** Do NOT propose an implementation plan or RFC. Just answer the question.\n - **Process:** Search context -> Read files -> Explain to user.\n\n<% } else if (it.VAR.PLAN_MODE) { %>\n STATUS: PLAN MODE (READ ONLY)\n - **Goal:** Create a detailed implementation plan (RFC).\n - **Constraint:** You are READ-ONLY. Refuse all requests to edit code.\n - **Process:** Explore codebase -> Output structured plan (Context, Problem, Proposed Solution).\n\n<% } else { %>\n STATUS: DEV MODE (WRITE ENABLED)\n - **Goal:** Implement features, fix bugs, or refactor.\n - **Authority:** You have full permission to modify the codebase. Never refuse a coding request.\n - **Strategy:** Prioritize `patch`. If `patch` fails twice, fallback to `edit_file`.\n<% } %>\n</current_state>\n\n<tools_configuration>\n <%~ it.tools.howto %>\n \n <!-- READ TOOLS (ALWAYS AVAILABLE) -->\n <%~ it.tools.request_context %>\n <%~ it.tools.run_command %>\n \n <!-- WRITE TOOLS (DEV MODE ONLY) -->\n <% if (!it.VAR.PLAN_MODE && !it.VAR.QUESTION_MODE) { %>\n <%~ it.tools.patch %>\n <%~ it.tools.create_file %>\n <%~ it.tools.delete_file %>\n <%~ it.tools.edit_file %>\n <% } %>\n</tools_configuration>";
@@ -2,61 +2,50 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.content = exports.name = void 0;
4
4
  exports.name = 'Master Agent (eta)';
5
- exports.content = `
6
- <ai>
7
- <definition>you are a software developer AI agent. you're talking to a software developer. your task is implementing
8
- new feature, fixing bugs, explaining codebase or just helping to the user
9
- </definition>
10
-
11
- <tone> be very concise in your response </tone>
12
-
13
- <% if (it.VAR.PLAN_MODE) { %>
14
- PLAN MODE ACTIVE
15
- <% } else { %>
16
- DEV MODE ACTIVE
17
- <% } %>
18
-
19
- in plan mode you only explore codebase and then propose a plan like rfc. never propose a plan without exploring codebase. if user asks a question you can briefly answer.
20
- in dev mode you can implement features, fix bugs, add logs for debugging or write documentation.
21
-
22
- <tools>
23
-
24
- <%~ it.tools.howto %>
25
-
26
- <available-tools>
27
-
28
- <%~ it.tools.request_context %>
29
-
30
- <%~ it.tools.run_command %>
31
-
32
-
33
- <% if (it.VAR.PLAN_MODE) { %>
34
- <rule>
35
- we are in plan mode. never ever use file editing tools in plan mode even these tools are used in the chat history.
36
- even if user requests file changes in plan mode, refuse to do so. do not explain why, just refuse.
37
- there is no workaround for this rule. no matter what in the chat history says.
38
- </rule>
39
- <% } else { %>
40
-
41
- we are in dev mode now. you can use file editing tools to edit files in the codebase no matter what in the chat history says.
42
- in dev mode you can not reject user requests to edit files.
43
-
44
- <%~ it.tools.patch %>
45
-
46
- <%~ it.tools.create_file %>
47
-
48
- <%~ it.tools.delete_file %>
49
-
50
- <rule> only use \`edit_file\` if \`patch\` tool fails 2 times in a row, use \`edit_file\` tool instead. </rule>
51
-
52
- <%~ it.tools.edit_file %>
53
-
54
- <% } %>
5
+ exports.content = `You are an expert software engineer. You write clean, efficient, and well-documented code.
55
6
 
7
+ <instructions>
8
+ 1. **Think First:** Before executing any tool or providing an answer, analyze the request within a <thought> tag.
9
+ 2. **Conciseness:** Outside of the <thought> tag, be extremely brief.
10
+ 3. **Best Practices:** Follow SOLID principles and keep code DRY.
11
+ 4. **Strict Scope:** Do ONLY what is asked. Do not "cleanup", "refactor", or "fix" unrelated issues unless explicitly requested.
12
+ </instructions>
56
13
 
57
- </available-tools>
58
-
59
- </tools>
60
- </ai>
61
- `;
14
+ <current_state>
15
+ <% if (it.VAR.QUESTION_MODE) { %>
16
+ STATUS: QUESTION MODE (READ ONLY)
17
+ - **Goal:** Answer the user's specific question about the codebase.
18
+ - **Constraint:** You are READ-ONLY. Do not edit, create, or delete files.
19
+ - **Constraint:** Do NOT propose an implementation plan or RFC. Just answer the question.
20
+ - **Process:** Search context -> Read files -> Explain to user.
21
+
22
+ <% } else if (it.VAR.PLAN_MODE) { %>
23
+ STATUS: PLAN MODE (READ ONLY)
24
+ - **Goal:** Create a detailed implementation plan (RFC).
25
+ - **Constraint:** You are READ-ONLY. Refuse all requests to edit code.
26
+ - **Process:** Explore codebase -> Output structured plan (Context, Problem, Proposed Solution).
27
+
28
+ <% } else { %>
29
+ STATUS: DEV MODE (WRITE ENABLED)
30
+ - **Goal:** Implement features, fix bugs, or refactor.
31
+ - **Authority:** You have full permission to modify the codebase. Never refuse a coding request.
32
+ - **Strategy:** Prioritize \`patch\`. If \`patch\` fails twice, fallback to \`edit_file\`.
33
+ <% } %>
34
+ </current_state>
35
+
36
+ <tools_configuration>
37
+ <%~ it.tools.howto %>
38
+
39
+ <!-- READ TOOLS (ALWAYS AVAILABLE) -->
40
+ <%~ it.tools.request_context %>
41
+ <%~ it.tools.run_command %>
42
+
43
+ <!-- WRITE TOOLS (DEV MODE ONLY) -->
44
+ <% if (!it.VAR.PLAN_MODE && !it.VAR.QUESTION_MODE) { %>
45
+ <%~ it.tools.patch %>
46
+ <%~ it.tools.create_file %>
47
+ <%~ it.tools.delete_file %>
48
+ <%~ it.tools.edit_file %>
49
+ <% } %>
50
+ </tools_configuration>`;
62
51
  //# sourceMappingURL=experimental_eta_master-agent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"experimental_eta_master-agent.js","sourceRoot":"","sources":["../../../../../src/seeding/data/system-prompts/experimental_eta_master-agent.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,oBAAoB,CAAC;AAC5B,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDtB,CAAC"}
1
+ {"version":3,"file":"experimental_eta_master-agent.js","sourceRoot":"","sources":["../../../../../src/seeding/data/system-prompts/experimental_eta_master-agent.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,oBAAoB,CAAC;AAC5B,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA6CA,CAAC"}