diff --git a/src/gateway/server.agent.gateway-server-agent-a.e2e.test.ts b/src/gateway/server.agent.gateway-server-agent-a.e2e.test.ts index ed6b9d4cce2..56de4256b4c 100644 --- a/src/gateway/server.agent.gateway-server-agent-a.e2e.test.ts +++ b/src/gateway/server.agent.gateway-server-agent-a.e2e.test.ts @@ -5,6 +5,7 @@ import { afterAll, beforeAll, describe, expect, test, vi } from "vitest"; import type { ChannelPlugin } from "../channels/plugins/types.js"; import type { PluginRegistry } from "../plugins/registry.js"; import { setRegistry } from "./server.agent.gateway-server-agent.mocks.js"; +import { createRegistry } from "./server.e2e-registry-helpers.js"; import { agentCommand, connectOk, @@ -42,19 +43,6 @@ function expectChannels(call: Record, channel: string) { expect(runContext?.messageChannel).toBe(channel); } -const createRegistry = (channels: PluginRegistry["channels"]): PluginRegistry => ({ - plugins: [], - tools: [], - channels, - providers: [], - gatewayHandlers: {}, - httpHandlers: [], - httpRoutes: [], - cliRegistrars: [], - services: [], - diagnostics: [], -}); - const createStubChannelPlugin = (params: { id: ChannelPlugin["id"]; label: string; diff --git a/src/gateway/server.agent.gateway-server-agent-b.e2e.test.ts b/src/gateway/server.agent.gateway-server-agent-b.e2e.test.ts index 2bbe39ecf02..12639455f17 100644 --- a/src/gateway/server.agent.gateway-server-agent-b.e2e.test.ts +++ b/src/gateway/server.agent.gateway-server-agent-b.e2e.test.ts @@ -10,6 +10,7 @@ import { BARE_SESSION_RESET_PROMPT } from "../auto-reply/reply/session-reset-pro import { emitAgentEvent, registerAgentRunContext } from "../infra/agent-events.js"; import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js"; import { setRegistry } from "./server.agent.gateway-server-agent.mocks.js"; +import { createRegistry } from "./server.e2e-registry-helpers.js"; import { agentCommand, connectOk, @@ -42,22 +43,6 @@ afterAll(async () => { await server.close(); }); -const _BASE_IMAGE_PNG = - "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+X3mIAAAAASUVORK5CYII="; - -const createRegistry = (channels: PluginRegistry["channels"]): PluginRegistry => ({ - plugins: [], - tools: [], - channels, - providers: [], - gatewayHandlers: {}, - httpHandlers: [], - httpRoutes: [], - cliRegistrars: [], - services: [], - diagnostics: [], -}); - const createMSTeamsPlugin = (params?: { aliases?: string[] }): ChannelPlugin => ({ id: "msteams", meta: { diff --git a/src/gateway/server.channels.e2e.test.ts b/src/gateway/server.channels.e2e.test.ts index c65b87c103a..87661d846b3 100644 --- a/src/gateway/server.channels.e2e.test.ts +++ b/src/gateway/server.channels.e2e.test.ts @@ -2,6 +2,7 @@ import { afterAll, beforeAll, describe, expect, test, vi } from "vitest"; import type { ChannelPlugin } from "../channels/plugins/types.js"; import type { PluginRegistry } from "../plugins/registry.js"; import { setActivePluginRegistry } from "../plugins/runtime.js"; +import { createRegistry } from "./server.e2e-registry-helpers.js"; import { connectOk, installGatewayTestHooks, @@ -41,19 +42,6 @@ vi.mock("./server-plugins.js", async () => { }; }); -const createRegistry = (channels: PluginRegistry["channels"]): PluginRegistry => ({ - plugins: [], - tools: [], - channels, - providers: [], - gatewayHandlers: {}, - httpHandlers: [], - httpRoutes: [], - cliRegistrars: [], - services: [], - diagnostics: [], -}); - const createStubChannelPlugin = (params: { id: ChannelPlugin["id"]; label: string; diff --git a/src/gateway/server.e2e-registry-helpers.ts b/src/gateway/server.e2e-registry-helpers.ts new file mode 100644 index 00000000000..148d3fe8227 --- /dev/null +++ b/src/gateway/server.e2e-registry-helpers.ts @@ -0,0 +1,17 @@ +import type { PluginRegistry } from "../plugins/registry.js"; + +export const createRegistry = (channels: PluginRegistry["channels"]): PluginRegistry => ({ + plugins: [], + tools: [], + hooks: [], + typedHooks: [], + channels, + providers: [], + gatewayHandlers: {}, + httpHandlers: [], + httpRoutes: [], + cliRegistrars: [], + services: [], + commands: [], + diagnostics: [], +}); diff --git a/src/gateway/server.models-voicewake-misc.e2e.test.ts b/src/gateway/server.models-voicewake-misc.e2e.test.ts index 27ae4237a5d..03a0c15bc14 100644 --- a/src/gateway/server.models-voicewake-misc.e2e.test.ts +++ b/src/gateway/server.models-voicewake-misc.e2e.test.ts @@ -12,6 +12,7 @@ import { GatewayLockError } from "../infra/gateway-lock.js"; import { getActivePluginRegistry, setActivePluginRegistry } from "../plugins/runtime.js"; import { createOutboundTestPlugin } from "../test-utils/channel-plugins.js"; import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js"; +import { createRegistry } from "./server.e2e-registry-helpers.js"; import { connectOk, getFreePort, @@ -67,19 +68,6 @@ const whatsappPlugin = createOutboundTestPlugin({ label: "WhatsApp", }); -const createRegistry = (channels: PluginRegistry["channels"]): PluginRegistry => ({ - plugins: [], - tools: [], - channels, - providers: [], - gatewayHandlers: {}, - httpHandlers: [], - httpRoutes: [], - cliRegistrars: [], - services: [], - diagnostics: [], -}); - const whatsappRegistry = createRegistry([ { pluginId: "whatsapp",