@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
package/dist/commands/init.js
CHANGED
|
@@ -1,165 +1,120 @@
|
|
|
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, s) {
|
|
7
|
+
var r, o, n;
|
|
8
|
+
if (!s && 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 config_1 = require("../lib/config");
|
|
45
|
-
const state_1 = require("../lib/state");
|
|
46
|
-
function parseArgs(argv) {
|
|
47
|
-
const args = {};
|
|
48
|
-
for (let i = 2; i < argv.length; i += 1) {
|
|
49
|
-
const token = argv[i] || '';
|
|
50
|
-
if (!token.startsWith('--')) {
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
const key = token.slice(2);
|
|
54
|
-
const next = argv[i + 1];
|
|
55
|
-
if (!next || next.startsWith('--')) {
|
|
56
|
-
args[key] = true;
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
args[key] = next;
|
|
60
|
-
i += 1;
|
|
12
|
+
if ((r = e(s)) && r.has(t)) return r.get(t);
|
|
13
|
+
for(var i in o = {
|
|
14
|
+
__proto__: null
|
|
15
|
+
}, n = Object.defineProperty && Object.getOwnPropertyDescriptor, t)if ("default" !== i && Object.prototype.hasOwnProperty.call(t, i)) {
|
|
16
|
+
var a = n ? Object.getOwnPropertyDescriptor(t, i) : null;
|
|
17
|
+
a && (a.get || a.set) ? Object.defineProperty(o, i, a) : o[i] = t[i];
|
|
61
18
|
}
|
|
62
|
-
return
|
|
19
|
+
return o.default = t, r && r.set(t, o), o;
|
|
63
20
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (!
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
if (!
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const projectRoot = config.projectRoot;
|
|
96
|
-
if (!projectRoot) {
|
|
97
|
-
return {
|
|
98
|
-
success: false,
|
|
99
|
-
reason: 'missing-project-root',
|
|
100
|
-
message: 'Config missing projectRoot',
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
const configTemplatePath = path.resolve(projectRoot, '.harnessrc.example');
|
|
104
|
-
if (!fs.existsSync(configTemplatePath)) {
|
|
105
|
-
const template = {
|
|
21
|
+
function s(e = {}) {
|
|
22
|
+
let t = (0, l.loadConfig)({
|
|
23
|
+
cwd: e.cwd
|
|
24
|
+
}), r = t.harnessRootAbs;
|
|
25
|
+
if (!r) return {
|
|
26
|
+
success: !1,
|
|
27
|
+
reason: 'missing-harness-root',
|
|
28
|
+
message: 'Config missing harnessRootAbs'
|
|
29
|
+
};
|
|
30
|
+
let o = c.resolve(r, 'state.json');
|
|
31
|
+
if (a.existsSync(o) && !e.force) return {
|
|
32
|
+
success: !1,
|
|
33
|
+
reason: 'already-initialized',
|
|
34
|
+
message: `Harness already initialized at ${r}. Use --force to reinitialize.`
|
|
35
|
+
};
|
|
36
|
+
(0, l.ensureDirectories)(t);
|
|
37
|
+
let n = (0, u.createInitialState)();
|
|
38
|
+
if (!(0, u.saveState)(n, t)) return {
|
|
39
|
+
success: !1,
|
|
40
|
+
reason: 'save-state-failed',
|
|
41
|
+
message: 'Failed to save initial state'
|
|
42
|
+
};
|
|
43
|
+
let i = t.projectRoot;
|
|
44
|
+
if (!i) return {
|
|
45
|
+
success: !1,
|
|
46
|
+
reason: 'missing-project-root',
|
|
47
|
+
message: 'Config missing projectRoot'
|
|
48
|
+
};
|
|
49
|
+
let f = c.resolve(i, '.harnessrc.example');
|
|
50
|
+
if (!a.existsSync(f)) try {
|
|
51
|
+
a.writeFileSync(f, JSON.stringify({
|
|
106
52
|
harnessRoot: '.harness',
|
|
107
53
|
worktreesDir: '.worktrees',
|
|
108
54
|
tasksDir: 'tasks',
|
|
109
55
|
snapshotsDir: 'snapshots',
|
|
110
56
|
archiveDir: 'archive',
|
|
111
57
|
reportsDir: 'reports',
|
|
112
|
-
|
|
113
|
-
|
|
58
|
+
specRoot: 'spec'
|
|
59
|
+
}, null, 2), 'utf8');
|
|
60
|
+
} catch (t) {
|
|
61
|
+
let e = t instanceof Error ? t.message : 'Unknown error';
|
|
62
|
+
return {
|
|
63
|
+
success: !1,
|
|
64
|
+
reason: 'file-write-error',
|
|
65
|
+
message: `Failed to write config template: ${e}`
|
|
114
66
|
};
|
|
115
|
-
try {
|
|
116
|
-
fs.writeFileSync(configTemplatePath, JSON.stringify(template, null, 2), 'utf8');
|
|
117
|
-
}
|
|
118
|
-
catch (error) {
|
|
119
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
120
|
-
return {
|
|
121
|
-
success: false,
|
|
122
|
-
reason: 'file-write-error',
|
|
123
|
-
message: `Failed to write config template: ${errorMessage}`,
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
67
|
}
|
|
127
68
|
return {
|
|
128
|
-
success:
|
|
129
|
-
config,
|
|
130
|
-
state
|
|
69
|
+
success: !0,
|
|
70
|
+
config: t,
|
|
71
|
+
state: n
|
|
131
72
|
};
|
|
132
73
|
}
|
|
133
|
-
function
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
74
|
+
function r() {
|
|
75
|
+
let e = function(e) {
|
|
76
|
+
let t = {};
|
|
77
|
+
for(let s = 2; s < e.length; s += 1){
|
|
78
|
+
let r = e[s] || '';
|
|
79
|
+
if (!r.startsWith('--')) continue;
|
|
80
|
+
let o = r.slice(2), n = e[s + 1];
|
|
81
|
+
if (!n || n.startsWith('--')) {
|
|
82
|
+
t[o] = !0;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
t[o] = n, s += 1;
|
|
86
|
+
}
|
|
87
|
+
return t;
|
|
88
|
+
}(process.argv), t = s({
|
|
89
|
+
cwd: e.cwd,
|
|
90
|
+
force: !0 === e.force
|
|
138
91
|
});
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
const harnessRoot = result.config?.harnessRootAbs || 'unknown';
|
|
144
|
-
const worktreesDir = result.config?.worktreesDirAbs || 'unknown';
|
|
145
|
-
const tasksDir = result.config?.tasksDirAbs || 'unknown';
|
|
146
|
-
const snapshotsDir = result.config?.snapshotsDirAbs || 'unknown';
|
|
147
|
-
console.log('[INIT] Task flow initialized successfully!');
|
|
148
|
-
console.log(` Root: ${harnessRoot}`);
|
|
149
|
-
console.log(` Worktrees: ${worktreesDir}`);
|
|
150
|
-
console.log(` Tasks: ${tasksDir}`);
|
|
151
|
-
console.log(` Snapshots: ${snapshotsDir}`);
|
|
152
|
-
console.log('');
|
|
153
|
-
console.log('Next steps:');
|
|
154
|
-
console.log(' 1. Create a proposal: task-flow extract --change <change-name>');
|
|
155
|
-
console.log(' 2. Check status: task-flow status');
|
|
156
|
-
console.log('');
|
|
157
|
-
process.exit(0);
|
|
92
|
+
t.success || (console.error(`[INIT] ${t.message}`), process.exit(1));
|
|
93
|
+
let r = t.config?.harnessRootAbs || 'unknown', o = t.config?.worktreesDirAbs || 'unknown', n = t.config?.tasksDirAbs || 'unknown', i = t.config?.snapshotsDirAbs || 'unknown';
|
|
94
|
+
console.log('[INIT] Task flow initialized successfully!'), console.log(` Root: ${r}`), console.log(` Worktrees: ${o}`), console.log(` Tasks: ${n}`), console.log(` Snapshots: ${i}`), console.log(''), console.log('Next steps:'), console.log(' 1. Create a proposal: task-flow extract --change <change-name>'), console.log(' 2. Check status: task-flow status'), console.log(''), process.exit(0);
|
|
158
95
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
96
|
+
"use strict";
|
|
97
|
+
Object.defineProperty(exports, "__esModule", {
|
|
98
|
+
value: !0
|
|
99
|
+
});
|
|
100
|
+
var o = exports, n = {
|
|
101
|
+
get default () {
|
|
102
|
+
return f;
|
|
103
|
+
},
|
|
104
|
+
get initHarness () {
|
|
105
|
+
return s;
|
|
106
|
+
},
|
|
107
|
+
get main () {
|
|
108
|
+
return r;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
for(var i in n)Object.defineProperty(o, i, {
|
|
112
|
+
enumerable: !0,
|
|
113
|
+
get: Object.getOwnPropertyDescriptor(n, i).get
|
|
114
|
+
});
|
|
115
|
+
let a = /*#__PURE__*/ t(require("fs")), c = /*#__PURE__*/ t(require("path")), l = require("../lib/config"), u = require("../lib/state");
|
|
116
|
+
require.main === module && r();
|
|
117
|
+
let f = {
|
|
118
|
+
initHarness: s,
|
|
119
|
+
main: r
|
|
165
120
|
};
|