@openclaw/googlechat 2026.8.1-beta.3 → 2026.8.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.
Files changed (52) hide show
  1. package/dist/{actions-B5wHFHkX.js → actions-D6pxn1Wt.js} +10 -9
  2. package/dist/api.js +2 -2
  3. package/dist/{approval-auth-AECosdcm.js → approval-auth-CSGubNJm.js} +2 -2
  4. package/dist/{approval-handler.runtime-DcfApI4d.js → approval-handler.runtime-YEjSHISM.js} +3 -3
  5. package/dist/{channel-Cy93IxLN.js → channel-DzU2exVT.js} +39 -34
  6. package/dist/{channel-base-BpHXDsur.js → channel-base-B3EzcV7X.js} +35 -23
  7. package/dist/channel-plugin-api.js +1 -1
  8. package/dist/{channel.adapters-FZq5jdkN.js → channel.adapters-Cp5Cywji.js} +74 -35
  9. package/dist/{channel.runtime-CU_z4ppv.js → channel.runtime-CeEvWgz_.js} +30 -46
  10. package/dist/directory-contract-api.js +1 -1
  11. package/dist/{secret-contract-BFYyuE0F.js → secret-contract-DmWM0kwM.js} +1 -1
  12. package/dist/secret-contract-api.js +1 -1
  13. package/dist/setup-plugin-api.js +1 -1
  14. package/node_modules/google-auth-library/node_modules/gaxios/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  15. package/node_modules/google-auth-library/node_modules/gaxios/build/esm/tsconfig.tsbuildinfo +1 -1
  16. package/node_modules/google-auth-library/node_modules/gaxios/package.json +3 -3
  17. package/node_modules/google-auth-library/node_modules/gcp-metadata/build/src/index.js +59 -40
  18. package/node_modules/google-auth-library/node_modules/gcp-metadata/build/src/index.js.map +1 -1
  19. package/node_modules/google-auth-library/node_modules/gcp-metadata/package.json +20 -23
  20. package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/colours.d.ts +1 -29
  21. package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/colours.js +13 -13
  22. package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/colours.js.map +1 -1
  23. package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/index.d.ts +1 -0
  24. package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/index.js +1 -1
  25. package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/index.js.map +1 -1
  26. package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/logging-utils.d.ts +2 -135
  27. package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/logging-utils.js +35 -58
  28. package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/logging-utils.js.map +1 -1
  29. package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/temporal.js +8 -8
  30. package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/temporal.js.map +1 -1
  31. package/node_modules/google-auth-library/node_modules/google-logging-utils/package.json +16 -14
  32. package/node_modules/google-auth-library/package.json +7 -7
  33. package/openclaw.plugin.json +0 -4
  34. package/package.json +5 -5
  35. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/LICENSE +0 -202
  36. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/README.md +0 -73
  37. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/colours.d.ts +0 -1
  38. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/colours.js +0 -81
  39. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/colours.js.map +0 -1
  40. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/index.d.ts +0 -2
  41. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/index.js +0 -31
  42. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/index.js.map +0 -1
  43. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/logging-utils.d.ts +0 -89
  44. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/logging-utils.js +0 -414
  45. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/logging-utils.js.map +0 -1
  46. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/temporal.d.ts +0 -45
  47. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/temporal.js +0 -68
  48. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/temporal.js.map +0 -1
  49. package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/package.json +0 -47
  50. /package/node_modules/google-auth-library/node_modules/{gcp-metadata/node_modules/google-logging-utils → google-logging-utils}/build/src/types.d.ts +0 -0
  51. /package/node_modules/google-auth-library/node_modules/{gcp-metadata/node_modules/google-logging-utils → google-logging-utils}/build/src/types.js +0 -0
  52. /package/node_modules/google-auth-library/node_modules/{gcp-metadata/node_modules/google-logging-utils → google-logging-utils}/build/src/types.js.map +0 -0
