@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.
Files changed (56) hide show
  1. package/README.md +2 -4
  2. package/SKILL.md +2 -4
  3. package/dist/commands/analyze.js +160 -318
  4. package/dist/commands/archive.js +44 -48
  5. package/dist/commands/design.js +225 -400
  6. package/dist/commands/extract.js +174 -303
  7. package/dist/commands/init.js +103 -147
  8. package/dist/commands/merge/index.js +184 -295
  9. package/dist/commands/merge/merger.js +112 -134
  10. package/dist/commands/merge/types.js +3 -5
  11. package/dist/commands/merge/validators.js +115 -132
  12. package/dist/commands/merge.js +46 -13
  13. package/dist/commands/start.js +155 -248
  14. package/dist/commands/status.js +68 -129
  15. package/dist/commands/sync.js +37 -53
  16. package/dist/commands/tasks-gen/doc-parser.js +148 -228
  17. package/dist/commands/tasks-gen/generators.js +104 -116
  18. package/dist/commands/tasks-gen/index.js +206 -314
  19. package/dist/commands/tasks-gen/parsers.js +131 -232
  20. package/dist/commands/tasks-gen/templates.js +9 -10
  21. package/dist/commands/tasks-gen/types.js +36 -14
  22. package/dist/commands/tasks-gen/validators.js +33 -49
  23. package/dist/commands/tasks.js +58 -20
  24. package/dist/commands/worktree.js +167 -249
  25. package/dist/hooks/check-prd-exists.js +45 -55
  26. package/dist/hooks/check-worktree-conflict.js +68 -101
  27. package/dist/hooks/hook-runner/executor.js +134 -126
  28. package/dist/hooks/hook-runner/index.js +181 -196
  29. package/dist/hooks/hook-runner/loader.js +74 -113
  30. package/dist/hooks/hook-runner/types.js +3 -5
  31. package/dist/hooks/hook-runner.js +94 -28
  32. package/dist/hooks/phase-complete-detector.js +125 -191
  33. package/dist/hooks/phase-gate-validator.js +315 -376
  34. package/dist/hooks/save-checkpoint.js +87 -130
  35. package/dist/hooks/start-mcp-servers.js +50 -65
  36. package/dist/hooks/stop-mcp-servers.js +40 -49
  37. package/dist/index.js +84 -153
  38. package/dist/lib/archive.js +126 -209
  39. package/dist/lib/config.js +141 -226
  40. package/dist/lib/constants.js +155 -145
  41. package/dist/lib/interactive.js +98 -148
  42. package/dist/lib/mcp-client.js +197 -320
  43. package/dist/lib/state.js +142 -253
  44. package/dist/slash/executor.js +299 -330
  45. package/dist/slash/index.js +69 -43
  46. package/dist/slash/parser.js +84 -97
  47. package/dist/slash/registry.js +100 -88
  48. package/dist/spec/openspec-to-task/builders.js +96 -109
  49. package/dist/spec/openspec-to-task/index.js +112 -173
  50. package/dist/spec/openspec-to-task/parsers.js +148 -219
  51. package/dist/spec/openspec-to-task/types.js +3 -5
  52. package/dist/spec/sync-openspec-to-task.js +47 -19
  53. package/dist/spec/sync-task-to-openspec.js +241 -272
  54. package/dist/types/ai-context.js +3 -8
  55. package/package.json +8 -6
  56. package/references/CLI-TUTORIAL.md +4 -10
package/README.md CHANGED
@@ -58,8 +58,7 @@ git config --global user.email "your@email.com"
58
58
  # 5. 在工作区中编码实现
59
59
  cd .worktrees/harness-feat-my-feature
60
60
 
61
- # 6. 验证并合并
62
- pnpm build && pnpm test && pnpm lint
61
+ # 6. 完成后合并
63
62
  cd ../..
64
63
  /tf:merge my-feature
65
64
 
@@ -94,8 +93,7 @@ task-flow worktree --change my-feature --yes
94
93
  # 8. 在工作区中开发
95
94
  cd .worktrees/harness-feat-my-feature
96
95
 
97
- # 9. 验证并合并
98
- pnpm build && pnpm test && pnpm lint
96
+ # 9. 完成后合并
99
97
  cd ../..
100
98
  task-flow merge my-feature
101
99
  ```
package/SKILL.md CHANGED
@@ -133,8 +133,7 @@ analyze → extract → design → tasks → worktree → implement → review
133
133
  # 5. 在工作区中编码实现
134
134
  cd .worktrees/harness-feat-add-oauth
135
135
 
136
- # 6. 验证并合并
137
- pnpm build && pnpm test && pnpm lint
136
+ # 6. 完成后合并
138
137
  cd ../..
139
138
  /tf:merge add-oauth
140
139
 
@@ -166,8 +165,7 @@ task-flow worktree --change add-oauth --yes
166
165
  # 7. 在工作区中编码实现
167
166
  cd .worktrees/harness-feat-add-oauth
168
167
 
169
- # 8. 验证并合并
170
- pnpm build && pnpm test && pnpm lint
168
+ # 8. 完成后合并
171
169
  cd ../..
172
170
  task-flow merge add-oauth
173
171
  ```
