@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.
- package/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +20 -0
- package/dist/index.js +34 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/controllers/eval.ts +6 -2
- package/src/services/__tests__/eval-runner.test.ts +131 -0
- package/src/services/eval-runner.ts +44 -3
- package/src/services/local-a2a.ts +2 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/gateway@3.0.
|
|
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
|
[34mCLI[39m 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
|
-
[
|
|
22
|
-
[32mCJS[39m [1mdist/index.js.map [22m[32m895.92 KB[39m
|
|
23
|
-
[32mCJS[39m ⚡️ Build success in 659ms
|
|
24
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m370.08 KB[39m
|
|
21
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m371.32 KB[39m
|
|
25
22
|
[32mESM[39m [1mdist/mcp-configs-SHRMQHIL.mjs [22m[32m685.00 B[39m
|
|
26
23
|
[32mESM[39m [1mdist/chunk-K4XELOSO.mjs [22m[32m12.52 KB[39m
|
|
27
24
|
[32mESM[39m [1mdist/sender-PX32VSHB.mjs [22m[32m873.00 B[39m
|
|
@@ -30,6 +27,7 @@
|
|
|
30
27
|
[32mESM[39m [1mdist/a2a-QMHEH3ZT.mjs [22m[32m17.78 KB[39m
|
|
31
28
|
[32mESM[39m [1mdist/resources-VA7LSDKN.mjs [22m[32m15.81 KB[39m
|
|
32
29
|
[32mESM[39m [1mdist/chunk-LHQY46YB.mjs [22m[32m1.46 KB[39m
|
|
30
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m773.05 KB[39m
|
|
33
31
|
[32mESM[39m [1mdist/mcp-configs-SHRMQHIL.mjs.map [22m[32m71.00 B[39m
|
|
34
32
|
[32mESM[39m [1mdist/chunk-K4XELOSO.mjs.map [22m[32m25.53 KB[39m
|
|
35
33
|
[32mESM[39m [1mdist/sender-PX32VSHB.mjs.map [22m[32m2.07 KB[39m
|
|
@@ -38,9 +36,11 @@
|
|
|
38
36
|
[32mESM[39m [1mdist/a2a-QMHEH3ZT.mjs.map [22m[32m35.64 KB[39m
|
|
39
37
|
[32mESM[39m [1mdist/resources-VA7LSDKN.mjs.map [22m[32m29.34 KB[39m
|
|
40
38
|
[32mESM[39m [1mdist/chunk-LHQY46YB.mjs.map [22m[32m2.39 KB[39m
|
|
41
|
-
[32mESM[39m
|
|
42
|
-
[
|
|
39
|
+
[32mESM[39m ⚡️ Build success in 660ms
|
|
40
|
+
[32mCJS[39m [1mdist/index.js [22m[32m444.31 KB[39m
|
|
41
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m898.76 KB[39m
|
|
42
|
+
[32mCJS[39m ⚡️ Build success in 663ms
|
|
43
43
|
[34mDTS[39m Build start
|
|
44
|
-
[32mDTS[39m ⚡️ Build success in
|
|
44
|
+
[32mDTS[39m ⚡️ Build success in 21089ms
|
|
45
45
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m7.57 KB[39m
|
|
46
46
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m7.57 KB[39m
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
});
|