@@ -1,6 +1,6 @@
1
- import { l as resolveGoogleChatAccount } from "./channel-base-BpHXDsur.js";
2
- import { m as resolveGoogleChatOutboundSpace, y as sendGoogleChatMessage } from "./channel.adapters-FZq5jdkN.js";
3
- import { n as describeGoogleChatMessageTool } from "./channel-Cy93IxLN.js";
1
+ import { l as resolveGoogleChatAccount } from "./channel-base-B3EzcV7X.js";
2
+ import { g as resolveGoogleChatOutboundSpace, x as sendGoogleChatMessage } from "./channel.adapters-Cp5Cywji.js";
3
+ import { n as describeGoogleChatMessageTool } from "./channel-DzU2exVT.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
@@ -50,15 +50,16 @@ const googlechatMessageActions = {
50
50
  account,
51
51
  target: to
52
52
  });
53
+ const sent = await sendGoogleChatMessage({
54
+ account,
55
+ space,
56
+ text: content,
57
+ thread: threadId ?? void 0
58
+ });
53
59
  return jsonResult({
54
60
  ok: true,
55
61
  to: space,
56
- ...await sendGoogleChatMessage({
57
- account,
58
- space,
59
- text: content,
60
- thread: threadId ?? void 0
61
- })
62
+ ...sent
62
63
  });
63
64
  }
64
65
  throw new Error(`Action ${action} is not supported for provider ${providerId}.`);
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as googlechatSetupAdapter, i as googlechatSetupWizard } from "./channel-base-BpHXDsur.js";
2
- import { t as googlechatPlugin } from "./channel-Cy93IxLN.js";
1
+ import { a as googlechatSetupAdapter, i as googlechatSetupWizard } from "./channel-base-B3EzcV7X.js";
2
+ import { t as googlechatPlugin } from "./channel-DzU2exVT.js";
3
3
  export { googlechatPlugin, googlechatSetupAdapter, googlechatSetupWizard };
@@ -1,5 +1,5 @@
1
- import { l as resolveGoogleChatAccount } from "./channel-base-BpHXDsur.js";
2
- import { d as isGoogleChatUserTarget, f as normalizeGoogleChatTarget } from "./channel.adapters-FZq5jdkN.js";
1
+ import { l as resolveGoogleChatAccount } from "./channel-base-B3EzcV7X.js";
2
+ import { m as normalizeGoogleChatTarget, p as isGoogleChatUserTarget } from "./channel.adapters-Cp5Cywji.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
- 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-FZq5jdkN.js";
3
- import { i as shouldHandleGoogleChatNativeApprovalRequest, r as isGoogleChatNativeApprovalClientEnabled } from "./channel-Cy93IxLN.js";
1
+ import { l as resolveGoogleChatAccount } from "./channel-base-B3EzcV7X.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-Cp5Cywji.js";
3
+ import { i as shouldHandleGoogleChatNativeApprovalRequest, r as isGoogleChatNativeApprovalClientEnabled } from "./channel-DzU2exVT.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
- 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-FZq5jdkN.js";
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-B3EzcV7X.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-Cp5Cywji.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-AECosdcm.js";
5
+ import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-CSGubNJm.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";
@@ -83,6 +83,23 @@ function shouldSuppressLocalGoogleChatExecApprovalPrompt(params) {
83
83
  isNativeDeliveryEnabled: isGoogleChatNativeApprovalClientEnabled
84
84
  });
85
85
  }
