@bicorne/task-flow 0.2.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 +2 -4
- package/SKILL.md +2 -4
- 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 -147
- 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.js +141 -226
- 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 +299 -330
- 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 +8 -6
- package/references/CLI-TUTORIAL.md +4 -10
package/dist/lib/config.js
CHANGED
|
@@ -1,247 +1,162 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
-
}
|
|
17
|
-
Object.defineProperty(o, k2, desc);
|
|
18
|
-
}) : (function(o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined) k2 = k;
|
|
20
|
-
o[k2] = m[k];
|
|
21
|
-
}));
|
|
22
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
-
}) : function(o, v) {
|
|
25
|
-
o["default"] = v;
|
|
26
|
-
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
-
var ownKeys = function(o) {
|
|
29
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
-
var ar = [];
|
|
31
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
-
return ar;
|
|
33
|
-
};
|
|
34
|
-
return ownKeys(o);
|
|
35
|
-
};
|
|
36
|
-
return function (mod) {
|
|
37
|
-
if (mod && mod.__esModule) return mod;
|
|
38
|
-
var result = {};
|
|
39
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
-
__setModuleDefault(result, mod);
|
|
41
|
-
return result;
|
|
1
|
+
function e(r) {
|
|
2
|
+
return "function" != typeof WeakMap ? null : (e = function(e) {
|
|
3
|
+
return new WeakMap();
|
|
4
|
+
})(r);
|
|
5
|
+
}
|
|
6
|
+
function r(r, t) {
|
|
7
|
+
var s, o, n;
|
|
8
|
+
if (!t && r && r.__esModule) return r;
|
|
9
|
+
if (null === r || "object" != typeof r && "function" != typeof r) return {
|
|
10
|
+
default: r
|
|
42
11
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
exports.resolvePath = resolvePath;
|
|
50
|
-
exports.loadConfig = loadConfig;
|
|
51
|
-
exports.getConfig = getConfig;
|
|
52
|
-
exports.ensureDirectories = ensureDirectories;
|
|
53
|
-
const fs = __importStar(require("fs"));
|
|
54
|
-
const path = __importStar(require("path"));
|
|
55
|
-
/**
|
|
56
|
-
* Default configuration values
|
|
57
|
-
*/
|
|
58
|
-
exports.DEFAULTS = {
|
|
59
|
-
harnessRoot: '.harness',
|
|
60
|
-
worktreesDir: '.worktrees',
|
|
61
|
-
tasksDir: 'tasks',
|
|
62
|
-
snapshotsDir: 'snapshots',
|
|
63
|
-
archiveDir: 'archive',
|
|
64
|
-
reportsDir: 'reports',
|
|
65
|
-
specRoot: 'spec',
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Environment variable mappings
|
|
69
|
-
*/
|
|
70
|
-
const ENV_MAPPING = {
|
|
71
|
-
HARNESS_ROOT: 'harnessRoot',
|
|
72
|
-
HARNESS_WORKTREES_DIR: 'worktreesDir',
|
|
73
|
-
HARNESS_TASKS_DIR: 'tasksDir',
|
|
74
|
-
HARNESS_SNAPSHOTS_DIR: 'snapshotsDir',
|
|
75
|
-
HARNESS_ARCHIVE_DIR: 'archiveDir',
|
|
76
|
-
HARNESS_REPORTS_DIR: 'reportsDir',
|
|
77
|
-
HARNESS_SPEC_ROOT: 'specRoot',
|
|
78
|
-
HARNESS_CONFIG_FILE: 'configFile',
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Find config file starting from cwd and walking up
|
|
82
|
-
* @param cwd - Current working directory
|
|
83
|
-
* @returns Path to config file or null
|
|
84
|
-
*/
|
|
85
|
-
function findConfigFile(cwd) {
|
|
86
|
-
const configNames = ['.harnessrc', '.harnessrc.json', 'harness.config.json'];
|
|
87
|
-
let current = cwd;
|
|
88
|
-
while (current !== path.dirname(current)) {
|
|
89
|
-
for (const configName of configNames) {
|
|
90
|
-
const configPath = path.resolve(current, configName);
|
|
91
|
-
if (fs.existsSync(configPath)) {
|
|
92
|
-
return configPath;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
current = path.dirname(current);
|
|
12
|
+
if ((s = e(t)) && s.has(r)) return s.get(r);
|
|
13
|
+
for(var i in o = {
|
|
14
|
+
__proto__: null
|
|
15
|
+
}, n = Object.defineProperty && Object.getOwnPropertyDescriptor, r)if ("default" !== i && Object.prototype.hasOwnProperty.call(r, i)) {
|
|
16
|
+
var a = n ? Object.getOwnPropertyDescriptor(r, i) : null;
|
|
17
|
+
a && (a.get || a.set) ? Object.defineProperty(o, i, a) : o[i] = r[i];
|
|
96
18
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
19
|
+
return o.default = r, s && s.set(r, o), o;
|
|
20
|
+
}
|
|
21
|
+
function t(e) {
|
|
22
|
+
let r = [
|
|
23
|
+
'.harnessrc',
|
|
24
|
+
'.harnessrc.json',
|
|
25
|
+
'harness.config.json'
|
|
26
|
+
], t = e;
|
|
27
|
+
for(; t !== D.dirname(t);){
|
|
28
|
+
for (let e of r){
|
|
29
|
+
let r = D.resolve(t, e);
|
|
30
|
+
if (p.existsSync(r)) return r;
|
|
102
31
|
}
|
|
32
|
+
t = D.dirname(t);
|
|
33
|
+
}
|
|
34
|
+
for (let t of r){
|
|
35
|
+
let r = D.resolve(e, t);
|
|
36
|
+
if (p.existsSync(r)) return r;
|
|
103
37
|
}
|
|
104
38
|
return null;
|
|
105
39
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
* @param configPath - Path to config file
|
|
109
|
-
* @returns Config object
|
|
110
|
-
*/
|
|
111
|
-
function loadConfigFile(configPath) {
|
|
112
|
-
if (!configPath || !fs.existsSync(configPath)) {
|
|
113
|
-
return {};
|
|
114
|
-
}
|
|
40
|
+
function s(e) {
|
|
41
|
+
if (!e || !p.existsSync(e)) return {};
|
|
115
42
|
try {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return
|
|
120
|
-
}
|
|
121
|
-
catch (error) {
|
|
122
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
123
|
-
console.warn(`[CONFIG] Failed to load config file: ${configPath}`, errorMessage);
|
|
124
|
-
return {};
|
|
43
|
+
let r = p.readFileSync(e, 'utf8').replace(/\/\/.*$/gm, '').replace(/\/\*[\s\S]*?\*\//g, '');
|
|
44
|
+
return JSON.parse(r);
|
|
45
|
+
} catch (r) {
|
|
46
|
+
return console.warn(`[CONFIG] Failed to load config file: ${e}`, r instanceof Error ? r.message : 'Unknown error'), {};
|
|
125
47
|
}
|
|
126
48
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const config = {};
|
|
133
|
-
for (const [envVar, configKey] of Object.entries(ENV_MAPPING)) {
|
|
134
|
-
const envValue = process.env[envVar];
|
|
135
|
-
if (envValue) {
|
|
136
|
-
config[configKey] = envValue;
|
|
137
|
-
}
|
|
49
|
+
function o() {
|
|
50
|
+
let e = {};
|
|
51
|
+
for (let [r, t] of Object.entries(h)){
|
|
52
|
+
let s = process.env[r];
|
|
53
|
+
s && (e[t] = s);
|
|
138
54
|
}
|
|
139
|
-
return
|
|
55
|
+
return e;
|
|
140
56
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
* @param basePath - Base path (can be relative or absolute)
|
|
144
|
-
* @param projectRoot - Project root directory
|
|
145
|
-
* @returns Resolved absolute path
|
|
146
|
-
*/
|
|
147
|
-
function resolvePath(basePath, projectRoot) {
|
|
148
|
-
if (!basePath) {
|
|
149
|
-
return projectRoot;
|
|
150
|
-
}
|
|
151
|
-
if (path.isAbsolute(basePath)) {
|
|
152
|
-
return basePath;
|
|
153
|
-
}
|
|
154
|
-
return path.resolve(projectRoot, basePath);
|
|
57
|
+
function n(e, r) {
|
|
58
|
+
return e ? D.isAbsolute(e) ? e : D.resolve(r, e) : r;
|
|
155
59
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
function loadConfig(options = {}) {
|
|
164
|
-
const cwd = path.resolve(options.cwd || process.cwd());
|
|
165
|
-
// Find config file
|
|
166
|
-
const configPath = options.configFile || findConfigFile(cwd);
|
|
167
|
-
// Determine project root
|
|
168
|
-
let projectRoot = cwd;
|
|
169
|
-
if (configPath) {
|
|
170
|
-
projectRoot = path.dirname(configPath);
|
|
171
|
-
// Walk up to find actual project root (where .git is)
|
|
172
|
-
let current = projectRoot;
|
|
173
|
-
while (current !== path.dirname(current)) {
|
|
174
|
-
if (fs.existsSync(path.resolve(current, '.git'))) {
|
|
175
|
-
projectRoot = current;
|
|
60
|
+
function i(e = {}) {
|
|
61
|
+
let r = D.resolve(e.cwd || process.cwd()), a = e.configFile || t(r), c = r;
|
|
62
|
+
if (a) {
|
|
63
|
+
let e = c = D.dirname(a);
|
|
64
|
+
for(; e !== D.dirname(e);){
|
|
65
|
+
if (p.existsSync(D.resolve(e, '.git'))) {
|
|
66
|
+
c = e;
|
|
176
67
|
break;
|
|
177
68
|
}
|
|
178
|
-
|
|
69
|
+
e = D.dirname(e);
|
|
179
70
|
}
|
|
180
71
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const config = {
|
|
186
|
-
...exports.DEFAULTS,
|
|
187
|
-
...fileConfig,
|
|
188
|
-
...envConfig,
|
|
72
|
+
let f = a ? s(a) : {}, l = o(), u = {
|
|
73
|
+
...R,
|
|
74
|
+
...f,
|
|
75
|
+
...l
|
|
189
76
|
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
77
|
+
for (let e of [
|
|
78
|
+
'harnessRoot',
|
|
79
|
+
'worktreesDir',
|
|
80
|
+
'tasksDir',
|
|
81
|
+
'snapshotsDir',
|
|
82
|
+
'archiveDir',
|
|
83
|
+
'reportsDir',
|
|
84
|
+
'specRoot'
|
|
85
|
+
]){
|
|
86
|
+
let r = u[e];
|
|
87
|
+
'string' == typeof r && (u[`${e}Abs`] = n(r, c));
|
|
198
88
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
config.reportsDirAbs = resolvePath(config.reportsDir, config.harnessRootAbs);
|
|
205
|
-
config.worktreesDirAbs = resolvePath(config.worktreesDir, projectRoot);
|
|
206
|
-
config.specRootAbs = resolvePath(config.specRoot, projectRoot);
|
|
207
|
-
// Add metadata
|
|
208
|
-
config.projectRoot = projectRoot;
|
|
209
|
-
config.configPath = configPath || undefined;
|
|
210
|
-
config.configSources = {
|
|
211
|
-
defaults: exports.DEFAULTS,
|
|
212
|
-
file: fileConfig,
|
|
213
|
-
env: envConfig,
|
|
214
|
-
};
|
|
215
|
-
return config;
|
|
89
|
+
return u.harnessRootAbs = n(u.harnessRoot, c), u.tasksDirAbs = n(u.tasksDir, u.harnessRootAbs), u.snapshotsDirAbs = n(u.snapshotsDir, u.harnessRootAbs), u.archiveDirAbs = n(u.archiveDir, u.harnessRootAbs), u.reportsDirAbs = n(u.reportsDir, u.harnessRootAbs), u.worktreesDirAbs = n(u.worktreesDir, c), u.specRootAbs = n(u.specRoot, c), u.projectRoot = c, u.configPath = a || void 0, u.configSources = {
|
|
90
|
+
defaults: R,
|
|
91
|
+
file: f,
|
|
92
|
+
env: l
|
|
93
|
+
}, u;
|
|
216
94
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
* @param defaultValue - Default value if not found
|
|
221
|
-
* @param options - Options
|
|
222
|
-
* @returns Config value
|
|
223
|
-
*/
|
|
224
|
-
function getConfig(key, defaultValue, options = {}) {
|
|
225
|
-
const config = loadConfig(options);
|
|
226
|
-
const value = config[key] || config[`${key}Abs`] || defaultValue;
|
|
227
|
-
return value;
|
|
95
|
+
function a(e, r, t = {}) {
|
|
96
|
+
let s = i(t);
|
|
97
|
+
return s[e] || s[`${e}Abs`] || r;
|
|
228
98
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
config.worktreesDirAbs,
|
|
241
|
-
];
|
|
242
|
-
for (const dir of dirs) {
|
|
243
|
-
if (dir) {
|
|
244
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
245
|
-
}
|
|
246
|
-
}
|
|
99
|
+
function c(e) {
|
|
100
|
+
for (let r of [
|
|
101
|
+
e.harnessRootAbs,
|
|
102
|
+
e.tasksDirAbs,
|
|
103
|
+
e.snapshotsDirAbs,
|
|
104
|
+
e.archiveDirAbs,
|
|
105
|
+
e.reportsDirAbs,
|
|
106
|
+
e.worktreesDirAbs
|
|
107
|
+
])r && p.mkdirSync(r, {
|
|
108
|
+
recursive: !0
|
|
109
|
+
});
|
|
247
110
|
}
|
|
111
|
+
"use strict";
|
|
112
|
+
Object.defineProperty(exports, "__esModule", {
|
|
113
|
+
value: !0
|
|
114
|
+
});
|
|
115
|
+
var f = exports, l = {
|
|
116
|
+
get DEFAULTS () {
|
|
117
|
+
return R;
|
|
118
|
+
},
|
|
119
|
+
get ensureDirectories () {
|
|
120
|
+
return c;
|
|
121
|
+
},
|
|
122
|
+
get findConfigFile () {
|
|
123
|
+
return t;
|
|
124
|
+
},
|
|
125
|
+
get getConfig () {
|
|
126
|
+
return a;
|
|
127
|
+
},
|
|
128
|
+
get loadConfig () {
|
|
129
|
+
return i;
|
|
130
|
+
},
|
|
131
|
+
get loadConfigFile () {
|
|
132
|
+
return s;
|
|
133
|
+
},
|
|
134
|
+
get loadEnvConfig () {
|
|
135
|
+
return o;
|
|
136
|
+
},
|
|
137
|
+
get resolvePath () {
|
|
138
|
+
return n;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
for(var u in l)Object.defineProperty(f, u, {
|
|
142
|
+
enumerable: !0,
|
|
143
|
+
get: Object.getOwnPropertyDescriptor(l, u).get
|
|
144
|
+
});
|
|
145
|
+
let p = /*#__PURE__*/ r(require("fs")), D = /*#__PURE__*/ r(require("path")), R = {
|
|
146
|
+
harnessRoot: '.harness',
|
|
147
|
+
worktreesDir: '.worktrees',
|
|
148
|
+
tasksDir: 'tasks',
|
|
149
|
+
snapshotsDir: 'snapshots',
|
|
150
|
+
archiveDir: 'archive',
|
|
151
|
+
reportsDir: 'reports',
|
|
152
|
+
specRoot: 'spec'
|
|
153
|
+
}, h = {
|
|
154
|
+
HARNESS_ROOT: 'harnessRoot',
|
|
155
|
+
HARNESS_WORKTREES_DIR: 'worktreesDir',
|
|
156
|
+
HARNESS_TASKS_DIR: 'tasksDir',
|
|
157
|
+
HARNESS_SNAPSHOTS_DIR: 'snapshotsDir',
|
|
158
|
+
HARNESS_ARCHIVE_DIR: 'archiveDir',
|
|
159
|
+
HARNESS_REPORTS_DIR: 'reportsDir',
|
|
160
|
+
HARNESS_SPEC_ROOT: 'specRoot',
|
|
161
|
+
HARNESS_CONFIG_FILE: 'configFile'
|
|
162
|
+
};
|