@openclaw/googlechat 2026.10.10 → 2026.11.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.
- package/dist/.setup/{actions-uo0lf5AI.mjs → actions-CTuBGHVR.mjs} +16 -13
- package/dist/.setup/{approval-auth-CKF1wHai.mjs → approval-auth-Dd-6ne22.mjs} +4 -3
- package/dist/.setup/{approval-card-text-9o-Dfr9Z.mjs → approval-card-text-BKg_4mXq.mjs} +2 -1
- package/dist/.setup/{approval-handler.runtime-wYtTR6as.mjs → approval-handler.runtime-ZJkCErV1.mjs} +6 -5
- package/dist/.setup/{channel-base-BFV0cGQ2.mjs → channel-base-sWlG7EP1.mjs} +8 -4
- package/dist/.setup/{channel-ZbGyNgH9.mjs → channel-p2FLMhYl.mjs} +19 -14
- package/dist/.setup/{channel.adapters-5rr8crHQ.mjs → channel.adapters-CLzwB-5-.mjs} +44 -13
- package/dist/.setup/{channel.runtime-DkrekcGA.mjs → channel.runtime-Dlp4xvi9.mjs} +39 -21
- package/dist/.setup/{doctor-contract-WrFOPxEj.mjs → doctor-contract-BzoaiFSD.mjs} +12 -6
- package/dist/.setup/{runtime-zEzHA5rr.mjs → runtime-C5OOOlaP.mjs} +2 -1
- package/dist/.setup/{secret-contract-h2P-4VpL.mjs → secret-contract-D7KjX374.mjs} +2 -1
- package/dist/.setup/secret-contract-api-Dx8QYxoR.mjs +3 -0
- package/dist/.setup/setup-plugin-api-yGEtLeXV.mjs +3 -0
- package/dist/api.js +2 -2
- package/dist/channel-config-api.js +2 -1
- package/dist/channel-plugin-api.js +2 -1
- package/dist/directory-contract-api.js +3 -2
- package/dist/doctor-contract-api.js +2 -1
- package/dist/index.js +2 -1
- package/dist/runtime-api.js +2 -1
- package/dist/secret-contract-api.js +2 -1
- package/dist/setup-entry.js +4 -3
- package/dist/setup-plugin-api.js +2 -1
- package/package.json +4 -4
- package/dist/.setup/secret-contract-api-CLRweErW.mjs +0 -2
- package/dist/.setup/setup-plugin-api-Dru1eW9z.mjs +0 -2
- package/dist/.source-module-urls/974ffefea973cf3ea18e1534d25b091bcf1b68760a2b9eda0cd9bd9392096c64.json +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount } from "./channel-base-
|
|
2
|
-
import {
|
|
1
|
+
import { l as resolveGoogleChatAccount } from "./channel-base-sWlG7EP1.mjs";
|
|
2
|
+
import { C as sendGoogleChatMessage, d as formatGoogleChatMediaText, v as resolveGoogleChatOutboundSpace } from "./channel.adapters-CLzwB-5-.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
|
|
6
6
|
const OUTBOUND_MEDIA_KEYS = [
|
|
7
7
|
"media",
|
|
8
8
|
"mediaUrl",
|
|
@@ -11,14 +11,20 @@ const OUTBOUND_MEDIA_KEYS = [
|
|
|
11
11
|
"fileUrl"
|
|
12
12
|
];
|
|
13
13
|
const STRUCTURED_ATTACHMENT_MEDIA_KEYS = [...OUTBOUND_MEDIA_KEYS, "url"];
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
function readGoogleChatMediaUrls(params) {
|
|
15
|
+
return [
|
|
16
|
+
...OUTBOUND_MEDIA_KEYS.map((key) => readStringParam(params, key)),
|
|
17
|
+
...readStringArrayParam(params, "mediaUrls") ?? [],
|
|
18
|
+
...(Array.isArray(params.attachments) ? params.attachments : []).flatMap((attachment) => isRecord(attachment) ? STRUCTURED_ATTACHMENT_MEDIA_KEYS.map((key) => readStringParam(attachment, key)) : [])
|
|
19
|
+
].filter((value) => value !== void 0);
|
|
19
20
|
}
|
|
20
21
|
async function handleGoogleChatAction({ action, params, cfg, accountId, assertDirectAdapterHandoff, onPlatformSendDispatch }) {
|
|
21
|
-
if (action === "upload-file"
|
|
22
|
+
if (action === "upload-file") throw new Error("Google Chat outbound attachments require user OAuth and are not supported by this service-account channel.");
|
|
23
|
+
const mediaUrls = action === "send" ? readGoogleChatMediaUrls(params) : [];
|
|
24
|
+
const content = action === "send" ? formatGoogleChatMediaText(readStringParam(params, "message", {
|
|
25
|
+
required: mediaUrls.length === 0,
|
|
26
|
+
allowEmpty: true
|
|
27
|
+
}), mediaUrls) : "";
|
|
22
28
|
const account = resolveGoogleChatAccount({
|
|
23
29
|
cfg,
|
|
24
30
|
accountId
|
|
@@ -26,10 +32,6 @@ async function handleGoogleChatAction({ action, params, cfg, accountId, assertDi
|
|
|
26
32
|
if (account.credentialSource === "none" || account.tokenStatus === "configured_unavailable") throw new Error("Google Chat credentials are missing.");
|
|
27
33
|
if (action === "send") {
|
|
28
34
|
const to = readStringParam(params, "to", { required: true });
|
|
29
|
-
const content = readStringParam(params, "message", {
|
|
30
|
-
required: true,
|
|
31
|
-
allowEmpty: true
|
|
32
|
-
});
|
|
33
35
|
const threadId = readStringParam(params, "threadId") ?? readStringParam(params, "replyTo");
|
|
34
36
|
const space = await resolveGoogleChatOutboundSpace({
|
|
35
37
|
account,
|
|
@@ -52,4 +54,5 @@ async function handleGoogleChatAction({ action, params, cfg, accountId, assertDi
|
|
|
52
54
|
}
|
|
53
55
|
throw new Error(`Action ${action} is not supported for provider googlechat.`);
|
|
54
56
|
}
|
|
57
|
+
//#endregion
|
|
55
58
|
export { handleGoogleChatAction };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount } from "./channel-base-
|
|
2
|
-
import {
|
|
1
|
+
import { l as resolveGoogleChatAccount } from "./channel-base-sWlG7EP1.mjs";
|
|
2
|
+
import { g as normalizeGoogleChatTarget, h as isGoogleChatUserTarget } from "./channel.adapters-CLzwB-5-.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
|
|
6
6
|
function normalizeGoogleChatApproverId(value) {
|
|
7
7
|
const normalized = normalizeGoogleChatTarget(String(value));
|
|
8
8
|
if (!normalized || !isGoogleChatUserTarget(normalized)) return;
|
|
@@ -26,4 +26,5 @@ const googleChatApproval = createChannelApprovalAuth({
|
|
|
26
26
|
});
|
|
27
27
|
const getGoogleChatApprovalApprovers = googleChatApproval.resolveApprovers;
|
|
28
28
|
const googleChatApprovalAuth = googleChatApproval.approvalAuth;
|
|
29
|
+
//#endregion
|
|
29
30
|
export { googleChatApprovalAuth as n, normalizeGoogleChatApproverId as r, getGoogleChatApprovalApprovers as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
2
|
-
|
|
2
|
+
//#region extensions/googlechat/src/approval-card-text.ts
|
|
3
3
|
const MAX_TEXT_PARAGRAPH_CHARS = 1800;
|
|
4
4
|
function escapeGoogleChatApprovalCardText(text) {
|
|
5
5
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
@@ -8,4 +8,5 @@ function buildGoogleChatApprovalTextWidget(text, format = "text") {
|
|
|
8
8
|
const truncated = text.length <= MAX_TEXT_PARAGRAPH_CHARS ? text : `${truncateUtf16Safe(text, 1797)}...`;
|
|
9
9
|
return { textParagraph: { text: format === "html" ? truncated : escapeGoogleChatApprovalCardText(truncated) } };
|
|
10
10
|
}
|
|
11
|
+
//#endregion
|
|
11
12
|
export { escapeGoogleChatApprovalCardText as n, buildGoogleChatApprovalTextWidget as t };
|
package/dist/.setup/{approval-handler.runtime-wYtTR6as.mjs → approval-handler.runtime-ZJkCErV1.mjs}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount } from "./channel-base-
|
|
2
|
-
import { A as
|
|
3
|
-
import { n as isGoogleChatNativeApprovalClientEnabled, r as shouldHandleGoogleChatNativeApprovalRequest } from "./channel-
|
|
4
|
-
import { n as escapeGoogleChatApprovalCardText, t as buildGoogleChatApprovalTextWidget } from "./approval-card-text-
|
|
1
|
+
import { l as resolveGoogleChatAccount } from "./channel-base-sWlG7EP1.mjs";
|
|
2
|
+
import { A as registerGoogleChatApprovalCardBinding, C as sendGoogleChatMessage, D as buildGoogleChatApprovalActionParameters, E as GOOGLECHAT_APPROVAL_ACTION, M as unregisterGoogleChatManualApprovalFollowupSuppression, O as googleChatApprovalControls, j as registerGoogleChatManualApprovalFollowupSuppression, v as resolveGoogleChatOutboundSpace, w as updateGoogleChatMessage } from "./channel.adapters-CLzwB-5-.mjs";
|
|
3
|
+
import { n as isGoogleChatNativeApprovalClientEnabled, r as shouldHandleGoogleChatNativeApprovalRequest } from "./channel-p2FLMhYl.mjs";
|
|
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";
|
|
7
7
|
import { formatChannelApprovalResolvedLabel } from "openclaw/plugin-sdk/approval-runtime";
|
|
8
8
|
import { createChannelApprovalNativeRuntimeAdapterAsync } from "openclaw/plugin-sdk/approval-handler-runtime";
|
|
9
9
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
10
|
-
|
|
10
|
+
//#region extensions/googlechat/src/approval-handler.runtime.ts
|
|
11
11
|
const log = createSubsystemLogger("googlechat/approvals");
|
|
12
12
|
const GOOGLECHAT_APPROVAL_CARD_ID = "openclaw-approval";
|
|
13
13
|
function resolveHandlerAccount(params) {
|
|
@@ -229,4 +229,5 @@ const googleChatApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapte
|
|
|
229
229
|
log.error(`googlechat approvals: failed to send request ${request.id}: ${String(error)}`);
|
|
230
230
|
} }
|
|
231
231
|
});
|
|
232
|
+
//#endregion
|
|
232
233
|
export { googleChatApprovalNativeRuntime };
|
|
@@ -13,9 +13,10 @@ import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
|
|
|
13
13
|
import { createPatchedAccountSetupAdapter, createSetupInputPresenceValidator } from "openclaw/plugin-sdk/setup-runtime";
|
|
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
17
|
const MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES = 65536;
|
|
18
|
-
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region extensions/googlechat/src/accounts.ts
|
|
19
20
|
const ENV_SERVICE_ACCOUNT$1 = "GOOGLE_CHAT_SERVICE_ACCOUNT";
|
|
20
21
|
const ENV_SERVICE_ACCOUNT_FILE$1 = "GOOGLE_CHAT_SERVICE_ACCOUNT_FILE";
|
|
21
22
|
const JsonRecordSchema = z.record(z.string(), z.unknown());
|
|
@@ -235,7 +236,8 @@ const googlechatSetupContract = defineChannelSetupContract({
|
|
|
235
236
|
},
|
|
236
237
|
legacyAdapter: googlechatSetupAdapter
|
|
237
238
|
});
|
|
238
|
-
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region extensions/googlechat/src/setup-surface.ts
|
|
239
241
|
const t = createSetupTranslator();
|
|
240
242
|
const channel = "googlechat";
|
|
241
243
|
const ENV_SERVICE_ACCOUNT = "GOOGLE_CHAT_SERVICE_ACCOUNT";
|
|
@@ -398,7 +400,8 @@ const googlechatSetupWizard = {
|
|
|
398
400
|
},
|
|
399
401
|
dmPolicy: googlechatDmPolicy
|
|
400
402
|
};
|
|
401
|
-
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region extensions/googlechat/src/channel-base.ts
|
|
402
405
|
const GOOGLECHAT_CHANNEL_ID = "googlechat";
|
|
403
406
|
const googlechatMeta = {
|
|
404
407
|
id: GOOGLECHAT_CHANNEL_ID,
|
|
@@ -472,4 +475,5 @@ const googlechatSetupPlugin = {
|
|
|
472
475
|
})
|
|
473
476
|
}
|
|
474
477
|
};
|
|
478
|
+
//#endregion
|
|
475
479
|
export { googlechatSetupAdapter as a, resolveDefaultGoogleChatAccountId as c, googlechatSetupWizard as i, resolveGoogleChatAccount as l, formatGoogleChatAllowFromEntry as n, inspectGoogleChatAccount as o, googlechatSetupPlugin as r, listGoogleChatAccountIds as s, GOOGLECHAT_CHANNEL_ID as t, MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES as u };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
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
|
-
import { c as resolveDefaultGoogleChatAccountId, l as resolveGoogleChatAccount, o as inspectGoogleChatAccount, r as googlechatSetupPlugin, s as listGoogleChatAccountIds, t as GOOGLECHAT_CHANNEL_ID } from "./channel-base-
|
|
4
|
-
import { a as googlechatPairingTextAdapter, g as
|
|
5
|
-
import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-
|
|
6
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-
|
|
3
|
+
import { c as resolveDefaultGoogleChatAccountId, l as resolveGoogleChatAccount, o as inspectGoogleChatAccount, r as googlechatSetupPlugin, s as listGoogleChatAccountIds, t as GOOGLECHAT_CHANNEL_ID } from "./channel-base-sWlG7EP1.mjs";
|
|
4
|
+
import { _ as resolveGoogleChatOutboundSessionRoute, a as googlechatPairingTextAdapter, g as normalizeGoogleChatTarget, h as isGoogleChatUserTarget, i as googlechatOutboundAdapter, m as isGoogleChatSpaceTarget, n as googlechatGroupsAdapter, o as googlechatSecurityAdapter, r as googlechatMessageAdapter, s as googlechatThreadingAdapter, t as googlechatDirectoryAdapter } from "./channel.adapters-CLzwB-5-.mjs";
|
|
5
|
+
import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-Dd-6ne22.mjs";
|
|
6
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-D7KjX374.mjs";
|
|
7
7
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
8
8
|
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
9
9
|
import { buildPassiveProbedChannelStatusSummary } from "openclaw/plugin-sdk/extension-shared";
|
|
@@ -18,7 +18,7 @@ import { buildMutableAllowEntryDetector, collectStandardAllowlistLists, createDa
|
|
|
18
18
|
import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
|
|
19
19
|
import { channelBlockedPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
|
20
20
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
21
|
-
|
|
21
|
+
//#region extensions/googlechat/src/approval-native.ts
|
|
22
22
|
const DEFAULT_APPROVAL_FORWARDING_MODE = "session";
|
|
23
23
|
function isGoogleChatApprovalTransportEnabled(params) {
|
|
24
24
|
const account = resolveGoogleChatAccount(params);
|
|
@@ -132,10 +132,11 @@ 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-ZJkCErV1.mjs")).googleChatApprovalNativeRuntime
|
|
136
136
|
})
|
|
137
137
|
});
|
|
138
|
-
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region extensions/googlechat/src/doctor.ts
|
|
139
140
|
const isGoogleChatMutableAllowEntry = buildMutableAllowEntryDetector({
|
|
140
141
|
prefixes: [
|
|
141
142
|
"googlechat:",
|
|
@@ -153,8 +154,9 @@ const collectGoogleChatMutableAllowlistWarnings = createDangerousNameMatchingMut
|
|
|
153
154
|
groupField: "users"
|
|
154
155
|
})
|
|
155
156
|
});
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region extensions/googlechat/src/gateway.ts
|
|
159
|
+
const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-Dlp4xvi9.mjs"), "googleChatChannelRuntime");
|
|
158
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.";
|
|
159
161
|
async function startGoogleChatGatewayAccount(ctx) {
|
|
160
162
|
const account = ctx.account;
|
|
@@ -209,7 +211,8 @@ async function startGoogleChatGatewayAccount(ctx) {
|
|
|
209
211
|
});
|
|
210
212
|
}
|
|
211
213
|
}
|
|
212
|
-
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region extensions/googlechat/src/message-tool-api.ts
|
|
213
216
|
function describeGoogleChatMessageTool({ cfg, accountId }) {
|
|
214
217
|
return (accountId ? [inspectGoogleChatAccount({
|
|
215
218
|
cfg,
|
|
@@ -223,10 +226,11 @@ const googlechatMessageActions = {
|
|
|
223
226
|
describeMessageTool: describeGoogleChatMessageTool,
|
|
224
227
|
supportsAction: ({ action }) => action === "send",
|
|
225
228
|
extractToolSend: ({ args }) => extractToolSend(args, "sendMessage"),
|
|
226
|
-
handleAction: async (ctx) => (await import("./actions-
|
|
229
|
+
handleAction: async (ctx) => (await import("./actions-CTuBGHVR.mjs")).handleGoogleChatAction(ctx)
|
|
227
230
|
};
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region extensions/googlechat/src/channel.ts
|
|
233
|
+
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-Dlp4xvi9.mjs"), "googleChatChannelRuntime");
|
|
230
234
|
const googlechatPlugin = createChatChannelPlugin({
|
|
231
235
|
base: {
|
|
232
236
|
...googlechatSetupPlugin,
|
|
@@ -346,4 +350,5 @@ const googlechatPlugin = createChatChannelPlugin({
|
|
|
346
350
|
}
|
|
347
351
|
}
|
|
348
352
|
});
|
|
353
|
+
//#endregion
|
|
349
354
|
export { isGoogleChatNativeApprovalClientEnabled as n, shouldHandleGoogleChatNativeApprovalRequest as r, googlechatPlugin as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount, n as formatGoogleChatAllowFromEntry, u as MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES } from "./channel-base-
|
|
1
|
+
import { l as resolveGoogleChatAccount, n as formatGoogleChatAllowFromEntry, u as MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES } from "./channel-base-sWlG7EP1.mjs";
|
|
2
2
|
import { buildChannelOutboundSessionRoute } from "openclaw/plugin-sdk/channel-core";
|
|
3
3
|
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
4
4
|
import { asNullableObjectRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -20,8 +20,9 @@ import { createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, s
|
|
|
20
20
|
import { buildChannelGroupsScopeTree, createAllowlistProviderOpenWarningCollector, createConditionalWarningCollector, resolveScopeRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
|
21
21
|
import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
|
|
22
22
|
import { createChannelDirectoryAdapter, listResolvedDirectoryGroupEntriesFromMapKeys, listResolvedDirectoryUserEntriesFromAllowFrom } from "openclaw/plugin-sdk/directory-runtime";
|
|
23
|
+
import { formatTextWithAttachmentLinks, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
23
24
|
import { FormatCapabilityProfile, markdownToIR, renderMarkdownIRChunksWithinLimit, renderMarkdownWithMarkers, sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
24
|
-
|
|
25
|
+
//#region extensions/googlechat/src/approval-card-actions.ts
|
|
25
26
|
const GOOGLECHAT_APPROVAL_ACTION = "openclaw.approval";
|
|
26
27
|
const GOOGLECHAT_APPROVAL_ACTION_PARAM = "openclaw_action";
|
|
27
28
|
const GOOGLECHAT_APPROVAL_TOKEN_PARAM = "token";
|
|
@@ -116,7 +117,8 @@ function shouldSuppressGoogleChatManualExecApprovalFollowupPayload(payload, nowM
|
|
|
116
117
|
if (!text || hasStructuredPayloadPart(payload)) return false;
|
|
117
118
|
return shouldSuppressGoogleChatManualExecApprovalFollowupText(text, nowMs);
|
|
118
119
|
}
|
|
119
|
-
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region extensions/googlechat/src/google-auth.runtime.ts
|
|
120
122
|
const GOOGLE_AUTH_POLICY = buildHostnameAllowlistPolicyFromSuffixAllowlist(["accounts.google.com", "googleapis.com"]);
|
|
121
123
|
const GOOGLE_AUTH_FETCH_TIMEOUT_MS = 3e4;
|
|
122
124
|
const GOOGLE_AUTH_URI = "https://accounts.google.com/o/oauth2/auth";
|
|
@@ -356,7 +358,8 @@ async function resolveValidatedGoogleChatCredentials(account) {
|
|
|
356
358
|
if (account.credentialsFile) return validateGoogleChatServiceAccountCredentials(await readCredentialsFile(account.credentialsFile));
|
|
357
359
|
return null;
|
|
358
360
|
}
|
|
359
|
-
|
|
361
|
+
//#endregion
|
|
362
|
+
//#region extensions/googlechat/src/auth.ts
|
|
360
363
|
const CHAT_SCOPE = "https://www.googleapis.com/auth/chat.bot";
|
|
361
364
|
const CHAT_ISSUER = "chat@system.gserviceaccount.com";
|
|
362
365
|
const ADDON_ISSUER_PATTERN = /^service-\d+@gcp-sa-gsuiteaddons\.iam\.gserviceaccount\.com$/;
|
|
@@ -483,7 +486,8 @@ async function verifyGoogleChatRequest(params) {
|
|
|
483
486
|
};
|
|
484
487
|
}
|
|
485
488
|
}
|
|
486
|
-
|
|
489
|
+
//#endregion
|
|
490
|
+
//#region extensions/googlechat/src/api.ts
|
|
487
491
|
const CHAT_API_BASE = "https://chat.googleapis.com/v1";
|
|
488
492
|
const GOOGLECHAT_API_TIMEOUT_MS = 3e4;
|
|
489
493
|
const GOOGLECHAT_MEDIA_TIMEOUT_GRACE_MS = 3e4;
|
|
@@ -656,7 +660,8 @@ async function probeGoogleChat(account) {
|
|
|
656
660
|
};
|
|
657
661
|
}
|
|
658
662
|
}
|
|
659
|
-
|
|
663
|
+
//#endregion
|
|
664
|
+
//#region extensions/googlechat/src/targets.ts
|
|
660
665
|
function normalizeGoogleChatTarget(raw) {
|
|
661
666
|
const trimmed = raw?.trim();
|
|
662
667
|
if (!trimmed) return;
|
|
@@ -747,7 +752,8 @@ async function resolveGoogleChatOutboundSessionRoute(params) {
|
|
|
747
752
|
to: spaceName
|
|
748
753
|
});
|
|
749
754
|
}
|
|
750
|
-
|
|
755
|
+
//#endregion
|
|
756
|
+
//#region extensions/googlechat/src/format.ts
|
|
751
757
|
const GOOGLE_CHAT_FORMAT_PROFILE = FormatCapabilityProfile.define({
|
|
752
758
|
mechanism: "markdown",
|
|
753
759
|
constructs: {
|
|
@@ -801,6 +807,18 @@ function createGoogleChatMarkers(text) {
|
|
|
801
807
|
function sanitizeGoogleChatText(text) {
|
|
802
808
|
return sanitizeForPlainText(sanitizeAssistantVisibleText(text), { style: "markdown" });
|
|
803
809
|
}
|
|
810
|
+
function formatGoogleChatMediaText(text, mediaUrls) {
|
|
811
|
+
const remoteUrls = mediaUrls.filter((value) => {
|
|
812
|
+
if (value.split("").some((character) => character <= " " || character === "") || !/^https?:\/\//iu.test(value)) return false;
|
|
813
|
+
try {
|
|
814
|
+
return Boolean(new URL(value).hostname);
|
|
815
|
+
} catch {
|
|
816
|
+
return false;
|
|
817
|
+
}
|
|
818
|
+
});
|
|
819
|
+
if (remoteUrls.length !== mediaUrls.length) throw new Error("Google Chat outbound attachments require remote HTTP(S) URLs.");
|
|
820
|
+
return [text, formatTextWithAttachmentLinks(void 0, remoteUrls)].filter(Boolean).join("\n\n");
|
|
821
|
+
}
|
|
804
822
|
function projectDecodedGoogleChatResources(ir) {
|
|
805
823
|
const text = ir.text.replace(/<(?:users|customEmojis)\/[^<>\s]+>/giu, (match) => `<${match.slice(1, -1)}>`);
|
|
806
824
|
return text === ir.text ? ir : {
|
|
@@ -1016,7 +1034,8 @@ function formatGoogleChatTextChunks(text, limit = GOOGLE_CHAT_FORMAT_PROFILE.chu
|
|
|
1016
1034
|
renderChunk: (chunk) => renderGoogleChatIR(chunk, prepared.markers)
|
|
1017
1035
|
}).map((chunk) => chunk.rendered);
|
|
1018
1036
|
}
|
|
1019
|
-
|
|
1037
|
+
//#endregion
|
|
1038
|
+
//#region extensions/googlechat/src/group-policy.ts
|
|
1020
1039
|
function buildGoogleChatGroupPolicyScope(params) {
|
|
1021
1040
|
const matchKey = params.groupId && Object.hasOwn(params.tree.scopes, params.groupId) ? params.groupId : void 0;
|
|
1022
1041
|
return {
|
|
@@ -1031,7 +1050,8 @@ function resolveGoogleChatGroupRequireMention(params) {
|
|
|
1031
1050
|
groupId: params.groupId
|
|
1032
1051
|
}));
|
|
1033
1052
|
}
|
|
1034
|
-
|
|
1053
|
+
//#endregion
|
|
1054
|
+
//#region extensions/googlechat/src/ingress-identity.ts
|
|
1035
1055
|
function normalizeGoogleChatUserId(raw) {
|
|
1036
1056
|
const trimmed = normalizeOptionalString(raw) ?? "";
|
|
1037
1057
|
return normalizeLowercaseStringOrEmpty(trimmed.replace(/^users\//i, ""));
|
|
@@ -1062,8 +1082,9 @@ const googleChatIngressIdentity = defineStableChannelIngressIdentity({
|
|
|
1062
1082
|
isWildcardEntry: (entry) => normalizeLowercaseStringOrEmpty(entry) === "*",
|
|
1063
1083
|
resolveEntryId: ({ entryIndex, fieldKey }) => fieldKey === "stableId" ? `entry-${entryIndex + 1}:user` : `entry-${entryIndex + 1}:${fieldKey}`
|
|
1064
1084
|
});
|
|
1065
|
-
|
|
1066
|
-
|
|
1085
|
+
//#endregion
|
|
1086
|
+
//#region extensions/googlechat/src/channel.adapters.ts
|
|
1087
|
+
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-Dlp4xvi9.mjs"), "googleChatChannelRuntime");
|
|
1067
1088
|
const collectGoogleChatGroupPolicyWarnings = createAllowlistProviderOpenWarningCollector({
|
|
1068
1089
|
providerConfigPresent: (cfg) => cfg.channels?.googlechat !== void 0,
|
|
1069
1090
|
resolveGroupPolicy: (account) => account.config.groupPolicy,
|
|
@@ -1156,7 +1177,15 @@ const googlechatOutboundAdapter = {
|
|
|
1156
1177
|
chunkerMode: "markdown",
|
|
1157
1178
|
textChunkLimit: GOOGLE_CHAT_FORMAT_PROFILE.chunk.limit,
|
|
1158
1179
|
sanitizeText: ({ text }) => sanitizeGoogleChatText(text),
|
|
1159
|
-
normalizePayload: ({ payload }) =>
|
|
1180
|
+
normalizePayload: ({ payload }) => {
|
|
1181
|
+
if (shouldSuppressGoogleChatManualExecApprovalFollowupPayload(payload)) return null;
|
|
1182
|
+
const reply = resolveSendableOutboundReplyParts(payload);
|
|
1183
|
+
const { mediaUrl: _mediaUrl, mediaUrls: _mediaUrls, ...rest } = payload;
|
|
1184
|
+
return {
|
|
1185
|
+
...rest,
|
|
1186
|
+
text: formatGoogleChatMediaText(reply.text, reply.mediaUrls)
|
|
1187
|
+
};
|
|
1188
|
+
},
|
|
1160
1189
|
resolveTarget: ({ to }) => {
|
|
1161
1190
|
const normalized = normalizeGoogleChatTarget(to);
|
|
1162
1191
|
return normalized ? {
|
|
@@ -1213,9 +1242,11 @@ const googlechatMessageAdapter = defineChannelMessageAdapter({
|
|
|
1213
1242
|
id: "googlechat",
|
|
1214
1243
|
durableFinal: { capabilities: {
|
|
1215
1244
|
text: true,
|
|
1245
|
+
media: true,
|
|
1216
1246
|
thread: true,
|
|
1217
1247
|
messageSendingHooks: true
|
|
1218
1248
|
} },
|
|
1219
1249
|
send: { text: googlechatOutboundAdapter.attachedResults.sendText }
|
|
1220
1250
|
});
|
|
1221
|
-
|
|
1251
|
+
//#endregion
|
|
1252
|
+
export { registerGoogleChatApprovalCardBinding as A, sendGoogleChatMessage as C, buildGoogleChatApprovalActionParameters as D, GOOGLECHAT_APPROVAL_ACTION as E, unregisterGoogleChatManualApprovalFollowupSuppression as M, googleChatApprovalControls as O, probeGoogleChat as S, verifyGoogleChatRequest as T, resolveGoogleChatOutboundSessionRoute as _, googlechatPairingTextAdapter as a, deleteGoogleChatMessage as b, googleChatIngressIdentity as c, formatGoogleChatMediaText as d, formatGoogleChatTextChunks as f, normalizeGoogleChatTarget as g, isGoogleChatUserTarget as h, googlechatOutboundAdapter as i, registerGoogleChatManualApprovalFollowupSuppression as j, readGoogleChatApprovalActionToken as k, normalizeGoogleChatUserId as l, isGoogleChatSpaceTarget as m, googlechatGroupsAdapter as n, googlechatSecurityAdapter as o, isGoogleChatGroupSpace as p, googlechatMessageAdapter as r, googlechatThreadingAdapter as s, googlechatDirectoryAdapter as t, buildGoogleChatGroupPolicyScope as u, resolveGoogleChatOutboundSpace as v, updateGoogleChatMessage as w, downloadGoogleChatMedia as x, GoogleChatApiError as y };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { n as googleChatApprovalAuth } from "./approval-auth-
|
|
3
|
-
import { t as getGoogleChatRuntime } from "./runtime-
|
|
4
|
-
import { n as escapeGoogleChatApprovalCardText, t as buildGoogleChatApprovalTextWidget } from "./approval-card-text-
|
|
1
|
+
import { C as sendGoogleChatMessage, O as googleChatApprovalControls, S as probeGoogleChat, T as verifyGoogleChatRequest, b as deleteGoogleChatMessage, c as googleChatIngressIdentity, d as formatGoogleChatMediaText, f as formatGoogleChatTextChunks, k as readGoogleChatApprovalActionToken, l as normalizeGoogleChatUserId, p as isGoogleChatGroupSpace, u as buildGoogleChatGroupPolicyScope, w as updateGoogleChatMessage, x as downloadGoogleChatMedia, y as GoogleChatApiError } from "./channel.adapters-CLzwB-5-.mjs";
|
|
2
|
+
import { n as googleChatApprovalAuth } from "./approval-auth-Dd-6ne22.mjs";
|
|
3
|
+
import { t as getGoogleChatRuntime } from "./runtime-C5OOOlaP.mjs";
|
|
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";
|
|
6
6
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
7
7
|
import { PlatformMessageNotDispatchedError, collectErrorGraphCandidates, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
8
8
|
import { MediaFetchError } from "openclaw/plugin-sdk/media-runtime";
|
|
9
9
|
import { channelIngressRoutes, createStandardRawEventIngressMonitor } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
10
10
|
import { createChannelIngressError } from "openclaw/plugin-sdk/channel-outbound";
|
|
11
|
+
import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
11
12
|
import { channelBlockedPatch, channelReadyPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
|
12
13
|
import { isRecord as isRecord$1 } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
13
14
|
import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
@@ -20,10 +21,9 @@ import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway
|
|
|
20
21
|
import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
|
|
21
22
|
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
22
23
|
import { GROUP_POLICY_BLOCKED_LABEL, resolveAllowlistProviderRuntimeGroupPolicy, resolveDefaultGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
23
|
-
import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
24
24
|
import { createWebhookInFlightLimiter, readJsonWebhookBodyOrReject, runDetachedWebhookWork } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
25
25
|
import { registerWebhookTargetWithPluginRoute, resolveWebhookTargetWithAuthOrReject, withResolvedWebhookRequestPipeline } from "openclaw/plugin-sdk/webhook-targets";
|
|
26
|
-
|
|
26
|
+
//#region extensions/googlechat/src/approval-terminal-card.ts
|
|
27
27
|
const GOOGLECHAT_APPROVAL_CARD_ID = "openclaw-approval";
|
|
28
28
|
function formatCanonicalOutcome(approval) {
|
|
29
29
|
switch (approval.status) {
|
|
@@ -70,7 +70,8 @@ function buildGoogleChatCanonicalApprovalTerminalCards(result) {
|
|
|
70
70
|
}
|
|
71
71
|
}];
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region extensions/googlechat/src/approval-card-click.ts
|
|
74
75
|
function logIgnored(target, message) {
|
|
75
76
|
target.runtime.log?.(`[${target.account.accountId}] googlechat approval ignored: ${message}`);
|
|
76
77
|
}
|
|
@@ -137,7 +138,8 @@ async function maybeHandleGoogleChatApprovalCardClick(params) {
|
|
|
137
138
|
params.target.runtime.log?.(`[${params.target.account.accountId}] googlechat approval ${label} id=${consumed.approvalId} status=${result.approval.status} decision=${decision} sender=${actor || "unknown"}`);
|
|
138
139
|
return true;
|
|
139
140
|
}
|
|
140
|
-
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region extensions/googlechat/src/monitor-access.ts
|
|
141
143
|
function resolveGoogleChatGroupConfig(params) {
|
|
142
144
|
const { groupId, groupName, groups } = params;
|
|
143
145
|
const entries = groups ?? {};
|
|
@@ -388,7 +390,8 @@ async function applyGoogleChatInboundAccessPolicy(params) {
|
|
|
388
390
|
groupSystemPrompt: normalizeOptionalString(groupEntry?.systemPrompt)
|
|
389
391
|
};
|
|
390
392
|
}
|
|
391
|
-
|
|
393
|
+
//#endregion
|
|
394
|
+
//#region extensions/googlechat/src/monitor-durable.ts
|
|
392
395
|
function resolveGoogleChatDurableReplyOptions(params) {
|
|
393
396
|
if (params.infoKind !== "final" || params.hasTypingMessage) return false;
|
|
394
397
|
const threadId = params.payload.replyToId?.trim() || void 0;
|
|
@@ -402,7 +405,8 @@ function resolveGoogleChatDurableReplyOptions(params) {
|
|
|
402
405
|
threadId
|
|
403
406
|
};
|
|
404
407
|
}
|
|
405
|
-
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region extensions/googlechat/src/monitor-event.ts
|
|
406
410
|
var GoogleChatEventPayloadError = class extends Error {
|
|
407
411
|
constructor() {
|
|
408
412
|
super("invalid payload");
|
|
@@ -462,7 +466,8 @@ function parseGoogleChatInboundPayload(raw) {
|
|
|
462
466
|
} else if (eventType === "CARD_CLICKED" && !isRecord$1(event.user)) throw new GoogleChatEventPayloadError();
|
|
463
467
|
return event;
|
|
464
468
|
}
|
|
465
|
-
|
|
469
|
+
//#endregion
|
|
470
|
+
//#region extensions/googlechat/src/monitor-ingress.ts
|
|
466
471
|
const GoogleChatIngressPermanentError = createChannelIngressError("GoogleChatIngressPermanentError", { withReason: true });
|
|
467
472
|
function requiredString(value, field) {
|
|
468
473
|
if (typeof value === "string" && value.trim()) return value.trim();
|
|
@@ -548,7 +553,8 @@ function createGoogleChatIngressMonitor(options) {
|
|
|
548
553
|
classifyAdmissionError: (error) => error instanceof GoogleChatIngressPermanentError ? error.message : void 0
|
|
549
554
|
});
|
|
550
555
|
}
|
|
551
|
-
|
|
556
|
+
//#endregion
|
|
557
|
+
//#region extensions/googlechat/src/monitor-reply-delivery.ts
|
|
552
558
|
function createGoogleChatTypingMessage(params) {
|
|
553
559
|
const name = params.messageName.trim();
|
|
554
560
|
const requestedThreadName = params.requestedThreadName?.trim();
|
|
@@ -590,11 +596,17 @@ async function deliverGoogleChatReply(params) {
|
|
|
590
596
|
}
|
|
591
597
|
typingMessage = void 0;
|
|
592
598
|
} else if (typingMessage?.placement === "thread") deliveryThreadName = typingMessage.deliveredThreadName;
|
|
593
|
-
|
|
599
|
+
let text = reply.text;
|
|
600
|
+
let mediaError;
|
|
601
|
+
try {
|
|
602
|
+
text = formatGoogleChatMediaText(reply.text, reply.mediaUrls);
|
|
603
|
+
} catch (error) {
|
|
604
|
+
mediaError = error;
|
|
605
|
+
}
|
|
594
606
|
const chunkLimit = account.config.textChunkLimit ?? 4e3;
|
|
595
607
|
const chunkMode = core.channel.text.resolveChunkMode(config, "googlechat", account.accountId);
|
|
596
|
-
const chunks = formatGoogleChatTextChunks(
|
|
597
|
-
const rejection =
|
|
608
|
+
const chunks = formatGoogleChatTextChunks(text, chunkLimit).flatMap((chunk) => core.channel.text.chunkMarkdownTextWithMode(chunk, chunkLimit, chunkMode));
|
|
609
|
+
const rejection = mediaError ? formatErrorMessage(mediaError) : text && !chunks.some((chunk) => chunk) ? "Google Chat reply has no visible text after formatting." : void 0;
|
|
598
610
|
if (rejection) {
|
|
599
611
|
try {
|
|
600
612
|
if (typingMessage) await deleteGoogleChatMessage({
|
|
@@ -605,7 +617,7 @@ async function deliverGoogleChatReply(params) {
|
|
|
605
617
|
runtime.error?.(`Google Chat typing cleanup failed: ${String(err)}`);
|
|
606
618
|
}
|
|
607
619
|
throw new PlatformMessageNotDispatchedError(rejection, {
|
|
608
|
-
cause:
|
|
620
|
+
cause: mediaError,
|
|
609
621
|
retryable: false
|
|
610
622
|
});
|
|
611
623
|
}
|
|
@@ -655,7 +667,8 @@ async function deliverGoogleChatReply(params) {
|
|
|
655
667
|
recordOutboundStatus();
|
|
656
668
|
}
|
|
657
669
|
}
|
|
658
|
-
|
|
670
|
+
//#endregion
|
|
671
|
+
//#region extensions/googlechat/src/monitor-reply-target.ts
|
|
659
672
|
/**
|
|
660
673
|
* Google Chat only accepts a thread resource (`spaces/x/threads/y`) as a reply
|
|
661
674
|
* target. The automatic reply pipeline supplies the inbound *message* resource
|
|
@@ -672,7 +685,8 @@ function normalizeGoogleChatReplyTarget(params) {
|
|
|
672
685
|
replyToId: params.replyThreadName
|
|
673
686
|
};
|
|
674
687
|
}
|
|
675
|
-
|
|
688
|
+
//#endregion
|
|
689
|
+
//#region extensions/googlechat/src/monitor-webhook.ts
|
|
676
690
|
function extractBearerToken(header) {
|
|
677
691
|
const authHeader = Array.isArray(header) ? typeof header[0] === "string" ? header[0] : "" : typeof header === "string" ? header : "";
|
|
678
692
|
return normalizeLowercaseStringOrEmpty(authHeader).startsWith("bearer ") ? authHeader.slice(7).trim() : "";
|
|
@@ -815,7 +829,8 @@ function createGoogleChatWebhookRequestHandler(params) {
|
|
|
815
829
|
});
|
|
816
830
|
};
|
|
817
831
|
}
|
|
818
|
-
|
|
832
|
+
//#endregion
|
|
833
|
+
//#region extensions/googlechat/src/monitor-routing.ts
|
|
819
834
|
const webhookTargets = /* @__PURE__ */ new Map();
|
|
820
835
|
const webhookRateLimiter = createFixedWindowRateLimiter(WEBHOOK_RATE_LIMIT_DEFAULTS);
|
|
821
836
|
const webhookInFlightLimiter = createWebhookInFlightLimiter();
|
|
@@ -853,7 +868,8 @@ function registerGoogleChatWebhookTarget(target) {
|
|
|
853
868
|
}
|
|
854
869
|
}).unregister;
|
|
855
870
|
}
|
|
856
|
-
|
|
871
|
+
//#endregion
|
|
872
|
+
//#region extensions/googlechat/src/monitor.ts
|
|
857
873
|
setGoogleChatWebhookEventProcessor(processGoogleChatEvent);
|
|
858
874
|
function logVerbose(core, runtime, message) {
|
|
859
875
|
if (core.logging.shouldLogVerbose()) runtime.log?.(`[googlechat] ${message}`);
|
|
@@ -1219,11 +1235,13 @@ function resolveGoogleChatWebhookPath({ webhookPath, webhookUrl }) {
|
|
|
1219
1235
|
defaultPath: "/googlechat"
|
|
1220
1236
|
});
|
|
1221
1237
|
}
|
|
1222
|
-
|
|
1238
|
+
//#endregion
|
|
1239
|
+
//#region extensions/googlechat/src/channel.runtime.ts
|
|
1223
1240
|
const googleChatChannelRuntime = {
|
|
1224
1241
|
probeGoogleChat,
|
|
1225
1242
|
sendGoogleChatMessage,
|
|
1226
1243
|
resolveGoogleChatWebhookPath,
|
|
1227
1244
|
startGoogleChatMonitor
|
|
1228
1245
|
};
|
|
1246
|
+
//#endregion
|
|
1229
1247
|
export { googleChatChannelRuntime };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -23,7 +23,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
23
|
return to;
|
|
24
24
|
};
|
|
25
25
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
26
|
-
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region packages/normalization-core/src/record-coerce.ts
|
|
27
28
|
/** Type guard for non-array object records at browser-safe boundaries. */
|
|
28
29
|
function isRecord(value) {
|
|
29
30
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -32,7 +33,8 @@ function isRecord(value) {
|
|
|
32
33
|
function asNullableRecord(value) {
|
|
33
34
|
return isRecord(value) ? value : null;
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/config/channel-config-normalization.ts
|
|
36
38
|
/** Applies one channel-specific doctor migration to every object-shaped account. */
|
|
37
39
|
function normalizeChannelAccounts(params) {
|
|
38
40
|
const rawAccounts = asNullableRecord(params.entry.accounts);
|
|
@@ -108,7 +110,8 @@ function normalizeChannelConfigEntries$1(params) {
|
|
|
108
110
|
changes
|
|
109
111
|
};
|
|
110
112
|
}
|
|
111
|
-
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/plugin-sdk/legacy-webhook-listener-migration.ts
|
|
112
115
|
/** Preserve explicitly configured webhook listeners while moving ingress onto Gateway routes. */
|
|
113
116
|
function createLegacyWebhookListenerDoctorContract(params) {
|
|
114
117
|
const portKey = params.portKey ?? "webhookPort";
|
|
@@ -178,11 +181,13 @@ function createLegacyWebhookListenerDoctorContract(params) {
|
|
|
178
181
|
}
|
|
179
182
|
};
|
|
180
183
|
}
|
|
181
|
-
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
|
|
182
186
|
var runtime_doctor_migrations_exports = /* @__PURE__ */ __exportAll({ createLegacyWebhookListenerDoctorContract: () => createLegacyWebhookListenerDoctorContract });
|
|
183
187
|
import * as import_openclaw_plugin_sdk_runtime_doctor_migrations from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
184
188
|
__reExport(runtime_doctor_migrations_exports, import_openclaw_plugin_sdk_runtime_doctor_migrations);
|
|
185
|
-
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region extensions/googlechat/src/doctor-contract.ts
|
|
186
191
|
const streamingAliasMigration = (0, runtime_doctor_migrations_exports.defineChannelAliasMigration)({
|
|
187
192
|
channelId: "googlechat",
|
|
188
193
|
streaming: {
|
|
@@ -291,4 +296,5 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
291
296
|
changes: retired.changes
|
|
292
297
|
});
|
|
293
298
|
}
|
|
299
|
+
//#endregion
|
|
294
300
|
export { normalizeCompatibilityConfig as n, legacyConfigRules as t };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
2
|
-
|
|
2
|
+
//#region extensions/googlechat/src/runtime.ts
|
|
3
3
|
const { setRuntime: setGoogleChatRuntime, getRuntime: getGoogleChatRuntime } = createPluginRuntimeStore({
|
|
4
4
|
pluginId: "googlechat",
|
|
5
5
|
errorMessage: "Google Chat runtime not initialized"
|
|
6
6
|
});
|
|
7
|
+
//#endregion
|
|
7
8
|
export { setGoogleChatRuntime as n, getGoogleChatRuntime as t };
|
|
@@ -2,7 +2,7 @@ import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
|
2
2
|
import { hasConfiguredAccountValue } from "openclaw/plugin-sdk/account-resolution";
|
|
3
3
|
import { coerceSecretRef } from "openclaw/plugin-sdk/secret-input";
|
|
4
4
|
import { createChannelSecretContract, hasOwnProperty, pushAssignment, pushInactiveSurfaceWarning } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
5
|
-
|
|
5
|
+
//#region extensions/googlechat/src/secret-contract.ts
|
|
6
6
|
function accountSecretOwner(accountId) {
|
|
7
7
|
return {
|
|
8
8
|
ownerKind: "account",
|
|
@@ -74,4 +74,5 @@ const channelSecrets = createChannelSecretContract({
|
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
const { secretTargetRegistryEntries, collectRuntimeConfigAssignments } = channelSecrets;
|
|
77
|
+
//#endregion
|
|
77
78
|
export { collectRuntimeConfigAssignments as n, secretTargetRegistryEntries as r, channelSecrets as t };
|
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as googlechatSetupAdapter, i as googlechatSetupWizard } from "./.setup/channel-base-
|
|
2
|
-
import { t as googlechatPlugin } from "./.setup/channel-
|
|
1
|
+
import { a as googlechatSetupAdapter, i as googlechatSetupWizard } from "./.setup/channel-base-sWlG7EP1.mjs";
|
|
2
|
+
import { t as googlechatPlugin } from "./.setup/channel-p2FLMhYl.mjs";
|
|
3
3
|
export { googlechatPlugin, googlechatSetupAdapter, googlechatSetupWizard };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { n as buildChannelConfigSchema, t as GoogleChatConfigSchema } from "./.setup/config-api-CsD0IFxF.mjs";
|
|
2
|
-
|
|
2
|
+
//#region extensions/googlechat/src/config-schema.ts
|
|
3
3
|
const GoogleChatChannelConfigSchema = buildChannelConfigSchema(GoogleChatConfigSchema);
|
|
4
|
+
//#endregion
|
|
4
5
|
export { GoogleChatChannelConfigSchema };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { t as googlechatPlugin } from "./.setup/channel-p2FLMhYl.mjs";
|
|
2
|
+
export { googlechatPlugin };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { t as googlechatDirectoryAdapter } from "./.setup/channel.adapters-
|
|
2
|
-
|
|
1
|
+
import { t as googlechatDirectoryAdapter } from "./.setup/channel.adapters-CLzwB-5-.mjs";
|
|
2
|
+
//#region extensions/googlechat/directory-contract-api.ts
|
|
3
3
|
const googlechatDirectoryContractPlugin = {
|
|
4
4
|
id: "googlechat",
|
|
5
5
|
directory: googlechatDirectoryAdapter
|
|
6
6
|
};
|
|
7
|
+
//#endregion
|
|
7
8
|
export { googlechatDirectoryContractPlugin };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./.setup/doctor-contract-BzoaiFSD.mjs";
|
|
2
|
+
export { legacyConfigRules, normalizeCompatibilityConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
|
-
|
|
2
|
+
//#region extensions/googlechat/index.ts
|
|
3
3
|
var googlechat_default = defineBundledChannelEntry({
|
|
4
4
|
id: "googlechat",
|
|
5
5
|
name: "Google Chat",
|
|
@@ -18,4 +18,5 @@ var googlechat_default = defineBundledChannelEntry({
|
|
|
18
18
|
exportName: "setGoogleChatRuntime"
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
|
+
//#endregion
|
|
21
22
|
export { googlechat_default as default };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { n as setGoogleChatRuntime } from "./.setup/runtime-C5OOOlaP.mjs";
|
|
2
|
+
export { setGoogleChatRuntime };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./.setup/secret-contract-D7KjX374.mjs";
|
|
2
|
+
export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
|
package/dist/setup-entry.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
|
|
3
|
+
//#region extensions/googlechat/setup-entry.ts
|
|
4
4
|
var setup_entry_default = defineBundledChannelSetupEntry({
|
|
5
5
|
importMetaUrl: import.meta.url,
|
|
6
6
|
plugin: {
|
|
7
|
-
specifier: fileURLToPath(new URL(".setup/setup-plugin-api-
|
|
7
|
+
specifier: fileURLToPath(new URL(".setup/setup-plugin-api-yGEtLeXV.mjs", import.meta.url).href),
|
|
8
8
|
exportName: "googlechatSetupPlugin"
|
|
9
9
|
},
|
|
10
10
|
secrets: {
|
|
11
|
-
specifier: fileURLToPath(new URL(".setup/secret-contract-api-
|
|
11
|
+
specifier: fileURLToPath(new URL(".setup/secret-contract-api-Dx8QYxoR.mjs", import.meta.url).href),
|
|
12
12
|
exportName: "channelSecrets"
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
+
//#endregion
|
|
15
16
|
export { setup_entry_default as default };
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { r as googlechatSetupPlugin } from "./.setup/channel-base-sWlG7EP1.mjs";
|
|
2
|
+
export { googlechatSetupPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/googlechat",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.11.2",
|
|
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.
|
|
15
|
+
"openclaw": ">=2026.11.2"
|
|
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.
|
|
138
|
+
"pluginApi": ">=2026.11.2"
|
|
139
139
|
},
|
|
140
140
|
"build": {
|
|
141
|
-
"openclawVersion": "2026.
|
|
141
|
+
"openclawVersion": "2026.11.2"
|
|
142
142
|
},
|
|
143
143
|
"release": {
|
|
144
144
|
"publishToClawHub": true,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"api.js","source":"extensions/googlechat/api.ts"},{"output":"channel-config-api.js","source":"extensions/googlechat/channel-config-api.ts"},{"output":"channel-plugin-api.js","source":"extensions/googlechat/channel-plugin-api.ts"},{"output":"directory-contract-api.js","source":"extensions/googlechat/directory-contract-api.ts"},{"output":"doctor-contract-api.js","source":"extensions/googlechat/doctor-contract-api.ts"},{"output":"index.js","source":"extensions/googlechat/index.ts"},{"output":"runtime-api.js","source":"extensions/googlechat/runtime-api.ts"},{"output":"secret-contract-api.js","source":"extensions/googlechat/secret-contract-api.ts"},{"output":"setup-entry.js","source":"extensions/googlechat/setup-entry.ts"},{"output":"setup-plugin-api.js","source":"extensions/googlechat/setup-plugin-api.ts"}],"chunks":[{"output":".setup/actions-uo0lf5AI.mjs","sha256":"9491b555adce2d9fc46e5eb13d765646700715304995533f4ab8b190532d3ac1","facadeSource":"extensions/googlechat/src/actions.ts","sources":["extensions/googlechat/src/actions.ts"]},{"output":".setup/approval-auth-CKF1wHai.mjs","sha256":"d528e256f5a4665431d0fae942ad4dc1c34bce21f432cd62ea613ddf0ef0aed4","facadeSource":null,"sources":["extensions/googlechat/src/approval-auth.ts"]},{"output":".setup/approval-card-text-9o-Dfr9Z.mjs","sha256":"acd260416e2c70d91b277feb6e4617c7873c2d30dceabbd6ee017161d84f9302","facadeSource":null,"sources":["extensions/googlechat/src/approval-card-text.ts"]},{"output":".setup/approval-handler.runtime-wYtTR6as.mjs","sha256":"6e1bb21c51a25ec3c25da51abe6416522b75147664372421d41fe441f8ebcef6","facadeSource":"extensions/googlechat/src/approval-handler.runtime.ts","sources":["extensions/googlechat/src/approval-handler.runtime.ts"]},{"output":".setup/channel-base-BFV0cGQ2.mjs","sha256":"4432c9b98d4eb0a40ce7925c79a0c30e9111e59928958d6d93dc5a7b0e63b498","facadeSource":null,"sources":["extensions/googlechat/src/accounts.ts","extensions/googlechat/src/channel-base.ts","extensions/googlechat/src/google-auth-limits.ts","extensions/googlechat/src/setup-core.ts","extensions/googlechat/src/setup-surface.ts"]},{"output":".setup/channel-ZbGyNgH9.mjs","sha256":"30b36aadd1f0e72db21d61dc0c5ce320875dbe02c164dd494763ce506e5ffd27","facadeSource":null,"sources":["extensions/googlechat/src/approval-native.ts","extensions/googlechat/src/channel.ts","extensions/googlechat/src/doctor.ts","extensions/googlechat/src/gateway.ts","extensions/googlechat/src/message-tool-api.ts"]},{"output":".setup/channel.adapters-5rr8crHQ.mjs","sha256":"b9f8cfc23752477601bec6bfa7bb5ac88ac808a6cd001a61d1c76abd27970cf1","facadeSource":null,"sources":["extensions/googlechat/src/api.ts","extensions/googlechat/src/approval-card-actions.ts","extensions/googlechat/src/auth.ts","extensions/googlechat/src/channel.adapters.ts","extensions/googlechat/src/format.ts","extensions/googlechat/src/google-auth.runtime.ts","extensions/googlechat/src/group-policy.ts","extensions/googlechat/src/ingress-identity.ts","extensions/googlechat/src/targets.ts"]},{"output":".setup/channel.runtime-DkrekcGA.mjs","sha256":"d9523fc897aee7966ecdcda43748f1b7d39622e3d00b34b0c9edaa3cced0bd9d","facadeSource":"extensions/googlechat/src/channel.runtime.ts","sources":["extensions/googlechat/src/approval-card-click.ts","extensions/googlechat/src/approval-terminal-card.ts","extensions/googlechat/src/channel.runtime.ts","extensions/googlechat/src/monitor-access.ts","extensions/googlechat/src/monitor-durable.ts","extensions/googlechat/src/monitor-event.ts","extensions/googlechat/src/monitor-ingress.ts","extensions/googlechat/src/monitor-reply-delivery.ts","extensions/googlechat/src/monitor-reply-target.ts","extensions/googlechat/src/monitor-routing.ts","extensions/googlechat/src/monitor-webhook.ts","extensions/googlechat/src/monitor.ts"]},{"output":".setup/config-api-CsD0IFxF.mjs","sha256":"134d1ecb7a42e67cb112730f0935792ac69fa8500796df1c1ef50308f70c4999","facadeSource":null,"sources":[]},{"output":".setup/doctor-contract-WrFOPxEj.mjs","sha256":"ac87e042e1965530c26cb25d48979f02332a586a8928814388621e247b5823fc","facadeSource":null,"sources":["extensions/googlechat/src/doctor-contract.ts","packages/normalization-core/src/record-coerce.ts","src/config/channel-config-normalization.ts","src/plugin-sdk/legacy-webhook-listener-migration.ts"]},{"output":".setup/runtime-zEzHA5rr.mjs","sha256":"ca736781dfaabb9b01e948b24fa82b567feaaf70cc6a15f880d0efd4e2fc0452","facadeSource":null,"sources":["extensions/googlechat/src/runtime.ts"]},{"output":".setup/secret-contract-api-CLRweErW.mjs","sha256":"ee90fabda59b98d84f7d5ae73c2b250527282f788916449c3f33968beb9001fe","facadeSource":"extensions/googlechat/secret-contract-api.ts","sources":[]},{"output":".setup/secret-contract-h2P-4VpL.mjs","sha256":"b894119f1d787508dc3a726be8bf8ca8670b707a7a76678787b9de8d497d9116","facadeSource":null,"sources":["extensions/googlechat/src/secret-contract.ts"]},{"output":".setup/setup-plugin-api-Dru1eW9z.mjs","sha256":"914efc1bd1576f3fe835b9d79fea654ac56f6d492a7a676f5bd984169c2c704b","facadeSource":"extensions/googlechat/setup-plugin-api.ts","sources":[]},{"output":"api.js","sha256":"db54e51d82e48e43aea13e84b5da2dba9905fe2ddd2d752c783c8fcbcd586bd0","facadeSource":"extensions/googlechat/api.ts","sources":[]},{"output":"channel-config-api.js","sha256":"cf612ab901974dfabb2c06edb513d91bb0bd4dac199bcf166f3fac5e12540bf5","facadeSource":"extensions/googlechat/channel-config-api.ts","sources":["extensions/googlechat/src/config-schema.ts"]},{"output":"channel-plugin-api.js","sha256":"3751b0af2542ea1ac99f9c7a88b7a613b6edf2f70e0ba5e1a9a5d7839146a3e3","facadeSource":"extensions/googlechat/channel-plugin-api.ts","sources":[]},{"output":"directory-contract-api.js","sha256":"f0fb8ede4c7c5f2d55ac8eba69fccb6e26e9852e5acbfd7f84e03a9ef9c91433","facadeSource":"extensions/googlechat/directory-contract-api.ts","sources":["extensions/googlechat/directory-contract-api.ts"]},{"output":"doctor-contract-api.js","sha256":"ede0e3577556acfd4a4df679979f5adcef7008639c1f4638ab6f375eb7d18077","facadeSource":"extensions/googlechat/doctor-contract-api.ts","sources":[]},{"output":"index.js","sha256":"a8677a1c9368c3c78c2f83b73ec50cece345574790a652c9162219b76404987c","facadeSource":"extensions/googlechat/index.ts","sources":["extensions/googlechat/index.ts"]},{"output":"runtime-api.js","sha256":"b149bacfb902e955995a631d92f928bcb02512bc30d45da3c93ad22570dc20da","facadeSource":"extensions/googlechat/runtime-api.ts","sources":[]},{"output":"secret-contract-api.js","sha256":"e2f8dcd992e1b82c48e592f948edd726064dabe13bb6e0bafd98479be4d05418","facadeSource":"extensions/googlechat/secret-contract-api.ts","sources":[]},{"output":"setup-entry.js","sha256":"f0bf84ccc2abc89c4b391769fa21aafb6a92e6d873d3a2c7803cb891698e9163","facadeSource":"extensions/googlechat/setup-entry.ts","sources":["extensions/googlechat/setup-entry.ts"]},{"output":"setup-plugin-api.js","sha256":"0edcff1c63d66ce8e2434d706b33b071a8d06be4b06104e1ee4e05feec9849b5","facadeSource":"extensions/googlechat/setup-plugin-api.ts","sources":[]}],"unrenderedSources":["extensions/googlechat/api.ts","extensions/googlechat/channel-config-api.ts","extensions/googlechat/channel-plugin-api.ts","extensions/googlechat/config-api.ts","extensions/googlechat/config-doctor-api.ts","extensions/googlechat/doctor-contract-api.ts","extensions/googlechat/runtime-api.ts","extensions/googlechat/secret-contract-api.ts","extensions/googlechat/setup-plugin-api.ts","extensions/googlechat/src/channel.setup.ts"]}
|