86
+ const resolveGoogleChatOriginTarget = createChannelNativeOriginTargetResolver({
87
+ channel: "googlechat",
88
+ shouldHandleRequest: shouldHandleGoogleChatNativeApprovalRequest,
89
+ resolveTurnSourceTarget: resolveTurnSourceGoogleChatOriginTarget,
90
+ resolveSessionTarget: resolveSessionGoogleChatOriginTarget
91
+ });
92
+ const resolveGoogleChatApproverDmTargets = createChannelApproverDmTargetResolver({
93
+ shouldHandleRequest: shouldHandleGoogleChatNativeApprovalRequest,
94
+ resolveApprovers: getGoogleChatApprovalApprovers,
95
+ mapApprover: (approver, params) => {
96
+ const to = normalizeGoogleChatApproverId(approver);
97
+ return to ? {
98
+ to,
99
+ accountId: normalizeOptionalString(params.accountId)
100
+ } : null;
101
+ }
102
+ });
86
103
  const googleChatApprovalCapability = createApproverRestrictedNativeApprovalCapability({
87
104
  channel: "googlechat",
88
105
  channelLabel: "Google Chat",
@@ -113,23 +130,8 @@ const googleChatApprovalCapability = createApproverRestrictedNativeApprovalCapab
113
130
  resolveNativeDeliveryMode: () => "channel",
114
131
  requireMatchingTurnSourceChannel: true,
115
132
  resolveSuppressionAccountId: ({ target, request }) => normalizeOptionalString(target.accountId) ?? normalizeOptionalString(request.request.turnSourceAccountId),
116
- resolveOriginTarget: createChannelNativeOriginTargetResolver({
117
- channel: "googlechat",
118
- shouldHandleRequest: shouldHandleGoogleChatNativeApprovalRequest,
119
- resolveTurnSourceTarget: resolveTurnSourceGoogleChatOriginTarget,
120
- resolveSessionTarget: resolveSessionGoogleChatOriginTarget
121
- }),
122
- resolveApproverDmTargets: createChannelApproverDmTargetResolver({
123
- shouldHandleRequest: shouldHandleGoogleChatNativeApprovalRequest,
124
- resolveApprovers: getGoogleChatApprovalApprovers,
125
- mapApprover: (approver, params) => {
126
- const to = normalizeGoogleChatApproverId(approver);
127
- return to ? {
128
- to,
129
- accountId: normalizeOptionalString(params.accountId)
130
- } : null;
131
- }
132
- }),
133
+ resolveOriginTarget: resolveGoogleChatOriginTarget,
134
+ resolveApproverDmTargets: resolveGoogleChatApproverDmTargets,
133
135
  nativeRuntime: createLazyChannelApprovalNativeRuntimeAdapter({
134
136
  eventKinds: ["exec", "plugin"],
135
137
  isConfigured: ({ cfg, accountId }) => isGoogleChatNativeApprovalClientEnabled({
@@ -142,20 +144,23 @@ const googleChatApprovalCapability = createApproverRestrictedNativeApprovalCapab
142
144
  approvalKind,
143
145
  request
144
146
  }),
145
- load: async () => (await import("./approval-handler.runtime-DcfApI4d.js")).googleChatApprovalNativeRuntime
147
+ load: async () => (await import("./approval-handler.runtime-YEjSHISM.js")).googleChatApprovalNativeRuntime
146
148
  })
147
149
  });
