@axiom-lattice/gateway 2.1.74 → 2.1.76

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.74 build /home/runner/work/agentic/agentic/packages/gateway
2
+ > @axiom-lattice/gateway@2.1.76 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
@@ -11,20 +11,22 @@
11
11
  ESM Build start
12
12
  [warn] ▲ [WARNING] "import.meta" is not available with the "cjs" output format and will be empty [empty-import-meta]
13
13
 
14
- src/index.ts:171:33:
15
-  171 │ const __filename = fileURLToPath(import.meta.url);
14
+ src/index.ts:178:33:
15
+  178 │ const __filename = fileURLToPath(import.meta.url);
16
16
  ╵ ~~~~~~~~~~~
17
17
 
18
18
  You need to set the output format to "esm" for "import.meta" to work correctly.
19
19
 
20
20
 
21
- ESM dist/index.mjs 222.76 KB
22
- ESM dist/index.mjs.map 478.65 KB
23
- ESM ⚡️ Build success in 394ms
24
- CJS dist/index.js 226.14 KB
25
- CJS dist/index.js.map 477.97 KB
26
- CJS ⚡️ Build success in 396ms
21
+ CJS dist/index.js 236.85 KB
22
+ CJS dist/index.js.map 498.40 KB
23
+ CJS ⚡️ Build success in 458ms
24
+ ESM dist/index.mjs 232.14 KB
25
+ ESM dist/sender-PX32VSHB.mjs 873.00 B
26
+ ESM dist/index.mjs.map 496.86 KB
27
+ ESM dist/sender-PX32VSHB.mjs.map 2.07 KB
28
+ ESM ⚡️ Build success in 457ms
27
29
  DTS Build start
28
- DTS ⚡️ Build success in 13001ms
29
- DTS dist/index.d.ts 3.85 KB
30
- DTS dist/index.d.mts 3.85 KB
30
+ DTS ⚡️ Build success in 13903ms
31
+ DTS dist/index.d.ts 5.01 KB
32
+ DTS dist/index.d.mts 5.01 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @axiom-lattice/gateway
2
2
 
3
+ ## 2.1.76
4
+
5
+ ### Patch Changes
6
+
7
+ - 462a751: add inbound
8
+ - Updated dependencies [462a751]
9
+ - @axiom-lattice/agent-eval@2.1.60
10
+ - @axiom-lattice/core@2.1.66
11
+ - @axiom-lattice/pg-stores@1.0.56
12
+ - @axiom-lattice/protocols@2.1.34
13
+ - @axiom-lattice/queue-redis@1.0.33
14
+
15
+ ## 2.1.75
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [77c93cb]
20
+ - @axiom-lattice/core@2.1.65
21
+ - @axiom-lattice/agent-eval@2.1.59
22
+ - @axiom-lattice/pg-stores@1.0.55
23
+
3
24
  ## 2.1.74
4
25
 
5
26
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as http from 'http';
2
2
  import * as fastify from 'fastify';
3
- import { LoggerType, PinoFileOptions } from '@axiom-lattice/protocols';
3
+ import { ChannelAdapter, InboundMessage, Binding, BindingRegistry, ChannelInstallationStore, DispatchResult, LoggerType, PinoFileOptions } from '@axiom-lattice/protocols';
4
4
 
