@mobiman/vector 1.1.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/LICENSE +21 -0
- package/README.md +117 -0
- package/agents/vector-codebase-mapper.md +770 -0
- package/agents/vector-debugger.md +1338 -0
- package/agents/vector-executor.md +487 -0
- package/agents/vector-integration-checker.md +443 -0
- package/agents/vector-nyquist-auditor.md +176 -0
- package/agents/vector-phase-researcher.md +553 -0
- package/agents/vector-plan-checker.md +706 -0
- package/agents/vector-planner.md +1307 -0
- package/agents/vector-project-researcher.md +629 -0
- package/agents/vector-research-synthesizer.md +247 -0
- package/agents/vector-roadmapper.md +650 -0
- package/agents/vector-ui-auditor.md +439 -0
- package/agents/vector-ui-checker.md +300 -0
- package/agents/vector-ui-researcher.md +353 -0
- package/agents/vector-verifier.md +579 -0
- package/bin/install.cjs +2907 -0
- package/bin/install.cjs.map +1 -0
- package/bin/install.cts +3103 -0
- package/bin/install.d.cts +3 -0
- package/bin/install.d.cts.map +1 -0
- package/commands/vector/add-phase.md +43 -0
- package/commands/vector/add-tests.md +41 -0
- package/commands/vector/add-todo.md +47 -0
- package/commands/vector/audit-milestone.md +36 -0
- package/commands/vector/autonomous.md +41 -0
- package/commands/vector/check-todos.md +45 -0
- package/commands/vector/cleanup.md +18 -0
- package/commands/vector/complete-milestone.md +136 -0
- package/commands/vector/debug.md +168 -0
- package/commands/vector/discuss-phase.md +90 -0
- package/commands/vector/do.md +30 -0
- package/commands/vector/execute-phase.md +41 -0
- package/commands/vector/health.md +22 -0
- package/commands/vector/help.md +22 -0
- package/commands/vector/insert-phase.md +32 -0
- package/commands/vector/join-discord.md +18 -0
- package/commands/vector/list-phase-assumptions.md +46 -0
- package/commands/vector/map-codebase.md +71 -0
- package/commands/vector/new-milestone.md +44 -0
- package/commands/vector/new-project.md +42 -0
- package/commands/vector/pause-work.md +38 -0
- package/commands/vector/plan-milestone-gaps.md +34 -0
- package/commands/vector/plan-phase.md +45 -0
- package/commands/vector/progress.md +24 -0
- package/commands/vector/quick.md +47 -0
- package/commands/vector/reapply-patches.md +123 -0
- package/commands/vector/remove-phase.md +31 -0
- package/commands/vector/research-phase.md +190 -0
- package/commands/vector/resume-work.md +40 -0
- package/commands/vector/set-profile.md +12 -0
- package/commands/vector/settings.md +36 -0
- package/commands/vector/stats.md +18 -0
- package/commands/vector/ui-phase.md +34 -0
- package/commands/vector/ui-review.md +32 -0
- package/commands/vector/update.md +37 -0
- package/commands/vector/validate-phase.md +35 -0
- package/commands/vector/verify-work.md +38 -0
- package/core/bin/lib/commands.cjs +641 -0
- package/core/bin/lib/commands.cjs.map +1 -0
- package/core/bin/lib/commands.cts +712 -0
- package/core/bin/lib/commands.d.cts +23 -0
- package/core/bin/lib/commands.d.cts.map +1 -0
- package/core/bin/lib/config.cjs +281 -0
- package/core/bin/lib/config.cjs.map +1 -0
- package/core/bin/lib/config.cts +301 -0
- package/core/bin/lib/config.d.cts +50 -0
- package/core/bin/lib/config.d.cts.map +1 -0
- package/core/bin/lib/core.cjs +483 -0
- package/core/bin/lib/core.cjs.map +1 -0
- package/core/bin/lib/core.cts +544 -0
- package/core/bin/lib/core.d.cts +96 -0
- package/core/bin/lib/core.d.cts.map +1 -0
- package/core/bin/lib/frontmatter.cjs +341 -0
- package/core/bin/lib/frontmatter.cjs.map +1 -0
- package/core/bin/lib/frontmatter.cts +295 -0
- package/core/bin/lib/frontmatter.d.cts +18 -0
- package/core/bin/lib/frontmatter.d.cts.map +1 -0
- package/core/bin/lib/init.cjs +674 -0
- package/core/bin/lib/init.cjs.map +1 -0
- package/core/bin/lib/init.cts +775 -0
- package/core/bin/lib/init.d.cts +16 -0
- package/core/bin/lib/init.d.cts.map +1 -0
- package/core/bin/lib/milestone.cjs +210 -0
- package/core/bin/lib/milestone.cjs.map +1 -0
- package/core/bin/lib/milestone.cts +241 -0
- package/core/bin/lib/milestone.d.cts +11 -0
- package/core/bin/lib/milestone.d.cts.map +1 -0
- package/core/bin/lib/model-profiles.cjs +62 -0
- package/core/bin/lib/model-profiles.cjs.map +1 -0
- package/core/bin/lib/model-profiles.cts +66 -0
- package/core/bin/lib/model-profiles.d.cts +33 -0
- package/core/bin/lib/model-profiles.d.cts.map +1 -0
- package/core/bin/lib/phase.cjs +713 -0
- package/core/bin/lib/phase.cjs.map +1 -0
- package/core/bin/lib/phase.cts +914 -0
- package/core/bin/lib/phase.d.cts +21 -0
- package/core/bin/lib/phase.d.cts.map +1 -0
- package/core/bin/lib/roadmap.cjs +246 -0
- package/core/bin/lib/roadmap.cjs.map +1 -0
- package/core/bin/lib/roadmap.cts +311 -0
- package/core/bin/lib/roadmap.d.cts +7 -0
- package/core/bin/lib/roadmap.d.cts.map +1 -0
- package/core/bin/lib/state.cjs +709 -0
- package/core/bin/lib/state.cjs.map +1 -0
- package/core/bin/lib/state.cts +718 -0
- package/core/bin/lib/state.d.cts +47 -0
- package/core/bin/lib/state.d.cts.map +1 -0
- package/core/bin/lib/template.cjs +220 -0
- package/core/bin/lib/template.cjs.map +1 -0
- package/core/bin/lib/template.cts +229 -0
- package/core/bin/lib/template.d.cts +15 -0
- package/core/bin/lib/template.d.cts.map +1 -0
- package/core/bin/lib/verify.cjs +824 -0
- package/core/bin/lib/verify.cjs.map +1 -0
- package/core/bin/lib/verify.cts +829 -0
- package/core/bin/lib/verify.d.cts +17 -0
- package/core/bin/lib/verify.d.cts.map +1 -0
- package/core/bin/vector-tools.cjs +641 -0
- package/core/bin/vector-tools.cjs.map +1 -0
- package/core/bin/vector-tools.cts +603 -0
- package/core/bin/vector-tools.d.cts +128 -0
- package/core/bin/vector-tools.d.cts.map +1 -0
- package/core/references/checkpoints.md +776 -0
- package/core/references/continuation-format.md +249 -0
- package/core/references/decimal-phase-calculation.md +65 -0
- package/core/references/git-integration.md +248 -0
- package/core/references/git-planning-commit.md +38 -0
- package/core/references/model-profile-resolution.md +36 -0
- package/core/references/model-profiles.md +101 -0
- package/core/references/phase-argument-parsing.md +61 -0
- package/core/references/planning-config.md +200 -0
- package/core/references/questioning.md +162 -0
- package/core/references/tdd.md +263 -0
- package/core/references/ui-brand.md +160 -0
- package/core/references/verification-patterns.md +612 -0
- package/core/templates/DEBUG.md +164 -0
- package/core/templates/UAT.md +247 -0
- package/core/templates/UI-SPEC.md +100 -0
- package/core/templates/VALIDATION.md +76 -0
- package/core/templates/codebase/architecture.md +255 -0
- package/core/templates/codebase/concerns.md +310 -0
- package/core/templates/codebase/conventions.md +307 -0
- package/core/templates/codebase/integrations.md +280 -0
- package/core/templates/codebase/stack.md +186 -0
- package/core/templates/codebase/structure.md +285 -0
- package/core/templates/codebase/testing.md +480 -0
- package/core/templates/config.json +37 -0
- package/core/templates/context.md +352 -0
- package/core/templates/continue-here.md +78 -0
- package/core/templates/copilot-instructions.md +7 -0
- package/core/templates/debug-subagent-prompt.md +91 -0
- package/core/templates/discovery.md +146 -0
- package/core/templates/milestone-archive.md +123 -0
- package/core/templates/milestone.md +115 -0
- package/core/templates/phase-prompt.md +610 -0
- package/core/templates/planner-subagent-prompt.md +117 -0
- package/core/templates/project.md +184 -0
- package/core/templates/requirements.md +231 -0
- package/core/templates/research-project/ARCHITECTURE.md +204 -0
- package/core/templates/research-project/FEATURES.md +147 -0
- package/core/templates/research-project/PITFALLS.md +200 -0
- package/core/templates/research-project/STACK.md +120 -0
- package/core/templates/research-project/SUMMARY.md +170 -0
- package/core/templates/research.md +552 -0
- package/core/templates/retrospective.md +54 -0
- package/core/templates/roadmap.md +202 -0
- package/core/templates/state.md +176 -0
- package/core/templates/summary-complex.md +59 -0
- package/core/templates/summary-minimal.md +41 -0
- package/core/templates/summary-standard.md +48 -0
- package/core/templates/summary.md +248 -0
- package/core/templates/user-setup.md +311 -0
- package/core/templates/verification-report.md +322 -0
- package/core/workflows/add-phase.md +112 -0
- package/core/workflows/add-tests.md +351 -0
- package/core/workflows/add-todo.md +158 -0
- package/core/workflows/audit-milestone.md +332 -0
- package/core/workflows/autonomous.md +743 -0
- package/core/workflows/check-todos.md +177 -0
- package/core/workflows/cleanup.md +152 -0
- package/core/workflows/complete-milestone.md +766 -0
- package/core/workflows/diagnose-issues.md +219 -0
- package/core/workflows/discovery-phase.md +289 -0
- package/core/workflows/discuss-phase.md +762 -0
- package/core/workflows/do.md +104 -0
- package/core/workflows/execute-phase.md +468 -0
- package/core/workflows/execute-plan.md +483 -0
- package/core/workflows/health.md +159 -0
- package/core/workflows/help.md +513 -0
- package/core/workflows/insert-phase.md +130 -0
- package/core/workflows/list-phase-assumptions.md +178 -0
- package/core/workflows/map-codebase.md +316 -0
- package/core/workflows/new-milestone.md +386 -0
- package/core/workflows/new-project.md +1113 -0
- package/core/workflows/node-repair.md +92 -0
- package/core/workflows/pause-work.md +122 -0
- package/core/workflows/plan-milestone-gaps.md +274 -0
- package/core/workflows/plan-phase.md +666 -0
- package/core/workflows/progress.md +382 -0
- package/core/workflows/quick.md +717 -0
- package/core/workflows/remove-phase.md +155 -0
- package/core/workflows/research-phase.md +74 -0
- package/core/workflows/resume-project.md +307 -0
- package/core/workflows/settings.md +243 -0
- package/core/workflows/stats.md +60 -0
- package/core/workflows/transition.md +544 -0
- package/core/workflows/ui-phase.md +290 -0
- package/core/workflows/ui-review.md +157 -0
- package/core/workflows/update.md +320 -0
- package/core/workflows/validate-phase.md +167 -0
- package/core/workflows/verify-phase.md +243 -0
- package/core/workflows/verify-work.md +584 -0
- package/package.json +55 -0
- package/scripts/build-hooks.cjs +38 -0
- package/scripts/build-hooks.cjs.map +1 -0
- package/scripts/build-hooks.cts +41 -0
- package/scripts/build-hooks.d.cts +6 -0
- package/scripts/build-hooks.d.cts.map +1 -0
- package/scripts/run-tests.cjs +28 -0
- package/scripts/run-tests.cjs.map +1 -0
- package/scripts/run-tests.cts +28 -0
- package/scripts/run-tests.d.cts +3 -0
- package/scripts/run-tests.d.cts.map +1 -0
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core — Shared utilities, constants, and internal helpers
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import os from 'os';
|
|
8
|
+
import { execSync, spawnSync } from 'child_process';
|
|
9
|
+
import { MODEL_PROFILES } from './model-profiles.cjs';
|
|
10
|
+
|
|
11
|
+
// ─── PhaseFilter interface ────────────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
export interface PhaseFilter {
|
|
14
|
+
(dirName: string): boolean;
|
|
15
|
+
phaseCount: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// ─── Config types ─────────────────────────────────────────────────────────────
|
|
19
|
+
|
|
20
|
+
export interface VectorConfig {
|
|
21
|
+
model_profile: string;
|
|
22
|
+
commit_docs: boolean;
|
|
23
|
+
search_gitignored: boolean;
|
|
24
|
+
branching_strategy: string;
|
|
25
|
+
phase_branch_template: string;
|
|
26
|
+
milestone_branch_template: string;
|
|
27
|
+
research: boolean;
|
|
28
|
+
plan_checker: boolean;
|
|
29
|
+
verifier: boolean;
|
|
30
|
+
nyquist_validation: boolean;
|
|
31
|
+
parallelization: boolean;
|
|
32
|
+
brave_search: boolean;
|
|
33
|
+
model_overrides: Record<string, string> | null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// ─── Path helpers ────────────────────────────────────────────────────────────
|
|
37
|
+
|
|
38
|
+
/** Normalize a relative path to always use forward slashes (cross-platform). */
|
|
39
|
+
export function toPosixPath(p: string): string {
|
|
40
|
+
return p.split(path.sep).join('/');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ─── Output helpers ───────────────────────────────────────────────────────────
|
|
44
|
+
|
|
45
|
+
export function output(result: unknown, raw?: boolean, rawValue?: unknown): void {
|
|
46
|
+
if (raw && rawValue !== undefined) {
|
|
47
|
+
process.stdout.write(String(rawValue));
|
|
48
|
+
} else {
|
|
49
|
+
const json = JSON.stringify(result, null, 2);
|
|
50
|
+
// Large payloads exceed Claude Code's Bash tool buffer (~50KB).
|
|
51
|
+
// Write to tmpfile and output the path prefixed with @file: so callers can detect it.
|
|
52
|
+
if (json.length > 50000) {
|
|
53
|
+
const tmpPath = path.join(os.tmpdir(), `vector-${Date.now()}.json`);
|
|
54
|
+
fs.writeFileSync(tmpPath, json, 'utf-8');
|
|
55
|
+
process.stdout.write('@file:' + tmpPath);
|
|
56
|
+
} else {
|
|
57
|
+
process.stdout.write(json);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
process.exit(0);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function error(message: string): never {
|
|
64
|
+
process.stderr.write('Error: ' + message + '\n');
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ─── File & Config utilities ──────────────────────────────────────────────────
|
|
69
|
+
|
|
70
|
+
export function safeReadFile(filePath: string): string | null {
|
|
71
|
+
try {
|
|
72
|
+
return fs.readFileSync(filePath, 'utf-8');
|
|
73
|
+
} catch {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function loadConfig(cwd: string): VectorConfig {
|
|
79
|
+
const configPath = path.join(cwd, '.planning', 'config.json');
|
|
80
|
+
const defaults: VectorConfig = {
|
|
81
|
+
model_profile: 'balanced',
|
|
82
|
+
commit_docs: true,
|
|
83
|
+
search_gitignored: false,
|
|
84
|
+
branching_strategy: 'none',
|
|
85
|
+
phase_branch_template: 'vector/phase-{phase}-{slug}',
|
|
86
|
+
milestone_branch_template: 'vector/{milestone}-{slug}',
|
|
87
|
+
research: true,
|
|
88
|
+
plan_checker: true,
|
|
89
|
+
verifier: true,
|
|
90
|
+
nyquist_validation: true,
|
|
91
|
+
parallelization: true,
|
|
92
|
+
brave_search: false,
|
|
93
|
+
model_overrides: null,
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
try {
|
|
97
|
+
const raw = fs.readFileSync(configPath, 'utf-8');
|
|
98
|
+
const parsed: Record<string, unknown> = JSON.parse(raw);
|
|
99
|
+
|
|
100
|
+
// Migrate deprecated "depth" key to "granularity" with value mapping
|
|
101
|
+
if ('depth' in parsed && !('granularity' in parsed)) {
|
|
102
|
+
const depthToGranularity: Record<string, string> = { quick: 'coarse', standard: 'standard', comprehensive: 'fine' };
|
|
103
|
+
parsed.granularity = depthToGranularity[parsed.depth as string] || parsed.depth;
|
|
104
|
+
delete parsed.depth;
|
|
105
|
+
try { fs.writeFileSync(configPath, JSON.stringify(parsed, null, 2), 'utf-8'); } catch {}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const get = (key: string, nested?: { section: string; field: string }): unknown => {
|
|
109
|
+
if (parsed[key] !== undefined) return parsed[key];
|
|
110
|
+
if (nested) {
|
|
111
|
+
const section = parsed[nested.section];
|
|
112
|
+
if (section && typeof section === 'object' && section !== null) {
|
|
113
|
+
const sectionObj = section as Record<string, unknown>;
|
|
114
|
+
if (sectionObj[nested.field] !== undefined) {
|
|
115
|
+
return sectionObj[nested.field];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return undefined;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const parallelization = (() => {
|
|
123
|
+
const val = get('parallelization');
|
|
124
|
+
if (typeof val === 'boolean') return val;
|
|
125
|
+
if (typeof val === 'object' && val !== null && 'enabled' in val) return (val as Record<string, unknown>).enabled as boolean;
|
|
126
|
+
return defaults.parallelization;
|
|
127
|
+
})();
|
|
128
|
+
|
|
129
|
+
return {
|
|
130
|
+
model_profile: (get('model_profile') ?? defaults.model_profile) as string,
|
|
131
|
+
commit_docs: (get('commit_docs', { section: 'planning', field: 'commit_docs' }) ?? defaults.commit_docs) as boolean,
|
|
132
|
+
search_gitignored: (get('search_gitignored', { section: 'planning', field: 'search_gitignored' }) ?? defaults.search_gitignored) as boolean,
|
|
133
|
+
branching_strategy: (get('branching_strategy', { section: 'git', field: 'branching_strategy' }) ?? defaults.branching_strategy) as string,
|
|
134
|
+
phase_branch_template: (get('phase_branch_template', { section: 'git', field: 'phase_branch_template' }) ?? defaults.phase_branch_template) as string,
|
|
135
|
+
milestone_branch_template: (get('milestone_branch_template', { section: 'git', field: 'milestone_branch_template' }) ?? defaults.milestone_branch_template) as string,
|
|
136
|
+
research: (get('research', { section: 'workflow', field: 'research' }) ?? defaults.research) as boolean,
|
|
137
|
+
plan_checker: (get('plan_checker', { section: 'workflow', field: 'plan_check' }) ?? defaults.plan_checker) as boolean,
|
|
138
|
+
verifier: (get('verifier', { section: 'workflow', field: 'verifier' }) ?? defaults.verifier) as boolean,
|
|
139
|
+
nyquist_validation: (get('nyquist_validation', { section: 'workflow', field: 'nyquist_validation' }) ?? defaults.nyquist_validation) as boolean,
|
|
140
|
+
parallelization,
|
|
141
|
+
brave_search: (get('brave_search') ?? defaults.brave_search) as boolean,
|
|
142
|
+
model_overrides: (parsed.model_overrides as Record<string, string>) || null,
|
|
143
|
+
};
|
|
144
|
+
} catch {
|
|
145
|
+
return defaults;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// ─── Git utilities ────────────────────────────────────────────────────────────
|
|
150
|
+
|
|
151
|
+
export function isGitIgnored(cwd: string, targetPath: string): boolean {
|
|
152
|
+
try {
|
|
153
|
+
// --no-index checks .gitignore rules regardless of whether the file is tracked.
|
|
154
|
+
// Without it, git check-ignore returns "not ignored" for tracked files even when
|
|
155
|
+
// .gitignore explicitly lists them — a common source of confusion when .planning/
|
|
156
|
+
// was committed before being added to .gitignore.
|
|
157
|
+
execSync('git check-ignore -q --no-index -- ' + targetPath.replace(/[^a-zA-Z0-9._\-/]/g, ''), {
|
|
158
|
+
cwd,
|
|
159
|
+
stdio: 'pipe',
|
|
160
|
+
});
|
|
161
|
+
return true;
|
|
162
|
+
} catch {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function execGit(cwd: string, args: string[]): { exitCode: number; stdout: string; stderr: string } {
|
|
168
|
+
const result = spawnSync('git', args, {
|
|
169
|
+
cwd,
|
|
170
|
+
stdio: 'pipe',
|
|
171
|
+
encoding: 'utf-8',
|
|
172
|
+
});
|
|
173
|
+
return {
|
|
174
|
+
exitCode: result.status ?? 1,
|
|
175
|
+
stdout: (result.stdout ?? '').toString().trim(),
|
|
176
|
+
stderr: (result.stderr ?? '').toString().trim(),
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// ─── Phase utilities ──────────────────────────────────────────────────────────
|
|
181
|
+
|
|
182
|
+
export function escapeRegex(value: unknown): string {
|
|
183
|
+
return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export function normalizePhaseName(phase: unknown): string {
|
|
187
|
+
const match = String(phase).match(/^(\d+)([A-Z])?((?:\.\d+)*)/i);
|
|
188
|
+
if (!match) return String(phase);
|
|
189
|
+
const padded = match[1].padStart(2, '0');
|
|
190
|
+
const letter = match[2] ? match[2].toUpperCase() : '';
|
|
191
|
+
const decimal = match[3] || '';
|
|
192
|
+
return padded + letter + decimal;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export function comparePhaseNum(a: unknown, b: unknown): number {
|
|
196
|
+
const pa = String(a).match(/^(\d+)([A-Z])?((?:\.\d+)*)/i);
|
|
197
|
+
const pb = String(b).match(/^(\d+)([A-Z])?((?:\.\d+)*)/i);
|
|
198
|
+
if (!pa || !pb) return String(a).localeCompare(String(b));
|
|
199
|
+
const intDiff = parseInt(pa[1], 10) - parseInt(pb[1], 10);
|
|
200
|
+
if (intDiff !== 0) return intDiff;
|
|
201
|
+
// No letter sorts before letter: 12 < 12A < 12B
|
|
202
|
+
const la = (pa[2] || '').toUpperCase();
|
|
203
|
+
const lb = (pb[2] || '').toUpperCase();
|
|
204
|
+
if (la !== lb) {
|
|
205
|
+
if (!la) return -1;
|
|
206
|
+
if (!lb) return 1;
|
|
207
|
+
return la < lb ? -1 : 1;
|
|
208
|
+
}
|
|
209
|
+
// Segment-by-segment decimal comparison: 12A < 12A.1 < 12A.1.2 < 12A.2
|
|
210
|
+
const aDecParts = pa[3] ? pa[3].slice(1).split('.').map(p => parseInt(p, 10)) : [];
|
|
211
|
+
const bDecParts = pb[3] ? pb[3].slice(1).split('.').map(p => parseInt(p, 10)) : [];
|
|
212
|
+
const maxLen = Math.max(aDecParts.length, bDecParts.length);
|
|
213
|
+
if (aDecParts.length === 0 && bDecParts.length > 0) return -1;
|
|
214
|
+
if (bDecParts.length === 0 && aDecParts.length > 0) return 1;
|
|
215
|
+
for (let i = 0; i < maxLen; i++) {
|
|
216
|
+
const av = Number.isFinite(aDecParts[i]) ? aDecParts[i] : 0;
|
|
217
|
+
const bv = Number.isFinite(bDecParts[i]) ? bDecParts[i] : 0;
|
|
218
|
+
if (av !== bv) return av - bv;
|
|
219
|
+
}
|
|
220
|
+
return 0;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface PhaseInfo {
|
|
224
|
+
found: boolean;
|
|
225
|
+
directory: string | null;
|
|
226
|
+
phase_number: string;
|
|
227
|
+
phase_name: string | null;
|
|
228
|
+
phase_slug: string | null;
|
|
229
|
+
plans: string[];
|
|
230
|
+
summaries: string[];
|
|
231
|
+
incomplete_plans: string[];
|
|
232
|
+
has_research: boolean;
|
|
233
|
+
has_context: boolean;
|
|
234
|
+
has_verification: boolean;
|
|
235
|
+
archived?: string;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export function searchPhaseInDir(baseDir: string, relBase: string, normalized: string): PhaseInfo | null {
|
|
239
|
+
try {
|
|
240
|
+
const entries = fs.readdirSync(baseDir, { withFileTypes: true });
|
|
241
|
+
const dirs = entries.filter(e => e.isDirectory()).map(e => e.name).sort((a, b) => comparePhaseNum(a, b));
|
|
242
|
+
const match = dirs.find(d => d.startsWith(normalized));
|
|
243
|
+
if (!match) return null;
|
|
244
|
+
|
|
245
|
+
const dirMatch = match.match(/^(\d+[A-Z]?(?:\.\d+)*)-?(.*)/i);
|
|
246
|
+
const phaseNumber = dirMatch ? dirMatch[1] : normalized;
|
|
247
|
+
const phaseName = dirMatch && dirMatch[2] ? dirMatch[2] : null;
|
|
248
|
+
const phaseDir = path.join(baseDir, match);
|
|
249
|
+
const phaseFiles = fs.readdirSync(phaseDir);
|
|
250
|
+
|
|
251
|
+
const plans = phaseFiles.filter(f => f.endsWith('-PLAN.md') || f === 'PLAN.md').sort();
|
|
252
|
+
const summaries = phaseFiles.filter(f => f.endsWith('-SUMMARY.md') || f === 'SUMMARY.md').sort();
|
|
253
|
+
const hasResearch = phaseFiles.some(f => f.endsWith('-RESEARCH.md') || f === 'RESEARCH.md');
|
|
254
|
+
const hasContext = phaseFiles.some(f => f.endsWith('-CONTEXT.md') || f === 'CONTEXT.md');
|
|
255
|
+
const hasVerification = phaseFiles.some(f => f.endsWith('-VERIFICATION.md') || f === 'VERIFICATION.md');
|
|
256
|
+
|
|
257
|
+
const completedPlanIds = new Set(
|
|
258
|
+
summaries.map(s => s.replace('-SUMMARY.md', '').replace('SUMMARY.md', ''))
|
|
259
|
+
);
|
|
260
|
+
const incompletePlans = plans.filter(p => {
|
|
261
|
+
const planId = p.replace('-PLAN.md', '').replace('PLAN.md', '');
|
|
262
|
+
return !completedPlanIds.has(planId);
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
return {
|
|
266
|
+
found: true,
|
|
267
|
+
directory: toPosixPath(path.join(relBase, match)),
|
|
268
|
+
phase_number: phaseNumber,
|
|
269
|
+
phase_name: phaseName,
|
|
270
|
+
phase_slug: phaseName ? phaseName.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') : null,
|
|
271
|
+
plans,
|
|
272
|
+
summaries,
|
|
273
|
+
incomplete_plans: incompletePlans,
|
|
274
|
+
has_research: hasResearch,
|
|
275
|
+
has_context: hasContext,
|
|
276
|
+
has_verification: hasVerification,
|
|
277
|
+
};
|
|
278
|
+
} catch {
|
|
279
|
+
return null;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export function findPhaseInternal(cwd: string, phase: unknown): PhaseInfo | null {
|
|
284
|
+
if (!phase) return null;
|
|
285
|
+
|
|
286
|
+
const phasesDir = path.join(cwd, '.planning', 'phases');
|
|
287
|
+
const normalized = normalizePhaseName(phase);
|
|
288
|
+
|
|
289
|
+
// Search current phases first
|
|
290
|
+
const current = searchPhaseInDir(phasesDir, '.planning/phases', normalized);
|
|
291
|
+
if (current) return current;
|
|
292
|
+
|
|
293
|
+
// Search archived milestone phases (newest first)
|
|
294
|
+
const milestonesDir = path.join(cwd, '.planning', 'milestones');
|
|
295
|
+
if (!fs.existsSync(milestonesDir)) return null;
|
|
296
|
+
|
|
297
|
+
try {
|
|
298
|
+
const milestoneEntries = fs.readdirSync(milestonesDir, { withFileTypes: true });
|
|
299
|
+
const archiveDirs = milestoneEntries
|
|
300
|
+
.filter(e => e.isDirectory() && /^v[\d.]+-phases$/.test(e.name))
|
|
301
|
+
.map(e => e.name)
|
|
302
|
+
.sort()
|
|
303
|
+
.reverse();
|
|
304
|
+
|
|
305
|
+
for (const archiveName of archiveDirs) {
|
|
306
|
+
const versionMatch = archiveName.match(/^(v[\d.]+)-phases$/);
|
|
307
|
+
const version = versionMatch ? versionMatch[1] : archiveName;
|
|
308
|
+
const archivePath = path.join(milestonesDir, archiveName);
|
|
309
|
+
const relBase = '.planning/milestones/' + archiveName;
|
|
310
|
+
const result = searchPhaseInDir(archivePath, relBase, normalized);
|
|
311
|
+
if (result) {
|
|
312
|
+
result.archived = version;
|
|
313
|
+
return result;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
} catch {}
|
|
317
|
+
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export interface ArchivedPhaseDir {
|
|
322
|
+
name: string;
|
|
323
|
+
milestone: string;
|
|
324
|
+
basePath: string;
|
|
325
|
+
fullPath: string;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export function getArchivedPhaseDirs(cwd: string): ArchivedPhaseDir[] {
|
|
329
|
+
const milestonesDir = path.join(cwd, '.planning', 'milestones');
|
|
330
|
+
const results: ArchivedPhaseDir[] = [];
|
|
331
|
+
|
|
332
|
+
if (!fs.existsSync(milestonesDir)) return results;
|
|
333
|
+
|
|
334
|
+
try {
|
|
335
|
+
const milestoneEntries = fs.readdirSync(milestonesDir, { withFileTypes: true });
|
|
336
|
+
// Find v*-phases directories, sort newest first
|
|
337
|
+
const phaseDirs = milestoneEntries
|
|
338
|
+
.filter(e => e.isDirectory() && /^v[\d.]+-phases$/.test(e.name))
|
|
339
|
+
.map(e => e.name)
|
|
340
|
+
.sort()
|
|
341
|
+
.reverse();
|
|
342
|
+
|
|
343
|
+
for (const archiveName of phaseDirs) {
|
|
344
|
+
const versionMatch = archiveName.match(/^(v[\d.]+)-phases$/);
|
|
345
|
+
const version = versionMatch ? versionMatch[1] : archiveName;
|
|
346
|
+
const archivePath = path.join(milestonesDir, archiveName);
|
|
347
|
+
const entries = fs.readdirSync(archivePath, { withFileTypes: true });
|
|
348
|
+
const dirs = entries.filter(e => e.isDirectory()).map(e => e.name).sort((a, b) => comparePhaseNum(a, b));
|
|
349
|
+
|
|
350
|
+
for (const dir of dirs) {
|
|
351
|
+
results.push({
|
|
352
|
+
name: dir,
|
|
353
|
+
milestone: version,
|
|
354
|
+
basePath: path.join('.planning', 'milestones', archiveName),
|
|
355
|
+
fullPath: path.join(archivePath, dir),
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
} catch {}
|
|
360
|
+
|
|
361
|
+
return results;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// ─── Roadmap milestone scoping ───────────────────────────────────────────────
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Strip shipped milestone content wrapped in <details> blocks.
|
|
368
|
+
* Used to isolate current milestone phases when searching ROADMAP.md
|
|
369
|
+
* for phase headings or checkboxes — prevents matching archived milestone
|
|
370
|
+
* phases that share the same numbers as current milestone phases.
|
|
371
|
+
*/
|
|
372
|
+
export function stripShippedMilestones(content: string): string {
|
|
373
|
+
return content.replace(/<details>[\s\S]*?<\/details>/gi, '');
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Replace a pattern only in the current milestone section of ROADMAP.md
|
|
378
|
+
* (everything after the last </details> close tag). Used for write operations
|
|
379
|
+
* that must not accidentally modify archived milestone checkboxes/tables.
|
|
380
|
+
*/
|
|
381
|
+
export function replaceInCurrentMilestone(content: string, pattern: RegExp, replacement: string): string {
|
|
382
|
+
const lastDetailsClose = content.lastIndexOf('</details>');
|
|
383
|
+
if (lastDetailsClose === -1) {
|
|
384
|
+
return content.replace(pattern, replacement);
|
|
385
|
+
}
|
|
386
|
+
const offset = lastDetailsClose + '</details>'.length;
|
|
387
|
+
const before = content.slice(0, offset);
|
|
388
|
+
const after = content.slice(offset);
|
|
389
|
+
return before + after.replace(pattern, replacement);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// ─── Roadmap & model utilities ────────────────────────────────────────────────
|
|
393
|
+
|
|
394
|
+
export interface RoadmapPhaseInfo {
|
|
395
|
+
found: boolean;
|
|
396
|
+
phase_number: string;
|
|
397
|
+
phase_name: string;
|
|
398
|
+
goal: string | null;
|
|
399
|
+
section: string;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export function getRoadmapPhaseInternal(cwd: string, phaseNum: unknown): RoadmapPhaseInfo | null {
|
|
403
|
+
if (!phaseNum) return null;
|
|
404
|
+
const roadmapPath = path.join(cwd, '.planning', 'ROADMAP.md');
|
|
405
|
+
if (!fs.existsSync(roadmapPath)) return null;
|
|
406
|
+
|
|
407
|
+
try {
|
|
408
|
+
const content = stripShippedMilestones(fs.readFileSync(roadmapPath, 'utf-8'));
|
|
409
|
+
const escapedPhase = escapeRegex(phaseNum.toString());
|
|
410
|
+
const phasePattern = new RegExp(`#{2,4}\\s*Phase\\s+${escapedPhase}:\\s*([^\\n]+)`, 'i');
|
|
411
|
+
const headerMatch = content.match(phasePattern);
|
|
412
|
+
if (!headerMatch) return null;
|
|
413
|
+
|
|
414
|
+
const phaseName = headerMatch[1].trim();
|
|
415
|
+
const headerIndex = headerMatch.index!;
|
|
416
|
+
const restOfContent = content.slice(headerIndex);
|
|
417
|
+
const nextHeaderMatch = restOfContent.match(/\n#{2,4}\s+Phase\s+\d/i);
|
|
418
|
+
const sectionEnd = nextHeaderMatch ? headerIndex + nextHeaderMatch.index! : content.length;
|
|
419
|
+
const section = content.slice(headerIndex, sectionEnd).trim();
|
|
420
|
+
|
|
421
|
+
const goalMatch = section.match(/\*\*Goal(?:\*\*:|\*?\*?:\*\*)\s*([^\n]+)/i);
|
|
422
|
+
const goal = goalMatch ? goalMatch[1].trim() : null;
|
|
423
|
+
|
|
424
|
+
return {
|
|
425
|
+
found: true,
|
|
426
|
+
phase_number: phaseNum.toString(),
|
|
427
|
+
phase_name: phaseName,
|
|
428
|
+
goal,
|
|
429
|
+
section,
|
|
430
|
+
};
|
|
431
|
+
} catch {
|
|
432
|
+
return null;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export function resolveModelInternal(cwd: string, agentType: string): string {
|
|
437
|
+
const config = loadConfig(cwd);
|
|
438
|
+
|
|
439
|
+
// Check per-agent override first
|
|
440
|
+
const override = config.model_overrides?.[agentType];
|
|
441
|
+
if (override) {
|
|
442
|
+
return override === 'opus' ? 'inherit' : override;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// Fall back to profile lookup
|
|
446
|
+
const profile = String(config.model_profile || 'balanced').toLowerCase();
|
|
447
|
+
const agentModels = MODEL_PROFILES[agentType] as Record<string, string> | undefined;
|
|
448
|
+
if (!agentModels) return 'sonnet';
|
|
449
|
+
if (profile === 'inherit') return 'inherit';
|
|
450
|
+
const resolved = agentModels[profile] || agentModels['balanced'] || 'sonnet';
|
|
451
|
+
return resolved === 'opus' ? 'inherit' : resolved;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// ─── Misc utilities ───────────────────────────────────────────────────────────
|
|
455
|
+
|
|
456
|
+
export function pathExistsInternal(cwd: string, targetPath: string): boolean {
|
|
457
|
+
const fullPath = path.isAbsolute(targetPath) ? targetPath : path.join(cwd, targetPath);
|
|
458
|
+
try {
|
|
459
|
+
fs.statSync(fullPath);
|
|
460
|
+
return true;
|
|
461
|
+
} catch {
|
|
462
|
+
return false;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export function generateSlugInternal(text: unknown): string | null {
|
|
467
|
+
if (!text) return null;
|
|
468
|
+
return String(text).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export interface MilestoneInfo {
|
|
472
|
+
version: string;
|
|
473
|
+
name: string;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export function getMilestoneInfo(cwd: string): MilestoneInfo {
|
|
477
|
+
try {
|
|
478
|
+
const roadmap = fs.readFileSync(path.join(cwd, '.planning', 'ROADMAP.md'), 'utf-8');
|
|
479
|
+
|
|
480
|
+
// First: check for list-format roadmaps using 🚧 (in-progress) marker
|
|
481
|
+
// e.g. "- 🚧 **v2.1 Belgium** — Phases 24-28 (in progress)"
|
|
482
|
+
const inProgressMatch = roadmap.match(/🚧\s*\*\*v(\d+\.\d+)\s+([^*]+)\*\*/);
|
|
483
|
+
if (inProgressMatch) {
|
|
484
|
+
return {
|
|
485
|
+
version: 'v' + inProgressMatch[1],
|
|
486
|
+
name: inProgressMatch[2].trim(),
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// Second: heading-format roadmaps — strip shipped milestones in <details> blocks
|
|
491
|
+
const cleaned = stripShippedMilestones(roadmap);
|
|
492
|
+
// Extract version and name from the same ## heading for consistency
|
|
493
|
+
const headingMatch = cleaned.match(/## .*v(\d+\.\d+)[:\s]+([^\n(]+)/);
|
|
494
|
+
if (headingMatch) {
|
|
495
|
+
return {
|
|
496
|
+
version: 'v' + headingMatch[1],
|
|
497
|
+
name: headingMatch[2].trim(),
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
// Fallback: try bare version match
|
|
501
|
+
const versionMatch = cleaned.match(/v(\d+\.\d+)/);
|
|
502
|
+
return {
|
|
503
|
+
version: versionMatch ? versionMatch[0] : 'v1.0',
|
|
504
|
+
name: 'milestone',
|
|
505
|
+
};
|
|
506
|
+
} catch {
|
|
507
|
+
return { version: 'v1.0', name: 'milestone' };
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Returns a filter function that checks whether a phase directory belongs
|
|
513
|
+
* to the current milestone based on ROADMAP.md phase headings.
|
|
514
|
+
* If no ROADMAP exists or no phases are listed, returns a pass-all filter.
|
|
515
|
+
*/
|
|
516
|
+
export function getMilestonePhaseFilter(cwd: string): PhaseFilter {
|
|
517
|
+
const milestonePhaseNums = new Set<string>();
|
|
518
|
+
try {
|
|
519
|
+
const roadmap = stripShippedMilestones(fs.readFileSync(path.join(cwd, '.planning', 'ROADMAP.md'), 'utf-8'));
|
|
520
|
+
const phasePattern = /#{2,4}\s*Phase\s+(\d+[A-Z]?(?:\.\d+)*)\s*:/gi;
|
|
521
|
+
let m: RegExpExecArray | null;
|
|
522
|
+
while ((m = phasePattern.exec(roadmap)) !== null) {
|
|
523
|
+
milestonePhaseNums.add(m[1]);
|
|
524
|
+
}
|
|
525
|
+
} catch {}
|
|
526
|
+
|
|
527
|
+
if (milestonePhaseNums.size === 0) {
|
|
528
|
+
const passAll = (_dirName: string) => true;
|
|
529
|
+
(passAll as PhaseFilter).phaseCount = 0;
|
|
530
|
+
return passAll as PhaseFilter;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
const normalized = new Set(
|
|
534
|
+
[...milestonePhaseNums].map(n => (n.replace(/^0+/, '') || '0').toLowerCase())
|
|
535
|
+
);
|
|
536
|
+
|
|
537
|
+
function isDirInMilestone(dirName: string): boolean {
|
|
538
|
+
const m = dirName.match(/^0*(\d+[A-Za-z]?(?:\.\d+)*)/);
|
|
539
|
+
if (!m) return false;
|
|
540
|
+
return normalized.has(m[1].toLowerCase());
|
|
541
|
+
}
|
|
542
|
+
(isDirInMilestone as PhaseFilter).phaseCount = milestonePhaseNums.size;
|
|
543
|
+
return isDirInMilestone as PhaseFilter;
|
|
544
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core — Shared utilities, constants, and internal helpers
|
|
3
|
+
*/
|
|
4
|
+
export interface PhaseFilter {
|
|
5
|
+
(dirName: string): boolean;
|
|
6
|
+
phaseCount: number;
|
|
7
|
+
}
|
|
8
|
+
export interface VectorConfig {
|
|
9
|
+
model_profile: string;
|
|
10
|
+
commit_docs: boolean;
|
|
11
|
+
search_gitignored: boolean;
|
|
12
|
+
branching_strategy: string;
|
|
13
|
+
phase_branch_template: string;
|
|
14
|
+
milestone_branch_template: string;
|
|
15
|
+
research: boolean;
|
|
16
|
+
plan_checker: boolean;
|
|
17
|
+
verifier: boolean;
|
|
18
|
+
nyquist_validation: boolean;
|
|
19
|
+
parallelization: boolean;
|
|
20
|
+
brave_search: boolean;
|
|
21
|
+
model_overrides: Record<string, string> | null;
|
|
22
|
+
}
|
|
23
|
+
/** Normalize a relative path to always use forward slashes (cross-platform). */
|
|
24
|
+
export declare function toPosixPath(p: string): string;
|
|
25
|
+
export declare function output(result: unknown, raw?: boolean, rawValue?: unknown): void;
|
|
26
|
+
export declare function error(message: string): never;
|
|
27
|
+
export declare function safeReadFile(filePath: string): string | null;
|
|
28
|
+
export declare function loadConfig(cwd: string): VectorConfig;
|
|
29
|
+
export declare function isGitIgnored(cwd: string, targetPath: string): boolean;
|
|
30
|
+
export declare function execGit(cwd: string, args: string[]): {
|
|
31
|
+
exitCode: number;
|
|
32
|
+
stdout: string;
|
|
33
|
+
stderr: string;
|
|
34
|
+
};
|
|
35
|
+
export declare function escapeRegex(value: unknown): string;
|
|
36
|
+
export declare function normalizePhaseName(phase: unknown): string;
|
|
37
|
+
export declare function comparePhaseNum(a: unknown, b: unknown): number;
|
|
38
|
+
export interface PhaseInfo {
|
|
39
|
+
found: boolean;
|
|
40
|
+
directory: string | null;
|
|
41
|
+
phase_number: string;
|
|
42
|
+
phase_name: string | null;
|
|
43
|
+
phase_slug: string | null;
|
|
44
|
+
plans: string[];
|
|
45
|
+
summaries: string[];
|
|
46
|
+
incomplete_plans: string[];
|
|
47
|
+
has_research: boolean;
|
|
48
|
+
has_context: boolean;
|
|
49
|
+
has_verification: boolean;
|
|
50
|
+
archived?: string;
|
|
51
|
+
}
|
|
52
|
+
export declare function searchPhaseInDir(baseDir: string, relBase: string, normalized: string): PhaseInfo | null;
|
|
53
|
+
export declare function findPhaseInternal(cwd: string, phase: unknown): PhaseInfo | null;
|
|
54
|
+
export interface ArchivedPhaseDir {
|
|
55
|
+
name: string;
|
|
56
|
+
milestone: string;
|
|
57
|
+
basePath: string;
|
|
58
|
+
fullPath: string;
|
|
59
|
+
}
|
|
60
|
+
export declare function getArchivedPhaseDirs(cwd: string): ArchivedPhaseDir[];
|
|
61
|
+
/**
|
|
62
|
+
* Strip shipped milestone content wrapped in <details> blocks.
|
|
63
|
+
* Used to isolate current milestone phases when searching ROADMAP.md
|
|
64
|
+
* for phase headings or checkboxes — prevents matching archived milestone
|
|
65
|
+
* phases that share the same numbers as current milestone phases.
|
|
66
|
+
*/
|
|
67
|
+
export declare function stripShippedMilestones(content: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* Replace a pattern only in the current milestone section of ROADMAP.md
|
|
70
|
+
* (everything after the last </details> close tag). Used for write operations
|
|
71
|
+
* that must not accidentally modify archived milestone checkboxes/tables.
|
|
72
|
+
*/
|
|
73
|
+
export declare function replaceInCurrentMilestone(content: string, pattern: RegExp, replacement: string): string;
|
|
74
|
+
export interface RoadmapPhaseInfo {
|
|
75
|
+
found: boolean;
|
|
76
|
+
phase_number: string;
|
|
77
|
+
phase_name: string;
|
|
78
|
+
goal: string | null;
|
|
79
|
+
section: string;
|
|
80
|
+
}
|
|
81
|
+
export declare function getRoadmapPhaseInternal(cwd: string, phaseNum: unknown): RoadmapPhaseInfo | null;
|
|
82
|
+
export declare function resolveModelInternal(cwd: string, agentType: string): string;
|
|
83
|
+
export declare function pathExistsInternal(cwd: string, targetPath: string): boolean;
|
|
84
|
+
export declare function generateSlugInternal(text: unknown): string | null;
|
|
85
|
+
export interface MilestoneInfo {
|
|
86
|
+
version: string;
|
|
87
|
+
name: string;
|
|
88
|
+
}
|
|
89
|
+
export declare function getMilestoneInfo(cwd: string): MilestoneInfo;
|
|
90
|
+
/**
|
|
91
|
+
* Returns a filter function that checks whether a phase directory belongs
|
|
92
|
+
* to the current milestone based on ROADMAP.md phase headings.
|
|
93
|
+
* If no ROADMAP exists or no phases are listed, returns a pass-all filter.
|
|
94
|
+
*/
|
|
95
|
+
export declare function getMilestonePhaseFilter(cwd: string): PhaseFilter;
|
|
96
|
+
//# sourceMappingURL=core.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.cts","sourceRoot":"","sources":["core.cts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,MAAM,WAAW,WAAW;IAC1B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;CACpB;AAID,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,yBAAyB,EAAE,MAAM,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAk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