@openclaw/zalo 2026.10.5-beta.4 → 2026.10.10-beta.1

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,5 +1,5 @@
1
1
  import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "./setup-core-BohTbM6i.mjs";
2
- import { t as zaloPlugin } from "./channel-BDoyUcaX.mjs";
2
+ import { t as zaloPlugin } from "./channel-mEpOoL81.mjs";
3
3
  import { n as resolveZaloRuntimeGroupPolicy } from "./group-access-Blsyu-ot.mjs";
4
4
  import { zaloSetupWizard } from "../setup-api.js";
5
5
  import "../api.js";
@@ -25,7 +25,7 @@ import { z } from "zod";
25
25
  import { buildChannelOutboundSessionRoute, stripChannelTargetPrefix, stripTargetKindPrefix } from "openclaw/plugin-sdk/core";
26
26
  import { coerceStatusIssueAccountId, readStatusIssueFields } from "openclaw/plugin-sdk/extension-shared";
27
27
  //#region extensions/zalo/src/actions.ts
28
- const loadZaloActionsRuntime = createLazyRuntimeNamedExport(() => import("./send-K3VH6hzV.mjs"), "sendMessageZalo");
28
+ const loadZaloActionsRuntime = createLazyRuntimeNamedExport(() => import("./send-DcAYX9XE.mjs"), "sendMessageZalo");
29
29
  const providerId = "zalo";
30
30
  const ZALO_ACTIONS = /* @__PURE__ */ new Set(["send"]);