5
5
  declare const defaultSwaggerConfig: {
6
6
  openapi: {
@@ -46,6 +46,39 @@ declare const defaultSwaggerUiConfig: {
46
46
  transformStaticCSP: (header: string) => string;
47
47
  };
48
48
 
49
+ declare class ChannelAdapterRegistry {
50
+ private adapters;
51
+ register(adapter: ChannelAdapter): void;
52
+ get(channel: string): ChannelAdapter | undefined;
53
+ list(): string[];
54
+ }
55
+
56
+ interface MessageContext {
57
+ inboundMessage: InboundMessage;
58
+ binding?: Binding;
59
+ result?: string;
60
+ error?: Error;
61
+ metadata: Record<string, unknown>;
62
+ }
63
+ type MessageMiddleware = (ctx: MessageContext, next: () => Promise<void>) => Promise<void>;
64
+
65
+ interface MessageRouterConfig {
66
+ middlewares: MessageMiddleware[];
67
+ bindingRegistry: BindingRegistry;
68
+ adapterRegistry: ChannelAdapterRegistry;
69
+ installationStore: ChannelInstallationStore;
70
+ }
71
+ declare class MessageRouter {
72
+ private middlewares;
73
+ private bindingRegistry;
74
+ private adapterRegistry;
75
+ private installationStore;
76
+ constructor(config: MessageRouterConfig);
77
+ use(middleware: MessageMiddleware): void;
78
+ dispatch(message: InboundMessage): Promise<DispatchResult>;
79
+ private runMiddlewares;
80
+ }
81
+
49
82
  type QueueServiceType = "memory" | "redis";
50
83
 
51
84
  interface AgentTaskRequest {
@@ -128,7 +161,10 @@ interface LatticeGatewayConfig {
128
161
  declare const LatticeGateway: {
129
162
  startAsHttpEndpoint: (config?: LatticeGatewayConfig) => Promise<void>;
130
163
  configureSwagger: (app: fastify.FastifyInstance, customSwaggerConfig?: Partial<typeof defaultSwaggerConfig>, customSwaggerUiConfig?: Partial<typeof defaultSwaggerUiConfig>) => Promise<void>;
131
- registerLatticeRoutes: (app: fastify.FastifyInstance) => void;
164
+ registerLatticeRoutes: (app: fastify.FastifyInstance, channelDeps?: {
165
+ router: MessageRouter;
166
+ installationStore: ChannelInstallationStore;
167
+ }) => void;
132
168
  app: fastify.FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault> & PromiseLike<fastify.FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>> & {
133
169
  __linterBrands: "SafePromiseLike";
134
170
  };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as http from 'http';
2
2
  import * as fastify from 'fastify';
3
- import { LoggerType, PinoFileOptions } from '@axiom-lattice/protocols';
3
+ import { ChannelAdapter, InboundMessage, Binding, BindingRegistry, ChannelInstallationStore, DispatchResult, LoggerType, PinoFileOptions } from '@axiom-lattice/protocols';
4
4
 
5
5
  declare const defaultSwaggerConfig: {
6
6
  openapi: {
@@ -46,6 +46,39 @@ declare const defaultSwaggerUiConfig: {
46
46
  transformStaticCSP: (header: string) => string;
47
47
  };
48
48
 
49
+ declare class ChannelAdapterRegistry {
50
+ private adapters;
51
+ register(adapter: ChannelAdapter): void;
52
+ get(channel: string): ChannelAdapter | undefined;
53
+ list(): string[];
54
+ }
55
+
56
+ interface MessageContext {
57
+ inboundMessage: InboundMessage;
58
+ binding?: Binding;
59
+ result?: string;
60
+ error?: Error;
61
+ metadata: Record<string, unknown>;
62
+ }
63
+ type MessageMiddleware = (ctx: MessageContext, next: () => Promise<void>) => Promise<void>;
64
+
65
+ interface MessageRouterConfig {
66
+ middlewares: MessageMiddleware[];
67
+ bindingRegistry: BindingRegistry;
68
+ adapterRegistry: ChannelAdapterRegistry;
69
+ installationStore: ChannelInstallationStore;
70
+ }
71
+ declare class MessageRouter {
72
+ private middlewares;
73
+ private bindingRegistry;
74
+ private adapterRegistry;
75
+ private installationStore;
76
+ constructor(config: MessageRouterConfig);
77
+ use(middleware: MessageMiddleware): void;
78
+ dispatch(message: InboundMessage): Promise<DispatchResult>;
79
+ private runMiddlewares;
80
+ }
81
+
49
82
  type QueueServiceType = "memory" | "redis";
50
83
 
51
84
  interface AgentTaskRequest {
@@ -128,7 +161,10 @@ interface LatticeGatewayConfig {
128
161
  declare const LatticeGateway: {
129
162
  startAsHttpEndpoint: (config?: LatticeGatewayConfig) => Promise<void>;
130
163
  configureSwagger: (app: fastify.FastifyInstance, customSwaggerConfig?: Partial<typeof defaultSwaggerConfig>, customSwaggerUiConfig?: Partial<typeof defaultSwaggerUiConfig>) => Promise<void>;
131
- registerLatticeRoutes: (app: fastify.FastifyInstance) => void;
164
+ registerLatticeRoutes: (app: fastify.FastifyInstance, channelDeps?: {
165
+ router: MessageRouter;
166
+ installationStore: ChannelInstallationStore;
167
+ }) => void;
132
168
  app: fastify.FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault> & PromiseLike<fastify.FastifyInstance<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>, http.IncomingMessage, http.ServerResponse<http.IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>> & {
133
169
  __linterBrands: "SafePromiseLike";
134
170
  };