124 lines
3.1 KiB
TypeScript
124 lines
3.1 KiB
TypeScript
/**
|
|
* V3 Progress Service
|
|
*
|
|
* Calculates accurate V3 implementation progress based on:
|
|
* - CLI commands
|
|
* - MCP tools
|
|
* - Hooks subcommands
|
|
* - Package count and DDD structure
|
|
*
|
|
* Can be used from CLI, MCP tools, hooks, or programmatically.
|
|
*
|
|
* @module @claude-flow/shared/services/v3-progress
|
|
*/
|
|
import { EventEmitter } from 'events';
|
|
export interface V3ProgressMetrics {
|
|
overall: number;
|
|
cli: {
|
|
commands: number;
|
|
target: number;
|
|
progress: number;
|
|
};
|
|
mcp: {
|
|
tools: number;
|
|
target: number;
|
|
progress: number;
|
|
};
|
|
hooks: {
|
|
subcommands: number;
|
|
target: number;
|
|
progress: number;
|
|
};
|
|
packages: {
|
|
total: number;
|
|
withDDD: number;
|
|
target: number;
|
|
progress: number;
|
|
list: string[];
|
|
};
|
|
ddd: {
|
|
explicit: number;
|
|
utility: number;
|
|
progress: number;
|
|
};
|
|
codebase: {
|
|
totalFiles: number;
|
|
totalLines: number;
|
|
};
|
|
lastUpdated: string;
|
|
source: string;
|
|
}
|
|
export interface V3ProgressOptions {
|
|
projectRoot?: string;
|
|
writeToFile?: boolean;
|
|
outputPath?: string;
|
|
}
|
|
export interface ProgressChangeEvent {
|
|
previous: number;
|
|
current: number;
|
|
metrics: V3ProgressMetrics;
|
|
}
|
|
export declare class V3ProgressService extends EventEmitter {
|
|
private projectRoot;
|
|
private v3Path;
|
|
private cliPath;
|
|
private metricsPath;
|
|
private lastMetrics;
|
|
private updateInterval;
|
|
constructor(options?: V3ProgressOptions);
|
|
/**
|
|
* Calculate current V3 implementation progress
|
|
*/
|
|
calculate(): Promise<V3ProgressMetrics>;
|
|
/**
|
|
* Calculate and persist metrics to file
|
|
*/
|
|
sync(): Promise<V3ProgressMetrics>;
|
|
/**
|
|
* Get last calculated metrics (without recalculating)
|
|
*/
|
|
getLastMetrics(): V3ProgressMetrics | null;
|
|
/**
|
|
* Load metrics from file
|
|
*/
|
|
load(): Promise<V3ProgressMetrics | null>;
|
|
/**
|
|
* Persist metrics to file
|
|
*/
|
|
persist(metrics: V3ProgressMetrics): Promise<void>;
|
|
/**
|
|
* Start automatic progress updates
|
|
*/
|
|
startAutoUpdate(intervalMs?: number): void;
|
|
/**
|
|
* Stop automatic updates
|
|
*/
|
|
stopAutoUpdate(): void;
|
|
/**
|
|
* Get human-readable progress summary
|
|
*/
|
|
getSummary(): Promise<string>;
|
|
private countCliCommands;
|
|
private countMcpTools;
|
|
private countHooksSubcommands;
|
|
private countPackages;
|
|
private countCodebase;
|
|
}
|
|
/**
|
|
* Create a new V3 Progress Service instance
|
|
*/
|
|
export declare function createV3ProgressService(options?: V3ProgressOptions): V3ProgressService;
|
|
/**
|
|
* Quick progress check - returns overall percentage
|
|
*/
|
|
export declare function getV3Progress(projectRoot?: string): Promise<number>;
|
|
/**
|
|
* Quick progress sync - calculates and persists
|
|
*/
|
|
export declare function syncV3Progress(projectRoot?: string): Promise<V3ProgressMetrics>;
|
|
/**
|
|
* Get the default V3 Progress Service instance
|
|
*/
|
|
export declare function getDefaultProgressService(): V3ProgressService;
|
|
export default V3ProgressService;
|
|
//# sourceMappingURL=v3-progress.service.d.ts.map
|