@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,141 +1,129 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
-
var ownKeys = function(o) {
|
|
24
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
-
var ar = [];
|
|
26
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
|
-
return ownKeys(o);
|
|
30
|
-
};
|
|
31
|
-
return function (mod) {
|
|
32
|
-
if (mod && mod.__esModule) return mod;
|
|
33
|
-
var result = {};
|
|
34
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
-
__setModuleDefault(result, mod);
|
|
36
|
-
return result;
|
|
1
|
+
function e(t) {
|
|
2
|
+
return "function" != typeof WeakMap ? null : (e = function(e) {
|
|
3
|
+
return new WeakMap();
|
|
4
|
+
})(t);
|
|
5
|
+
}
|
|
6
|
+
function t(t, r) {
|
|
7
|
+
var n, i, a;
|
|
8
|
+
if (!r && t && t.__esModule) return t;
|
|
9
|
+
if (null === t || "object" != typeof t && "function" != typeof t) return {
|
|
10
|
+
default: t
|
|
37
11
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const fs = __importStar(require("fs"));
|
|
45
|
-
const path = __importStar(require("path"));
|
|
46
|
-
/**
|
|
47
|
-
* Generate a single phase JSON object
|
|
48
|
-
*/
|
|
49
|
-
function generatePhaseJson(task, changeName, allTaskIds = []) {
|
|
50
|
-
const dependencies = task.dependencies || [];
|
|
51
|
-
const invalidDependencies = dependencies.filter((depId) => !allTaskIds.includes(depId));
|
|
52
|
-
if (invalidDependencies.length > 0) {
|
|
53
|
-
console.warn(`[TASKS] Warning: Invalid dependencies found: ${invalidDependencies.join(', ')}`);
|
|
54
|
-
console.warn(`[TASKS] Available task IDs: ${allTaskIds.join(', ')}`);
|
|
12
|
+
if ((n = e(r)) && n.has(t)) return n.get(t);
|
|
13
|
+
for(var s in i = {
|
|
14
|
+
__proto__: null
|
|
15
|
+
}, a = Object.defineProperty && Object.getOwnPropertyDescriptor, t)if ("default" !== s && Object.prototype.hasOwnProperty.call(t, s)) {
|
|
16
|
+
var o = a ? Object.getOwnPropertyDescriptor(t, s) : null;
|
|
17
|
+
o && (o.get || o.set) ? Object.defineProperty(i, s, o) : i[s] = t[s];
|
|
55
18
|
}
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
19
|
+
return i.default = t, n && n.set(t, i), i;
|
|
20
|
+
}
|
|
21
|
+
function r(e, t, n = []) {
|
|
22
|
+
let i = e.dependencies || [], a = i.filter((e)=>!n.includes(e));
|
|
23
|
+
return a.length > 0 && (console.warn(`[TASKS] Warning: Invalid dependencies found: ${a.join(', ')}`), console.warn(`[TASKS] Available task IDs: ${n.join(', ')}`)), {
|
|
24
|
+
id: e.id,
|
|
25
|
+
type: e.type,
|
|
26
|
+
title: e.title,
|
|
27
|
+
priority: e.priority,
|
|
28
|
+
phase: e.phase,
|
|
29
|
+
dependencies: i.filter((e)=>n.includes(e)),
|
|
30
|
+
docs_to_read: e.docs_to_read || [
|
|
31
|
+
`spec/changes/${t}/product-requirement.md`,
|
|
32
|
+
`spec/changes/${t}/design.md`
|
|
66
33
|
],
|
|
67
34
|
spec: {
|
|
68
|
-
description:
|
|
69
|
-
files:
|
|
70
|
-
|
|
35
|
+
description: e.spec.description || e.title,
|
|
36
|
+
files: e.spec.files.length > 0 ? e.spec.files : [
|
|
37
|
+
'src/README.md'
|
|
38
|
+
],
|
|
39
|
+
context: e.spec.context || []
|
|
71
40
|
},
|
|
72
|
-
acceptance_criteria:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
implementation:
|
|
41
|
+
acceptance_criteria: e.acceptance_criteria && e.acceptance_criteria.length > 0 ? e.acceptance_criteria : [
|
|
42
|
+
'功能正常工作'
|
|
43
|
+
],
|
|
44
|
+
implementation: e.implementation || {
|
|
76
45
|
steps: [],
|
|
77
|
-
notes: ''
|
|
46
|
+
notes: ''
|
|
78
47
|
},
|
|
79
|
-
validation:
|
|
48
|
+
validation: e.validation || {
|
|
80
49
|
commands: [],
|
|
81
|
-
manual_checks: []
|
|
50
|
+
manual_checks: []
|
|
82
51
|
},
|
|
83
|
-
status:
|
|
52
|
+
status: e.status
|
|
84
53
|
};
|
|
85
54
|
}
|
|
86
|
-
|
|
87
|
-
* Generate manifest JSON
|
|
88
|
-
*/
|
|
89
|
-
function generateManifestJson(changeName, tasks, options = {}) {
|
|
55
|
+
function n(e, t, r = {}) {
|
|
90
56
|
return {
|
|
91
57
|
version: '1.0',
|
|
92
|
-
taskId:
|
|
93
|
-
type:
|
|
94
|
-
priority:
|
|
95
|
-
title:
|
|
96
|
-
changeName,
|
|
97
|
-
totalTasks:
|
|
98
|
-
phases: [
|
|
58
|
+
taskId: e,
|
|
59
|
+
type: r.type || 'feat',
|
|
60
|
+
priority: r.priority || 'medium',
|
|
61
|
+
title: e,
|
|
62
|
+
changeName: e,
|
|
63
|
+
totalTasks: t.length,
|
|
64
|
+
phases: [
|
|
65
|
+
...new Set(t.map((e)=>e.phase))
|
|
66
|
+
].sort((e, t)=>e - t),
|
|
99
67
|
mergeStrategy: {
|
|
100
68
|
type: 'squash',
|
|
101
|
-
deleteBranch:
|
|
102
|
-
deleteWorktree:
|
|
69
|
+
deleteBranch: !0,
|
|
70
|
+
deleteWorktree: !0
|
|
103
71
|
},
|
|
104
|
-
createdAt: new Date().toISOString()
|
|
72
|
+
createdAt: new Date().toISOString()
|
|
105
73
|
};
|
|
106
74
|
}
|
|
107
|
-
|
|
108
|
-
* Generate phase JSON files for all tasks
|
|
109
|
-
*/
|
|
110
|
-
function generatePhaseFiles(tasksDir, tasks, changeName) {
|
|
75
|
+
function i(e, t, n) {
|
|
111
76
|
try {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
generatedFiles.push(taskJsonPath);
|
|
77
|
+
l.mkdirSync(e, {
|
|
78
|
+
recursive: !0
|
|
79
|
+
});
|
|
80
|
+
let i = t.map((e)=>e.id), a = [];
|
|
81
|
+
for (let s of t){
|
|
82
|
+
let t = p.resolve(e, `${s.id}.json`), o = r(s, n, i);
|
|
83
|
+
l.writeFileSync(t, JSON.stringify(o, null, 2), 'utf8'), a.push(t);
|
|
120
84
|
}
|
|
121
|
-
return {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
85
|
+
return {
|
|
86
|
+
generatedFiles: a,
|
|
87
|
+
allTaskIds: i
|
|
88
|
+
};
|
|
89
|
+
} catch (e) {
|
|
90
|
+
return {
|
|
91
|
+
generatedFiles: [],
|
|
92
|
+
allTaskIds: [],
|
|
93
|
+
error: e instanceof Error ? e.message : 'Unknown error'
|
|
94
|
+
};
|
|
126
95
|
}
|
|
127
96
|
}
|
|
128
|
-
|
|
129
|
-
* Generate manifest JSON file
|
|
130
|
-
*/
|
|
131
|
-
function generateManifestFile(manifestPath, changeName, tasks, options = {}) {
|
|
97
|
+
function a(e, t, r, i = {}) {
|
|
132
98
|
try {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
return { error: errorMessage };
|
|
99
|
+
let a = n(t, r, i);
|
|
100
|
+
return l.writeFileSync(e, JSON.stringify(a, null, 2), 'utf8'), {};
|
|
101
|
+
} catch (e) {
|
|
102
|
+
return {
|
|
103
|
+
error: e instanceof Error ? e.message : 'Unknown error'
|
|
104
|
+
};
|
|
140
105
|
}
|
|
141
106
|
}
|
|
107
|
+
"use strict";
|
|
108
|
+
Object.defineProperty(exports, "__esModule", {
|
|
109
|
+
value: !0
|
|
110
|
+
});
|
|
111
|
+
var s = exports, o = {
|
|
112
|
+
get generateManifestFile () {
|
|
113
|
+
return a;
|
|
114
|
+
},
|
|
115
|
+
get generateManifestJson () {
|
|
116
|
+
return n;
|
|
117
|
+
},
|
|
118
|
+
get generatePhaseFiles () {
|
|
119
|
+
return i;
|
|
120
|
+
},
|
|
121
|
+
get generatePhaseJson () {
|
|
122
|
+
return r;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
for(var c in o)Object.defineProperty(s, c, {
|
|
126
|
+
enumerable: !0,
|
|
127
|
+
get: Object.getOwnPropertyDescriptor(o, c).get
|
|
128
|
+
});
|
|
129
|
+
let l = /*#__PURE__*/ t(require("fs")), p = /*#__PURE__*/ t(require("path"));
|