@bicorne/task-flow 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +337 -145
- package/SKILL.md +9 -5
- package/assets/.harnessrc +0 -1
- package/dist/commands/analyze.js +160 -318
- package/dist/commands/archive.js +44 -48
- package/dist/commands/design.js +225 -400
- package/dist/commands/extract.js +174 -303
- package/dist/commands/init.js +103 -148
- package/dist/commands/merge/index.js +184 -295
- package/dist/commands/merge/merger.js +112 -134
- package/dist/commands/merge/types.js +3 -5
- package/dist/commands/merge/validators.js +115 -132
- package/dist/commands/merge.js +46 -13
- package/dist/commands/start.js +155 -248
- package/dist/commands/status.js +68 -129
- package/dist/commands/sync.js +37 -53
- package/dist/commands/tasks-gen/doc-parser.js +148 -228
- package/dist/commands/tasks-gen/generators.js +104 -116
- package/dist/commands/tasks-gen/index.js +206 -314
- package/dist/commands/tasks-gen/parsers.js +131 -232
- package/dist/commands/tasks-gen/templates.js +9 -10
- package/dist/commands/tasks-gen/types.js +36 -14
- package/dist/commands/tasks-gen/validators.js +33 -49
- package/dist/commands/tasks.js +58 -20
- package/dist/commands/worktree.js +167 -249
- package/dist/hooks/check-prd-exists.js +45 -55
- package/dist/hooks/check-worktree-conflict.js +68 -101
- package/dist/hooks/hook-runner/executor.js +134 -126
- package/dist/hooks/hook-runner/index.js +181 -196
- package/dist/hooks/hook-runner/loader.js +74 -113
- package/dist/hooks/hook-runner/types.js +3 -5
- package/dist/hooks/hook-runner.js +94 -28
- package/dist/hooks/phase-complete-detector.js +125 -191
- package/dist/hooks/phase-gate-validator.js +315 -376
- package/dist/hooks/save-checkpoint.js +87 -130
- package/dist/hooks/start-mcp-servers.js +50 -65
- package/dist/hooks/stop-mcp-servers.js +40 -49
- package/dist/index.js +84 -153
- package/dist/lib/archive.js +126 -209
- package/dist/lib/config.d.ts +0 -2
- package/dist/lib/config.js +141 -230
- package/dist/lib/constants.js +155 -145
- package/dist/lib/interactive.js +98 -148
- package/dist/lib/mcp-client.js +197 -320
- package/dist/lib/state.js +142 -253
- package/dist/slash/executor.js +309 -233
- package/dist/slash/index.js +69 -43
- package/dist/slash/parser.js +84 -97
- package/dist/slash/registry.js +100 -88
- package/dist/spec/openspec-to-task/builders.js +96 -109
- package/dist/spec/openspec-to-task/index.js +112 -173
- package/dist/spec/openspec-to-task/parsers.js +148 -219
- package/dist/spec/openspec-to-task/types.js +3 -5
- package/dist/spec/sync-openspec-to-task.js +47 -19
- package/dist/spec/sync-task-to-openspec.js +241 -272
- package/dist/types/ai-context.js +3 -8
- package/package.json +9 -7
- package/references/CLI-TUTORIAL.md +4 -10
|
@@ -1,345 +1,237 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
-
}
|
|
13
|
-
Object.defineProperty(o, k2, desc);
|
|
14
|
-
}) : (function(o, m, k, k2) {
|
|
15
|
-
if (k2 === undefined) k2 = k;
|
|
16
|
-
o[k2] = m[k];
|
|
17
|
-
}));
|
|
18
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
-
}) : function(o, v) {
|
|
21
|
-
o["default"] = v;
|
|
22
|
-
});
|
|
23
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
-
var ownKeys = function(o) {
|
|
25
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
-
var ar = [];
|
|
27
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
-
return ar;
|
|
29
|
-
};
|
|
30
|
-
return ownKeys(o);
|
|
31
|
-
};
|
|
32
|
-
return function (mod) {
|
|
33
|
-
if (mod && mod.__esModule) return mod;
|
|
34
|
-
var result = {};
|
|
35
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
-
__setModuleDefault(result, mod);
|
|
37
|
-
return result;
|
|
1
|
+
function e(s) {
|
|
2
|
+
return "function" != typeof WeakMap ? null : (e = function(e) {
|
|
3
|
+
return new WeakMap();
|
|
4
|
+
})(s);
|
|
5
|
+
}
|
|
6
|
+
function s(s, t) {
|
|
7
|
+
var r, a, o;
|
|
8
|
+
if (!t && s && s.__esModule) return s;
|
|
9
|
+
if (null === s || "object" != typeof s && "function" != typeof s) return {
|
|
10
|
+
default: s
|
|
38
11
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const config_1 = require("../../lib/config");
|
|
46
|
-
const types_1 = require("./types");
|
|
47
|
-
const templates_1 = require("./templates");
|
|
48
|
-
const parsers_1 = require("./parsers");
|
|
49
|
-
const generators_1 = require("./generators");
|
|
50
|
-
const validators_1 = require("./validators");
|
|
51
|
-
const doc_parser_1 = require("./doc-parser");
|
|
52
|
-
function loadTemplate(name) {
|
|
53
|
-
const templatePath = path.resolve(__dirname, '../../../assets', name);
|
|
54
|
-
if (fs.existsSync(templatePath)) {
|
|
55
|
-
return fs.readFileSync(templatePath, 'utf8');
|
|
12
|
+
if ((r = e(t)) && r.has(s)) return r.get(s);
|
|
13
|
+
for(var n in a = {
|
|
14
|
+
__proto__: null
|
|
15
|
+
}, o = Object.defineProperty && Object.getOwnPropertyDescriptor, s)if ("default" !== n && Object.prototype.hasOwnProperty.call(s, n)) {
|
|
16
|
+
var l = o ? Object.getOwnPropertyDescriptor(s, n) : null;
|
|
17
|
+
l && (l.get || l.set) ? Object.defineProperty(a, n, l) : a[n] = s[n];
|
|
56
18
|
}
|
|
57
|
-
return
|
|
19
|
+
return a.default = s, r && r.set(s, a), a;
|
|
58
20
|
}
|
|
59
|
-
function
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
}
|
|
21
|
+
function t(e) {
|
|
22
|
+
if (c.existsSync(e)) return {
|
|
23
|
+
created: !1
|
|
24
|
+
};
|
|
63
25
|
try {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
created: true,
|
|
26
|
+
let s, t = (s = i.resolve(__dirname, '../../../assets', 'tasks.md'), (c.existsSync(s) ? c.readFileSync(s, 'utf8') : null) || d.TASKS_MD_TEMPLATE);
|
|
27
|
+
return c.writeFileSync(e, t, 'utf8'), {
|
|
28
|
+
created: !0,
|
|
68
29
|
reason: 'tasks-md-created',
|
|
69
|
-
message: `tasks.md created. Please edit and confirm: ${
|
|
70
|
-
tasksPath
|
|
30
|
+
message: `tasks.md created. Please edit and confirm: ${e}`,
|
|
31
|
+
tasksPath: e
|
|
71
32
|
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
33
|
+
} catch (t) {
|
|
34
|
+
let s = t instanceof Error ? t.message : 'Unknown error';
|
|
75
35
|
return {
|
|
76
|
-
created:
|
|
36
|
+
created: !1,
|
|
77
37
|
reason: 'file-write-error',
|
|
78
|
-
message: `Failed to create tasks.md: ${
|
|
79
|
-
tasksPath
|
|
38
|
+
message: `Failed to create tasks.md: ${s}`,
|
|
39
|
+
tasksPath: e
|
|
80
40
|
};
|
|
81
41
|
}
|
|
82
42
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
43
|
+
async function r(e = {}) {
|
|
44
|
+
let s, a = (0, u.loadConfig)({
|
|
45
|
+
cwd: e.cwd
|
|
46
|
+
}), o = (0, f.toChangeName)(e.change);
|
|
47
|
+
if (!o) return {
|
|
48
|
+
success: !1,
|
|
49
|
+
reason: 'missing-change',
|
|
50
|
+
message: 'Missing required argument: --change <change-name>'
|
|
51
|
+
};
|
|
52
|
+
let n = a.specRootAbs || i.resolve(a.projectRoot, 'spec'), l = i.resolve(n, 'changes', o), g = i.resolve(l, 'product-requirement.md'), d = i.resolve(l, 'tasks.md'), S = i.resolve(l, 'tasks'), h = i.resolve(l, 'manifest.json');
|
|
53
|
+
if (e.input) try {
|
|
54
|
+
s = (0, f.parseAiInput)(e.input), console.log(`[TASKS] Parsed ${s.length} tasks from --input parameter`);
|
|
55
|
+
} catch (s) {
|
|
56
|
+
let e = s instanceof Error ? s.message : 'Unknown error';
|
|
90
57
|
return {
|
|
91
|
-
success:
|
|
92
|
-
reason: '
|
|
93
|
-
message:
|
|
58
|
+
success: !1,
|
|
59
|
+
reason: 'input-parse-error',
|
|
60
|
+
message: `Failed to parse input: ${e}`
|
|
94
61
|
};
|
|
95
62
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
110
|
-
return {
|
|
111
|
-
success: false,
|
|
112
|
-
reason: 'input-parse-error',
|
|
113
|
-
message: `Failed to parse input: ${errorMessage}`,
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
else if (!process.stdin.isTTY) {
|
|
63
|
+
else if (process.stdin.isTTY) {
|
|
64
|
+
let e = (0, p.validateRequiredFiles)({
|
|
65
|
+
productRequirement: g
|
|
66
|
+
});
|
|
67
|
+
if (!e.valid) return {
|
|
68
|
+
success: !1,
|
|
69
|
+
reason: e.reason,
|
|
70
|
+
message: e.message
|
|
71
|
+
};
|
|
72
|
+
let r = i.resolve(l, 'design.md'), a = c.existsSync(r);
|
|
73
|
+
console.log('[TASKS] Attempting to extract tasks from documents...'), console.log(` PRD: ${g}`), a && console.log(` Design: ${r}`);
|
|
118
74
|
try {
|
|
119
|
-
|
|
120
|
-
if (
|
|
121
|
-
tasks = (0, parsers_1.parseAiInput)(stdinContent);
|
|
122
|
-
console.log(`[TASKS] Parsed ${tasks.length} tasks from stdin`);
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
const validation = (0, validators_1.validateRequiredFiles)({ productRequirement: productRequirementPath });
|
|
126
|
-
if (!validation.valid) {
|
|
127
|
-
return {
|
|
128
|
-
success: false,
|
|
129
|
-
reason: validation.reason,
|
|
130
|
-
message: validation.message,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
const designPath = path.resolve(changeDir, 'design.md');
|
|
134
|
-
const hasDesign = fs.existsSync(designPath);
|
|
135
|
-
console.log('[TASKS] Attempting to extract tasks from documents...');
|
|
136
|
-
const prdContent = fs.readFileSync(productRequirementPath, 'utf8');
|
|
137
|
-
const designContent = hasDesign ? fs.readFileSync(designPath, 'utf8') : null;
|
|
138
|
-
tasks = (0, doc_parser_1.parseDocumentsToTasks)(prdContent, designContent, changeName);
|
|
139
|
-
if (tasks.length === 0) {
|
|
140
|
-
console.log('[TASKS] No tasks extracted, falling back to tasks.md');
|
|
141
|
-
const templateResult = createTasksTemplate(tasksPath);
|
|
142
|
-
if (templateResult.created) {
|
|
143
|
-
return {
|
|
144
|
-
success: false,
|
|
145
|
-
reason: templateResult.reason,
|
|
146
|
-
message: templateResult.message,
|
|
147
|
-
tasksPath: templateResult.tasksPath,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
const tasksContent = fs.readFileSync(tasksPath, 'utf8');
|
|
151
|
-
tasks = (0, parsers_1.parseTasksMd)(tasksContent);
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
console.log(`[TASKS] Successfully extracted ${tasks.length} tasks from documents`);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
catch (error) {
|
|
159
|
-
if (error.message.includes('Stdin timeout')) {
|
|
160
|
-
const validation = (0, validators_1.validateRequiredFiles)({ productRequirement: productRequirementPath });
|
|
161
|
-
if (!validation.valid) {
|
|
162
|
-
return {
|
|
163
|
-
success: false,
|
|
164
|
-
reason: validation.reason,
|
|
165
|
-
message: validation.message,
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
const designPath = path.resolve(changeDir, 'design.md');
|
|
169
|
-
const hasDesign = fs.existsSync(designPath);
|
|
170
|
-
console.log('[TASKS] Attempting to extract tasks from documents...');
|
|
171
|
-
const prdContent = fs.readFileSync(productRequirementPath, 'utf8');
|
|
172
|
-
const designContent = hasDesign ? fs.readFileSync(designPath, 'utf8') : null;
|
|
173
|
-
tasks = (0, doc_parser_1.parseDocumentsToTasks)(prdContent, designContent, changeName);
|
|
174
|
-
if (tasks.length === 0) {
|
|
175
|
-
console.log('[TASKS] No tasks extracted, falling back to tasks.md');
|
|
176
|
-
const templateResult = createTasksTemplate(tasksPath);
|
|
177
|
-
if (templateResult.created) {
|
|
178
|
-
return {
|
|
179
|
-
success: false,
|
|
180
|
-
reason: templateResult.reason,
|
|
181
|
-
message: templateResult.message,
|
|
182
|
-
tasksPath: templateResult.tasksPath,
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
const tasksContent = fs.readFileSync(tasksPath, 'utf8');
|
|
186
|
-
tasks = (0, parsers_1.parseTasksMd)(tasksContent);
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
console.log(`[TASKS] Successfully extracted ${tasks.length} tasks from documents`);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
75
|
+
let e = c.readFileSync(g, 'utf8'), n = a ? c.readFileSync(r, 'utf8') : null;
|
|
76
|
+
if ((s = (0, k.parseDocumentsToTasks)(e, n, o)).length > 0) console.log(`[TASKS] Successfully extracted ${s.length} tasks from documents`);
|
|
192
77
|
else {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
78
|
+
console.log('[TASKS] No tasks extracted from documents, falling back to tasks.md');
|
|
79
|
+
let e = t(d);
|
|
80
|
+
if (e.created) return {
|
|
81
|
+
success: !1,
|
|
82
|
+
reason: e.reason,
|
|
83
|
+
message: e.message,
|
|
84
|
+
tasksPath: e.tasksPath
|
|
198
85
|
};
|
|
86
|
+
let r = c.readFileSync(d, 'utf8');
|
|
87
|
+
s = (0, f.parseTasksMd)(r);
|
|
199
88
|
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
89
|
+
} catch (o) {
|
|
90
|
+
let e = o instanceof Error ? o.message : 'Unknown error';
|
|
91
|
+
console.log(`[TASKS] Failed to extract from documents: ${e}`), console.log('[TASKS] Falling back to tasks.md');
|
|
92
|
+
let r = t(d);
|
|
93
|
+
if (r.created) return {
|
|
94
|
+
success: !1,
|
|
95
|
+
reason: r.reason,
|
|
96
|
+
message: r.message,
|
|
97
|
+
tasksPath: r.tasksPath
|
|
209
98
|
};
|
|
99
|
+
let a = c.readFileSync(d, 'utf8');
|
|
100
|
+
s = (0, f.parseTasksMd)(a);
|
|
210
101
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
console.log(
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
const tasksContent = fs.readFileSync(tasksPath, 'utf8');
|
|
237
|
-
tasks = (0, parsers_1.parseTasksMd)(tasksContent);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
catch (error) {
|
|
241
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
242
|
-
console.log(`[TASKS] Failed to extract from documents: ${errorMessage}`);
|
|
243
|
-
console.log('[TASKS] Falling back to tasks.md');
|
|
244
|
-
const templateResult = createTasksTemplate(tasksPath);
|
|
245
|
-
if (templateResult.created) {
|
|
246
|
-
return {
|
|
247
|
-
success: false,
|
|
248
|
-
reason: templateResult.reason,
|
|
249
|
-
message: templateResult.message,
|
|
250
|
-
tasksPath: templateResult.tasksPath,
|
|
102
|
+
} else try {
|
|
103
|
+
let e = await (0, f.readStdin)();
|
|
104
|
+
if (e.trim()) s = (0, f.parseAiInput)(e), console.log(`[TASKS] Parsed ${s.length} tasks from stdin`);
|
|
105
|
+
else {
|
|
106
|
+
let e = (0, p.validateRequiredFiles)({
|
|
107
|
+
productRequirement: g
|
|
108
|
+
});
|
|
109
|
+
if (!e.valid) return {
|
|
110
|
+
success: !1,
|
|
111
|
+
reason: e.reason,
|
|
112
|
+
message: e.message
|
|
113
|
+
};
|
|
114
|
+
let r = i.resolve(l, 'design.md'), a = c.existsSync(r);
|
|
115
|
+
console.log('[TASKS] Attempting to extract tasks from documents...');
|
|
116
|
+
let n = c.readFileSync(g, 'utf8'), u = a ? c.readFileSync(r, 'utf8') : null;
|
|
117
|
+
if (s = (0, k.parseDocumentsToTasks)(n, u, o), 0 === s.length) {
|
|
118
|
+
console.log('[TASKS] No tasks extracted, falling back to tasks.md');
|
|
119
|
+
let e = t(d);
|
|
120
|
+
if (e.created) return {
|
|
121
|
+
success: !1,
|
|
122
|
+
reason: e.reason,
|
|
123
|
+
message: e.message,
|
|
124
|
+
tasksPath: e.tasksPath
|
|
251
125
|
};
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
126
|
+
let r = c.readFileSync(d, 'utf8');
|
|
127
|
+
s = (0, f.parseTasksMd)(r);
|
|
128
|
+
} else console.log(`[TASKS] Successfully extracted ${s.length} tasks from documents`);
|
|
255
129
|
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
130
|
+
} catch (e) {
|
|
131
|
+
if (e.message.includes('Stdin timeout')) {
|
|
132
|
+
let e = (0, p.validateRequiredFiles)({
|
|
133
|
+
productRequirement: g
|
|
134
|
+
});
|
|
135
|
+
if (!e.valid) return {
|
|
136
|
+
success: !1,
|
|
137
|
+
reason: e.reason,
|
|
138
|
+
message: e.message
|
|
139
|
+
};
|
|
140
|
+
let r = i.resolve(l, 'design.md'), a = c.existsSync(r);
|
|
141
|
+
console.log('[TASKS] Attempting to extract tasks from documents...');
|
|
142
|
+
let n = c.readFileSync(g, 'utf8'), u = a ? c.readFileSync(r, 'utf8') : null;
|
|
143
|
+
if (0 === (s = (0, k.parseDocumentsToTasks)(n, u, o)).length) {
|
|
144
|
+
console.log('[TASKS] No tasks extracted, falling back to tasks.md');
|
|
145
|
+
let e = t(d);
|
|
146
|
+
if (e.created) return {
|
|
147
|
+
success: !1,
|
|
148
|
+
reason: e.reason,
|
|
149
|
+
message: e.message,
|
|
150
|
+
tasksPath: e.tasksPath
|
|
151
|
+
};
|
|
152
|
+
let r = c.readFileSync(d, 'utf8');
|
|
153
|
+
s = (0, f.parseTasksMd)(r);
|
|
154
|
+
} else console.log(`[TASKS] Successfully extracted ${s.length} tasks from documents`);
|
|
155
|
+
} else {
|
|
156
|
+
let s = e instanceof Error ? e.message : 'Unknown error';
|
|
272
157
|
return {
|
|
273
|
-
success:
|
|
274
|
-
reason: '
|
|
275
|
-
message:
|
|
158
|
+
success: !1,
|
|
159
|
+
reason: 'stdin-parse-error',
|
|
160
|
+
message: `Failed to parse stdin: ${s}`
|
|
276
161
|
};
|
|
277
162
|
}
|
|
278
163
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
164
|
+
if (0 === s.length) return {
|
|
165
|
+
success: !1,
|
|
166
|
+
reason: 'no-tasks',
|
|
167
|
+
message: 'No valid tasks found. Please provide tasks via --input, stdin, or tasks.md file.'
|
|
168
|
+
};
|
|
169
|
+
if (console.log(''), console.log('[TASKS] Task list preview:'), console.log(` Total tasks: ${s.length}`), console.log(` Phases: ${[
|
|
170
|
+
...new Set(s.map((e)=>e.phase))
|
|
171
|
+
].sort((e, s)=>e - s).join(', ')}`), console.log(''), !e.yes && process.stdin.isTTY && !await (0, f.promptConfirmation)('Proceed to generate PHASE-*.json files? [Y/n] ')) return {
|
|
172
|
+
success: !1,
|
|
173
|
+
reason: 'user-cancelled',
|
|
174
|
+
message: 'User cancelled the operation.'
|
|
175
|
+
};
|
|
176
|
+
let { generatedFiles: y, error: T } = (0, m.generatePhaseFiles)(S, s, o);
|
|
177
|
+
if (T) return {
|
|
178
|
+
success: !1,
|
|
179
|
+
reason: 'phase-file-error',
|
|
180
|
+
message: `Failed to generate phase files: ${T}`
|
|
181
|
+
};
|
|
182
|
+
let P = (0, m.generateManifestFile)(h, o, s, e);
|
|
183
|
+
return P.error ? {
|
|
184
|
+
success: !1,
|
|
185
|
+
reason: 'manifest-file-error',
|
|
186
|
+
message: `Failed to generate manifest file: ${P.error}`
|
|
187
|
+
} : {
|
|
188
|
+
success: !0,
|
|
189
|
+
changeName: o,
|
|
190
|
+
tasksPath: d,
|
|
191
|
+
tasksDir: S,
|
|
192
|
+
manifestPath: h,
|
|
193
|
+
generatedFiles: y,
|
|
194
|
+
totalTasks: s.length
|
|
303
195
|
};
|
|
304
196
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
input: args.input,
|
|
317
|
-
}).then((result) => {
|
|
318
|
-
if (!result.success) {
|
|
319
|
-
console.error(`[TASKS] ${result.message}`);
|
|
320
|
-
process.exit(result.reason === 'tasks-md-created' ? 0 : 1);
|
|
321
|
-
}
|
|
322
|
-
console.log('');
|
|
323
|
-
console.log('[TASKS] Task files generated successfully!');
|
|
324
|
-
console.log(` Change Name: ${result.changeName}`);
|
|
325
|
-
console.log(` Tasks Dir: ${result.tasksDir}`);
|
|
326
|
-
console.log(` Manifest: ${result.manifestPath}`);
|
|
327
|
-
console.log(` Generated: ${result.generatedFiles?.length || 0} PHASE-*.json files`);
|
|
328
|
-
console.log('');
|
|
329
|
-
console.log('Next steps:');
|
|
330
|
-
console.log(' 1. Review generated task files');
|
|
331
|
-
console.log(' 2. Run: task-flow worktree --change <change-name>');
|
|
332
|
-
console.log('');
|
|
333
|
-
process.exit(0);
|
|
197
|
+
function a() {
|
|
198
|
+
let e = (0, f.parseArgs)(process.argv);
|
|
199
|
+
r({
|
|
200
|
+
cwd: e.cwd,
|
|
201
|
+
change: e.change,
|
|
202
|
+
type: e.type,
|
|
203
|
+
priority: e.priority,
|
|
204
|
+
yes: !0 === e.yes,
|
|
205
|
+
input: e.input
|
|
206
|
+
}).then((e)=>{
|
|
207
|
+
e.success || (console.error(`[TASKS] ${e.message}`), process.exit(+('tasks-md-created' !== e.reason))), console.log(''), console.log('[TASKS] Task files generated successfully!'), console.log(` Change Name: ${e.changeName}`), console.log(` Tasks Dir: ${e.tasksDir}`), console.log(` Manifest: ${e.manifestPath}`), console.log(` Generated: ${e.generatedFiles?.length || 0} PHASE-*.json files`), console.log(''), console.log('Next steps:'), console.log(' 1. Review generated task files'), console.log(' 2. Run: task-flow worktree --change <change-name>'), console.log(''), process.exit(0);
|
|
334
208
|
});
|
|
335
209
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
210
|
+
"use strict";
|
|
211
|
+
Object.defineProperty(exports, "__esModule", {
|
|
212
|
+
value: !0
|
|
213
|
+
});
|
|
214
|
+
var o = exports, n = {
|
|
215
|
+
get default () {
|
|
216
|
+
return S;
|
|
217
|
+
},
|
|
218
|
+
get generateTasks () {
|
|
219
|
+
return r;
|
|
220
|
+
},
|
|
221
|
+
get main () {
|
|
222
|
+
return a;
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
for(var l in n)Object.defineProperty(o, l, {
|
|
226
|
+
enumerable: !0,
|
|
227
|
+
get: Object.getOwnPropertyDescriptor(n, l).get
|
|
228
|
+
});
|
|
229
|
+
let c = /*#__PURE__*/ s(require("fs")), i = /*#__PURE__*/ s(require("path")), u = require("../../lib/config"), g = require("./types"), d = require("./templates"), f = require("./parsers"), m = require("./generators"), p = require("./validators"), k = require("./doc-parser");
|
|
230
|
+
require.main === module && a();
|
|
231
|
+
let S = {
|
|
232
|
+
generateTasks: r,
|
|
233
|
+
parseTasksMd: f.parseTasksMd,
|
|
234
|
+
generatePhaseJson: m.generatePhaseJson,
|
|
235
|
+
generateManifestJson: m.generateManifestJson,
|
|
236
|
+
TASK_SCHEMA: g.TASK_SCHEMA
|
|
345
237
|
};
|