@ls-stack/agent-eval 0.28.0 → 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.
@@ -1,6 +1,7 @@
1
- import { D as updateManualScoreRequestSchema, E as createRunRequestSchema } from "./runOrchestration-ClWYWPen.mjs";
2
- import "./src-CuirVcPY.mjs";
3
- import { t as getRunnerInstance } from "./runner-DbVB66h9.mjs";
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 run = await getRunnerInstance().startRun(body);
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");
@@ -311,14 +337,15 @@ const workspaceRoutes = new Hono().get("/", async (c) => {
311
337
  workspaceRoot: runner.getWorkspaceRoot(),
312
338
  packageManager,
313
339
  llmCalls: runner.getLlmCallsConfig(),
314
- apiCalls: runner.getApiCallsConfig()
340
+ apiCalls: runner.getApiCallsConfig(),
341
+ configReload: runner.getConfigReloadState()
315
342
  }, 200);
316
343
  });
317
344
  //#endregion
318
345
  //#region ../../apps/server/src/app.ts
319
346
  const baseApp = new Hono();
320
347
  baseApp.use("/*", cors());
321
- 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);
322
349
  const serverDir = dirname(fileURLToPath(import.meta.url));
323
350
  const webDist = process.env.AGENT_EVALS_WEB_DIST ? resolve(process.env.AGENT_EVALS_WEB_DIST) : resolve(serverDir, "../../web/dist");
324
351
  if (existsSync(webDist)) {