@paths.design/caws-cli 6.0.0 → 7.0.1
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/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/quality-gates.d.ts +52 -0
- package/dist/commands/quality-gates.d.ts.map +1 -0
- package/dist/commands/quality-gates.js +4 -2
- 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/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/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/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/git-hooks.d.ts +20 -0
- package/dist/scaffold/git-hooks.d.ts.map +1 -0
- package/dist/scaffold/git-hooks.js +65 -7
- package/dist/scaffold/index.d.ts +20 -0
- package/dist/scaffold/index.d.ts.map +1 -0
- package/dist/scaffold/index.js +179 -41
- 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/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/project-analysis.js +103 -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/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,72 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export = ToolValidator;
|
|
3
|
+
/**
|
|
4
|
+
* Tool Validator - Security validation and allowlist enforcement
|
|
5
|
+
*/
|
|
6
|
+
declare class ToolValidator {
|
|
7
|
+
constructor(options?: {});
|
|
8
|
+
options: {
|
|
9
|
+
allowlistPath: any;
|
|
10
|
+
strictMode: boolean;
|
|
11
|
+
maxFileSize: any;
|
|
12
|
+
};
|
|
13
|
+
allowlist: any;
|
|
14
|
+
validationCache: Map<any, any>;
|
|
15
|
+
/**
|
|
16
|
+
* Load and parse the tools allowlist
|
|
17
|
+
* @returns {Promise<Array<string>>} Array of allowed commands/patterns
|
|
18
|
+
*/
|
|
19
|
+
loadAllowlist(): Promise<Array<string>>;
|
|
20
|
+
/**
|
|
21
|
+
* Validate a tool against security requirements
|
|
22
|
+
* @param {Object} tool - Tool object with module and metadata
|
|
23
|
+
* @returns {Promise<Object>} Validation result
|
|
24
|
+
*/
|
|
25
|
+
validateTool(tool: any): Promise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* Check file-level security
|
|
28
|
+
* @private
|
|
29
|
+
* @param {Object} tool - Tool object
|
|
30
|
+
*/
|
|
31
|
+
private checkFileSecurity;
|
|
32
|
+
/**
|
|
33
|
+
* Check code-level security
|
|
34
|
+
* @private
|
|
35
|
+
* @param {Object} tool - Tool object
|
|
36
|
+
*/
|
|
37
|
+
private checkCodeSecurity;
|
|
38
|
+
/**
|
|
39
|
+
* Check interface compliance
|
|
40
|
+
* @private
|
|
41
|
+
* @param {Object} tool - Tool object
|
|
42
|
+
*/
|
|
43
|
+
private checkInterfaceCompliance;
|
|
44
|
+
/**
|
|
45
|
+
* Check metadata validity
|
|
46
|
+
* @private
|
|
47
|
+
* @param {Object} tool - Tool object
|
|
48
|
+
*/
|
|
49
|
+
private checkMetadataValidity;
|
|
50
|
+
/**
|
|
51
|
+
* Check dependency safety
|
|
52
|
+
* @private
|
|
53
|
+
* @param {Object} tool - Tool object
|
|
54
|
+
*/
|
|
55
|
+
private checkDependencySafety;
|
|
56
|
+
/**
|
|
57
|
+
* Validate a command against the allowlist
|
|
58
|
+
* @param {string} command - Command to validate
|
|
59
|
+
* @returns {boolean} True if command is allowed
|
|
60
|
+
*/
|
|
61
|
+
validateCommand(command: string): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Clear validation cache
|
|
64
|
+
*/
|
|
65
|
+
clearCache(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Get validator statistics
|
|
68
|
+
* @returns {Object} Statistics object
|
|
69
|
+
*/
|
|
70
|
+
getStats(): any;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=tool-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-validator.d.ts","sourceRoot":"","sources":["../src/tool-validator.js"],"names":[],"mappings":";;AAYA;;GAEG;AACH;IACE,0BAWC;IAVC;;;;MAMC;IAED,eAAqB;IACrB,+BAAgC;IAGlC;;;OAGG;IACH,iBAFa,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAqBlC;IAED;;;;OAIG;IACH,yBAFa,OAAO,KAAQ,CAsF3B;IAED;;;;OAIG;IACH,0BAgCC;IAED;;;;OAIG;IACH,0BA8CC;IAED;;;;OAIG;IACH,iCAkBC;IAED;;;;OAIG;IACH,8BAqCC;IAED;;;;OAIG;IACH,8BA4BC;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,OAAO,CAmBnB;IAED;;OAEG;IACH,mBAEC;IAED;;;OAGG;IACH,gBAOC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detection.d.ts","sourceRoot":"","sources":["../../src/utils/detection.js"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,sCAHW,MAAM,OA6JhB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate provenance manifest and git initialization (for both modes)
|
|
3
|
+
* @param {string} projectName - Project name
|
|
4
|
+
* @param {Object} options - Command options
|
|
5
|
+
* @param {Object} answers - User answers
|
|
6
|
+
*/
|
|
7
|
+
export function finalizeProject(projectName: string, options: any, answers: any): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Display success message after project initialization
|
|
10
|
+
*/
|
|
11
|
+
export function continueToSuccess(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Set dependencies for finalization utilities
|
|
14
|
+
* @param {Object} deps - Dependencies object
|
|
15
|
+
*/
|
|
16
|
+
export function setFinalizationDependencies(deps: any): void;
|
|
17
|
+
//# sourceMappingURL=finalization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finalization.d.ts","sourceRoot":"","sources":["../../src/utils/finalization.js"],"names":[],"mappings":"AA6BA;;;;;GAKG;AACH,6CAJW,MAAM,6CAgKhB;AAED;;GAEG;AACH,0CA0BC;AA1MD;;;GAGG;AACH,6DAGC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect project type from existing files and structure
|
|
3
|
+
* @param {string} cwd - Current working directory
|
|
4
|
+
* @returns {string} Project type
|
|
5
|
+
*/
|
|
6
|
+
export function detectProjectType(cwd?: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Detect if current directory appears to be a project that should be initialized directly
|
|
9
|
+
* @param {string} projectName - Project name from command line
|
|
10
|
+
* @param {string} currentDir - Current directory path
|
|
11
|
+
* @returns {boolean} Whether to init in current directory
|
|
12
|
+
*/
|
|
13
|
+
export function shouldInitInCurrentDirectory(projectName: string, currentDir: string): boolean;
|
|
14
|
+
//# sourceMappingURL=project-analysis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-analysis.d.ts","sourceRoot":"","sources":["../../src/utils/project-analysis.js"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wCAHW,MAAM,GACJ,MAAM,CAmDlB;AAED;;;;;GAKG;AACH,0DAJW,MAAM,cACN,MAAM,GACJ,OAAO,CA8BnB"}
|
|
@@ -99,7 +99,110 @@ function shouldInitInCurrentDirectory(projectName, currentDir) {
|
|
|
99
99
|
return hasProjectIndicators;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Detect if project publishes packages to registries
|
|
104
|
+
* Checks for publishing configuration in package.json, pyproject.toml, etc.
|
|
105
|
+
* @param {string} cwd - Current working directory
|
|
106
|
+
* @returns {boolean} Whether project appears to publish packages
|
|
107
|
+
*/
|
|
108
|
+
function detectsPublishing(cwd = process.cwd()) {
|
|
109
|
+
const files = fs.readdirSync(cwd);
|
|
110
|
+
|
|
111
|
+
// Check package.json for npm publishing
|
|
112
|
+
if (files.includes('package.json')) {
|
|
113
|
+
try {
|
|
114
|
+
const packageJson = JSON.parse(
|
|
115
|
+
fs.readFileSync(path.join(cwd, 'package.json'), 'utf8')
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
// Indicators of publishing:
|
|
119
|
+
// - Has publishConfig
|
|
120
|
+
// - Has scripts that include "publish"
|
|
121
|
+
// - Has name that suggests it's a published package
|
|
122
|
+
// - Has repository field (often indicates published package)
|
|
123
|
+
const hasPublishConfig = packageJson.publishConfig;
|
|
124
|
+
const hasPublishScript =
|
|
125
|
+
packageJson.scripts &&
|
|
126
|
+
Object.keys(packageJson.scripts).some((key) =>
|
|
127
|
+
key.toLowerCase().includes('publish')
|
|
128
|
+
);
|
|
129
|
+
const hasScopedName = packageJson.name && packageJson.name.startsWith('@');
|
|
130
|
+
const hasRepository = packageJson.repository;
|
|
131
|
+
|
|
132
|
+
if (hasPublishConfig || hasPublishScript || (hasScopedName && hasRepository)) {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
} catch (e) {
|
|
136
|
+
// Ignore parse errors
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Check pyproject.toml for PyPI publishing
|
|
141
|
+
if (files.includes('pyproject.toml')) {
|
|
142
|
+
try {
|
|
143
|
+
const pyprojectContent = fs.readFileSync(
|
|
144
|
+
path.join(cwd, 'pyproject.toml'),
|
|
145
|
+
'utf8'
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
// Check for build system and project metadata (indicates publishable package)
|
|
149
|
+
const hasBuildSystem = pyprojectContent.includes('[build-system]');
|
|
150
|
+
const hasProjectMetadata = pyprojectContent.includes('[project]');
|
|
151
|
+
const hasToolPublish = pyprojectContent.includes('[tool.publish]') ||
|
|
152
|
+
pyprojectContent.includes('[tool.twine]');
|
|
153
|
+
|
|
154
|
+
if ((hasBuildSystem && hasProjectMetadata) || hasToolPublish) {
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
} catch (e) {
|
|
158
|
+
// Ignore read errors
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Check for Maven publishing (pom.xml)
|
|
163
|
+
if (files.includes('pom.xml')) {
|
|
164
|
+
return true; // Maven projects typically publish
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Check for .csproj (NuGet publishing)
|
|
168
|
+
const csprojFiles = files.filter((f) => f.endsWith('.csproj'));
|
|
169
|
+
if (csprojFiles.length > 0) {
|
|
170
|
+
return true; // .NET projects typically publish
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Check for GitHub Actions workflows that publish
|
|
174
|
+
const workflowsPath = path.join(cwd, '.github', 'workflows');
|
|
175
|
+
if (fs.existsSync(workflowsPath)) {
|
|
176
|
+
try {
|
|
177
|
+
const workflowFiles = fs.readdirSync(workflowsPath);
|
|
178
|
+
for (const workflowFile of workflowFiles) {
|
|
179
|
+
if (workflowFile.endsWith('.yml') || workflowFile.endsWith('.yaml')) {
|
|
180
|
+
const workflowContent = fs.readFileSync(
|
|
181
|
+
path.join(workflowsPath, workflowFile),
|
|
182
|
+
'utf8'
|
|
183
|
+
);
|
|
184
|
+
// Check for common publishing actions/commands
|
|
185
|
+
if (
|
|
186
|
+
workflowContent.includes('npm publish') ||
|
|
187
|
+
workflowContent.includes('pypa/gh-action-pypi-publish') ||
|
|
188
|
+
workflowContent.includes('publish-to-npm') ||
|
|
189
|
+
workflowContent.includes('semantic-release') ||
|
|
190
|
+
workflowContent.includes('publish')
|
|
191
|
+
) {
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
} catch (e) {
|
|
197
|
+
// Ignore read errors
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
|
|
102
204
|
module.exports = {
|
|
103
205
|
detectProjectType,
|
|
104
206
|
shouldInitInCurrentDirectory,
|
|
207
|
+
detectsPublishing,
|
|
105
208
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get staged files from git
|
|
3
|
+
* @returns {string[]} Array of staged file paths
|
|
4
|
+
*/
|
|
5
|
+
export function getStagedFiles(): string[];
|
|
6
|
+
/**
|
|
7
|
+
* Check for god objects in staged files
|
|
8
|
+
* @param {string[]} stagedFiles - Array of staged file paths
|
|
9
|
+
* @param {string} language - Language to check ('rust', 'typescript', etc.)
|
|
10
|
+
* @returns {Object} God object analysis results
|
|
11
|
+
*/
|
|
12
|
+
export function checkGodObjects(stagedFiles: string[], language?: string): any;
|
|
13
|
+
/**
|
|
14
|
+
* Check for hidden TODOs in staged files
|
|
15
|
+
* @param {string[]} stagedFiles - Array of staged file paths
|
|
16
|
+
* @returns {Object} TODO analysis results
|
|
17
|
+
*/
|
|
18
|
+
export function checkHiddenTodos(stagedFiles: string[]): any;
|
|
19
|
+
/**
|
|
20
|
+
* Check if a waiver applies to the given gate
|
|
21
|
+
* @param {string} gate - Gate name to check
|
|
22
|
+
* @returns {Object} Waiver check result
|
|
23
|
+
*/
|
|
24
|
+
export function checkWaiver(gate: string): any;
|
|
25
|
+
/**
|
|
26
|
+
* Detect if project is in crisis response mode
|
|
27
|
+
* @returns {boolean} True if in crisis mode
|
|
28
|
+
*/
|
|
29
|
+
export function detectCrisisMode(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Run comprehensive quality gates on staged files
|
|
32
|
+
* @param {Object} options - Options for quality gates
|
|
33
|
+
* @returns {Object} Quality gate results
|
|
34
|
+
*/
|
|
35
|
+
export function runQualityGates(options?: any): any;
|
|
36
|
+
export namespace CONFIG {
|
|
37
|
+
namespace godObjectThresholds {
|
|
38
|
+
let warning: number;
|
|
39
|
+
let critical: number;
|
|
40
|
+
}
|
|
41
|
+
let todoConfidenceThreshold: number;
|
|
42
|
+
let supportedExtensions: string[];
|
|
43
|
+
namespace crisisResponseThresholds {
|
|
44
|
+
export let godObjectCritical: number;
|
|
45
|
+
let todoConfidenceThreshold_1: number;
|
|
46
|
+
export { todoConfidenceThreshold_1 as todoConfidenceThreshold };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=quality-gates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quality-gates.d.ts","sourceRoot":"","sources":["../../src/utils/quality-gates.js"],"names":[],"mappings":"AAyGA;;;GAGG;AACH,kCAFa,MAAM,EAAE,CAcpB;AAED;;;;;GAKG;AACH,6CAJW,MAAM,EAAE,aACR,MAAM,OAqDhB;AAED;;;;GAIG;AACH,8CAHW,MAAM,EAAE,OA2ClB;AApMD;;;;GAIG;AACH,kCAHW,MAAM,OAiChB;AAED;;;GAGG;AACH,oCAFa,OAAO,CAkCnB;AA6HD;;;;GAIG;AACH,oDAqHC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve spec file path based on priority
|
|
3
|
+
* @param {Object} options - Resolution options
|
|
4
|
+
* @param {string} [options.specId] - Feature-specific spec ID (e.g., 'user-auth', 'FEAT-001')
|
|
5
|
+
* @param {string} [options.specFile] - Explicit file path override
|
|
6
|
+
* @param {boolean} [options.warnLegacy=true] - Warn when falling back to legacy spec
|
|
7
|
+
* @param {boolean} [options.interactive=false] - Use interactive spec selection for multiple specs
|
|
8
|
+
* @returns {Promise<{path: string, type: 'feature' | 'legacy', spec: Object}>}
|
|
9
|
+
*/
|
|
10
|
+
export function resolveSpec(options?: {
|
|
11
|
+
specId?: string;
|
|
12
|
+
specFile?: string;
|
|
13
|
+
warnLegacy?: boolean;
|
|
14
|
+
interactive?: boolean;
|
|
15
|
+
}): Promise<{
|
|
16
|
+
path: string;
|
|
17
|
+
type: "feature" | "legacy";
|
|
18
|
+
spec: any;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* List all available specs
|
|
22
|
+
* @returns {Promise<Array<{id: string, path: string, type: string}>>}
|
|
23
|
+
*/
|
|
24
|
+
export function listAvailableSpecs(): Promise<Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
path: string;
|
|
27
|
+
type: string;
|
|
28
|
+
}>>;
|
|
29
|
+
/**
|
|
30
|
+
* Check if project is using multi-spec architecture
|
|
31
|
+
* @returns {Promise<{isMultiSpec: boolean, specCount: number, needsMigration: boolean}>}
|
|
32
|
+
*/
|
|
33
|
+
export function checkMultiSpecStatus(): Promise<{
|
|
34
|
+
isMultiSpec: boolean;
|
|
35
|
+
specCount: number;
|
|
36
|
+
needsMigration: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Check for scope conflicts between specs
|
|
40
|
+
* @param {string[]} specIds - Array of spec IDs to check
|
|
41
|
+
* @returns {Promise<Array<{spec1: string, spec2: string, conflicts: string[]}>>} Array of conflicts
|
|
42
|
+
*/
|
|
43
|
+
export function checkScopeConflicts(specIds: string[]): Promise<Array<{
|
|
44
|
+
spec1: string;
|
|
45
|
+
spec2: string;
|
|
46
|
+
conflicts: string[];
|
|
47
|
+
}>>;
|
|
48
|
+
/**
|
|
49
|
+
* Suggest migration from legacy to multi-spec
|
|
50
|
+
* @returns {Promise<void>}
|
|
51
|
+
*/
|
|
52
|
+
export function suggestMigration(): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Interactive spec selection using readline
|
|
55
|
+
* @param {string[]} specIds - Available spec IDs
|
|
56
|
+
* @returns {Promise<string>} Selected spec ID
|
|
57
|
+
*/
|
|
58
|
+
export function interactiveSpecSelection(specIds: string[]): Promise<string>;
|
|
59
|
+
/**
|
|
60
|
+
* Load specs registry
|
|
61
|
+
* @returns {Promise<Object>} Registry data
|
|
62
|
+
*/
|
|
63
|
+
export function loadSpecsRegistry(): Promise<any>;
|
|
64
|
+
export function suggestFeatureBreakdown(legacySpec: any): {
|
|
65
|
+
id: string;
|
|
66
|
+
title: any;
|
|
67
|
+
criteria: any;
|
|
68
|
+
scope: {
|
|
69
|
+
in: string[];
|
|
70
|
+
out: any[];
|
|
71
|
+
};
|
|
72
|
+
}[];
|
|
73
|
+
/**
|
|
74
|
+
* Check if two paths overlap (simplified implementation)
|
|
75
|
+
* @param {string} path1 - First path
|
|
76
|
+
* @param {string} path2 - Second path
|
|
77
|
+
* @returns {boolean} True if paths overlap
|
|
78
|
+
*/
|
|
79
|
+
export function pathsOverlap(path1: string, path2: string): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Spec resolution priority:
|
|
82
|
+
* 1. .caws/specs/<spec-id>.yaml (feature-specific, multi-agent safe)
|
|
83
|
+
* 2. .caws/working-spec.yaml (legacy, single-agent only)
|
|
84
|
+
*/
|
|
85
|
+
export const SPECS_DIR: ".caws/specs";
|
|
86
|
+
export const LEGACY_SPEC: ".caws/working-spec.yaml";
|
|
87
|
+
export const SPECS_REGISTRY: ".caws/specs/registry.json";
|
|
88
|
+
//# sourceMappingURL=spec-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-resolver.d.ts","sourceRoot":"","sources":["../../src/utils/spec-resolver.js"],"names":[],"mappings":"AAwBA;;;;;;;;GAQG;AACH,sCANG;IAAyB,MAAM,GAAvB,MAAM;IACW,QAAQ,GAAzB,MAAM;IACY,UAAU,GAA5B,OAAO;IACW,WAAW,GAA7B,OAAO;CACf,GAAU,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAAC,IAAI,MAAQ;CAAC,CAAC,CAwK7E;AA6BD;;;GAGG;AACH,sCAFa,OAAO,CAAC,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC,CAoDpE;AAgDD;;;GAGG;AACH,wCAFa,OAAO,CAAC;IAAC,WAAW,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAC,CAAC,CAavF;AAED;;;;GAIG;AACH,6CAHW,MAAM,EAAE,GACN,OAAO,CAAC,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAC,CAAC,CAAC,CA2D/E;AA+DD;;;GAGG;AACH,oCAFa,OAAO,CAAC,IAAI,CAAC,CAczB;AA5MD;;;;GAIG;AACH,kDAHW,MAAM,EAAE,GACN,OAAO,CAAC,MAAM,CAAC,CAyC3B;AA/HD;;;GAGG;AACH,qCAFa,OAAO,KAAQ,CAuB3B;AAyQD;;;;;;;;IA+FC;AA/KD;;;;;GAKG;AACH,oCAJW,MAAM,SACN,MAAM,GACJ,OAAO,CAuDnB;AAvcD;;;;GAIG;AACH,wBAAkB,aAAa,CAAC;AAChC,0BAAoB,yBAAyB,CAAC;AAC9C,6BAAuB,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect if project is using TypeScript
|
|
3
|
+
* @param {string} projectDir - Project directory path
|
|
4
|
+
* @returns {Object} TypeScript detection result
|
|
5
|
+
*/
|
|
6
|
+
export function detectTypeScript(projectDir?: string): any;
|
|
7
|
+
/**
|
|
8
|
+
* Detect testing framework in use
|
|
9
|
+
* @param {string} projectDir - Project directory path
|
|
10
|
+
* @param {Object} packageJson - Parsed package.json (optional)
|
|
11
|
+
* @returns {Object} Testing framework detection result
|
|
12
|
+
*/
|
|
13
|
+
export function detectTestFramework(projectDir?: string, packageJson?: any): any;
|
|
14
|
+
export function getWorkspaceDirectories(projectDir?: string): string[];
|
|
15
|
+
/**
|
|
16
|
+
* Get workspace directories from package.json
|
|
17
|
+
* @param {string} projectDir - Project directory path
|
|
18
|
+
* @returns {string[]} Array of workspace directories
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Get workspace directories from npm/yarn package.json workspaces
|
|
22
|
+
* @param {string} projectDir - Project directory path
|
|
23
|
+
* @returns {string[]} Array of workspace directories
|
|
24
|
+
*/
|
|
25
|
+
export function getNpmWorkspaces(projectDir: string): string[];
|
|
26
|
+
/**
|
|
27
|
+
* Get workspace directories from pnpm-workspace.yaml
|
|
28
|
+
* @param {string} projectDir - Project directory path
|
|
29
|
+
* @returns {string[]} Array of workspace directories
|
|
30
|
+
*/
|
|
31
|
+
export function getPnpmWorkspaces(projectDir: string): string[];
|
|
32
|
+
/**
|
|
33
|
+
* Get workspace directories from lerna.json
|
|
34
|
+
* @param {string} projectDir - Project directory path
|
|
35
|
+
* @returns {string[]} Array of workspace directories
|
|
36
|
+
*/
|
|
37
|
+
export function getLernaWorkspaces(projectDir: string): string[];
|
|
38
|
+
/**
|
|
39
|
+
* Check if a dependency exists in hoisted node_modules
|
|
40
|
+
* @param {string} depName - Dependency name to check
|
|
41
|
+
* @param {string} projectDir - Project directory path
|
|
42
|
+
* @returns {boolean} True if dependency found in hoisted node_modules
|
|
43
|
+
*/
|
|
44
|
+
export function checkHoistedDependency(depName: string, projectDir: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Check if TypeScript project needs test configuration
|
|
47
|
+
* @param {string} projectDir - Project directory path
|
|
48
|
+
* @returns {Object} Configuration status
|
|
49
|
+
*/
|
|
50
|
+
export function checkTypeScriptTestConfig(projectDir?: string): any;
|
|
51
|
+
/**
|
|
52
|
+
* Generate configuration recommendations
|
|
53
|
+
* @param {Object} tsDetection - TypeScript detection result
|
|
54
|
+
* @param {Object} testDetection - Test framework detection result
|
|
55
|
+
* @returns {string[]} Array of recommendations
|
|
56
|
+
*/
|
|
57
|
+
export function generateRecommendations(tsDetection: any, testDetection: any): string[];
|
|
58
|
+
/**
|
|
59
|
+
* Display TypeScript detection results
|
|
60
|
+
* @param {Object} detection - Detection result from checkTypeScriptTestConfig
|
|
61
|
+
*/
|
|
62
|
+
export function displayTypeScriptDetection(detection: any): void;
|
|
63
|
+
//# sourceMappingURL=typescript-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-detector.d.ts","sourceRoot":"","sources":["../../src/utils/typescript-detector.js"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,8CAHW,MAAM,OAkChB;AAED;;;;;GAKG;AACH,iDAJW,MAAM,0BAkDhB;AAuKD,uEASC;AA9KD;;;;GAIG;AACH;;;;GAIG;AACH,6CAHW,MAAM,GACJ,MAAM,EAAE,CA6CpB;AAED;;;;GAIG;AACH,8CAHW,MAAM,GACJ,MAAM,EAAE,CA6CpB;AAED;;;;GAIG;AACH,+CAHW,MAAM,GACJ,MAAM,EAAE,CA4CpB;AAED;;;;;GAKG;AACH,gDAJW,MAAM,cACN,MAAM,GACJ,OAAO,CAKnB;AAaD;;;;GAIG;AACH,uDAHW,MAAM,OA0EhB;AAED;;;;;GAKG;AACH,+EAFa,MAAM,EAAE,CAuBpB;AAED;;;GAGG;AACH,iEAoBC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basic validation of working spec
|
|
3
|
+
* @param {Object} spec - Working spec object
|
|
4
|
+
* @param {Object} options - Validation options
|
|
5
|
+
* @returns {Object} Validation result
|
|
6
|
+
*/
|
|
7
|
+
export function validateWorkingSpec(spec: any, _options?: {}): any;
|
|
8
|
+
/**
|
|
9
|
+
* Enhanced validation with suggestions and auto-fix
|
|
10
|
+
* @param {Object} spec - Working spec object
|
|
11
|
+
* @param {Object} options - Validation options
|
|
12
|
+
* @returns {Object} Enhanced validation result
|
|
13
|
+
*/
|
|
14
|
+
export function validateWorkingSpecWithSuggestions(spec: any, options?: any): any;
|
|
15
|
+
/**
|
|
16
|
+
* Get suggestion for a missing field
|
|
17
|
+
* @param {string} field - Field name
|
|
18
|
+
* @param {Object} _spec - Spec object (for context)
|
|
19
|
+
* @returns {string} Suggestion text
|
|
20
|
+
*/
|
|
21
|
+
export function getFieldSuggestion(field: string, _spec: any): string;
|
|
22
|
+
/**
|
|
23
|
+
* Check if a field can be auto-fixed
|
|
24
|
+
* @param {string} field - Field name
|
|
25
|
+
* @param {Object} _spec - Spec object (for context)
|
|
26
|
+
* @returns {boolean} Whether field can be auto-fixed
|
|
27
|
+
*/
|
|
28
|
+
export function canAutoFixField(field: string, _spec: any): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Calculate compliance score based on errors and warnings
|
|
31
|
+
* Score ranges from 0 (many issues) to 1 (perfect)
|
|
32
|
+
* @param {Array} errors - Validation errors
|
|
33
|
+
* @param {Array} warnings - Validation warnings
|
|
34
|
+
* @returns {number} Compliance score (0-1)
|
|
35
|
+
*/
|
|
36
|
+
export function calculateComplianceScore(errors: any[], warnings: any[]): number;
|
|
37
|
+
/**
|
|
38
|
+
* Get compliance grade from score
|
|
39
|
+
* @param {number} score - Compliance score (0-1)
|
|
40
|
+
* @returns {string} Grade (A, B, C, D, F)
|
|
41
|
+
*/
|
|
42
|
+
export function getComplianceGrade(score: number): string;
|
|
43
|
+
//# sourceMappingURL=spec-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-validation.d.ts","sourceRoot":"","sources":["../../src/validation/spec-validation.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,mEA8HC;AAED;;;;;GAKG;AACH,kFAyWC;AAoCD;;;;;GAKG;AACH,0CAJW,MAAM,eAEJ,MAAM,CAkBlB;AAED;;;;;GAKG;AACH,uCAJW,MAAM,eAEJ,OAAO,CAKnB;AAnED;;;;;;GAMG;AACH,0EAFa,MAAM,CAclB;AAED;;;;GAIG;AACH,0CAHW,MAAM,GACJ,MAAM,CAQlB"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
export = WaiversManager;
|
|
2
|
+
/**
|
|
3
|
+
* Waiver Manager Class
|
|
4
|
+
* Handles waiver creation, validation, expiration, and audit logging
|
|
5
|
+
*/
|
|
6
|
+
declare class WaiversManager {
|
|
7
|
+
constructor(options?: {});
|
|
8
|
+
projectRoot: any;
|
|
9
|
+
waiversDir: string;
|
|
10
|
+
waiversFile: string;
|
|
11
|
+
auditLogFile: string;
|
|
12
|
+
/**
|
|
13
|
+
* Waiver Schema Definition
|
|
14
|
+
*/
|
|
15
|
+
getWaiverSchema(): {
|
|
16
|
+
type: string;
|
|
17
|
+
required: string[];
|
|
18
|
+
properties: {
|
|
19
|
+
id: {
|
|
20
|
+
type: string;
|
|
21
|
+
pattern: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
title: {
|
|
25
|
+
type: string;
|
|
26
|
+
minLength: number;
|
|
27
|
+
maxLength: number;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
reason: {
|
|
31
|
+
type: string;
|
|
32
|
+
enum: string[];
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
description: {
|
|
36
|
+
type: string;
|
|
37
|
+
minLength: number;
|
|
38
|
+
maxLength: number;
|
|
39
|
+
description: string;
|
|
40
|
+
};
|
|
41
|
+
gates: {
|
|
42
|
+
type: string;
|
|
43
|
+
items: {
|
|
44
|
+
type: string;
|
|
45
|
+
enum: string[];
|
|
46
|
+
};
|
|
47
|
+
minItems: number;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
risk_assessment: {
|
|
51
|
+
type: string;
|
|
52
|
+
properties: {
|
|
53
|
+
impact_level: {
|
|
54
|
+
type: string;
|
|
55
|
+
enum: string[];
|
|
56
|
+
};
|
|
57
|
+
mitigation_plan: {
|
|
58
|
+
type: string;
|
|
59
|
+
minLength: number;
|
|
60
|
+
};
|
|
61
|
+
review_required: {
|
|
62
|
+
type: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
required: string[];
|
|
66
|
+
};
|
|
67
|
+
expires_at: {
|
|
68
|
+
type: string;
|
|
69
|
+
format: string;
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
approved_by: {
|
|
73
|
+
type: string;
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
created_at: {
|
|
77
|
+
type: string;
|
|
78
|
+
format: string;
|
|
79
|
+
description: string;
|
|
80
|
+
};
|
|
81
|
+
metadata: {
|
|
82
|
+
type: string;
|
|
83
|
+
properties: {
|
|
84
|
+
related_pr: {
|
|
85
|
+
type: string;
|
|
86
|
+
};
|
|
87
|
+
related_issue: {
|
|
88
|
+
type: string;
|
|
89
|
+
};
|
|
90
|
+
environment: {
|
|
91
|
+
type: string;
|
|
92
|
+
enum: string[];
|
|
93
|
+
};
|
|
94
|
+
urgency: {
|
|
95
|
+
type: string;
|
|
96
|
+
enum: string[];
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Create a new waiver
|
|
104
|
+
*/
|
|
105
|
+
createWaiver(waiverData: any): Promise<{
|
|
106
|
+
id: string;
|
|
107
|
+
title: any;
|
|
108
|
+
reason: any;
|
|
109
|
+
description: any;
|
|
110
|
+
gates: any;
|
|
111
|
+
risk_assessment: any;
|
|
112
|
+
expires_at: any;
|
|
113
|
+
approved_by: any;
|
|
114
|
+
created_at: string;
|
|
115
|
+
metadata: any;
|
|
116
|
+
}>;
|
|
117
|
+
/**
|
|
118
|
+
* Check if waiver applies to specific gates
|
|
119
|
+
*/
|
|
120
|
+
checkWaiverCoverage(gatesToCheck: any, context?: {}): Promise<{
|
|
121
|
+
coveredGates: any[];
|
|
122
|
+
waiverDetails: {
|
|
123
|
+
gate: any;
|
|
124
|
+
waiver_id: any;
|
|
125
|
+
reason: any;
|
|
126
|
+
expires_at: any;
|
|
127
|
+
approved_by: any;
|
|
128
|
+
}[];
|
|
129
|
+
allCovered: boolean;
|
|
130
|
+
}>;
|
|
131
|
+
/**
|
|
132
|
+
* Get all active waivers
|
|
133
|
+
*/
|
|
134
|
+
getActiveWaivers(): Promise<any[]>;
|
|
135
|
+
/**
|
|
136
|
+
* Revoke a waiver
|
|
137
|
+
*/
|
|
138
|
+
revokeWaiver(waiverId: any, reason?: string): Promise<any>;
|
|
139
|
+
/**
|
|
140
|
+
* Extend waiver expiration
|
|
141
|
+
*/
|
|
142
|
+
extendWaiver(waiverId: any, newExpiryDate: any, approvedBy: any): Promise<any>;
|
|
143
|
+
/**
|
|
144
|
+
* Get waiver statistics and health metrics
|
|
145
|
+
*/
|
|
146
|
+
getWaiverStats(): Promise<{
|
|
147
|
+
total_active: number;
|
|
148
|
+
by_reason: {};
|
|
149
|
+
by_risk_level: {};
|
|
150
|
+
expiring_soon: any[];
|
|
151
|
+
high_risk: any[];
|
|
152
|
+
total_gates_waived: number;
|
|
153
|
+
average_lifespan_days: number;
|
|
154
|
+
}>;
|
|
155
|
+
generateWaiverId(): Promise<string>;
|
|
156
|
+
validateWaiver(waiver: any): {
|
|
157
|
+
valid: boolean;
|
|
158
|
+
errors: string[];
|
|
159
|
+
};
|
|
160
|
+
checkWaiverConflicts(newWaiver: any): Promise<string[]>;
|
|
161
|
+
waiverAppliesToContext(waiver: any, context: any): boolean;
|
|
162
|
+
loadActiveWaivers(): Promise<any[]>;
|
|
163
|
+
saveActiveWaivers(waivers: any): Promise<void>;
|
|
164
|
+
auditLog(action: any, waiverId: any, details: any): Promise<void>;
|
|
165
|
+
flagForReview(waiver: any): Promise<void>;
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=waivers-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waivers-manager.d.ts","sourceRoot":"","sources":["../src/waivers-manager.js"],"names":[],"mappings":";AAaA;;;GAGG;AACH;IACE,0BAUC;IATC,iBAAuD;IACvD,mBAAiE;IACjE,oBAAoE;IACpE,qBAAkE;IAQpE;;OAEG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiGC;IAED;;OAEG;IACH;;;;;;;;;;;OA4DC;IAED;;OAEG;IACH;;;;;;;;;;OA+BC;IAED;;OAEG;IACH,mCAgBC;IAED;;OAEG;IACH,2DAeC;IAED;;OAEG;IACH,+EAuBC;IAED;;OAEG;IACH;;;;;;;;OA2DC;IAID,oCAUC;IAED;;;MAkDC;IAED,wDAkBC;IAED,2DAUC;IAED,oCAyCC;IAED,+CAuBC;IAED,kEAaC;IAED,0CA2CC;CACF"}
|