task-o-matic 0.0.2 → 0.0.4
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 +96 -40
- package/dist/commands/prd.js +4 -0
- package/dist/commands/prompt.d.ts.map +1 -1
- package/dist/commands/prompt.js +69 -61
- package/dist/commands/tasks/create.d.ts +3 -0
- package/dist/commands/tasks/create.d.ts.map +1 -0
- package/dist/commands/tasks/create.js +58 -0
- package/dist/commands/tasks/delete.d.ts +3 -0
- package/dist/commands/tasks/delete.d.ts.map +1 -0
- package/dist/commands/tasks/delete.js +40 -0
- package/dist/commands/tasks/document.d.ts +5 -0
- package/dist/commands/tasks/document.d.ts.map +1 -0
- package/dist/commands/tasks/document.js +118 -0
- package/dist/commands/tasks/enhance.d.ts +3 -0
- package/dist/commands/tasks/enhance.d.ts.map +1 -0
- package/dist/commands/tasks/enhance.js +86 -0
- package/dist/commands/tasks/execute.d.ts +3 -0
- package/dist/commands/tasks/execute.d.ts.map +1 -0
- package/dist/commands/tasks/execute.js +33 -0
- package/dist/commands/tasks/index.d.ts +16 -0
- package/dist/commands/tasks/index.d.ts.map +1 -0
- package/dist/commands/tasks/index.js +31 -0
- package/dist/commands/tasks/list.d.ts +3 -0
- package/dist/commands/tasks/list.d.ts.map +1 -0
- package/dist/commands/tasks/list.js +27 -0
- package/dist/commands/tasks/next.d.ts +3 -0
- package/dist/commands/tasks/next.d.ts.map +1 -0
- package/dist/commands/tasks/next.js +44 -0
- package/dist/commands/tasks/plan.d.ts +7 -0
- package/dist/commands/tasks/plan.d.ts.map +1 -0
- package/dist/commands/tasks/plan.js +131 -0
- package/dist/commands/tasks/show.d.ts +3 -0
- package/dist/commands/tasks/show.d.ts.map +1 -0
- package/dist/commands/tasks/show.js +23 -0
- package/dist/commands/tasks/split.d.ts +3 -0
- package/dist/commands/tasks/split.d.ts.map +1 -0
- package/dist/commands/tasks/split.js +95 -0
- package/dist/commands/tasks/status.d.ts +3 -0
- package/dist/commands/tasks/status.d.ts.map +1 -0
- package/dist/commands/tasks/status.js +26 -0
- package/dist/commands/tasks/subtasks.d.ts +3 -0
- package/dist/commands/tasks/subtasks.d.ts.map +1 -0
- package/dist/commands/tasks/subtasks.js +35 -0
- package/dist/commands/tasks/tags.d.ts +4 -0
- package/dist/commands/tasks/tags.d.ts.map +1 -0
- package/dist/commands/tasks/tags.js +37 -0
- package/dist/commands/tasks/tree.d.ts +3 -0
- package/dist/commands/tasks/tree.d.ts.map +1 -0
- package/dist/commands/tasks/tree.js +20 -0
- package/dist/commands/tasks/update.d.ts +3 -0
- package/dist/commands/tasks/update.d.ts.map +1 -0
- package/dist/commands/tasks/update.js +35 -0
- package/dist/commands/tasks.d.ts.map +1 -1
- package/dist/commands/tasks.js +23 -594
- package/dist/commands/workflow.d.ts +4 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +434 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/lib/ai-service/ai-operations.d.ts +5 -3
- package/dist/lib/ai-service/ai-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/ai-operations.js +231 -30
- package/dist/lib/ai-service/filesystem-tools.d.ts +69 -0
- package/dist/lib/ai-service/filesystem-tools.d.ts.map +1 -0
- package/dist/lib/ai-service/filesystem-tools.js +70 -0
- package/dist/lib/ai-service/research-tools.d.ts.map +1 -1
- package/dist/lib/ai-service/research-tools.js +2 -2
- package/dist/lib/context-builder.d.ts +2 -1
- package/dist/lib/context-builder.d.ts.map +1 -1
- package/dist/lib/context-builder.js +3 -8
- package/dist/lib/executors/claude-code-executor.d.ts +6 -0
- package/dist/lib/executors/claude-code-executor.d.ts.map +1 -0
- package/dist/lib/executors/claude-code-executor.js +41 -0
- package/dist/lib/executors/codex-executor.d.ts +6 -0
- package/dist/lib/executors/codex-executor.d.ts.map +1 -0
- package/dist/lib/executors/codex-executor.js +41 -0
- package/dist/lib/executors/executor-factory.d.ts.map +1 -1
- package/dist/lib/executors/executor-factory.js +6 -3
- package/dist/lib/executors/gemini-executor.d.ts +6 -0
- package/dist/lib/executors/gemini-executor.d.ts.map +1 -0
- package/dist/lib/executors/gemini-executor.js +41 -0
- package/dist/lib/executors/opencode-executor.d.ts.map +1 -1
- package/dist/lib/executors/opencode-executor.js +2 -3
- package/dist/lib/hooks/logger.d.ts +2 -0
- package/dist/lib/hooks/logger.d.ts.map +1 -0
- package/dist/lib/hooks/logger.js +27 -0
- package/dist/lib/hooks.d.ts +64 -0
- package/dist/lib/hooks.d.ts.map +1 -0
- package/dist/lib/hooks.js +60 -0
- package/dist/lib/index.d.ts +18 -17
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +3 -3
- package/dist/lib/prompt-builder.d.ts +8 -0
- package/dist/lib/prompt-builder.d.ts.map +1 -1
- package/dist/lib/prompt-builder.js +110 -4
- package/dist/lib/{storage.d.ts → storage/file-system.d.ts} +4 -3
- package/dist/lib/storage/file-system.d.ts.map +1 -0
- package/dist/lib/{storage.js → storage/file-system.js} +141 -152
- package/dist/lib/storage/types.d.ts +43 -0
- package/dist/lib/storage/types.d.ts.map +1 -0
- package/dist/lib/storage/types.js +2 -0
- package/dist/lib/task-execution.d.ts.map +1 -1
- package/dist/lib/task-execution.js +63 -14
- package/dist/prompts/workflow-assistance.d.ts +32 -0
- package/dist/prompts/workflow-assistance.d.ts.map +1 -0
- package/dist/prompts/workflow-assistance.js +130 -0
- package/dist/services/prd.d.ts +2 -0
- package/dist/services/prd.d.ts.map +1 -1
- package/dist/services/prd.js +4 -4
- package/dist/services/tasks.d.ts +13 -6
- package/dist/services/tasks.d.ts.map +1 -1
- package/dist/services/tasks.js +202 -88
- package/dist/services/workflow-ai-assistant.d.ts +74 -0
- package/dist/services/workflow-ai-assistant.d.ts.map +1 -0
- package/dist/services/workflow-ai-assistant.js +223 -0
- package/dist/test/hooks.test.d.ts +2 -0
- package/dist/test/hooks.test.d.ts.map +1 -0
- package/dist/test/hooks.test.js +58 -0
- package/dist/test/storage.test.js +16 -16
- package/dist/types/options.d.ts +35 -0
- package/dist/types/options.d.ts.map +1 -1
- package/dist/utils/ai-service-factory.d.ts +5 -5
- package/dist/utils/ai-service-factory.d.ts.map +1 -1
- package/dist/utils/ai-service-factory.js +4 -3
- package/dist/utils/workflow-prompts.d.ts +17 -0
- package/dist/utils/workflow-prompts.d.ts.map +1 -0
- package/dist/utils/workflow-prompts.js +88 -0
- package/package.json +2 -2
- package/dist/lib/storage.d.ts.map +0 -1
|
@@ -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.addDocumentationCommand = exports.getDocumentationCommand = exports.documentCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const tasks_1 = require("../../services/tasks");
|
|
10
|
+
const hooks_1 = require("../../lib/hooks");
|
|
11
|
+
const streaming_options_1 = require("../../utils/streaming-options");
|
|
12
|
+
const progress_1 = require("../../cli/display/progress");
|
|
13
|
+
const common_1 = require("../../cli/display/common");
|
|
14
|
+
exports.documentCommand = new commander_1.Command("document")
|
|
15
|
+
.description("Analyze and fetch documentation for a task using AI with Context7")
|
|
16
|
+
.requiredOption("--task-id <id>", "Task ID")
|
|
17
|
+
.option("--force", "Force refresh documentation even if recent")
|
|
18
|
+
.option("--stream", "Show streaming AI output during analysis")
|
|
19
|
+
.option("--ai-provider <provider>", "AI provider override")
|
|
20
|
+
.option("--ai-model <model>", "AI model override")
|
|
21
|
+
.option("--ai-key <key>", "AI API key override")
|
|
22
|
+
.option("--ai-provider-url <url>", "AI provider URL override")
|
|
23
|
+
.option("--reasoning <tokens>", "Enable reasoning for OpenRouter models (max reasoning tokens)")
|
|
24
|
+
.action(async (options) => {
|
|
25
|
+
try {
|
|
26
|
+
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.stream, "Analysis");
|
|
27
|
+
const progressHandler = (payload) => {
|
|
28
|
+
(0, progress_1.displayProgress)(payload);
|
|
29
|
+
};
|
|
30
|
+
hooks_1.hooks.on("task:progress", progressHandler);
|
|
31
|
+
try {
|
|
32
|
+
const result = await tasks_1.taskService.documentTask(options.taskId, options.force, {
|
|
33
|
+
aiProvider: options.aiProvider,
|
|
34
|
+
aiModel: options.aiModel,
|
|
35
|
+
aiKey: options.aiKey,
|
|
36
|
+
aiProviderUrl: options.aiProviderUrl,
|
|
37
|
+
aiReasoning: options.reasoning,
|
|
38
|
+
}, streamingOptions);
|
|
39
|
+
if (result.documentation && !options.force) {
|
|
40
|
+
const daysSinceFetch = (Date.now() - result.documentation.lastFetched) /
|
|
41
|
+
(24 * 60 * 60 * 1000);
|
|
42
|
+
console.log(chalk_1.default.green(`✓ Documentation is fresh (${Math.round(daysSinceFetch)} days old)`));
|
|
43
|
+
console.log(chalk_1.default.cyan(`Recap: ${result.documentation.recap}`));
|
|
44
|
+
console.log(chalk_1.default.blue(`Libraries: ${result.documentation.libraries.join(", ")}`));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (result.analysis) {
|
|
48
|
+
(0, common_1.displayDocumentationAnalysis)(result.analysis);
|
|
49
|
+
}
|
|
50
|
+
if (result.documentation?.research) {
|
|
51
|
+
(0, common_1.displayResearchSummary)(result.documentation);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
hooks_1.hooks.off("task:progress", progressHandler);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
(0, progress_1.displayError)(error);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
exports.getDocumentationCommand = new commander_1.Command("get-documentation")
|
|
64
|
+
.description("Get existing documentation for a task")
|
|
65
|
+
.requiredOption("--id <id>", "Task ID")
|
|
66
|
+
.action(async (options) => {
|
|
67
|
+
try {
|
|
68
|
+
const task = await tasks_1.taskService.getTask(options.id);
|
|
69
|
+
if (!task) {
|
|
70
|
+
throw new Error(`Task with ID ${options.id} not found`);
|
|
71
|
+
}
|
|
72
|
+
const documentation = await tasks_1.taskService.getTaskDocumentation(options.id);
|
|
73
|
+
if (!documentation) {
|
|
74
|
+
console.log(chalk_1.default.yellow(`⚠️ No documentation found for task ${options.id}`));
|
|
75
|
+
console.log(chalk_1.default.gray(` Task: ${task.title}`));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
console.log(chalk_1.default.blue(`\n📖 Documentation for Task: ${task.title} (${options.id})`));
|
|
79
|
+
console.log(chalk_1.default.gray(` File: .task-o-matic/docs/tasks/${options.id}.md`));
|
|
80
|
+
console.log("");
|
|
81
|
+
console.log(documentation);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
(0, progress_1.displayError)(error);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
exports.addDocumentationCommand = new commander_1.Command("add-documentation")
|
|
89
|
+
.description("Add documentation to a task from a file")
|
|
90
|
+
.requiredOption("--id <id>", "Task ID")
|
|
91
|
+
.requiredOption("--doc-file <path>", "Path to documentation file")
|
|
92
|
+
.option("--overwrite", "Overwrite existing documentation")
|
|
93
|
+
.action(async (options) => {
|
|
94
|
+
try {
|
|
95
|
+
const task = await tasks_1.taskService.getTask(options.id);
|
|
96
|
+
if (!task) {
|
|
97
|
+
throw new Error(`Task with ID ${options.id} not found`);
|
|
98
|
+
}
|
|
99
|
+
// Check if documentation already exists
|
|
100
|
+
const existingDoc = await tasks_1.taskService.getTaskDocumentation(options.id);
|
|
101
|
+
if (existingDoc && !options.overwrite) {
|
|
102
|
+
console.log(chalk_1.default.yellow(`⚠️ Documentation already exists for task ${options.id}`));
|
|
103
|
+
console.log(chalk_1.default.gray(` Use --overwrite to replace existing documentation`));
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const result = await tasks_1.taskService.addTaskDocumentationFromFile(options.id, options.docFile);
|
|
107
|
+
console.log(chalk_1.default.green(`✓ Documentation added to task: ${task.title} (${options.id})`));
|
|
108
|
+
console.log(chalk_1.default.gray(` Source file: ${options.docFile}`));
|
|
109
|
+
console.log(chalk_1.default.gray(` Saved to: ${result.filePath}`));
|
|
110
|
+
if (options.overwrite) {
|
|
111
|
+
console.log(chalk_1.default.cyan(` Previous documentation was overwritten`));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
(0, progress_1.displayError)(error);
|
|
116
|
+
process.exit(1);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enhance.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/enhance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,eAAO,MAAM,cAAc,SA8GvB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
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.enhanceCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const tasks_1 = require("../../services/tasks");
|
|
10
|
+
const hooks_1 = require("../../lib/hooks");
|
|
11
|
+
const streaming_options_1 = require("../../utils/streaming-options");
|
|
12
|
+
const progress_1 = require("../../cli/display/progress");
|
|
13
|
+
exports.enhanceCommand = new commander_1.Command("enhance")
|
|
14
|
+
.description("Enhance an existing task with AI using Context7 documentation")
|
|
15
|
+
.option("--task-id <id>", "Task ID to enhance")
|
|
16
|
+
.option("--all", "Enhance all existing tasks")
|
|
17
|
+
.option("--stream", "Show streaming AI output during enhancement")
|
|
18
|
+
.option("--ai-provider <provider>", "AI provider override")
|
|
19
|
+
.option("--ai-model <model>", "AI model override")
|
|
20
|
+
.option("--ai-key <key>", "AI API key override")
|
|
21
|
+
.option("--ai-provider-url <url>", "AI provider URL override")
|
|
22
|
+
.option("--reasoning <tokens>", "Enable reasoning for OpenRouter models (max reasoning tokens)")
|
|
23
|
+
.action(async (options) => {
|
|
24
|
+
try {
|
|
25
|
+
if (!options.taskId && !options.all) {
|
|
26
|
+
throw new Error("Either --task-id or --all must be specified");
|
|
27
|
+
}
|
|
28
|
+
if (options.taskId && options.all) {
|
|
29
|
+
throw new Error("Cannot specify both --task-id and --all");
|
|
30
|
+
}
|
|
31
|
+
const enhanceSingleTask = async (taskId) => {
|
|
32
|
+
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.stream, "Enhancement");
|
|
33
|
+
const progressHandler = (payload) => {
|
|
34
|
+
(0, progress_1.displayProgress)(payload);
|
|
35
|
+
};
|
|
36
|
+
hooks_1.hooks.on("task:progress", progressHandler);
|
|
37
|
+
try {
|
|
38
|
+
const result = await tasks_1.taskService.enhanceTask(taskId, {
|
|
39
|
+
aiProvider: options.aiProvider,
|
|
40
|
+
aiModel: options.aiModel,
|
|
41
|
+
aiKey: options.aiKey,
|
|
42
|
+
aiProviderUrl: options.aiProviderUrl,
|
|
43
|
+
aiReasoning: options.reasoning,
|
|
44
|
+
}, streamingOptions);
|
|
45
|
+
if (result.enhancedContent.length > 200) {
|
|
46
|
+
console.log(chalk_1.default.cyan(` Enhanced content saved to file.`));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
console.log(chalk_1.default.cyan(` Enhanced content updated in task description.`));
|
|
50
|
+
}
|
|
51
|
+
console.log(chalk_1.default.green("✓ Task enhanced with Context7 documentation"));
|
|
52
|
+
console.log(chalk_1.default.magenta(` 🤖 Enhanced using Context7 MCP tools`));
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
hooks_1.hooks.off("task:progress", progressHandler);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
if (options.taskId) {
|
|
59
|
+
await enhanceSingleTask(options.taskId);
|
|
60
|
+
}
|
|
61
|
+
else if (options.all) {
|
|
62
|
+
const allTasks = await tasks_1.taskService.listTasks({});
|
|
63
|
+
if (allTasks.length === 0) {
|
|
64
|
+
console.log(chalk_1.default.yellow("No tasks found to enhance."));
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
console.log(chalk_1.default.blue(`🤖 Enhancing ${allTasks.length} tasks in order...`));
|
|
68
|
+
for (let i = 0; i < allTasks.length; i++) {
|
|
69
|
+
const task = allTasks[i];
|
|
70
|
+
console.log(chalk_1.default.cyan(`\n[${i + 1}/${allTasks.length}] Enhancing: ${task.title} (${task.id})`));
|
|
71
|
+
try {
|
|
72
|
+
await enhanceSingleTask(task.id);
|
|
73
|
+
console.log(chalk_1.default.green(`✓ Enhanced task ${task.id}`));
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
console.log(chalk_1.default.red(`❌ Failed to enhance task ${task.id}: ${error instanceof Error ? error.message : "Unknown error"}`));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
console.log(chalk_1.default.green(`\n✓ Bulk enhancement complete! Processed ${allTasks.length} tasks.`));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
(0, progress_1.displayError)(error);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,cAAc,SAoCvB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.executeCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const task_execution_1 = require("../../lib/task-execution");
|
|
10
|
+
exports.executeCommand = new commander_1.Command("execute")
|
|
11
|
+
.description("Execute a task using an external coding assistant")
|
|
12
|
+
.requiredOption("--id <id>", "Task ID to execute")
|
|
13
|
+
.option("--tool <tool>", "External tool to use (opencode/claude/gemini/codex)", "opencode")
|
|
14
|
+
.option("--message <message>", "Custom message to send to the tool (uses task plan if not provided)")
|
|
15
|
+
.option("--dry", "Show what would be executed without running it")
|
|
16
|
+
.option("--validate <command>", "Validation command to run after execution (can be used multiple times)", (value, previous = []) => {
|
|
17
|
+
return [...previous, value];
|
|
18
|
+
})
|
|
19
|
+
.action(async (options) => {
|
|
20
|
+
try {
|
|
21
|
+
await (0, task_execution_1.executeTask)({
|
|
22
|
+
taskId: options.id,
|
|
23
|
+
tool: options.tool,
|
|
24
|
+
message: options.message,
|
|
25
|
+
dry: options.dry,
|
|
26
|
+
validate: options.validate || [],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error(chalk_1.default.red("Execution failed:"), error instanceof Error ? error.message : "Unknown error");
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from "./list";
|
|
2
|
+
export * from "./create";
|
|
3
|
+
export * from "./show";
|
|
4
|
+
export * from "./update";
|
|
5
|
+
export * from "./delete";
|
|
6
|
+
export * from "./status";
|
|
7
|
+
export * from "./tags";
|
|
8
|
+
export * from "./plan";
|
|
9
|
+
export * from "./enhance";
|
|
10
|
+
export * from "./split";
|
|
11
|
+
export * from "./document";
|
|
12
|
+
export * from "./execute";
|
|
13
|
+
export * from "./subtasks";
|
|
14
|
+
export * from "./tree";
|
|
15
|
+
export * from "./next";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./list"), exports);
|
|
18
|
+
__exportStar(require("./create"), exports);
|
|
19
|
+
__exportStar(require("./show"), exports);
|
|
20
|
+
__exportStar(require("./update"), exports);
|
|
21
|
+
__exportStar(require("./delete"), exports);
|
|
22
|
+
__exportStar(require("./status"), exports);
|
|
23
|
+
__exportStar(require("./tags"), exports);
|
|
24
|
+
__exportStar(require("./plan"), exports);
|
|
25
|
+
__exportStar(require("./enhance"), exports);
|
|
26
|
+
__exportStar(require("./split"), exports);
|
|
27
|
+
__exportStar(require("./document"), exports);
|
|
28
|
+
__exportStar(require("./execute"), exports);
|
|
29
|
+
__exportStar(require("./subtasks"), exports);
|
|
30
|
+
__exportStar(require("./tree"), exports);
|
|
31
|
+
__exportStar(require("./next"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,WAAW,SAoBpB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listCommand = void 0;
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const tasks_1 = require("../../services/tasks");
|
|
6
|
+
const task_1 = require("../../cli/display/task");
|
|
7
|
+
const progress_1 = require("../../cli/display/progress");
|
|
8
|
+
exports.listCommand = new commander_1.Command("list")
|
|
9
|
+
.description("List all tasks")
|
|
10
|
+
.option("--status <status>", "Filter by status (todo/in-progress/completed)")
|
|
11
|
+
.option("--tag <tag>", "Filter by tag")
|
|
12
|
+
.action(async (options) => {
|
|
13
|
+
try {
|
|
14
|
+
const tasks = await tasks_1.taskService.listTasks({
|
|
15
|
+
status: options.status,
|
|
16
|
+
tag: options.tag,
|
|
17
|
+
});
|
|
18
|
+
(0, task_1.displayTaskList)(tasks);
|
|
19
|
+
for (const task of tasks) {
|
|
20
|
+
await (0, task_1.displayTask)(task, { showSubtasks: true });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
(0, progress_1.displayError)(error);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,WAAW,SAuCpB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.nextCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const tasks_1 = require("../../services/tasks");
|
|
10
|
+
const task_1 = require("../../cli/display/task");
|
|
11
|
+
const progress_1 = require("../../cli/display/progress");
|
|
12
|
+
exports.nextCommand = new commander_1.Command("get-next")
|
|
13
|
+
.description("Get the next task to work on (defaults to hierarchical order)")
|
|
14
|
+
.option("--status <status>", "Filter by status (todo/in-progress)")
|
|
15
|
+
.option("--tag <tag>", "Filter by tag")
|
|
16
|
+
.option("--effort <effort>", "Filter by effort (small/medium/large)")
|
|
17
|
+
.option("--priority <priority>", "Sort priority (newest/oldest/effort)", "hierarchical")
|
|
18
|
+
.action(async (options) => {
|
|
19
|
+
try {
|
|
20
|
+
// Default to todo status if not specified
|
|
21
|
+
const searchOptions = {
|
|
22
|
+
...options,
|
|
23
|
+
status: options.status || "todo",
|
|
24
|
+
};
|
|
25
|
+
const nextTask = await tasks_1.taskService.getNextTask(searchOptions);
|
|
26
|
+
if (!nextTask) {
|
|
27
|
+
console.log(chalk_1.default.yellow("No tasks found matching the criteria."));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const criteria = [
|
|
31
|
+
searchOptions.status && `status: ${searchOptions.status}`,
|
|
32
|
+
options.tag && `tag: ${options.tag}`,
|
|
33
|
+
options.effort && `effort: ${options.effort}`,
|
|
34
|
+
options.priority && `priority: ${options.priority}`,
|
|
35
|
+
]
|
|
36
|
+
.filter(Boolean)
|
|
37
|
+
.join(", ");
|
|
38
|
+
(0, task_1.displayNextTask)(nextTask, criteria || "next todo task");
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
(0, progress_1.displayError)(error);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
export declare const planCommand: Command;
|
|
3
|
+
export declare const getPlanCommand: Command;
|
|
4
|
+
export declare const listPlanCommand: Command;
|
|
5
|
+
export declare const deletePlanCommand: Command;
|
|
6
|
+
export declare const setPlanCommand: Command;
|
|
7
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,eAAO,MAAM,WAAW,SA+CpB,CAAC;AAEL,eAAO,MAAM,cAAc,SA4BvB,CAAC;AAEL,eAAO,MAAM,eAAe,SAsBxB,CAAC;AAEL,eAAO,MAAM,iBAAiB,SAW1B,CAAC;AAEL,eAAO,MAAM,cAAc,SAsCvB,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
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.setPlanCommand = exports.deletePlanCommand = exports.listPlanCommand = exports.getPlanCommand = exports.planCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const tasks_1 = require("../../services/tasks");
|
|
10
|
+
const hooks_1 = require("../../lib/hooks");
|
|
11
|
+
const streaming_options_1 = require("../../utils/streaming-options");
|
|
12
|
+
const progress_1 = require("../../cli/display/progress");
|
|
13
|
+
const plan_1 = require("../../cli/display/plan");
|
|
14
|
+
exports.planCommand = new commander_1.Command("plan")
|
|
15
|
+
.description("Create detailed implementation plan for a task or subtask")
|
|
16
|
+
.requiredOption("--id <id>", "Task or subtask ID to plan")
|
|
17
|
+
.option("--stream", "Show streaming AI output during planning")
|
|
18
|
+
.option("--ai-provider <provider>", "AI provider override")
|
|
19
|
+
.option("--ai-model <model>", "AI model override")
|
|
20
|
+
.option("--ai-key <key>", "AI API key override")
|
|
21
|
+
.option("--ai-provider-url <url>", "AI provider URL override")
|
|
22
|
+
.option("--reasoning <tokens>", "Enable reasoning for OpenRouter models (max reasoning tokens)")
|
|
23
|
+
.action(async (options) => {
|
|
24
|
+
try {
|
|
25
|
+
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.stream, "Planning");
|
|
26
|
+
const progressHandler = (payload) => {
|
|
27
|
+
(0, progress_1.displayProgress)(payload);
|
|
28
|
+
};
|
|
29
|
+
hooks_1.hooks.on("task:progress", progressHandler);
|
|
30
|
+
try {
|
|
31
|
+
const result = await tasks_1.taskService.planTask(options.id, {
|
|
32
|
+
aiProvider: options.aiProvider,
|
|
33
|
+
aiModel: options.aiModel,
|
|
34
|
+
aiKey: options.aiKey,
|
|
35
|
+
aiProviderUrl: options.aiProviderUrl,
|
|
36
|
+
aiReasoning: options.reasoning,
|
|
37
|
+
}, streamingOptions);
|
|
38
|
+
// Display the plan
|
|
39
|
+
(0, plan_1.displayPlanCreation)(options.id, result.task.title);
|
|
40
|
+
console.log(chalk_1.default.cyan(result.plan));
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
hooks_1.hooks.off("task:progress", progressHandler);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
(0, progress_1.displayError)(error);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
exports.getPlanCommand = new commander_1.Command("get-plan")
|
|
52
|
+
.description("View existing implementation plan for a task or subtask")
|
|
53
|
+
.requiredOption("--id <id>", "Task or subtask ID")
|
|
54
|
+
.action(async (options) => {
|
|
55
|
+
try {
|
|
56
|
+
const plan = await tasks_1.taskService.getTaskPlan(options.id);
|
|
57
|
+
if (!plan) {
|
|
58
|
+
console.log(chalk_1.default.yellow(`⚠️ No plan found for task/subtask ${options.id}`));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const task = await tasks_1.taskService.getTask(options.id);
|
|
62
|
+
const taskTitle = task ? task.title : options.id;
|
|
63
|
+
(0, plan_1.displayPlanView)(taskTitle, options.id, plan.plan, plan.createdAt, plan.updatedAt);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
(0, progress_1.displayError)(error);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
exports.listPlanCommand = new commander_1.Command("list-plan")
|
|
71
|
+
.description("List all available implementation plans")
|
|
72
|
+
.action(async () => {
|
|
73
|
+
try {
|
|
74
|
+
const plans = await tasks_1.taskService.listTaskPlans();
|
|
75
|
+
// Get task titles for each plan
|
|
76
|
+
const plansWithTitles = await Promise.all(plans.map(async (plan) => {
|
|
77
|
+
const task = await tasks_1.taskService.getTask(plan.taskId);
|
|
78
|
+
return {
|
|
79
|
+
...plan,
|
|
80
|
+
taskTitle: task ? task.title : plan.taskId,
|
|
81
|
+
};
|
|
82
|
+
}));
|
|
83
|
+
(0, plan_1.displayPlanList)(plansWithTitles);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
(0, progress_1.displayError)(error);
|
|
87
|
+
process.exit(1);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
exports.deletePlanCommand = new commander_1.Command("delete-plan")
|
|
91
|
+
.description("Delete implementation plan for a task")
|
|
92
|
+
.requiredOption("--id <id>", "Task ID")
|
|
93
|
+
.action(async (options) => {
|
|
94
|
+
try {
|
|
95
|
+
const success = await tasks_1.taskService.deleteTaskPlan(options.id);
|
|
96
|
+
(0, plan_1.displayPlanDeletion)(options.id, success);
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
(0, progress_1.displayError)(error);
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
exports.setPlanCommand = new commander_1.Command("set-plan")
|
|
104
|
+
.description("Set implementation plan for a task")
|
|
105
|
+
.requiredOption("--id <id>", "Task ID")
|
|
106
|
+
.option("--plan <text>", "Plan text (use quotes for multi-line)")
|
|
107
|
+
.option("--plan-file <path>", "Path to file containing the plan")
|
|
108
|
+
.action(async (options) => {
|
|
109
|
+
try {
|
|
110
|
+
const task = await tasks_1.taskService.getTask(options.id);
|
|
111
|
+
if (!task) {
|
|
112
|
+
throw new Error(`Task with ID ${options.id} not found`);
|
|
113
|
+
}
|
|
114
|
+
if (!options.plan && !options.planFile) {
|
|
115
|
+
throw new Error("Either --plan or --plan-file must be specified");
|
|
116
|
+
}
|
|
117
|
+
if (options.plan && options.planFile) {
|
|
118
|
+
throw new Error("Cannot specify both --plan and --plan-file");
|
|
119
|
+
}
|
|
120
|
+
const result = await tasks_1.taskService.setTaskPlan(options.id, options.plan || undefined, options.planFile || undefined);
|
|
121
|
+
console.log(chalk_1.default.green(`✓ Plan set for task: ${task.title} (${options.id})`));
|
|
122
|
+
console.log(chalk_1.default.gray(` Plan file: ${result.planFile}`));
|
|
123
|
+
if (options.planFile) {
|
|
124
|
+
console.log(chalk_1.default.gray(` Source file: ${options.planFile}`));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
(0, progress_1.displayError)(error);
|
|
129
|
+
process.exit(1);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,WAAW,SAgBpB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.showCommand = void 0;
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const tasks_1 = require("../../services/tasks");
|
|
6
|
+
const task_1 = require("../../cli/display/task");
|
|
7
|
+
const progress_1 = require("../../cli/display/progress");
|
|
8
|
+
exports.showCommand = new commander_1.Command("show")
|
|
9
|
+
.description("Show detailed information about a task")
|
|
10
|
+
.requiredOption("--id <id>", "Task ID")
|
|
11
|
+
.action(async (options) => {
|
|
12
|
+
try {
|
|
13
|
+
const task = await tasks_1.taskService.getTask(options.id);
|
|
14
|
+
if (!task) {
|
|
15
|
+
throw new Error(`Task with ID ${options.id} not found`);
|
|
16
|
+
}
|
|
17
|
+
await (0, task_1.displayTaskDetails)(task);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
(0, progress_1.displayError)(error);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,eAAO,MAAM,YAAY,SAyHrB,CAAC"}
|