@openclaw/googlechat 2026.8.1-beta.3 → 2026.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{actions-B5wHFHkX.js → actions-Bsv9COyy.js} +2 -2
- package/dist/api.js +1 -1
- package/dist/{approval-auth-AECosdcm.js → approval-auth-DnqxUj0j.js} +1 -1
- package/dist/{approval-handler.runtime-DcfApI4d.js → approval-handler.runtime-5Yr5TCX6.js} +2 -2
- package/dist/{channel-Cy93IxLN.js → channel-DAC3b287.js} +7 -7
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.adapters-FZq5jdkN.js → channel.adapters-C2dHazJR.js} +60 -23
- package/dist/{channel.runtime-CU_z4ppv.js → channel.runtime-DqiduEYL.js} +22 -39
- package/dist/directory-contract-api.js +1 -1
- package/dist/{secret-contract-BFYyuE0F.js → secret-contract-DmWM0kwM.js} +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/node_modules/google-auth-library/node_modules/gaxios/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/node_modules/google-auth-library/node_modules/gaxios/build/esm/tsconfig.tsbuildinfo +1 -1
- package/node_modules/google-auth-library/node_modules/gaxios/package.json +3 -3
- package/openclaw.plugin.json +0 -4
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as resolveGoogleChatAccount } from "./channel-base-BpHXDsur.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as describeGoogleChatMessageTool } from "./channel-
|
|
2
|
+
import { g as resolveGoogleChatOutboundSpace, x as sendGoogleChatMessage } from "./channel.adapters-C2dHazJR.js";
|
|
3
|
+
import { n as describeGoogleChatMessageTool } from "./channel-DAC3b287.js";
|
|
4
4
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
5
5
|
import { jsonResult, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/channel-actions";
|
|
6
6
|
//#region extensions/googlechat/src/actions.ts
|
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as googlechatSetupAdapter, i as googlechatSetupWizard } from "./channel-base-BpHXDsur.js";
|
|
2
|
-
import { t as googlechatPlugin } from "./channel-
|
|
2
|
+
import { t as googlechatPlugin } from "./channel-DAC3b287.js";
|
|
3
3
|
export { googlechatPlugin, googlechatSetupAdapter, googlechatSetupWizard };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as resolveGoogleChatAccount } from "./channel-base-BpHXDsur.js";
|
|
2
|
-
import {
|
|
2
|
+
import { m as normalizeGoogleChatTarget, p as isGoogleChatUserTarget } from "./channel.adapters-C2dHazJR.js";
|
|
3
3
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { createChannelApprovalAuth } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
5
5
|
//#region extensions/googlechat/src/approval-auth.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as resolveGoogleChatAccount } from "./channel-base-BpHXDsur.js";
|
|
2
|
-
import {
|
|
3
|
-
import { i as shouldHandleGoogleChatNativeApprovalRequest, r as isGoogleChatNativeApprovalClientEnabled } from "./channel-
|
|
2
|
+
import { F as unregisterGoogleChatManualApprovalFollowupSuppression, M as registerGoogleChatManualApprovalFollowupSuppression, O as createGoogleChatApprovalToken, P as unregisterGoogleChatApprovalCardBindings, S as updateGoogleChatMessage, T as buildGoogleChatApprovalActionParameters, g as resolveGoogleChatOutboundSpace, j as registerGoogleChatApprovalCardBinding, w as GOOGLECHAT_APPROVAL_ACTION, x as sendGoogleChatMessage } from "./channel.adapters-C2dHazJR.js";
|
|
3
|
+
import { i as shouldHandleGoogleChatNativeApprovalRequest, r as isGoogleChatNativeApprovalClientEnabled } from "./channel-DAC3b287.js";
|
|
4
4
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
5
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { c as resolveDefaultGoogleChatAccountId, l as resolveGoogleChatAccount, n as createGoogleChatPluginBase, o as inspectGoogleChatAccount, s as listGoogleChatAccountIds, t as GOOGLECHAT_CHANNEL_ID } from "./channel-base-BpHXDsur.js";
|
|
2
|
-
import { a as googlechatPairingTextAdapter,
|
|
2
|
+
import { a as googlechatPairingTextAdapter, f as isGoogleChatSpaceTarget, h as resolveGoogleChatOutboundSessionRoute, i as googlechatOutboundAdapter, m as normalizeGoogleChatTarget, n as googlechatGroupsAdapter, o as googlechatSecurityAdapter, p as isGoogleChatUserTarget, r as googlechatMessageAdapter, s as googlechatThreadingAdapter, t as googlechatDirectoryAdapter } from "./channel.adapters-C2dHazJR.js";
|
|
3
3
|
import { n as buildChannelConfigSchema, t as GoogleChatConfigSchema } from "./config-api-CsD0IFxF.js";
|
|
4
4
|
import { t as DEFAULT_ACCOUNT_ID } from "./runtime-api-Dh0CNVS4.js";
|
|
5
|
-
import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-
|
|
5
|
+
import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-DnqxUj0j.js";
|
|
6
6
|
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BLvSmTXT.js";
|
|
7
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-
|
|
7
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DmWM0kwM.js";
|
|
8
8
|
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
9
9
|
import { buildPassiveProbedChannelStatusSummary } from "openclaw/plugin-sdk/extension-shared";
|
|
10
10
|
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
@@ -142,7 +142,7 @@ const googleChatApprovalCapability = createApproverRestrictedNativeApprovalCapab
|
|
|
142
142
|
approvalKind,
|
|
143
143
|
request
|
|
144
144
|
}),
|
|
145
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
145
|
+
load: async () => (await import("./approval-handler.runtime-5Yr5TCX6.js")).googleChatApprovalNativeRuntime
|
|
146
146
|
})
|
|
147
147
|
});
|
|
148
148
|
const collectGoogleChatMutableAllowlistWarnings = createDangerousNameMatchingMutableAllowlistWarningCollector({
|
|
@@ -163,7 +163,7 @@ const collectGoogleChatMutableAllowlistWarnings = createDangerousNameMatchingMut
|
|
|
163
163
|
});
|
|
164
164
|
//#endregion
|
|
165
165
|
//#region extensions/googlechat/src/gateway.ts
|
|
166
|
-
const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
166
|
+
const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-DqiduEYL.js"), "googleChatChannelRuntime");
|
|
167
167
|
const UNRESOLVED_WEBHOOK_URL_ERROR = "Invalid webhookUrl: expected an absolute URL such as https://chat.example.com/googlechat. No inbound webhook route was registered.";
|
|
168
168
|
async function startGoogleChatGatewayAccount(ctx) {
|
|
169
169
|
const account = ctx.account;
|
|
@@ -241,13 +241,13 @@ function describeGoogleChatMessageTool({ cfg, accountId }) {
|
|
|
241
241
|
}
|
|
242
242
|
//#endregion
|
|
243
243
|
//#region extensions/googlechat/src/channel.ts
|
|
244
|
-
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
244
|
+
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-DqiduEYL.js"), "googleChatChannelRuntime");
|
|
245
245
|
const googlechatActions = {
|
|
246
246
|
describeMessageTool: describeGoogleChatMessageTool,
|
|
247
247
|
supportsAction: ({ action }) => action === "send",
|
|
248
248
|
extractToolSend: ({ args }) => extractToolSend(args, "sendMessage"),
|
|
249
249
|
handleAction: async (ctx) => {
|
|
250
|
-
const { googlechatMessageActions } = await import("./actions-
|
|
250
|
+
const { googlechatMessageActions } = await import("./actions-Bsv9COyy.js");
|
|
251
251
|
if (!googlechatMessageActions.handleAction) throw new Error("Google Chat actions are not available.");
|
|
252
252
|
return await googlechatMessageActions.handleAction(ctx);
|
|
253
253
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as googlechatPlugin } from "./channel-
|
|
1
|
+
import { t as googlechatPlugin } from "./channel-DAC3b287.js";
|
|
2
2
|
export { googlechatPlugin };
|
|
@@ -16,6 +16,7 @@ import { createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, s
|
|
|
16
16
|
import { FormatCapabilityProfile, markdownToIR, renderMarkdownIRChunksWithinLimit, renderMarkdownWithMarkers, sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
17
17
|
import fs from "node:fs/promises";
|
|
18
18
|
import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
19
|
+
import { defineStableChannelIngressIdentity, identityEntryAuthenticationClassifier } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
19
20
|
import { buildChannelGroupsScopeTree, createAllowlistProviderOpenWarningCollector, createConditionalWarningCollector, resolveScopeRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
|
20
21
|
import { createChannelDirectoryAdapter, listResolvedDirectoryGroupEntriesFromMapKeys, listResolvedDirectoryUserEntriesFromAllowFrom } from "openclaw/plugin-sdk/directory-runtime";
|
|
21
22
|
//#region extensions/googlechat/src/approval-card-actions.ts
|
|
@@ -427,15 +428,11 @@ async function readGoogleAuthResponseBytes(response) {
|
|
|
427
428
|
if (done) break;
|
|
428
429
|
if (!value) continue;
|
|
429
430
|
total += value.byteLength;
|
|
430
|
-
if (total > MAX_GOOGLE_AUTH_RESPONSE_BYTES) {
|
|
431
|
-
try {
|
|
432
|
-
await reader.cancel("Google auth response exceeded buffer limit");
|
|
433
|
-
} catch {}
|
|
434
|
-
throw new Error(`Google auth response exceeds ${MAX_GOOGLE_AUTH_RESPONSE_BYTES} bytes.`);
|
|
435
|
-
}
|
|
431
|
+
if (total > MAX_GOOGLE_AUTH_RESPONSE_BYTES) throw new Error(`Google auth response exceeds ${MAX_GOOGLE_AUTH_RESPONSE_BYTES} bytes.`);
|
|
436
432
|
chunks.push(value);
|
|
437
433
|
}
|
|
438
434
|
} finally {
|
|
435
|
+
reader.cancel().catch(() => void 0);
|
|
439
436
|
reader.releaseLock();
|
|
440
437
|
}
|
|
441
438
|
const bytes = new Uint8Array(total);
|
|
@@ -535,10 +532,7 @@ async function fetchChatCerts() {
|
|
|
535
532
|
timeoutMs: GOOGLECHAT_CERT_FETCH_TIMEOUT_MS
|
|
536
533
|
});
|
|
537
534
|
try {
|
|
538
|
-
if (!response.ok) {
|
|
539
|
-
await response.body?.cancel().catch(() => void 0);
|
|
540
|
-
throw new Error(`Failed to fetch Chat certs (${response.status})`);
|
|
541
|
-
}
|
|
535
|
+
if (!response.ok) throw new Error(`Failed to fetch Chat certs (${response.status})`);
|
|
542
536
|
const certs = await readGoogleChatCertsResponse(response);
|
|
543
537
|
cachedCerts = {
|
|
544
538
|
fetchedAt: now,
|
|
@@ -831,41 +825,47 @@ function stripMessageSuffix(target) {
|
|
|
831
825
|
if (index === -1) return target;
|
|
832
826
|
return target.slice(0, index);
|
|
833
827
|
}
|
|
834
|
-
async function
|
|
828
|
+
async function resolveGoogleChatOutboundSpaceDetails(params) {
|
|
835
829
|
const normalized = normalizeGoogleChatTarget(params.target);
|
|
836
830
|
if (!normalized) throw new Error("Missing Google Chat target.");
|
|
837
831
|
const base = stripMessageSuffix(normalized);
|
|
838
|
-
if (isGoogleChatSpaceTarget(base)) return base;
|
|
832
|
+
if (isGoogleChatSpaceTarget(base)) return { name: base };
|
|
839
833
|
if (isGoogleChatUserTarget(base)) {
|
|
840
834
|
const dm = await findGoogleChatDirectMessage({
|
|
841
835
|
account: params.account,
|
|
842
836
|
userName: base
|
|
843
837
|
});
|
|
844
838
|
if (!dm?.name) throw new Error(`No Google Chat DM found for ${base}`);
|
|
845
|
-
return
|
|
839
|
+
return {
|
|
840
|
+
name: dm.name,
|
|
841
|
+
resource: dm
|
|
842
|
+
};
|
|
846
843
|
}
|
|
847
|
-
return base;
|
|
844
|
+
return { name: base };
|
|
845
|
+
}
|
|
846
|
+
async function resolveGoogleChatOutboundSpace(params) {
|
|
847
|
+
return (await resolveGoogleChatOutboundSpaceDetails(params)).name;
|
|
848
848
|
}
|
|
849
849
|
async function resolveGoogleChatOutboundSessionRoute(params) {
|
|
850
850
|
const account = resolveGoogleChatAccount({
|
|
851
851
|
cfg: params.cfg,
|
|
852
852
|
accountId: params.accountId
|
|
853
853
|
});
|
|
854
|
-
const
|
|
854
|
+
const resolvedSpace = await resolveGoogleChatOutboundSpaceDetails({
|
|
855
855
|
account,
|
|
856
856
|
target: params.target
|
|
857
857
|
});
|
|
858
|
+
const spaceName = resolvedSpace.name;
|
|
858
859
|
if (!isGoogleChatSpaceTarget(spaceName)) return null;
|
|
859
|
-
let
|
|
860
|
-
try {
|
|
861
|
-
|
|
860
|
+
let chatType = resolvedSpace.resource ? resolveGoogleChatSpaceChatType(resolvedSpace.resource) : void 0;
|
|
861
|
+
if (!chatType) try {
|
|
862
|
+
chatType = resolveGoogleChatSpaceChatType(await getGoogleChatSpace({
|
|
862
863
|
account,
|
|
863
864
|
spaceName
|
|
864
|
-
});
|
|
865
|
+
}));
|
|
865
866
|
} catch {
|
|
866
867
|
return null;
|
|
867
868
|
}
|
|
868
|
-
const chatType = resolveGoogleChatSpaceChatType(space);
|
|
869
869
|
if (!chatType) return null;
|
|
870
870
|
return buildChannelOutboundSessionRoute({
|
|
871
871
|
cfg: params.cfg,
|
|
@@ -1138,7 +1138,7 @@ function renderGoogleChatIR(ir, markers) {
|
|
|
1138
1138
|
if (!href || !label) return null;
|
|
1139
1139
|
const labelHasStyles = ir.styles.some((span) => span.start < link.end && span.end > link.start);
|
|
1140
1140
|
return /[<>|]/u.test(href) || /[<>|*_~`]/u.test(label) || labelHasStyles ? {
|
|
1141
|
-
start: link.
|
|
1141
|
+
start: link.end,
|
|
1142
1142
|
end: link.end,
|
|
1143
1143
|
open: "",
|
|
1144
1144
|
close: ` (${href})`
|
|
@@ -1178,8 +1178,44 @@ function resolveGoogleChatGroupRequireMention(params) {
|
|
|
1178
1178
|
}));
|
|
1179
1179
|
}
|
|
1180
1180
|
//#endregion
|
|
1181
|
+
//#region extensions/googlechat/src/ingress-identity.ts
|
|
1182
|
+
function normalizeGoogleChatUserId(raw) {
|
|
1183
|
+
const trimmed = normalizeOptionalString(raw) ?? "";
|
|
1184
|
+
if (!trimmed) return "";
|
|
1185
|
+
return normalizeLowercaseStringOrEmpty(trimmed.replace(/^users\//i, ""));
|
|
1186
|
+
}
|
|
1187
|
+
const GOOGLECHAT_EMAIL_KIND = "plugin:googlechat-email";
|
|
1188
|
+
function normalizeEntryValue(raw) {
|
|
1189
|
+
return normalizeLowercaseStringOrEmpty(raw ?? "");
|
|
1190
|
+
}
|
|
1191
|
+
function normalizeGoogleChatStableEntry(entry) {
|
|
1192
|
+
const withoutProvider = normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "");
|
|
1193
|
+
if (!withoutProvider) return null;
|
|
1194
|
+
return withoutProvider.startsWith("users/") ? normalizeGoogleChatUserId(withoutProvider) : withoutProvider;
|
|
1195
|
+
}
|
|
1196
|
+
function normalizeGoogleChatEmailEntry(entry) {
|
|
1197
|
+
if (normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "").startsWith("users/")) return null;
|
|
1198
|
+
const stable = normalizeGoogleChatStableEntry(entry);
|
|
1199
|
+
return stable?.includes("@") ? stable : null;
|
|
1200
|
+
}
|
|
1201
|
+
const googleChatIngressIdentity = defineStableChannelIngressIdentity({
|
|
1202
|
+
key: "sender-id",
|
|
1203
|
+
authentication: "verified",
|
|
1204
|
+
normalizeEntry: normalizeGoogleChatStableEntry,
|
|
1205
|
+
normalizeSubject: normalizeGoogleChatUserId,
|
|
1206
|
+
aliases: [{
|
|
1207
|
+
key: "email",
|
|
1208
|
+
kind: GOOGLECHAT_EMAIL_KIND,
|
|
1209
|
+
normalizeEntry: normalizeGoogleChatEmailEntry,
|
|
1210
|
+
normalizeSubject: normalizeEntryValue,
|
|
1211
|
+
authentication: "mutable"
|
|
1212
|
+
}],
|
|
1213
|
+
isWildcardEntry: (entry) => normalizeEntryValue(entry) === "*",
|
|
1214
|
+
resolveEntryId: ({ entryIndex, fieldKey }) => fieldKey === "stableId" ? `entry-${entryIndex + 1}:user` : `entry-${entryIndex + 1}:${fieldKey}`
|
|
1215
|
+
});
|
|
1216
|
+
//#endregion
|
|
1181
1217
|
//#region extensions/googlechat/src/channel.adapters.ts
|
|
1182
|
-
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
1218
|
+
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-DqiduEYL.js"), "googleChatChannelRuntime");
|
|
1183
1219
|
function createGoogleChatSendReceipt(params) {
|
|
1184
1220
|
const messageId = params.messageId?.trim();
|
|
1185
1221
|
return createMessageReceiptFromOutboundResults({
|
|
@@ -1229,6 +1265,7 @@ const googlechatSecurityAdapter = {
|
|
|
1229
1265
|
resolvePolicy: (account) => account.config.dmPolicy,
|
|
1230
1266
|
resolveAllowFrom: (account) => account.config.allowFrom,
|
|
1231
1267
|
allowFromPathSuffix: "",
|
|
1268
|
+
classifyEntryAuthentication: identityEntryAuthenticationClassifier(googleChatIngressIdentity),
|
|
1232
1269
|
normalizeEntry: (raw) => formatGoogleChatAllowFromEntry(raw)
|
|
1233
1270
|
},
|
|
1234
1271
|
collectWarnings: collectGoogleChatSecurityWarnings
|
|
@@ -1350,4 +1387,4 @@ const googlechatMessageAdapter = defineChannelMessageAdapter({
|
|
|
1350
1387
|
send: { text: googlechatOutboundAdapter.attachedResults.sendText }
|
|
1351
1388
|
});
|
|
1352
1389
|
//#endregion
|
|
1353
|
-
export {
|
|
1390
|
+
export { readGoogleChatApprovalActionToken as A, verifyGoogleChatRequest as C, completeGoogleChatApprovalCardBinding as D, claimGoogleChatApprovalCardBinding as E, unregisterGoogleChatManualApprovalFollowupSuppression as F, registerGoogleChatManualApprovalFollowupSuppression as M, releaseGoogleChatApprovalCardBinding as N, createGoogleChatApprovalToken as O, unregisterGoogleChatApprovalCardBindings as P, updateGoogleChatMessage as S, buildGoogleChatApprovalActionParameters as T, GoogleChatApiError as _, googlechatPairingTextAdapter as a, probeGoogleChat as b, googleChatIngressIdentity as c, isGoogleChatGroupSpace as d, isGoogleChatSpaceTarget as f, resolveGoogleChatOutboundSpace as g, resolveGoogleChatOutboundSessionRoute as h, googlechatOutboundAdapter as i, registerGoogleChatApprovalCardBinding as j, getGoogleChatApprovalCardBinding as k, normalizeGoogleChatUserId as l, normalizeGoogleChatTarget as m, googlechatGroupsAdapter as n, googlechatSecurityAdapter as o, isGoogleChatUserTarget as p, googlechatMessageAdapter as r, googlechatThreadingAdapter as s, googlechatDirectoryAdapter as t, buildGoogleChatGroupPolicyScope as u, deleteGoogleChatMessage as v, GOOGLECHAT_APPROVAL_ACTION as w, sendGoogleChatMessage as x, downloadGoogleChatMedia as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as readGoogleChatApprovalActionToken, C as verifyGoogleChatRequest, D as completeGoogleChatApprovalCardBinding, E as claimGoogleChatApprovalCardBinding, N as releaseGoogleChatApprovalCardBinding, S as updateGoogleChatMessage, _ as GoogleChatApiError, b as probeGoogleChat, c as googleChatIngressIdentity, d as isGoogleChatGroupSpace, k as getGoogleChatApprovalCardBinding, l as normalizeGoogleChatUserId, u as buildGoogleChatGroupPolicyScope, v as deleteGoogleChatMessage, x as sendGoogleChatMessage, y as downloadGoogleChatMedia } from "./channel.adapters-C2dHazJR.js";
|
|
2
2
|
import { C as resolveWebhookPath, E as warnMissingProviderGroupPolicyFallbackOnce, O as getGoogleChatRuntime, b as resolveAllowlistProviderRuntimeGroupPolicy, c as createChannelPairingController, f as isDangerousNameMatchingEnabled, n as GROUP_POLICY_BLOCKED_LABEL, x as resolveDefaultGroupPolicy } from "./runtime-api-Dh0CNVS4.js";
|
|
3
|
-
import { n as googleChatApprovalAuth } from "./approval-auth-
|
|
3
|
+
import { n as googleChatApprovalAuth } from "./approval-auth-DnqxUj0j.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
6
6
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -11,12 +11,12 @@ import { createChannelPartialDeliveryError, formatInboundMediaUnavailableText, r
|
|
|
11
11
|
import { WEBHOOK_RATE_LIMIT_DEFAULTS, canonicalizeWebhookRouteKey, createFixedWindowRateLimiter, resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
|
|
12
12
|
import { registerWebhookTargetWithPluginRoute, resolveWebhookTargetWithAuthOrReject, withResolvedWebhookRequestPipeline } from "openclaw/plugin-sdk/webhook-targets";
|
|
13
13
|
import { createWebhookInFlightLimiter, readJsonWebhookBodyOrReject, runDetachedWebhookWork } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
14
|
+
import { channelIngressRoutes, createChannelIngressResolver, createStandardRawEventIngressMonitor } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
14
15
|
import { channelBlockedPatch, channelReadyPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
|
15
16
|
import { isRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
16
17
|
import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
17
18
|
import { parseDateStringTimestampMs } from "openclaw/plugin-sdk/number-runtime";
|
|
18
19
|
import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway-runtime";
|
|
19
|
-
import { channelIngressRoutes, createChannelIngressResolver, createStandardRawEventIngressMonitor, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
20
20
|
import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
21
21
|
//#region extensions/googlechat/src/approval-terminal-card.ts
|
|
22
22
|
const GOOGLECHAT_APPROVAL_CARD_ID = "openclaw-approval";
|
|
@@ -158,39 +158,6 @@ async function maybeHandleGoogleChatApprovalCardClick(params) {
|
|
|
158
158
|
}
|
|
159
159
|
//#endregion
|
|
160
160
|
//#region extensions/googlechat/src/monitor-access.ts
|
|
161
|
-
function normalizeUserId(raw) {
|
|
162
|
-
const trimmed = normalizeOptionalString(raw) ?? "";
|
|
163
|
-
if (!trimmed) return "";
|
|
164
|
-
return normalizeLowercaseStringOrEmpty(trimmed.replace(/^users\//i, ""));
|
|
165
|
-
}
|
|
166
|
-
const GOOGLECHAT_EMAIL_KIND = "plugin:googlechat-email";
|
|
167
|
-
function normalizeEntryValue(raw) {
|
|
168
|
-
return normalizeLowercaseStringOrEmpty(raw ?? "");
|
|
169
|
-
}
|
|
170
|
-
function normalizeGoogleChatStableEntry(entry) {
|
|
171
|
-
const withoutProvider = normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "");
|
|
172
|
-
if (!withoutProvider) return null;
|
|
173
|
-
return withoutProvider.startsWith("users/") ? normalizeUserId(withoutProvider) : withoutProvider;
|
|
174
|
-
}
|
|
175
|
-
function normalizeGoogleChatEmailEntry(entry) {
|
|
176
|
-
if (normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "").startsWith("users/")) return null;
|
|
177
|
-
const stable = normalizeGoogleChatStableEntry(entry);
|
|
178
|
-
return stable?.includes("@") ? stable : null;
|
|
179
|
-
}
|
|
180
|
-
const googleChatIngressIdentity = defineStableChannelIngressIdentity({
|
|
181
|
-
key: "sender-id",
|
|
182
|
-
normalizeEntry: normalizeGoogleChatStableEntry,
|
|
183
|
-
normalizeSubject: normalizeUserId,
|
|
184
|
-
aliases: [{
|
|
185
|
-
key: "email",
|
|
186
|
-
kind: GOOGLECHAT_EMAIL_KIND,
|
|
187
|
-
normalizeEntry: normalizeGoogleChatEmailEntry,
|
|
188
|
-
normalizeSubject: normalizeEntryValue,
|
|
189
|
-
dangerous: true
|
|
190
|
-
}],
|
|
191
|
-
isWildcardEntry: (entry) => normalizeEntryValue(entry) === "*",
|
|
192
|
-
resolveEntryId: ({ entryIndex, fieldKey }) => fieldKey === "stableId" ? `entry-${entryIndex + 1}:user` : `entry-${entryIndex + 1}:${fieldKey}`
|
|
193
|
-
});
|
|
194
161
|
function resolveGoogleChatGroupConfig(params) {
|
|
195
162
|
const { groupId, groupName, groups } = params;
|
|
196
163
|
const entries = groups ?? {};
|
|
@@ -232,7 +199,7 @@ function extractMentionInfo(annotations, botUser) {
|
|
|
232
199
|
const userName = entry.userMention?.user?.name;
|
|
233
200
|
if (!userName) return false;
|
|
234
201
|
if (botTargets.has(userName)) return true;
|
|
235
|
-
return
|
|
202
|
+
return normalizeGoogleChatUserId(userName) === "app";
|
|
236
203
|
})
|
|
237
204
|
};
|
|
238
205
|
}
|
|
@@ -1002,14 +969,14 @@ async function processGoogleChatEvent(event, target, turnAdoptionLifecycle) {
|
|
|
1002
969
|
* Resolve bot display name with fallback chain:
|
|
1003
970
|
* 1. Account config name
|
|
1004
971
|
* 2. Agent name from config
|
|
1005
|
-
* 3. "OpenClaw"
|
|
972
|
+
* 3. Agent identity name, then "OpenClaw"
|
|
1006
973
|
*/
|
|
1007
974
|
function resolveBotDisplayName(params) {
|
|
1008
975
|
const { accountName, agentId, config } = params;
|
|
1009
976
|
if (accountName?.trim()) return accountName.trim();
|
|
1010
977
|
const agent = resolveAgentConfig(config, agentId);
|
|
1011
978
|
if (agent?.name?.trim()) return agent.name.trim();
|
|
1012
|
-
return "OpenClaw";
|
|
979
|
+
return agent?.identity?.name?.trim() || "OpenClaw";
|
|
1013
980
|
}
|
|
1014
981
|
async function processMessageWithPipeline(params) {
|
|
1015
982
|
const { event, account, config, runtime, core, statusSink, mediaMaxMb, turnAdoptionLifecycle } = params;
|
|
@@ -1098,6 +1065,14 @@ async function processMessageWithPipeline(params) {
|
|
|
1098
1065
|
url: attachmentData.path,
|
|
1099
1066
|
contentType: attachmentData.contentType ?? first.contentType
|
|
1100
1067
|
};
|
|
1068
|
+
else {
|
|
1069
|
+
const notice = `[Google Chat attachment unavailable: ${first.driveDataRef ? "Google Drive files are not downloadable" : "unsupported attachment source"}; upload the file directly]`;
|
|
1070
|
+
rawBody = formatInboundMediaUnavailableText({
|
|
1071
|
+
body: rawBody,
|
|
1072
|
+
notice
|
|
1073
|
+
});
|
|
1074
|
+
runtime.error?.(`[${account.accountId}] ${notice}`);
|
|
1075
|
+
}
|
|
1101
1076
|
} catch (error) {
|
|
1102
1077
|
if (!(error instanceof MediaFetchError) || error.code !== "max_bytes") throw error;
|
|
1103
1078
|
const notice = `[Google Chat attachment too large; maximum ${mediaMaxMb} MB]`;
|
|
@@ -1107,6 +1082,14 @@ async function processMessageWithPipeline(params) {
|
|
|
1107
1082
|
});
|
|
1108
1083
|
runtime.error?.(`[${account.accountId}] ${notice} Increase channels.googlechat.mediaMaxMb to process larger attachments.`);
|
|
1109
1084
|
}
|
|
1085
|
+
const additionalCount = attachments.length - 1;
|
|
1086
|
+
if (additionalCount > 0) {
|
|
1087
|
+
const notice = `[Google Chat: ${additionalCount} additional ${additionalCount === 1 ? "attachment was" : "attachments were"} not processed; only the first attachment is supported]`;
|
|
1088
|
+
rawBody = formatInboundMediaUnavailableText({
|
|
1089
|
+
body: rawBody,
|
|
1090
|
+
notice
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1110
1093
|
const media = mediaInputs.length === 0 ? [] : await toInboundMediaFactsWithMetadata(mediaInputs);
|
|
1111
1094
|
const fromLabel = isGroup ? space.displayName || `space:${spaceId}` : senderName || `user:${senderId}`;
|
|
1112
1095
|
const timestampMs = parseDateStringTimestampMs(event.eventTime);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as googlechatDirectoryAdapter } from "./channel.adapters-
|
|
1
|
+
import { t as googlechatDirectoryAdapter } from "./channel.adapters-C2dHazJR.js";
|
|
2
2
|
//#region extensions/googlechat/directory-contract-api.ts
|
|
3
3
|
const googlechatDirectoryContractPlugin = {
|
|
4
4
|
id: "googlechat",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { coerceSecretRef } from "openclaw/plugin-sdk/secret-input";
|
|
1
2
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
2
3
|
import { createChannelSecretTargetRegistryEntries, getChannelSurface, hasOwnProperty, pushAssignment, pushInactiveSurfaceWarning, resolveChannelAccountSurface } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
3
|
-
import { coerceSecretRef } from "openclaw/plugin-sdk/secret-ref-runtime";
|
|
4
4
|
//#region extensions/googlechat/src/secret-contract.ts
|
|
5
5
|
function accountSecretOwner(accountId) {
|
|
6
6
|
return {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-
|
|
1
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-DmWM0kwM.js";
|
|
2
2
|
export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
|