@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
|
@@ -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"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Specs command handler
|
|
3
|
+
* @param {string} action - Action to perform (list, create, show, update, delete, conflicts, migrate)
|
|
4
|
+
* @param {Object} options - Command options
|
|
5
|
+
*/
|
|
6
|
+
export function specsCommand(action: string, options?: any): Promise<any>;
|
|
7
|
+
/**
|
|
8
|
+
* Load specs registry
|
|
9
|
+
* @returns {Promise<Object>} Registry data
|
|
10
|
+
*/
|
|
11
|
+
export function loadSpecsRegistry(): Promise<any>;
|
|
12
|
+
/**
|
|
13
|
+
* Save specs registry
|
|
14
|
+
* @param {Object} registry - Registry data
|
|
15
|
+
* @returns {Promise<void>}
|
|
16
|
+
*/
|
|
17
|
+
export function saveSpecsRegistry(registry: any): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* List all spec files in the specs directory
|
|
20
|
+
* @returns {Promise<Array>} Array of spec file info
|
|
21
|
+
*/
|
|
22
|
+
export function listSpecFiles(): Promise<any[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Create a new spec file
|
|
25
|
+
* @param {string} id - Spec identifier
|
|
26
|
+
* @param {Object} options - Creation options
|
|
27
|
+
* @returns {Promise<Object>} Created spec info
|
|
28
|
+
*/
|
|
29
|
+
export function createSpec(id: string, options?: any): Promise<any>;
|
|
30
|
+
/**
|
|
31
|
+
* Load a specific spec file
|
|
32
|
+
* @param {string} id - Spec identifier
|
|
33
|
+
* @returns {Promise<Object|null>} Spec data or null
|
|
34
|
+
*/
|
|
35
|
+
export function loadSpec(id: string): Promise<any | null>;
|
|
36
|
+
/**
|
|
37
|
+
* Update a spec file
|
|
38
|
+
* @param {string} id - Spec identifier
|
|
39
|
+
* @param {Object} updates - Updates to apply
|
|
40
|
+
* @returns {Promise<boolean>} Success status
|
|
41
|
+
*/
|
|
42
|
+
export function updateSpec(id: string, updates?: any): Promise<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Delete a spec file
|
|
45
|
+
* @param {string} id - Spec identifier
|
|
46
|
+
* @returns {Promise<boolean>} Success status
|
|
47
|
+
*/
|
|
48
|
+
export function deleteSpec(id: string): Promise<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* Display specs in a formatted table
|
|
51
|
+
* @param {Array} specs - Array of spec objects
|
|
52
|
+
*/
|
|
53
|
+
export function displaySpecsTable(specs: any[]): void;
|
|
54
|
+
/**
|
|
55
|
+
* Display detailed spec information
|
|
56
|
+
* @param {Object} spec - Spec object
|
|
57
|
+
*/
|
|
58
|
+
export function displaySpecDetails(spec: any): void;
|
|
59
|
+
/**
|
|
60
|
+
* Ask user how to resolve spec creation conflicts
|
|
61
|
+
* @returns {Promise<string>} User's choice: 'cancel', 'rename', 'merge', 'override'
|
|
62
|
+
*/
|
|
63
|
+
export function askConflictResolution(): Promise<string>;
|
|
64
|
+
/**
|
|
65
|
+
* Specs directory structure
|
|
66
|
+
*/
|
|
67
|
+
export const SPECS_DIR: ".caws/specs";
|
|
68
|
+
export const SPECS_REGISTRY: ".caws/specs/registry.json";
|
|
69
|
+
import { SPEC_TYPES } from "../constants/spec-types";
|
|
70
|
+
export { SPEC_TYPES };
|
|
71
|
+
//# sourceMappingURL=specs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../src/commands/specs.js"],"names":[],"mappings":"AAghBA;;;;GAIG;AACH,qCAHW,MAAM,+BA2LhB;AAvrBD;;;GAGG;AACH,qCAFa,OAAO,KAAQ,CAqB3B;AAED;;;;GAIG;AACH,kDAFa,OAAO,CAAC,IAAI,CAAC,CAMzB;AAED;;;GAGG;AACH,iCAFa,OAAO,OAAO,CAmC1B;AAED;;;;;GAKG;AACH,+BAJW,MAAM,kBAEJ,OAAO,KAAQ,CA8H3B;AAED;;;;GAIG;AACH,6BAHW,MAAM,GACJ,OAAO,CAAC,MAAO,IAAI,CAAC,CAiBhC;AAED;;;;;GAKG;AACH,+BAJW,MAAM,kBAEJ,OAAO,CAAC,OAAO,CAAC,CA6B5B;AAED;;;;GAIG;AACH,+BAHW,MAAM,GACJ,OAAO,CAAC,OAAO,CAAC,CAmB5B;AAED;;;GAGG;AACH,sDA2CC;AAED;;;GAGG;AACH,oDAoCC;AAsFD;;;GAGG;AACH,yCAFa,OAAO,CAAC,MAAM,CAAC,CAuC3B;AA9fD;;GAEG;AACH,wBAAkB,aAAa,CAAC;AAChC,6BAAuB,2BAA2B,CAAC"}
|
package/dist/commands/specs.js
CHANGED
|
@@ -9,6 +9,7 @@ const path = require('path');
|
|
|
9
9
|
const yaml = require('js-yaml');
|
|
10
10
|
const chalk = require('chalk');
|
|
11
11
|
const { safeAsync, outputResult } = require('../error-handler');
|
|
12
|
+
const { question, closeReadline } = require('../utils/promise-utils');
|
|
12
13
|
const { SPEC_TYPES } = require('../constants/spec-types');
|
|
13
14
|
|
|
14
15
|
// Import suggestFeatureBreakdown from spec-resolver
|
|
@@ -488,42 +489,40 @@ async function migrateFromLegacy(options = {}) {
|
|
|
488
489
|
* @returns {Promise<string>} User's choice: 'cancel', 'rename', 'merge', 'override'
|
|
489
490
|
*/
|
|
490
491
|
async function askConflictResolution() {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
input: process.stdin,
|
|
504
|
-
output: process.stdout,
|
|
505
|
-
});
|
|
506
|
-
|
|
507
|
-
rl.question('> ', (answer) => {
|
|
508
|
-
rl.close();
|
|
509
|
-
|
|
510
|
-
const trimmed = answer.trim().toLowerCase();
|
|
511
|
-
|
|
512
|
-
// Handle numeric choices
|
|
513
|
-
if (trimmed === '1' || trimmed === 'cancel') {
|
|
514
|
-
resolve('cancel');
|
|
515
|
-
} else if (trimmed === '2' || trimmed === 'rename') {
|
|
516
|
-
resolve('rename');
|
|
517
|
-
} else if (trimmed === '3' || trimmed === 'merge') {
|
|
518
|
-
resolve('merge');
|
|
519
|
-
} else if (trimmed === '4' || trimmed === 'override') {
|
|
520
|
-
resolve('override');
|
|
521
|
-
} else {
|
|
522
|
-
console.log(chalk.red('❌ Invalid choice. Defaulting to cancel.'));
|
|
523
|
-
resolve('cancel');
|
|
524
|
-
}
|
|
525
|
-
});
|
|
492
|
+
const readline = require('readline');
|
|
493
|
+
|
|
494
|
+
console.log(chalk.blue('\n🔄 Conflict Resolution Options:'));
|
|
495
|
+
console.log(chalk.gray(" 1. Cancel - Don't create the spec"));
|
|
496
|
+
console.log(chalk.gray(' 2. Rename - Create with auto-generated name'));
|
|
497
|
+
console.log(chalk.gray(' 3. Merge - Merge with existing spec (not implemented)'));
|
|
498
|
+
console.log(chalk.gray(' 4. Override - Replace existing spec (use --force)'));
|
|
499
|
+
console.log(chalk.yellow('\nEnter your choice (1-4) or the option name:'));
|
|
500
|
+
|
|
501
|
+
const rl = readline.createInterface({
|
|
502
|
+
input: process.stdin,
|
|
503
|
+
output: process.stdout,
|
|
526
504
|
});
|
|
505
|
+
|
|
506
|
+
try {
|
|
507
|
+
const answer = await question(rl, '> ');
|
|
508
|
+
const trimmed = answer.trim().toLowerCase();
|
|
509
|
+
|
|
510
|
+
// Handle numeric choices
|
|
511
|
+
if (trimmed === '1' || trimmed === 'cancel') {
|
|
512
|
+
return 'cancel';
|
|
513
|
+
} else if (trimmed === '2' || trimmed === 'rename') {
|
|
514
|
+
return 'rename';
|
|
515
|
+
} else if (trimmed === '3' || trimmed === 'merge') {
|
|
516
|
+
return 'merge';
|
|
517
|
+
} else if (trimmed === '4' || trimmed === 'override') {
|
|
518
|
+
return 'override';
|
|
519
|
+
} else {
|
|
520
|
+
console.log(chalk.red('❌ Invalid choice. Defaulting to cancel.'));
|
|
521
|
+
return 'cancel';
|
|
522
|
+
}
|
|
523
|
+
} finally {
|
|
524
|
+
await closeReadline(rl);
|
|
525
|
+
}
|
|
527
526
|
}
|
|
528
527
|
|
|
529
528
|
/**
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status command handler
|
|
3
|
+
* @param {Object} options - Command options
|
|
4
|
+
*/
|
|
5
|
+
export function statusCommand(options?: any): Promise<any>;
|
|
6
|
+
/**
|
|
7
|
+
* Load working specification (legacy single file approach)
|
|
8
|
+
* @param {string} specPath - Path to working spec
|
|
9
|
+
* @returns {Promise<Object|null>} Parsed spec or null
|
|
10
|
+
*/
|
|
11
|
+
export function loadWorkingSpec(specPath?: string): Promise<any | null>;
|
|
12
|
+
/**
|
|
13
|
+
* Check Git hooks status
|
|
14
|
+
* @returns {Promise<Object>} Hooks status
|
|
15
|
+
*/
|
|
16
|
+
export function checkGitHooks(): Promise<any>;
|
|
17
|
+
/**
|
|
18
|
+
* Load provenance chain
|
|
19
|
+
* @returns {Promise<Object>} Provenance status
|
|
20
|
+
*/
|
|
21
|
+
export function loadProvenanceChain(): Promise<any>;
|
|
22
|
+
/**
|
|
23
|
+
* Load waiver status
|
|
24
|
+
* @returns {Promise<Object>} Waiver status
|
|
25
|
+
*/
|
|
26
|
+
export function loadWaiverStatus(): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* Check quality gates status (simplified)
|
|
29
|
+
* @returns {Promise<Object>} Quality gates status
|
|
30
|
+
*/
|
|
31
|
+
export function checkQualityGates(): Promise<any>;
|
|
32
|
+
/**
|
|
33
|
+
* Display project status
|
|
34
|
+
* @param {Object} data - Status data
|
|
35
|
+
*/
|
|
36
|
+
export function displayStatus(data: any): void;
|
|
37
|
+
/**
|
|
38
|
+
* Generate actionable suggestions based on status and mode
|
|
39
|
+
* @param {Object} data - Status data
|
|
40
|
+
* @param {string} currentMode - Current CAWS mode
|
|
41
|
+
* @returns {string[]} Array of suggestions
|
|
42
|
+
*/
|
|
43
|
+
export function generateSuggestions(data: any, currentMode: string): string[];
|
|
44
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.js"],"names":[],"mappings":"AA6uBA;;;GAGG;AACH,2DA6IC;AAl3BD;;;;GAIG;AACH,2CAHW,MAAM,GACJ,OAAO,CAAC,MAAO,IAAI,CAAC,CAahC;AAgBD;;;GAGG;AACH,iCAFa,OAAO,KAAQ,CAgC3B;AAED;;;GAGG;AACH,uCAFa,OAAO,KAAQ,CA+B3B;AAED;;;GAGG;AACH,oCAFa,OAAO,KAAQ,CA0D3B;AAED;;;GAGG;AACH,qCAFa,OAAO,KAAQ,CAS3B;AAwBD;;;GAGG;AACH,+CAgGC;AAED;;;;;GAKG;AACH,4DAHW,MAAM,GACJ,MAAM,EAAE,CAoCpB"}
|
package/dist/commands/status.js
CHANGED
|
@@ -9,6 +9,7 @@ const path = require('path');
|
|
|
9
9
|
const yaml = require('js-yaml');
|
|
10
10
|
const chalk = require('chalk');
|
|
11
11
|
const { safeAsync, outputResult } = require('../error-handler');
|
|
12
|
+
const { parallel } = require('../utils/async-utils');
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Load working specification (legacy single file approach)
|
|
@@ -758,13 +759,15 @@ async function statusCommand(options = {}) {
|
|
|
758
759
|
const modes = require('../config/modes');
|
|
759
760
|
const currentMode = await modes.getCurrentMode();
|
|
760
761
|
|
|
761
|
-
// Load all status data
|
|
762
|
-
const spec = await
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
762
|
+
// Load all status data in parallel for better performance
|
|
763
|
+
const [spec, specs, hooks, provenance, waivers, gates] = await parallel([
|
|
764
|
+
() => loadWorkingSpec(options.spec || '.caws/working-spec.yaml'),
|
|
765
|
+
() => loadSpecsFromMultiSpec(),
|
|
766
|
+
() => checkGitHooks(),
|
|
767
|
+
() => loadProvenanceChain(),
|
|
768
|
+
() => loadWaiverStatus(),
|
|
769
|
+
() => checkQualityGates(),
|
|
770
|
+
]);
|
|
768
771
|
|
|
769
772
|
// Display status (visual mode if requested)
|
|
770
773
|
if (options.visual || options.json) {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Templates command handler
|
|
3
|
+
* @param {string} subcommand - Subcommand (list, info)
|
|
4
|
+
* @param {Object} options - Command options
|
|
5
|
+
*/
|
|
6
|
+
export function templatesCommand(subcommand?: string, options?: any): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* List all available templates
|
|
9
|
+
*/
|
|
10
|
+
export function listTemplates(): void;
|
|
11
|
+
/**
|
|
12
|
+
* Show detailed template information
|
|
13
|
+
* @param {string} templateId - Template ID
|
|
14
|
+
*/
|
|
15
|
+
export function showTemplateInfo(templateId: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* Check which templates actually exist
|
|
18
|
+
* @returns {Object} Available templates
|
|
19
|
+
*/
|
|
20
|
+
export function getAvailableTemplates(): any;
|
|
21
|
+
/**
|
|
22
|
+
* Built-in template definitions
|
|
23
|
+
*/
|
|
24
|
+
export const BUILTIN_TEMPLATES: {
|
|
25
|
+
'typescript-library': {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
category: string;
|
|
29
|
+
tier: number;
|
|
30
|
+
features: string[];
|
|
31
|
+
path: string;
|
|
32
|
+
};
|
|
33
|
+
'typescript-api': {
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
category: string;
|
|
37
|
+
tier: number;
|
|
38
|
+
features: string[];
|
|
39
|
+
path: string;
|
|
40
|
+
};
|
|
41
|
+
'typescript-monorepo': {
|
|
42
|
+
name: string;
|
|
43
|
+
description: string;
|
|
44
|
+
category: string;
|
|
45
|
+
tier: number;
|
|
46
|
+
features: string[];
|
|
47
|
+
path: string;
|
|
48
|
+
};
|
|
49
|
+
'javascript-package': {
|
|
50
|
+
name: string;
|
|
51
|
+
description: string;
|
|
52
|
+
category: string;
|
|
53
|
+
tier: number;
|
|
54
|
+
features: string[];
|
|
55
|
+
path: string;
|
|
56
|
+
};
|
|
57
|
+
'react-component-lib': {
|
|
58
|
+
name: string;
|
|
59
|
+
description: string;
|
|
60
|
+
category: string;
|
|
61
|
+
tier: number;
|
|
62
|
+
features: string[];
|
|
63
|
+
path: string;
|
|
64
|
+
};
|
|
65
|
+
'vscode-extension': {
|
|
66
|
+
name: string;
|
|
67
|
+
description: string;
|
|
68
|
+
category: string;
|
|
69
|
+
tier: number;
|
|
70
|
+
features: string[];
|
|
71
|
+
path: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/commands/templates.js"],"names":[],"mappings":"AAoMA;;;;GAIG;AACH,8CAHW,MAAM,gCA4BhB;AAvHD;;GAEG;AACH,sCAuCC;AAED;;;GAGG;AACH,6CAFW,MAAM,QAyChB;AA9GD;;;GAGG;AACH,6CAiBC;AA/FD;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiDE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Initialize tool system
|
|
3
|
+
* @returns {Promise<ToolLoader|null>} Initialized tool loader or null if failed
|
|
4
|
+
*/
|
|
5
|
+
export function initializeToolSystem(): Promise<ToolLoader | null>;
|
|
6
|
+
/**
|
|
7
|
+
* Execute tool command handler
|
|
8
|
+
* @param {string} toolId - ID of the tool to execute
|
|
9
|
+
* @param {Object} options - Command options
|
|
10
|
+
*/
|
|
11
|
+
export function executeTool(toolId: string, options: any): Promise<void>;
|
|
12
|
+
import ToolLoader = require("../tool-loader");
|
|
13
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/commands/tool.js"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,wCAFa,OAAO,CAAC,UAAU,GAAC,IAAI,CAAC,CAoCpC;AAED;;;;GAIG;AACH,oCAHW,MAAM,+BAyEhB"}
|
package/dist/commands/tool.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const path = require('path');
|
|
8
|
-
const
|
|
8
|
+
const { commandWrapper, Output } = require('../utils/command-wrapper');
|
|
9
9
|
|
|
10
10
|
// Import tool system
|
|
11
11
|
const ToolLoader = require('../tool-loader');
|
|
@@ -32,16 +32,19 @@ async function initializeToolSystem() {
|
|
|
32
32
|
// Set up event listeners for tool system
|
|
33
33
|
toolLoader.on('discovery:complete', ({ tools: _tools, count }) => {
|
|
34
34
|
if (count > 0) {
|
|
35
|
-
|
|
35
|
+
Output.info(`Discovered ${count} tools`);
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
toolLoader.on('tool:loaded', ({ id, metadata }) => {
|
|
40
|
-
|
|
40
|
+
// Only log in verbose mode or when not using JSON output
|
|
41
|
+
if (!process.env.CAWS_OUTPUT_FORMAT || process.env.CAWS_OUTPUT_FORMAT !== 'json') {
|
|
42
|
+
console.log(` ✓ Loaded tool: ${metadata.name} (${id})`);
|
|
43
|
+
}
|
|
41
44
|
});
|
|
42
45
|
|
|
43
46
|
toolLoader.on('tool:error', ({ id, error }) => {
|
|
44
|
-
|
|
47
|
+
Output.warning(`Failed to load tool ${id}: ${error}`);
|
|
45
48
|
});
|
|
46
49
|
|
|
47
50
|
// Auto-discover tools on initialization
|
|
@@ -49,8 +52,10 @@ async function initializeToolSystem() {
|
|
|
49
52
|
|
|
50
53
|
return toolLoader;
|
|
51
54
|
} catch (error) {
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
Output.warning(
|
|
56
|
+
`Tool system initialization failed: ${error.message}`,
|
|
57
|
+
'Continuing without dynamic tools'
|
|
58
|
+
);
|
|
54
59
|
return null;
|
|
55
60
|
}
|
|
56
61
|
}
|
|
@@ -61,75 +66,70 @@ async function initializeToolSystem() {
|
|
|
61
66
|
* @param {Object} options - Command options
|
|
62
67
|
*/
|
|
63
68
|
async function executeTool(toolId, options) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
return commandWrapper(
|
|
70
|
+
async () => {
|
|
71
|
+
// Initialize tool system
|
|
72
|
+
const loader = await initializeToolSystem();
|
|
67
73
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
74
|
+
if (!loader) {
|
|
75
|
+
throw new Error('Tool system not available');
|
|
76
|
+
}
|
|
72
77
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
// Load all tools first
|
|
79
|
+
await loader.loadAllTools();
|
|
80
|
+
const tool = loader.getTool(toolId);
|
|
76
81
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
if (!tool) {
|
|
83
|
+
const tools = loader.getAllTools();
|
|
84
|
+
const availableTools = Array.from(tools, ([id, t]) => `${id}: ${t.metadata.name}`).join(
|
|
85
|
+
', '
|
|
86
|
+
);
|
|
87
|
+
throw new Error(`Tool '${toolId}' not found.\n` + `Available tools: ${availableTools}`);
|
|
83
88
|
}
|
|
84
|
-
process.exit(1);
|
|
85
|
-
}
|
|
86
89
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
process.exit(1);
|
|
95
|
-
}
|
|
90
|
+
// Validate tool before execution
|
|
91
|
+
const validation = await toolValidator.validateTool(tool);
|
|
92
|
+
if (!validation.valid) {
|
|
93
|
+
throw new Error(
|
|
94
|
+
`Tool validation failed:\n` + validation.errors.map((e) => ` - ${e}`).join('\n')
|
|
95
|
+
);
|
|
96
|
+
}
|
|
96
97
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
// Parse parameters
|
|
99
|
+
let params = {};
|
|
100
|
+
if (options.params) {
|
|
101
|
+
try {
|
|
102
|
+
params = JSON.parse(options.params);
|
|
103
|
+
} catch (error) {
|
|
104
|
+
throw new Error(`Invalid JSON parameters: ${error.message}`);
|
|
105
|
+
}
|
|
105
106
|
}
|
|
106
|
-
}
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
Output.progress(`Executing tool: ${tool.metadata.name}`);
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
// Execute tool
|
|
111
|
+
const result = await tool.module.execute(params, {
|
|
112
|
+
workingDirectory: process.cwd(),
|
|
113
|
+
timeout: options.timeout,
|
|
114
|
+
});
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
// Display results
|
|
117
|
+
if (result.success) {
|
|
118
|
+
Output.success('Tool execution successful', {
|
|
119
|
+
output: result.output,
|
|
120
|
+
});
|
|
121
|
+
return result;
|
|
122
|
+
} else {
|
|
123
|
+
throw new Error(
|
|
124
|
+
`Tool execution failed:\n` + result.errors.map((e) => ` - ${e}`).join('\n')
|
|
125
|
+
);
|
|
121
126
|
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
});
|
|
127
|
-
process.exit(1);
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
commandName: `tool ${toolId}`,
|
|
130
|
+
context: { toolId, options },
|
|
128
131
|
}
|
|
129
|
-
|
|
130
|
-
console.error(chalk.red(`❌ Error executing tool ${toolId}:`), error.message);
|
|
131
|
-
process.exit(1);
|
|
132
|
-
}
|
|
132
|
+
);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
module.exports = {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export = troubleshootCommand;
|
|
2
|
+
/**
|
|
3
|
+
* Troubleshoot command handler
|
|
4
|
+
* @param {string} guide - Guide key argument
|
|
5
|
+
* @param {Object} options - Command options
|
|
6
|
+
*/
|
|
7
|
+
declare function troubleshootCommand(guide: string, options: any): void;
|
|
8
|
+
//# sourceMappingURL=troubleshoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"troubleshoot.d.ts","sourceRoot":"","sources":["../../src/commands/troubleshoot.js"],"names":[],"mappings":";AAqFA;;;;GAIG;AACH,4CAHW,MAAM,sBAchB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tutorial command handler
|
|
3
|
+
* @param {string} tutorialType - Type of tutorial to run
|
|
4
|
+
* @param {Object} options - Command options
|
|
5
|
+
*/
|
|
6
|
+
export function tutorialCommand(tutorialType: string, _options?: {}): Promise<any>;
|
|
7
|
+
export namespace TUTORIALS {
|
|
8
|
+
namespace agent {
|
|
9
|
+
let name: string;
|
|
10
|
+
let description: string;
|
|
11
|
+
let icon: string;
|
|
12
|
+
let steps: ({
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
content: string;
|
|
16
|
+
action: string;
|
|
17
|
+
verify?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
id: string;
|
|
20
|
+
title: string;
|
|
21
|
+
content: string;
|
|
22
|
+
action: string;
|
|
23
|
+
verify: string;
|
|
24
|
+
})[];
|
|
25
|
+
}
|
|
26
|
+
namespace developer {
|
|
27
|
+
let name_1: string;
|
|
28
|
+
export { name_1 as name };
|
|
29
|
+
let description_1: string;
|
|
30
|
+
export { description_1 as description };
|
|
31
|
+
let icon_1: string;
|
|
32
|
+
export { icon_1 as icon };
|
|
33
|
+
let steps_1: ({
|
|
34
|
+
id: string;
|
|
35
|
+
title: string;
|
|
36
|
+
content: string;
|
|
37
|
+
action: string;
|
|
38
|
+
verify?: undefined;
|
|
39
|
+
} | {
|
|
40
|
+
id: string;
|
|
41
|
+
title: string;
|
|
42
|
+
content: string;
|
|
43
|
+
action: string;
|
|
44
|
+
verify: string;
|
|
45
|
+
})[];
|
|
46
|
+
export { steps_1 as steps };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Interactive tutorial session
|
|
51
|
+
* @param {string} tutorialType - Type of tutorial (agent, developer)
|
|
52
|
+
* @returns {Promise<void>}
|
|
53
|
+
*/
|
|
54
|
+
export function runInteractiveTutorial(tutorialType: string): Promise<void>;
|
|
55
|
+
//# sourceMappingURL=tutorial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tutorial.d.ts","sourceRoot":"","sources":["../../src/commands/tutorial.js"],"names":[],"mappings":"AA4aA;;;;GAIG;AACH,8CAHW,MAAM,+BA4ChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA/FD;;;;GAIG;AACH,qDAHW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CA4CzB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate command handler
|
|
3
|
+
* Enhanced with multi-spec support and JSON output format
|
|
4
|
+
* @param {string} specFile - Path to spec file (optional, uses spec resolution)
|
|
5
|
+
* @param {Object} options - Command options
|
|
6
|
+
* @param {string} [options.specId] - Feature-specific spec ID
|
|
7
|
+
* @param {boolean} [options.interactive] - Use interactive spec selection
|
|
8
|
+
* @param {boolean} [options.format] - Output format (json)
|
|
9
|
+
*/
|
|
10
|
+
export function validateCommand(specFile: string, options?: {
|
|
11
|
+
specId?: string;
|
|
12
|
+
interactive?: boolean;
|
|
13
|
+
format?: boolean;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.js"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,0CANW,MAAM,YAEd;IAAyB,MAAM,GAAvB,MAAM;IACY,WAAW,GAA7B,OAAO;IACW,MAAM,GAAxB,OAAO;CACjB,iBAiNA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Waivers command handler
|
|
3
|
+
*
|
|
4
|
+
* @param {string} subcommand - create, list, show, revoke
|
|
5
|
+
* @param {object} options - Command options
|
|
6
|
+
*/
|
|
7
|
+
export function waiversCommand(subcommand?: string, options?: object): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=waivers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waivers.d.ts","sourceRoot":"","sources":["../../src/commands/waivers.js"],"names":[],"mappings":"AAmBA;;;;;GAKG;AACH,4CAHW,MAAM,YACN,MAAM,iBA2ChB"}
|