task-o-matic 0.0.7 ā 0.0.9
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/README.md +286 -23
- package/dist/commands/benchmark.d.ts +3 -0
- package/dist/commands/benchmark.d.ts.map +1 -0
- package/dist/commands/benchmark.js +569 -0
- package/dist/commands/prd.d.ts.map +1 -1
- package/dist/commands/prd.js +203 -9
- package/dist/commands/tasks/execute-loop.d.ts +3 -0
- package/dist/commands/tasks/execute-loop.d.ts.map +1 -0
- package/dist/commands/tasks/execute-loop.js +118 -0
- package/dist/commands/tasks/index.d.ts +1 -0
- package/dist/commands/tasks/index.d.ts.map +1 -1
- package/dist/commands/tasks/index.js +1 -0
- package/dist/commands/tasks.d.ts.map +1 -1
- package/dist/commands/tasks.js +1 -0
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +491 -331
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/lib/ai-service/ai-operations.d.ts +5 -0
- package/dist/lib/ai-service/ai-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/ai-operations.js +167 -0
- package/dist/lib/benchmark/registry.d.ts +11 -0
- package/dist/lib/benchmark/registry.d.ts.map +1 -0
- package/dist/lib/benchmark/registry.js +89 -0
- package/dist/lib/benchmark/runner.d.ts +6 -0
- package/dist/lib/benchmark/runner.d.ts.map +1 -0
- package/dist/lib/benchmark/runner.js +150 -0
- package/dist/lib/benchmark/storage.d.ts +13 -0
- package/dist/lib/benchmark/storage.d.ts.map +1 -0
- package/dist/lib/benchmark/storage.js +99 -0
- package/dist/lib/benchmark/types.d.ts +104 -0
- package/dist/lib/benchmark/types.d.ts.map +1 -0
- package/dist/lib/benchmark/types.js +2 -0
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +7 -1
- package/dist/lib/prompt-registry.d.ts.map +1 -1
- package/dist/lib/prompt-registry.js +23 -0
- package/dist/lib/task-loop-execution.d.ts +25 -0
- package/dist/lib/task-loop-execution.d.ts.map +1 -0
- package/dist/lib/task-loop-execution.js +473 -0
- package/dist/prompts/index.d.ts +7 -6
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +1 -0
- package/dist/prompts/prd-question.d.ts +3 -0
- package/dist/prompts/prd-question.d.ts.map +1 -0
- package/dist/prompts/prd-question.js +40 -0
- package/dist/services/benchmark.d.ts +12 -0
- package/dist/services/benchmark.d.ts.map +1 -0
- package/dist/services/benchmark.js +18 -0
- package/dist/services/prd.d.ts +25 -0
- package/dist/services/prd.d.ts.map +1 -1
- package/dist/services/prd.js +224 -29
- package/dist/services/tasks.d.ts.map +1 -1
- package/dist/services/tasks.js +90 -3
- package/dist/services/workflow-benchmark.d.ts +34 -0
- package/dist/services/workflow-benchmark.d.ts.map +1 -0
- package/dist/services/workflow-benchmark.js +317 -0
- package/dist/services/workflow.d.ts +85 -0
- package/dist/services/workflow.d.ts.map +1 -0
- package/dist/services/workflow.js +476 -0
- package/dist/test/task-loop-git.test.d.ts +2 -0
- package/dist/test/task-loop-git.test.d.ts.map +1 -0
- package/dist/test/task-loop-git.test.js +62 -0
- package/dist/types/index.d.ts +53 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/options.d.ts +2 -1
- package/dist/types/options.d.ts.map +1 -1
- package/dist/types/options.js +16 -0
- package/dist/types/results.d.ts +29 -1
- package/dist/types/results.d.ts.map +1 -1
- package/dist/types/workflow-options.d.ts +45 -0
- package/dist/types/workflow-options.d.ts.map +1 -0
- package/dist/types/workflow-options.js +2 -0
- package/dist/types/workflow-results.d.ts +82 -0
- package/dist/types/workflow-results.d.ts.map +1 -0
- package/dist/types/workflow-results.js +2 -0
- package/package.json +1 -1
package/dist/commands/prd.js
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
38
|
};
|
|
@@ -7,6 +40,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
40
|
exports.prdCommand = void 0;
|
|
8
41
|
const commander_1 = require("commander");
|
|
9
42
|
const chalk_1 = __importDefault(require("chalk"));
|
|
43
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
10
44
|
const prd_1 = require("../services/prd");
|
|
11
45
|
const streaming_options_1 = require("../utils/streaming-options");
|
|
12
46
|
const progress_1 = require("../cli/display/progress");
|
|
@@ -30,7 +64,7 @@ exports.prdCommand
|
|
|
30
64
|
// Determine working directory from current process location
|
|
31
65
|
// Service layer should receive this explicitly, not use process.cwd()
|
|
32
66
|
const workingDirectory = process.cwd();
|
|
33
|
-
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.stream,
|
|
67
|
+
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.stream, "Parsing");
|
|
34
68
|
const result = await prd_1.prdService.parsePRD({
|
|
35
69
|
file: options.file,
|
|
36
70
|
workingDirectory, // Pass working directory explicitly to service
|
|
@@ -50,14 +84,14 @@ exports.prdCommand
|
|
|
50
84
|
onError: progress_1.displayError,
|
|
51
85
|
},
|
|
52
86
|
});
|
|
53
|
-
console.log(
|
|
87
|
+
console.log("");
|
|
54
88
|
console.log(chalk_1.default.blue(`š PRD Parsing Summary:`));
|
|
55
89
|
console.log(chalk_1.default.cyan(` Tasks created: ${result.stats.tasksCreated}`));
|
|
56
90
|
console.log(chalk_1.default.cyan(` Duration: ${result.stats.duration}ms`));
|
|
57
91
|
console.log(chalk_1.default.cyan(` AI Model: ${result.stats.aiModel}`));
|
|
58
|
-
console.log(chalk_1.default.blue(
|
|
59
|
-
result.steps.forEach(step => {
|
|
60
|
-
const icon = step.status ===
|
|
92
|
+
console.log(chalk_1.default.blue("\nš Processing Steps:"));
|
|
93
|
+
result.steps.forEach((step) => {
|
|
94
|
+
const icon = step.status === "completed" ? "ā" : "ā";
|
|
61
95
|
console.log(` ${icon} ${step.step} (${step.duration}ms)`);
|
|
62
96
|
if (step.details) {
|
|
63
97
|
console.log(chalk_1.default.gray(` ${JSON.stringify(step.details)}`));
|
|
@@ -68,12 +102,12 @@ exports.prdCommand
|
|
|
68
102
|
result.tasks.forEach((task, index) => {
|
|
69
103
|
console.log(`${index + 1}. ${chalk_1.default.bold(task.title)} (${task.id})`);
|
|
70
104
|
if (task.description) {
|
|
71
|
-
console.log(chalk_1.default.gray(` ${task.description.substring(0, 100)}${task.description.length > 100 ?
|
|
105
|
+
console.log(chalk_1.default.gray(` ${task.description.substring(0, 100)}${task.description.length > 100 ? "..." : ""}`));
|
|
72
106
|
}
|
|
73
107
|
if (task.estimatedEffort) {
|
|
74
108
|
console.log(chalk_1.default.cyan(` Effort: ${task.estimatedEffort}`));
|
|
75
109
|
}
|
|
76
|
-
console.log(
|
|
110
|
+
console.log("");
|
|
77
111
|
});
|
|
78
112
|
}
|
|
79
113
|
catch (error) {
|
|
@@ -102,7 +136,7 @@ exports.prdCommand
|
|
|
102
136
|
// Determine working directory from current process location
|
|
103
137
|
// Service layer should receive this explicitly, not use process.cwd()
|
|
104
138
|
const workingDirectory = process.cwd();
|
|
105
|
-
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.stream,
|
|
139
|
+
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.stream, "Rework");
|
|
106
140
|
const outputPath = await prd_1.prdService.reworkPRD({
|
|
107
141
|
file: options.file,
|
|
108
142
|
feedback: options.feedback,
|
|
@@ -124,7 +158,7 @@ exports.prdCommand
|
|
|
124
158
|
onError: progress_1.displayError,
|
|
125
159
|
},
|
|
126
160
|
});
|
|
127
|
-
console.log(
|
|
161
|
+
console.log("");
|
|
128
162
|
console.log(chalk_1.default.green(`ā PRD improved and saved to ${outputPath}`));
|
|
129
163
|
console.log(chalk_1.default.cyan(`Feedback applied: ${options.feedback}`));
|
|
130
164
|
}
|
|
@@ -133,3 +167,163 @@ exports.prdCommand
|
|
|
133
167
|
process.exit(1);
|
|
134
168
|
}
|
|
135
169
|
});
|
|
170
|
+
// Generate questions for PRD
|
|
171
|
+
exports.prdCommand
|
|
172
|
+
.command("question")
|
|
173
|
+
.description("Generate clarifying questions for a PRD")
|
|
174
|
+
.requiredOption("--file <path>", "Path to PRD file")
|
|
175
|
+
.option("--output <path>", "Output JSON file path (default: prd-questions.json)")
|
|
176
|
+
.option("--prompt <prompt>", "Override prompt")
|
|
177
|
+
.option("--message <message>", "User message")
|
|
178
|
+
.option("--ai-provider <provider>", "AI provider override")
|
|
179
|
+
.option("--ai-model <model>", "AI model override")
|
|
180
|
+
.option("--ai-key <key>", "AI API key override")
|
|
181
|
+
.option("--ai-provider-url <url>", "AI provider URL override")
|
|
182
|
+
.option("--ai-reasoning <tokens>", "Enable reasoning for OpenRouter models (max reasoning tokens)")
|
|
183
|
+
.option("--stream", "Show streaming AI output")
|
|
184
|
+
.option("--tools", "Enable filesystem tools for project analysis")
|
|
185
|
+
.action(async (options) => {
|
|
186
|
+
try {
|
|
187
|
+
const workingDirectory = process.cwd();
|
|
188
|
+
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.stream, "Questioning");
|
|
189
|
+
const questions = await prd_1.prdService.generateQuestions({
|
|
190
|
+
file: options.file,
|
|
191
|
+
workingDirectory,
|
|
192
|
+
enableFilesystemTools: options.tools,
|
|
193
|
+
aiOptions: {
|
|
194
|
+
aiProvider: options.aiProvider,
|
|
195
|
+
aiModel: options.aiModel,
|
|
196
|
+
aiKey: options.aiKey,
|
|
197
|
+
aiProviderUrl: options.aiProviderUrl,
|
|
198
|
+
aiReasoning: options.aiReasoning,
|
|
199
|
+
},
|
|
200
|
+
promptOverride: options.prompt,
|
|
201
|
+
messageOverride: options.message,
|
|
202
|
+
streamingOptions,
|
|
203
|
+
callbacks: {
|
|
204
|
+
onProgress: progress_1.displayProgress,
|
|
205
|
+
onError: progress_1.displayError,
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
const outputPath = options.output || "prd-questions.json";
|
|
209
|
+
const fs = await Promise.resolve().then(() => __importStar(require("fs")));
|
|
210
|
+
fs.writeFileSync(outputPath, JSON.stringify({ questions }, null, 2));
|
|
211
|
+
console.log("");
|
|
212
|
+
console.log(chalk_1.default.green(`ā Generated ${questions.length} questions`));
|
|
213
|
+
console.log(chalk_1.default.cyan(`Saved to: ${outputPath}`));
|
|
214
|
+
console.log(chalk_1.default.blue("\nQuestions:"));
|
|
215
|
+
questions.forEach((q, i) => {
|
|
216
|
+
console.log(`${i + 1}. ${q}`);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
(0, progress_1.displayError)(error);
|
|
221
|
+
process.exit(1);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
// Refine PRD with questions
|
|
225
|
+
exports.prdCommand
|
|
226
|
+
.command("refine")
|
|
227
|
+
.description("Refine PRD by answering clarifying questions")
|
|
228
|
+
.requiredOption("--file <path>", "Path to PRD file")
|
|
229
|
+
.option("--questions <path>", "Path to questions JSON file (optional, will generate if missing)")
|
|
230
|
+
.option("--output <path>", "Output file path (default: overwrite original)")
|
|
231
|
+
.option("--prompt <prompt>", "Override prompt")
|
|
232
|
+
.option("--message <message>", "User message")
|
|
233
|
+
.option("--ai-provider <provider>", "AI provider override")
|
|
234
|
+
.option("--ai-model <model>", "AI model override")
|
|
235
|
+
.option("--ai-key <key>", "AI API key override")
|
|
236
|
+
.option("--ai-provider-url <url>", "AI provider URL override")
|
|
237
|
+
.option("--ai-reasoning <tokens>", "Enable reasoning for OpenRouter models (max reasoning tokens)")
|
|
238
|
+
.option("--stream", "Show streaming AI output")
|
|
239
|
+
.option("--tools", "Enable filesystem tools for project analysis")
|
|
240
|
+
.action(async (options) => {
|
|
241
|
+
try {
|
|
242
|
+
const workingDirectory = process.cwd();
|
|
243
|
+
const fs = await Promise.resolve().then(() => __importStar(require("fs")));
|
|
244
|
+
let questions = [];
|
|
245
|
+
// If questions file provided, load it
|
|
246
|
+
if (options.questions && fs.existsSync(options.questions)) {
|
|
247
|
+
console.log(chalk_1.default.blue(`Loading questions from ${options.questions}...`));
|
|
248
|
+
const content = fs.readFileSync(options.questions, "utf-8");
|
|
249
|
+
const data = JSON.parse(content);
|
|
250
|
+
questions = data.questions || [];
|
|
251
|
+
}
|
|
252
|
+
// If no questions loaded, generate them
|
|
253
|
+
if (questions.length === 0) {
|
|
254
|
+
console.log(chalk_1.default.blue("Generating clarifying questions..."));
|
|
255
|
+
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.stream, "Questioning");
|
|
256
|
+
questions = await prd_1.prdService.generateQuestions({
|
|
257
|
+
file: options.file,
|
|
258
|
+
workingDirectory,
|
|
259
|
+
enableFilesystemTools: options.tools,
|
|
260
|
+
aiOptions: {
|
|
261
|
+
aiProvider: options.aiProvider,
|
|
262
|
+
aiModel: options.aiModel,
|
|
263
|
+
aiKey: options.aiKey,
|
|
264
|
+
aiProviderUrl: options.aiProviderUrl,
|
|
265
|
+
aiReasoning: options.aiReasoning,
|
|
266
|
+
},
|
|
267
|
+
promptOverride: options.prompt,
|
|
268
|
+
messageOverride: options.message,
|
|
269
|
+
streamingOptions,
|
|
270
|
+
callbacks: {
|
|
271
|
+
onProgress: progress_1.displayProgress,
|
|
272
|
+
onError: progress_1.displayError,
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
if (questions.length === 0) {
|
|
277
|
+
console.log(chalk_1.default.yellow("No questions generated. PRD might be clear enough."));
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
console.log(chalk_1.default.blue(`\nPlease answer the following ${questions.length} questions to refine the PRD:\n`));
|
|
281
|
+
const answers = {};
|
|
282
|
+
for (let i = 0; i < questions.length; i++) {
|
|
283
|
+
const q = questions[i];
|
|
284
|
+
const answer = await inquirer_1.default.prompt([
|
|
285
|
+
{
|
|
286
|
+
type: "input",
|
|
287
|
+
name: "response",
|
|
288
|
+
message: `${i + 1}/${questions.length}: ${q}`,
|
|
289
|
+
validate: (input) => input.trim().length > 0 || "Please provide an answer",
|
|
290
|
+
},
|
|
291
|
+
]);
|
|
292
|
+
answers[q] = answer.response;
|
|
293
|
+
}
|
|
294
|
+
// Format feedback
|
|
295
|
+
let feedback = "Please incorporate the following clarifications into the PRD:\n\n";
|
|
296
|
+
Object.entries(answers).forEach(([q, a], i) => {
|
|
297
|
+
feedback += `Q${i + 1}: ${q}\nA: ${a}\n\n`;
|
|
298
|
+
});
|
|
299
|
+
console.log(chalk_1.default.blue("\nReworking PRD with your answers..."));
|
|
300
|
+
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.stream, "Refining");
|
|
301
|
+
const outputPath = await prd_1.prdService.reworkPRD({
|
|
302
|
+
file: options.file,
|
|
303
|
+
feedback,
|
|
304
|
+
output: options.output,
|
|
305
|
+
workingDirectory,
|
|
306
|
+
enableFilesystemTools: options.tools,
|
|
307
|
+
aiOptions: {
|
|
308
|
+
aiProvider: options.aiProvider,
|
|
309
|
+
aiModel: options.aiModel,
|
|
310
|
+
aiKey: options.aiKey,
|
|
311
|
+
aiProviderUrl: options.aiProviderUrl,
|
|
312
|
+
aiReasoning: options.aiReasoning,
|
|
313
|
+
},
|
|
314
|
+
promptOverride: options.prompt,
|
|
315
|
+
messageOverride: options.message,
|
|
316
|
+
streamingOptions,
|
|
317
|
+
callbacks: {
|
|
318
|
+
onProgress: progress_1.displayProgress,
|
|
319
|
+
onError: progress_1.displayError,
|
|
320
|
+
},
|
|
321
|
+
});
|
|
322
|
+
console.log("");
|
|
323
|
+
console.log(chalk_1.default.green(`ā PRD refined and saved to ${outputPath}`));
|
|
324
|
+
}
|
|
325
|
+
catch (error) {
|
|
326
|
+
(0, progress_1.displayError)(error);
|
|
327
|
+
process.exit(1);
|
|
328
|
+
}
|
|
329
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-loop.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/execute-loop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiDpC,eAAO,MAAM,kBAAkB,SAoI3B,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.executeLoopCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const task_loop_execution_1 = require("../../lib/task-loop-execution");
|
|
10
|
+
/**
|
|
11
|
+
* Parse --try-models option into ModelAttemptConfig array
|
|
12
|
+
* Supports formats:
|
|
13
|
+
* - "model1,model2,model3" - just models (uses default executor)
|
|
14
|
+
* - "opencode:gpt-4o,claude:sonnet-4" - executor:model format
|
|
15
|
+
* - Mixed: "gpt-4o,claude:sonnet-4,gemini:gemini-2.0"
|
|
16
|
+
*/
|
|
17
|
+
function parseTryModels(value) {
|
|
18
|
+
return value.split(",").map((item) => {
|
|
19
|
+
const trimmed = item.trim();
|
|
20
|
+
// Check if it includes executor specification (executor:model format)
|
|
21
|
+
if (trimmed.includes(":")) {
|
|
22
|
+
const [executor, model] = trimmed.split(":");
|
|
23
|
+
const validExecutors = [
|
|
24
|
+
"opencode",
|
|
25
|
+
"claude",
|
|
26
|
+
"gemini",
|
|
27
|
+
"codex",
|
|
28
|
+
];
|
|
29
|
+
if (!validExecutors.includes(executor)) {
|
|
30
|
+
throw new Error(`Invalid executor "${executor}" in --try-models. Must be one of: ${validExecutors.join(", ")}`);
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
executor: executor,
|
|
34
|
+
model: model.trim(),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// Just a model name - use default executor
|
|
38
|
+
return {
|
|
39
|
+
model: trimmed,
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
exports.executeLoopCommand = new commander_1.Command("execute-loop")
|
|
44
|
+
.description("Execute multiple tasks in a loop with retry logic and verification")
|
|
45
|
+
.option("--status <status>", "Filter tasks by status (todo/in-progress/completed)")
|
|
46
|
+
.option("--tag <tag>", "Filter tasks by tag")
|
|
47
|
+
.option("--ids <ids>", "Comma-separated list of task IDs to execute", (value) => value.split(",").map((id) => id.trim()))
|
|
48
|
+
.option("--tool <tool>", "External tool to use (opencode/claude/gemini/codex)", "opencode")
|
|
49
|
+
.option("--max-retries <number>", "Maximum number of retries per task", (value) => parseInt(value, 10), 3)
|
|
50
|
+
.option("--try-models <models>", "Progressive model/executor configs for each retry (e.g., 'gpt-4o-mini,gpt-4o,claude:sonnet-4')")
|
|
51
|
+
.option("--verify <command>", "Verification command to run after each task (can be used multiple times)", (value, previous = []) => {
|
|
52
|
+
return [...previous, value];
|
|
53
|
+
})
|
|
54
|
+
.option("--auto-commit", "Automatically commit changes after each task", false)
|
|
55
|
+
.option("--dry", "Show what would be executed without running it", false)
|
|
56
|
+
.action(async (options) => {
|
|
57
|
+
try {
|
|
58
|
+
// Validate tool
|
|
59
|
+
const validTools = [
|
|
60
|
+
"opencode",
|
|
61
|
+
"claude",
|
|
62
|
+
"gemini",
|
|
63
|
+
"codex",
|
|
64
|
+
];
|
|
65
|
+
if (!validTools.includes(options.tool)) {
|
|
66
|
+
console.error(chalk_1.default.red(`Invalid tool: ${options.tool}. Must be one of: ${validTools.join(", ")}`));
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
// Parse tryModels if provided
|
|
70
|
+
let tryModels;
|
|
71
|
+
if (options.tryModels) {
|
|
72
|
+
try {
|
|
73
|
+
tryModels = parseTryModels(options.tryModels);
|
|
74
|
+
console.log(chalk_1.default.cyan(`š Progressive model escalation configured with ${tryModels.length} model(s):`));
|
|
75
|
+
tryModels.forEach((config, index) => {
|
|
76
|
+
const executorInfo = config.executor
|
|
77
|
+
? `${config.executor}:`
|
|
78
|
+
: "default:";
|
|
79
|
+
const modelInfo = config.model || "default model";
|
|
80
|
+
console.log(chalk_1.default.cyan(` ${index + 1}. ${executorInfo}${modelInfo}`));
|
|
81
|
+
});
|
|
82
|
+
console.log();
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.error(chalk_1.default.red(`Failed to parse --try-models: ${error instanceof Error ? error.message : "Unknown error"}`));
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Build options
|
|
90
|
+
const executeOptions = {
|
|
91
|
+
filters: {
|
|
92
|
+
status: options.status,
|
|
93
|
+
tag: options.tag,
|
|
94
|
+
taskIds: options.ids,
|
|
95
|
+
},
|
|
96
|
+
tool: options.tool,
|
|
97
|
+
config: {
|
|
98
|
+
maxRetries: options.maxRetries,
|
|
99
|
+
verificationCommands: options.verify || [],
|
|
100
|
+
autoCommit: options.autoCommit,
|
|
101
|
+
tryModels,
|
|
102
|
+
},
|
|
103
|
+
dry: options.dry,
|
|
104
|
+
};
|
|
105
|
+
// Execute task loop
|
|
106
|
+
const result = await (0, task_loop_execution_1.executeTaskLoop)(executeOptions);
|
|
107
|
+
// Exit with error code if any tasks failed
|
|
108
|
+
if (result.failedTasks > 0) {
|
|
109
|
+
console.error(chalk_1.default.red(`\nā ${result.failedTasks} task(s) failed. See logs above for details.`));
|
|
110
|
+
process.exit(1);
|
|
111
|
+
}
|
|
112
|
+
console.log(chalk_1.default.green(`\nā
All ${result.completedTasks} task(s) completed successfully!`));
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
console.error(chalk_1.default.red("Execute loop failed:"), error instanceof Error ? error.message : "Unknown error");
|
|
116
|
+
process.exit(1);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
@@ -26,6 +26,7 @@ __exportStar(require("./enhance"), exports);
|
|
|
26
26
|
__exportStar(require("./split"), exports);
|
|
27
27
|
__exportStar(require("./document"), exports);
|
|
28
28
|
__exportStar(require("./execute"), exports);
|
|
29
|
+
__exportStar(require("./execute-loop"), exports);
|
|
29
30
|
__exportStar(require("./subtasks"), exports);
|
|
30
31
|
__exportStar(require("./tree"), exports);
|
|
31
32
|
__exportStar(require("./next"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/commands/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/commands/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2BpC,eAAO,MAAM,YAAY,SAAuB,CAAC"}
|
package/dist/commands/tasks.js
CHANGED
|
@@ -23,6 +23,7 @@ exports.tasksCommand.addCommand(index_1.documentCommand);
|
|
|
23
23
|
exports.tasksCommand.addCommand(index_1.getDocumentationCommand);
|
|
24
24
|
exports.tasksCommand.addCommand(index_1.addDocumentationCommand);
|
|
25
25
|
exports.tasksCommand.addCommand(index_1.executeCommand);
|
|
26
|
+
exports.tasksCommand.addCommand(index_1.executeLoopCommand);
|
|
26
27
|
exports.tasksCommand.addCommand(index_1.subtasksCommand);
|
|
27
28
|
exports.tasksCommand.addCommand(index_1.treeCommand);
|
|
28
29
|
exports.tasksCommand.addCommand(index_1.nextCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/commands/workflow.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/commands/workflow.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBpC,eAAO,MAAM,eAAe,SAoJxB,CAAC"}
|