@axiom-lattice/gateway 2.1.16 → 2.1.18

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.16 build /home/runner/work/agentic/agentic/packages/gateway
2
+ > @axiom-lattice/gateway@2.1.18 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
@@ -9,13 +9,13 @@
9
9
  CLI Cleaning output folder
10
10
  CJS Build start
11
11
  ESM Build start
12
- ESM dist/index.mjs 53.97 KB
13
- ESM dist/index.mjs.map 116.16 KB
14
- ESM ⚡️ Build success in 146ms
15
- CJS dist/index.js 56.47 KB
16
- CJS dist/index.js.map 116.26 KB
17
- CJS ⚡️ Build success in 148ms
12
+ CJS dist/index.js 57.99 KB
13
+ CJS dist/index.js.map 119.45 KB
14
+ CJS ⚡️ Build success in 131ms
15
+ ESM dist/index.mjs 55.49 KB
16
+ ESM dist/index.mjs.map 119.35 KB
17
+ ESM ⚡️ Build success in 131ms
18
18
  DTS Build start
19
- DTS ⚡️ Build success in 7937ms
19
+ DTS ⚡️ Build success in 7860ms
20
20
  DTS dist/index.d.ts 3.32 KB
21
21
  DTS dist/index.d.mts 3.32 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @axiom-lattice/gateway
2
2
 
3
+ ## 2.1.18
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [e26be9a]
8
+ - @axiom-lattice/protocols@2.1.7
9
+ - @axiom-lattice/core@2.1.13
10
+ - @axiom-lattice/queue-redis@1.0.6
11
+
12
+ ## 2.1.17
13
+
14
+ ### Patch Changes
15
+
16
+ - dceba32: add health
17
+
3
18
  ## 2.1.16
4
19
 
5
20
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1113,6 +1113,29 @@ async function updateModels(request, reply) {
1113
1113
  }
1114
1114
  }
1115
1115
 
1116
+ // src/controllers/health.ts
1117
+ async function getHealth(request, reply) {
1118
+ try {
1119
+ const healthStatus = {
1120
+ status: "healthy",
1121
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1122
+ uptime: process.uptime(),
1123
+ service: "lattice-gateway",
1124
+ version: process.env.npm_package_version || "1.0.0"
1125
+ };
1126
+ return reply.send({
1127
+ success: true,
1128
+ data: healthStatus
1129
+ });
1130
+ } catch (error) {
1131
+ return reply.status(500).send({
1132
+ success: false,
1133
+ status: "unhealthy",
1134
+ error: error.message || "Health check failed"
1135
+ });
1136
+ }
1137
+ }
1138
+
1116
1139
  // src/schemas/index.ts
1117
1140
  var getAllMemoryItemsSchema = {
1118
1141
  description: "Get all memory items for an assistant thread",
@@ -1352,6 +1375,37 @@ var getConfigSchema = {
1352
1375
  }
1353
1376
  }
1354
1377
  };
1378
+ var getHealthSchema = {
1379
+ description: "Health check endpoint for monitoring and load balancer checks",
1380
+ tags: ["Health"],
1381
+ summary: "Health Check",
1382
+ response: {
1383
+ 200: {
1384
+ type: "object",
1385
+ properties: {
1386
+ success: { type: "boolean" },
1387
+ data: {
1388
+ type: "object",
1389
+ properties: {
1390
+ status: { type: "string", enum: ["healthy", "unhealthy"] },
1391
+ timestamp: { type: "string" },
1392
+ uptime: { type: "number" },
1393
+ service: { type: "string" },
1394
+ version: { type: "string" }
1395
+ }
1396
+ }
1397
+ }
1398
+ },
1399
+ 500: {
1400
+ type: "object",
1401
+ properties: {
1402
+ success: { type: "boolean" },
1403
+ status: { type: "string" },
1404
+ error: { type: "string" }
1405
+ }
1406
+ }
1407
+ }
1408
+ };
1355
1409
 
1356
1410
  // src/routes/index.ts
1357
1411
  var registerLatticeRoutes = (app2) => {
@@ -1428,6 +1482,11 @@ var registerLatticeRoutes = (app2) => {
1428
1482
  );
1429
1483
  app2.get("/api/models", getModels);
1430
1484
  app2.put("/api/models", updateModels);
1485
+ app2.get(
1486
+ "/health",
1487
+ { schema: getHealthSchema },
1488
+ getHealth
1489
+ );
1431
1490
  };
1432
1491
 
1433
1492
  // src/logger/Logger.ts
@@ -1921,8 +1980,10 @@ var logger = new Logger({
1921
1980
  name: "fastify-server"
1922
1981
  });
1923
1982
  var app = (0, import_fastify.default)({
1924
- logger: false
1983
+ logger: false,
1925
1984
  // 禁用内置日志记录器
1985
+ bodyLimit: Number(process.env.BODY_LIMIT) || 50 * 1024 * 1024
1986
+ // Default 50MB, configurable via BODY_LIMIT env var
1926
1987
  });
1927
1988
  app.addHook("onRequest", (request, reply, done) => {
1928
1989
  const context = {