File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { PluginRuntime } from "openclaw/plugin-sdk" ;
22
33let runtime : PluginRuntime | null = null ;
4+ type LegacyRuntimeLogShape = { log ?: ( message : string ) => void } ;
45
56export function setBlueBubblesRuntime ( next : PluginRuntime ) : void {
67 runtime = next ;
@@ -23,7 +24,8 @@ export function getBlueBubblesRuntime(): PluginRuntime {
2324
2425export function warnBlueBubbles ( message : string ) : void {
2526 const formatted = `[bluebubbles] ${ message } ` ;
26- const log = runtime ?. log ;
27+ // Backward-compatible with tests/legacy injections that pass { log }.
28+ const log = ( runtime as unknown as LegacyRuntimeLogShape | null ) ?. log ;
2729 if ( typeof log === "function" ) {
2830 log ( formatted ) ;
2931 return ;
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ import type { Mock } from "vitest";
22import { afterEach , beforeEach , vi } from "vitest" ;
33
44export const BLUE_BUBBLES_PRIVATE_API_STATUS = {
5- enabled : true as const ,
6- disabled : false as const ,
7- unknown : null as const ,
8- } ;
5+ enabled : true ,
6+ disabled : false ,
7+ unknown : null ,
8+ } as const ;
99
1010type BlueBubblesPrivateApiStatusMock = {
1111 mockReturnValue : ( value : boolean | null ) => unknown ;
@@ -47,13 +47,15 @@ export function createBlueBubblesAccountsMockModule() {
4747
4848type BlueBubblesProbeMockModule = {
4949 getCachedBlueBubblesPrivateApiStatus : Mock < ( ) => boolean | null > ;
50+ isBlueBubblesPrivateApiStatusEnabled : Mock < ( status : boolean | null ) => boolean > ;
5051} ;
5152
5253export function createBlueBubblesProbeMockModule ( ) : BlueBubblesProbeMockModule {
5354 return {
5455 getCachedBlueBubblesPrivateApiStatus : vi
5556 . fn ( )
5657 . mockReturnValue ( BLUE_BUBBLES_PRIVATE_API_STATUS . unknown ) ,
58+ isBlueBubblesPrivateApiStatusEnabled : vi . fn ( ( status : boolean | null ) => status === true ) ,
5759 } ;
5860}
5961
Original file line number Diff line number Diff line change @@ -225,9 +225,7 @@ export const feishuPlugin: ChannelPlugin<ResolvedFeishuAccount> = {
225225 collectWarnings : ( { cfg, accountId } ) => {
226226 const account = resolveFeishuAccount ( { cfg, accountId } ) ;
227227 const feishuCfg = account . config ;
228- const defaultGroupPolicy = (
229- cfg . channels as Record < string , { groupPolicy ?: string } > | undefined
230- ) ?. defaults ?. groupPolicy ;
228+ const defaultGroupPolicy = cfg . channels ?. defaults ?. groupPolicy ;
231229 const { groupPolicy } = resolveRuntimeGroupPolicy ( {
232230 providerConfigPresent : cfg . channels ?. feishu !== undefined ,
233231 groupPolicy : feishuCfg ?. groupPolicy ,
Original file line number Diff line number Diff line change @@ -162,8 +162,7 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
162162 } ;
163163 } ,
164164 collectWarnings : ( { account, cfg } ) => {
165- const defaultGroupPolicy = ( cfg . channels ?. defaults as { groupPolicy ?: string } | undefined )
166- ?. groupPolicy ;
165+ const defaultGroupPolicy = cfg . channels ?. defaults ?. groupPolicy ;
167166 const { groupPolicy } = resolveRuntimeGroupPolicy ( {
168167 providerConfigPresent : cfg . channels ?. line !== undefined ,
169168 groupPolicy : account . config . groupPolicy ,
You can’t perform that action at this time.
0 commit comments