@openclaw/googlechat 2026.10.1-beta.2 → 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.
- package/dist/.setup/{actions-BtW6Mbtw.mjs → actions-BBxrBsOk.mjs} +1 -1
- package/dist/.setup/{approval-auth-7RuArHyo.mjs → approval-auth-CHn-C5YE.mjs} +1 -1
- package/dist/.setup/{approval-handler.runtime-D0dWJcjH.mjs → approval-handler.runtime-r0gTDaSz.mjs} +2 -2
- package/dist/.setup/{channel-CRIyIoxn.mjs → channel-CNQuKfU7.mjs} +6 -6
- package/dist/.setup/{channel.adapters-CcYyfMMC.mjs → channel.adapters-B54Nj4rn.mjs} +58 -80
- package/dist/.setup/{channel.runtime-BEP3QsS4.mjs → channel.runtime-BlI4aJ2a.mjs} +12 -10
- package/dist/api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/package.json +4 -4
|
@@ -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-
|
|
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-
|
|
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
|
package/dist/.setup/{approval-handler.runtime-D0dWJcjH.mjs → approval-handler.runtime-r0gTDaSz.mjs}
RENAMED
|
@@ -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-
|
|
3
|
-
import { n as isGoogleChatNativeApprovalClientEnabled, r as shouldHandleGoogleChatNativeApprovalRequest } from "./channel-
|
|
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-
|
|
5
|
-
import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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
|
-
|
|
292
|
-
|
|
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
|
-
|
|
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
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
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:
|
|
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
|
|
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(
|
|
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
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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
|
|
785
|
+
function createGoogleChatMarkers(text) {
|
|
798
786
|
const used = /* @__PURE__ */ new Set();
|
|
799
787
|
let candidate = 0;
|
|
800
788
|
const rangeSize = 6400;
|
|
801
|
-
|
|
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
|
|
826
|
-
|
|
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
|
|
836
|
-
}
|
|
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-
|
|
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-
|
|
2
|
-
import { n as googleChatApprovalAuth } from "./approval-auth-
|
|
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,
|
|
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(
|
|
411
|
-
super(
|
|
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:
|
|
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
|
|
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 =
|
|
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-
|
|
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-
|
|
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-
|
|
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.
|
|
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.
|
|
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.
|
|
138
|
+
"pluginApi": ">=2026.10.5-beta.1"
|
|
139
139
|
},
|
|
140
140
|
"build": {
|
|
141
|
-
"openclawVersion": "2026.10.
|
|
141
|
+
"openclawVersion": "2026.10.5-beta.1"
|
|
142
142
|
},
|
|
143
143
|
"release": {
|
|
144
144
|
"publishToClawHub": true,
|