@ls-stack/agent-eval 0.27.1 → 0.29.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/{app-CJj1yPPD.mjs → app-D6-msfKP.mjs} +45 -6
- package/dist/apps/web/dist/assets/index-BCr6J8Uj.js +118 -0
- package/dist/apps/web/dist/assets/index-DjUTm3M-.css +1 -0
- package/dist/apps/web/dist/index.html +2 -2
- package/dist/bin.mjs +1 -1
- package/dist/{cli-Clf8xUFa.mjs → cli-CIc_gBNM.mjs} +965 -167
- package/dist/index.d.mts +5828 -3368
- package/dist/index.mjs +4 -4
- package/dist/runChild.mjs +4 -2
- package/dist/{runOrchestration-FEvBwwJI.mjs → runOrchestration-CIARrLs6.mjs} +1046 -228
- package/dist/{runner-zqKwTlNj.mjs → runner-1F8MeY5V.mjs} +2 -2
- package/dist/{runner-KbDKLSU4.mjs → runner-Bq1f9B9d.mjs} +1 -1
- package/dist/src-CkWT1iSu.mjs +3 -0
- package/package.json +2 -29
- package/skills/agent-eval/SKILL.md +104 -20
- package/dist/apps/web/dist/assets/index-6YqV9t4k.js +0 -118
- package/dist/apps/web/dist/assets/index-C-OiMSQD.css +0 -1
- package/dist/bin.d.mts +0 -1
- package/dist/runChild.d.mts +0 -1
- package/dist/src-BBwT7_cy.mjs +0 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import
|
|
1
|
+
import { A as createRunRequestSchema, j as updateManualScoreRequestSchema } from "./runOrchestration-CIARrLs6.mjs";
|
|
2
|
+
import { o as stageManualInputFile } from "./cli-CIc_gBNM.mjs";
|
|
3
|
+
import "./src-CkWT1iSu.mjs";
|
|
4
|
+
import { t as getRunnerInstance } from "./runner-1F8MeY5V.mjs";
|
|
4
5
|
import { readFile } from "node:fs/promises";
|
|
5
6
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
6
7
|
import { z } from "zod/v4";
|
|
@@ -132,6 +133,19 @@ const evalsRoutes = new Hono().get("/", (c) => {
|
|
|
132
133
|
return c.json({ ok: true }, 200);
|
|
133
134
|
});
|
|
134
135
|
//#endregion
|
|
136
|
+
//#region ../../apps/server/src/routes/manualInputFiles.ts
|
|
137
|
+
const manualInputFilesRoutes = new Hono().post("/", async (c) => {
|
|
138
|
+
const uploaded = (await c.req.parseBody())["file"];
|
|
139
|
+
if (!(uploaded instanceof File)) return c.json({ error: "Missing file upload" }, 400);
|
|
140
|
+
const value = await stageManualInputFile({
|
|
141
|
+
workspaceRoot: getRunnerInstance().getWorkspaceRoot(),
|
|
142
|
+
bytes: new Uint8Array(await uploaded.arrayBuffer()),
|
|
143
|
+
name: uploaded.name,
|
|
144
|
+
mimeType: uploaded.type
|
|
145
|
+
});
|
|
146
|
+
return c.json(value, 201);
|
|
147
|
+
});
|
|
148
|
+
//#endregion
|
|
135
149
|
//#region ../../apps/server/src/routes/runs.ts
|
|
136
150
|
const openRunLocationRequestSchema = z.object({
|
|
137
151
|
file: z.string().min(1),
|
|
@@ -158,7 +172,19 @@ const runsRoutes = new Hono().get("/", (c) => {
|
|
|
158
172
|
return c.json(result, 200);
|
|
159
173
|
}).post("/", zValidator("json", createRunRequestSchema), async (c) => {
|
|
160
174
|
const body = c.req.valid("json");
|
|
161
|
-
const
|
|
175
|
+
const runner = getRunnerInstance();
|
|
176
|
+
const configReload = runner.getConfigReloadState();
|
|
177
|
+
if (configReload.status !== "idle") return c.json({
|
|
178
|
+
code: "CONFIG_RELOAD_PENDING",
|
|
179
|
+
error: "agent-evals.config.ts changed and the app is reloading before new runs can start.",
|
|
180
|
+
configReload
|
|
181
|
+
}, 409);
|
|
182
|
+
const validation = runner.validateManualInputs(body);
|
|
183
|
+
if (!validation.ok) return c.json({
|
|
184
|
+
error: "Manual input validation failed",
|
|
185
|
+
failures: validation.failures
|
|
186
|
+
}, 400);
|
|
187
|
+
const run = await runner.startRun(body);
|
|
162
188
|
return c.json(run, 201);
|
|
163
189
|
}).post("/actions/open-location", zValidator("json", openRunLocationRequestSchema), (c) => {
|
|
164
190
|
const body = c.req.valid("json");
|
|
@@ -195,6 +221,18 @@ const runsRoutes = new Hono().get("/", (c) => {
|
|
|
195
221
|
const caseDetail = getRunnerInstance().getCaseDetail(runId, caseId);
|
|
196
222
|
if (!caseDetail) return c.json({ error: "Case not found" }, 404);
|
|
197
223
|
return c.json(caseDetail, 200);
|
|
224
|
+
}).post("/:runId/cases/:caseId/actions/recalculate-derived-attributes", async (c) => {
|
|
225
|
+
const runId = c.req.param("runId");
|
|
226
|
+
const caseId = c.req.param("caseId");
|
|
227
|
+
const result = await getRunnerInstance().recalculateDerivedAttributesForCase({
|
|
228
|
+
runId,
|
|
229
|
+
caseId
|
|
230
|
+
});
|
|
231
|
+
if (!result.updated) return c.json({
|
|
232
|
+
error: result.reason,
|
|
233
|
+
updated: false
|
|
234
|
+
}, 404);
|
|
235
|
+
return c.json(result, 200);
|
|
198
236
|
}).patch("/:runId/cases/:caseId/manual-scores/:scoreKey", zValidator("json", updateManualScoreRequestSchema), async (c) => {
|
|
199
237
|
const runId = c.req.param("runId");
|
|
200
238
|
const caseId = c.req.param("caseId");
|
|
@@ -299,14 +337,15 @@ const workspaceRoutes = new Hono().get("/", async (c) => {
|
|
|
299
337
|
workspaceRoot: runner.getWorkspaceRoot(),
|
|
300
338
|
packageManager,
|
|
301
339
|
llmCalls: runner.getLlmCallsConfig(),
|
|
302
|
-
apiCalls: runner.getApiCallsConfig()
|
|
340
|
+
apiCalls: runner.getApiCallsConfig(),
|
|
341
|
+
configReload: runner.getConfigReloadState()
|
|
303
342
|
}, 200);
|
|
304
343
|
});
|
|
305
344
|
//#endregion
|
|
306
345
|
//#region ../../apps/server/src/app.ts
|
|
307
346
|
const baseApp = new Hono();
|
|
308
347
|
baseApp.use("/*", cors());
|
|
309
|
-
baseApp.route("/api/evals", evalsRoutes).route("/api/runs", runsRoutes).route("/api/cache", cacheRoutes).route("/api/workspace", workspaceRoutes).route("/api", assetsRoutes);
|
|
348
|
+
baseApp.route("/api/evals", evalsRoutes).route("/api/runs", runsRoutes).route("/api/manual-input-files", manualInputFilesRoutes).route("/api/cache", cacheRoutes).route("/api/workspace", workspaceRoutes).route("/api", assetsRoutes);
|
|
310
349
|
const serverDir = dirname(fileURLToPath(import.meta.url));
|
|
311
350
|
const webDist = process.env.AGENT_EVALS_WEB_DIST ? resolve(process.env.AGENT_EVALS_WEB_DIST) : resolve(serverDir, "../../web/dist");
|
|
312
351
|
if (existsSync(webDist)) {
|