@axiom-lattice/gateway 2.1.116 → 2.1.117

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.116 build /home/runner/work/agentic/agentic/packages/gateway
2
+ > @axiom-lattice/gateway@2.1.117 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,29 +18,29 @@
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 410.19 KB
22
- CJS dist/index.js.map 833.87 KB
23
- CJS ⚡️ Build success in 551ms
21
+ CJS dist/index.js 412.49 KB
22
+ CJS dist/index.js.map 838.48 KB
23
+ CJS ⚡️ Build success in 644ms
24
+ ESM dist/index.mjs 341.76 KB
25
+ ESM dist/mcp-configs-SHRMQHIL.mjs 685.00 B
24
26
  ESM dist/chunk-K4XELOSO.mjs 12.52 KB
25
27
  ESM dist/sender-PX32VSHB.mjs 873.00 B
26
28
  ESM dist/WechatChannelAdapter-WSDKR4OA.mjs 8.27 KB
27
- ESM dist/index.mjs 339.48 KB
28
- ESM dist/mcp-configs-SHRMQHIL.mjs 685.00 B
29
29
  ESM dist/chunk-6CUQGDJI.mjs 6.42 KB
30
- ESM dist/resources-VA7LSDKN.mjs 15.81 KB
31
30
  ESM dist/a2a-ERG5RMUW.mjs 15.95 KB
31
+ ESM dist/resources-VA7LSDKN.mjs 15.81 KB
32
32
  ESM dist/chunk-LHQY46YB.mjs 1.46 KB
33
- ESM dist/sender-PX32VSHB.mjs.map 2.07 KB
33
+ ESM dist/mcp-configs-SHRMQHIL.mjs.map 71.00 B
34
34
  ESM dist/chunk-K4XELOSO.mjs.map 25.53 KB
35
+ ESM dist/sender-PX32VSHB.mjs.map 2.07 KB
35
36
  ESM dist/WechatChannelAdapter-WSDKR4OA.mjs.map 16.28 KB
36
- ESM dist/mcp-configs-SHRMQHIL.mjs.map 71.00 B
37
37
  ESM dist/chunk-6CUQGDJI.mjs.map 14.04 KB
38
- ESM dist/resources-VA7LSDKN.mjs.map 29.34 KB
39
38
  ESM dist/a2a-ERG5RMUW.mjs.map 32.14 KB
39
+ ESM dist/resources-VA7LSDKN.mjs.map 29.34 KB
40
40
  ESM dist/chunk-LHQY46YB.mjs.map 2.39 KB
41
- ESM dist/index.mjs.map 711.66 KB
42
- ESM ⚡️ Build success in 551ms
41
+ ESM dist/index.mjs.map 716.26 KB
42
+ ESM ⚡️ Build success in 648ms
43
43
  DTS Build start
44
- DTS ⚡️ Build success in 20289ms
44
+ DTS ⚡️ Build success in 20771ms
45
45
  DTS dist/index.d.ts 7.57 KB
46
46
  DTS dist/index.d.mts 7.57 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @axiom-lattice/gateway
2
2
 
3
+ ## 2.1.117
4
+
5
+ ### Patch Changes
6
+
7
+ - 5e1486e: add voice input
8
+ - Updated dependencies [5e1486e]
9
+ - @axiom-lattice/core@2.1.103
10
+ - @axiom-lattice/pg-stores@1.0.94
11
+ - @axiom-lattice/protocols@2.1.54
12
+ - @axiom-lattice/queue-redis@1.0.53
13
+
3
14
  ## 2.1.116
4
15
 
