@axiom-lattice/gateway 2.1.91 → 2.1.92
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 +12 -0
- package/dist/index.js +58 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +58 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/controllers/workflow-tracking.ts +66 -13
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/gateway@2.1.
|
|
2
|
+
> @axiom-lattice/gateway@2.1.92 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,17 +18,17 @@
|
|
|
18
18
|
You need to set the output format to "esm" for "import.meta" to work correctly.
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
[32mCJS[39m [1mdist/index.js [22m[32m268.14 KB[39m
|
|
22
|
-
[32mCJS[39m [1mdist/index.js.map [22m[32m560.68 KB[39m
|
|
23
|
-
[32mCJS[39m ⚡️ Build success in 480ms
|
|
24
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m246.84 KB[39m
|
|
25
21
|
[32mESM[39m [1mdist/sender-PX32VSHB.mjs [22m[32m873.00 B[39m
|
|
26
22
|
[32mESM[39m [1mdist/a2a-ERG5RMUW.mjs [22m[32m15.95 KB[39m
|
|
23
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m248.45 KB[39m
|
|
27
24
|
[32mESM[39m [1mdist/sender-PX32VSHB.mjs.map [22m[32m2.07 KB[39m
|
|
28
25
|
[32mESM[39m [1mdist/a2a-ERG5RMUW.mjs.map [22m[32m32.14 KB[39m
|
|
29
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[
|
|
30
|
-
[32mESM[39m ⚡️ Build success in
|
|
26
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m529.86 KB[39m
|
|
27
|
+
[32mESM[39m ⚡️ Build success in 480ms
|
|
28
|
+
[32mCJS[39m [1mdist/index.js [22m[32m269.76 KB[39m
|
|
29
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m563.71 KB[39m
|
|
30
|
+
[32mCJS[39m ⚡️ Build success in 481ms
|
|
31
31
|
[34mDTS[39m Build start
|
|
32
|
-
[32mDTS[39m ⚡️ Build success in
|
|
32
|
+
[32mDTS[39m ⚡️ Build success in 20551ms
|
|
33
33
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m7.57 KB[39m
|
|
34
34
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m7.57 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @axiom-lattice/gateway
|
|
2
2
|
|
|
3
|
+
## 2.1.92
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b4bdb6c: up new
|
|
8
|
+
- Updated dependencies [b4bdb6c]
|
|
9
|
+
- @axiom-lattice/pg-stores@1.0.71
|
|
10
|
+
- @axiom-lattice/protocols@2.1.42
|
|
11
|
+
- @axiom-lattice/core@2.1.80
|
|
12
|
+
- @axiom-lattice/agent-eval@2.1.74
|
|
13
|
+
- @axiom-lattice/queue-redis@1.0.41
|
|
14
|
+
|
|
3
15
|
## 2.1.91
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -2450,6 +2450,16 @@ async function getAllWorkflowRuns(request, reply) {
|
|
|
2450
2450
|
if (!store) {
|
|
2451
2451
|
return reply.status(404).send({ success: false, message: "No workflow tracking store configured" });
|
|
2452
2452
|
}
|
|
2453
|
+
const nameMap = {};
|
|
2454
|
+
try {
|
|
2455
|
+
const asStoreLattice = (0, import_core13.getStoreLattice)("default", "assistant");
|
|
2456
|
+
const assistantStore = asStoreLattice.store;
|
|
2457
|
+
const assistants = await assistantStore.getAllAssistants(tenantId);
|
|
2458
|
+
for (const a of assistants) {
|
|
2459
|
+
nameMap[a.id] = a.name;
|
|
2460
|
+
}
|
|
2461
|
+
} catch {
|
|
2462
|
+
}
|
|
2453
2463
|
let runs;
|
|
2454
2464
|
if (assistantId) {
|
|
2455
2465
|
runs = await store.getWorkflowRunsByAssistantId(tenantId, assistantId);
|
|
@@ -2459,10 +2469,22 @@ async function getAllWorkflowRuns(request, reply) {
|
|
|
2459
2469
|
if (status) {
|
|
2460
2470
|
runs = runs.filter((r) => r.status === status);
|
|
2461
2471
|
}
|
|
2472
|
+
const enrichedRuns = await Promise.all(
|
|
2473
|
+
runs.map(async (run) => {
|
|
2474
|
+
try {
|
|
2475
|
+
const steps = await store.getRunSteps(run.id);
|
|
2476
|
+
const totalSteps = steps.length;
|
|
2477
|
+
const completedSteps = steps.filter((s) => s.status === "completed").length;
|
|
2478
|
+
return { ...run, totalSteps, completedSteps, assistantName: nameMap[run.assistantId] || run.assistantId };
|
|
2479
|
+
} catch {
|
|
2480
|
+
return { ...run, totalSteps: 0, completedSteps: 0, assistantName: nameMap[run.assistantId] || run.assistantId };
|
|
2481
|
+
}
|
|
2482
|
+
})
|
|
2483
|
+
);
|
|
2462
2484
|
return {
|
|
2463
2485
|
success: true,
|
|
2464
2486
|
message: "Successfully retrieved workflow runs",
|
|
2465
|
-
data: { records:
|
|
2487
|
+
data: { records: enrichedRuns, total: enrichedRuns.length }
|
|
2466
2488
|
};
|
|
2467
2489
|
} catch (error) {
|
|
2468
2490
|
request.log.error(error, "Failed to get workflow runs");
|
|
@@ -2487,17 +2509,40 @@ async function getInboxItems(request, reply) {
|
|
|
2487
2509
|
} catch {
|
|
2488
2510
|
}
|
|
2489
2511
|
const runs = await store.getWorkflowRunsByTenantId(tenantId);
|
|
2490
|
-
const
|
|
2491
|
-
if (
|
|
2492
|
-
return { success: true, message: "No
|
|
2512
|
+
const pendingRuns = runs.filter((r) => r.status === "interrupted");
|
|
2513
|
+
if (pendingRuns.length === 0) {
|
|
2514
|
+
return { success: true, message: "No pending workflows", data: { records: [] } };
|
|
2493
2515
|
}
|
|
2494
|
-
const checkPromises =
|
|
2516
|
+
const checkPromises = pendingRuns.map(async (r) => {
|
|
2495
2517
|
try {
|
|
2496
|
-
const agent =
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2518
|
+
const [steps, agent] = await Promise.all([
|
|
2519
|
+
store.getRunSteps(r.id).catch(() => []),
|
|
2520
|
+
(async () => {
|
|
2521
|
+
try {
|
|
2522
|
+
return import_core13.agentInstanceManager.getAgent({
|
|
2523
|
+
assistant_id: r.assistantId,
|
|
2524
|
+
thread_id: r.threadId,
|
|
2525
|
+
tenant_id: r.tenantId
|
|
2526
|
+
});
|
|
2527
|
+
} catch {
|
|
2528
|
+
return null;
|
|
2529
|
+
}
|
|
2530
|
+
})()
|
|
2531
|
+
]);
|
|
2532
|
+
if (!agent) {
|
|
2533
|
+
return [{
|
|
2534
|
+
runId: r.id,
|
|
2535
|
+
assistantId: r.assistantId,
|
|
2536
|
+
assistantName: nameMap[r.assistantId] || r.assistantId,
|
|
2537
|
+
threadId: r.threadId,
|
|
2538
|
+
tenantId: r.tenantId,
|
|
2539
|
+
status: r.status,
|
|
2540
|
+
startedAt: r.startedAt,
|
|
2541
|
+
totalEdges: r.totalEdges,
|
|
2542
|
+
completedEdges: r.completedEdges,
|
|
2543
|
+
steps
|
|
2544
|
+
}];
|
|
2545
|
+
}
|
|
2501
2546
|
const runStatus = await agent.getRunStatus();
|
|
2502
2547
|
if (runStatus !== "interrupted") return [];
|
|
2503
2548
|
const state = await agent.getCurrentState();
|
|
@@ -2510,9 +2555,11 @@ async function getInboxItems(request, reply) {
|
|
|
2510
2555
|
tenantId: r.tenantId,
|
|
2511
2556
|
interruptId: i.id,
|
|
2512
2557
|
interruptValue: i.value,
|
|
2558
|
+
status: r.status,
|
|
2513
2559
|
startedAt: r.startedAt,
|
|
2514
2560
|
totalEdges: r.totalEdges,
|
|
2515
|
-
completedEdges: r.completedEdges
|
|
2561
|
+
completedEdges: r.completedEdges,
|
|
2562
|
+
steps
|
|
2516
2563
|
}));
|
|
2517
2564
|
} catch (err) {
|
|
2518
2565
|
request.log.warn({ runId: r.id, error: err.message }, "Agent check skipped");
|