@axiom-lattice/gateway 2.1.68 → 2.1.70

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.68 build /home/runner/work/agentic/agentic/packages/gateway
2
+ > @axiom-lattice/gateway@2.1.70 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,13 +18,13 @@
18
18
  You need to set the output format to "esm" for "import.meta" to work correctly.
19
19
 
20
20
 
21
- ESM dist/index.mjs 201.26 KB
22
- ESM dist/index.mjs.map 436.63 KB
23
- ESM ⚡️ Build success in 320ms
24
- CJS dist/index.js 204.59 KB
25
- CJS dist/index.js.map 436.01 KB
26
- CJS ⚡️ Build success in 326ms
21
+ CJS dist/index.js 204.73 KB
22
+ CJS dist/index.js.map 436.33 KB
23
+ CJS ⚡️ Build success in 437ms
24
+ ESM dist/index.mjs 201.40 KB
25
+ ESM dist/index.mjs.map 436.95 KB
26
+ ESM ⚡️ Build success in 439ms
27
27
  DTS Build start
28
- DTS ⚡️ Build success in 13420ms
28
+ DTS ⚡️ Build success in 14016ms
29
29
  DTS dist/index.d.ts 3.85 KB
30
30
  DTS dist/index.d.mts 3.85 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @axiom-lattice/gateway
2
2
 
3
+ ## 2.1.70
4
+
5
+ ### Patch Changes
6
+
7
+ - 13c9cc5: workflow tracking
8
+ - Updated dependencies [13c9cc5]
9
+ - @axiom-lattice/core@2.1.62
10
+ - @axiom-lattice/pg-stores@1.0.52
11
+ - @axiom-lattice/protocols@2.1.32
12
+ - @axiom-lattice/queue-redis@1.0.31
13
+
14
+ ## 2.1.69
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [3b8f197]
19
+ - @axiom-lattice/core@2.1.61
20
+ - @axiom-lattice/pg-stores@1.0.51
21
+
3
22
  ## 2.1.68
4
23
 
5
24
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1876,8 +1876,7 @@ async function getInboxItems(request, reply) {
1876
1876
  if (runningRuns.length === 0) {
1877
1877
  return { success: true, message: "No running workflows", data: { records: [] } };
1878
1878
  }
1879
- const inboxItems = [];
1880
- for (const r of runningRuns) {
1879
+ const checkPromises = runningRuns.map(async (r) => {
1881
1880
  try {
1882
1881
  const agent = import_core13.agentInstanceManager.getAgent({
1883
1882
  assistant_id: r.assistantId,
@@ -1885,26 +1884,28 @@ async function getInboxItems(request, reply) {
1885
1884
  tenant_id: r.tenantId
1886
1885
  });
1887
1886
  const runStatus = await agent.getRunStatus();
1888
- if (runStatus !== "interrupted") continue;
1887
+ if (runStatus !== "interrupted") return [];
1889
1888
  const state = await agent.getCurrentState();
1890
1889
  const interrupts = state.tasks?.flatMap((t) => t.interrupts || []) || [];
1891
- for (const i of interrupts) {
1892
- inboxItems.push({
1893
- runId: r.id,
1894
- assistantId: r.assistantId,
1895
- assistantName: nameMap[r.assistantId] || r.assistantId,
1896
- threadId: r.threadId,
1897
- tenantId: r.tenantId,
1898
- interruptId: i.id,
1899
- interruptValue: i.value,
1900
- startedAt: r.startedAt,
1901
- totalEdges: r.totalEdges,
1902
- completedEdges: r.completedEdges
1903
- });
1904
- }
1905
- } catch {
1890
+ return interrupts.map((i) => ({
1891
+ runId: r.id,
1892
+ assistantId: r.assistantId,
1893
+ assistantName: nameMap[r.assistantId] || r.assistantId,
1894
+ threadId: r.threadId,
1895
+ tenantId: r.tenantId,
1896
+ interruptId: i.id,
1897
+ interruptValue: i.value,
1898
+ startedAt: r.startedAt,
1899
+ totalEdges: r.totalEdges,
1900
+ completedEdges: r.completedEdges
1901
+ }));
1902
+ } catch (err) {
1903
+ request.log.warn({ runId: r.id, error: err.message }, "Agent check skipped");
1904
+ return [];
1906
1905
  }
1907
- }
1906
+ });
1907
+ const results = await Promise.all(checkPromises);
1908
+ const inboxItems = results.flat();
1908
1909
  inboxItems.sort(
1909
1910
  (a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime()
1910
1911
  );