@paths.design/caws-cli 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/archive.js +353 -0
- package/dist/commands/iterate.js +12 -13
- package/dist/commands/mode.js +259 -0
- package/dist/commands/plan.js +448 -0
- package/dist/commands/quality-gates.js +490 -0
- package/dist/commands/specs.js +735 -0
- package/dist/commands/status.js +552 -22
- package/dist/commands/tutorial.js +481 -0
- package/dist/commands/validate.js +137 -54
- package/dist/commands/waivers.js +101 -26
- package/dist/config/modes.js +321 -0
- package/dist/constants/spec-types.js +42 -0
- package/dist/index.js +225 -10
- package/dist/scaffold/git-hooks.js +32 -44
- package/dist/scaffold/index.js +19 -0
- package/dist/utils/quality-gates-errors.js +520 -0
- package/dist/utils/quality-gates.js +361 -0
- package/dist/utils/spec-resolver.js +602 -0
- package/dist/waivers-manager.js +49 -4
- package/package.json +6 -5
- package/templates/.cursor/hooks/caws-scope-guard.sh +64 -8
- package/templates/.cursor/hooks/validate-spec.sh +22 -12
- package/templates/.cursor/rules/{01-claims-verification.mdc → 00-claims-verification.mdc} +1 -1
- package/templates/.cursor/rules/01-working-style.mdc +50 -0
- package/templates/.cursor/rules/{02-testing-standards.mdc → 02-quality-gates.mdc} +84 -29
- package/templates/.cursor/rules/03-naming-and-refactor.mdc +33 -0
- package/templates/.cursor/rules/04-logging-language-style.mdc +23 -0
- package/templates/.cursor/rules/05-safe-defaults-guards.mdc +23 -0
- package/templates/.cursor/rules/06-typescript-conventions.mdc +36 -0
- package/templates/.cursor/rules/07-process-ops.mdc +20 -0
- package/templates/.cursor/rules/08-solid-and-architecture.mdc +16 -0
- package/templates/.cursor/rules/09-docstrings.mdc +89 -0
- package/templates/.cursor/rules/10-authorship-and-attribution.mdc +15 -0
- package/templates/.cursor/rules/11-documentation-quality-standards.mdc +390 -0
- package/templates/.cursor/rules/12-scope-management-waivers.mdc +385 -0
- package/templates/.cursor/rules/13-implementation-completeness.mdc +516 -0
- package/templates/.cursor/rules/14-language-agnostic-standards.mdc +588 -0
- package/templates/.cursor/rules/15-sophisticated-todo-detection.mdc +425 -0
- package/templates/.cursor/rules/README.md +93 -7
- package/templates/scripts/quality-gates/check-god-objects.js +146 -0
- package/templates/scripts/quality-gates/run-quality-gates.js +50 -0
- package/templates/scripts/v3/analysis/todo_analyzer.py +1950 -0
- package/dist/budget-derivation.d.ts +0 -74
- package/dist/budget-derivation.d.ts.map +0 -1
- package/dist/cicd-optimizer.d.ts +0 -142
- package/dist/cicd-optimizer.d.ts.map +0 -1
- package/dist/commands/burnup.d.ts +0 -6
- package/dist/commands/burnup.d.ts.map +0 -1
- package/dist/commands/diagnose.d.ts +0 -52
- package/dist/commands/diagnose.d.ts.map +0 -1
- package/dist/commands/evaluate.d.ts +0 -8
- package/dist/commands/evaluate.d.ts.map +0 -1
- package/dist/commands/init.d.ts +0 -5
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/iterate.d.ts +0 -8
- package/dist/commands/iterate.d.ts.map +0 -1
- package/dist/commands/provenance.d.ts +0 -32
- package/dist/commands/provenance.d.ts.map +0 -1
- package/dist/commands/quality-monitor.d.ts +0 -17
- package/dist/commands/quality-monitor.d.ts.map +0 -1
- package/dist/commands/status.d.ts +0 -43
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/templates.d.ts +0 -74
- package/dist/commands/templates.d.ts.map +0 -1
- package/dist/commands/tool.d.ts +0 -13
- package/dist/commands/tool.d.ts.map +0 -1
- package/dist/commands/troubleshoot.d.ts +0 -8
- package/dist/commands/troubleshoot.d.ts.map +0 -1
- package/dist/commands/validate.d.ts +0 -8
- package/dist/commands/validate.d.ts.map +0 -1
- package/dist/commands/waivers.d.ts +0 -8
- package/dist/commands/waivers.d.ts.map +0 -1
- package/dist/commands/workflow.d.ts +0 -85
- package/dist/commands/workflow.d.ts.map +0 -1
- package/dist/config/index.d.ts +0 -29
- package/dist/config/index.d.ts.map +0 -1
- package/dist/error-handler.d.ts +0 -164
- package/dist/error-handler.d.ts.map +0 -1
- package/dist/generators/jest-config.d.ts +0 -32
- package/dist/generators/jest-config.d.ts.map +0 -1
- package/dist/generators/working-spec.d.ts +0 -13
- package/dist/generators/working-spec.d.ts.map +0 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.d.ts.map +0 -1
- package/dist/minimal-cli.d.ts +0 -3
- package/dist/minimal-cli.d.ts.map +0 -1
- package/dist/policy/PolicyManager.d.ts +0 -104
- package/dist/policy/PolicyManager.d.ts.map +0 -1
- package/dist/scaffold/cursor-hooks.d.ts +0 -7
- package/dist/scaffold/cursor-hooks.d.ts.map +0 -1
- package/dist/scaffold/git-hooks.d.ts +0 -20
- package/dist/scaffold/git-hooks.d.ts.map +0 -1
- package/dist/scaffold/index.d.ts +0 -20
- package/dist/scaffold/index.d.ts.map +0 -1
- package/dist/spec/SpecFileManager.d.ts +0 -146
- package/dist/spec/SpecFileManager.d.ts.map +0 -1
- package/dist/test-analysis.d.ts +0 -182
- package/dist/test-analysis.d.ts.map +0 -1
- package/dist/tool-interface.d.ts +0 -236
- package/dist/tool-interface.d.ts.map +0 -1
- package/dist/tool-loader.d.ts +0 -77
- package/dist/tool-loader.d.ts.map +0 -1
- package/dist/tool-validator.d.ts +0 -72
- package/dist/tool-validator.d.ts.map +0 -1
- package/dist/utils/detection.d.ts +0 -7
- package/dist/utils/detection.d.ts.map +0 -1
- package/dist/utils/finalization.d.ts +0 -17
- package/dist/utils/finalization.d.ts.map +0 -1
- package/dist/utils/project-analysis.d.ts +0 -14
- package/dist/utils/project-analysis.d.ts.map +0 -1
- package/dist/utils/typescript-detector.d.ts +0 -63
- package/dist/utils/typescript-detector.d.ts.map +0 -1
- package/dist/validation/spec-validation.d.ts +0 -43
- package/dist/validation/spec-validation.d.ts.map +0 -1
- package/dist/waivers-manager.d.ts +0 -167
- package/dist/waivers-manager.d.ts.map +0 -1
- package/templates/.cursor/rules/03-infrastructure-standards.mdc +0 -251
- package/templates/.cursor/rules/04-documentation-integrity.mdc +0 -291
- package/templates/.cursor/rules/05-production-readiness-checklist.mdc +0 -214
package/dist/config/index.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import CLI_VERSION_1 = require("../../package.json");
|
|
2
|
-
import CLI_VERSION = CLI_VERSION_1.version;
|
|
3
|
-
/**
|
|
4
|
-
* Initialize global setup detection
|
|
5
|
-
* @returns {Object} Setup configuration
|
|
6
|
-
*/
|
|
7
|
-
export function initializeGlobalSetup(): any;
|
|
8
|
-
/**
|
|
9
|
-
* Load provenance tools dynamically
|
|
10
|
-
* @returns {Object|null} Provenance tools or null if not available
|
|
11
|
-
*/
|
|
12
|
-
export function loadProvenanceTools(): any | null;
|
|
13
|
-
/**
|
|
14
|
-
* Initialize language support tools
|
|
15
|
-
* @returns {Object|null} Language support tools or null if not available
|
|
16
|
-
*/
|
|
17
|
-
export function initializeLanguageSupport(): any | null;
|
|
18
|
-
/**
|
|
19
|
-
* Get global CAWS setup
|
|
20
|
-
* @returns {Object} CAWS setup configuration
|
|
21
|
-
*/
|
|
22
|
-
export function getGlobalCAWSSetup(): any;
|
|
23
|
-
/**
|
|
24
|
-
* Set global CAWS setup (for testing or override)
|
|
25
|
-
* @param {Object} setup - Setup configuration
|
|
26
|
-
*/
|
|
27
|
-
export function setGlobalCAWSSetup(setup: any): void;
|
|
28
|
-
export { CLI_VERSION };
|
|
29
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.js"],"names":[],"mappings":";mCAakD,OAAO;AAOzD;;;GAGG;AACH,6CAkBC;AAED;;;GAGG;AACH,uCAFa,MAAO,IAAI,CA2CvB;AAED;;;GAGG;AACH,6CAFa,MAAO,IAAI,CAmCvB;AAED;;;GAGG;AACH,0CAEC;AAED;;;GAGG;AACH,qDAEC"}
|
package/dist/error-handler.d.ts
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enhanced error class with category and recovery suggestions
|
|
3
|
-
*/
|
|
4
|
-
export class CAWSError extends Error {
|
|
5
|
-
constructor(message: any, category?: any, suggestions?: any[]);
|
|
6
|
-
category: any;
|
|
7
|
-
suggestions: any[];
|
|
8
|
-
timestamp: Date;
|
|
9
|
-
executionTime: any;
|
|
10
|
-
}
|
|
11
|
-
export namespace ERROR_CATEGORIES {
|
|
12
|
-
let VALIDATION: string;
|
|
13
|
-
let PERMISSION: string;
|
|
14
|
-
let FILESYSTEM: string;
|
|
15
|
-
let NETWORK: string;
|
|
16
|
-
let CONFIGURATION: string;
|
|
17
|
-
let USER_INPUT: string;
|
|
18
|
-
let DEPENDENCY: string;
|
|
19
|
-
let UNKNOWN: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Execution timing utilities
|
|
23
|
-
*/
|
|
24
|
-
export class ExecutionTimer {
|
|
25
|
-
startTime: bigint;
|
|
26
|
-
endTime: bigint;
|
|
27
|
-
start(): void;
|
|
28
|
-
end(): number;
|
|
29
|
-
getDuration(): number;
|
|
30
|
-
formatDuration(): string;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Get error category from error object or message
|
|
34
|
-
* @param {Error|string} error - Error object or message
|
|
35
|
-
* @returns {string} Error category
|
|
36
|
-
*/
|
|
37
|
-
export function getErrorCategory(error: Error | string): string;
|
|
38
|
-
/**
|
|
39
|
-
* Wrap async operations with consistent error handling and timing
|
|
40
|
-
* @param {Function} operation - Async operation to wrap
|
|
41
|
-
* @param {string} context - Context for error messages
|
|
42
|
-
* @param {boolean} includeTiming - Whether to include timing in results
|
|
43
|
-
* @returns {Promise<any>} Operation result or throws handled error
|
|
44
|
-
*/
|
|
45
|
-
export function safeAsync(operation: Function, context?: string, includeTiming?: boolean): Promise<any>;
|
|
46
|
-
/**
|
|
47
|
-
* Wrap sync operations with timing
|
|
48
|
-
* @param {Function} operation - Sync operation to wrap
|
|
49
|
-
* @param {string} context - Context for error messages
|
|
50
|
-
* @param {boolean} includeTiming - Whether to include timing in results
|
|
51
|
-
* @returns {any} Operation result or throws handled error
|
|
52
|
-
*/
|
|
53
|
-
export function safeSync(operation: Function, context?: string, includeTiming?: boolean): any;
|
|
54
|
-
/**
|
|
55
|
-
* Handle CLI errors with consistent formatting and user guidance
|
|
56
|
-
* @param {Error} error - Error to handle
|
|
57
|
-
* @param {Object} context - Error context (command, option, etc.)
|
|
58
|
-
* @param {boolean} exit - Whether to exit the process (default: true)
|
|
59
|
-
*/
|
|
60
|
-
export function handleCliError(error: Error, context?: any, exit?: boolean): void;
|
|
61
|
-
/**
|
|
62
|
-
* Validate required environment and dependencies
|
|
63
|
-
* @returns {Object} Validation result with any errors
|
|
64
|
-
*/
|
|
65
|
-
export function validateEnvironment(): any;
|
|
66
|
-
/**
|
|
67
|
-
* Get recovery suggestions based on error category
|
|
68
|
-
* @param {Error} error - Original error
|
|
69
|
-
* @param {string} category - Error category
|
|
70
|
-
* @param {Object} context - Additional context (command, options, etc.)
|
|
71
|
-
* @returns {string[]} Array of recovery suggestions
|
|
72
|
-
*/
|
|
73
|
-
export function getRecoverySuggestions(error: Error, category: string, context?: any): string[];
|
|
74
|
-
/**
|
|
75
|
-
* Get documentation link for error category
|
|
76
|
-
* @param {string} category - Error category
|
|
77
|
-
* @param {Object} context - Additional context
|
|
78
|
-
* @returns {string} Documentation URL
|
|
79
|
-
*/
|
|
80
|
-
export function getDocumentationLink(category: string, context?: any): string;
|
|
81
|
-
/**
|
|
82
|
-
* Find similar command using Levenshtein distance
|
|
83
|
-
* @param {string} input - User's input command
|
|
84
|
-
* @param {string[]} validCommands - List of valid commands
|
|
85
|
-
* @returns {string|null} Most similar command or null
|
|
86
|
-
*/
|
|
87
|
-
export function findSimilarCommand(input: string, validCommands: string[]): string | null;
|
|
88
|
-
/**
|
|
89
|
-
* Command-specific error suggestions
|
|
90
|
-
*/
|
|
91
|
-
export const COMMAND_SUGGESTIONS: {
|
|
92
|
-
'unknown option': (option: any, command: any) => any[];
|
|
93
|
-
'unknown command': (command: any) => string[];
|
|
94
|
-
'template not found': () => string[];
|
|
95
|
-
'not a caws project': () => string[];
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* JSON output formatter for programmatic use
|
|
99
|
-
* @param {Object} data - Data to format as JSON
|
|
100
|
-
* @param {boolean} pretty - Whether to pretty-print (default: true)
|
|
101
|
-
*/
|
|
102
|
-
export function formatJsonOutput(data: any, pretty?: boolean): string;
|
|
103
|
-
/**
|
|
104
|
-
* Check if user requested JSON output
|
|
105
|
-
* @returns {boolean} True if --json flag is present
|
|
106
|
-
*/
|
|
107
|
-
export function isJsonOutput(): boolean;
|
|
108
|
-
/**
|
|
109
|
-
* Output data in appropriate format (JSON or human-readable)
|
|
110
|
-
* @param {Object} data - Data to output
|
|
111
|
-
* @param {boolean} success - Whether this is a success response
|
|
112
|
-
*/
|
|
113
|
-
export function outputResult(data: any, success?: boolean): any;
|
|
114
|
-
/**
|
|
115
|
-
* Troubleshooting guide system
|
|
116
|
-
*/
|
|
117
|
-
export const TROUBLESHOOTING_GUIDES: {
|
|
118
|
-
'coverage-report-not-found': {
|
|
119
|
-
title: string;
|
|
120
|
-
symptoms: string[];
|
|
121
|
-
rootCauses: string[];
|
|
122
|
-
solutions: string[];
|
|
123
|
-
commands: string[];
|
|
124
|
-
};
|
|
125
|
-
'mutation-report-not-found': {
|
|
126
|
-
title: string;
|
|
127
|
-
symptoms: string[];
|
|
128
|
-
rootCauses: string[];
|
|
129
|
-
solutions: string[];
|
|
130
|
-
commands: string[];
|
|
131
|
-
};
|
|
132
|
-
'working-spec-validation': {
|
|
133
|
-
title: string;
|
|
134
|
-
symptoms: string[];
|
|
135
|
-
rootCauses: string[];
|
|
136
|
-
solutions: string[];
|
|
137
|
-
commands: string[];
|
|
138
|
-
};
|
|
139
|
-
'monorepo-detection': {
|
|
140
|
-
title: string;
|
|
141
|
-
symptoms: string[];
|
|
142
|
-
rootCauses: string[];
|
|
143
|
-
solutions: string[];
|
|
144
|
-
commands: string[];
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
/**
|
|
148
|
-
* Get troubleshooting guide for a specific issue
|
|
149
|
-
* @param {string} issueKey - Key for the troubleshooting guide
|
|
150
|
-
* @returns {Object|null} Troubleshooting guide or null if not found
|
|
151
|
-
*/
|
|
152
|
-
export function getTroubleshootingGuide(issueKey: string): any | null;
|
|
153
|
-
/**
|
|
154
|
-
* Get all available troubleshooting guides
|
|
155
|
-
* @returns {Object} All troubleshooting guides
|
|
156
|
-
*/
|
|
157
|
-
export function getAllTroubleshootingGuides(): any;
|
|
158
|
-
/**
|
|
159
|
-
* Suggest troubleshooting guide based on error message
|
|
160
|
-
* @param {string} errorMessage - Error message to analyze
|
|
161
|
-
* @returns {string|null} Issue key if match found, null otherwise
|
|
162
|
-
*/
|
|
163
|
-
export function suggestTroubleshootingGuide(errorMessage: string): string | null;
|
|
164
|
-
//# sourceMappingURL=error-handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../src/error-handler.js"],"names":[],"mappings":"AA0GA;;GAEG;AACH;IACE,+DAOC;IAJC,cAAqD;IACrD,mBAA2F;IAC3F,gBAA2B;IAC3B,mBAAyB;CAE5B;;;;;;;;;;;AAED;;GAEG;AACH;IAEI,kBAAqB;IACrB,gBAAmB;IAGrB,cAEC;IAED,cAGC;IAED,sBAIC;IAED,yBAMC;CACF;AAjHD;;;;GAIG;AACH,wCAHW,KAAK,GAAC,MAAM,GACV,MAAM,CA+DlB;AAiDD;;;;;;GAMG;AACH,yDAJW,MAAM,kBACN,OAAO,GACL,OAAO,CAAC,GAAG,CAAC,CA8BxB;AAED;;;;;;GAMG;AACH,wDAJW,MAAM,kBACN,OAAO,GACL,GAAG,CA8Bf;AAgSD;;;;;GAKG;AACH,sCAJW,KAAK,wBAEL,OAAO,QAmDjB;AA0JD;;;GAGG;AACH,2CAqBC;AAnXD;;;;;;GAMG;AACH,8CALW,KAAK,YACL,MAAM,kBAEJ,MAAM,EAAE,CAwDpB;AAED;;;;;GAKG;AACH,+CAJW,MAAM,kBAEJ,MAAM,CA4BlB;AAxJD;;;;;GAKG;AACH,0CAJW,MAAM,iBACN,MAAM,EAAE,GACN,MAAM,GAAC,IAAI,CAiBvB;AAjHD;;GAEG;AACH;;;;;EAuFE;AA4JF;;;;GAIG;AACH,qDAFW,OAAO,UAIjB;AAED;;;GAGG;AACH,gCAFa,OAAO,CAQnB;AAED;;;;GAIG;AACH,kDAFW,OAAO,OAcjB;AA2DD;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0GE;AAEF;;;;GAIG;AACH,kDAHW,MAAM,GACJ,MAAO,IAAI,CAIvB;AAED;;;GAGG;AACH,mDAEC;AAED;;;;GAIG;AACH,0DAHW,MAAM,GACJ,MAAM,GAAC,IAAI,CAmBvB"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configure Jest for TypeScript project
|
|
3
|
-
* @param {string} projectDir - Project directory path
|
|
4
|
-
* @param {Object} options - Configuration options
|
|
5
|
-
* @returns {Promise<Object>} Configuration result
|
|
6
|
-
*/
|
|
7
|
-
export function configureJestForTypeScript(projectDir?: string, options?: any): Promise<any>;
|
|
8
|
-
/**
|
|
9
|
-
* Generate Jest configuration for TypeScript project
|
|
10
|
-
* @param {Object} options - Configuration options
|
|
11
|
-
* @returns {string} Jest configuration content
|
|
12
|
-
*/
|
|
13
|
-
export function generateJestConfig(options?: any): string;
|
|
14
|
-
/**
|
|
15
|
-
* Generate test setup file for TypeScript
|
|
16
|
-
* @returns {string} Setup file content
|
|
17
|
-
*/
|
|
18
|
-
export function generateTestSetup(): string;
|
|
19
|
-
/**
|
|
20
|
-
* Install Jest and TypeScript dependencies
|
|
21
|
-
* @param {string} projectDir - Project directory
|
|
22
|
-
* @param {Object} packageJson - Existing package.json
|
|
23
|
-
* @returns {Promise<Object>} Installation result
|
|
24
|
-
*/
|
|
25
|
-
export function installJestDependencies(projectDir: string, packageJson: any): Promise<any>;
|
|
26
|
-
/**
|
|
27
|
-
* Get Jest configuration recommendations
|
|
28
|
-
* @param {string} projectDir - Project directory path
|
|
29
|
-
* @returns {Object} Recommendations
|
|
30
|
-
*/
|
|
31
|
-
export function getJestRecommendations(projectDir?: string): any;
|
|
32
|
-
//# sourceMappingURL=jest-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jest-config.d.ts","sourceRoot":"","sources":["../../src/generators/jest-config.js"],"names":[],"mappings":"AA+GA;;;;;GAKG;AACH,wDAJW,MAAM,kBAEJ,OAAO,KAAQ,CAgE3B;AAzKD;;;;GAIG;AACH,mDAFa,MAAM,CA0ClB;AAED;;;GAGG;AACH,qCAFa,MAAM,CAiBlB;AAED;;;;;GAKG;AACH,oDAJW,MAAM,qBAEJ,OAAO,KAAQ,CA2B3B;AAwED;;;;GAIG;AACH,oDAHW,MAAM,OAkDhB"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate working spec YAML with user input
|
|
3
|
-
* @param {Object} answers - User responses
|
|
4
|
-
* @returns {string} - Generated YAML content
|
|
5
|
-
*/
|
|
6
|
-
export function generateWorkingSpec(answers: any): string;
|
|
7
|
-
/**
|
|
8
|
-
* Validate generated working spec against JSON schema
|
|
9
|
-
* @param {string} specContent - YAML spec content
|
|
10
|
-
* @param {Object} answers - User responses for error context
|
|
11
|
-
*/
|
|
12
|
-
export function validateGeneratedSpec(specContent: string, _answers: any): void;
|
|
13
|
-
//# sourceMappingURL=working-spec.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"working-spec.d.ts","sourceRoot":"","sources":["../../src/generators/working-spec.js"],"names":[],"mappings":"AAYA;;;;GAIG;AACH,mDAFa,MAAM,CAqJlB;AAED;;;;GAIG;AACH,mDAHW,MAAM,uBA8BhB"}
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
|
package/dist/minimal-cli.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"minimal-cli.d.ts","sourceRoot":"","sources":["../src/minimal-cli.js"],"names":[],"mappings":""}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Policy Manager - Handles policy loading with intelligent caching
|
|
3
|
-
*
|
|
4
|
-
* Features:
|
|
5
|
-
* - TTL-based caching for performance
|
|
6
|
-
* - Graceful fallback to defaults when policy.yaml missing
|
|
7
|
-
* - Cache inspection and management API
|
|
8
|
-
* - Waiver validation and delta application
|
|
9
|
-
*/
|
|
10
|
-
export class PolicyManager {
|
|
11
|
-
constructor(options?: {});
|
|
12
|
-
enableCaching: any;
|
|
13
|
-
cacheTTL: any;
|
|
14
|
-
policyCache: Map<any, any>;
|
|
15
|
-
/**
|
|
16
|
-
* Load CAWS policy from policy.yaml with caching
|
|
17
|
-
*
|
|
18
|
-
* @param {string} projectRoot - Project root directory
|
|
19
|
-
* @param {Object} options - Loading options
|
|
20
|
-
* @param {boolean} options.useCache - Use cache if available (default: true)
|
|
21
|
-
* @param {number} options.cacheTTL - Cache TTL override in milliseconds
|
|
22
|
-
* @returns {Promise<Object>} Policy object
|
|
23
|
-
*/
|
|
24
|
-
loadPolicy(projectRoot: string, options?: {
|
|
25
|
-
useCache: boolean;
|
|
26
|
-
cacheTTL: number;
|
|
27
|
-
}): Promise<any>;
|
|
28
|
-
/**
|
|
29
|
-
* Load a waiver document by ID
|
|
30
|
-
*
|
|
31
|
-
* @param {string} waiverId - Waiver ID (e.g., WV-0001)
|
|
32
|
-
* @param {string} projectRoot - Project root directory
|
|
33
|
-
* @returns {Promise<Object|null>} Waiver document or null if not found
|
|
34
|
-
*/
|
|
35
|
-
loadWaiver(waiverId: string, projectRoot: string): Promise<any | null>;
|
|
36
|
-
/**
|
|
37
|
-
* Check if a waiver is currently valid
|
|
38
|
-
*
|
|
39
|
-
* @param {Object} waiver - Waiver document
|
|
40
|
-
* @returns {boolean} True if waiver is valid and active
|
|
41
|
-
*/
|
|
42
|
-
isWaiverValid(waiver: any): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Apply waivers to baseline budget
|
|
45
|
-
*
|
|
46
|
-
* @param {Object} baseline - Baseline budget from policy
|
|
47
|
-
* @param {string[]} waiverIds - Array of waiver IDs to apply
|
|
48
|
-
* @param {string} projectRoot - Project root directory
|
|
49
|
-
* @returns {Promise<Object>} Effective budget with waivers applied
|
|
50
|
-
*/
|
|
51
|
-
applyWaivers(baseline: any, waiverIds: string[], projectRoot: string): Promise<any>;
|
|
52
|
-
/**
|
|
53
|
-
* Validate policy structure
|
|
54
|
-
*
|
|
55
|
-
* @param {Object} policy - Policy to validate
|
|
56
|
-
* @throws {Error} If policy is invalid
|
|
57
|
-
*/
|
|
58
|
-
validatePolicy(policy: any): void;
|
|
59
|
-
/**
|
|
60
|
-
* Get default CAWS policy
|
|
61
|
-
*
|
|
62
|
-
* Returns sensible defaults when policy.yaml doesn't exist.
|
|
63
|
-
*
|
|
64
|
-
* @returns {Object} Default policy configuration
|
|
65
|
-
*/
|
|
66
|
-
getDefaultPolicy(): any;
|
|
67
|
-
/**
|
|
68
|
-
* Clear policy cache
|
|
69
|
-
*
|
|
70
|
-
* @param {string} [projectRoot] - Specific project to clear, or all if omitted
|
|
71
|
-
*/
|
|
72
|
-
clearCache(projectRoot?: string): void;
|
|
73
|
-
/**
|
|
74
|
-
* Get cache status for a project
|
|
75
|
-
*
|
|
76
|
-
* @param {string} projectRoot - Project root directory
|
|
77
|
-
* @returns {Object} Cache status information
|
|
78
|
-
*/
|
|
79
|
-
getCacheStatus(projectRoot: string): any;
|
|
80
|
-
/**
|
|
81
|
-
* Reload policy from disk (bypassing cache)
|
|
82
|
-
*
|
|
83
|
-
* @param {string} projectRoot - Project root directory
|
|
84
|
-
* @returns {Promise<Object>} Fresh policy
|
|
85
|
-
*/
|
|
86
|
-
reloadPolicy(projectRoot: string): Promise<any>;
|
|
87
|
-
/**
|
|
88
|
-
* Get all cached projects
|
|
89
|
-
*
|
|
90
|
-
* @returns {string[]} Array of project roots with cached policies
|
|
91
|
-
*/
|
|
92
|
-
getCachedProjects(): string[];
|
|
93
|
-
/**
|
|
94
|
-
* Get cache statistics
|
|
95
|
-
*
|
|
96
|
-
* @returns {Object} Cache statistics
|
|
97
|
-
*/
|
|
98
|
-
getCacheStats(): any;
|
|
99
|
-
}
|
|
100
|
-
export const defaultPolicyManager: PolicyManager;
|
|
101
|
-
export declare function loadPolicy(projectRoot: any, options: any): Promise<any>;
|
|
102
|
-
export declare function clearCache(projectRoot: any): void;
|
|
103
|
-
export declare function getCacheStatus(projectRoot: any): any;
|
|
104
|
-
//# sourceMappingURL=PolicyManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PolicyManager.d.ts","sourceRoot":"","sources":["../../src/policy/PolicyManager.js"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH;IACE,0BAIC;IAHC,mBAAkD;IAClD,cAA0C;IAC1C,2BAA4B;IAG9B;;;;;;;;OAQG;IACH,wBANW,MAAM,YAEd;QAAyB,QAAQ,EAAzB,OAAO;QACS,QAAQ,EAAxB,MAAM;KACd,GAAU,OAAO,KAAQ,CAuE3B;IAED;;;;;;OAMG;IACH,qBAJW,MAAM,eACN,MAAM,GACJ,OAAO,CAAC,MAAO,IAAI,CAAC,CAchC;IAED;;;;;OAKG;IACH,4BAFa,OAAO,CA2BnB;IAED;;;;;;;OAOG;IACH,uCAJW,MAAM,EAAE,eACR,MAAM,GACJ,OAAO,KAAQ,CA2B3B;IAED;;;;;OAKG;IACH,kCA8BC;IAED;;;;;;OAMG;IACH,wBAoDC;IAED;;;;OAIG;IACH,yBAFW,MAAM,QAQhB;IAED;;;;;OAKG;IACH,4BAHW,MAAM,OAmBhB;IAED;;;;;OAKG;IACH,0BAHW,MAAM,GACJ,OAAO,KAAQ,CAK3B;IAED;;;;OAIG;IACH,qBAFa,MAAM,EAAE,CAIpB;IAED;;;;OAIG;IACH,qBA2BC;CACF;AAGD,iDAAiD;AAOnC,iFAA+E;AAC/E,2DAA6D;AACzD,8DAAiE"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Scaffold Cursor hooks for a CAWS project
|
|
3
|
-
* @param {string} projectDir - Project directory path
|
|
4
|
-
* @param {string[]} levels - Hook levels to enable
|
|
5
|
-
*/
|
|
6
|
-
export function scaffoldCursorHooks(projectDir: string, levels?: string[]): Promise<void>;
|
|
7
|
-
//# sourceMappingURL=cursor-hooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-hooks.d.ts","sourceRoot":"","sources":["../../src/scaffold/cursor-hooks.js"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,gDAHW,MAAM,WACN,MAAM,EAAE,iBAqJlB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Scaffold git hooks for CAWS provenance tracking
|
|
3
|
-
* @param {string} projectDir - Project directory path
|
|
4
|
-
* @param {Object} options - Hook options
|
|
5
|
-
*/
|
|
6
|
-
export function scaffoldGitHooks(projectDir: string, options?: any): Promise<{
|
|
7
|
-
added: number;
|
|
8
|
-
skipped: number;
|
|
9
|
-
}>;
|
|
10
|
-
/**
|
|
11
|
-
* Remove CAWS git hooks
|
|
12
|
-
* @param {string} projectDir - Project directory path
|
|
13
|
-
*/
|
|
14
|
-
export function removeGitHooks(projectDir: string): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Check git hooks status
|
|
17
|
-
* @param {string} projectDir - Project directory path
|
|
18
|
-
*/
|
|
19
|
-
export function checkGitHooksStatus(projectDir: string): Promise<void>;
|
|
20
|
-
//# sourceMappingURL=git-hooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-hooks.d.ts","sourceRoot":"","sources":["../../src/scaffold/git-hooks.js"],"names":[],"mappings":"AASA;;;;GAIG;AACH,6CAHW,MAAM;;;GAwGhB;AAoOD;;;GAGG;AACH,2CAFW,MAAM,iBAkChB;AAED;;;GAGG;AACH,gDAFW,MAAM,iBAgDhB"}
|
package/dist/scaffold/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Scaffold existing project with CAWS components
|
|
3
|
-
* @param {Object} options - Scaffold options
|
|
4
|
-
*/
|
|
5
|
-
export function scaffoldProject(options: any): Promise<void>;
|
|
6
|
-
/**
|
|
7
|
-
* Scaffold IDE integrations for comprehensive CAWS development experience
|
|
8
|
-
* @param {string} targetDir - Target directory for scaffolding
|
|
9
|
-
* @param {Object} options - Scaffold options
|
|
10
|
-
*/
|
|
11
|
-
export function scaffoldIDEIntegrations(targetDir: string, options: any): Promise<{
|
|
12
|
-
added: number;
|
|
13
|
-
skipped: number;
|
|
14
|
-
}>;
|
|
15
|
-
/**
|
|
16
|
-
* Set dependencies for scaffold module
|
|
17
|
-
* @param {Object} deps - Dependencies object
|
|
18
|
-
*/
|
|
19
|
-
export function setScaffoldDependencies(deps: any): void;
|
|
20
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scaffold/index.js"],"names":[],"mappings":"AAkKA;;;GAGG;AACH,6DA0UC;AA7dD;;;;GAIG;AACH,mDAHW,MAAM;;;GA8HhB;AAMD;;;GAGG;AACH,yDAGC"}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec File Manager - Handles WorkingSpec file operations and YAML conversion
|
|
3
|
-
*
|
|
4
|
-
* Features:
|
|
5
|
-
* - Bidirectional WorkingSpec ↔ YAML conversion
|
|
6
|
-
* - Temporary file support for validation workflows
|
|
7
|
-
* - Backup/restore capabilities
|
|
8
|
-
* - Automatic cleanup of old temporary files
|
|
9
|
-
*/
|
|
10
|
-
export class SpecFileManager {
|
|
11
|
-
constructor(config?: {});
|
|
12
|
-
projectRoot: any;
|
|
13
|
-
useTemporaryFiles: any;
|
|
14
|
-
tempDir: any;
|
|
15
|
-
/**
|
|
16
|
-
* Convert WorkingSpec object to YAML string
|
|
17
|
-
*
|
|
18
|
-
* @param {Object} spec - WorkingSpec to convert
|
|
19
|
-
* @returns {string} YAML string representation
|
|
20
|
-
*/
|
|
21
|
-
specToYaml(spec: any): string;
|
|
22
|
-
/**
|
|
23
|
-
* Parse YAML string to WorkingSpec object
|
|
24
|
-
*
|
|
25
|
-
* @param {string} yamlContent - YAML string to parse
|
|
26
|
-
* @returns {Object} Parsed WorkingSpec object
|
|
27
|
-
* @throws {Error} If YAML is invalid or doesn't match WorkingSpec schema
|
|
28
|
-
*/
|
|
29
|
-
yamlToSpec(yamlContent: string): any;
|
|
30
|
-
/**
|
|
31
|
-
* Get path to .caws/working-spec.yaml in project
|
|
32
|
-
*
|
|
33
|
-
* @returns {string} Absolute path to working spec file
|
|
34
|
-
*/
|
|
35
|
-
getSpecFilePath(): string;
|
|
36
|
-
/**
|
|
37
|
-
* Check if working spec file exists
|
|
38
|
-
*
|
|
39
|
-
* @returns {Promise<boolean>} True if file exists
|
|
40
|
-
*/
|
|
41
|
-
specFileExists(): Promise<boolean>;
|
|
42
|
-
/**
|
|
43
|
-
* Read working spec from .caws/working-spec.yaml
|
|
44
|
-
*
|
|
45
|
-
* @returns {Promise<Object>} Parsed WorkingSpec object
|
|
46
|
-
* @throws {Error} If file doesn't exist or is invalid
|
|
47
|
-
*/
|
|
48
|
-
readSpecFile(): Promise<any>;
|
|
49
|
-
/**
|
|
50
|
-
* Write WorkingSpec to file
|
|
51
|
-
*
|
|
52
|
-
* Writes to .caws/working-spec.yaml or a temporary file based on configuration.
|
|
53
|
-
*
|
|
54
|
-
* @param {Object} spec - WorkingSpec to write
|
|
55
|
-
* @param {Object} options - Write options
|
|
56
|
-
* @param {boolean} options.useTemp - Override temp file usage
|
|
57
|
-
* @param {boolean} options.backup - Create backup before writing
|
|
58
|
-
* @returns {Promise<Object>} Write result with file path and cleanup function
|
|
59
|
-
*/
|
|
60
|
-
writeSpecFile(spec: any, options?: {
|
|
61
|
-
useTemp: boolean;
|
|
62
|
-
backup: boolean;
|
|
63
|
-
}): Promise<any>;
|
|
64
|
-
/**
|
|
65
|
-
* Update existing working spec file
|
|
66
|
-
*
|
|
67
|
-
* Reads current spec, merges changes, and writes back.
|
|
68
|
-
*
|
|
69
|
-
* @param {Object} updates - Partial WorkingSpec with fields to update
|
|
70
|
-
* @returns {Promise<Object>} Updated WorkingSpec
|
|
71
|
-
*/
|
|
72
|
-
updateSpecFile(updates: any): Promise<any>;
|
|
73
|
-
/**
|
|
74
|
-
* Create backup of working spec
|
|
75
|
-
*
|
|
76
|
-
* @returns {Promise<string>} Path to backup file
|
|
77
|
-
*/
|
|
78
|
-
backupSpecFile(): Promise<string>;
|
|
79
|
-
/**
|
|
80
|
-
* Restore working spec from backup
|
|
81
|
-
*
|
|
82
|
-
* @param {string} backupPath - Path to backup file
|
|
83
|
-
* @returns {Promise<void>}
|
|
84
|
-
*/
|
|
85
|
-
restoreSpecFile(backupPath: string): Promise<void>;
|
|
86
|
-
/**
|
|
87
|
-
* List all backup files
|
|
88
|
-
*
|
|
89
|
-
* @returns {Promise<string[]>} Array of backup file paths
|
|
90
|
-
*/
|
|
91
|
-
listBackups(): Promise<string[]>;
|
|
92
|
-
/**
|
|
93
|
-
* Delete old backup files
|
|
94
|
-
*
|
|
95
|
-
* @param {Object} options - Cleanup options
|
|
96
|
-
* @param {number} options.maxAge - Maximum age in milliseconds (default: 7 days)
|
|
97
|
-
* @param {number} options.keep - Minimum number of backups to keep (default: 5)
|
|
98
|
-
* @returns {Promise<number>} Number of backups deleted
|
|
99
|
-
*/
|
|
100
|
-
cleanupBackups(options?: {
|
|
101
|
-
maxAge: number;
|
|
102
|
-
keep: number;
|
|
103
|
-
}): Promise<number>;
|
|
104
|
-
/**
|
|
105
|
-
* Validate spec file exists and is parseable
|
|
106
|
-
*
|
|
107
|
-
* @returns {Promise<Object>} Validation result
|
|
108
|
-
*/
|
|
109
|
-
validateSpecFile(): Promise<any>;
|
|
110
|
-
/**
|
|
111
|
-
* Clean up old temporary spec files
|
|
112
|
-
*
|
|
113
|
-
* Removes temp files older than specified age.
|
|
114
|
-
*
|
|
115
|
-
* @param {number} maxAge - Maximum age in milliseconds (default: 1 hour)
|
|
116
|
-
* @returns {Promise<number>} Number of files cleaned up
|
|
117
|
-
*/
|
|
118
|
-
cleanupTempFiles(maxAge?: number): Promise<number>;
|
|
119
|
-
/**
|
|
120
|
-
* Get spec file stats (size, modified date, etc.)
|
|
121
|
-
*
|
|
122
|
-
* @returns {Promise<Object>} File stats
|
|
123
|
-
*/
|
|
124
|
-
getSpecFileStats(): Promise<any>;
|
|
125
|
-
/**
|
|
126
|
-
* Create a new SpecFileManager instance with different configuration
|
|
127
|
-
*
|
|
128
|
-
* @param {Object} config - New configuration
|
|
129
|
-
* @returns {SpecFileManager} New instance
|
|
130
|
-
*/
|
|
131
|
-
withConfig(config: any): SpecFileManager;
|
|
132
|
-
}
|
|
133
|
-
export const defaultSpecFileManager: SpecFileManager;
|
|
134
|
-
/**
|
|
135
|
-
* Create a SpecFileManager instance with default configuration
|
|
136
|
-
*
|
|
137
|
-
* @param {string} projectRoot - Project root directory
|
|
138
|
-
* @param {Object} options - Additional options
|
|
139
|
-
* @returns {SpecFileManager} SpecFileManager instance
|
|
140
|
-
*/
|
|
141
|
-
export function createSpecFileManager(projectRoot: string, options?: any): SpecFileManager;
|
|
142
|
-
export declare function specToYaml(spec: any): string;
|
|
143
|
-
export declare function yamlToSpec(yaml: any): any;
|
|
144
|
-
export declare function readSpecFile(projectRoot: any): Promise<any>;
|
|
145
|
-
export declare function writeSpecFile(spec: any, projectRoot: any, options: any): Promise<any>;
|
|
146
|
-
//# sourceMappingURL=SpecFileManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SpecFileManager.d.ts","sourceRoot":"","sources":["../../src/spec/SpecFileManager.js"],"names":[],"mappings":"AAaA;;;;;;;;GAQG;AACH;IACE,yBAIC;IAHC,iBAAsD;IACtD,uBAA0D;IAC1D,aAA4C;IAG9C;;;;;OAKG;IACH,uBAFa,MAAM,CASlB;IAED;;;;;;OAMG;IACH,wBAJW,MAAM,OAqBhB;IAED;;;;OAIG;IACH,mBAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,kBAFa,OAAO,CAAC,OAAO,CAAC,CAS5B;IAED;;;;;OAKG;IACH,gBAHa,OAAO,KAAQ,CAe3B;IAED;;;;;;;;;;OAUG;IACH,mCAJG;QAAyB,OAAO,EAAxB,OAAO;QACU,MAAM,EAAvB,OAAO;KACf,GAAU,OAAO,KAAQ,CA2C3B;IAED;;;;;;;OAOG;IACH,8BAFa,OAAO,KAAQ,CAa3B;IAED;;;;OAIG;IACH,kBAFa,OAAO,CAAC,MAAM,CAAC,CAS3B;IAED;;;;;OAKG;IACH,4BAHW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAKzB;IAED;;;;OAIG;IACH,eAFa,OAAO,CAAC,MAAM,EAAE,CAAC,CAoB7B;IAED;;;;;;;OAOG;IACH,yBAJG;QAAwB,MAAM,EAAtB,MAAM;QACU,IAAI,EAApB,MAAM;KACd,GAAU,OAAO,CAAC,MAAM,CAAC,CA+B3B;IAED;;;;OAIG;IACH,oBAFa,OAAO,KAAQ,CAe3B;IAED;;;;;;;OAOG;IACH,0BAHW,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CA6B3B;IAED;;;;OAIG;IACH,oBAFa,OAAO,KAAQ,CA0B3B;IAED;;;;;OAKG;IACH,yBAFa,eAAe,CAS3B;CACF;AAiBD,qDAAqD;AAfrD;;;;;;GAMG;AACH,mDAJW,MAAM,kBAEJ,eAAe,CAO3B;AAWa,sDAAiD;AACjD,mDAAiD;AAC/C,qEAKb;AACc,+FAKd"}
|