@axiom-lattice/gateway 3.0.0 → 3.0.2

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,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/gateway@3.0.0 build /home/runner/work/agentic/agentic/packages/gateway
2
+ > @axiom-lattice/gateway@3.0.2 build /home/runner/work/agentic/agentic/packages/gateway
3
3
  > tsup src/index.ts --format cjs,esm --dts --clean --sourcemap
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -18,10 +18,7 @@
18
18
  You need to set the output format to "esm" for "import.meta" to work correctly.
19
19
 
20
20
 
21
- CJS dist/index.js 443.07 KB
22
- CJS dist/index.js.map 895.92 KB
23
- CJS ⚡️ Build success in 659ms
24
- ESM dist/index.mjs 370.08 KB
21
+ ESM dist/index.mjs 371.32 KB
25
22
  ESM dist/mcp-configs-SHRMQHIL.mjs 685.00 B
26
23
  ESM dist/chunk-K4XELOSO.mjs 12.52 KB
27
24
  ESM dist/sender-PX32VSHB.mjs 873.00 B
@@ -30,6 +27,7 @@
30
27
  ESM dist/a2a-QMHEH3ZT.mjs 17.78 KB
31
28
  ESM dist/resources-VA7LSDKN.mjs 15.81 KB
32
29
  ESM dist/chunk-LHQY46YB.mjs 1.46 KB
30
+ ESM dist/index.mjs.map 773.05 KB
33
31
  ESM dist/mcp-configs-SHRMQHIL.mjs.map 71.00 B
34
32
  ESM dist/chunk-K4XELOSO.mjs.map 25.53 KB
35
33
  ESM dist/sender-PX32VSHB.mjs.map 2.07 KB
@@ -38,9 +36,11 @@
38
36
  ESM dist/a2a-QMHEH3ZT.mjs.map 35.64 KB
39
37
  ESM dist/resources-VA7LSDKN.mjs.map 29.34 KB
40
38
  ESM dist/chunk-LHQY46YB.mjs.map 2.39 KB
41
- ESM dist/index.mjs.map 770.22 KB
42
- ESM ⚡️ Build success in 658ms
39
+ ESM ⚡️ Build success in 660ms
40
+ CJS dist/index.js 444.31 KB
41
+ CJS dist/index.js.map 898.76 KB
42
+ CJS ⚡️ Build success in 663ms
43
43
  DTS Build start
44
- DTS ⚡️ Build success in 20073ms
44
+ DTS ⚡️ Build success in 21089ms
45
45
  DTS dist/index.d.ts 7.57 KB
46
46
  DTS dist/index.d.mts 7.57 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @axiom-lattice/gateway
2
2
 
3
+ ## 3.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [e2f0a28]
8
+ - @axiom-lattice/core@3.0.2
9
+ - @axiom-lattice/pg-stores@2.0.2
10
+
11
+ ## 3.0.1
12
+
13
+ ### Patch Changes
14
+
15
+ - c6b8984: add document agent
16
+ - Updated dependencies [c6b8984]
17
+ - @axiom-lattice/core@3.0.1
18
+ - @axiom-lattice/pg-stores@2.0.1
19
+ - @axiom-lattice/protocols@3.0.1
20
+ - @axiom-lattice/cli-a2a@0.1.7
21
+ - @axiom-lattice/queue-redis@1.0.55
22
+
3
23
  ## 3.0.0
4
24
 
5
25
  ### Major Changes
package/dist/index.js CHANGED
@@ -2080,6 +2080,7 @@ function findWorkspaceRoot(startDir) {
2080
2080
  if (parent === current) return null;
2081
2081
  current = parent;
2082
2082
  }
2083
+ return null;
2083
2084
  }
