@kevinrabun/judges 3.115.2 → 3.115.3
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/agent-loader.js +7 -1
- package/dist/judges/index.js +4 -2
- package/dist/skill-loader.js +3 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/agent-loader.ts +7 -1
- package/src/skill-loader.ts +8 -1
package/dist/agent-loader.js
CHANGED
|
@@ -168,7 +168,13 @@ export function resolveEvaluator(agent) {
|
|
|
168
168
|
.replace(/\.ts$/, ".js"),
|
|
169
169
|
resolve(process.cwd(), "dist", "evaluators", `${agent.frontmatter.id}.js`),
|
|
170
170
|
];
|
|
171
|
-
|
|
171
|
+
// Support both ESM and CJS (esbuild bundle) environments
|
|
172
|
+
const _url = typeof import.meta?.url === "string" ? import.meta.url : undefined;
|
|
173
|
+
const req = _url
|
|
174
|
+
? createRequire(_url)
|
|
175
|
+
: typeof globalThis.require === "function"
|
|
176
|
+
? globalThis.require
|
|
177
|
+
: createRequire("file:///" + process.cwd());
|
|
172
178
|
for (const candidate of candidatePaths) {
|
|
173
179
|
try {
|
|
174
180
|
const mod = req(candidate);
|
package/dist/judges/index.js
CHANGED
|
@@ -15,8 +15,10 @@ import { defaultRegistry } from "../judge-registry.js";
|
|
|
15
15
|
import { loadAndRegisterAgents } from "../agent-loader.js";
|
|
16
16
|
import { resolve, dirname } from "node:path";
|
|
17
17
|
import { fileURLToPath } from "node:url";
|
|
18
|
-
|
|
19
|
-
const
|
|
18
|
+
// Support both ESM (import.meta.url) and CJS (esbuild bundle) environments.
|
|
19
|
+
const _importMetaUrl = typeof import.meta?.url === "string" ? import.meta.url : undefined;
|
|
20
|
+
const __filename = _importMetaUrl ? fileURLToPath(_importMetaUrl) : "";
|
|
21
|
+
const __dirname = __filename ? dirname(__filename) : process.cwd();
|
|
20
22
|
let agentsLoaded = false;
|
|
21
23
|
function loadDefaultAgents() {
|
|
22
24
|
if (agentsLoaded)
|
package/dist/skill-loader.js
CHANGED
|
@@ -136,7 +136,9 @@ export function listSkills(dirPath) {
|
|
|
136
136
|
* only the judges referenced by the skill. Returns a tribunal verdict.
|
|
137
137
|
*/
|
|
138
138
|
export async function runSkill(skillId, code, language, opts) {
|
|
139
|
-
const
|
|
139
|
+
const _skillUrl = typeof import.meta?.url === "string" ? import.meta.url : undefined;
|
|
140
|
+
const skillsDir = opts?.skillsDir ??
|
|
141
|
+
resolve(dirname(_skillUrl ? fileURLToPath(_skillUrl) : __filename || process.argv[1] || process.cwd()), "..", "skills");
|
|
140
142
|
const skills = loadSkillDirectory(skillsDir);
|
|
141
143
|
const skill = skills.find((s) => s.frontmatter.id === skillId);
|
|
142
144
|
if (!skill)
|
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.115.
|
|
10
|
+
"version": "3.115.3",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "@kevinrabun/judges",
|
|
15
|
-
"version": "3.115.
|
|
15
|
+
"version": "3.115.3",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
}
|
package/src/agent-loader.ts
CHANGED
|
@@ -221,7 +221,13 @@ export function resolveEvaluator(agent: ParsedAgent): AnalyzeFn | undefined {
|
|
|
221
221
|
resolve(process.cwd(), "dist", "evaluators", `${agent.frontmatter.id}.js`),
|
|
222
222
|
];
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
// Support both ESM and CJS (esbuild bundle) environments
|
|
225
|
+
const _url = typeof import.meta?.url === "string" ? import.meta.url : undefined;
|
|
226
|
+
const req = _url
|
|
227
|
+
? createRequire(_url)
|
|
228
|
+
: typeof globalThis.require === "function"
|
|
229
|
+
? globalThis.require
|
|
230
|
+
: createRequire("file:///" + process.cwd());
|
|
225
231
|
for (const candidate of candidatePaths) {
|
|
226
232
|
try {
|
|
227
233
|
const mod = req(candidate) as Record<string, unknown>;
|
package/src/skill-loader.ts
CHANGED
|
@@ -170,7 +170,14 @@ export async function runSkill(
|
|
|
170
170
|
language: string,
|
|
171
171
|
opts?: { skillsDir?: string; context?: unknown },
|
|
172
172
|
): Promise<TribunalVerdict> {
|
|
173
|
-
const
|
|
173
|
+
const _skillUrl = typeof import.meta?.url === "string" ? import.meta.url : undefined;
|
|
174
|
+
const skillsDir =
|
|
175
|
+
opts?.skillsDir ??
|
|
176
|
+
resolve(
|
|
177
|
+
dirname(_skillUrl ? fileURLToPath(_skillUrl) : __filename || process.argv[1] || process.cwd()),
|
|
178
|
+
"..",
|
|
179
|
+
"skills",
|
|
180
|
+
);
|
|
174
181
|
const skills = loadSkillDirectory(skillsDir);
|
|
175
182
|
const skill = skills.find((s) => s.frontmatter.id === skillId);
|
|
176
183
|
if (!skill) throw new Error(`Skill not found: ${skillId}`);
|