@@ -1,338 +1,180 @@
1
- "use strict";
2
- /**
3
- * commands/analyze.ts
4
- * 扫描宿主项目基本信息,生成 AI context JSON 的骨架
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
- * Read and parse package.json if it exists
71
- */
72
- function readPackageJson(projectRoot) {
73
- const pkgPath = path.resolve(projectRoot, 'package.json');
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
- for (const entry of entries) {
124
- if (entry.isDirectory() && !entry.name.startsWith('.') && !entry.name.startsWith('node_modules')) {
125
- const dirPath = path.resolve(projectRoot, entry.name);
126
- const purpose = knownDirs[entry.name] || '项目目录';
127
- let fileCount;
128
- try {
129
- fileCount = fs.readdirSync(dirPath, { recursive: true }).filter((p) => typeof p === 'string' && !p.startsWith('.') && fs.statSync(path.resolve(dirPath, p)).isFile()).length;
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
- * Infer tech stack from package.json and tsconfig
166
- */
167
- function inferTechStack(pkg, tsconfig) {
168
- const techStack = {};
169
- if (tsconfig) {
170
- techStack.language = 'TypeScript';
171
- }
172
- if (pkg) {
173
- const deps = { ...(pkg.dependencies || {}), ...(pkg.devDependencies || {}) };
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
- return techStack;
245
- }
246
- /**
247
- * Infer dependencies info
248
- */
249
- function inferDependencies(pkg) {
250
- const result = {};
251
- if (!pkg) {
252
- return result;
253
- }
254
- const deps = pkg.dependencies || {};
255
- const devDeps = pkg.devDependencies || {};
256
- result.core = Object.keys(deps).slice(0, 10);
257
- result.dev = Object.keys(devDeps).slice(0, 10);
258
- return result;
259
- }
260
- /**
261
- * Analyze project and generate context JSON
262
- */
263
- function analyzeProject(options = {}) {
264
- const config = (0, config_1.loadConfig)({ cwd: options.cwd });
265
- const projectRoot = config.projectRoot || process.cwd();
266
- const pkg = readPackageJson(projectRoot);
267
- const tsconfig = readTsconfig(projectRoot);
268
- const structure = scanDirectoryStructure(projectRoot);
269
- const projectName = String(pkg?.name || path.basename(projectRoot));
270
- const description = String(pkg?.description || '');
271
- const projectType = detectProjectType(pkg, structure);
272
- const techStack = inferTechStack(pkg, tsconfig);
273
- const dependencies = inferDependencies(pkg);
274
- const context = {
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: projectName,
278
- description: description || undefined,
279
- type: projectType,
280
- techStack,
281
- structure,
282
- keyFiles: ['package.json', ...(tsconfig ? ['tsconfig.json'] : [])],
283
- dependencies,
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
- // Write to output file if specified
287
- if (options.output) {
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
- fs.mkdirSync(path.dirname(outputPath), { recursive: true });
291
- fs.writeFileSync(outputPath, JSON.stringify(context, null, 2), 'utf8');
292
- return {
293
- success: true,
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
- catch (error) {
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: false,
125
+ success: !1,
302
126
  reason: 'file-write-error',
303
- message: `Failed to write context file: ${errorMessage}`,
127
+ message: `Failed to write context file: ${e}`
304
128
  };
305
129
  }
306
130
  }
307
- // Print to stdout
308
131
  return {
309
- success: true,
310
- context,
132
+ success: !0,
133
+ context: o
311
134
  };
312
135
  }
313
- function main() {
314
- const args = parseArgs(process.argv);
315
- const result = analyzeProject({
316
- cwd: args.cwd,
317
- output: args.output,
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
- if (!result.success) {
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
- if (require.main === module) {
333
- main();
334
- }
335
- exports.default = {
336
- analyzeProject,
337
- main,
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
  };
@@ -1,53 +1,49 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- /**
4
- * commands/archive.ts
5
- * Archive current task state
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.main = main;
9
- const archive_1 = require("../lib/archive");
10
- function parseArgs(argv) {
11
- const args = {};
12
- for (let i = 2; i < argv.length; i += 1) {
13
- const token = argv[i] || '';
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
- args[key] = next;
24
- i += 1;
25
- }
26
- return args;
27
- }
28
- function main() {
29
- const args = parseArgs(process.argv);
30
- const result = (0, archive_1.archiveTaskState)({
31
- cwd: args.cwd,
32
- taskId: args['task-id'],
33
- eventType: args.event,
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
- if ('skipped' in result && result.skipped) {
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
- if (require.main === module) {
49
- main();
50
- }
51
- exports.default = {
52
- archiveTaskState: archive_1.archiveTaskState,
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
  };