@kevinrabun/judges 3.65.0 → 3.66.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/CHANGELOG.md +8 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +56 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/finding-timeline.d.ts +5 -0
- package/dist/commands/finding-timeline.d.ts.map +1 -0
- package/dist/commands/finding-timeline.js +144 -0
- package/dist/commands/finding-timeline.js.map +1 -0
- package/dist/commands/fix-verify.d.ts +5 -0
- package/dist/commands/fix-verify.d.ts.map +1 -0
- package/dist/commands/fix-verify.js +124 -0
- package/dist/commands/fix-verify.js.map +1 -0
- package/dist/commands/review-comment.d.ts +5 -0
- package/dist/commands/review-comment.d.ts.map +1 -0
- package/dist/commands/review-comment.js +166 -0
- package/dist/commands/review-comment.js.map +1 -0
- package/dist/commands/review-export.d.ts +5 -0
- package/dist/commands/review-export.d.ts.map +1 -0
- package/dist/commands/review-export.js +180 -0
- package/dist/commands/review-export.js.map +1 -0
- package/dist/commands/review-schedule.d.ts +5 -0
- package/dist/commands/review-schedule.d.ts.map +1 -0
- package/dist/commands/review-schedule.js +170 -0
- package/dist/commands/review-schedule.js.map +1 -0
- package/dist/commands/review-scope.d.ts +5 -0
- package/dist/commands/review-scope.d.ts.map +1 -0
- package/dist/commands/review-scope.js +198 -0
- package/dist/commands/review-scope.js.map +1 -0
- package/dist/commands/rule-catalog.d.ts +5 -0
- package/dist/commands/rule-catalog.d.ts.map +1 -0
- package/dist/commands/rule-catalog.js +129 -0
- package/dist/commands/rule-catalog.js.map +1 -0
- package/dist/commands/setup-wizard.d.ts +5 -0
- package/dist/commands/setup-wizard.d.ts.map +1 -0
- package/dist/commands/setup-wizard.js +175 -0
- package/dist/commands/setup-wizard.js.map +1 -0
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rule-catalog — Browse, search, and preview available rules with examples.
|
|
3
|
+
*/
|
|
4
|
+
import { defaultRegistry } from "../judge-registry.js";
|
|
5
|
+
// ─── CLI ────────────────────────────────────────────────────────────────────
|
|
6
|
+
export function runRuleCatalog(argv) {
|
|
7
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
8
|
+
console.log(`
|
|
9
|
+
judges rule-catalog — Browse and search available rules
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
judges rule-catalog List all rules
|
|
13
|
+
judges rule-catalog --search injection Search rules by keyword
|
|
14
|
+
judges rule-catalog --judge security Filter by judge
|
|
15
|
+
judges rule-catalog --severity critical Filter by severity
|
|
16
|
+
judges rule-catalog --count Show rule count only
|
|
17
|
+
judges rule-catalog --format json JSON output
|
|
18
|
+
|
|
19
|
+
Options:
|
|
20
|
+
--search <keyword> Search rules by keyword in name/description
|
|
21
|
+
--judge <id> Filter rules by judge ID
|
|
22
|
+
--severity <level> Filter by severity level
|
|
23
|
+
--count Show count only
|
|
24
|
+
--format json JSON output
|
|
25
|
+
--help, -h Show this help
|
|
26
|
+
|
|
27
|
+
Browse the full catalog of rules available across all judges.
|
|
28
|
+
`);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const format = argv.find((_a, i) => argv[i - 1] === "--format") || "text";
|
|
32
|
+
const search = argv.find((_a, i) => argv[i - 1] === "--search") || "";
|
|
33
|
+
const judgeFilter = argv.find((_a, i) => argv[i - 1] === "--judge") || "";
|
|
34
|
+
const sevFilter = argv.find((_a, i) => argv[i - 1] === "--severity") || "";
|
|
35
|
+
const countOnly = argv.includes("--count");
|
|
36
|
+
const judges = defaultRegistry.getJudges();
|
|
37
|
+
const catalog = [];
|
|
38
|
+
for (const judge of judges) {
|
|
39
|
+
// Create catalog entries from judge metadata
|
|
40
|
+
const entry = {
|
|
41
|
+
judgeId: judge.id,
|
|
42
|
+
ruleId: judge.id,
|
|
43
|
+
description: `Rules from ${judge.id} judge`,
|
|
44
|
+
severity: "medium",
|
|
45
|
+
category: categorizeJudge(judge.id),
|
|
46
|
+
};
|
|
47
|
+
// Filter by judge
|
|
48
|
+
if (judgeFilter && !judge.id.toLowerCase().includes(judgeFilter.toLowerCase()))
|
|
49
|
+
continue;
|
|
50
|
+
// Filter by severity
|
|
51
|
+
if (sevFilter && entry.severity !== sevFilter.toLowerCase())
|
|
52
|
+
continue;
|
|
53
|
+
// Search filter
|
|
54
|
+
if (search) {
|
|
55
|
+
const haystack = `${entry.judgeId} ${entry.ruleId} ${entry.description} ${entry.category}`.toLowerCase();
|
|
56
|
+
if (!haystack.includes(search.toLowerCase()))
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
catalog.push(entry);
|
|
60
|
+
}
|
|
61
|
+
if (countOnly) {
|
|
62
|
+
console.log(catalog.length);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (format === "json") {
|
|
66
|
+
console.log(JSON.stringify({ total: catalog.length, rules: catalog }, null, 2));
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
console.log(`\n Rule Catalog (${catalog.length} rules)\n ═════════════════════════════`);
|
|
70
|
+
if (catalog.length === 0) {
|
|
71
|
+
console.log(" No rules match your filters.");
|
|
72
|
+
console.log();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
// Group by category
|
|
76
|
+
const byCategory = new Map();
|
|
77
|
+
for (const entry of catalog) {
|
|
78
|
+
const cat = entry.category;
|
|
79
|
+
const arr = byCategory.get(cat);
|
|
80
|
+
if (arr)
|
|
81
|
+
arr.push(entry);
|
|
82
|
+
else
|
|
83
|
+
byCategory.set(cat, [entry]);
|
|
84
|
+
}
|
|
85
|
+
for (const [category, entries] of byCategory) {
|
|
86
|
+
console.log(`\n ${category.toUpperCase()} (${entries.length})`);
|
|
87
|
+
console.log(" ─────────────────────────────");
|
|
88
|
+
for (const e of entries) {
|
|
89
|
+
console.log(` ${e.ruleId.padEnd(30)} ${e.description}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
console.log();
|
|
93
|
+
}
|
|
94
|
+
function categorizeJudge(id) {
|
|
95
|
+
const lower = id.toLowerCase();
|
|
96
|
+
if (lower.includes("sql") ||
|
|
97
|
+
lower.includes("xss") ||
|
|
98
|
+
lower.includes("inject") ||
|
|
99
|
+
lower.includes("auth") ||
|
|
100
|
+
lower.includes("crypto") ||
|
|
101
|
+
lower.includes("secret") ||
|
|
102
|
+
lower.includes("security") ||
|
|
103
|
+
lower.includes("pii") ||
|
|
104
|
+
lower.includes("privilege")) {
|
|
105
|
+
return "security";
|
|
106
|
+
}
|
|
107
|
+
if (lower.includes("perf") ||
|
|
108
|
+
lower.includes("cache") ||
|
|
109
|
+
lower.includes("optim") ||
|
|
110
|
+
lower.includes("memory") ||
|
|
111
|
+
lower.includes("resource")) {
|
|
112
|
+
return "performance";
|
|
113
|
+
}
|
|
114
|
+
if (lower.includes("cost") ||
|
|
115
|
+
lower.includes("cloud") ||
|
|
116
|
+
lower.includes("infra") ||
|
|
117
|
+
lower.includes("deploy") ||
|
|
118
|
+
lower.includes("iac")) {
|
|
119
|
+
return "infrastructure";
|
|
120
|
+
}
|
|
121
|
+
if (lower.includes("test") || lower.includes("quality") || lower.includes("coverage")) {
|
|
122
|
+
return "quality";
|
|
123
|
+
}
|
|
124
|
+
if (lower.includes("api") || lower.includes("type") || lower.includes("contract")) {
|
|
125
|
+
return "api";
|
|
126
|
+
}
|
|
127
|
+
return "general";
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=rule-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-catalog.js","sourceRoot":"","sources":["../../src/commands/rule-catalog.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,+EAA+E;AAE/E,MAAM,UAAU,cAAc,CAAC,IAAc;IAC3C,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAA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CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CA2HnD"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup-wizard — Interactive guided setup for new users and teams.
|
|
3
|
+
*/
|
|
4
|
+
import { writeFileSync, existsSync, mkdirSync } from "fs";
|
|
5
|
+
import { join, dirname } from "path";
|
|
6
|
+
// ─── Presets ────────────────────────────────────────────────────────────────
|
|
7
|
+
const SETUP_PRESETS = {
|
|
8
|
+
"quick-start": {
|
|
9
|
+
description: "Minimal setup — evaluate files with sensible defaults",
|
|
10
|
+
config: { preset: "lenient", format: "text" },
|
|
11
|
+
},
|
|
12
|
+
"security-first": {
|
|
13
|
+
description: "Focus on security findings — strict severity thresholds",
|
|
14
|
+
config: { preset: "security-only", minSeverity: "medium", failOnFindings: true },
|
|
15
|
+
},
|
|
16
|
+
"ci-integration": {
|
|
17
|
+
description: "Optimized for CI/CD pipelines — JSON output, quality gates",
|
|
18
|
+
config: { preset: "strict", format: "sarif", failOnFindings: true, minScore: 70 },
|
|
19
|
+
},
|
|
20
|
+
"team-review": {
|
|
21
|
+
description: "Team-oriented — shared config, audit logging, PR summaries",
|
|
22
|
+
config: { preset: "strict", format: "markdown" },
|
|
23
|
+
},
|
|
24
|
+
compliance: {
|
|
25
|
+
description: "Compliance-focused — full audit trail, evidence collection",
|
|
26
|
+
config: { preset: "compliance", format: "sarif" },
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
// ─── CI Templates ───────────────────────────────────────────────────────────
|
|
30
|
+
function generateGitHubActions(profile) {
|
|
31
|
+
return `name: Judges Code Review
|
|
32
|
+
on:
|
|
33
|
+
pull_request:
|
|
34
|
+
branches: [main]
|
|
35
|
+
push:
|
|
36
|
+
branches: [main]
|
|
37
|
+
|
|
38
|
+
jobs:
|
|
39
|
+
review:
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v4
|
|
43
|
+
- uses: actions/setup-node@v4
|
|
44
|
+
with:
|
|
45
|
+
node-version: '20'
|
|
46
|
+
- run: npx @kevinrabun/judges eval . --preset ${profile.preset} --format sarif --fail-on-findings
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
function generateGitLabCI(profile) {
|
|
50
|
+
return `judges-review:
|
|
51
|
+
image: node:20
|
|
52
|
+
script:
|
|
53
|
+
- npx @kevinrabun/judges eval . --preset ${profile.preset} --format sarif --fail-on-findings
|
|
54
|
+
only:
|
|
55
|
+
- merge_requests
|
|
56
|
+
- main
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
// ─── CLI ────────────────────────────────────────────────────────────────────
|
|
60
|
+
export function runSetupWizard(argv) {
|
|
61
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
62
|
+
console.log(`
|
|
63
|
+
judges setup-wizard — Guided setup for new users
|
|
64
|
+
|
|
65
|
+
Usage:
|
|
66
|
+
judges setup-wizard Interactive setup
|
|
67
|
+
judges setup-wizard --profile quick-start Use preset profile
|
|
68
|
+
judges setup-wizard --list-profiles List available profiles
|
|
69
|
+
judges setup-wizard --generate-ci github-actions Generate CI config
|
|
70
|
+
judges setup-wizard --init Create .judgesrc and CI config
|
|
71
|
+
|
|
72
|
+
Profiles:
|
|
73
|
+
quick-start Minimal setup with sensible defaults
|
|
74
|
+
security-first Security-focused with strict thresholds
|
|
75
|
+
ci-integration Optimized for CI/CD pipelines
|
|
76
|
+
team-review Team-oriented with shared config
|
|
77
|
+
compliance Full compliance with audit trails
|
|
78
|
+
|
|
79
|
+
Options:
|
|
80
|
+
--profile <name> Select a setup profile
|
|
81
|
+
--list-profiles List all available profiles
|
|
82
|
+
--generate-ci <type> Generate CI config (github-actions, gitlab-ci)
|
|
83
|
+
--init Write configuration files
|
|
84
|
+
--output <dir> Output directory (default: current)
|
|
85
|
+
--format json JSON output
|
|
86
|
+
--help, -h Show this help
|
|
87
|
+
|
|
88
|
+
Generates .judgesrc configuration and CI workflow files
|
|
89
|
+
based on your team's needs. All data stays local.
|
|
90
|
+
`);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const format = argv.find((_a, i) => argv[i - 1] === "--format") || "text";
|
|
94
|
+
if (argv.includes("--list-profiles")) {
|
|
95
|
+
if (format === "json") {
|
|
96
|
+
console.log(JSON.stringify(SETUP_PRESETS, null, 2));
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
console.log("\n Setup Profiles\n ═════════════════════════════");
|
|
100
|
+
for (const [name, info] of Object.entries(SETUP_PRESETS)) {
|
|
101
|
+
console.log(` ${name.padEnd(20)} ${info.description}`);
|
|
102
|
+
}
|
|
103
|
+
console.log();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const profileName = argv.find((_a, i) => argv[i - 1] === "--profile") || "quick-start";
|
|
107
|
+
const ciType = argv.find((_a, i) => argv[i - 1] === "--generate-ci");
|
|
108
|
+
const outputDir = argv.find((_a, i) => argv[i - 1] === "--output") || ".";
|
|
109
|
+
const doInit = argv.includes("--init");
|
|
110
|
+
const preset = SETUP_PRESETS[profileName];
|
|
111
|
+
if (!preset) {
|
|
112
|
+
console.error(`Error: Unknown profile '${profileName}'. Use --list-profiles to see options.`);
|
|
113
|
+
process.exitCode = 1;
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const profile = {
|
|
117
|
+
preset: profileName,
|
|
118
|
+
ciSystem: ciType || "github-actions",
|
|
119
|
+
languages: [],
|
|
120
|
+
strictness: profileName === "security-first" || profileName === "compliance" ? "strict" : "moderate",
|
|
121
|
+
features: [],
|
|
122
|
+
};
|
|
123
|
+
if (ciType) {
|
|
124
|
+
const ciConfig = ciType === "gitlab-ci" ? generateGitLabCI(profile) : generateGitHubActions(profile);
|
|
125
|
+
console.log(ciConfig);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (doInit) {
|
|
129
|
+
// Write .judgesrc
|
|
130
|
+
const rcPath = join(outputDir, ".judgesrc");
|
|
131
|
+
if (!existsSync(rcPath)) {
|
|
132
|
+
writeFileSync(rcPath, JSON.stringify(preset.config, null, 2), "utf-8");
|
|
133
|
+
console.log(`Created ${rcPath}`);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
console.log(`${rcPath} already exists, skipping.`);
|
|
137
|
+
}
|
|
138
|
+
// Write CI config
|
|
139
|
+
const ciDir = join(outputDir, ".github", "workflows");
|
|
140
|
+
const ciPath = join(ciDir, "judges-review.yml");
|
|
141
|
+
if (!existsSync(ciPath)) {
|
|
142
|
+
mkdirSync(dirname(ciPath), { recursive: true });
|
|
143
|
+
writeFileSync(ciPath, generateGitHubActions(profile), "utf-8");
|
|
144
|
+
console.log(`Created ${ciPath}`);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
console.log(`${ciPath} already exists, skipping.`);
|
|
148
|
+
}
|
|
149
|
+
console.log("\nSetup complete! Next steps:");
|
|
150
|
+
console.log(" 1. Run: npx @kevinrabun/judges eval <file>");
|
|
151
|
+
console.log(" 2. Customize .judgesrc for your needs");
|
|
152
|
+
console.log(" 3. Commit the CI workflow for automated reviews");
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
// Show setup summary
|
|
156
|
+
if (format === "json") {
|
|
157
|
+
console.log(JSON.stringify({ profile: profileName, ...preset }, null, 2));
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
console.log(`\n Setup Wizard — ${profileName}\n ═════════════════════════════`);
|
|
161
|
+
console.log(` Profile: ${profileName}`);
|
|
162
|
+
console.log(` Description: ${preset.description}`);
|
|
163
|
+
console.log(` Configuration:`);
|
|
164
|
+
for (const [key, value] of Object.entries(preset.config)) {
|
|
165
|
+
console.log(` ${key}: ${value}`);
|
|
166
|
+
}
|
|
167
|
+
console.log();
|
|
168
|
+
console.log(" To apply this configuration:");
|
|
169
|
+
console.log(` judges setup-wizard --profile ${profileName} --init`);
|
|
170
|
+
console.log();
|
|
171
|
+
console.log(" To generate CI config:");
|
|
172
|
+
console.log(` judges setup-wizard --profile ${profileName} --generate-ci github-actions`);
|
|
173
|
+
console.log();
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=setup-wizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-wizard.js","sourceRoot":"","sources":["../../src/commands/setup-wizard.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAYrC,+EAA+E;AAE/E,MAAM,aAAa,GAA6E;IAC9F,aAAa,EAAE;QACb,WAAW,EAAE,uDAAuD;QACpE,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE;KAC9C;IACD,gBAAgB,EAAE;QAChB,WAAW,EAAE,yDAAyD;QACtE,MAAM,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE;KACjF;IACD,gBAAgB,EAAE;QAChB,WAAW,EAAE,4DAA4D;QACzE,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;KAClF;IACD,aAAa,EAAE;QACb,WAAW,EAAE,4DAA4D;QACzE,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE;KACjD;IACD,UAAU,EAAE;QACV,WAAW,EAAE,4DAA4D;QACzE,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE;KAClD;CACF,CAAC;AAEF,+EAA+E;AAE/E,SAAS,qBAAqB,CAAC,OAAqB;IAClD,OAAO;;;;;;;;;;;;;;;sDAe6C,OAAO,CAAC,MAAM;C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C,SAAS,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1E,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,sBAAsB,WAAW,mCAAmC,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,gBAAgB,WAAW,EAAE,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,oBAAoB,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAClC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,KAAK,KAAK,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,qCAAqC,WAAW,SAAS,CAAC,CAAC;IACvE,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,qCAAqC,WAAW,+BAA+B,CAAC,CAAC;IAC7F,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
"url": "https://github.com/kevinrabun/judges",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "3.
|
|
10
|
+
"version": "3.66.0",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "@kevinrabun/judges",
|
|
15
|
-
"version": "3.
|
|
15
|
+
"version": "3.66.0",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
}
|