2084
2085
  function resolveLocalA2AWorkingDirectory(options) {
2085
2086
  if (options.envWorkdir) return options.envWorkdir;
@@ -8216,11 +8217,12 @@ var EvalRunner = class {
8216
8217
  constructor() {
8217
8218
  this.runs = /* @__PURE__ */ new Map();
8218
8219
  this.eventEmitter = new import_events.EventEmitter();
8220
+ this.processStartedAt = /* @__PURE__ */ new Date();
8219
8221
  }
8220
8222
  getEventEmitter() {
8221
8223
  return this.eventEmitter;
8222
8224
  }
8223
- async startRun(tenantId, projectId) {
8225
+ async startRun(tenantId, projectId, suiteIds) {
8224
8226
  const store2 = this.getEvalStore();
8225
8227
  const project = await store2.getProjectById(tenantId, projectId);
8226
8228
  if (!project) throw new Error("Project not found");
@@ -8230,10 +8232,27 @@ var EvalRunner = class {
8230
8232
  }
8231
8233
  }
8232
8234
  const existingRuns = await store2.getRunsByTenant(tenantId, { projectId, status: "running" });
8233
- if (existingRuns.length > 0) {
8235
+ for (const run of existingRuns) {
8236
+ const orphaned = !this.runs.has(run.id) && run.createdAt < this.processStartedAt;
8237
+ if (orphaned) {
8238
+ await store2.updateRunStatus(tenantId, run.id, {
8239
+ status: "failed",
8240
+ error: "Gateway restarted \u2014 run orphaned",
8241
+ completedAt: /* @__PURE__ */ new Date()
8242
+ });
8243
+ }
8244
+ }
8245
+ const stillRunning = await store2.getRunsByTenant(tenantId, { projectId, status: "running" });
8246
+ if (stillRunning.length > 0) {
8234
8247
  throw new Error("A run is already in progress for this project");
8235
8248
  }
8236
- const suites = await store2.getSuitesByProject(tenantId, projectId);
8249
+ let suites = await store2.getSuitesByProject(tenantId, projectId);
8250
+ if (suiteIds && suiteIds.length > 0) {
8251
+ suites = suites.filter((s) => suiteIds.includes(s.id));
8252
+ if (suites.length === 0) {
8253
+ throw new Error("No suites match the requested suiteIds filter");
8254
+ }
8255
+ }
8237
8256
  const evalSuites = [];
8238
8257
  let totalCases = 0;
8239
8258
  for (const suite of suites) {
@@ -8332,6 +8351,15 @@ var EvalRunner = class {
8332
8351
  const runPromise = (async () => {
8333
8352
  try {
8334
8353
  const evalProject = new import_core31.LatticeEvalProject(projectConfig, onCaseComplete);
8354
+ const calibration = await evalProject.calibrateJudge();
8355
+ if (!calibration.ok) {
8356
+ await store2.updateRunStatus(tenantId, runId, {
8357
+ status: "failed",
8358
+ error: `Judge calibration failed: ${calibration.reason}`,
8359
+ completedAt: /* @__PURE__ */ new Date()
8360
+ });
8361
+ throw new Error(`Judge calibration failed: ${calibration.reason}`);
8362
+ }
8335
8363
  const { report } = await evalProject.runAllSuitesBatch(concurrency, abortController.signal);
8336
8364
  if (!abortController.signal.aborted) {
8337
8365
  const completedCount = stats.passed + stats.failed;
@@ -8719,11 +8747,12 @@ function registerEvalRoutes(app2) {
8719
8747
  try {
8720
8748
  const tenantId = getTenantId14(request);
8721
8749
  const { pid } = request.params;
8722
- const runId = await evalRunner.startRun(tenantId, pid);
8750
+ const body = request.body ?? {};
8751
+ const runId = await evalRunner.startRun(tenantId, pid, body?.suiteIds);
8723
8752
  reply.status(202).send({ success: true, message: "Run started", data: { run_id: runId } });
8724
8753
  } catch (err) {
8725
8754
  const msg = err.message;
8726
- const code = msg === "Project not found" ? 404 : msg.includes("already in progress") ? 409 : 500;
8755
+ const code = msg === "Project not found" ? 404 : msg.includes("already in progress") ? 409 : msg.includes("No suites match") ? 400 : 500;
8727
8756
  reply.status(code).send({ success: false, message: msg });
8728
8757
  }
8729
8758
  });