calllint 0.6.0 → 0.7.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/dist/index.js +63 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -91,6 +91,7 @@ SCAN OPTIONS
|
|
|
91
91
|
--sarif Emit SARIF 2.1.0 (GitHub Code Scanning / CI)
|
|
92
92
|
--markdown Emit Markdown for PR comments / GitHub Step Summary
|
|
93
93
|
--html Emit a self-contained HTML report
|
|
94
|
+
--badge Emit a shields.io endpoint badge JSON (SAFE/REVIEW/UNKNOWN/BLOCK)
|
|
94
95
|
--policy <file> Use a policy file (default: built-in defaults)
|
|
95
96
|
--stdin Read config JSON from stdin
|
|
96
97
|
--ci Exit non-zero per policy (BLOCK=30, UNKNOWN=20, REVIEW=10 if enabled)
|
|
@@ -110,6 +111,7 @@ EXAMPLES
|
|
|
110
111
|
calllint scan-all --no-emoji
|
|
111
112
|
calllint check ./mcp.json --json
|
|
112
113
|
calllint scan .cursor/mcp.json --markdown
|
|
114
|
+
calllint scan .cursor/mcp.json --badge > calllint-badge.json
|
|
113
115
|
calllint verify ./mcp.json --ci
|
|
114
116
|
calllint approve && calllint verify --approved --ci
|
|
115
117
|
calllint explain filesystem
|
|
@@ -767,6 +769,25 @@ function looksSecret(key) {
|
|
|
767
769
|
const upper = key.toUpperCase();
|
|
768
770
|
return SECRET_HINTS.some((h) => upper.includes(h));
|
|
769
771
|
}
|
|
772
|
+
function extractDockerEnvKeys(args) {
|
|
773
|
+
const keys = [];
|
|
774
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
775
|
+
const arg = args[i];
|
|
776
|
+
let spec;
|
|
777
|
+
if (arg === "-e" || arg === "--env") {
|
|
778
|
+
spec = args[i + 1];
|
|
779
|
+
i += 1;
|
|
780
|
+
} else if (arg.startsWith("-e=")) {
|
|
781
|
+
spec = arg.slice("-e=".length);
|
|
782
|
+
} else if (arg.startsWith("--env=")) {
|
|
783
|
+
spec = arg.slice("--env=".length);
|
|
784
|
+
}
|
|
785
|
+
if (spec === void 0) continue;
|
|
786
|
+
const eq = spec.indexOf("=");
|
|
787
|
+
keys.push(eq === -1 ? spec : spec.slice(0, eq));
|
|
788
|
+
}
|
|
789
|
+
return keys;
|
|
790
|
+
}
|
|
770
791
|
function detectSecretEnvKeys(ctx) {
|
|
771
792
|
const { server } = ctx;
|
|
772
793
|
const evidence = [];
|
|
@@ -781,6 +802,21 @@ function detectSecretEnvKeys(ctx) {
|
|
|
781
802
|
});
|
|
782
803
|
}
|
|
783
804
|
}
|
|
805
|
+
if ((server.command ?? "").toLowerCase() === "docker") {
|
|
806
|
+
const already = new Set(server.envKeys);
|
|
807
|
+
for (const key of extractDockerEnvKeys(server.args)) {
|
|
808
|
+
if (already.has(key)) continue;
|
|
809
|
+
already.add(key);
|
|
810
|
+
if (looksSecret(key)) {
|
|
811
|
+
evidence.push({
|
|
812
|
+
type: "config",
|
|
813
|
+
path: server.sourceConfigPath,
|
|
814
|
+
key: "args",
|
|
815
|
+
value: key
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
784
820
|
if (evidence.length === 0) return [];
|
|
785
821
|
return [
|
|
786
822
|
{
|
|
@@ -3361,6 +3397,32 @@ function mdCell(s) {
|
|
|
3361
3397
|
return s.replace(/\|/g, "\\|").replace(/\n/g, " ");
|
|
3362
3398
|
}
|
|
3363
3399
|
|
|
3400
|
+
// ../../packages/report-renderer/src/renderBadge.ts
|
|
3401
|
+
var BADGE_COLOR = {
|
|
3402
|
+
SAFE: "brightgreen",
|
|
3403
|
+
REVIEW: "yellow",
|
|
3404
|
+
UNKNOWN: "lightgrey",
|
|
3405
|
+
BLOCK: "red"
|
|
3406
|
+
};
|
|
3407
|
+
var BADGE_MESSAGE = {
|
|
3408
|
+
SAFE: "SAFE",
|
|
3409
|
+
REVIEW: "REVIEW",
|
|
3410
|
+
UNKNOWN: "UNKNOWN",
|
|
3411
|
+
BLOCK: "BLOCK"
|
|
3412
|
+
};
|
|
3413
|
+
function renderBadge(summary) {
|
|
3414
|
+
return JSON.stringify(badgeEndpoint(summary.verdict), null, 2);
|
|
3415
|
+
}
|
|
3416
|
+
function badgeEndpoint(verdict) {
|
|
3417
|
+
return {
|
|
3418
|
+
schemaVersion: 1,
|
|
3419
|
+
label: "CallLint",
|
|
3420
|
+
message: BADGE_MESSAGE[verdict],
|
|
3421
|
+
color: BADGE_COLOR[verdict],
|
|
3422
|
+
cacheSeconds: 3600
|
|
3423
|
+
};
|
|
3424
|
+
}
|
|
3425
|
+
|
|
3364
3426
|
// ../../packages/report-renderer/src/renderDiagnostics.ts
|
|
3365
3427
|
function verdictContributionFor(f) {
|
|
3366
3428
|
if (f.blocker) return "blocker";
|
|
@@ -3736,6 +3798,7 @@ function renderSummary(summary, args) {
|
|
|
3736
3798
|
if (flagBool(args.flags, "json")) return renderJson(summary);
|
|
3737
3799
|
if (flagBool(args.flags, "sarif")) return renderSarif(summary);
|
|
3738
3800
|
if (flagBool(args.flags, "markdown")) return renderMarkdown(summary);
|
|
3801
|
+
if (flagBool(args.flags, "badge")) return renderBadge(summary);
|
|
3739
3802
|
if (flagBool(args.flags, "html")) return renderHtml(summary);
|
|
3740
3803
|
if (flagBool(args.flags, "compact")) return renderCompact(summary, style);
|
|
3741
3804
|
return renderTerminal(summary, style);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "calllint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Evidence-backed security verdicts for MCP servers and agent tools. Lint agent tool-call risk before tools run — SAFE / REVIEW / BLOCK / UNKNOWN, with evidence. Never executes the server it judges.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|