task-o-matic 0.0.3 → 0.0.6
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/cli/bin.js +0 -0
- 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 -686
- package/dist/commands/workflow.d.ts +4 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +503 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/lib/ai-service/ai-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/ai-operations.js +54 -22
- 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/better-t-stack-cli.d.ts +1 -0
- package/dist/lib/better-t-stack-cli.d.ts.map +1 -1
- package/dist/lib/better-t-stack-cli.js +8 -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/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.map +1 -1
- package/dist/lib/prompt-builder.js +16 -8
- 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 +22 -3
- package/dist/mcp/server.js +0 -0
- 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/tasks.d.ts +4 -6
- package/dist/services/tasks.d.ts.map +1 -1
- package/dist/services/tasks.js +115 -96
- 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 +4 -4
- package/dist/lib/storage.d.ts.map +0 -1
|
@@ -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"}
|
|
@@ -0,0 +1,95 @@
|
|
|
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.splitCommand = 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 task_1 = require("../../cli/display/task");
|
|
14
|
+
exports.splitCommand = new commander_1.Command("split")
|
|
15
|
+
.description("Split a task into smaller subtasks using AI")
|
|
16
|
+
.option("--task-id <id>", "Task ID to split")
|
|
17
|
+
.option("--all", "Split all existing tasks that don't have subtasks")
|
|
18
|
+
.option("--stream", "Show streaming AI output during breakdown")
|
|
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
|
+
.option("--tools", "Enable filesystem tools for project analysis")
|
|
25
|
+
.action(async (options) => {
|
|
26
|
+
try {
|
|
27
|
+
if (!options.taskId && !options.all) {
|
|
28
|
+
throw new Error("Either --task-id or --all must be specified");
|
|
29
|
+
}
|
|
30
|
+
if (options.taskId && options.all) {
|
|
31
|
+
throw new Error("Cannot specify both --task-id and --all");
|
|
32
|
+
}
|
|
33
|
+
const splitSingleTask = async (taskId) => {
|
|
34
|
+
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.stream, "Task breakdown");
|
|
35
|
+
const progressHandler = (payload) => {
|
|
36
|
+
(0, progress_1.displayProgress)(payload);
|
|
37
|
+
};
|
|
38
|
+
hooks_1.hooks.on("task:progress", progressHandler);
|
|
39
|
+
try {
|
|
40
|
+
const result = await tasks_1.taskService.splitTask(taskId, {
|
|
41
|
+
aiProvider: options.aiProvider,
|
|
42
|
+
aiModel: options.aiModel,
|
|
43
|
+
aiKey: options.aiKey,
|
|
44
|
+
aiProviderUrl: options.aiProviderUrl,
|
|
45
|
+
aiReasoning: options.reasoning,
|
|
46
|
+
}, undefined, undefined, streamingOptions, options.tools);
|
|
47
|
+
(0, task_1.displaySubtaskCreation)(result.subtasks);
|
|
48
|
+
// Display AI metadata
|
|
49
|
+
console.log(chalk_1.default.gray(`\n📊 AI Splitting Details:`));
|
|
50
|
+
console.log(chalk_1.default.gray(` Provider: ${result.metadata.aiProvider}`));
|
|
51
|
+
console.log(chalk_1.default.gray(` Model: ${result.metadata.aiModel}`));
|
|
52
|
+
console.log(chalk_1.default.gray(` Subtasks created: ${result.subtasks.length}`));
|
|
53
|
+
console.log(chalk_1.default.gray(` Confidence: ${result.metadata.confidence
|
|
54
|
+
? (result.metadata.confidence * 100).toFixed(1)
|
|
55
|
+
: "N/A"}%`));
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
if (error instanceof Error && error.message.includes("already has")) {
|
|
59
|
+
console.log(chalk_1.default.yellow(`⚠️ ${error.message}`));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
hooks_1.hooks.off("task:progress", progressHandler);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
if (options.taskId) {
|
|
69
|
+
await splitSingleTask(options.taskId);
|
|
70
|
+
}
|
|
71
|
+
else if (options.all) {
|
|
72
|
+
const allTasks = await tasks_1.taskService.listTasks({});
|
|
73
|
+
if (allTasks.length === 0) {
|
|
74
|
+
console.log(chalk_1.default.yellow("No tasks found to split."));
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
console.log(chalk_1.default.blue(`🔧 Splitting ${allTasks.length} tasks...`));
|
|
78
|
+
for (let i = 0; i < allTasks.length; i++) {
|
|
79
|
+
const task = allTasks[i];
|
|
80
|
+
console.log(chalk_1.default.cyan(`\n[${i + 1}/${allTasks.length}] Splitting: ${task.title}`));
|
|
81
|
+
try {
|
|
82
|
+
await splitSingleTask(task.id);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.log(chalk_1.default.red(`❌ Failed to split task ${task.id}: ${error instanceof Error ? error.message : "Unknown error"}`));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
console.log(chalk_1.default.green(`\n✓ Bulk splitting complete! Processed ${allTasks.length} tasks.`));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
(0, progress_1.displayError)(error);
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,aAAa,SAyBtB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.statusCommand = 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.statusCommand = new commander_1.Command("status")
|
|
9
|
+
.description("Set task status")
|
|
10
|
+
.requiredOption("--id <id>", "Task ID")
|
|
11
|
+
.requiredOption("--status <status>", "New status (todo/in-progress/completed)")
|
|
12
|
+
.action(async (options) => {
|
|
13
|
+
try {
|
|
14
|
+
const task = await tasks_1.taskService.getTask(options.id);
|
|
15
|
+
if (!task) {
|
|
16
|
+
throw new Error(`Task with ID ${options.id} not found`);
|
|
17
|
+
}
|
|
18
|
+
const oldStatus = task.status;
|
|
19
|
+
const updatedTask = await tasks_1.taskService.setTaskStatus(options.id, options.status);
|
|
20
|
+
(0, task_1.displayTaskStatusChange)(updatedTask, oldStatus, options.status);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
(0, progress_1.displayError)(error);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subtasks.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/subtasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,eAAe,SA4BxB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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.subtasksCommand = 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.subtasksCommand = new commander_1.Command("subtasks")
|
|
13
|
+
.description("List subtasks for a task")
|
|
14
|
+
.requiredOption("--id <id>", "Parent task ID")
|
|
15
|
+
.action(async (options) => {
|
|
16
|
+
try {
|
|
17
|
+
const subtasks = await tasks_1.taskService.getSubtasks(options.id);
|
|
18
|
+
if (subtasks.length === 0) {
|
|
19
|
+
console.log(chalk_1.default.yellow(`No subtasks found for task ${options.id}`));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const parentTask = await tasks_1.taskService.getTask(options.id);
|
|
23
|
+
const parentTitle = parentTask ? parentTask.title : options.id;
|
|
24
|
+
console.log(chalk_1.default.blue(`\n📋 Subtasks for ${parentTitle} (${options.id}):`));
|
|
25
|
+
console.log("");
|
|
26
|
+
for (let i = 0; i < subtasks.length; i++) {
|
|
27
|
+
const subtask = subtasks[i];
|
|
28
|
+
await (0, task_1.displayTask)(subtask, { indent: " ", showSubtasks: false });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
(0, progress_1.displayError)(error);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,cAAc,SAcvB,CAAC;AAEL,eAAO,MAAM,iBAAiB,SAc1B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeTagsCommand = exports.addTagsCommand = 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.addTagsCommand = new commander_1.Command("add-tags")
|
|
9
|
+
.description("Add tags to a task")
|
|
10
|
+
.requiredOption("--id <id>", "Task ID")
|
|
11
|
+
.requiredOption("--tags <tags>", "Tags to add (comma-separated)")
|
|
12
|
+
.action(async (options) => {
|
|
13
|
+
try {
|
|
14
|
+
const tags = options.tags.split(",").map((tag) => tag.trim());
|
|
15
|
+
const updatedTask = await tasks_1.taskService.addTags(options.id, tags);
|
|
16
|
+
(0, task_1.displayTagsUpdate)(updatedTask, tags, []);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
(0, progress_1.displayError)(error);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
exports.removeTagsCommand = new commander_1.Command("remove-tags")
|
|
24
|
+
.description("Remove tags from a task")
|
|
25
|
+
.requiredOption("--id <id>", "Task ID")
|
|
26
|
+
.requiredOption("--tags <tags>", "Tags to remove (comma-separated)")
|
|
27
|
+
.action(async (options) => {
|
|
28
|
+
try {
|
|
29
|
+
const tags = options.tags.split(",").map((tag) => tag.trim());
|
|
30
|
+
const updatedTask = await tasks_1.taskService.removeTags(options.id, tags);
|
|
31
|
+
(0, task_1.displayTagsUpdate)(updatedTask, [], tags);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
(0, progress_1.displayError)(error);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,WAAW,SAcpB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.treeCommand = 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.treeCommand = new commander_1.Command("tree")
|
|
9
|
+
.description("Display hierarchical task tree")
|
|
10
|
+
.option("--id <id>", "Root task ID (optional - shows full tree if not specified)")
|
|
11
|
+
.action(async (options) => {
|
|
12
|
+
try {
|
|
13
|
+
const tasks = await tasks_1.taskService.getTaskTree(options.id);
|
|
14
|
+
await (0, task_1.displayTaskTree)(tasks, options.id);
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
(0, progress_1.displayError)(error);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,aAAa,SA4BtB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateCommand = 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.updateCommand = new commander_1.Command("update")
|
|
9
|
+
.description("Update an existing task")
|
|
10
|
+
.requiredOption("--id <id>", "Task ID to update")
|
|
11
|
+
.option("--title <title>", "New task title")
|
|
12
|
+
.option("--description <description>", "New task description")
|
|
13
|
+
.option("--status <status>", "New status (todo/in-progress/completed)")
|
|
14
|
+
.option("--effort <effort>", "New estimated effort (small/medium/large)")
|
|
15
|
+
.option("--tags <tags>", "New tags (comma-separated)")
|
|
16
|
+
.action(async (options) => {
|
|
17
|
+
try {
|
|
18
|
+
const { id, ...updates } = options;
|
|
19
|
+
if (Object.keys(updates).length === 0) {
|
|
20
|
+
throw new Error("At least one field must be specified for update");
|
|
21
|
+
}
|
|
22
|
+
const updatedTask = await tasks_1.taskService.updateTask(id, {
|
|
23
|
+
title: updates.title,
|
|
24
|
+
description: updates.description,
|
|
25
|
+
status: updates.status,
|
|
26
|
+
effort: updates.effort,
|
|
27
|
+
tags: updates.tags,
|
|
28
|
+
});
|
|
29
|
+
(0, task_1.displayTaskUpdate)(updatedTask, updates);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
(0, progress_1.displayError)(error);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
@@ -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;AA0BpC,eAAO,MAAM,YAAY,SAAuB,CAAC"}
|