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/docs/agents/cli.md
CHANGED
|
@@ -1,191 +1,100 @@
|
|
|
1
|
-
# Task-O-Matic
|
|
1
|
+
# Task-O-Matic Agent Guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Concise reference for AI agents using Task-O-Matic in autonomous workflows.
|
|
4
4
|
|
|
5
|
-
## Core Commands
|
|
5
|
+
## Core Workflow Commands
|
|
6
6
|
|
|
7
7
|
### Task Management
|
|
8
|
-
```bash
|
|
9
|
-
# Get next task to work on (prioritizes subtasks over parent tasks)
|
|
10
|
-
task-o-matic tasks get-next [--status todo] [--tag <tag>] [--effort <small|medium|large>]
|
|
11
|
-
|
|
12
|
-
# Show detailed task information
|
|
13
|
-
task-o-matic tasks show --id <task-id>
|
|
14
|
-
|
|
15
|
-
# Update task status
|
|
16
|
-
task-o-matic tasks status --id <task-id> --status <todo|in-progress|completed>
|
|
17
|
-
|
|
18
|
-
# List all tasks with optional filtering
|
|
19
|
-
task-o-matic tasks list [--status <status>] [--tag <tag>]
|
|
20
|
-
|
|
21
|
-
# Create new tasks
|
|
22
|
-
task-o-matic tasks create --title "Task Title" [--content "Description"] [--effort <small|medium|large>] [--parent-id <id>] [--ai-enhance] [--stream]
|
|
23
|
-
|
|
24
|
-
# Split tasks into subtasks using AI
|
|
25
|
-
task-o-matic tasks split --task-id <id> [--tools] [--stream] [--ai-provider <provider>]
|
|
26
|
-
|
|
27
|
-
# Update task details
|
|
28
|
-
task-o-matic tasks update --id <task-id> [--title "New Title"] [--description "New Description"] [--status <status>] [--effort <effort>]
|
|
29
|
-
|
|
30
|
-
# Delete tasks
|
|
31
|
-
task-o-matic tasks delete --id <task-id> --force [--cascade]
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Planning & Documentation
|
|
35
|
-
```bash
|
|
36
|
-
# Generate AI implementation plans for tasks
|
|
37
|
-
task-o-matic tasks plan --id <task-id> [--stream] [--ai-provider <provider>]
|
|
38
|
-
|
|
39
|
-
# View existing implementation plans
|
|
40
|
-
task-o-matic tasks get-plan --id <task-id>
|
|
41
|
-
|
|
42
|
-
# Set manual implementation plan
|
|
43
|
-
task-o-matic tasks set-plan --id <task-id> --plan "Plan text" [or --plan-file <path>]
|
|
44
|
-
|
|
45
|
-
# Generate AI task documentation with project context
|
|
46
|
-
task-o-matic tasks document --task-id <task-id> [--force] [--stream] [--ai-provider <provider>]
|
|
47
|
-
|
|
48
|
-
# Get existing task documentation
|
|
49
|
-
task-o-matic tasks get-documentation --id <task-id>
|
|
50
8
|
|
|
51
|
-
# Add documentation from external file
|
|
52
|
-
task-o-matic tasks add-documentation --id <task-id> --doc-file <path> [--overwrite]
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### PRD Management
|
|
56
9
|
```bash
|
|
57
|
-
#
|
|
58
|
-
task-o-matic
|
|
10
|
+
# List tasks (filter by status or tag)
|
|
11
|
+
task-o-matic tasks list [-s <status>] [-t <tag>]
|
|
59
12
|
|
|
60
|
-
#
|
|
61
|
-
task-o-matic
|
|
62
|
-
```
|
|
13
|
+
# Get next task to work on (prioritizes subtasks)
|
|
14
|
+
task-o-matic tasks get-next [-s <status>] [-t <tag>]
|
|
63
15
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
# Initialize task-o-matic in current directory
|
|
67
|
-
task-o-matic init init
|
|
16
|
+
# Update task status
|
|
17
|
+
task-o-matic tasks status -i <task-id> -s <todo|in-progress|completed>
|
|
68
18
|
|
|
69
|
-
#
|
|
70
|
-
task-o-matic
|
|
19
|
+
# Add documentation from file
|
|
20
|
+
task-o-matic tasks add-documentation -i <task-id> --doc-file <path>
|
|
71
21
|
```
|
|
72
22
|
|
|
73
|
-
##
|
|
23
|
+
## Typical Agent Workflow
|
|
74
24
|
|
|
75
|
-
### Primary Work Loop
|
|
76
25
|
```bash
|
|
77
|
-
# 1. Get next
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
# 2. Show task details and mark as in-progress
|
|
81
|
-
task-o-matic tasks show --id $TASK_ID
|
|
82
|
-
task-o-matic tasks status --id $TASK_ID --status in-progress
|
|
83
|
-
|
|
84
|
-
# 3. Generate implementation plan with project context
|
|
85
|
-
task-o-matic tasks plan --id $TASK_ID --stream
|
|
86
|
-
|
|
87
|
-
# 4. Check for existing documentation or create it
|
|
88
|
-
task-o-matic tasks get-documentation --id $TASK_ID || \
|
|
89
|
-
task-o-matic tasks document --task-id $TASK_ID --stream
|
|
26
|
+
# 1. Get next task
|
|
27
|
+
TASK=$(task-o-matic tasks get-next -s todo)
|
|
90
28
|
|
|
91
|
-
#
|
|
92
|
-
|
|
93
|
-
# - Implement code changes
|
|
94
|
-
# - Add tests if needed
|
|
29
|
+
# 2. Mark as in-progress
|
|
30
|
+
task-o-matic tasks status -i $TASK_ID -s in-progress
|
|
95
31
|
|
|
96
|
-
#
|
|
97
|
-
|
|
98
|
-
npm run build # Fix any build errors
|
|
99
|
-
npm test # Fix any test failures
|
|
32
|
+
# 3. Implement the task
|
|
33
|
+
# (use your development tools)
|
|
100
34
|
|
|
101
|
-
#
|
|
102
|
-
|
|
103
|
-
git commit -m "$(task-o-matic tasks show --id $TASK_ID | grep Title | cut -d: -f2-) - completed"
|
|
35
|
+
# 4. Validate
|
|
36
|
+
npm run check-types && npm run build && npm test
|
|
104
37
|
|
|
105
|
-
#
|
|
106
|
-
task-o-matic tasks status
|
|
38
|
+
# 5. Mark as completed
|
|
39
|
+
task-o-matic tasks status -i $TASK_ID -s completed
|
|
107
40
|
|
|
108
|
-
#
|
|
109
|
-
task-o-matic tasks get-next
|
|
41
|
+
# 6. Repeat
|
|
110
42
|
```
|
|
111
43
|
|
|
112
|
-
##
|
|
44
|
+
## Bootstrap Options
|
|
113
45
|
|
|
114
|
-
###
|
|
115
|
-
Use `--tools` flag to enable filesystem tools for AI operations:
|
|
46
|
+
### Web Projects
|
|
116
47
|
```bash
|
|
117
|
-
|
|
118
|
-
task-o-matic prd parse --file prd.md --tools --stream
|
|
119
|
-
|
|
120
|
-
# Split tasks with understanding of current codebase
|
|
121
|
-
task-o-matic tasks split --task-id <id> --tools --stream
|
|
122
|
-
|
|
123
|
-
# Rework PRD considering current implementation
|
|
124
|
-
task-o-matic prd rework --file prd.md --feedback "Add auth" --tools --stream
|
|
48
|
+
task-o-matic init init --project-name my-app --frontend next --backend hono
|
|
125
49
|
```
|
|
126
50
|
|
|
127
|
-
###
|
|
51
|
+
### Multi-Frontend Monorepo
|
|
128
52
|
```bash
|
|
129
|
-
#
|
|
130
|
-
task-o-matic --
|
|
53
|
+
# Web + Native + CLI + TUI
|
|
54
|
+
task-o-matic init init --project-name my-app --frontend "next native-uniwind cli tui" --backend hono
|
|
131
55
|
|
|
132
|
-
#
|
|
133
|
-
task-o-matic
|
|
134
|
-
task-o-matic prd --help
|
|
135
|
-
task-o-matic config --help
|
|
56
|
+
# Web + Native
|
|
57
|
+
task-o-matic init init --project-name my-app --frontend "next native-bare" --backend hono
|
|
136
58
|
|
|
137
|
-
#
|
|
138
|
-
task-o-matic
|
|
139
|
-
task-o-matic tasks split --help
|
|
59
|
+
# Web + CLI
|
|
60
|
+
task-o-matic init init --project-name my-app --frontend "next cli" --backend hono
|
|
140
61
|
```
|
|
141
62
|
|
|
142
|
-
###
|
|
63
|
+
### Single Frontend Projects
|
|
143
64
|
```bash
|
|
144
|
-
#
|
|
145
|
-
task-o-matic
|
|
146
|
-
task-o-matic config set --provider anthropic --model claude-3-sonnet-20240229 --api-key <your-key>
|
|
147
|
-
task-o-matic config set --provider openrouter --model anthropic/claude-3.5-sonnet --api-key <your-key>
|
|
65
|
+
# CLI only
|
|
66
|
+
task-o-matic init init --project-name my-cli --frontend cli --cli-deps full
|
|
148
67
|
|
|
149
|
-
#
|
|
150
|
-
task-o-matic
|
|
151
|
-
```
|
|
68
|
+
# TUI only
|
|
69
|
+
task-o-matic init init --project-name my-tui --frontend tui --tui-framework solid
|
|
152
70
|
|
|
153
|
-
|
|
71
|
+
# Native only
|
|
72
|
+
task-o-matic init init --project-name my-mobile --frontend native-uniwind --backend hono
|
|
73
|
+
```
|
|
154
74
|
|
|
155
|
-
###
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
75
|
+
### Frontend Options
|
|
76
|
+
- **Web**: next, tanstack-router, react-router, nuxt, svelte, solid
|
|
77
|
+
- **Native**: native-bare, native-uniwind, native-unistyles
|
|
78
|
+
- **Custom**: cli, tui
|
|
159
79
|
|
|
160
|
-
###
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
80
|
+
### CLI Dependency Levels
|
|
81
|
+
- **minimal**: commander + chalk only
|
|
82
|
+
- **standard**: + inquirer + dotenv (default)
|
|
83
|
+
- **full**: + mocha + tsx (testing)
|
|
84
|
+
- **task-o-matic**: + AI SDK (Vercel AI)
|
|
164
85
|
|
|
165
|
-
###
|
|
166
|
-
- **
|
|
167
|
-
- **
|
|
168
|
-
- **
|
|
169
|
-
- **Task confusion**: Use `task-o-matic tasks show --id <id>` for clarification
|
|
86
|
+
### TUI Framework Options
|
|
87
|
+
- **solid**: Solid.js (default, recommended)
|
|
88
|
+
- **vue**: Vue.js
|
|
89
|
+
- **react**: React
|
|
170
90
|
|
|
171
|
-
|
|
172
|
-
- **Never stop the loop**: Immediately get next task after completing current one
|
|
173
|
-
- **Maintain clean git history**: One commit per completed task
|
|
174
|
-
- **Use descriptive commit messages**: Include task title and completion status
|
|
175
|
-
- **Leverage AI enhancements**: Use `--ai-enhance`, `--tools`, and `--stream` flags appropriately
|
|
91
|
+
## Getting Help
|
|
176
92
|
|
|
177
|
-
|
|
178
|
-
When you need to discover available commands or options:
|
|
93
|
+
All commands support `--help`:
|
|
179
94
|
```bash
|
|
180
|
-
# Explore available commands
|
|
181
95
|
task-o-matic --help
|
|
182
|
-
|
|
183
|
-
# Explore command groups
|
|
184
96
|
task-o-matic tasks --help
|
|
185
|
-
task-o-matic
|
|
186
|
-
|
|
187
|
-
# Get detailed help for specific commands
|
|
188
|
-
task-o-matic tasks [command] --help
|
|
97
|
+
task-o-matic tasks list --help
|
|
189
98
|
```
|
|
190
99
|
|
|
191
|
-
|
|
100
|
+
Full command reference: `docs/task-o-matic_help.md`
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,eAAO,MAAM,eAAe,SA2ExB,CAAC;AAEL,eAAO,MAAM,uBAAuB,SAgChC,CAAC;AAEL,eAAO,MAAM,uBAAuB,SA8ChC,CAAC"}
|
|
@@ -1,118 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,131 +0,0 @@
|
|
|
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
|
-
});
|