@openclaw/zalouser 2026.5.27 → 2026.5.28-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,2 +1,2 @@
1
- import { n as getZaloUserInfo, t as checkZaloAuthenticated } from "./zalo-js-C3Wijq_z.js";
1
+ import { n as getZaloUserInfo, t as checkZaloAuthenticated } from "./zalo-js-CoAYxl2h.js";
2
2
  export { checkZaloAuthenticated, getZaloUserInfo };
@@ -1,11 +1,10 @@
1
- import "./setup-surface-CjXKvjhE.js";
2
- import "./shared-BcyjjZep.js";
3
- import "./channel-BICvWuAo.js";
4
- import { r as parseZalouserOutboundTarget } from "./session-route-Bp8b300d.js";
1
+ import "./setup-surface-DQBRWLnI.js";
2
+ import "./shared-BweDHhLM.js";
3
+ import { n as parseZalouserOutboundTarget } from "./channel-DlMjHD00.js";
5
4
  import "./security-audit-DhK2UscX.js";
6
- import { i as listZaloFriendsMatching, n as getZaloUserInfo, s as listZaloGroupsMatching, t as checkZaloAuthenticated } from "./zalo-js-C3Wijq_z.js";
7
- import "./channel.setup-Db981qWE.js";
8
- import { i as sendMessageZalouser, n as sendImageZalouser, r as sendLinkZalouser } from "./send-CbTBtzZQ.js";
5
+ import { i as listZaloFriendsMatching, n as getZaloUserInfo, s as listZaloGroupsMatching, t as checkZaloAuthenticated } from "./zalo-js-CoAYxl2h.js";
6
+ import "./channel.setup-CdA5CvO0.js";
7
+ import { i as sendMessageZalouser, n as sendImageZalouser, r as sendLinkZalouser } from "./send-C65xy6Wd.js";
9
8
  import { stringEnum } from "openclaw/plugin-sdk/channel-actions";
10
9
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
11
10
  import { Type } from "typebox";
package/dist/api.js CHANGED
@@ -1,7 +1,7 @@
1
- import { n as zalouserSetupWizard } from "./setup-surface-CjXKvjhE.js";
2
- import { n as createZalouserSetupWizardProxy, r as zalouserSetupAdapter } from "./shared-BcyjjZep.js";
3
- import { t as zalouserPlugin } from "./channel-BICvWuAo.js";
1
+ import { n as zalouserSetupWizard } from "./setup-surface-DQBRWLnI.js";
2
+ import { n as createZalouserSetupWizardProxy, r as zalouserSetupAdapter } from "./shared-BweDHhLM.js";
3
+ import { t as zalouserPlugin } from "./channel-DlMjHD00.js";
4
4
  import { n as isZalouserMutableGroupEntry, t as collectZalouserSecurityAuditFindings } from "./security-audit-DhK2UscX.js";
5
- import { t as zalouserSetupPlugin } from "./channel.setup-Db981qWE.js";
6
- import { t as createZalouserTool } from "./api-CC2is5Vz.js";
5
+ import { t as zalouserSetupPlugin } from "./channel.setup-CdA5CvO0.js";
6
+ import { t as createZalouserTool } from "./api-BBqnUi9A.js";
7
7
  export { collectZalouserSecurityAuditFindings, createZalouserSetupWizardProxy, createZalouserTool, isZalouserMutableGroupEntry, zalouserPlugin, zalouserSetupAdapter, zalouserSetupPlugin, zalouserSetupWizard };
@@ -1,12 +1,11 @@
1
- import { a as resolveZalouserAccountSync, i as resolveDefaultZalouserAccountId, r as listZalouserAccountIds, t as checkZcaAuthenticated } from "./accounts-C1OmvrPK.js";
2
- import { a as DEFAULT_ACCOUNT_ID, c as isNumericTargetId, i as writeQrDataUrlToTempFile, l as normalizeAccountId, n as createZalouserSetupWizardProxy, o as chunkTextForOutbound, r as zalouserSetupAdapter, s as isDangerousNameMatchingEnabled, t as createZalouserPluginBase, u as sendPayloadWithChunkedTextAndMedia } from "./shared-BcyjjZep.js";
3
- import { i as resolveZalouserOutboundSessionRoute, n as parseZalouserDirectoryGroupId, r as parseZalouserOutboundTarget, t as normalizeZalouserTarget } from "./session-route-Bp8b300d.js";
1
+ import { a as DEFAULT_ACCOUNT_ID, c as isNumericTargetId, d as checkZcaAuthenticated, f as listZalouserAccountIds, i as writeQrDataUrlToTempFile, l as normalizeAccountId, m as resolveZalouserAccountSync, n as createZalouserSetupWizardProxy, o as chunkTextForOutbound, p as resolveDefaultZalouserAccountId, r as zalouserSetupAdapter, s as isDangerousNameMatchingEnabled, t as createZalouserPluginBase, u as sendPayloadWithChunkedTextAndMedia } from "./shared-BweDHhLM.js";
4
2
  import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
