@openclaw/googlechat 2026.8.1-beta.2 → 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.
@@ -1,6 +1,6 @@
1
1
  import { l as resolveGoogleChatAccount } from "./channel-base-BpHXDsur.js";
2
- import { m as resolveGoogleChatOutboundSpace, y as sendGoogleChatMessage } from "./channel.adapters-DiI1p1ml.js";
3
- import { n as describeGoogleChatMessageTool } from "./channel-DkSxE2Ch.js";
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-DkSxE2Ch.js";
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 { d as isGoogleChatUserTarget, f as normalizeGoogleChatTarget } from "./channel.adapters-DiI1p1ml.js";
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 { A as registerGoogleChatManualApprovalFollowupSuppression, C as buildGoogleChatApprovalActionParameters, E as createGoogleChatApprovalToken, M as unregisterGoogleChatApprovalCardBindings, N as unregisterGoogleChatManualApprovalFollowupSuppression, S as GOOGLECHAT_APPROVAL_ACTION, b as updateGoogleChatMessage, k as registerGoogleChatApprovalCardBinding, m as resolveGoogleChatOutboundSpace, y as sendGoogleChatMessage } from "./channel.adapters-DiI1p1ml.js";
3
- import { i as shouldHandleGoogleChatNativeApprovalRequest, r as isGoogleChatNativeApprovalClientEnabled } from "./channel-DkSxE2Ch.js";
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, d as isGoogleChatUserTarget, f as normalizeGoogleChatTarget, i as googlechatOutboundAdapter, n as googlechatGroupsAdapter, o as googlechatSecurityAdapter, p as resolveGoogleChatOutboundSessionRoute, r as googlechatMessageAdapter, s as googlechatThreadingAdapter, t as googlechatDirectoryAdapter, u as isGoogleChatSpaceTarget } from "./channel.adapters-DiI1p1ml.js";
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-Bm8YFEkI.js";
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-BFYyuE0F.js";
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-B-p-W-_V.js")).googleChatApprovalNativeRuntime
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-CqOzrZWb.js"), "googleChatChannelRuntime");
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-CqOzrZWb.js"), "googleChatChannelRuntime");
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-BIY4DNRJ.js");
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-DkSxE2Ch.js";
1
+ import { t as googlechatPlugin } from "./channel-DAC3b287.js";
2
2
  export { googlechatPlugin };
@@ -16,7 +16,8 @@ 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 { buildChannelGroupsScopeTree, composeAccountWarningCollectors, createAllowlistProviderOpenWarningCollector, resolveScopeRequireMention } from "openclaw/plugin-sdk/channel-policy";
19
+ import { defineStableChannelIngressIdentity, identityEntryAuthenticationClassifier } from "openclaw/plugin-sdk/channel-ingress-runtime";
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
22
23
  const GOOGLECHAT_APPROVAL_ACTION = "openclaw.approval";
@@ -293,15 +294,19 @@ function assertUrlPrefixField(record, fieldName, expectedPrefix) {
293
294
  function validateGoogleChatServiceAccountCredentials(credentials) {
294
295
  const type = readOptionalTrimmedString(credentials, "type");
295
296
  if (type && type !== "service_account") throw new Error(`Google Chat credentials must use service_account auth, got "${type}" instead`);
296
- readRequiredTrimmedString(credentials, "client_email");
297
- readRequiredTrimmedString(credentials, "private_key");
297
+ const clientEmail = readRequiredTrimmedString(credentials, "client_email");
298
+ const privateKey = readRequiredTrimmedString(credentials, "private_key");
298
299
  const universeDomain = readOptionalTrimmedString(credentials, "universe_domain");
299
300
  if (universeDomain && universeDomain !== GOOGLE_AUTH_UNIVERSE_DOMAIN) throw new Error(`Google Chat service account field "universe_domain" must be ${GOOGLE_AUTH_UNIVERSE_DOMAIN}, got ${universeDomain}`);
300
301
  assertExactUrlField(credentials, "auth_uri", GOOGLE_AUTH_URI);
301
302
  assertExactUrlField(credentials, "auth_provider_x509_cert_url", GOOGLE_AUTH_PROVIDER_CERTS_URL);
302
303
  assertExactUrlField(credentials, "token_uri", GOOGLE_AUTH_TOKEN_URI);
303
304
  assertUrlPrefixField(credentials, "client_x509_cert_url", GOOGLE_CLIENT_CERTS_URL_PREFIX);
304
- return credentials;
305
+ return {
306
+ ...credentials,
307
+ client_email: clientEmail,
308
+ private_key: privateKey
309
+ };
305
310
  }
306
311
  async function readCredentialsFile(filePath) {
307
312
  const resolvedPath = resolveUserPath(filePath);
@@ -423,15 +428,11 @@ async function readGoogleAuthResponseBytes(response) {
423
428
  if (done) break;
424
429
  if (!value) continue;
425
430
  total += value.byteLength;
426
- if (total > MAX_GOOGLE_AUTH_RESPONSE_BYTES) {
427
- try {
428
- await reader.cancel("Google auth response exceeded buffer limit");
429
- } catch {}
430
- throw new Error(`Google auth response exceeds ${MAX_GOOGLE_AUTH_RESPONSE_BYTES} bytes.`);
431
- }
431
+ if (total > MAX_GOOGLE_AUTH_RESPONSE_BYTES) throw new Error(`Google auth response exceeds ${MAX_GOOGLE_AUTH_RESPONSE_BYTES} bytes.`);
432
432
  chunks.push(value);
433
433
  }
434
434
  } finally {
435
+ reader.cancel().catch(() => void 0);
435
436
  reader.releaseLock();
436
437
  }
437
438
  const bytes = new Uint8Array(total);
@@ -531,10 +532,7 @@ async function fetchChatCerts() {
531
532
  timeoutMs: GOOGLECHAT_CERT_FETCH_TIMEOUT_MS
532
533
  });
