@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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/gateway@2.1.91 build /home/runner/work/agentic/agentic/packages/gateway
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
  CLI 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
- CJS dist/index.js 268.14 KB
22
- CJS dist/index.js.map 560.68 KB
23
- CJS ⚡️ Build success in 480ms
24
- ESM dist/index.mjs 246.84 KB
25
21
  ESM dist/sender-PX32VSHB.mjs 873.00 B
26
22
  ESM dist/a2a-ERG5RMUW.mjs 15.95 KB
23
+ ESM dist/index.mjs 248.45 KB
27
24
  ESM dist/sender-PX32VSHB.mjs.map 2.07 KB
28
25
  ESM dist/a2a-ERG5RMUW.mjs.map 32.14 KB
29
- ESM dist/index.mjs.map 526.83 KB
30
- ESM ⚡️ Build success in 483ms
26
+ ESM dist/index.mjs.map 529.86 KB
27
+ ESM ⚡️ Build success in 480ms
28
+ CJS dist/index.js 269.76 KB
29
+ CJS dist/index.js.map 563.71 KB
30
+ CJS ⚡️ Build success in 481ms
31
31
  DTS Build start
32
- DTS ⚡️ Build success in 14738ms
32
+ DTS ⚡️ Build success in 20551ms
33
33
  DTS dist/index.d.ts 7.57 KB
34
34
  DTS dist/index.d.mts 7.57 KB
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: runs, total: runs.length }
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 runningRuns = runs.filter((r) => r.status === "running");
2491
- if (runningRuns.length === 0) {
2492
- return { success: true, message: "No running workflows", data: { records: [] } };
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 = runningRuns.map(async (r) => {
2516
+ const checkPromises = pendingRuns.map(async (r) => {
2495
2517
  try {
2496
- const agent = import_core13.agentInstanceManager.getAgent({
2497
- assistant_id: r.assistantId,
2498
- thread_id: r.threadId,
2499
- tenant_id: r.tenantId
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");