@openclaw/zalo 2026.9.2 → 2026.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { t as sendMessageZalo } from "./send-w8RLKyQx.js";
1
+ import { t as sendMessageZalo } from "./send-CIMDH1gH.js";
2
2
  //#region extensions/zalo/src/actions.runtime.ts
3
3
  const zaloActionsRuntime = { sendMessageZalo };
4
4
  //#endregion
package/dist/api.js CHANGED
@@ -1,5 +1,5 @@
1
- import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "./setup-core-DgD3ai3p.js";
2
- import { t as zaloPlugin } from "./channel-hG8iBI_S.js";
1
+ import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "./setup-core-CCMLSh4Q.js";
2
+ import { t as zaloPlugin } from "./channel-mgXGK008.js";
3
3
  import { n as resolveZaloRuntimeGroupPolicy } from "./group-access-8qHRzDHx.js";
4
4
  import { zaloSetupWizard } from "./setup-api.js";
5
5
  export { createZaloSetupWizardProxy, resolveZaloRuntimeGroupPolicy, zaloDmPolicy, zaloPlugin, zaloSetupAdapter, zaloSetupWizard };
@@ -1,4 +1,4 @@
1
- import { c as inspectZaloAccount, d as resolveDefaultZaloAccountId, f as resolveZaloAccount, i as zaloSetupContract, l as isZaloAccountConfigured, m as buildSecretInputSchema, t as createZaloSetupWizardProxy, u as listZaloAccountIds } from "./setup-core-DgD3ai3p.js";
1
+ import { c as isZaloAccountConfigured, d as resolveZaloAccount, i as zaloSetupContract, l as listZaloAccountIds, p as buildSecretInputSchema, s as inspectZaloAccount, t as createZaloSetupWizardProxy, u as resolveDefaultZaloAccountId } from "./setup-core-CCMLSh4Q.js";
2
2
  import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-Cpsqe5Cv.js";
