@paths.design/caws-cli 7.0.0 → 7.0.2
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/budget-derivation.d.ts +74 -0
- package/dist/budget-derivation.d.ts.map +1 -0
- package/dist/cicd-optimizer.d.ts +142 -0
- package/dist/cicd-optimizer.d.ts.map +1 -0
- package/dist/commands/archive.d.ts +50 -0
- package/dist/commands/archive.d.ts.map +1 -0
- package/dist/commands/burnup.d.ts +6 -0
- package/dist/commands/burnup.d.ts.map +1 -0
- package/dist/commands/diagnose.d.ts +52 -0
- package/dist/commands/diagnose.d.ts.map +1 -0
- package/dist/commands/diagnose.js +3 -2
- package/dist/commands/evaluate.d.ts +8 -0
- package/dist/commands/evaluate.d.ts.map +1 -0
- package/dist/commands/init.d.ts +5 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +23 -3
- package/dist/commands/iterate.d.ts +8 -0
- package/dist/commands/iterate.d.ts.map +1 -0
- package/dist/commands/mode.d.ts +24 -0
- package/dist/commands/mode.d.ts.map +1 -0
- package/dist/commands/plan.d.ts +49 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/provenance.d.ts +32 -0
- package/dist/commands/provenance.d.ts.map +1 -0
- package/dist/commands/quality-gates.d.ts +52 -0
- package/dist/commands/quality-gates.d.ts.map +1 -0
- package/dist/commands/quality-monitor.d.ts +17 -0
- package/dist/commands/quality-monitor.d.ts.map +1 -0
- package/dist/commands/specs.d.ts +71 -0
- package/dist/commands/specs.d.ts.map +1 -0
- package/dist/commands/status.d.ts +44 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/templates.d.ts +74 -0
- package/dist/commands/templates.d.ts.map +1 -0
- package/dist/commands/templates.js +10 -0
- package/dist/commands/tool.d.ts +13 -0
- package/dist/commands/tool.d.ts.map +1 -0
- package/dist/commands/troubleshoot.d.ts +8 -0
- package/dist/commands/troubleshoot.d.ts.map +1 -0
- package/dist/commands/tutorial.d.ts +55 -0
- package/dist/commands/tutorial.d.ts.map +1 -0
- package/dist/commands/validate.d.ts +15 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +12 -0
- package/dist/commands/waivers.d.ts +8 -0
- package/dist/commands/waivers.d.ts.map +1 -0
- package/dist/commands/workflow.d.ts +85 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/config/index.d.ts +29 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/modes.d.ts +225 -0
- package/dist/config/modes.d.ts.map +1 -0
- package/dist/constants/spec-types.d.ts +41 -0
- package/dist/constants/spec-types.d.ts.map +1 -0
- package/dist/error-handler.d.ts +164 -0
- package/dist/error-handler.d.ts.map +1 -0
- package/dist/generators/jest-config.d.ts +32 -0
- package/dist/generators/jest-config.d.ts.map +1 -0
- package/dist/generators/working-spec.d.ts +13 -0
- package/dist/generators/working-spec.d.ts.map +1 -0
- package/dist/generators/working-spec.js +26 -6
- package/dist/index-new.d.ts +5 -0
- package/dist/index-new.d.ts.map +1 -0
- package/dist/index-new.js +317 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.backup +4711 -0
- package/dist/minimal-cli.d.ts +3 -0
- package/dist/minimal-cli.d.ts.map +1 -0
- package/dist/policy/PolicyManager.d.ts +104 -0
- package/dist/policy/PolicyManager.d.ts.map +1 -0
- package/dist/scaffold/cursor-hooks.d.ts +7 -0
- package/dist/scaffold/cursor-hooks.d.ts.map +1 -0
- package/dist/scaffold/cursor-hooks.js +10 -2
- package/dist/scaffold/git-hooks.d.ts +20 -0
- package/dist/scaffold/git-hooks.d.ts.map +1 -0
- package/dist/scaffold/git-hooks.js +62 -3
- package/dist/scaffold/index.d.ts +20 -0
- package/dist/scaffold/index.d.ts.map +1 -0
- package/dist/scaffold/index.js +57 -15
- package/dist/spec/SpecFileManager.d.ts +146 -0
- package/dist/spec/SpecFileManager.d.ts.map +1 -0
- package/dist/test-analysis.d.ts +182 -0
- package/dist/test-analysis.d.ts.map +1 -0
- package/dist/tool-interface.d.ts +236 -0
- package/dist/tool-interface.d.ts.map +1 -0
- package/dist/tool-loader.d.ts +77 -0
- package/dist/tool-loader.d.ts.map +1 -0
- package/dist/tool-validator.d.ts +72 -0
- package/dist/tool-validator.d.ts.map +1 -0
- package/dist/utils/detection.d.ts +7 -0
- package/dist/utils/detection.d.ts.map +1 -0
- package/dist/utils/detection.js +30 -3
- package/dist/utils/finalization.d.ts +17 -0
- package/dist/utils/finalization.d.ts.map +1 -0
- package/dist/utils/project-analysis.d.ts +14 -0
- package/dist/utils/project-analysis.d.ts.map +1 -0
- package/dist/utils/quality-gates.d.ts +49 -0
- package/dist/utils/quality-gates.d.ts.map +1 -0
- package/dist/utils/spec-resolver.d.ts +88 -0
- package/dist/utils/spec-resolver.d.ts.map +1 -0
- package/dist/utils/typescript-detector.d.ts +63 -0
- package/dist/utils/typescript-detector.d.ts.map +1 -0
- package/dist/validation/spec-validation.d.ts +43 -0
- package/dist/validation/spec-validation.d.ts.map +1 -0
- package/dist/validation/spec-validation.js +26 -2
- package/dist/waivers-manager.d.ts +167 -0
- package/dist/waivers-manager.d.ts.map +1 -0
- package/package.json +1 -1
- package/templates/COMMIT_CONVENTIONS.md +86 -0
- package/templates/apps/tools/caws/prompt-lint.js.backup +274 -0
- package/templates/apps/tools/caws/provenance.js.backup +73 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derive budget for a working spec based on policy and waivers
|
|
3
|
+
* Enhanced to use PolicyManager for caching
|
|
4
|
+
* @param {Object} spec - Working spec object
|
|
5
|
+
* @param {string} projectRoot - Project root directory
|
|
6
|
+
* @param {Object} options - Derivation options
|
|
7
|
+
* @param {boolean} options.useCache - Use cached policy (default: true)
|
|
8
|
+
* @returns {Object} Derived budget with baseline and effective limits
|
|
9
|
+
*/
|
|
10
|
+
export function deriveBudget(spec: any, projectRoot?: string, options?: {
|
|
11
|
+
useCache: boolean;
|
|
12
|
+
}): any;
|
|
13
|
+
/**
|
|
14
|
+
* Load a waiver by ID
|
|
15
|
+
* Enhanced with structure validation and detailed error reporting
|
|
16
|
+
* @param {string} waiverId - Waiver ID (e.g., WV-0001)
|
|
17
|
+
* @param {string} projectRoot - Project root directory
|
|
18
|
+
* @returns {Object|null} Waiver object or null if not found
|
|
19
|
+
*/
|
|
20
|
+
export function loadWaiver(waiverId: string, projectRoot: string): any | null;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a waiver is currently valid
|
|
23
|
+
* Enhanced with proper expiry and approval validation
|
|
24
|
+
* @param {Object} waiver - Waiver object
|
|
25
|
+
* @param {Object} policy - Policy configuration (optional)
|
|
26
|
+
* @returns {boolean} Whether waiver is valid and active
|
|
27
|
+
*/
|
|
28
|
+
export function isWaiverValid(waiver: any, policy?: any): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Check if current changes exceed derived budget
|
|
31
|
+
* @param {Object} derivedBudget - Budget from deriveBudget()
|
|
32
|
+
* @param {Object} currentStats - Current change statistics
|
|
33
|
+
* @returns {Object} Budget check result
|
|
34
|
+
*/
|
|
35
|
+
export function checkBudgetCompliance(derivedBudget: any, currentStats: any): any;
|
|
36
|
+
/**
|
|
37
|
+
* Generate burn-up report for scope visibility
|
|
38
|
+
* Enhanced with utilization metrics and warnings
|
|
39
|
+
* @param {Object} derivedBudget - Budget from deriveBudget()
|
|
40
|
+
* @param {Object} currentStats - Current change statistics
|
|
41
|
+
* @returns {string} Human-readable burn-up report
|
|
42
|
+
*/
|
|
43
|
+
export function generateBurnupReport(derivedBudget: any, currentStats: any): string;
|
|
44
|
+
/**
|
|
45
|
+
* Calculate budget utilization percentages
|
|
46
|
+
* @param {Object} budgetCompliance - Budget compliance result
|
|
47
|
+
* @returns {Object} Utilization percentages
|
|
48
|
+
*/
|
|
49
|
+
export function calculateBudgetUtilization(budgetCompliance: any): any;
|
|
50
|
+
/**
|
|
51
|
+
* Check if changes are approaching budget limit
|
|
52
|
+
* @param {Object} budgetCompliance - Budget compliance result
|
|
53
|
+
* @param {number} threshold - Warning threshold (default 80)
|
|
54
|
+
* @returns {boolean} Whether approaching limit
|
|
55
|
+
*/
|
|
56
|
+
export function isApproachingBudgetLimit(budgetCompliance: any, threshold?: number): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Validate policy structure and content
|
|
59
|
+
* @param {Object} policy - Policy object from policy.yaml
|
|
60
|
+
* @throws {Error} If policy is invalid
|
|
61
|
+
*/
|
|
62
|
+
export function validatePolicy(policy: any): void;
|
|
63
|
+
/**
|
|
64
|
+
* Get default policy as fallback
|
|
65
|
+
* @returns {Object} Default CAWS policy
|
|
66
|
+
*/
|
|
67
|
+
export function getDefaultPolicy(): any;
|
|
68
|
+
/**
|
|
69
|
+
* Validate waiver document structure
|
|
70
|
+
* @param {Object} waiver - Waiver document to validate
|
|
71
|
+
* @throws {Error} If waiver structure is invalid
|
|
72
|
+
*/
|
|
73
|
+
export function validateWaiverStructure(waiver: any): void;
|
|
74
|
+
//# sourceMappingURL=budget-derivation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"budget-derivation.d.ts","sourceRoot":"","sources":["../src/budget-derivation.js"],"names":[],"mappings":"AA8JA;;;;;;;;GAQG;AACH,sDALW,MAAM,YAEd;IAAyB,QAAQ,EAAzB,OAAO;CACf,OA+FF;AA4FD;;;;;;GAMG;AACH,qCAJW,MAAM,eACN,MAAM,GACJ,MAAO,IAAI,CAuCvB;AAED;;;;;;GAMG;AACH,0DAFa,OAAO,CAgDnB;AAED;;;;;GAKG;AACH,kFA8BC;AAqCD;;;;;;GAMG;AACH,6EAFa,MAAM,CA8ClB;AAtFD;;;;GAIG;AACH,uEAiBC;AAED;;;;;GAKG;AACH,4EAHW,MAAM,GACJ,OAAO,CAKnB;AAhgBD;;;;GAIG;AACH,kDA+FC;AAED;;;GAGG;AACH,wCAsCC;AA0GD;;;;GAIG;AACH,2DAmFC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
export = CICDOptimizer;
|
|
2
|
+
declare class CICDOptimizer {
|
|
3
|
+
constructor(options?: {});
|
|
4
|
+
projectRoot: any;
|
|
5
|
+
cacheDir: string;
|
|
6
|
+
optimizationConfig: string;
|
|
7
|
+
/**
|
|
8
|
+
* Analyze project and generate CI/CD optimization recommendations
|
|
9
|
+
*/
|
|
10
|
+
analyzeProject(specPath?: string): Promise<{
|
|
11
|
+
project_tier: string;
|
|
12
|
+
recommended_optimizations: any[];
|
|
13
|
+
cache_strategy: {};
|
|
14
|
+
parallel_groups: any[];
|
|
15
|
+
conditional_execution: {};
|
|
16
|
+
estimated_savings: {};
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Generate tier-based conditional execution rules
|
|
20
|
+
*/
|
|
21
|
+
generateConditionalExecutionRules(tier: any): {
|
|
22
|
+
coverage_required: boolean;
|
|
23
|
+
mutation_required: boolean;
|
|
24
|
+
contract_testing: boolean;
|
|
25
|
+
accessibility_check: boolean;
|
|
26
|
+
performance_budget: boolean;
|
|
27
|
+
security_scan: boolean;
|
|
28
|
+
lint_strict: boolean;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Analyze what optimizations are beneficial for this tier
|
|
32
|
+
*/
|
|
33
|
+
analyzeOptimizationOpportunities(tier: any): Promise<{
|
|
34
|
+
type: string;
|
|
35
|
+
description: string;
|
|
36
|
+
impact: string;
|
|
37
|
+
effort: string;
|
|
38
|
+
}[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Generate intelligent caching strategy
|
|
41
|
+
*/
|
|
42
|
+
generateCacheStrategy(): Promise<{
|
|
43
|
+
node_modules: {
|
|
44
|
+
key: string;
|
|
45
|
+
paths: string[];
|
|
46
|
+
restore_keys: string[];
|
|
47
|
+
};
|
|
48
|
+
build_artifacts: {
|
|
49
|
+
key: string;
|
|
50
|
+
paths: string[];
|
|
51
|
+
restore_keys: any[];
|
|
52
|
+
};
|
|
53
|
+
test_cache: {
|
|
54
|
+
key: string;
|
|
55
|
+
paths: string[];
|
|
56
|
+
restore_keys: string[];
|
|
57
|
+
};
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* Create parallel execution groups for quality gates
|
|
61
|
+
*/
|
|
62
|
+
createParallelGroups(): Promise<{
|
|
63
|
+
name: string;
|
|
64
|
+
description: string;
|
|
65
|
+
jobs: string[];
|
|
66
|
+
max_parallel: number;
|
|
67
|
+
timeout: number;
|
|
68
|
+
}[]>;
|
|
69
|
+
/**
|
|
70
|
+
* Analyze changed files to determine what tests to run
|
|
71
|
+
*/
|
|
72
|
+
analyzeChangedFiles(changedFiles?: any[]): Promise<{
|
|
73
|
+
unit: any[];
|
|
74
|
+
integration: any[];
|
|
75
|
+
contract: any[];
|
|
76
|
+
e2e: any[];
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Estimate time savings from optimizations
|
|
80
|
+
*/
|
|
81
|
+
estimateTimeSavings(analysis: any): {
|
|
82
|
+
original_minutes: any;
|
|
83
|
+
optimized_minutes: number;
|
|
84
|
+
savings_percent: number;
|
|
85
|
+
monthly_savings_hours: number;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Generate optimized CI/CD configuration
|
|
89
|
+
*/
|
|
90
|
+
generateOptimizedConfig(platform?: string): Promise<string | {
|
|
91
|
+
name: string;
|
|
92
|
+
on: {
|
|
93
|
+
push: {
|
|
94
|
+
branches: string[];
|
|
95
|
+
};
|
|
96
|
+
pull_request: {
|
|
97
|
+
branches: string[];
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
jobs: {};
|
|
101
|
+
} | {
|
|
102
|
+
stages: string[];
|
|
103
|
+
cache: {
|
|
104
|
+
key: string;
|
|
105
|
+
paths: string[];
|
|
106
|
+
};
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Generate optimized GitHub Actions workflow
|
|
110
|
+
*/
|
|
111
|
+
generateGitHubActionsConfig(analysis: any): {
|
|
112
|
+
name: string;
|
|
113
|
+
on: {
|
|
114
|
+
push: {
|
|
115
|
+
branches: string[];
|
|
116
|
+
};
|
|
117
|
+
pull_request: {
|
|
118
|
+
branches: string[];
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
jobs: {};
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Generate GitLab CI configuration
|
|
125
|
+
*/
|
|
126
|
+
generateGitLabCIConfig(analysis: any): {
|
|
127
|
+
stages: string[];
|
|
128
|
+
cache: {
|
|
129
|
+
key: string;
|
|
130
|
+
paths: string[];
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Generate Jenkins pipeline configuration
|
|
135
|
+
*/
|
|
136
|
+
generateJenkinsConfig(analysis: any): string;
|
|
137
|
+
/**
|
|
138
|
+
* Create hash for cache invalidation
|
|
139
|
+
*/
|
|
140
|
+
createCacheHash(files: any): string;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=cicd-optimizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cicd-optimizer.d.ts","sourceRoot":"","sources":["../src/cicd-optimizer.js"],"names":[],"mappings":";AAaA;IACE,0BASC;IARC,iBAAuD;IACvD,iBAA6D;IAC7D,2BAAkF;IAQpF;;OAEG;IACH;;;;;;;OAyCC;IAED;;OAEG;IACH;;;;;;;;MAyBC;IAED;;OAEG;IACH;;;;;SA6CC;IAED;;OAEG;IACH;;;;;;;;;;;;;;;;OA8CC;IAED;;OAEG;IACH;;;;;;SA0BC;IAED;;OAEG;IACH;;;;;OA2BC;IAED;;OAEG;IACH;;;;;MA+BC;IAED;;OAEG;IACH;;;;;;;;;;;;;;;;;OAYC;IAED;;OAEG;IACH;;;;;;;;;;;MA4EC;IAED;;OAEG;IACH;;;;;;MAiCC;IAED;;OAEG;IACH,6CA+CC;IAED;;OAEG;IACH,oCAQC;CACF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Archive command handler
|
|
3
|
+
* @param {string} changeId - Change identifier to archive
|
|
4
|
+
* @param {Object} options - Command options
|
|
5
|
+
*/
|
|
6
|
+
export function archiveCommand(changeId: string, options?: any): Promise<any>;
|
|
7
|
+
/**
|
|
8
|
+
* Load change folder structure
|
|
9
|
+
* @param {string} changeId - Change identifier
|
|
10
|
+
* @returns {Promise<Object|null>} Change data or null
|
|
11
|
+
*/
|
|
12
|
+
export function loadChange(changeId: string): Promise<any | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Validate all acceptance criteria are met
|
|
15
|
+
* @param {Object} workingSpec - Working specification
|
|
16
|
+
* @returns {Promise<Object>} Validation result
|
|
17
|
+
*/
|
|
18
|
+
export function validateAcceptanceCriteria(workingSpec: any): Promise<any>;
|
|
19
|
+
/**
|
|
20
|
+
* Validate change meets quality gates
|
|
21
|
+
* @param {string} changeId - Change identifier
|
|
22
|
+
* @returns {Promise<Object>} Quality gate result
|
|
23
|
+
*/
|
|
24
|
+
export function validateQualityGates(_changeId: any): Promise<any>;
|
|
25
|
+
/**
|
|
26
|
+
* Generate change summary for archival
|
|
27
|
+
* @param {Object} change - Change data
|
|
28
|
+
* @returns {Promise<string>} Summary text
|
|
29
|
+
*/
|
|
30
|
+
export function generateChangeSummary(change: any): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Archive change folder to archive directory
|
|
33
|
+
* @param {Object} change - Change data
|
|
34
|
+
* @returns {Promise<void>}
|
|
35
|
+
*/
|
|
36
|
+
export function archiveChange(change: any): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Update provenance with completion
|
|
39
|
+
* @param {Object} change - Change data
|
|
40
|
+
* @returns {Promise<void>}
|
|
41
|
+
*/
|
|
42
|
+
export function updateProvenance(change: any): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Display archive results
|
|
45
|
+
* @param {Object} change - Change data
|
|
46
|
+
* @param {Object} validation - Validation result
|
|
47
|
+
* @param {Object} qualityGates - Quality gates result
|
|
48
|
+
*/
|
|
49
|
+
export function displayArchiveResults(change: any, validation: any, qualityGates: any): void;
|
|
50
|
+
//# sourceMappingURL=archive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../src/commands/archive.js"],"names":[],"mappings":"AA8OA;;;;GAIG;AACH,yCAHW,MAAM,+BAqGhB;AAtUD;;;;GAIG;AACH,qCAHW,MAAM,GACJ,OAAO,CAAC,MAAO,IAAI,CAAC,CAgChC;AAED;;;;GAIG;AACH,8DAFa,OAAO,KAAQ,CA8B3B;AAED;;;;GAIG;AACH,sDAFa,OAAO,KAAQ,CAS3B;AAED;;;;GAIG;AACH,oDAFa,OAAO,CAAC,MAAM,CAAC,CAgC3B;AAED;;;;GAIG;AACH,4CAFa,OAAO,CAAC,IAAI,CAAC,CAazB;AAED;;;;GAIG;AACH,+CAFa,OAAO,CAAC,IAAI,CAAC,CAoCzB;AAED;;;;;GAKG;AACH,6FAiCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"burnup.d.ts","sourceRoot":"","sources":["../../src/commands/burnup.js"],"names":[],"mappings":"AAaA;;;GAGG;AACH,wCAFW,MAAM,iBAsEhB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diagnose command handler
|
|
3
|
+
* @param {Object} options - Command options
|
|
4
|
+
*/
|
|
5
|
+
export function diagnoseCommand(options?: any): Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Run all health checks
|
|
8
|
+
* @returns {Promise<Object>} Diagnosis results
|
|
9
|
+
*/
|
|
10
|
+
export function runDiagnosis(): Promise<any>;
|
|
11
|
+
/**
|
|
12
|
+
* Display diagnosis results
|
|
13
|
+
* @param {Object[]} results - Diagnosis results
|
|
14
|
+
*/
|
|
15
|
+
export function displayResults(results: any[]): void;
|
|
16
|
+
/**
|
|
17
|
+
* Apply automatic fixes
|
|
18
|
+
* @param {Object[]} results - Diagnosis results
|
|
19
|
+
* @returns {Promise<Object>} Fix results
|
|
20
|
+
*/
|
|
21
|
+
export function applyAutoFixes(results: any[]): Promise<any>;
|
|
22
|
+
/**
|
|
23
|
+
* Health check: Working spec validity
|
|
24
|
+
* @returns {Promise<Object>} Check result
|
|
25
|
+
*/
|
|
26
|
+
export function checkWorkingSpec(): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* Health check: Git repository
|
|
29
|
+
* @returns {Promise<Object>} Check result
|
|
30
|
+
*/
|
|
31
|
+
export function checkGitSetup(): Promise<any>;
|
|
32
|
+
/**
|
|
33
|
+
* Health check: Git hooks
|
|
34
|
+
* @returns {Promise<Object>} Check result
|
|
35
|
+
*/
|
|
36
|
+
export function checkGitHooks(): Promise<any>;
|
|
37
|
+
/**
|
|
38
|
+
* Health check: TypeScript configuration
|
|
39
|
+
* @returns {Promise<Object>} Check result
|
|
40
|
+
*/
|
|
41
|
+
export function checkTypeScriptConfig(): Promise<any>;
|
|
42
|
+
/**
|
|
43
|
+
* Health check: Test files exist
|
|
44
|
+
* @returns {Promise<Object>} Check result
|
|
45
|
+
*/
|
|
46
|
+
export function checkTestFiles(): Promise<any>;
|
|
47
|
+
/**
|
|
48
|
+
* Health check: CAWS tools directory
|
|
49
|
+
* @returns {Promise<Object>} Check result
|
|
50
|
+
*/
|
|
51
|
+
export function checkCAWSTools(): Promise<any>;
|
|
52
|
+
//# sourceMappingURL=diagnose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnose.d.ts","sourceRoot":"","sources":["../../src/commands/diagnose.js"],"names":[],"mappings":"AAubA;;;GAGG;AACH,8DAiDC;AApND;;;GAGG;AACH,gCAFa,OAAO,KAAQ,CAkD3B;AAED;;;GAGG;AACH,wCAFW,KAAQ,QA4ClB;AAED;;;;GAIG;AACH,wCAHW,KAAQ,GACN,OAAO,KAAQ,CAoD3B;AAtaD;;;GAGG;AACH,oCAFa,OAAO,KAAQ,CA2C3B;AAED;;;GAGG;AACH,iCAFa,OAAO,KAAQ,CAiB3B;AAED;;;GAGG;AACH,iCAFa,OAAO,KAAQ,CA0C3B;AAED;;;GAGG;AACH,yCAFa,OAAO,KAAQ,CAgE3B;AAED;;;GAGG;AACH,kCAFa,OAAO,KAAQ,CAoC3B;AAED;;;GAGG;AACH,kCAFa,OAAO,KAAQ,CAuC3B"}
|
|
@@ -481,9 +481,10 @@ async function diagnoseCommand(options = {}) {
|
|
|
481
481
|
|
|
482
482
|
if (issueCount === 0) {
|
|
483
483
|
console.log(chalk.blue('📚 Next steps:'));
|
|
484
|
-
console.log(chalk.blue(' • Run: caws status to view project health'));
|
|
484
|
+
console.log(chalk.blue(' • Run: caws status --visual to view project health'));
|
|
485
485
|
console.log(chalk.blue(' • Run: caws validate to check working spec'));
|
|
486
|
-
console.log(chalk.blue(' •
|
|
486
|
+
console.log(chalk.blue(' • Optional: Create .caws/policy.yaml for custom budgets'));
|
|
487
|
+
console.log(chalk.blue(' • Start implementing: caws iterate --current-state "Ready to begin"'));
|
|
487
488
|
}
|
|
488
489
|
} catch (error) {
|
|
489
490
|
console.error(chalk.red('\n❌ Error running diagnosis:'), error.message);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evaluate command handler
|
|
3
|
+
*
|
|
4
|
+
* @param {string} specFile - Path to working spec file
|
|
5
|
+
* @param {object} options - Command options
|
|
6
|
+
*/
|
|
7
|
+
export function evaluateCommand(specFile?: string, options?: object): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=evaluate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../src/commands/evaluate.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AACH,2CAHW,MAAM,YACN,MAAM,iBA0QhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.js"],"names":[],"mappings":"AAoBA;;GAEG;AACH,2EAseC"}
|
package/dist/commands/init.js
CHANGED
|
@@ -481,11 +481,31 @@ Happy coding! 🎯
|
|
|
481
481
|
console.log(chalk.blue('\nNext steps:'));
|
|
482
482
|
console.log('1. Review .caws/working-spec.yaml');
|
|
483
483
|
console.log('2. Customize the specification for your needs');
|
|
484
|
-
|
|
484
|
+
|
|
485
|
+
// Show contract requirements if Tier 1 or 2
|
|
486
|
+
// Use answers if available (interactive mode), otherwise default to 2
|
|
487
|
+
const riskTier = answers?.riskTier || 2;
|
|
488
|
+
if (riskTier === 1 || riskTier === 2) {
|
|
489
|
+
console.log(chalk.yellow('\n⚠️ Important: Contract Requirements'));
|
|
490
|
+
console.log(` Tier ${riskTier} changes require at least one contract.`);
|
|
491
|
+
console.log(' For infrastructure/setup work, add a minimal contract:');
|
|
492
|
+
console.log(chalk.gray(' contracts:'));
|
|
493
|
+
console.log(chalk.gray(' - type: "project_setup"'));
|
|
494
|
+
console.log(chalk.gray(' path: ".caws/working-spec.yaml"'));
|
|
495
|
+
console.log(chalk.gray(' description: "Project-level CAWS configuration"'));
|
|
496
|
+
console.log(' Or use "chore" mode for maintenance work (mode: chore)');
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
console.log('\n📋 Recommended Setup Workflow:');
|
|
500
|
+
console.log(' 1. Review .caws/working-spec.yaml');
|
|
501
|
+
console.log(' 2. Run: caws scaffold (adds tools and templates)');
|
|
502
|
+
console.log(' 3. Run: caws validate (verify setup)');
|
|
503
|
+
console.log(' 4. Run: caws diagnose (check health)');
|
|
504
|
+
console.log(' 5. Optional: Create .caws/policy.yaml for custom budgets');
|
|
485
505
|
if (answers?.useCursorHooks || options.interactive === false) {
|
|
486
|
-
console.log('
|
|
506
|
+
console.log(' 6. Restart Cursor IDE to activate quality gates');
|
|
487
507
|
}
|
|
488
|
-
console.log('
|
|
508
|
+
console.log('\n💡 Quick start: caws scaffold && caws validate && caws diagnose');
|
|
489
509
|
} catch (error) {
|
|
490
510
|
console.error(chalk.red('❌ Error during initialization:'), error.message);
|
|
491
511
|
if (error.stack) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Iterate command handler
|
|
3
|
+
*
|
|
4
|
+
* @param {string} specFile - Path to working spec file
|
|
5
|
+
* @param {object} options - Command options
|
|
6
|
+
*/
|
|
7
|
+
export function iterateCommand(specFile?: string, options?: object): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=iterate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iterate.d.ts","sourceRoot":"","sources":["../../src/commands/iterate.js"],"names":[],"mappings":"AAiBA;;;;;GAKG;AACH,0CAHW,MAAM,YACN,MAAM,iBAgLhB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mode command handler
|
|
3
|
+
* @param {string} action - Action to perform (current, set, compare, recommend)
|
|
4
|
+
* @param {Object} options - Command options
|
|
5
|
+
*/
|
|
6
|
+
export function modeCommand(action: string, options?: any): Promise<any>;
|
|
7
|
+
import { getCurrentMode } from "../config/modes";
|
|
8
|
+
import { setCurrentMode } from "../config/modes";
|
|
9
|
+
/**
|
|
10
|
+
* Display current mode status
|
|
11
|
+
*/
|
|
12
|
+
export function displayCurrentMode(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Display mode details
|
|
15
|
+
* @param {string} mode - Mode to display
|
|
16
|
+
*/
|
|
17
|
+
export function displayModeDetails(mode: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* Interactive mode selection
|
|
20
|
+
* @returns {Promise<string>} Selected mode
|
|
21
|
+
*/
|
|
22
|
+
export function interactiveModeSelection(): Promise<string>;
|
|
23
|
+
export { getCurrentMode, setCurrentMode };
|
|
24
|
+
//# sourceMappingURL=mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mode.d.ts","sourceRoot":"","sources":["../../src/commands/mode.js"],"names":[],"mappings":"AAuHA;;;;GAIG;AACH,oCAHW,MAAM,+BAgIhB;;;AAvOD;;GAEG;AACH,2CAOC;AAED;;;GAGG;AACH,yCAFW,MAAM,QA+ChB;AAED;;;GAGG;AACH,4CAFa,OAAO,CAAC,MAAM,CAAC,CAkC3B"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan command handler
|
|
3
|
+
* @param {string} action - Action to perform (generate)
|
|
4
|
+
* @param {Object} options - Command options
|
|
5
|
+
*/
|
|
6
|
+
export function planCommand(action: string, options?: any): Promise<any>;
|
|
7
|
+
/**
|
|
8
|
+
* Generate implementation plan from spec
|
|
9
|
+
* @param {Object} spec - Spec data
|
|
10
|
+
* @returns {Object} Generated plan
|
|
11
|
+
*/
|
|
12
|
+
export function generateImplementationPlan(spec: any): any;
|
|
13
|
+
/**
|
|
14
|
+
* Write plan to file
|
|
15
|
+
* @param {Object} plan - Plan data
|
|
16
|
+
* @param {string} outputPath - Output file path
|
|
17
|
+
* @returns {Promise<void>}
|
|
18
|
+
*/
|
|
19
|
+
export function writePlanToFile(plan: any, outputPath: string): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Generate markdown content from plan
|
|
22
|
+
* @param {Object} plan - Plan data
|
|
23
|
+
* @returns {string} Markdown content
|
|
24
|
+
*/
|
|
25
|
+
export function generatePlanMarkdown(plan: any): string;
|
|
26
|
+
/**
|
|
27
|
+
* Display generated plan
|
|
28
|
+
* @param {Object} plan - Plan data
|
|
29
|
+
*/
|
|
30
|
+
export function displayGeneratedPlan(plan: any): void;
|
|
31
|
+
export namespace PLAN_TEMPLATES {
|
|
32
|
+
namespace feature {
|
|
33
|
+
let sections: string[];
|
|
34
|
+
let defaultTasks: string[];
|
|
35
|
+
}
|
|
36
|
+
namespace fix {
|
|
37
|
+
let sections_1: string[];
|
|
38
|
+
export { sections_1 as sections };
|
|
39
|
+
let defaultTasks_1: string[];
|
|
40
|
+
export { defaultTasks_1 as defaultTasks };
|
|
41
|
+
}
|
|
42
|
+
namespace refactor {
|
|
43
|
+
let sections_2: string[];
|
|
44
|
+
export { sections_2 as sections };
|
|
45
|
+
let defaultTasks_2: string[];
|
|
46
|
+
export { defaultTasks_2 as defaultTasks };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/commands/plan.js"],"names":[],"mappings":"AA6XA;;;;GAIG;AACH,oCAHW,MAAM,+BAuDhB;AA1OD;;;;GAIG;AACH,2DA8CC;AAED;;;;;GAKG;AACH,uDAHW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAQzB;AAED;;;;GAIG;AACH,iDAFa,MAAM,CAiElB;AAED;;;GAGG;AACH,sDAkCC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provenance command handler
|
|
3
|
+
* @param {string} subcommand - The subcommand to execute
|
|
4
|
+
* @param {Object} options - Command options
|
|
5
|
+
*/
|
|
6
|
+
export function provenanceCommand(subcommand: string, options: any): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Update provenance with new commit information
|
|
9
|
+
* @param {Object} options - Command options
|
|
10
|
+
*/
|
|
11
|
+
export function updateProvenance(options: any): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Show current provenance information
|
|
14
|
+
* @param {Object} options - Command options
|
|
15
|
+
*/
|
|
16
|
+
export function showProvenance(options: any): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Verify provenance chain integrity
|
|
19
|
+
* @param {Object} options - Command options
|
|
20
|
+
*/
|
|
21
|
+
export function verifyProvenance(options: any): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Initialize provenance tracking for the project
|
|
24
|
+
* @param {Object} options - Command options
|
|
25
|
+
*/
|
|
26
|
+
export function initProvenance(options: any): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Install git hooks for automatic provenance updates
|
|
29
|
+
* @param {Object} options - Command options
|
|
30
|
+
*/
|
|
31
|
+
export function installHooks(options: any): Promise<void>;
|
|
32
|
+
//# sourceMappingURL=provenance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../../src/commands/provenance.js"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,8CAHW,MAAM,+BA2BhB;AAED;;;GAGG;AACH,8DA4EC;AAED;;;GAGG;AACH,4DAyEC;AAED;;;GAGG;AACH,8DA8CC;AA6iBD;;;GAGG;AACH,4DAmEC;AAzcD;;;GAGG;AACH,0DAwEC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quality Gates Configuration
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Update provenance with quality gates results
|
|
6
|
+
* @param {Object} results - Quality gates results
|
|
7
|
+
* @param {boolean} crisisMode - Whether in crisis mode
|
|
8
|
+
* @param {string[]} stagedFiles - Array of staged files
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Detect agent type for provenance tracking
|
|
12
|
+
* @returns {string} Agent type identifier
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Check if a waiver applies to the given gate
|
|
16
|
+
* @param {string} gate - Gate name to check
|
|
17
|
+
* @returns {Object} Waiver check result
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Detect if project is in crisis response mode
|
|
21
|
+
* @returns {boolean} True if in crisis mode
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Get staged files from git
|
|
25
|
+
* @returns {string[]} Array of staged file paths
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Check for god objects in staged Rust files with waiver and crisis mode support
|
|
29
|
+
* @param {string[]} stagedFiles - Array of staged file paths
|
|
30
|
+
* @param {boolean} crisisMode - Whether in crisis response mode
|
|
31
|
+
* @returns {Object} God object analysis results
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Check for hidden TODOs in staged files with waiver and crisis mode support
|
|
35
|
+
* @param {string[]} stagedFiles - Array of staged file paths
|
|
36
|
+
* @param {boolean} crisisMode - Whether in crisis response mode
|
|
37
|
+
* @returns {Object} TODO analysis results
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Check for human override in working spec
|
|
41
|
+
* @returns {Object} Human override check result
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* Get CAWS tier from working spec
|
|
45
|
+
* @returns {number|null} CAWS tier (1, 2, or 3) or null if not found
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* Run comprehensive quality gates on staged files
|
|
49
|
+
* @param {Object} options - Command options
|
|
50
|
+
*/
|
|
51
|
+
export function qualityGatesCommand(options?: any): Promise<any>;
|
|
52
|
+
//# sourceMappingURL=quality-gates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quality-gates.d.ts","sourceRoot":"","sources":["../../src/commands/quality-gates.js"],"names":[],"mappings":"AAqBA;;GAEG;AAkBH;;;;;GAKG;AAGH;;;GAGG;AA6BH;;;;GAIG;AAiCH;;;GAGG;AAoCH;;;GAGG;AAeH;;;;;GAKG;AAmFH;;;;;GAKG;AAqEH;;;GAGG;AA0BH;;;GAGG;AAaH;;;GAGG;AACH,iEAmGC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quality monitor command handler
|
|
3
|
+
*
|
|
4
|
+
* @param {string} action - Type of action to monitor
|
|
5
|
+
* @param {object} options - Command options
|
|
6
|
+
*/
|
|
7
|
+
export function qualityMonitorCommand(action: string, options?: object): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Analyze quality impact of an action
|
|
10
|
+
*
|
|
11
|
+
* @param {string} action - Type of action (file_saved, code_edited, test_run)
|
|
12
|
+
* @param {array} files - Files affected by the action
|
|
13
|
+
* @param {object} context - Additional context information
|
|
14
|
+
* @returns {object} Quality analysis
|
|
15
|
+
*/
|
|
16
|
+
export function analyzeQualityImpact(action: string, files?: any[], context?: object): object;
|
|
17
|
+
//# sourceMappingURL=quality-monitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quality-monitor.d.ts","sourceRoot":"","sources":["../../src/commands/quality-monitor.js"],"names":[],"mappings":"AAoIA;;;;;GAKG;AACH,8CAHW,MAAM,YACN,MAAM,iBA2HhB;AArPD;;;;;;;GAOG;AACH,6CALW,MAAM,2BAEN,MAAM,GACJ,MAAM,CA8GlB"}
|