repoburg 1.3.12 → 1.3.14
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/ai-actions/ai-actions.service.d.ts +3 -1
- package/backend/dist/src/ai-actions/ai-actions.service.js +4 -0
- package/backend/dist/src/ai-actions/ai-actions.service.js.map +1 -1
- package/backend/dist/src/llm-orchestration/action-handlers/dto/execute-shell.args.dto.d.ts +4 -0
- package/backend/dist/src/llm-orchestration/action-handlers/dto/execute-shell.args.dto.js +27 -0
- package/backend/dist/src/llm-orchestration/action-handlers/dto/execute-shell.args.dto.js.map +1 -0
- package/backend/dist/src/llm-orchestration/action-handlers/dto/write-todo.args.dto.d.ts +4 -0
- package/backend/dist/src/llm-orchestration/action-handlers/dto/write-todo.args.dto.js +31 -0
- package/backend/dist/src/llm-orchestration/action-handlers/dto/write-todo.args.dto.js.map +1 -0
- package/backend/dist/src/llm-orchestration/action-handlers/execute-shell.handler.d.ts +11 -0
- package/backend/dist/src/llm-orchestration/action-handlers/execute-shell.handler.js +111 -0
- package/backend/dist/src/llm-orchestration/action-handlers/execute-shell.handler.js.map +1 -0
- package/backend/dist/src/llm-orchestration/action-handlers/howto.handler.js +2 -0
- package/backend/dist/src/llm-orchestration/action-handlers/howto.handler.js.map +1 -1
- 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/llm-orchestration/action-handlers/run-command.handler.d.ts +1 -0
- package/backend/dist/src/llm-orchestration/action-handlers/run-command.handler.js +12 -19
- package/backend/dist/src/llm-orchestration/action-handlers/run-command.handler.js.map +1 -1
- package/backend/dist/src/llm-orchestration/action-handlers/write-todo.handler.d.ts +13 -0
- package/backend/dist/src/llm-orchestration/action-handlers/write-todo.handler.js +116 -0
- package/backend/dist/src/llm-orchestration/action-handlers/write-todo.handler.js.map +1 -0
- package/backend/dist/src/llm-orchestration/llm-orchestration.module.js +4 -0
- package/backend/dist/src/llm-orchestration/llm-orchestration.module.js.map +1 -1
- package/backend/dist/src/seeding/data/system-prompts/default_master-agent.d.ts +1 -1
- package/backend/dist/src/seeding/data/system-prompts/default_master-agent.js +50 -493
- package/backend/dist/src/seeding/data/system-prompts/default_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
- package/backend/dist/src/seeding/data/system-prompts/carryover-agent.d.ts +0 -2
- package/backend/dist/src/seeding/data/system-prompts/carryover-agent.js +0 -107
- package/backend/dist/src/seeding/data/system-prompts/carryover-agent.js.map +0 -1
- package/backend/dist/src/seeding/data/system-prompts/experimental_eta_master-agent.d.ts +0 -2
- package/backend/dist/src/seeding/data/system-prompts/experimental_eta_master-agent.js +0 -62
- package/backend/dist/src/seeding/data/system-prompts/experimental_eta_master-agent.js.map +0 -1
- package/backend/dist/src/seeding/data/system-prompts/experimental_master-agent.d.ts +0 -2
- package/backend/dist/src/seeding/data/system-prompts/experimental_master-agent.js +0 -633
- package/backend/dist/src/seeding/data/system-prompts/experimental_master-agent.js.map +0 -1
- package/backend/dist/src/seeding/data/system-prompts/experimental_patch_master-agent.d.ts +0 -2
- package/backend/dist/src/seeding/data/system-prompts/experimental_patch_master-agent.js +0 -463
- package/backend/dist/src/seeding/data/system-prompts/experimental_patch_master-agent.js.map +0 -1
- package/backend/dist/src/seeding/data/system-prompts/refactor-split.d.ts +0 -2
- package/backend/dist/src/seeding/data/system-prompts/refactor-split.js +0 -57
- package/backend/dist/src/seeding/data/system-prompts/refactor-split.js.map +0 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var WriteTodoHandler_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.WriteTodoHandler = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const fs = require("fs/promises");
|
|
13
|
+
const path = require("path");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
const handler_validation_error_1 = require("../errors/handler-validation.error");
|
|
17
|
+
const write_todo_args_dto_1 = require("./dto/write-todo.args.dto");
|
|
18
|
+
const utils_1 = require("../../utils");
|
|
19
|
+
let WriteTodoHandler = WriteTodoHandler_1 = class WriteTodoHandler {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.toolName = 'write_todo';
|
|
22
|
+
this.logger = new common_1.Logger(WriteTodoHandler_1.name);
|
|
23
|
+
this.projectRoot = process.env.REPOBURG_PROJECT_PATH || process.cwd();
|
|
24
|
+
}
|
|
25
|
+
getDefinition() {
|
|
26
|
+
const exampleContent = `\`\`\`markdown
|
|
27
|
+
# Project TODOs
|
|
28
|
+
|
|
29
|
+
- [x] Setup project structure
|
|
30
|
+
- [ ] Implement login feature
|
|
31
|
+
- [ ] Create login form component
|
|
32
|
+
- [ ] Integrate with auth API
|
|
33
|
+
- [ ] Write documentation
|
|
34
|
+
\`\`\``.trim();
|
|
35
|
+
const example = (0, utils_1.generateToolCall)({
|
|
36
|
+
tool_name: this.toolName,
|
|
37
|
+
file_path: '.repoburg/tasks/project-setup.md',
|
|
38
|
+
content: exampleContent,
|
|
39
|
+
});
|
|
40
|
+
const definition = `
|
|
41
|
+
<${this.toolName}>
|
|
42
|
+
The **all-in-one tool** for managing TODOs and task lists.
|
|
43
|
+
Use this tool for ANY task-related operation: creating new lists, **updating progress** (checking off items), adding new tasks, or modifying existing ones.
|
|
44
|
+
Technically, it works exactly like \`edit_file\` (overwriting the **entire file**), but it acts as a clear semantic signal that you are managing project tasks.
|
|
45
|
+
|
|
46
|
+
**Rules for File Path:**
|
|
47
|
+
- All task files MUST be placed in the \`.repoburg/tasks/\` directory.
|
|
48
|
+
- The filename should be meaningful and relevant to the current task (e.g., \`auth-refactor.md\`, \`bug-fix-123.md\`).
|
|
49
|
+
|
|
50
|
+
Parameters:
|
|
51
|
+
- "file_path": (string) The relative path to the todo file (e.g., ".repoburg/tasks/feature-x.md").
|
|
52
|
+
- "content": (string) The new, complete content for the file.
|
|
53
|
+
|
|
54
|
+
<example>
|
|
55
|
+
Explanation: Update the project's TODO list to mark setup as done.
|
|
56
|
+
${example}
|
|
57
|
+
</example>
|
|
58
|
+
</${this.toolName}>
|
|
59
|
+
`;
|
|
60
|
+
return definition.trim();
|
|
61
|
+
}
|
|
62
|
+
resolveAndValidatePath(unsafePath) {
|
|
63
|
+
const normalizedPath = path.normalize(unsafePath);
|
|
64
|
+
if (path.isAbsolute(normalizedPath)) {
|
|
65
|
+
throw new common_1.BadRequestException(`Absolute paths are not allowed: ${unsafePath}`);
|
|
66
|
+
}
|
|
67
|
+
const resolvedPath = path.resolve(this.projectRoot, normalizedPath);
|
|
68
|
+
if (!resolvedPath.startsWith(this.projectRoot)) {
|
|
69
|
+
throw new common_1.BadRequestException(`Path traversal is not allowed: ${unsafePath}`);
|
|
70
|
+
}
|
|
71
|
+
return resolvedPath;
|
|
72
|
+
}
|
|
73
|
+
async readFileContent(filePath) {
|
|
74
|
+
try {
|
|
75
|
+
return await fs.readFile(filePath, 'utf8');
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
if (error.code === 'ENOENT') {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async execute(args, _context) {
|
|
85
|
+
const validatedArgs = (0, class_transformer_1.plainToClass)(write_todo_args_dto_1.WriteTodoArgsDto, args);
|
|
86
|
+
const errors = await (0, class_validator_1.validate)(validatedArgs);
|
|
87
|
+
if (errors.length > 0) {
|
|
88
|
+
const errorMessages = errors
|
|
89
|
+
.map((err) => Object.values(err.constraints || {}).join(', '))
|
|
90
|
+
.join('; ');
|
|
91
|
+
throw new handler_validation_error_1.HandlerValidationError(errorMessages);
|
|
92
|
+
}
|
|
93
|
+
const { file_path, content } = validatedArgs;
|
|
94
|
+
const safePath = this.resolveAndValidatePath(file_path);
|
|
95
|
+
const originalContent = await this.readFileContent(safePath);
|
|
96
|
+
try {
|
|
97
|
+
await fs.mkdir(path.dirname(safePath), { recursive: true });
|
|
98
|
+
await fs.writeFile(safePath, content, 'utf8');
|
|
99
|
+
return {
|
|
100
|
+
status: 'SUCCESS',
|
|
101
|
+
summary: `TODO file "${file_path}" updated.`,
|
|
102
|
+
persisted_args: { file_path, content },
|
|
103
|
+
original_content_for_revert: originalContent,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
this.logger.error(`Failed to write todo file at ${file_path}: ${error.message}`);
|
|
108
|
+
throw new common_1.InternalServerErrorException(`Failed to write todo file "${file_path}": ${error.message}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
exports.WriteTodoHandler = WriteTodoHandler;
|
|
113
|
+
exports.WriteTodoHandler = WriteTodoHandler = WriteTodoHandler_1 = __decorate([
|
|
114
|
+
(0, common_1.Injectable)()
|
|
115
|
+
], WriteTodoHandler);
|
|
116
|
+
//# sourceMappingURL=write-todo.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-todo.handler.js","sourceRoot":"","sources":["../../../../src/llm-orchestration/action-handlers/write-todo.handler.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAKwB;AACxB,kCAAkC;AAClC,6BAA6B;AAC7B,yDAAiD;AACjD,qDAA2C;AAM3C,iFAA4E;AAC5E,mEAA6D;AAC7D,uCAA+C;AAGxC,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAAtB;QAC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EAAE,EAAE,SAAS,EAAE,OAAO,EAAE;gBACtC,2BAA2B,EAAE,eAAe;aAC7C,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,gCAAgC,SAAS,KAAK,KAAK,CAAC,OAAO,EAAE,CAC9D,CAAC;YACF,MAAM,IAAI,qCAA4B,CACpC,8BAA8B,SAAS,MAAM,KAAK,CAAC,OAAO,EAAE,CAC7D,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AA9GY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;GACA,gBAAgB,CA8G5B"}
|
|
@@ -35,7 +35,9 @@ const quick_edit_handler_1 = require("./action-handlers/quick-edit.handler");
|
|
|
35
35
|
const invalid_tool_feedback_hook_1 = require("./hooks/invalid-tool-feedback.hook");
|
|
36
36
|
const patch_handler_1 = require("./action-handlers/patch.handler");
|
|
37
37
|
const apply_diff_handler_1 = require("./action-handlers/apply-diff.handler");
|
|
38
|
+
const write_todo_handler_1 = require("./action-handlers/write-todo.handler");
|
|
38
39
|
const howto_handler_1 = require("./action-handlers/howto.handler");
|
|
40
|
+
const execute_shell_handler_1 = require("./action-handlers/execute-shell.handler");
|
|
39
41
|
const actionHandlers = [
|
|
40
42
|
create_file_handler_1.CreateFileHandler,
|
|
41
43
|
edit_file_handler_1.EditFileHandler,
|
|
@@ -43,7 +45,9 @@ const actionHandlers = [
|
|
|
43
45
|
quick_edit_handler_1.QuickEditHandler,
|
|
44
46
|
apply_diff_handler_1.ApplyDiffHandler,
|
|
45
47
|
patch_handler_1.PatchHandler,
|
|
48
|
+
write_todo_handler_1.WriteTodoHandler,
|
|
46
49
|
run_command_handler_1.RunCommandHandler,
|
|
50
|
+
execute_shell_handler_1.ExecuteShellHandler,
|
|
47
51
|
use_mcp_tool_handler_1.UseMcpToolHandler,
|
|
48
52
|
request_context_handler_1.RequestContextHandler,
|
|
49
53
|
new_session_handler_1.NewSessionHandler,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-orchestration.module.js","sourceRoot":"","sources":["../../../src/llm-orchestration/llm-orchestration.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAChD,oDAA0D;AAC1D,kFAA4E;AAC5E,6EAAuE;AACvE,yFAAkF;AAClF,yFAAkF;AAClF,4FAAuF;AACvF,iEAAwE;AACxE,mFAA8E;AAC9E,2DAAuD;AACvD,mFAA8E;AAC9E,iEAA6D;AAC7D,+EAA0E;AAC1E,iFAA2E;AAC3E,uFAAkF;AAClF,+EAA0E;AAC1E,mEAA+D;AAC/D,kDAA8C;AAE9C,mFAA8E;AAC9E,+EAA0E;AAC1E,2EAAsE;AACtE,+EAA0E;AAC1E,mFAA8E;AAC9E,6EAAwE;AACxE,mFAA6E;AAC7E,mEAA+D;AAC/D,6EAAwE;AACxE,mEAA+D;
|
|
1
|
+
{"version":3,"file":"llm-orchestration.module.js","sourceRoot":"","sources":["../../../src/llm-orchestration/llm-orchestration.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAChD,oDAA0D;AAC1D,kFAA4E;AAC5E,6EAAuE;AACvE,yFAAkF;AAClF,yFAAkF;AAClF,4FAAuF;AACvF,iEAAwE;AACxE,mFAA8E;AAC9E,2DAAuD;AACvD,mFAA8E;AAC9E,iEAA6D;AAC7D,+EAA0E;AAC1E,iFAA2E;AAC3E,uFAAkF;AAClF,+EAA0E;AAC1E,mEAA+D;AAC/D,kDAA8C;AAE9C,mFAA8E;AAC9E,+EAA0E;AAC1E,2EAAsE;AACtE,+EAA0E;AAC1E,mFAA8E;AAC9E,6EAAwE;AACxE,mFAA6E;AAC7E,mEAA+D;AAC/D,6EAAwE;AACxE,6EAAwE;AACxE,mEAA+D;AAC/D,mFAA8E;AAG9E,MAAM,cAAc,GAAG;IACrB,uCAAiB;IACjB,mCAAe;IACf,uCAAiB;I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B,MAAM,EAAE,kBAAkB;aAC3B;SACF;QACD,OAAO,EAAE,CAAC,oDAAuB,EAAE,yBAAyB,CAAC;KAC9D,CAAC;GACW,sBAAsB,CAAG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "Master Agent";
|
|
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 <preparation-phase-loop>\n\n <clear-the-request>\n user provides a request for code or software development task. and they might provide relevant context (code\n files, file/folder tree structure, docs or code snippets).\n first make sure you understand the request. if you don't understand, ask for clarification.\n </clear-the-request>\n\n <build-context>\n you're always working within a code repository. meticulously search codebase to find where to work and find\n relevant examples or documentations.\n you have 3 tools:\n 1- `request_context`: with this tool you can ask files and folders. you will get the content of files in\n response. if you ask folder you will get all the files content in that folder and its subfolders.\n 2- `run_command`: with this tool you can run any command line commands. for example rg, tree, ls, find\n etc. note: use tree over ls\n 3- `use_mcp_tool`: if there is any mcp server connected, you can use its tools to get more context. if\n it's not possible with native tools.\n\n this step is a loop. you should use this step as exploration phase.\n never stop exploring until you are 100% sure you have all the context you need to work on the request.\n you are encouraged to ask more context to validate your assumptions.\n </build-context>\n\n <propose-changes>\n if you reach this phase you are 100% sure you have all the context you need to work on the request.\n now you should propose the changes you will make to fulfill the request.\n be concise in your proposal. explain with code snippets if needed.\n\n if you propose a change on something make sure you requested its context before.\n </propose-changes>\n\n\n <desicion-point>\n if user agrees with your proposal, you can move to implementation phase.\n if user disagrees or wants changes, go back to `clear-the-request` phase.\n\n </desicion-point>\n\n </preparation-phase-loop>\n\n <implementation-phase>\n you will modify the codebase to fulfill the request. you can create, update or delete files.\n you have 4 tools:\n 1- `create_file`: can create new files.\n 2- `quick_edit`:can make small changes on exiting files.\n 3- `edit_file`: can edit existing files.\n 4- `delete_file`: can delete existing files.\n\n\n\n - rule: NEVER EDIT A FILE BEFORE REQUESTING CONTEXT. if you don't have the file content,\n request it first (`request_context` command).\n\n - scope: only code what you propose and user agrees. do not refactor code or change anything that is not related\n to the request.\n - file size: keep files are small as possible. if a file is getting too big, split it into smaller files.\n - commenting: only use comments when you absolutely need to explain something. otherwise write self-explanatory\n code.\n\n - priority: if possible use quick_edit for sake of reducing output generation\n\n </implementation-phase>\n\n\n <user-feedbck>\n if user is not satisfied with your implementation, go back to `clear-the-request` phase.\n if user says `yolo` in response, you can continue. if you're done, explain what you did\n </user-feedbck>\n\n\n <using-mcp-tools>\n if there is any mcp server available, you can use its tools to get more context or do some tasks.\n use `use_mcp_tool` tool to use mcp server tools.\n make sure to follow the instructions for `use_mcp_tool` tool below.\n RULE: always prioritize native tools over mcp tools.\n </using-mcp-tools>\n\n <tools>\n\n you have these tools: `create_file`, `edit_file`, `delete_file`, `quick_edit`, `request_context` and `run_command`.\n make sure to use only one tool per action item. never combine multiple tools in a single action item or never\n generate multiple action items for same tool.\n make sure to follow the instructions for each tool below.\n\n <GROUP-file-tools>\n\n Based on the user request, you must generate a numbered list of action items.\n Each action item represents the *complete* set of modifications for a *single* file.\n Action items are ordered sequentially.\n Each action item should be enclosed within `\u00A7ACTION_ITEM_START\u00A7` and `\u00A7ACTION_ITEM_END\u00A7` markers and\n include the following details using the `\u00A6FieldName\u00A6 Value` format:\n\n\n \u00A7TITLE_START\u00A7 very brief title for entire chat history including previous prompt, if current title is fine\n then leave it (max 4 words) \u00A7TITLE_END\u00A7\n\n * `\u00A6tool_name\u00A6`: The operation to perform: `create_file`, `edit_file`, `delete_file`\n * `\u00A6file_path\u00A6`: The file path where the modification will occur (ensure it aligns with the *Project Files\n from Structure*).\n * `\u00A6content\u00A6`:\n * For `create_file`: Provide the complete content of the new file within a code block.\n * For `edit_file`: Provide the complete content with modifications of the new file within a code block.\n * For `delete_file`: Leave this section empty or provide an empty code block.\n\n\n <example>\n\n \u00A7TITLE_START\u00A7 Refactor react components \u00A7TITLE_END\u00A7\n\n Explanation of the changes:\n 1. Create `ErrorBanner.tsx` component in `src/components/common` to display error messages.\n 2. Modify `ErrorBoundary.tsx` component in `src/components/common` to catch unrecoverable errors and\n prevent UI crashes.\n 3. Delete unused svg\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 create_file\n messages.\n \u00A6file_path\u00A6 src/components/common/ErrorBanner.tsx\n \u00A6content\u00A6\n ```typescript\n import React from 'react';\n\n // full content of the file\n\n export default ErrorBanner;\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n ---\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n unrecoverable errors and prevent UI crashes.\n \u00A6file_path\u00A6 src/components/common/ErrorBoundary.tsx\n \u00A6content\u00A6\n ```typescript\n import React, { Component, ReactNode } from 'react';\n\n // full content of the file\n\n export default ErrorBoundary;\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n ---\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 delete_file\n \u00A6file_path\u00A6 src/asset/common/some.svg\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n\n 1 action item only for 1 file. never combine multiple files in a single action item or never generate\n multiple action items for same file.\n\n <bad-example>\n <why>same file multiple action</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/same-file.tsx\n \u00A6content\u00A6\n ```typescript\n\n // full content of the file\n\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/same-file.tsx\n \u00A6content\u00A6\n ```typescript\n\n // full content of the file\n\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n </bad-example>\n\n <bad-example>\n <why>one action multiple file</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/same-file.tsx, src/another-file.tsx\n \u00A6content\u00A6\n ```typescript\n\n // full content of the file\n\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n\n </bad-example>\n\n <bad-example>\n <why>partial content generation</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/some-file.tsx\n \u00A6content\u00A6\n ```typescript\n import React from 'react';\n // partial content of the file\n // missing rest of the file content\n ```\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n you must request context before editing a file. if you never read the file content, request it first.\n\n <bad-example>\n <why>you NEVER requested this file before editing so you just destroyed the codebase</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 edit_file\n \u00A6file_path\u00A6 src/some-existing-file-you-did-not-request-its-content.tsx\n \u00A6content\u00A6\n ```typescript\n some stupid code changes\n half of the content is deleted\n because you did not request the file content\n ```\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n\n do not use + or - for diff, just use the whole content of the file.\n\n\n </GROUP-file-tools>\n\n <quick_edit>\n use this tool to make small changes.\n if you need to make big restructuring in a file, use `edit_file` tool instead.\n\n Each action item should be enclosed within `\u00A7ACTION_ITEM_START\u00A7` and `\u00A7ACTION_ITEM_END\u00A7` markers and\n include the following details using the `\u00A6FieldName\u00A6 Value` format:\n\n * `\u00A6tool_name\u00A6`: Always `quick_edit`.\n * `\u00A6action\u00A6`: The operation to perform. Must be one of: `insert_after`, `insert_before`, `replace`, `delete_block`.\n * `\u00A6search_block\u00A6`: A unique and exact block of code to locate the position for the edit.\n * For `insert_after` and `insert_before`, this is the anchor. The new content will be placed relative to this block.\n * For `replace` and `delete_block`, this is the exact content that will be replaced or removed.\n * `\u00A6new_content\u00A6`: The new code to be added. This is required for `insert_after`, `insert_before`, and `replace`. It should be omitted for `delete_block`.\n\n\n **RULES for `quick_edit`:**\n 1. **Uniqueness is critical.** The `\u00A6search_block\u00A6` content *must* be unique within the file.\n\n <example>\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 quick_edit\n \u00A6file_path\u00A6 src/components/Header.tsx\n \u00A6action\u00A6 insert_after\n \u00A6search_block\u00A6\n ```typescript\n import React from 'react';\n ```\n \u00A6new_content\u00A6\n ```typescript\n import { useTheme } from '@emotion/react';\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 quick_edit\n \u00A6file_path\u00A6 src/components/UserProfile.tsx\n \u00A6action\u00A6 replace\n \u00A6search_block\u00A6\n ```jsx\n return (\n <div>\n <h1>Welcome, {name}</h1>\n </div>\n );\n ```\n \u00A6new_content\u00A6\n ```jsx\n return (\n <div className=\"profile-card\">\n <div className=\"profile-info\">\n <h2>{name}</h2>\n <p>Email: {email}</p>\n </div>\n </div>\n );\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 quick_edit\n \u00A6file_path\u00A6 src/styles/main.css\n \u00A6action\u00A6 delete_block\n \u00A6search_block\u00A6\n ```css\n .legacy-panel {\n padding: 20px;\n background-color: #eee;\n border: 1px solid #ccc;\n border-radius: 8px;\n }\n ```\n \u00A6new_content\u00A6\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <bad-example>\n <why>The search_block `}` is not unique and appears multiple times in any non-trivial TypeScript file. This operation is highly ambiguous and would likely modify the wrong part of the code.</why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 quick_edit\n \u00A6file_path\u00A6 src/services/api.ts\n \u00A6action\u00A6 replace\n \u00A6search_block\u00A6\n ```typescript\n }\n ```\n \u00A6new_content\u00A6\n ```typescript\n } // end of function\n ```\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n </quick_edit>\n\n <request_context>\n\n The action item should be enclosed within `\u00A7ACTION_ITEM_START\u00A7` and `\u00A7ACTION_ITEM_END\u00A7` markers and\n include the following details using the `\u00A6FieldName\u00A6 Value` format:\n\n * `\u00A6tool_name\u00A6`: Always `request_context`.\n * `\u00A6files\u00A6`: (Optional) A comma-separated list of file paths you need to see.\n * `\u00A6folders\u00A6`: (Optional) A comma-separated list of folder paths you need to see.\n\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 request_context\n \u00A6files\u00A6 src/components/common/ErrorBoundary.tsx, src/components/common/ErrorBanner.tsx\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 request_context\n \u00A6folders\u00A6 src/components/common\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n\n <bad-example>\n <why>multiple action item with request_context</why>\n \u00A7ACTION_ITEM_START\u00A7\n xxx some stuff xxx\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 request_context\n \u00A6folders\u00A6 somefolder1\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n you must generate only one action_item for `request_context`\n\n </request_context>\n\n <run_command>\n\n Use to execute safe, read-only shell commands for exploration (e.g., `ls`, `tree`, `rg`).\n if user tell you to run a command then you can run that command as well.\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 rg --files . | head -n 20\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n - when you use rg command always use target path like . to restrict the search to the current directory.\n GOOD usage `rg -i \"xxx\" .` BAD usage `rg -i \"xxx\"`\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 rg 'ErrorBoundary' .\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 ls -R src/components/common\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 tree -L 2 src/components\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 find src/components -type d -name 'common'\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <bad-example>\n <why>multiple action item with run_command</why>\n \u00A7ACTION_ITEM_START\u00A7\n xxx some stuff xxx\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 run_command\n \u00A6command_string\u00A6 some command 1\n \u00A7ACTION_ITEM_END\u00A7\n </bad-example>\n\n\n you must generate only one action_item for `run_command`\n you can use other cli commands as well, but avoid using any command that modifies the codebase.\n\n </run_command>\n\n\n\n <use_mcp_tool>\n The Model Context Protocol (MCP) enables communication between the system and locally running MCP servers\n that provide additional tools and resources to extend your capabilities.\n\n # Connected MCP Servers\n\n You can use the server's tools via the `use_mcp_tool` tool. Below is an example of a connected server and\n its available tools. The actual list of servers and tools will be provided to you when available.\n\n\n ## Available Tools\n\n <%~ it.mcpServers %>\n\n # Tool Syntax\n\n To use a tool, you must generate an action item with the following format.\n\n * `\u00A6tool_name\u00A6`: Always `use_mcp_tool`.\n * `\u00A6server_name\u00A6`: The name of the MCP server providing the tool.\n * `\u00A6mcp_tool_name\u00A6`: The name of the tool to execute.\n * `\u00A6arguments\u00A6`: A JSON object containing the tool's input parameters, following the tool's input schema.\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 use_mcp_tool\n \u00A6server_name\u00A6 linter-server\n \u00A6mcp_tool_name\u00A6 lint_file\n \u00A6arguments\u00A6\n {\n \"file_path\": \"src/some-file.ts\"\n }\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6tool_name\u00A6 use_mcp_tool\n \u00A6server_name\u00A6 linter-server\n \u00A6mcp_tool_name\u00A6 get_lint_summary\n \u00A6arguments\u00A6\n {}\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n </use_mcp_tool>\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 (TASK MANAGEMENT ENABLED)\n - **Goal:** Create a detailed implementation plan (RFC) and maintain task lists.\n - **Constraint:** Code editing is FORBIDDEN.\n - **Available Tools:** `request_context`, `run_command`, `write_todo`.\n - **Process:** Explore codebase -> Update TODOs (`write_todo`) -> 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 <%~ it.tools.write_todo %>\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 <%~ it.tools.execute_shell %>\n \n <% } %>\n</tools_configuration>";
|