task-o-matic 0.0.12 ā 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/init.js +41 -8
- package/dist/commands/tasks/create.d.ts.map +1 -1
- package/dist/commands/tasks/create.js +6 -13
- package/dist/commands/tasks/document/add.d.ts +3 -0
- package/dist/commands/tasks/document/add.d.ts.map +1 -0
- package/dist/commands/tasks/document/add.js +35 -0
- package/dist/commands/tasks/document/analyze.d.ts +3 -0
- package/dist/commands/tasks/document/analyze.d.ts.map +1 -0
- package/dist/commands/tasks/document/analyze.js +49 -0
- package/dist/commands/tasks/document/get.d.ts +3 -0
- package/dist/commands/tasks/document/get.d.ts.map +1 -0
- package/dist/commands/tasks/document/get.js +29 -0
- package/dist/commands/tasks/document/index.d.ts +8 -0
- package/dist/commands/tasks/document/index.d.ts.map +1 -0
- package/dist/commands/tasks/document/index.js +13 -0
- package/dist/commands/tasks/enhance.d.ts.map +1 -1
- package/dist/commands/tasks/enhance.js +64 -61
- package/dist/commands/tasks/execute-loop.d.ts.map +1 -1
- package/dist/commands/tasks/execute-loop.js +64 -90
- package/dist/commands/tasks/execute.d.ts.map +1 -1
- package/dist/commands/tasks/execute.js +52 -16
- package/dist/commands/tasks/list.js +2 -2
- package/dist/commands/tasks/next.js +4 -4
- package/dist/commands/tasks/plan/create.d.ts +3 -0
- package/dist/commands/tasks/plan/create.d.ts.map +1 -0
- package/dist/commands/tasks/plan/create.js +37 -0
- package/dist/commands/tasks/plan/delete.d.ts +3 -0
- package/dist/commands/tasks/plan/delete.d.ts.map +1 -0
- package/dist/commands/tasks/plan/delete.js +14 -0
- package/dist/commands/tasks/plan/get.d.ts +3 -0
- package/dist/commands/tasks/plan/get.d.ts.map +1 -0
- package/dist/commands/tasks/plan/get.js +24 -0
- package/dist/commands/tasks/plan/index.d.ts +10 -0
- package/dist/commands/tasks/plan/index.d.ts.map +1 -0
- package/dist/commands/tasks/plan/index.js +17 -0
- package/dist/commands/tasks/plan/list.d.ts +3 -0
- package/dist/commands/tasks/plan/list.d.ts.map +1 -0
- package/dist/commands/tasks/plan/list.js +21 -0
- package/dist/commands/tasks/plan/set.d.ts +3 -0
- package/dist/commands/tasks/plan/set.d.ts.map +1 -0
- package/dist/commands/tasks/plan/set.js +33 -0
- package/dist/commands/tasks/split.d.ts.map +1 -1
- package/dist/commands/tasks/split.js +65 -60
- package/dist/commands/tasks/status.js +2 -2
- package/dist/lib/ai-service/ai-operations.d.ts +1 -1
- package/dist/lib/ai-service/ai-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/base-operations.d.ts +22 -0
- package/dist/lib/ai-service/base-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/base-operations.js +29 -1
- package/dist/lib/ai-service/task-operations.d.ts +1 -1
- package/dist/lib/ai-service/task-operations.d.ts.map +1 -1
- package/dist/lib/better-t-stack-cli.d.ts +36 -21
- package/dist/lib/better-t-stack-cli.d.ts.map +1 -1
- package/dist/lib/better-t-stack-cli.js +212 -33
- package/dist/lib/bootstrap/cli-bootstrap.d.ts +14 -0
- package/dist/lib/bootstrap/cli-bootstrap.d.ts.map +1 -0
- package/dist/lib/bootstrap/cli-bootstrap.js +325 -0
- package/dist/lib/bootstrap/index.d.ts +4 -0
- package/dist/lib/bootstrap/index.d.ts.map +1 -0
- package/dist/lib/bootstrap/index.js +19 -0
- package/dist/lib/bootstrap/medusa-bootstrap.d.ts +14 -0
- package/dist/lib/bootstrap/medusa-bootstrap.d.ts.map +1 -0
- package/dist/lib/bootstrap/medusa-bootstrap.js +218 -0
- package/dist/lib/bootstrap/opentui-bootstrap.d.ts +11 -0
- package/dist/lib/bootstrap/opentui-bootstrap.d.ts.map +1 -0
- package/dist/lib/bootstrap/opentui-bootstrap.js +342 -0
- package/dist/lib/config.d.ts +14 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +18 -0
- package/dist/lib/git-utils.d.ts +45 -0
- package/dist/lib/git-utils.d.ts.map +1 -0
- package/dist/lib/git-utils.js +160 -0
- package/dist/lib/task-execution-core.d.ts +7 -0
- package/dist/lib/task-execution-core.d.ts.map +1 -0
- package/dist/lib/task-execution-core.js +360 -0
- package/dist/lib/task-execution.d.ts +4 -0
- package/dist/lib/task-execution.d.ts.map +1 -1
- package/dist/lib/task-execution.js +31 -149
- package/dist/lib/task-loop-execution.d.ts +1 -19
- package/dist/lib/task-loop-execution.d.ts.map +1 -1
- package/dist/lib/task-loop-execution.js +50 -585
- package/dist/lib/task-planning.d.ts +28 -0
- package/dist/lib/task-planning.d.ts.map +1 -0
- package/dist/lib/task-planning.js +109 -0
- package/dist/lib/task-review.d.ts +27 -0
- package/dist/lib/task-review.d.ts.map +1 -0
- package/dist/lib/task-review.js +106 -0
- package/dist/lib/validation.d.ts +20 -3
- package/dist/lib/validation.d.ts.map +1 -1
- package/dist/lib/validation.js +39 -10
- package/dist/services/prd.d.ts.map +1 -1
- package/dist/services/prd.js +18 -45
- package/dist/services/tasks.d.ts +2 -2
- package/dist/services/tasks.d.ts.map +1 -1
- package/dist/services/tasks.js +55 -85
- package/dist/test/task-loop-git.test.js +6 -6
- package/dist/types/cli-options.d.ts +138 -0
- package/dist/types/cli-options.d.ts.map +1 -0
- package/dist/types/cli-options.js +6 -0
- package/dist/types/index.d.ts +74 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/results.d.ts +60 -6
- package/dist/types/results.d.ts.map +1 -1
- package/dist/utils/bulk-operations.d.ts +51 -0
- package/dist/utils/bulk-operations.d.ts.map +1 -0
- package/dist/utils/bulk-operations.js +68 -0
- package/dist/utils/cli-validators.d.ts +54 -0
- package/dist/utils/cli-validators.d.ts.map +1 -0
- package/dist/utils/cli-validators.js +75 -0
- package/dist/utils/command-error-handler.d.ts +32 -0
- package/dist/utils/command-error-handler.d.ts.map +1 -0
- package/dist/utils/command-error-handler.js +52 -0
- package/dist/utils/confirmation.d.ts +19 -0
- package/dist/utils/confirmation.d.ts.map +1 -0
- package/dist/utils/confirmation.js +39 -0
- package/dist/utils/display-helpers.d.ts +81 -0
- package/dist/utils/display-helpers.d.ts.map +1 -0
- package/dist/utils/display-helpers.js +109 -0
- package/dist/utils/error-utils.d.ts +70 -0
- package/dist/utils/error-utils.d.ts.map +1 -0
- package/dist/utils/error-utils.js +103 -0
- package/dist/utils/file-utils.d.ts +49 -0
- package/dist/utils/file-utils.d.ts.map +1 -0
- package/dist/utils/file-utils.js +77 -0
- package/dist/utils/id-generator.d.ts +92 -0
- package/dist/utils/id-generator.d.ts.map +1 -0
- package/dist/utils/id-generator.js +140 -0
- package/dist/utils/model-executor-parser.d.ts +38 -0
- package/dist/utils/model-executor-parser.d.ts.map +1 -0
- package/dist/utils/model-executor-parser.js +67 -0
- package/dist/utils/progress-tracking.d.ts +28 -0
- package/dist/utils/progress-tracking.d.ts.map +1 -0
- package/dist/utils/progress-tracking.js +43 -0
- package/dist/utils/stack-formatter.d.ts +2 -1
- package/dist/utils/stack-formatter.d.ts.map +1 -1
- package/dist/utils/stack-formatter.js +8 -2
- package/dist/utils/storage-utils.d.ts +49 -0
- package/dist/utils/storage-utils.d.ts.map +1 -0
- package/dist/utils/storage-utils.js +79 -0
- package/dist/utils/streaming-utils.d.ts +38 -0
- package/dist/utils/streaming-utils.d.ts.map +1 -0
- package/dist/utils/streaming-utils.js +56 -0
- package/docs/agents/cli.md +58 -149
- package/package.json +1 -1
- package/dist/commands/tasks/document.d.ts +0 -5
- package/dist/commands/tasks/document.d.ts.map +0 -1
- package/dist/commands/tasks/document.js +0 -118
- package/dist/commands/tasks/plan.d.ts +0 -7
- package/dist/commands/tasks/plan.d.ts.map +0 -1
- package/dist/commands/tasks/plan.js +0 -131
package/dist/commands/init.js
CHANGED
|
@@ -11,7 +11,7 @@ const fs_1 = require("fs");
|
|
|
11
11
|
const path_1 = require("path");
|
|
12
12
|
const config_1 = require("../lib/config");
|
|
13
13
|
const better_t_stack_cli_1 = require("../lib/better-t-stack-cli");
|
|
14
|
-
exports.initCommand = new commander_1.Command("init").description("Initialize task-o-matic project and bootstrap
|
|
14
|
+
exports.initCommand = new commander_1.Command("init").description("Initialize task-o-matic project and bootstrap projects (web/native/cli/tui)");
|
|
15
15
|
// Initialize task-o-matic project
|
|
16
16
|
exports.initCommand
|
|
17
17
|
.command("init")
|
|
@@ -24,7 +24,7 @@ exports.initCommand
|
|
|
24
24
|
.option("--temperature <temp>", "AI temperature", "0.5")
|
|
25
25
|
.option("--no-bootstrap", "Skip bootstrap after initialization")
|
|
26
26
|
.option("--project-name <name>", "Project name for bootstrap")
|
|
27
|
-
.option("--frontend <
|
|
27
|
+
.option("--frontend <frontends...>", "Frontend framework(s) - space/comma-separated (next, native-bare, cli, tui, etc.)", "next")
|
|
28
28
|
.option("--backend <backend>", "Backend framework for bootstrap", "convex")
|
|
29
29
|
.option("--database <database>", "Database for bootstrap")
|
|
30
30
|
.option("--auth <auth>", "Authentication for bootstrap", "better-auth")
|
|
@@ -33,6 +33,8 @@ exports.initCommand
|
|
|
33
33
|
.option("--package-manager <pm>", "Package manager (npm/pnpm/bun)", "npm")
|
|
34
34
|
.option("--runtime <runtime>", "Runtime (bun/node)", "node")
|
|
35
35
|
.option("--payment <payment>", "Payment provider (none/polar)", "none")
|
|
36
|
+
.option("--cli-deps <level>", "CLI dependency level (minimal/standard/full/task-o-matic)", "standard")
|
|
37
|
+
.option("--tui-framework <framework>", "TUI framework (solid/vue/react)", "solid")
|
|
36
38
|
.action(async (options) => {
|
|
37
39
|
// Handle directory creation/setup first
|
|
38
40
|
if (options.directory) {
|
|
@@ -136,9 +138,9 @@ async function initializeProjectStructure(options) {
|
|
|
136
138
|
// Bootstrap project with Better-T-Stack
|
|
137
139
|
exports.initCommand
|
|
138
140
|
.command("bootstrap")
|
|
139
|
-
.description("Bootstrap a new project
|
|
141
|
+
.description("Bootstrap a new project (web/native/cli/tui)")
|
|
140
142
|
.argument("<name>", "Project name")
|
|
141
|
-
.option("--frontend <
|
|
143
|
+
.option("--frontend <frontends...>", "Frontend framework(s) - space/comma-separated (next, native-bare, cli, tui, etc.)", "next")
|
|
142
144
|
.option("--backend <backend>", "Backend framework (hono/express/elysia)", "hono")
|
|
143
145
|
.option("--database <database>", "Database (sqlite/postgres/mysql/mongodb)", "sqlite")
|
|
144
146
|
.option("--orm <orm>", "ORM (drizzle/prisma/none)", "drizzle")
|
|
@@ -152,6 +154,8 @@ exports.initCommand
|
|
|
152
154
|
.option("--runtime <runtime>", "Runtime (bun/node)", "node")
|
|
153
155
|
.option("--api <type>", "API type (trpc/orpc)")
|
|
154
156
|
.option("--payment <payment>", "Payment provider (none/polar)", "none")
|
|
157
|
+
.option("--cli-deps <level>", "CLI dependency level (minimal/standard/full/task-o-matic)", "standard")
|
|
158
|
+
.option("--tui-framework <framework>", "TUI framework (solid/vue/react)", "solid")
|
|
155
159
|
.action(async (name, options) => {
|
|
156
160
|
const taskOMaticDir = config_1.configManager.getTaskOMaticDir();
|
|
157
161
|
if (!(0, fs_1.existsSync)(taskOMaticDir)) {
|
|
@@ -192,11 +196,32 @@ exports.initCommand.action(() => {
|
|
|
192
196
|
console.log(" task-o-matic init bootstrap <name> Bootstrap Better-T-Stack project");
|
|
193
197
|
console.log("");
|
|
194
198
|
console.log(chalk_1.default.cyan("Examples:"));
|
|
199
|
+
console.log(" # Basic initialization:");
|
|
195
200
|
console.log(" task-o-matic init init");
|
|
196
201
|
console.log(" task-o-matic init init --project-name my-app");
|
|
197
|
-
console.log("
|
|
202
|
+
console.log("");
|
|
203
|
+
console.log(" # Web + Native + CLI + TUI (monorepo):");
|
|
204
|
+
console.log(" task-o-matic init init --project-name my-app --frontend \"next native-uniwind cli tui\" --backend hono");
|
|
205
|
+
console.log("");
|
|
206
|
+
console.log(" # CLI only:");
|
|
207
|
+
console.log(" task-o-matic init init --project-name my-cli --frontend cli --cli-deps full");
|
|
208
|
+
console.log("");
|
|
209
|
+
console.log(" # TUI only:");
|
|
210
|
+
console.log(" task-o-matic init init --project-name my-tui --frontend tui --tui-framework solid");
|
|
211
|
+
console.log("");
|
|
212
|
+
console.log(" # Web + Native (monorepo):");
|
|
213
|
+
console.log(" task-o-matic init init --project-name my-app --frontend \"next native-bare\" --backend hono");
|
|
214
|
+
console.log("");
|
|
215
|
+
console.log(" # Multiple web frontends:");
|
|
216
|
+
console.log(" task-o-matic init init --project-name my-app --frontend \"next tanstack-router\" --backend hono");
|
|
217
|
+
console.log("");
|
|
218
|
+
console.log(" # No bootstrap:");
|
|
198
219
|
console.log(" task-o-matic init init --project-name my-app --no-bootstrap");
|
|
220
|
+
console.log("");
|
|
221
|
+
console.log(" # Custom directory:");
|
|
199
222
|
console.log(" task-o-matic init init --directory my-workspace --project-name my-app");
|
|
223
|
+
console.log("");
|
|
224
|
+
console.log(" # Bootstrap command:");
|
|
200
225
|
console.log(" task-o-matic init bootstrap my-app --frontend next --backend hono --database postgres");
|
|
201
226
|
console.log("");
|
|
202
227
|
console.log(chalk_1.default.cyan("Init Options:"));
|
|
@@ -211,8 +236,16 @@ exports.initCommand.action(() => {
|
|
|
211
236
|
console.log(" --directory <dir> Working directory for the project");
|
|
212
237
|
console.log("");
|
|
213
238
|
console.log(chalk_1.default.cyan("Bootstrap Options:"));
|
|
214
|
-
console.log(" --frontend <
|
|
215
|
-
console.log("
|
|
239
|
+
console.log(" --frontend <frontends...> Frontend framework(s) - multiple values supported");
|
|
240
|
+
console.log(" Web: next, tanstack-router, react-router, nuxt, svelte, solid");
|
|
241
|
+
console.log(" Native: native-bare, native-uniwind, native-unistyles");
|
|
242
|
+
console.log(" Custom: cli, tui");
|
|
243
|
+
console.log(" --backend <backend> Backend framework (hono/express/elysia/convex)");
|
|
216
244
|
console.log(" --database <database> Database (sqlite/postgres/mysql/mongodb)");
|
|
217
|
-
console.log(" --auth
|
|
245
|
+
console.log(" --auth <auth> Authentication (better-auth/none)");
|
|
246
|
+
console.log(" --cli-deps <level> CLI dependency level (minimal/standard/full/task-o-matic)");
|
|
247
|
+
console.log(" --tui-framework <framework> TUI framework (solid/vue/react)");
|
|
248
|
+
console.log(" --package-manager <pm> Package manager (npm/pnpm/bun)");
|
|
249
|
+
console.log(" --runtime <runtime> Runtime (node/bun)");
|
|
250
|
+
console.log(" --payment <payment> Payment provider (none/polar)");
|
|
218
251
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,eAAO,MAAM,aAAa,SA+CtB,CAAC"}
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createCommand = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
5
|
const tasks_1 = require("../../services/tasks");
|
|
6
|
-
const hooks_1 = require("../../lib/hooks");
|
|
7
6
|
const streaming_options_1 = require("../../utils/streaming-options");
|
|
8
7
|
const progress_1 = require("../../cli/display/progress");
|
|
9
8
|
const common_1 = require("../../cli/display/common");
|
|
10
9
|
const task_1 = require("../../cli/display/task");
|
|
10
|
+
const progress_tracking_1 = require("../../utils/progress-tracking");
|
|
11
11
|
exports.createCommand = new commander_1.Command("create")
|
|
12
12
|
.description("Create a new task with AI enhancement using Context7")
|
|
13
13
|
.requiredOption("--title <title>", "Task title")
|
|
@@ -24,12 +24,8 @@ exports.createCommand = new commander_1.Command("create")
|
|
|
24
24
|
.action(async (options) => {
|
|
25
25
|
try {
|
|
26
26
|
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.aiEnhance && options.stream, "Enhancement");
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
hooks_1.hooks.on("task:progress", progressHandler);
|
|
31
|
-
try {
|
|
32
|
-
const result = await tasks_1.taskService.createTask({
|
|
27
|
+
const result = await (0, progress_tracking_1.withProgressTracking)(async () => {
|
|
28
|
+
return await tasks_1.taskService.createTask({
|
|
33
29
|
title: options.title,
|
|
34
30
|
content: options.content,
|
|
35
31
|
parentId: options.parentId,
|
|
@@ -44,12 +40,9 @@ exports.createCommand = new commander_1.Command("create")
|
|
|
44
40
|
},
|
|
45
41
|
streamingOptions,
|
|
46
42
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
finally {
|
|
51
|
-
hooks_1.hooks.off("task:progress", progressHandler);
|
|
52
|
-
}
|
|
43
|
+
});
|
|
44
|
+
(0, common_1.displayEnhancementResult)(options.aiEnhance && options.stream);
|
|
45
|
+
(0, task_1.displayCreatedTask)(result.task, result.aiMetadata);
|
|
53
46
|
}
|
|
54
47
|
catch (error) {
|
|
55
48
|
(0, progress_1.displayError)(error);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../src/commands/tasks/document/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,uBAAuB,SAyC/B,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.addDocumentationCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const tasks_1 = require("../../../services/tasks");
|
|
10
|
+
const command_error_handler_1 = require("../../../utils/command-error-handler");
|
|
11
|
+
exports.addDocumentationCommand = new commander_1.Command("add-documentation")
|
|
12
|
+
.description("Add documentation to a task from a file")
|
|
13
|
+
.requiredOption("-i, --id <id>", "Task ID")
|
|
14
|
+
.requiredOption("-f, --doc-file <path>", "Path to documentation file")
|
|
15
|
+
.option("-o, --overwrite", "Overwrite existing documentation")
|
|
16
|
+
.action((0, command_error_handler_1.wrapCommandHandler)("Add documentation", async (options) => {
|
|
17
|
+
const task = await tasks_1.taskService.getTask(options.id);
|
|
18
|
+
if (!task) {
|
|
19
|
+
throw new Error(`Task with ID ${options.id} not found`);
|
|
20
|
+
}
|
|
21
|
+
// Check if documentation already exists
|
|
22
|
+
const existingDoc = await tasks_1.taskService.getTaskDocumentation(options.id);
|
|
23
|
+
if (existingDoc && !options.overwrite) {
|
|
24
|
+
console.log(chalk_1.default.yellow(`ā ļø Documentation already exists for task ${options.id}`));
|
|
25
|
+
console.log(chalk_1.default.gray(` Use --overwrite to replace existing documentation`));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const result = await tasks_1.taskService.addTaskDocumentationFromFile(options.id, options.docFile);
|
|
29
|
+
console.log(chalk_1.default.green(`ā Documentation added to task: ${task.title} (${options.id})`));
|
|
30
|
+
console.log(chalk_1.default.gray(` Source file: ${options.docFile}`));
|
|
31
|
+
console.log(chalk_1.default.gray(` Saved to: ${result.filePath}`));
|
|
32
|
+
if (options.overwrite) {
|
|
33
|
+
console.log(chalk_1.default.cyan(` Previous documentation was overwritten`));
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../../../src/commands/tasks/document/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,eAAO,MAAM,eAAe,SA+DvB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
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.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 streaming_options_1 = require("../../../utils/streaming-options");
|
|
11
|
+
const common_1 = require("../../../cli/display/common");
|
|
12
|
+
const progress_tracking_1 = require("../../../utils/progress-tracking");
|
|
13
|
+
const command_error_handler_1 = require("../../../utils/command-error-handler");
|
|
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((0, command_error_handler_1.wrapCommandHandler)("Task documentation", async (options) => {
|
|
25
|
+
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.stream, "Analysis");
|
|
26
|
+
const result = await (0, progress_tracking_1.withProgressTracking)(async () => {
|
|
27
|
+
return await tasks_1.taskService.documentTask(options.taskId, options.force, {
|
|
28
|
+
aiProvider: options.aiProvider,
|
|
29
|
+
aiModel: options.aiModel,
|
|
30
|
+
aiKey: options.aiKey,
|
|
31
|
+
aiProviderUrl: options.aiProviderUrl,
|
|
32
|
+
aiReasoning: options.reasoning,
|
|
33
|
+
}, streamingOptions);
|
|
34
|
+
});
|
|
35
|
+
if (result.documentation && !options.force) {
|
|
36
|
+
const daysSinceFetch = (Date.now() - result.documentation.lastFetched) /
|
|
37
|
+
(24 * 60 * 60 * 1000);
|
|
38
|
+
console.log(chalk_1.default.green(`ā Documentation is fresh (${Math.round(daysSinceFetch)} days old)`));
|
|
39
|
+
console.log(chalk_1.default.cyan(`Recap: ${result.documentation.recap}`));
|
|
40
|
+
console.log(chalk_1.default.blue(`Libraries: ${result.documentation.libraries.join(", ")}`));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (result.analysis) {
|
|
44
|
+
(0, common_1.displayDocumentationAnalysis)(result.analysis);
|
|
45
|
+
}
|
|
46
|
+
if (result.documentation?.research) {
|
|
47
|
+
(0, common_1.displayResearchSummary)(result.documentation);
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/commands/tasks/document/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,uBAAuB,SA2B/B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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.getDocumentationCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const tasks_1 = require("../../../services/tasks");
|
|
10
|
+
const command_error_handler_1 = require("../../../utils/command-error-handler");
|
|
11
|
+
exports.getDocumentationCommand = new commander_1.Command("get-documentation")
|
|
12
|
+
.description("Get existing documentation for a task")
|
|
13
|
+
.requiredOption("--id <id>", "Task ID")
|
|
14
|
+
.action((0, command_error_handler_1.wrapCommandHandler)("Get documentation", async (options) => {
|
|
15
|
+
const task = await tasks_1.taskService.getTask(options.id);
|
|
16
|
+
if (!task) {
|
|
17
|
+
throw new Error(`Task with ID ${options.id} not found`);
|
|
18
|
+
}
|
|
19
|
+
const documentation = await tasks_1.taskService.getTaskDocumentation(options.id);
|
|
20
|
+
if (!documentation) {
|
|
21
|
+
console.log(chalk_1.default.yellow(`ā ļø No documentation found for task ${options.id}`));
|
|
22
|
+
console.log(chalk_1.default.gray(` Task: ${task.title}`));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
console.log(chalk_1.default.blue(`\nš Documentation for Task: ${task.title} (${options.id})`));
|
|
26
|
+
console.log(chalk_1.default.gray(` File: .task-o-matic/docs/tasks/${options.id}.md`));
|
|
27
|
+
console.log("");
|
|
28
|
+
console.log(documentation);
|
|
29
|
+
}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document command submodules
|
|
3
|
+
* Each command is in its own file for better organization
|
|
4
|
+
*/
|
|
5
|
+
export { documentCommand } from "./analyze";
|
|
6
|
+
export { getDocumentationCommand } from "./get";
|
|
7
|
+
export { addDocumentationCommand } from "./add";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tasks/document/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Document command submodules
|
|
4
|
+
* Each command is in its own file for better organization
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.addDocumentationCommand = exports.getDocumentationCommand = exports.documentCommand = void 0;
|
|
8
|
+
var analyze_1 = require("./analyze");
|
|
9
|
+
Object.defineProperty(exports, "documentCommand", { enumerable: true, get: function () { return analyze_1.documentCommand; } });
|
|
10
|
+
var get_1 = require("./get");
|
|
11
|
+
Object.defineProperty(exports, "getDocumentationCommand", { enumerable: true, get: function () { return get_1.getDocumentationCommand; } });
|
|
12
|
+
var add_1 = require("./add");
|
|
13
|
+
Object.defineProperty(exports, "addDocumentationCommand", { enumerable: true, get: function () { return add_1.addDocumentationCommand; } });
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"enhance.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/enhance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,eAAO,MAAM,cAAc,SAqGtB,CAAC"}
|
|
@@ -7,80 +7,83 @@ exports.enhanceCommand = void 0;
|
|
|
7
7
|
const commander_1 = require("commander");
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const tasks_1 = require("../../services/tasks");
|
|
10
|
-
const hooks_1 = require("../../lib/hooks");
|
|
11
10
|
const streaming_options_1 = require("../../utils/streaming-options");
|
|
12
|
-
const
|
|
11
|
+
const progress_tracking_1 = require("../../utils/progress-tracking");
|
|
12
|
+
const cli_validators_1 = require("../../utils/cli-validators");
|
|
13
|
+
const bulk_operations_1 = require("../../utils/bulk-operations");
|
|
14
|
+
const confirmation_1 = require("../../utils/confirmation");
|
|
15
|
+
const command_error_handler_1 = require("../../utils/command-error-handler");
|
|
13
16
|
exports.enhanceCommand = new commander_1.Command("enhance")
|
|
14
17
|
.description("Enhance an existing task with AI using Context7 documentation")
|
|
15
18
|
.option("--task-id <id>", "Task ID to enhance")
|
|
16
19
|
.option("--all", "Enhance all existing tasks")
|
|
20
|
+
.option("--status <status>", "Filter tasks by status (todo/in-progress/completed)")
|
|
21
|
+
.option("--tag <tag>", "Filter tasks by tag")
|
|
22
|
+
.option("--dry", "Preview what would be enhanced without making changes")
|
|
23
|
+
.option("--force", "Skip confirmation prompt for bulk operations")
|
|
17
24
|
.option("--stream", "Show streaming AI output during enhancement")
|
|
18
25
|
.option("--ai-provider <provider>", "AI provider override")
|
|
19
26
|
.option("--ai-model <model>", "AI model override")
|
|
20
27
|
.option("--ai-key <key>", "AI API key override")
|
|
21
28
|
.option("--ai-provider-url <url>", "AI provider URL override")
|
|
22
29
|
.option("--reasoning <tokens>", "Enable reasoning for OpenRouter models (max reasoning tokens)")
|
|
23
|
-
.action(async (options) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
.action((0, command_error_handler_1.wrapCommandHandler)("Task enhancement", async (options) => {
|
|
31
|
+
// Validate mutual exclusivity (only if no filters provided)
|
|
32
|
+
if (!options.status && !options.tag) {
|
|
33
|
+
(0, cli_validators_1.validateMutuallyExclusive)(options, "taskId", "all", "task-id", "all");
|
|
34
|
+
}
|
|
35
|
+
const enhanceSingleTask = async (taskId) => {
|
|
36
|
+
if (options.dry) {
|
|
37
|
+
const task = await tasks_1.taskService.getTask(taskId);
|
|
38
|
+
console.log(chalk_1.default.blue(`[DRY RUN] Would enhance: ${task?.title || taskId}`));
|
|
39
|
+
return;
|
|
30
40
|
}
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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);
|
|
41
|
+
const streamingOptions = (0, streaming_options_1.createStreamingOptions)(options.stream, "Enhancement");
|
|
42
|
+
const result = await (0, progress_tracking_1.withProgressTracking)(async () => {
|
|
43
|
+
return await tasks_1.taskService.enhanceTask(taskId, {
|
|
44
|
+
aiProvider: options.aiProvider,
|
|
45
|
+
aiModel: options.aiModel,
|
|
46
|
+
aiKey: options.aiKey,
|
|
47
|
+
aiProviderUrl: options.aiProviderUrl,
|
|
48
|
+
aiReasoning: options.reasoning,
|
|
49
|
+
}, streamingOptions);
|
|
50
|
+
});
|
|
51
|
+
if (result.enhancedContent.length > 200) {
|
|
52
|
+
console.log(chalk_1.default.cyan(` Enhanced content saved to file.`));
|
|
60
53
|
}
|
|
61
|
-
else
|
|
62
|
-
|
|
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.`));
|
|
54
|
+
else {
|
|
55
|
+
console.log(chalk_1.default.cyan(` Enhanced content updated in task description.`));
|
|
80
56
|
}
|
|
57
|
+
console.log(chalk_1.default.green("ā Task enhanced with Context7 documentation"));
|
|
58
|
+
console.log(chalk_1.default.magenta(` š¤ Enhanced using Context7 MCP tools`));
|
|
59
|
+
};
|
|
60
|
+
if (options.taskId) {
|
|
61
|
+
await enhanceSingleTask(options.taskId);
|
|
81
62
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
63
|
+
else {
|
|
64
|
+
// Build filters for bulk operation
|
|
65
|
+
const filters = {};
|
|
66
|
+
if (options.status)
|
|
67
|
+
filters.status = options.status;
|
|
68
|
+
if (options.tag)
|
|
69
|
+
filters.tag = options.tag;
|
|
70
|
+
// Get task count for confirmation
|
|
71
|
+
const tasks = await tasks_1.taskService.listTasks(filters);
|
|
72
|
+
if (tasks.length === 0) {
|
|
73
|
+
console.log(chalk_1.default.yellow("No tasks found matching the filters"));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
// Confirm bulk operation
|
|
77
|
+
const confirmed = await (0, confirmation_1.confirmBulkOperation)("enhance", tasks.length, options.force);
|
|
78
|
+
if (!confirmed) {
|
|
79
|
+
console.log(chalk_1.default.yellow("Operation cancelled"));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
await (0, bulk_operations_1.executeBulkOperation)((taskId) => enhanceSingleTask(taskId), {
|
|
83
|
+
operationName: "Enhancing",
|
|
84
|
+
operationEmoji: "š¤",
|
|
85
|
+
successMessage: (taskId) => `ā Enhanced task ${taskId}`,
|
|
86
|
+
filters,
|
|
87
|
+
});
|
|
85
88
|
}
|
|
86
|
-
});
|
|
89
|
+
}));
|
|
@@ -1 +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;
|
|
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;AAYpC,eAAO,MAAM,kBAAkB,SAkK1B,CAAC"}
|