task-o-matic 0.0.13 → 0.0.15
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/cli/display/progress.d.ts +15 -2
- package/dist/cli/display/progress.d.ts.map +1 -1
- package/dist/cli/display/progress.js +72 -4
- package/dist/commands/benchmark.d.ts.map +1 -1
- package/dist/commands/benchmark.js +11 -3
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +60 -12
- package/dist/commands/prd.js +7 -1
- package/dist/commands/tasks/delete.d.ts.map +1 -1
- package/dist/commands/tasks/delete.js +2 -1
- package/dist/commands/tasks/document/add.d.ts.map +1 -1
- package/dist/commands/tasks/document/add.js +5 -4
- package/dist/commands/tasks/document/get.d.ts.map +1 -1
- package/dist/commands/tasks/document/get.js +2 -1
- package/dist/commands/tasks/list.js +2 -2
- package/dist/commands/tasks/next.js +4 -4
- package/dist/commands/tasks/plan/set.d.ts.map +1 -1
- package/dist/commands/tasks/plan/set.js +11 -3
- package/dist/commands/tasks/show.d.ts.map +1 -1
- package/dist/commands/tasks/show.js +2 -1
- package/dist/commands/tasks/status.d.ts.map +1 -1
- package/dist/commands/tasks/status.js +4 -3
- package/dist/commands/tasks/update.d.ts.map +1 -1
- package/dist/commands/tasks/update.js +7 -1
- 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/model-provider.d.ts.map +1 -1
- package/dist/lib/ai-service/model-provider.js +37 -6
- package/dist/lib/ai-service/task-operations.d.ts +2 -1
- package/dist/lib/ai-service/task-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/task-operations.js +135 -173
- package/dist/lib/benchmark/registry.d.ts.map +1 -1
- package/dist/lib/benchmark/registry.js +6 -10
- 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-validation.d.ts +215 -0
- package/dist/lib/config-validation.d.ts.map +1 -0
- package/dist/lib/config-validation.js +246 -0
- package/dist/lib/config.d.ts +14 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +37 -5
- package/dist/lib/storage/file-system.d.ts.map +1 -1
- package/dist/lib/storage/file-system.js +81 -21
- package/dist/lib/task-execution-core.d.ts.map +1 -1
- package/dist/lib/task-execution-core.js +3 -2
- package/dist/services/prd.d.ts +17 -0
- package/dist/services/prd.d.ts.map +1 -1
- package/dist/services/prd.js +67 -60
- package/dist/services/tasks.d.ts +317 -3
- package/dist/services/tasks.d.ts.map +1 -1
- package/dist/services/tasks.js +531 -185
- package/dist/services/workflow-ai-assistant.d.ts.map +1 -1
- package/dist/services/workflow-ai-assistant.js +19 -6
- package/dist/test/lib/ai-service/task-operations.test.d.ts +2 -0
- package/dist/test/lib/ai-service/task-operations.test.d.ts.map +1 -0
- package/dist/test/lib/ai-service/task-operations.test.js +362 -0
- package/dist/test/mocks/mock-ai-operations.d.ts +15 -0
- package/dist/test/mocks/mock-ai-operations.d.ts.map +1 -0
- package/dist/test/mocks/mock-ai-operations.js +107 -0
- package/dist/test/mocks/mock-context-builder.d.ts +10 -0
- package/dist/test/mocks/mock-context-builder.d.ts.map +1 -0
- package/dist/test/mocks/mock-context-builder.js +81 -0
- package/dist/test/mocks/mock-model-provider.d.ts +7 -0
- package/dist/test/mocks/mock-model-provider.d.ts.map +1 -0
- package/dist/test/mocks/mock-model-provider.js +21 -0
- package/dist/test/mocks/mock-service-factory.d.ts +11 -0
- package/dist/test/mocks/mock-service-factory.d.ts.map +1 -0
- package/dist/test/mocks/mock-service-factory.js +61 -0
- package/dist/test/mocks/mock-storage.d.ts +50 -0
- package/dist/test/mocks/mock-storage.d.ts.map +1 -0
- package/dist/test/mocks/mock-storage.js +145 -0
- package/dist/test/services/task-service.test.d.ts +2 -0
- package/dist/test/services/task-service.test.d.ts.map +1 -0
- package/dist/test/services/task-service.test.js +352 -0
- package/dist/test/test-mock-setup.d.ts +26 -0
- package/dist/test/test-mock-setup.d.ts.map +1 -0
- package/dist/test/test-mock-setup.js +41 -0
- package/dist/test/test-setup.d.ts +9 -0
- package/dist/test/test-setup.d.ts.map +1 -0
- package/dist/test/test-setup.js +44 -0
- package/dist/test/test-utils.d.ts +22 -0
- package/dist/test/test-utils.d.ts.map +1 -0
- package/dist/test/test-utils.js +37 -0
- package/dist/test/utils/ai-operation-utility.test.d.ts +2 -0
- package/dist/test/utils/ai-operation-utility.test.d.ts.map +1 -0
- package/dist/test/utils/ai-operation-utility.test.js +290 -0
- package/dist/test/utils/error-handling.test.d.ts +2 -0
- package/dist/test/utils/error-handling.test.d.ts.map +1 -0
- package/dist/test/utils/error-handling.test.js +231 -0
- package/dist/types/index.d.ts +36 -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/ai-operation-utility.d.ts +142 -0
- package/dist/utils/ai-operation-utility.d.ts.map +1 -0
- package/dist/utils/ai-operation-utility.js +288 -0
- package/dist/utils/ai-service-factory.d.ts +10 -0
- package/dist/utils/ai-service-factory.d.ts.map +1 -1
- package/dist/utils/ai-service-factory.js +19 -1
- package/dist/utils/cli-validators.d.ts +2 -2
- package/dist/utils/cli-validators.d.ts.map +1 -1
- package/dist/utils/cli-validators.js +7 -6
- 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 +104 -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 +82 -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 +146 -0
- package/dist/utils/model-executor-parser.d.ts +1 -1
- package/dist/utils/model-executor-parser.d.ts.map +1 -1
- package/dist/utils/model-executor-parser.js +3 -2
- 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 +80 -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/dist/utils/task-o-matic-error.d.ts +206 -0
- package/dist/utils/task-o-matic-error.d.ts.map +1 -0
- package/dist/utils/task-o-matic-error.js +304 -0
- package/docs/agents/cli.md +58 -149
- package/package.json +2 -2
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskOMaticErrorCodes = exports.TaskOMaticError = void 0;
|
|
4
|
+
exports.createStandardError = createStandardError;
|
|
5
|
+
exports.formatStandardError = formatStandardError;
|
|
6
|
+
exports.isTaskOMaticError = isTaskOMaticError;
|
|
7
|
+
exports.formatTaskNotFoundError = formatTaskNotFoundError;
|
|
8
|
+
exports.formatInvalidStatusTransitionError = formatInvalidStatusTransitionError;
|
|
9
|
+
exports.formatStorageError = formatStorageError;
|
|
10
|
+
exports.formatAIOperationError = formatAIOperationError;
|
|
11
|
+
exports.wrapErrorForBackwardCompatibility = wrapErrorForBackwardCompatibility;
|
|
12
|
+
const error_utils_1 = require("./error-utils");
|
|
13
|
+
/**
|
|
14
|
+
* TaskOMaticError - Standardized error class for TaskOMatic
|
|
15
|
+
*
|
|
16
|
+
* Provides consistent error handling with context, suggestions, and typing.
|
|
17
|
+
* All errors in the system should use this class or one of the helper functions
|
|
18
|
+
* to ensure consistent error reporting and debugging experience.
|
|
19
|
+
*
|
|
20
|
+
* @example Basic usage
|
|
21
|
+
* ```typescript
|
|
22
|
+
* throw new TaskOMaticError("Task not found", {
|
|
23
|
+
* code: "TASK_NOT_FOUND",
|
|
24
|
+
* context: "Attempted to retrieve task ID: 123",
|
|
25
|
+
* suggestions: [
|
|
26
|
+
* "Verify the task ID is correct",
|
|
27
|
+
* "Check if the task was deleted"
|
|
28
|
+
* ]
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example With cause chain
|
|
33
|
+
* ```typescript
|
|
34
|
+
* try {
|
|
35
|
+
* await storage.getTask(id);
|
|
36
|
+
* } catch (error) {
|
|
37
|
+
* throw new TaskOMaticError("Failed to retrieve task", {
|
|
38
|
+
* code: "STORAGE_ERROR",
|
|
39
|
+
* cause: error instanceof Error ? error : new Error(String(error)),
|
|
40
|
+
* context: `Task ID: ${id}`,
|
|
41
|
+
* suggestions: ["Check storage permissions", "Verify storage is initialized"]
|
|
42
|
+
* });
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example With metadata
|
|
47
|
+
* ```typescript
|
|
48
|
+
* throw new TaskOMaticError("AI operation timed out", {
|
|
49
|
+
* code: "AI_OPERATION_FAILED",
|
|
50
|
+
* metadata: {
|
|
51
|
+
* operation: "task-breakdown",
|
|
52
|
+
* duration: 30000,
|
|
53
|
+
* retryAttempts: 3
|
|
54
|
+
* },
|
|
55
|
+
* suggestions: ["Increase timeout", "Check AI service status"]
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
class TaskOMaticError extends Error {
|
|
60
|
+
/**
|
|
61
|
+
* Error code for categorization
|
|
62
|
+
*/
|
|
63
|
+
code;
|
|
64
|
+
/**
|
|
65
|
+
* Additional context information
|
|
66
|
+
*/
|
|
67
|
+
context;
|
|
68
|
+
/**
|
|
69
|
+
* Actionable suggestions for resolving the error
|
|
70
|
+
*/
|
|
71
|
+
suggestions;
|
|
72
|
+
/**
|
|
73
|
+
* Original error that caused this error (if applicable)
|
|
74
|
+
*/
|
|
75
|
+
cause;
|
|
76
|
+
/**
|
|
77
|
+
* Timestamp when the error occurred
|
|
78
|
+
*/
|
|
79
|
+
timestamp;
|
|
80
|
+
/**
|
|
81
|
+
* Additional metadata for debugging
|
|
82
|
+
*/
|
|
83
|
+
metadata;
|
|
84
|
+
/**
|
|
85
|
+
* Create a new TaskOMaticError
|
|
86
|
+
*
|
|
87
|
+
* @param message - Error message
|
|
88
|
+
* @param options - Additional error options
|
|
89
|
+
*/
|
|
90
|
+
constructor(message, options) {
|
|
91
|
+
super(message);
|
|
92
|
+
this.name = "TaskOMaticError";
|
|
93
|
+
this.code = options.code;
|
|
94
|
+
this.context = options.context;
|
|
95
|
+
this.suggestions = options.suggestions;
|
|
96
|
+
this.cause = options.cause;
|
|
97
|
+
this.timestamp = Date.now();
|
|
98
|
+
this.metadata = options.metadata;
|
|
99
|
+
// Maintain proper stack trace
|
|
100
|
+
if (Error.captureStackTrace) {
|
|
101
|
+
Error.captureStackTrace(this, TaskOMaticError);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Get full error details as a formatted string
|
|
106
|
+
*/
|
|
107
|
+
getDetails() {
|
|
108
|
+
let details = `[${this.code}] ${this.message}`;
|
|
109
|
+
if (this.context) {
|
|
110
|
+
details += `\nContext: ${this.context}`;
|
|
111
|
+
}
|
|
112
|
+
if (this.suggestions && this.suggestions.length > 0) {
|
|
113
|
+
details += `\nSuggestions:\n- ${this.suggestions.join("\n- ")}`;
|
|
114
|
+
}
|
|
115
|
+
if (this.cause) {
|
|
116
|
+
details += `\nCaused by: ${this.cause.message}`;
|
|
117
|
+
}
|
|
118
|
+
if (this.metadata && Object.keys(this.metadata).length > 0) {
|
|
119
|
+
details += `\nMetadata: ${JSON.stringify(this.metadata, null, 2)}`;
|
|
120
|
+
}
|
|
121
|
+
return details;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Get error details as a structured object
|
|
125
|
+
*/
|
|
126
|
+
toJSON() {
|
|
127
|
+
return {
|
|
128
|
+
name: this.name,
|
|
129
|
+
code: this.code,
|
|
130
|
+
message: this.message,
|
|
131
|
+
context: this.context,
|
|
132
|
+
suggestions: this.suggestions,
|
|
133
|
+
cause: this.cause?.message,
|
|
134
|
+
timestamp: this.timestamp,
|
|
135
|
+
metadata: this.metadata,
|
|
136
|
+
stack: this.stack,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.TaskOMaticError = TaskOMaticError;
|
|
141
|
+
/**
|
|
142
|
+
* Standard error codes for TaskOMatic
|
|
143
|
+
*/
|
|
144
|
+
exports.TaskOMaticErrorCodes = {
|
|
145
|
+
// General errors
|
|
146
|
+
UNEXPECTED_ERROR: "TASK_O_MATIC_001",
|
|
147
|
+
INVALID_INPUT: "TASK_O_MATIC_002",
|
|
148
|
+
CONFIGURATION_ERROR: "TASK_O_MATIC_003",
|
|
149
|
+
// Task-related errors
|
|
150
|
+
TASK_NOT_FOUND: "TASK_O_MATIC_101",
|
|
151
|
+
TASK_ALREADY_EXISTS: "TASK_O_MATIC_102",
|
|
152
|
+
INVALID_TASK_STATUS: "TASK_O_MATIC_103",
|
|
153
|
+
TASK_OPERATION_FAILED: "TASK_O_MATIC_104",
|
|
154
|
+
// Storage errors
|
|
155
|
+
STORAGE_ERROR: "TASK_O_MATIC_201",
|
|
156
|
+
STORAGE_NOT_INITIALIZED: "TASK_O_MATIC_202",
|
|
157
|
+
STORAGE_INTEGRITY_ERROR: "TASK_O_MATIC_203",
|
|
158
|
+
// AI operation errors
|
|
159
|
+
AI_OPERATION_FAILED: "TASK_O_MATIC_301",
|
|
160
|
+
AI_CONFIGURATION_ERROR: "TASK_O_MATIC_302",
|
|
161
|
+
AI_RATE_LIMIT: "TASK_O_MATIC_303",
|
|
162
|
+
// Workflow errors
|
|
163
|
+
WORKFLOW_VALIDATION_ERROR: "TASK_O_MATIC_401",
|
|
164
|
+
WORKFLOW_EXECUTION_ERROR: "TASK_O_MATIC_402",
|
|
165
|
+
// PRD errors
|
|
166
|
+
PRD_PARSING_ERROR: "TASK_O_MATIC_501",
|
|
167
|
+
PRD_GENERATION_ERROR: "TASK_O_MATIC_502",
|
|
168
|
+
PRD_VALIDATION_ERROR: "TASK_O_MATIC_503",
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Create a standardized error with context and suggestions
|
|
172
|
+
*
|
|
173
|
+
* Helper function to create TaskOMaticError instances with proper error codes
|
|
174
|
+
* from the TaskOMaticErrorCodes constants.
|
|
175
|
+
*
|
|
176
|
+
* @param code - Error code from TaskOMaticErrorCodes
|
|
177
|
+
* @param message - Human-readable error message
|
|
178
|
+
* @param options - Additional error options
|
|
179
|
+
* @returns Configured TaskOMaticError instance
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```typescript
|
|
183
|
+
* throw createStandardError(
|
|
184
|
+
* TaskOMaticErrorCodes.TASK_NOT_FOUND,
|
|
185
|
+
* "Task with ID '123' not found",
|
|
186
|
+
* {
|
|
187
|
+
* context: "User attempted to retrieve non-existent task",
|
|
188
|
+
* suggestions: ["Verify task ID", "List all tasks to see available IDs"]
|
|
189
|
+
* }
|
|
190
|
+
* );
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
function createStandardError(code, message, options = {}) {
|
|
194
|
+
return new TaskOMaticError(message, {
|
|
195
|
+
code,
|
|
196
|
+
context: options.context,
|
|
197
|
+
suggestions: options.suggestions,
|
|
198
|
+
cause: options.cause,
|
|
199
|
+
metadata: options.metadata,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Format an existing error into a TaskOMaticError with context and suggestions
|
|
204
|
+
*
|
|
205
|
+
* Useful for wrapping caught errors with additional context while preserving
|
|
206
|
+
* the original error as the cause.
|
|
207
|
+
*
|
|
208
|
+
* @param error - Original error to wrap
|
|
209
|
+
* @param code - Error code from TaskOMaticErrorCodes
|
|
210
|
+
* @param options - Additional error options
|
|
211
|
+
* @returns TaskOMaticError wrapping the original error
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```typescript
|
|
215
|
+
* try {
|
|
216
|
+
* await dangerousOperation();
|
|
217
|
+
* } catch (error) {
|
|
218
|
+
* throw formatStandardError(
|
|
219
|
+
* error,
|
|
220
|
+
* TaskOMaticErrorCodes.STORAGE_ERROR,
|
|
221
|
+
* {
|
|
222
|
+
* context: "Failed during task persistence",
|
|
223
|
+
* suggestions: ["Check disk space", "Verify write permissions"]
|
|
224
|
+
* }
|
|
225
|
+
* );
|
|
226
|
+
* }
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
function formatStandardError(error, code, options = {}) {
|
|
230
|
+
const message = (0, error_utils_1.getErrorMessage)(error);
|
|
231
|
+
const cause = error instanceof Error ? error : undefined;
|
|
232
|
+
return new TaskOMaticError(message, {
|
|
233
|
+
code,
|
|
234
|
+
context: options.context,
|
|
235
|
+
suggestions: options.suggestions,
|
|
236
|
+
cause,
|
|
237
|
+
metadata: options.metadata,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Type guard for TaskOMaticError
|
|
242
|
+
*/
|
|
243
|
+
function isTaskOMaticError(error) {
|
|
244
|
+
return error instanceof TaskOMaticError;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Common error formatting functions
|
|
248
|
+
*/
|
|
249
|
+
function formatTaskNotFoundError(taskId) {
|
|
250
|
+
return createStandardError(exports.TaskOMaticErrorCodes.TASK_NOT_FOUND, `Task with ID "${taskId}" not found`, {
|
|
251
|
+
context: `The task "${taskId}" could not be found in the storage.`,
|
|
252
|
+
suggestions: [
|
|
253
|
+
"Verify the task ID is correct",
|
|
254
|
+
"Check if the task was deleted",
|
|
255
|
+
"List all tasks to see available IDs",
|
|
256
|
+
],
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
function formatInvalidStatusTransitionError(fromStatus, toStatus) {
|
|
260
|
+
return createStandardError(exports.TaskOMaticErrorCodes.INVALID_TASK_STATUS, `Invalid status transition from "${fromStatus}" to "${toStatus}"`, {
|
|
261
|
+
context: `Task status transitions must follow the workflow: todo -> in-progress -> completed.`,
|
|
262
|
+
suggestions: [
|
|
263
|
+
"Use a valid status transition",
|
|
264
|
+
"Check the current task status",
|
|
265
|
+
"Review the workflow documentation",
|
|
266
|
+
],
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
function formatStorageError(operation, cause) {
|
|
270
|
+
return createStandardError(exports.TaskOMaticErrorCodes.STORAGE_ERROR, `Storage operation "${operation}" failed`, {
|
|
271
|
+
context: `The storage operation "${operation}" could not be completed.`,
|
|
272
|
+
suggestions: [
|
|
273
|
+
"Check storage permissions",
|
|
274
|
+
"Verify storage configuration",
|
|
275
|
+
"Review storage logs for details",
|
|
276
|
+
],
|
|
277
|
+
cause,
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
function formatAIOperationError(operation, cause) {
|
|
281
|
+
return createStandardError(exports.TaskOMaticErrorCodes.AI_OPERATION_FAILED, `AI operation "${operation}" failed`, {
|
|
282
|
+
context: `The AI operation "${operation}" could not be completed.`,
|
|
283
|
+
suggestions: [
|
|
284
|
+
"Check AI configuration",
|
|
285
|
+
"Verify API keys and endpoints",
|
|
286
|
+
"Review AI service status",
|
|
287
|
+
"Check rate limits",
|
|
288
|
+
],
|
|
289
|
+
cause,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Backward compatibility wrapper
|
|
294
|
+
* Maintains existing error handling patterns while using new error system
|
|
295
|
+
*/
|
|
296
|
+
function wrapErrorForBackwardCompatibility(error, context) {
|
|
297
|
+
if (isTaskOMaticError(error)) {
|
|
298
|
+
return error;
|
|
299
|
+
}
|
|
300
|
+
if (error instanceof Error) {
|
|
301
|
+
return error;
|
|
302
|
+
}
|
|
303
|
+
return new Error((0, error_utils_1.formatError)(error, context));
|
|
304
|
+
}
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "task-o-matic",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "AI-powered task management CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"task-management",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"dev:mcp": "tsx src/mcp/server.ts",
|
|
51
51
|
"start": "node dist/cli/bin.js",
|
|
52
52
|
"check-types": "tsc --noEmit --skipLibCheck",
|
|
53
|
-
"test": "mocha -r tsx/cjs src/test/**/*.test.ts",
|
|
53
|
+
"test": "mocha -r tsx/cjs src/test/test-setup.ts src/test/**/*.test.ts",
|
|
54
54
|
"prepare": "npm run build && chmod +x dist/cli/bin.js",
|
|
55
55
|
"prepublishOnly": "bun run build && chmod +x dist/cli/bin.js && bun test"
|
|
56
56
|
},
|