@axiom-lattice/gateway 2.1.28 → 2.1.30

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.28 build /home/runner/work/agentic/agentic/packages/gateway
2
+ > @axiom-lattice/gateway@2.1.30 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,17 @@
9
9
  CLI Cleaning output folder
10
10
  CJS Build start
11
11
  ESM Build start
12
- ESM dist/index.mjs 84.32 KB
13
- ESM dist/index.mjs.map 201.30 KB
14
- ESM ⚡️ Build success in 198ms
15
- CJS dist/index.js 86.95 KB
16
- CJS dist/index.js.map 201.27 KB
17
- CJS ⚡️ Build success in 202ms
12
+ CJS dist/index.js 145.26 KB
13
+ CJS dist/index.js.map 316.16 KB
14
+ CJS ⚡️ Build success in 283ms
15
+ ESM dist/config-F3FCBSPH.mjs 148.00 B
16
+ ESM dist/index.mjs 138.74 KB
17
+ ESM dist/chunk-FSASG3SB.mjs 2.46 KB
18
+ ESM dist/config-F3FCBSPH.mjs.map 71.00 B
19
+ ESM dist/chunk-FSASG3SB.mjs.map 5.33 KB
20
+ ESM dist/index.mjs.map 310.76 KB
21
+ ESM ⚡️ Build success in 285ms
18
22
  DTS Build start
19
- DTS ⚡️ Build success in 8936ms
23
+ DTS ⚡️ Build success in 10103ms
20
24
  DTS dist/index.d.ts 3.72 KB
21
25
  DTS dist/index.d.mts 3.72 KB
package/AGENTS.md ADDED
@@ -0,0 +1,50 @@
1
+ ## OVERVIEW
2
+ Fastify-based HTTP API gateway exposing REST endpoints for agent execution, thread management, and config CRUD.
3
+
4
+ ## STRUCTURE
5
+ ```
6
+ src/
7
+ index.ts # Gateway startup, Fastify config
8
+ routes/index.ts # Route definitions (registerLatticeRoutes)
9
+ controllers/ # Route handlers
10
+ run.ts # Agent execution endpoints
11
+ assistant.ts # Agent CRUD
12
+ threads.ts # Thread lifecycle
13
+ memory.ts # Agent state/memory access
14
+ skills.ts # Skill registry
15
+ tools.ts # Tool configs
16
+ models.ts # Model registry
17
+ schedules.ts # Task scheduling
18
+ database-configs.ts # DB connection configs
19
+ workspace.ts # Workspace CRUD
20
+ config.ts # Gateway config
21
+ health.ts # Health checks
22
+ services/ # Business logic
23
+ agent_service.ts # Agent invocation/streaming
24
+ queue_service.ts # Task queue (memory/redis)
25
+ agent_task_consumer.ts # Queue consumer
26
+ sandbox_service.ts # Sandbox proxy
27
+ schemas/index.ts # Zod/Fastify schemas
28
+ logger/Logger.ts # Logger lattice integration
29
+ ```
30
+
31
+ ## WHERE TO LOOK
32
+ - **Run agent**: `routes/index.ts` (/api/runs), `controllers/run.ts`, `services/agent_service.ts`
33
+ - **Stream responses**: `controllers/run.ts` (SSE via reply.hijack), `services/agent_service.ts#agent_stream`
34
+ - **Thread CRUD**: `routes/index.ts`, `controllers/threads.ts`
35
+ - **Assistant CRUD**: `routes/index.ts`, `controllers/assistant.ts`
36
+ - **Memory/State**: `routes/index.ts` (/api/assistants/:id/:thread_id/state), `controllers/memory.ts`
37
+ - **Skills registry**: `routes/index.ts`, `controllers/skills.ts`
38
+ - **Scheduling**: `routes/index.ts`, `controllers/schedules.ts`
39
+ - **Config endpoints**: `routes/index.ts`, `controllers/config.ts`
40
+ - **DB configs**: `routes/index.ts`, `controllers/database-configs.ts`
41
+ - **Queue setup**: `services/queue_service.ts`, `services/agent_task_consumer.ts`
42
+ - **Logger lattice**: `logger/Logger.ts`, integration in `index.ts`
43
+
44
+ ## CONVENTIONS
45
+ - Controllers export named handlers, consume from `services/`
46
+ - Services contain business logic, talk to `@axiom-lattice/core`
47
+ - Routes registered via `registerLatticeRoutes(app)`
48
+ - Streaming: use `reply.hijack()` + SSE headers, iterate async generators
49
+ - Tenant/workspace headers: `x-tenant-id`, `x-workspace-id`, `x-project-id`
50
+ - Schemas in `schemas/index.ts` for validation/Swagger
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @axiom-lattice/gateway
2
2
 
