chati-dev 4.2.2 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -53
- package/bin/chati.js +170 -5
- package/framework/agents/build/dev.md +509 -76
- package/framework/agents/deploy/devops.md +40 -25
- package/framework/agents/discover/brief.md +158 -22
- package/framework/agents/discover/brownfield-wu.md +26 -14
- package/framework/agents/discover/greenfield-wu.md +102 -14
- package/framework/agents/plan/architect-data-engineer.md +6 -6
- package/framework/agents/plan/architect-system.md +46 -12
- package/framework/agents/plan/architect.md +40 -20
- package/framework/agents/plan/detail.md +38 -24
- package/framework/agents/plan/phases.md +36 -26
- package/framework/agents/plan/tasks.md +114 -33
- package/framework/agents/plan/ux-brand-architect.md +240 -8
- package/framework/agents/plan/ux-component-engineer.md +28 -13
- package/framework/agents/plan/ux-researcher.md +7 -6
- package/framework/agents/plan/ux.md +55 -22
- package/framework/agents/quality/qa-implementation.md +143 -74
- package/framework/agents/quality/qa-planning.md +115 -42
- package/framework/agents/quality/qa-visual.md +448 -0
- package/framework/agents/shared/visualizer.md +128 -0
- package/framework/config.yaml +7 -6
- package/framework/constitution.md +127 -44
- package/framework/context/governance.md +12 -7
- package/framework/context/quality.md +6 -5
- package/framework/context/root.md +6 -6
- package/framework/data/entity-registry.yaml +377 -4
- package/framework/data/model-limits.json +19 -0
- package/framework/domains/agents/qa-visual.yaml +74 -0
- package/framework/domains/constitution.yaml +46 -2
- package/framework/domains/workflows/greenfield-fullstack.yaml +2 -2
- package/framework/hooks/advance-trigger.js +131 -0
- package/framework/hooks/brief-validator.js +83 -0
- package/framework/hooks/constitution-guard.js +24 -5
- package/framework/hooks/license-guard.js +62 -27
- package/framework/hooks/mode-governance.js +13 -2
- package/framework/hooks/model-governance.js +1 -0
- package/framework/hooks/post-dev.js +207 -0
- package/framework/hooks/prism-engine.js +274 -105
- package/framework/hooks/reasoning-escalator.js +371 -0
- package/framework/hooks/reference-trigger.js +117 -0
- package/framework/hooks/session-digest.js +50 -1
- package/framework/hooks/settings.json +32 -1
- package/framework/hooks/style-guard.js +25 -6
- package/framework/hooks/team-quality-gate.js +19 -12
- package/framework/hooks/undercover-guard.js +4 -2
- package/framework/i18n/en.yaml +3 -3
- package/framework/i18n/es.yaml +3 -3
- package/framework/i18n/fr.yaml +3 -3
- package/framework/i18n/pt.yaml +3 -3
- package/framework/intelligence/context-engine.md +4 -5
- package/framework/intelligence/decision-engine.md +1 -1
- package/framework/intelligence/hooks-performance.md +3 -3
- package/framework/migrations/v1.0-to-v1.1.yaml +1 -1
- package/framework/migrations/v1.4-to-v2.0.yaml +11 -11
- package/framework/migrations/v4.0-to-v4.1.yaml +2 -2
- package/framework/migrations/v4.2-to-v4.3.yaml +29 -0
- package/framework/orchestrator/chati-router.js +441 -0
- package/framework/orchestrator/chati-update.md +40 -40
- package/framework/orchestrator/chati.md +295 -94
- package/framework/rules/human-writing-style.md +47 -0
- package/framework/scaffold/motion-premium/README.md +99 -0
- package/framework/scaffold/motion-premium/app/globals.css.template +400 -0
- package/framework/scaffold/motion-premium/app/layout.tsx.template +110 -0
- package/framework/scaffold/motion-premium/components/animation/BackgroundCrossfadeProvider.tsx.template +170 -0
- package/framework/scaffold/motion-premium/components/animation/LenisProvider.tsx.template +49 -0
- package/framework/scaffold/motion-premium/components/animation/PageTransitionWrapper.tsx.template +83 -0
- package/framework/scaffold/motion-premium/components/animation/Preloader.tsx.template +171 -0
- package/framework/scaffold/motion-premium/components/ui/Container.tsx.template +69 -0
- package/framework/scaffold/motion-premium/components/ui/PageSection.tsx.template +74 -0
- package/framework/scaffold/motion-premium/lib/animations/gsap.ts.template +112 -0
- package/framework/scaffold/motion-premium/lib/animations/refreshCoordinator.ts.template +75 -0
- package/framework/scaffold/motion-premium/lib/animations/tokens.ts.template +119 -0
- package/framework/scaffold/motion-premium/lib/animations/useGsapContext.ts.template +92 -0
- package/framework/scaffold/motion-premium/lib/animations/useScrollSnapStepper.ts.template +265 -0
- package/framework/scaffold/motion-premium/lib/animations/useSmoothScroll.ts.template +67 -0
- package/framework/scaffold/motion-premium/lib/brand.ts.template +43 -0
- package/framework/scaffold/motion-premium/scaffold.yaml +178 -0
- package/framework/scaffold/motion-premium-3d/README.md +90 -0
- package/framework/scaffold/motion-premium-3d/app/(3d)/scroll-demo/ScrollDemoCanvas.tsx.template +81 -0
- package/framework/scaffold/motion-premium-3d/app/(3d)/scroll-demo/ScrollDemoClient.tsx.template +75 -0
- package/framework/scaffold/motion-premium-3d/app/(3d)/scroll-demo/page.tsx.template +26 -0
- package/framework/scaffold/motion-premium-3d/components/3d/CameraRig.tsx.template +100 -0
- package/framework/scaffold/motion-premium-3d/components/3d/CanvasProvider.tsx.template +85 -0
- package/framework/scaffold/motion-premium-3d/components/3d/InvalidateOnScroll.tsx.template +51 -0
- package/framework/scaffold/motion-premium-3d/components/3d/MeshCrossfade.tsx.template +79 -0
- package/framework/scaffold/motion-premium-3d/components/3d/ScrollCrossfade.tsx.template +88 -0
- package/framework/scaffold/motion-premium-3d/components/3d/ScrollScene.tsx.template +121 -0
- package/framework/scaffold/motion-premium-3d/components/webgl/SceneFallback.tsx.template +65 -0
- package/framework/scaffold/motion-premium-3d/components/webgl/WebGLContext.tsx.template +68 -0
- package/framework/scaffold/motion-premium-3d/lib/webgl/detect.ts.template +69 -0
- package/framework/scaffold/motion-premium-3d/scaffold.yaml +136 -0
- package/framework/schemas/session.schema.json +109 -21
- package/framework/scripts/reference-capture.js +430 -0
- package/framework/scripts/visual-qa.js +686 -0
- package/framework/tasks/orchestrator-handoff.md +1 -1
- package/framework/tasks/orchestrator-resume.md +1 -1
- package/framework/tasks/orchestrator-route.md +1 -1
- package/framework/tasks/orchestrator-status.md +3 -3
- package/framework/tasks/qa-planning-gate-define.md +1 -1
- package/framework/templates/brandbook-html-tmpl.md +2 -2
- package/framework/templates/brandbook-tmpl.yaml +1 -1
- package/framework/templates/component-spec-tmpl.yaml +1 -1
- package/framework/templates/design-token-tmpl.yaml +1 -1
- package/framework/templates/icon-system-tmpl.yaml +1 -1
- package/framework/templates/team-planning-tasks.yaml +6 -5
- package/framework/workflows/brownfield-discovery.yaml +2 -2
- package/framework/workflows/brownfield-fullstack.yaml +15 -11
- package/framework/workflows/brownfield-service.yaml +14 -10
- package/framework/workflows/brownfield-ui.yaml +15 -11
- package/framework/workflows/greenfield-fullstack.yaml +16 -13
- package/framework/workflows/quick-flow.yaml +3 -3
- package/framework/workflows/standard-flow.yaml +12 -9
- package/package.json +12 -6
- package/src/autonomy/autonomous-gate.js +1 -0
- package/src/autonomy/build-state.js +1 -2
- package/src/autonomy/progress-reporter.js +1 -1
- package/src/config/agent-customizer.js +11 -3
- package/src/config/claude-settings-generator.js +27 -7
- package/src/config/context-file-generator.js +41 -21
- package/src/config/framework-adapter.js +1 -0
- package/src/config/gemini-hooks-generator.js +19 -7
- package/src/config/mcp-configs.js +1 -0
- package/src/context/layers/l1-global.js +2 -1
- package/src/dashboard/data-reader.js +4 -3
- package/src/dashboard/layout.js +2 -1
- package/src/decision/analyzer.js +6 -30
- package/src/decision/engine.js +4 -28
- package/src/decision/registry-healer.js +3 -2
- package/src/decision/registry-updater.js +23 -14
- package/src/extensions/loader.js +2 -8
- package/src/gates/g1-planning-complete.js +2 -1
- package/src/gates/g2-qa-planning.js +2 -1
- package/src/gates/g3-implementation.js +2 -1
- package/src/gates/g4-qa-implementation.js +3 -2
- package/src/gates/g5-deploy-ready.js +2 -1
- package/src/health/engine.js +4 -3
- package/src/installer/core.js +431 -81
- package/src/installer/preflight.js +131 -0
- package/src/installer/provider-overlay.js +3 -3
- package/src/installer/scaffold-applier.js +358 -0
- package/src/installer/templates.js +46 -29
- package/src/installer/validator.js +17 -12
- package/src/intelligence/registry-manager.js +22 -29
- package/src/intelligence/timeline.js +11 -6
- package/src/license/commands.js +1 -1
- package/src/license/wait.js +102 -0
- package/src/memory/agent-memory.js +81 -0
- package/src/memory/dream.js +32 -1
- package/src/merger/replace-merger.js +28 -15
- package/src/orchestrator/agent-selector.js +2 -1
- package/src/orchestrator/cli.js +1880 -71
- package/src/orchestrator/doctor.js +270 -0
- package/src/orchestrator/handoff-engine.js +4 -3
- package/src/orchestrator/index.js +2 -0
- package/src/orchestrator/pipeline-manager.js +306 -15
- package/src/orchestrator/session-manager.js +339 -6
- package/src/tasks/handoff.js +3 -2
- package/src/telemetry/config.js +4 -3
- package/src/telemetry/schema.js +1 -0
- package/src/terminal/collector.js +3 -2
- package/src/terminal/index.js +1 -2
- package/src/terminal/isolation.js +52 -18
- package/src/terminal/prompt-builder.js +42 -25
- package/src/terminal/run-parallel.js +1 -1
- package/src/terminal/run-team.js +3 -3
- package/src/terminal/team-task-list.js +43 -4
- package/src/upgrade/backup.js +3 -2
- package/src/upgrade/checker.js +3 -2
- package/src/upgrade/migrator.js +65 -7
- package/src/upgrade/tracked-files-detector.js +86 -0
- package/src/upgrade/user-messages.js +94 -0
- package/src/utils/config-parser.js +2 -1
- package/src/utils/feature-flags.js +2 -1
- package/src/utils/flatten-entities.js +69 -0
- package/src/utils/framework-dir.js +16 -0
- package/src/utils/model-id.js +85 -0
- package/src/utils/provider-limits.js +84 -23
- package/src/utils/schema-validator.js +1 -1
- package/src/wizard/i18n.js +5 -4
- package/src/wizard/index.js +14 -0
- package/assets/logo - c/303/263pia.png +0 -0
- package/assets/logo.svg +0 -42
- package/assets/logo2.png +0 -0
- package/assets/social-preview.png +0 -0
- package/scripts/bundle-framework.js +0 -69
- package/scripts/changelog-generator.js +0 -222
- package/scripts/codebase-mapper.js +0 -728
- package/scripts/commit-message-generator.js +0 -167
- package/scripts/coverage-analyzer.js +0 -260
- package/scripts/dependency-analyzer.js +0 -280
- package/scripts/doctor/checks/agents.js +0 -77
- package/scripts/doctor/checks/constitution.js +0 -41
- package/scripts/doctor/checks/domain-alignment.js +0 -58
- package/scripts/doctor/checks/prism-layers.js +0 -84
- package/scripts/doctor/checks/registry.js +0 -55
- package/scripts/doctor/checks/schemas.js +0 -61
- package/scripts/doctor/fixes/reference-fix.js +0 -100
- package/scripts/doctor/fixes/registry-fix.js +0 -56
- package/scripts/doctor/index.js +0 -212
- package/scripts/framework-analyzer.js +0 -308
- package/scripts/generate-constitution-domain.js +0 -253
- package/scripts/generate-signing-key.js +0 -33
- package/scripts/health-check.js +0 -481
- package/scripts/ide-sync.js +0 -326
- package/scripts/performance-analyzer.js +0 -325
- package/scripts/plan-tracker.js +0 -278
- package/scripts/populate-entity-registry.js +0 -481
- package/scripts/pr-review.js +0 -317
- package/scripts/rollback-manager.js +0 -310
- package/scripts/semantic-lint.js +0 -328
- package/scripts/sign-manifest.js +0 -53
- package/scripts/stuck-detector.js +0 -343
- package/scripts/test-quality-assessment.js +0 -257
- package/scripts/validate-agents.js +0 -368
- package/scripts/validate-package.js +0 -505
- package/scripts/validate-tasks.js +0 -465
- package/src/autonomy/worktree-manager.js +0 -250
- package/src/intelligence/decision-engine.js +0 -256
- package/src/intelligence/document-sharder.js +0 -221
- package/src/intelligence/elicitation.js +0 -265
package/scripts/plan-tracker.js
DELETED
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plan Tracker — Tracks progress of development phases and tasks.
|
|
3
|
-
*
|
|
4
|
-
* Persists plan state to .chati/plan.json and provides progress calculation,
|
|
5
|
-
* visual progress bars, and formatted reports.
|
|
6
|
-
*
|
|
7
|
-
* @module scripts/plan-tracker
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'node:fs';
|
|
11
|
-
import { join, dirname } from 'node:path';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @typedef {Object} Task
|
|
15
|
-
* @property {string} id
|
|
16
|
-
* @property {string} name
|
|
17
|
-
* @property {string} status — 'pending' | 'in_progress' | 'completed' | 'skipped'
|
|
18
|
-
* @property {string} [assignee]
|
|
19
|
-
* @property {number} [updatedAt]
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @typedef {Object} Phase
|
|
24
|
-
* @property {string} id
|
|
25
|
-
* @property {string} name
|
|
26
|
-
* @property {string} status — 'pending' | 'in_progress' | 'completed' | 'skipped'
|
|
27
|
-
* @property {Task[]} tasks
|
|
28
|
-
* @property {number} [updatedAt]
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @typedef {Object} Plan
|
|
33
|
-
* @property {string} name
|
|
34
|
-
* @property {Phase[]} phases
|
|
35
|
-
* @property {number} createdAt
|
|
36
|
-
* @property {number} updatedAt
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @typedef {Object} Progress
|
|
41
|
-
* @property {number} totalPhases
|
|
42
|
-
* @property {number} completedPhases
|
|
43
|
-
* @property {number} totalTasks
|
|
44
|
-
* @property {number} completedTasks
|
|
45
|
-
* @property {number} percentComplete
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
const VALID_STATUSES = new Set(['pending', 'in_progress', 'completed', 'skipped']);
|
|
49
|
-
|
|
50
|
-
export class PlanTracker {
|
|
51
|
-
/**
|
|
52
|
-
* @param {string} targetDir — project root directory
|
|
53
|
-
*/
|
|
54
|
-
constructor(targetDir) {
|
|
55
|
-
this.targetDir = targetDir;
|
|
56
|
-
this.planPath = join(targetDir, '.chati', 'plan.json');
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Loads the plan from disk. Returns a default empty plan if none exists.
|
|
61
|
-
* @returns {Plan}
|
|
62
|
-
*/
|
|
63
|
-
loadPlan() {
|
|
64
|
-
if (!existsSync(this.planPath)) {
|
|
65
|
-
return {
|
|
66
|
-
name: 'Untitled Plan',
|
|
67
|
-
phases: [],
|
|
68
|
-
createdAt: Date.now(),
|
|
69
|
-
updatedAt: Date.now(),
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
try {
|
|
74
|
-
const raw = readFileSync(this.planPath, 'utf-8');
|
|
75
|
-
return JSON.parse(raw);
|
|
76
|
-
} catch {
|
|
77
|
-
return {
|
|
78
|
-
name: 'Untitled Plan',
|
|
79
|
-
phases: [],
|
|
80
|
-
createdAt: Date.now(),
|
|
81
|
-
updatedAt: Date.now(),
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Saves the plan to disk.
|
|
88
|
-
* @param {Plan} plan
|
|
89
|
-
*/
|
|
90
|
-
savePlan(plan) {
|
|
91
|
-
const dir = dirname(this.planPath);
|
|
92
|
-
if (!existsSync(dir)) {
|
|
93
|
-
mkdirSync(dir, { recursive: true });
|
|
94
|
-
}
|
|
95
|
-
plan.updatedAt = Date.now();
|
|
96
|
-
writeFileSync(this.planPath, JSON.stringify(plan, null, 2), 'utf-8');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Adds a phase to the plan.
|
|
101
|
-
* @param {{ id: string, name: string, status?: string }} phase
|
|
102
|
-
*/
|
|
103
|
-
addPhase(phase) {
|
|
104
|
-
if (!phase.id || !phase.name) {
|
|
105
|
-
throw new Error('Phase must have an id and name');
|
|
106
|
-
}
|
|
107
|
-
const plan = this.loadPlan();
|
|
108
|
-
const existing = plan.phases.find((p) => p.id === phase.id);
|
|
109
|
-
if (existing) {
|
|
110
|
-
throw new Error(`Phase "${phase.id}" already exists`);
|
|
111
|
-
}
|
|
112
|
-
plan.phases.push({
|
|
113
|
-
id: phase.id,
|
|
114
|
-
name: phase.name,
|
|
115
|
-
status: phase.status || 'pending',
|
|
116
|
-
tasks: [],
|
|
117
|
-
updatedAt: Date.now(),
|
|
118
|
-
});
|
|
119
|
-
this.savePlan(plan);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Updates the status of a phase.
|
|
124
|
-
* @param {string} phaseId
|
|
125
|
-
* @param {string} status
|
|
126
|
-
*/
|
|
127
|
-
updatePhaseStatus(phaseId, status) {
|
|
128
|
-
if (!VALID_STATUSES.has(status)) {
|
|
129
|
-
throw new Error(`Invalid status "${status}". Must be one of: ${[...VALID_STATUSES].join(', ')}`);
|
|
130
|
-
}
|
|
131
|
-
const plan = this.loadPlan();
|
|
132
|
-
const phase = plan.phases.find((p) => p.id === phaseId);
|
|
133
|
-
if (!phase) {
|
|
134
|
-
throw new Error(`Phase "${phaseId}" not found`);
|
|
135
|
-
}
|
|
136
|
-
phase.status = status;
|
|
137
|
-
phase.updatedAt = Date.now();
|
|
138
|
-
this.savePlan(plan);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Adds a task to a phase.
|
|
143
|
-
* @param {string} phaseId
|
|
144
|
-
* @param {{ id: string, name: string, status?: string, assignee?: string }} task
|
|
145
|
-
*/
|
|
146
|
-
addTask(phaseId, task) {
|
|
147
|
-
if (!task.id || !task.name) {
|
|
148
|
-
throw new Error('Task must have an id and name');
|
|
149
|
-
}
|
|
150
|
-
const plan = this.loadPlan();
|
|
151
|
-
const phase = plan.phases.find((p) => p.id === phaseId);
|
|
152
|
-
if (!phase) {
|
|
153
|
-
throw new Error(`Phase "${phaseId}" not found`);
|
|
154
|
-
}
|
|
155
|
-
const existing = phase.tasks.find((t) => t.id === task.id);
|
|
156
|
-
if (existing) {
|
|
157
|
-
throw new Error(`Task "${task.id}" already exists in phase "${phaseId}"`);
|
|
158
|
-
}
|
|
159
|
-
phase.tasks.push({
|
|
160
|
-
id: task.id,
|
|
161
|
-
name: task.name,
|
|
162
|
-
status: task.status || 'pending',
|
|
163
|
-
assignee: task.assignee || null,
|
|
164
|
-
updatedAt: Date.now(),
|
|
165
|
-
});
|
|
166
|
-
phase.updatedAt = Date.now();
|
|
167
|
-
this.savePlan(plan);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Updates the status of a task within a phase.
|
|
172
|
-
* @param {string} phaseId
|
|
173
|
-
* @param {string} taskId
|
|
174
|
-
* @param {string} status
|
|
175
|
-
*/
|
|
176
|
-
updateTaskStatus(phaseId, taskId, status) {
|
|
177
|
-
if (!VALID_STATUSES.has(status)) {
|
|
178
|
-
throw new Error(`Invalid status "${status}". Must be one of: ${[...VALID_STATUSES].join(', ')}`);
|
|
179
|
-
}
|
|
180
|
-
const plan = this.loadPlan();
|
|
181
|
-
const phase = plan.phases.find((p) => p.id === phaseId);
|
|
182
|
-
if (!phase) {
|
|
183
|
-
throw new Error(`Phase "${phaseId}" not found`);
|
|
184
|
-
}
|
|
185
|
-
const task = phase.tasks.find((t) => t.id === taskId);
|
|
186
|
-
if (!task) {
|
|
187
|
-
throw new Error(`Task "${taskId}" not found in phase "${phaseId}"`);
|
|
188
|
-
}
|
|
189
|
-
task.status = status;
|
|
190
|
-
task.updatedAt = Date.now();
|
|
191
|
-
phase.updatedAt = Date.now();
|
|
192
|
-
this.savePlan(plan);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Calculates overall progress across all phases and tasks.
|
|
197
|
-
* @returns {Progress}
|
|
198
|
-
*/
|
|
199
|
-
getProgress() {
|
|
200
|
-
const plan = this.loadPlan();
|
|
201
|
-
const totalPhases = plan.phases.length;
|
|
202
|
-
const completedPhases = plan.phases.filter((p) => p.status === 'completed').length;
|
|
203
|
-
|
|
204
|
-
let totalTasks = 0;
|
|
205
|
-
let completedTasks = 0;
|
|
206
|
-
for (const phase of plan.phases) {
|
|
207
|
-
totalTasks += phase.tasks.length;
|
|
208
|
-
completedTasks += phase.tasks.filter((t) => t.status === 'completed').length;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
const percentComplete =
|
|
212
|
-
totalTasks > 0
|
|
213
|
-
? Math.round((completedTasks / totalTasks) * 10000) / 100
|
|
214
|
-
: totalPhases > 0
|
|
215
|
-
? Math.round((completedPhases / totalPhases) * 10000) / 100
|
|
216
|
-
: 0;
|
|
217
|
-
|
|
218
|
-
return { totalPhases, completedPhases, totalTasks, completedTasks, percentComplete };
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Generates a visual progress bar.
|
|
223
|
-
*
|
|
224
|
-
* @param {Progress} progress
|
|
225
|
-
* @param {number} [width=30] — bar width in characters
|
|
226
|
-
* @returns {string}
|
|
227
|
-
*/
|
|
228
|
-
formatProgressBar(progress, width = 30) {
|
|
229
|
-
const ratio = progress.percentComplete / 100;
|
|
230
|
-
const filled = Math.round(ratio * width);
|
|
231
|
-
const empty = width - filled;
|
|
232
|
-
const bar = '\u2588'.repeat(filled) + '\u2591'.repeat(empty);
|
|
233
|
-
return `[${bar}] ${progress.percentComplete.toFixed(1)}%`;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Generates a detailed progress report.
|
|
238
|
-
*
|
|
239
|
-
* @param {Progress} [progress]
|
|
240
|
-
* @returns {string}
|
|
241
|
-
*/
|
|
242
|
-
formatProgressReport(progress) {
|
|
243
|
-
const p = progress || this.getProgress();
|
|
244
|
-
const plan = this.loadPlan();
|
|
245
|
-
const lines = [];
|
|
246
|
-
|
|
247
|
-
lines.push(`=== Plan: ${plan.name} ===`);
|
|
248
|
-
lines.push('');
|
|
249
|
-
lines.push(`Progress: ${this.formatProgressBar(p)}`);
|
|
250
|
-
lines.push(`Phases : ${p.completedPhases}/${p.totalPhases}`);
|
|
251
|
-
lines.push(`Tasks : ${p.completedTasks}/${p.totalTasks}`);
|
|
252
|
-
lines.push('');
|
|
253
|
-
|
|
254
|
-
const statusIcons = {
|
|
255
|
-
pending: '[ ]',
|
|
256
|
-
in_progress: '[~]',
|
|
257
|
-
completed: '[x]',
|
|
258
|
-
skipped: '[-]',
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
for (const phase of plan.phases) {
|
|
262
|
-
const icon = statusIcons[phase.status] || '[ ]';
|
|
263
|
-
const phaseTasks = phase.tasks.length;
|
|
264
|
-
const phaseDone = phase.tasks.filter((t) => t.status === 'completed').length;
|
|
265
|
-
lines.push(`${icon} ${phase.name} (${phaseDone}/${phaseTasks} tasks)`);
|
|
266
|
-
|
|
267
|
-
for (const task of phase.tasks) {
|
|
268
|
-
const taskIcon = statusIcons[task.status] || '[ ]';
|
|
269
|
-
const assignee = task.assignee ? ` @${task.assignee}` : '';
|
|
270
|
-
lines.push(` ${taskIcon} ${task.name}${assignee}`);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
lines.push('');
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
return lines.join('\n');
|
|
277
|
-
}
|
|
278
|
-
}
|