@openclaw/googlechat 2026.7.2-beta.1 → 2026.7.2-beta.3
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/{actions-I93fRoRd.js → actions-C9M27Xgq.js} +5 -5
- package/dist/api.js +2 -2
- package/dist/{approval-auth-CMMwmCPY.js → approval-auth-DXkKpb-s.js} +2 -2
- package/dist/{approval-handler.runtime-DcSqrj8k.js → approval-handler.runtime-DemP1cMx.js} +4 -4
- package/dist/{channel-9ZeBzfmP.js → channel-Bylft8ql.js} +30 -47
- package/dist/{channel-base-B16U1bY7.js → channel-base-CuSSPg6I.js} +56 -15
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.adapters-CvESEXlT.js → channel.adapters-CAVl8EUt.js} +24 -18
- package/dist/{channel.runtime-B0u_Dy7b.js → channel.runtime-tLQQKXrg.js} +24 -19
- package/dist/directory-contract-api.js +1 -1
- package/dist/{runtime-api-1v-DgldF.js → runtime-api-Dh0CNVS4.js} +1 -2
- package/dist/runtime-api.js +2 -2
- package/dist/{secret-contract-D__4IIu_.js → secret-contract-ZFiLJ7Yn.js} +15 -5
- package/dist/secret-contract-api.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/npm-shrinkwrap.json +3 -3
- package/package.json +4 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount, o as listEnabledGoogleChatAccounts } from "./channel-base-
|
|
2
|
-
import {
|
|
1
|
+
import { l as resolveGoogleChatAccount, o as listEnabledGoogleChatAccounts } from "./channel-base-CuSSPg6I.js";
|
|
2
|
+
import { m as resolveGoogleChatOutboundSpace, v as sendGoogleChatMessage } from "./channel.adapters-CAVl8EUt.js";
|
|
3
3
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
4
4
|
import { jsonResult, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/channel-actions";
|
|
5
5
|
//#region extensions/googlechat/src/actions.ts
|
|
6
6
|
const providerId = "googlechat";
|
|
7
7
|
function listEnabledAccounts(cfg) {
|
|
8
|
-
return listEnabledGoogleChatAccounts(cfg).filter((account) => account.enabled && account.credentialSource !== "none");
|
|
8
|
+
return listEnabledGoogleChatAccounts(cfg).filter((account) => account.enabled && account.credentialSource !== "none" && account.tokenStatus !== "configured_unavailable");
|
|
9
9
|
}
|
|
10
10
|
const OUTBOUND_MEDIA_KEYS = [
|
|
11
11
|
"media",
|
|
@@ -30,7 +30,7 @@ const googlechatMessageActions = {
|
|
|
30
30
|
if ((accountId ? [resolveGoogleChatAccount({
|
|
31
31
|
cfg,
|
|
32
32
|
accountId
|
|
33
|
-
})].filter((account) => account.enabled && account.credentialSource !== "none") : listEnabledAccounts(cfg)).length === 0) return null;
|
|
33
|
+
})].filter((account) => account.enabled && account.credentialSource !== "none" && account.tokenStatus !== "configured_unavailable") : listEnabledAccounts(cfg)).length === 0) return null;
|
|
34
34
|
return { actions: ["send"] };
|
|
35
35
|
},
|
|
36
36
|
supportsAction: ({ action }) => action === "send",
|
|
@@ -46,7 +46,7 @@ const googlechatMessageActions = {
|
|
|
46
46
|
cfg,
|
|
47
47
|
accountId
|
|
48
48
|
});
|
|
49
|
-
if (account.credentialSource === "none") throw new Error("Google Chat credentials are missing.");
|
|
49
|
+
if (account.credentialSource === "none" || account.tokenStatus === "configured_unavailable") throw new Error("Google Chat credentials are missing.");
|
|
50
50
|
if (action === "send") {
|
|
51
51
|
const to = readStringParam(params, "to", { required: true });
|
|
52
52
|
const content = readStringParam(params, "message", {
|
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as googlechatSetupAdapter, i as googlechatSetupWizard } from "./channel-base-
|
|
2
|
-
import { t as googlechatPlugin } from "./channel-
|
|
1
|
+
import { a as googlechatSetupAdapter, i as googlechatSetupWizard } from "./channel-base-CuSSPg6I.js";
|
|
2
|
+
import { t as googlechatPlugin } from "./channel-Bylft8ql.js";
|
|
3
3
|
export { googlechatPlugin, googlechatSetupAdapter, googlechatSetupWizard };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount } from "./channel-base-
|
|
2
|
-
import { d as
|
|
1
|
+
import { l as resolveGoogleChatAccount } from "./channel-base-CuSSPg6I.js";
|
|
2
|
+
import { d as isGoogleChatUserTarget, f as normalizeGoogleChatTarget } from "./channel.adapters-CAVl8EUt.js";
|
|
3
3
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { createChannelApprovalAuth } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
5
5
|
//#region extensions/googlechat/src/approval-auth.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount } from "./channel-base-
|
|
2
|
-
import {
|
|
3
|
-
import { n as isGoogleChatNativeApprovalClientEnabled, r as shouldHandleGoogleChatNativeApprovalRequest } from "./channel-
|
|
1
|
+
import { l as resolveGoogleChatAccount } from "./channel-base-CuSSPg6I.js";
|
|
2
|
+
import { M as unregisterGoogleChatManualApprovalFollowupSuppression, O as registerGoogleChatApprovalCardBinding, S as buildGoogleChatApprovalActionParameters, T as createGoogleChatApprovalToken, j as unregisterGoogleChatApprovalCardBindings, k as registerGoogleChatManualApprovalFollowupSuppression, m as resolveGoogleChatOutboundSpace, v as sendGoogleChatMessage, x as GOOGLECHAT_APPROVAL_ACTION, y as updateGoogleChatMessage } from "./channel.adapters-CAVl8EUt.js";
|
|
3
|
+
import { n as isGoogleChatNativeApprovalClientEnabled, r as shouldHandleGoogleChatNativeApprovalRequest } from "./channel-Bylft8ql.js";
|
|
4
4
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
5
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -15,7 +15,7 @@ function resolveHandlerAccount(params) {
|
|
|
15
15
|
cfg: params.cfg,
|
|
16
16
|
accountId: params.accountId
|
|
17
17
|
});
|
|
18
|
-
if (!account.enabled || account.credentialSource === "none") return null;
|
|
18
|
+
if (!account.enabled || account.credentialSource === "none" || account.tokenStatus === "configured_unavailable") return null;
|
|
19
19
|
return account;
|
|
20
20
|
}
|
|
21
21
|
function escapeGoogleChatText(text) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as resolveDefaultGoogleChatAccountId, l as resolveGoogleChatAccount, n as createGoogleChatPluginBase, s as listGoogleChatAccountIds, t as GOOGLECHAT_CHANNEL_ID } from "./channel-base-
|
|
2
|
-
import { a as googlechatPairingTextAdapter, d as
|
|
1
|
+
import { c as resolveDefaultGoogleChatAccountId, l as resolveGoogleChatAccount, n as createGoogleChatPluginBase, s as listGoogleChatAccountIds, t as GOOGLECHAT_CHANNEL_ID } from "./channel-base-CuSSPg6I.js";
|
|
2
|
+
import { a as googlechatPairingTextAdapter, d as isGoogleChatUserTarget, f as normalizeGoogleChatTarget, i as googlechatOutboundAdapter, n as googlechatGroupsAdapter, o as googlechatSecurityAdapter, p as resolveGoogleChatOutboundSessionRoute, r as googlechatMessageAdapter, s as googlechatThreadingAdapter, t as googlechatDirectoryAdapter, u as isGoogleChatSpaceTarget } from "./channel.adapters-CAVl8EUt.js";
|
|
3
3
|
import { n as buildChannelConfigSchema, t as GoogleChatConfigSchema } from "./config-api-CsD0IFxF.js";
|
|
4
|
-
import { t as DEFAULT_ACCOUNT_ID } from "./runtime-api-
|
|
5
|
-
import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-
|
|
4
|
+
import { t as DEFAULT_ACCOUNT_ID } from "./runtime-api-Dh0CNVS4.js";
|
|
5
|
+
import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-DXkKpb-s.js";
|
|
6
6
|
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-CvhD0eoX.js";
|
|
7
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-
|
|
7
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-ZFiLJ7Yn.js";
|
|
8
8
|
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
9
9
|
import { buildPassiveProbedChannelStatusSummary } from "openclaw/plugin-sdk/extension-shared";
|
|
10
10
|
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
@@ -15,13 +15,13 @@ import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY, createLazyChannelAp
|
|
|
15
15
|
import { createChannelApproverDmTargetResolver, createChannelNativeOriginTargetResolver, createNativeApprovalChannelRouteGates, shouldSuppressLocalNativeExecApprovalPrompt } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
16
16
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
17
17
|
import { createAccountStatusSink, runPassiveAccountLifecycle } from "openclaw/plugin-sdk/channel-outbound";
|
|
18
|
-
import { createDangerousNameMatchingMutableAllowlistWarningCollector } from "openclaw/plugin-sdk/channel-policy";
|
|
18
|
+
import { buildMutableAllowEntryDetector, collectStandardAllowlistLists, createDangerousNameMatchingMutableAllowlistWarningCollector } from "openclaw/plugin-sdk/channel-policy";
|
|
19
19
|
import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
|
|
20
20
|
//#region extensions/googlechat/src/approval-native.ts
|
|
21
21
|
const DEFAULT_APPROVAL_FORWARDING_MODE = "session";
|
|
22
22
|
function isGoogleChatAccountConfigured(params) {
|
|
23
23
|
const account = resolveGoogleChatAccount(params);
|
|
24
|
-
return account.enabled && account.credentialSource !== "none";
|
|
24
|
+
return account.enabled && account.credentialSource !== "none" && account.tokenStatus !== "configured_unavailable";
|
|
25
25
|
}
|
|
26
26
|
function hasGoogleChatWebhookApprovalAuthConfig(params) {
|
|
27
27
|
const account = resolveGoogleChatAccount(params).config;
|
|
@@ -141,49 +141,30 @@ const googleChatApprovalCapability = createApproverRestrictedNativeApprovalCapab
|
|
|
141
141
|
approvalKind,
|
|
142
142
|
request
|
|
143
143
|
}),
|
|
144
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
144
|
+
load: async () => (await import("./approval-handler.runtime-DemP1cMx.js")).googleChatApprovalNativeRuntime
|
|
145
145
|
})
|
|
146
146
|
});
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region extensions/googlechat/src/doctor.ts
|
|
149
|
-
function asObjectRecord(value) {
|
|
150
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
151
|
-
}
|
|
152
|
-
function isGoogleChatMutableAllowEntry(raw) {
|
|
153
|
-
const text = raw.trim();
|
|
154
|
-
if (!text || text === "*") return false;
|
|
155
|
-
const withoutPrefix = text.replace(/^(googlechat|google-chat|gchat):/i, "").trim();
|
|
156
|
-
if (!withoutPrefix) return false;
|
|
157
|
-
return withoutPrefix.replace(/^users\//i, "").includes("@");
|
|
158
|
-
}
|
|
159
147
|
const collectGoogleChatMutableAllowlistWarnings = createDangerousNameMatchingMutableAllowlistWarningCollector({
|
|
160
148
|
channel: "googlechat",
|
|
161
|
-
detector:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
lists.push({
|
|
177
|
-
pathLabel: `${scope.prefix}.groups.${groupKey}.users`,
|
|
178
|
-
list: group.users
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
return lists;
|
|
182
|
-
}
|
|
149
|
+
detector: buildMutableAllowEntryDetector({
|
|
150
|
+
prefixes: [
|
|
151
|
+
"googlechat:",
|
|
152
|
+
"google-chat:",
|
|
153
|
+
"gchat:",
|
|
154
|
+
"users/"
|
|
155
|
+
],
|
|
156
|
+
stableIdPattern: /^[^@]+$/
|
|
157
|
+
}),
|
|
158
|
+
collectLists: (scope) => collectStandardAllowlistLists(scope, {
|
|
159
|
+
includeAllowFrom: false,
|
|
160
|
+
includeDm: true,
|
|
161
|
+
includeGroups: true,
|
|
162
|
+
groupField: "users"
|
|
163
|
+
})
|
|
183
164
|
});
|
|
184
165
|
//#endregion
|
|
185
166
|
//#region extensions/googlechat/src/gateway.ts
|
|
186
|
-
const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
167
|
+
const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-tLQQKXrg.js"), "googleChatChannelRuntime");
|
|
187
168
|
async function startGoogleChatGatewayAccount(ctx) {
|
|
188
169
|
const account = ctx.account;
|
|
189
170
|
const statusSink = createAccountStatusSink({
|
|
@@ -245,22 +226,22 @@ async function startGoogleChatGatewayAccount(ctx) {
|
|
|
245
226
|
}
|
|
246
227
|
//#endregion
|
|
247
228
|
//#region extensions/googlechat/src/channel.ts
|
|
248
|
-
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
229
|
+
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-tLQQKXrg.js"), "googleChatChannelRuntime");
|
|
249
230
|
const googlechatActions = {
|
|
250
231
|
describeMessageTool: ({ cfg, accountId }) => {
|
|
251
232
|
if ((accountId ? [resolveGoogleChatAccount({
|
|
252
233
|
cfg,
|
|
253
234
|
accountId
|
|
254
|
-
})].filter((account) => account.enabled && account.credentialSource !== "none") : listGoogleChatAccountIds(cfg).map((id) => resolveGoogleChatAccount({
|
|
235
|
+
})].filter((account) => account.enabled && account.credentialSource !== "none" && account.tokenStatus !== "configured_unavailable") : listGoogleChatAccountIds(cfg).map((id) => resolveGoogleChatAccount({
|
|
255
236
|
cfg,
|
|
256
237
|
accountId: id
|
|
257
|
-
})).filter((account) => account.enabled && account.credentialSource !== "none")).length === 0) return null;
|
|
238
|
+
})).filter((account) => account.enabled && account.credentialSource !== "none" && account.tokenStatus !== "configured_unavailable")).length === 0) return null;
|
|
258
239
|
return { actions: ["send"] };
|
|
259
240
|
},
|
|
260
241
|
supportsAction: ({ action }) => action === "send",
|
|
261
242
|
extractToolSend: ({ args }) => extractToolSend(args, "sendMessage"),
|
|
262
243
|
handleAction: async (ctx) => {
|
|
263
|
-
const { googlechatMessageActions } = await import("./actions-
|
|
244
|
+
const { googlechatMessageActions } = await import("./actions-C9M27Xgq.js");
|
|
264
245
|
if (!googlechatMessageActions.handleAction) throw new Error("Google Chat actions are not available.");
|
|
265
246
|
return await googlechatMessageActions.handleAction(ctx);
|
|
266
247
|
}
|
|
@@ -280,6 +261,7 @@ const googlechatPlugin = createChatChannelPlugin({
|
|
|
280
261
|
"google-chat",
|
|
281
262
|
"gchat"
|
|
282
263
|
],
|
|
264
|
+
targetIdComparison: "case-sensitive",
|
|
283
265
|
normalizeTarget: normalizeGoogleChatTarget,
|
|
284
266
|
resolveOutboundSessionRoute: (params) => resolveGoogleChatOutboundSessionRoute(params),
|
|
285
267
|
targetResolver: {
|
|
@@ -366,6 +348,7 @@ const googlechatPlugin = createChatChannelPlugin({
|
|
|
366
348
|
configured: account.credentialSource !== "none",
|
|
367
349
|
extra: {
|
|
368
350
|
credentialSource: account.credentialSource,
|
|
351
|
+
tokenStatus: account.tokenStatus,
|
|
369
352
|
audienceType: account.config.audienceType,
|
|
370
353
|
audience: account.config.audience,
|
|
371
354
|
webhookPath: account.config.webhookPath,
|
|
@@ -2,13 +2,18 @@ import { safeParseJsonWithSchema, safeParseWithSchema } from "openclaw/plugin-sd
|
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringifiedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { DEFAULT_ACCOUNT_ID, createAccountListHelpers, normalizeAccountId, resolveAccountEntry, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
|
|
4
4
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
5
|
+
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/secret-file-runtime";
|
|
5
6
|
import { isSecretRef } from "openclaw/plugin-sdk/secret-input";
|
|
7
|
+
import { resolveUserPath } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
6
8
|
import { z } from "zod";
|
|
7
9
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
8
10
|
import { formatNormalizedAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
9
11
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
10
12
|
import { createPatchedAccountSetupAdapter, createSetupInputPresenceValidator } from "openclaw/plugin-sdk/setup-runtime";
|
|
11
13
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, addWildcardAllowFrom, applySetupAccountConfigPatch, createPromptParsedAllowFromForAccount, createSetupTranslator, createStandardChannelSetupStatus, formatDocsLink, mergeAllowFromEntries, migrateBaseNameToDefaultAccount, splitSetupEntries } from "openclaw/plugin-sdk/setup";
|
|
14
|
+
//#region extensions/googlechat/src/google-auth-limits.ts
|
|
15
|
+
const MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES = 64 * 1024;
|
|
16
|
+
//#endregion
|
|
12
17
|
//#region extensions/googlechat/src/accounts.ts
|
|
13
18
|
const ENV_SERVICE_ACCOUNT$1 = "GOOGLE_CHAT_SERVICE_ACCOUNT";
|
|
14
19
|
const ENV_SERVICE_ACCOUNT_FILE$1 = "GOOGLE_CHAT_SERVICE_ACCOUNT_FILE";
|
|
@@ -58,29 +63,60 @@ function resolveCredentialsFromConfig(params) {
|
|
|
58
63
|
const inline = parseServiceAccount(account.serviceAccount);
|
|
59
64
|
if (inline) return {
|
|
60
65
|
credentials: inline,
|
|
61
|
-
source: "inline"
|
|
66
|
+
source: "inline",
|
|
67
|
+
status: "available"
|
|
62
68
|
};
|
|
63
69
|
if (isSecretRef(account.serviceAccount)) throw new Error(`channels.googlechat.accounts.${accountId}.serviceAccount: unresolved SecretRef "${account.serviceAccount.source}:${account.serviceAccount.provider}:${account.serviceAccount.id}". Resolve this command against an active gateway runtime snapshot before reading it.`);
|
|
64
70
|
if (isSecretRef(account.serviceAccountRef)) throw new Error(`channels.googlechat.accounts.${accountId}.serviceAccount: unresolved SecretRef "${account.serviceAccountRef.source}:${account.serviceAccountRef.provider}:${account.serviceAccountRef.id}". Resolve this command against an active gateway runtime snapshot before reading it.`);
|
|
65
71
|
const file = normalizeOptionalString(account.serviceAccountFile);
|
|
66
|
-
if (file)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
if (file) {
|
|
73
|
+
const result = tryReadSecretFileSync(resolveUserPath(file), "Google Chat service account file", {
|
|
74
|
+
maxBytes: MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES,
|
|
75
|
+
rejectHardlinks: false,
|
|
76
|
+
rejectSymlink: false
|
|
77
|
+
}, { configPath: `channels.googlechat.accounts.${accountId}.serviceAccountFile` });
|
|
78
|
+
return result.status === "available" ? {
|
|
79
|
+
credentialsFile: file,
|
|
80
|
+
source: "file",
|
|
81
|
+
status: "available"
|
|
82
|
+
} : {
|
|
83
|
+
credentialsFile: file,
|
|
84
|
+
source: "file",
|
|
85
|
+
status: "configured_unavailable",
|
|
86
|
+
diagnostic: result.diagnostic
|
|
87
|
+
};
|
|
88
|
+
}
|
|
70
89
|
if (accountId === DEFAULT_ACCOUNT_ID) {
|
|
71
90
|
const envJson = process.env[ENV_SERVICE_ACCOUNT$1];
|
|
72
91
|
const envInline = parseServiceAccount(envJson);
|
|
73
92
|
if (envInline) return {
|
|
74
93
|
credentials: envInline,
|
|
75
|
-
source: "env"
|
|
94
|
+
source: "env",
|
|
95
|
+
status: "available"
|
|
76
96
|
};
|
|
77
97
|
const envFile = normalizeOptionalString(process.env[ENV_SERVICE_ACCOUNT_FILE$1]);
|
|
78
|
-
if (envFile)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
98
|
+
if (envFile) {
|
|
99
|
+
const result = tryReadSecretFileSync(resolveUserPath(envFile), "Google Chat service account file", {
|
|
100
|
+
maxBytes: MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES,
|
|
101
|
+
rejectHardlinks: false,
|
|
102
|
+
rejectSymlink: false
|
|
103
|
+
}, { configPath: `env.${ENV_SERVICE_ACCOUNT_FILE$1}` });
|
|
104
|
+
return result.status === "available" ? {
|
|
105
|
+
credentialsFile: envFile,
|
|
106
|
+
source: "env",
|
|
107
|
+
status: "available"
|
|
108
|
+
} : {
|
|
109
|
+
credentialsFile: envFile,
|
|
110
|
+
source: "env",
|
|
111
|
+
status: "configured_unavailable",
|
|
112
|
+
diagnostic: result.diagnostic
|
|
113
|
+
};
|
|
114
|
+
}
|
|
82
115
|
}
|
|
83
|
-
return {
|
|
116
|
+
return {
|
|
117
|
+
source: "none",
|
|
118
|
+
status: "missing"
|
|
119
|
+
};
|
|
84
120
|
}
|
|
85
121
|
function resolveGoogleChatAccount(params) {
|
|
86
122
|
const accountId = normalizeAccountId(params.accountId ?? params.cfg.channels?.["googlechat"]?.defaultAccount);
|
|
@@ -99,7 +135,9 @@ function resolveGoogleChatAccount(params) {
|
|
|
99
135
|
config: merged,
|
|
100
136
|
credentialSource: credentials.source,
|
|
101
137
|
credentials: credentials.credentials,
|
|
102
|
-
credentialsFile: credentials.credentialsFile
|
|
138
|
+
credentialsFile: credentials.credentialsFile,
|
|
139
|
+
tokenStatus: credentials.status,
|
|
140
|
+
...credentials.diagnostic ? { credentialDiagnostics: [credentials.diagnostic] } : {}
|
|
103
141
|
};
|
|
104
142
|
}
|
|
105
143
|
function listEnabledGoogleChatAccounts(cfg) {
|
|
@@ -236,7 +274,7 @@ const googlechatSetupWizard = {
|
|
|
236
274
|
]
|
|
237
275
|
},
|
|
238
276
|
prepare: async ({ cfg, accountId, credentialValues, prompter }) => {
|
|
239
|
-
if (accountId === DEFAULT_ACCOUNT_ID$1 &&
|
|
277
|
+
if (accountId === DEFAULT_ACCOUNT_ID$1 && Boolean(normalizeOptionalString(process.env[ENV_SERVICE_ACCOUNT]) || normalizeOptionalString(process.env[ENV_SERVICE_ACCOUNT_FILE]))) {
|
|
240
278
|
if (await prompter.confirm({
|
|
241
279
|
message: t("wizard.googlechat.useEnvPrompt"),
|
|
242
280
|
initialValue: true
|
|
@@ -390,10 +428,13 @@ function createGoogleChatPluginBase(params = {}) {
|
|
|
390
428
|
describeAccount: (account) => describeAccountSnapshot({
|
|
391
429
|
account,
|
|
392
430
|
configured: account.credentialSource !== "none",
|
|
393
|
-
extra: {
|
|
431
|
+
extra: {
|
|
432
|
+
credentialSource: account.credentialSource,
|
|
433
|
+
tokenStatus: account.tokenStatus
|
|
434
|
+
}
|
|
394
435
|
})
|
|
395
436
|
}
|
|
396
437
|
};
|
|
397
438
|
}
|
|
398
439
|
//#endregion
|
|
399
|
-
export { googlechatSetupAdapter as a, resolveDefaultGoogleChatAccountId as c, googlechatSetupWizard as i, resolveGoogleChatAccount as l, createGoogleChatPluginBase as n, listEnabledGoogleChatAccounts as o, formatGoogleChatAllowFromEntry as r, listGoogleChatAccountIds as s, GOOGLECHAT_CHANNEL_ID as t };
|
|
440
|
+
export { googlechatSetupAdapter as a, resolveDefaultGoogleChatAccountId as c, googlechatSetupWizard as i, resolveGoogleChatAccount as l, createGoogleChatPluginBase as n, listEnabledGoogleChatAccounts as o, formatGoogleChatAllowFromEntry as r, listGoogleChatAccountIds as s, GOOGLECHAT_CHANNEL_ID as t, MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES as u };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as googlechatPlugin } from "./channel-
|
|
1
|
+
import { t as googlechatPlugin } from "./channel-Bylft8ql.js";
|
|
2
2
|
export { googlechatPlugin };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount, r as formatGoogleChatAllowFromEntry } from "./channel-base-
|
|
2
|
-
import { d as fetchWithSsrFGuard$1, i as chunkTextForOutbound, m as missingTargetError, r as PAIRING_APPROVED_MESSAGE } from "./runtime-api-
|
|
1
|
+
import { l as resolveGoogleChatAccount, r as formatGoogleChatAllowFromEntry, u as MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES } from "./channel-base-CuSSPg6I.js";
|
|
2
|
+
import { d as fetchWithSsrFGuard$1, i as chunkTextForOutbound, m as missingTargetError, r as PAIRING_APPROVED_MESSAGE } from "./runtime-api-Dh0CNVS4.js";
|
|
3
3
|
import { buildChannelOutboundSessionRoute } from "openclaw/plugin-sdk/channel-core";
|
|
4
4
|
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
|
+
import { resolveUserPath } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
6
7
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
7
8
|
import { parseMediaContentLength, readResponseTextSnippet } from "openclaw/plugin-sdk/media-runtime";
|
|
8
9
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
@@ -13,7 +14,6 @@ import { readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
|
|
|
13
14
|
import { createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, sanitizeForPlainText } from "openclaw/plugin-sdk/channel-outbound";
|
|
14
15
|
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
15
16
|
import fs from "node:fs/promises";
|
|
16
|
-
import { resolveUserPath } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
17
17
|
import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
18
18
|
import { buildChannelGroupsScopeTree, composeAccountWarningCollectors, createAllowlistProviderOpenWarningCollector, resolveScopeRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
|
19
19
|
import { createChannelDirectoryAdapter, listResolvedDirectoryGroupEntriesFromMapKeys, listResolvedDirectoryUserEntriesFromAllowFrom } from "openclaw/plugin-sdk/directory-runtime";
|
|
@@ -175,7 +175,6 @@ const GOOGLE_AUTH_TOKEN_URI = "https://oauth2.googleapis.com/token";
|
|
|
175
175
|
const GOOGLE_AUTH_UNIVERSE_DOMAIN = "googleapis.com";
|
|
176
176
|
const GOOGLE_CLIENT_CERTS_URL_PREFIX = "https://www.googleapis.com/robot/v1/metadata/x509/";
|
|
177
177
|
const MAX_GOOGLE_AUTH_RESPONSE_BYTES = 1024 * 1024;
|
|
178
|
-
const MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES = 64 * 1024;
|
|
179
178
|
let googleAuthRuntimePromise = null;
|
|
180
179
|
function normalizeGoogleAuthPreparedRequestHeaders(config) {
|
|
181
180
|
if (!(config.headers instanceof Headers)) config.headers = new Headers(config.headers);
|
|
@@ -318,14 +317,14 @@ async function readCredentialsFile(filePath) {
|
|
|
318
317
|
try {
|
|
319
318
|
const stat = await handle.stat();
|
|
320
319
|
if (!stat.isFile()) throw new Error("Google Chat service account file must be a regular file.");
|
|
321
|
-
if (stat.size >
|
|
320
|
+
if (stat.size > 65536) throw new Error(`Google Chat service account file exceeds ${MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES} bytes.`);
|
|
322
321
|
let raw;
|
|
323
322
|
try {
|
|
324
323
|
raw = await handle.readFile({ encoding: "utf8" });
|
|
325
324
|
} catch {
|
|
326
325
|
throw new Error("Failed to load Google Chat service account file.");
|
|
327
326
|
}
|
|
328
|
-
if (Buffer.byteLength(raw, "utf8") >
|
|
327
|
+
if (Buffer.byteLength(raw, "utf8") > 65536) throw new Error(`Google Chat service account file exceeds ${MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES} bytes.`);
|
|
329
328
|
let parsed;
|
|
330
329
|
try {
|
|
331
330
|
parsed = JSON.parse(raw);
|
|
@@ -383,7 +382,7 @@ function resolveGoogleAuthDispatcherPolicy(input, init) {
|
|
|
383
382
|
};
|
|
384
383
|
return { init: nextInit };
|
|
385
384
|
}
|
|
386
|
-
function createGoogleAuthFetch(
|
|
385
|
+
function createGoogleAuthFetch() {
|
|
387
386
|
return async (input, init) => {
|
|
388
387
|
const url = input instanceof Request ? input.url : String(input);
|
|
389
388
|
const guardedOptions = resolveGoogleAuthDispatcherPolicy(input, init);
|
|
@@ -394,8 +393,7 @@ function createGoogleAuthFetch(baseFetch) {
|
|
|
394
393
|
policy: GOOGLE_AUTH_POLICY,
|
|
395
394
|
signal: guardedOptions.init?.signal ?? void 0,
|
|
396
395
|
timeoutMs: GOOGLE_AUTH_FETCH_TIMEOUT_MS,
|
|
397
|
-
url
|
|
398
|
-
...baseFetch ? { fetchImpl: baseFetch } : {}
|
|
396
|
+
url
|
|
399
397
|
});
|
|
400
398
|
try {
|
|
401
399
|
const body = await readGoogleAuthResponseBytes(response);
|
|
@@ -534,7 +532,10 @@ async function fetchChatCerts() {
|
|
|
534
532
|
timeoutMs: GOOGLECHAT_CERT_FETCH_TIMEOUT_MS
|
|
535
533
|
});
|
|
536
534
|
try {
|
|
537
|
-
if (!response.ok)
|
|
535
|
+
if (!response.ok) {
|
|
536
|
+
await response.body?.cancel().catch(() => void 0);
|
|
537
|
+
throw new Error(`Failed to fetch Chat certs (${response.status})`);
|
|
538
|
+
}
|
|
538
539
|
const certs = await readGoogleChatCertsResponse(response);
|
|
539
540
|
cachedCerts = {
|
|
540
541
|
fetchedAt: now,
|
|
@@ -867,18 +868,23 @@ async function resolveGoogleChatOutboundSessionRoute(params) {
|
|
|
867
868
|
}
|
|
868
869
|
//#endregion
|
|
869
870
|
//#region extensions/googlechat/src/group-policy.ts
|
|
870
|
-
function
|
|
871
|
-
|
|
871
|
+
function buildGoogleChatGroupPolicyScope(params) {
|
|
872
|
+
const matchKey = params.groupId && Object.hasOwn(params.tree.scopes, params.groupId) ? params.groupId : void 0;
|
|
873
|
+
return {
|
|
874
|
+
tree: params.tree,
|
|
875
|
+
path: matchKey ? [matchKey] : [],
|
|
876
|
+
matchKey
|
|
877
|
+
};
|
|
872
878
|
}
|
|
873
879
|
function resolveGoogleChatGroupRequireMention(params) {
|
|
874
|
-
return resolveScopeRequireMention({
|
|
880
|
+
return resolveScopeRequireMention(buildGoogleChatGroupPolicyScope({
|
|
875
881
|
tree: buildChannelGroupsScopeTree(params.cfg, "googlechat", params.accountId),
|
|
876
|
-
|
|
877
|
-
});
|
|
882
|
+
groupId: params.groupId
|
|
883
|
+
}));
|
|
878
884
|
}
|
|
879
885
|
//#endregion
|
|
880
886
|
//#region extensions/googlechat/src/channel.adapters.ts
|
|
881
|
-
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
887
|
+
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-tLQQKXrg.js"), "googleChatChannelRuntime");
|
|
882
888
|
function createGoogleChatSendReceipt(params) {
|
|
883
889
|
const messageId = params.messageId?.trim();
|
|
884
890
|
return createMessageReceiptFromOutboundResults({
|
|
@@ -958,7 +964,7 @@ const googlechatPairingTextAdapter = {
|
|
|
958
964
|
cfg,
|
|
959
965
|
accountId
|
|
960
966
|
});
|
|
961
|
-
if (account.credentialSource === "none") return;
|
|
967
|
+
if (account.credentialSource === "none" || account.tokenStatus === "configured_unavailable") return;
|
|
962
968
|
const user = normalizeGoogleChatTarget(id) ?? id;
|
|
963
969
|
const space = await resolveGoogleChatOutboundSpace({
|
|
964
970
|
account,
|
|
@@ -1040,4 +1046,4 @@ const googlechatMessageAdapter = defineChannelMessageAdapter({
|
|
|
1040
1046
|
send: { text: googlechatOutboundAdapter.attachedResults.sendText }
|
|
1041
1047
|
});
|
|
1042
1048
|
//#endregion
|
|
1043
|
-
export {
|
|
1049
|
+
export { releaseGoogleChatApprovalCardBinding as A, claimGoogleChatApprovalCardBinding as C, readGoogleChatApprovalActionToken as D, getGoogleChatApprovalCardBinding as E, unregisterGoogleChatManualApprovalFollowupSuppression as M, registerGoogleChatApprovalCardBinding as O, buildGoogleChatApprovalActionParameters as S, createGoogleChatApprovalToken as T, probeGoogleChat as _, googlechatPairingTextAdapter as a, verifyGoogleChatRequest as b, buildGoogleChatGroupPolicyScope as c, isGoogleChatUserTarget as d, normalizeGoogleChatTarget as f, downloadGoogleChatMedia as g, deleteGoogleChatMessage as h, googlechatOutboundAdapter as i, unregisterGoogleChatApprovalCardBindings as j, registerGoogleChatManualApprovalFollowupSuppression as k, isGoogleChatGroupSpace as l, resolveGoogleChatOutboundSpace as m, googlechatGroupsAdapter as n, googlechatSecurityAdapter as o, resolveGoogleChatOutboundSessionRoute as p, googlechatMessageAdapter as r, googlechatThreadingAdapter as s, googlechatDirectoryAdapter as t, isGoogleChatSpaceTarget as u, sendGoogleChatMessage as v, completeGoogleChatApprovalCardBinding as w, GOOGLECHAT_APPROVAL_ACTION as x, updateGoogleChatMessage as y };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as
|
|
3
|
-
import { n as googleChatApprovalAuth } from "./approval-auth-
|
|
1
|
+
import { A as releaseGoogleChatApprovalCardBinding, C as claimGoogleChatApprovalCardBinding, D as readGoogleChatApprovalActionToken, E as getGoogleChatApprovalCardBinding, _ as probeGoogleChat, b as verifyGoogleChatRequest, c as buildGoogleChatGroupPolicyScope, g as downloadGoogleChatMedia, h as deleteGoogleChatMessage, l as isGoogleChatGroupSpace, v as sendGoogleChatMessage, w as completeGoogleChatApprovalCardBinding, y as updateGoogleChatMessage } from "./channel.adapters-CAVl8EUt.js";
|
|
2
|
+
import { C as resolveWebhookPath, E as warnMissingProviderGroupPolicyFallbackOnce, O as getGoogleChatRuntime, b as resolveAllowlistProviderRuntimeGroupPolicy, c as createChannelPairingController, f as isDangerousNameMatchingEnabled, n as GROUP_POLICY_BLOCKED_LABEL, x as resolveDefaultGroupPolicy } from "./runtime-api-Dh0CNVS4.js";
|
|
3
|
+
import { n as googleChatApprovalAuth } from "./approval-auth-DXkKpb-s.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
6
|
-
import {
|
|
6
|
+
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
7
|
+
import { recordChannelBotPairLoopAndCheckSuppression, resolveChannelInboundRouteEnvelope } from "openclaw/plugin-sdk/channel-inbound";
|
|
7
8
|
import { WEBHOOK_RATE_LIMIT_DEFAULTS, createFixedWindowRateLimiter, normalizeWebhookPath, resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
|
|
8
9
|
import { registerWebhookTargetWithPluginRoute, resolveWebhookTargetWithAuthOrReject, withResolvedWebhookRequestPipeline } from "openclaw/plugin-sdk/webhook-targets";
|
|
9
|
-
import { createWebhookInFlightLimiter, readJsonWebhookBodyOrReject } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
10
|
-
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
10
|
+
import { createWebhookInFlightLimiter, readJsonWebhookBodyOrReject, runDetachedWebhookWork } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
11
11
|
import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway-runtime";
|
|
12
12
|
import { channelIngressRoutes, createChannelIngressResolver, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
13
13
|
import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
@@ -187,14 +187,21 @@ function resolveGoogleChatGroupConfig(params) {
|
|
|
187
187
|
allowlistConfigured: false,
|
|
188
188
|
deprecatedNameMatch: false
|
|
189
189
|
};
|
|
190
|
-
const
|
|
190
|
+
const { "*": fallback, ...scopes } = entries;
|
|
191
|
+
const scope = buildGoogleChatGroupPolicyScope({
|
|
192
|
+
tree: {
|
|
193
|
+
defaults: fallback,
|
|
194
|
+
scopes
|
|
195
|
+
},
|
|
196
|
+
groupId
|
|
197
|
+
});
|
|
198
|
+
const entry = scope.matchKey ? entries[scope.matchKey] : void 0;
|
|
191
199
|
const normalizedGroupName = normalizeLowercaseStringOrEmpty(groupName ?? "");
|
|
192
200
|
const deprecatedNameMatch = !entry && Boolean(groupName && keys.some((key) => {
|
|
193
201
|
const trimmed = key.trim();
|
|
194
202
|
if (!trimmed || trimmed === "*" || /^spaces\//i.test(trimmed)) return false;
|
|
195
203
|
return trimmed === groupName || normalizeLowercaseStringOrEmpty(trimmed) === normalizedGroupName;
|
|
196
204
|
}));
|
|
197
|
-
const fallback = entries["*"];
|
|
198
205
|
return {
|
|
199
206
|
entry: deprecatedNameMatch ? void 0 : entry ?? fallback,
|
|
200
207
|
allowlistConfigured: true,
|
|
@@ -713,7 +720,7 @@ function createGoogleChatWebhookRequestHandler(params) {
|
|
|
713
720
|
}
|
|
714
721
|
const dispatchTarget = selectedTarget;
|
|
715
722
|
dispatchTarget.statusSink?.({ lastInboundAt: Date.now() });
|
|
716
|
-
params.processEvent(parsedEvent, dispatchTarget).catch((err) => {
|
|
723
|
+
runDetachedWebhookWork(() => params.processEvent(parsedEvent, dispatchTarget)).catch((err) => {
|
|
717
724
|
dispatchTarget.runtime.error?.(`[${dispatchTarget.account.accountId}] Google Chat webhook failed: ${String(err)}`);
|
|
718
725
|
});
|
|
719
726
|
res.statusCode = 200;
|
|
@@ -905,16 +912,14 @@ async function processMessageWithPipeline(params) {
|
|
|
905
912
|
core,
|
|
906
913
|
runtime
|
|
907
914
|
})) return;
|
|
908
|
-
const { route, buildEnvelope } =
|
|
915
|
+
const { route, buildEnvelope } = resolveChannelInboundRouteEnvelope({
|
|
909
916
|
cfg: config,
|
|
910
917
|
channel: "googlechat",
|
|
911
918
|
accountId: account.accountId,
|
|
912
919
|
peer: {
|
|
913
920
|
kind: isGroup ? "group" : "direct",
|
|
914
921
|
id: spaceId
|
|
915
|
-
}
|
|
916
|
-
runtime: core.channel,
|
|
917
|
-
sessionStore: config.session?.store
|
|
922
|
+
}
|
|
918
923
|
});
|
|
919
924
|
let mediaPath;
|
|
920
925
|
let mediaType;
|
|
@@ -928,7 +933,7 @@ async function processMessageWithPipeline(params) {
|
|
|
928
933
|
}
|
|
929
934
|
const fromLabel = isGroup ? space.displayName || `space:${spaceId}` : senderName || `user:${senderId}`;
|
|
930
935
|
const timestampMs = resolveGoogleChatTimestampMs(event.eventTime);
|
|
931
|
-
const
|
|
936
|
+
const body = buildEnvelope({
|
|
932
937
|
channel: "Google Chat",
|
|
933
938
|
from: fromLabel,
|
|
934
939
|
timestamp: timestampMs,
|
|
@@ -955,6 +960,7 @@ async function processMessageWithPipeline(params) {
|
|
|
955
960
|
},
|
|
956
961
|
route: {
|
|
957
962
|
agentId: route.agentId,
|
|
963
|
+
dmScope: route.dmScope,
|
|
958
964
|
accountId: route.accountId,
|
|
959
965
|
routeSessionKey: route.sessionKey
|
|
960
966
|
},
|
|
@@ -1026,12 +1032,11 @@ async function processMessageWithPipeline(params) {
|
|
|
1026
1032
|
cfg: config,
|
|
1027
1033
|
channel: "googlechat",
|
|
1028
1034
|
accountId: route.accountId,
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1035
|
+
route: {
|
|
1036
|
+
agentId: route.agentId,
|
|
1037
|
+
sessionKey: route.sessionKey
|
|
1038
|
+
},
|
|
1032
1039
|
ctxPayload,
|
|
1033
|
-
recordInboundSession: core.channel.session.recordInboundSession,
|
|
1034
|
-
dispatchReplyWithBufferedBlockDispatcher: core.channel.reply.dispatchReplyWithBufferedBlockDispatcher,
|
|
1035
1040
|
delivery: {
|
|
1036
1041
|
durable: (payload, info) => resolveGoogleChatDurableReplyOptions({
|
|
1037
1042
|
payload,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as googlechatDirectoryAdapter } from "./channel.adapters-
|
|
1
|
+
import { t as googlechatDirectoryAdapter } from "./channel.adapters-CAVl8EUt.js";
|
|
2
2
|
//#region extensions/googlechat/directory-contract-api.ts
|
|
3
3
|
const googlechatDirectoryContractPlugin = {
|
|
4
4
|
id: "googlechat",
|
|
@@ -11,7 +11,6 @@ import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
|
11
11
|
import { GROUP_POLICY_BLOCKED_LABEL, resolveAllowlistProviderRuntimeGroupPolicy, resolveDefaultGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
12
12
|
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
13
13
|
import { resolveInboundMentionDecision } from "openclaw/plugin-sdk/channel-inbound";
|
|
14
|
-
import { resolveInboundRouteEnvelopeBuilderWithRuntime } from "openclaw/plugin-sdk/inbound-envelope";
|
|
15
14
|
import { resolveWebhookPath } from "openclaw/plugin-sdk/webhook-ingress";
|
|
16
15
|
import { registerWebhookTargetWithPluginRoute as registerWebhookTargetWithPluginRoute$1, resolveWebhookTargetWithAuthOrReject as resolveWebhookTargetWithAuthOrReject$1, withResolvedWebhookRequestPipeline as withResolvedWebhookRequestPipeline$1 } from "openclaw/plugin-sdk/webhook-targets";
|
|
17
16
|
import { createWebhookInFlightLimiter as createWebhookInFlightLimiter$1, readJsonWebhookBodyOrReject as readJsonWebhookBodyOrReject$1 } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
@@ -22,4 +21,4 @@ const { setRuntime: setGoogleChatRuntime, getRuntime: getGoogleChatRuntime } = c
|
|
|
22
21
|
errorMessage: "Google Chat runtime not initialized"
|
|
23
22
|
});
|
|
24
23
|
//#endregion
|
|
25
|
-
export {
|
|
24
|
+
export { resolveWebhookPath as C, withResolvedWebhookRequestPipeline$1 as D, warnMissingProviderGroupPolicyFallbackOnce as E, getGoogleChatRuntime as O, resolveInboundMentionDecision as S, runPassiveAccountLifecycle$1 as T, readReactionParams as _, createAccountStatusSink$1 as a, resolveAllowlistProviderRuntimeGroupPolicy as b, createChannelPairingController as c, fetchWithSsrFGuard$1 as d, isDangerousNameMatchingEnabled as f, readNumberParam as g, readJsonWebhookBodyOrReject$1 as h, chunkTextForOutbound as i, setGoogleChatRuntime as k, createWebhookInFlightLimiter$1 as l, missingTargetError as m, GROUP_POLICY_BLOCKED_LABEL as n, createActionGate as o, jsonResult$1 as p, PAIRING_APPROVED_MESSAGE as r, createChannelMessageReplyPipeline as s, DEFAULT_ACCOUNT_ID as t, extractToolSend$1 as u, readStringParam$1 as v, resolveWebhookTargetWithAuthOrReject$1 as w, resolveDefaultGroupPolicy as x, registerWebhookTargetWithPluginRoute$1 as y };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as buildChannelConfigSchema, t as GoogleChatConfigSchema } from "./config-api-CsD0IFxF.js";
|
|
2
|
-
import {
|
|
3
|
-
export { DEFAULT_ACCOUNT_ID, GROUP_POLICY_BLOCKED_LABEL, GoogleChatConfigSchema, PAIRING_APPROVED_MESSAGE, buildChannelConfigSchema, chunkTextForOutbound, createAccountStatusSink, createActionGate, createChannelMessageReplyPipeline, createChannelPairingController, createWebhookInFlightLimiter, extractToolSend, fetchWithSsrFGuard, isDangerousNameMatchingEnabled, jsonResult, missingTargetError, readJsonWebhookBodyOrReject, readNumberParam, readReactionParams, readStringParam, registerWebhookTargetWithPluginRoute, resolveAllowlistProviderRuntimeGroupPolicy, resolveDefaultGroupPolicy, resolveInboundMentionDecision,
|
|
2
|
+
import { C as resolveWebhookPath, D as withResolvedWebhookRequestPipeline, E as warnMissingProviderGroupPolicyFallbackOnce, S as resolveInboundMentionDecision, T as runPassiveAccountLifecycle, _ as readReactionParams, a as createAccountStatusSink, b as resolveAllowlistProviderRuntimeGroupPolicy, c as createChannelPairingController, d as fetchWithSsrFGuard, f as isDangerousNameMatchingEnabled, g as readNumberParam, h as readJsonWebhookBodyOrReject, i as chunkTextForOutbound, k as setGoogleChatRuntime, l as createWebhookInFlightLimiter, m as missingTargetError, n as GROUP_POLICY_BLOCKED_LABEL, o as createActionGate, p as jsonResult, r as PAIRING_APPROVED_MESSAGE, s as createChannelMessageReplyPipeline, t as DEFAULT_ACCOUNT_ID, u as extractToolSend, v as readStringParam, w as resolveWebhookTargetWithAuthOrReject, x as resolveDefaultGroupPolicy, y as registerWebhookTargetWithPluginRoute } from "./runtime-api-Dh0CNVS4.js";
|
|
3
|
+
export { DEFAULT_ACCOUNT_ID, GROUP_POLICY_BLOCKED_LABEL, GoogleChatConfigSchema, PAIRING_APPROVED_MESSAGE, buildChannelConfigSchema, chunkTextForOutbound, createAccountStatusSink, createActionGate, createChannelMessageReplyPipeline, createChannelPairingController, createWebhookInFlightLimiter, extractToolSend, fetchWithSsrFGuard, isDangerousNameMatchingEnabled, jsonResult, missingTargetError, readJsonWebhookBodyOrReject, readNumberParam, readReactionParams, readStringParam, registerWebhookTargetWithPluginRoute, resolveAllowlistProviderRuntimeGroupPolicy, resolveDefaultGroupPolicy, resolveInboundMentionDecision, resolveWebhookPath, resolveWebhookTargetWithAuthOrReject, runPassiveAccountLifecycle, setGoogleChatRuntime, warnMissingProviderGroupPolicyFallbackOnce, withResolvedWebhookRequestPipeline };
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
1
2
|
import { createChannelSecretTargetRegistryEntries, getChannelSurface, hasOwnProperty, pushAssignment, pushInactiveSurfaceWarning, pushWarning, resolveChannelAccountSurface } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
2
3
|
import { coerceSecretRef } from "openclaw/plugin-sdk/secret-ref-runtime";
|
|
3
4
|
//#region extensions/googlechat/src/secret-contract.ts
|
|
5
|
+
function accountSecretOwner(accountId) {
|
|
6
|
+
return {
|
|
7
|
+
ownerKind: "account",
|
|
8
|
+
ownerId: `googlechat:${normalizeAccountId(accountId)}`,
|
|
9
|
+
requiredForGateway: false,
|
|
10
|
+
disposition: "isolate"
|
|
11
|
+
};
|
|
12
|
+
}
|
|
4
13
|
const secretTargetRegistryEntries = createChannelSecretTargetRegistryEntries({
|
|
5
14
|
channelKey: "googlechat",
|
|
6
15
|
account: [{
|
|
@@ -35,7 +44,7 @@ function collectGoogleChatAccountAssignment(params) {
|
|
|
35
44
|
defaults: params.defaults
|
|
36
45
|
});
|
|
37
46
|
if (!ref) return;
|
|
38
|
-
if (params.
|
|
47
|
+
if (params.ownerAccountIds.length === 0) {
|
|
39
48
|
pushInactiveSurfaceWarning({
|
|
40
49
|
context: params.context,
|
|
41
50
|
path: `${params.path}.serviceAccount`,
|
|
@@ -48,10 +57,11 @@ function collectGoogleChatAccountAssignment(params) {
|
|
|
48
57
|
path: params.path,
|
|
49
58
|
message: `${params.path}: serviceAccountRef is set; runtime will ignore plaintext serviceAccount.`
|
|
50
59
|
});
|
|
51
|
-
pushAssignment(params.context, {
|
|
60
|
+
for (const accountId of params.ownerAccountIds) pushAssignment(params.context, {
|
|
52
61
|
ref,
|
|
53
62
|
path: `${params.path}.serviceAccount`,
|
|
54
63
|
expected: "string-or-object",
|
|
64
|
+
...accountSecretOwner(accountId),
|
|
55
65
|
apply: (value) => {
|
|
56
66
|
params.target.serviceAccount = value;
|
|
57
67
|
}
|
|
@@ -62,13 +72,13 @@ function collectRuntimeConfigAssignments(params) {
|
|
|
62
72
|
if (!resolved) return;
|
|
63
73
|
const googleChat = resolved.channel;
|
|
64
74
|
const surface = resolveChannelAccountSurface(googleChat);
|
|
65
|
-
const
|
|
75
|
+
const topLevelServiceAccountOwners = !surface.channelEnabled ? [] : !surface.hasExplicitAccounts ? ["default"] : surface.accounts.filter(({ account, enabled }) => enabled && !hasOwnProperty(account, "serviceAccount") && !hasOwnProperty(account, "serviceAccountRef")).map(({ accountId }) => accountId);
|
|
66
76
|
collectGoogleChatAccountAssignment({
|
|
67
77
|
target: googleChat,
|
|
68
78
|
path: "channels.googlechat",
|
|
69
79
|
defaults: params.defaults,
|
|
70
80
|
context: params.context,
|
|
71
|
-
|
|
81
|
+
ownerAccountIds: topLevelServiceAccountOwners,
|
|
72
82
|
inactiveReason: "no enabled account inherits this top-level Google Chat serviceAccount."
|
|
73
83
|
});
|
|
74
84
|
if (!surface.hasExplicitAccounts) return;
|
|
@@ -79,7 +89,7 @@ function collectRuntimeConfigAssignments(params) {
|
|
|
79
89
|
path: `channels.googlechat.accounts.${accountId}`,
|
|
80
90
|
defaults: params.defaults,
|
|
81
91
|
context: params.context,
|
|
82
|
-
|
|
92
|
+
ownerAccountIds: enabled ? [accountId] : [],
|
|
83
93
|
inactiveReason: "Google Chat account is disabled."
|
|
84
94
|
});
|
|
85
95
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-
|
|
1
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-ZFiLJ7Yn.js";
|
|
2
2
|
export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createGoogleChatPluginBase } from "./channel-base-
|
|
1
|
+
import { n as createGoogleChatPluginBase } from "./channel-base-CuSSPg6I.js";
|
|
2
2
|
//#region extensions/googlechat/src/channel.setup.ts
|
|
3
3
|
const googlechatSetupPlugin = createGoogleChatPluginBase();
|
|
4
4
|
//#endregion
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/googlechat",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/googlechat",
|
|
9
|
-
"version": "2026.7.2-beta.
|
|
9
|
+
"version": "2026.7.2-beta.3",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"google-auth-library": "10.9.0",
|
|
12
12
|
"zod": "4.4.3"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"openclaw": ">=2026.7.2-beta.
|
|
15
|
+
"openclaw": ">=2026.7.2-beta.3"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"openclaw": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/googlechat",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.3",
|
|
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.4.3"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"openclaw": ">=2026.7.2-beta.
|
|
15
|
+
"openclaw": ">=2026.7.2-beta.3"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"openclaw": {
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
"minHostVersion": ">=2026.4.10"
|
|
71
71
|
},
|
|
72
72
|
"compat": {
|
|
73
|
-
"pluginApi": ">=2026.7.2-beta.
|
|
73
|
+
"pluginApi": ">=2026.7.2-beta.3"
|
|
74
74
|
},
|
|
75
75
|
"build": {
|
|
76
|
-
"openclawVersion": "2026.7.2-beta.
|
|
76
|
+
"openclawVersion": "2026.7.2-beta.3"
|
|
77
77
|
},
|
|
78
78
|
"release": {
|
|
79
79
|
"publishToClawHub": true,
|