3
3
  import { describeWebhookAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
4
4
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
@@ -8,7 +8,7 @@ import { buildChannelConfigSchema, createChatChannelPlugin } from "openclaw/plug
8
8
  import { defineChannelMessageAdapter } from "openclaw/plugin-sdk/channel-outbound";
9
9
  import { buildOpenGroupPolicyRestrictSendersWarning, buildOpenGroupPolicyWarning, createConditionalWarningCollector, createOpenProviderGroupPolicyWarningCollector } from "openclaw/plugin-sdk/channel-policy";
10
10
  import { createAttachedChannelResultAdapter, createEmptyChannelResult } from "openclaw/plugin-sdk/channel-send-result";
11
- import { buildTokenChannelStatusSummary } from "openclaw/plugin-sdk/channel-status";
11
+ import { PAIRING_APPROVED_MESSAGE, buildTokenChannelStatusSummary } from "openclaw/plugin-sdk/channel-status";
12
12
  import { createStaticReplyToModeResolver } from "openclaw/plugin-sdk/conversation-runtime";
13
13
  import { createChannelDirectoryAdapter, listResolvedDirectoryUserEntriesFromAllowFrom } from "openclaw/plugin-sdk/directory-runtime";
14
14
  import { createLazyRuntimeModule, createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
@@ -24,7 +24,7 @@ import { z } from "zod";
24
24
  import { buildChannelOutboundSessionRoute, stripChannelTargetPrefix, stripTargetKindPrefix } from "openclaw/plugin-sdk/core";
25
25
  import { coerceStatusIssueAccountId, readStatusIssueFields } from "openclaw/plugin-sdk/extension-shared";
26
26
  //#region extensions/zalo/src/actions.ts
27
- const loadZaloActionsRuntime = createLazyRuntimeNamedExport(() => import("./actions.runtime-Bw8qKwdO.js"), "zaloActionsRuntime");
27
+ const loadZaloActionsRuntime = createLazyRuntimeNamedExport(() => import("./actions.runtime-2MsIGd0H.js"), "zaloActionsRuntime");
28
28
  const providerId = "zalo";
29
29
  const ZALO_ACTIONS = /* @__PURE__ */ new Set(["send"]);
30
30
  function listEnabledAccounts(cfg, accountId) {
@@ -186,8 +186,8 @@ function looksLikeZaloChatId(raw, normalized) {
186
186
  const target = normalizeZaloMessagingTarget(normalized ?? raw);
187
187
  return Boolean(target);
188
188
  }
189
- const loadZaloChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-jqx3Fyja.js"));
190
- const zaloSetupWizard = createZaloSetupWizardProxy(async () => (await import("./setup-surface-D5xgPinc.js").then((n) => n.t)).zaloSetupWizard);
189
+ const loadZaloChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-aikbF-5l.js"));
190
+ const zaloSetupWizard = createZaloSetupWizardProxy(async () => (await import("./setup-surface--Y84d_LY.js").then((n) => n.t)).zaloSetupWizard);
191
191
  const zaloTextChunkLimit = 2e3;
192
192
  async function sendZaloDelivery(ctx) {
193
193
  const result = await (await loadZaloChannelRuntime()).sendZaloText({
@@ -362,9 +362,15 @@ const zaloPlugin = createChatChannelPlugin({
362
362
  },
363
363
  pairing: { text: {
364
364
  idLabel: "zaloUserId",
365
- message: "Your pairing request has been approved.",
365
+ message: PAIRING_APPROVED_MESSAGE,
366
366
  normalizeAllowEntry: (entry) => entry.trim().replace(/^(zalo|zl):/i, ""),
367
- notify: async (params) => await (await loadZaloChannelRuntime()).notifyZaloPairingApproval(params)
367
+ notify: async (params) => {
368
+ await sendZaloDelivery({
369
+ ...params,
370
+ to: params.id,
371
+ text: params.message
372
+ });
373
+ }
368
374
  } },
369
375
  threading: { resolveReplyToMode: createStaticReplyToModeResolver("off") },
370
376
  outbound: {
@@ -1,2 +1,2 @@
1
- import { t as zaloPlugin } from "./channel-hG8iBI_S.js";
1
+ import { t as zaloPlugin } from "./channel-mgXGK008.js";
2
2
  export { zaloPlugin };
@@ -1,6 +1,5 @@
1
- import { h as normalizeSecretInputString } from "./setup-core-DgD3ai3p.js";
2
- import { n as PAIRING_APPROVED_MESSAGE } from "./runtime-api-CN6fYNQK.js";
3
- import { a as getMe, n as resolveZaloProxyFetch, r as ZaloApiError, t as sendMessageZalo } from "./send-w8RLKyQx.js";
1
+ import { m as normalizeSecretInputString } from "./setup-core-CCMLSh4Q.js";
2
+ import { a as getMe, n as resolveZaloProxyFetch, r as ZaloApiError, t as sendMessageZalo } from "./send-CIMDH1gH.js";
4
3
  import { createAccountStatusSink } from "openclaw/plugin-sdk/channel-outbound";
5
4
  import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
6
5
  //#region extensions/zalo/src/probe.ts
@@ -34,12 +33,6 @@ async function probeZalo(token, timeoutMs = 5e3, fetcher) {
34
33
  }
35
34
  //#endregion
36
35
  //#region extensions/zalo/src/channel.runtime.ts
37
- async function notifyZaloPairingApproval(params) {
38
- const { resolveZaloAccount } = await import("./setup-core-DgD3ai3p.js").then((n) => n.s);
39
- const account = resolveZaloAccount({ cfg: params.cfg });
40
- if (!account.token) throw new Error("Zalo token not configured");
41
- await sendMessageZalo(params.id, PAIRING_APPROVED_MESSAGE, { token: account.token });
42
- }
43
36
  async function sendZaloText(params) {
44
37
  return await sendMessageZalo(params.to, params.text, params);
45
38
  }
@@ -69,7 +62,7 @@ async function startZaloGatewayAccount(ctx) {
69
62
  setStatus: ctx.setStatus
70
63
  });
71
64
  ctx.log?.info(`[${account.accountId}] starting provider${zaloBotLabel} mode=${mode}`);
72
- const { monitorZaloProvider } = await import("./monitor-0WIjv0t5.js");
65
+ const { monitorZaloProvider } = await import("./monitor-CXlZtCk9.js");
73
66
  return monitorZaloProvider({
74
67
  token,
75
68
  account,
@@ -85,4 +78,4 @@ async function startZaloGatewayAccount(ctx) {
85
78
  });
86
79
  }
87
80
  //#endregion
88
- export { notifyZaloPairingApproval, probeZaloAccount, sendZaloText, startZaloGatewayAccount };
81
+ export { probeZaloAccount, sendZaloText, startZaloGatewayAccount };
@@ -1,6 +1,6 @@
1
1
  import { n as resolveZaloRuntimeGroupPolicy, t as normalizeZaloAllowEntry } from "./group-access-8qHRzDHx.js";
2
- import { X as getZaloRuntime } from "./runtime-api-CN6fYNQK.js";
3
- import { c as sendChatAction, d as setWebhook, f as ZALO_OUTBOUND_MEDIA_TTL_MS, i as deleteWebhook, l as sendMessage, n as resolveZaloProxyFetch, o as getUpdates, r as ZaloApiError, s as getWebhookInfo, u as sendPhoto } from "./send-w8RLKyQx.js";
2
+ import { t as getZaloRuntime } from "./runtime-Dfhzt7qb.js";
3
+ import { c as sendChatAction, d as setWebhook, f as ZALO_OUTBOUND_MEDIA_TTL_MS, i as deleteWebhook, l as sendMessage, n as resolveZaloProxyFetch, o as getUpdates, r as ZaloApiError, s as getWebhookInfo, u as sendPhoto } from "./send-CIMDH1gH.js";
4
4
  import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
5
5
  import { createLazyRuntimeModule, createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
6
6
  import { deliverTextOrMediaReply, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
@@ -173,8 +173,8 @@ function resolveZaloTimestampMs(date) {
173
173
  if (!date) return;
174
174
  return date >= UNIX_MILLISECONDS_THRESHOLD ? date : date * 1e3;
175
175
  }
176
- const loadZaloWebhookRuntime = createLazyRuntimeNamedExport(() => import("./monitor.webhook-B5RaWvFf.js"), "zaloWebhookRuntime");
177
- const loadZaloWebhookIngressRuntime = createLazyRuntimeNamedExport(() => import("./webhook-spool-2fDB_7Qy.js"), "zaloWebhookIngressRuntime");
176
+ const loadZaloWebhookRuntime = createLazyRuntimeNamedExport(() => import("./monitor.webhook-DOCUBaE5.js"), "zaloWebhookRuntime");
177
+ const loadZaloWebhookIngressRuntime = createLazyRuntimeNamedExport(() => import("./webhook-spool-CPxf_Kwe.js"), "zaloWebhookIngressRuntime");
178
178
  const loadZaloWebhookModule = createLazyRuntimeModule(async () => ({
179
179
  ...await loadZaloWebhookRuntime(),
180
180
  ...await loadZaloWebhookIngressRuntime()
@@ -1,5 +1,5 @@
1
- import { L as registerWebhookTarget, R as registerWebhookTargetWithPluginRoute, U as resolveWebhookTargetWithAuthOrRejectSync, Y as withResolvedWebhookRequestPipeline, i as WEBHOOK_RATE_LIMIT_DEFAULTS, r as WEBHOOK_ANOMALY_COUNTER_DEFAULTS, s as applyBasicWebhookRequestGuards, v as createFixedWindowRateLimiter, y as createWebhookAnomalyTracker, z as resolveClientIp } from "./runtime-api-CN6fYNQK.js";
2
- import { ZaloWebhookPayloadError } from "./webhook-spool-2fDB_7Qy.js";
1
+ import { WEBHOOK_ANOMALY_COUNTER_DEFAULTS, WEBHOOK_RATE_LIMIT_DEFAULTS, applyBasicWebhookRequestGuards, createFixedWindowRateLimiter, createWebhookAnomalyTracker, registerWebhookTarget, registerWebhookTargetWithPluginRoute, resolveClientIp, resolveWebhookTargetWithAuthOrRejectSync, withResolvedWebhookRequestPipeline } from "./runtime-api.js";
2
+ import { ZaloWebhookPayloadError } from "./webhook-spool-CPxf_Kwe.js";
3
3
  import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
4
4
  import { readWebhookBodyOrReject } from "openclaw/plugin-sdk/webhook-request-guards";
5
5
  //#region extensions/zalo/src/monitor.webhook.ts
@@ -0,0 +1,8 @@
1
+ import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
2
+ //#region extensions/zalo/src/runtime.ts
3
+ const { setRuntime: setZaloRuntime, getRuntime: getZaloRuntime } = createPluginRuntimeStore({
4
+ pluginId: "zalo",
5
+ errorMessage: "Zalo runtime not initialized"
6
+ });
7
+ //#endregion
8
+ export { setZaloRuntime as n, getZaloRuntime as t };
@@ -1,2 +1,16 @@
1
- import { A as normalizeAccountId, B as resolveDefaultGroupPolicy, C as hasConfiguredSecretInput, D as logTypingFailure, E as jsonResult, F as readStringParam, G as sendPayloadWithChunkedTextAndMedia, H as resolveWebhookPath, I as registerPluginHttpRoute, J as warnMissingProviderGroupPolicyFallbackOnce, K as setTopLevelChannelDmPolicyWithAllowFrom, L as registerWebhookTarget, M as normalizeSecretInputString, N as promptSingleChannelSecretInput, O as mergeAllowFromEntries, P as readJsonWebhookBodyOrReject, R as registerWebhookTargetWithPluginRoute, S as formatPairingApproveHint, T as isNumericTargetId, U as resolveWebhookTargetWithAuthOrRejectSync, V as resolveOpenProviderRuntimeGroupPolicy, W as runSingleChannelSecretStep, Y as withResolvedWebhookRequestPipeline, Z as setZaloRuntime, _ as createDedupeCache, a as addWildcardAllowFrom, b as deliverTextOrMediaReply, c as applySetupAccountConfigPatch, d as buildSecretInputSchema, f as buildSingleChannelSecretPromptState, g as createChannelPairingController, h as createChannelMessageReplyPipeline, i as WEBHOOK_RATE_LIMIT_DEFAULTS, j as normalizeResolvedSecretInputString, k as migrateBaseNameToDefaultAccount, l as buildBaseAccountStatusSnapshot, m as chunkTextForOutbound, n as PAIRING_APPROVED_MESSAGE, o as applyAccountNameToChannelSection, p as buildTokenChannelStatusSummary, q as waitForAbortSignal, r as WEBHOOK_ANOMALY_COUNTER_DEFAULTS, s as applyBasicWebhookRequestGuards, t as DEFAULT_ACCOUNT_ID, u as buildChannelConfigSchema, v as createFixedWindowRateLimiter, w as isNormalizedSenderAllowed, x as formatAllowFromLowercase, y as createWebhookAnomalyTracker, z as resolveClientIp } from "./runtime-api-CN6fYNQK.js";
1
+ import { n as setZaloRuntime } from "./runtime-Dfhzt7qb.js";
2
+ import { formatAllowFromLowercase, isNormalizedSenderAllowed } from "openclaw/plugin-sdk/allow-from";
3
+ import { createChannelMessageReplyPipeline } from "openclaw/plugin-sdk/channel-outbound";
4
+ import { PAIRING_APPROVED_MESSAGE, buildTokenChannelStatusSummary } from "openclaw/plugin-sdk/channel-status";
5
+ import { deliverTextOrMediaReply, isNumericTargetId, sendPayloadWithChunkedTextAndMedia } from "openclaw/plugin-sdk/reply-payload";
6
+ import { buildBaseAccountStatusSnapshot } from "openclaw/plugin-sdk/status-helpers";
7
+ import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
8
+ import { buildSecretInputSchema, hasConfiguredSecretInput, normalizeResolvedSecretInputString, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
9
+ import { DEFAULT_ACCOUNT_ID, buildChannelConfigSchema, createDedupeCache, formatPairingApproveHint, jsonResult, normalizeAccountId, readStringParam, resolveClientIp } from "openclaw/plugin-sdk/core";
10
+ import { addWildcardAllowFrom, applyAccountNameToChannelSection, applySetupAccountConfigPatch, buildSingleChannelSecretPromptState, mergeAllowFromEntries, migrateBaseNameToDefaultAccount, promptSingleChannelSecretInput, runSingleChannelSecretStep, setTopLevelChannelDmPolicyWithAllowFrom } from "openclaw/plugin-sdk/setup";
11
+ import { resolveDefaultGroupPolicy, resolveOpenProviderRuntimeGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
12
+ import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
13
+ import { logTypingFailure } from "openclaw/plugin-sdk/channel-feedback";
14
+ import { waitForAbortSignal } from "openclaw/plugin-sdk/runtime";
15
+ import { WEBHOOK_ANOMALY_COUNTER_DEFAULTS, WEBHOOK_RATE_LIMIT_DEFAULTS, applyBasicWebhookRequestGuards, createFixedWindowRateLimiter, createWebhookAnomalyTracker, readJsonWebhookBodyOrReject, registerPluginHttpRoute, registerWebhookTarget, registerWebhookTargetWithPluginRoute, resolveWebhookPath, resolveWebhookTargetWithAuthOrRejectSync, withResolvedWebhookRequestPipeline } from "openclaw/plugin-sdk/webhook-ingress";
2
16
  export { DEFAULT_ACCOUNT_ID, PAIRING_APPROVED_MESSAGE, WEBHOOK_ANOMALY_COUNTER_DEFAULTS, WEBHOOK_RATE_LIMIT_DEFAULTS, addWildcardAllowFrom, applyAccountNameToChannelSection, applyBasicWebhookRequestGuards, applySetupAccountConfigPatch, buildBaseAccountStatusSnapshot, buildChannelConfigSchema, buildSecretInputSchema, buildSingleChannelSecretPromptState, buildTokenChannelStatusSummary, chunkTextForOutbound, createChannelMessageReplyPipeline, createChannelPairingController, createDedupeCache, createFixedWindowRateLimiter, createWebhookAnomalyTracker, deliverTextOrMediaReply, formatAllowFromLowercase, formatPairingApproveHint, hasConfiguredSecretInput, isNormalizedSenderAllowed, isNumericTargetId, jsonResult, logTypingFailure, mergeAllowFromEntries, migrateBaseNameToDefaultAccount, normalizeAccountId, normalizeResolvedSecretInputString, normalizeSecretInputString, promptSingleChannelSecretInput, readJsonWebhookBodyOrReject, readStringParam, registerPluginHttpRoute, registerWebhookTarget, registerWebhookTargetWithPluginRoute, resolveClientIp, resolveDefaultGroupPolicy, resolveOpenProviderRuntimeGroupPolicy, resolveWebhookPath, resolveWebhookTargetWithAuthOrRejectSync, runSingleChannelSecretStep, sendPayloadWithChunkedTextAndMedia, setTopLevelChannelDmPolicyWithAllowFrom, setZaloRuntime, waitForAbortSignal, warnMissingProviderGroupPolicyFallbackOnce, withResolvedWebhookRequestPipeline };
@@ -1,4 +1,4 @@
1
- import { f as resolveZaloAccount, p as resolveZaloToken } from "./setup-core-DgD3ai3p.js";
1
+ import { d as resolveZaloAccount, f as resolveZaloToken } from "./setup-core-CCMLSh4Q.js";
2
2
  import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
3
3
  import { stripChannelTargetPrefix, stripTargetKindPrefix } from "openclaw/plugin-sdk/core";
4
4
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
package/dist/setup-api.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "./setup-core-DgD3ai3p.js";
1
+ import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "./setup-core-CCMLSh4Q.js";
2
2
  import { n as resolveZaloRuntimeGroupPolicy } from "./group-access-8qHRzDHx.js";
3
3
  import { loadBundledEntryExportSync } from "openclaw/plugin-sdk/channel-entry-contract";
4
4
  //#region extensions/zalo/setup-api.ts
@@ -6,19 +6,7 @@ import { tryReadSecretFileSync } from "openclaw/plugin-sdk/secret-file-runtime";
6
6
  import { buildSecretInputSchema, normalizeSecretInputString, resolveSecretInputString } from "openclaw/plugin-sdk/secret-input";
7
7
  import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
8
8
  import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
9
- import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, createDelegatedSetupWizardProxy, createPatchedAccountSetupAdapter, createSetupInputPresenceValidator, createSetupTranslator, formatDocsLink, mergeAllowFromEntries, normalizeAccountId as normalizeAccountId$1, patchScopedAccountConfig, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
10
- //#region \0rolldown/runtime.js
11
- var __defProp = Object.defineProperty;
12
- var __exportAll = (all, no_symbols) => {
13
- let target = {};
14
- for (var name in all) __defProp(target, name, {
15
- get: all[name],
16
- enumerable: true
17
- });
18
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
19
- return target;
20
- };
21
- //#endregion
9
+ import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, createDelegatedSetupWizardProxy, createPatchedAccountSetupAdapter, createSetupInputPresenceValidator, createSetupTranslator, formatDocsLink, mergeAllowFromEntries, normalizeAccountId as normalizeAccountId$1, patchScopedAccountConfig, patchTopLevelChannelConfigSection, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
22
10
  //#region extensions/zalo/src/token.ts
23
11
  function readTokenFromFile(tokenFile, configPath) {
24
12
  const result = tryReadSecretFileSync(tokenFile, "Zalo token file", { rejectSymlink: true }, { configPath });
@@ -91,13 +79,6 @@ function resolveZaloToken(config, accountId, options) {
91
79
  }
92
80
  //#endregion
93
81
  //#region extensions/zalo/src/accounts.ts
94
- var accounts_exports = /* @__PURE__ */ __exportAll({
95
- inspectZaloAccount: () => inspectZaloAccount,
96
- isZaloAccountConfigured: () => isZaloAccountConfigured,
97
- listZaloAccountIds: () => listZaloAccountIds,
98
- resolveDefaultZaloAccountId: () => resolveDefaultZaloAccountId,
99
- resolveZaloAccount: () => resolveZaloAccount
100
- });
101
82
  const { listAccountIds: listZaloAccountIds, resolveDefaultAccountId: resolveDefaultZaloAccountId, resolveAccountConfig: mergeZaloAccountConfig } = createAccountListHelpers("zalo", {
102
83
  omitKeys: ["defaultAccount"],
103
84
  implicitDefaultAccount: {
@@ -174,38 +155,24 @@ async function promptZaloAllowFrom(params) {
174
155
  }
175
156
  })).trim();
176
157
  const unique = mergeAllowFromEntries(existingAllowFrom, [normalized]);
177
- if (accountId === DEFAULT_ACCOUNT_ID$1) return {
178
- ...cfg,
179
- channels: {
180
- ...cfg.channels,
181
- zalo: {
182
- ...cfg.channels?.zalo,
183
- enabled: true,
158
+ const currentAccount = cfg.channels?.zalo?.accounts?.[accountId];
159
+ return patchTopLevelChannelConfigSection({
160
+ cfg,
161
+ channel: "zalo",
162
+ enabled: true,
163
+ patch: accountId === DEFAULT_ACCOUNT_ID$1 ? {
164
+ dmPolicy: "allowlist",
165
+ allowFrom: unique
166
+ } : { accounts: {
167
+ ...cfg.channels?.zalo?.accounts,
168
+ [accountId]: {
169
+ ...currentAccount,
170
+ enabled: currentAccount?.enabled ?? true,
184
171
  dmPolicy: "allowlist",
185
172
  allowFrom: unique
186
173
  }
187
- }
188
- };
189
- const currentAccount = cfg.channels?.zalo?.accounts?.[accountId];
190
- return {
191
- ...cfg,
192
- channels: {
193
- ...cfg.channels,
194
- zalo: {
195
- ...cfg.channels?.zalo,
196
- enabled: true,
197
- accounts: {
198
- ...cfg.channels?.zalo?.accounts,
199
- [accountId]: {
200
- ...currentAccount,
201
- enabled: currentAccount?.enabled ?? true,
202
- dmPolicy: "allowlist",
203
- allowFrom: unique
204
- }
205
- }
206
- }
207
- }
208
- };
174
+ } }
175
+ });
209
176
  }
210
177
  //#endregion
211
178
  //#region extensions/zalo/src/setup-core.ts
@@ -294,4 +261,4 @@ function createZaloSetupWizardProxy(loadWizard) {
294
261
  });
295
262
  }
296
263
  //#endregion
297
- export { noteZaloTokenHelp as a, inspectZaloAccount as c, resolveDefaultZaloAccountId as d, resolveZaloAccount as f, __exportAll as g, normalizeSecretInputString as h, zaloSetupContract as i, isZaloAccountConfigured as l, buildSecretInputSchema as m, zaloDmPolicy as n, promptZaloAllowFrom as o, resolveZaloToken as p, zaloSetupAdapter as r, accounts_exports as s, createZaloSetupWizardProxy as t, listZaloAccountIds as u };
264
+ export { noteZaloTokenHelp as a, isZaloAccountConfigured as c, resolveZaloAccount as d, resolveZaloToken as f, zaloSetupContract as i, listZaloAccountIds as l, normalizeSecretInputString as m, zaloDmPolicy as n, promptZaloAllowFrom as o, buildSecretInputSchema as p, zaloSetupAdapter as r, inspectZaloAccount as s, createZaloSetupWizardProxy as t, resolveDefaultZaloAccountId as u };
@@ -1,65 +1,49 @@
1
- import { a as noteZaloTokenHelp, c as inspectZaloAccount, g as __exportAll, n as zaloDmPolicy, o as promptZaloAllowFrom } from "./setup-core-DgD3ai3p.js";
2
- import { DEFAULT_ACCOUNT_ID, buildSingleChannelSecretPromptState, createSetupTranslator, createStandardChannelSetupStatus, hasConfiguredSecretInput, promptSingleChannelSecretInput, runSingleChannelSecretStep } from "openclaw/plugin-sdk/setup";
1
+ import { a as noteZaloTokenHelp, n as zaloDmPolicy, o as promptZaloAllowFrom, s as inspectZaloAccount } from "./setup-core-CCMLSh4Q.js";
2
+ import { DEFAULT_ACCOUNT_ID, buildSingleChannelSecretPromptState, createSetupTranslator, createStandardChannelSetupStatus, hasConfiguredSecretInput, patchTopLevelChannelConfigSection, promptSingleChannelSecretInput, runSingleChannelSecretStep } from "openclaw/plugin-sdk/setup";
3
+ //#region \0rolldown/runtime.js
4
+ var __defProp = Object.defineProperty;
5
+ var __exportAll = (all, no_symbols) => {
6
+ let target = {};
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
11
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
12
+ return target;
13
+ };
14
+ //#endregion
3
15
  //#region extensions/zalo/src/setup-surface.ts
4
16
  var setup_surface_exports = /* @__PURE__ */ __exportAll({ zaloSetupWizard: () => zaloSetupWizard });
5
17
  const t = createSetupTranslator();
6
18
  const channel = "zalo";
7
19
  function setZaloUpdateMode(cfg, accountId, mode, webhookUrl, webhookSecret, webhookPath) {
8
20
  const isDefault = accountId === DEFAULT_ACCOUNT_ID;
21
+ const next = { ...isDefault ? cfg.channels?.zalo : cfg.channels?.zalo?.accounts?.[accountId] };
9
22
  if (mode === "polling") {
10
- if (isDefault) {
11
- const { webhookUrl: _url, webhookSecret: _secret, webhookPath: _path, ...rest } = cfg.channels?.zalo ?? {};
12
- return {
13
- ...cfg,
14
- channels: {
15
- ...cfg.channels,
16
- zalo: rest
17
- }
18
- };
19
- }
23
+ delete next.webhookUrl;
24
+ delete next.webhookSecret;
25
+ delete next.webhookPath;
26
+ } else {
27
+ next.webhookUrl = webhookUrl;
28
+ next.webhookSecret = webhookSecret;
29
+ next.webhookPath = webhookPath;
30
+ }
31
+ let patch = next;
32
+ if (!isDefault) {
20
33
  const accounts = { ...cfg.channels?.zalo?.accounts };
21
- const { webhookUrl: _url, webhookSecret: _secret, webhookPath: _path, ...rest } = accounts[accountId] ?? {};
22
- accounts[accountId] = rest;
23
- return {
24
- ...cfg,
25
- channels: {
26
- ...cfg.channels,
27
- zalo: {
28
- ...cfg.channels?.zalo,
29
- accounts
30
- }
31
- }
32
- };
34
+ accounts[accountId] = next;
35
+ patch = { accounts };
33
36
  }
34
- if (isDefault) return {
35
- ...cfg,
36
- channels: {
37
- ...cfg.channels,
38
- zalo: {
39
- ...cfg.channels?.zalo,
40
- webhookUrl,
41
- webhookSecret,
42
- webhookPath
43
- }
44
- }
45
- };
46
- const accounts = { ...cfg.channels?.zalo?.accounts };
47
- accounts[accountId] = {
48
- ...accounts[accountId],
49
- webhookUrl,
50
- webhookSecret,
51
- webhookPath
52
- };
53
- return {
54
- ...cfg,
55
- channels: {
56
- ...cfg.channels,
57
- zalo: {
58
- ...cfg.channels?.zalo,
59
- accounts
60
- }
61
- }
62
- };
37
+ return patchTopLevelChannelConfigSection({
38
+ cfg,
39
+ channel,
40
+ clearFields: isDefault && mode === "polling" ? [
41
+ "webhookUrl",
42
+ "webhookSecret",
43
+ "webhookPath"
44
+ ] : void 0,
45
+ patch
46
+ });
63
47
  }
64
48
  const zaloSetupWizard = {
65
49
  channel,
@@ -105,44 +89,25 @@ const zaloSetupWizard = {
105
89
  inputPrompt: t("wizard.zalo.tokenInput"),
106
90
  preferredEnvVar: "ZALO_BOT_TOKEN",
107
91
  onMissingConfigured: async () => await noteZaloTokenHelp(prompter),
108
- applyUseEnv: async (currentCfg) => accountId === DEFAULT_ACCOUNT_ID ? {
109
- ...currentCfg,
110
- channels: {
111
- ...currentCfg.channels,
112
- zalo: {
113
- ...currentCfg.channels?.zalo,
114
- enabled: true
115
- }
116
- }
117
- } : currentCfg,
118
- applySet: async (currentCfg, value) => accountId === DEFAULT_ACCOUNT_ID ? {
119
- ...currentCfg,
120
- channels: {
121
- ...currentCfg.channels,
122
- zalo: {
123
- ...currentCfg.channels?.zalo,
92
+ applyUseEnv: async (currentCfg) => accountId === DEFAULT_ACCOUNT_ID ? patchTopLevelChannelConfigSection({
93
+ cfg: currentCfg,
94
+ channel,
95
+ enabled: true,
96
+ patch: {}
97
+ }) : currentCfg,
98
+ applySet: async (currentCfg, value) => patchTopLevelChannelConfigSection({
99
+ cfg: currentCfg,
100
+ channel,
101
+ enabled: true,
102
+ patch: accountId === DEFAULT_ACCOUNT_ID ? { botToken: value } : { accounts: {
103
+ ...currentCfg.channels?.zalo?.accounts,
104
+ [accountId]: {
105
+ ...currentCfg.channels?.zalo?.accounts?.[accountId],
124
106
  enabled: true,
125
107
  botToken: value
126
108
  }
127
- }
128
- } : {
129
- ...currentCfg,
130
- channels: {
131
- ...currentCfg.channels,
132
- zalo: {
133
- ...currentCfg.channels?.zalo,
134
- enabled: true,
135
- accounts: {
136
- ...currentCfg.channels?.zalo?.accounts,
137
- [accountId]: {
138
- ...currentCfg.channels?.zalo?.accounts?.[accountId],
139
- enabled: true,
140
- botToken: value
141
- }
142
- }
143
- }
144
- }
145
- }
109
+ } }
110
+ })
146
111
  })).cfg;
147
112
  if (await prompter.confirm({
148
113
  message: t("wizard.zalo.webhookModePrompt"),
@@ -1,3 +1,3 @@
1
- import { r as zaloSetupAdapter } from "./setup-core-DgD3ai3p.js";
2
- import { n as zaloSetupWizard } from "./setup-surface-D5xgPinc.js";
1
+ import { n as zaloSetupWizard } from "./setup-surface--Y84d_LY.js";
2
+ import { r as zaloSetupAdapter } from "./setup-core-CCMLSh4Q.js";
3
3
  export { zaloSetupAdapter, zaloSetupWizard };
@@ -1,5 +1,5 @@
1
- import { X as getZaloRuntime } from "./runtime-api-CN6fYNQK.js";
2
- import { r as ZaloApiError } from "./send-w8RLKyQx.js";
1
+ import { t as getZaloRuntime } from "./runtime-Dfhzt7qb.js";
2
+ import { r as ZaloApiError } from "./send-CIMDH1gH.js";
3
3
  import { DEFAULT_INGRESS_ADOPTION_STALL_MS, DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor } from "openclaw/plugin-sdk/channel-outbound";
4
4
  import { normalizeNullableString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { z } from "zod";
@@ -1,5 +1,8 @@
1
1
  {
2
2
  "id": "zalo",
3
+ "categories": [
4
+ "channels"
5
+ ],
3
6
  "doctorContract": {},
4
7
  "name": "Zalo",
5
8
  "description": "OpenClaw Zalo channel plugin for bot and webhook chats.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/zalo",
3
- "version": "2026.9.2",
3
+ "version": "2026.9.4",
4
4
  "description": "OpenClaw Zalo channel plugin for bot and webhook chats.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "type": "module",
10
10
  "peerDependencies": {
11
- "openclaw": ">=2026.9.2"
11
+ "openclaw": ">=2026.9.4"
12
12
  },
13
13
  "peerDependenciesMeta": {
14
14
  "openclaw": {
@@ -82,10 +82,10 @@
82
82
  "minHostVersion": ">=2026.4.10"
83
83
  },
84
84
  "compat": {
85
- "pluginApi": ">=2026.9.2"
85
+ "pluginApi": ">=2026.9.4"
86
86
  },
87
87
  "build": {
88
- "openclawVersion": "2026.9.2"
88
+ "openclawVersion": "2026.9.4"
89
89
  },
90
90
  "release": {
91
91
  "publishToClawHub": true,
@@ -1,22 +0,0 @@
1
- import { formatAllowFromLowercase as formatAllowFromLowercase$1, isNormalizedSenderAllowed } from "openclaw/plugin-sdk/allow-from";
2
- import { createChannelMessageReplyPipeline } from "openclaw/plugin-sdk/channel-outbound";
3
- import { PAIRING_APPROVED_MESSAGE, buildTokenChannelStatusSummary as buildTokenChannelStatusSummary$1 } from "openclaw/plugin-sdk/channel-status";
4
- import { deliverTextOrMediaReply as deliverTextOrMediaReply$1, isNumericTargetId, sendPayloadWithChunkedTextAndMedia as sendPayloadWithChunkedTextAndMedia$1 } from "openclaw/plugin-sdk/reply-payload";
5
- import { buildBaseAccountStatusSnapshot } from "openclaw/plugin-sdk/status-helpers";
6
- import { chunkTextForOutbound as chunkTextForOutbound$1 } from "openclaw/plugin-sdk/text-chunking";
7
- import { buildSecretInputSchema, hasConfiguredSecretInput as hasConfiguredSecretInput$1, normalizeResolvedSecretInputString, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
8
- import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, buildChannelConfigSchema, createDedupeCache, formatPairingApproveHint, jsonResult, normalizeAccountId as normalizeAccountId$1, readStringParam, resolveClientIp } from "openclaw/plugin-sdk/core";
9
- import { addWildcardAllowFrom, applyAccountNameToChannelSection, applySetupAccountConfigPatch, buildSingleChannelSecretPromptState as buildSingleChannelSecretPromptState$1, mergeAllowFromEntries as mergeAllowFromEntries$1, migrateBaseNameToDefaultAccount, promptSingleChannelSecretInput as promptSingleChannelSecretInput$1, runSingleChannelSecretStep as runSingleChannelSecretStep$1, setTopLevelChannelDmPolicyWithAllowFrom } from "openclaw/plugin-sdk/setup";
10
- import { resolveDefaultGroupPolicy as resolveDefaultGroupPolicy$1, resolveOpenProviderRuntimeGroupPolicy as resolveOpenProviderRuntimeGroupPolicy$1, warnMissingProviderGroupPolicyFallbackOnce as warnMissingProviderGroupPolicyFallbackOnce$1 } from "openclaw/plugin-sdk/runtime-group-policy";
11
- import { createChannelPairingController as createChannelPairingController$1 } from "openclaw/plugin-sdk/channel-pairing";
12
- import { logTypingFailure as logTypingFailure$1 } from "openclaw/plugin-sdk/channel-feedback";
13
- import { waitForAbortSignal } from "openclaw/plugin-sdk/runtime";
14
- import { WEBHOOK_ANOMALY_COUNTER_DEFAULTS, WEBHOOK_RATE_LIMIT_DEFAULTS, applyBasicWebhookRequestGuards, createFixedWindowRateLimiter, createWebhookAnomalyTracker, readJsonWebhookBodyOrReject, registerPluginHttpRoute as registerPluginHttpRoute$1, registerWebhookTarget, registerWebhookTargetWithPluginRoute, resolveWebhookPath as resolveWebhookPath$1, resolveWebhookTargetWithAuthOrRejectSync, withResolvedWebhookRequestPipeline } from "openclaw/plugin-sdk/webhook-ingress";
15
- import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
16
- //#region extensions/zalo/src/runtime.ts
17
- const { setRuntime: setZaloRuntime, getRuntime: getZaloRuntime } = createPluginRuntimeStore({
18
- pluginId: "zalo",
19
- errorMessage: "Zalo runtime not initialized"
20
- });
21
- //#endregion
22
- export { normalizeAccountId$1 as A, resolveDefaultGroupPolicy$1 as B, hasConfiguredSecretInput$1 as C, logTypingFailure$1 as D, jsonResult as E, readStringParam as F, sendPayloadWithChunkedTextAndMedia$1 as G, resolveWebhookPath$1 as H, registerPluginHttpRoute$1 as I, warnMissingProviderGroupPolicyFallbackOnce$1 as J, setTopLevelChannelDmPolicyWithAllowFrom as K, registerWebhookTarget as L, normalizeSecretInputString as M, promptSingleChannelSecretInput$1 as N, mergeAllowFromEntries$1 as O, readJsonWebhookBodyOrReject as P, registerWebhookTargetWithPluginRoute as R, formatPairingApproveHint as S, isNumericTargetId as T, resolveWebhookTargetWithAuthOrRejectSync as U, resolveOpenProviderRuntimeGroupPolicy$1 as V, runSingleChannelSecretStep$1 as W, getZaloRuntime as X, withResolvedWebhookRequestPipeline as Y, setZaloRuntime as Z, createDedupeCache as _, addWildcardAllowFrom as a, deliverTextOrMediaReply$1 as b, applySetupAccountConfigPatch as c, buildSecretInputSchema as d, buildSingleChannelSecretPromptState$1 as f, createChannelPairingController$1 as g, createChannelMessageReplyPipeline as h, WEBHOOK_RATE_LIMIT_DEFAULTS as i, normalizeResolvedSecretInputString as j, migrateBaseNameToDefaultAccount as k, buildBaseAccountStatusSnapshot as l, chunkTextForOutbound$1 as m, PAIRING_APPROVED_MESSAGE as n, applyAccountNameToChannelSection as o, buildTokenChannelStatusSummary$1 as p, waitForAbortSignal as q, WEBHOOK_ANOMALY_COUNTER_DEFAULTS as r, applyBasicWebhookRequestGuards as s, DEFAULT_ACCOUNT_ID$1 as t, buildChannelConfigSchema as u, createFixedWindowRateLimiter as v, isNormalizedSenderAllowed as w, formatAllowFromLowercase$1 as x, createWebhookAnomalyTracker as y, resolveClientIp as z };