task-o-matic 0.0.10 → 0.0.12
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/dist/cli/display/progress.d.ts +1 -1
- package/dist/cli/display/progress.d.ts.map +1 -1
- package/dist/cli/display/progress.js +16 -13
- package/dist/commands/benchmark.js +70 -2
- package/dist/commands/init.js +48 -27
- package/dist/commands/prd.d.ts.map +1 -1
- package/dist/commands/prd.js +201 -0
- package/dist/commands/tasks/execute-loop.d.ts.map +1 -1
- package/dist/commands/tasks/execute-loop.js +21 -16
- package/dist/commands/tasks/execute.d.ts.map +1 -1
- package/dist/commands/tasks/execute.js +4 -0
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +56 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/lib/ai-service/ai-operations.d.ts +13 -10
- package/dist/lib/ai-service/ai-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/ai-operations.js +35 -995
- package/dist/lib/ai-service/base-operations.d.ts +13 -0
- package/dist/lib/ai-service/base-operations.d.ts.map +1 -0
- package/dist/lib/ai-service/base-operations.js +79 -0
- package/dist/lib/ai-service/documentation-operations.d.ts +18 -0
- package/dist/lib/ai-service/documentation-operations.d.ts.map +1 -0
- package/dist/lib/ai-service/documentation-operations.js +301 -0
- package/dist/lib/ai-service/prd-operations.d.ts +14 -0
- package/dist/lib/ai-service/prd-operations.d.ts.map +1 -0
- package/dist/lib/ai-service/prd-operations.js +398 -0
- package/dist/lib/ai-service/task-operations.d.ts +12 -0
- package/dist/lib/ai-service/task-operations.d.ts.map +1 -0
- package/dist/lib/ai-service/task-operations.js +225 -0
- package/dist/lib/benchmark/registry.d.ts.map +1 -1
- package/dist/lib/benchmark/registry.js +127 -0
- package/dist/lib/better-t-stack-cli.d.ts +4 -1
- package/dist/lib/better-t-stack-cli.d.ts.map +1 -1
- package/dist/lib/better-t-stack-cli.js +126 -5
- package/dist/lib/config.d.ts +13 -6
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +90 -48
- package/dist/lib/context-builder.d.ts +13 -1
- package/dist/lib/context-builder.d.ts.map +1 -1
- package/dist/lib/context-builder.js +68 -36
- package/dist/lib/executors/claude-code-executor.d.ts +5 -2
- package/dist/lib/executors/claude-code-executor.d.ts.map +1 -1
- package/dist/lib/executors/claude-code-executor.js +30 -3
- package/dist/lib/executors/codex-executor.d.ts +5 -2
- package/dist/lib/executors/codex-executor.d.ts.map +1 -1
- package/dist/lib/executors/codex-executor.js +30 -3
- package/dist/lib/executors/executor-factory.d.ts +2 -2
- package/dist/lib/executors/executor-factory.d.ts.map +1 -1
- package/dist/lib/executors/executor-factory.js +5 -5
- package/dist/lib/executors/gemini-executor.d.ts +5 -2
- package/dist/lib/executors/gemini-executor.d.ts.map +1 -1
- package/dist/lib/executors/gemini-executor.js +30 -3
- package/dist/lib/executors/opencode-executor.d.ts +5 -2
- package/dist/lib/executors/opencode-executor.d.ts.map +1 -1
- package/dist/lib/executors/opencode-executor.js +32 -7
- package/dist/lib/prompt-builder.d.ts +11 -0
- package/dist/lib/prompt-builder.d.ts.map +1 -1
- package/dist/lib/prompt-builder.js +60 -0
- package/dist/lib/prompt-registry.d.ts.map +1 -1
- package/dist/lib/prompt-registry.js +158 -0
- package/dist/lib/storage/file-system.d.ts +3 -7
- package/dist/lib/storage/file-system.d.ts.map +1 -1
- package/dist/lib/storage/file-system.js +50 -230
- package/dist/lib/storage/storage-callbacks.d.ts +17 -0
- package/dist/lib/storage/storage-callbacks.d.ts.map +1 -0
- package/dist/lib/storage/storage-callbacks.js +94 -0
- package/dist/lib/task-execution.d.ts.map +1 -1
- package/dist/lib/task-execution.js +29 -51
- package/dist/lib/task-loop-execution.d.ts.map +1 -1
- package/dist/lib/task-loop-execution.js +234 -42
- package/dist/prompts/documentation-recap.d.ts +3 -0
- package/dist/prompts/documentation-recap.d.ts.map +1 -0
- package/dist/prompts/documentation-recap.js +13 -0
- package/dist/prompts/index.d.ts +6 -0
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +6 -0
- package/dist/prompts/prd-combination.d.ts +2 -0
- package/dist/prompts/prd-combination.d.ts.map +1 -0
- package/dist/prompts/prd-combination.js +35 -0
- package/dist/prompts/prd-generation.d.ts +2 -0
- package/dist/prompts/prd-generation.d.ts.map +1 -0
- package/dist/prompts/prd-generation.js +49 -0
- package/dist/prompts/prd-question-answer.d.ts +3 -0
- package/dist/prompts/prd-question-answer.d.ts.map +1 -0
- package/dist/prompts/prd-question-answer.js +27 -0
- package/dist/prompts/task-execution.d.ts +3 -0
- package/dist/prompts/task-execution.d.ts.map +1 -0
- package/dist/prompts/task-execution.js +21 -0
- package/dist/prompts/workflow-prompts.d.ts +9 -0
- package/dist/prompts/workflow-prompts.d.ts.map +1 -0
- package/dist/prompts/workflow-prompts.js +93 -0
- package/dist/services/prd.d.ts +43 -0
- package/dist/services/prd.d.ts.map +1 -1
- package/dist/services/prd.js +121 -0
- package/dist/services/workflow-ai-assistant.d.ts.map +1 -1
- package/dist/services/workflow-ai-assistant.js +73 -134
- package/dist/services/workflow.d.ts +10 -0
- package/dist/services/workflow.d.ts.map +1 -1
- package/dist/services/workflow.js +118 -40
- package/dist/test/integration/callbacks.test.d.ts +2 -0
- package/dist/test/integration/callbacks.test.d.ts.map +1 -0
- package/dist/test/integration/callbacks.test.js +64 -0
- package/dist/types/callbacks.d.ts +9 -6
- package/dist/types/callbacks.d.ts.map +1 -1
- package/dist/types/index.d.ts +17 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/workflow-options.d.ts +7 -0
- package/dist/types/workflow-options.d.ts.map +1 -1
- package/dist/utils/ai-service-factory.d.ts +15 -1
- package/dist/utils/ai-service-factory.d.ts.map +1 -1
- package/dist/utils/ai-service-factory.js +29 -1
- package/dist/utils/streaming-options.d.ts +1 -1
- package/dist/utils/streaming-options.d.ts.map +1 -1
- package/dist/utils/streaming-options.js +31 -18
- package/docs/agents/cli.md +191 -0
- package/package.json +3 -2
|
@@ -1,15 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ContextBuilder = void 0;
|
|
4
|
-
|
|
4
|
+
exports.createDefaultContextCallbacks = createDefaultContextCallbacks;
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const config_1 = require("./config");
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
function createDefaultContextCallbacks() {
|
|
9
|
+
return {
|
|
10
|
+
readFile: async (path) => {
|
|
11
|
+
if ((0, fs_1.existsSync)(path)) {
|
|
12
|
+
return (0, fs_1.readFileSync)(path, "utf-8");
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
},
|
|
16
|
+
fileExists: async (path) => {
|
|
17
|
+
return (0, fs_1.existsSync)(path);
|
|
18
|
+
},
|
|
19
|
+
listFiles: async (dir) => {
|
|
20
|
+
if ((0, fs_1.existsSync)(dir) && (0, fs_1.statSync)(dir).isDirectory()) {
|
|
21
|
+
return (0, fs_1.readdirSync)(dir);
|
|
22
|
+
}
|
|
23
|
+
return [];
|
|
24
|
+
},
|
|
25
|
+
stat: async (path) => {
|
|
26
|
+
if ((0, fs_1.existsSync)(path)) {
|
|
27
|
+
const stats = (0, fs_1.statSync)(path);
|
|
28
|
+
return {
|
|
29
|
+
mtime: stats.mtime.getTime(),
|
|
30
|
+
isDirectory: stats.isDirectory(),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
7
37
|
class ContextBuilder {
|
|
8
38
|
storage;
|
|
39
|
+
callbacks;
|
|
9
40
|
taskOMatic = null;
|
|
10
41
|
initialized = false;
|
|
11
|
-
constructor(storage) {
|
|
42
|
+
constructor(storage, callbacks) {
|
|
12
43
|
this.storage = storage;
|
|
44
|
+
this.callbacks = callbacks || createDefaultContextCallbacks();
|
|
13
45
|
}
|
|
14
46
|
ensureInitialized() {
|
|
15
47
|
if (this.initialized) {
|
|
@@ -27,11 +59,11 @@ class ContextBuilder {
|
|
|
27
59
|
if (!task) {
|
|
28
60
|
throw new Error(`Task with ID ${taskId} not found`);
|
|
29
61
|
}
|
|
30
|
-
const stack = this.getStackConfig();
|
|
62
|
+
const stack = await this.getStackConfig();
|
|
31
63
|
const documentation = this.getTaskDocumentation(task);
|
|
32
|
-
const fullContent = this.getTaskFullContent(task);
|
|
64
|
+
const fullContent = await this.getTaskFullContent(task);
|
|
33
65
|
const prdContent = task.prdFile
|
|
34
|
-
? this.getPRDContent(task.prdFile)
|
|
66
|
+
? await this.getPRDContent(task.prdFile)
|
|
35
67
|
: undefined;
|
|
36
68
|
return {
|
|
37
69
|
task: {
|
|
@@ -46,8 +78,7 @@ class ContextBuilder {
|
|
|
46
78
|
recap: documentation.recap,
|
|
47
79
|
files: documentation.files.map((file) => ({
|
|
48
80
|
path: file,
|
|
49
|
-
//
|
|
50
|
-
// content: this.readDocumentationFile(file),
|
|
81
|
+
// Content loading is skipped as per original code comment
|
|
51
82
|
})),
|
|
52
83
|
}
|
|
53
84
|
: undefined,
|
|
@@ -61,10 +92,10 @@ class ContextBuilder {
|
|
|
61
92
|
*/
|
|
62
93
|
async buildContextForNewTask(title, description, prdFile) {
|
|
63
94
|
this.ensureInitialized();
|
|
64
|
-
const stack = this.getStackConfig();
|
|
95
|
+
const stack = await this.getStackConfig();
|
|
65
96
|
const prdContent = prdFile
|
|
66
|
-
? this.getPRDContent(prdFile)
|
|
67
|
-
: this.getRelevantPRDContent(title, description);
|
|
97
|
+
? await this.getPRDContent(prdFile)
|
|
98
|
+
: await this.getRelevantPRDContent(title, description);
|
|
68
99
|
return {
|
|
69
100
|
task: {
|
|
70
101
|
id: "new-task",
|
|
@@ -81,7 +112,7 @@ class ContextBuilder {
|
|
|
81
112
|
/**
|
|
82
113
|
* Get stack configuration from project (set by bootstrap)
|
|
83
114
|
*/
|
|
84
|
-
getStackConfig() {
|
|
115
|
+
async getStackConfig() {
|
|
85
116
|
if (!this.taskOMatic) {
|
|
86
117
|
return undefined;
|
|
87
118
|
}
|
|
@@ -107,8 +138,8 @@ class ContextBuilder {
|
|
|
107
138
|
};
|
|
108
139
|
try {
|
|
109
140
|
const stackFile = (0, path_1.join)(this.taskOMatic, "stack.json");
|
|
110
|
-
|
|
111
|
-
|
|
141
|
+
const content = await this.callbacks.readFile(stackFile);
|
|
142
|
+
if (content) {
|
|
112
143
|
const config = JSON.parse(content);
|
|
113
144
|
config._source = "file"; // Track source
|
|
114
145
|
return config;
|
|
@@ -131,15 +162,13 @@ class ContextBuilder {
|
|
|
131
162
|
/**
|
|
132
163
|
* Get full task content from MD file
|
|
133
164
|
*/
|
|
134
|
-
getTaskFullContent(task) {
|
|
165
|
+
async getTaskFullContent(task) {
|
|
135
166
|
if (!task.contentFile || !this.taskOMatic) {
|
|
136
167
|
return undefined;
|
|
137
168
|
}
|
|
138
169
|
try {
|
|
139
170
|
const contentPath = (0, path_1.join)(this.taskOMatic, task.contentFile);
|
|
140
|
-
|
|
141
|
-
return (0, fs_1.readFileSync)(contentPath, "utf-8");
|
|
142
|
-
}
|
|
171
|
+
return (await this.callbacks.readFile(contentPath)) || undefined;
|
|
143
172
|
}
|
|
144
173
|
catch (error) {
|
|
145
174
|
console.warn(`Failed to read task content file ${task.contentFile}:`, error);
|
|
@@ -149,14 +178,15 @@ class ContextBuilder {
|
|
|
149
178
|
/**
|
|
150
179
|
* Read documentation file content
|
|
151
180
|
*/
|
|
152
|
-
readDocumentationFile(filePath) {
|
|
181
|
+
async readDocumentationFile(filePath) {
|
|
153
182
|
if (!this.taskOMatic) {
|
|
154
183
|
return `# ContextBuilder Not Initialized\n\nFile: ${filePath}\n\nContextBuilder has not been properly initialized.`;
|
|
155
184
|
}
|
|
156
185
|
try {
|
|
157
186
|
const fullPath = (0, path_1.join)(this.taskOMatic, filePath);
|
|
158
|
-
|
|
159
|
-
|
|
187
|
+
const content = await this.callbacks.readFile(fullPath);
|
|
188
|
+
if (content) {
|
|
189
|
+
return content;
|
|
160
190
|
}
|
|
161
191
|
return `# Documentation File Not Found\n\nFile: ${filePath}\n\nThis documentation file could not be found on disk.`;
|
|
162
192
|
}
|
|
@@ -181,7 +211,7 @@ class ContextBuilder {
|
|
|
181
211
|
/**
|
|
182
212
|
* Get PRD content from file path
|
|
183
213
|
*/
|
|
184
|
-
getPRDContent(prdFile) {
|
|
214
|
+
async getPRDContent(prdFile) {
|
|
185
215
|
if (!this.taskOMatic) {
|
|
186
216
|
return undefined;
|
|
187
217
|
}
|
|
@@ -190,10 +220,7 @@ class ContextBuilder {
|
|
|
190
220
|
const fullPath = prdFile.startsWith("/")
|
|
191
221
|
? prdFile
|
|
192
222
|
: (0, path_1.join)(this.taskOMatic, prdFile);
|
|
193
|
-
|
|
194
|
-
return (0, fs_1.readFileSync)(fullPath, "utf-8");
|
|
195
|
-
}
|
|
196
|
-
return undefined;
|
|
223
|
+
return (await this.callbacks.readFile(fullPath)) || undefined;
|
|
197
224
|
}
|
|
198
225
|
catch (error) {
|
|
199
226
|
console.warn(`Failed to read PRD file ${prdFile}:`, error);
|
|
@@ -203,32 +230,37 @@ class ContextBuilder {
|
|
|
203
230
|
/**
|
|
204
231
|
* Get relevant PRD content based on task title/description
|
|
205
232
|
*/
|
|
206
|
-
getRelevantPRDContent(taskTitle, taskDescription) {
|
|
233
|
+
async getRelevantPRDContent(taskTitle, taskDescription) {
|
|
207
234
|
if (!this.taskOMatic)
|
|
208
235
|
return undefined;
|
|
209
236
|
// Look for PRD files in known locations
|
|
210
237
|
const prdPaths = [
|
|
211
238
|
(0, path_1.join)(this.taskOMatic, "prd"),
|
|
212
239
|
(0, path_1.join)(this.taskOMatic, "..", "docs"),
|
|
213
|
-
(0, path_1.join)(
|
|
214
|
-
(0, path_1.join)(
|
|
215
|
-
(0, path_1.join)(
|
|
240
|
+
(0, path_1.join)(config_1.configManager.getWorkingDirectory(), ".task-o-matic", "prd"),
|
|
241
|
+
(0, path_1.join)(config_1.configManager.getWorkingDirectory(), "prd"),
|
|
242
|
+
(0, path_1.join)(config_1.configManager.getWorkingDirectory(), "docs"),
|
|
216
243
|
];
|
|
217
244
|
for (const prdPath of prdPaths) {
|
|
218
|
-
if (
|
|
245
|
+
if (await this.callbacks.fileExists(prdPath)) {
|
|
219
246
|
try {
|
|
220
247
|
// Look for ANY text files in PRD directory
|
|
221
|
-
const
|
|
248
|
+
const files = await this.callbacks.listFiles(prdPath);
|
|
249
|
+
const prdFiles = files.filter((f) => f.endsWith(".md") || f.endsWith(".txt"));
|
|
222
250
|
if (prdFiles.length > 0) {
|
|
223
251
|
// Get the MOST RECENT PRD file by modification time
|
|
224
|
-
const prdFilesWithStats = prdFiles.map((file) =>
|
|
225
|
-
file
|
|
226
|
-
|
|
227
|
-
|
|
252
|
+
const prdFilesWithStats = await Promise.all(prdFiles.map(async (file) => {
|
|
253
|
+
const path = (0, path_1.join)(prdPath, file);
|
|
254
|
+
const stats = await this.callbacks.stat(path);
|
|
255
|
+
return {
|
|
256
|
+
file,
|
|
257
|
+
path,
|
|
258
|
+
mtime: stats ? stats.mtime : 0,
|
|
259
|
+
};
|
|
228
260
|
}));
|
|
229
261
|
prdFilesWithStats.sort((a, b) => b.mtime - a.mtime); // Sort by newest first
|
|
230
262
|
const mostRecentPrd = prdFilesWithStats[0];
|
|
231
|
-
return (
|
|
263
|
+
return ((await this.callbacks.readFile(mostRecentPrd.path)) || undefined);
|
|
232
264
|
}
|
|
233
265
|
}
|
|
234
266
|
catch (error) {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { ExternalExecutor } from "../../types";
|
|
1
|
+
import { ExternalExecutor, ExecutorConfig } from "../../types";
|
|
2
2
|
export declare class ClaudeCodeExecutor implements ExternalExecutor {
|
|
3
3
|
name: string;
|
|
4
|
-
|
|
4
|
+
private config?;
|
|
5
|
+
constructor(config?: ExecutorConfig);
|
|
6
|
+
supportsSessionResumption(): boolean;
|
|
7
|
+
execute(message: string, dry?: boolean, config?: ExecutorConfig): Promise<void>;
|
|
5
8
|
}
|
|
6
9
|
//# sourceMappingURL=claude-code-executor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code-executor.d.ts","sourceRoot":"","sources":["../../../src/lib/executors/claude-code-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAI/
|
|
1
|
+
{"version":3,"file":"claude-code-executor.d.ts","sourceRoot":"","sources":["../../../src/lib/executors/claude-code-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI/D,qBAAa,kBAAmB,YAAW,gBAAgB;IACzD,IAAI,SAAY;IAChB,OAAO,CAAC,MAAM,CAAC,CAAiB;gBAEpB,MAAM,CAAC,EAAE,cAAc;IAInC,yBAAyB,IAAI,OAAO;IAI9B,OAAO,CACX,OAAO,EAAE,MAAM,EACf,GAAG,GAAE,OAAe,EACpB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,CAAC;CAuDjB"}
|
|
@@ -8,14 +8,41 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
8
8
|
const child_process_1 = require("child_process");
|
|
9
9
|
class ClaudeCodeExecutor {
|
|
10
10
|
name = "claude";
|
|
11
|
-
|
|
11
|
+
config;
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
}
|
|
15
|
+
supportsSessionResumption() {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
async execute(message, dry = false, config) {
|
|
19
|
+
// Merge constructor config with execution config (execution takes precedence)
|
|
20
|
+
const finalConfig = { ...this.config, ...config };
|
|
21
|
+
// Build arguments array
|
|
22
|
+
const args = [];
|
|
23
|
+
// Add model if specified
|
|
24
|
+
if (finalConfig.model) {
|
|
25
|
+
args.push("--model", finalConfig.model);
|
|
26
|
+
console.log(chalk_1.default.cyan(`🤖 Using model: ${finalConfig.model}`));
|
|
27
|
+
}
|
|
28
|
+
// Add session resumption if specified
|
|
29
|
+
if (finalConfig.continueLastSession) {
|
|
30
|
+
args.push("-c");
|
|
31
|
+
console.log(chalk_1.default.cyan("🔄 Continuing last session"));
|
|
32
|
+
}
|
|
33
|
+
else if (finalConfig.sessionId) {
|
|
34
|
+
args.push("-r", finalConfig.sessionId);
|
|
35
|
+
console.log(chalk_1.default.cyan(`🔄 Resuming session: ${finalConfig.sessionId}`));
|
|
36
|
+
}
|
|
37
|
+
// Add prompt
|
|
38
|
+
args.push("-p", message);
|
|
12
39
|
if (dry) {
|
|
13
40
|
console.log(chalk_1.default.cyan(`🔧 Using executor: ${this.name}`));
|
|
14
|
-
console.log(chalk_1.default.cyan(`claude
|
|
41
|
+
console.log(chalk_1.default.cyan(`claude ${args.join(" ")}`));
|
|
15
42
|
return;
|
|
16
43
|
}
|
|
17
44
|
// Launch claude and wait for it to complete
|
|
18
|
-
const child = (0, child_process_1.spawn)("claude",
|
|
45
|
+
const child = (0, child_process_1.spawn)("claude", args, {
|
|
19
46
|
stdio: "inherit", // Give tool full terminal control
|
|
20
47
|
});
|
|
21
48
|
// Wait for completion (blocking)
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { ExternalExecutor } from "../../types";
|
|
1
|
+
import { ExternalExecutor, ExecutorConfig } from "../../types";
|
|
2
2
|
export declare class CodexExecutor implements ExternalExecutor {
|
|
3
3
|
name: string;
|
|
4
|
-
|
|
4
|
+
private config?;
|
|
5
|
+
constructor(config?: ExecutorConfig);
|
|
6
|
+
supportsSessionResumption(): boolean;
|
|
7
|
+
execute(message: string, dry?: boolean, config?: ExecutorConfig): Promise<void>;
|
|
5
8
|
}
|
|
6
9
|
//# sourceMappingURL=codex-executor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-executor.d.ts","sourceRoot":"","sources":["../../../src/lib/executors/codex-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAI/
|
|
1
|
+
{"version":3,"file":"codex-executor.d.ts","sourceRoot":"","sources":["../../../src/lib/executors/codex-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI/D,qBAAa,aAAc,YAAW,gBAAgB;IACpD,IAAI,SAAW;IACf,OAAO,CAAC,MAAM,CAAC,CAAiB;gBAEpB,MAAM,CAAC,EAAE,cAAc;IAInC,yBAAyB,IAAI,OAAO;IAI9B,OAAO,CACX,OAAO,EAAE,MAAM,EACf,GAAG,GAAE,OAAe,EACpB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,CAAC;CA2DjB"}
|
|
@@ -8,14 +8,41 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
8
8
|
const child_process_1 = require("child_process");
|
|
9
9
|
class CodexExecutor {
|
|
10
10
|
name = "codex";
|
|
11
|
-
|
|
11
|
+
config;
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
}
|
|
15
|
+
supportsSessionResumption() {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
async execute(message, dry = false, config) {
|
|
19
|
+
// Merge constructor config with execution config (execution takes precedence)
|
|
20
|
+
const finalConfig = { ...this.config, ...config };
|
|
21
|
+
// Build arguments array
|
|
22
|
+
const args = ["exec"];
|
|
23
|
+
// Add model if specified
|
|
24
|
+
if (finalConfig.model) {
|
|
25
|
+
args.push("-m", finalConfig.model);
|
|
26
|
+
console.log(chalk_1.default.cyan(`🤖 Using model: ${finalConfig.model}`));
|
|
27
|
+
}
|
|
28
|
+
// Add session resumption if specified
|
|
29
|
+
if (finalConfig.continueLastSession) {
|
|
30
|
+
args.push("resume", "--last");
|
|
31
|
+
console.log(chalk_1.default.cyan("🔄 Continuing last session"));
|
|
32
|
+
}
|
|
33
|
+
else if (finalConfig.sessionId) {
|
|
34
|
+
// Codex doesn't support resuming specific session IDs directly
|
|
35
|
+
console.log(chalk_1.default.yellow(`⚠️ Codex doesn't support resuming specific session IDs. Starting new session instead.`));
|
|
36
|
+
}
|
|
37
|
+
// Add prompt
|
|
38
|
+
args.push(message);
|
|
12
39
|
if (dry) {
|
|
13
40
|
console.log(chalk_1.default.cyan(`🔧 Using executor: ${this.name}`));
|
|
14
|
-
console.log(chalk_1.default.cyan(`codex
|
|
41
|
+
console.log(chalk_1.default.cyan(`codex ${args.join(" ")}`));
|
|
15
42
|
return;
|
|
16
43
|
}
|
|
17
44
|
// Launch codex and wait for it to complete
|
|
18
|
-
const child = (0, child_process_1.spawn)("codex",
|
|
45
|
+
const child = (0, child_process_1.spawn)("codex", args, {
|
|
19
46
|
stdio: "inherit", // Give tool full terminal control
|
|
20
47
|
});
|
|
21
48
|
// Wait for completion (blocking)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExternalExecutor, ExecutorTool } from "../../types";
|
|
1
|
+
import { ExternalExecutor, ExecutorTool, ExecutorConfig } from "../../types";
|
|
2
2
|
export declare class ExecutorFactory {
|
|
3
|
-
static create(tool?: ExecutorTool): ExternalExecutor;
|
|
3
|
+
static create(tool?: ExecutorTool, config?: ExecutorConfig): ExternalExecutor;
|
|
4
4
|
}
|
|
5
5
|
//# sourceMappingURL=executor-factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor-factory.d.ts","sourceRoot":"","sources":["../../../src/lib/executors/executor-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"executor-factory.d.ts","sourceRoot":"","sources":["../../../src/lib/executors/executor-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAM7E,qBAAa,eAAe;IAC1B,MAAM,CAAC,MAAM,CACX,IAAI,GAAE,YAAyB,EAC/B,MAAM,CAAC,EAAE,cAAc,GACtB,gBAAgB;CAcpB"}
|
|
@@ -6,16 +6,16 @@ const claude_code_executor_1 = require("./claude-code-executor");
|
|
|
6
6
|
const gemini_executor_1 = require("./gemini-executor");
|
|
7
7
|
const codex_executor_1 = require("./codex-executor");
|
|
8
8
|
class ExecutorFactory {
|
|
9
|
-
static create(tool = "opencode") {
|
|
9
|
+
static create(tool = "opencode", config) {
|
|
10
10
|
switch (tool) {
|
|
11
11
|
case "opencode":
|
|
12
|
-
return new opencode_executor_1.OpencodeExecutor();
|
|
12
|
+
return new opencode_executor_1.OpencodeExecutor(config);
|
|
13
13
|
case "claude":
|
|
14
|
-
return new claude_code_executor_1.ClaudeCodeExecutor();
|
|
14
|
+
return new claude_code_executor_1.ClaudeCodeExecutor(config);
|
|
15
15
|
case "gemini":
|
|
16
|
-
return new gemini_executor_1.GeminiExecutor();
|
|
16
|
+
return new gemini_executor_1.GeminiExecutor(config);
|
|
17
17
|
case "codex":
|
|
18
|
-
return new codex_executor_1.CodexExecutor();
|
|
18
|
+
return new codex_executor_1.CodexExecutor(config);
|
|
19
19
|
default:
|
|
20
20
|
throw new Error(`Unknown executor tool: ${tool}`);
|
|
21
21
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { ExternalExecutor } from "../../types";
|
|
1
|
+
import { ExternalExecutor, ExecutorConfig } from "../../types";
|
|
2
2
|
export declare class GeminiExecutor implements ExternalExecutor {
|
|
3
3
|
name: string;
|
|
4
|
-
|
|
4
|
+
private config?;
|
|
5
|
+
constructor(config?: ExecutorConfig);
|
|
6
|
+
supportsSessionResumption(): boolean;
|
|
7
|
+
execute(message: string, dry?: boolean, config?: ExecutorConfig): Promise<void>;
|
|
5
8
|
}
|
|
6
9
|
//# sourceMappingURL=gemini-executor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-executor.d.ts","sourceRoot":"","sources":["../../../src/lib/executors/gemini-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAI/
|
|
1
|
+
{"version":3,"file":"gemini-executor.d.ts","sourceRoot":"","sources":["../../../src/lib/executors/gemini-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI/D,qBAAa,cAAe,YAAW,gBAAgB;IACrD,IAAI,SAAY;IAChB,OAAO,CAAC,MAAM,CAAC,CAAiB;gBAEpB,MAAM,CAAC,EAAE,cAAc;IAInC,yBAAyB,IAAI,OAAO;IAI9B,OAAO,CACX,OAAO,EAAE,MAAM,EACf,GAAG,GAAE,OAAe,EACpB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,CAAC;CAuDjB"}
|
|
@@ -8,14 +8,41 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
8
8
|
const child_process_1 = require("child_process");
|
|
9
9
|
class GeminiExecutor {
|
|
10
10
|
name = "gemini";
|
|
11
|
-
|
|
11
|
+
config;
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
}
|
|
15
|
+
supportsSessionResumption() {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
async execute(message, dry = false, config) {
|
|
19
|
+
// Merge constructor config with execution config (execution takes precedence)
|
|
20
|
+
const finalConfig = { ...this.config, ...config };
|
|
21
|
+
// Build arguments array
|
|
22
|
+
const args = [];
|
|
23
|
+
// Add model if specified
|
|
24
|
+
if (finalConfig.model) {
|
|
25
|
+
args.push("-m", finalConfig.model);
|
|
26
|
+
console.log(chalk_1.default.cyan(`🤖 Using model: ${finalConfig.model}`));
|
|
27
|
+
}
|
|
28
|
+
// Add session resumption if specified
|
|
29
|
+
if (finalConfig.continueLastSession) {
|
|
30
|
+
args.push("-r", "latest");
|
|
31
|
+
console.log(chalk_1.default.cyan("🔄 Continuing last session"));
|
|
32
|
+
}
|
|
33
|
+
else if (finalConfig.sessionId) {
|
|
34
|
+
args.push("-r", finalConfig.sessionId);
|
|
35
|
+
console.log(chalk_1.default.cyan(`🔄 Resuming session: ${finalConfig.sessionId}`));
|
|
36
|
+
}
|
|
37
|
+
// Add prompt
|
|
38
|
+
args.push("-p", message);
|
|
12
39
|
if (dry) {
|
|
13
40
|
console.log(chalk_1.default.cyan(`🔧 Using executor: ${this.name}`));
|
|
14
|
-
console.log(chalk_1.default.cyan(`gemini
|
|
41
|
+
console.log(chalk_1.default.cyan(`gemini ${args.join(" ")}`));
|
|
15
42
|
return;
|
|
16
43
|
}
|
|
17
44
|
// Launch gemini and wait for it to complete
|
|
18
|
-
const child = (0, child_process_1.spawn)("gemini",
|
|
45
|
+
const child = (0, child_process_1.spawn)("gemini", args, {
|
|
19
46
|
stdio: "inherit", // Give tool full terminal control
|
|
20
47
|
});
|
|
21
48
|
// Wait for completion (blocking)
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { ExternalExecutor } from "../../types";
|
|
1
|
+
import { ExternalExecutor, ExecutorConfig } from "../../types";
|
|
2
2
|
export declare class OpencodeExecutor implements ExternalExecutor {
|
|
3
3
|
name: string;
|
|
4
|
-
|
|
4
|
+
private config?;
|
|
5
|
+
constructor(config?: ExecutorConfig);
|
|
6
|
+
supportsSessionResumption(): boolean;
|
|
7
|
+
execute(message: string, dry?: boolean, config?: ExecutorConfig): Promise<void>;
|
|
5
8
|
}
|
|
6
9
|
//# sourceMappingURL=opencode-executor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode-executor.d.ts","sourceRoot":"","sources":["../../../src/lib/executors/opencode-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"opencode-executor.d.ts","sourceRoot":"","sources":["../../../src/lib/executors/opencode-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI/D,qBAAa,gBAAiB,YAAW,gBAAgB;IACvD,IAAI,SAAc;IAClB,OAAO,CAAC,MAAM,CAAC,CAAiB;gBAEpB,MAAM,CAAC,EAAE,cAAc;IAInC,yBAAyB,IAAI,OAAO;IAI9B,OAAO,CACX,OAAO,EAAE,MAAM,EACf,GAAG,GAAE,OAAe,EACpB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,CAAC;CA2DjB"}
|
|
@@ -8,20 +8,45 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
8
8
|
const child_process_1 = require("child_process");
|
|
9
9
|
class OpencodeExecutor {
|
|
10
10
|
name = "opencode";
|
|
11
|
-
|
|
11
|
+
config;
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
}
|
|
15
|
+
supportsSessionResumption() {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
async execute(message, dry = false, config) {
|
|
19
|
+
// Merge constructor config with execution config (execution takes precedence)
|
|
20
|
+
const finalConfig = { ...this.config, ...config };
|
|
21
|
+
// Build arguments array
|
|
22
|
+
const args = [];
|
|
23
|
+
// Add model if specified
|
|
24
|
+
if (finalConfig.model) {
|
|
25
|
+
args.push("-m", finalConfig.model);
|
|
26
|
+
console.log(chalk_1.default.cyan(`🤖 Using model: ${finalConfig.model}`));
|
|
27
|
+
}
|
|
28
|
+
// Add session resumption if specified
|
|
29
|
+
if (finalConfig.continueLastSession) {
|
|
30
|
+
args.push("-c");
|
|
31
|
+
console.log(chalk_1.default.cyan("🔄 Continuing last session"));
|
|
32
|
+
}
|
|
33
|
+
else if (finalConfig.sessionId) {
|
|
34
|
+
args.push("-s", finalConfig.sessionId);
|
|
35
|
+
console.log(chalk_1.default.cyan(`🔄 Resuming session: ${finalConfig.sessionId}`));
|
|
36
|
+
}
|
|
37
|
+
// Add prompt
|
|
38
|
+
args.push("-p", message);
|
|
12
39
|
if (dry) {
|
|
13
40
|
console.log(chalk_1.default.cyan(`🔧 Using executor: ${this.name}`));
|
|
14
|
-
|
|
41
|
+
// Quote arguments that contain spaces for display
|
|
42
|
+
const quotedArgs = args.map((arg) => arg.includes(" ") ? `"${arg.replace(/"/g, '\\"')}"` : arg);
|
|
43
|
+
console.log(chalk_1.default.cyan(`opencode ${quotedArgs.join(" ")}`));
|
|
15
44
|
return;
|
|
16
45
|
}
|
|
17
46
|
// Launch opencode and wait for it to complete
|
|
18
|
-
const child = (0, child_process_1.spawn)("opencode",
|
|
47
|
+
const child = (0, child_process_1.spawn)("opencode", args, {
|
|
19
48
|
stdio: "inherit", // Give tool full terminal control
|
|
20
49
|
});
|
|
21
|
-
// run opencode and wait for it to complete
|
|
22
|
-
// const child = spawn("opencode", ["run", message], {
|
|
23
|
-
// stdio: "inherit", // Give tool full terminal control
|
|
24
|
-
// });
|
|
25
50
|
// Wait for completion (blocking)
|
|
26
51
|
await new Promise((resolve, reject) => {
|
|
27
52
|
child.on("close", (code) => {
|
|
@@ -54,5 +54,16 @@ export declare class PromptBuilder {
|
|
|
54
54
|
* Format prompt for specific executor
|
|
55
55
|
*/
|
|
56
56
|
static formatForExecutor(prompt: string, executor: "opencode" | "claude" | "gemini" | "codex"): string;
|
|
57
|
+
/**
|
|
58
|
+
* Build execution prompt with task context
|
|
59
|
+
*/
|
|
60
|
+
static buildExecutionPrompt(options: {
|
|
61
|
+
taskTitle: string;
|
|
62
|
+
taskDescription?: string;
|
|
63
|
+
taskPlan?: string;
|
|
64
|
+
stack?: any;
|
|
65
|
+
documentation?: any;
|
|
66
|
+
retryContext?: string;
|
|
67
|
+
}): PromptBuilderResult;
|
|
57
68
|
}
|
|
58
69
|
//# sourceMappingURL=prompt-builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../src/lib/prompt-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAOnE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,qBAAa,aAAa;IACxB;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB;IAiFtE;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,MAAM;IAI5B;;OAEG;IACH,MAAM,CAAC,iBAAiB,CACtB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GACvB,cAAc,GAAG,IAAI;IAKxB;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAO/C;;OAEG;WACU,oBAAoB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAiBhE;;OAEG;WACU,gBAAgB,CAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC;IAmClB;;OAEG;WACU,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../src/lib/prompt-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAOnE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,qBAAa,aAAa;IACxB;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB;IAiFtE;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,MAAM;IAI5B;;OAEG;IACH,MAAM,CAAC,iBAAiB,CACtB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GACvB,cAAc,GAAG,IAAI;IAKxB;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAO/C;;OAEG;WACU,oBAAoB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAiBhE;;OAEG;WACU,gBAAgB,CAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC;IAmClB;;OAEG;WACU,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAwCnE;;OAEG;WACU,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA4G1E;;OAEG;IACH,MAAM,CAAC,iBAAiB,CACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GACnD,MAAM;IAoBT;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE;QACnC,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,GAAG,CAAC;QACZ,aAAa,CAAC,EAAE,GAAG,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,mBAAmB;CAmExB"}
|
|
@@ -141,6 +141,7 @@ class PromptBuilder {
|
|
|
141
141
|
// Default to current working directory if not provided
|
|
142
142
|
const workDir = projectPath || process.cwd();
|
|
143
143
|
config_1.configManager.setWorkingDirectory(workDir);
|
|
144
|
+
await config_1.configManager.load();
|
|
144
145
|
const contextBuilder = (0, ai_service_factory_1.getContextBuilder)();
|
|
145
146
|
// Build context for a dummy task to get stack info
|
|
146
147
|
const context = await contextBuilder.buildContextForNewTask("Dummy Task", "For stack detection");
|
|
@@ -273,5 +274,64 @@ class PromptBuilder {
|
|
|
273
274
|
return prompt;
|
|
274
275
|
}
|
|
275
276
|
}
|
|
277
|
+
/**
|
|
278
|
+
* Build execution prompt with task context
|
|
279
|
+
*/
|
|
280
|
+
static buildExecutionPrompt(options) {
|
|
281
|
+
const { taskTitle, taskDescription, taskPlan, stack, documentation, retryContext, } = options;
|
|
282
|
+
// Build TASK_PLAN variable
|
|
283
|
+
let taskPlanText = "";
|
|
284
|
+
if (taskPlan) {
|
|
285
|
+
taskPlanText = `# Task Plan\n\n${taskPlan}\n`;
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
taskPlanText = `# Task: ${taskTitle}\n\n${taskDescription || "No description"}\n`;
|
|
289
|
+
}
|
|
290
|
+
// Build STACK_INFO variable
|
|
291
|
+
let stackInfo = "";
|
|
292
|
+
if (stack) {
|
|
293
|
+
const stackParts = [];
|
|
294
|
+
stackParts.push(`- **Project**: ${stack.projectName}`);
|
|
295
|
+
stackParts.push(`- **Frontend**: ${stack.frontend}`);
|
|
296
|
+
stackParts.push(`- **Backend**: ${stack.backend}`);
|
|
297
|
+
if (stack.database !== "none") {
|
|
298
|
+
stackParts.push(`- **Database**: ${stack.database}`);
|
|
299
|
+
}
|
|
300
|
+
if (stack.orm !== "none") {
|
|
301
|
+
stackParts.push(`- **ORM**: ${stack.orm}`);
|
|
302
|
+
}
|
|
303
|
+
stackParts.push(`- **Auth**: ${stack.auth}`);
|
|
304
|
+
if (stack.addons && stack.addons.length > 0) {
|
|
305
|
+
stackParts.push(`- **Addons**: ${stack.addons.join(", ")}`);
|
|
306
|
+
}
|
|
307
|
+
stackParts.push(`- **Package Manager**: ${stack.packageManager}`);
|
|
308
|
+
stackInfo = stackParts.join("\n");
|
|
309
|
+
}
|
|
310
|
+
// Build DOCUMENTATION_CONTEXT variable
|
|
311
|
+
let docContext = "";
|
|
312
|
+
if (documentation) {
|
|
313
|
+
const docParts = [];
|
|
314
|
+
docParts.push(`\n# Documentation Context\n`);
|
|
315
|
+
docParts.push(documentation.recap);
|
|
316
|
+
if (documentation.files && documentation.files.length > 0) {
|
|
317
|
+
docParts.push(`\n**Relevant Documentation Files**:`);
|
|
318
|
+
documentation.files.forEach((file) => {
|
|
319
|
+
docParts.push(`- ${file.path}`);
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
docContext = docParts.join("\n");
|
|
323
|
+
}
|
|
324
|
+
// Build RETRY_CONTEXT variable
|
|
325
|
+
const retryCtx = retryContext || "";
|
|
326
|
+
return this.buildPrompt({
|
|
327
|
+
name: "task-execution",
|
|
328
|
+
variables: {
|
|
329
|
+
RETRY_CONTEXT: retryCtx,
|
|
330
|
+
TASK_PLAN: taskPlanText,
|
|
331
|
+
STACK_INFO: stackInfo,
|
|
332
|
+
DOCUMENTATION_CONTEXT: docContext,
|
|
333
|
+
},
|
|
334
|
+
});
|
|
335
|
+
}
|
|
276
336
|
}
|
|
277
337
|
exports.PromptBuilder = PromptBuilder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-registry.d.ts","sourceRoot":"","sources":["../../src/lib/prompt-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompt-registry.d.ts","sourceRoot":"","sources":["../../src/lib/prompt-registry.ts"],"names":[],"mappings":"AA8BA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,OAAO,CAiUnB;IAEH,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAI1D,MAAM,CAAC,aAAa,IAAI,cAAc,EAAE;IAIxC,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,cAAc,EAAE;IAMlE,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIvC,MAAM,CAAC,WAAW,IAAI,MAAM;IAiD5B,MAAM,CAAC,cAAc,CACnB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC;QACD,KAAK,EAAE,OAAO,CAAC;QACf,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,eAAe,EAAE,MAAM,EAAE,CAAC;KAC3B;CAuBF"}
|