@openclaw/googlechat 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/{actions-CSUbe7VX.js → actions-D-PNwmYx.js} +3 -3
- package/dist/{api-BwM7NTay.js → api-AErsImS_.js} +1 -1
- package/dist/api.js +1 -1
- package/dist/{channel-DHHatGQ1.js → channel-9lvRWX6T.js} +6 -6
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-CRRchMB8.js → channel.runtime-CK4QbJkn.js} +128 -128
- package/dist/{runtime-api-JpbBRVpx.js → runtime-api-DMEzhesS.js} +2 -3
- package/dist/runtime-api.js +2 -2
- package/dist/{targets-14IVp2Yg.js → targets-qggOq6n-.js} +1 -1
- package/dist/test-api.js +2 -2
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as resolveGoogleChatAccount, t as listEnabledGoogleChatAccounts } from "./accounts-BbM9zX1S.js";
|
|
2
|
-
import {
|
|
3
|
-
import { c as sendGoogleChatMessage, o as listGoogleChatReactions, r as deleteGoogleChatReaction, t as createGoogleChatReaction, u as uploadGoogleChatAttachment } from "./api-
|
|
4
|
-
import { i as resolveGoogleChatOutboundSpace } from "./targets-
|
|
2
|
+
import { P as getGoogleChatRuntime } from "./runtime-api-DMEzhesS.js";
|
|
3
|
+
import { c as sendGoogleChatMessage, o as listGoogleChatReactions, r as deleteGoogleChatReaction, t as createGoogleChatReaction, u as uploadGoogleChatAttachment } from "./api-AErsImS_.js";
|
|
4
|
+
import { i as resolveGoogleChatOutboundSpace } from "./targets-qggOq6n-.js";
|
|
5
5
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
6
6
|
import { createActionGate, jsonResult, readNumberParam, readReactionParams, readStringParam } from "openclaw/plugin-sdk/channel-actions";
|
|
7
7
|
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as fetchWithSsrFGuard$1 } from "./runtime-api-DMEzhesS.js";
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty, resolveUserPath } from "openclaw/plugin-sdk/text-runtime";
|
|
3
3
|
import crypto from "node:crypto";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as googlechatPlugin } from "./channel-
|
|
1
|
+
import { t as googlechatPlugin } from "./channel-9lvRWX6T.js";
|
|
2
2
|
import { n as googlechatSetupAdapter, t as googlechatSetupWizard } from "./setup-surface-S4ArLnR8.js";
|
|
3
3
|
export { googlechatPlugin, googlechatSetupAdapter, googlechatSetupWizard };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as resolveGoogleChatConfigAccessorAccount, i as resolveGoogleChatAccount, n as listGoogleChatAccountIds, r as resolveDefaultGoogleChatAccountId } from "./accounts-BbM9zX1S.js";
|
|
2
|
-
import {
|
|
3
|
-
import { i as resolveGoogleChatOutboundSpace, n as isGoogleChatUserTarget, r as normalizeGoogleChatTarget, t as isGoogleChatSpaceTarget } from "./targets-
|
|
2
|
+
import { T as resolveChannelMediaMaxBytes, _ as loadOutboundMediaFromUrl, a as buildChannelConfigSchema, i as PAIRING_APPROVED_MESSAGE, o as chunkTextForOutbound, p as fetchRemoteMedia, r as GoogleChatConfigSchema, t as DEFAULT_ACCOUNT_ID, v as missingTargetError } from "./runtime-api-DMEzhesS.js";
|
|
3
|
+
import { i as resolveGoogleChatOutboundSpace, n as isGoogleChatUserTarget, r as normalizeGoogleChatTarget, t as isGoogleChatSpaceTarget } from "./targets-qggOq6n-.js";
|
|
4
4
|
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BsERSjSe.js";
|
|
5
5
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DLAG2_NI.js";
|
|
6
6
|
import { n as googlechatSetupAdapter, t as googlechatSetupWizard } from "./setup-surface-S4ArLnR8.js";
|
|
@@ -54,7 +54,7 @@ function resolveGoogleChatGroupRequireMention(params) {
|
|
|
54
54
|
}
|
|
55
55
|
//#endregion
|
|
56
56
|
//#region extensions/googlechat/src/channel.adapters.ts
|
|
57
|
-
const loadGoogleChatChannelRuntime$2 = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
57
|
+
const loadGoogleChatChannelRuntime$2 = createLazyRuntimeNamedExport(() => import("./channel.runtime-CK4QbJkn.js"), "googleChatChannelRuntime");
|
|
58
58
|
function createGoogleChatSendReceipt(params) {
|
|
59
59
|
const messageId = params.messageId?.trim();
|
|
60
60
|
return createMessageReceiptFromOutboundResults({
|
|
@@ -295,7 +295,7 @@ const collectGoogleChatMutableAllowlistWarnings = createDangerousNameMatchingMut
|
|
|
295
295
|
});
|
|
296
296
|
//#endregion
|
|
297
297
|
//#region extensions/googlechat/src/gateway.ts
|
|
298
|
-
const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
298
|
+
const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-CK4QbJkn.js"), "googleChatChannelRuntime");
|
|
299
299
|
async function startGoogleChatGatewayAccount(ctx) {
|
|
300
300
|
const account = ctx.account;
|
|
301
301
|
const statusSink = createAccountStatusSink({
|
|
@@ -335,7 +335,7 @@ async function startGoogleChatGatewayAccount(ctx) {
|
|
|
335
335
|
}
|
|
336
336
|
//#endregion
|
|
337
337
|
//#region extensions/googlechat/src/channel.ts
|
|
338
|
-
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
338
|
+
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CK4QbJkn.js"), "googleChatChannelRuntime");
|
|
339
339
|
const meta = {
|
|
340
340
|
id: "googlechat",
|
|
341
341
|
label: "Google Chat",
|
|
@@ -391,7 +391,7 @@ const googlechatActions = {
|
|
|
391
391
|
},
|
|
392
392
|
extractToolSend: ({ args }) => extractToolSend(args, "sendMessage"),
|
|
393
393
|
handleAction: async (ctx) => {
|
|
394
|
-
const { googlechatMessageActions } = await import("./actions-
|
|
394
|
+
const { googlechatMessageActions } = await import("./actions-D-PNwmYx.js");
|
|
395
395
|
if (!googlechatMessageActions.handleAction) throw new Error("Google Chat actions are not available.");
|
|
396
396
|
return await googlechatMessageActions.handleAction(ctx);
|
|
397
397
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as buildChannelConfigSchema, r as GoogleChatConfigSchema } from "./runtime-api-
|
|
1
|
+
import { a as buildChannelConfigSchema, r as GoogleChatConfigSchema } from "./runtime-api-DMEzhesS.js";
|
|
2
2
|
//#region extensions/googlechat/src/config-schema.ts
|
|
3
3
|
const GoogleChatChannelConfigSchema = buildChannelConfigSchema(GoogleChatConfigSchema);
|
|
4
4
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as googlechatPlugin } from "./channel-
|
|
1
|
+
import { t as googlechatPlugin } from "./channel-9lvRWX6T.js";
|
|
2
2
|
export { googlechatPlugin };
|
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as sendGoogleChatMessage, d as verifyGoogleChatRequest, i as downloadGoogleChatMedia, l as updateGoogleChatMessage, n as deleteGoogleChatMessage, s as probeGoogleChat, u as uploadGoogleChatAttachment } from "./api-
|
|
3
|
-
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime";
|
|
4
|
-
import { resolveInboundMentionDecision } from "openclaw/plugin-sdk/channel-inbound";
|
|
1
|
+
import { E as resolveDefaultGroupPolicy, M as warnMissingProviderGroupPolicyFallbackOnce, O as resolveInboundRouteEnvelopeBuilderWithRuntime, P as getGoogleChatRuntime, h as isDangerousNameMatchingEnabled, k as resolveWebhookPath, n as GROUP_POLICY_BLOCKED_LABEL, u as createChannelPairingController, w as resolveAllowlistProviderRuntimeGroupPolicy } from "./runtime-api-DMEzhesS.js";
|
|
2
|
+
import { c as sendGoogleChatMessage, d as verifyGoogleChatRequest, i as downloadGoogleChatMedia, l as updateGoogleChatMessage, n as deleteGoogleChatMessage, s as probeGoogleChat, u as uploadGoogleChatAttachment } from "./api-AErsImS_.js";
|
|
3
|
+
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/text-runtime";
|
|
5
4
|
import { registerWebhookTargetWithPluginRoute, resolveWebhookTargetWithAuthOrReject, withResolvedWebhookRequestPipeline } from "openclaw/plugin-sdk/webhook-targets";
|
|
6
5
|
import { createWebhookInFlightLimiter, readJsonWebhookBodyOrReject } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
7
|
-
import {
|
|
6
|
+
import { channelIngressRoutes, createChannelIngressResolver, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
8
7
|
import { deliverTextOrMediaReply, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
9
|
-
//#region extensions/googlechat/src/sender-allow.ts
|
|
10
|
-
function normalizeUserId$1(raw) {
|
|
11
|
-
const trimmed = typeof raw === "string" ? raw.trim() : "";
|
|
12
|
-
if (!trimmed) return "";
|
|
13
|
-
return normalizeLowercaseStringOrEmpty(trimmed.replace(/^users\//i, ""));
|
|
14
|
-
}
|
|
15
|
-
function isEmailLike(value) {
|
|
16
|
-
return value.includes("@");
|
|
17
|
-
}
|
|
18
|
-
function isSenderAllowed(senderId, senderEmail, allowFrom, allowNameMatching = false) {
|
|
19
|
-
if (allowFrom.includes("*")) return true;
|
|
20
|
-
const normalizedSenderId = normalizeUserId$1(senderId);
|
|
21
|
-
const normalizedEmail = normalizeLowercaseStringOrEmpty(senderEmail ?? "");
|
|
22
|
-
return allowFrom.some((entry) => {
|
|
23
|
-
const normalized = normalizeLowercaseStringOrEmpty(entry);
|
|
24
|
-
if (!normalized) return false;
|
|
25
|
-
const withoutPrefix = normalized.replace(/^(googlechat|google-chat|gchat):/i, "");
|
|
26
|
-
if (withoutPrefix.startsWith("users/")) return normalizeUserId$1(withoutPrefix) === normalizedSenderId;
|
|
27
|
-
if (allowNameMatching && normalizedEmail && isEmailLike(withoutPrefix)) return withoutPrefix === normalizedEmail;
|
|
28
|
-
return withoutPrefix.replace(/^users\//i, "") === normalizedSenderId;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
8
|
//#region extensions/googlechat/src/monitor-access.ts
|
|
33
9
|
function normalizeUserId(raw) {
|
|
34
10
|
const trimmed = normalizeOptionalString(raw) ?? "";
|
|
35
11
|
if (!trimmed) return "";
|
|
36
12
|
return normalizeLowercaseStringOrEmpty(trimmed.replace(/^users\//i, ""));
|
|
37
13
|
}
|
|
14
|
+
const GOOGLECHAT_EMAIL_KIND = "plugin:googlechat-email";
|
|
15
|
+
function normalizeEntryValue(raw) {
|
|
16
|
+
return normalizeLowercaseStringOrEmpty(raw ?? "");
|
|
17
|
+
}
|
|
18
|
+
function normalizeGoogleChatStableEntry(entry) {
|
|
19
|
+
const withoutProvider = normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "");
|
|
20
|
+
if (!withoutProvider) return null;
|
|
21
|
+
return withoutProvider.startsWith("users/") ? normalizeUserId(withoutProvider) : withoutProvider;
|
|
22
|
+
}
|
|
23
|
+
function normalizeGoogleChatEmailEntry(entry) {
|
|
24
|
+
if (normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "").startsWith("users/")) return null;
|
|
25
|
+
const stable = normalizeGoogleChatStableEntry(entry);
|
|
26
|
+
return stable?.includes("@") ? stable : null;
|
|
27
|
+
}
|
|
28
|
+
const googleChatIngressIdentity = defineStableChannelIngressIdentity({
|
|
29
|
+
key: "sender-id",
|
|
30
|
+
normalizeEntry: normalizeGoogleChatStableEntry,
|
|
31
|
+
normalizeSubject: normalizeUserId,
|
|
32
|
+
aliases: [{
|
|
33
|
+
key: "email",
|
|
34
|
+
kind: GOOGLECHAT_EMAIL_KIND,
|
|
35
|
+
normalizeEntry: normalizeGoogleChatEmailEntry,
|
|
36
|
+
normalizeSubject: normalizeEntryValue,
|
|
37
|
+
dangerous: true
|
|
38
|
+
}],
|
|
39
|
+
isWildcardEntry: (entry) => normalizeEntryValue(entry) === "*",
|
|
40
|
+
resolveEntryId: ({ entryIndex, fieldKey }) => fieldKey === "stableId" ? `entry-${entryIndex + 1}:user` : `entry-${entryIndex + 1}:${fieldKey}`
|
|
41
|
+
});
|
|
38
42
|
function resolveGroupConfig(params) {
|
|
39
43
|
const { groupId, groupName, groups } = params;
|
|
40
44
|
const entries = groups ?? {};
|
|
@@ -121,120 +125,116 @@ async function applyGoogleChatInboundAccessPolicy(params) {
|
|
|
121
125
|
});
|
|
122
126
|
const groupEntry = groupConfigResolved.entry;
|
|
123
127
|
const groupUsers = groupEntry?.users ?? account.config.groupAllowFrom ?? [];
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
let effectiveWasMentioned;
|
|
129
|
+
const dmPolicy = account.config.dm?.policy ?? "pairing";
|
|
130
|
+
const rawConfigAllowFrom = normalizeStringEntries(account.config.dm?.allowFrom);
|
|
131
|
+
const shouldComputeAuth = core.channel.commands.shouldComputeCommandAuthorized(rawBody, config);
|
|
132
|
+
const groupActivation = (() => {
|
|
133
|
+
if (!isGroup) return;
|
|
134
|
+
const requireMention = groupEntry?.requireMention ?? account.config.requireMention ?? true;
|
|
135
|
+
const mentionInfo = extractMentionInfo(message.annotations ?? [], account.config.botUser);
|
|
136
|
+
return {
|
|
137
|
+
requireMention,
|
|
138
|
+
allowTextCommands: core.channel.commands.shouldHandleTextCommands({
|
|
139
|
+
cfg: config,
|
|
140
|
+
surface: "googlechat"
|
|
141
|
+
}),
|
|
142
|
+
hasControlCommand: core.channel.text.hasControlCommand(rawBody, config),
|
|
143
|
+
wasMentioned: mentionInfo.wasMentioned,
|
|
144
|
+
hasAnyMention: mentionInfo.hasAnyMention
|
|
145
|
+
};
|
|
146
|
+
})();
|
|
147
|
+
const command = {
|
|
148
|
+
hasControlCommand: groupActivation?.hasControlCommand ?? shouldComputeAuth,
|
|
149
|
+
groupOwnerAllowFrom: "none"
|
|
150
|
+
};
|
|
151
|
+
const groupAllowFrom = normalizeStringEntries(groupUsers);
|
|
152
|
+
const senderGroupPolicy = groupConfigResolved.allowlistConfigured && groupAllowFrom.length === 0 ? groupPolicy : groupPolicy === "disabled" ? "disabled" : groupAllowFrom.length > 0 ? "allowlist" : "open";
|
|
153
|
+
const route = channelIngressRoutes(isGroup && groupPolicy !== "disabled" && groupEntry?.enabled === false && {
|
|
154
|
+
id: "googlechat:space",
|
|
155
|
+
enabled: false,
|
|
156
|
+
matched: true,
|
|
157
|
+
matchId: "googlechat-space",
|
|
158
|
+
blockReason: "route_disabled"
|
|
159
|
+
}, isGroup && groupPolicy === "allowlist" && groupEntry?.enabled !== false && !groupConfigResolved.allowlistConfigured && {
|
|
160
|
+
id: "googlechat:space",
|
|
161
|
+
allowed: false,
|
|
162
|
+
blockReason: "empty_allowlist"
|
|
163
|
+
}, isGroup && groupPolicy === "allowlist" && groupEntry?.enabled !== false && groupConfigResolved.allowlistConfigured && {
|
|
164
|
+
id: "googlechat:space",
|
|
165
|
+
senderPolicy: "deny-when-empty",
|
|
166
|
+
...groupEntry ? { senderAllowFromSource: "effective-group" } : {},
|
|
167
|
+
allowed: Boolean(groupEntry),
|
|
168
|
+
matchId: "googlechat-space",
|
|
169
|
+
blockReason: groupEntry ? "sender_empty_allowlist" : "route_not_allowlisted"
|
|
170
|
+
});
|
|
171
|
+
const resolvedAccess = await createChannelIngressResolver({
|
|
172
|
+
channelId: "googlechat",
|
|
129
173
|
accountId: account.accountId,
|
|
130
|
-
|
|
131
|
-
|
|
174
|
+
identity: googleChatIngressIdentity,
|
|
175
|
+
cfg: config,
|
|
176
|
+
readStoreAllowFrom: pairing.readAllowFromStore
|
|
177
|
+
}).message({
|
|
178
|
+
subject: {
|
|
179
|
+
stableId: senderId,
|
|
180
|
+
aliases: { email: senderEmail }
|
|
181
|
+
},
|
|
182
|
+
conversation: {
|
|
183
|
+
kind: isGroup ? "group" : "direct",
|
|
184
|
+
id: spaceId
|
|
185
|
+
},
|
|
186
|
+
route,
|
|
187
|
+
allowFrom: rawConfigAllowFrom,
|
|
188
|
+
groupAllowFrom,
|
|
189
|
+
dmPolicy,
|
|
190
|
+
groupPolicy: senderGroupPolicy,
|
|
191
|
+
policy: {
|
|
192
|
+
groupAllowFromFallbackToAllowFrom: false,
|
|
193
|
+
mutableIdentifierMatching: allowNameMatching ? "enabled" : "disabled",
|
|
194
|
+
...groupActivation ? { activation: {
|
|
195
|
+
requireMention: groupActivation.requireMention,
|
|
196
|
+
allowTextCommands: groupActivation.allowTextCommands
|
|
197
|
+
} } : {}
|
|
198
|
+
},
|
|
199
|
+
...groupActivation == null ? {} : { mentionFacts: {
|
|
200
|
+
canDetectMention: true,
|
|
201
|
+
wasMentioned: groupActivation.wasMentioned,
|
|
202
|
+
hasAnyMention: groupActivation.hasAnyMention,
|
|
203
|
+
implicitMentionKinds: []
|
|
204
|
+
} },
|
|
205
|
+
command
|
|
132
206
|
});
|
|
133
|
-
|
|
207
|
+
const senderAccess = resolvedAccess.senderAccess;
|
|
208
|
+
const commandAuthorized = resolvedAccess.commandAccess.requested ? resolvedAccess.commandAccess.authorized : void 0;
|
|
134
209
|
if (isGroup) {
|
|
135
210
|
if (groupConfigResolved.deprecatedNameMatch) {
|
|
136
211
|
logVerbose(`drop group message (deprecated mutable group key matched, space=${spaceId})`);
|
|
137
212
|
return { ok: false };
|
|
138
213
|
}
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
groupPolicy,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
routeEnabled: groupEntry?.enabled !== false
|
|
145
|
-
});
|
|
146
|
-
if (!routeAccess.allowed) {
|
|
147
|
-
if (routeAccess.reason === "disabled") logVerbose(`drop group message (groupPolicy=disabled, space=${spaceId})`);
|
|
148
|
-
else if (routeAccess.reason === "empty_allowlist") logVerbose(`drop group message (groupPolicy=allowlist, no allowlist, space=${spaceId})`);
|
|
149
|
-
else if (routeAccess.reason === "route_not_allowlisted") logVerbose(`drop group message (not allowlisted, space=${spaceId})`);
|
|
150
|
-
else if (routeAccess.reason === "route_disabled") logVerbose(`drop group message (space disabled, space=${spaceId})`);
|
|
214
|
+
const routeBlockReason = resolvedAccess.routeAccess.reason;
|
|
215
|
+
if (routeBlockReason && routeBlockReason !== "sender_empty_allowlist") {
|
|
216
|
+
if (routeBlockReason === "empty_allowlist") logVerbose(`drop group message (groupPolicy=allowlist, no allowlist, space=${spaceId})`);
|
|
217
|
+
else if (routeBlockReason === "route_not_allowlisted") logVerbose(`drop group message (not allowlisted, space=${spaceId})`);
|
|
218
|
+
else if (routeBlockReason === "route_disabled") logVerbose(`drop group message (space disabled, space=${spaceId})`);
|
|
151
219
|
return { ok: false };
|
|
152
220
|
}
|
|
153
|
-
if (
|
|
154
|
-
warnDeprecatedUsersEmailEntries(logVerbose,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return { ok: false };
|
|
158
|
-
}
|
|
221
|
+
if (senderAccess.effectiveGroupAllowFrom.length > 0 && senderAccess.decision !== "allow") {
|
|
222
|
+
warnDeprecatedUsersEmailEntries(logVerbose, senderAccess.effectiveGroupAllowFrom);
|
|
223
|
+
logVerbose(`drop group message (sender not allowed, ${senderId})`);
|
|
224
|
+
return { ok: false };
|
|
159
225
|
}
|
|
160
226
|
}
|
|
161
|
-
const
|
|
162
|
-
const rawConfigAllowFrom = (account.config.dm?.allowFrom ?? []).map((v) => String(v));
|
|
163
|
-
const normalizedGroupUsers = expandedGroupUsers;
|
|
164
|
-
const senderGroupPolicy = groupConfigResolved.allowlistConfigured && normalizedGroupUsers.length === 0 ? groupPolicy : resolveSenderScopedGroupPolicy({
|
|
165
|
-
groupPolicy,
|
|
166
|
-
groupAllowFrom: normalizedGroupUsers
|
|
167
|
-
});
|
|
168
|
-
const shouldComputeAuth = core.channel.commands.shouldComputeCommandAuthorized(rawBody, config);
|
|
169
|
-
const storeAllowFrom = !isGroup && dmPolicy !== "allowlist" && dmPolicy !== "open" ? await pairing.readAllowFromStore().catch(() => []) : [];
|
|
170
|
-
const [configAllowFrom, effectiveStoreAllowFrom] = await Promise.all([expandAllowFromWithAccessGroups({
|
|
171
|
-
cfg: config,
|
|
172
|
-
allowFrom: rawConfigAllowFrom,
|
|
173
|
-
channel: "googlechat",
|
|
174
|
-
accountId: account.accountId,
|
|
175
|
-
senderId,
|
|
176
|
-
isSenderAllowed: isGoogleChatSenderAllowed
|
|
177
|
-
}), expandAllowFromWithAccessGroups({
|
|
178
|
-
cfg: config,
|
|
179
|
-
allowFrom: storeAllowFrom,
|
|
180
|
-
channel: "googlechat",
|
|
181
|
-
accountId: account.accountId,
|
|
182
|
-
senderId,
|
|
183
|
-
isSenderAllowed: isGoogleChatSenderAllowed
|
|
184
|
-
})]);
|
|
185
|
-
const access = resolveDmGroupAccessWithLists({
|
|
186
|
-
isGroup,
|
|
187
|
-
dmPolicy,
|
|
188
|
-
groupPolicy: senderGroupPolicy,
|
|
189
|
-
allowFrom: configAllowFrom,
|
|
190
|
-
groupAllowFrom: normalizedGroupUsers,
|
|
191
|
-
storeAllowFrom: effectiveStoreAllowFrom,
|
|
192
|
-
groupAllowFromFallbackToAllowFrom: false,
|
|
193
|
-
isSenderAllowed: (allowFrom) => isSenderAllowed(senderId, senderEmail, allowFrom, allowNameMatching)
|
|
194
|
-
});
|
|
195
|
-
const effectiveAllowFrom = access.effectiveAllowFrom;
|
|
196
|
-
const effectiveGroupAllowFrom = access.effectiveGroupAllowFrom;
|
|
227
|
+
const effectiveAllowFrom = senderAccess.effectiveAllowFrom;
|
|
197
228
|
warnDeprecatedUsersEmailEntries(logVerbose, effectiveAllowFrom);
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const commandAuthorized = shouldComputeAuth ? core.channel.commands.resolveCommandAuthorizedFromAuthorizers({
|
|
202
|
-
useAccessGroups,
|
|
203
|
-
authorizers: [{
|
|
204
|
-
configured: commandAllowFrom.length > 0,
|
|
205
|
-
allowed: senderAllowedForCommands
|
|
206
|
-
}]
|
|
207
|
-
}) : void 0;
|
|
208
|
-
if (isGroup) {
|
|
209
|
-
const requireMention = groupEntry?.requireMention ?? account.config.requireMention ?? true;
|
|
210
|
-
const mentionInfo = extractMentionInfo(message.annotations ?? [], account.config.botUser);
|
|
211
|
-
const allowTextCommands = core.channel.commands.shouldHandleTextCommands({
|
|
212
|
-
cfg: config,
|
|
213
|
-
surface: "googlechat"
|
|
214
|
-
});
|
|
215
|
-
const mentionDecision = resolveInboundMentionDecision({
|
|
216
|
-
facts: {
|
|
217
|
-
canDetectMention: true,
|
|
218
|
-
wasMentioned: mentionInfo.wasMentioned,
|
|
219
|
-
hasAnyMention: mentionInfo.hasAnyMention,
|
|
220
|
-
implicitMentionKinds: []
|
|
221
|
-
},
|
|
222
|
-
policy: {
|
|
223
|
-
isGroup: true,
|
|
224
|
-
requireMention,
|
|
225
|
-
allowTextCommands,
|
|
226
|
-
hasControlCommand: core.channel.text.hasControlCommand(rawBody, config),
|
|
227
|
-
commandAuthorized: commandAuthorized === true
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
effectiveWasMentioned = mentionDecision.effectiveWasMentioned;
|
|
231
|
-
if (mentionDecision.shouldSkip) {
|
|
229
|
+
if (isGroup && resolvedAccess.activationAccess.ran) {
|
|
230
|
+
effectiveWasMentioned = resolvedAccess.activationAccess.effectiveWasMentioned;
|
|
231
|
+
if (resolvedAccess.activationAccess.shouldSkip) {
|
|
232
232
|
logVerbose(`drop group message (mention required, space=${spaceId})`);
|
|
233
233
|
return { ok: false };
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
if (isGroup &&
|
|
237
|
-
logVerbose(`drop group message (sender policy blocked, reason=${
|
|
236
|
+
if (isGroup && senderAccess.decision !== "allow") {
|
|
237
|
+
logVerbose(`drop group message (sender policy blocked, reason=${resolvedAccess.ingress.reasonCode === "route_sender_empty" ? "groupPolicy=allowlist (empty allowlist)" : senderAccess.reasonCode}, space=${spaceId})`);
|
|
238
238
|
return { ok: false };
|
|
239
239
|
}
|
|
240
240
|
if (!isGroup) {
|
|
@@ -242,8 +242,8 @@ async function applyGoogleChatInboundAccessPolicy(params) {
|
|
|
242
242
|
logVerbose(`Blocked Google Chat DM from ${senderId} (dmPolicy=disabled)`);
|
|
243
243
|
return { ok: false };
|
|
244
244
|
}
|
|
245
|
-
if (
|
|
246
|
-
if (
|
|
245
|
+
if (senderAccess.decision !== "allow") {
|
|
246
|
+
if (senderAccess.decision === "pairing") await pairing.issueChallenge({
|
|
247
247
|
senderId,
|
|
248
248
|
senderIdLine: `Your Google Chat user id: ${senderId}`,
|
|
249
249
|
meta: {
|
|
@@ -7,7 +7,6 @@ import { missingTargetError } from "openclaw/plugin-sdk/channel-feedback";
|
|
|
7
7
|
import { createAccountStatusSink as createAccountStatusSink$1, runPassiveAccountLifecycle as runPassiveAccountLifecycle$1 } from "openclaw/plugin-sdk/channel-lifecycle";
|
|
8
8
|
import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
|
|
9
9
|
import { createChannelMessageReplyPipeline } from "openclaw/plugin-sdk/channel-message";
|
|
10
|
-
import { evaluateGroupRouteAccessForPolicy, resolveDmGroupAccessWithLists, resolveSenderScopedGroupPolicy } from "openclaw/plugin-sdk/channel-policy";
|
|
11
10
|
import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
|
|
12
11
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
13
12
|
import { GoogleChatConfigSchema } from "openclaw/plugin-sdk/bundled-channel-config-schema";
|
|
@@ -15,7 +14,7 @@ import { GROUP_POLICY_BLOCKED_LABEL, resolveAllowlistProviderRuntimeGroupPolicy,
|
|
|
15
14
|
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
16
15
|
import { fetchRemoteMedia, resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/media-runtime";
|
|
17
16
|
import { loadOutboundMediaFromUrl as loadOutboundMediaFromUrl$1 } from "openclaw/plugin-sdk/outbound-media";
|
|
18
|
-
import { resolveInboundMentionDecision
|
|
17
|
+
import { resolveInboundMentionDecision } from "openclaw/plugin-sdk/channel-inbound";
|
|
19
18
|
import { resolveInboundRouteEnvelopeBuilderWithRuntime } from "openclaw/plugin-sdk/inbound-envelope";
|
|
20
19
|
import { resolveWebhookPath } from "openclaw/plugin-sdk/webhook-path";
|
|
21
20
|
import { registerWebhookTargetWithPluginRoute as registerWebhookTargetWithPluginRoute$1, resolveWebhookTargetWithAuthOrReject as resolveWebhookTargetWithAuthOrReject$1, withResolvedWebhookRequestPipeline as withResolvedWebhookRequestPipeline$1 } from "openclaw/plugin-sdk/webhook-targets";
|
|
@@ -27,4 +26,4 @@ const { setRuntime: setGoogleChatRuntime, getRuntime: getGoogleChatRuntime } = c
|
|
|
27
26
|
errorMessage: "Google Chat runtime not initialized"
|
|
28
27
|
});
|
|
29
28
|
//#endregion
|
|
30
|
-
export {
|
|
29
|
+
export { resolveWebhookTargetWithAuthOrReject$1 as A, registerWebhookTargetWithPluginRoute$1 as C, resolveInboundMentionDecision as D, resolveDefaultGroupPolicy as E, setGoogleChatRuntime as F, warnMissingProviderGroupPolicyFallbackOnce as M, withResolvedWebhookRequestPipeline$1 as N, resolveInboundRouteEnvelopeBuilderWithRuntime as O, getGoogleChatRuntime as P, readStringParam$1 as S, resolveChannelMediaMaxBytes as T, loadOutboundMediaFromUrl$1 as _, buildChannelConfigSchema as a, readNumberParam$1 as b, createActionGate$1 as c, createWebhookInFlightLimiter$1 as d, extractToolSend$1 as f, jsonResult$1 as g, isDangerousNameMatchingEnabled as h, PAIRING_APPROVED_MESSAGE as i, runPassiveAccountLifecycle$1 as j, resolveWebhookPath as k, createChannelMessageReplyPipeline as l, fetchWithSsrFGuard$1 as m, GROUP_POLICY_BLOCKED_LABEL as n, chunkTextForOutbound as o, fetchRemoteMedia as p, GoogleChatConfigSchema as r, createAccountStatusSink$1 as s, DEFAULT_ACCOUNT_ID as t, createChannelPairingController as u, missingTargetError as v, resolveAllowlistProviderRuntimeGroupPolicy as w, readReactionParams$1 as x, readJsonWebhookBodyOrReject$1 as y };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { DEFAULT_ACCOUNT_ID, GROUP_POLICY_BLOCKED_LABEL, GoogleChatConfigSchema, PAIRING_APPROVED_MESSAGE, buildChannelConfigSchema, chunkTextForOutbound, createAccountStatusSink, createActionGate, createChannelMessageReplyPipeline, createChannelPairingController, createWebhookInFlightLimiter,
|
|
1
|
+
import { A as resolveWebhookTargetWithAuthOrReject, C as registerWebhookTargetWithPluginRoute, D as resolveInboundMentionDecision, E as resolveDefaultGroupPolicy, F as setGoogleChatRuntime, M as warnMissingProviderGroupPolicyFallbackOnce, N as withResolvedWebhookRequestPipeline, O as resolveInboundRouteEnvelopeBuilderWithRuntime, S as readStringParam, T as resolveChannelMediaMaxBytes, _ as loadOutboundMediaFromUrl, a as buildChannelConfigSchema, b as readNumberParam, c as createActionGate, d as createWebhookInFlightLimiter, f as extractToolSend, g as jsonResult, h as isDangerousNameMatchingEnabled, i as PAIRING_APPROVED_MESSAGE, j as runPassiveAccountLifecycle, k as resolveWebhookPath, l as createChannelMessageReplyPipeline, m as fetchWithSsrFGuard, n as GROUP_POLICY_BLOCKED_LABEL, o as chunkTextForOutbound, p as fetchRemoteMedia, r as GoogleChatConfigSchema, s as createAccountStatusSink, t as DEFAULT_ACCOUNT_ID, u as createChannelPairingController, v as missingTargetError, w as resolveAllowlistProviderRuntimeGroupPolicy, x as readReactionParams, y as readJsonWebhookBodyOrReject } from "./runtime-api-DMEzhesS.js";
|
|
2
|
+
export { DEFAULT_ACCOUNT_ID, GROUP_POLICY_BLOCKED_LABEL, GoogleChatConfigSchema, PAIRING_APPROVED_MESSAGE, buildChannelConfigSchema, chunkTextForOutbound, createAccountStatusSink, createActionGate, createChannelMessageReplyPipeline, createChannelPairingController, createWebhookInFlightLimiter, extractToolSend, fetchRemoteMedia, fetchWithSsrFGuard, isDangerousNameMatchingEnabled, jsonResult, loadOutboundMediaFromUrl, missingTargetError, readJsonWebhookBodyOrReject, readNumberParam, readReactionParams, readStringParam, registerWebhookTargetWithPluginRoute, resolveAllowlistProviderRuntimeGroupPolicy, resolveChannelMediaMaxBytes, resolveDefaultGroupPolicy, resolveInboundMentionDecision, resolveInboundRouteEnvelopeBuilderWithRuntime, resolveWebhookPath, resolveWebhookTargetWithAuthOrReject, runPassiveAccountLifecycle, setGoogleChatRuntime, warnMissingProviderGroupPolicyFallbackOnce, withResolvedWebhookRequestPipeline };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as findGoogleChatDirectMessage } from "./api-
|
|
1
|
+
import { a as findGoogleChatDirectMessage } from "./api-AErsImS_.js";
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
|
|
3
3
|
//#region extensions/googlechat/src/targets.ts
|
|
4
4
|
function normalizeGoogleChatTarget(raw) {
|
package/dist/test-api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as googlechatPlugin } from "./channel-
|
|
1
|
+
import { F as setGoogleChatRuntime } from "./runtime-api-DMEzhesS.js";
|
|
2
|
+
import { t as googlechatPlugin } from "./channel-9lvRWX6T.js";
|
|
3
3
|
export { googlechatPlugin, setGoogleChatRuntime };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/googlechat",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.10-beta.2",
|
|
4
4
|
"description": "OpenClaw Google Chat channel plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"openclaw": "workspace:*"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"openclaw": ">=2026.5.
|
|
19
|
+
"openclaw": ">=2026.5.10-beta.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"openclaw": {
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
"minHostVersion": ">=2026.4.10"
|
|
75
75
|
},
|
|
76
76
|
"compat": {
|
|
77
|
-
"pluginApi": ">=2026.5.
|
|
77
|
+
"pluginApi": ">=2026.5.10-beta.2"
|
|
78
78
|
},
|
|
79
79
|
"build": {
|
|
80
|
-
"openclawVersion": "2026.5.
|
|
80
|
+
"openclawVersion": "2026.5.10-beta.2"
|
|
81
81
|
},
|
|
82
82
|
"release": {
|
|
83
83
|
"publishToClawHub": true,
|