@vyuhlabs/dxkit 2.2.0 → 2.2.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/CHANGELOG.md +45 -0
- package/package.json +4 -3
- package/dist/agents/extract.d.ts +0 -25
- package/dist/agents/extract.d.ts.map +0 -1
- package/dist/agents/extract.js +0 -186
- package/dist/agents/extract.js.map +0 -1
- package/dist/agents/schemas.d.ts +0 -106
- package/dist/agents/schemas.d.ts.map +0 -1
- package/dist/agents/schemas.js +0 -86
- package/dist/agents/schemas.js.map +0 -1
- package/dist/agents/session.d.ts +0 -28
- package/dist/agents/session.d.ts.map +0 -1
- package/dist/agents/session.js +0 -223
- package/dist/agents/session.js.map +0 -1
- package/dist/analyzers/index.d.ts +0 -3
- package/dist/analyzers/index.d.ts.map +0 -1
- package/dist/analyzers/index.js +0 -6
- package/dist/analyzers/index.js.map +0 -1
- package/dist/analyzers/security/report.d.ts +0 -6
- package/dist/analyzers/security/report.d.ts.map +0 -1
- package/dist/analyzers/security/report.js +0 -118
- package/dist/analyzers/security/report.js.map +0 -1
- package/dist/analyzers/tools/dotnet.d.ts +0 -8
- package/dist/analyzers/tools/dotnet.d.ts.map +0 -1
- package/dist/analyzers/tools/dotnet.js +0 -81
- package/dist/analyzers/tools/dotnet.js.map +0 -1
- package/dist/analyzers/tools/gather-cache.d.ts +0 -16
- package/dist/analyzers/tools/gather-cache.d.ts.map +0 -1
- package/dist/analyzers/tools/gather-cache.js +0 -126
- package/dist/analyzers/tools/gather-cache.js.map +0 -1
- package/dist/analyzers/tools/go.d.ts +0 -8
- package/dist/analyzers/tools/go.d.ts.map +0 -1
- package/dist/analyzers/tools/go.js +0 -84
- package/dist/analyzers/tools/go.js.map +0 -1
- package/dist/analyzers/tools/node.d.ts +0 -8
- package/dist/analyzers/tools/node.d.ts.map +0 -1
- package/dist/analyzers/tools/node.js +0 -160
- package/dist/analyzers/tools/node.js.map +0 -1
- package/dist/analyzers/tools/python.d.ts +0 -8
- package/dist/analyzers/tools/python.d.ts.map +0 -1
- package/dist/analyzers/tools/python.js +0 -81
- package/dist/analyzers/tools/python.js.map +0 -1
- package/dist/analyzers/tools/rust.d.ts +0 -8
- package/dist/analyzers/tools/rust.d.ts.map +0 -1
- package/dist/analyzers/tools/rust.js +0 -86
- package/dist/analyzers/tools/rust.js.map +0 -1
- package/templates/.ai/templates/session-checkpoint-template.md +0 -97
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Go tool runner — golangci-lint, govulncheck.
|
|
3
|
-
* Layer 1: language-specific tools for Go projects.
|
|
4
|
-
*/
|
|
5
|
-
import { HealthMetrics } from '../types';
|
|
6
|
-
/** Gather Go-specific metrics. */
|
|
7
|
-
export declare function gatherGoMetrics(cwd: string): Partial<HealthMetrics>;
|
|
8
|
-
//# sourceMappingURL=go.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"go.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/go.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAazC,kCAAkC;AAClC,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAwEnE"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gatherGoMetrics = gatherGoMetrics;
|
|
4
|
-
const runner_1 = require("./runner");
|
|
5
|
-
const tool_registry_1 = require("./tool-registry");
|
|
6
|
-
/** Gather Go-specific metrics. */
|
|
7
|
-
function gatherGoMetrics(cwd) {
|
|
8
|
-
const metrics = {
|
|
9
|
-
toolsUsed: [],
|
|
10
|
-
toolsUnavailable: [],
|
|
11
|
-
};
|
|
12
|
-
// golangci-lint
|
|
13
|
-
const lint = (0, tool_registry_1.findTool)(tool_registry_1.TOOL_DEFS['golangci-lint'], cwd);
|
|
14
|
-
if (lint.available && lint.path) {
|
|
15
|
-
const raw = (0, runner_1.run)(`${lint.path} run --out-format json ./... 2>/dev/null`, cwd, 120000);
|
|
16
|
-
if (raw) {
|
|
17
|
-
try {
|
|
18
|
-
const data = JSON.parse(raw);
|
|
19
|
-
const issues = data.Issues || [];
|
|
20
|
-
const errors = issues.filter((i) => i.Severity === 'error').length;
|
|
21
|
-
const warnings = issues.length - errors;
|
|
22
|
-
metrics.lintErrors = errors;
|
|
23
|
-
metrics.lintWarnings = warnings;
|
|
24
|
-
metrics.lintTool = 'golangci-lint';
|
|
25
|
-
metrics.toolsUsed.push('golangci-lint');
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
metrics.toolsUnavailable.push('golangci-lint (parse error)');
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
// Empty = no issues
|
|
33
|
-
metrics.lintErrors = 0;
|
|
34
|
-
metrics.lintWarnings = 0;
|
|
35
|
-
metrics.lintTool = 'golangci-lint';
|
|
36
|
-
metrics.toolsUsed.push('golangci-lint');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
metrics.toolsUnavailable.push('golangci-lint');
|
|
41
|
-
}
|
|
42
|
-
// govulncheck
|
|
43
|
-
const vuln = (0, tool_registry_1.findTool)(tool_registry_1.TOOL_DEFS.govulncheck, cwd);
|
|
44
|
-
if (vuln.available && vuln.path) {
|
|
45
|
-
const raw = (0, runner_1.run)(`${vuln.path} -json ./... 2>/dev/null`, cwd, 120000);
|
|
46
|
-
if (raw) {
|
|
47
|
-
try {
|
|
48
|
-
// govulncheck JSON is newline-delimited JSON objects
|
|
49
|
-
let vulnCount = 0;
|
|
50
|
-
for (const line of raw.split('\n')) {
|
|
51
|
-
if (!line.trim())
|
|
52
|
-
continue;
|
|
53
|
-
try {
|
|
54
|
-
const obj = JSON.parse(line);
|
|
55
|
-
if (obj.finding)
|
|
56
|
-
vulnCount++;
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
/* skip non-JSON lines */
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
// govulncheck doesn't provide severity breakdown — count all as high
|
|
63
|
-
metrics.depVulnHigh = vulnCount;
|
|
64
|
-
metrics.depVulnCritical = 0;
|
|
65
|
-
metrics.depVulnMedium = 0;
|
|
66
|
-
metrics.depVulnLow = 0;
|
|
67
|
-
metrics.depAuditTool = 'govulncheck';
|
|
68
|
-
metrics.toolsUsed.push('govulncheck');
|
|
69
|
-
}
|
|
70
|
-
catch {
|
|
71
|
-
metrics.toolsUnavailable.push('govulncheck (parse error)');
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
metrics.toolsUnavailable.push('govulncheck');
|
|
77
|
-
}
|
|
78
|
-
// Test framework detection
|
|
79
|
-
if ((0, runner_1.fileExists)(cwd, 'go.mod')) {
|
|
80
|
-
metrics.testFramework = 'go-test';
|
|
81
|
-
}
|
|
82
|
-
return metrics;
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=go.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"go.js","sourceRoot":"","sources":["../../../src/analyzers/tools/go.ts"],"names":[],"mappings":";;AAkBA,0CAwEC;AArFD,qCAA2C;AAC3C,mDAAsD;AAWtD,kCAAkC;AAClC,SAAgB,eAAe,CAAC,GAAW;IACzC,MAAM,OAAO,GAA2B;QACtC,SAAS,EAAE,EAAE;QACb,gBAAgB,EAAE,EAAE;KACrB,CAAC;IAEF,gBAAgB;IAChB,MAAM,IAAI,GAAG,IAAA,wBAAQ,EAAC,yBAAS,CAAC,eAAe,CAAC,EAAE,GAAG,CAAC,CAAC;IACvD,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,IAAA,YAAG,EAAC,GAAG,IAAI,CAA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ACjB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node.js tool runner -- eslint, npm audit, test runners.
|
|
3
|
-
* Layer 1 (project tools) + Layer 2 (optional tools).
|
|
4
|
-
*/
|
|
5
|
-
import { HealthMetrics } from '../types';
|
|
6
|
-
/** Gather Node.js-specific metrics. */
|
|
7
|
-
export declare function gatherNodeMetrics(cwd: string): Partial<HealthMetrics>;
|
|
8
|
-
//# sourceMappingURL=node.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/node.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAiBzC,uCAAuC;AACvC,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAwFrE"}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gatherNodeMetrics = gatherNodeMetrics;
|
|
4
|
-
const runner_1 = require("./runner");
|
|
5
|
-
/** Gather Node.js-specific metrics. */
|
|
6
|
-
function gatherNodeMetrics(cwd) {
|
|
7
|
-
const metrics = {
|
|
8
|
-
toolsUsed: [],
|
|
9
|
-
toolsUnavailable: [],
|
|
10
|
-
};
|
|
11
|
-
// ESLint — pick the right binary and config format, skip gracefully if mismatched
|
|
12
|
-
const eslintStatus = runEslint(cwd);
|
|
13
|
-
if (eslintStatus.ran) {
|
|
14
|
-
metrics.lintErrors = eslintStatus.errors;
|
|
15
|
-
metrics.lintWarnings = eslintStatus.warnings;
|
|
16
|
-
metrics.lintTool = 'eslint';
|
|
17
|
-
metrics.toolsUsed.push('eslint');
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
metrics.toolsUnavailable.push(`eslint (${eslintStatus.reason})`);
|
|
21
|
-
}
|
|
22
|
-
// npm audit -- handles both v1 and v2+ formats
|
|
23
|
-
// npm audit may exit non-zero when vulnerabilities exist, so use run() which catches errors
|
|
24
|
-
// Don't redirect stderr to /dev/null — some versions write JSON to stderr
|
|
25
|
-
const auditRaw = (0, runner_1.run)('npm audit --json 2>&1', cwd, 60000);
|
|
26
|
-
if (auditRaw) {
|
|
27
|
-
try {
|
|
28
|
-
const auditData = JSON.parse(auditRaw);
|
|
29
|
-
let critical = 0, high = 0, medium = 0, low = 0;
|
|
30
|
-
if (auditData.metadata?.vulnerabilities) {
|
|
31
|
-
const v = auditData.metadata.vulnerabilities;
|
|
32
|
-
critical = v.critical || 0;
|
|
33
|
-
high = v.high || 0;
|
|
34
|
-
medium = v.moderate || 0;
|
|
35
|
-
low = v.low || 0;
|
|
36
|
-
}
|
|
37
|
-
else if (auditData.vulnerabilities) {
|
|
38
|
-
for (const v of Object.values(auditData.vulnerabilities)) {
|
|
39
|
-
if (v.severity === 'critical')
|
|
40
|
-
critical++;
|
|
41
|
-
else if (v.severity === 'high')
|
|
42
|
-
high++;
|
|
43
|
-
else if (v.severity === 'moderate')
|
|
44
|
-
medium++;
|
|
45
|
-
else if (v.severity === 'low')
|
|
46
|
-
low++;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
metrics.depVulnCritical = critical;
|
|
50
|
-
metrics.depVulnHigh = high;
|
|
51
|
-
metrics.depVulnMedium = medium;
|
|
52
|
-
metrics.depVulnLow = low;
|
|
53
|
-
metrics.depAuditTool = 'npm-audit';
|
|
54
|
-
metrics.toolsUsed.push('npm-audit');
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
metrics.toolsUnavailable.push('npm-audit (parse error)');
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
metrics.toolsUnavailable.push('npm-audit');
|
|
62
|
-
}
|
|
63
|
-
// Test runner detection (detect framework but don't run tests -- too slow for health audit)
|
|
64
|
-
const testScript = (0, runner_1.run)("node -e \"const p=require('./package.json'); console.log(p.scripts?.test || '')\" 2>/dev/null", cwd);
|
|
65
|
-
if (testScript && testScript !== 'echo "Error: no test specified" && exit 1') {
|
|
66
|
-
let framework = 'unknown';
|
|
67
|
-
if (testScript.includes('vitest'))
|
|
68
|
-
framework = 'vitest';
|
|
69
|
-
else if (testScript.includes('jest'))
|
|
70
|
-
framework = 'jest';
|
|
71
|
-
else if (testScript.includes('mocha') || testScript.includes('lb-mocha'))
|
|
72
|
-
framework = 'mocha';
|
|
73
|
-
else if (testScript.includes('ava'))
|
|
74
|
-
framework = 'ava';
|
|
75
|
-
else if (testScript.includes('tap'))
|
|
76
|
-
framework = 'tap';
|
|
77
|
-
metrics.testFramework = framework;
|
|
78
|
-
}
|
|
79
|
-
// npm scripts count
|
|
80
|
-
const scriptsOutput = (0, runner_1.run)('node -e "const p=require(\'./package.json\'); console.log(Object.keys(p.scripts||{}).length)" 2>/dev/null', cwd);
|
|
81
|
-
metrics.npmScriptsCount = parseInt(scriptsOutput) || 0;
|
|
82
|
-
// Node engine
|
|
83
|
-
const engineOutput = (0, runner_1.run)("node -e \"const p=require('./package.json'); console.log(p.engines?.node || '')\" 2>/dev/null", cwd);
|
|
84
|
-
if (engineOutput) {
|
|
85
|
-
metrics.nodeEngineVersion = engineOutput;
|
|
86
|
-
}
|
|
87
|
-
return metrics;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Run eslint with config-aware binary selection and graceful failure.
|
|
91
|
-
*
|
|
92
|
-
* Compatibility matrix:
|
|
93
|
-
* - ESLint v9+: needs eslint.config.{js,mjs,cjs,ts} (flat config)
|
|
94
|
-
* - ESLint v8: needs .eslintrc.{js,json,yml,yaml,cjs}
|
|
95
|
-
* - LoopBack projects: use lb-eslint binary with embedded config
|
|
96
|
-
*/
|
|
97
|
-
function runEslint(cwd) {
|
|
98
|
-
// Prefer lb-eslint if present (LoopBack embeds its own config)
|
|
99
|
-
const lbEslintPath = 'node_modules/.bin/lb-eslint';
|
|
100
|
-
const eslintPath = 'node_modules/.bin/eslint';
|
|
101
|
-
const hasLbEslint = (0, runner_1.fileExists)(cwd, lbEslintPath);
|
|
102
|
-
const hasEslint = (0, runner_1.fileExists)(cwd, eslintPath);
|
|
103
|
-
if (!hasLbEslint && !hasEslint) {
|
|
104
|
-
return { ran: false, errors: 0, warnings: 0, reason: 'not installed' };
|
|
105
|
-
}
|
|
106
|
-
// Detect config format
|
|
107
|
-
const hasFlatConfig = (0, runner_1.fileExists)(cwd, 'eslint.config.js', 'eslint.config.mjs', 'eslint.config.cjs', 'eslint.config.ts');
|
|
108
|
-
const hasLegacyConfig = (0, runner_1.fileExists)(cwd, '.eslintrc', '.eslintrc.js', '.eslintrc.json', '.eslintrc.yml', '.eslintrc.yaml', '.eslintrc.cjs');
|
|
109
|
-
// Get eslint version to check compatibility
|
|
110
|
-
const binToCheck = hasEslint ? `./${eslintPath}` : `./${lbEslintPath}`;
|
|
111
|
-
const versionOutput = (0, runner_1.run)(`${binToCheck} --version 2>/dev/null`, cwd);
|
|
112
|
-
const majorMatch = versionOutput.match(/v?(\d+)/);
|
|
113
|
-
const major = majorMatch ? parseInt(majorMatch[1]) : 0;
|
|
114
|
-
// Config compatibility check
|
|
115
|
-
if (major >= 9 && !hasFlatConfig) {
|
|
116
|
-
// v9+ needs flat config
|
|
117
|
-
if (hasLbEslint) {
|
|
118
|
-
// lb-eslint may provide its own config; try it
|
|
119
|
-
// (fall through to actual run)
|
|
120
|
-
}
|
|
121
|
-
else if (hasLegacyConfig) {
|
|
122
|
-
return {
|
|
123
|
-
ran: false,
|
|
124
|
-
errors: 0,
|
|
125
|
-
warnings: 0,
|
|
126
|
-
reason: `v${major} but project uses legacy .eslintrc`,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
return {
|
|
131
|
-
ran: false,
|
|
132
|
-
errors: 0,
|
|
133
|
-
warnings: 0,
|
|
134
|
-
reason: 'no eslint config found',
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
// Prefer lb-eslint first if available, then standard eslint
|
|
139
|
-
const bins = hasLbEslint ? [`./${lbEslintPath}`, `./${eslintPath}`] : [`./${eslintPath}`];
|
|
140
|
-
for (const bin of bins) {
|
|
141
|
-
if (!(0, runner_1.fileExists)(cwd, bin.replace('./', '')))
|
|
142
|
-
continue;
|
|
143
|
-
const result = (0, runner_1.runJSON)(`${bin} . --format json 2>/dev/null`, cwd, 120000);
|
|
144
|
-
if (result && Array.isArray(result)) {
|
|
145
|
-
let errors = 0;
|
|
146
|
-
let warnings = 0;
|
|
147
|
-
for (const file of result) {
|
|
148
|
-
for (const msg of file.messages || []) {
|
|
149
|
-
if (msg.severity === 2)
|
|
150
|
-
errors++;
|
|
151
|
-
else
|
|
152
|
-
warnings++;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return { ran: true, errors, warnings, reason: '' };
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return { ran: false, errors: 0, warnings: 0, reason: 'config error' };
|
|
159
|
-
}
|
|
160
|
-
//# sourceMappingURL=node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/analyzers/tools/node.ts"],"names":[],"mappings":";;AAsBA,8CAwFC;AAzGD,qCAAoD;AAgBpD,uCAAuC;AACvC,SAAgB,iBAAiB,CAAC,GAAW;IAC3C,MAAM,OAAO,GAA2B;QACtC,SAAS,EAAE,EAAE;QACb,gBAAgB,EAAE,EAAE;KACrB,CAAC;IAEF,kFAAkF;IAClF,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,YAAY,CAAC,GAAG,EAAE,CAAC;QACrB,OAAO,CAAC,UAAU,GAAG,YAAY,CAAC,MAAM,CAAC;QACzC,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC;QAC7C,OAAO,CAAC,QAAQ,G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EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC9F,IAAI,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACpC,IAAI,MAAM,GAAG,CAAC,CAAC;YACf,IAAI,QAAQ,GAAG,CAAC,CAAC;YACjB,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;gBAC1B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;oBACtC,IAAI,GAAG,CAAC,QAAQ,KAAK,CAAC;wBAAE,MAAM,EAAE,CAAC;;wBAC5B,QAAQ,EAAE,CAAC;gBAClB,CAAC;YACH,CAAC;YACD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QACrD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Python tool runner — ruff (lint), pip-audit (deps).
|
|
3
|
-
* Layer 1: language-specific tools for Python projects.
|
|
4
|
-
*/
|
|
5
|
-
import { HealthMetrics } from '../types';
|
|
6
|
-
/** Gather Python-specific metrics. */
|
|
7
|
-
export declare function gatherPythonMetrics(cwd: string): Partial<HealthMetrics>;
|
|
8
|
-
//# sourceMappingURL=python.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"python.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/python.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAUzC,sCAAsC;AACtC,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA0EvE"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gatherPythonMetrics = gatherPythonMetrics;
|
|
4
|
-
const runner_1 = require("./runner");
|
|
5
|
-
const tool_registry_1 = require("./tool-registry");
|
|
6
|
-
/** Gather Python-specific metrics. */
|
|
7
|
-
function gatherPythonMetrics(cwd) {
|
|
8
|
-
const metrics = {
|
|
9
|
-
toolsUsed: [],
|
|
10
|
-
toolsUnavailable: [],
|
|
11
|
-
};
|
|
12
|
-
// ruff (lint)
|
|
13
|
-
const ruff = (0, tool_registry_1.findTool)(tool_registry_1.TOOL_DEFS.ruff, cwd);
|
|
14
|
-
if (ruff.available && ruff.path) {
|
|
15
|
-
const raw = (0, runner_1.run)(`${ruff.path} check . --output-format json 2>/dev/null`, cwd, 60000);
|
|
16
|
-
if (raw) {
|
|
17
|
-
try {
|
|
18
|
-
const results = JSON.parse(raw);
|
|
19
|
-
if (Array.isArray(results)) {
|
|
20
|
-
// ruff doesn't distinguish error/warning by default — all are errors
|
|
21
|
-
metrics.lintErrors = results.length;
|
|
22
|
-
metrics.lintWarnings = 0;
|
|
23
|
-
metrics.lintTool = 'ruff';
|
|
24
|
-
metrics.toolsUsed.push('ruff');
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
metrics.toolsUnavailable.push('ruff (parse error)');
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
// Empty output = no errors
|
|
33
|
-
metrics.lintErrors = 0;
|
|
34
|
-
metrics.lintWarnings = 0;
|
|
35
|
-
metrics.lintTool = 'ruff';
|
|
36
|
-
metrics.toolsUsed.push('ruff');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
metrics.toolsUnavailable.push('ruff');
|
|
41
|
-
}
|
|
42
|
-
// pip-audit (dependency vulnerabilities)
|
|
43
|
-
const pipAudit = (0, tool_registry_1.findTool)(tool_registry_1.TOOL_DEFS['pip-audit'], cwd);
|
|
44
|
-
if (pipAudit.available && pipAudit.path) {
|
|
45
|
-
const raw = (0, runner_1.run)(`${pipAudit.path} --format json 2>/dev/null`, cwd, 120000);
|
|
46
|
-
if (raw) {
|
|
47
|
-
try {
|
|
48
|
-
const data = JSON.parse(raw);
|
|
49
|
-
let medium = 0;
|
|
50
|
-
for (const dep of data.dependencies || []) {
|
|
51
|
-
// pip-audit doesn't provide severity — count all as medium
|
|
52
|
-
medium += (dep.vulns || []).length;
|
|
53
|
-
}
|
|
54
|
-
const critical = 0;
|
|
55
|
-
const high = 0;
|
|
56
|
-
const low = 0;
|
|
57
|
-
metrics.depVulnCritical = critical;
|
|
58
|
-
metrics.depVulnHigh = high;
|
|
59
|
-
metrics.depVulnMedium = medium;
|
|
60
|
-
metrics.depVulnLow = low;
|
|
61
|
-
metrics.depAuditTool = 'pip-audit';
|
|
62
|
-
metrics.toolsUsed.push('pip-audit');
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
metrics.toolsUnavailable.push('pip-audit (parse error)');
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
metrics.toolsUnavailable.push('pip-audit');
|
|
71
|
-
}
|
|
72
|
-
// Test framework detection (don't run tests — just detect)
|
|
73
|
-
if ((0, runner_1.fileExists)(cwd, 'pytest.ini', 'conftest.py') || (0, runner_1.fileExists)(cwd, 'pyproject.toml')) {
|
|
74
|
-
const pyproject = (0, runner_1.run)('cat pyproject.toml 2>/dev/null', cwd);
|
|
75
|
-
if (pyproject?.includes('[tool.pytest') || (0, runner_1.fileExists)(cwd, 'pytest.ini', 'conftest.py')) {
|
|
76
|
-
metrics.testFramework = 'pytest';
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return metrics;
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=python.js.map
|
|
@@ -1 +0,0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AAiB,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,gBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9C,CAAC;IAED,2DAA2D;IAC3D,IAAI,IAAA,mBAAU,EAAC,GAAG,EAAE,YAAY,EAAE,aAAa,CAAC,IAAI,IAAA,mBAAU,EAAC,GAAG,EAAE,gBAAgB,CAAC,EAAE,CAAC;QACtF,MAAM,SAAS,GAAG,IAAA,YAAG,EAAC,gCAAgC,EAAE,GAAG,CAAC,CAAC;QAC7D,IAAI,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,IAAI,IAAA,mBAAU,EAAC,GAAG,EAAE,YAAY,EAAE,aAAa,CAAC,EAAE,CAAC;YACxF,OAAO,CAAC,aAAa,GAAG,QAAQ,CAAC;QACnC,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rust tool runner — clippy, cargo-audit.
|
|
3
|
-
* Layer 1: language-specific tools for Rust projects.
|
|
4
|
-
*/
|
|
5
|
-
import { HealthMetrics } from '../types';
|
|
6
|
-
/** Gather Rust-specific metrics. */
|
|
7
|
-
export declare function gatherRustMetrics(cwd: string): Partial<HealthMetrics>;
|
|
8
|
-
//# sourceMappingURL=rust.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rust.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/rust.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAoBzC,oCAAoC;AACpC,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA0ErE"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gatherRustMetrics = gatherRustMetrics;
|
|
4
|
-
const runner_1 = require("./runner");
|
|
5
|
-
const tool_registry_1 = require("./tool-registry");
|
|
6
|
-
/** Gather Rust-specific metrics. */
|
|
7
|
-
function gatherRustMetrics(cwd) {
|
|
8
|
-
const metrics = {
|
|
9
|
-
toolsUsed: [],
|
|
10
|
-
toolsUnavailable: [],
|
|
11
|
-
};
|
|
12
|
-
// clippy
|
|
13
|
-
const clippy = (0, tool_registry_1.findTool)(tool_registry_1.TOOL_DEFS.clippy, cwd);
|
|
14
|
-
if (clippy.available) {
|
|
15
|
-
const raw = (0, runner_1.run)('cargo clippy --message-format json 2>/dev/null', cwd, 120000);
|
|
16
|
-
if (raw) {
|
|
17
|
-
let errors = 0;
|
|
18
|
-
let warnings = 0;
|
|
19
|
-
for (const line of raw.split('\n')) {
|
|
20
|
-
if (!line.trim())
|
|
21
|
-
continue;
|
|
22
|
-
try {
|
|
23
|
-
const msg = JSON.parse(line);
|
|
24
|
-
if (msg.reason === 'compiler-message' && msg.message) {
|
|
25
|
-
if (msg.message.level === 'error')
|
|
26
|
-
errors++;
|
|
27
|
-
else if (msg.message.level === 'warning')
|
|
28
|
-
warnings++;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
/* skip non-JSON lines */
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
metrics.lintErrors = errors;
|
|
36
|
-
metrics.lintWarnings = warnings;
|
|
37
|
-
metrics.lintTool = 'clippy';
|
|
38
|
-
metrics.toolsUsed.push('clippy');
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
metrics.toolsUnavailable.push('clippy');
|
|
43
|
-
}
|
|
44
|
-
// cargo-audit
|
|
45
|
-
const audit = (0, tool_registry_1.findTool)(tool_registry_1.TOOL_DEFS['cargo-audit'], cwd);
|
|
46
|
-
if (audit.available && audit.path) {
|
|
47
|
-
const raw = (0, runner_1.run)(`${audit.path} audit --json 2>/dev/null`, cwd, 60000);
|
|
48
|
-
if (raw) {
|
|
49
|
-
try {
|
|
50
|
-
const data = JSON.parse(raw);
|
|
51
|
-
if (data.vulnerabilities) {
|
|
52
|
-
let critical = 0, high = 0, medium = 0, low = 0;
|
|
53
|
-
for (const v of data.vulnerabilities.list || []) {
|
|
54
|
-
const sev = v.advisory?.severity?.toLowerCase();
|
|
55
|
-
if (sev === 'critical')
|
|
56
|
-
critical++;
|
|
57
|
-
else if (sev === 'high')
|
|
58
|
-
high++;
|
|
59
|
-
else if (sev === 'medium')
|
|
60
|
-
medium++;
|
|
61
|
-
else
|
|
62
|
-
low++;
|
|
63
|
-
}
|
|
64
|
-
metrics.depVulnCritical = critical;
|
|
65
|
-
metrics.depVulnHigh = high;
|
|
66
|
-
metrics.depVulnMedium = medium;
|
|
67
|
-
metrics.depVulnLow = low;
|
|
68
|
-
metrics.depAuditTool = 'cargo-audit';
|
|
69
|
-
metrics.toolsUsed.push('cargo-audit');
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
metrics.toolsUnavailable.push('cargo-audit (parse error)');
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
metrics.toolsUnavailable.push('cargo-audit');
|
|
79
|
-
}
|
|
80
|
-
// Test framework detection
|
|
81
|
-
if ((0, runner_1.fileExists)(cwd, 'Cargo.toml')) {
|
|
82
|
-
metrics.testFramework = 'cargo-test';
|
|
83
|
-
}
|
|
84
|
-
return metrics;
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=rust.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rust.js","sourceRoot":"","sources":["../../../src/analyzers/tools/rust.ts"],"names":[],"mappings":";;AAyBA,8CA0EC;AA9FD,qCAA2C;AAC3C,mDAAsD;AAkBtD,oCAAoC;AACpC,SAAgB,iBAAi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IAAI,CAAC,aAAa,CAAC,CAAC;gBACzC,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,CAAC,gBAAiB,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;YAC9D,CAAC;QACH,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,gBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAChD,CAAC;IAED,2BAA2B;IAC3B,IAAI,IAAA,mBAAU,EAAC,GAAG,EAAE,YAAY,CAAC,EAAE,CAAC;QAClC,OAAO,CAAC,aAAa,GAAG,YAAY,CAAC;IACvC,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
# Session Checkpoint: {DATE} - Session {N}
|
|
2
|
-
|
|
3
|
-
**Developer:** {DEVELOPER_NAME}
|
|
4
|
-
**Date:** {YYYY-MM-DD}
|
|
5
|
-
**Duration:** {X hours}
|
|
6
|
-
|
|
7
|
-
## Session Goal
|
|
8
|
-
{One-line description of what we set out to accomplish}
|
|
9
|
-
|
|
10
|
-
## Accomplished ✅
|
|
11
|
-
- {Specific item 1}
|
|
12
|
-
- {Specific item 2}
|
|
13
|
-
- {Specific item 3}
|
|
14
|
-
|
|
15
|
-
## Files Created/Modified
|
|
16
|
-
|
|
17
|
-
### Created
|
|
18
|
-
- `path/to/new/file1.py` - {brief description}
|
|
19
|
-
- `path/to/new/file2.go` - {brief description}
|
|
20
|
-
|
|
21
|
-
### Modified
|
|
22
|
-
- `path/to/existing/file1.py` - {what changed}
|
|
23
|
-
- `path/to/existing/file2.go` - {what changed}
|
|
24
|
-
|
|
25
|
-
## Key Decisions
|
|
26
|
-
|
|
27
|
-
### Decision 1: {Title}
|
|
28
|
-
**Why:** {Reasoning for this approach}
|
|
29
|
-
**Alternatives considered:** {Other options we discussed}
|
|
30
|
-
**Trade-offs:** {What we gained/lost with this choice}
|
|
31
|
-
|
|
32
|
-
### Decision 2: {Title}
|
|
33
|
-
**Why:** {Reasoning}
|
|
34
|
-
**Alternatives considered:** {Other options}
|
|
35
|
-
**Trade-offs:** {Gains/losses}
|
|
36
|
-
|
|
37
|
-
## Implementation Details
|
|
38
|
-
|
|
39
|
-
### {Component/Feature Name}
|
|
40
|
-
{Brief technical description of how it works, key patterns used, important details}
|
|
41
|
-
|
|
42
|
-
### {Component/Feature Name}
|
|
43
|
-
{Description}
|
|
44
|
-
|
|
45
|
-
## Testing Status
|
|
46
|
-
- [ ] Unit tests added/updated
|
|
47
|
-
- [ ] Integration tests added/updated
|
|
48
|
-
- [ ] Manual testing completed
|
|
49
|
-
- [ ] All tests passing (`make test`)
|
|
50
|
-
- [ ] Code linted and formatted (`make lint && make format`)
|
|
51
|
-
|
|
52
|
-
## Next Session
|
|
53
|
-
|
|
54
|
-
### Goal
|
|
55
|
-
{What to accomplish next - be specific}
|
|
56
|
-
|
|
57
|
-
### Planned Steps
|
|
58
|
-
1. {Specific next step with enough context}
|
|
59
|
-
2. {Specific next step}
|
|
60
|
-
3. {Specific next step}
|
|
61
|
-
|
|
62
|
-
### Context for AI Agent
|
|
63
|
-
```
|
|
64
|
-
We just completed {X}. The implementation is in {files}.
|
|
65
|
-
|
|
66
|
-
Next, we need to {Y} because {reason}.
|
|
67
|
-
|
|
68
|
-
Key context to remember:
|
|
69
|
-
- {Important detail 1}
|
|
70
|
-
- {Important detail 2}
|
|
71
|
-
|
|
72
|
-
Start by {first specific action}.
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Blockers / Considerations
|
|
76
|
-
|
|
77
|
-
### Blockers
|
|
78
|
-
- {Any blockers that need resolution}
|
|
79
|
-
|
|
80
|
-
### Technical Debt
|
|
81
|
-
- {Any shortcuts taken that need future attention}
|
|
82
|
-
|
|
83
|
-
### Things to Watch
|
|
84
|
-
- {Potential issues or areas needing careful attention}
|
|
85
|
-
|
|
86
|
-
### Dependencies
|
|
87
|
-
- {External dependencies or waiting on other work}
|
|
88
|
-
|
|
89
|
-
## References
|
|
90
|
-
- Related docs: {links to relevant documentation}
|
|
91
|
-
- Related issues: {GitHub issue links}
|
|
92
|
-
- Related PRs: {Pull request links}
|
|
93
|
-
- External resources: {API docs, articles, etc.}
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
**Session Summary:** {One paragraph summarizing the session for quick scanning}
|