diff --git a/extensions/line/src/channel-api.ts b/extensions/line/src/channel-api.ts new file mode 100644 index 00000000000..08f23125101 --- /dev/null +++ b/extensions/line/src/channel-api.ts @@ -0,0 +1,22 @@ +import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/account-resolution"; +import type { ChannelPlugin } from "openclaw/plugin-sdk/core"; +import { + listLineAccountIds, + normalizeAccountId, + resolveDefaultLineAccountId, + resolveLineAccount, +} from "./accounts.js"; +import { resolveExactLineGroupConfigKey } from "./group-keys.js"; +import type { ResolvedLineAccount } from "./types.js"; + +export { + DEFAULT_ACCOUNT_ID, + listLineAccountIds, + normalizeAccountId, + resolveDefaultLineAccountId, + resolveExactLineGroupConfigKey, + resolveLineAccount, +}; + +export type { ChannelPlugin, OpenClawConfig, ResolvedLineAccount }; diff --git a/extensions/line/src/channel-shared.ts b/extensions/line/src/channel-shared.ts index da2212db879..ef6435b9cee 100644 --- a/extensions/line/src/channel-shared.ts +++ b/extensions/line/src/channel-shared.ts @@ -1,11 +1,13 @@ import { describeWebhookAccountSnapshot } from "openclaw/plugin-sdk/account-helpers"; -import type { ChannelPlugin } from "../api.js"; +import { hasLineCredentials, parseLineAllowFromId } from "./account-helpers.js"; import { + DEFAULT_ACCOUNT_ID, + normalizeAccountId, resolveLineAccount, + type ChannelPlugin, type OpenClawConfig, type ResolvedLineAccount, -} from "../runtime-api.js"; -import { hasLineCredentials, parseLineAllowFromId } from "./account-helpers.js"; +} from "./channel-api.js"; import { lineConfigAdapter } from "./config-adapter.js"; import { LineChannelConfigSchema } from "./config-schema.js"; @@ -56,5 +58,4 @@ export function isLineConfigured(cfg: OpenClawConfig, accountId: string): boolea return hasLineCredentials(resolveLineAccount({ cfg, accountId })); } -export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../runtime-api.js"; export { parseLineAllowFromId }; diff --git a/extensions/line/src/channel.ts b/extensions/line/src/channel.ts index 4a13c70da3c..33a9dd13a31 100644 --- a/extensions/line/src/channel.ts +++ b/extensions/line/src/channel.ts @@ -2,8 +2,8 @@ import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing import { createRestrictSendersChannelSecurity } from "openclaw/plugin-sdk/channel-policy"; import { createChatChannelPlugin } from "openclaw/plugin-sdk/core"; import { createEmptyChannelDirectoryAdapter } from "openclaw/plugin-sdk/directory-runtime"; -import { type ChannelPlugin, type ResolvedLineAccount } from "../api.js"; import { resolveLineAccount } from "./accounts.js"; +import { type ChannelPlugin, type ResolvedLineAccount } from "./channel-api.js"; import { lineChannelPluginCommon } from "./channel-shared.js"; import { lineGatewayAdapter } from "./gateway.js"; import { resolveLineGroupRequireMention } from "./group-policy.js"; diff --git a/extensions/line/src/config-adapter.ts b/extensions/line/src/config-adapter.ts index 1b10989b45c..4bc8c4cb523 100644 --- a/extensions/line/src/config-adapter.ts +++ b/extensions/line/src/config-adapter.ts @@ -5,7 +5,7 @@ import { resolveLineAccount, type OpenClawConfig, type ResolvedLineAccount, -} from "../runtime-api.js"; +} from "./channel-api.js"; export function normalizeLineAllowFrom(entry: string): string { return entry.replace(/^line:(?:user:)?/i, ""); diff --git a/extensions/line/src/group-policy.ts b/extensions/line/src/group-policy.ts index eaf30e04cf7..80855a5bf94 100644 --- a/extensions/line/src/group-policy.ts +++ b/extensions/line/src/group-policy.ts @@ -1,5 +1,5 @@ import { resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy"; -import { resolveExactLineGroupConfigKey, type OpenClawConfig } from "../runtime-api.js"; +import { resolveExactLineGroupConfigKey, type OpenClawConfig } from "./channel-api.js"; type LineGroupContext = { cfg: OpenClawConfig;