31
31
  function listEnabledAccounts(cfg, accountId) {
@@ -187,8 +187,8 @@ function looksLikeZaloChatId(raw, normalized) {
187
187
  const target = normalizeZaloMessagingTarget(normalized ?? raw);
188
188
  return Boolean(target);
189
189
  }
190
- const loadZaloChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-h7Ma-rtL.mjs"));
191
- const zaloSetupWizard = createZaloSetupWizardProxy(async () => (await import("./setup-surface-Bzs4Hwk9.mjs").then((n) => n.t)).zaloSetupWizard);
190
+ const loadZaloChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-D_N32APw.mjs"));
191
+ const zaloSetupWizard = createZaloSetupWizardProxy(async () => (await import("./setup-surface-C1uIvO1X.mjs").then((n) => n.t)).zaloSetupWizard);
192
192
  const zaloTextChunkLimit = 2e3;
193
193
  async function sendZaloDelivery(ctx) {
194
194
  const result = await (await loadZaloChannelRuntime()).sendMessageZalo(ctx.to, ctx.text, {
@@ -1,4 +1,4 @@
1
- import { i as getMe, n as ZaloApiError, sendMessageZalo, t as resolveZaloProxyFetch } from "./send-K3VH6hzV.mjs";
1
+ import { i as getMe, n as ZaloApiError, sendMessageZalo, t as resolveZaloProxyFetch } from "./send-DcAYX9XE.mjs";
2
2
  import { createAccountStatusSink } from "openclaw/plugin-sdk/channel-outbound";
3
3
  import { normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
4
4
  import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
@@ -59,7 +59,7 @@ async function startZaloGatewayAccount(ctx) {
59
59
  setStatus: ctx.setStatus
60
60
  });
61
61
  ctx.log?.info(`[${account.accountId}] starting provider${zaloBotLabel} mode=${mode}`);
62
- const { monitorZaloProvider } = await import("./monitor-CkPLrWVm.mjs");
62
+ const { monitorZaloProvider } = await import("./monitor-K-P5Cxzh.mjs");
63
63
  return monitorZaloProvider({
64
64
  token,
65
65
  account,
@@ -1,6 +1,6 @@
1
1
  import { n as resolveZaloRuntimeGroupPolicy, t as normalizeZaloAllowEntry } from "./group-access-Blsyu-ot.mjs";
2
2
  import { t as getZaloRuntime } from "./runtime-Dfhzt7qb.mjs";
3
- import { a as getUpdates, c as sendMessage, d as ZALO_OUTBOUND_MEDIA_TTL_MS, l as sendPhoto, n as ZaloApiError, o as getWebhookInfo, r as deleteWebhook, s as sendChatAction, t as resolveZaloProxyFetch, u as setWebhook } from "./send-K3VH6hzV.mjs";
3
+ import { a as getUpdates, c as sendMessage, d as ZALO_OUTBOUND_MEDIA_TTL_MS, l as sendPhoto, n as ZaloApiError, o as getWebhookInfo, r as deleteWebhook, s as sendChatAction, t as resolveZaloProxyFetch, u as setWebhook } from "./send-DcAYX9XE.mjs";
4
4
  import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
5
5
  import { deliverTextOrMediaReply, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
6
6
  import { normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -194,7 +194,10 @@ function startPollingLoop(params) {
194
194
  const poll = async () => {
195
195
  if (isStopped() || abortSignal.aborted) return;
196
196
  try {
197
- const response = await getUpdates(token, { timeout: pollTimeout }, fetcher);
197
+ const response = await getUpdates(token, {
198
+ timeout: pollTimeout,
199
+ signal: abortSignal
200
+ }, fetcher);
198
201
  if (isStopped() || abortSignal.aborted) return;
199
202
  if (response.ok) statusSink?.(channelReadyPatch());
200
203
  if (response.ok && response.result) {
@@ -640,8 +643,8 @@ async function monitorZaloProvider(options) {
640
643
  stopHandlers.push(unregisterHostedMediaRoute);
641
644
  }
642
645
  if (useWebhook) {
643
- const { registerZaloWebhookTarget, handleZaloWebhookRequest } = (await import("./monitor.webhook-B3g1irKn.mjs")).zaloWebhookRuntime;
644
- const { createZaloWebhookIngress } = (await import("./webhook-spool-DejV9YSc.mjs")).zaloWebhookIngressRuntime;
646
+ const { registerZaloWebhookTarget, handleZaloWebhookRequest } = (await import("./monitor.webhook-CqCMBCij.mjs")).zaloWebhookRuntime;
647
+ const { createZaloWebhookIngress } = (await import("./webhook-spool-Cx5a0Wv0.mjs")).zaloWebhookIngressRuntime;
645
648
  if (!effectiveWebhookUrl || !webhookSecret) throw new Error("Zalo webhookUrl and webhookSecret are required for webhook mode");
646
649
  if (!effectiveWebhookUrl.startsWith("https://")) throw new Error("Zalo webhook URL must use HTTPS");
647
650
  if (webhookSecret.length < 8 || webhookSecret.length > 256) throw new Error("Zalo webhook secret must be 8-256 characters");
@@ -1,4 +1,4 @@
1
- import { ZaloWebhookPayloadError } from "./webhook-spool-DejV9YSc.mjs";
1
+ import { ZaloWebhookPayloadError } from "./webhook-spool-Cx5a0Wv0.mjs";
2
2
  import { resolveClientIp } from "openclaw/plugin-sdk/core";
3
3
  import { WEBHOOK_ANOMALY_COUNTER_DEFAULTS, WEBHOOK_RATE_LIMIT_DEFAULTS, applyBasicWebhookRequestGuards, createFixedWindowRateLimiter, createWebhookAnomalyTracker, registerWebhookTarget, registerWebhookTargetWithPluginRoute, resolveWebhookTargetWithAuthOrRejectSync, withResolvedWebhookRequestPipeline } from "openclaw/plugin-sdk/webhook-ingress";
4
4
  import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
@@ -0,0 +1,2 @@
1
+ export { t as channelSecrets, n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DF_0WQX4.mjs";
2
+ import "../secret-contract-api.js";
@@ -56,7 +56,7 @@ async function callZaloApi(method, token, body, options) {
56
56
  method: "POST",
57
57
  headers: { "Content-Type": "application/json" },
58
58
  body: body ? JSON.stringify(body) : void 0,
59
- signal: controller.signal
59
+ signal: options?.signal ? AbortSignal.any([controller.signal, options.signal]) : controller.signal
60
60
  };
61
61
  const response = await captureEffectAuthority().initiate(() => {
62
62
  options?.assertDirectAdapterHandoff?.();
@@ -116,6 +116,7 @@ async function getUpdates(token, params, fetcher) {
116
116
  const timeoutMs = (pollTimeoutSec + 5) * 1e3;
117
117
  return callZaloApi("getUpdates", token, { timeout: String(pollTimeoutSec) }, {
118
118
  timeoutMs,
119
+ signal: params?.signal,
119
120
  fetch: fetcher
120
121
  });
121
122
  }
@@ -1,5 +1,5 @@
1
1
  import { a as noteZaloTokenHelp, n as zaloDmPolicy, o as promptZaloAllowFrom, s as inspectZaloAccount } from "./setup-core-BohTbM6i.mjs";
2
- import { DEFAULT_ACCOUNT_ID, buildSingleChannelSecretPromptState, createSetupTranslator, createStandardChannelSetupStatus, hasConfiguredSecretInput, patchTopLevelChannelConfigSection, promptSingleChannelSecretInput, runSingleChannelSecretStep } from "openclaw/plugin-sdk/setup";
2
+ import { DEFAULT_ACCOUNT_ID, buildSingleChannelSecretPromptState, createSetupTranslator, createStandardChannelSetupStatus, hasConfiguredSecretInput, patchScopedAccountConfig, patchTopLevelChannelConfigSection, promptSingleChannelSecretInput, runSingleChannelSecretStep } from "openclaw/plugin-sdk/setup";
3
3
  //#region \0rolldown/runtime.js
4
4
  var __defProp = Object.defineProperty;
5
5
  var __exportAll = (all, no_symbols) => {
@@ -17,32 +17,22 @@ var setup_surface_exports = /* @__PURE__ */ __exportAll({ zaloSetupWizard: () =>
17
17
  const t = createSetupTranslator();
18
18
  const channel = "zalo";
19
19
  function setZaloUpdateMode(cfg, accountId, mode, webhookUrl, webhookSecret, webhookPath) {
20
- const isDefault = accountId === DEFAULT_ACCOUNT_ID;
21
- const next = { ...isDefault ? cfg.channels?.zalo : cfg.channels?.zalo?.accounts?.[accountId] };
22
- if (mode === "polling") {
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) {
33
- const accounts = { ...cfg.channels?.zalo?.accounts };
34
- accounts[accountId] = next;
35
- patch = { accounts };
36
- }
37
- return patchTopLevelChannelConfigSection({
20
+ return patchScopedAccountConfig({
38
21
  cfg,
39
- channel,
40
- clearFields: isDefault && mode === "polling" ? [
22
+ channelKey: channel,
23
+ accountId,
24
+ ensureChannelEnabled: false,
25
+ ensureAccountEnabled: false,
26
+ clearFields: mode === "polling" ? [
41
27
  "webhookUrl",
42
28
  "webhookSecret",
43
29
  "webhookPath"
44
30
  ] : void 0,
45
- patch
31
+ patch: mode === "polling" ? {} : {
32
+ webhookUrl,
33
+ webhookSecret,
34
+ webhookPath
35
+ }
46
36
  });
47
37
  }
48
38
  const zaloSetupWizard = {
@@ -95,18 +85,15 @@ const zaloSetupWizard = {
95
85
  enabled: true,
96
86
  patch: {}
97
87
  }) : currentCfg,
98
- applySet: async (currentCfg, value) => patchTopLevelChannelConfigSection({
88
+ applySet: async (currentCfg, value) => patchScopedAccountConfig({
99
89
  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],
106
- enabled: true,
107
- botToken: value
108
- }
109
- } }
90
+ channelKey: channel,
91
+ accountId,
92
+ patch: { botToken: value },
93
+ accountPatch: {
94
+ enabled: true,
95
+ botToken: value
96
+ }
110
97
  })
111
98
  })).cfg;
112
99
  if (await prompter.confirm({
@@ -1,9 +1,9 @@
1
1
  import { t as getZaloRuntime } from "./runtime-Dfhzt7qb.mjs";
2
- import { n as ZaloApiError } from "./send-K3VH6hzV.mjs";
2
+ import { n as ZaloApiError } from "./send-DcAYX9XE.mjs";
3
3
  import { DEFAULT_INGRESS_ADOPTION_STALL_MS, DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor } from "openclaw/plugin-sdk/channel-outbound";
4
- import { normalizeNullableString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
+ import { asOptionalObjectRecord, normalizeNullableString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { z } from "zod";
6
- import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
6
+ import { collectErrorGraphCandidates, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
7
7
  import { runDetachedWebhookWork } from "openclaw/plugin-sdk/webhook-request-guards";
8
8
  //#region extensions/zalo/src/message-schema.ts
9
9
  const nonEmptyWebhookStringSchema = z.string().transform((value) => normalizeNullableString(value)).pipe(z.string());
@@ -116,13 +116,10 @@ function parseClaimedUpdate(payload, claimedId) {
116
116
  };
117
117
  }
118
118
  function isZaloAuthenticationFailure(error) {
119
- let current = error;
120
- const seen = /* @__PURE__ */ new Set();
121
- while (current && typeof current === "object" && !seen.has(current)) {
122
- seen.add(current);
123
- const candidate = current;
124
- if (current instanceof ZaloApiError && (current.errorCode === 401 || current.errorCode === 403) || candidate.status === 401 || candidate.status === 403 || candidate.statusCode === 401 || candidate.statusCode === 403) return true;
125
- current = candidate.cause;
119
+ for (const current of collectErrorGraphCandidates(error, (candidate) => [candidate.cause])) {
120
+ const candidate = asOptionalObjectRecord(current);
121
+ if (!candidate) continue;
122
+ if (candidate instanceof ZaloApiError && (candidate.errorCode === 401 || candidate.errorCode === 403) || candidate.status === 401 || candidate.status === 403 || candidate.statusCode === 401 || candidate.statusCode === 403) return true;
126
123
  }
127
124
  return false;
128
125
  }
package/dist/api.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "./.setup/setup-core-BohTbM6i.mjs";
2
- import { t as zaloPlugin } from "./.setup/channel-BDoyUcaX.mjs";
2
+ import { t as zaloPlugin } from "./.setup/channel-mEpOoL81.mjs";
3
3
  import { n as resolveZaloRuntimeGroupPolicy } from "./.setup/group-access-Blsyu-ot.mjs";
4
4
  import { zaloSetupWizard } from "./setup-api.js";
5
5
  export { createZaloSetupWizardProxy, resolveZaloRuntimeGroupPolicy, zaloDmPolicy, zaloPlugin, zaloSetupAdapter, zaloSetupWizard };
@@ -1,2 +1 @@
1
- import { t as zaloPlugin } from "./.setup/channel-BDoyUcaX.mjs";
2
- export { zaloPlugin };
1
+ export { t as zaloPlugin } from "./.setup/channel-mEpOoL81.mjs";
@@ -1,2 +1 @@
1
- import { n as resolveZaloRuntimeGroupPolicy } from "./.setup/group-access-Blsyu-ot.mjs";
2
- export { resolveZaloRuntimeGroupPolicy };
1
+ export { n as resolveZaloRuntimeGroupPolicy } from "./.setup/group-access-Blsyu-ot.mjs";
@@ -1,2 +1 @@
1
- import { n as setZaloRuntime } from "./.setup/runtime-Dfhzt7qb.mjs";
2
- export { setZaloRuntime };
1
+ export { n as setZaloRuntime } from "./.setup/runtime-Dfhzt7qb.mjs";
@@ -1,2 +1 @@
1
- import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./.setup/secret-contract-DF_0WQX4.mjs";
2
- export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
1
+ export { t as channelSecrets, n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./.setup/secret-contract-DF_0WQX4.mjs";
@@ -4,11 +4,11 @@ import { fileURLToPath } from "node:url";
4
4
  var setup_entry_default = defineBundledChannelSetupEntry({
5
5
  importMetaUrl: import.meta.url,
6
6
  plugin: {
7
- specifier: fileURLToPath(new URL(".setup/api-DcyxnTMW.mjs", import.meta.url).href),
7
+ specifier: fileURLToPath(new URL(".setup/api-wgJsO22l.mjs", import.meta.url).href),
8
8
  exportName: "zaloPlugin"
9
9
  },
10
10
  secrets: {
11
- specifier: fileURLToPath(new URL(".setup/secret-contract-api-CRklpdRx.mjs", import.meta.url).href),
11
+ specifier: fileURLToPath(new URL(".setup/secret-contract-api-BMxXSY78.mjs", import.meta.url).href),
12
12
  exportName: "channelSecrets"
13
13
  }
14
14
  });
@@ -1,3 +1,3 @@
1
- import { n as zaloSetupWizard } from "./.setup/setup-surface-Bzs4Hwk9.mjs";
1
+ import { n as zaloSetupWizard } from "./.setup/setup-surface-C1uIvO1X.mjs";
2
2
  import { r as zaloSetupAdapter } from "./.setup/setup-core-BohTbM6i.mjs";
3
3
  export { zaloSetupAdapter, zaloSetupWizard };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/zalo",
3
- "version": "2026.10.5-beta.4",
3
+ "version": "2026.10.10-beta.1",
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.10.5-beta.4"
11
+ "openclaw": ">=2026.10.10-beta.1"
12
12
  },
13
13
  "peerDependenciesMeta": {
14
14
  "openclaw": {
@@ -83,10 +83,10 @@
83
83
  "minHostVersion": ">=2026.9.8"
84
84
  },
85
85
  "compat": {
86
- "pluginApi": ">=2026.10.5-beta.4"
86
+ "pluginApi": ">=2026.10.10-beta.1"
87
87
  },
88
88
  "build": {
89
- "openclawVersion": "2026.10.5-beta.4"
89
+ "openclawVersion": "2026.10.10-beta.1"
90
90
  },
91
91
  "release": {
92
92
  "publishToClawHub": true,
@@ -1,3 +0,0 @@
1
- import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-DF_0WQX4.mjs";
2
- import "../secret-contract-api.js";
3
- export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };