@openclaw/zalo 2026.5.9-beta.1 → 2026.5.10-beta.2
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/api.js +3 -3
- package/dist/{channel-Dv3a8qOv.js → channel-CqYdiVMC.js} +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-DmdT2jqb.js → channel.runtime-CAA9uPYO.js} +2 -2
- package/dist/contract-api.js +2 -2
- package/dist/group-access-B_fAqJAN.js +15 -0
- package/dist/{monitor-HPIkfv6L.js → monitor-CpIJP2uj.js} +108 -121
- package/dist/{monitor.webhook-0sObsTVp.js → monitor.webhook-DDHdDX2R.js} +1 -1
- package/dist/{runtime-api-CMlbWaSj.js → runtime-api-df534_Ih.js} +2 -4
- package/dist/runtime-api.js +2 -2
- package/dist/setup-api.js +2 -2
- package/dist/test-api.js +2 -2
- package/package.json +4 -4
- package/dist/group-access-DZR43lOR.js +0 -30
package/dist/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as zaloPlugin } from "./channel-
|
|
1
|
+
import { t as zaloPlugin } from "./channel-CqYdiVMC.js";
|
|
2
2
|
import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "./setup-core-DigRD3j1.js";
|
|
3
|
-
import {
|
|
3
|
+
import { n as resolveZaloRuntimeGroupPolicy } from "./group-access-B_fAqJAN.js";
|
|
4
4
|
import { zaloSetupWizard } from "./setup-api.js";
|
|
5
|
-
export { createZaloSetupWizardProxy,
|
|
5
|
+
export { createZaloSetupWizardProxy, resolveZaloRuntimeGroupPolicy, zaloDmPolicy, zaloPlugin, zaloSetupAdapter, zaloSetupWizard };
|
|
@@ -174,7 +174,7 @@ function normalizeZaloMessagingTarget(raw) {
|
|
|
174
174
|
if (!trimmed) return;
|
|
175
175
|
return trimmed.replace(/^(zalo|zl):/i, "").trim();
|
|
176
176
|
}
|
|
177
|
-
const loadZaloChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
177
|
+
const loadZaloChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-CAA9uPYO.js"));
|
|
178
178
|
const zaloSetupWizard = createZaloSetupWizardProxy(async () => (await import("./setup-surface-2Up3yWov.js")).zaloSetupWizard);
|
|
179
179
|
const zaloTextChunkLimit = 2e3;
|
|
180
180
|
const zaloRawSendResultAdapter = createRawChannelSendResultAdapter({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as zaloPlugin } from "./channel-
|
|
1
|
+
import { t as zaloPlugin } from "./channel-CqYdiVMC.js";
|
|
2
2
|
export { zaloPlugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as normalizeSecretInputString } from "./accounts-9NLDDlZ8.js";
|
|
2
|
-
import { n as PAIRING_APPROVED_MESSAGE } from "./runtime-api-
|
|
2
|
+
import { n as PAIRING_APPROVED_MESSAGE } from "./runtime-api-df534_Ih.js";
|
|
3
3
|
import { i as getMe, n as ZaloApiError, t as resolveZaloProxyFetch } from "./proxy-D5AGEsI0.js";
|
|
4
4
|
import { t as sendMessageZalo } from "./send-znUV-Z2f.js";
|
|
5
5
|
import { createAccountStatusSink } from "openclaw/plugin-sdk/channel-lifecycle";
|
|
@@ -87,7 +87,7 @@ async function startZaloGatewayAccount(ctx) {
|
|
|
87
87
|
setStatus: ctx.setStatus
|
|
88
88
|
});
|
|
89
89
|
ctx.log?.info(`[${account.accountId}] starting provider${zaloBotLabel} mode=${mode}`);
|
|
90
|
-
const { monitorZaloProvider } = await import("./monitor-
|
|
90
|
+
const { monitorZaloProvider } = await import("./monitor-CpIJP2uj.js");
|
|
91
91
|
return monitorZaloProvider({
|
|
92
92
|
token,
|
|
93
93
|
account,
|
package/dist/contract-api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-Dw93tGo2.js";
|
|
2
|
-
import {
|
|
3
|
-
export { collectRuntimeConfigAssignments,
|
|
2
|
+
import { n as resolveZaloRuntimeGroupPolicy } from "./group-access-B_fAqJAN.js";
|
|
3
|
+
export { collectRuntimeConfigAssignments, resolveZaloRuntimeGroupPolicy, secretTargetRegistryEntries };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
2
|
+
//#region extensions/zalo/src/group-access.ts
|
|
3
|
+
const ZALO_ALLOW_FROM_PREFIX_RE = /^(zalo|zl):/i;
|
|
4
|
+
function normalizeZaloAllowEntry(value) {
|
|
5
|
+
return value.trim().replace(ZALO_ALLOW_FROM_PREFIX_RE, "").trim().toLowerCase();
|
|
6
|
+
}
|
|
7
|
+
function resolveZaloRuntimeGroupPolicy(params) {
|
|
8
|
+
return resolveOpenProviderRuntimeGroupPolicy({
|
|
9
|
+
providerConfigPresent: params.providerConfigPresent,
|
|
10
|
+
groupPolicy: params.groupPolicy,
|
|
11
|
+
defaultGroupPolicy: params.defaultGroupPolicy
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { resolveZaloRuntimeGroupPolicy as n, normalizeZaloAllowEntry as t };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { n as resolveZaloRuntimeGroupPolicy, t as normalizeZaloAllowEntry } from "./group-access-B_fAqJAN.js";
|
|
2
2
|
import { t as getZaloRuntime } from "./runtime-BRFxnYQx.js";
|
|
3
3
|
import { a as getUpdates, c as sendMessage, l as sendPhoto, n as ZaloApiError, o as getWebhookInfo, r as deleteWebhook, s as sendChatAction, t as resolveZaloProxyFetch, u as setWebhook } from "./proxy-D5AGEsI0.js";
|
|
4
4
|
import { deliverTextOrMediaReply, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
5
|
+
import { normalizeStringEntries } from "openclaw/plugin-sdk/text-runtime";
|
|
5
6
|
import { resolveDefaultGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
6
7
|
import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
|
|
7
8
|
import { logTypingFailure } from "openclaw/plugin-sdk/channel-feedback";
|
|
8
|
-
import { resolveDirectDmAuthorizationOutcome, resolveSenderCommandAuthorizationWithRuntime } from "openclaw/plugin-sdk/command-auth";
|
|
9
9
|
import { resolveInboundRouteEnvelopeBuilderWithRuntime } from "openclaw/plugin-sdk/inbound-envelope";
|
|
10
10
|
import { registerPluginHttpRoute, resolveWebhookPath } from "openclaw/plugin-sdk/webhook-ingress";
|
|
11
|
+
import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
11
12
|
import { waitForAbortSignal } from "openclaw/plugin-sdk/runtime-env";
|
|
12
13
|
import { randomBytes } from "node:crypto";
|
|
13
14
|
import { readFile, readdir, stat, unlink } from "node:fs/promises";
|
|
@@ -185,7 +186,7 @@ const ZALO_TYPING_TIMEOUT_MS = 5e3;
|
|
|
185
186
|
let zaloWebhookModulePromise;
|
|
186
187
|
const hostedMediaRouteRefs = /* @__PURE__ */ new Map();
|
|
187
188
|
function loadZaloWebhookModule() {
|
|
188
|
-
zaloWebhookModulePromise ??= import("./monitor.webhook-
|
|
189
|
+
zaloWebhookModulePromise ??= import("./monitor.webhook-DDHdDX2R.js");
|
|
189
190
|
return zaloWebhookModulePromise;
|
|
190
191
|
}
|
|
191
192
|
function registerSharedHostedMediaRoute(params) {
|
|
@@ -407,56 +408,58 @@ async function authorizeZaloMessage(params) {
|
|
|
407
408
|
const senderId = from.id;
|
|
408
409
|
const senderName = from.display_name ?? from.name;
|
|
409
410
|
const dmPolicy = account.config.dmPolicy ?? "pairing";
|
|
410
|
-
const configAllowFrom = (account.config.allowFrom ?? []).map((v) => String(v));
|
|
411
|
-
const configuredGroupAllowFrom = (account.config.groupAllowFrom ?? []).map((v) => String(v));
|
|
412
|
-
const groupAllowFrom = configuredGroupAllowFrom.length > 0 ? configuredGroupAllowFrom : configAllowFrom;
|
|
413
411
|
const defaultGroupPolicy = resolveDefaultGroupPolicy(config);
|
|
414
|
-
const
|
|
412
|
+
const rawBody = text?.trim() || (mediaPath ? "<media:image>" : "");
|
|
413
|
+
const { groupPolicy, providerMissingFallbackApplied } = resolveZaloRuntimeGroupPolicy({
|
|
415
414
|
providerConfigPresent: config.channels?.zalo !== void 0,
|
|
416
|
-
|
|
417
|
-
defaultGroupPolicy
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
415
|
+
groupPolicy: account.config.groupPolicy,
|
|
416
|
+
defaultGroupPolicy
|
|
417
|
+
});
|
|
418
|
+
const shouldComputeAuth = core.channel.commands.shouldComputeCommandAuthorized(rawBody, config);
|
|
419
|
+
const access = await resolveStableChannelMessageIngress({
|
|
420
|
+
channelId: "zalo",
|
|
421
|
+
accountId: account.accountId,
|
|
422
|
+
identity: {
|
|
423
|
+
key: "zalo-user-id",
|
|
424
|
+
normalize: normalizeZaloAllowEntry,
|
|
425
|
+
sensitivity: "pii",
|
|
426
|
+
entryIdPrefix: "zalo-entry"
|
|
427
|
+
},
|
|
428
|
+
cfg: config,
|
|
429
|
+
readStoreAllowFrom: async () => await pairing.readAllowFromStore(),
|
|
430
|
+
subject: { stableId: senderId },
|
|
431
|
+
conversation: {
|
|
432
|
+
kind: isGroup ? "group" : "direct",
|
|
433
|
+
id: chatId
|
|
434
|
+
},
|
|
435
|
+
providerMissingFallbackApplied,
|
|
436
|
+
dmPolicy,
|
|
437
|
+
groupPolicy,
|
|
438
|
+
policy: { groupAllowFromFallbackToAllowFrom: true },
|
|
439
|
+
allowFrom: normalizeStringEntries(account.config.allowFrom),
|
|
440
|
+
groupAllowFrom: normalizeStringEntries(account.config.groupAllowFrom),
|
|
441
|
+
command: shouldComputeAuth ? {} : void 0
|
|
442
|
+
});
|
|
443
|
+
const senderAccess = access.senderAccess;
|
|
444
|
+
if (isGroup) {
|
|
422
445
|
warnMissingProviderGroupPolicyFallbackOnce({
|
|
423
|
-
providerMissingFallbackApplied:
|
|
446
|
+
providerMissingFallbackApplied: senderAccess.providerMissingFallbackApplied,
|
|
424
447
|
providerKey: "zalo",
|
|
425
448
|
accountId: account.accountId,
|
|
426
449
|
log: (message) => logVerbose(core, runtime, message)
|
|
427
450
|
});
|
|
428
|
-
if (!
|
|
429
|
-
if (
|
|
430
|
-
else if (
|
|
431
|
-
else if (
|
|
451
|
+
if (!senderAccess.allowed) {
|
|
452
|
+
if (senderAccess.reasonCode === "group_policy_disabled") logVerbose(core, runtime, `zalo: drop group ${chatId} (groupPolicy=disabled)`);
|
|
453
|
+
else if (senderAccess.reasonCode === "group_policy_empty_allowlist") logVerbose(core, runtime, `zalo: drop group ${chatId} (groupPolicy=allowlist, no groupAllowFrom)`);
|
|
454
|
+
else if (senderAccess.reasonCode === "group_policy_not_allowlisted") logVerbose(core, runtime, `zalo: drop group sender ${senderId} (groupPolicy=allowlist)`);
|
|
432
455
|
return;
|
|
433
456
|
}
|
|
434
457
|
}
|
|
435
|
-
|
|
436
|
-
const { senderAllowedForCommands, commandAuthorized } = await resolveSenderCommandAuthorizationWithRuntime({
|
|
437
|
-
cfg: config,
|
|
438
|
-
rawBody,
|
|
439
|
-
isGroup,
|
|
440
|
-
dmPolicy,
|
|
441
|
-
configuredAllowFrom: configAllowFrom,
|
|
442
|
-
configuredGroupAllowFrom: groupAllowFrom,
|
|
443
|
-
senderId,
|
|
444
|
-
isSenderAllowed: isZaloSenderAllowed,
|
|
445
|
-
channel: "zalo",
|
|
446
|
-
accountId: account.accountId,
|
|
447
|
-
readAllowFromStore: pairing.readAllowFromStore,
|
|
448
|
-
runtime: core.channel.commands
|
|
449
|
-
});
|
|
450
|
-
const directDmOutcome = resolveDirectDmAuthorizationOutcome({
|
|
451
|
-
isGroup,
|
|
452
|
-
dmPolicy,
|
|
453
|
-
senderAllowedForCommands
|
|
454
|
-
});
|
|
455
|
-
if (directDmOutcome === "disabled") {
|
|
458
|
+
if (!isGroup && senderAccess.decision === "block" && senderAccess.reasonCode === "dm_policy_disabled") {
|
|
456
459
|
logVerbose(core, runtime, `Blocked zalo DM from ${senderId} (dmPolicy=disabled)`);
|
|
457
460
|
return;
|
|
458
461
|
}
|
|
459
|
-
if (
|
|
462
|
+
if (!isGroup && senderAccess.decision !== "allow") {
|
|
460
463
|
if (dmPolicy === "pairing") await pairing.issueChallenge({
|
|
461
464
|
senderId,
|
|
462
465
|
senderIdLine: `Your Zalo user id: ${senderId}`,
|
|
@@ -480,7 +483,7 @@ async function authorizeZaloMessage(params) {
|
|
|
480
483
|
}
|
|
481
484
|
return {
|
|
482
485
|
chatId,
|
|
483
|
-
commandAuthorized,
|
|
486
|
+
commandAuthorized: access.commandAccess.requested ? access.commandAccess.authorized : void 0,
|
|
484
487
|
isGroup,
|
|
485
488
|
rawBody,
|
|
486
489
|
senderId,
|
|
@@ -569,89 +572,73 @@ async function processMessageWithPipeline(params) {
|
|
|
569
572
|
channel: "zalo",
|
|
570
573
|
accountId: account.accountId
|
|
571
574
|
});
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
await sendChatAction(token, {
|
|
575
|
-
chat_id: chatId,
|
|
576
|
-
action: "typing"
|
|
577
|
-
}, fetcher, ZALO_TYPING_TIMEOUT_MS);
|
|
578
|
-
},
|
|
579
|
-
onStartError: (err) => {
|
|
580
|
-
logTypingFailure({
|
|
581
|
-
log: (message) => logVerbose(core, runtime, message),
|
|
582
|
-
channel: "zalo",
|
|
583
|
-
action: "start",
|
|
584
|
-
target: chatId,
|
|
585
|
-
error: err
|
|
586
|
-
});
|
|
587
|
-
}
|
|
588
|
-
} };
|
|
589
|
-
await core.channel.turn.run({
|
|
575
|
+
await core.channel.turn.runAssembled({
|
|
576
|
+
cfg: config,
|
|
590
577
|
channel: "zalo",
|
|
591
578
|
accountId: account.accountId,
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
579
|
+
agentId: route.agentId,
|
|
580
|
+
routeSessionKey: route.sessionKey,
|
|
581
|
+
storePath,
|
|
582
|
+
ctxPayload,
|
|
583
|
+
recordInboundSession: core.channel.session.recordInboundSession,
|
|
584
|
+
dispatchReplyWithBufferedBlockDispatcher: core.channel.reply.dispatchReplyWithBufferedBlockDispatcher,
|
|
585
|
+
delivery: {
|
|
586
|
+
preparePayload: (payload) => prepareZaloDurableReplyPayload({
|
|
587
|
+
payload,
|
|
588
|
+
tableMode,
|
|
589
|
+
convertMarkdownTables: core.channel.text.convertMarkdownTables
|
|
601
590
|
}),
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
})
|
|
654
|
-
}
|
|
591
|
+
durable: (payload, info) => resolveZaloDurableReplyOptions({
|
|
592
|
+
payload,
|
|
593
|
+
infoKind: info.kind,
|
|
594
|
+
chatId
|
|
595
|
+
}),
|
|
596
|
+
deliver: async (payload) => {
|
|
597
|
+
await deliverZaloReply({
|
|
598
|
+
payload,
|
|
599
|
+
token,
|
|
600
|
+
chatId,
|
|
601
|
+
runtime,
|
|
602
|
+
core,
|
|
603
|
+
config,
|
|
604
|
+
webhookUrl: params.webhookUrl,
|
|
605
|
+
webhookPath: params.webhookPath,
|
|
606
|
+
proxyUrl: account.config.proxy,
|
|
607
|
+
mediaMaxBytes: params.mediaMaxMb * 1024 * 1024,
|
|
608
|
+
canHostMedia: params.canHostMedia,
|
|
609
|
+
accountId: account.accountId,
|
|
610
|
+
statusSink,
|
|
611
|
+
fetcher,
|
|
612
|
+
tableMode: "off"
|
|
613
|
+
});
|
|
614
|
+
},
|
|
615
|
+
onDelivered: () => {
|
|
616
|
+
statusSink?.({ lastOutboundAt: Date.now() });
|
|
617
|
+
},
|
|
618
|
+
onError: (err, info) => {
|
|
619
|
+
runtime.error?.(`[${account.accountId}] Zalo ${info.kind} reply failed: ${String(err)}`);
|
|
620
|
+
}
|
|
621
|
+
},
|
|
622
|
+
replyPipeline: { typing: {
|
|
623
|
+
start: async () => {
|
|
624
|
+
await sendChatAction(token, {
|
|
625
|
+
chat_id: chatId,
|
|
626
|
+
action: "typing"
|
|
627
|
+
}, fetcher, ZALO_TYPING_TIMEOUT_MS);
|
|
628
|
+
},
|
|
629
|
+
onStartError: (err) => {
|
|
630
|
+
logTypingFailure({
|
|
631
|
+
log: (message) => logVerbose(core, runtime, message),
|
|
632
|
+
channel: "zalo",
|
|
633
|
+
action: "start",
|
|
634
|
+
target: chatId,
|
|
635
|
+
error: err
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
} },
|
|
639
|
+
record: { onRecordError: (err) => {
|
|
640
|
+
runtime.error?.(`zalo: failed updating session meta: ${String(err)}`);
|
|
641
|
+
} }
|
|
655
642
|
});
|
|
656
643
|
}
|
|
657
644
|
async function deliverZaloReply(params) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as registerWebhookTarget, P as readJsonWebhookBodyOrReject, R as registerWebhookTargetWithPluginRoute, W as resolveWebhookTargetWithAuthOrRejectSync, X 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-df534_Ih.js";
|
|
2
2
|
import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
3
3
|
import { createClaimableDedupe } from "openclaw/plugin-sdk/persistent-dedupe";
|
|
4
4
|
//#region extensions/zalo/src/monitor.webhook.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./runtime-BRFxnYQx.js";
|
|
2
|
-
import { formatAllowFromLowercase as formatAllowFromLowercase$1, isNormalizedSenderAllowed
|
|
2
|
+
import { formatAllowFromLowercase as formatAllowFromLowercase$1, isNormalizedSenderAllowed } from "openclaw/plugin-sdk/allow-from";
|
|
3
3
|
import { createChannelMessageReplyPipeline } from "openclaw/plugin-sdk/channel-message";
|
|
4
4
|
import { PAIRING_APPROVED_MESSAGE, buildTokenChannelStatusSummary as buildTokenChannelStatusSummary$1 } from "openclaw/plugin-sdk/channel-status";
|
|
5
5
|
import { deliverTextOrMediaReply as deliverTextOrMediaReply$1, isNumericTargetId as isNumericTargetId$1, sendPayloadWithChunkedTextAndMedia as sendPayloadWithChunkedTextAndMedia$1 } from "openclaw/plugin-sdk/reply-payload";
|
|
@@ -8,12 +8,10 @@ import { chunkTextForOutbound as chunkTextForOutbound$1 } from "openclaw/plugin-
|
|
|
8
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
9
|
import { buildSecretInputSchema, hasConfiguredSecretInput as hasConfiguredSecretInput$1, normalizeResolvedSecretInputString, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
10
10
|
import { addWildcardAllowFrom as addWildcardAllowFrom$1, 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";
|
|
11
|
-
import { evaluateSenderGroupAccess as evaluateSenderGroupAccess$1 } from "openclaw/plugin-sdk/group-access";
|
|
12
11
|
import { resolveDefaultGroupPolicy as resolveDefaultGroupPolicy$1, resolveOpenProviderRuntimeGroupPolicy as resolveOpenProviderRuntimeGroupPolicy$1, warnMissingProviderGroupPolicyFallbackOnce as warnMissingProviderGroupPolicyFallbackOnce$1 } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
13
12
|
import { createChannelPairingController as createChannelPairingController$1 } from "openclaw/plugin-sdk/channel-pairing";
|
|
14
13
|
import { logTypingFailure as logTypingFailure$1 } from "openclaw/plugin-sdk/channel-feedback";
|
|
15
|
-
import { resolveDirectDmAuthorizationOutcome as resolveDirectDmAuthorizationOutcome$1, resolveSenderCommandAuthorizationWithRuntime as resolveSenderCommandAuthorizationWithRuntime$1 } from "openclaw/plugin-sdk/command-auth";
|
|
16
14
|
import { resolveInboundRouteEnvelopeBuilderWithRuntime as resolveInboundRouteEnvelopeBuilderWithRuntime$1 } from "openclaw/plugin-sdk/inbound-envelope";
|
|
17
15
|
import { waitForAbortSignal } from "openclaw/plugin-sdk/runtime";
|
|
18
16
|
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";
|
|
19
|
-
export {
|
|
17
|
+
export { normalizeAccountId$1 as A, resolveDefaultGroupPolicy$1 as B, hasConfiguredSecretInput$1 as C, logTypingFailure$1 as D, jsonResult as E, readStringParam as F, runSingleChannelSecretStep$1 as G, resolveOpenProviderRuntimeGroupPolicy$1 as H, registerPluginHttpRoute$1 as I, waitForAbortSignal as J, sendPayloadWithChunkedTextAndMedia$1 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$1 as T, resolveWebhookPath$1 as U, resolveInboundRouteEnvelopeBuilderWithRuntime$1 as V, resolveWebhookTargetWithAuthOrRejectSync as W, withResolvedWebhookRequestPipeline as X, warnMissingProviderGroupPolicyFallbackOnce$1 as Y, createDedupeCache as _, addWildcardAllowFrom$1 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, setTopLevelChannelDmPolicyWithAllowFrom 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,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as normalizeAccountId, B as resolveDefaultGroupPolicy, C as hasConfiguredSecretInput, D as logTypingFailure, E as jsonResult, F as readStringParam, G as runSingleChannelSecretStep, H as resolveOpenProviderRuntimeGroupPolicy, I as registerPluginHttpRoute, J as waitForAbortSignal, K as sendPayloadWithChunkedTextAndMedia, 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 resolveWebhookPath, V as resolveInboundRouteEnvelopeBuilderWithRuntime, W as resolveWebhookTargetWithAuthOrRejectSync, X as withResolvedWebhookRequestPipeline, Y as warnMissingProviderGroupPolicyFallbackOnce, _ 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 setTopLevelChannelDmPolicyWithAllowFrom, 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-df534_Ih.js";
|
|
2
2
|
import { n as setZaloRuntime } from "./runtime-BRFxnYQx.js";
|
|
3
|
-
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,
|
|
3
|
+
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, resolveInboundRouteEnvelopeBuilderWithRuntime, resolveOpenProviderRuntimeGroupPolicy, resolveWebhookPath, resolveWebhookTargetWithAuthOrRejectSync, runSingleChannelSecretStep, sendPayloadWithChunkedTextAndMedia, setTopLevelChannelDmPolicyWithAllowFrom, setZaloRuntime, waitForAbortSignal, warnMissingProviderGroupPolicyFallbackOnce, withResolvedWebhookRequestPipeline };
|
package/dist/setup-api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "./setup-core-DigRD3j1.js";
|
|
2
|
-
import {
|
|
2
|
+
import { n as resolveZaloRuntimeGroupPolicy } from "./group-access-B_fAqJAN.js";
|
|
3
3
|
import { loadBundledEntryExportSync } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
4
4
|
//#region extensions/zalo/setup-api.ts
|
|
5
5
|
function createLazyObjectValue(load) {
|
|
@@ -27,4 +27,4 @@ function loadSetupSurfaceModule() {
|
|
|
27
27
|
}
|
|
28
28
|
const zaloSetupWizard = createLazyObjectValue(() => loadSetupSurfaceModule().zaloSetupWizard);
|
|
29
29
|
//#endregion
|
|
30
|
-
export { createZaloSetupWizardProxy,
|
|
30
|
+
export { createZaloSetupWizardProxy, resolveZaloRuntimeGroupPolicy, zaloDmPolicy, zaloSetupAdapter, zaloSetupWizard };
|
package/dist/test-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { n as resolveZaloRuntimeGroupPolicy } from "./group-access-B_fAqJAN.js";
|
|
2
|
+
export { resolveZaloRuntimeGroupPolicy };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/zalo",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.10-beta.2",
|
|
4
4
|
"description": "OpenClaw Zalo channel plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"openclaw": "workspace:*"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"openclaw": ">=2026.5.
|
|
15
|
+
"openclaw": ">=2026.5.10-beta.2"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"openclaw": {
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"minHostVersion": ">=2026.4.10"
|
|
44
44
|
},
|
|
45
45
|
"compat": {
|
|
46
|
-
"pluginApi": ">=2026.5.
|
|
46
|
+
"pluginApi": ">=2026.5.10-beta.2"
|
|
47
47
|
},
|
|
48
48
|
"build": {
|
|
49
|
-
"openclawVersion": "2026.5.
|
|
49
|
+
"openclawVersion": "2026.5.10-beta.2"
|
|
50
50
|
},
|
|
51
51
|
"release": {
|
|
52
52
|
"publishToClawHub": true,
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { isNormalizedSenderAllowed } from "openclaw/plugin-sdk/allow-from";
|
|
2
|
-
import { evaluateSenderGroupAccess, resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/group-access";
|
|
3
|
-
//#region extensions/zalo/src/group-access.ts
|
|
4
|
-
const ZALO_ALLOW_FROM_PREFIX_RE = /^(zalo|zl):/i;
|
|
5
|
-
function isZaloSenderAllowed(senderId, allowFrom) {
|
|
6
|
-
return isNormalizedSenderAllowed({
|
|
7
|
-
senderId,
|
|
8
|
-
allowFrom,
|
|
9
|
-
stripPrefixRe: ZALO_ALLOW_FROM_PREFIX_RE
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
function resolveZaloRuntimeGroupPolicy(params) {
|
|
13
|
-
return resolveOpenProviderRuntimeGroupPolicy({
|
|
14
|
-
providerConfigPresent: params.providerConfigPresent,
|
|
15
|
-
groupPolicy: params.groupPolicy,
|
|
16
|
-
defaultGroupPolicy: params.defaultGroupPolicy
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
function evaluateZaloGroupAccess(params) {
|
|
20
|
-
return evaluateSenderGroupAccess({
|
|
21
|
-
providerConfigPresent: params.providerConfigPresent,
|
|
22
|
-
configuredGroupPolicy: params.configuredGroupPolicy,
|
|
23
|
-
defaultGroupPolicy: params.defaultGroupPolicy,
|
|
24
|
-
groupAllowFrom: params.groupAllowFrom,
|
|
25
|
-
senderId: params.senderId,
|
|
26
|
-
isSenderAllowed: isZaloSenderAllowed
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { isZaloSenderAllowed as n, resolveZaloRuntimeGroupPolicy as r, evaluateZaloGroupAccess as t };
|