task-o-matic 0.0.7 → 0.0.8
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 +86 -23
- package/dist/commands/benchmark.d.ts +3 -0
- package/dist/commands/benchmark.d.ts.map +1 -0
- package/dist/commands/benchmark.js +227 -0
- package/dist/commands/prd.d.ts.map +1 -1
- package/dist/commands/prd.js +203 -9
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +452 -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 +78 -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 +54 -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/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 +188 -28
- package/dist/services/workflow.d.ts +85 -0
- package/dist/services/workflow.d.ts.map +1 -0
- package/dist/services/workflow.js +363 -0
- package/dist/types/index.d.ts +3 -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/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 +55 -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
|
+
});
|
|
@@ -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"}
|