11import { createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers" ;
2- import type { OpenClawConfig , ResolvedLineAccount } from "../api.js" ;
3- import { getLineRuntime } from "./runtime.js" ;
4-
5- function resolveLineRuntimeAccount ( cfg : OpenClawConfig , accountId ?: string | null ) {
6- return getLineRuntime ( ) . channel . line . resolveLineAccount ( {
7- cfg,
8- accountId : accountId ?? undefined ,
9- } ) ;
10- }
2+ import {
3+ listLineAccountIds ,
4+ resolveDefaultLineAccountId ,
5+ resolveLineAccount ,
6+ type OpenClawConfig ,
7+ type ResolvedLineAccount ,
8+ } from "../runtime-api.js" ;
119
1210export function normalizeLineAllowFrom ( entry : string ) : string {
1311 return entry . replace ( / ^ l i n e : (?: u s e r : ) ? / i, "" ) ;
@@ -19,9 +17,10 @@ export const lineConfigAdapter = createScopedChannelConfigAdapter<
1917 OpenClawConfig
2018> ( {
2119 sectionKey : "line" ,
22- listAccountIds : ( cfg ) => getLineRuntime ( ) . channel . line . listLineAccountIds ( cfg ) ,
23- resolveAccount : ( cfg , accountId ) => resolveLineRuntimeAccount ( cfg , accountId ) ,
24- defaultAccountId : ( cfg ) => getLineRuntime ( ) . channel . line . resolveDefaultLineAccountId ( cfg ) ,
20+ listAccountIds : listLineAccountIds ,
21+ resolveAccount : ( cfg , accountId ) =>
22+ resolveLineAccount ( { cfg, accountId : accountId ?? undefined } ) ,
23+ defaultAccountId : resolveDefaultLineAccountId ,
2524 clearBaseFields : [ "channelSecret" , "tokenFile" , "secretFile" ] ,
2625 resolveAllowFrom : ( account ) => account . config . allowFrom ,
2726 formatAllowFrom : ( allowFrom ) =>
0 commit comments