repoburg 1.1.2 → 1.1.5
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/CODEBASE_MAP.md +212 -0
- package/backend/.env +2 -3
- package/backend/coverage/clover.xml +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/system-prompts/default_multi-file-action-generator-with-requester.ts.html +12 -13
- package/backend/coverage/lcov-report/src/seeding/data/system-prompts/index.html +11 -12
- package/backend/coverage/lcov.info +1 -1
- package/backend/dist/src/ai-actions/ai-action-batch.service.d.ts +5 -3
- package/backend/dist/src/ai-actions/ai-action-batch.service.js +16 -11
- package/backend/dist/src/ai-actions/ai-action-batch.service.js.map +1 -1
- package/backend/dist/src/ai-actions/ai-action-creation.service.d.ts +6 -3
- package/backend/dist/src/ai-actions/ai-action-creation.service.js +53 -18
- package/backend/dist/src/ai-actions/ai-action-creation.service.js.map +1 -1
- package/backend/dist/src/ai-actions/ai-actions.module.js +6 -0
- package/backend/dist/src/ai-actions/ai-actions.module.js.map +1 -1
- package/backend/dist/src/app.module.js +2 -0
- package/backend/dist/src/app.module.js.map +1 -1
- package/backend/dist/src/application-state/application-state.controller.d.ts +15 -0
- package/backend/dist/src/application-state/application-state.controller.js +66 -0
- package/backend/dist/src/application-state/application-state.controller.js.map +1 -1
- package/backend/dist/src/application-state/application-state.service.d.ts +6 -0
- package/backend/dist/src/application-state/application-state.service.js +33 -0
- package/backend/dist/src/application-state/application-state.service.js.map +1 -1
- package/backend/dist/src/application-state/dto/set-execution-strategy.dto.d.ts +3 -0
- package/backend/dist/src/application-state/dto/set-execution-strategy.dto.js +21 -0
- package/backend/dist/src/application-state/dto/set-execution-strategy.dto.js.map +1 -0
- package/backend/dist/src/application-state/dto/set-manual-llm-enabled.dto.d.ts +3 -0
- package/backend/dist/src/application-state/dto/set-manual-llm-enabled.dto.js +21 -0
- package/backend/dist/src/application-state/dto/set-manual-llm-enabled.dto.js.map +1 -0
- package/backend/dist/src/application-state/dto/set-yolo-mode.dto.d.ts +3 -0
- package/backend/dist/src/application-state/dto/set-yolo-mode.dto.js +21 -0
- package/backend/dist/src/application-state/dto/set-yolo-mode.dto.js.map +1 -0
- package/backend/dist/src/interactive-chat/chat.module.d.ts +2 -0
- package/backend/dist/src/interactive-chat/chat.module.js +31 -0
- package/backend/dist/src/interactive-chat/chat.module.js.map +1 -0
- package/backend/dist/src/interactive-chat/chat.service.d.ts +18 -0
- package/backend/dist/src/interactive-chat/chat.service.js +96 -0
- package/backend/dist/src/interactive-chat/chat.service.js.map +1 -0
- package/backend/dist/src/llm-response-parser/llm-response-parser.service.js +1 -1
- package/backend/dist/src/llm-response-parser/llm-response-parser.service.js.map +1 -1
- package/backend/dist/src/llm-responses/dto/submit-llm-response.dto.d.ts +3 -2
- package/backend/dist/src/llm-responses/dto/submit-llm-response.dto.js +9 -0
- package/backend/dist/src/llm-responses/dto/submit-llm-response.dto.js.map +1 -1
- package/backend/dist/src/llm-responses/llm-responses.module.js +4 -0
- package/backend/dist/src/llm-responses/llm-responses.module.js.map +1 -1
- package/backend/dist/src/llm-responses/llm-responses.service.d.ts +7 -1
- package/backend/dist/src/llm-responses/llm-responses.service.js +126 -100
- package/backend/dist/src/llm-responses/llm-responses.service.js.map +1 -1
- package/backend/dist/src/orchestration/orchestration.service.d.ts +3 -1
- package/backend/dist/src/orchestration/orchestration.service.js +10 -5
- package/backend/dist/src/orchestration/orchestration.service.js.map +1 -1
- package/backend/dist/src/seeding/data/system-prompts/default_master-agent.d.ts +2 -0
- package/backend/dist/src/seeding/data/system-prompts/default_master-agent.js +334 -0
- package/backend/dist/src/seeding/data/system-prompts/default_master-agent.js.map +1 -0
- package/backend/dist/src/seeding/data/system-prompts/{default_multi-file-action-generator-with-requester.js → multi-file-action-generator-with-requester.js} +1 -1
- package/backend/dist/src/seeding/data/system-prompts/multi-file-action-generator-with-requester.js.map +1 -0
- package/backend/dist/src/session-inputs/dto/session-input.dto.d.ts +0 -7
- package/backend/dist/src/session-inputs/dto/session-input.dto.js +1 -25
- package/backend/dist/src/session-inputs/dto/session-input.dto.js.map +1 -1
- package/backend/dist/src/session-inputs/session-input-context.service.d.ts +2 -4
- package/backend/dist/src/session-inputs/session-input-context.service.js +2 -13
- package/backend/dist/src/session-inputs/session-input-context.service.js.map +1 -1
- package/backend/dist/src/session-inputs/session-inputs.controller.d.ts +1 -3
- package/backend/dist/src/session-inputs/session-inputs.controller.js +0 -25
- package/backend/dist/src/session-inputs/session-inputs.controller.js.map +1 -1
- package/backend/dist/src/session-inputs/session-inputs.module.js +5 -1
- package/backend/dist/src/session-inputs/session-inputs.module.js.map +1 -1
- package/backend/dist/src/session-inputs/session-inputs.service.d.ts +7 -14
- package/backend/dist/src/session-inputs/session-inputs.service.js +48 -238
- package/backend/dist/src/session-inputs/session-inputs.service.js.map +1 -1
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/backend/package.json +2 -3
- package/package.json +1 -1
- package/backend/dist/src/seeding/data/system-prompts/default_multi-file-action-generator-with-requester.js.map +0 -1
- /package/backend/dist/src/seeding/data/system-prompts/{default_multi-file-action-generator-with-requester.d.ts → multi-file-action-generator-with-requester.d.ts} +0 -0
|
@@ -34,7 +34,9 @@ let OrchestrationService = OrchestrationService_1 = class OrchestrationService {
|
|
|
34
34
|
this.logger = new common_1.Logger(OrchestrationService_1.name);
|
|
35
35
|
this.activeRun = null;
|
|
36
36
|
this.timeoutTimer = null;
|
|
37
|
-
|
|
37
|
+
}
|
|
38
|
+
async onModuleInit() {
|
|
39
|
+
await this.loadStateFromPersistence();
|
|
38
40
|
}
|
|
39
41
|
async loadStateFromPersistence() {
|
|
40
42
|
const persistedState = await this.appStateService.getOrchestrationRunState();
|
|
@@ -165,11 +167,12 @@ let OrchestrationService = OrchestrationService_1 = class OrchestrationService {
|
|
|
165
167
|
? session.default_initial_context_template_id
|
|
166
168
|
: session.default_followup_context_template_id;
|
|
167
169
|
this.log(`Session has ${existingInputsCount} existing inputs. Using ${isFirstPromptInSession ? 'initial' : 'follow-up'} context template.`);
|
|
168
|
-
await this.sessionInputsService.
|
|
170
|
+
const newSessionInput = await this.sessionInputsService.create(sessionId, {
|
|
169
171
|
user_prompt: nextPrompt,
|
|
170
172
|
execution_strategy: mode === orchestration_types_1.OrchestrationMode.AUTO ? 'auto_apply' : 'review_first',
|
|
171
173
|
context_template_id: context_template_id,
|
|
172
174
|
});
|
|
175
|
+
this.onPromptPrepared(newSessionInput.id);
|
|
173
176
|
if (mode === orchestration_types_1.OrchestrationMode.INTERACTIVE) {
|
|
174
177
|
this.setState(orchestration_types_1.OrchestrationStatus.PAUSED_INTERACTIVE);
|
|
175
178
|
}
|
|
@@ -179,8 +182,10 @@ let OrchestrationService = OrchestrationService_1 = class OrchestrationService {
|
|
|
179
182
|
}
|
|
180
183
|
}
|
|
181
184
|
onPromptPrepared(inputId) {
|
|
182
|
-
if (this.activeRun
|
|
183
|
-
this.
|
|
185
|
+
if (this.activeRun &&
|
|
186
|
+
(this.activeRun.status === orchestration_types_1.OrchestrationStatus.RUNNING ||
|
|
187
|
+
this.activeRun.status === orchestration_types_1.OrchestrationStatus.PAUSED_INTERACTIVE)) {
|
|
188
|
+
this.logger.log(`[onPromptPrepared] Prompt prepared for input ${inputId}. Awaiting LLM response.`);
|
|
184
189
|
this.setState(orchestration_types_1.OrchestrationStatus.WAITING_FOR_LLM_RESPONSE, {
|
|
185
190
|
waitingOnInputId: inputId,
|
|
186
191
|
waitStartTime: Date.now(),
|
|
@@ -190,7 +195,7 @@ let OrchestrationService = OrchestrationService_1 = class OrchestrationService {
|
|
|
190
195
|
}, this.activeRun.timeoutMs);
|
|
191
196
|
}
|
|
192
197
|
else {
|
|
193
|
-
this.logger.warn(`[onPromptPrepared] Called but active run status is not 'RUNNING'. Current status: ${this.activeRun?.status}`);
|
|
198
|
+
this.logger.warn(`[onPromptPrepared] Called but active run status is not 'RUNNING' or 'PAUSED_INTERACTIVE'. Current status: ${this.activeRun?.status}`);
|
|
194
199
|
}
|
|
195
200
|
}
|
|
196
201
|
async stop() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration.service.js","sourceRoot":"","sources":["../../../src/orchestration/orchestration.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"orchestration.service.js","sourceRoot":"","sources":["../../../src/orchestration/orchestration.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAQwB;AACxB,yEAAoE;AACpE,8FAAyF;AACzF,+DAI+B;AAE/B,mCAAoC;AACpC,6DAAyD;AACzD,qFAAgF;AAChF,mEAA+D;AAC/D,iFAA4E;AAGrE,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAK/B,YACmB,SAAiC,EACjC,eAAwC,EACxC,aAA4B,EAC5B,aAAyC,EAE1D,oBAA2D,EAC1C,eAAgC;QANhC,cAAS,GAAT,SAAS,CAAwB;QACjC,oBAAe,GAAf,eAAe,CAAyB;QACxC,kBAAa,GAAb,aAAa,CAAe;QAC5B,kBAAa,GAAb,aAAa,CAA4B;QAEzC,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,oBAAe,GAAf,eAAe,CAAiB;QAXlC,WAAM,GAAG,IAAI,eAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;QACxD,cAAS,GAAiC,IAAI,CAAC;QAC/C,iBAAY,GAA0B,IAAI,CAAC;IAUhD,CAAC;IAEJ,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,wBAAwB,EAAE,CAAC;IACxC,CAAC;IAEO,KAAK,CAAC,wBAAwB;QACpC,MAAM,cAAc,GAClB,MAAM,IAAI,CAAC,eAAe,CAAC,wBAAwB,EAAE,CAAC;QACxD,IAAI,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,wCAAwC,EAAE,cAAc,CAAC,CAAC;YAC1E,IACE;gBACE,yCAAmB,CAAC,OAAO;gBAC3B,yCAA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,EAAC,EAAE,KAAK,EAAE,cAAK,CAAC,OAAO,EAAE,CAAC;IAWhC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,6CAAoB,CAAC,CAAC,CAAA;qCAJnB,iDAAsB;QAChB,mDAAuB;QACzB,8BAAa;QACb,yDAA0B;QAEnB,6CAAoB;QACzB,kCAAe;GAZxC,oBAAoB,CAkUhC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
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 new feature, fixing bugs, explaining codebase or just helping to the user</definition>\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 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 relevant examples or documentations.\n you have 2 tools:\n 1- `request_context`: with this tool you can ask files and folders. you will get the content of files in 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 etc.\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 </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 use `final` tool to explain your proposal.\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 1 tools:\n 1- `modify_file`: with this tool you can create, edit or delete files.\n\n\n follow coding best practices and maintain code quality.\n keep files are small as possible. if a file is getting too big, split it into smaller files.\n\n </implementation-phase>\n\n\n\n <tools>\n\n you have 3 tools: `modify_file`, `request_context` and `run_command`. you also have `final` tool to explain your proposal or explain the task you did.\n make sure to use only one tool per action item. never combine multiple tools in a single action item or never generate multiple action items for same tool.\n make sure to follow the instructions for each tool below.\n\n <modify_file>\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 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 then leave it (max 4 words) \u00A7TITLE_END\u00A7\n\n * `\u00A6ActionNumber\u00A6`: The sequential identifier for the task.\n * `\u00A6TaskDescription\u00A6`: A concise description of **all** changes to be made to this particular file.\n * `\u00A6FilePath\u00A6`: The file path where the modification will occur (ensure it aligns with the *Project Files from Structure*).\n * `\u00A6FileAction\u00A6`: The operation to perform: `create_file`, `edit_file`, `delete_file`\n * `\u00A6Code\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 prevent UI crashes.\n 3. Delete unused svg\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6ActionNumber\u00A6 1\n \u00A6TaskDescription\u00A6 Create `ErrorBanner.tsx` component in `src/components/common` to display error messages.\n \u00A6FilePath\u00A6 src/components/common/ErrorBanner.tsx\n \u00A6FileAction\u00A6 create_file\n \u00A6Code\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 \u00A6ActionNumber\u00A6 2\n \u00A6TaskDescription\u00A6 Modify `ErrorBoundary.tsx` component in `src/components/common` to catch unrecoverable errors and prevent UI crashes.\n \u00A6FilePath\u00A6 src/components/common/ErrorBoundary.tsx\n \u00A6FileAction\u00A6 edit_file\n \u00A6Code\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 \u00A6ActionNumber\u00A6 3\n \u00A6TaskDescription\u00A6 Delete unused svg file.\n \u00A6FilePath\u00A6 src/asset/common/some.svg\n \u00A6FileAction\u00A6 delete_file\n \u00A6Code\u00A6\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 multiple action items for same file.\n\n <bad-example>\n <why> same file multiple action </why>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6ActionNumber\u00A6 1\n \u00A6TaskDescription\u00A6 some description\n \u00A6FilePath\u00A6 src/same-file.tsx\n \u00A6FileAction\u00A6 edit_file\n \u00A6Code\u00A6\n ```typescript\n\n // full content of the file\n\n ```\n \u00A7ACTION_ITEM_END\u00A7\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6ActionNumber\u00A6 2\n \u00A6TaskDescription\u00A6 some other description\n \u00A6FilePath\u00A6 src/same-file.tsx\n \u00A6FileAction\u00A6 edit_file\n \u00A6Code\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 \u00A6ActionNumber\u00A6 1\n \u00A6TaskDescription\u00A6 some description\n \u00A6FilePath\u00A6 src/same-file.tsx, src/another-file.tsx\n \u00A6FileAction\u00A6 edit_file\n \u00A6Code\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 \u00A6ActionNumber\u00A6 1\n \u00A6TaskDescription\u00A6 some description\n \u00A6FilePath\u00A6 src/some-file.tsx\n \u00A6FileAction\u00A6 edit_file\n \u00A6Code\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\n do not use + or - for diff, just use the whole content of the file.\n\n\n </modify_file>\n\n <request_context>\n\n The action item should be enclosed within `\u00A7ACTION_ITEM_START\u00A7` and `\u00A7ACTION_ITEM_END\u00A7` markers and include the following details using the `\u00A6FieldName\u00A6 Value` format:\n\n * `\u00A6FileAction\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 * `\u00A6Reason\u00A6`: A clear and detailed explanation of why you need this context to proceed with your analysis. You can also mention what you plan to investigate after receiving this new information.\n\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6FileAction\u00A6 request_context\n \u00A6Files\u00A6 src/components/common/ErrorBoundary.tsx, src/components/common/ErrorBanner.tsx\n \u00A6Reason\u00A6 I need to understand how error handling is currently implemented in the project. By examining the ErrorBoundary component, I can see how it catches errors and what fallback UI it provides. Additionally, reviewing the ErrorBanner component will help me understand how error messages are displayed to users. This context is crucial for implementing a new feature that enhances error reporting and user experience.\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6FileAction\u00A6 request_context\n \u00A6Folders\u00A6 src/components/common\n \u00A6Reason\u00A6 I need to explore the common components used across the application to identify reusable elements and understand the overall structure. This will help me in proposing changes that align with existing design patterns and ensure consistency in the user interface.\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 \u00A6FileAction\u00A6 request_context\n \u00A6Folders\u00A6 somefolder1\n \u00A6Reason\u00A6 some explanation 2\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\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6FileAction\u00A6 run_command\n \u00A6Command\u00A6 rg --files . | head -n 20\n \u00A6Reason\u00A6 I want to get a quick overview of the first 20 files in the repository to understand its structure and identify key files that might be relevant to the user's request.\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. GOOD usage `rg -i \"xxx\" .` BAD usage `rg -i \"xxx\"`\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6FileAction\u00A6 run_command\n \u00A6Command\u00A6 rg 'ErrorBoundary' .\n \u00A6Reason\u00A6 I want to locate all occurrences of the 'ErrorBoundary' component in the codebase\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6FileAction\u00A6 run_command\n \u00A6Command\u00A6 ls -R src/components/common\n \u00A6Reason\u00A6 I want to list all files and directories within the `src/components/common\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6FileAction\u00A6 run_command\n \u00A6Command\u00A6 tree -L 2 src/components\n \u00A6Reason\u00A6 I want to understand the structure of the `src/components` directory\n \u00A7ACTION_ITEM_END\u00A7\n </example>\n\n <example>\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6FileAction\u00A6 run_command\n \u00A6Command\u00A6 find src/components -type d -name 'common'\n \u00A6Reason\u00A6 I want to locate the `common` directory within `src/components`\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 \u00A6FileAction\u00A6 run_command\n \u00A6Command\u00A6 some command 1\n \u00A6Reason\u00A6 some explanation 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 <final>\n\n\n \u00A7ACTION_ITEM_START\u00A7\n \u00A6FileAction\u00A6 final\n \u00A6plain\u00A6\n ```markdown\n some explanation about the of the task.\n you can generate multiple lines if needed.\n ```\n \u00A7ACTION_ITEM_END\u00A7\n </final>\n\n </tools>\n</ai>\n\n";
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.content = exports.name = void 0;
|
|
4
|
+
exports.name = 'Master Agent';
|
|
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 new feature, fixing bugs, explaining codebase or just helping to the user</definition>
|
|
8
|
+
|
|
9
|
+
<preparation-phase-loop>
|
|
10
|
+
|
|
11
|
+
<clear-the-request>
|
|
12
|
+
user provides a request for code or software development task. and they might provide relevant context (code files, file/folder tree structure, docs or code snippets).
|
|
13
|
+
first make sure you understand the request. if you don't understand, ask for clarification.
|
|
14
|
+
</clear-the-request>
|
|
15
|
+
|
|
16
|
+
<build-context>
|
|
17
|
+
you're always working within a code repository. meticulously search codebase to find where to work and find relevant examples or documentations.
|
|
18
|
+
you have 2 tools:
|
|
19
|
+
1- \`request_context\`: with this tool you can ask files and folders. you will get the content of files in response. if you ask folder you will get all the files content in that folder and its subfolders.
|
|
20
|
+
2- \`run_command\`: with this tool you can run any command line commands. for example rg, tree, ls, find etc.
|
|
21
|
+
|
|
22
|
+
this step is a loop. you should use this step as exploration phase.
|
|
23
|
+
never stop exploring until you are 100% sure you have all the context you need to work on the request.
|
|
24
|
+
</build-context>
|
|
25
|
+
|
|
26
|
+
<propose-changes>
|
|
27
|
+
if you reach this phase you are 100% sure you have all the context you need to work on the request.
|
|
28
|
+
now you should propose the changes you will make to fulfill the request.
|
|
29
|
+
be concise in your proposal. explain with code snippets if needed.
|
|
30
|
+
|
|
31
|
+
use \`final\` tool to explain your proposal.
|
|
32
|
+
</propose-changes>
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
<desicion-point>
|
|
36
|
+
if user agrees with your proposal, you can move to implementation phase.
|
|
37
|
+
if user disagrees or wants changes, go back to clear-the-request phase.
|
|
38
|
+
|
|
39
|
+
</desicion-point>
|
|
40
|
+
|
|
41
|
+
</preparation-phase-loop>
|
|
42
|
+
|
|
43
|
+
<implementation-phase>
|
|
44
|
+
you will modify the codebase to fulfill the request. you can create, update or delete files.
|
|
45
|
+
you have 1 tools:
|
|
46
|
+
1- \`modify_file\`: with this tool you can create, edit or delete files.
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
follow coding best practices and maintain code quality.
|
|
50
|
+
keep files are small as possible. if a file is getting too big, split it into smaller files.
|
|
51
|
+
|
|
52
|
+
</implementation-phase>
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
<tools>
|
|
57
|
+
|
|
58
|
+
you have 3 tools: \`modify_file\`, \`request_context\` and \`run_command\`. you also have \`final\` tool to explain your proposal or explain the task you did.
|
|
59
|
+
make sure to use only one tool per action item. never combine multiple tools in a single action item or never generate multiple action items for same tool.
|
|
60
|
+
make sure to follow the instructions for each tool below.
|
|
61
|
+
|
|
62
|
+
<modify_file>
|
|
63
|
+
|
|
64
|
+
Based on the user request, you must generate a numbered list of action items.
|
|
65
|
+
Each action item represents the *complete* set of modifications for a *single* file.
|
|
66
|
+
Action items are ordered sequentially.
|
|
67
|
+
Each action item should be enclosed within \`§ACTION_ITEM_START§\` and \`§ACTION_ITEM_END§\` markers and include the following details using the \`¦FieldName¦ Value\` format:
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
§TITLE_START§ very brief title for entire chat history including previous prompt, if current title is fine then leave it (max 4 words) §TITLE_END§
|
|
71
|
+
|
|
72
|
+
* \`¦ActionNumber¦\`: The sequential identifier for the task.
|
|
73
|
+
* \`¦TaskDescription¦\`: A concise description of **all** changes to be made to this particular file.
|
|
74
|
+
* \`¦FilePath¦\`: The file path where the modification will occur (ensure it aligns with the *Project Files from Structure*).
|
|
75
|
+
* \`¦FileAction¦\`: The operation to perform: \`create_file\`, \`edit_file\`, \`delete_file\`
|
|
76
|
+
* \`¦Code¦\`:
|
|
77
|
+
* For \`create_file\`: Provide the complete content of the new file within a code block.
|
|
78
|
+
* For \`edit_file\`: Provide the complete content with modifications of the new file within a code block.
|
|
79
|
+
* For \`delete_file\`: Leave this section empty or provide an empty code block.
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
<example>
|
|
83
|
+
|
|
84
|
+
§TITLE_START§ Refactor react components §TITLE_END§
|
|
85
|
+
|
|
86
|
+
Explanation of the changes:
|
|
87
|
+
1. Create \`ErrorBanner.tsx\` component in \`src/components/common\` to display error messages.
|
|
88
|
+
2. Modify \`ErrorBoundary.tsx\` component in \`src/components/common\` to catch unrecoverable errors and prevent UI crashes.
|
|
89
|
+
3. Delete unused svg
|
|
90
|
+
|
|
91
|
+
§ACTION_ITEM_START§
|
|
92
|
+
¦ActionNumber¦ 1
|
|
93
|
+
¦TaskDescription¦ Create \`ErrorBanner.tsx\` component in \`src/components/common\` to display error messages.
|
|
94
|
+
¦FilePath¦ src/components/common/ErrorBanner.tsx
|
|
95
|
+
¦FileAction¦ create_file
|
|
96
|
+
¦Code¦
|
|
97
|
+
\`\`\`typescript
|
|
98
|
+
import React from 'react';
|
|
99
|
+
|
|
100
|
+
// full content of the file
|
|
101
|
+
|
|
102
|
+
export default ErrorBanner;
|
|
103
|
+
\`\`\`
|
|
104
|
+
§ACTION_ITEM_END§
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
§ACTION_ITEM_START§
|
|
109
|
+
¦ActionNumber¦ 2
|
|
110
|
+
¦TaskDescription¦ Modify \`ErrorBoundary.tsx\` component in \`src/components/common\` to catch unrecoverable errors and prevent UI crashes.
|
|
111
|
+
¦FilePath¦ src/components/common/ErrorBoundary.tsx
|
|
112
|
+
¦FileAction¦ edit_file
|
|
113
|
+
¦Code¦
|
|
114
|
+
\`\`\`typescript
|
|
115
|
+
import React, { Component, ReactNode } from 'react';
|
|
116
|
+
|
|
117
|
+
// full content of the file
|
|
118
|
+
|
|
119
|
+
export default ErrorBoundary;
|
|
120
|
+
\`\`\`
|
|
121
|
+
§ACTION_ITEM_END§
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
§ACTION_ITEM_START§
|
|
126
|
+
¦ActionNumber¦ 3
|
|
127
|
+
¦TaskDescription¦ Delete unused svg file.
|
|
128
|
+
¦FilePath¦ src/asset/common/some.svg
|
|
129
|
+
¦FileAction¦ delete_file
|
|
130
|
+
¦Code¦
|
|
131
|
+
§ACTION_ITEM_END§
|
|
132
|
+
</example>
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
1 action item only for 1 file. never combine multiple files in a single action item or never generate multiple action items for same file.
|
|
136
|
+
|
|
137
|
+
<bad-example>
|
|
138
|
+
<why> same file multiple action </why>
|
|
139
|
+
§ACTION_ITEM_START§
|
|
140
|
+
¦ActionNumber¦ 1
|
|
141
|
+
¦TaskDescription¦ some description
|
|
142
|
+
¦FilePath¦ src/same-file.tsx
|
|
143
|
+
¦FileAction¦ edit_file
|
|
144
|
+
¦Code¦
|
|
145
|
+
\`\`\`typescript
|
|
146
|
+
|
|
147
|
+
// full content of the file
|
|
148
|
+
|
|
149
|
+
\`\`\`
|
|
150
|
+
§ACTION_ITEM_END§
|
|
151
|
+
|
|
152
|
+
§ACTION_ITEM_START§
|
|
153
|
+
¦ActionNumber¦ 2
|
|
154
|
+
¦TaskDescription¦ some other description
|
|
155
|
+
¦FilePath¦ src/same-file.tsx
|
|
156
|
+
¦FileAction¦ edit_file
|
|
157
|
+
¦Code¦
|
|
158
|
+
\`\`\`typescript
|
|
159
|
+
|
|
160
|
+
// full content of the file
|
|
161
|
+
|
|
162
|
+
\`\`\`
|
|
163
|
+
§ACTION_ITEM_END§
|
|
164
|
+
|
|
165
|
+
</bad-example>
|
|
166
|
+
|
|
167
|
+
<bad-example>
|
|
168
|
+
<why> one action multiple file </why>
|
|
169
|
+
§ACTION_ITEM_START§
|
|
170
|
+
¦ActionNumber¦ 1
|
|
171
|
+
¦TaskDescription¦ some description
|
|
172
|
+
¦FilePath¦ src/same-file.tsx, src/another-file.tsx
|
|
173
|
+
¦FileAction¦ edit_file
|
|
174
|
+
¦Code¦
|
|
175
|
+
\`\`\`typescript
|
|
176
|
+
|
|
177
|
+
// full content of the file
|
|
178
|
+
|
|
179
|
+
\`\`\`
|
|
180
|
+
§ACTION_ITEM_END§
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
</bad-example>
|
|
184
|
+
|
|
185
|
+
<bad-example>
|
|
186
|
+
<why> partial content generation</why>
|
|
187
|
+
§ACTION_ITEM_START§
|
|
188
|
+
¦ActionNumber¦ 1
|
|
189
|
+
¦TaskDescription¦ some description
|
|
190
|
+
¦FilePath¦ src/some-file.tsx
|
|
191
|
+
¦FileAction¦ edit_file
|
|
192
|
+
¦Code¦
|
|
193
|
+
\`\`\`typescript
|
|
194
|
+
import React from 'react';
|
|
195
|
+
// partial content of the file
|
|
196
|
+
// missing rest of the file content
|
|
197
|
+
\`\`\`
|
|
198
|
+
§ACTION_ITEM_END§
|
|
199
|
+
</bad-example>
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
do not use + or - for diff, just use the whole content of the file.
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
</modify_file>
|
|
206
|
+
|
|
207
|
+
<request_context>
|
|
208
|
+
|
|
209
|
+
The action item should be enclosed within \`§ACTION_ITEM_START§\` and \`§ACTION_ITEM_END§\` markers and include the following details using the \`¦FieldName¦ Value\` format:
|
|
210
|
+
|
|
211
|
+
* \`¦FileAction¦\`: Always \`request_context\`.
|
|
212
|
+
* \`¦Files¦\`: (Optional) A comma-separated list of file paths you need to see.
|
|
213
|
+
* \`¦Folders¦\`: (Optional) A comma-separated list of folder paths you need to see.
|
|
214
|
+
* \`¦Reason¦\`: A clear and detailed explanation of why you need this context to proceed with your analysis. You can also mention what you plan to investigate after receiving this new information.
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
<example>
|
|
218
|
+
§ACTION_ITEM_START§
|
|
219
|
+
¦FileAction¦ request_context
|
|
220
|
+
¦Files¦ src/components/common/ErrorBoundary.tsx, src/components/common/ErrorBanner.tsx
|
|
221
|
+
¦Reason¦ I need to understand how error handling is currently implemented in the project. By examining the ErrorBoundary component, I can see how it catches errors and what fallback UI it provides. Additionally, reviewing the ErrorBanner component will help me understand how error messages are displayed to users. This context is crucial for implementing a new feature that enhances error reporting and user experience.
|
|
222
|
+
§ACTION_ITEM_END§
|
|
223
|
+
</example>
|
|
224
|
+
|
|
225
|
+
<example>
|
|
226
|
+
§ACTION_ITEM_START§
|
|
227
|
+
¦FileAction¦ request_context
|
|
228
|
+
¦Folders¦ src/components/common
|
|
229
|
+
¦Reason¦ I need to explore the common components used across the application to identify reusable elements and understand the overall structure. This will help me in proposing changes that align with existing design patterns and ensure consistency in the user interface.
|
|
230
|
+
§ACTION_ITEM_END§
|
|
231
|
+
</example>
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
<bad-example>
|
|
235
|
+
<why>multiple action item with request_context </why>
|
|
236
|
+
§ACTION_ITEM_START§
|
|
237
|
+
xxx some stuff xxx
|
|
238
|
+
§ACTION_ITEM_END§
|
|
239
|
+
|
|
240
|
+
§ACTION_ITEM_START§
|
|
241
|
+
¦FileAction¦ request_context
|
|
242
|
+
¦Folders¦ somefolder1
|
|
243
|
+
¦Reason¦ some explanation 2
|
|
244
|
+
§ACTION_ITEM_END§
|
|
245
|
+
</bad-example>
|
|
246
|
+
|
|
247
|
+
you must generate only one action_item for \`request_context\`
|
|
248
|
+
|
|
249
|
+
</request_context>
|
|
250
|
+
|
|
251
|
+
<run_command>
|
|
252
|
+
|
|
253
|
+
Use to execute safe, read-only shell commands for exploration (e.g., \`ls\`, \`tree\`, \`rg\`).
|
|
254
|
+
|
|
255
|
+
<example>
|
|
256
|
+
§ACTION_ITEM_START§
|
|
257
|
+
¦FileAction¦ run_command
|
|
258
|
+
¦Command¦ rg --files . | head -n 20
|
|
259
|
+
¦Reason¦ I want to get a quick overview of the first 20 files in the repository to understand its structure and identify key files that might be relevant to the user's request.
|
|
260
|
+
§ACTION_ITEM_END§
|
|
261
|
+
</example>
|
|
262
|
+
|
|
263
|
+
- when you use rg command always use target path like . to restrict the search to the current directory. GOOD usage \`rg -i "xxx" .\` BAD usage \`rg -i "xxx"\`
|
|
264
|
+
|
|
265
|
+
<example>
|
|
266
|
+
§ACTION_ITEM_START§
|
|
267
|
+
¦FileAction¦ run_command
|
|
268
|
+
¦Command¦ rg 'ErrorBoundary' .
|
|
269
|
+
¦Reason¦ I want to locate all occurrences of the 'ErrorBoundary' component in the codebase
|
|
270
|
+
§ACTION_ITEM_END§
|
|
271
|
+
</example>
|
|
272
|
+
|
|
273
|
+
<example>
|
|
274
|
+
§ACTION_ITEM_START§
|
|
275
|
+
¦FileAction¦ run_command
|
|
276
|
+
¦Command¦ ls -R src/components/common
|
|
277
|
+
¦Reason¦ I want to list all files and directories within the \`src/components/common
|
|
278
|
+
§ACTION_ITEM_END§
|
|
279
|
+
</example>
|
|
280
|
+
|
|
281
|
+
<example>
|
|
282
|
+
§ACTION_ITEM_START§
|
|
283
|
+
¦FileAction¦ run_command
|
|
284
|
+
¦Command¦ tree -L 2 src/components
|
|
285
|
+
¦Reason¦ I want to understand the structure of the \`src/components\` directory
|
|
286
|
+
§ACTION_ITEM_END§
|
|
287
|
+
</example>
|
|
288
|
+
|
|
289
|
+
<example>
|
|
290
|
+
§ACTION_ITEM_START§
|
|
291
|
+
¦FileAction¦ run_command
|
|
292
|
+
¦Command¦ find src/components -type d -name 'common'
|
|
293
|
+
¦Reason¦ I want to locate the \`common\` directory within \`src/components\`
|
|
294
|
+
§ACTION_ITEM_END§
|
|
295
|
+
</example>
|
|
296
|
+
|
|
297
|
+
<bad-example>
|
|
298
|
+
<why>multiple action item with run_command </why>
|
|
299
|
+
§ACTION_ITEM_START§
|
|
300
|
+
xxx some stuff xxx
|
|
301
|
+
§ACTION_ITEM_END§
|
|
302
|
+
|
|
303
|
+
§ACTION_ITEM_START§
|
|
304
|
+
¦FileAction¦ run_command
|
|
305
|
+
¦Command¦ some command 1
|
|
306
|
+
¦Reason¦ some explanation 1
|
|
307
|
+
§ACTION_ITEM_END§
|
|
308
|
+
</bad-example>
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
you must generate only one action_item for \`run_command\`
|
|
312
|
+
you can use other cli commands as well, but avoid using any command that modifies the codebase.
|
|
313
|
+
|
|
314
|
+
</run_command>
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
<final>
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
§ACTION_ITEM_START§
|
|
321
|
+
¦FileAction¦ final
|
|
322
|
+
¦plain¦
|
|
323
|
+
\`\`\`markdown
|
|
324
|
+
some explanation about the of the task.
|
|
325
|
+
you can generate multiple lines if needed.
|
|
326
|
+
\`\`\`
|
|
327
|
+
§ACTION_ITEM_END§
|
|
328
|
+
</final>
|
|
329
|
+
|
|
330
|
+
</tools>
|
|
331
|
+
</ai>
|
|
332
|
+
|
|
333
|
+
`;
|
|
334
|
+
//# sourceMappingURL=default_master-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default_master-agent.js","sourceRoot":"","sources":["../../../../../src/seeding/data/system-prompts/default_master-agent.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,cAAc,CAAC;AACtB,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwUtB,CAAC"}
|
|
@@ -198,4 +198,4 @@ export default ErrorBoundary;
|
|
|
198
198
|
* The entire output should follow the specified template format.
|
|
199
199
|
* Be concise and focus only on generating the action items as per the template.
|
|
200
200
|
`;
|
|
201
|
-
//# sourceMappingURL=
|
|
201
|
+
//# sourceMappingURL=multi-file-action-generator-with-requester.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-file-action-generator-with-requester.js","sourceRoot":"","sources":["../../../../../src/seeding/data/system-prompts/multi-file-action-generator-with-requester.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,0DAA0D,CAAC;AAClE,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmMtB,CAAC"}
|
|
@@ -5,10 +5,3 @@ export declare class CreateSessionInputDto {
|
|
|
5
5
|
execution_strategy: string;
|
|
6
6
|
raw_llm_response?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare class PrepareLlmInputResponseDto {
|
|
9
|
-
input_id: string;
|
|
10
|
-
llm_input_string: string;
|
|
11
|
-
}
|
|
12
|
-
export declare class SubmitLlmOutputDto {
|
|
13
|
-
raw_llm_response: string;
|
|
14
|
-
}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.CreateSessionInputDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
class CreateSessionInputDto {
|
|
15
15
|
}
|
|
@@ -34,28 +34,4 @@ __decorate([
|
|
|
34
34
|
(0, class_validator_1.IsNotEmpty)(),
|
|
35
35
|
__metadata("design:type", String)
|
|
36
36
|
], CreateSessionInputDto.prototype, "execution_strategy", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, class_validator_1.IsOptional)(),
|
|
39
|
-
(0, class_validator_1.IsString)(),
|
|
40
|
-
__metadata("design:type", String)
|
|
41
|
-
], CreateSessionInputDto.prototype, "raw_llm_response", void 0);
|
|
42
|
-
class PrepareLlmInputResponseDto {
|
|
43
|
-
}
|
|
44
|
-
exports.PrepareLlmInputResponseDto = PrepareLlmInputResponseDto;
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, class_validator_1.IsUUID)(),
|
|
47
|
-
__metadata("design:type", String)
|
|
48
|
-
], PrepareLlmInputResponseDto.prototype, "input_id", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, class_validator_1.IsString)(),
|
|
51
|
-
__metadata("design:type", String)
|
|
52
|
-
], PrepareLlmInputResponseDto.prototype, "llm_input_string", void 0);
|
|
53
|
-
class SubmitLlmOutputDto {
|
|
54
|
-
}
|
|
55
|
-
exports.SubmitLlmOutputDto = SubmitLlmOutputDto;
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, class_validator_1.IsString)(),
|
|
58
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
59
|
-
__metadata("design:type", String)
|
|
60
|
-
], SubmitLlmOutputDto.prototype, "raw_llm_response", void 0);
|
|
61
37
|
//# sourceMappingURL=session-input.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-input.dto.js","sourceRoot":"","sources":["../../../../src/session-inputs/dto/session-input.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"session-input.dto.js","sourceRoot":"","sources":["../../../../src/session-inputs/dto/session-input.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2E;AAE3E,MAAa,qBAAqB;CAuBjC;AAvBD,sDAuBC;AApBC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACO;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;kEACoB;AAI7B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wEACwB;AAInC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;iEACc"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { ContextTemplate } from '../core-entities';
|
|
2
2
|
import { CreateSessionInputDto } from './dto/session-input.dto';
|
|
3
3
|
import { ContextGenerationService } from '../context-generation/context-generation.service';
|
|
4
|
-
import { EventsGateway } from '../events/events.gateway';
|
|
5
4
|
import { ApplicationStateService } from '../application-state/application-state.service';
|
|
6
5
|
import { ContextSnippetsService } from '../context-snippets/context-snippets.service';
|
|
7
6
|
export declare class SessionInputContextService {
|
|
8
7
|
private readonly contextGenerationService;
|
|
9
|
-
private readonly eventsGateway;
|
|
10
8
|
private readonly applicationStateService;
|
|
11
9
|
private readonly contextSnippetsService;
|
|
12
10
|
private readonly logger;
|
|
13
|
-
constructor(contextGenerationService: ContextGenerationService,
|
|
11
|
+
constructor(contextGenerationService: ContextGenerationService, applicationStateService: ApplicationStateService, contextSnippetsService: ContextSnippetsService);
|
|
14
12
|
private resolveContextSnippets;
|
|
15
|
-
generateContext(dto: CreateSessionInputDto, contextTemplate: ContextTemplate | null, previousActionsSummary?: string
|
|
13
|
+
generateContext(dto: CreateSessionInputDto, contextTemplate: ContextTemplate | null, previousActionsSummary?: string): Promise<string>;
|
|
16
14
|
}
|
|
@@ -13,14 +13,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
exports.SessionInputContextService = void 0;
|
|
14
14
|
const common_1 = require("@nestjs/common");
|
|
15
15
|
const context_generation_service_1 = require("../context-generation/context-generation.service");
|
|
16
|
-
const events_gateway_1 = require("../events/events.gateway");
|
|
17
16
|
const application_state_service_1 = require("../application-state/application-state.service");
|
|
18
17
|
const context_snippets_service_1 = require("../context-snippets/context-snippets.service");
|
|
19
18
|
const gpt_tokenizer_1 = require("gpt-tokenizer");
|
|
20
19
|
let SessionInputContextService = SessionInputContextService_1 = class SessionInputContextService {
|
|
21
|
-
constructor(contextGenerationService,
|
|
20
|
+
constructor(contextGenerationService, applicationStateService, contextSnippetsService) {
|
|
22
21
|
this.contextGenerationService = contextGenerationService;
|
|
23
|
-
this.eventsGateway = eventsGateway;
|
|
24
22
|
this.applicationStateService = applicationStateService;
|
|
25
23
|
this.contextSnippetsService = contextSnippetsService;
|
|
26
24
|
this.logger = new common_1.Logger(SessionInputContextService_1.name);
|
|
@@ -54,7 +52,7 @@ let SessionInputContextService = SessionInputContextService_1 = class SessionInp
|
|
|
54
52
|
cleanedPrompt,
|
|
55
53
|
};
|
|
56
54
|
}
|
|
57
|
-
async generateContext(dto, contextTemplate, previousActionsSummary
|
|
55
|
+
async generateContext(dto, contextTemplate, previousActionsSummary) {
|
|
58
56
|
const { resolvedContent: context_snippets_content, cleanedPrompt } = await this.resolveContextSnippets(dto.user_prompt);
|
|
59
57
|
dto.user_prompt = cleanedPrompt;
|
|
60
58
|
this.logger.log(`Generating context. Template: ${contextTemplate?.template_name || 'None'}. Ad-hoc: ${!!dto.ad_hoc_context_definition}. Snippets: ${context_snippets_content.length > 0 ? 'Yes' : 'No'}.`);
|
|
@@ -141,14 +139,6 @@ let SessionInputContextService = SessionInputContextService_1 = class SessionInp
|
|
|
141
139
|
this.logger.warn(`Generated context exceeds token limit. Size: ${tokenCount} tokens. Limit: ${TOKEN_LIMIT} tokens.`);
|
|
142
140
|
return errorMessage;
|
|
143
141
|
}
|
|
144
|
-
if (isManualFlow) {
|
|
145
|
-
const websocketEnabled = await this.applicationStateService.getWebsocketEnabled();
|
|
146
|
-
if (websocketEnabled) {
|
|
147
|
-
this.eventsGateway.sendToAll('llm-input-generated', {
|
|
148
|
-
prompt: generatedString,
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
142
|
if (!templateContent.includes('it.user_input')) {
|
|
153
143
|
this.logger.warn("Template does not explicitly use 'it.user_input'. Appending user prompt to the end.");
|
|
154
144
|
return generatedString.trim()
|
|
@@ -168,7 +158,6 @@ exports.SessionInputContextService = SessionInputContextService;
|
|
|
168
158
|
exports.SessionInputContextService = SessionInputContextService = SessionInputContextService_1 = __decorate([
|
|
169
159
|
(0, common_1.Injectable)(),
|
|
170
160
|
__metadata("design:paramtypes", [context_generation_service_1.ContextGenerationService,
|
|
171
|
-
events_gateway_1.EventsGateway,
|
|
172
161
|
application_state_service_1.ApplicationStateService,
|
|
173
162
|
context_snippets_service_1.ContextSnippetsService])
|
|
174
163
|
], SessionInputContextService);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-input-context.service.js","sourceRoot":"","sources":["../../../src/session-inputs/session-input-context.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAyE;AAGzE,iGAA4F;AAC5F,
|
|
1
|
+
{"version":3,"file":"session-input-context.service.js","sourceRoot":"","sources":["../../../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