@kevinrabun/judges 3.121.0 → 3.122.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/config.js CHANGED
@@ -12,7 +12,7 @@ import { matchGlobPath } from "./tools/command-safety.js";
12
12
  export function expandEnvPlaceholders(content) {
13
13
  if (!content)
14
14
  return content;
15
- return content.replace(/\$\{([^}]+)\}/g, (_match, varName) => {
15
+ return content.replace(/\$\{([^}]{1,100})\}/g, (_match, varName) => {
16
16
  const envVal = process.env[varName];
17
17
  return envVal !== undefined ? envVal : "";
18
18
  });
@@ -5,7 +5,7 @@ const SEVERITY_SET = new Set(["critical", "high", "medium", "low", "info"]);
5
5
  * Attempt to parse a JSON payload embedded in LLM output. Supports fenced code blocks and raw JSON.
6
6
  */
7
7
  function parseJsonBlock(text) {
8
- const fenceMatch = text.match(/```(?:json)?\s*([\s\S]*?)```/i);
8
+ const fenceMatch = text.match(/```(?:json)?[ \t]*\n([\s\S]*?)\n[ \t]*```/i) ?? text.match(/```(?:json)?[ \t]*([\s\S]*?)```/i);
9
9
  if (fenceMatch) {
10
10
  try {
11
11
  return JSON.parse(fenceMatch[1]);
@@ -215,7 +215,15 @@ function countBySeverity(findings) {
215
215
  function compileExcludeRegexes(patterns) {
216
216
  if (!patterns || patterns.length === 0)
217
217
  return [];
218
- return patterns.map((pattern) => new RegExp(pattern, "i"));
218
+ return patterns.map((pattern) => {
219
+ try {
220
+ return new RegExp(pattern, "i");
221
+ }
222
+ catch {
223
+ // Invalid regex from user input — treat as literal string match
224
+ return new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "i");
225
+ }
226
+ });
219
227
  }
220
228
  function isLikelyNonProductionPath(path) {
221
229
  return /(^|\/)(test|tests|__tests__|spec|specs|e2e)(\/|\.|$)|\.(?:test|tests|spec|specs|e2e)\.[^/]+$|mock|fixture|fixtures|(^|\/)docs(-|\/)i18n(\/|$)|(^|\/)docs(\/|$)/i.test(path);
@@ -25,7 +25,7 @@ export function parseSkillFrontmatter(raw) {
25
25
  i++;
26
26
  continue;
27
27
  }
28
- const kv = line.match(/^([a-zA-Z_][a-zA-Z0-9_-]*)\s*:\s*(.*)$/);
28
+ const kv = line.match(/^([a-zA-Z_][a-zA-Z0-9_-]*)[ \t]*:[ \t]*(.*)$/);
29
29
  if (!kv) {
30
30
  i++;
31
31
  continue;
@@ -64,9 +64,10 @@ export function parseSkillFrontmatter(raw) {
64
64
  if (typeof value === "string" && ((value.startsWith("[") && value.endsWith("]")) || value.includes(","))) {
65
65
  // simple array parsing: split on comma
66
66
  const normalized = value
67
- .replace(/^\s*\[/, "")
68
- .replace(/\]\s*$/, "")
69
- .split(/\s*,\s*/)
67
+ .replace(/^[ \t]*\[/, "")
68
+ .replace(/\][ \t]*$/, "")
69
+ .split(",")
70
+ .map((s) => s.trim())
70
71
  .filter(Boolean);
71
72
  value = normalized;
72
73
  }
@@ -93,13 +94,15 @@ export function validateSkillFrontmatter(meta, sourcePath) {
93
94
  agents: Array.isArray(meta.agents)
94
95
  ? meta.agents
95
96
  : String(meta.agents ?? "")
96
- .split(/\s*,\s*/)
97
+ .split(",")
98
+ .map((s) => s.trim())
97
99
  .filter(Boolean),
98
100
  tags: Array.isArray(meta.tags)
99
101
  ? meta.tags
100
102
  : meta.tags
101
103
  ? String(meta.tags)
102
- .split(/\s*,\s*/)
104
+ .split(",")
105
+ .map((s) => s.trim())
103
106
  .filter(Boolean)
104
107
  : undefined,
105
108
  priority: meta.priority ? Number(meta.priority) : 10,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevinrabun/judges",
3
- "version": "3.121.0",
3
+ "version": "3.122.0",
4
4
  "description": "45 specialized judges that evaluate AI-generated code for security, cost, and quality.",
5
5
  "mcpName": "io.github.KevinRabun/judges",
6
6
  "type": "module",
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.121.0",
10
+ "version": "3.122.0",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "@kevinrabun/judges",
15
- "version": "3.121.0",
15
+ "version": "3.122.0",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  }
@@ -44,7 +44,7 @@ export function parseSkillFrontmatter(raw: string): { meta: SkillMeta; body: str
44
44
  i++;
45
45
  continue;
46
46
  }
47
- const kv = line.match(/^([a-zA-Z_][a-zA-Z0-9_-]*)\s*:\s*(.*)$/);
47
+ const kv = line.match(/^([a-zA-Z_][a-zA-Z0-9_-]*)[ \t]*:[ \t]*(.*)$/);
48
48
  if (!kv) {
49
49
  i++;
50
50
  continue;
@@ -85,9 +85,10 @@ export function parseSkillFrontmatter(raw: string): { meta: SkillMeta; body: str
85
85
  if (typeof value === "string" && ((value.startsWith("[") && value.endsWith("]")) || value.includes(","))) {
86
86
  // simple array parsing: split on comma
87
87
  const normalized = (value as string)
88
- .replace(/^\s*\[/, "")
89
- .replace(/\]\s*$/, "")
90
- .split(/\s*,\s*/)
88
+ .replace(/^[ \t]*\[/, "")
89
+ .replace(/\][ \t]*$/, "")
90
+ .split(",")
91
+ .map((s) => s.trim())
91
92
  .filter(Boolean);
92
93
  value = normalized;
93
94
  } else if (
@@ -117,13 +118,15 @@ export function validateSkillFrontmatter(meta: SkillMeta, sourcePath: string): S
117
118
  agents: Array.isArray(meta.agents)
118
119
  ? (meta.agents as string[])
119
120
  : String(meta.agents ?? "")
120
- .split(/\s*,\s*/)
121
+ .split(",")
122
+ .map((s) => s.trim())
121
123
  .filter(Boolean),
122
124
  tags: Array.isArray(meta.tags)
123
125
  ? (meta.tags as string[])
124
126
  : meta.tags
125
127
  ? String(meta.tags)
126
- .split(/\s*,\s*/)
128
+ .split(",")
129
+ .map((s) => s.trim())
127
130
  .filter(Boolean)
128
131
  : undefined,
129
132
  priority: meta.priority ? Number(meta.priority) : 10,