@openclaw/googlechat 2026.10.1 → 2026.10.5-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { l as resolveGoogleChatAccount } from "./channel-base-BdCGLoFe.mjs";
2
- import { g as resolveGoogleChatOutboundSpace, x as sendGoogleChatMessage } from "./channel.adapters-CcYyfMMC.mjs";
2
+ import { g as resolveGoogleChatOutboundSpace, x as sendGoogleChatMessage } from "./channel.adapters-B54Nj4rn.mjs";
3
3
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { jsonResult, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/channel-actions";
5
5
  //#region extensions/googlechat/src/actions.ts
@@ -1,5 +1,5 @@
1
1
  import { l as resolveGoogleChatAccount } from "./channel-base-BdCGLoFe.mjs";
2
- import { m as normalizeGoogleChatTarget, p as isGoogleChatUserTarget } from "./channel.adapters-CcYyfMMC.mjs";
2
+ import { m as normalizeGoogleChatTarget, p as isGoogleChatUserTarget } from "./channel.adapters-B54Nj4rn.mjs";
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-BdCGLoFe.mjs";
2
- import { A as unregisterGoogleChatManualApprovalFollowupSuppression, E as googleChatApprovalControls, O as registerGoogleChatApprovalCardBinding, S as updateGoogleChatMessage, T as buildGoogleChatApprovalActionParameters, g as resolveGoogleChatOutboundSpace, k as registerGoogleChatManualApprovalFollowupSuppression, w as GOOGLECHAT_APPROVAL_ACTION, x as sendGoogleChatMessage } from "./channel.adapters-CcYyfMMC.mjs";
3
- import { n as isGoogleChatNativeApprovalClientEnabled, r as shouldHandleGoogleChatNativeApprovalRequest } from "./channel-CRIyIoxn.mjs";
2
+ import { A as unregisterGoogleChatManualApprovalFollowupSuppression, E as googleChatApprovalControls, O as registerGoogleChatApprovalCardBinding, S as updateGoogleChatMessage, T as buildGoogleChatApprovalActionParameters, g as resolveGoogleChatOutboundSpace, k as registerGoogleChatManualApprovalFollowupSuppression, w as GOOGLECHAT_APPROVAL_ACTION, x as sendGoogleChatMessage } from "./channel.adapters-B54Nj4rn.mjs";
3
+ import { n as isGoogleChatNativeApprovalClientEnabled, r as shouldHandleGoogleChatNativeApprovalRequest } from "./channel-CNQuKfU7.mjs";
4
4
  import { n as escapeGoogleChatApprovalCardText, t as buildGoogleChatApprovalTextWidget } from "./approval-card-text-BKg_4mXq.mjs";
5
5
  import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
6
6
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -1,8 +1,8 @@
1
1
  import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BzoaiFSD.mjs";
2
2
  import { n as buildChannelConfigSchema, t as GoogleChatConfigSchema } from "./config-api-CsD0IFxF.mjs";
3
3
  import { c as resolveDefaultGoogleChatAccountId, l as resolveGoogleChatAccount, n as createGoogleChatPluginBase, o as inspectGoogleChatAccount, s as listGoogleChatAccountIds, t as GOOGLECHAT_CHANNEL_ID } from "./channel-base-BdCGLoFe.mjs";
4
- 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-CcYyfMMC.mjs";
5
- import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-7RuArHyo.mjs";
4
+ 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-B54Nj4rn.mjs";
5
+ import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-CHn-C5YE.mjs";
6
6
  import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-020OItNt.mjs";
7
7
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
8
8
  import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
@@ -132,7 +132,7 @@ const googleChatApprovalCapability = createApproverRestrictedNativeApprovalCapab
132
132
  ],
133
133
  isConfigured: isGoogleChatNativeApprovalClientEnabled,
134
134
  shouldHandle: shouldHandleGoogleChatNativeApprovalRequest,
135
- load: async () => (await import("./approval-handler.runtime-D0dWJcjH.mjs")).googleChatApprovalNativeRuntime
135
+ load: async () => (await import("./approval-handler.runtime-r0gTDaSz.mjs")).googleChatApprovalNativeRuntime
136
136
  })
137
137
  });
138
138
  //#endregion
@@ -156,7 +156,7 @@ const collectGoogleChatMutableAllowlistWarnings = createDangerousNameMatchingMut
156
156
  });
157
157
  //#endregion
