@openclaw/zalo 2026.8.1-beta.3 → 2026.8.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.
- package/dist/{actions.runtime-DUY9_6Ss.js → actions.runtime-3ZRHK2SE.js} +1 -1
- package/dist/api.js +1 -1
- package/dist/{channel-Vdxu1Y3k.js → channel-A8nLvhBc.js} +10 -4
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-UD-M7eDb.js → channel.runtime-gH4VQVIN.js} +3 -3
- package/dist/{monitor-JdVVhnCm.js → monitor-ado96nMT.js} +4 -4
- package/dist/{monitor.webhook-cl1sV6j0.js → monitor.webhook-CcTwt1dC.js} +2 -2
- package/dist/{runtime-api-BNim5FCa.js → runtime-api-CN6fYNQK.js} +1 -1
- package/dist/runtime-api.js +1 -1
- package/dist/{send-DVMIplpy.js → send-Cb7ITYME.js} +20 -26
- package/dist/{webhook-spool-Bdnu4GjY.js → webhook-spool-DPgnFGD0.js} +2 -2
- package/openclaw.plugin.json +5 -0
- package/package.json +5 -6
package/dist/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "./setup-core-CcCJ1E26.js";
|
|
2
|
-
import { t as zaloPlugin } from "./channel-
|
|
2
|
+
import { t as zaloPlugin } from "./channel-A8nLvhBc.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 };
|
|
@@ -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-
|
|
27
|
+
const loadZaloActionsRuntime = createLazyRuntimeNamedExport(() => import("./actions.runtime-3ZRHK2SE.js"), "zaloActionsRuntime");
|
|
28
28
|
const providerId = "zalo";
|
|
29
29
|
const ZALO_ACTIONS = /* @__PURE__ */ new Set(["send"]);
|
|
30
30
|
function listEnabledAccounts(cfg, accountId) {
|
|
@@ -89,7 +89,9 @@ const zaloApprovalAuth = createChannelApprovalAuth({
|
|
|
89
89
|
},
|
|
90
90
|
normalizeApprover: normalizeZaloApproverId
|
|
91
91
|
}).approvalAuth;
|
|
92
|
-
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region extensions/zalo/src/config-schema.ts
|
|
94
|
+
const zaloAccountSchema = z.object({
|
|
93
95
|
name: z.string().optional(),
|
|
94
96
|
enabled: z.boolean().optional(),
|
|
95
97
|
configWrites: z.boolean().optional(),
|
|
@@ -106,7 +108,11 @@ const ZaloConfigSchema = buildMultiAccountChannelSchema(z.object({
|
|
|
106
108
|
mediaMaxMb: z.number().optional(),
|
|
107
109
|
proxy: z.string().optional(),
|
|
108
110
|
responsePrefix: z.string().optional()
|
|
109
|
-
})
|
|
111
|
+
});
|
|
112
|
+
const ZaloConfigSchema = buildMultiAccountChannelSchema(zaloAccountSchema.extend({ historyLimit: z.number().int().min(0).optional() }), {
|
|
113
|
+
accountSchema: zaloAccountSchema,
|
|
114
|
+
accountsMode: "catchall"
|
|
115
|
+
});
|
|
110
116
|
//#endregion
|
|
111
117
|
//#region extensions/zalo/src/session-route.ts
|
|
112
118
|
function resolveZaloOutboundSessionRoute(params) {
|
|
@@ -180,7 +186,7 @@ function looksLikeZaloChatId(raw, normalized) {
|
|
|
180
186
|
const target = normalizeZaloMessagingTarget(normalized ?? raw);
|
|
181
187
|
return Boolean(target);
|
|
182
188
|
}
|
|
183
|
-
const loadZaloChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
189
|
+
const loadZaloChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-gH4VQVIN.js"));
|
|
184
190
|
const zaloSetupWizard = createZaloSetupWizardProxy(async () => (await import("./setup-surface-CIpp_MDf.js").then((n) => n.t)).zaloSetupWizard);
|
|
185
191
|
const zaloTextChunkLimit = 2e3;
|
|
186
192
|
async function sendZaloDelivery(ctx) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as zaloPlugin } from "./channel-
|
|
1
|
+
import { t as zaloPlugin } from "./channel-A8nLvhBc.js";
|
|
2
2
|
export { zaloPlugin };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as normalizeSecretInputString } from "./setup-core-CcCJ1E26.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as getMe, n as resolveZaloProxyFetch, r as ZaloApiError, t as sendMessageZalo } from "./send-
|
|
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-Cb7ITYME.js";
|
|
4
4
|
import { createAccountStatusSink } from "openclaw/plugin-sdk/channel-outbound";
|
|
5
5
|
import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
6
6
|
//#region extensions/zalo/src/probe.ts
|
|
@@ -69,7 +69,7 @@ async function startZaloGatewayAccount(ctx) {
|
|
|
69
69
|
setStatus: ctx.setStatus
|
|
70
70
|
});
|
|
71
71
|
ctx.log?.info(`[${account.accountId}] starting provider${zaloBotLabel} mode=${mode}`);
|
|
72
|
-
const { monitorZaloProvider } = await import("./monitor-
|
|
72
|
+
const { monitorZaloProvider } = await import("./monitor-ado96nMT.js");
|
|
73
73
|
return monitorZaloProvider({
|
|
74
74
|
token,
|
|
75
75
|
account,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as resolveZaloRuntimeGroupPolicy, t as normalizeZaloAllowEntry } from "./group-access-8qHRzDHx.js";
|
|
2
|
-
import {
|
|
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-
|
|
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-Cb7ITYME.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";
|
|
@@ -174,8 +174,8 @@ function resolveZaloTimestampMs(date) {
|
|
|
174
174
|
if (!date) return;
|
|
175
175
|
return date >= UNIX_MILLISECONDS_THRESHOLD ? date : date * 1e3;
|
|
176
176
|
}
|
|
177
|
-
const loadZaloWebhookRuntime = createLazyRuntimeNamedExport(() => import("./monitor.webhook-
|
|
178
|
-
const loadZaloWebhookIngressRuntime = createLazyRuntimeNamedExport(() => import("./webhook-spool-
|
|
177
|
+
const loadZaloWebhookRuntime = createLazyRuntimeNamedExport(() => import("./monitor.webhook-CcTwt1dC.js"), "zaloWebhookRuntime");
|
|
178
|
+
const loadZaloWebhookIngressRuntime = createLazyRuntimeNamedExport(() => import("./webhook-spool-DPgnFGD0.js"), "zaloWebhookIngressRuntime");
|
|
179
179
|
const loadZaloWebhookModule = createLazyRuntimeModule(async () => ({
|
|
180
180
|
...await loadZaloWebhookRuntime(),
|
|
181
181
|
...await loadZaloWebhookIngressRuntime()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ZaloWebhookPayloadError } from "./webhook-spool-
|
|
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-DPgnFGD0.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
|
|
@@ -19,4 +19,4 @@ const { setRuntime: setZaloRuntime, getRuntime: getZaloRuntime } = createPluginR
|
|
|
19
19
|
errorMessage: "Zalo runtime not initialized"
|
|
20
20
|
});
|
|
21
21
|
//#endregion
|
|
22
|
-
export {
|
|
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 };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
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";
|
|
2
2
|
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 };
|
|
@@ -264,11 +264,26 @@ async function sendMessageZalo(chatId, text, options = {}) {
|
|
|
264
264
|
const resolved = resolveSendContextOrFailure(chatId, options);
|
|
265
265
|
if ("failure" in resolved) return resolved.failure;
|
|
266
266
|
const { context } = resolved;
|
|
267
|
-
if (options.mediaUrl && (options.mediaUrl.trim() || !text))
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
267
|
+
if (options.mediaUrl && (options.mediaUrl.trim() || !text)) {
|
|
268
|
+
const photoUrl = options.mediaUrl.trim();
|
|
269
|
+
if (!photoUrl) return {
|
|
270
|
+
ok: false,
|
|
271
|
+
error: "No photo URL provided",
|
|
272
|
+
receipt: createZaloSendReceipt({
|
|
273
|
+
chatId: context.chatId,
|
|
274
|
+
kind: "media"
|
|
275
|
+
})
|
|
276
|
+
};
|
|
277
|
+
const caption = text || options.caption;
|
|
278
|
+
return await runZaloSend("Failed to send photo", {
|
|
279
|
+
chatId: context.chatId,
|
|
280
|
+
kind: "media"
|
|
281
|
+
}, () => sendPhoto(context.token, {
|
|
282
|
+
chat_id: context.chatId,
|
|
283
|
+
photo: photoUrl,
|
|
284
|
+
caption: caption !== void 0 ? truncateUtf16Safe(caption, 2e3) : void 0
|
|
285
|
+
}, context.fetcher));
|
|
286
|
+
}
|
|
272
287
|
return await runZaloSend("Failed to send message", {
|
|
273
288
|
chatId: context.chatId,
|
|
274
289
|
kind: "text"
|
|
@@ -277,26 +292,5 @@ async function sendMessageZalo(chatId, text, options = {}) {
|
|
|
277
292
|
text: truncateUtf16Safe(text, 2e3)
|
|
278
293
|
}, context.fetcher));
|
|
279
294
|
}
|
|
280
|
-
async function sendPhotoZalo(chatId, photoUrl, options = {}) {
|
|
281
|
-
const resolved = resolveSendContextOrFailure(chatId, options);
|
|
282
|
-
if ("failure" in resolved) return resolved.failure;
|
|
283
|
-
const { context } = resolved;
|
|
284
|
-
if (!photoUrl?.trim()) return {
|
|
285
|
-
ok: false,
|
|
286
|
-
error: "No photo URL provided",
|
|
287
|
-
receipt: createZaloSendReceipt({
|
|
288
|
-
chatId: context.chatId,
|
|
289
|
-
kind: "media"
|
|
290
|
-
})
|
|
291
|
-
};
|
|
292
|
-
return await runZaloSend("Failed to send photo", {
|
|
293
|
-
chatId: context.chatId,
|
|
294
|
-
kind: "media"
|
|
295
|
-
}, () => (async () => sendPhoto(context.token, {
|
|
296
|
-
chat_id: context.chatId,
|
|
297
|
-
photo: photoUrl.trim(),
|
|
298
|
-
caption: options.caption !== void 0 ? truncateUtf16Safe(options.caption, 2e3) : void 0
|
|
299
|
-
}, context.fetcher))());
|
|
300
|
-
}
|
|
301
295
|
//#endregion
|
|
302
296
|
export { getMe as a, sendChatAction as c, setWebhook as d, ZALO_OUTBOUND_MEDIA_TTL_MS as f, deleteWebhook as i, sendMessage as l, resolveZaloProxyFetch as n, getUpdates as o, ZaloApiError as r, getWebhookInfo as s, sendMessageZalo as t, sendPhoto as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as ZaloApiError } from "./send-
|
|
1
|
+
import { X as getZaloRuntime } from "./runtime-api-CN6fYNQK.js";
|
|
2
|
+
import { r as ZaloApiError } from "./send-Cb7ITYME.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";
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/zalo",
|
|
3
|
-
"version": "2026.8.1
|
|
3
|
+
"version": "2026.8.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.8.1
|
|
11
|
+
"openclaw": ">=2026.8.1"
|
|
12
12
|
},
|
|
13
13
|
"peerDependenciesMeta": {
|
|
14
14
|
"openclaw": {
|
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
"configuredState": {
|
|
29
29
|
"env": {
|
|
30
30
|
"anyOf": [
|
|
31
|
-
"ZALO_BOT_TOKEN"
|
|
32
|
-
"ZALO_WEBHOOK_SECRET"
|
|
31
|
+
"ZALO_BOT_TOKEN"
|
|
33
32
|
]
|
|
34
33
|
}
|
|
35
34
|
},
|
|
@@ -83,10 +82,10 @@
|
|
|
83
82
|
"minHostVersion": ">=2026.4.10"
|
|
84
83
|
},
|
|
85
84
|
"compat": {
|
|
86
|
-
"pluginApi": ">=2026.8.1
|
|
85
|
+
"pluginApi": ">=2026.8.1"
|
|
87
86
|
},
|
|
88
87
|
"build": {
|
|
89
|
-
"openclawVersion": "2026.8.1
|
|
88
|
+
"openclawVersion": "2026.8.1"
|
|
90
89
|
},
|
|
91
90
|
"release": {
|
|
92
91
|
"publishToClawHub": true,
|