@axiom-lattice/gateway 2.1.69 → 2.1.71

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.69 build /home/runner/work/agentic/agentic/packages/gateway
2
+ > @axiom-lattice/gateway@2.1.71 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
- CJS dist/index.js 204.59 KB
22
- CJS dist/index.js.map 436.01 KB
23
- CJS ⚡️ Build success in 367ms
24
- ESM dist/index.mjs 201.26 KB
25
- ESM dist/index.mjs.map 436.63 KB
26
- ESM ⚡️ Build success in 389ms
21
+ CJS dist/index.js 204.96 KB
22
+ CJS dist/index.js.map 436.78 KB
23
+ CJS ⚡️ Build success in 394ms
24
+ ESM dist/index.mjs 201.64 KB
25
+ ESM dist/index.mjs.map 437.40 KB
26
+ ESM ⚡️ Build success in 397ms
27
27
  DTS Build start
28
- DTS ⚡️ Build success in 13238ms
28
+ DTS ⚡️ Build success in 14513ms
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,22 @@
1
1
  # @axiom-lattice/gateway
2
2
 
3
+ ## 2.1.71
4
+
5
+ ### Patch Changes
6
+
7
+ - e61bc9d: fix reply
8
+
9
+ ## 2.1.70
10
+
11
+ ### Patch Changes
12
+
13
+ - 13c9cc5: workflow tracking
14
+ - Updated dependencies [13c9cc5]
15
+ - @axiom-lattice/core@2.1.62
16
+ - @axiom-lattice/pg-stores@1.0.52
17
+ - @axiom-lattice/protocols@2.1.32
18
+ - @axiom-lattice/queue-redis@1.0.31
19
+
3
20
  ## 2.1.69
4
21
 
5
22
  ### 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
  );
@@ -2054,6 +2055,10 @@ async function replyInboxTask(request, reply) {
2054
2055
  tenant_id: tenantId
2055
2056
  });
2056
2057
  try {
2058
+ const queueStore = agent.getQueueStore?.() || agent.queueStore;
2059
+ if (queueStore?.resetProcessingToPending) {
2060
+ await queueStore.resetProcessingToPending(run.threadId);
2061
+ }
2057
2062
  await agent.addMessage({
2058
2063
  input: { message: "Clarification answers submitted" },
2059
2064
  command: {
@@ -2064,6 +2069,7 @@ async function replyInboxTask(request, reply) {
2064
2069
  }
2065
2070
  }
2066
2071
  });
2072
+ await agent.startQueueProcessorIfNeeded();
2067
2073
  } catch (error) {
2068
2074
  return reply.status(400).send({
2069
2075
  success: false,