@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,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Init — Compound init commands for workflow bootstrapping
|
|
3
|
+
*/
|
|
4
|
+
export declare function cmdInitExecutePhase(cwd: string, phase: string | undefined, raw: boolean): void;
|
|
5
|
+
export declare function cmdInitPlanPhase(cwd: string, phase: string | undefined, raw: boolean): void;
|
|
6
|
+
export declare function cmdInitNewProject(cwd: string, raw: boolean): void;
|
|
7
|
+
export declare function cmdInitNewMilestone(cwd: string, raw: boolean): void;
|
|
8
|
+
export declare function cmdInitQuick(cwd: string, description: string | undefined, raw: boolean): void;
|
|
9
|
+
export declare function cmdInitResume(cwd: string, raw: boolean): void;
|
|
10
|
+
export declare function cmdInitVerifyWork(cwd: string, phase: string | undefined, raw: boolean): void;
|
|
11
|
+
export declare function cmdInitPhaseOp(cwd: string, phase: string | undefined, raw: boolean): void;
|
|
12
|
+
export declare function cmdInitTodos(cwd: string, area: string | undefined, raw: boolean): void;
|
|
13
|
+
export declare function cmdInitMilestoneOp(cwd: string, raw: boolean): void;
|
|
14
|
+
export declare function cmdInitMapCodebase(cwd: string, raw: boolean): void;
|
|
15
|
+
export declare function cmdInitProgress(cwd: string, raw: boolean): void;
|
|
16
|
+
//# sourceMappingURL=init.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.cts","sourceRoot":"","sources":["init.cts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAuE9F;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CA6E3F;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAyDjE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CA8BnE;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CA+C7F;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CA8B7D;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CA2B5F;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAsGzF;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAyDtF;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CA2DlE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAgClE;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAyJ/D"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Milestone — Milestone and requirements lifecycle operations
|
|
4
|
+
*/
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.cmdRequirementsMarkComplete = cmdRequirementsMarkComplete;
|
|
10
|
+
exports.cmdMilestoneComplete = cmdMilestoneComplete;
|
|
11
|
+
const fs_1 = __importDefault(require("fs"));
|
|
12
|
+
const path_1 = __importDefault(require("path"));
|
|
13
|
+
const core_cjs_1 = require("./core.cjs");
|
|
14
|
+
const frontmatter_cjs_1 = require("./frontmatter.cjs");
|
|
15
|
+
const state_cjs_1 = require("./state.cjs");
|
|
16
|
+
function cmdRequirementsMarkComplete(cwd, reqIdsRaw, raw) {
|
|
17
|
+
if (!reqIdsRaw || reqIdsRaw.length === 0) {
|
|
18
|
+
(0, core_cjs_1.error)('requirement IDs required. Usage: requirements mark-complete REQ-01,REQ-02 or REQ-01 REQ-02');
|
|
19
|
+
}
|
|
20
|
+
// Accept comma-separated, space-separated, or bracket-wrapped: [REQ-01, REQ-02]
|
|
21
|
+
const reqIds = reqIdsRaw
|
|
22
|
+
.join(' ')
|
|
23
|
+
.replace(/[\[\]]/g, '')
|
|
24
|
+
.split(/[,\s]+/)
|
|
25
|
+
.map(r => r.trim())
|
|
26
|
+
.filter(Boolean);
|
|
27
|
+
if (reqIds.length === 0) {
|
|
28
|
+
(0, core_cjs_1.error)('no valid requirement IDs found');
|
|
29
|
+
}
|
|
30
|
+
const reqPath = path_1.default.join(cwd, '.planning', 'REQUIREMENTS.md');
|
|
31
|
+
if (!fs_1.default.existsSync(reqPath)) {
|
|
32
|
+
(0, core_cjs_1.output)({ updated: false, reason: 'REQUIREMENTS.md not found', ids: reqIds }, raw, 'no requirements file');
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
let reqContent = fs_1.default.readFileSync(reqPath, 'utf-8');
|
|
36
|
+
const updated = [];
|
|
37
|
+
const notFound = [];
|
|
38
|
+
for (const reqId of reqIds) {
|
|
39
|
+
let found = false;
|
|
40
|
+
const reqEscaped = (0, core_cjs_1.escapeRegex)(reqId);
|
|
41
|
+
// Update checkbox: - [ ] **REQ-ID** → - [x] **REQ-ID**
|
|
42
|
+
const checkboxPattern = new RegExp(`(-\\s*\\[)[ ](\\]\\s*\\*\\*${reqEscaped}\\*\\*)`, 'gi');
|
|
43
|
+
if (checkboxPattern.test(reqContent)) {
|
|
44
|
+
reqContent = reqContent.replace(new RegExp(`(-\\s*\\[)[ ](\\]\\s*\\*\\*${reqEscaped}\\*\\*)`, 'gi'), '$1x$2');
|
|
45
|
+
found = true;
|
|
46
|
+
}
|
|
47
|
+
// Update traceability table: | REQ-ID | Phase N | Pending | → | REQ-ID | Phase N | Complete |
|
|
48
|
+
const tablePattern = new RegExp(`(\\|\\s*${reqEscaped}\\s*\\|[^|]+\\|)\\s*Pending\\s*(\\|)`, 'gi');
|
|
49
|
+
if (tablePattern.test(reqContent)) {
|
|
50
|
+
// Re-read since test() advances lastIndex for global regex
|
|
51
|
+
reqContent = reqContent.replace(new RegExp(`(\\|\\s*${reqEscaped}\\s*\\|[^|]+\\|)\\s*Pending\\s*(\\|)`, 'gi'), '$1 Complete $2');
|
|
52
|
+
found = true;
|
|
53
|
+
}
|
|
54
|
+
if (found) {
|
|
55
|
+
updated.push(reqId);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
notFound.push(reqId);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (updated.length > 0) {
|
|
62
|
+
fs_1.default.writeFileSync(reqPath, reqContent, 'utf-8');
|
|
63
|
+
}
|
|
64
|
+
(0, core_cjs_1.output)({
|
|
65
|
+
updated: updated.length > 0,
|
|
66
|
+
marked_complete: updated,
|
|
67
|
+
not_found: notFound,
|
|
68
|
+
total: reqIds.length,
|
|
69
|
+
}, raw, `${updated.length}/${reqIds.length} requirements marked complete`);
|
|
70
|
+
}
|
|
71
|
+
function cmdMilestoneComplete(cwd, version, options, raw) {
|
|
72
|
+
if (!version) {
|
|
73
|
+
(0, core_cjs_1.error)('version required for milestone complete (e.g., v1.0)');
|
|
74
|
+
}
|
|
75
|
+
const roadmapPath = path_1.default.join(cwd, '.planning', 'ROADMAP.md');
|
|
76
|
+
const reqPath = path_1.default.join(cwd, '.planning', 'REQUIREMENTS.md');
|
|
77
|
+
const statePath = path_1.default.join(cwd, '.planning', 'STATE.md');
|
|
78
|
+
const milestonesPath = path_1.default.join(cwd, '.planning', 'MILESTONES.md');
|
|
79
|
+
const archiveDir = path_1.default.join(cwd, '.planning', 'milestones');
|
|
80
|
+
const phasesDir = path_1.default.join(cwd, '.planning', 'phases');
|
|
81
|
+
const today = new Date().toISOString().split('T')[0];
|
|
82
|
+
const milestoneName = options.name || version;
|
|
83
|
+
// Ensure archive directory exists
|
|
84
|
+
fs_1.default.mkdirSync(archiveDir, { recursive: true });
|
|
85
|
+
// Scope stats and accomplishments to only the phases belonging to the
|
|
86
|
+
// current milestone's ROADMAP. Uses the shared filter from core.cjs
|
|
87
|
+
// (same logic used by cmdPhasesList and other callers).
|
|
88
|
+
const isDirInMilestone = (0, core_cjs_1.getMilestonePhaseFilter)(cwd);
|
|
89
|
+
// Gather stats from phases (scoped to current milestone only)
|
|
90
|
+
let phaseCount = 0;
|
|
91
|
+
let totalPlans = 0;
|
|
92
|
+
let totalTasks = 0;
|
|
93
|
+
const accomplishments = [];
|
|
94
|
+
try {
|
|
95
|
+
const entries = fs_1.default.readdirSync(phasesDir, { withFileTypes: true });
|
|
96
|
+
const dirs = entries.filter(e => e.isDirectory()).map(e => e.name).sort();
|
|
97
|
+
for (const dir of dirs) {
|
|
98
|
+
if (!isDirInMilestone(dir))
|
|
99
|
+
continue;
|
|
100
|
+
phaseCount++;
|
|
101
|
+
const phaseFiles = fs_1.default.readdirSync(path_1.default.join(phasesDir, dir));
|
|
102
|
+
const plans = phaseFiles.filter(f => f.endsWith('-PLAN.md') || f === 'PLAN.md');
|
|
103
|
+
const summaries = phaseFiles.filter(f => f.endsWith('-SUMMARY.md') || f === 'SUMMARY.md');
|
|
104
|
+
totalPlans += plans.length;
|
|
105
|
+
// Extract one-liners from summaries
|
|
106
|
+
for (const s of summaries) {
|
|
107
|
+
try {
|
|
108
|
+
const content = fs_1.default.readFileSync(path_1.default.join(phasesDir, dir, s), 'utf-8');
|
|
109
|
+
const fm = (0, frontmatter_cjs_1.extractFrontmatter)(content);
|
|
110
|
+
if (fm['one-liner']) {
|
|
111
|
+
accomplishments.push(fm['one-liner']);
|
|
112
|
+
}
|
|
113
|
+
// Count tasks
|
|
114
|
+
const taskMatches = content.match(/##\s*Task\s*\d+/gi) || [];
|
|
115
|
+
totalTasks += taskMatches.length;
|
|
116
|
+
}
|
|
117
|
+
catch { }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
catch { }
|
|
122
|
+
// Archive ROADMAP.md
|
|
123
|
+
if (fs_1.default.existsSync(roadmapPath)) {
|
|
124
|
+
const roadmapContent = fs_1.default.readFileSync(roadmapPath, 'utf-8');
|
|
125
|
+
fs_1.default.writeFileSync(path_1.default.join(archiveDir, `${version}-ROADMAP.md`), roadmapContent, 'utf-8');
|
|
126
|
+
}
|
|
127
|
+
// Archive REQUIREMENTS.md
|
|
128
|
+
if (fs_1.default.existsSync(reqPath)) {
|
|
129
|
+
const reqContent = fs_1.default.readFileSync(reqPath, 'utf-8');
|
|
130
|
+
const archiveHeader = `# Requirements Archive: ${version} ${milestoneName}\n\n**Archived:** ${today}\n**Status:** SHIPPED\n\nFor current requirements, see \`.planning/REQUIREMENTS.md\`.\n\n---\n\n`;
|
|
131
|
+
fs_1.default.writeFileSync(path_1.default.join(archiveDir, `${version}-REQUIREMENTS.md`), archiveHeader + reqContent, 'utf-8');
|
|
132
|
+
}
|
|
133
|
+
// Archive audit file if exists
|
|
134
|
+
const auditFile = path_1.default.join(cwd, '.planning', `${version}-MILESTONE-AUDIT.md`);
|
|
135
|
+
if (fs_1.default.existsSync(auditFile)) {
|
|
136
|
+
fs_1.default.renameSync(auditFile, path_1.default.join(archiveDir, `${version}-MILESTONE-AUDIT.md`));
|
|
137
|
+
}
|
|
138
|
+
// Create/append MILESTONES.md entry
|
|
139
|
+
const accomplishmentsList = accomplishments.map(a => `- ${a}`).join('\n');
|
|
140
|
+
const milestoneEntry = `## ${version} ${milestoneName} (Shipped: ${today})\n\n**Phases completed:** ${phaseCount} phases, ${totalPlans} plans, ${totalTasks} tasks\n\n**Key accomplishments:**\n${accomplishmentsList || '- (none recorded)'}\n\n---\n\n`;
|
|
141
|
+
if (fs_1.default.existsSync(milestonesPath)) {
|
|
142
|
+
const existing = fs_1.default.readFileSync(milestonesPath, 'utf-8');
|
|
143
|
+
if (!existing.trim()) {
|
|
144
|
+
// Empty file — treat like new
|
|
145
|
+
fs_1.default.writeFileSync(milestonesPath, `# Milestones\n\n${milestoneEntry}`, 'utf-8');
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
// Insert after the header line(s) for reverse chronological order (newest first)
|
|
149
|
+
const headerMatch = existing.match(/^(#{1,3}\s+[^\n]*\n\n?)/);
|
|
150
|
+
if (headerMatch) {
|
|
151
|
+
const header = headerMatch[1];
|
|
152
|
+
const rest = existing.slice(header.length);
|
|
153
|
+
fs_1.default.writeFileSync(milestonesPath, header + milestoneEntry + rest, 'utf-8');
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
// No recognizable header — prepend the entry
|
|
157
|
+
fs_1.default.writeFileSync(milestonesPath, milestoneEntry + existing, 'utf-8');
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
fs_1.default.writeFileSync(milestonesPath, `# Milestones\n\n${milestoneEntry}`, 'utf-8');
|
|
163
|
+
}
|
|
164
|
+
// Update STATE.md
|
|
165
|
+
if (fs_1.default.existsSync(statePath)) {
|
|
166
|
+
let stateContent = fs_1.default.readFileSync(statePath, 'utf-8');
|
|
167
|
+
stateContent = stateContent.replace(/(\*\*Status:\*\*\s*).*/, `$1${version} milestone complete`);
|
|
168
|
+
stateContent = stateContent.replace(/(\*\*Last Activity:\*\*\s*).*/, `$1${today}`);
|
|
169
|
+
stateContent = stateContent.replace(/(\*\*Last Activity Description:\*\*\s*).*/, `$1${version} milestone completed and archived`);
|
|
170
|
+
(0, state_cjs_1.writeStateMd)(statePath, stateContent, cwd);
|
|
171
|
+
}
|
|
172
|
+
// Archive phase directories if requested
|
|
173
|
+
let phasesArchived = false;
|
|
174
|
+
if (options.archivePhases) {
|
|
175
|
+
try {
|
|
176
|
+
const phaseArchiveDir = path_1.default.join(archiveDir, `${version}-phases`);
|
|
177
|
+
fs_1.default.mkdirSync(phaseArchiveDir, { recursive: true });
|
|
178
|
+
const phaseEntries = fs_1.default.readdirSync(phasesDir, { withFileTypes: true });
|
|
179
|
+
const phaseDirNames = phaseEntries.filter(e => e.isDirectory()).map(e => e.name);
|
|
180
|
+
let archivedCount = 0;
|
|
181
|
+
for (const dir of phaseDirNames) {
|
|
182
|
+
if (!isDirInMilestone(dir))
|
|
183
|
+
continue;
|
|
184
|
+
fs_1.default.renameSync(path_1.default.join(phasesDir, dir), path_1.default.join(phaseArchiveDir, dir));
|
|
185
|
+
archivedCount++;
|
|
186
|
+
}
|
|
187
|
+
phasesArchived = archivedCount > 0;
|
|
188
|
+
}
|
|
189
|
+
catch { }
|
|
190
|
+
}
|
|
191
|
+
const result = {
|
|
192
|
+
version,
|
|
193
|
+
name: milestoneName,
|
|
194
|
+
date: today,
|
|
195
|
+
phases: phaseCount,
|
|
196
|
+
plans: totalPlans,
|
|
197
|
+
tasks: totalTasks,
|
|
198
|
+
accomplishments,
|
|
199
|
+
archived: {
|
|
200
|
+
roadmap: fs_1.default.existsSync(path_1.default.join(archiveDir, `${version}-ROADMAP.md`)),
|
|
201
|
+
requirements: fs_1.default.existsSync(path_1.default.join(archiveDir, `${version}-REQUIREMENTS.md`)),
|
|
202
|
+
audit: fs_1.default.existsSync(path_1.default.join(archiveDir, `${version}-MILESTONE-AUDIT.md`)),
|
|
203
|
+
phases: phasesArchived,
|
|
204
|
+
},
|
|
205
|
+
milestones_updated: true,
|
|
206
|
+
state_updated: fs_1.default.existsSync(statePath),
|
|
207
|
+
};
|
|
208
|
+
(0, core_cjs_1.output)(result, raw);
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=milestone.cjs.map
|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C"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Milestone — Milestone and requirements lifecycle operations
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import { escapeRegex, getMilestonePhaseFilter, output, error } from './core.cjs';
|
|
8
|
+
import { extractFrontmatter } from './frontmatter.cjs';
|
|
9
|
+
import { writeStateMd } from './state.cjs';
|
|
10
|
+
|
|
11
|
+
export function cmdRequirementsMarkComplete(cwd: string, reqIdsRaw: string[], raw: boolean): void {
|
|
12
|
+
if (!reqIdsRaw || reqIdsRaw.length === 0) {
|
|
13
|
+
error('requirement IDs required. Usage: requirements mark-complete REQ-01,REQ-02 or REQ-01 REQ-02');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Accept comma-separated, space-separated, or bracket-wrapped: [REQ-01, REQ-02]
|
|
17
|
+
const reqIds = reqIdsRaw
|
|
18
|
+
.join(' ')
|
|
19
|
+
.replace(/[\[\]]/g, '')
|
|
20
|
+
.split(/[,\s]+/)
|
|
21
|
+
.map(r => r.trim())
|
|
22
|
+
.filter(Boolean);
|
|
23
|
+
|
|
24
|
+
if (reqIds.length === 0) {
|
|
25
|
+
error('no valid requirement IDs found');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const reqPath = path.join(cwd, '.planning', 'REQUIREMENTS.md');
|
|
29
|
+
if (!fs.existsSync(reqPath)) {
|
|
30
|
+
output({ updated: false, reason: 'REQUIREMENTS.md not found', ids: reqIds }, raw, 'no requirements file');
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let reqContent = fs.readFileSync(reqPath, 'utf-8');
|
|
35
|
+
const updated: string[] = [];
|
|
36
|
+
const notFound: string[] = [];
|
|
37
|
+
|
|
38
|
+
for (const reqId of reqIds) {
|
|
39
|
+
let found = false;
|
|
40
|
+
const reqEscaped = escapeRegex(reqId);
|
|
41
|
+
|
|
42
|
+
// Update checkbox: - [ ] **REQ-ID** → - [x] **REQ-ID**
|
|
43
|
+
const checkboxPattern = new RegExp(`(-\\s*\\[)[ ](\\]\\s*\\*\\*${reqEscaped}\\*\\*)`, 'gi');
|
|
44
|
+
if (checkboxPattern.test(reqContent)) {
|
|
45
|
+
reqContent = reqContent.replace(new RegExp(`(-\\s*\\[)[ ](\\]\\s*\\*\\*${reqEscaped}\\*\\*)`, 'gi'), '$1x$2');
|
|
46
|
+
found = true;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Update traceability table: | REQ-ID | Phase N | Pending | → | REQ-ID | Phase N | Complete |
|
|
50
|
+
const tablePattern = new RegExp(`(\\|\\s*${reqEscaped}\\s*\\|[^|]+\\|)\\s*Pending\\s*(\\|)`, 'gi');
|
|
51
|
+
if (tablePattern.test(reqContent)) {
|
|
52
|
+
// Re-read since test() advances lastIndex for global regex
|
|
53
|
+
reqContent = reqContent.replace(
|
|
54
|
+
new RegExp(`(\\|\\s*${reqEscaped}\\s*\\|[^|]+\\|)\\s*Pending\\s*(\\|)`, 'gi'),
|
|
55
|
+
'$1 Complete $2'
|
|
56
|
+
);
|
|
57
|
+
found = true;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (found) {
|
|
61
|
+
updated.push(reqId);
|
|
62
|
+
} else {
|
|
63
|
+
notFound.push(reqId);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (updated.length > 0) {
|
|
68
|
+
fs.writeFileSync(reqPath, reqContent, 'utf-8');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
output({
|
|
72
|
+
updated: updated.length > 0,
|
|
73
|
+
marked_complete: updated,
|
|
74
|
+
not_found: notFound,
|
|
75
|
+
total: reqIds.length,
|
|
76
|
+
}, raw, `${updated.length}/${reqIds.length} requirements marked complete`);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface MilestoneCompleteOptions {
|
|
80
|
+
name?: string;
|
|
81
|
+
archivePhases?: boolean;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function cmdMilestoneComplete(cwd: string, version: string | undefined, options: MilestoneCompleteOptions, raw: boolean): void {
|
|
85
|
+
if (!version) {
|
|
86
|
+
error('version required for milestone complete (e.g., v1.0)');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const roadmapPath = path.join(cwd, '.planning', 'ROADMAP.md');
|
|
90
|
+
const reqPath = path.join(cwd, '.planning', 'REQUIREMENTS.md');
|
|
91
|
+
const statePath = path.join(cwd, '.planning', 'STATE.md');
|
|
92
|
+
const milestonesPath = path.join(cwd, '.planning', 'MILESTONES.md');
|
|
93
|
+
const archiveDir = path.join(cwd, '.planning', 'milestones');
|
|
94
|
+
const phasesDir = path.join(cwd, '.planning', 'phases');
|
|
95
|
+
const today = new Date().toISOString().split('T')[0];
|
|
96
|
+
const milestoneName = options.name || version!;
|
|
97
|
+
|
|
98
|
+
// Ensure archive directory exists
|
|
99
|
+
fs.mkdirSync(archiveDir, { recursive: true });
|
|
100
|
+
|
|
101
|
+
// Scope stats and accomplishments to only the phases belonging to the
|
|
102
|
+
// current milestone's ROADMAP. Uses the shared filter from core.cjs
|
|
103
|
+
// (same logic used by cmdPhasesList and other callers).
|
|
104
|
+
const isDirInMilestone = getMilestonePhaseFilter(cwd);
|
|
105
|
+
|
|
106
|
+
// Gather stats from phases (scoped to current milestone only)
|
|
107
|
+
let phaseCount = 0;
|
|
108
|
+
let totalPlans = 0;
|
|
109
|
+
let totalTasks = 0;
|
|
110
|
+
const accomplishments: string[] = [];
|
|
111
|
+
|
|
112
|
+
try {
|
|
113
|
+
const entries = fs.readdirSync(phasesDir, { withFileTypes: true });
|
|
114
|
+
const dirs = entries.filter(e => e.isDirectory()).map(e => e.name).sort();
|
|
115
|
+
|
|
116
|
+
for (const dir of dirs) {
|
|
117
|
+
if (!isDirInMilestone(dir)) continue;
|
|
118
|
+
|
|
119
|
+
phaseCount++;
|
|
120
|
+
const phaseFiles = fs.readdirSync(path.join(phasesDir, dir));
|
|
121
|
+
const plans = phaseFiles.filter(f => f.endsWith('-PLAN.md') || f === 'PLAN.md');
|
|
122
|
+
const summaries = phaseFiles.filter(f => f.endsWith('-SUMMARY.md') || f === 'SUMMARY.md');
|
|
123
|
+
totalPlans += plans.length;
|
|
124
|
+
|
|
125
|
+
// Extract one-liners from summaries
|
|
126
|
+
for (const s of summaries) {
|
|
127
|
+
try {
|
|
128
|
+
const content = fs.readFileSync(path.join(phasesDir, dir, s), 'utf-8');
|
|
129
|
+
const fm = extractFrontmatter(content) as Record<string, unknown>;
|
|
130
|
+
if (fm['one-liner']) {
|
|
131
|
+
accomplishments.push(fm['one-liner'] as string);
|
|
132
|
+
}
|
|
133
|
+
// Count tasks
|
|
134
|
+
const taskMatches = content.match(/##\s*Task\s*\d+/gi) || [];
|
|
135
|
+
totalTasks += taskMatches.length;
|
|
136
|
+
} catch {}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
} catch {}
|
|
140
|
+
|
|
141
|
+
// Archive ROADMAP.md
|
|
142
|
+
if (fs.existsSync(roadmapPath)) {
|
|
143
|
+
const roadmapContent = fs.readFileSync(roadmapPath, 'utf-8');
|
|
144
|
+
fs.writeFileSync(path.join(archiveDir, `${version}-ROADMAP.md`), roadmapContent, 'utf-8');
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Archive REQUIREMENTS.md
|
|
148
|
+
if (fs.existsSync(reqPath)) {
|
|
149
|
+
const reqContent = fs.readFileSync(reqPath, 'utf-8');
|
|
150
|
+
const archiveHeader = `# Requirements Archive: ${version} ${milestoneName}\n\n**Archived:** ${today}\n**Status:** SHIPPED\n\nFor current requirements, see \`.planning/REQUIREMENTS.md\`.\n\n---\n\n`;
|
|
151
|
+
fs.writeFileSync(path.join(archiveDir, `${version}-REQUIREMENTS.md`), archiveHeader + reqContent, 'utf-8');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Archive audit file if exists
|
|
155
|
+
const auditFile = path.join(cwd, '.planning', `${version}-MILESTONE-AUDIT.md`);
|
|
156
|
+
if (fs.existsSync(auditFile)) {
|
|
157
|
+
fs.renameSync(auditFile, path.join(archiveDir, `${version}-MILESTONE-AUDIT.md`));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Create/append MILESTONES.md entry
|
|
161
|
+
const accomplishmentsList = accomplishments.map(a => `- ${a}`).join('\n');
|
|
162
|
+
const milestoneEntry = `## ${version} ${milestoneName} (Shipped: ${today})\n\n**Phases completed:** ${phaseCount} phases, ${totalPlans} plans, ${totalTasks} tasks\n\n**Key accomplishments:**\n${accomplishmentsList || '- (none recorded)'}\n\n---\n\n`;
|
|
163
|
+
|
|
164
|
+
if (fs.existsSync(milestonesPath)) {
|
|
165
|
+
const existing = fs.readFileSync(milestonesPath, 'utf-8');
|
|
166
|
+
if (!existing.trim()) {
|
|
167
|
+
// Empty file — treat like new
|
|
168
|
+
fs.writeFileSync(milestonesPath, `# Milestones\n\n${milestoneEntry}`, 'utf-8');
|
|
169
|
+
} else {
|
|
170
|
+
// Insert after the header line(s) for reverse chronological order (newest first)
|
|
171
|
+
const headerMatch = existing.match(/^(#{1,3}\s+[^\n]*\n\n?)/);
|
|
172
|
+
if (headerMatch) {
|
|
173
|
+
const header = headerMatch[1];
|
|
174
|
+
const rest = existing.slice(header.length);
|
|
175
|
+
fs.writeFileSync(milestonesPath, header + milestoneEntry + rest, 'utf-8');
|
|
176
|
+
} else {
|
|
177
|
+
// No recognizable header — prepend the entry
|
|
178
|
+
fs.writeFileSync(milestonesPath, milestoneEntry + existing, 'utf-8');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
fs.writeFileSync(milestonesPath, `# Milestones\n\n${milestoneEntry}`, 'utf-8');
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Update STATE.md
|
|
186
|
+
if (fs.existsSync(statePath)) {
|
|
187
|
+
let stateContent = fs.readFileSync(statePath, 'utf-8');
|
|
188
|
+
stateContent = stateContent.replace(
|
|
189
|
+
/(\*\*Status:\*\*\s*).*/,
|
|
190
|
+
`$1${version} milestone complete`
|
|
191
|
+
);
|
|
192
|
+
stateContent = stateContent.replace(
|
|
193
|
+
/(\*\*Last Activity:\*\*\s*).*/,
|
|
194
|
+
`$1${today}`
|
|
195
|
+
);
|
|
196
|
+
stateContent = stateContent.replace(
|
|
197
|
+
/(\*\*Last Activity Description:\*\*\s*).*/,
|
|
198
|
+
`$1${version} milestone completed and archived`
|
|
199
|
+
);
|
|
200
|
+
writeStateMd(statePath, stateContent, cwd);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Archive phase directories if requested
|
|
204
|
+
let phasesArchived = false;
|
|
205
|
+
if (options.archivePhases) {
|
|
206
|
+
try {
|
|
207
|
+
const phaseArchiveDir = path.join(archiveDir, `${version}-phases`);
|
|
208
|
+
fs.mkdirSync(phaseArchiveDir, { recursive: true });
|
|
209
|
+
|
|
210
|
+
const phaseEntries = fs.readdirSync(phasesDir, { withFileTypes: true });
|
|
211
|
+
const phaseDirNames = phaseEntries.filter(e => e.isDirectory()).map(e => e.name);
|
|
212
|
+
let archivedCount = 0;
|
|
213
|
+
for (const dir of phaseDirNames) {
|
|
214
|
+
if (!isDirInMilestone(dir)) continue;
|
|
215
|
+
fs.renameSync(path.join(phasesDir, dir), path.join(phaseArchiveDir, dir));
|
|
216
|
+
archivedCount++;
|
|
217
|
+
}
|
|
218
|
+
phasesArchived = archivedCount > 0;
|
|
219
|
+
} catch {}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const result = {
|
|
223
|
+
version,
|
|
224
|
+
name: milestoneName,
|
|
225
|
+
date: today,
|
|
226
|
+
phases: phaseCount,
|
|
227
|
+
plans: totalPlans,
|
|
228
|
+
tasks: totalTasks,
|
|
229
|
+
accomplishments,
|
|
230
|
+
archived: {
|
|
231
|
+
roadmap: fs.existsSync(path.join(archiveDir, `${version}-ROADMAP.md`)),
|
|
232
|
+
requirements: fs.existsSync(path.join(archiveDir, `${version}-REQUIREMENTS.md`)),
|
|
233
|
+
audit: fs.existsSync(path.join(archiveDir, `${version}-MILESTONE-AUDIT.md`)),
|
|
234
|
+
phases: phasesArchived,
|
|
235
|
+
},
|
|
236
|
+
milestones_updated: true,
|
|
237
|
+
state_updated: fs.existsSync(statePath),
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
output(result, raw);
|
|
241
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Milestone — Milestone and requirements lifecycle operations
|
|
3
|
+
*/
|
|
4
|
+
export declare function cmdRequirementsMarkComplete(cwd: string, reqIdsRaw: string[], raw: boolean): void;
|
|
5
|
+
interface MilestoneCompleteOptions {
|
|
6
|
+
name?: string;
|
|
7
|
+
archivePhases?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function cmdMilestoneComplete(cwd: string, version: string | undefined, options: MilestoneCompleteOptions, raw: boolean): void;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=milestone.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"milestone.d.cts","sourceRoot":"","sources":["milestone.cts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAkEhG;AAED,UAAU,wBAAwB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,wBAAwB,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CA6JpI"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Mapping of Vector agent to model for each profile.
|
|
4
|
+
*
|
|
5
|
+
* Should be in sync with the profiles table in `core/references/model-profiles.md`. But
|
|
6
|
+
* possibly worth making this the single source of truth at some point, and removing the markdown
|
|
7
|
+
* reference table in favor of programmatically determining the model to use for an agent (which
|
|
8
|
+
* would be faster, use fewer tokens, and be less error-prone).
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.VALID_PROFILES = exports.MODEL_PROFILES = void 0;
|
|
12
|
+
exports.formatAgentToModelMapAsTable = formatAgentToModelMapAsTable;
|
|
13
|
+
exports.getAgentToModelMapForProfile = getAgentToModelMapForProfile;
|
|
14
|
+
exports.MODEL_PROFILES = {
|
|
15
|
+
'vector-planner': { quality: 'opus', balanced: 'opus', budget: 'sonnet' },
|
|
16
|
+
'vector-roadmapper': { quality: 'opus', balanced: 'sonnet', budget: 'sonnet' },
|
|
17
|
+
'vector-executor': { quality: 'opus', balanced: 'sonnet', budget: 'sonnet' },
|
|
18
|
+
'vector-phase-researcher': { quality: 'opus', balanced: 'sonnet', budget: 'haiku' },
|
|
19
|
+
'vector-project-researcher': { quality: 'opus', balanced: 'sonnet', budget: 'haiku' },
|
|
20
|
+
'vector-research-synthesizer': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
21
|
+
'vector-debugger': { quality: 'opus', balanced: 'sonnet', budget: 'sonnet' },
|
|
22
|
+
'vector-codebase-mapper': { quality: 'sonnet', balanced: 'haiku', budget: 'haiku' },
|
|
23
|
+
'vector-verifier': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
24
|
+
'vector-plan-checker': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
25
|
+
'vector-integration-checker': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
26
|
+
'vector-nyquist-auditor': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
27
|
+
'vector-ui-researcher': { quality: 'opus', balanced: 'sonnet', budget: 'haiku' },
|
|
28
|
+
'vector-ui-checker': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
29
|
+
'vector-ui-auditor': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
30
|
+
};
|
|
31
|
+
exports.VALID_PROFILES = Object.keys(exports.MODEL_PROFILES['vector-planner']);
|
|
32
|
+
/**
|
|
33
|
+
* Formats the agent-to-model mapping as a human-readable table (in string format).
|
|
34
|
+
*
|
|
35
|
+
* @param agentToModelMap - A mapping from agent to model
|
|
36
|
+
* @returns A formatted table string
|
|
37
|
+
*/
|
|
38
|
+
function formatAgentToModelMapAsTable(agentToModelMap) {
|
|
39
|
+
const agentWidth = Math.max('Agent'.length, ...Object.keys(agentToModelMap).map((a) => a.length));
|
|
40
|
+
const modelWidth = Math.max('Model'.length, ...Object.values(agentToModelMap).map((m) => m.length));
|
|
41
|
+
const sep = '─'.repeat(agentWidth + 2) + '┼' + '─'.repeat(modelWidth + 2);
|
|
42
|
+
const header = ' ' + 'Agent'.padEnd(agentWidth) + ' │ ' + 'Model'.padEnd(modelWidth);
|
|
43
|
+
let agentToModelTable = header + '\n' + sep + '\n';
|
|
44
|
+
for (const [agent, model] of Object.entries(agentToModelMap)) {
|
|
45
|
+
agentToModelTable += ' ' + agent.padEnd(agentWidth) + ' │ ' + model.padEnd(modelWidth) + '\n';
|
|
46
|
+
}
|
|
47
|
+
return agentToModelTable;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns a mapping from agent to model for the given model profile.
|
|
51
|
+
*
|
|
52
|
+
* @param normalizedProfile - The normalized (lowercase and trimmed) profile name
|
|
53
|
+
* @returns A mapping from agent to model for the given profile
|
|
54
|
+
*/
|
|
55
|
+
function getAgentToModelMapForProfile(normalizedProfile) {
|
|
56
|
+
const agentToModelMap = {};
|
|
57
|
+
for (const [agent, profileToModelMap] of Object.entries(exports.MODEL_PROFILES)) {
|
|
58
|
+
agentToModelMap[agent] = profileToModelMap[normalizedProfile];
|
|
59
|
+
}
|
|
60
|
+
return agentToModelMap;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=model-profiles.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-profiles.cjs","sourceRoot":"","sources":["model-profiles.cts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AA+BH,oEAaC;AAQD,oEAMC;AApDY,QAAA,cAAc,GAAkB;IAC3C,gBAAgB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE;IACzE,mBAAmB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE;IAC9E,iBAAiB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE;IAC5E,yBAAyB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;IACnF,2BAA2B,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;IACrF,6BAA6B,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;IACzF,iBAAiB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE;IAC5E,wBAAwB,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;IACnF,iBAAiB,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;IAC7E,qBAAqB,EA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GAAG,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IAC1E,MAAM,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACrF,IAAI,iBAAiB,GAAG,MAAM,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC;IACnD,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QAC7D,iBAAiB,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IAChG,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED;;;;;GAKG;AACH,SAAgB,4BAA4B,CAAC,iBAAyB;IACpE,MAAM,eAAe,GAA2B,EAAE,CAAC;IACnD,KAAK,MAAM,CAAC,KAAK,EAAE,iBAAiB,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,sBAAc,CAAC,EAAE,CAAC;QACxE,eAAe,CAAC,KAAK,CAAC,GAAI,iBAA4C,CAAC,iBAAiB,CAAC,CAAC;IAC5F,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mapping of Vector agent to model for each profile.
|
|
3
|
+
*
|
|
4
|
+
* Should be in sync with the profiles table in `core/references/model-profiles.md`. But
|
|
5
|
+
* possibly worth making this the single source of truth at some point, and removing the markdown
|
|
6
|
+
* reference table in favor of programmatically determining the model to use for an agent (which
|
|
7
|
+
* would be faster, use fewer tokens, and be less error-prone).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
type ModelTier = 'opus' | 'sonnet' | 'haiku';
|
|
11
|
+
type ProfileMap = { quality: ModelTier; balanced: ModelTier; budget: ModelTier };
|
|
12
|
+
type ModelProfiles = Record<string, ProfileMap>;
|
|
13
|
+
|
|
14
|
+
export const MODEL_PROFILES: ModelProfiles = {
|
|
15
|
+
'vector-planner': { quality: 'opus', balanced: 'opus', budget: 'sonnet' },
|
|
16
|
+
'vector-roadmapper': { quality: 'opus', balanced: 'sonnet', budget: 'sonnet' },
|
|
17
|
+
'vector-executor': { quality: 'opus', balanced: 'sonnet', budget: 'sonnet' },
|
|
18
|
+
'vector-phase-researcher': { quality: 'opus', balanced: 'sonnet', budget: 'haiku' },
|
|
19
|
+
'vector-project-researcher': { quality: 'opus', balanced: 'sonnet', budget: 'haiku' },
|
|
20
|
+
'vector-research-synthesizer': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
21
|
+
'vector-debugger': { quality: 'opus', balanced: 'sonnet', budget: 'sonnet' },
|
|
22
|
+
'vector-codebase-mapper': { quality: 'sonnet', balanced: 'haiku', budget: 'haiku' },
|
|
23
|
+
'vector-verifier': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
24
|
+
'vector-plan-checker': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
25
|
+
'vector-integration-checker': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
26
|
+
'vector-nyquist-auditor': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
27
|
+
'vector-ui-researcher': { quality: 'opus', balanced: 'sonnet', budget: 'haiku' },
|
|
28
|
+
'vector-ui-checker': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
29
|
+
'vector-ui-auditor': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku' },
|
|
30
|
+
};
|
|
31
|
+
export const VALID_PROFILES: string[] = Object.keys(MODEL_PROFILES['vector-planner']);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Formats the agent-to-model mapping as a human-readable table (in string format).
|
|
35
|
+
*
|
|
36
|
+
* @param agentToModelMap - A mapping from agent to model
|
|
37
|
+
* @returns A formatted table string
|
|
38
|
+
*/
|
|
39
|
+
export function formatAgentToModelMapAsTable(agentToModelMap: Record<string, string>): string {
|
|
40
|
+
const agentWidth = Math.max('Agent'.length, ...Object.keys(agentToModelMap).map((a) => a.length));
|
|
41
|
+
const modelWidth = Math.max(
|
|
42
|
+
'Model'.length,
|
|
43
|
+
...Object.values(agentToModelMap).map((m) => m.length)
|
|
44
|
+
);
|
|
45
|
+
const sep = '─'.repeat(agentWidth + 2) + '┼' + '─'.repeat(modelWidth + 2);
|
|
46
|
+
const header = ' ' + 'Agent'.padEnd(agentWidth) + ' │ ' + 'Model'.padEnd(modelWidth);
|
|
47
|
+
let agentToModelTable = header + '\n' + sep + '\n';
|
|
48
|
+
for (const [agent, model] of Object.entries(agentToModelMap)) {
|
|
49
|
+
agentToModelTable += ' ' + agent.padEnd(agentWidth) + ' │ ' + model.padEnd(modelWidth) + '\n';
|
|
50
|
+
}
|
|
51
|
+
return agentToModelTable;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Returns a mapping from agent to model for the given model profile.
|
|
56
|
+
*
|
|
57
|
+
* @param normalizedProfile - The normalized (lowercase and trimmed) profile name
|
|
58
|
+
* @returns A mapping from agent to model for the given profile
|
|
59
|
+
*/
|
|
60
|
+
export function getAgentToModelMapForProfile(normalizedProfile: string): Record<string, string> {
|
|
61
|
+
const agentToModelMap: Record<string, string> = {};
|
|
62
|
+
for (const [agent, profileToModelMap] of Object.entries(MODEL_PROFILES)) {
|
|
63
|
+
agentToModelMap[agent] = (profileToModelMap as Record<string, string>)[normalizedProfile];
|
|
64
|
+
}
|
|
65
|
+
return agentToModelMap;
|
|
66
|
+
}
|