@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/analyze.js
CHANGED
|
@@ -1,338 +1,180 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* AI 可以在此基础上补充自己的理解(analysis、task 等字段),
|
|
7
|
-
* 然后通过 --context-file 传给 extract/design 命令。
|
|
8
|
-
*
|
|
9
|
-
* 用法:
|
|
10
|
-
* task-flow analyze --output context.json
|
|
11
|
-
*/
|
|
12
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
16
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17
|
-
}
|
|
18
|
-
Object.defineProperty(o, k2, desc);
|
|
19
|
-
}) : (function(o, m, k, k2) {
|
|
20
|
-
if (k2 === undefined) k2 = k;
|
|
21
|
-
o[k2] = m[k];
|
|
22
|
-
}));
|
|
23
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
24
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
25
|
-
}) : function(o, v) {
|
|
26
|
-
o["default"] = v;
|
|
27
|
-
});
|
|
28
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
29
|
-
var ownKeys = function(o) {
|
|
30
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
31
|
-
var ar = [];
|
|
32
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
33
|
-
return ar;
|
|
34
|
-
};
|
|
35
|
-
return ownKeys(o);
|
|
36
|
-
};
|
|
37
|
-
return function (mod) {
|
|
38
|
-
if (mod && mod.__esModule) return mod;
|
|
39
|
-
var result = {};
|
|
40
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
41
|
-
__setModuleDefault(result, mod);
|
|
42
|
-
return result;
|
|
43
|
-
};
|
|
44
|
-
})();
|
|
45
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.analyzeProject = analyzeProject;
|
|
47
|
-
exports.main = main;
|
|
48
|
-
const fs = __importStar(require("fs"));
|
|
49
|
-
const path = __importStar(require("path"));
|
|
50
|
-
const config_1 = require("../lib/config");
|
|
51
|
-
function parseArgs(argv) {
|
|
52
|
-
const args = {};
|
|
53
|
-
for (let i = 2; i < argv.length; i += 1) {
|
|
54
|
-
const token = argv[i] || '';
|
|
55
|
-
if (!token.startsWith('--')) {
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
const key = token.slice(2);
|
|
59
|
-
const next = argv[i + 1] || '';
|
|
60
|
-
if (!next || next.startsWith('--')) {
|
|
61
|
-
args[key] = true;
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
args[key] = next;
|
|
65
|
-
i += 1;
|
|
66
|
-
}
|
|
67
|
-
return args;
|
|
1
|
+
function e(t) {
|
|
2
|
+
return "function" != typeof WeakMap ? null : (e = function(e) {
|
|
3
|
+
return new WeakMap();
|
|
4
|
+
})(t);
|
|
68
5
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
function
|
|
73
|
-
|
|
74
|
-
if (!fs.existsSync(pkgPath)) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
try {
|
|
78
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
79
|
-
return require(pkgPath);
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Read tsconfig.json if it exists
|
|
87
|
-
*/
|
|
88
|
-
function readTsconfig(projectRoot) {
|
|
89
|
-
const tsconfigPath = path.resolve(projectRoot, 'tsconfig.json');
|
|
90
|
-
if (!fs.existsSync(tsconfigPath)) {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
try {
|
|
94
|
-
const content = fs.readFileSync(tsconfigPath, 'utf8');
|
|
95
|
-
// Strip comments for basic parsing
|
|
96
|
-
const stripped = content.replace(/\/\/.*$/gm, '').replace(/\/\*[\s\S]*?\*\//g, '');
|
|
97
|
-
return JSON.parse(stripped);
|
|
98
|
-
}
|
|
99
|
-
catch {
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Scan top-level directory structure
|
|
105
|
-
*/
|
|
106
|
-
function scanDirectoryStructure(projectRoot) {
|
|
107
|
-
const entries = fs.readdirSync(projectRoot, { withFileTypes: true });
|
|
108
|
-
const summary = [];
|
|
109
|
-
const knownDirs = {
|
|
110
|
-
src: '源代码目录',
|
|
111
|
-
lib: '库代码目录',
|
|
112
|
-
packages: 'Monorepo 包目录',
|
|
113
|
-
apps: '应用目录',
|
|
114
|
-
test: '测试目录',
|
|
115
|
-
tests: '测试目录',
|
|
116
|
-
__tests__: '测试目录',
|
|
117
|
-
docs: '文档目录',
|
|
118
|
-
scripts: '脚本目录',
|
|
119
|
-
config: '配置目录',
|
|
120
|
-
public: '静态资源目录',
|
|
121
|
-
assets: '资源目录',
|
|
6
|
+
function t(t, r) {
|
|
7
|
+
var n, s, i;
|
|
8
|
+
if (!r && t && t.__esModule) return t;
|
|
9
|
+
if (null === t || "object" != typeof t && "function" != typeof t) return {
|
|
10
|
+
default: t
|
|
122
11
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
catch {
|
|
132
|
-
// Ignore permission errors
|
|
133
|
-
}
|
|
134
|
-
summary.push({ path: entry.name, purpose, fileCount });
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return summary;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Detect project type from structure and package.json
|
|
141
|
-
*/
|
|
142
|
-
function detectProjectType(pkg, structure) {
|
|
143
|
-
if (pkg) {
|
|
144
|
-
const isMonorepo = pkg.workspaces !== undefined
|
|
145
|
-
|| (pkg.pnpm !== undefined && typeof pkg.pnpm === 'object')
|
|
146
|
-
|| structure.some((s) => s.path === 'packages' || s.path === 'apps');
|
|
147
|
-
if (isMonorepo) {
|
|
148
|
-
return 'monorepo';
|
|
149
|
-
}
|
|
150
|
-
const hasBin = pkg.bin !== undefined;
|
|
151
|
-
if (hasBin) {
|
|
152
|
-
return 'cli';
|
|
153
|
-
}
|
|
154
|
-
const mainType = typeof pkg.main === 'string' ? pkg.main : '';
|
|
155
|
-
if (mainType.includes('.mjs') || mainType.includes('.cjs')) {
|
|
156
|
-
return 'library';
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
if (structure.some((s) => s.path === 'src') && structure.some((s) => s.path === 'public')) {
|
|
160
|
-
return 'application';
|
|
161
|
-
}
|
|
162
|
-
return 'application';
|
|
12
|
+
if ((n = e(r)) && n.has(t)) return n.get(t);
|
|
13
|
+
for(var o in s = {
|
|
14
|
+
__proto__: null
|
|
15
|
+
}, i = Object.defineProperty && Object.getOwnPropertyDescriptor, t)if ("default" !== o && Object.prototype.hasOwnProperty.call(t, o)) {
|
|
16
|
+
var c = i ? Object.getOwnPropertyDescriptor(t, o) : null;
|
|
17
|
+
c && (c.get || c.set) ? Object.defineProperty(s, o, c) : s[o] = t[o];
|
|
18
|
+
}
|
|
19
|
+
return s.default = t, n && n.set(t, s), s;
|
|
163
20
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
const depNames = Object.keys(deps);
|
|
175
|
-
// Runtime
|
|
176
|
-
if (depNames.some((d) => d.includes('next'))) {
|
|
177
|
-
techStack.runtime = 'Next.js';
|
|
178
|
-
}
|
|
179
|
-
else if (depNames.some((d) => d.includes('express'))) {
|
|
180
|
-
techStack.runtime = 'Express';
|
|
181
|
-
}
|
|
182
|
-
else if (depNames.some((d) => d.includes('fastify'))) {
|
|
183
|
-
techStack.runtime = 'Fastify';
|
|
184
|
-
}
|
|
185
|
-
else if (depNames.some((d) => d.includes('react'))) {
|
|
186
|
-
techStack.runtime = 'React';
|
|
187
|
-
}
|
|
188
|
-
else if (depNames.some((d) => d.includes('vue'))) {
|
|
189
|
-
techStack.runtime = 'Vue';
|
|
190
|
-
}
|
|
191
|
-
// Framework
|
|
192
|
-
if (depNames.includes('next')) {
|
|
193
|
-
techStack.framework = 'Next.js';
|
|
194
|
-
}
|
|
195
|
-
else if (depNames.includes('express')) {
|
|
196
|
-
techStack.framework = 'Express';
|
|
197
|
-
}
|
|
198
|
-
else if (depNames.includes('fastify')) {
|
|
199
|
-
techStack.framework = 'Fastify';
|
|
200
|
-
}
|
|
201
|
-
else if (depNames.includes('react')) {
|
|
202
|
-
techStack.framework = 'React';
|
|
203
|
-
}
|
|
204
|
-
else if (depNames.includes('vue')) {
|
|
205
|
-
techStack.framework = 'Vue';
|
|
206
|
-
}
|
|
207
|
-
// Build tool
|
|
208
|
-
if (depNames.includes('typescript') || depNames.includes('ts-node')) {
|
|
209
|
-
techStack.buildTool = 'tsc';
|
|
210
|
-
}
|
|
211
|
-
if (depNames.includes('vite')) {
|
|
212
|
-
techStack.buildTool = 'vite';
|
|
213
|
-
}
|
|
214
|
-
if (depNames.includes('webpack')) {
|
|
215
|
-
techStack.buildTool = 'webpack';
|
|
216
|
-
}
|
|
217
|
-
if (depNames.includes('esbuild')) {
|
|
218
|
-
techStack.buildTool = 'esbuild';
|
|
219
|
-
}
|
|
220
|
-
if (depNames.includes('turbo')) {
|
|
221
|
-
techStack.buildTool = 'turbo';
|
|
222
|
-
}
|
|
223
|
-
// Test framework
|
|
224
|
-
if (depNames.includes('vitest')) {
|
|
225
|
-
techStack.testFramework = 'vitest';
|
|
226
|
-
}
|
|
227
|
-
else if (depNames.includes('jest')) {
|
|
228
|
-
techStack.testFramework = 'jest';
|
|
229
|
-
}
|
|
230
|
-
else if (depNames.includes('mocha')) {
|
|
231
|
-
techStack.testFramework = 'mocha';
|
|
232
|
-
}
|
|
233
|
-
// Lint
|
|
234
|
-
if (depNames.includes('eslint')) {
|
|
235
|
-
techStack.lintTool = 'eslint';
|
|
236
|
-
}
|
|
237
|
-
else if (depNames.includes('biome')) {
|
|
238
|
-
techStack.lintTool = 'biome';
|
|
239
|
-
}
|
|
240
|
-
if (depNames.includes('prettier')) {
|
|
241
|
-
techStack.lintTool = (techStack.lintTool || '') + ' + prettier';
|
|
21
|
+
function r(e = {}) {
|
|
22
|
+
let t = (0, l.loadConfig)({
|
|
23
|
+
cwd: e.cwd
|
|
24
|
+
}).projectRoot || process.cwd(), n = function(e) {
|
|
25
|
+
let t = u.resolve(e, 'package.json');
|
|
26
|
+
if (!c.existsSync(t)) return null;
|
|
27
|
+
try {
|
|
28
|
+
return require(t);
|
|
29
|
+
} catch {
|
|
30
|
+
return null;
|
|
242
31
|
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
32
|
+
}(t), s = function(e) {
|
|
33
|
+
let t = u.resolve(e, 'tsconfig.json');
|
|
34
|
+
if (!c.existsSync(t)) return null;
|
|
35
|
+
try {
|
|
36
|
+
let e = c.readFileSync(t, 'utf8').replace(/\/\/.*$/gm, '').replace(/\/\*[\s\S]*?\*\//g, '');
|
|
37
|
+
return JSON.parse(e);
|
|
38
|
+
} catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}(t), i = function(e) {
|
|
42
|
+
let t = c.readdirSync(e, {
|
|
43
|
+
withFileTypes: !0
|
|
44
|
+
}), r = [], n = {
|
|
45
|
+
src: '源代码目录',
|
|
46
|
+
lib: '库代码目录',
|
|
47
|
+
packages: 'Monorepo 包目录',
|
|
48
|
+
apps: '应用目录',
|
|
49
|
+
test: '测试目录',
|
|
50
|
+
tests: '测试目录',
|
|
51
|
+
__tests__: '测试目录',
|
|
52
|
+
docs: '文档目录',
|
|
53
|
+
scripts: '脚本目录',
|
|
54
|
+
config: '配置目录',
|
|
55
|
+
public: '静态资源目录',
|
|
56
|
+
assets: '资源目录'
|
|
57
|
+
};
|
|
58
|
+
for (let s of t)if (s.isDirectory() && !s.name.startsWith('.') && !s.name.startsWith('node_modules')) {
|
|
59
|
+
let t, i = u.resolve(e, s.name), o = n[s.name] || '项目目录';
|
|
60
|
+
try {
|
|
61
|
+
t = c.readdirSync(i, {
|
|
62
|
+
recursive: !0
|
|
63
|
+
}).filter((e)=>'string' == typeof e && !e.startsWith('.') && c.statSync(u.resolve(i, e)).isFile()).length;
|
|
64
|
+
} catch {}
|
|
65
|
+
r.push({
|
|
66
|
+
path: s.name,
|
|
67
|
+
purpose: o,
|
|
68
|
+
fileCount: t
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return r;
|
|
72
|
+
}(t), o = {
|
|
275
73
|
version: '1.0',
|
|
276
74
|
project: {
|
|
277
|
-
name:
|
|
278
|
-
description: description ||
|
|
279
|
-
type:
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
75
|
+
name: String(n?.name || u.basename(t)),
|
|
76
|
+
description: String(n?.description || '') || void 0,
|
|
77
|
+
type: function(e, t) {
|
|
78
|
+
if (e) {
|
|
79
|
+
if (void 0 !== e.workspaces || void 0 !== e.pnpm && 'object' == typeof e.pnpm || t.some((e)=>'packages' === e.path || 'apps' === e.path)) return 'monorepo';
|
|
80
|
+
if (void 0 !== e.bin) return 'cli';
|
|
81
|
+
let r = 'string' == typeof e.main ? e.main : '';
|
|
82
|
+
if (r.includes('.mjs') || r.includes('.cjs')) return 'library';
|
|
83
|
+
}
|
|
84
|
+
return t.some((e)=>'src' === e.path) && t.some((e)=>'public' === e.path), 'application';
|
|
85
|
+
}(n, i),
|
|
86
|
+
techStack: function(e, t) {
|
|
87
|
+
let r = {};
|
|
88
|
+
if (t && (r.language = 'TypeScript'), e) {
|
|
89
|
+
let t = Object.keys({
|
|
90
|
+
...e.dependencies || {},
|
|
91
|
+
...e.devDependencies || {}
|
|
92
|
+
});
|
|
93
|
+
t.some((e)=>e.includes('next')) ? r.runtime = 'Next.js' : t.some((e)=>e.includes('express')) ? r.runtime = 'Express' : t.some((e)=>e.includes('fastify')) ? r.runtime = 'Fastify' : t.some((e)=>e.includes('react')) ? r.runtime = 'React' : t.some((e)=>e.includes('vue')) && (r.runtime = 'Vue'), t.includes('next') ? r.framework = 'Next.js' : t.includes('express') ? r.framework = 'Express' : t.includes('fastify') ? r.framework = 'Fastify' : t.includes('react') ? r.framework = 'React' : t.includes('vue') && (r.framework = 'Vue'), (t.includes("typescript") || t.includes('ts-node')) && (r.buildTool = 'tsc'), t.includes('vite') && (r.buildTool = 'vite'), t.includes('webpack') && (r.buildTool = 'webpack'), t.includes('esbuild') && (r.buildTool = 'esbuild'), t.includes('turbo') && (r.buildTool = 'turbo'), t.includes('vitest') ? r.testFramework = 'vitest' : t.includes('jest') ? r.testFramework = 'jest' : t.includes('mocha') && (r.testFramework = 'mocha'), t.includes('eslint') ? r.lintTool = 'eslint' : t.includes('biome') && (r.lintTool = 'biome'), t.includes('prettier') && (r.lintTool = (r.lintTool || '') + ' + prettier');
|
|
94
|
+
}
|
|
95
|
+
return r;
|
|
96
|
+
}(n, s),
|
|
97
|
+
structure: i,
|
|
98
|
+
keyFiles: [
|
|
99
|
+
'package.json',
|
|
100
|
+
...s ? [
|
|
101
|
+
'tsconfig.json'
|
|
102
|
+
] : []
|
|
103
|
+
],
|
|
104
|
+
dependencies: function(e) {
|
|
105
|
+
let t = {};
|
|
106
|
+
if (!e) return t;
|
|
107
|
+
let r = e.dependencies || {}, n = e.devDependencies || {};
|
|
108
|
+
return t.core = Object.keys(r).slice(0, 10), t.dev = Object.keys(n).slice(0, 10), t;
|
|
109
|
+
}(n)
|
|
110
|
+
}
|
|
285
111
|
};
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
const outputPath = path.resolve(process.cwd(), options.output);
|
|
112
|
+
if (e.output) {
|
|
113
|
+
let t = u.resolve(process.cwd(), e.output);
|
|
289
114
|
try {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
success:
|
|
294
|
-
context,
|
|
295
|
-
outputPath
|
|
115
|
+
return c.mkdirSync(u.dirname(t), {
|
|
116
|
+
recursive: !0
|
|
117
|
+
}), c.writeFileSync(t, JSON.stringify(o, null, 2), 'utf8'), {
|
|
118
|
+
success: !0,
|
|
119
|
+
context: o,
|
|
120
|
+
outputPath: t
|
|
296
121
|
};
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
122
|
+
} catch (t) {
|
|
123
|
+
let e = t instanceof Error ? t.message : 'Unknown error';
|
|
300
124
|
return {
|
|
301
|
-
success:
|
|
125
|
+
success: !1,
|
|
302
126
|
reason: 'file-write-error',
|
|
303
|
-
message: `Failed to write context file: ${
|
|
127
|
+
message: `Failed to write context file: ${e}`
|
|
304
128
|
};
|
|
305
129
|
}
|
|
306
130
|
}
|
|
307
|
-
// Print to stdout
|
|
308
131
|
return {
|
|
309
|
-
success:
|
|
310
|
-
context
|
|
132
|
+
success: !0,
|
|
133
|
+
context: o
|
|
311
134
|
};
|
|
312
135
|
}
|
|
313
|
-
function
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
136
|
+
function n() {
|
|
137
|
+
let e = function(e) {
|
|
138
|
+
let t = {};
|
|
139
|
+
for(let r = 2; r < e.length; r += 1){
|
|
140
|
+
let n = e[r] || '';
|
|
141
|
+
if (!n.startsWith('--')) continue;
|
|
142
|
+
let s = n.slice(2), i = e[r + 1] || '';
|
|
143
|
+
if (!i || i.startsWith('--')) {
|
|
144
|
+
t[s] = !0;
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
t[s] = i, r += 1;
|
|
148
|
+
}
|
|
149
|
+
return t;
|
|
150
|
+
}(process.argv), t = r({
|
|
151
|
+
cwd: e.cwd,
|
|
152
|
+
output: e.output
|
|
318
153
|
});
|
|
319
|
-
|
|
320
|
-
console.error(`[ANALYZE] ${result.message}`);
|
|
321
|
-
process.exit(1);
|
|
322
|
-
}
|
|
323
|
-
if (result.outputPath) {
|
|
324
|
-
console.log(`[ANALYZE] Project context saved to: ${result.outputPath}`);
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
// Output JSON to stdout
|
|
328
|
-
process.stdout.write(JSON.stringify(result.context, null, 2));
|
|
329
|
-
}
|
|
330
|
-
process.exit(0);
|
|
154
|
+
t.success || (console.error(`[ANALYZE] ${t.message}`), process.exit(1)), t.outputPath ? console.log(`[ANALYZE] Project context saved to: ${t.outputPath}`) : process.stdout.write(JSON.stringify(t.context, null, 2)), process.exit(0);
|
|
331
155
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
156
|
+
"use strict";
|
|
157
|
+
Object.defineProperty(exports, "__esModule", {
|
|
158
|
+
value: !0
|
|
159
|
+
});
|
|
160
|
+
var s = exports, i = {
|
|
161
|
+
get analyzeProject () {
|
|
162
|
+
return r;
|
|
163
|
+
},
|
|
164
|
+
get default () {
|
|
165
|
+
return a;
|
|
166
|
+
},
|
|
167
|
+
get main () {
|
|
168
|
+
return n;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
for(var o in i)Object.defineProperty(s, o, {
|
|
172
|
+
enumerable: !0,
|
|
173
|
+
get: Object.getOwnPropertyDescriptor(i, o).get
|
|
174
|
+
});
|
|
175
|
+
let c = /*#__PURE__*/ t(require("fs")), u = /*#__PURE__*/ t(require("path")), l = require("../lib/config");
|
|
176
|
+
require.main === module && n();
|
|
177
|
+
let a = {
|
|
178
|
+
analyzeProject: r,
|
|
179
|
+
main: n
|
|
338
180
|
};
|
package/dist/commands/archive.js
CHANGED
|
@@ -1,53 +1,49 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (!token.startsWith('--')) {
|
|
15
|
-
continue;
|
|
16
|
-
}
|
|
17
|
-
const key = token.slice(2);
|
|
18
|
-
const next = argv[i + 1] || '';
|
|
19
|
-
if (!next || next.startsWith('--')) {
|
|
20
|
-
args[key] = true;
|
|
21
|
-
continue;
|
|
2
|
+
function e() {
|
|
3
|
+
let e = function(e) {
|
|
4
|
+
let t = {};
|
|
5
|
+
for(let r = 2; r < e.length; r += 1){
|
|
6
|
+
let s = e[r] || '';
|
|
7
|
+
if (!s.startsWith('--')) continue;
|
|
8
|
+
let i = s.slice(2), a = e[r + 1] || '';
|
|
9
|
+
if (!a || a.startsWith('--')) {
|
|
10
|
+
t[i] = !0;
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
t[i] = a, r += 1;
|
|
22
14
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
status: args.status,
|
|
35
|
-
phase: args.phase,
|
|
36
|
-
phaseCompleted: args['phase-completed'],
|
|
37
|
-
reviewConclusion: args['review-conclusion'],
|
|
38
|
-
reason: args.reason,
|
|
39
|
-
completedAt: args['completed-at'],
|
|
15
|
+
return t;
|
|
16
|
+
}(process.argv), t = (0, i.archiveTaskState)({
|
|
17
|
+
cwd: e.cwd,
|
|
18
|
+
taskId: e['task-id'],
|
|
19
|
+
eventType: e.event,
|
|
20
|
+
status: e.status,
|
|
21
|
+
phase: e.phase,
|
|
22
|
+
phaseCompleted: e['phase-completed'],
|
|
23
|
+
reviewConclusion: e['review-conclusion'],
|
|
24
|
+
reason: e.reason,
|
|
25
|
+
completedAt: e['completed-at']
|
|
40
26
|
});
|
|
41
|
-
|
|
42
|
-
console.log(`[ARCHIVE] skipped: ${result.reason}`);
|
|
43
|
-
process.exit(0);
|
|
44
|
-
}
|
|
45
|
-
console.log(`[ARCHIVE] updated: ${result.archivePath}`);
|
|
46
|
-
process.exit(0);
|
|
27
|
+
'skipped' in t && t.skipped && (console.log(`[ARCHIVE] skipped: ${t.reason}`), process.exit(0)), console.log(`[ARCHIVE] updated: ${t.archivePath}`), process.exit(0);
|
|
47
28
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
29
|
+
"use strict";
|
|
30
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31
|
+
value: !0
|
|
32
|
+
});
|
|
33
|
+
var t = exports, r = {
|
|
34
|
+
get default () {
|
|
35
|
+
return a;
|
|
36
|
+
},
|
|
37
|
+
get main () {
|
|
38
|
+
return e;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
for(var s in r)Object.defineProperty(t, s, {
|
|
42
|
+
enumerable: !0,
|
|
43
|
+
get: Object.getOwnPropertyDescriptor(r, s).get
|
|
44
|
+
});
|
|
45
|
+
let i = require("../lib/archive");
|
|
46
|
+
require.main === module && e();
|
|
47
|
+
let a = {
|
|
48
|
+
archiveTaskState: i.archiveTaskState
|
|
53
49
|
};
|