@axiom-lattice/gateway 2.1.87 → 2.1.88
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 +10 -10
- package/CHANGELOG.md +12 -0
- package/README.md +37 -94
- package/dist/index.js +34 -54
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/controllers/channel-bindings.ts +1 -1
- package/src/controllers/data-query.ts +1 -1
- package/src/controllers/metrics-configs.ts +3 -3
- package/src/index.ts +1 -15
- package/src/bindings/index.ts +0 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axiom-lattice/gateway",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.88",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"redis": "^5.0.1",
|
|
41
41
|
"uuid": "^9.0.1",
|
|
42
42
|
"zod": "3.25.76",
|
|
43
|
-
"@axiom-lattice/agent-eval": "2.1.
|
|
44
|
-
"@axiom-lattice/core": "2.1.
|
|
45
|
-
"@axiom-lattice/pg-stores": "1.0.
|
|
46
|
-
"@axiom-lattice/protocols": "2.1.
|
|
47
|
-
"@axiom-lattice/queue-redis": "1.0.
|
|
43
|
+
"@axiom-lattice/agent-eval": "2.1.70",
|
|
44
|
+
"@axiom-lattice/core": "2.1.76",
|
|
45
|
+
"@axiom-lattice/pg-stores": "1.0.67",
|
|
46
|
+
"@axiom-lattice/protocols": "2.1.39",
|
|
47
|
+
"@axiom-lattice/queue-redis": "1.0.38"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/jest": "^29.5.14",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FastifyRequest, FastifyReply } from "fastify";
|
|
2
2
|
import type { CreateBindingInput } from "@axiom-lattice/protocols";
|
|
3
|
-
import { getBindingRegistry } from "
|
|
3
|
+
import { getBindingRegistry } from "@axiom-lattice/core";
|
|
4
4
|
|
|
5
5
|
function getTenantId(request: FastifyRequest): string {
|
|
6
6
|
const userTenantId = (request as any).user?.tenantId;
|
|
@@ -145,7 +145,7 @@ export async function executeDataQuery(
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
// Get client from manager (read-only, no registration)
|
|
148
|
-
const client = metricsServerManager.getClient(tenantId, body.serverKey) as SemanticMetricsClient;
|
|
148
|
+
const client = await metricsServerManager.getClient(tenantId, body.serverKey) as SemanticMetricsClient;
|
|
149
149
|
|
|
150
150
|
// Execute query based on type
|
|
151
151
|
if (isSemanticQuery) {
|
|
@@ -541,7 +541,7 @@ export async function testMetricsServerConnection(
|
|
|
541
541
|
metricsServerManager.registerServer(tenantId, testKey, config.config);
|
|
542
542
|
|
|
543
543
|
try {
|
|
544
|
-
const client = metricsServerManager.getClient(tenantId, testKey);
|
|
544
|
+
const client = await metricsServerManager.getClient(tenantId, testKey);
|
|
545
545
|
const result = await client.testConnection();
|
|
546
546
|
|
|
547
547
|
// Cleanup
|
|
@@ -608,7 +608,7 @@ export async function listAvailableMetrics(
|
|
|
608
608
|
metricsServerManager.registerServer(tenantId, key, config.config);
|
|
609
609
|
}
|
|
610
610
|
|
|
611
|
-
const client = metricsServerManager.getClient(tenantId, key);
|
|
611
|
+
const client = await metricsServerManager.getClient(tenantId, key);
|
|
612
612
|
const metrics = await client.listMetrics();
|
|
613
613
|
|
|
614
614
|
return {
|
|
@@ -674,7 +674,7 @@ export async function queryMetricsData(
|
|
|
674
674
|
metricsServerManager.registerServer(tenantId, key, config.config);
|
|
675
675
|
}
|
|
676
676
|
|
|
677
|
-
const client = metricsServerManager.getClient(tenantId, key);
|
|
677
|
+
const client = await metricsServerManager.getClient(tenantId, key);
|
|
678
678
|
const result = await client.queryMetricData(metricName, {
|
|
679
679
|
startTime,
|
|
680
680
|
endTime,
|
package/src/index.ts
CHANGED
|
@@ -11,8 +11,7 @@ import type { ChannelInstallationStore, BindingRegistry } from "@axiom-lattice/p
|
|
|
11
11
|
import { MessageRouter } from "./router/MessageRouter";
|
|
12
12
|
import { ChannelAdapterRegistry } from "./channels/registry";
|
|
13
13
|
import { createDeduplicationMiddleware, createRateLimitMiddleware, createAuditLoggerMiddleware } from "./router/middlewares";
|
|
14
|
-
import { setBindingRegistry } from "
|
|
15
|
-
import { setBindingRegistry as setCoreBindingRegistry } from "@axiom-lattice/core";
|
|
14
|
+
import { setBindingRegistry } from "@axiom-lattice/core";
|
|
16
15
|
import { larkChannelAdapter } from "./channels/lark/LarkChannelAdapter";
|
|
17
16
|
import { extractUserFromAuthHeader } from "./controllers/auth";
|
|
18
17
|
import { configureSwagger } from "./swagger";
|
|
@@ -26,13 +25,11 @@ import {
|
|
|
26
25
|
getLoggerLattice,
|
|
27
26
|
loggerLatticeManager,
|
|
28
27
|
sandboxLatticeManager,
|
|
29
|
-
sqlDatabaseManager,
|
|
30
28
|
getStoreLattice,
|
|
31
29
|
agentInstanceManager,
|
|
32
30
|
createSandboxProvider,
|
|
33
31
|
type CreateSandboxProviderConfig,
|
|
34
32
|
} from "@axiom-lattice/core";
|
|
35
|
-
import type { DatabaseConfigStore } from "@axiom-lattice/protocols";
|
|
36
33
|
import {
|
|
37
34
|
LoggerType,
|
|
38
35
|
LoggerConfig,
|
|
@@ -280,7 +277,6 @@ const start = async (config?: LatticeGatewayConfig) => {
|
|
|
280
277
|
const bindingStore = getStoreLattice("default", "channelBinding").store as BindingRegistry;
|
|
281
278
|
const installationStore = getStoreLattice("default", "channelInstallation").store as ChannelInstallationStore;
|
|
282
279
|
setBindingRegistry(bindingStore);
|
|
283
|
-
setCoreBindingRegistry(bindingStore);
|
|
284
280
|
|
|
285
281
|
const adapterRegistry = new ChannelAdapterRegistry();
|
|
286
282
|
adapterRegistry.register(larkChannelAdapter);
|
|
@@ -305,16 +301,6 @@ const start = async (config?: LatticeGatewayConfig) => {
|
|
|
305
301
|
// Register all routes (channel routes only active if channelDeps is set)
|
|
306
302
|
registerLatticeRoutes(app, channelDeps);
|
|
307
303
|
|
|
308
|
-
// Set up database config store for on-demand loading
|
|
309
|
-
try {
|
|
310
|
-
const storeLattice = getStoreLattice("default", "database");
|
|
311
|
-
const store: DatabaseConfigStore = storeLattice.store;
|
|
312
|
-
sqlDatabaseManager.setConfigStore(store);
|
|
313
|
-
logger.info("Database config store set for SqlDatabaseManager");
|
|
314
|
-
} catch (error) {
|
|
315
|
-
logger.warn("Failed to set database config store: " + (error instanceof Error ? error.message : String(error)));
|
|
316
|
-
}
|
|
317
|
-
|
|
318
304
|
// Register sandbox manager if not already registered
|
|
319
305
|
if (!sandboxLatticeManager.hasLattice("default")) {
|
|
320
306
|
sandboxLatticeManager.registerLattice("default", getConfiguredSandboxProvider());
|
package/src/bindings/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { BindingRegistry } from "@axiom-lattice/protocols";
|
|
2
|
-
|
|
3
|
-
let registryInstance: BindingRegistry | null = null;
|
|
4
|
-
|
|
5
|
-
export function setBindingRegistry(registry: BindingRegistry): void {
|
|
6
|
-
registryInstance = registry;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function getBindingRegistry(): BindingRegistry {
|
|
10
|
-
if (!registryInstance) {
|
|
11
|
-
throw new Error("BindingRegistry not initialized. Call setBindingRegistry() first.");
|
|
12
|
-
}
|
|
13
|
-
return registryInstance;
|
|
14
|
-
}
|