158
158
  //#region extensions/googlechat/src/gateway.ts
159
- const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-BEP3QsS4.mjs"), "googleChatChannelRuntime");
159
+ const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-BlI4aJ2a.mjs"), "googleChatChannelRuntime");
160
160
  const UNRESOLVED_WEBHOOK_URL_ERROR = "Invalid webhookUrl: expected an absolute URL such as https://chat.example.com/googlechat. No inbound webhook route was registered.";
161
161
  async function startGoogleChatGatewayAccount(ctx) {
162
162
  const account = ctx.account;
@@ -226,11 +226,11 @@ const googlechatMessageActions = {
226
226
  describeMessageTool: describeGoogleChatMessageTool,
227
227
  supportsAction: ({ action }) => action === "send",
228
228
  extractToolSend: ({ args }) => extractToolSend(args, "sendMessage"),
229
- handleAction: async (ctx) => (await import("./actions-BtW6Mbtw.mjs")).handleGoogleChatAction(ctx)
229
+ handleAction: async (ctx) => (await import("./actions-BBxrBsOk.mjs")).handleGoogleChatAction(ctx)
230
230
  };
231
231
  //#endregion
232
232
  //#region extensions/googlechat/src/channel.ts
233
- const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-BEP3QsS4.mjs"), "googleChatChannelRuntime");
233
+ const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-BlI4aJ2a.mjs"), "googleChatChannelRuntime");
234
234
  const googlechatPlugin = createChatChannelPlugin({
235
235
  base: {
236
236
  ...createGoogleChatPluginBase({ configSchema: buildChannelConfigSchema(GoogleChatConfigSchema) }),
@@ -209,27 +209,22 @@ function readRequiredTrimmedString(record, fieldName) {
209
209
  if (value === void 0) throw new Error(`Google Chat service account is missing "${fieldName}"`);
210
210
  return value;
211
211
  }
212
- function assertExactUrlField(record, fieldName, expectedUrl) {
212
+ function assertExactField(record, fieldName, expectedUrl) {
213
213
  const value = readOptionalTrimmedString(record, fieldName);
214
214
  if (!value) return;
215
215
  if (value !== expectedUrl) throw new Error(`Google Chat service account field "${fieldName}" must be ${expectedUrl}, got ${value}`);
216
216
  }
217
- function assertUrlPrefixField(record, fieldName, expectedPrefix) {
218
- const value = readOptionalTrimmedString(record, fieldName);
219
- if (!value) return;
220
- if (!value.startsWith(expectedPrefix)) throw new Error(`Google Chat service account field "${fieldName}" must start with ${expectedPrefix}, got ${value}`);
221
- }
222
217
  function validateGoogleChatServiceAccountCredentials(credentials) {
223
218
  const type = readOptionalTrimmedString(credentials, "type");
224
219
  if (type && type !== "service_account") throw new Error(`Google Chat credentials must use service_account auth, got "${type}" instead`);
225
220
  const clientEmail = readRequiredTrimmedString(credentials, "client_email");
226
221
  const privateKey = readRequiredTrimmedString(credentials, "private_key");
227
- const universeDomain = readOptionalTrimmedString(credentials, "universe_domain");
228
- 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}`);
229
- assertExactUrlField(credentials, "auth_uri", GOOGLE_AUTH_URI);
230
- assertExactUrlField(credentials, "auth_provider_x509_cert_url", GOOGLE_AUTH_PROVIDER_CERTS_URL);
231
- assertExactUrlField(credentials, "token_uri", GOOGLE_AUTH_TOKEN_URI);
232
- assertUrlPrefixField(credentials, "client_x509_cert_url", GOOGLE_CLIENT_CERTS_URL_PREFIX);
222
+ assertExactField(credentials, "universe_domain", GOOGLE_AUTH_UNIVERSE_DOMAIN);
223
+ assertExactField(credentials, "auth_uri", GOOGLE_AUTH_URI);
224
+ assertExactField(credentials, "auth_provider_x509_cert_url", GOOGLE_AUTH_PROVIDER_CERTS_URL);
225
+ assertExactField(credentials, "token_uri", GOOGLE_AUTH_TOKEN_URI);
226
+ const certUrl = readOptionalTrimmedString(credentials, "client_x509_cert_url");
227
+ if (certUrl && !certUrl.startsWith(GOOGLE_CLIENT_CERTS_URL_PREFIX)) throw new Error(`Google Chat service account field "client_x509_cert_url" must start with ${GOOGLE_CLIENT_CERTS_URL_PREFIX}, got ${certUrl}`);
233
228
  return {
234
229
  ...credentials,
235
230
  client_email: clientEmail,
@@ -288,18 +283,14 @@ function resolveGoogleAuthDispatcherPolicy(input, init) {
288
283
  const proxyBypassed = shouldBypassGoogleAuthProxy(requestUrl, Array.isArray(googleAuthInit.noProxy) ? googleAuthInit.noProxy : []);
289
284
  const agent = resolveGoogleAuthAgent(googleAuthInit, requestUrl);
290
285
  const explicitProxy = (googleAuthInit.proxy instanceof URL ? googleAuthInit.proxy.toString() : normalizeOptionalString(googleAuthInit.proxy)) ?? (hasProxyAgentShape(agent) ? agent.proxy.toString() : void 0);
291
- if (!proxyBypassed && explicitProxy) return {
292
- dispatcherPolicy: {
293
- allowPrivateProxy: true,
294
- mode: "explicit-proxy",
295
- ...hasTlsOptions(tlsOptions) ? { proxyTls: { ...tlsOptions } } : {},
296
- proxyUrl: explicitProxy
297
- },
298
- init: nextInit
299
- };
300
- if (proxyBypassed ? void 0 : resolveGoogleAuthEnvProxyUrl(requestUrl.protocol === "http:" ? "http" : "https")) return {
286
+ const proxyUrl = proxyBypassed ? void 0 : explicitProxy ?? resolveGoogleAuthEnvProxyUrl(requestUrl.protocol === "http:" ? "http" : "https");
287
+ if (proxyUrl) return {
301
288
  dispatcherPolicy: {
302
- mode: "env-proxy",
289
+ ...explicitProxy ? {
290
+ allowPrivateProxy: true,
291
+ mode: "explicit-proxy",
292
+ proxyUrl
293
+ } : { mode: "env-proxy" },
303
294
  ...hasTlsOptions(tlsOptions) ? { proxyTls: { ...tlsOptions } } : {}
304
295
  },
305
296
  init: nextInit
@@ -313,32 +304,30 @@ function resolveGoogleAuthDispatcherPolicy(input, init) {
313
304
  };
314
305
  return { init: nextInit };
315
306
  }
316
- function createGoogleAuthFetch() {
317
- return async (input, init) => {
318
- const url = input instanceof Request ? input.url : String(input);
319
- const guardedOptions = resolveGoogleAuthDispatcherPolicy(input, init);
320
- const { response, release } = await fetchWithSsrFGuard({
321
- auditContext: "googlechat.auth.google-auth",
322
- dispatcherPolicy: guardedOptions.dispatcherPolicy,
323
- init: guardedOptions.init,
324
- policy: GOOGLE_AUTH_POLICY,
325
- signal: guardedOptions.init?.signal ?? void 0,
326
- timeoutMs: GOOGLE_AUTH_FETCH_TIMEOUT_MS,
327
- url
307
+ async function googleAuthFetch(input, init) {
308
+ const url = input instanceof Request ? input.url : String(input);
309
+ const guardedOptions = resolveGoogleAuthDispatcherPolicy(input, init);
310
+ const { response, release } = await fetchWithSsrFGuard({
311
+ auditContext: "googlechat.auth.google-auth",
312
+ dispatcherPolicy: guardedOptions.dispatcherPolicy,
313
+ init: guardedOptions.init,
314
+ policy: GOOGLE_AUTH_POLICY,
315
+ signal: guardedOptions.init?.signal ?? void 0,
316
+ timeoutMs: GOOGLE_AUTH_FETCH_TIMEOUT_MS,
317
+ url
318
+ });
319
+ try {
320
+ const body = await readGoogleAuthResponseBytes(response);
321
+ const bufferedBody = Uint8Array.from(body);
322
+ return new Response(bufferedBody.buffer, {
323
+ headers: response.headers,
324
+ status: response.status,
325
+ statusText: response.statusText
328
326
  });
329
- try {
330
- const body = await readGoogleAuthResponseBytes(response);
331
- const bufferedBody = Uint8Array.from(body);
332
- return new Response(bufferedBody.buffer, {
333
- headers: response.headers,
334
- status: response.status,
335
- statusText: response.statusText
336
- });
337
- } finally {
338
- response.body?.cancel().catch(() => void 0);
339
- await release();
340
- }
341
- };
327
+ } finally {
328
+ response.body?.cancel().catch(() => void 0);
329
+ await release();
330
+ }
342
331
  }
343
332
  async function readGoogleAuthResponseBytes(response) {
344
333
  const contentLengthHeader = response.headers.get("content-length");
@@ -358,7 +347,7 @@ async function loadGoogleAuthRuntime() {
358
347
  }
359
348
  async function getGoogleAuthTransport() {
360
349
  const { gaxios } = await loadGoogleAuthRuntime();
361
- const transport = new gaxios.Gaxios({ fetchImplementation: createGoogleAuthFetch() });
350
+ const transport = new gaxios.Gaxios({ fetchImplementation: googleAuthFetch });
362
351
  transport.interceptors.request.add({ resolved: async (config) => normalizeGoogleAuthHeaders(config) });
363
352
  transport.interceptors.response.add({ resolved: async (response) => normalizeGoogleAuthHeaders(response) });
364
353
  return transport;
@@ -519,12 +508,12 @@ function resolveGoogleChatMediaTimeoutMs(maxBytes) {
519
508
  const transferMs = Math.ceil(maxBytes / GOOGLECHAT_MEDIA_MIN_BYTES_PER_SECOND * 1e3);
520
509
  return Math.min(GOOGLECHAT_MEDIA_TIMEOUT_GRACE_MS + transferMs, GOOGLECHAT_MEDIA_MAX_TIMEOUT_MS);
521
510
  }
522
- async function readGoogleChatErrorResponse(response, label) {
511
+ async function readGoogleChatErrorResponse(response) {
523
512
  const text = await readResponseTextSnippet(response, {
524
513
  maxBytes: GOOGLECHAT_ERROR_BODY_MAX_BYTES,
525
514
  maxChars: GOOGLECHAT_ERROR_BODY_MAX_BYTES,
526
515
  chunkTimeoutMs: GOOGLECHAT_RESPONSE_READ_IDLE_TIMEOUT_MS,
527
- onIdleTimeout: ({ chunkTimeoutMs }) => /* @__PURE__ */ new Error(`${label} error response stalled after ${chunkTimeoutMs}ms`)
516
+ onIdleTimeout: ({ chunkTimeoutMs }) => /* @__PURE__ */ new Error(`Google Chat API error response stalled after ${chunkTimeoutMs}ms`)
528
517
  }) ?? "";
529
518
  return redactToolPayloadText(text);
530
519
  }
@@ -551,7 +540,7 @@ async function withGoogleChatResponse(params) {
551
540
  });
552
541
  try {
553
542
  if (!response.ok) {
554
- const text = await readGoogleChatErrorResponse(response, "Google Chat API");
543
+ const text = await readGoogleChatErrorResponse(response);
555
544
  throw new GoogleChatApiError(response.status, `Google Chat API ${response.status}: ${text || response.statusText}`);
556
545
  }
557
546
  return await handleResponse(response);
@@ -608,15 +597,15 @@ async function sendGoogleChatMessage(params) {
608
597
  const { account, space, text, thread, cardsV2 } = params;
609
598
  const usableThread = thread && isUsableGoogleChatThreadName(thread, space) ? thread : void 0;
610
599
  if (text && (!cardsV2 || cardsV2.length === 0) && shouldSuppressGoogleChatManualExecApprovalFollowupText(text)) return null;
611
- const body = {};
612
- if (text) body.text = text;
613
- if (cardsV2 && cardsV2.length > 0) body.cardsV2 = cardsV2;
614
- if (usableThread) body.thread = { name: usableThread };
615
600
  const urlObj = new URL(`${CHAT_API_BASE}/${space}/messages`);
616
601
  if (usableThread) urlObj.searchParams.set("messageReplyOption", "REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD");
617
602
  const result = await fetchJson(account, urlObj.toString(), {
618
603
  method: "POST",
619
- body: JSON.stringify(body)
604
+ body: JSON.stringify({
605
+ text: text || void 0,
606
+ cardsV2: cardsV2?.length ? cardsV2 : void 0,
607
+ thread: usableThread ? { name: usableThread } : void 0
608
+ })
620
609
  }, {
621
610
  assertDirectAdapterHandoff: params.assertDirectAdapterHandoff,
622
611
  onPlatformSendDispatch: params.onPlatformSendDispatch
@@ -630,13 +619,12 @@ async function updateGoogleChatMessage(params) {
630
619
  const { account, messageName, text, cardsV2 } = params;
631
620
  const updateMask = [...text !== void 0 ? ["text"] : [], ...cardsV2 !== void 0 ? ["cardsV2"] : []];
632
621
  if (updateMask.length === 0) throw new Error("Google Chat message update requires text or cardsV2.");
633
- const url = `${CHAT_API_BASE}/${messageName}?updateMask=${updateMask.join(",")}`;
634
- const body = {};
635
- if (text !== void 0) body.text = text;
636
- if (cardsV2 !== void 0) body.cardsV2 = cardsV2;
637
- return { messageName: (await fetchJson(account, url, {
622
+ return { messageName: (await fetchJson(account, `${CHAT_API_BASE}/${messageName}?updateMask=${updateMask.join(",")}`, {
638
623
  method: "PATCH",
639
- body: JSON.stringify(body)
624
+ body: JSON.stringify({
625
+ text,
626
+ cardsV2
627
+ })
640
628
  })).name };
641
629
  }
642
630
  async function deleteGoogleChatMessage(params) {
@@ -794,11 +782,11 @@ const GOOGLE_CHAT_LITERAL_FALLBACKS = /* @__PURE__ */ new Map([
794
782
  ["-", "-"],
795
783
  ["|", "|"]
796
784
  ]);
797
- function createPrivateMarkerGenerator(text) {
785
+ function createGoogleChatMarkers(text) {
798
786
  const used = /* @__PURE__ */ new Set();
799
787
  let candidate = 0;
800
788
  const rangeSize = 6400;
801
- return () => {
789
+ const nextMarker = () => {
802
790
  while (true) {
803
791
  const marker = String.fromCharCode(57344 + Math.floor(candidate / rangeSize), 57344 + candidate % rangeSize);
804
792
  candidate += 1;
@@ -808,9 +796,6 @@ function createPrivateMarkerGenerator(text) {
808
796
  }
809
797
  }
810
798
  };
811
- }
812
- function createGoogleChatMarkers(text) {
813
- const nextMarker = createPrivateMarkerGenerator(text);
814
799
  return {
815
800
  list: nextMarker(),
816
801
  blockquoteOpen: nextMarker(),
@@ -822,18 +807,11 @@ function sanitizeGoogleChatText(text) {
822
807
  return sanitizeForPlainText(sanitizeAssistantVisibleText(text), { style: "markdown" });
823
808
  }
824
809
  function projectDecodedGoogleChatResources(ir) {
825
- const characters = ir.text.includes("<") ? ir.text.split("") : [];
826
- let changed = false;
827
- for (const match of ir.text.matchAll(/<(?:users|customEmojis)\/[^<>\s]+>/giu)) {
828
- const start = match.index ?? 0;
829
- characters[start] = "<";
830
- characters[start + match[0].length - 1] = ">";
831
- changed = true;
832
- }
833
- return changed ? {
810
+ const text = ir.text.replace(/<(?:users|customEmojis)\/[^<>\s]+>/giu, (match) => `<${match.slice(1, -1)}>`);
811
+ return text === ir.text ? ir : {
834
812
  ...ir,
835
- text: characters.join("")
836
- } : ir;
813
+ text
814
+ };
837
815
  }
838
816
  function projectGoogleChatLinkLabels(ir) {
839
817
  const characters = ir.links.length > 0 ? ir.text.split("") : [];
@@ -1093,7 +1071,7 @@ const googleChatIngressIdentity = defineStableChannelIngressIdentity({
1093
1071
  });
1094
1072
  //#endregion
1095
1073
  //#region extensions/googlechat/src/channel.adapters.ts
1096
- const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-BEP3QsS4.mjs"), "googleChatChannelRuntime");
1074
+ const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-BlI4aJ2a.mjs"), "googleChatChannelRuntime");
1097
1075
  const collectGoogleChatGroupPolicyWarnings = createAllowlistProviderOpenWarningCollector({
1098
1076
  providerConfigPresent: (cfg) => cfg.channels?.googlechat !== void 0,
1099
1077
  resolveGroupPolicy: (account) => account.config.groupPolicy,
@@ -1,5 +1,5 @@
1
- import { C as verifyGoogleChatRequest, D as readGoogleChatApprovalActionToken, E as googleChatApprovalControls, S as updateGoogleChatMessage, _ as GoogleChatApiError, b as probeGoogleChat, c as googleChatIngressIdentity, d as isGoogleChatGroupSpace, l as normalizeGoogleChatUserId, u as buildGoogleChatGroupPolicyScope, v as deleteGoogleChatMessage, x as sendGoogleChatMessage, y as downloadGoogleChatMedia } from "./channel.adapters-CcYyfMMC.mjs";
2
- import { n as googleChatApprovalAuth } from "./approval-auth-7RuArHyo.mjs";
1
+ import { C as verifyGoogleChatRequest, D as readGoogleChatApprovalActionToken, E as googleChatApprovalControls, S as updateGoogleChatMessage, _ as GoogleChatApiError, b as probeGoogleChat, c as googleChatIngressIdentity, d as isGoogleChatGroupSpace, l as normalizeGoogleChatUserId, u as buildGoogleChatGroupPolicyScope, v as deleteGoogleChatMessage, x as sendGoogleChatMessage, y as downloadGoogleChatMedia } from "./channel.adapters-B54Nj4rn.mjs";
2
+ import { n as googleChatApprovalAuth } from "./approval-auth-CHn-C5YE.mjs";
3
3
  import { t as getGoogleChatRuntime } from "./runtime-C5OOOlaP.mjs";
4
4
  import { n as escapeGoogleChatApprovalCardText, t as buildGoogleChatApprovalTextWidget } from "./approval-card-text-BKg_4mXq.mjs";
5
5
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringEntries, normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -11,8 +11,9 @@ import { createChannelIngressError } from "openclaw/plugin-sdk/channel-outbound"
11
11
  import { channelBlockedPatch, channelReadyPatch } from "openclaw/plugin-sdk/gateway-runtime";
12
12
  import { isRecord as isRecord$1 } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
13
13
  import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
14
- import { createChannelPartialDeliveryError, formatInboundMediaUnavailableText, recordChannelBotPairLoopAndCheckSuppression, resolveChannelInboundRouteEnvelope, toInboundMediaFactsWithMetadata } from "openclaw/plugin-sdk/channel-inbound";
14
+ import { createChannelInboundEnvelopeBuilderAsync, createChannelPartialDeliveryError, formatInboundMediaUnavailableText, recordChannelBotPairLoopAndCheckSuppression, toInboundMediaFactsWithMetadata } from "openclaw/plugin-sdk/channel-inbound";
15
15
  import { parseDateStringTimestampMs } from "openclaw/plugin-sdk/number-runtime";
16
+ import { resolveAgentRoute } from "openclaw/plugin-sdk/routing";
16
17
  import { createRuntimeConfigReader } from "openclaw/plugin-sdk/runtime-config-snapshot";
17
18
  import { WEBHOOK_RATE_LIMIT_DEFAULTS, canonicalizeWebhookRouteKey, createFixedWindowRateLimiter, resolveRequestClientIp, resolveWebhookPath } from "openclaw/plugin-sdk/webhook-ingress";
18
19
  import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway-runtime";
@@ -407,8 +408,8 @@ function resolveGoogleChatDurableReplyOptions(params) {
407
408
  //#endregion
408
409
  //#region extensions/googlechat/src/monitor-event.ts
409
410
  var GoogleChatEventPayloadError = class extends Error {
410
- constructor(message = "invalid payload") {
411
- super(message);
411
+ constructor() {
412
+ super("invalid payload");
412
413
  this.name = "GoogleChatEventPayloadError";
413
414
  }
414
415
  };
@@ -536,7 +537,7 @@ function createGoogleChatIngressMonitor(options) {
536
537
  return serialized;
537
538
  };
538
539
  return createStandardRawEventIngressMonitor({
539
- queue: options.queue ?? (() => getGoogleChatRuntime().state.openChannelIngressQueue({ accountId: options.accountId })),
540
+ queue: () => getGoogleChatRuntime().state.openChannelIngressQueue({ accountId: options.accountId }),
540
541
  inspect: inspectGoogleChatIngressEvent,
541
542
  payload: {
542
543
  serialize: serializeForIngress,
@@ -544,10 +545,8 @@ function createGoogleChatIngressMonitor(options) {
544
545
  createClaimError: (kind, claim) => new GoogleChatIngressPermanentError("invalid-event", kind === "invalid-version" ? `Google Chat ingress row ${claim.id} has an invalid payload.` : `Google Chat ingress row ${claim.id} has invalid message identity.`)
545
546
  },
546
547
  deliver: (rawEvent, lifecycle, claim) => options.dispatch(normalizeClaimedGoogleChatEvent(rawEvent, claim.id), lifecycle),
547
- pollIntervalMs: options.pollIntervalMs,
548
548
  drain: {
549
549
  resolveNonRetryableFailure: resolveGoogleChatIngressNonRetryableFailure,
550
- ...options.adoptionStallTimeoutMs === void 0 ? {} : { adoptionStallTimeoutMs: options.adoptionStallTimeoutMs },
551
550
  onLog: (message) => options.runtime.error?.(`googlechat: ${message}`)
552
551
  },
553
552
  ...options.abortSignal ? { abortSignal: options.abortSignal } : {},
@@ -915,7 +914,7 @@ async function processGoogleChatEvent(event, target, turnAdoptionLifecycle, conf
915
914
  const attachments = message.attachment ?? [];
916
915
  let rawBody = messageText;
917
916
  if (!rawBody && attachments.length === 0) return;
918
- const { route, buildEnvelope } = resolveChannelInboundRouteEnvelope({
917
+ const route = resolveAgentRoute({
919
918
  cfg: config,
920
919
  channel: "googlechat",
921
920
  accountId: account.accountId,
@@ -998,7 +997,10 @@ async function processGoogleChatEvent(event, target, turnAdoptionLifecycle, conf
998
997
  const media = mediaInputs.length === 0 ? [] : await toInboundMediaFactsWithMetadata(mediaInputs);
999
998
  const fromLabel = isGroup ? space.displayName || `space:${spaceId}` : senderName || `user:${senderId}`;
1000
999
  const timestampMs = parseDateStringTimestampMs(event.eventTime);
1001
- const body = buildEnvelope({
1000
+ const body = (await createChannelInboundEnvelopeBuilderAsync({
1001
+ cfg: config,
1002
+ route
1003
+ }))({
1002
1004
  channel: "Google Chat",
1003
1005
  from: fromLabel,
1004
1006
  timestamp: timestampMs,
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { a as googlechatSetupAdapter, i as googlechatSetupWizard } from "./.setup/channel-base-BdCGLoFe.mjs";
2
- import { t as googlechatPlugin } from "./.setup/channel-CRIyIoxn.mjs";
2
+ import { t as googlechatPlugin } from "./.setup/channel-CNQuKfU7.mjs";
3
3
  export { googlechatPlugin, googlechatSetupAdapter, googlechatSetupWizard };
@@ -1,2 +1,2 @@
1
- import { t as googlechatPlugin } from "./.setup/channel-CRIyIoxn.mjs";
1
+ import { t as googlechatPlugin } from "./.setup/channel-CNQuKfU7.mjs";
2
2
  export { googlechatPlugin };
@@ -1,4 +1,4 @@
1
- import { t as googlechatDirectoryAdapter } from "./.setup/channel.adapters-CcYyfMMC.mjs";
1
+ import { t as googlechatDirectoryAdapter } from "./.setup/channel.adapters-B54Nj4rn.mjs";
2
2
  //#region extensions/googlechat/directory-contract-api.ts
3
3
  const googlechatDirectoryContractPlugin = {
4
4
  id: "googlechat",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/googlechat",
3
- "version": "2026.10.1",
3
+ "version": "2026.10.5-beta.1",
4
4
  "description": "OpenClaw Google Chat channel plugin for spaces and direct messages.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  "zod": "4.6.5"
13
13
  },
14
14
  "peerDependencies": {
15
- "openclaw": ">=2026.10.1"
15
+ "openclaw": ">=2026.10.5-beta.1"
16
16
  },
17
17
  "peerDependenciesMeta": {
18
18
  "openclaw": {
@@ -135,10 +135,10 @@
135
135
  "minHostVersion": ">=2026.9.8"
136
136
  },
137
137
  "compat": {
138
- "pluginApi": ">=2026.10.1"
138
+ "pluginApi": ">=2026.10.5-beta.1"
139
139
  },
140
140
  "build": {
141
- "openclawVersion": "2026.10.1"
141
+ "openclawVersion": "2026.10.5-beta.1"
142
142
  },
143
143
  "release": {
144
144
  "publishToClawHub": true,