@axiom-lattice/gateway 2.1.75 → 2.1.77
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 +14 -12
- package/CHANGELOG.md +22 -0
- package/dist/index.d.mts +38 -2
- package/dist/index.d.ts +38 -2
- package/dist/index.js +741 -401
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +689 -390
- package/dist/index.mjs.map +1 -1
- package/dist/sender-PX32VSHB.mjs +32 -0
- package/dist/sender-PX32VSHB.mjs.map +1 -0
- package/package.json +7 -6
- package/src/bindings/index.ts +14 -0
- package/src/channels/__tests__/routes.test.ts +23 -44
- package/src/channels/lark/LarkChannelAdapter.ts +75 -0
- package/src/channels/lark/__tests__/controller.test.ts +62 -196
- package/src/channels/lark/controller.ts +25 -167
- package/src/channels/lark/routes.ts +12 -111
- package/src/channels/registry.ts +20 -0
- package/src/channels/routes.ts +7 -4
- package/src/controllers/channel-bindings.ts +135 -0
- package/src/controllers/channel-installations.ts +6 -3
- package/src/index.ts +38 -2
- package/src/router/MessageContext.ts +14 -0
- package/src/router/MessageRouter.ts +201 -0
- package/src/router/middlewares/auditLogger.ts +34 -0
- package/src/router/middlewares/deduplication.ts +26 -0
- package/src/router/middlewares/index.ts +3 -0
- package/src/router/middlewares/rateLimit.ts +39 -0
- package/src/routes/channel-bindings.ts +11 -0
- package/src/routes/index.ts +50 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/gateway@2.1.
|
|
2
|
+
> @axiom-lattice/gateway@2.1.77 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
|
|
@@ -11,20 +11,22 @@
|
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[warn] [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1m"import.meta" is not available with the "cjs" output format and will be empty[0m [empty-import-meta]
|
|
13
13
|
|
|
14
|
-
src/index.ts:
|
|
15
|
-
[37m
|
|
14
|
+
src/index.ts:178:33:
|
|
15
|
+
[37m 178 │ const __filename = fileURLToPath([32mimport.meta[37m.url);
|
|
16
16
|
╵ [32m~~~~~~~~~~~[0m
|
|
17
17
|
|
|
18
18
|
You need to set the output format to "esm" for "import.meta" to work correctly.
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
22
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
23
|
-
[32mCJS[39m ⚡️ Build success in
|
|
24
|
-
[32mESM[39m [1mdist/
|
|
25
|
-
[32mESM[39m [1mdist/index.mjs
|
|
26
|
-
[32mESM[39m
|
|
21
|
+
[32mCJS[39m [1mdist/index.js [22m[32m236.85 KB[39m
|
|
22
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m498.40 KB[39m
|
|
23
|
+
[32mCJS[39m ⚡️ Build success in 395ms
|
|
24
|
+
[32mESM[39m [1mdist/sender-PX32VSHB.mjs [22m[32m873.00 B[39m
|
|
25
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m232.14 KB[39m
|
|
26
|
+
[32mESM[39m [1mdist/sender-PX32VSHB.mjs.map [22m[32m2.07 KB[39m
|
|
27
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m496.86 KB[39m
|
|
28
|
+
[32mESM[39m ⚡️ Build success in 397ms
|
|
27
29
|
[34mDTS[39m Build start
|
|
28
|
-
[32mDTS[39m ⚡️ Build success in
|
|
29
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
30
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
30
|
+
[32mDTS[39m ⚡️ Build success in 13178ms
|
|
31
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m5.01 KB[39m
|
|
32
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m5.01 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @axiom-lattice/gateway
|
|
2
2
|
|
|
3
|
+
## 2.1.77
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2ec0254: up tools
|
|
8
|
+
- Updated dependencies [2ec0254]
|
|
9
|
+
- @axiom-lattice/core@2.1.67
|
|
10
|
+
- @axiom-lattice/agent-eval@2.1.61
|
|
11
|
+
- @axiom-lattice/pg-stores@1.0.57
|
|
12
|
+
|
|
13
|
+
## 2.1.76
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 462a751: add inbound
|
|
18
|
+
- Updated dependencies [462a751]
|
|
19
|
+
- @axiom-lattice/agent-eval@2.1.60
|
|
20
|
+
- @axiom-lattice/core@2.1.66
|
|
21
|
+
- @axiom-lattice/pg-stores@1.0.56
|
|
22
|
+
- @axiom-lattice/protocols@2.1.34
|
|
23
|
+
- @axiom-lattice/queue-redis@1.0.33
|
|
24
|
+
|
|
3
25
|
## 2.1.75
|
|
4
26
|
|
|
5
27
|
### 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
|
|
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
|
|
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
|
};
|