maxsimcli 3.11.0 → 4.0.0
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/dist/.tsbuildinfo +1 -1
- package/dist/adapters/index.d.ts +0 -11
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +4 -40
- package/dist/adapters/index.js.map +1 -1
- package/dist/assets/CHANGELOG.md +36 -0
- package/dist/assets/dashboard/client/assets/{index-CZ8WC97G.js → index-C_eAetZJ.js} +66 -66
- package/dist/assets/dashboard/client/assets/index-CmiJKqOU.css +32 -0
- package/dist/assets/dashboard/client/index.html +2 -2
- package/dist/assets/dashboard/server.js +467 -271
- package/dist/assets/templates/agents/AGENTS.md +94 -0
- package/dist/assets/templates/agents/maxsim-debugger.md +2 -2
- package/dist/assets/templates/agents/maxsim-executor.md +5 -5
- package/dist/assets/templates/agents/maxsim-phase-researcher.md +2 -2
- package/dist/assets/templates/agents/maxsim-plan-checker.md +2 -2
- package/dist/assets/templates/agents/maxsim-planner.md +3 -3
- package/dist/assets/templates/commands/maxsim/add-todo.md +15 -5
- package/dist/assets/templates/commands/maxsim/discuss-phase.md +1 -0
- package/dist/assets/templates/commands/maxsim/init-existing.md +4 -0
- package/dist/assets/templates/commands/maxsim/new-project.md +4 -0
- package/dist/assets/templates/commands/maxsim/settings.md +1 -1
- package/dist/assets/templates/references/thinking-partner.md +41 -0
- package/dist/assets/templates/skills/batch-worktree/SKILL.md +137 -0
- package/dist/assets/templates/skills/brainstorming/SKILL.md +159 -0
- package/dist/assets/templates/skills/code-review/SKILL.md +151 -0
- package/dist/assets/templates/skills/memory-management/SKILL.md +174 -0
- package/dist/assets/templates/skills/roadmap-writing/SKILL.md +198 -0
- package/dist/assets/templates/skills/sdd/SKILL.md +175 -0
- package/dist/assets/templates/skills/simplify/SKILL.md +185 -0
- package/dist/assets/templates/skills/using-maxsim/SKILL.md +120 -0
- package/dist/assets/templates/templates/acceptance-criteria.md +10 -0
- package/dist/assets/templates/templates/config.json +1 -1
- package/dist/assets/templates/templates/decisions.md +10 -0
- package/dist/assets/templates/templates/no-gos.md +9 -0
- package/dist/assets/templates/workflows/add-tests.md +3 -3
- package/dist/assets/templates/workflows/add-todo.md +89 -0
- package/dist/assets/templates/workflows/complete-milestone.md +1 -1
- package/dist/assets/templates/workflows/discuss-phase.md +85 -1
- package/dist/assets/templates/workflows/execute-phase.md +26 -16
- package/dist/assets/templates/workflows/execute-plan.md +166 -0
- package/dist/assets/templates/workflows/init-existing.md +123 -3
- package/dist/assets/templates/workflows/new-milestone.md +4 -0
- package/dist/assets/templates/workflows/new-project.md +111 -3
- package/dist/assets/templates/workflows/plan-phase.md +5 -5
- package/dist/assets/templates/workflows/quick.md +2 -2
- package/dist/assets/templates/workflows/settings.md +8 -4
- package/dist/assets/templates/workflows/verify-work.md +1 -1
- package/dist/cli.cjs +1512 -1026
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +170 -278
- package/dist/cli.js.map +1 -1
- package/dist/core/artefakte.d.ts +12 -0
- package/dist/core/artefakte.d.ts.map +1 -0
- package/dist/core/artefakte.js +136 -0
- package/dist/core/artefakte.js.map +1 -0
- package/dist/core/commands.d.ts +13 -13
- package/dist/core/commands.d.ts.map +1 -1
- package/dist/core/commands.js +48 -58
- package/dist/core/commands.js.map +1 -1
- package/dist/core/config.d.ts +4 -3
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +14 -18
- package/dist/core/config.js.map +1 -1
- package/dist/core/context-loader.d.ts +20 -0
- package/dist/core/context-loader.d.ts.map +1 -0
- package/dist/core/context-loader.js +154 -0
- package/dist/core/context-loader.js.map +1 -0
- package/dist/core/core.d.ts +26 -2
- package/dist/core/core.d.ts.map +1 -1
- package/dist/core/core.js +90 -24
- package/dist/core/core.js.map +1 -1
- package/dist/core/dashboard-launcher.d.ts +56 -0
- package/dist/core/dashboard-launcher.d.ts.map +1 -0
- package/dist/core/dashboard-launcher.js +246 -0
- package/dist/core/dashboard-launcher.js.map +1 -0
- package/dist/core/frontmatter.d.ts +5 -5
- package/dist/core/frontmatter.d.ts.map +1 -1
- package/dist/core/frontmatter.js +21 -26
- package/dist/core/frontmatter.js.map +1 -1
- package/dist/core/index.d.ts +10 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +40 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/init.d.ts +14 -15
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +93 -155
- package/dist/core/init.js.map +1 -1
- package/dist/core/milestone.d.ts +3 -3
- package/dist/core/milestone.d.ts.map +1 -1
- package/dist/core/milestone.js +9 -9
- package/dist/core/milestone.js.map +1 -1
- package/dist/core/phase.d.ts +9 -9
- package/dist/core/phase.d.ts.map +1 -1
- package/dist/core/phase.js +65 -63
- package/dist/core/phase.js.map +1 -1
- package/dist/core/roadmap.d.ts +4 -3
- package/dist/core/roadmap.d.ts.map +1 -1
- package/dist/core/roadmap.js +46 -108
- package/dist/core/roadmap.js.map +1 -1
- package/dist/core/skills.d.ts +19 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +145 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/start.d.ts +15 -0
- package/dist/core/start.d.ts.map +1 -0
- package/dist/core/start.js +80 -0
- package/dist/core/start.js.map +1 -0
- package/dist/core/state.d.ts +13 -13
- package/dist/core/state.d.ts.map +1 -1
- package/dist/core/state.js +125 -130
- package/dist/core/state.js.map +1 -1
- package/dist/core/template.d.ts +3 -3
- package/dist/core/template.d.ts.map +1 -1
- package/dist/core/template.js +12 -14
- package/dist/core/template.js.map +1 -1
- package/dist/core/types.d.ts +15 -4
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +9 -2
- package/dist/core/types.js.map +1 -1
- package/dist/core/verify.d.ts +10 -9
- package/dist/core/verify.d.ts.map +1 -1
- package/dist/core/verify.js +38 -48
- package/dist/core/verify.js.map +1 -1
- package/dist/core-TFSlUjV1.cjs +4312 -0
- package/dist/core-TFSlUjV1.cjs.map +1 -0
- package/dist/install/adapters.d.ts +6 -0
- package/dist/install/adapters.d.ts.map +1 -0
- package/dist/install/adapters.js +65 -0
- package/dist/install/adapters.js.map +1 -0
- package/dist/install/copy.d.ts +6 -0
- package/dist/install/copy.d.ts.map +1 -0
- package/dist/install/copy.js +71 -0
- package/dist/install/copy.js.map +1 -0
- package/dist/install/dashboard.d.ts +16 -0
- package/dist/install/dashboard.d.ts.map +1 -0
- package/dist/install/dashboard.js +273 -0
- package/dist/install/dashboard.js.map +1 -0
- package/dist/install/hooks.d.ts +31 -0
- package/dist/install/hooks.d.ts.map +1 -0
- package/dist/install/hooks.js +260 -0
- package/dist/install/hooks.js.map +1 -0
- package/dist/install/index.d.ts +2 -0
- package/dist/install/index.d.ts.map +1 -0
- package/dist/install/index.js +535 -0
- package/dist/install/index.js.map +1 -0
- package/dist/install/manifest.d.ts +23 -0
- package/dist/install/manifest.d.ts.map +1 -0
- package/dist/install/manifest.js +129 -0
- package/dist/install/manifest.js.map +1 -0
- package/dist/install/patches.d.ts +10 -0
- package/dist/install/patches.d.ts.map +1 -0
- package/dist/install/patches.js +124 -0
- package/dist/install/patches.js.map +1 -0
- package/dist/install/shared.d.ts +56 -0
- package/dist/install/shared.d.ts.map +1 -0
- package/dist/install/shared.js +172 -0
- package/dist/install/shared.js.map +1 -0
- package/dist/install/uninstall.d.ts +5 -0
- package/dist/install/uninstall.d.ts.map +1 -0
- package/dist/install/uninstall.js +222 -0
- package/dist/install/uninstall.js.map +1 -0
- package/dist/install.cjs +793 -1648
- package/dist/install.cjs.map +1 -1
- package/dist/mcp-server.cjs +38 -14
- package/dist/mcp-server.cjs.map +1 -1
- package/dist/skills-BOSxYUzf.cjs +6812 -0
- package/dist/skills-BOSxYUzf.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/adapters/codex.d.ts +0 -19
- package/dist/adapters/codex.d.ts.map +0 -1
- package/dist/adapters/codex.js +0 -94
- package/dist/adapters/codex.js.map +0 -1
- package/dist/adapters/gemini.d.ts +0 -19
- package/dist/adapters/gemini.d.ts.map +0 -1
- package/dist/adapters/gemini.js +0 -96
- package/dist/adapters/gemini.js.map +0 -1
- package/dist/adapters/opencode.d.ts +0 -17
- package/dist/adapters/opencode.d.ts.map +0 -1
- package/dist/adapters/opencode.js +0 -111
- package/dist/adapters/opencode.js.map +0 -1
- package/dist/adapters/transforms/content.d.ts +0 -39
- package/dist/adapters/transforms/content.d.ts.map +0 -1
- package/dist/adapters/transforms/content.js +0 -125
- package/dist/adapters/transforms/content.js.map +0 -1
- package/dist/adapters/transforms/frontmatter.d.ts +0 -42
- package/dist/adapters/transforms/frontmatter.d.ts.map +0 -1
- package/dist/adapters/transforms/frontmatter.js +0 -204
- package/dist/adapters/transforms/frontmatter.js.map +0 -1
- package/dist/adapters/transforms/tool-maps.d.ts +0 -20
- package/dist/adapters/transforms/tool-maps.d.ts.map +0 -1
- package/dist/adapters/transforms/tool-maps.js +0 -64
- package/dist/adapters/transforms/tool-maps.js.map +0 -1
- package/dist/assets/dashboard/client/assets/index-DzJChB-D.css +0 -32
- package/dist/install.d.ts +0 -2
- package/dist/install.d.ts.map +0 -1
- package/dist/install.js +0 -1841
- package/dist/install.js.map +0 -1
package/dist/core/init.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Ported from maxsim/bin/lib/init.cjs
|
|
5
5
|
*/
|
|
6
|
-
import type { BranchingStrategy, ModelResolution } from './types.js';
|
|
6
|
+
import type { BranchingStrategy, ModelResolution, CmdResult } from './types.js';
|
|
7
7
|
export type WorkflowType = 'execute-phase' | 'plan-phase' | 'new-project' | 'new-milestone' | 'quick' | 'resume' | 'verify-work' | 'phase-op' | 'todos' | 'milestone-op' | 'map-codebase' | 'init-existing' | 'progress';
|
|
8
8
|
export interface ExecutePhaseContext {
|
|
9
9
|
executor_model: ModelResolution;
|
|
@@ -42,7 +42,6 @@ export interface PlanPhaseContext {
|
|
|
42
42
|
checker_model: ModelResolution;
|
|
43
43
|
research_enabled: boolean;
|
|
44
44
|
plan_checker_enabled: boolean;
|
|
45
|
-
nyquist_validation_enabled: boolean;
|
|
46
45
|
commit_docs: boolean;
|
|
47
46
|
phase_found: boolean;
|
|
48
47
|
phase_dir: string | null;
|
|
@@ -257,18 +256,18 @@ export interface ProgressContext {
|
|
|
257
256
|
config_path: string;
|
|
258
257
|
}
|
|
259
258
|
export type InitContext = ExecutePhaseContext | PlanPhaseContext | NewProjectContext | NewMilestoneContext | QuickContext | ResumeContext | VerifyWorkContext | PhaseOpContext | TodosContext | MilestoneOpContext | MapCodebaseContext | InitExistingContext | ProgressContext;
|
|
260
|
-
export declare function cmdInitExecutePhase(cwd: string, phase: string | undefined
|
|
261
|
-
export declare function cmdInitPlanPhase(cwd: string, phase: string | undefined
|
|
262
|
-
export declare function cmdInitNewProject(cwd: string
|
|
263
|
-
export declare function cmdInitNewMilestone(cwd: string
|
|
264
|
-
export declare function cmdInitQuick(cwd: string, description: string | undefined
|
|
265
|
-
export declare function cmdInitResume(cwd: string
|
|
266
|
-
export declare function cmdInitVerifyWork(cwd: string, phase: string | undefined
|
|
267
|
-
export declare function cmdInitPhaseOp(cwd: string, phase: string | undefined
|
|
268
|
-
export declare function cmdInitTodos(cwd: string, area: string | undefined
|
|
269
|
-
export declare function cmdInitMilestoneOp(cwd: string
|
|
270
|
-
export declare function cmdInitMapCodebase(cwd: string
|
|
271
|
-
export declare function cmdInitExisting(cwd: string
|
|
272
|
-
export declare function cmdInitProgress(cwd: string
|
|
259
|
+
export declare function cmdInitExecutePhase(cwd: string, phase: string | undefined): CmdResult;
|
|
260
|
+
export declare function cmdInitPlanPhase(cwd: string, phase: string | undefined): CmdResult;
|
|
261
|
+
export declare function cmdInitNewProject(cwd: string): CmdResult;
|
|
262
|
+
export declare function cmdInitNewMilestone(cwd: string): CmdResult;
|
|
263
|
+
export declare function cmdInitQuick(cwd: string, description: string | undefined): CmdResult;
|
|
264
|
+
export declare function cmdInitResume(cwd: string): CmdResult;
|
|
265
|
+
export declare function cmdInitVerifyWork(cwd: string, phase: string | undefined): CmdResult;
|
|
266
|
+
export declare function cmdInitPhaseOp(cwd: string, phase: string | undefined): CmdResult;
|
|
267
|
+
export declare function cmdInitTodos(cwd: string, area: string | undefined): CmdResult;
|
|
268
|
+
export declare function cmdInitMilestoneOp(cwd: string): CmdResult;
|
|
269
|
+
export declare function cmdInitMapCodebase(cwd: string): CmdResult;
|
|
270
|
+
export declare function cmdInitExisting(cwd: string): CmdResult;
|
|
271
|
+
export declare function cmdInitProgress(cwd: string): CmdResult;
|
|
273
272
|
export {};
|
|
274
273
|
//# sourceMappingURL=init.d.ts.map
|
package/dist/core/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/core/init.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/core/init.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH,OAAO,KAAK,EAEV,iBAAiB,EACjB,eAAe,EAIf,SAAS,EACV,MAAM,YAAY,CAAC;AAIpB,MAAM,MAAM,YAAY,GACpB,eAAe,GACf,YAAY,GACZ,aAAa,GACb,eAAe,GACf,OAAO,GACP,QAAQ,GACR,aAAa,GACb,UAAU,GACV,OAAO,GACP,cAAc,GACd,cAAc,GACd,eAAe,GACf,UAAU,CAAC;AAEf,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,eAAe,CAAC;IAChC,cAAc,EAAE,eAAe,CAAC;IAChC,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,iBAAiB,CAAC;IACtC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,yBAAyB,EAAE,MAAM,CAAC;IAClC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC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AC,GAAG,EAAE,MAAM,GAAG,SAAS,CA+BtD;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAkDtD"}
|
package/dist/core/init.js
CHANGED
|
@@ -24,15 +24,13 @@ exports.cmdInitProgress = cmdInitProgress;
|
|
|
24
24
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
25
25
|
const node_path_1 = __importDefault(require("node:path"));
|
|
26
26
|
const node_os_1 = __importDefault(require("node:os"));
|
|
27
|
-
const node_child_process_1 = require("node:child_process");
|
|
28
27
|
const core_js_1 = require("./core.js");
|
|
28
|
+
const types_js_1 = require("./types.js");
|
|
29
29
|
// ─── Helper: extract requirement IDs from roadmap phase section ─────────────
|
|
30
30
|
function extractReqIds(cwd, phase) {
|
|
31
31
|
const roadmapPhase = (0, core_js_1.getRoadmapPhaseInternal)(cwd, phase);
|
|
32
32
|
const reqMatch = roadmapPhase?.section?.match(/^\*\*Requirements\*\*:[^\S\n]*([^\n]*)$/m);
|
|
33
|
-
const reqExtracted = reqMatch
|
|
34
|
-
? reqMatch[1].replace(/[\[\]]/g, '').split(',').map((s) => s.trim()).filter(Boolean).join(', ')
|
|
35
|
-
: null;
|
|
33
|
+
const reqExtracted = reqMatch ? reqMatch[1].replace(/[\[\]]/g, '').split(',').map((s) => s.trim()).filter(Boolean).join(', ') : null;
|
|
36
34
|
return (reqExtracted && reqExtracted !== 'TBD') ? reqExtracted : null;
|
|
37
35
|
}
|
|
38
36
|
function scanPhaseArtifacts(cwd, phaseDirectory) {
|
|
@@ -41,33 +39,61 @@ function scanPhaseArtifacts(cwd, phaseDirectory) {
|
|
|
41
39
|
try {
|
|
42
40
|
const files = node_fs_1.default.readdirSync(phaseDirFull);
|
|
43
41
|
const contextFile = files.find(f => f.endsWith('-CONTEXT.md') || f === 'CONTEXT.md');
|
|
44
|
-
if (contextFile)
|
|
42
|
+
if (contextFile)
|
|
45
43
|
result.context_path = node_path_1.default.join(phaseDirectory, contextFile);
|
|
46
|
-
}
|
|
47
44
|
const researchFile = files.find(f => f.endsWith('-RESEARCH.md') || f === 'RESEARCH.md');
|
|
48
|
-
if (researchFile)
|
|
45
|
+
if (researchFile)
|
|
49
46
|
result.research_path = node_path_1.default.join(phaseDirectory, researchFile);
|
|
50
|
-
}
|
|
51
47
|
const verificationFile = files.find(f => f.endsWith('-VERIFICATION.md') || f === 'VERIFICATION.md');
|
|
52
|
-
if (verificationFile)
|
|
48
|
+
if (verificationFile)
|
|
53
49
|
result.verification_path = node_path_1.default.join(phaseDirectory, verificationFile);
|
|
54
|
-
}
|
|
55
50
|
const uatFile = files.find(f => f.endsWith('-UAT.md') || f === 'UAT.md');
|
|
56
|
-
if (uatFile)
|
|
51
|
+
if (uatFile)
|
|
57
52
|
result.uat_path = node_path_1.default.join(phaseDirectory, uatFile);
|
|
58
|
-
}
|
|
59
53
|
}
|
|
60
54
|
catch (e) {
|
|
61
|
-
/* optional op, ignore */
|
|
62
55
|
(0, core_js_1.debugLog)(e);
|
|
63
56
|
}
|
|
64
57
|
return result;
|
|
65
58
|
}
|
|
66
|
-
// ───
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
59
|
+
// ─── Helper: cross-platform code file detection ─────────────────────────────
|
|
60
|
+
const CODE_EXTENSIONS = new Set(['.ts', '.js', '.py', '.go', '.rs', '.swift', '.java']);
|
|
61
|
+
const EXCLUDED_DIRS = new Set(['node_modules', '.git']);
|
|
62
|
+
function findCodeFiles(dir, maxDepth = 3, limit = 5) {
|
|
63
|
+
const results = [];
|
|
64
|
+
function walk(currentDir, depth) {
|
|
65
|
+
if (depth > maxDepth || results.length >= limit)
|
|
66
|
+
return;
|
|
67
|
+
let entries;
|
|
68
|
+
try {
|
|
69
|
+
entries = node_fs_1.default.readdirSync(currentDir, { withFileTypes: true });
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
for (const entry of entries) {
|
|
75
|
+
if (results.length >= limit)
|
|
76
|
+
return;
|
|
77
|
+
if (EXCLUDED_DIRS.has(entry.name))
|
|
78
|
+
continue;
|
|
79
|
+
const fullPath = node_path_1.default.join(currentDir, entry.name);
|
|
80
|
+
if (entry.isDirectory()) {
|
|
81
|
+
walk(fullPath, depth + 1);
|
|
82
|
+
}
|
|
83
|
+
else if (entry.isFile()) {
|
|
84
|
+
const ext = node_path_1.default.extname(entry.name).toLowerCase();
|
|
85
|
+
if (CODE_EXTENSIONS.has(ext))
|
|
86
|
+
results.push(fullPath);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
70
89
|
}
|
|
90
|
+
walk(dir, 1);
|
|
91
|
+
return results;
|
|
92
|
+
}
|
|
93
|
+
// ─── Init commands ──────────────────────────────────────────────────────────
|
|
94
|
+
function cmdInitExecutePhase(cwd, phase) {
|
|
95
|
+
if (!phase)
|
|
96
|
+
return (0, types_js_1.cmdErr)('phase required for init execute-phase');
|
|
71
97
|
const config = (0, core_js_1.loadConfig)(cwd);
|
|
72
98
|
const phaseInfo = (0, core_js_1.findPhaseInternal)(cwd, phase);
|
|
73
99
|
const milestone = (0, core_js_1.getMilestoneInfo)(cwd);
|
|
@@ -93,13 +119,9 @@ function cmdInitExecutePhase(cwd, phase, raw) {
|
|
|
93
119
|
plan_count: phaseInfo?.plans?.length ?? 0,
|
|
94
120
|
incomplete_count: phaseInfo?.incomplete_plans?.length ?? 0,
|
|
95
121
|
branch_name: config.branching_strategy === 'phase' && phaseInfo
|
|
96
|
-
? config.phase_branch_template
|
|
97
|
-
.replace('{phase}', phaseInfo.phase_number)
|
|
98
|
-
.replace('{slug}', phaseInfo.phase_slug || 'phase')
|
|
122
|
+
? config.phase_branch_template.replace('{phase}', phaseInfo.phase_number).replace('{slug}', phaseInfo.phase_slug || 'phase')
|
|
99
123
|
: config.branching_strategy === 'milestone'
|
|
100
|
-
? config.milestone_branch_template
|
|
101
|
-
.replace('{milestone}', milestone.version)
|
|
102
|
-
.replace('{slug}', (0, core_js_1.generateSlugInternal)(milestone.name) || 'milestone')
|
|
124
|
+
? config.milestone_branch_template.replace('{milestone}', milestone.version).replace('{slug}', (0, core_js_1.generateSlugInternal)(milestone.name) || 'milestone')
|
|
103
125
|
: null,
|
|
104
126
|
milestone_version: milestone.version,
|
|
105
127
|
milestone_name: milestone.name,
|
|
@@ -111,12 +133,11 @@ function cmdInitExecutePhase(cwd, phase, raw) {
|
|
|
111
133
|
roadmap_path: '.planning/ROADMAP.md',
|
|
112
134
|
config_path: '.planning/config.json',
|
|
113
135
|
};
|
|
114
|
-
(0,
|
|
136
|
+
return (0, types_js_1.cmdOk)(result);
|
|
115
137
|
}
|
|
116
|
-
function cmdInitPlanPhase(cwd, phase
|
|
117
|
-
if (!phase)
|
|
118
|
-
(0,
|
|
119
|
-
}
|
|
138
|
+
function cmdInitPlanPhase(cwd, phase) {
|
|
139
|
+
if (!phase)
|
|
140
|
+
return (0, types_js_1.cmdErr)('phase required for init plan-phase');
|
|
120
141
|
const config = (0, core_js_1.loadConfig)(cwd);
|
|
121
142
|
const phaseInfo = (0, core_js_1.findPhaseInternal)(cwd, phase);
|
|
122
143
|
const phase_req_ids = extractReqIds(cwd, phase);
|
|
@@ -126,7 +147,6 @@ function cmdInitPlanPhase(cwd, phase, raw) {
|
|
|
126
147
|
checker_model: (0, core_js_1.resolveModelInternal)(cwd, 'maxsim-plan-checker'),
|
|
127
148
|
research_enabled: config.research,
|
|
128
149
|
plan_checker_enabled: config.plan_checker,
|
|
129
|
-
nyquist_validation_enabled: false, // config doesn't have nyquist_validation directly
|
|
130
150
|
commit_docs: config.commit_docs,
|
|
131
151
|
phase_found: !!phaseInfo,
|
|
132
152
|
phase_dir: phaseInfo?.directory ?? null,
|
|
@@ -156,32 +176,15 @@ function cmdInitPlanPhase(cwd, phase, raw) {
|
|
|
156
176
|
if (artifacts.uat_path)
|
|
157
177
|
result.uat_path = artifacts.uat_path;
|
|
158
178
|
}
|
|
159
|
-
(0,
|
|
179
|
+
return (0, types_js_1.cmdOk)(result);
|
|
160
180
|
}
|
|
161
|
-
function cmdInitNewProject(cwd
|
|
181
|
+
function cmdInitNewProject(cwd) {
|
|
162
182
|
const config = (0, core_js_1.loadConfig)(cwd);
|
|
163
183
|
const homedir = node_os_1.default.homedir();
|
|
164
184
|
const braveKeyFile = node_path_1.default.join(homedir, '.maxsim', 'brave_api_key');
|
|
165
185
|
const hasBraveSearch = !!(process.env.BRAVE_API_KEY || node_fs_1.default.existsSync(braveKeyFile));
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
try {
|
|
169
|
-
const files = (0, node_child_process_1.execSync)('find . -maxdepth 3 \\( -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.swift" -o -name "*.java" \\) 2>/dev/null | grep -v node_modules | grep -v .git | head -5', {
|
|
170
|
-
cwd,
|
|
171
|
-
encoding: 'utf-8',
|
|
172
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
173
|
-
});
|
|
174
|
-
hasCode = files.trim().length > 0;
|
|
175
|
-
}
|
|
176
|
-
catch (e) {
|
|
177
|
-
/* optional op, ignore */
|
|
178
|
-
(0, core_js_1.debugLog)(e);
|
|
179
|
-
}
|
|
180
|
-
hasPackageFile = (0, core_js_1.pathExistsInternal)(cwd, 'package.json') ||
|
|
181
|
-
(0, core_js_1.pathExistsInternal)(cwd, 'requirements.txt') ||
|
|
182
|
-
(0, core_js_1.pathExistsInternal)(cwd, 'Cargo.toml') ||
|
|
183
|
-
(0, core_js_1.pathExistsInternal)(cwd, 'go.mod') ||
|
|
184
|
-
(0, core_js_1.pathExistsInternal)(cwd, 'Package.swift');
|
|
186
|
+
const hasCode = findCodeFiles(cwd).length > 0;
|
|
187
|
+
const hasPackageFile = (0, core_js_1.pathExistsInternal)(cwd, 'package.json') || (0, core_js_1.pathExistsInternal)(cwd, 'requirements.txt') || (0, core_js_1.pathExistsInternal)(cwd, 'Cargo.toml') || (0, core_js_1.pathExistsInternal)(cwd, 'go.mod') || (0, core_js_1.pathExistsInternal)(cwd, 'Package.swift');
|
|
185
188
|
const result = {
|
|
186
189
|
researcher_model: (0, core_js_1.resolveModelInternal)(cwd, 'maxsim-project-researcher'),
|
|
187
190
|
synthesizer_model: (0, core_js_1.resolveModelInternal)(cwd, 'maxsim-research-synthesizer'),
|
|
@@ -198,9 +201,9 @@ function cmdInitNewProject(cwd, raw) {
|
|
|
198
201
|
brave_search_available: hasBraveSearch,
|
|
199
202
|
project_path: '.planning/PROJECT.md',
|
|
200
203
|
};
|
|
201
|
-
(0,
|
|
204
|
+
return (0, types_js_1.cmdOk)(result);
|
|
202
205
|
}
|
|
203
|
-
function cmdInitNewMilestone(cwd
|
|
206
|
+
function cmdInitNewMilestone(cwd) {
|
|
204
207
|
const config = (0, core_js_1.loadConfig)(cwd);
|
|
205
208
|
const milestone = (0, core_js_1.getMilestoneInfo)(cwd);
|
|
206
209
|
const result = {
|
|
@@ -218,25 +221,20 @@ function cmdInitNewMilestone(cwd, raw) {
|
|
|
218
221
|
roadmap_path: '.planning/ROADMAP.md',
|
|
219
222
|
state_path: '.planning/STATE.md',
|
|
220
223
|
};
|
|
221
|
-
(0,
|
|
224
|
+
return (0, types_js_1.cmdOk)(result);
|
|
222
225
|
}
|
|
223
|
-
function cmdInitQuick(cwd, description
|
|
226
|
+
function cmdInitQuick(cwd, description) {
|
|
224
227
|
const config = (0, core_js_1.loadConfig)(cwd);
|
|
225
228
|
const now = new Date();
|
|
226
229
|
const slug = description ? (0, core_js_1.generateSlugInternal)(description)?.substring(0, 40) ?? null : null;
|
|
227
230
|
const quickDir = (0, core_js_1.planningPath)(cwd, 'quick');
|
|
228
231
|
let nextNum = 1;
|
|
229
232
|
try {
|
|
230
|
-
const existing = node_fs_1.default.readdirSync(quickDir)
|
|
231
|
-
|
|
232
|
-
.map(f => parseInt(f.split('-')[0], 10))
|
|
233
|
-
.filter(n => !isNaN(n));
|
|
234
|
-
if (existing.length > 0) {
|
|
233
|
+
const existing = node_fs_1.default.readdirSync(quickDir).filter(f => /^\d+-/.test(f)).map(f => parseInt(f.split('-')[0], 10)).filter(n => !isNaN(n));
|
|
234
|
+
if (existing.length > 0)
|
|
235
235
|
nextNum = Math.max(...existing) + 1;
|
|
236
|
-
}
|
|
237
236
|
}
|
|
238
237
|
catch (e) {
|
|
239
|
-
/* optional op, ignore */
|
|
240
238
|
(0, core_js_1.debugLog)(e);
|
|
241
239
|
}
|
|
242
240
|
const result = {
|
|
@@ -255,16 +253,15 @@ function cmdInitQuick(cwd, description, raw) {
|
|
|
255
253
|
roadmap_exists: (0, core_js_1.pathExistsInternal)(cwd, '.planning/ROADMAP.md'),
|
|
256
254
|
planning_exists: (0, core_js_1.pathExistsInternal)(cwd, '.planning'),
|
|
257
255
|
};
|
|
258
|
-
(0,
|
|
256
|
+
return (0, types_js_1.cmdOk)(result);
|
|
259
257
|
}
|
|
260
|
-
function cmdInitResume(cwd
|
|
258
|
+
function cmdInitResume(cwd) {
|
|
261
259
|
const config = (0, core_js_1.loadConfig)(cwd);
|
|
262
260
|
let interruptedAgentId = null;
|
|
263
261
|
try {
|
|
264
262
|
interruptedAgentId = node_fs_1.default.readFileSync((0, core_js_1.planningPath)(cwd, 'current-agent-id.txt'), 'utf-8').trim();
|
|
265
263
|
}
|
|
266
264
|
catch (e) {
|
|
267
|
-
/* optional op, ignore */
|
|
268
265
|
(0, core_js_1.debugLog)(e);
|
|
269
266
|
}
|
|
270
267
|
const result = {
|
|
@@ -279,12 +276,11 @@ function cmdInitResume(cwd, raw) {
|
|
|
279
276
|
interrupted_agent_id: interruptedAgentId,
|
|
280
277
|
commit_docs: config.commit_docs,
|
|
281
278
|
};
|
|
282
|
-
(0,
|
|
279
|
+
return (0, types_js_1.cmdOk)(result);
|
|
283
280
|
}
|
|
284
|
-
function cmdInitVerifyWork(cwd, phase
|
|
285
|
-
if (!phase)
|
|
286
|
-
(0,
|
|
287
|
-
}
|
|
281
|
+
function cmdInitVerifyWork(cwd, phase) {
|
|
282
|
+
if (!phase)
|
|
283
|
+
return (0, types_js_1.cmdErr)('phase required for init verify-work');
|
|
288
284
|
const config = (0, core_js_1.loadConfig)(cwd);
|
|
289
285
|
const phaseInfo = (0, core_js_1.findPhaseInternal)(cwd, phase);
|
|
290
286
|
const result = {
|
|
@@ -297,28 +293,16 @@ function cmdInitVerifyWork(cwd, phase, raw) {
|
|
|
297
293
|
phase_name: phaseInfo?.phase_name ?? null,
|
|
298
294
|
has_verification: phaseInfo?.has_verification ?? false,
|
|
299
295
|
};
|
|
300
|
-
(0,
|
|
296
|
+
return (0, types_js_1.cmdOk)(result);
|
|
301
297
|
}
|
|
302
|
-
function cmdInitPhaseOp(cwd, phase
|
|
298
|
+
function cmdInitPhaseOp(cwd, phase) {
|
|
303
299
|
const config = (0, core_js_1.loadConfig)(cwd);
|
|
304
300
|
let phaseInfo = (0, core_js_1.findPhaseInternal)(cwd, phase ?? '');
|
|
305
301
|
if (!phaseInfo) {
|
|
306
302
|
const roadmapPhase = (0, core_js_1.getRoadmapPhaseInternal)(cwd, phase ?? '');
|
|
307
303
|
if (roadmapPhase?.found) {
|
|
308
304
|
const phaseName = roadmapPhase.phase_name;
|
|
309
|
-
phaseInfo = {
|
|
310
|
-
found: true,
|
|
311
|
-
directory: '', // no directory yet
|
|
312
|
-
phase_number: roadmapPhase.phase_number,
|
|
313
|
-
phase_name: phaseName,
|
|
314
|
-
phase_slug: phaseName ? phaseName.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') : null,
|
|
315
|
-
plans: [],
|
|
316
|
-
summaries: [],
|
|
317
|
-
incomplete_plans: [],
|
|
318
|
-
has_research: false,
|
|
319
|
-
has_context: false,
|
|
320
|
-
has_verification: false,
|
|
321
|
-
};
|
|
305
|
+
phaseInfo = { found: true, directory: '', phase_number: roadmapPhase.phase_number, phase_name: phaseName, phase_slug: phaseName ? phaseName.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') : null, plans: [], summaries: [], incomplete_plans: [], has_research: false, has_context: false, has_verification: false };
|
|
322
306
|
}
|
|
323
307
|
}
|
|
324
308
|
const result = {
|
|
@@ -352,9 +336,9 @@ function cmdInitPhaseOp(cwd, phase, raw) {
|
|
|
352
336
|
if (artifacts.uat_path)
|
|
353
337
|
result.uat_path = artifacts.uat_path;
|
|
354
338
|
}
|
|
355
|
-
(0,
|
|
339
|
+
return (0, types_js_1.cmdOk)(result);
|
|
356
340
|
}
|
|
357
|
-
function cmdInitTodos(cwd, area
|
|
341
|
+
function cmdInitTodos(cwd, area) {
|
|
358
342
|
const config = (0, core_js_1.loadConfig)(cwd);
|
|
359
343
|
const now = new Date();
|
|
360
344
|
const pendingDir = (0, core_js_1.planningPath)(cwd, 'todos', 'pending');
|
|
@@ -372,22 +356,14 @@ function cmdInitTodos(cwd, area, raw) {
|
|
|
372
356
|
if (area && todoArea !== area)
|
|
373
357
|
continue;
|
|
374
358
|
count++;
|
|
375
|
-
todos.push({
|
|
376
|
-
file,
|
|
377
|
-
created: createdMatch ? createdMatch[1].trim() : 'unknown',
|
|
378
|
-
title: titleMatch ? titleMatch[1].trim() : 'Untitled',
|
|
379
|
-
area: todoArea,
|
|
380
|
-
path: node_path_1.default.join('.planning', 'todos', 'pending', file),
|
|
381
|
-
});
|
|
359
|
+
todos.push({ file, created: createdMatch ? createdMatch[1].trim() : 'unknown', title: titleMatch ? titleMatch[1].trim() : 'Untitled', area: todoArea, path: node_path_1.default.join('.planning', 'todos', 'pending', file) });
|
|
382
360
|
}
|
|
383
361
|
catch (e) {
|
|
384
|
-
/* optional op, ignore */
|
|
385
362
|
(0, core_js_1.debugLog)(e);
|
|
386
363
|
}
|
|
387
364
|
}
|
|
388
365
|
}
|
|
389
366
|
catch (e) {
|
|
390
|
-
/* optional op, ignore */
|
|
391
367
|
(0, core_js_1.debugLog)(e);
|
|
392
368
|
}
|
|
393
369
|
const result = {
|
|
@@ -403,9 +379,9 @@ function cmdInitTodos(cwd, area, raw) {
|
|
|
403
379
|
todos_dir_exists: (0, core_js_1.pathExistsInternal)(cwd, '.planning/todos'),
|
|
404
380
|
pending_dir_exists: (0, core_js_1.pathExistsInternal)(cwd, '.planning/todos/pending'),
|
|
405
381
|
};
|
|
406
|
-
(0,
|
|
382
|
+
return (0, types_js_1.cmdOk)(result);
|
|
407
383
|
}
|
|
408
|
-
function cmdInitMilestoneOp(cwd
|
|
384
|
+
function cmdInitMilestoneOp(cwd) {
|
|
409
385
|
const config = (0, core_js_1.loadConfig)(cwd);
|
|
410
386
|
const milestone = (0, core_js_1.getMilestoneInfo)(cwd);
|
|
411
387
|
let phaseCount = 0;
|
|
@@ -417,18 +393,15 @@ function cmdInitMilestoneOp(cwd, raw) {
|
|
|
417
393
|
for (const dir of dirs) {
|
|
418
394
|
try {
|
|
419
395
|
const phaseFiles = node_fs_1.default.readdirSync(node_path_1.default.join(phasesDir, dir));
|
|
420
|
-
|
|
421
|
-
if (hasSummary)
|
|
396
|
+
if (phaseFiles.some(f => (0, core_js_1.isSummaryFile)(f)))
|
|
422
397
|
completedPhases++;
|
|
423
398
|
}
|
|
424
399
|
catch (e) {
|
|
425
|
-
/* optional op, ignore */
|
|
426
400
|
(0, core_js_1.debugLog)(e);
|
|
427
401
|
}
|
|
428
402
|
}
|
|
429
403
|
}
|
|
430
404
|
catch (e) {
|
|
431
|
-
/* optional op, ignore */
|
|
432
405
|
(0, core_js_1.debugLog)(e);
|
|
433
406
|
}
|
|
434
407
|
const archiveDir = (0, core_js_1.planningPath)(cwd, 'archive');
|
|
@@ -437,7 +410,6 @@ function cmdInitMilestoneOp(cwd, raw) {
|
|
|
437
410
|
archivedMilestones = (0, core_js_1.listSubDirs)(archiveDir);
|
|
438
411
|
}
|
|
439
412
|
catch (e) {
|
|
440
|
-
/* optional op, ignore */
|
|
441
413
|
(0, core_js_1.debugLog)(e);
|
|
442
414
|
}
|
|
443
415
|
const result = {
|
|
@@ -456,9 +428,9 @@ function cmdInitMilestoneOp(cwd, raw) {
|
|
|
456
428
|
archive_exists: (0, core_js_1.pathExistsInternal)(cwd, '.planning/archive'),
|
|
457
429
|
phases_dir_exists: (0, core_js_1.pathExistsInternal)(cwd, '.planning/phases'),
|
|
458
430
|
};
|
|
459
|
-
(0,
|
|
431
|
+
return (0, types_js_1.cmdOk)(result);
|
|
460
432
|
}
|
|
461
|
-
function cmdInitMapCodebase(cwd
|
|
433
|
+
function cmdInitMapCodebase(cwd) {
|
|
462
434
|
const config = (0, core_js_1.loadConfig)(cwd);
|
|
463
435
|
const codebaseDir = (0, core_js_1.planningPath)(cwd, 'codebase');
|
|
464
436
|
let existingMaps = [];
|
|
@@ -466,7 +438,6 @@ function cmdInitMapCodebase(cwd, raw) {
|
|
|
466
438
|
existingMaps = node_fs_1.default.readdirSync(codebaseDir).filter(f => f.endsWith('.md'));
|
|
467
439
|
}
|
|
468
440
|
catch (e) {
|
|
469
|
-
/* optional op, ignore */
|
|
470
441
|
(0, core_js_1.debugLog)(e);
|
|
471
442
|
}
|
|
472
443
|
const result = {
|
|
@@ -480,39 +451,20 @@ function cmdInitMapCodebase(cwd, raw) {
|
|
|
480
451
|
planning_exists: (0, core_js_1.pathExistsInternal)(cwd, '.planning'),
|
|
481
452
|
codebase_dir_exists: (0, core_js_1.pathExistsInternal)(cwd, '.planning/codebase'),
|
|
482
453
|
};
|
|
483
|
-
(0,
|
|
454
|
+
return (0, types_js_1.cmdOk)(result);
|
|
484
455
|
}
|
|
485
|
-
function cmdInitExisting(cwd
|
|
456
|
+
function cmdInitExisting(cwd) {
|
|
486
457
|
const config = (0, core_js_1.loadConfig)(cwd);
|
|
487
458
|
const homedir = node_os_1.default.homedir();
|
|
488
459
|
const braveKeyFile = node_path_1.default.join(homedir, '.maxsim', 'brave_api_key');
|
|
489
460
|
const hasBraveSearch = !!(process.env.BRAVE_API_KEY || node_fs_1.default.existsSync(braveKeyFile));
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
let hasPackageFile = false;
|
|
493
|
-
try {
|
|
494
|
-
const files = (0, node_child_process_1.execSync)('find . -maxdepth 3 \\( -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.swift" -o -name "*.java" \\) 2>/dev/null | grep -v node_modules | grep -v .git | head -5', { cwd, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] });
|
|
495
|
-
hasCode = files.trim().length > 0;
|
|
496
|
-
}
|
|
497
|
-
catch (e) {
|
|
498
|
-
(0, core_js_1.debugLog)(e);
|
|
499
|
-
}
|
|
500
|
-
hasPackageFile =
|
|
501
|
-
(0, core_js_1.pathExistsInternal)(cwd, 'package.json') ||
|
|
502
|
-
(0, core_js_1.pathExistsInternal)(cwd, 'requirements.txt') ||
|
|
503
|
-
(0, core_js_1.pathExistsInternal)(cwd, 'Cargo.toml') ||
|
|
504
|
-
(0, core_js_1.pathExistsInternal)(cwd, 'go.mod') ||
|
|
505
|
-
(0, core_js_1.pathExistsInternal)(cwd, 'Package.swift');
|
|
506
|
-
// Detect existing .planning/ content for conflict dialog
|
|
461
|
+
const hasCode = findCodeFiles(cwd).length > 0;
|
|
462
|
+
const hasPackageFile = (0, core_js_1.pathExistsInternal)(cwd, 'package.json') || (0, core_js_1.pathExistsInternal)(cwd, 'requirements.txt') || (0, core_js_1.pathExistsInternal)(cwd, 'Cargo.toml') || (0, core_js_1.pathExistsInternal)(cwd, 'go.mod') || (0, core_js_1.pathExistsInternal)(cwd, 'Package.swift');
|
|
507
463
|
let planningFiles = [];
|
|
508
464
|
try {
|
|
509
465
|
const planDir = (0, core_js_1.planningPath)(cwd);
|
|
510
|
-
if (node_fs_1.default.existsSync(planDir))
|
|
511
|
-
planningFiles = node_fs_1.default
|
|
512
|
-
.readdirSync(planDir, { recursive: true })
|
|
513
|
-
.map((f) => String(f))
|
|
514
|
-
.filter((f) => !f.startsWith('.'));
|
|
515
|
-
}
|
|
466
|
+
if (node_fs_1.default.existsSync(planDir))
|
|
467
|
+
planningFiles = node_fs_1.default.readdirSync(planDir, { recursive: true }).map((f) => String(f)).filter((f) => !f.startsWith('.'));
|
|
516
468
|
}
|
|
517
469
|
catch (e) {
|
|
518
470
|
(0, core_js_1.debugLog)(e);
|
|
@@ -538,9 +490,9 @@ function cmdInitExisting(cwd, raw) {
|
|
|
538
490
|
project_path: '.planning/PROJECT.md',
|
|
539
491
|
codebase_dir: '.planning/codebase',
|
|
540
492
|
};
|
|
541
|
-
(0,
|
|
493
|
+
return (0, types_js_1.cmdOk)(result);
|
|
542
494
|
}
|
|
543
|
-
function cmdInitProgress(cwd
|
|
495
|
+
function cmdInitProgress(cwd) {
|
|
544
496
|
const config = (0, core_js_1.loadConfig)(cwd);
|
|
545
497
|
const milestone = (0, core_js_1.getMilestoneInfo)(cwd);
|
|
546
498
|
const progressPhasesDir = (0, core_js_1.phasesPath)(cwd);
|
|
@@ -555,32 +507,19 @@ function cmdInitProgress(cwd, raw) {
|
|
|
555
507
|
const phaseName = match && match[2] ? match[2] : null;
|
|
556
508
|
const phaseDirPath = node_path_1.default.join(progressPhasesDir, dir);
|
|
557
509
|
const phaseFiles = node_fs_1.default.readdirSync(phaseDirPath);
|
|
558
|
-
const
|
|
510
|
+
const plansList = phaseFiles.filter(f => (0, core_js_1.isPlanFile)(f));
|
|
559
511
|
const summaries = phaseFiles.filter(f => (0, core_js_1.isSummaryFile)(f));
|
|
560
512
|
const hasResearch = phaseFiles.some(f => f.endsWith('-RESEARCH.md') || f === 'RESEARCH.md');
|
|
561
|
-
const status = summaries.length >=
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
status,
|
|
569
|
-
plan_count: plans.length,
|
|
570
|
-
summary_count: summaries.length,
|
|
571
|
-
has_research: hasResearch,
|
|
572
|
-
};
|
|
573
|
-
phases.push(phaseInfo);
|
|
574
|
-
if (!currentPhase && (status === 'in_progress' || status === 'researched')) {
|
|
575
|
-
currentPhase = phaseInfo;
|
|
576
|
-
}
|
|
577
|
-
if (!nextPhase && status === 'pending') {
|
|
578
|
-
nextPhase = phaseInfo;
|
|
579
|
-
}
|
|
513
|
+
const status = summaries.length >= plansList.length && plansList.length > 0 ? 'complete' : plansList.length > 0 ? 'in_progress' : hasResearch ? 'researched' : 'pending';
|
|
514
|
+
const phaseInfoItem = { number: phaseNumber, name: phaseName, directory: node_path_1.default.join('.planning', 'phases', dir), status, plan_count: plansList.length, summary_count: summaries.length, has_research: hasResearch };
|
|
515
|
+
phases.push(phaseInfoItem);
|
|
516
|
+
if (!currentPhase && (status === 'in_progress' || status === 'researched'))
|
|
517
|
+
currentPhase = phaseInfoItem;
|
|
518
|
+
if (!nextPhase && status === 'pending')
|
|
519
|
+
nextPhase = phaseInfoItem;
|
|
580
520
|
}
|
|
581
521
|
}
|
|
582
522
|
catch (e) {
|
|
583
|
-
/* optional op, ignore */
|
|
584
523
|
(0, core_js_1.debugLog)(e);
|
|
585
524
|
}
|
|
586
525
|
let pausedAt = null;
|
|
@@ -591,7 +530,6 @@ function cmdInitProgress(cwd, raw) {
|
|
|
591
530
|
pausedAt = pauseMatch[1].trim();
|
|
592
531
|
}
|
|
593
532
|
catch (e) {
|
|
594
|
-
/* optional op, ignore */
|
|
595
533
|
(0, core_js_1.debugLog)(e);
|
|
596
534
|
}
|
|
597
535
|
const result = {
|
|
@@ -616,6 +554,6 @@ function cmdInitProgress(cwd, raw) {
|
|
|
616
554
|
project_path: '.planning/PROJECT.md',
|
|
617
555
|
config_path: '.planning/config.json',
|
|
618
556
|
};
|
|
619
|
-
(0,
|
|
557
|
+
return (0, types_js_1.cmdOk)(result);
|
|
620
558
|
}
|
|
621
559
|
//# sourceMappingURL=init.js.map
|