5
3
  import { createAccountStatusSink, defineChannelMessageAdapter } from "openclaw/plugin-sdk/channel-outbound";
6
4
  import { buildPassiveProbedChannelStatusSummary, coerceStatusIssueAccountId, readStatusIssueFields } from "openclaw/plugin-sdk/extension-shared";
7
5
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
8
6
  import { createAsyncComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
9
7
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
8
+ import { buildChannelOutboundSessionRoute } from "openclaw/plugin-sdk/core";
10
9
  import { createScopedDmSecurityResolver } from "openclaw/plugin-sdk/channel-config-helpers";
11
10
  import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
12
11
  import { createEmptyChannelResult, createRawChannelSendResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
@@ -115,8 +114,97 @@ const { setRuntime: setZalouserRuntime, getRuntime: getZalouserRuntime } = creat
115
114
  errorMessage: "Zalouser runtime not initialized"
116
115
  });
117
116
  //#endregion
117
+ //#region extensions/zalouser/src/session-route.ts
118
+ function stripZalouserTargetPrefix(raw) {
119
+ return raw.trim().replace(/^(zalouser|zlu):/i, "").trim();
120
+ }
121
+ function normalizeZalouserTarget(raw) {
122
+ const trimmed = stripZalouserTargetPrefix(raw);
123
+ if (!trimmed) return;
124
+ const lower = normalizeLowercaseStringOrEmpty(trimmed);
125
+ if (lower.startsWith("group:")) {
126
+ const id = trimmed.slice(6).trim();
127
+ return id ? `group:${id}` : void 0;
128
+ }
129
+ if (lower.startsWith("g:")) {
130
+ const id = trimmed.slice(2).trim();
131
+ return id ? `group:${id}` : void 0;
132
+ }
133
+ if (lower.startsWith("user:")) {
134
+ const id = trimmed.slice(5).trim();
135
+ return id ? `user:${id}` : void 0;
136
+ }
137
+ if (lower.startsWith("dm:")) {
138
+ const id = trimmed.slice(3).trim();
139
+ return id ? `user:${id}` : void 0;
140
+ }
141
+ if (lower.startsWith("u:")) {
142
+ const id = trimmed.slice(2).trim();
143
+ return id ? `user:${id}` : void 0;
144
+ }
145
+ if (/^g-\S+$/i.test(trimmed)) return `group:${trimmed}`;
146
+ if (/^u-\S+$/i.test(trimmed)) return `user:${trimmed}`;
147
+ return trimmed;
148
+ }
149
+ function parseZalouserOutboundTarget(raw) {
150
+ const normalized = normalizeZalouserTarget(raw);
151
+ if (!normalized) throw new Error("Zalouser target is required");
152
+ const lowered = normalizeLowercaseStringOrEmpty(normalized);
153
+ if (lowered.startsWith("group:")) {
154
+ const threadId = normalized.slice(6).trim();
155
+ if (!threadId) throw new Error("Zalouser group target is missing group id");
156
+ return {
157
+ threadId,
158
+ isGroup: true
159
+ };
160
+ }
161
+ if (lowered.startsWith("user:")) {
162
+ const threadId = normalized.slice(5).trim();
163
+ if (!threadId) throw new Error("Zalouser user target is missing user id");
164
+ return {
165
+ threadId,
166
+ isGroup: false
167
+ };
168
+ }
169
+ return {
170
+ threadId: normalized,
171
+ isGroup: false
172
+ };
173
+ }
174
+ function parseZalouserDirectoryGroupId(raw) {
175
+ const normalized = normalizeZalouserTarget(raw);
176
+ if (!normalized) throw new Error("Zalouser group target is required");
177
+ const lowered = normalizeLowercaseStringOrEmpty(normalized);
178
+ if (lowered.startsWith("group:")) {
179
+ const groupId = normalized.slice(6).trim();
180
+ if (!groupId) throw new Error("Zalouser group target is missing group id");
181
+ return groupId;
182
+ }
183
+ if (lowered.startsWith("user:")) throw new Error("Zalouser group members lookup requires a group target (group:<id>)");
184
+ return normalized;
185
+ }
186
+ function resolveZalouserOutboundSessionRoute(params) {
187
+ const normalized = normalizeZalouserTarget(params.target);
188
+ if (!normalized) return null;
189
+ const isGroup = (normalizeOptionalLowercaseString(normalized) ?? "").startsWith("group:");
190
+ const peerId = normalized.replace(/^(group|user):/i, "").trim();
191
+ return buildChannelOutboundSessionRoute({
192
+ cfg: params.cfg,
193
+ agentId: params.agentId,
194
+ channel: "zalouser",
195
+ accountId: params.accountId,
196
+ peer: {
197
+ kind: isGroup ? "group" : "direct",
198
+ id: peerId
199
+ },
200
+ chatType: isGroup ? "group" : "direct",
201
+ from: isGroup ? `zalouser:group:${peerId}` : `zalouser:${peerId}`,
202
+ to: `zalouser:${peerId}`
203
+ });
204
+ }
205
+ //#endregion
118
206
  //#region extensions/zalouser/src/channel.adapters.ts
