@paths.design/caws-cli 5.0.1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -12
- 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/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/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/provenance.js +27 -22
- package/dist/commands/quality-gates.d.ts +52 -0
- package/dist/commands/quality-gates.d.ts.map +1 -0
- package/dist/commands/quality-gates.js +190 -455
- 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/specs.js +34 -35
- package/dist/commands/status.d.ts +44 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +10 -7
- package/dist/commands/templates.d.ts +74 -0
- package/dist/commands/templates.d.ts.map +1 -0
- package/dist/commands/tool.d.ts +13 -0
- package/dist/commands/tool.d.ts.map +1 -0
- package/dist/commands/tool.js +63 -63
- 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/waivers.d.ts +8 -0
- package/dist/commands/waivers.d.ts.map +1 -0
- package/dist/commands/waivers.js +38 -39
- 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/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 +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/policy/PolicyManager.js +60 -28
- package/dist/scaffold/cursor-hooks.d.ts +7 -0
- package/dist/scaffold/cursor-hooks.d.ts.map +1 -0
- 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 +89 -27
- package/dist/scaffold/index.d.ts +20 -0
- package/dist/scaffold/index.d.ts.map +1 -0
- package/dist/scaffold/index.js +25 -0
- 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/async-utils.js +188 -0
- package/dist/utils/command-wrapper.js +200 -0
- package/dist/utils/detection.d.ts +7 -0
- package/dist/utils/detection.d.ts.map +1 -0
- 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/promise-utils.js +72 -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/waivers-manager.d.ts +167 -0
- package/dist/waivers-manager.d.ts.map +1 -0
- package/package.json +1 -1
- package/templates/apps/tools/caws/prompt-lint.js.backup +274 -0
- package/templates/apps/tools/caws/provenance.js.backup +73 -0
package/dist/commands/waivers.js
CHANGED
|
@@ -14,6 +14,7 @@ const yaml = require('js-yaml');
|
|
|
14
14
|
const chalk = require('chalk');
|
|
15
15
|
const { initializeGlobalSetup } = require('../config');
|
|
16
16
|
const WaiversManager = require('../waivers-manager');
|
|
17
|
+
const { commandWrapper, Output } = require('../utils/command-wrapper');
|
|
17
18
|
|
|
18
19
|
const WAIVER_DIR = '.caws/waivers';
|
|
19
20
|
|
|
@@ -24,46 +25,44 @@ const WAIVER_DIR = '.caws/waivers';
|
|
|
24
25
|
* @param {object} options - Command options
|
|
25
26
|
*/
|
|
26
27
|
async function waiversCommand(subcommand = 'list', options = {}) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
28
|
+
return commandWrapper(
|
|
29
|
+
async () => {
|
|
30
|
+
Output.info('Detecting CAWS setup...');
|
|
31
|
+
const setup = initializeGlobalSetup();
|
|
32
|
+
|
|
33
|
+
if (setup.hasWorkingSpec) {
|
|
34
|
+
Output.success(`Detected ${setup.setupType} CAWS setup`, {
|
|
35
|
+
capabilities: setup.capabilities,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Ensure waivers directory exists
|
|
40
|
+
const waiversDir = path.join(process.cwd(), WAIVER_DIR);
|
|
41
|
+
if (!fs.existsSync(waiversDir)) {
|
|
42
|
+
fs.mkdirSync(waiversDir, { recursive: true });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
switch (subcommand) {
|
|
46
|
+
case 'create':
|
|
47
|
+
return await createWaiver(options);
|
|
48
|
+
case 'list':
|
|
49
|
+
return await listWaivers(options);
|
|
50
|
+
case 'show':
|
|
51
|
+
return await showWaiver(options.id, options);
|
|
52
|
+
case 'revoke':
|
|
53
|
+
return await revokeWaiver(options.id, options);
|
|
54
|
+
default:
|
|
55
|
+
throw new Error(
|
|
56
|
+
`Unknown waiver subcommand: ${subcommand}.\n` +
|
|
57
|
+
'Available subcommands: create, list, show, revoke'
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
commandName: `waivers ${subcommand}`,
|
|
63
|
+
context: { subcommand, options },
|
|
59
64
|
}
|
|
60
|
-
|
|
61
|
-
console.error(chalk.red(`\n❌ Waiver command failed: ${error.message}`));
|
|
62
|
-
if (options.verbose) {
|
|
63
|
-
console.error(error.stack);
|
|
64
|
-
}
|
|
65
|
-
process.exit(1);
|
|
66
|
-
}
|
|
65
|
+
);
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
/**
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow command handler
|
|
3
|
+
*
|
|
4
|
+
* @param {string} workflowType - Type of workflow
|
|
5
|
+
* @param {object} options - Command options
|
|
6
|
+
*/
|
|
7
|
+
export function workflowCommand(workflowType: string, options?: object): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Generate workflow guidance
|
|
10
|
+
*
|
|
11
|
+
* @param {string} workflowType - Type of workflow (tdd, refactor, feature)
|
|
12
|
+
* @param {number} currentStep - Current step number (1-based)
|
|
13
|
+
* @param {object} context - Optional context information
|
|
14
|
+
* @returns {object} Workflow guidance
|
|
15
|
+
*/
|
|
16
|
+
export function generateWorkflowGuidance(workflowType: string, currentStep: number, context?: object): object;
|
|
17
|
+
export namespace WORKFLOW_TEMPLATES {
|
|
18
|
+
namespace tdd {
|
|
19
|
+
let name: string;
|
|
20
|
+
let steps: string[];
|
|
21
|
+
let guidance: {
|
|
22
|
+
1: string;
|
|
23
|
+
2: string;
|
|
24
|
+
3: string;
|
|
25
|
+
4: string;
|
|
26
|
+
5: string;
|
|
27
|
+
6: string;
|
|
28
|
+
};
|
|
29
|
+
let recommendations: {
|
|
30
|
+
1: string[];
|
|
31
|
+
2: string[];
|
|
32
|
+
3: string[];
|
|
33
|
+
4: string[];
|
|
34
|
+
5: string[];
|
|
35
|
+
6: string[];
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
namespace refactor {
|
|
39
|
+
let name_1: string;
|
|
40
|
+
export { name_1 as name };
|
|
41
|
+
let steps_1: string[];
|
|
42
|
+
export { steps_1 as steps };
|
|
43
|
+
let guidance_1: {
|
|
44
|
+
1: string;
|
|
45
|
+
2: string;
|
|
46
|
+
3: string;
|
|
47
|
+
4: string;
|
|
48
|
+
5: string;
|
|
49
|
+
};
|
|
50
|
+
export { guidance_1 as guidance };
|
|
51
|
+
let recommendations_1: {
|
|
52
|
+
1: string[];
|
|
53
|
+
2: string[];
|
|
54
|
+
3: string[];
|
|
55
|
+
4: string[];
|
|
56
|
+
5: string[];
|
|
57
|
+
};
|
|
58
|
+
export { recommendations_1 as recommendations };
|
|
59
|
+
}
|
|
60
|
+
namespace feature {
|
|
61
|
+
let name_2: string;
|
|
62
|
+
export { name_2 as name };
|
|
63
|
+
let steps_2: string[];
|
|
64
|
+
export { steps_2 as steps };
|
|
65
|
+
let guidance_2: {
|
|
66
|
+
1: string;
|
|
67
|
+
2: string;
|
|
68
|
+
3: string;
|
|
69
|
+
4: string;
|
|
70
|
+
5: string;
|
|
71
|
+
6: string;
|
|
72
|
+
};
|
|
73
|
+
export { guidance_2 as guidance };
|
|
74
|
+
let recommendations_2: {
|
|
75
|
+
1: string[];
|
|
76
|
+
2: string[];
|
|
77
|
+
3: string[];
|
|
78
|
+
4: string[];
|
|
79
|
+
5: string[];
|
|
80
|
+
6: string[];
|
|
81
|
+
};
|
|
82
|
+
export { recommendations_2 as recommendations };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/commands/workflow.js"],"names":[],"mappings":"AA2IA;;;;;GAKG;AACH,8CAHW,MAAM,YACN,MAAM,iBA6FhB;AA7ID;;;;;;;GAOG;AACH,uDALW,MAAM,eACN,MAAM,YACN,MAAM,GACJ,MAAM,CAoClB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
export namespace COMPLEXITY_TIERS {
|
|
2
|
+
namespace simple {
|
|
3
|
+
let name: string;
|
|
4
|
+
let description: string;
|
|
5
|
+
let color: chalk.Chalk;
|
|
6
|
+
let icon: string;
|
|
7
|
+
namespace features {
|
|
8
|
+
let workingSpec: boolean;
|
|
9
|
+
let basicValidation: boolean;
|
|
10
|
+
let statusDisplay: boolean;
|
|
11
|
+
let noQualityGates: boolean;
|
|
12
|
+
let noProvenance: boolean;
|
|
13
|
+
let noWaivers: boolean;
|
|
14
|
+
let noChangeBudgets: boolean;
|
|
15
|
+
let noMultiSpec: boolean;
|
|
16
|
+
}
|
|
17
|
+
namespace qualityRequirements {
|
|
18
|
+
let testCoverage: number;
|
|
19
|
+
let mutationScore: number;
|
|
20
|
+
let contracts: string;
|
|
21
|
+
}
|
|
22
|
+
let riskTiers: string[];
|
|
23
|
+
namespace commands {
|
|
24
|
+
let init: boolean;
|
|
25
|
+
let validate: boolean;
|
|
26
|
+
let status: boolean;
|
|
27
|
+
let specs: boolean;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
namespace standard {
|
|
31
|
+
let name_1: string;
|
|
32
|
+
export { name_1 as name };
|
|
33
|
+
let description_1: string;
|
|
34
|
+
export { description_1 as description };
|
|
35
|
+
let color_1: chalk.Chalk;
|
|
36
|
+
export { color_1 as color };
|
|
37
|
+
let icon_1: string;
|
|
38
|
+
export { icon_1 as icon };
|
|
39
|
+
export namespace features_1 {
|
|
40
|
+
let workingSpec_1: boolean;
|
|
41
|
+
export { workingSpec_1 as workingSpec };
|
|
42
|
+
export let fullValidation: boolean;
|
|
43
|
+
let statusDisplay_1: boolean;
|
|
44
|
+
export { statusDisplay_1 as statusDisplay };
|
|
45
|
+
export let qualityGates: boolean;
|
|
46
|
+
export let provenance: boolean;
|
|
47
|
+
export let waivers: boolean;
|
|
48
|
+
export let changeBudgets: boolean;
|
|
49
|
+
export let multiSpec: boolean;
|
|
50
|
+
export let changeFolders: boolean;
|
|
51
|
+
}
|
|
52
|
+
export { features_1 as features };
|
|
53
|
+
export namespace qualityRequirements_1 {
|
|
54
|
+
let testCoverage_1: number;
|
|
55
|
+
export { testCoverage_1 as testCoverage };
|
|
56
|
+
let mutationScore_1: number;
|
|
57
|
+
export { mutationScore_1 as mutationScore };
|
|
58
|
+
let contracts_1: string;
|
|
59
|
+
export { contracts_1 as contracts };
|
|
60
|
+
}
|
|
61
|
+
export { qualityRequirements_1 as qualityRequirements };
|
|
62
|
+
let riskTiers_1: string[];
|
|
63
|
+
export { riskTiers_1 as riskTiers };
|
|
64
|
+
export namespace commands_1 {
|
|
65
|
+
let init_1: boolean;
|
|
66
|
+
export { init_1 as init };
|
|
67
|
+
let validate_1: boolean;
|
|
68
|
+
export { validate_1 as validate };
|
|
69
|
+
let status_1: boolean;
|
|
70
|
+
export { status_1 as status };
|
|
71
|
+
let specs_1: boolean;
|
|
72
|
+
export { specs_1 as specs };
|
|
73
|
+
export let diagnose: boolean;
|
|
74
|
+
export let evaluate: boolean;
|
|
75
|
+
export let iterate: boolean;
|
|
76
|
+
let provenance_1: boolean;
|
|
77
|
+
export { provenance_1 as provenance };
|
|
78
|
+
let waivers_1: boolean;
|
|
79
|
+
export { waivers_1 as waivers };
|
|
80
|
+
export let hooks: boolean;
|
|
81
|
+
export let archive: boolean;
|
|
82
|
+
}
|
|
83
|
+
export { commands_1 as commands };
|
|
84
|
+
}
|
|
85
|
+
namespace enterprise {
|
|
86
|
+
let name_2: string;
|
|
87
|
+
export { name_2 as name };
|
|
88
|
+
let description_2: string;
|
|
89
|
+
export { description_2 as description };
|
|
90
|
+
let color_2: chalk.Chalk;
|
|
91
|
+
export { color_2 as color };
|
|
92
|
+
let icon_2: string;
|
|
93
|
+
export { icon_2 as icon };
|
|
94
|
+
export namespace features_2 {
|
|
95
|
+
let workingSpec_2: boolean;
|
|
96
|
+
export { workingSpec_2 as workingSpec };
|
|
97
|
+
let fullValidation_1: boolean;
|
|
98
|
+
export { fullValidation_1 as fullValidation };
|
|
99
|
+
let statusDisplay_2: boolean;
|
|
100
|
+
export { statusDisplay_2 as statusDisplay };
|
|
101
|
+
let qualityGates_1: boolean;
|
|
102
|
+
export { qualityGates_1 as qualityGates };
|
|
103
|
+
let provenance_2: boolean;
|
|
104
|
+
export { provenance_2 as provenance };
|
|
105
|
+
let waivers_2: boolean;
|
|
106
|
+
export { waivers_2 as waivers };
|
|
107
|
+
let changeBudgets_1: boolean;
|
|
108
|
+
export { changeBudgets_1 as changeBudgets };
|
|
109
|
+
let multiSpec_1: boolean;
|
|
110
|
+
export { multiSpec_1 as multiSpec };
|
|
111
|
+
let changeFolders_1: boolean;
|
|
112
|
+
export { changeFolders_1 as changeFolders };
|
|
113
|
+
export let auditTrails: boolean;
|
|
114
|
+
export let compliance: boolean;
|
|
115
|
+
export let advancedMonitoring: boolean;
|
|
116
|
+
}
|
|
117
|
+
export { features_2 as features };
|
|
118
|
+
export namespace qualityRequirements_2 {
|
|
119
|
+
let testCoverage_2: number;
|
|
120
|
+
export { testCoverage_2 as testCoverage };
|
|
121
|
+
let mutationScore_2: number;
|
|
122
|
+
export { mutationScore_2 as mutationScore };
|
|
123
|
+
let contracts_2: string;
|
|
124
|
+
export { contracts_2 as contracts };
|
|
125
|
+
}
|
|
126
|
+
export { qualityRequirements_2 as qualityRequirements };
|
|
127
|
+
let riskTiers_2: string[];
|
|
128
|
+
export { riskTiers_2 as riskTiers };
|
|
129
|
+
export namespace commands_2 {
|
|
130
|
+
let init_2: boolean;
|
|
131
|
+
export { init_2 as init };
|
|
132
|
+
let validate_2: boolean;
|
|
133
|
+
export { validate_2 as validate };
|
|
134
|
+
let status_2: boolean;
|
|
135
|
+
export { status_2 as status };
|
|
136
|
+
let specs_2: boolean;
|
|
137
|
+
export { specs_2 as specs };
|
|
138
|
+
let diagnose_1: boolean;
|
|
139
|
+
export { diagnose_1 as diagnose };
|
|
140
|
+
let evaluate_1: boolean;
|
|
141
|
+
export { evaluate_1 as evaluate };
|
|
142
|
+
let iterate_1: boolean;
|
|
143
|
+
export { iterate_1 as iterate };
|
|
144
|
+
let provenance_3: boolean;
|
|
145
|
+
export { provenance_3 as provenance };
|
|
146
|
+
let waivers_3: boolean;
|
|
147
|
+
export { waivers_3 as waivers };
|
|
148
|
+
let hooks_1: boolean;
|
|
149
|
+
export { hooks_1 as hooks };
|
|
150
|
+
let archive_1: boolean;
|
|
151
|
+
export { archive_1 as archive };
|
|
152
|
+
export let troubleshoot: boolean;
|
|
153
|
+
export let testAnalysis: boolean;
|
|
154
|
+
export let qualityMonitor: boolean;
|
|
155
|
+
}
|
|
156
|
+
export { commands_2 as commands };
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Get tier information
|
|
161
|
+
* @param {string} tier - Tier name
|
|
162
|
+
* @returns {Object} Tier configuration
|
|
163
|
+
*/
|
|
164
|
+
export function getTier(tier: string): any;
|
|
165
|
+
/**
|
|
166
|
+
* Get available tiers
|
|
167
|
+
* @returns {string[]} Array of tier names
|
|
168
|
+
*/
|
|
169
|
+
export function getAvailableTiers(): string[];
|
|
170
|
+
/**
|
|
171
|
+
* Get current mode from configuration
|
|
172
|
+
* @returns {Promise<string>} Current mode
|
|
173
|
+
*/
|
|
174
|
+
export function getCurrentMode(): Promise<string>;
|
|
175
|
+
/**
|
|
176
|
+
* Set current mode in configuration
|
|
177
|
+
* @param {string} mode - Mode to set
|
|
178
|
+
* @returns {Promise<boolean>} Success status
|
|
179
|
+
*/
|
|
180
|
+
export function setCurrentMode(mode: string): Promise<boolean>;
|
|
181
|
+
/**
|
|
182
|
+
* Check if a command is available in the current tier
|
|
183
|
+
* @param {string} command - Command name
|
|
184
|
+
* @param {string} tier - Tier name
|
|
185
|
+
* @returns {boolean} Whether command is available
|
|
186
|
+
*/
|
|
187
|
+
export function isCommandAvailable(command: string, tier?: string): boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Check if a feature is enabled in the current tier
|
|
190
|
+
* @param {string} feature - Feature name
|
|
191
|
+
* @param {string} tier - Tier name
|
|
192
|
+
* @returns {boolean} Whether feature is enabled
|
|
193
|
+
*/
|
|
194
|
+
export function isFeatureEnabled(feature: string, tier?: string): boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Get quality requirements for a tier
|
|
197
|
+
* @param {string} tier - Tier name
|
|
198
|
+
* @returns {Object} Quality requirements
|
|
199
|
+
*/
|
|
200
|
+
export function getQualityRequirements(tier?: string): any;
|
|
201
|
+
/**
|
|
202
|
+
* Get supported risk tiers for a complexity tier
|
|
203
|
+
* @param {string} tier - Tier name
|
|
204
|
+
* @returns {string[]} Supported risk tiers
|
|
205
|
+
*/
|
|
206
|
+
export function getSupportedRiskTiers(tier?: string): string[];
|
|
207
|
+
/**
|
|
208
|
+
* Validate if a risk tier is supported in the current complexity tier
|
|
209
|
+
* @param {string} riskTier - Risk tier to validate
|
|
210
|
+
* @param {string} complexityTier - Complexity tier
|
|
211
|
+
* @returns {boolean} Whether risk tier is supported
|
|
212
|
+
*/
|
|
213
|
+
export function isRiskTierSupported(riskTier: string, complexityTier?: string): boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Display tier comparison
|
|
216
|
+
*/
|
|
217
|
+
export function displayTierComparison(): void;
|
|
218
|
+
/**
|
|
219
|
+
* Get tier recommendation based on project characteristics
|
|
220
|
+
* @param {Object} projectInfo - Project information
|
|
221
|
+
* @returns {string} Recommended tier
|
|
222
|
+
*/
|
|
223
|
+
export function getTierRecommendation(projectInfo?: any): string;
|
|
224
|
+
import chalk = require("chalk");
|
|
225
|
+
//# sourceMappingURL=modes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modes.d.ts","sourceRoot":"","sources":["../../src/config/modes.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2HA;;;;GAIG;AACH,8BAHW,MAAM,OAKhB;AAED;;;GAGG;AACH,qCAFa,MAAM,EAAE,CAIpB;AA8FD;;;GAGG;AACH,kCAFa,OAAO,CAAC,MAAM,CAAC,CAgB3B;AAED;;;;GAIG;AACH,qCAHW,MAAM,GACJ,OAAO,CAAC,OAAO,CAAC,CAuB5B;AA1ID;;;;;GAKG;AACH,4CAJW,MAAM,SACN,MAAM,GACJ,OAAO,CAKnB;AAED;;;;;GAKG;AACH,0CAJW,MAAM,SACN,MAAM,GACJ,OAAO,CAKnB;AAED;;;;GAIG;AACH,8CAHW,MAAM,OAMhB;AAED;;;;GAIG;AACH,6CAHW,MAAM,GACJ,MAAM,EAAE,CAKpB;AAED;;;;;GAKG;AACH,8CAJW,MAAM,mBACN,MAAM,GACJ,OAAO,CAKnB;AAED;;GAEG;AACH,8CAkCC;AAkDD;;;;GAIG;AACH,0DAFa,MAAM,CAsBlB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export namespace SPEC_TYPES {
|
|
2
|
+
namespace feature {
|
|
3
|
+
let color: chalk.Chalk;
|
|
4
|
+
let icon: string;
|
|
5
|
+
let description: string;
|
|
6
|
+
}
|
|
7
|
+
namespace fix {
|
|
8
|
+
let color_1: chalk.Chalk;
|
|
9
|
+
export { color_1 as color };
|
|
10
|
+
let icon_1: string;
|
|
11
|
+
export { icon_1 as icon };
|
|
12
|
+
let description_1: string;
|
|
13
|
+
export { description_1 as description };
|
|
14
|
+
}
|
|
15
|
+
namespace refactor {
|
|
16
|
+
let color_2: chalk.Chalk;
|
|
17
|
+
export { color_2 as color };
|
|
18
|
+
let icon_2: string;
|
|
19
|
+
export { icon_2 as icon };
|
|
20
|
+
let description_2: string;
|
|
21
|
+
export { description_2 as description };
|
|
22
|
+
}
|
|
23
|
+
namespace chore {
|
|
24
|
+
let color_3: chalk.Chalk;
|
|
25
|
+
export { color_3 as color };
|
|
26
|
+
let icon_3: string;
|
|
27
|
+
export { icon_3 as icon };
|
|
28
|
+
let description_3: string;
|
|
29
|
+
export { description_3 as description };
|
|
30
|
+
}
|
|
31
|
+
namespace docs {
|
|
32
|
+
let color_4: chalk.Chalk;
|
|
33
|
+
export { color_4 as color };
|
|
34
|
+
let icon_4: string;
|
|
35
|
+
export { icon_4 as icon };
|
|
36
|
+
let description_4: string;
|
|
37
|
+
export { description_4 as description };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
import chalk = require("chalk");
|
|
41
|
+
//# sourceMappingURL=spec-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-types.d.ts","sourceRoot":"","sources":["../../src/constants/spec-types.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,164 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|