refactor(line): narrow channel runtime imports

This commit is contained in:
Vincent Koc 2026-04-04 11:58:58 +09:00
parent e9d802c32b
commit 0737816010
5 changed files with 30 additions and 7 deletions

View File

@ -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 };

View File

@ -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 };

View File

@ -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";

View File

@ -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, "");

View File

@ -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;