119
- const loadZalouserChannelRuntime$1 = createLazyRuntimeModule(() => import("./channel.runtime-1aZZUPQ2.js"));
207
+ const loadZalouserChannelRuntime$1 = createLazyRuntimeModule(() => import("./channel.runtime-C6g86q6_.js"));
120
208
  const ZALOUSER_TEXT_CHUNK_LIMIT = 2e3;
121
209
  function resolveZalouserQrProfile(accountId) {
122
210
  const normalized = normalizeAccountId(accountId);
@@ -447,8 +535,8 @@ function collectZalouserStatusIssues(accounts) {
447
535
  }
448
536
  //#endregion
449
537
  //#region extensions/zalouser/src/channel.ts
450
- const loadZalouserChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-1aZZUPQ2.js"));
451
- const zalouserSetupWizardProxy = createZalouserSetupWizardProxy(async () => (await import("./setup-surface-CjXKvjhE.js").then((n) => n.t)).zalouserSetupWizard);
538
+ const loadZalouserChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-C6g86q6_.js"));
539
+ const zalouserSetupWizardProxy = createZalouserSetupWizardProxy(async () => (await import("./setup-surface-DQBRWLnI.js").then((n) => n.t)).zalouserSetupWizard);
452
540
  function mapUser(params) {
453
541
  return {
454
542
  kind: "user",
@@ -565,7 +653,7 @@ const zalouserPlugin = createChatChannelPlugin({
565
653
  setStatus: ctx.setStatus
566
654
  });
567
655
  ctx.log?.info(`[${account.accountId}] starting zalouser provider${userLabel}`);
568
- const { monitorZalouserProvider } = await import("./monitor-HUsRtlNS.js");
656
+ const { monitorZalouserProvider } = await import("./monitor-fmAC676K.js");
569
657
  return monitorZalouserProvider({
570
658
  account,
571
659
  config: ctx.cfg,
@@ -598,4 +686,4 @@ const zalouserPlugin = createChatChannelPlugin({
598
686
  outbound: zalouserOutboundAdapter
599
687
  });
600
688
  //#endregion
601
- export { resolveZalouserMessageSid as a, isZalouserGroupEntryAllowed as c, formatZalouserMessageSidFull as i, getZalouserRuntime as n, buildZalouserGroupCandidates as o, setZalouserRuntime as r, findZalouserGroupEntry as s, zalouserPlugin as t };
689
+ export { formatZalouserMessageSidFull as a, findZalouserGroupEntry as c, setZalouserRuntime as i, isZalouserGroupEntryAllowed as l, parseZalouserOutboundTarget as n, resolveZalouserMessageSid as o, getZalouserRuntime as r, buildZalouserGroupCandidates as s, zalouserPlugin as t };
@@ -1,2 +1,2 @@
1
- import { t as zalouserPlugin } from "./channel-BICvWuAo.js";
1
+ import { t as zalouserPlugin } from "./channel-DlMjHD00.js";
2
2
  export { zalouserPlugin };
@@ -1,6 +1,6 @@
1
1
  import { t as collectZalouserSecurityAuditFindings } from "./security-audit-DhK2UscX.js";
2
- import { a as listZaloGroupMembers, b as waitForZaloQrLogin, c as logoutZaloProfile, i as listZaloFriendsMatching, n as getZaloUserInfo, s as listZaloGroupsMatching, y as startZaloQrLogin } from "./zalo-js-C3Wijq_z.js";
3
- import { a as sendReactionZalouser, i as sendMessageZalouser } from "./send-CbTBtzZQ.js";
2
+ import { a as listZaloGroupMembers, b as waitForZaloQrLogin, c as logoutZaloProfile, i as listZaloFriendsMatching, n as getZaloUserInfo, s as listZaloGroupsMatching, y as startZaloQrLogin } from "./zalo-js-CoAYxl2h.js";
3
+ import { a as sendReactionZalouser, i as sendMessageZalouser } from "./send-C65xy6Wd.js";
4
4
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
5
5
  //#region extensions/zalouser/src/probe.ts
6
6
  async function probeZalouser(profile, timeoutMs) {
@@ -1,5 +1,5 @@
1
- import { n as zalouserSetupWizard } from "./setup-surface-CjXKvjhE.js";
2
- import { r as zalouserSetupAdapter, t as createZalouserPluginBase } from "./shared-BcyjjZep.js";
1
+ import { n as zalouserSetupWizard } from "./setup-surface-DQBRWLnI.js";
2
+ import { r as zalouserSetupAdapter, t as createZalouserPluginBase } from "./shared-BweDHhLM.js";
3
3
  //#region extensions/zalouser/src/channel.setup.ts
4
4
  const zalouserSetupPlugin = { ...createZalouserPluginBase({
5
5
  setupWizard: zalouserSetupWizard,
@@ -1,6 +1,6 @@
1
- import { a as resolveZalouserMessageSid, c as isZalouserGroupEntryAllowed, i as formatZalouserMessageSidFull, n as getZalouserRuntime, o as buildZalouserGroupCandidates, s as findZalouserGroupEntry } from "./channel-BICvWuAo.js";
2
- import { o as listZaloGroups, r as listZaloFriends, u as resolveZaloGroupContext, v as startZaloListener } from "./zalo-js-C3Wijq_z.js";
3
- import { i as sendMessageZalouser, o as sendSeenZalouser, s as sendTypingZalouser, t as sendDeliveredZalouser } from "./send-CbTBtzZQ.js";
1
+ import { a as formatZalouserMessageSidFull, c as findZalouserGroupEntry, l as isZalouserGroupEntryAllowed, o as resolveZalouserMessageSid, r as getZalouserRuntime, s as buildZalouserGroupCandidates } from "./channel-DlMjHD00.js";
2
+ import { o as listZaloGroups, r as listZaloFriends, u as resolveZaloGroupContext, v as startZaloListener } from "./zalo-js-CoAYxl2h.js";
3
+ import { i as sendMessageZalouser, o as sendSeenZalouser, s as sendTypingZalouser, t as sendDeliveredZalouser } from "./send-C65xy6Wd.js";
4
4
  import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
5
5
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { mergeAllowlist, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
@@ -1,9 +1,9 @@
1
- import { n as zalouserSetupWizard } from "./setup-surface-CjXKvjhE.js";
2
- import { n as createZalouserSetupWizardProxy, r as zalouserSetupAdapter } from "./shared-BcyjjZep.js";
3
- import { r as setZalouserRuntime, t as zalouserPlugin } from "./channel-BICvWuAo.js";
1
+ import { n as zalouserSetupWizard } from "./setup-surface-DQBRWLnI.js";
2
+ import { n as createZalouserSetupWizardProxy, r as zalouserSetupAdapter } from "./shared-BweDHhLM.js";
3
+ import { i as setZalouserRuntime, t as zalouserPlugin } from "./channel-DlMjHD00.js";
4
4
  import { n as isZalouserMutableGroupEntry, t as collectZalouserSecurityAuditFindings } from "./security-audit-DhK2UscX.js";
5
- import { t as zalouserSetupPlugin } from "./channel.setup-Db981qWE.js";
6
- import { t as createZalouserTool } from "./api-CC2is5Vz.js";
5
+ import { t as zalouserSetupPlugin } from "./channel.setup-CdA5CvO0.js";
6
+ import { t as createZalouserTool } from "./api-BBqnUi9A.js";
7
7
  import { createChannelMessageReplyPipeline } from "openclaw/plugin-sdk/channel-outbound";
8
8
  import { buildBaseAccountStatusSnapshot } from "openclaw/plugin-sdk/status-helpers";
9
9
  import { formatAllowFromLowercase, mergeAllowlist, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
@@ -1,4 +1,4 @@
1
- import { S as TextStyle, _ as sendZaloTypingEvent, f as sendZaloDeliveredEvent, g as sendZaloTextMessage, h as sendZaloSeenEvent, m as sendZaloReaction, p as sendZaloLink, x as createZalouserSendReceipt } from "./zalo-js-C3Wijq_z.js";
1
+ import { S as TextStyle, _ as sendZaloTypingEvent, f as sendZaloDeliveredEvent, g as sendZaloTextMessage, h as sendZaloSeenEvent, m as sendZaloReaction, p as sendZaloLink, x as createZalouserSendReceipt } from "./zalo-js-CoAYxl2h.js";
2
2
  //#region extensions/zalouser/src/text-styles.ts
3
3
  const ESCAPE_SENTINEL_START = "";
4
4
  const ESCAPE_SENTINEL_END = "";
@@ -1,2 +1,2 @@
1
- import { t as zalouserSetupPlugin } from "./channel.setup-Db981qWE.js";
1
+ import { t as zalouserSetupPlugin } from "./channel.setup-CdA5CvO0.js";
2
2
  export { zalouserSetupPlugin };
@@ -1,6 +1,5 @@
1
- import { a as resolveZalouserAccountSync, i as resolveDefaultZalouserAccountId, r as listZalouserAccountIds, t as checkZcaAuthenticated } from "./accounts-C1OmvrPK.js";
2
- import { i as writeQrDataUrlToTempFile } from "./shared-BcyjjZep.js";
3
- import { b as waitForZaloQrLogin, c as logoutZaloProfile, d as resolveZaloGroupsByEntries, l as resolveZaloAllowFromEntries, y as startZaloQrLogin } from "./zalo-js-C3Wijq_z.js";
1
+ import { d as checkZcaAuthenticated, f as listZalouserAccountIds, i as writeQrDataUrlToTempFile, m as resolveZalouserAccountSync, p as resolveDefaultZalouserAccountId } from "./shared-BweDHhLM.js";
2
+ import { b as waitForZaloQrLogin, c as logoutZaloProfile, d as resolveZaloGroupsByEntries, l as resolveZaloAllowFromEntries, y as startZaloQrLogin } from "./zalo-js-CoAYxl2h.js";
4
3
  import { normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
5
4
  import { DEFAULT_ACCOUNT_ID, addWildcardAllowFrom, createSetupTranslator, formatCliCommand, formatDocsLink, formatResolvedUnresolvedNote, mergeAllowFromEntries, normalizeAccountId, patchScopedAccountConfig } from "openclaw/plugin-sdk/setup";
6
5
  //#region \0rolldown/runtime.js
@@ -1,9 +1,10 @@
1
- import { a as resolveZalouserAccountSync, i as resolveDefaultZalouserAccountId, r as listZalouserAccountIds, t as checkZcaAuthenticated } from "./accounts-C1OmvrPK.js";
2
1
  import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-mDJdHVKH.js";
3
2
  import { n as isZalouserMutableGroupEntry } from "./security-audit-DhK2UscX.js";
3
+ import { DEFAULT_ACCOUNT_ID, createAccountListHelpers, normalizeAccountId, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
4
+ import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
5
  import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
5
6
  import { AllowFromListSchema, DmPolicySchema, GroupPolicySchema, MarkdownConfigSchema, ToolPolicySchema, buildCatchallMultiAccountChannelSchema, buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
6
- import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/core";
7
+ import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/core";
7
8
  import { isDangerousNameMatchingEnabled as isDangerousNameMatchingEnabled$1 } from "openclaw/plugin-sdk/dangerous-name-runtime";
8
9
  import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
9
10
  import { isNumericTargetId, sendPayloadWithChunkedTextAndMedia } from "openclaw/plugin-sdk/reply-payload";
@@ -15,6 +16,61 @@ import { createDelegatedSetupWizardProxy, createPatchedAccountSetupAdapter, crea
15
16
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
16
17
  import { z } from "zod";
17
18
  import { createDangerousNameMatchingMutableAllowlistWarningCollector } from "openclaw/plugin-sdk/channel-policy";
19
+ //#region extensions/zalouser/src/accounts.ts
20
+ let zalouserAccountsRuntimePromise;
21
+ async function loadZalouserAccountsRuntime() {
22
+ zalouserAccountsRuntimePromise ??= import("./accounts.runtime-BtI8gfc2.js");
23
+ return await zalouserAccountsRuntimePromise;
24
+ }
25
+ const { listAccountIds: listZalouserAccountIds, resolveDefaultAccountId: resolveDefaultZalouserAccountId } = createAccountListHelpers("zalouser", { implicitDefaultAccount: {
26
+ channelKeys: ["profile"],
27
+ envVars: ["ZALOUSER_PROFILE", "ZCA_PROFILE"]
28
+ } });
29
+ function mergeZalouserAccountConfig(cfg, accountId) {
30
+ const merged = resolveMergedAccountConfig({
31
+ channelConfig: cfg.channels?.zalouser,
32
+ accounts: (cfg.channels?.zalouser)?.accounts,
33
+ accountId,
34
+ omitKeys: ["defaultAccount"]
35
+ });
36
+ return {
37
+ ...merged,
38
+ groupPolicy: merged.groupPolicy ?? "allowlist"
39
+ };
40
+ }
41
+ function resolveProfile(config, accountId) {
42
+ if (config.profile?.trim()) return config.profile.trim();
43
+ if (process.env.ZALOUSER_PROFILE?.trim()) return process.env.ZALOUSER_PROFILE.trim();
44
+ if (process.env.ZCA_PROFILE?.trim()) return process.env.ZCA_PROFILE.trim();
45
+ if (accountId !== DEFAULT_ACCOUNT_ID) return accountId;
46
+ return "default";
47
+ }
48
+ function resolveZalouserAccountBase(params) {
49
+ const accountId = normalizeAccountId(params.accountId ?? resolveDefaultZalouserAccountId(params.cfg));
50
+ const baseEnabled = (params.cfg.channels?.zalouser)?.enabled !== false;
51
+ const merged = mergeZalouserAccountConfig(params.cfg, accountId);
52
+ return {
53
+ accountId,
54
+ enabled: baseEnabled && merged.enabled !== false,
55
+ merged,
56
+ profile: resolveProfile(merged, accountId)
57
+ };
58
+ }
59
+ function resolveZalouserAccountSync(params) {
60
+ const { accountId, enabled, merged, profile } = resolveZalouserAccountBase(params);
61
+ return {
62
+ accountId,
63
+ name: normalizeOptionalString(merged.name),
64
+ enabled,
65
+ profile,
66
+ authenticated: false,
67
+ config: merged
68
+ };
69
+ }
70
+ async function checkZcaAuthenticated(profile) {
71
+ return await (await loadZalouserAccountsRuntime()).checkZaloAuthenticated(profile);
72
+ }
73
+ //#endregion
18
74
  //#region extensions/zalouser/src/qr-temp-file.ts
19
75
  async function writeQrDataUrlToTempFile(qrDataUrl, profile) {
20
76
  const base64 = (qrDataUrl.trim().match(/^data:image\/png;base64,(.+)$/i)?.[1] ?? "").trim();
@@ -157,4 +213,4 @@ function createZalouserPluginBase(params) {
157
213
  };
158
214
  }
159
215
  //#endregion
160
- export { DEFAULT_ACCOUNT_ID as a, isNumericTargetId as c, writeQrDataUrlToTempFile as i, normalizeAccountId as l, createZalouserSetupWizardProxy as n, chunkTextForOutbound as o, zalouserSetupAdapter as r, isDangerousNameMatchingEnabled$1 as s, createZalouserPluginBase as t, sendPayloadWithChunkedTextAndMedia as u };
216
+ export { DEFAULT_ACCOUNT_ID$1 as a, isNumericTargetId as c, checkZcaAuthenticated as d, listZalouserAccountIds as f, writeQrDataUrlToTempFile as i, normalizeAccountId$1 as l, resolveZalouserAccountSync as m, createZalouserSetupWizardProxy as n, chunkTextForOutbound as o, resolveDefaultZalouserAccountId as p, zalouserSetupAdapter as r, isDangerousNameMatchingEnabled$1 as s, createZalouserPluginBase as t, sendPayloadWithChunkedTextAndMedia as u };
@@ -5,6 +5,7 @@ import { randomUUID } from "node:crypto";
5
5
  import fs from "node:fs";
6
6
  import os from "node:os";
7
7
  import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
8
+ import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
8
9
  import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
9
10
  import { privateFileStoreSync, readRegularFileSync, statRegularFileSync, withTimeout } from "openclaw/plugin-sdk/security-runtime";
10
11
  import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
@@ -238,8 +239,8 @@ function toNonNegativeInteger(value) {
238
239
  return normalized >= 0 ? normalized : null;
239
240
  }
240
241
  if (typeof value === "string" && value.trim().length > 0) {
241
- const parsed = Number.parseInt(value.trim(), 10);
242
- if (Number.isFinite(parsed)) return parsed >= 0 ? parsed : null;
242
+ const parsed = parseStrictNonNegativeInteger(value);
243
+ if (parsed !== void 0) return parsed >= 0 ? parsed : null;
243
244
  }
244
245
  return null;
245
246
  }
@@ -98,6 +98,9 @@ class Range {
98
98
  }
99
99
 
100
100
  parseRange (range) {
101
+ // strip build metadata so it can't bleed into the version
102
+ range = range.replace(BUILDSTRIPRE, '')
103
+
101
104
  // memoize range parsing for performance.
102
105
  // this is a very hot path, and fully deterministic.
103
106
  const memoOpts =
@@ -223,6 +226,7 @@ const debug = require('../internal/debug')
223
226
  const SemVer = require('./semver')
224
227
  const {
225
228
  safeRe: re,
229
+ src,
226
230
  t,
227
231
  comparatorTrimReplace,
228
232
  tildeTrimReplace,
@@ -230,6 +234,9 @@ const {
230
234
  } = require('../internal/re')
231
235
  const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')
232
236
 
237
+ // unbounded global build-metadata stripper used by parseRange
238
+ const BUILDSTRIPRE = new RegExp(src[t.BUILD], 'g')
239
+
233
240
  const isNullSet = c => c.value === '<0.0.0-0'
234
241
  const isAny = c => c.value === ''
235
242
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semver",
3
- "version": "7.8.0",
3
+ "version": "7.8.1",
4
4
  "description": "The semantic version parser used by npm.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -174,7 +174,7 @@ const simpleSubset = (sub, dom, options) => {
174
174
  if (higher === c && higher !== gt) {
175
175
  return false
176
176
  }
177
- } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
177
+ } else if (gt.operator === '>=' && !c.test(gt.semver)) {
178
178
  return false
179
179
  }
180
180
  }
@@ -192,7 +192,7 @@ const simpleSubset = (sub, dom, options) => {
192
192
  if (lower === c && lower !== lt) {
193
193
  return false
194
194
  }
195
- } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
195
+ } else if (lt.operator === '<=' && !c.test(lt.semver)) {
196
196
  return false
197
197
  }
198
198
  }
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@openclaw/zalouser",
3
- "version": "2026.5.27",
3
+ "version": "2026.5.28-beta.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/zalouser",
9
- "version": "2026.5.27",
9
+ "version": "2026.5.28-beta.1",
10
10
  "dependencies": {
11
11
  "typebox": "1.1.38",
12
12
  "zca-js": "2.1.2",
13
13
  "zod": "4.4.3"
14
14
  },
15
15
  "peerDependencies": {
16
- "openclaw": ">=2026.5.27"
16
+ "openclaw": ">=2026.5.28-beta.1"
17
17
  },
18
18
  "peerDependenciesMeta": {
19
19
  "openclaw": {
@@ -356,9 +356,9 @@
356
356
  "license": "MIT"
357
357
  },
358
358
  "node_modules/semver": {
359
- "version": "7.8.0",
360
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz",
361
- "integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==",
359
+ "version": "7.8.1",
360
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.1.tgz",
361
+ "integrity": "sha512-rkVq3IXh+4FDGch+KwzX3aV9W3kO54GyEgpvBzSyctDA6Xtd7RJQV1xmXbeQp5v7+VzLOfVqiutSE6GICgPFvg==",
362
362
  "license": "ISC",
363
363
  "bin": {
364
364
  "semver": "bin/semver.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/zalouser",
3
- "version": "2026.5.27",
3
+ "version": "2026.5.28-beta.1",
4
4
  "description": "OpenClaw Zalo Personal Account plugin via native zca-js integration.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,7 +13,7 @@
13
13
  "zod": "4.4.3"
14
14
  },
15
15
  "peerDependencies": {
16
- "openclaw": ">=2026.5.27"
16
+ "openclaw": ">=2026.5.28-beta.1"
17
17
  },
18
18
  "peerDependenciesMeta": {
19
19
  "openclaw": {
@@ -50,10 +50,10 @@
50
50
  "minHostVersion": ">=2026.4.10"
51
51
  },
52
52
  "compat": {
53
- "pluginApi": ">=2026.5.27"
53
+ "pluginApi": ">=2026.5.28-beta.1"
54
54
  },
55
55
  "build": {
56
- "openclawVersion": "2026.5.27"
56
+ "openclawVersion": "2026.5.28-beta.1"
57
57
  },
58
58
  "release": {
59
59
  "publishToClawHub": true,
@@ -1,66 +0,0 @@
1
- import { DEFAULT_ACCOUNT_ID, createAccountListHelpers, normalizeAccountId, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
2
- import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
- //#region extensions/zalouser/src/accounts.ts
4
- let zalouserAccountsRuntimePromise;
5
- async function loadZalouserAccountsRuntime() {
6
- zalouserAccountsRuntimePromise ??= import("./accounts.runtime-B8IJHMI7.js");
7
- return await zalouserAccountsRuntimePromise;
8
- }
9
- const { listAccountIds: listZalouserAccountIds, resolveDefaultAccountId: resolveDefaultZalouserAccountId } = createAccountListHelpers("zalouser", { implicitDefaultAccount: {
10
- channelKeys: ["profile"],
11
- envVars: ["ZALOUSER_PROFILE", "ZCA_PROFILE"]
12
- } });
13
- function mergeZalouserAccountConfig(cfg, accountId) {
14
- const merged = resolveMergedAccountConfig({
15
- channelConfig: cfg.channels?.zalouser,
16
- accounts: (cfg.channels?.zalouser)?.accounts,
17
- accountId,
18
- omitKeys: ["defaultAccount"]
19
- });
20
- return {
21
- ...merged,
22
- groupPolicy: merged.groupPolicy ?? "allowlist"
23
- };
24
- }
25
- function resolveProfile(config, accountId) {
26
- if (config.profile?.trim()) return config.profile.trim();
27
- if (process.env.ZALOUSER_PROFILE?.trim()) return process.env.ZALOUSER_PROFILE.trim();
28
- if (process.env.ZCA_PROFILE?.trim()) return process.env.ZCA_PROFILE.trim();
29
- if (accountId !== DEFAULT_ACCOUNT_ID) return accountId;
30
- return "default";
31
- }
32
- function resolveZalouserAccountBase(params) {
33
- const accountId = normalizeAccountId(params.accountId ?? resolveDefaultZalouserAccountId(params.cfg));
34
- const baseEnabled = (params.cfg.channels?.zalouser)?.enabled !== false;
35
- const merged = mergeZalouserAccountConfig(params.cfg, accountId);
36
- return {
37
- accountId,
38
- enabled: baseEnabled && merged.enabled !== false,
39
- merged,
40
- profile: resolveProfile(merged, accountId)
41
- };
42
- }
43
- function resolveZalouserAccountSync(params) {
44
- const { accountId, enabled, merged, profile } = resolveZalouserAccountBase(params);
45
- return {
46
- accountId,
47
- name: normalizeOptionalString(merged.name),
48
- enabled,
49
- profile,
50
- authenticated: false,
51
- config: merged
52
- };
53
- }
54
- async function getZcaUserInfo(profile) {
55
- const info = await (await loadZalouserAccountsRuntime()).getZaloUserInfo(profile);
56
- if (!info) return null;
57
- return {
58
- userId: info.userId,
59
- displayName: info.displayName
60
- };
61
- }
62
- async function checkZcaAuthenticated(profile) {
63
- return await (await loadZalouserAccountsRuntime()).checkZaloAuthenticated(profile);
64
- }
65
- //#endregion
66
- export { resolveZalouserAccountSync as a, resolveDefaultZalouserAccountId as i, getZcaUserInfo as n, listZalouserAccountIds as r, checkZcaAuthenticated as t };
@@ -1,92 +0,0 @@
1
- import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
2
- import { buildChannelOutboundSessionRoute } from "openclaw/plugin-sdk/core";
3
- //#region extensions/zalouser/src/session-route.ts
4
- function stripZalouserTargetPrefix(raw) {
5
- return raw.trim().replace(/^(zalouser|zlu):/i, "").trim();
6
- }
7
- function normalizeZalouserTarget(raw) {
8
- const trimmed = stripZalouserTargetPrefix(raw);
9
- if (!trimmed) return;
10
- const lower = normalizeLowercaseStringOrEmpty(trimmed);
11
- if (lower.startsWith("group:")) {
12
- const id = trimmed.slice(6).trim();
13
- return id ? `group:${id}` : void 0;
14
- }
15
- if (lower.startsWith("g:")) {
16
- const id = trimmed.slice(2).trim();
17
- return id ? `group:${id}` : void 0;
18
- }
19
- if (lower.startsWith("user:")) {
20
- const id = trimmed.slice(5).trim();
21
- return id ? `user:${id}` : void 0;
22
- }
23
- if (lower.startsWith("dm:")) {
24
- const id = trimmed.slice(3).trim();
25
- return id ? `user:${id}` : void 0;
26
- }
27
- if (lower.startsWith("u:")) {
28
- const id = trimmed.slice(2).trim();
29
- return id ? `user:${id}` : void 0;
30
- }
31
- if (/^g-\S+$/i.test(trimmed)) return `group:${trimmed}`;
32
- if (/^u-\S+$/i.test(trimmed)) return `user:${trimmed}`;
33
- return trimmed;
34
- }
35
- function parseZalouserOutboundTarget(raw) {
36
- const normalized = normalizeZalouserTarget(raw);
37
- if (!normalized) throw new Error("Zalouser target is required");
38
- const lowered = normalizeLowercaseStringOrEmpty(normalized);
39
- if (lowered.startsWith("group:")) {
40
- const threadId = normalized.slice(6).trim();
41
- if (!threadId) throw new Error("Zalouser group target is missing group id");
42
- return {
43
- threadId,
44
- isGroup: true
45
- };
46
- }
47
- if (lowered.startsWith("user:")) {
48
- const threadId = normalized.slice(5).trim();
49
- if (!threadId) throw new Error("Zalouser user target is missing user id");
50
- return {
51
- threadId,
52
- isGroup: false
53
- };
54
- }
55
- return {
56
- threadId: normalized,
57
- isGroup: false
58
- };
59
- }
60
- function parseZalouserDirectoryGroupId(raw) {
61
- const normalized = normalizeZalouserTarget(raw);
62
- if (!normalized) throw new Error("Zalouser group target is required");
63
- const lowered = normalizeLowercaseStringOrEmpty(normalized);
64
- if (lowered.startsWith("group:")) {
65
- const groupId = normalized.slice(6).trim();
66
- if (!groupId) throw new Error("Zalouser group target is missing group id");
67
- return groupId;
68
- }
69
- if (lowered.startsWith("user:")) throw new Error("Zalouser group members lookup requires a group target (group:<id>)");
70
- return normalized;
71
- }
72
- function resolveZalouserOutboundSessionRoute(params) {
73
- const normalized = normalizeZalouserTarget(params.target);
74
- if (!normalized) return null;
75
- const isGroup = (normalizeOptionalLowercaseString(normalized) ?? "").startsWith("group:");
76
- const peerId = normalized.replace(/^(group|user):/i, "").trim();
77
- return buildChannelOutboundSessionRoute({
78
- cfg: params.cfg,
79
- agentId: params.agentId,
80
- channel: "zalouser",
81
- accountId: params.accountId,
82
- peer: {
83
- kind: isGroup ? "group" : "direct",
84
- id: peerId
85
- },
86
- chatType: isGroup ? "group" : "direct",
87
- from: isGroup ? `zalouser:group:${peerId}` : `zalouser:${peerId}`,
88
- to: `zalouser:${peerId}`
89
- });
90
- }
91
- //#endregion
92
- export { resolveZalouserOutboundSessionRoute as i, parseZalouserDirectoryGroupId as n, parseZalouserOutboundTarget as r, normalizeZalouserTarget as t };
package/dist/test-api.js DELETED
@@ -1,5 +0,0 @@
1
- import { a as resolveZalouserAccountSync, i as resolveDefaultZalouserAccountId, n as getZcaUserInfo, r as listZalouserAccountIds, t as checkZcaAuthenticated } from "./accounts-C1OmvrPK.js";
2
- import { r as parseZalouserOutboundTarget } from "./session-route-Bp8b300d.js";
3
- import { a as listZaloGroupMembers, b as waitForZaloQrLogin, c as logoutZaloProfile, d as resolveZaloGroupsByEntries, i as listZaloFriendsMatching, l as resolveZaloAllowFromEntries, n as getZaloUserInfo, s as listZaloGroupsMatching, t as checkZaloAuthenticated, y as startZaloQrLogin } from "./zalo-js-C3Wijq_z.js";
4
- import { i as sendMessageZalouser } from "./send-CbTBtzZQ.js";
5
- export { checkZaloAuthenticated, checkZcaAuthenticated, getZaloUserInfo, getZcaUserInfo, listZaloFriendsMatching, listZaloGroupMembers, listZaloGroupsMatching, listZalouserAccountIds, logoutZaloProfile, parseZalouserOutboundTarget, resolveDefaultZalouserAccountId, resolveZaloAllowFromEntries, resolveZaloGroupsByEntries, resolveZalouserAccountSync, sendMessageZalouser, startZaloQrLogin, waitForZaloQrLogin };