150
+ //#endregion
151
+ //#region extensions/googlechat/src/doctor.ts
152
+ const isGoogleChatMutableAllowEntry = buildMutableAllowEntryDetector({
153
+ prefixes: [
154
+ "googlechat:",
155
+ "google-chat:",
156
+ "gchat:",
157
+ "users/"
158
+ ],
159
+ stableIdPattern: /^[^@]+$/
160
+ });
148
161
  const collectGoogleChatMutableAllowlistWarnings = createDangerousNameMatchingMutableAllowlistWarningCollector({
149
162
  channel: "googlechat",
150
- detector: buildMutableAllowEntryDetector({
151
- prefixes: [
152
- "googlechat:",
153
- "google-chat:",
154
- "gchat:",
155
- "users/"
156
- ],
157
- stableIdPattern: /^[^@]+$/
158
- }),
163
+ detector: isGoogleChatMutableAllowEntry,
159
164
  collectLists: (scope) => collectStandardAllowlistLists(scope, {
160
165
  includeGroups: true,
161
166
  groupField: "users"
@@ -163,7 +168,7 @@ const collectGoogleChatMutableAllowlistWarnings = createDangerousNameMatchingMut
163
168
  });
164
169
  //#endregion
165
170
  //#region extensions/googlechat/src/gateway.ts
166
- const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-CU_z4ppv.js"), "googleChatChannelRuntime");
171
+ const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-CeEvWgz_.js"), "googleChatChannelRuntime");
167
172
  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
173
  async function startGoogleChatGatewayAccount(ctx) {
169
174
  const account = ctx.account;
@@ -241,13 +246,13 @@ function describeGoogleChatMessageTool({ cfg, accountId }) {
241
246
  }
242
247
  //#endregion
243
248
  //#region extensions/googlechat/src/channel.ts
244
- const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CU_z4ppv.js"), "googleChatChannelRuntime");
249
+ const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CeEvWgz_.js"), "googleChatChannelRuntime");
245
250
  const googlechatActions = {
246
251
  describeMessageTool: describeGoogleChatMessageTool,
247
252
  supportsAction: ({ action }) => action === "send",
248
253
  extractToolSend: ({ args }) => extractToolSend(args, "sendMessage"),
249
254
  handleAction: async (ctx) => {
250
- const { googlechatMessageActions } = await import("./actions-B5wHFHkX.js");
255
+ const { googlechatMessageActions } = await import("./actions-D6pxn1Wt.js");
251
256
  if (!googlechatMessageActions.handleAction) throw new Error("Google Chat actions are not available.");
252
257
  return await googlechatMessageActions.handleAction(ctx);
253
258
  }
@@ -14,7 +14,7 @@ import { createPatchedAccountSetupAdapter, createSetupInputPresenceValidator } f
14
14
  import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
15
15
  import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, applySetupAccountConfigPatch, createPromptParsedAllowFromForAccount, createSetupTranslator, createStandardChannelSetupStatus, formatDocsLink, mergeAllowFromEntries, migrateBaseNameToDefaultAccount, splitSetupEntries } from "openclaw/plugin-sdk/setup";
16
16
  //#region extensions/googlechat/src/google-auth-limits.ts
17
- const MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES = 64 * 1024;
17
+ const MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES = 65536;
18
18
  //#endregion
19
19
  //#region extensions/googlechat/src/accounts.ts
20
20
  const ENV_SERVICE_ACCOUNT$1 = "GOOGLE_CHAT_SERVICE_ACCOUNT";
@@ -76,7 +76,8 @@ function resolveCredentialsFromConfig(params) {
76
76
  };
77
77
  const file = normalizeOptionalString(account.serviceAccountFile);
78
78
  if (file) {
79
- const result = tryReadSecretFileSync(resolveUserPath(file), "Google Chat service account file", {
79
+ const resolvedFile = resolveUserPath(file);
80
+ const result = tryReadSecretFileSync(resolvedFile, "Google Chat service account file", {
80
81
  maxBytes: MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES,
81
82
  rejectHardlinks: false,
82
83
  rejectSymlink: false
@@ -102,7 +103,8 @@ function resolveCredentialsFromConfig(params) {
102
103
  };
103
104
  const envFile = normalizeOptionalString(process.env[ENV_SERVICE_ACCOUNT_FILE$1]);
104
105
  if (envFile) {
105
- const result = tryReadSecretFileSync(resolveUserPath(envFile), "Google Chat service account file", {
106
+ const resolvedEnvFile = resolveUserPath(envFile);
107
+ const result = tryReadSecretFileSync(resolvedEnvFile, "Google Chat service account file", {
106
108
  maxBytes: MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES,
107
109
  rejectHardlinks: false,
108
110
  rejectSymlink: false
@@ -155,10 +157,22 @@ function resolveGoogleChatAccount(params) {
155
157
  });
156
158
  }
157
159
  function inspectGoogleChatAccount(params) {
158
- return resolveGoogleChatAccountWithMode({
160
+ const account = resolveGoogleChatAccountWithMode({
159
161
  ...params,
160
162
  mode: "inspect"
161
163
  });
164
+ return {
165
+ ...account,
166
+ configured: isGoogleChatAccountConfigured(account),
167
+ audienceType: account.config.audienceType,
168
+ audience: account.config.audience,
169
+ webhookPath: account.config.webhookPath,
170
+ webhookUrl: account.config.webhookUrl,
171
+ dmPolicy: account.config.dmPolicy ?? "pairing"
172
+ };
173
+ }
174
+ function isGoogleChatAccountConfigured(account) {
175
+ return account.tokenStatus ? account.tokenStatus !== "missing" : account.credentialSource !== "none";
162
176
  }
163
177
  const googlechatSetupAdapter = createPatchedAccountSetupAdapter({
164
178
  channelKey: "googlechat",
@@ -252,6 +266,22 @@ const ENV_SERVICE_ACCOUNT = "GOOGLE_CHAT_SERVICE_ACCOUNT";
252
266
  const ENV_SERVICE_ACCOUNT_FILE = "GOOGLE_CHAT_SERVICE_ACCOUNT_FILE";
253
267
  const USE_ENV_FLAG = "__googlechatUseEnv";
254
268
  const AUTH_METHOD_FLAG = "__googlechatAuthMethod";
269
+ const promptAllowFrom = createPromptParsedAllowFromForAccount({
270
+ defaultAccountId: resolveDefaultGoogleChatAccountId,
271
+ message: t("wizard.googlechat.allowFromPrompt"),
272
+ placeholder: "users/123456789, name@example.com",
273
+ parseEntries: (raw) => ({ entries: mergeAllowFromEntries(void 0, splitSetupEntries(raw)) }),
274
+ getExistingAllowFrom: ({ cfg, accountId }) => resolveGoogleChatAccount({
275
+ cfg,
276
+ accountId
277
+ }).config.allowFrom ?? [],
278
+ applyAllowFrom: ({ cfg, accountId, allowFrom }) => applySetupAccountConfigPatch({
279
+ cfg,
280
+ channelKey: channel,
281
+ accountId,
282
+ patch: { allowFrom }
283
+ })
284
+ });
255
285
  const googlechatDmPolicy = createChannelDmPolicy({
256
286
  label: "Google Chat",
257
287
  channel,
@@ -265,22 +295,7 @@ const googlechatDmPolicy = createChannelDmPolicy({
265
295
  accountId: account.accountId,
266
296
  patch
267
297
  }),
268
- promptAllowFrom: createPromptParsedAllowFromForAccount({
269
- defaultAccountId: resolveDefaultGoogleChatAccountId,
270
- message: t("wizard.googlechat.allowFromPrompt"),
271
- placeholder: "users/123456789, name@example.com",
272
- parseEntries: (raw) => ({ entries: mergeAllowFromEntries(void 0, splitSetupEntries(raw)) }),
273
- getExistingAllowFrom: ({ cfg, accountId }) => resolveGoogleChatAccount({
274
- cfg,
275
- accountId
276
- }).config.allowFrom ?? [],
277
- applyAllowFrom: ({ cfg, accountId, allowFrom }) => applySetupAccountConfigPatch({
278
- cfg,
279
- channelKey: channel,
280
- accountId,
281
- patch: { allowFrom }
282
- })
283
- })
298
+ promptAllowFrom
284
299
  });
285
300
  function createServiceAccountTextInput(params) {
286
301
  return {
@@ -447,9 +462,6 @@ const googleChatConfigAdapter = createScopedChannelConfigAdapter({
447
462
  }),
448
463
  resolveDefaultTo: (account) => account.config.defaultTo
449
464
  });
450
- function isGoogleChatAccountConfigured(account) {
451
- return account.tokenStatus ? account.tokenStatus !== "missing" : account.credentialSource !== "none";
452
- }
453
465
  function createGoogleChatPluginBase(params = {}) {
454
466
  return {
455
467
  id: GOOGLECHAT_CHANNEL_ID,
@@ -1,2 +1,2 @@
1
- import { t as googlechatPlugin } from "./channel-Cy93IxLN.js";
1
+ import { t as googlechatPlugin } from "./channel-DzU2exVT.js";
2
2
  export { googlechatPlugin };
@@ -1,4 +1,4 @@
1
- import { l as resolveGoogleChatAccount, r as formatGoogleChatAllowFromEntry, u as MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES } from "./channel-base-BpHXDsur.js";
1
+ import { l as resolveGoogleChatAccount, r as formatGoogleChatAllowFromEntry, u as MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES } from "./channel-base-B3EzcV7X.js";
2
2
  import { d as fetchWithSsrFGuard$1, m as missingTargetError, r as PAIRING_APPROVED_MESSAGE } from "./runtime-api-Dh0CNVS4.js";
3
3
  import { buildChannelOutboundSessionRoute } from "openclaw/plugin-sdk/channel-core";
4
4
  import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
@@ -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
@@ -175,7 +176,7 @@ const GOOGLE_AUTH_PROVIDER_CERTS_URL = "https://www.googleapis.com/oauth2/v1/cer
175
176
  const GOOGLE_AUTH_TOKEN_URI = "https://oauth2.googleapis.com/token";
176
177
  const GOOGLE_AUTH_UNIVERSE_DOMAIN = "googleapis.com";
177
178
  const GOOGLE_CLIENT_CERTS_URL_PREFIX = "https://www.googleapis.com/robot/v1/metadata/x509/";
178
- const MAX_GOOGLE_AUTH_RESPONSE_BYTES = 1024 * 1024;
179
+ const MAX_GOOGLE_AUTH_RESPONSE_BYTES = 1048576;
179
180
  let googleAuthRuntimePromise = null;
180
181
  function normalizeGoogleAuthPreparedRequestHeaders(config) {
181
182
  if (!(config.headers instanceof Headers)) config.headers = new Headers(config.headers);
@@ -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);
@@ -528,17 +525,14 @@ async function getGoogleChatAccessToken(account) {
528
525
  }
529
526
  async function fetchChatCerts() {
530
527
  const now = Date.now();
531
- if (cachedCerts && now - cachedCerts.fetchedAt < 600 * 1e3) return cachedCerts.certs;
528
+ if (cachedCerts && now - cachedCerts.fetchedAt < 6e5) return cachedCerts.certs;
532
529
  const { response, release } = await fetchWithSsrFGuard$1({
533
530
  url: CHAT_CERTS_URL,
534
531
  auditContext: "googlechat.auth.certs",
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,
@@ -614,12 +608,12 @@ async function verifyGoogleChatRequest(params) {
614
608
  const CHAT_API_BASE = "https://chat.googleapis.com/v1";
615
609
  const GOOGLECHAT_API_TIMEOUT_MS = 3e4;
616
610
  const GOOGLECHAT_MEDIA_TIMEOUT_GRACE_MS = 3e4;
617
- const GOOGLECHAT_MEDIA_MIN_BYTES_PER_SECOND = 256 * 1024;
618
- const GOOGLECHAT_MEDIA_MAX_TIMEOUT_MS = 15 * 6e4;
611
+ const GOOGLECHAT_MEDIA_MIN_BYTES_PER_SECOND = 262144;
612
+ const GOOGLECHAT_MEDIA_MAX_TIMEOUT_MS = 9e5;
619
613
  const GOOGLECHAT_RESPONSE_READ_IDLE_TIMEOUT_MS = 3e4;
620
- const GOOGLECHAT_JSON_RESPONSE_MAX_BYTES = 16 * 1024 * 1024;
621
- const GOOGLECHAT_ERROR_BODY_MAX_BYTES = 16 * 1024;
622
- const GOOGLE_CHAT_MEDIA_RESPONSE_MAX_BYTES = 20 * 1024 * 1024;
614
+ const GOOGLECHAT_JSON_RESPONSE_MAX_BYTES = 16777216;
615
+ const GOOGLECHAT_ERROR_BODY_MAX_BYTES = 16384;
616
+ const GOOGLE_CHAT_MEDIA_RESPONSE_MAX_BYTES = 20971520;
623
617
  var GoogleChatApiError = class extends Error {
624
618
  constructor(status, message) {
625
619
  super(message);
@@ -640,12 +634,13 @@ async function readGoogleChatJsonResponse(response, label) {
640
634
  });
641
635
  }
642
636
  async function readGoogleChatErrorResponse(response, label) {
643
- return redactToolPayloadText(await readResponseTextSnippet(response, {
637
+ const text = await readResponseTextSnippet(response, {
644
638
  maxBytes: GOOGLECHAT_ERROR_BODY_MAX_BYTES,
645
639
  maxChars: GOOGLECHAT_ERROR_BODY_MAX_BYTES,
646
640
  chunkTimeoutMs: GOOGLECHAT_RESPONSE_READ_IDLE_TIMEOUT_MS,
647
641
  onIdleTimeout: ({ chunkTimeoutMs }) => /* @__PURE__ */ new Error(`${label} error response stalled after ${chunkTimeoutMs}ms`)
648
- }) ?? "");
642
+ }) ?? "";
643
+ return redactToolPayloadText(text);
649
644
  }
650
645
  const headersToObject = (headers) => headers instanceof Headers ? Object.fromEntries(headers.entries()) : Array.isArray(headers) ? Object.fromEntries(headers) : headers || {};
651
646
  async function withGoogleChatResponse(params) {
@@ -831,41 +826,47 @@ function stripMessageSuffix(target) {
831
826
  if (index === -1) return target;
832
827
  return target.slice(0, index);
833
828
  }
834
- async function resolveGoogleChatOutboundSpace(params) {
829
+ async function resolveGoogleChatOutboundSpaceDetails(params) {
835
830
  const normalized = normalizeGoogleChatTarget(params.target);
836
831
  if (!normalized) throw new Error("Missing Google Chat target.");
837
832
  const base = stripMessageSuffix(normalized);
838
- if (isGoogleChatSpaceTarget(base)) return base;
833
+ if (isGoogleChatSpaceTarget(base)) return { name: base };
839
834
  if (isGoogleChatUserTarget(base)) {
840
835
  const dm = await findGoogleChatDirectMessage({
841
836
  account: params.account,
842
837
  userName: base
843
838
  });
844
839
  if (!dm?.name) throw new Error(`No Google Chat DM found for ${base}`);
845
- return dm.name;
840
+ return {
841
+ name: dm.name,
842
+ resource: dm
843
+ };
846
844
  }
847
- return base;
845
+ return { name: base };
846
+ }
847
+ async function resolveGoogleChatOutboundSpace(params) {
848
+ return (await resolveGoogleChatOutboundSpaceDetails(params)).name;
848
849
  }
849
850
  async function resolveGoogleChatOutboundSessionRoute(params) {
850
851
  const account = resolveGoogleChatAccount({
851
852
  cfg: params.cfg,
852
853
  accountId: params.accountId
853
854
  });
854
- const spaceName = await resolveGoogleChatOutboundSpace({
855
+ const resolvedSpace = await resolveGoogleChatOutboundSpaceDetails({
855
856
  account,
856
857
  target: params.target
857
858
  });
859
+ const spaceName = resolvedSpace.name;
858
860
  if (!isGoogleChatSpaceTarget(spaceName)) return null;
859
- let space;
860
- try {
861
- space = await getGoogleChatSpace({
861
+ let chatType = resolvedSpace.resource ? resolveGoogleChatSpaceChatType(resolvedSpace.resource) : void 0;
862
+ if (!chatType) try {
863
+ chatType = resolveGoogleChatSpaceChatType(await getGoogleChatSpace({
862
864
  account,
863
865
  spaceName
864
- });
866
+ }));
865
867
  } catch {
866
868
  return null;
867
869
  }
868
- const chatType = resolveGoogleChatSpaceChatType(space);
869
870
  if (!chatType) return null;
870
871
  return buildChannelOutboundSessionRoute({
871
872
  cfg: params.cfg,
@@ -1090,7 +1091,8 @@ function emitGoogleChatBlockquotes(text, markers) {
1090
1091
  return rendered;
1091
1092
  }
1092
1093
  function prepareGoogleChatIR(text) {
1093
- const ir = projectGoogleChatPlainLiterals(projectGoogleChatLinkLabels(projectDecodedGoogleChatResources(projectUnsafeCodeFallbacks(markdownToIR(sanitizeGoogleChatText(text), {
1094
+ const sanitized = sanitizeGoogleChatText(text);
1095
+ const ir = projectGoogleChatPlainLiterals(projectGoogleChatLinkLabels(projectDecodedGoogleChatResources(projectUnsafeCodeFallbacks(markdownToIR(sanitized, {
1094
1096
  enableSpoilers: true,
1095
1097
  enableTaskLists: true,
1096
1098
  headingStyle: "rich",
@@ -1138,7 +1140,7 @@ function renderGoogleChatIR(ir, markers) {
1138
1140
  if (!href || !label) return null;
1139
1141
  const labelHasStyles = ir.styles.some((span) => span.start < link.end && span.end > link.start);
1140
1142
  return /[<>|]/u.test(href) || /[<>|*_~`]/u.test(label) || labelHasStyles ? {
1141
- start: link.start,
1143
+ start: link.end,
1142
1144
  end: link.end,
1143
1145
  open: "",
1144
1146
  close: ` (${href})`
@@ -1157,7 +1159,7 @@ function formatGoogleChatTextChunks(text, limit = GOOGLE_CHAT_FORMAT_PROFILE.chu
1157
1159
  return renderMarkdownIRChunksWithinLimit({
1158
1160
  ir: prepared.ir,
1159
1161
  limit: Math.min(limit, GOOGLE_CHAT_FORMAT_PROFILE.chunk.limit),
1160
- measureRendered: (rendered) => new TextEncoder().encode(rendered).byteLength,
1162
+ measureRendered: (rendered) => Buffer.byteLength(rendered, "utf8"),
1161
1163
  renderChunk: (chunk) => renderGoogleChatIR(chunk, prepared.markers)
1162
1164
  }).map((chunk) => chunk.rendered);
1163
1165
  }
@@ -1178,8 +1180,44 @@ function resolveGoogleChatGroupRequireMention(params) {
1178
1180
  }));
1179
1181
  }
1180
1182
  //#endregion
1183
+ //#region extensions/googlechat/src/ingress-identity.ts
1184
+ function normalizeGoogleChatUserId(raw) {
1185
+ const trimmed = normalizeOptionalString(raw) ?? "";
1186
+ if (!trimmed) return "";
1187
+ return normalizeLowercaseStringOrEmpty(trimmed.replace(/^users\//i, ""));
1188
+ }
1189
+ const GOOGLECHAT_EMAIL_KIND = "plugin:googlechat-email";
1190
+ function normalizeEntryValue(raw) {
1191
+ return normalizeLowercaseStringOrEmpty(raw ?? "");
1192
+ }
1193
+ function normalizeGoogleChatStableEntry(entry) {
1194
+ const withoutProvider = normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "");
1195
+ if (!withoutProvider) return null;
1196
+ return withoutProvider.startsWith("users/") ? normalizeGoogleChatUserId(withoutProvider) : withoutProvider;
1197
+ }
1198
+ function normalizeGoogleChatEmailEntry(entry) {
1199
+ if (normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "").startsWith("users/")) return null;
1200
+ const stable = normalizeGoogleChatStableEntry(entry);
1201
+ return stable?.includes("@") ? stable : null;
1202
+ }
1203
+ const googleChatIngressIdentity = defineStableChannelIngressIdentity({
1204
+ key: "sender-id",
1205
+ authentication: "verified",
1206
+ normalizeEntry: normalizeGoogleChatStableEntry,
1207
+ normalizeSubject: normalizeGoogleChatUserId,
1208
+ aliases: [{
1209
+ key: "email",
1210
+ kind: GOOGLECHAT_EMAIL_KIND,
1211
+ normalizeEntry: normalizeGoogleChatEmailEntry,
1212
+ normalizeSubject: normalizeEntryValue,
1213
+ authentication: "mutable"
1214
+ }],
1215
+ isWildcardEntry: (entry) => normalizeEntryValue(entry) === "*",
1216
+ resolveEntryId: ({ entryIndex, fieldKey }) => fieldKey === "stableId" ? `entry-${entryIndex + 1}:user` : `entry-${entryIndex + 1}:${fieldKey}`
1217
+ });
1218
+ //#endregion
1181
1219
  //#region extensions/googlechat/src/channel.adapters.ts
1182
- const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CU_z4ppv.js"), "googleChatChannelRuntime");
1220
+ const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CeEvWgz_.js"), "googleChatChannelRuntime");
1183
1221
  function createGoogleChatSendReceipt(params) {
1184
1222
  const messageId = params.messageId?.trim();
1185
1223
  return createMessageReceiptFromOutboundResults({
@@ -1229,6 +1267,7 @@ const googlechatSecurityAdapter = {
1229
1267
  resolvePolicy: (account) => account.config.dmPolicy,
1230
1268
  resolveAllowFrom: (account) => account.config.allowFrom,
1231
1269
  allowFromPathSuffix: "",
1270
+ classifyEntryAuthentication: identityEntryAuthenticationClassifier(googleChatIngressIdentity),
1232
1271
  normalizeEntry: (raw) => formatGoogleChatAllowFromEntry(raw)
1233
1272
  },
1234
1273
  collectWarnings: collectGoogleChatSecurityWarnings
@@ -1350,4 +1389,4 @@ const googlechatMessageAdapter = defineChannelMessageAdapter({
1350
1389
  send: { text: googlechatOutboundAdapter.attachedResults.sendText }
1351
1390
  });
1352
1391
  //#endregion
1353
- 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 };
1392
+ 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 };