@axiom-lattice/gateway 2.1.42 → 2.1.44

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiom-lattice/gateway",
3
- "version": "2.1.42",
3
+ "version": "2.1.44",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -37,7 +37,7 @@
37
37
  "pino-roll": "^3.1.0",
38
38
  "redis": "^5.0.1",
39
39
  "uuid": "^9.0.1",
40
- "@axiom-lattice/core": "2.1.36",
40
+ "@axiom-lattice/core": "2.1.38",
41
41
  "@axiom-lattice/protocols": "2.1.20",
42
42
  "@axiom-lattice/queue-redis": "1.0.19"
43
43
  },
@@ -346,7 +346,7 @@ export async function testDatabaseConnection(
346
346
  sqlDatabaseManager.registerDatabase(tenantId, testKey, config.config);
347
347
 
348
348
  const startTime = Date.now();
349
- const db = sqlDatabaseManager.getDatabase(tenantId, testKey);
349
+ const db = await sqlDatabaseManager.getDatabase(tenantId, testKey);
350
350
 
351
351
  try {
352
352
  // Try to connect and list tables
package/src/index.ts CHANGED
@@ -17,7 +17,10 @@ import {
17
17
  getLoggerLattice,
18
18
  loggerLatticeManager,
19
19
  sandboxLatticeManager,
20
+ sqlDatabaseManager,
21
+ getStoreLattice,
20
22
  } from "@axiom-lattice/core";
23
+ import type { DatabaseConfigStore } from "@axiom-lattice/protocols";
21
24
  import {
22
25
  LoggerType,
23
26
  LoggerConfig,
@@ -89,6 +92,15 @@ app.addHook("onRequest", (request, reply, done) => {
89
92
  done();
90
93
  });
91
94
 
95
+ // Fix for DELETE requests with Content-Type: application/json header
96
+ // Some clients send Content-Type header even for DELETE requests without body
97
+ app.addHook("onRequest", async (request, reply) => {
98
+ if (request.method === "DELETE" && request.headers["content-type"]) {
99
+ // Remove content-type header for DELETE requests to avoid body parsing errors
100
+ delete request.headers["content-type"];
101
+ }
102
+ });
103
+
92
104
  app.addHook("onResponse", (request, reply, done) => {
93
105
  // Convert headers to strings (Fastify headers can be string | string[])
94
106
  const getHeaderValue = (
@@ -208,6 +220,16 @@ const start = async (config?: LatticeGatewayConfig) => {
208
220
  // Register all routes
209
221
  registerLatticeRoutes(app);
210
222
 
223
+ // Set up database config store for on-demand loading
224
+ try {
225
+ const storeLattice = getStoreLattice("default", "database");
226
+ const store: DatabaseConfigStore = storeLattice.store;
227
+ sqlDatabaseManager.setConfigStore(store);
228
+ logger.info("Database config store set for SqlDatabaseManager");
229
+ } catch (error) {
230
+ logger.warn("Failed to set database config store: " + (error instanceof Error ? error.message : String(error)));
231
+ }
232
+
211
233
  // Register sandbox manager if not already registered
212
234
  if (!sandboxLatticeManager.hasLattice("default")) {
213
235
  const sandboxBaseURL = process.env.SANDBOX_BASE_URL || "http://localhost:8080";
@@ -94,6 +94,9 @@ export async function agent_invoke({
94
94
  ? new Command(command)
95
95
  : { ...rest, messages, "x-tenant-id": tenant_id },
96
96
  {
97
+ context: {
98
+ runConfig
99
+ },
97
100
  configurable: {
98
101
  thread_id: thread_id,
99
102
  run_id: run_id || v4(),
@@ -177,6 +180,9 @@ export async function agent_stream({
177
180
  },
178
181
 
179
182
  {
183
+ context: {
184
+ runConfig
185
+ },
180
186
  configurable: {
181
187
  thread_id: thread_id,
182
188
  run_id: run_id || v4(),