533
534
  try {
534
- if (!response.ok) {
535
- await response.body?.cancel().catch(() => void 0);
536
- throw new Error(`Failed to fetch Chat certs (${response.status})`);
537
- }
535
+ if (!response.ok) throw new Error(`Failed to fetch Chat certs (${response.status})`);
538
536
  const certs = await readGoogleChatCertsResponse(response);
539
537
  cachedCerts = {
540
538
  fetchedAt: now,
@@ -827,41 +825,47 @@ function stripMessageSuffix(target) {
827
825
  if (index === -1) return target;
828
826
  return target.slice(0, index);
829
827
  }
830
- async function resolveGoogleChatOutboundSpace(params) {
828
+ async function resolveGoogleChatOutboundSpaceDetails(params) {
831
829
  const normalized = normalizeGoogleChatTarget(params.target);
832
830
  if (!normalized) throw new Error("Missing Google Chat target.");
833
831
  const base = stripMessageSuffix(normalized);
834
- if (isGoogleChatSpaceTarget(base)) return base;
832
+ if (isGoogleChatSpaceTarget(base)) return { name: base };
835
833
  if (isGoogleChatUserTarget(base)) {
836
834
  const dm = await findGoogleChatDirectMessage({
837
835
  account: params.account,
838
836
  userName: base
839
837
  });
840
838
  if (!dm?.name) throw new Error(`No Google Chat DM found for ${base}`);
841
- return dm.name;
839
+ return {
840
+ name: dm.name,
841
+ resource: dm
842
+ };
842
843
  }
843
- return base;
844
+ return { name: base };
845
+ }
846
+ async function resolveGoogleChatOutboundSpace(params) {
847
+ return (await resolveGoogleChatOutboundSpaceDetails(params)).name;
844
848
  }
845
849
  async function resolveGoogleChatOutboundSessionRoute(params) {
846
850
  const account = resolveGoogleChatAccount({
847
851
  cfg: params.cfg,
848
852
  accountId: params.accountId
849
853
  });
850
- const spaceName = await resolveGoogleChatOutboundSpace({
854
+ const resolvedSpace = await resolveGoogleChatOutboundSpaceDetails({
851
855
  account,
852
856
  target: params.target
853
857
  });
858
+ const spaceName = resolvedSpace.name;
854
859
  if (!isGoogleChatSpaceTarget(spaceName)) return null;
855
- let space;
856
- try {
857
- space = await getGoogleChatSpace({
860
+ let chatType = resolvedSpace.resource ? resolveGoogleChatSpaceChatType(resolvedSpace.resource) : void 0;
861
+ if (!chatType) try {
862
+ chatType = resolveGoogleChatSpaceChatType(await getGoogleChatSpace({
858
863
  account,
859
864
  spaceName
860
- });
865
+ }));
861
866
  } catch {
862
867
  return null;
863
868
  }
864
- const chatType = resolveGoogleChatSpaceChatType(space);
865
869
  if (!chatType) return null;
866
870
  return buildChannelOutboundSessionRoute({
867
871
  cfg: params.cfg,
@@ -972,16 +976,18 @@ function projectGoogleChatLinkLabels(ir) {
972
976
  } : ir;
973
977
  }
974
978
  function markGoogleChatBulletLists(ir, markerToken) {
975
- let text = ir.text;
979
+ let characters;
976
980
  for (const item of ir.listItems ?? []) {
977
981
  const marker = item.listMarker;
978
- if (item.kind !== "bullet" || !marker || text.slice(marker.start, marker.end) !== "• ") continue;
979
- text = `${text.slice(0, marker.start)}${markerToken}${text.slice(marker.end)}`;
982
+ if (item.kind !== "bullet" || !marker || marker.end !== marker.start + 2 || ir.text[marker.start] !== "•" || ir.text[marker.start + 1] !== " ") continue;
983
+ characters ??= ir.text.split("");
984
+ characters[marker.start] = markerToken[0] ?? "";
985
+ characters[marker.start + 1] = markerToken[1] ?? "";
980
986
  }
981
- return text === ir.text ? ir : {
987
+ return characters ? {
982
988
  ...ir,
983
- text
984
- };
989
+ text: characters.join("")
990
+ } : ir;
985
991
  }
986
992
  function projectUnsafeCodeFallbacks(ir) {
987
993
  let text = ir.text;
@@ -1132,7 +1138,7 @@ function renderGoogleChatIR(ir, markers) {
1132
1138
  if (!href || !label) return null;
1133
1139
  const labelHasStyles = ir.styles.some((span) => span.start < link.end && span.end > link.start);
1134
1140
  return /[<>|]/u.test(href) || /[<>|*_~`]/u.test(label) || labelHasStyles ? {
1135
- start: link.start,
1141
+ start: link.end,
1136
1142
  end: link.end,
1137
1143
  open: "",
1138
1144
  close: ` (${href})`
@@ -1172,8 +1178,44 @@ function resolveGoogleChatGroupRequireMention(params) {
1172
1178
  }));
1173
1179
  }
1174
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
1175
1217
  //#region extensions/googlechat/src/channel.adapters.ts
1176
- const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CqOzrZWb.js"), "googleChatChannelRuntime");
1218
+ const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-DqiduEYL.js"), "googleChatChannelRuntime");
1177
1219
  function createGoogleChatSendReceipt(params) {
1178
1220
  const messageId = params.messageId?.trim();
1179
1221
  return createMessageReceiptFromOutboundResults({
@@ -1187,7 +1229,7 @@ function createGoogleChatSendReceipt(params) {
1187
1229
  kind: params.kind
1188
1230
  });
1189
1231
  }
1190
- const collectGoogleChatSecurityWarnings = composeAccountWarningCollectors(createAllowlistProviderOpenWarningCollector({
1232
+ const collectGoogleChatGroupPolicyWarnings = createAllowlistProviderOpenWarningCollector({
1191
1233
  providerConfigPresent: (cfg) => cfg.channels?.googlechat !== void 0,
1192
1234
  resolveGroupPolicy: (account) => account.config.groupPolicy,
1193
1235
  buildOpenWarning: {
@@ -1195,7 +1237,14 @@ const collectGoogleChatSecurityWarnings = composeAccountWarningCollectors(create
1195
1237
  openBehavior: "allows any space to trigger (mention-gated)",
1196
1238
  remediation: "Set channels.googlechat.groupPolicy=\"allowlist\" and configure channels.googlechat.groups"
1197
1239
  }
1198
- }), (account) => account.config.dmPolicy === "open" && "- Google Chat DMs are open to anyone. Set channels.googlechat.dmPolicy=\"pairing\" or \"allowlist\".");
1240
+ });
1241
+ const collectGoogleChatOpenGroupFindings = createConditionalWarningCollector.findings({
1242
+ collectWarnings: collectGoogleChatGroupPolicyWarnings,
1243
+ checkId: "channels.googlechat.groups.open",
1244
+ severity: "critical",
1245
+ title: "Google Chat security warning"
1246
+ });
1247
+ const collectGoogleChatSecurityWarnings = (params) => [...collectGoogleChatOpenGroupFindings(params), ...params.account.config.dmPolicy === "open" ? ["- Google Chat DMs are open to anyone. Set channels.googlechat.dmPolicy=\"pairing\" or \"allowlist\"."] : []];
1199
1248
  const googlechatGroupsAdapter = { resolveRequireMention: resolveGoogleChatGroupRequireMention };
1200
1249
  const googlechatDirectoryAdapter = createChannelDirectoryAdapter({
1201
1250
  listPeers: async (params) => listResolvedDirectoryUserEntriesFromAllowFrom({
@@ -1216,6 +1265,7 @@ const googlechatSecurityAdapter = {
1216
1265
  resolvePolicy: (account) => account.config.dmPolicy,
1217
1266
  resolveAllowFrom: (account) => account.config.allowFrom,
1218
1267
  allowFromPathSuffix: "",
1268
+ classifyEntryAuthentication: identityEntryAuthenticationClassifier(googleChatIngressIdentity),
1219
1269
  normalizeEntry: (raw) => formatGoogleChatAllowFromEntry(raw)
1220
1270
  },
1221
1271
  collectWarnings: collectGoogleChatSecurityWarnings
@@ -1337,4 +1387,4 @@ const googlechatMessageAdapter = defineChannelMessageAdapter({
1337
1387
  send: { text: googlechatOutboundAdapter.attachedResults.sendText }
1338
1388
  });
1339
1389
  //#endregion
1340
- export { registerGoogleChatManualApprovalFollowupSuppression as A, buildGoogleChatApprovalActionParameters as C, getGoogleChatApprovalCardBinding as D, createGoogleChatApprovalToken as E, unregisterGoogleChatApprovalCardBindings as M, unregisterGoogleChatManualApprovalFollowupSuppression as N, readGoogleChatApprovalActionToken as O, GOOGLECHAT_APPROVAL_ACTION as S, completeGoogleChatApprovalCardBinding as T, downloadGoogleChatMedia as _, googlechatPairingTextAdapter as a, updateGoogleChatMessage as b, buildGoogleChatGroupPolicyScope as c, isGoogleChatUserTarget as d, normalizeGoogleChatTarget as f, deleteGoogleChatMessage as g, GoogleChatApiError as h, googlechatOutboundAdapter as i, releaseGoogleChatApprovalCardBinding as j, registerGoogleChatApprovalCardBinding as k, isGoogleChatGroupSpace as l, resolveGoogleChatOutboundSpace as m, googlechatGroupsAdapter as n, googlechatSecurityAdapter as o, resolveGoogleChatOutboundSessionRoute as p, googlechatMessageAdapter as r, googlechatThreadingAdapter as s, googlechatDirectoryAdapter as t, isGoogleChatSpaceTarget as u, probeGoogleChat as v, claimGoogleChatApprovalCardBinding as w, verifyGoogleChatRequest as x, sendGoogleChatMessage as y };
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 { D as getGoogleChatApprovalCardBinding, O as readGoogleChatApprovalActionToken, T as completeGoogleChatApprovalCardBinding, _ as downloadGoogleChatMedia, b as updateGoogleChatMessage, c as buildGoogleChatGroupPolicyScope, g as deleteGoogleChatMessage, h as GoogleChatApiError, j as releaseGoogleChatApprovalCardBinding, l as isGoogleChatGroupSpace, v as probeGoogleChat, w as claimGoogleChatApprovalCardBinding, x as verifyGoogleChatRequest, y as sendGoogleChatMessage } from "./channel.adapters-DiI1p1ml.js";
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-Bm8YFEkI.js";
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,13 @@ 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";
17
+ import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
18
+ import { parseDateStringTimestampMs } from "openclaw/plugin-sdk/number-runtime";
16
19
  import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway-runtime";
17
- import { channelIngressRoutes, createChannelIngressResolver, createStandardRawEventIngressMonitor, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
18
20
  import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
19
- import { parseDateStringTimestampMs } from "openclaw/plugin-sdk/number-runtime";
20
21
  //#region extensions/googlechat/src/approval-terminal-card.ts
21
22
  const GOOGLECHAT_APPROVAL_CARD_ID = "openclaw-approval";
22
23
  const MAX_TEXT_PARAGRAPH_CHARS = 1800;
@@ -157,39 +158,6 @@ async function maybeHandleGoogleChatApprovalCardClick(params) {
157
158
  }
158
159
  //#endregion
159
160
  //#region extensions/googlechat/src/monitor-access.ts
160
- function normalizeUserId(raw) {
161
- const trimmed = normalizeOptionalString(raw) ?? "";
162
- if (!trimmed) return "";
163
- return normalizeLowercaseStringOrEmpty(trimmed.replace(/^users\//i, ""));
164
- }
165
- const GOOGLECHAT_EMAIL_KIND = "plugin:googlechat-email";
166
- function normalizeEntryValue(raw) {
167
- return normalizeLowercaseStringOrEmpty(raw ?? "");
168
- }
169
- function normalizeGoogleChatStableEntry(entry) {
170
- const withoutProvider = normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "");
171
- if (!withoutProvider) return null;
172
- return withoutProvider.startsWith("users/") ? normalizeUserId(withoutProvider) : withoutProvider;
173
- }
174
- function normalizeGoogleChatEmailEntry(entry) {
175
- if (normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "").startsWith("users/")) return null;
176
- const stable = normalizeGoogleChatStableEntry(entry);
177
- return stable?.includes("@") ? stable : null;
178
- }
179
- const googleChatIngressIdentity = defineStableChannelIngressIdentity({
180
- key: "sender-id",
181
- normalizeEntry: normalizeGoogleChatStableEntry,
182
- normalizeSubject: normalizeUserId,
183
- aliases: [{
184
- key: "email",
185
- kind: GOOGLECHAT_EMAIL_KIND,
186
- normalizeEntry: normalizeGoogleChatEmailEntry,
187
- normalizeSubject: normalizeEntryValue,
188
- dangerous: true
189
- }],
190
- isWildcardEntry: (entry) => normalizeEntryValue(entry) === "*",
191
- resolveEntryId: ({ entryIndex, fieldKey }) => fieldKey === "stableId" ? `entry-${entryIndex + 1}:user` : `entry-${entryIndex + 1}:${fieldKey}`
192
- });
193
161
  function resolveGoogleChatGroupConfig(params) {
194
162
  const { groupId, groupName, groups } = params;
195
163
  const entries = groups ?? {};
@@ -231,7 +199,7 @@ function extractMentionInfo(annotations, botUser) {
231
199
  const userName = entry.userMention?.user?.name;
232
200
  if (!userName) return false;
233
201
  if (botTargets.has(userName)) return true;
234
- return normalizeUserId(userName) === "app";
202
+ return normalizeGoogleChatUserId(userName) === "app";
235
203
  })
236
204
  };
237
205
  }
@@ -1001,14 +969,14 @@ async function processGoogleChatEvent(event, target, turnAdoptionLifecycle) {
1001
969
  * Resolve bot display name with fallback chain:
1002
970
  * 1. Account config name
1003
971
  * 2. Agent name from config
1004
- * 3. "OpenClaw" as generic fallback
972
+ * 3. Agent identity name, then "OpenClaw"
1005
973
  */
1006
974
  function resolveBotDisplayName(params) {
1007
975
  const { accountName, agentId, config } = params;
1008
976
  if (accountName?.trim()) return accountName.trim();
1009
- const agent = config.agents?.list?.find((a) => a.id === agentId);
977
+ const agent = resolveAgentConfig(config, agentId);
1010
978
  if (agent?.name?.trim()) return agent.name.trim();
1011
- return "OpenClaw";
979
+ return agent?.identity?.name?.trim() || "OpenClaw";
1012
980
  }
1013
981
  async function processMessageWithPipeline(params) {
1014
982
  const { event, account, config, runtime, core, statusSink, mediaMaxMb, turnAdoptionLifecycle } = params;
@@ -1097,6 +1065,14 @@ async function processMessageWithPipeline(params) {
1097
1065
  url: attachmentData.path,
1098
1066
  contentType: attachmentData.contentType ?? first.contentType
1099
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
+ }
1100
1076
  } catch (error) {
1101
1077
  if (!(error instanceof MediaFetchError) || error.code !== "max_bytes") throw error;
1102
1078
  const notice = `[Google Chat attachment too large; maximum ${mediaMaxMb} MB]`;
@@ -1106,7 +1082,15 @@ async function processMessageWithPipeline(params) {
1106
1082
  });
1107
1083
  runtime.error?.(`[${account.accountId}] ${notice} Increase channels.googlechat.mediaMaxMb to process larger attachments.`);
1108
1084
  }
1109
- const media = await toInboundMediaFactsWithMetadata(mediaInputs);
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
+ }
1093
+ const media = mediaInputs.length === 0 ? [] : await toInboundMediaFactsWithMetadata(mediaInputs);
1110
1094
  const fromLabel = isGroup ? space.displayName || `space:${spaceId}` : senderName || `user:${senderId}`;
1111
1095
  const timestampMs = parseDateStringTimestampMs(event.eventTime);
1112
1096
  const body = buildEnvelope({
@@ -1,4 +1,4 @@
1
- import { t as googlechatDirectoryAdapter } from "./channel.adapters-DiI1p1ml.js";
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-BFYyuE0F.js";
1
+ import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-DmWM0kwM.js";
2
2
  export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };