@axiom-lattice/gateway 2.1.71 → 2.1.72

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.71 build /home/runner/work/agentic/agentic/packages/gateway
2
+ > @axiom-lattice/gateway@2.1.72 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.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
21
+ CJS dist/index.js 205.11 KB
22
+ CJS dist/index.js.map 437.04 KB
23
+ CJS ⚡️ Build success in 299ms
24
+ ESM dist/index.mjs 201.79 KB
25
+ ESM dist/index.mjs.map 437.67 KB
26
+ ESM ⚡️ Build success in 299ms
27
27
  DTS Build start
28
- DTS ⚡️ Build success in 14513ms
28
+ DTS ⚡️ Build success in 10288ms
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,11 @@
1
1
  # @axiom-lattice/gateway
2
2
 
3
+ ## 2.1.72
4
+
5
+ ### Patch Changes
6
+
7
+ - 1ada590: fix resume
8
+
3
9
  ## 2.1.71
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1743,6 +1743,7 @@ async function executeSqlQuery(client, body, reply) {
1743
1743
 
1744
1744
  // src/controllers/workflow-tracking.ts
1745
1745
  var import_core13 = require("@axiom-lattice/core");
1746
+ var import_protocols3 = require("@axiom-lattice/protocols");
1746
1747
  function getTenantId6(request) {
1747
1748
  const userTenantId = request.user?.tenantId;
1748
1749
  if (userTenantId) return userTenantId;
@@ -2049,34 +2050,38 @@ async function replyInboxTask(request, reply) {
2049
2050
  message: "Workflow run not found"
2050
2051
  });
2051
2052
  }
2053
+ const workspace_id = request.headers["x-workspace-id"];
2054
+ const project_id = request.headers["x-project-id"];
2052
2055
  const agent = import_core13.agentInstanceManager.getAgent({
2053
2056
  assistant_id: run.assistantId,
2054
2057
  thread_id: run.threadId,
2055
- tenant_id: tenantId
2058
+ tenant_id: tenantId,
2059
+ workspace_id,
2060
+ project_id
2056
2061
  });
2057
- try {
2058
- const queueStore = agent.getQueueStore?.() || agent.queueStore;
2059
- if (queueStore?.resetProcessingToPending) {
2060
- await queueStore.resetProcessingToPending(run.threadId);
2062
+ agent.addMessage({
2063
+ input: { message: "Clarification answers submitted" },
2064
+ command: {
2065
+ resume: {
2066
+ action: "submit",
2067
+ data: { answers },
2068
+ message: "Clarification answers submitted"
2069
+ }
2061
2070
  }
2062
- await agent.addMessage({
2063
- input: { message: "Clarification answers submitted" },
2064
- command: {
2065
- resume: {
2066
- action: "submit",
2067
- data: { answers },
2068
- message: "Clarification answers submitted"
2069
- }
2071
+ }).then((result) => {
2072
+ const stream = agent.chunkStream(
2073
+ result.messageId,
2074
+ [import_protocols3.MessageChunkTypes.MESSAGE_COMPLETED]
2075
+ );
2076
+ (async () => {
2077
+ for await (const _ of stream) {
2070
2078
  }
2079
+ })().catch((error) => {
2080
+ request.log.error(error, "Background chunk stream error");
2071
2081
  });
2072
- await agent.startQueueProcessorIfNeeded();
2073
- } catch (error) {
2074
- return reply.status(400).send({
2075
- success: false,
2076
- message: "Failed to resume workflow",
2077
- error: error instanceof Error ? error.message : String(error)
2078
- });
2079
- }
2082
+ }).catch((error) => {
2083
+ request.log.error(error, "Background resume failed");
2084
+ });
2080
2085
  return reply.status(200).send({
2081
2086
  success: true,
2082
2087
  message: "Resume request submitted successfully",
@@ -5380,13 +5385,13 @@ function resolveSubjectType(mappingMode, chatType) {
5380
5385
 
5381
5386
  // src/channels/lark/runner.ts
5382
5387
  var import_core26 = require("@axiom-lattice/core");
5383
- var import_protocols4 = require("@axiom-lattice/protocols");
5388
+ var import_protocols5 = require("@axiom-lattice/protocols");
5384
5389
 
5385
5390
  // src/channels/lark/aggregator.ts
5386
- var import_protocols3 = require("@axiom-lattice/protocols");
5391
+ var import_protocols4 = require("@axiom-lattice/protocols");
5387
5392
  function aggregateLarkReply(messageId, chunks) {
5388
5393
  return chunks.filter(
5389
- (chunk) => chunk.type === import_protocols3.MessageChunkTypes.AI && chunk.data.id === messageId
5394
+ (chunk) => chunk.type === import_protocols4.MessageChunkTypes.AI && chunk.data.id === messageId
5390
5395
  ).map((chunk) => chunk.data.content || "").join("").trim();
5391
5396
  }
5392
5397
 
@@ -5406,7 +5411,7 @@ async function runAgentAndCollectLarkReply(input) {
5406
5411
  });
5407
5412
  const chunks = [];
5408
5413
  const stream = agent.chunkStream(result.messageId, [
5409
- import_protocols4.MessageChunkTypes.MESSAGE_COMPLETED
5414
+ import_protocols5.MessageChunkTypes.MESSAGE_COMPLETED
5410
5415
  ]);
5411
5416
  for await (const chunk of stream) {
5412
5417
  chunks.push(chunk);
@@ -6309,7 +6314,7 @@ var AgentTaskConsumer = _AgentTaskConsumer;
6309
6314
 
6310
6315
  // src/index.ts
6311
6316
  var import_core29 = require("@axiom-lattice/core");
6312
- var import_protocols5 = require("@axiom-lattice/protocols");
6317
+ var import_protocols6 = require("@axiom-lattice/protocols");
6313
6318
  var import_meta = {};
6314
6319
  process.on("unhandledRejection", (reason, promise) => {
6315
6320
  console.error("\u672A\u5904\u7406\u7684Promise\u62D2\u7EDD:", reason);
@@ -6317,7 +6322,7 @@ process.on("unhandledRejection", (reason, promise) => {
6317
6322
  var DEFAULT_LOGGER_CONFIG = {
6318
6323
  name: "default",
6319
6324
  description: "Default logger for lattice-gateway service",
6320
- type: import_protocols5.LoggerType.PINO,
6325
+ type: import_protocols6.LoggerType.PINO,
6321
6326
  serviceName: "lattice/gateway",
6322
6327
  loggerName: "lattice/gateway"
6323
6328
  };