|
1 | 1 | import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; |
| 2 | +import type { ChannelRuntimeSurface } from "../channels/plugins/channel-runtime-surface.types.js"; |
2 | 3 | import { type ChannelId, type ChannelPlugin } from "../channels/plugins/types.js"; |
3 | 4 | import { |
4 | 5 | createSubsystemLogger, |
@@ -110,8 +111,8 @@ function installTestRegistry(...plugins: ChannelPlugin<TestAccount>[]) { |
110 | 111 | } |
111 | 112 |
|
112 | 113 | function createManager(options?: { |
113 | | - channelRuntime?: PluginRuntime["channel"]; |
114 | | - resolveChannelRuntime?: () => PluginRuntime["channel"]; |
| 114 | + channelRuntime?: ChannelRuntimeSurface; |
| 115 | + resolveChannelRuntime?: () => ChannelRuntimeSurface; |
115 | 116 | loadConfig?: () => Record<string, unknown>; |
116 | 117 | channelIds?: ChannelId[]; |
117 | 118 | }) { |
@@ -224,8 +225,8 @@ describe("server-channels auto restart", () => { |
224 | 225 | const channelRuntime = { |
225 | 226 | ...createRuntimeChannel(), |
226 | 227 | marker: "channel-runtime", |
227 | | - } as PluginRuntime["channel"] & { marker: string }; |
228 | | - const startAccount = vi.fn(async (_ctx: { channelRuntime?: PluginRuntime["channel"] }) => {}); |
| 228 | + } as ChannelRuntimeSurface & { marker: string }; |
| 229 | + const startAccount = vi.fn(async (_ctx: { channelRuntime?: ChannelRuntimeSurface }) => {}); |
229 | 230 |
|
230 | 231 | installTestRegistry(createTestPlugin({ startAccount })); |
231 | 232 | const manager = createManager({ channelRuntime }); |
@@ -287,9 +288,9 @@ describe("server-channels auto restart", () => { |
287 | 288 | const channelRuntime = { |
288 | 289 | ...createRuntimeChannel(), |
289 | 290 | marker: "lazy-channel-runtime", |
290 | | - } as PluginRuntime["channel"] & { marker: string }; |
| 291 | + } as ChannelRuntimeSurface & { marker: string }; |
291 | 292 | const resolveChannelRuntime = vi.fn(() => channelRuntime); |
292 | | - const startAccount = vi.fn(async (_ctx: { channelRuntime?: PluginRuntime["channel"] }) => {}); |
| 293 | + const startAccount = vi.fn(async (_ctx: { channelRuntime?: ChannelRuntimeSurface }) => {}); |
293 | 294 |
|
294 | 295 | installTestRegistry(createTestPlugin({ startAccount })); |
295 | 296 | const manager = createManager({ resolveChannelRuntime }); |
@@ -336,7 +337,7 @@ describe("server-channels auto restart", () => { |
336 | 337 | }, |
337 | 338 | }; |
338 | 339 | const startAccount = vi.fn( |
339 | | - async ({ channelRuntime }: { channelRuntime?: PluginRuntime["channel"] }) => { |
| 340 | + async ({ channelRuntime }: { channelRuntime?: ChannelRuntimeSurface }) => { |
340 | 341 | channelRuntime?.runtimeContexts.register({ |
341 | 342 | channelId: "discord", |
342 | 343 | accountId: DEFAULT_ACCOUNT_ID, |
|
0 commit comments