refactor(zalo): narrow action runtime imports

This commit is contained in:
Vincent Koc 2026-04-04 03:03:00 +09:00
parent 0ba93afda9
commit abc3f27ba9
1 changed files with 9 additions and 8 deletions

View File

@ -1,11 +1,12 @@
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
import { listEnabledZaloAccounts, resolveZaloAccount } from "./accounts.js";
import { jsonResult, readStringParam } from "openclaw/plugin-sdk/channel-actions";
import type {
ChannelMessageActionAdapter,
ChannelMessageActionName,
OpenClawConfig,
} from "./runtime-api.js";
import { extractToolSend, jsonResult, readStringParam } from "./runtime-api.js";
} from "openclaw/plugin-sdk/channel-contract";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
import { listEnabledZaloAccounts, resolveZaloAccount } from "./accounts.js";
const loadZaloActionsRuntime = createLazyRuntimeNamedExport(
() => import("./actions.runtime.js"),
@ -15,9 +16,9 @@ const loadZaloActionsRuntime = createLazyRuntimeNamedExport(
const providerId = "zalo";
function listEnabledAccounts(cfg: OpenClawConfig, accountId?: string | null) {
return (accountId ? [resolveZaloAccount({ cfg, accountId })] : listEnabledZaloAccounts(cfg)).filter(
(account) => account.enabled && account.tokenSource !== "none",
);
return (
accountId ? [resolveZaloAccount({ cfg, accountId })] : listEnabledZaloAccounts(cfg)
).filter((account) => account.enabled && account.tokenSource !== "none");
}
export const zaloMessageActions: ChannelMessageActionAdapter = {