@axiom-lattice/gateway 3.0.2 → 3.0.3
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/dist/index.js +31 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -6
- package/.eslintrc.json +0 -22
- package/.turbo/turbo-build.log +0 -46
- package/AGENTS.md +0 -112
- package/CHANGELOG.md +0 -1190
- package/LOGGER_CONFIG.md +0 -135
- package/RESUME_STREAM_CONTENT_BASED.md +0 -326
- package/RESUME_STREAM_README.md +0 -388
- package/jest.config.js +0 -72
- package/public/sdk/README.md +0 -695
- package/public/sdk/dashboard-engine-skill.md +0 -1122
- package/public/sdk/dashboard-single-file-spec.md +0 -357
- package/public/sdk/data-query-sdk-skill.md +0 -307
- package/public/sdk/data-query-sdk.d.ts +0 -252
- package/public/sdk/data-query-sdk.js +0 -970
- package/public/sdk/occupancy-dashboard.html +0 -363
- package/public/sdk/test-dashboard.html +0 -690
- package/scripts/seed-lark-installation.ts +0 -54
- package/src/__tests__/__mocks__/e2b.ts +0 -1
- package/src/__tests__/a2a.test.ts +0 -428
- package/src/__tests__/channel-installations.test.ts +0 -199
- package/src/__tests__/data-query.test.ts +0 -77
- package/src/__tests__/sandbox-provider-registration.test.ts +0 -74
- package/src/__tests__/setup.ts +0 -5
- package/src/__tests__/workspace.test.ts +0 -400
- package/src/channels/__tests__/routes.test.ts +0 -50
- package/src/channels/lark/LarkChannelAdapter.ts +0 -217
- package/src/channels/lark/README.md +0 -187
- package/src/channels/lark/__tests__/controller.test.ts +0 -136
- package/src/channels/lark/__tests__/mapping-service.test.ts +0 -118
- package/src/channels/lark/__tests__/parser.test.ts +0 -72
- package/src/channels/lark/__tests__/sender.test.ts +0 -37
- package/src/channels/lark/__tests__/verification.test.ts +0 -157
- package/src/channels/lark/controller.ts +0 -48
- package/src/channels/lark/mapping-service.ts +0 -138
- package/src/channels/lark/parser.ts +0 -68
- package/src/channels/lark/routes.ts +0 -22
- package/src/channels/lark/sender.ts +0 -58
- package/src/channels/lark/types.ts +0 -20
- package/src/channels/lark/verification.ts +0 -32
- package/src/channels/registry.ts +0 -20
- package/src/channels/routes.ts +0 -30
- package/src/channels/wechat/WechatChannelAdapter.ts +0 -294
- package/src/channels/wechat/__tests__/context-store.test.ts +0 -148
- package/src/channels/wechat/context-store.ts +0 -54
- package/src/channels/wechat/controller.ts +0 -59
- package/src/channels/wechat/routes.ts +0 -7
- package/src/channels/wechat/types.ts +0 -62
- package/src/channels/wechat/wechat-client.ts +0 -162
- package/src/config/local-a2a-templates.ts +0 -59
- package/src/config.ts +0 -124
- package/src/controllers/__tests__/assistant-local-a2a.test.ts +0 -147
- package/src/controllers/__tests__/local-a2a-templates.test.ts +0 -112
- package/src/controllers/__tests__/mime.test.ts +0 -74
- package/src/controllers/__tests__/resources.test.ts +0 -122
- package/src/controllers/__tests__/run.test.ts +0 -115
- package/src/controllers/__tests__/tasks.test.ts +0 -215
- package/src/controllers/__tests__/workflow-tracking.test.ts +0 -113
- package/src/controllers/agent_task.ts +0 -72
- package/src/controllers/assistant.ts +0 -490
- package/src/controllers/auth.ts +0 -524
- package/src/controllers/channel-bindings.ts +0 -135
- package/src/controllers/channel-installations.ts +0 -409
- package/src/controllers/collections.ts +0 -176
- package/src/controllers/config.ts +0 -126
- package/src/controllers/connections.ts +0 -181
- package/src/controllers/data-query.ts +0 -236
- package/src/controllers/database-configs.ts +0 -440
- package/src/controllers/embeddings.ts +0 -22
- package/src/controllers/entries.ts +0 -167
- package/src/controllers/eval.ts +0 -513
- package/src/controllers/export-import.ts +0 -166
- package/src/controllers/health.ts +0 -36
- package/src/controllers/local-a2a-templates.ts +0 -18
- package/src/controllers/local-a2a.ts +0 -149
- package/src/controllers/mcp-configs.ts +0 -673
- package/src/controllers/memory.ts +0 -257
- package/src/controllers/menu-items.ts +0 -114
- package/src/controllers/metrics-configs.ts +0 -1061
- package/src/controllers/middleware-types.ts +0 -15
- package/src/controllers/models.ts +0 -199
- package/src/controllers/personal-assistant.ts +0 -191
- package/src/controllers/resources.ts +0 -477
- package/src/controllers/run.ts +0 -338
- package/src/controllers/sandbox.ts +0 -255
- package/src/controllers/schedules.ts +0 -336
- package/src/controllers/skills.ts +0 -256
- package/src/controllers/tasks.ts +0 -213
- package/src/controllers/tenants.ts +0 -121
- package/src/controllers/thread_status.ts +0 -66
- package/src/controllers/threads.ts +0 -260
- package/src/controllers/tools.ts +0 -139
- package/src/controllers/users.ts +0 -135
- package/src/controllers/workflow-tracking.ts +0 -693
- package/src/controllers/workspace.ts +0 -879
- package/src/export_registrations/a2a-api-key.registration.ts +0 -89
- package/src/export_registrations/agent.registration.ts +0 -80
- package/src/export_registrations/binding.registration.ts +0 -106
- package/src/export_registrations/channel-installation.registration.ts +0 -88
- package/src/export_registrations/collection.registration.ts +0 -85
- package/src/export_registrations/connection.registration.ts +0 -97
- package/src/export_registrations/database-config.registration.ts +0 -94
- package/src/export_registrations/eval.registration.ts +0 -334
- package/src/export_registrations/index.ts +0 -31
- package/src/export_registrations/mcp-config.registration.ts +0 -97
- package/src/export_registrations/menu.registration.ts +0 -91
- package/src/export_registrations/metrics-config.registration.ts +0 -94
- package/src/export_registrations/skill.registration.ts +0 -88
- package/src/export_registrations/task.registration.ts +0 -99
- package/src/index.ts +0 -497
- package/src/logger/Logger.ts +0 -186
- package/src/router/MessageContext.ts +0 -14
- package/src/router/MessageRouter.ts +0 -490
- package/src/router/middlewares/auditLogger.ts +0 -34
- package/src/router/middlewares/deduplication.ts +0 -38
- package/src/router/middlewares/index.ts +0 -3
- package/src/router/middlewares/rateLimit.ts +0 -46
- package/src/routes/__tests__/a2a-test-connection.test.ts +0 -177
- package/src/routes/a2a-bridge.ts +0 -266
- package/src/routes/a2a-test-connection.ts +0 -126
- package/src/routes/a2a.ts +0 -851
- package/src/routes/channel-bindings.ts +0 -11
- package/src/routes/channel-installations.ts +0 -33
- package/src/routes/index.ts +0 -640
- package/src/routes/menu-items.ts +0 -10
- package/src/routes/resource-routes.ts +0 -35
- package/src/routes/stt.ts +0 -102
- package/src/schemas/data-query.ts +0 -69
- package/src/schemas/index.ts +0 -852
- package/src/services/ExportImportService.ts +0 -296
- package/src/services/__tests__/ExportImportService.test.ts +0 -130
- package/src/services/__tests__/eval-runner.test.ts +0 -131
- package/src/services/__tests__/local-a2a.test.ts +0 -124
- package/src/services/agent_task_consumer.ts +0 -348
- package/src/services/collection_service.ts +0 -258
- package/src/services/eval-runner.ts +0 -283
- package/src/services/local-a2a.ts +0 -354
- package/src/services/queue_service.ts +0 -104
- package/src/services/sandbox_service.ts +0 -223
- package/src/services/skill_service.ts +0 -97
- package/src/services/supabase.ts +0 -60
- package/src/swagger.ts +0 -77
- package/src/types/index.ts +0 -118
- package/src/types/koa.d.ts +0 -7
- package/src/utils/__tests__/local-a2a-runtime.test.ts +0 -77
- package/src/utils/__tests__/path-containment.test.ts +0 -35
- package/src/utils/a2a-url.ts +0 -20
- package/src/utils/local-a2a-runtime.ts +0 -107
- package/src/utils/mime.ts +0 -44
- package/src/utils/path-containment.ts +0 -38
- package/tsconfig.json +0 -26
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { FastifyRequest, FastifyReply } from "fastify";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Health Controller
|
|
5
|
-
* Handles health check endpoints for monitoring and load balancer checks
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Health check endpoint
|
|
10
|
-
* Returns service status and basic information
|
|
11
|
-
*/
|
|
12
|
-
export async function getHealth(
|
|
13
|
-
request: FastifyRequest,
|
|
14
|
-
reply: FastifyReply
|
|
15
|
-
) {
|
|
16
|
-
try {
|
|
17
|
-
const healthStatus = {
|
|
18
|
-
status: "healthy",
|
|
19
|
-
timestamp: new Date().toISOString(),
|
|
20
|
-
uptime: process.uptime(),
|
|
21
|
-
service: "lattice-gateway",
|
|
22
|
-
version: process.env.npm_package_version || "1.0.0",
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
return reply.send({
|
|
26
|
-
success: true,
|
|
27
|
-
data: healthStatus,
|
|
28
|
-
});
|
|
29
|
-
} catch (error: any) {
|
|
30
|
-
return reply.status(500).send({
|
|
31
|
-
success: false,
|
|
32
|
-
status: "unhealthy",
|
|
33
|
-
error: error.message || "Health check failed",
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { FastifyReply, FastifyRequest } from "fastify";
|
|
2
|
-
import { LOCAL_A2A_TEMPLATES } from "../config/local-a2a-templates";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* List all configured Local A2A templates (read-only static config).
|
|
6
|
-
*/
|
|
7
|
-
export async function getLocalA2ATemplates(
|
|
8
|
-
_request: FastifyRequest,
|
|
9
|
-
reply: FastifyReply,
|
|
10
|
-
): Promise<void> {
|
|
11
|
-
reply.send({
|
|
12
|
-
success: true,
|
|
13
|
-
data: {
|
|
14
|
-
records: LOCAL_A2A_TEMPLATES,
|
|
15
|
-
total: LOCAL_A2A_TEMPLATES.length,
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { FastifyReply, FastifyRequest } from "fastify";
|
|
2
|
-
import { getStoreLattice } from "@axiom-lattice/core";
|
|
3
|
-
import { localA2AService } from "../services/local-a2a";
|
|
4
|
-
import {
|
|
5
|
-
AgentType,
|
|
6
|
-
type Assistant,
|
|
7
|
-
type A2ARemoteAgentConfig,
|
|
8
|
-
} from "@axiom-lattice/protocols";
|
|
9
|
-
|
|
10
|
-
function getTenantId(request: FastifyRequest): string {
|
|
11
|
-
const userTenantId = (request as any).user?.tenantId;
|
|
12
|
-
if (userTenantId) return userTenantId;
|
|
13
|
-
return (request.headers["x-tenant-id"] as string) || "default";
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function getLocalRuntime(assistant: Assistant): A2ARemoteAgentConfig["localRuntime"] | undefined {
|
|
17
|
-
const graphDefinition = assistant.graphDefinition;
|
|
18
|
-
if (!graphDefinition || typeof graphDefinition !== "object") return undefined;
|
|
19
|
-
if ((graphDefinition as { type?: unknown }).type !== AgentType.A2A_REMOTE) return undefined;
|
|
20
|
-
return (graphDefinition as A2ARemoteAgentConfig).localRuntime;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async function getLocalA2AAssistants(
|
|
24
|
-
tenantId: string,
|
|
25
|
-
): Promise<Array<{ assistant: Assistant; localRuntime: NonNullable<A2ARemoteAgentConfig["localRuntime"]> }>> {
|
|
26
|
-
const storeLattice = getStoreLattice("default", "assistant");
|
|
27
|
-
const assistants = await storeLattice.store.getAllAssistants(tenantId);
|
|
28
|
-
const results: Array<{
|
|
29
|
-
assistant: Assistant;
|
|
30
|
-
localRuntime: NonNullable<A2ARemoteAgentConfig["localRuntime"]>;
|
|
31
|
-
}> = [];
|
|
32
|
-
|
|
33
|
-
for (const assistant of assistants) {
|
|
34
|
-
const runtime = getLocalRuntime(assistant);
|
|
35
|
-
if (runtime) {
|
|
36
|
-
results.push({ assistant, localRuntime: runtime });
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return results;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async function getLocalA2AAssistant(
|
|
44
|
-
tenantId: string,
|
|
45
|
-
assistantId: string,
|
|
46
|
-
): Promise<{
|
|
47
|
-
assistant: Assistant;
|
|
48
|
-
localRuntime: NonNullable<A2ARemoteAgentConfig["localRuntime"]>;
|
|
49
|
-
} | null> {
|
|
50
|
-
const storeLattice = getStoreLattice("default", "assistant");
|
|
51
|
-
const assistant = await storeLattice.store.getAssistantById(tenantId, assistantId);
|
|
52
|
-
if (!assistant) return null;
|
|
53
|
-
|
|
54
|
-
const runtime = getLocalRuntime(assistant);
|
|
55
|
-
if (!runtime) return null;
|
|
56
|
-
|
|
57
|
-
return { assistant, localRuntime: runtime };
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
async function requireManagedAssistant(
|
|
61
|
-
request: FastifyRequest<{ Params: { assistantId: string } }>,
|
|
62
|
-
reply: FastifyReply,
|
|
63
|
-
): Promise<{
|
|
64
|
-
assistantId: string;
|
|
65
|
-
localRuntime: NonNullable<A2ARemoteAgentConfig["localRuntime"]>;
|
|
66
|
-
} | null> {
|
|
67
|
-
const assistantId = request.params.assistantId;
|
|
68
|
-
if (!assistantId) {
|
|
69
|
-
reply.status(400).send({ success: false, error: "assistantId is required" });
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const registered = await getLocalA2AAssistant(getTenantId(request), assistantId);
|
|
74
|
-
if (!registered) {
|
|
75
|
-
reply.status(404).send({
|
|
76
|
-
success: false,
|
|
77
|
-
error: `Assistant ${assistantId} is not a local managed A2A assistant`,
|
|
78
|
-
});
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return { assistantId, localRuntime: registered.localRuntime };
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export async function getLocalA2AStatus(
|
|
86
|
-
request: FastifyRequest,
|
|
87
|
-
reply: FastifyReply,
|
|
88
|
-
): Promise<void> {
|
|
89
|
-
const tenantId = getTenantId(request);
|
|
90
|
-
const managed = await getLocalA2AAssistants(tenantId);
|
|
91
|
-
const states = await Promise.all(
|
|
92
|
-
managed.map(({ assistant, localRuntime }) =>
|
|
93
|
-
localA2AService.getRegisteredState(assistant.id, localRuntime),
|
|
94
|
-
),
|
|
95
|
-
);
|
|
96
|
-
reply.send({ success: true, data: { records: states, total: states.length } });
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export async function getLocalA2AProvider(
|
|
100
|
-
request: FastifyRequest<{ Params: { assistantId: string } }>,
|
|
101
|
-
reply: FastifyReply,
|
|
102
|
-
): Promise<void> {
|
|
103
|
-
const registered = await requireManagedAssistant(request, reply);
|
|
104
|
-
if (!registered) return;
|
|
105
|
-
const state = await localA2AService.getRegisteredState(
|
|
106
|
-
registered.assistantId,
|
|
107
|
-
registered.localRuntime,
|
|
108
|
-
);
|
|
109
|
-
reply.send({ success: true, data: state });
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export async function startLocalA2AProvider(
|
|
113
|
-
request: FastifyRequest<{ Params: { assistantId: string } }>,
|
|
114
|
-
reply: FastifyReply,
|
|
115
|
-
): Promise<void> {
|
|
116
|
-
const registered = await requireManagedAssistant(request, reply);
|
|
117
|
-
if (!registered) return;
|
|
118
|
-
|
|
119
|
-
const state = await localA2AService.startProvider(
|
|
120
|
-
registered.assistantId,
|
|
121
|
-
registered.localRuntime,
|
|
122
|
-
);
|
|
123
|
-
reply.send({ success: true, data: state });
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export async function stopLocalA2AProvider(
|
|
127
|
-
request: FastifyRequest<{ Params: { assistantId: string } }>,
|
|
128
|
-
reply: FastifyReply,
|
|
129
|
-
): Promise<void> {
|
|
130
|
-
const registered = await requireManagedAssistant(request, reply);
|
|
131
|
-
if (!registered) return;
|
|
132
|
-
|
|
133
|
-
const state = await localA2AService.stopProvider(registered.assistantId);
|
|
134
|
-
reply.send({ success: true, data: state });
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export async function restartLocalA2AProvider(
|
|
138
|
-
request: FastifyRequest<{ Params: { assistantId: string } }>,
|
|
139
|
-
reply: FastifyReply,
|
|
140
|
-
): Promise<void> {
|
|
141
|
-
const registered = await requireManagedAssistant(request, reply);
|
|
142
|
-
if (!registered) return;
|
|
143
|
-
|
|
144
|
-
const state = await localA2AService.restartProvider(
|
|
145
|
-
registered.assistantId,
|
|
146
|
-
registered.localRuntime,
|
|
147
|
-
);
|
|
148
|
-
reply.send({ success: true, data: state });
|
|
149
|
-
}
|