@axiom-lattice/gateway 2.1.16 → 2.1.17
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +6 -0
- package/dist/index.js +62 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/controllers/health.ts +36 -0
- package/src/index.ts +1 -0
- package/src/routes/index.ts +9 -0
- package/src/schemas/index.ts +33 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/gateway@2.1.
|
|
2
|
+
> @axiom-lattice/gateway@2.1.17 build /home/runner/work/agentic/agentic/packages/gateway
|
|
3
3
|
> tsup src/index.ts --format cjs,esm --dts --clean --sourcemap
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
[34mCLI[39m Cleaning output folder
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
13
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[
|
|
14
|
-
[32mESM[39m ⚡️ Build success in
|
|
15
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
16
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
17
|
-
[32mCJS[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m55.49 KB[39m
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m119.35 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 105ms
|
|
15
|
+
[32mCJS[39m [1mdist/index.js [22m[32m57.99 KB[39m
|
|
16
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m119.45 KB[39m
|
|
17
|
+
[32mCJS[39m ⚡️ Build success in 107ms
|
|
18
18
|
[34mDTS[39m Build start
|
|
19
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
+
[32mDTS[39m ⚡️ Build success in 7551ms
|
|
20
20
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.32 KB[39m
|
|
21
21
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m3.32 KB[39m
|
package/CHANGELOG.md
CHANGED
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 = {
|