3
+ ## 2.1.30
4
+
5
+ ### Patch Changes
6
+
7
+ - 203d94b: update metrics middleware and tenant / user
8
+ - Updated dependencies [203d94b]
9
+ - @axiom-lattice/protocols@2.1.15
10
+ - @axiom-lattice/core@2.1.25
11
+ - @axiom-lattice/queue-redis@1.0.14
12
+
13
+ ## 2.1.29
14
+
15
+ ### Patch Changes
16
+
17
+ - faf1bad: update team and more
18
+ - Updated dependencies [faf1bad]
19
+ - @axiom-lattice/core@2.1.24
20
+ - @axiom-lattice/protocols@2.1.14
21
+ - @axiom-lattice/queue-redis@1.0.13
22
+
3
23
  ## 2.1.28
4
24
 
5
25
  ### Patch Changes
@@ -0,0 +1,94 @@
1
+ // src/config.ts
2
+ var ConfigService = class {
3
+ constructor() {
4
+ this.config = this.loadFromEnv();
5
+ }
6
+ /**
7
+ * Load configuration from environment variables
8
+ */
9
+ loadFromEnv() {
10
+ return {
11
+ port: process.env.PORT ? Number(process.env.PORT) : void 0,
12
+ queueServiceType: process.env.QUEUE_SERVICE_TYPE,
13
+ redisUrl: process.env.REDIS_URL,
14
+ redisPassword: process.env.REDIS_PASSWORD,
15
+ queueName: process.env.QUEUE_NAME
16
+ };
17
+ }
18
+ /**
19
+ * Update configuration from JSON object
20
+ * This will update both the internal config and process.env
21
+ */
22
+ updateConfig(jsonConfig) {
23
+ for (const [key, value] of Object.entries(jsonConfig)) {
24
+ if (value !== null && value !== void 0) {
25
+ if (typeof value === "object" && !Array.isArray(value)) {
26
+ for (const [nestedKey, nestedValue] of Object.entries(value)) {
27
+ const envKey = `${key.toUpperCase()}_${nestedKey.toUpperCase()}`;
28
+ process.env[envKey] = String(nestedValue);
29
+ }
30
+ } else {
31
+ process.env[key.toUpperCase()] = String(value);
32
+ }
33
+ }
34
+ }
35
+ this.config = this.loadFromEnv();
36
+ this.config = this.deepMerge(this.config, jsonConfig);
37
+ }
38
+ /**
39
+ * Deep merge two objects
40
+ */
41
+ deepMerge(target, source) {
42
+ const output = { ...target };
43
+ if (this.isObject(target) && this.isObject(source)) {
44
+ Object.keys(source).forEach((key) => {
45
+ if (this.isObject(source[key])) {
46
+ if (!(key in target)) {
47
+ Object.assign(output, { [key]: source[key] });
48
+ } else {
49
+ output[key] = this.deepMerge(target[key], source[key]);
50
+ }
51
+ } else {
52
+ Object.assign(output, { [key]: source[key] });
53
+ }
54
+ });
55
+ }
56
+ return output;
57
+ }
58
+ /**
59
+ * Check if value is a plain object
60
+ */
61
+ isObject(item) {
62
+ return item && typeof item === "object" && !Array.isArray(item);
63
+ }
64
+ /**
65
+ * Get current configuration
66
+ */
67
+ getConfig() {
68
+ return { ...this.config };
69
+ }
70
+ };
71
+ var configService = new ConfigService();
72
+ var config = {
73
+ get port() {
74
+ return configService.getConfig().port;
75
+ },
76
+ get queueServiceType() {
77
+ return configService.getConfig().queueServiceType;
78
+ },
79
+ get redisUrl() {
80
+ return configService.getConfig().redisUrl;
81
+ },
82
+ get redisPassword() {
83
+ return configService.getConfig().redisPassword;
84
+ },
85
+ get queueName() {
86
+ return configService.getConfig().queueName;
87
+ }
88
+ };
89
+
90
+ export {
91
+ configService,
92
+ config
93
+ };
94
+ //# sourceMappingURL=chunk-FSASG3SB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/config.ts"],"sourcesContent":["/**\n * Configuration service\n * Manages environment variables and supports dynamic updates\n */\n\nexport interface GatewayConfig {\n port?: number;\n queueServiceType?: string;\n redisUrl?: string;\n redisPassword?: string;\n queueName?: string;\n [key: string]: any; // Allow additional config keys\n}\n\n/**\n * Get configuration from environment variables\n * Supports dynamic updates via updateConfig method\n */\nclass ConfigService {\n private config: GatewayConfig;\n\n constructor() {\n this.config = this.loadFromEnv();\n }\n\n /**\n * Load configuration from environment variables\n */\n private loadFromEnv(): GatewayConfig {\n return {\n port: process.env.PORT ? Number(process.env.PORT) : undefined,\n queueServiceType: process.env.QUEUE_SERVICE_TYPE,\n redisUrl: process.env.REDIS_URL,\n redisPassword: process.env.REDIS_PASSWORD,\n queueName: process.env.QUEUE_NAME,\n };\n }\n\n /**\n * Update configuration from JSON object\n * This will update both the internal config and process.env\n */\n updateConfig(jsonConfig: Record<string, any>): void {\n // Update process.env for all provided keys\n for (const [key, value] of Object.entries(jsonConfig)) {\n if (value !== null && value !== undefined) {\n // Convert nested objects to environment variable format\n if (typeof value === \"object\" && !Array.isArray(value)) {\n // Handle nested objects like supabase: { url: \"...\", key: \"...\" }\n for (const [nestedKey, nestedValue] of Object.entries(value)) {\n const envKey = `${key.toUpperCase()}_${nestedKey.toUpperCase()}`;\n process.env[envKey] = String(nestedValue);\n }\n } else {\n // Handle flat keys\n process.env[key.toUpperCase()] = String(value);\n }\n }\n }\n\n // Reload config from updated environment variables\n this.config = this.loadFromEnv();\n\n // Deep merge the JSON config into our config object\n this.config = this.deepMerge(this.config, jsonConfig);\n }\n\n /**\n * Deep merge two objects\n */\n private deepMerge(target: any, source: any): any {\n const output = { ...target };\n if (this.isObject(target) && this.isObject(source)) {\n Object.keys(source).forEach((key) => {\n if (this.isObject(source[key])) {\n if (!(key in target)) {\n Object.assign(output, { [key]: source[key] });\n } else {\n output[key] = this.deepMerge(target[key], source[key]);\n }\n } else {\n Object.assign(output, { [key]: source[key] });\n }\n });\n }\n return output;\n }\n\n /**\n * Check if value is a plain object\n */\n private isObject(item: any): boolean {\n return item && typeof item === \"object\" && !Array.isArray(item);\n }\n\n /**\n * Get current configuration\n */\n getConfig(): GatewayConfig {\n return { ...this.config };\n }\n}\n\n// Export singleton instance\nexport const configService = new ConfigService();\n\n// Export config getter for backward compatibility\nexport const config = {\n get port() {\n return configService.getConfig().port;\n },\n get queueServiceType() {\n return configService.getConfig().queueServiceType;\n },\n get redisUrl() {\n return configService.getConfig().redisUrl;\n },\n get redisPassword() {\n return configService.getConfig().redisPassword;\n },\n get queueName() {\n return configService.getConfig().queueName;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C9B,cAAI,EAAE,OAAO,SAAS;AACpB,mBAAO,OAAO,QAAQ,EAAE,CAAC,GAAG,GAAG,OAAO,GAAG,EAAE,CAAC;AAAA,UAC9C,OAAO;AACL,mBAAO,GAAG,IAAI,KAAK,UAAU,OAAO,GAAG,GAAG,OAAO,GAAG,CAAC;AAAA,UACvD;AAAA,QACF,OAAO;AACL,iBAAO,OAAO,QAAQ,EAAE,CAAC,GAAG,GAAG,OAAO,GAAG,EAAE,CAAC;AAAA,QAC9C;AAAA,MACF,CAAC;AAAA,IACH;AACA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKQ,SAAS,MAAoB;AACnC,WAAO,QAAQ,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI;AAAA,EAChE;AAAA;AAAA;AAAA;AAAA,EAKA,YAA2B;AACzB,WAAO,EAAE,GAAG,KAAK,OAAO;AAAA,EAC1B;AACF;AAGO,IAAM,gBAAgB,IAAI,cAAc;AAGxC,IAAM,SAAS;AAAA,EACpB,IAAI,OAAO;AACT,WAAO,cAAc,UAAU,EAAE;AAAA,EACnC;AAAA,EACA,IAAI,mBAAmB;AACrB,WAAO,cAAc,UAAU,EAAE;AAAA,EACnC;AAAA,EACA,IAAI,WAAW;AACb,WAAO,cAAc,UAAU,EAAE;AAAA,EACnC;AAAA,EACA,IAAI,gBAAgB;AAClB,WAAO,cAAc,UAAU,EAAE;AAAA,EACnC;AAAA,EACA,IAAI,YAAY;AACd,WAAO,cAAc,UAAU,EAAE;AAAA,EACnC;AACF;","names":[]}
@@ -0,0 +1,9 @@
1
+ import {
2
+ config,
3
+ configService
4
+ } from "./chunk-FSASG3SB.mjs";
5
+ export {
6
+ config,
7
+ configService
8
+ };
9
+ //# sourceMappingURL=config-F3FCBSPH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}