diff --git a/extensions/zalouser/src/channel-api.ts b/extensions/zalouser/src/channel-api.ts new file mode 100644 index 00000000000..da37d0e8544 --- /dev/null +++ b/extensions/zalouser/src/channel-api.ts @@ -0,0 +1,23 @@ +export { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from"; +export type { + ChannelAccountSnapshot, + ChannelDirectoryEntry, + ChannelGroupContext, + ChannelMessageActionAdapter, +} from "openclaw/plugin-sdk/channel-contract"; +export { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-plugin-common"; +export type { ChannelPlugin } from "openclaw/plugin-sdk/core"; +export { + DEFAULT_ACCOUNT_ID, + normalizeAccountId, + type OpenClawConfig, +} from "openclaw/plugin-sdk/core"; +export { + isDangerousNameMatchingEnabled, + type GroupToolPolicyConfig, +} from "openclaw/plugin-sdk/config-runtime"; +export { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking"; +export { + isNumericTargetId, + sendPayloadWithChunkedTextAndMedia, +} from "openclaw/plugin-sdk/reply-payload"; diff --git a/extensions/zalouser/src/channel.setup.ts b/extensions/zalouser/src/channel.setup.ts index 7373b10977a..0e1df1c1711 100644 --- a/extensions/zalouser/src/channel.setup.ts +++ b/extensions/zalouser/src/channel.setup.ts @@ -1,5 +1,5 @@ -import type { ChannelPlugin } from "../runtime-api.js"; import type { ResolvedZalouserAccount } from "./accounts.js"; +import type { ChannelPlugin } from "./channel-api.js"; import { zalouserSetupAdapter } from "./setup-core.js"; import { zalouserSetupWizard } from "./setup-surface.js"; import { createZalouserPluginBase } from "./shared.js"; diff --git a/extensions/zalouser/src/channel.ts b/extensions/zalouser/src/channel.ts index f70f1d96cfc..91719a64806 100644 --- a/extensions/zalouser/src/channel.ts +++ b/extensions/zalouser/src/channel.ts @@ -12,23 +12,6 @@ import { createAsyncComputedAccountStatusAdapter, createDefaultChannelRuntimeState, } from "openclaw/plugin-sdk/status-helpers"; -import type { - ChannelAccountSnapshot, - ChannelDirectoryEntry, - ChannelGroupContext, - ChannelMessageActionAdapter, - ChannelPlugin, - OpenClawConfig, - GroupToolPolicyConfig, -} from "../runtime-api.js"; -import { - DEFAULT_ACCOUNT_ID, - chunkTextForOutbound, - isDangerousNameMatchingEnabled, - isNumericTargetId, - normalizeAccountId, - sendPayloadWithChunkedTextAndMedia, -} from "../runtime-api.js"; import { listZalouserAccountIds, resolveDefaultZalouserAccountId, @@ -37,6 +20,23 @@ import { checkZcaAuthenticated, type ResolvedZalouserAccount, } from "./accounts.js"; +import type { + ChannelAccountSnapshot, + ChannelDirectoryEntry, + ChannelGroupContext, + ChannelMessageActionAdapter, + ChannelPlugin, + OpenClawConfig, + GroupToolPolicyConfig, +} from "./channel-api.js"; +import { + DEFAULT_ACCOUNT_ID, + chunkTextForOutbound, + isDangerousNameMatchingEnabled, + isNumericTargetId, + normalizeAccountId, + sendPayloadWithChunkedTextAndMedia, +} from "./channel-api.js"; import { buildZalouserGroupCandidates, findZalouserGroupEntry } from "./group-policy.js"; import { resolveZalouserReactionMessageIds } from "./message-sid.js"; import { probeZalouser, type ZalouserProbeResult } from "./probe.js"; @@ -184,7 +184,9 @@ const zalouserMessageActions: ChannelMessageActionAdapter = { const accounts = accountId ? [resolveZalouserAccountSync({ cfg, accountId })].filter((account) => account.enabled) : listZalouserAccountIds(cfg) - .map((resolvedAccountId) => resolveZalouserAccountSync({ cfg, accountId: resolvedAccountId })) + .map((resolvedAccountId) => + resolveZalouserAccountSync({ cfg, accountId: resolvedAccountId }), + ) .filter((account) => account.enabled); if (accounts.length === 0) { return null; diff --git a/extensions/zalouser/src/shared.ts b/extensions/zalouser/src/shared.ts index 9aa71ee66fc..b855250a94e 100644 --- a/extensions/zalouser/src/shared.ts +++ b/extensions/zalouser/src/shared.ts @@ -3,8 +3,6 @@ import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter, } from "openclaw/plugin-sdk/channel-config-helpers"; -import type { ChannelPlugin } from "../runtime-api.js"; -import { buildChannelConfigSchema, formatAllowFromLowercase } from "../runtime-api.js"; import { listZalouserAccountIds, resolveDefaultZalouserAccountId, @@ -12,6 +10,8 @@ import { checkZcaAuthenticated, type ResolvedZalouserAccount, } from "./accounts.js"; +import type { ChannelPlugin } from "./channel-api.js"; +import { buildChannelConfigSchema, formatAllowFromLowercase } from "./channel-api.js"; import { ZalouserConfigSchema } from "./config-schema.js"; import { zalouserDoctor } from "./doctor.js";