@@ -3,14 +3,15 @@ import os from "node:os";
33import path from "node:path" ;
44import type { ChannelAccountSnapshot } from "openclaw/plugin-sdk/channel-contract" ;
55import { MAX_TIMER_TIMEOUT_MS } from "openclaw/plugin-sdk/number-runtime" ;
6- import { afterEach , beforeAll , beforeEach , describe , expect , it , vi } from "vitest" ;
7- import { createChannelIngressQueue } from "../../../src/channels/message/ingress-queue.js" ;
8- import { executeSqliteQuerySync , getNodeSqliteKysely } from "../../../src/infra/kysely-sync.js" ;
9- import type { DB as OpenClawStateKyselyDatabase } from "../../../src/state/openclaw-state-db.generated.js" ;
106import {
117 closeOpenClawStateDatabaseForTest ,
8+ createChannelIngressQueueForTests as createChannelIngressQueue ,
9+ executeSqliteQuerySync ,
10+ getNodeSqliteKysely ,
1211 openOpenClawStateDatabase ,
13- } from "../../../src/state/openclaw-state-db.js" ;
12+ type OpenClawStateKyselyDatabaseForTests ,
13+ } from "openclaw/plugin-sdk/plugin-state-test-runtime" ;
14+ import { afterEach , beforeAll , beforeEach , describe , expect , it , vi } from "vitest" ;
1415import { clearTelegramRuntime , setTelegramRuntime } from "./runtime.js" ;
1516import type { TelegramRuntime } from "./runtime.types.js" ;
1617import type { TelegramIngressWorkerMessage } from "./telegram-ingress-worker.js" ;
@@ -105,7 +106,10 @@ type WorkerPollErrorListener = (message: {
105106type WorkerMessageListener = ( message : TelegramIngressWorkerMessage ) => void ;
106107type AsyncVoidFn = ( ) => Promise < void > ;
107108type MockCallSource = { mock : { calls : Array < Array < unknown > > } } ;
108- type TelegramPollingTestDatabase = Pick < OpenClawStateKyselyDatabase , "channel_ingress_events" > ;
109+ type TelegramPollingTestDatabase = Pick <
110+ OpenClawStateKyselyDatabaseForTests ,
111+ "channel_ingress_events"
112+ > ;
109113
110114const POLLING_TEST_WATCHDOG_INTERVAL_MS = 30_000 ;
111115
@@ -115,7 +119,7 @@ function installTelegramIngressQueueRuntime(resolveStateDir: () => string): void
115119 resolveStateDir,
116120 openChannelIngressQueue : (
117121 options ?: Omit < Parameters < typeof createChannelIngressQueue > [ 0 ] , "channelId" > ,
118- ) => createChannelIngressQueue ( { ...( options ?? { } ) , channelId : "telegram" } ) ,
122+ ) => createChannelIngressQueue ( { ...options , channelId : "telegram" } ) ,
119123 } ,
120124 } as TelegramRuntime ) ;
121125}
0 commit comments