5
16
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1290,7 +1290,7 @@ async function handleTasksSend(request, reply) {
1290
1290
  taskStore.set(taskId, record);
1291
1291
  let agent;
1292
1292
  try {
1293
- agent = import_core54.agentInstanceManager.getAgent({
1293
+ agent = import_core55.agentInstanceManager.getAgent({
1294
1294
  assistant_id: assistantId,
1295
1295
  thread_id: threadId,
1296
1296
  tenant_id: tenantId,
@@ -1382,7 +1382,7 @@ async function handleTasksCancel(request, reply) {
1382
1382
  return;
1383
1383
  }
1384
1384
  try {
1385
- const agent = import_core54.agentInstanceManager.getAgent({
1385
+ const agent = import_core55.agentInstanceManager.getAgent({
1386
1386
  assistant_id: record.assistantId,
1387
1387
  thread_id: record.threadId,
1388
1388
  tenant_id: record.tenantId,
@@ -1419,7 +1419,7 @@ async function handleTasksStream(request, reply) {
1419
1419
  }
1420
1420
  let agent;
1421
1421
  try {
1422
- agent = import_core54.agentInstanceManager.getAgent({
1422
+ agent = import_core55.agentInstanceManager.getAgent({
1423
1423
  assistant_id: record.assistantId,
1424
1424
  thread_id: record.threadId,
1425
1425
  tenant_id: record.tenantId,
@@ -1614,12 +1614,12 @@ function registerA2ARoutes(app2) {
1614
1614
  handleApiKeyRotate
1615
1615
  );
1616
1616
  }
1617
- var import_uuid10, import_core54, import_protocols4, taskStore, _a2aKeyStore, _storeKeyMap;
1617
+ var import_uuid10, import_core55, import_protocols4, taskStore, _a2aKeyStore, _storeKeyMap;
1618
1618
  var init_a2a = __esm({
1619
1619
  "src/routes/a2a.ts"() {
1620
1620
  "use strict";
1621
1621
  import_uuid10 = require("uuid");
1622
- import_core54 = require("@axiom-lattice/core");
1622
+ import_core55 = require("@axiom-lattice/core");
1623
1623
  import_protocols4 = require("@axiom-lattice/protocols");
1624
1624
  taskStore = /* @__PURE__ */ new Map();
1625
1625
  _a2aKeyStore = null;
@@ -1632,12 +1632,12 @@ var resources_exports = {};
1632
1632
  __export(resources_exports, {
1633
1633
  ResourceController: () => ResourceController
1634
1634
  });
1635
- var import_bcryptjs, import_core55, ResourceController;
1635
+ var import_bcryptjs, import_core56, ResourceController;
1636
1636
  var init_resources = __esm({
1637
1637
  "src/controllers/resources.ts"() {
1638
1638
  "use strict";
1639
1639
  import_bcryptjs = __toESM(require("bcryptjs"));
1640
- import_core55 = require("@axiom-lattice/core");
1640
+ import_core56 = require("@axiom-lattice/core");
1641
1641
  init_mime();
1642
1642
  ResourceController = class {
1643
1643
  constructor(deps) {
@@ -1652,14 +1652,14 @@ var init_resources = __esm({
1652
1652
  if (!workspaceId || !projectId) {
1653
1653
  return reply.status(400).send({ error: "x-workspace-id and x-project-id headers required" });
1654
1654
  }
1655
- const payload = (0, import_core55.createSharePayload)(
1655
+ const payload = (0, import_core56.createSharePayload)(
1656
1656
  tenantId,
1657
1657
  workspaceId,
1658
1658
  projectId,
1659
1659
  userId,
1660
1660
  body
1661
1661
  );
1662
- const token = (0, import_core55.generateToken)();
1662
+ const token = (0, import_core56.generateToken)();
1663
1663
  try {
1664
1664
  await this.deps.store.create({ ...payload, token });
1665
1665
  this.deps.logger.info(
@@ -1811,7 +1811,7 @@ var init_resources = __esm({
1811
1811
  resourcePath: subPath
1812
1812
  }, subPath, ext, request, reply);
1813
1813
  }
1814
- const volume = (0, import_core55.buildNamedVolumeName)("p", "project", tenantId, workspaceId, projectId);
1814
+ const volume = (0, import_core56.buildNamedVolumeName)("p", "project", tenantId, workspaceId, projectId);
1815
1815
  return this._resolveAndServe(
1816
1816
  volume,
1817
1817
  subPath,
@@ -9713,9 +9713,88 @@ function registerA2ABridgeRoutes(app2) {
9713
9713
  });
9714
9714
  }
9715
9715
 
9716
+ // src/routes/stt.ts
9717
+ var import_core38 = require("@axiom-lattice/core");
9718
+ var ALLOWED_AUDIO_FORMATS = /* @__PURE__ */ new Set([
9719
+ "webm",
9720
+ "wav",
9721
+ "mp3",
9722
+ "m4a",
9723
+ "ogg",
9724
+ "flac",
9725
+ "aac"
9726
+ ]);
9727
+ var MAX_AUDIO_FILE_SIZE = 25 * 1024 * 1024;
9728
+ var registerSTTRoutes = (app2) => {
9729
+ app2.get("/api/stt/models", async (_request, reply) => {
9730
+ const models = import_core38.sttModelLatticeManager.getAllSTTModelInfo();
9731
+ return reply.send({ models });
9732
+ });
9733
+ app2.post(
9734
+ "/api/stt/transcribe",
9735
+ {
9736
+ schema: {
9737
+ querystring: {
9738
+ type: "object",
9739
+ properties: {
9740
+ model: { type: "string" }
9741
+ }
9742
+ },
9743
+ response: {
9744
+ 200: {
9745
+ type: "object",
9746
+ properties: {
9747
+ text: { type: "string" },
9748
+ confidence: { type: "number" }
9749
+ }
9750
+ }
9751
+ }
9752
+ }
9753
+ },
9754
+ async (request, reply) => {
9755
+ const modelKey = request.query.model || "default";
9756
+ const data = await request.file({
9757
+ limits: { fileSize: MAX_AUDIO_FILE_SIZE }
9758
+ });
9759
+ if (!data) {
9760
+ return reply.status(400).send({ error: "No audio file provided" });
9761
+ }
9762
+ const buffer = await data.toBuffer();
9763
+ if (buffer.length === 0) {
9764
+ return reply.status(400).send({ error: "Empty audio file" });
9765
+ }
9766
+ const format = (data.filename.split(".").pop() || "webm").toLowerCase();
9767
+ if (!ALLOWED_AUDIO_FORMATS.has(format)) {
9768
+ return reply.status(400).send({ error: `Unsupported audio format: ${format}` });
9769
+ }
9770
+ try {
9771
+ let client;
9772
+ try {
9773
+ client = (0, import_core38.getSTTClient)(modelKey);
9774
+ } catch {
9775
+ return reply.status(404).send({ error: `STT model "${modelKey}" not found` });
9776
+ }
9777
+ const result = await client.transcribe(buffer, format);
9778
+ return reply.send({
9779
+ text: result.text,
9780
+ confidence: result.confidence
9781
+ });
9782
+ } catch (error) {
9783
+ const sanitizedMessage = error instanceof Error ? error.message : "Transcription failed";
9784
+ request.log.error(
9785
+ { error: sanitizedMessage },
9786
+ "STT transcription failed"
9787
+ );
9788
+ return reply.status(500).send({ error: "Transcription service error. Please try again." });
9789
+ }
9790
+ }
9791
+ );
9792
+ };
9793
+
9716
9794
  // src/routes/index.ts
9717
9795
  var registerLatticeRoutes = (app2, channelDeps) => {
9718
9796
  registerA2ABridgeRoutes(app2);
9797
+ registerSTTRoutes(app2);
9719
9798
  app2.post("/api/runs", createRun);
9720
9799
  app2.post("/api/resume_stream", resumeStream);
9721
9800
  app2.post("/api/assistants/:assistantId/threads/:threadId/abort", abortRun);
@@ -10007,12 +10086,12 @@ function registerResourceRoutes(app2, controller) {
10007
10086
  }
10008
10087
 
10009
10088
  // src/export_registrations/index.ts
10010
- var import_core51 = require("@axiom-lattice/core");
10089
+ var import_core52 = require("@axiom-lattice/core");
10011
10090
 
10012
10091
  // src/export_registrations/skill.registration.ts
10013
- var import_core38 = require("@axiom-lattice/core");
10092
+ var import_core39 = require("@axiom-lattice/core");
10014
10093
  function getStore2() {
10015
- return (0, import_core38.getStoreLattice)("default", "skill").store;
10094
+ return (0, import_core39.getStoreLattice)("default", "skill").store;
10016
10095
  }
10017
10096
  var skillRegistration = {
10018
10097
  entityType: "skill",
@@ -10087,9 +10166,9 @@ var skillRegistration = {
10087
10166
  };
10088
10167
 
10089
10168
  // src/export_registrations/agent.registration.ts
10090
- var import_core39 = require("@axiom-lattice/core");
10169
+ var import_core40 = require("@axiom-lattice/core");
10091
10170
  function getStore3() {
10092
- return (0, import_core39.getStoreLattice)("default", "assistant").store;
10171
+ return (0, import_core40.getStoreLattice)("default", "assistant").store;
10093
10172
  }
10094
10173
  var agentRegistration = {
10095
10174
  entityType: "agent",
@@ -10156,9 +10235,9 @@ var agentRegistration = {
10156
10235
  };
10157
10236
 
10158
10237
  // src/export_registrations/binding.registration.ts
10159
- var import_core40 = require("@axiom-lattice/core");
10238
+ var import_core41 = require("@axiom-lattice/core");
10160
10239
  function getStore4() {
10161
- return (0, import_core40.getStoreLattice)("default", "channelBinding").store;
10240
+ return (0, import_core41.getStoreLattice)("default", "channelBinding").store;
10162
10241
  }
10163
10242
  var bindingRegistration = {
10164
10243
  entityType: "binding",
@@ -10246,9 +10325,9 @@ var bindingRegistration = {
10246
10325
  };
10247
10326
 
10248
10327
  // src/export_registrations/database-config.registration.ts
10249
- var import_core41 = require("@axiom-lattice/core");
10328
+ var import_core42 = require("@axiom-lattice/core");
10250
10329
  function getStore5() {
10251
- return (0, import_core41.getStoreLattice)("default", "database").store;
10330
+ return (0, import_core42.getStoreLattice)("default", "database").store;
10252
10331
  }
10253
10332
  var databaseConfigRegistration = {
10254
10333
  entityType: "database_config",
@@ -10328,9 +10407,9 @@ var databaseConfigRegistration = {
10328
10407
  };
10329
10408
 
10330
10409
  // src/export_registrations/metrics-config.registration.ts
10331
- var import_core42 = require("@axiom-lattice/core");
10410
+ var import_core43 = require("@axiom-lattice/core");
10332
10411
  function getStore6() {
10333
- return (0, import_core42.getStoreLattice)("default", "metrics").store;
10412
+ return (0, import_core43.getStoreLattice)("default", "metrics").store;
10334
10413
  }
10335
10414
  var metricsConfigRegistration = {
10336
10415
  entityType: "metrics_config",
@@ -10410,9 +10489,9 @@ var metricsConfigRegistration = {
10410
10489
  };
10411
10490
 
10412
10491
  // src/export_registrations/mcp-config.registration.ts
10413
- var import_core43 = require("@axiom-lattice/core");
10492
+ var import_core44 = require("@axiom-lattice/core");
10414
10493
  function getStore7() {
10415
- return (0, import_core43.getStoreLattice)("default", "mcp").store;
10494
+ return (0, import_core44.getStoreLattice)("default", "mcp").store;
10416
10495
  }
10417
10496
  var mcpConfigRegistration = {
10418
10497
  entityType: "mcp_config",
@@ -10495,9 +10574,9 @@ var mcpConfigRegistration = {
10495
10574
  };
10496
10575
 
10497
10576
  // src/export_registrations/connection.registration.ts
10498
- var import_core44 = require("@axiom-lattice/core");
10577
+ var import_core45 = require("@axiom-lattice/core");
10499
10578
  function getStore8() {
10500
- return (0, import_core44.getStoreLattice)("default", "connection").store;
10579
+ return (0, import_core45.getStoreLattice)("default", "connection").store;
10501
10580
  }
10502
10581
  async function listAllConnections(tenantId) {
10503
10582
  const store2 = getStore8();
@@ -10579,9 +10658,9 @@ var connectionRegistration = {
10579
10658
  };
10580
10659
 
10581
10660
  // src/export_registrations/collection.registration.ts
10582
- var import_core45 = require("@axiom-lattice/core");
10661
+ var import_core46 = require("@axiom-lattice/core");
10583
10662
  function getStore9() {
10584
- return (0, import_core45.getStoreLattice)("default", "collection").store;
10663
+ return (0, import_core46.getStoreLattice)("default", "collection").store;
10585
10664
  }
10586
10665
  var collectionRegistration = {
10587
10666
  entityType: "collection",
@@ -10652,9 +10731,9 @@ var collectionRegistration = {
10652
10731
  };
10653
10732
 
10654
10733
  // src/export_registrations/channel-installation.registration.ts
10655
- var import_core46 = require("@axiom-lattice/core");
10734
+ var import_core47 = require("@axiom-lattice/core");
10656
10735
  function getStore10() {
10657
- return (0, import_core46.getStoreLattice)("default", "channelInstallation").store;
10736
+ return (0, import_core47.getStoreLattice)("default", "channelInstallation").store;
10658
10737
  }
10659
10738
  var channelInstallationRegistration = {
10660
10739
  entityType: "channel_installation",
@@ -10729,9 +10808,9 @@ var channelInstallationRegistration = {
10729
10808
  };
10730
10809
 
10731
10810
  // src/export_registrations/menu.registration.ts
10732
- var import_core47 = require("@axiom-lattice/core");
10811
+ var import_core48 = require("@axiom-lattice/core");
10733
10812
  function getStore11() {
10734
- return (0, import_core47.getStoreLattice)("default", "menu").store;
10813
+ return (0, import_core48.getStoreLattice)("default", "menu").store;
10735
10814
  }
10736
10815
  var menuRegistration = {
10737
10816
  entityType: "menu",
@@ -10809,9 +10888,9 @@ var menuRegistration = {
10809
10888
  };
10810
10889
 
10811
10890
  // src/export_registrations/task.registration.ts
10812
- var import_core48 = require("@axiom-lattice/core");
10891
+ var import_core49 = require("@axiom-lattice/core");
10813
10892
  function getStore12() {
10814
- return (0, import_core48.getStoreLattice)("default", "task").store;
10893
+ return (0, import_core49.getStoreLattice)("default", "task").store;
10815
10894
  }
10816
10895
  var taskRegistration = {
10817
10896
  entityType: "task",
@@ -10897,9 +10976,9 @@ var taskRegistration = {
10897
10976
  };
10898
10977
 
10899
10978
  // src/export_registrations/a2a-api-key.registration.ts
10900
- var import_core49 = require("@axiom-lattice/core");
10979
+ var import_core50 = require("@axiom-lattice/core");
10901
10980
  function getStore13() {
10902
- return (0, import_core49.getStoreLattice)("default", "a2aApiKey").store;
10981
+ return (0, import_core50.getStoreLattice)("default", "a2aApiKey").store;
10903
10982
  }
10904
10983
  var a2aApiKeyRegistration = {
10905
10984
  entityType: "a2a_api_key",
@@ -10970,9 +11049,9 @@ var a2aApiKeyRegistration = {
10970
11049
  };
10971
11050
 
10972
11051
  // src/export_registrations/eval.registration.ts
10973
- var import_core50 = require("@axiom-lattice/core");
11052
+ var import_core51 = require("@axiom-lattice/core");
10974
11053
  function getStore14() {
10975
- return (0, import_core50.getStoreLattice)("default", "eval").store;
11054
+ return (0, import_core51.getStoreLattice)("default", "eval").store;
10976
11055
  }
10977
11056
  var evalRegistration = {
10978
11057
  entityType: "eval",
@@ -11298,7 +11377,7 @@ var evalRegistration = {
11298
11377
 
11299
11378
  // src/export_registrations/index.ts
11300
11379
  function registerAllBuiltinEntities() {
11301
- const registry = import_core51.ExportableEntityRegistry.getInstance();
11380
+ const registry = import_core52.ExportableEntityRegistry.getInstance();
11302
11381
  registry.register(skillRegistration);
11303
11382
  registry.register(agentRegistration);
11304
11383
  registry.register(bindingRegistration);
@@ -11315,7 +11394,7 @@ function registerAllBuiltinEntities() {
11315
11394
  }
11316
11395
 
11317
11396
  // src/router/MessageRouter.ts
11318
- var import_core52 = require("@axiom-lattice/core");
11397
+ var import_core53 = require("@axiom-lattice/core");
11319
11398
  var import_crypto10 = require("crypto");
11320
11399
  var BindingNotFoundError = class extends Error {
11321
11400
  constructor(message) {
@@ -11476,7 +11555,7 @@ var MessageRouter = class {
11476
11555
  channel: message.channel,
11477
11556
  adapterChannel: adapter.channel
11478
11557
  }, "Thread resolved by adapter strategy");
11479
- const threadStore = (0, import_core52.getStoreLattice)("default", "thread").store;
11558
+ const threadStore = (0, import_core53.getStoreLattice)("default", "thread").store;
11480
11559
  try {
11481
11560
  await threadStore.createThread(
11482
11561
  tenantId,
@@ -11513,7 +11592,7 @@ var MessageRouter = class {
11513
11592
  }
11514
11593
  }
11515
11594
  if (!threadId) {
11516
- const threadStore = (0, import_core52.getStoreLattice)("default", "thread").store;
11595
+ const threadStore = (0, import_core53.getStoreLattice)("default", "thread").store;
11517
11596
  const newThreadId = (0, import_crypto10.randomUUID)();
11518
11597
  console.log({
11519
11598
  event: "dispatch:thread:create",
@@ -11553,7 +11632,7 @@ var MessageRouter = class {
11553
11632
  senderId: message.sender.id,
11554
11633
  contentLength: message.content.text.length
11555
11634
  }, "Dispatching to agent");
11556
- const agent = import_core52.agentInstanceManager.getAgent({
11635
+ const agent = import_core53.agentInstanceManager.getAgent({
11557
11636
  tenant_id: tenantId,
11558
11637
  assistant_id: agentId,
11559
11638
  thread_id: threadId,
@@ -11798,7 +11877,7 @@ function createAuditLoggerMiddleware() {
11798
11877
  }
11799
11878
 
11800
11879
  // src/index.ts
11801
- var import_core56 = require("@axiom-lattice/core");
11880
+ var import_core57 = require("@axiom-lattice/core");
11802
11881
 
11803
11882
  // src/swagger.ts
11804
11883
  var import_swagger = __toESM(require("@fastify/swagger"));
@@ -11863,7 +11942,7 @@ var configureSwagger = async (app2, customSwaggerConfig, customSwaggerUiConfig)
11863
11942
  };
11864
11943
 
11865
11944
  // src/services/agent_task_consumer.ts
11866
- var import_core53 = require("@axiom-lattice/core");
11945
+ var import_core54 = require("@axiom-lattice/core");
11867
11946
  var handleAgentTask = async (taskRequest, retryCount = 0) => {
11868
11947
  const {
11869
11948
  assistant_id,
@@ -11881,17 +11960,17 @@ var handleAgentTask = async (taskRequest, retryCount = 0) => {
11881
11960
  console.log(
11882
11961
  `\u5F00\u59CB\u5904\u7406\u4EFB\u52A1 [assistant_id: ${assistant_id}, thread_id: ${thread_id}]`
11883
11962
  );
11884
- const agent = import_core53.agentInstanceManager.getAgent({ assistant_id, thread_id, tenant_id, workspace_id: runConfig?.workspaceId, project_id: runConfig?.projectId, custom_run_config: runConfig });
11885
- await agent.addMessage({ input, command, custom_run_config: runConfig }, import_core53.QueueMode.STEER);
11963
+ const agent = import_core54.agentInstanceManager.getAgent({ assistant_id, thread_id, tenant_id, workspace_id: runConfig?.workspaceId, project_id: runConfig?.projectId, custom_run_config: runConfig });
11964
+ await agent.addMessage({ input, command, custom_run_config: runConfig }, import_core54.QueueMode.STEER);
11886
11965
  if (callback_event) {
11887
11966
  agent.subscribeOnce("message:completed", (evt) => {
11888
- import_core53.eventBus.publish(callback_event, {
11967
+ import_core54.eventBus.publish(callback_event, {
11889
11968
  success: true,
11890
11969
  state: evt.state
11891
11970
  });
11892
11971
  if (main_thread_id && main_tenant_id) {
11893
11972
  try {
11894
- const mainAgent = import_core53.agentInstanceManager.getAgent({
11973
+ const mainAgent = import_core54.agentInstanceManager.getAgent({
11895
11974
  assistant_id: main_assistant_id ?? assistant_id,
11896
11975
  thread_id: main_thread_id,
11897
11976
  tenant_id: main_tenant_id,
@@ -11921,7 +12000,7 @@ ${summary}`
11921
12000
  }
11922
12001
  });
11923
12002
  agent.subscribeOnce("message:interrupted", (evt) => {
11924
- import_core53.eventBus.publish(callback_event, {
12003
+ import_core54.eventBus.publish(callback_event, {
11925
12004
  success: true,
11926
12005
  state: evt.state
11927
12006
  });
@@ -11944,7 +12023,7 @@ ${summary}`
11944
12023
  return handleAgentTask(taskRequest, nextRetryCount);
11945
12024
  }
11946
12025
  if (callback_event) {
11947
- import_core53.eventBus.publish(callback_event, {
12026
+ import_core54.eventBus.publish(callback_event, {
11948
12027
  success: false,
11949
12028
  error: error instanceof Error ? error.message : String(error)
11950
12029
  });
@@ -11981,7 +12060,7 @@ var _AgentTaskConsumer = class _AgentTaskConsumer {
11981
12060
  * 初始化事件监听和队列轮询
11982
12061
  */
11983
12062
  initialize() {
11984
- import_core53.eventBus.subscribe(import_core53.AGENT_TASK_EVENT, this.trigger_agent_task.bind(this));
12063
+ import_core54.eventBus.subscribe(import_core54.AGENT_TASK_EVENT, this.trigger_agent_task.bind(this));
11985
12064
  this.startPollingQueue();
11986
12065
  console.log("Agent\u4EFB\u52A1\u6D88\u8D39\u8005\u5DF2\u542F\u52A8\u5E76\u76D1\u542C\u4EFB\u52A1\u4E8B\u4EF6\u548C\u961F\u5217");
11987
12066
  }
@@ -12100,7 +12179,7 @@ var _AgentTaskConsumer = class _AgentTaskConsumer {
12100
12179
  handleAgentTask(taskRequest).catch((error) => {
12101
12180
  console.error("\u5904\u7406Agent\u4EFB\u52A1\u65F6\u53D1\u751F\u672A\u6355\u83B7\u7684\u9519\u8BEF:", error);
12102
12181
  if (taskRequest.callback_event) {
12103
- import_core53.eventBus.publish(taskRequest.callback_event, {
12182
+ import_core54.eventBus.publish(taskRequest.callback_event, {
12104
12183
  success: false,
12105
12184
  error: error instanceof Error ? error.message : String(error)
12106
12185
  });
@@ -12115,7 +12194,7 @@ _AgentTaskConsumer.agent_run_endpoint = "http://localhost:4001/api/runs";
12115
12194
  var AgentTaskConsumer = _AgentTaskConsumer;
12116
12195
 
12117
12196
  // src/index.ts
12118
- var import_core57 = require("@axiom-lattice/core");
12197
+ var import_core58 = require("@axiom-lattice/core");
12119
12198
  var import_protocols5 = require("@axiom-lattice/protocols");
12120
12199
  var import_meta = {};
12121
12200
  process.on("unhandledRejection", (reason, promise) => {
@@ -12131,11 +12210,11 @@ var DEFAULT_LOGGER_CONFIG = {
12131
12210
  var loggerLattice = initializeLogger(DEFAULT_LOGGER_CONFIG);
12132
12211
  var logger5 = loggerLattice.client;
12133
12212
  function initializeLogger(config) {
12134
- if (import_core57.loggerLatticeManager.hasLattice("default")) {
12135
- import_core57.loggerLatticeManager.removeLattice("default");
12213
+ if (import_core58.loggerLatticeManager.hasLattice("default")) {
12214
+ import_core58.loggerLatticeManager.removeLattice("default");
12136
12215
  }
12137
- (0, import_core57.registerLoggerLattice)("default", config);
12138
- return (0, import_core57.getLoggerLattice)("default");
12216
+ (0, import_core58.registerLoggerLattice)("default", config);
12217
+ return (0, import_core58.getLoggerLattice)("default");
12139
12218
  }
12140
12219
  var app = (0, import_fastify.default)({
12141
12220
  logger: false,
@@ -12159,7 +12238,7 @@ var getHeaderValue = (header) => {
12159
12238
  }
12160
12239
  return header;
12161
12240
  };
12162
- var PUBLIC_ROUTES = ["/api/auth/login", "/api/auth/register", "/health"];
12241
+ var PUBLIC_ROUTES = ["/api/auth/login", "/api/auth/register", "/health", "/api/stt/models"];
12163
12242
  app.addHook("preHandler", async (request, reply) => {
12164
12243
  const user = extractUserFromAuthHeader(request.headers.authorization);
12165
12244
  if (user) {
@@ -12246,7 +12325,7 @@ app.setErrorHandler((error, request, reply) => {
12246
12325
  });
12247
12326
  function getConfiguredSandboxProvider() {
12248
12327
  const sandboxProviderType = process.env.SANDBOX_PROVIDER_TYPE || "microsandbox-remote";
12249
- return (0, import_core57.createSandboxProvider)({
12328
+ return (0, import_core58.createSandboxProvider)({
12250
12329
  type: sandboxProviderType,
12251
12330
  remoteBaseURL: process.env.SANDBOX_BASE_URL,
12252
12331
  microsandboxServiceBaseURL: process.env.MICROSANDBOX_SERVICE_BASE_URL,
@@ -12262,7 +12341,7 @@ function getConfiguredSandboxProvider() {
12262
12341
  }
12263
12342
  async function restoreMcpConnections() {
12264
12343
  try {
12265
- const storeLattice = (0, import_core57.getStoreLattice)("default", "mcp");
12344
+ const storeLattice = (0, import_core58.getStoreLattice)("default", "mcp");
12266
12345
  const store2 = storeLattice.store;
12267
12346
  if (!store2) {
12268
12347
  logger5.info("MCP store not configured, skipping connection restoration");
@@ -12276,15 +12355,15 @@ async function restoreMcpConnections() {
12276
12355
  for (const config of connectedConfigs) {
12277
12356
  try {
12278
12357
  const connection = convertToConnection2(config.config);
12279
- import_core57.mcpManager.addServer(config.key, connection);
12358
+ import_core58.mcpManager.addServer(config.key, connection);
12280
12359
  } catch (err) {
12281
12360
  logger5.warn(`Failed to prepare MCP server "${config.key}" for restoration`, { error: err });
12282
12361
  }
12283
12362
  }
12284
- await import_core57.mcpManager.connect();
12363
+ await import_core58.mcpManager.connect();
12285
12364
  for (const config of connectedConfigs) {
12286
12365
  try {
12287
- await import_core57.mcpManager.registerToolsToToolLattice(config.key, config.selectedTools);
12366
+ await import_core58.mcpManager.registerToolsToToolLattice(config.key, config.selectedTools);
12288
12367
  logger5.info(`MCP server "${config.key}" restored with ${config.selectedTools.length} tools`);
12289
12368
  } catch (err) {
12290
12369
  logger5.warn(`Failed to register tools for MCP server "${config.key}"`, { error: err });
@@ -12317,7 +12396,7 @@ var start = async (config) => {
12317
12396
  const { getStoreLattice: getStore15 } = await import("@axiom-lattice/core");
12318
12397
  const bindingStore = getStore15("default", "channelBinding").store;
12319
12398
  const installationStore = getStore15("default", "channelInstallation").store;
12320
- (0, import_core56.setBindingRegistry)(bindingStore);
12399
+ (0, import_core57.setBindingRegistry)(bindingStore);
12321
12400
  const router = new MessageRouter({
12322
12401
  middlewares: [
12323
12402
  createDeduplicationMiddleware(),
@@ -12342,10 +12421,10 @@ var start = async (config) => {
12342
12421
  error: err instanceof Error ? err.message : String(err)
12343
12422
  });
12344
12423
  }
12345
- (0, import_core56.setEvalRunService)(evalRunner);
12424
+ (0, import_core57.setEvalRunService)(evalRunner);
12346
12425
  try {
12347
- const menuStore = (0, import_core57.getStoreLattice)("default", "menu").store;
12348
- (0, import_core56.setMenuRegistry)(menuStore);
12426
+ const menuStore = (0, import_core58.getStoreLattice)("default", "menu").store;
12427
+ (0, import_core57.setMenuRegistry)(menuStore);
12349
12428
  logger5.info("Menu registry initialized");
12350
12429
  } catch {
12351
12430
  }
@@ -12354,17 +12433,17 @@ var start = async (config) => {
12354
12433
  setChannelControllerDeps({ adapterRegistry, router: channelDeps.router });
12355
12434
  }
12356
12435
  registerLatticeRoutes(app, channelDeps);
12357
- if (!import_core57.sandboxLatticeManager.hasLattice("default")) {
12358
- import_core57.sandboxLatticeManager.registerLattice("default", getConfiguredSandboxProvider());
12436
+ if (!import_core58.sandboxLatticeManager.hasLattice("default")) {
12437
+ import_core58.sandboxLatticeManager.registerLattice("default", getConfiguredSandboxProvider());
12359
12438
  logger5.info("Registered sandbox manager from env configuration");
12360
12439
  }
12361
12440
  try {
12362
12441
  const { ResourceController: ResourceController2 } = await Promise.resolve().then(() => (init_resources(), resources_exports));
12363
- const sharedResourceStore = (0, import_core57.getStoreLattice)("default", "sharedResource").store;
12364
- const cache = new import_core57.TokenCache();
12442
+ const sharedResourceStore = (0, import_core58.getStoreLattice)("default", "sharedResource").store;
12443
+ const cache = new import_core58.TokenCache();
12365
12444
  const resourceController = new ResourceController2({
12366
12445
  store: sharedResourceStore,
12367
- sandboxManager: import_core57.sandboxLatticeManager,
12446
+ sandboxManager: import_core58.sandboxLatticeManager,
12368
12447
  cache,
12369
12448
  logger: logger5
12370
12449
  });
@@ -12405,7 +12484,7 @@ var start = async (config) => {
12405
12484
  }
12406
12485
  }
12407
12486
  if (process.env.AXIOM_RESTORE_PENDING_ON_STARTUP === "true") {
12408
- import_core57.agentInstanceManager.restore().then((stats) => {
12487
+ import_core58.agentInstanceManager.restore().then((stats) => {
12409
12488
  logger5.info(`Agent recovery complete: ${stats.restored} threads restored, ${stats.errors} errors`);
12410
12489
  }).catch((error) => {
12411
12490
  logger5.error("Agent recovery failed", { error });