repoburg 1.3.12 → 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.
- package/backend/dist/packages/tokenpatch/index.d.ts +5 -1
- package/backend/dist/packages/tokenpatch/index.js +39 -22
- package/backend/dist/packages/tokenpatch/index.js.map +1 -1
- package/backend/dist/packages/tokenpatch/patcher.js +57 -16
- package/backend/dist/packages/tokenpatch/patcher.js.map +1 -1
- package/backend/dist/packages/tokenpatch/strategies/tiktoken-tokenizer.d.ts +6 -0
- package/backend/dist/packages/tokenpatch/strategies/tiktoken-tokenizer.js +28 -0
- package/backend/dist/packages/tokenpatch/strategies/tiktoken-tokenizer.js.map +1 -0
- package/backend/dist/packages/tokenpatch/strategies/tree-sitter-tokenizer.d.ts +9 -0
- package/backend/dist/packages/tokenpatch/strategies/tree-sitter-tokenizer.js +36 -0
- package/backend/dist/packages/tokenpatch/strategies/tree-sitter-tokenizer.js.map +1 -0
- package/backend/dist/packages/tokenpatch/tokenizer.interface.d.ts +4 -0
- package/backend/dist/packages/tokenpatch/tokenizer.interface.js +3 -0
- package/backend/dist/packages/tokenpatch/tokenizer.interface.js.map +1 -0
- package/backend/dist/packages/tokenpatch/tokens.d.ts +0 -2
- package/backend/dist/packages/tokenpatch/tokens.js +4 -23
- package/backend/dist/packages/tokenpatch/tokens.js.map +1 -1
- package/backend/dist/packages/tokenpatch/types.d.ts +2 -2
- package/backend/dist/src/llm-orchestration/action-handlers/patch.handler.js +125 -47
- package/backend/dist/src/llm-orchestration/action-handlers/patch.handler.js.map +1 -1
- package/backend/dist/src/seeding/data/system-prompts/experimental_eta_master-agent.d.ts +1 -1
- package/backend/dist/src/seeding/data/system-prompts/experimental_eta_master-agent.js +44 -55
- package/backend/dist/src/seeding/data/system-prompts/experimental_eta_master-agent.js.map +1 -1
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/backend/packages/tokenpatch/index.spec.ts +44 -30
- package/backend/packages/tokenpatch/index.ts +54 -32
- package/backend/packages/tokenpatch/patcher.ts +107 -26
- package/backend/packages/tokenpatch/strategies/tiktoken-tokenizer.ts +35 -0
- package/backend/packages/tokenpatch/strategies/tree-sitter-tokenizer.ts +37 -0
- package/backend/packages/tokenpatch/tokenizer.interface.ts +5 -0
- package/backend/packages/tokenpatch/tokens.ts +10 -28
- package/backend/packages/tokenpatch/types.ts +4 -4
- package/package.json +2 -1
|
@@ -19,6 +19,7 @@ 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
21
|
const parsing_constants_1 = require("../parser/parsing.constants");
|
|
22
|
+
const ENABLE_TREE_SITTER = false;
|
|
22
23
|
const grammarMap = {
|
|
23
24
|
'.js': 'tree-sitter-javascript.wasm',
|
|
24
25
|
'.jsx': 'tree-sitter-javascript.wasm',
|
|
@@ -53,36 +54,56 @@ let PatchHandler = PatchHandler_1 = class PatchHandler {
|
|
|
53
54
|
})();
|
|
54
55
|
}
|
|
55
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
|
+
\`\`\``;
|
|
56
64
|
const goodAnchorExample = (0, utils_1.generateToolCall)({
|
|
57
65
|
tool_name: this.toolName,
|
|
58
|
-
file_path: 'src/
|
|
66
|
+
file_path: 'src/utils/formatting.ts',
|
|
59
67
|
patch_code: `\`\`\`typescript
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
protocol: 'https'
|
|
64
|
-
};
|
|
68
|
+
export function formatDate(date: Date): string {
|
|
69
|
+
return date.toISOString();
|
|
70
|
+
}
|
|
65
71
|
|
|
66
|
-
|
|
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 {
|
|
67
83
|
\`\`\``,
|
|
68
84
|
});
|
|
69
85
|
const badAnchorExample = (0, utils_1.generateToolCall)({
|
|
70
86
|
tool_name: this.toolName,
|
|
71
|
-
file_path: 'src/
|
|
87
|
+
file_path: 'src/utils/formatting.ts',
|
|
72
88
|
patch_code: `\`\`\`typescript
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
protocol: 'https'
|
|
77
|
-
};
|
|
89
|
+
// MODIFIED: Handle non-string inputs gracefully
|
|
90
|
+
if (typeof str !== 'string') return String(str);
|
|
91
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
78
92
|
\`\`\``,
|
|
79
93
|
});
|
|
80
94
|
const appendExample = (0, utils_1.generateToolCall)({
|
|
81
95
|
tool_name: this.toolName,
|
|
82
|
-
file_path: 'src/
|
|
96
|
+
file_path: 'src/services/auth.service.ts',
|
|
83
97
|
patch_code: `\`\`\`typescript
|
|
84
|
-
|
|
85
|
-
|
|
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
|
+
}
|
|
86
107
|
// ${parsing_constants_1.SPECIAL_PATCH_END_FILE_MARKER}
|
|
87
108
|
\`\`\``,
|
|
88
109
|
});
|
|
@@ -91,8 +112,21 @@ export { sum };
|
|
|
91
112
|
file_path: 'src/main.ts',
|
|
92
113
|
patch_code: `\`\`\`typescript
|
|
93
114
|
// ${parsing_constants_1.SPECIAL_PATCH_BEGIN_FILE_MARKER}
|
|
94
|
-
import
|
|
95
|
-
import {
|
|
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() {
|
|
96
130
|
\`\`\``,
|
|
97
131
|
});
|
|
98
132
|
const definition = `
|
|
@@ -105,51 +139,100 @@ import { ModuleA } from './moduleA';
|
|
|
105
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.
|
|
106
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.
|
|
107
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.
|
|
108
143
|
|
|
109
144
|
Special Markers for Edge Cases:
|
|
110
|
-
|
|
111
|
-
|
|
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.
|
|
112
153
|
|
|
113
154
|
Parameters:
|
|
114
155
|
- "file_path": (string) The relative path to the file to be patched.
|
|
115
156
|
- "patch_code": (string) A code snippet containing your changes, with enough surrounding context to serve as a unique anchor.
|
|
116
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
|
+
|
|
117
163
|
<example_good_anchoring>
|
|
118
|
-
Explanation:
|
|
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.
|
|
119
165
|
|
|
120
166
|
Original File Content:
|
|
121
167
|
\`\`\`typescript
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
};
|
|
168
|
+
export function formatDate(date: Date): string {
|
|
169
|
+
return date.toISOString();
|
|
170
|
+
}
|
|
126
171
|
|
|
127
|
-
function
|
|
128
|
-
|
|
172
|
+
export function capitalize(str: string): string {
|
|
173
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
129
174
|
}
|
|
130
175
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
};
|
|
176
|
+
export function formatCurrency(amount: number): string {
|
|
177
|
+
return '$' + amount.toFixed(2);
|
|
178
|
+
}
|
|
135
179
|
\`\`\`
|
|
136
180
|
|
|
137
181
|
${goodAnchorExample}
|
|
138
182
|
</example_good_anchoring>
|
|
139
183
|
|
|
140
184
|
<example_bad_anchoring>
|
|
141
|
-
Explanation: This is a **bad example**. The 'patch_code'
|
|
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
|
+
\`\`\`
|
|
142
201
|
|
|
143
202
|
${badAnchorExample}
|
|
144
203
|
</example_bad_anchoring>
|
|
145
204
|
|
|
146
205
|
<example_append>
|
|
147
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
|
+
|
|
148
218
|
${appendExample}
|
|
149
219
|
</example_append>
|
|
150
220
|
|
|
151
221
|
<example_prepend>
|
|
152
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
|
+
|
|
153
236
|
${prependExample}
|
|
154
237
|
</example_prepend>
|
|
155
238
|
</${this.toolName}>
|
|
@@ -180,20 +263,15 @@ ${prependExample}
|
|
|
180
263
|
const safePath = this.resolveAndValidatePath(file_path);
|
|
181
264
|
const fileExtension = path.extname(file_path);
|
|
182
265
|
const grammarFile = grammarMap[fileExtension];
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
summary: `Patch on "${file_path}" failed: Unsupported file type.`,
|
|
192
|
-
error_message: errorMessage,
|
|
193
|
-
persisted_args: validatedArgs,
|
|
194
|
-
};
|
|
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 };
|
|
195
274
|
}
|
|
196
|
-
const grammarPath = path.join(this.grammarDir, grammarFile);
|
|
197
275
|
const originalContent = await fs
|
|
198
276
|
.readFile(safePath, 'utf8')
|
|
199
277
|
.catch((error) => {
|
|
@@ -216,7 +294,7 @@ ${prependExample}
|
|
|
216
294
|
};
|
|
217
295
|
}
|
|
218
296
|
try {
|
|
219
|
-
const newFileContent = await (0, tokenpatch_1.applySnippetPatch)(originalContent, patch_code,
|
|
297
|
+
const newFileContent = await (0, tokenpatch_1.applySnippetPatch)(originalContent, patch_code, applyPatchOptions);
|
|
220
298
|
await fs.writeFile(safePath, newFileContent, 'utf8');
|
|
221
299
|
return {
|
|
222
300
|
status: 'SUCCESS',
|
|
@@ -227,7 +305,7 @@ ${prependExample}
|
|
|
227
305
|
}
|
|
228
306
|
catch (error) {
|
|
229
307
|
this.logger.error(`Failed to apply patch for ${file_path}: ${error.message}`);
|
|
230
|
-
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.`;
|
|
231
309
|
context.feedback.validationErrors.push({
|
|
232
310
|
tool_name: this.toolName,
|
|
233
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;AAC/C,mEAGqC;
|
|
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,6BAA6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AAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,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,0KAA0K,CAAC;YACtd,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;AAlUY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;GACA,YAAY,CAkUxB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "Master Agent (eta)";
|
|
2
|
-
export declare const content = "\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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
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"}
|