@openclaw/googlechat 2026.9.2 → 2026.9.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-6QiB4LOV.js → actions-MrZw34qF.js} +2 -2
- package/dist/api.js +1 -1
- package/dist/{approval-auth-CEu4-wG6.js → approval-auth-B3UhTpE1.js} +1 -1
- package/dist/{approval-handler.runtime-BlNZVfJD.js → approval-handler.runtime-BcfsJERr.js} +7 -9
- package/dist/{channel-C_PzX4pt.js → channel-C-lifj0n.js} +6 -6
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.adapters-CQxQqwUQ.js → channel.adapters-BjvJ28vf.js} +12 -56
- package/dist/{channel.runtime-DBXW-pey.js → channel.runtime-tG5WjXlo.js} +14 -28
- package/dist/directory-contract-api.js +1 -1
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as resolveGoogleChatAccount } from "./channel-base-B3EzcV7X.js";
|
|
2
|
-
import { g as resolveGoogleChatOutboundSpace, x as sendGoogleChatMessage } from "./channel.adapters-
|
|
3
|
-
import { n as describeGoogleChatMessageTool } from "./channel-
|
|
2
|
+
import { g as resolveGoogleChatOutboundSpace, x as sendGoogleChatMessage } from "./channel.adapters-BjvJ28vf.js";
|
|
3
|
+
import { n as describeGoogleChatMessageTool } from "./channel-C-lifj0n.js";
|
|
4
4
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
5
5
|
import { jsonResult, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/channel-actions";
|
|
6
6
|
//#region extensions/googlechat/src/actions.ts
|
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as googlechatSetupAdapter, i as googlechatSetupWizard } from "./channel-base-B3EzcV7X.js";
|
|
2
|
-
import { t as googlechatPlugin } from "./channel-
|
|
2
|
+
import { t as googlechatPlugin } from "./channel-C-lifj0n.js";
|
|
3
3
|
export { googlechatPlugin, googlechatSetupAdapter, googlechatSetupWizard };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as resolveGoogleChatAccount } from "./channel-base-B3EzcV7X.js";
|
|
2
|
-
import { m as normalizeGoogleChatTarget, p as isGoogleChatUserTarget } from "./channel.adapters-
|
|
2
|
+
import { m as normalizeGoogleChatTarget, p as isGoogleChatUserTarget } from "./channel.adapters-BjvJ28vf.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,10 +1,11 @@
|
|
|
1
1
|
import { l as resolveGoogleChatAccount } from "./channel-base-B3EzcV7X.js";
|
|
2
|
-
import {
|
|
3
|
-
import { i as shouldHandleGoogleChatNativeApprovalRequest, r as isGoogleChatNativeApprovalClientEnabled } from "./channel-
|
|
2
|
+
import { A as unregisterGoogleChatManualApprovalFollowupSuppression, E as googleChatApprovalControls, O as registerGoogleChatApprovalCardBinding, S as updateGoogleChatMessage, T as buildGoogleChatApprovalActionParameters, g as resolveGoogleChatOutboundSpace, k as registerGoogleChatManualApprovalFollowupSuppression, w as GOOGLECHAT_APPROVAL_ACTION, x as sendGoogleChatMessage } from "./channel.adapters-BjvJ28vf.js";
|
|
3
|
+
import { i as shouldHandleGoogleChatNativeApprovalRequest, r as isGoogleChatNativeApprovalClientEnabled } from "./channel-C-lifj0n.js";
|
|
4
4
|
import { t as escapeGoogleChatApprovalCardText } from "./approval-card-text-ChngxXdJ.js";
|
|
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 { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
8
|
+
import { formatChannelApprovalResolvedLabel } from "openclaw/plugin-sdk/approval-runtime";
|
|
8
9
|
import { createChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-runtime";
|
|
9
10
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
10
11
|
//#region extensions/googlechat/src/approval-handler.runtime.ts
|
|
@@ -25,9 +26,6 @@ function truncateText(text, maxChars = MAX_TEXT_PARAGRAPH_CHARS) {
|
|
|
25
26
|
function buildMetadataText(metadata) {
|
|
26
27
|
return metadata.map((item) => `<b>${escapeGoogleChatApprovalCardText(item.label)}:</b> ${escapeGoogleChatApprovalCardText(item.value)}`).join("<br>");
|
|
27
28
|
}
|
|
28
|
-
function formatDecision(decision) {
|
|
29
|
-
return decision === "allow-once" ? "Allowed once" : decision === "allow-always" ? "Allowed always" : "Denied";
|
|
30
|
-
}
|
|
31
29
|
function buildMainTextWidget(text) {
|
|
32
30
|
return { textParagraph: { text: escapeGoogleChatApprovalCardText(truncateText(text)) } };
|
|
33
31
|
}
|
|
@@ -71,7 +69,7 @@ function buildMetadataSection(view) {
|
|
|
71
69
|
function buildActionSection(params) {
|
|
72
70
|
const { actionFunction, view } = params;
|
|
73
71
|
const actionTokens = view.actions.map((action) => ({
|
|
74
|
-
token:
|
|
72
|
+
token: googleChatApprovalControls.createToken(),
|
|
75
73
|
decision: action.decision
|
|
76
74
|
}));
|
|
77
75
|
return {
|
|
@@ -131,7 +129,7 @@ function resolveApprovalActionFunction(params) {
|
|
|
131
129
|
}
|
|
132
130
|
function buildResolvedPayload(view) {
|
|
133
131
|
const resolvedBy = normalizeOptionalString(view.resolvedBy);
|
|
134
|
-
const decisionLabel =
|
|
132
|
+
const decisionLabel = formatChannelApprovalResolvedLabel(view);
|
|
135
133
|
return { cardsV2: [{
|
|
136
134
|
cardId: GOOGLECHAT_APPROVAL_CARD_ID,
|
|
137
135
|
card: {
|
|
@@ -273,10 +271,10 @@ const googleChatApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapte
|
|
|
273
271
|
return tokens.length > 0 ? tokens : null;
|
|
274
272
|
},
|
|
275
273
|
unbindPending: ({ binding }) => {
|
|
276
|
-
|
|
274
|
+
googleChatApprovalControls.unregister(binding);
|
|
277
275
|
},
|
|
278
276
|
cancelDelivered: ({ entry }) => {
|
|
279
|
-
|
|
277
|
+
googleChatApprovalControls.unregister(entry.actionTokens.map((actionToken) => actionToken.token));
|
|
280
278
|
}
|
|
281
279
|
},
|
|
282
280
|
observe: { onDeliveryError: ({ error, request }) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as resolveDefaultGoogleChatAccountId, l as resolveGoogleChatAccount, n as createGoogleChatPluginBase, o as inspectGoogleChatAccount, s as listGoogleChatAccountIds, t as GOOGLECHAT_CHANNEL_ID } from "./channel-base-B3EzcV7X.js";
|
|
2
|
-
import { a as googlechatPairingTextAdapter, f as isGoogleChatSpaceTarget, h as resolveGoogleChatOutboundSessionRoute, i as googlechatOutboundAdapter, m as normalizeGoogleChatTarget, n as googlechatGroupsAdapter, o as googlechatSecurityAdapter, p as isGoogleChatUserTarget, r as googlechatMessageAdapter, s as googlechatThreadingAdapter, t as googlechatDirectoryAdapter } from "./channel.adapters-
|
|
2
|
+
import { a as googlechatPairingTextAdapter, f as isGoogleChatSpaceTarget, h as resolveGoogleChatOutboundSessionRoute, i as googlechatOutboundAdapter, m as normalizeGoogleChatTarget, n as googlechatGroupsAdapter, o as googlechatSecurityAdapter, p as isGoogleChatUserTarget, r as googlechatMessageAdapter, s as googlechatThreadingAdapter, t as googlechatDirectoryAdapter } from "./channel.adapters-BjvJ28vf.js";
|
|
3
3
|
import { n as buildChannelConfigSchema, t as GoogleChatConfigSchema } from "./config-api-CsD0IFxF.js";
|
|
4
4
|
import { t as DEFAULT_ACCOUNT_ID } from "./runtime-api-Dh0CNVS4.js";
|
|
5
|
-
import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-
|
|
5
|
+
import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-B3UhTpE1.js";
|
|
6
6
|
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BLvSmTXT.js";
|
|
7
7
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DmWM0kwM.js";
|
|
8
8
|
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
@@ -148,7 +148,7 @@ const googleChatApprovalCapability = createApproverRestrictedNativeApprovalCapab
|
|
|
148
148
|
approvalKind,
|
|
149
149
|
request
|
|
150
150
|
}),
|
|
151
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
151
|
+
load: async () => (await import("./approval-handler.runtime-BcfsJERr.js")).googleChatApprovalNativeRuntime
|
|
152
152
|
})
|
|
153
153
|
});
|
|
154
154
|
//#endregion
|
|
@@ -172,7 +172,7 @@ const collectGoogleChatMutableAllowlistWarnings = createDangerousNameMatchingMut
|
|
|
172
172
|
});
|
|
173
173
|
//#endregion
|
|
174
174
|
//#region extensions/googlechat/src/gateway.ts
|
|
175
|
-
const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
175
|
+
const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-tG5WjXlo.js"), "googleChatChannelRuntime");
|
|
176
176
|
const UNRESOLVED_WEBHOOK_URL_ERROR = "Invalid webhookUrl: expected an absolute URL such as https://chat.example.com/googlechat. No inbound webhook route was registered.";
|
|
177
177
|
async function startGoogleChatGatewayAccount(ctx) {
|
|
178
178
|
const account = ctx.account;
|
|
@@ -250,13 +250,13 @@ function describeGoogleChatMessageTool({ cfg, accountId }) {
|
|
|
250
250
|
}
|
|
251
251
|
//#endregion
|
|
252
252
|
//#region extensions/googlechat/src/channel.ts
|
|
253
|
-
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
253
|
+
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-tG5WjXlo.js"), "googleChatChannelRuntime");
|
|
254
254
|
const googlechatActions = {
|
|
255
255
|
describeMessageTool: describeGoogleChatMessageTool,
|
|
256
256
|
supportsAction: ({ action }) => action === "send",
|
|
257
257
|
extractToolSend: ({ args }) => extractToolSend(args, "sendMessage"),
|
|
258
258
|
handleAction: async (ctx) => {
|
|
259
|
-
const { googlechatMessageActions } = await import("./actions-
|
|
259
|
+
const { googlechatMessageActions } = await import("./actions-MrZw34qF.js");
|
|
260
260
|
if (!googlechatMessageActions.handleAction) throw new Error("Google Chat actions are not available.");
|
|
261
261
|
return await googlechatMessageActions.handleAction(ctx);
|
|
262
262
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as googlechatPlugin } from "./channel-
|
|
1
|
+
import { t as googlechatPlugin } from "./channel-C-lifj0n.js";
|
|
2
2
|
export { googlechatPlugin };
|
|
@@ -10,7 +10,7 @@ import { MediaFetchError, parseMediaContentLength, readResponseTextSnippet } fro
|
|
|
10
10
|
import { readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
|
|
11
11
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
12
12
|
import { buildHostnameAllowlistPolicyFromSuffixAllowlist, fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
13
|
-
import
|
|
13
|
+
import { createNativeApprovalControlRegistry } from "openclaw/plugin-sdk/approval-runtime";
|
|
14
14
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
15
15
|
import { createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, sanitizeForPlainText } from "openclaw/plugin-sdk/channel-outbound";
|
|
16
16
|
import { FormatCapabilityProfile, markdownToIR, renderMarkdownIRChunksWithinLimit, renderMarkdownWithMarkers, sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
@@ -25,14 +25,12 @@ const GOOGLECHAT_APPROVAL_ACTION_PARAM = "openclaw_action";
|
|
|
25
25
|
const GOOGLECHAT_APPROVAL_TOKEN_PARAM = "token";
|
|
26
26
|
const GOOGLECHAT_APPROVAL_ACTION_VALUE = "approval";
|
|
27
27
|
const MANUAL_EXEC_APPROVAL_COMMAND_RE = /(?:^|[\s`])\/approve[ \t]+([^ \t\r\n`|]+)[ \t]+(allow-once|allow-always|deny)(?=$|[\s`|.,;:!?])/giu;
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const googleChatApprovalControls = createNativeApprovalControlRegistry({
|
|
29
|
+
releaseClaimOnLookupExpiry: false,
|
|
30
|
+
onComplete: (binding) => unregisterGoogleChatManualApprovalFollowupSuppression(binding.approvalId)
|
|
31
|
+
});
|
|
31
32
|
const GOOGLECHAT_MANUAL_APPROVAL_SUPPRESSION_MAX_ENTRIES = 1024;
|
|
32
33
|
const manualApprovalFollowupSuppressions = /* @__PURE__ */ new Map();
|
|
33
|
-
function createGoogleChatApprovalToken() {
|
|
34
|
-
return crypto.randomBytes(18).toString("base64url");
|
|
35
|
-
}
|
|
36
34
|
function buildGoogleChatApprovalActionParameters(token) {
|
|
37
35
|
return [{
|
|
38
36
|
key: GOOGLECHAT_APPROVAL_ACTION_PARAM,
|
|
@@ -57,10 +55,7 @@ function readGoogleChatApprovalActionToken(event) {
|
|
|
57
55
|
return normalizeOptionalString(params[GOOGLECHAT_APPROVAL_TOKEN_PARAM]) ?? null;
|
|
58
56
|
}
|
|
59
57
|
function registerGoogleChatApprovalCardBinding(binding) {
|
|
60
|
-
if (
|
|
61
|
-
if (approvalCardBindings.has(binding.token)) approvalCardBindings.delete(binding.token);
|
|
62
|
-
approvalCardBindings.set(binding.token, binding);
|
|
63
|
-
pruneMapToMaxSize(approvalCardBindings, GOOGLECHAT_APPROVAL_CARD_BINDING_MAX_ENTRIES);
|
|
58
|
+
if (!googleChatApprovalControls.register(binding)) return false;
|
|
64
59
|
registerGoogleChatManualApprovalFollowupSuppression({
|
|
65
60
|
approvalId: binding.approvalId,
|
|
66
61
|
approvalKind: binding.approvalKind,
|
|
@@ -69,15 +64,6 @@ function registerGoogleChatApprovalCardBinding(binding) {
|
|
|
69
64
|
});
|
|
70
65
|
return true;
|
|
71
66
|
}
|
|
72
|
-
function getGoogleChatApprovalCardBinding(token) {
|
|
73
|
-
const binding = approvalCardBindings.get(token);
|
|
74
|
-
if (!binding) return null;
|
|
75
|
-
if (binding.expiresAtMs <= Date.now()) {
|
|
76
|
-
approvalCardBindings.delete(token);
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
return binding;
|
|
80
|
-
}
|
|
81
67
|
function normalizeApprovalRef(value) {
|
|
82
68
|
const normalized = value.trim().toLowerCase();
|
|
83
69
|
return normalized ? normalized : null;
|
|
@@ -105,15 +91,12 @@ function approvalRefMatches(bindingApprovalId, approvalRef) {
|
|
|
105
91
|
return normalizedRef === normalizedBindingId || normalizedRef.length >= 8 && normalizedBindingId.startsWith(normalizedRef);
|
|
106
92
|
}
|
|
107
93
|
function pruneExpiredGoogleChatApprovalCardBindings(nowMs) {
|
|
108
|
-
|
|
109
|
-
approvalCardBindings.delete(token);
|
|
110
|
-
approvalCardResolvingTokens.delete(token);
|
|
111
|
-
}
|
|
94
|
+
googleChatApprovalControls.pruneExpired(nowMs);
|
|
112
95
|
for (const [approvalId, suppression] of manualApprovalFollowupSuppressions) if (suppression.expiresAtMs <= nowMs) manualApprovalFollowupSuppressions.delete(approvalId);
|
|
113
96
|
}
|
|
114
97
|
function hasActiveGoogleChatExecApprovalCardForManualCommand(params) {
|
|
115
98
|
pruneExpiredGoogleChatApprovalCardBindings(params.nowMs);
|
|
116
|
-
for (const binding of
|
|
99
|
+
for (const binding of googleChatApprovalControls.values()) if (binding.approvalKind === "exec" && binding.allowedDecisions.includes(params.decision) && approvalRefMatches(binding.approvalId, params.approvalRef)) return true;
|
|
117
100
|
for (const suppression of manualApprovalFollowupSuppressions.values()) if (suppression.approvalKind === "exec" && suppression.allowedDecisions.includes(params.decision) && approvalRefMatches(suppression.approvalId, params.approvalRef)) return true;
|
|
118
101
|
return false;
|
|
119
102
|
}
|
|
@@ -140,33 +123,6 @@ function shouldSuppressGoogleChatManualExecApprovalFollowupPayload(payload, nowM
|
|
|
140
123
|
if (!text || hasStructuredPayloadPart(payload)) return false;
|
|
141
124
|
return shouldSuppressGoogleChatManualExecApprovalFollowupText(text, nowMs);
|
|
142
125
|
}
|
|
143
|
-
function claimGoogleChatApprovalCardBinding(token) {
|
|
144
|
-
const binding = getGoogleChatApprovalCardBinding(token);
|
|
145
|
-
if (!binding) return { kind: "missing" };
|
|
146
|
-
if (approvalCardResolvingTokens.has(token)) return { kind: "in-flight" };
|
|
147
|
-
approvalCardResolvingTokens.add(token);
|
|
148
|
-
return {
|
|
149
|
-
kind: "claimed",
|
|
150
|
-
binding
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
function completeGoogleChatApprovalCardBinding(token) {
|
|
154
|
-
const binding = approvalCardBindings.get(token);
|
|
155
|
-
approvalCardResolvingTokens.delete(token);
|
|
156
|
-
approvalCardBindings.delete(token);
|
|
157
|
-
if (binding) unregisterGoogleChatManualApprovalFollowupSuppression(binding.approvalId);
|
|
158
|
-
}
|
|
159
|
-
function releaseGoogleChatApprovalCardBinding(token) {
|
|
160
|
-
approvalCardResolvingTokens.delete(token);
|
|
161
|
-
}
|
|
162
|
-
function unregisterGoogleChatApprovalCardBindings(tokens) {
|
|
163
|
-
for (const token of tokens) {
|
|
164
|
-
const binding = approvalCardBindings.get(token);
|
|
165
|
-
approvalCardBindings.delete(token);
|
|
166
|
-
approvalCardResolvingTokens.delete(token);
|
|
167
|
-
if (binding) unregisterGoogleChatManualApprovalFollowupSuppression(binding.approvalId);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
126
|
//#endregion
|
|
171
127
|
//#region extensions/googlechat/src/google-auth.runtime.ts
|
|
172
128
|
const GOOGLE_AUTH_POLICY = buildHostnameAllowlistPolicyFromSuffixAllowlist(["accounts.google.com", "googleapis.com"]);
|
|
@@ -942,7 +898,7 @@ function sanitizeGoogleChatText(text) {
|
|
|
942
898
|
return sanitizeForPlainText(sanitizeAssistantVisibleText(text), { style: "markdown" });
|
|
943
899
|
}
|
|
944
900
|
function projectDecodedGoogleChatResources(ir) {
|
|
945
|
-
const characters = ir.text.split("");
|
|
901
|
+
const characters = ir.text.includes("<") ? ir.text.split("") : [];
|
|
946
902
|
let changed = false;
|
|
947
903
|
for (const match of ir.text.matchAll(/<(?:users|customEmojis)\/[^<>\s]+>/giu)) {
|
|
948
904
|
const start = match.index ?? 0;
|
|
@@ -956,7 +912,7 @@ function projectDecodedGoogleChatResources(ir) {
|
|
|
956
912
|
} : ir;
|
|
957
913
|
}
|
|
958
914
|
function projectGoogleChatLinkLabels(ir) {
|
|
959
|
-
const characters = ir.text.split("");
|
|
915
|
+
const characters = ir.links.length > 0 ? ir.text.split("") : [];
|
|
960
916
|
let changed = false;
|
|
961
917
|
for (const link of ir.links) {
|
|
962
918
|
const label = ir.text.slice(link.start, link.end);
|
|
@@ -1217,7 +1173,7 @@ const googleChatIngressIdentity = defineStableChannelIngressIdentity({
|
|
|
1217
1173
|
});
|
|
1218
1174
|
//#endregion
|
|
1219
1175
|
//#region extensions/googlechat/src/channel.adapters.ts
|
|
1220
|
-
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
1176
|
+
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-tG5WjXlo.js"), "googleChatChannelRuntime");
|
|
1221
1177
|
function createGoogleChatSendReceipt(params) {
|
|
1222
1178
|
const messageId = params.messageId?.trim();
|
|
1223
1179
|
return createMessageReceiptFromOutboundResults({
|
|
@@ -1389,4 +1345,4 @@ const googlechatMessageAdapter = defineChannelMessageAdapter({
|
|
|
1389
1345
|
send: { text: googlechatOutboundAdapter.attachedResults.sendText }
|
|
1390
1346
|
});
|
|
1391
1347
|
//#endregion
|
|
1392
|
-
export {
|
|
1348
|
+
export { unregisterGoogleChatManualApprovalFollowupSuppression as A, verifyGoogleChatRequest as C, readGoogleChatApprovalActionToken as D, googleChatApprovalControls as E, registerGoogleChatApprovalCardBinding as O, updateGoogleChatMessage as S, buildGoogleChatApprovalActionParameters as T, GoogleChatApiError as _, googlechatPairingTextAdapter as a, probeGoogleChat as b, googleChatIngressIdentity as c, isGoogleChatGroupSpace as d, isGoogleChatSpaceTarget as f, resolveGoogleChatOutboundSpace as g, resolveGoogleChatOutboundSessionRoute as h, googlechatOutboundAdapter as i, registerGoogleChatManualApprovalFollowupSuppression as k, normalizeGoogleChatUserId as l, normalizeGoogleChatTarget as m, googlechatGroupsAdapter as n, googlechatSecurityAdapter as o, isGoogleChatUserTarget as p, googlechatMessageAdapter as r, googlechatThreadingAdapter as s, googlechatDirectoryAdapter as t, buildGoogleChatGroupPolicyScope as u, deleteGoogleChatMessage as v, GOOGLECHAT_APPROVAL_ACTION as w, sendGoogleChatMessage as x, downloadGoogleChatMedia as y };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as verifyGoogleChatRequest, D as readGoogleChatApprovalActionToken, E as googleChatApprovalControls, S as updateGoogleChatMessage, _ as GoogleChatApiError, b as probeGoogleChat, c as googleChatIngressIdentity, d as isGoogleChatGroupSpace, l as normalizeGoogleChatUserId, u as buildGoogleChatGroupPolicyScope, v as deleteGoogleChatMessage, x as sendGoogleChatMessage, y as downloadGoogleChatMedia } from "./channel.adapters-BjvJ28vf.js";
|
|
2
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-
|
|
3
|
+
import { n as googleChatApprovalAuth } from "./approval-auth-B3UhTpE1.js";
|
|
4
4
|
import { t as escapeGoogleChatApprovalCardText } from "./approval-card-text-ChngxXdJ.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
7
7
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
8
|
-
import { PlatformMessageNotDispatchedError, collectErrorGraphCandidates, formatErrorMessage
|
|
8
|
+
import { PlatformMessageNotDispatchedError, collectErrorGraphCandidates, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
9
9
|
import { MediaFetchError } from "openclaw/plugin-sdk/media-runtime";
|
|
10
10
|
import { createChannelIngressError } from "openclaw/plugin-sdk/channel-outbound";
|
|
11
11
|
import { createChannelPartialDeliveryError, formatInboundMediaUnavailableText, recordChannelBotPairLoopAndCheckSuppression, resolveChannelInboundRouteEnvelope, toInboundMediaFactsWithMetadata } from "openclaw/plugin-sdk/channel-inbound";
|
|
@@ -81,7 +81,7 @@ async function maybeHandleGoogleChatApprovalCardClick(params) {
|
|
|
81
81
|
if ((params.event.type ?? params.event.eventType) !== "CARD_CLICKED") return false;
|
|
82
82
|
const token = readGoogleChatApprovalActionToken(params.event);
|
|
83
83
|
if (!token) return false;
|
|
84
|
-
const binding =
|
|
84
|
+
const binding = googleChatApprovalControls.get(token);
|
|
85
85
|
if (!binding) {
|
|
86
86
|
logIgnored(params.target, "unknown or expired card token");
|
|
87
87
|
return true;
|
|
@@ -113,19 +113,8 @@ async function maybeHandleGoogleChatApprovalCardClick(params) {
|
|
|
113
113
|
logIgnored(params.target, `unauthorized actor ${actor || "unknown"}`);
|
|
114
114
|
return true;
|
|
115
115
|
}
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
logIgnored(params.target, "card token already consumed");
|
|
119
|
-
return true;
|
|
120
|
-
}
|
|
121
|
-
if (claim.kind === "in-flight") {
|
|
122
|
-
logIgnored(params.target, "card token resolve already in flight");
|
|
123
|
-
return true;
|
|
124
|
-
}
|
|
125
|
-
const consumed = claim.binding;
|
|
126
|
-
let result;
|
|
127
|
-
try {
|
|
128
|
-
result = await resolveApprovalOverGateway({
|
|
116
|
+
const outcome = await googleChatApprovalControls.settle(token, async (consumed) => {
|
|
117
|
+
const result = await resolveApprovalOverGateway({
|
|
129
118
|
cfg: params.target.config,
|
|
130
119
|
approvalId: consumed.approvalId,
|
|
131
120
|
approvalKind: consumed.approvalKind,
|
|
@@ -139,19 +128,16 @@ async function maybeHandleGoogleChatApprovalCardClick(params) {
|
|
|
139
128
|
messageName: consumed.messageName,
|
|
140
129
|
cardsV2: buildGoogleChatCanonicalApprovalTerminalCards(result)
|
|
141
130
|
});
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
releaseGoogleChatApprovalCardBinding(token);
|
|
149
|
-
throw error;
|
|
131
|
+
return result;
|
|
132
|
+
});
|
|
133
|
+
if (outcome.kind !== "settled") {
|
|
134
|
+
logIgnored(params.target, outcome.kind === "missing" ? "card token already consumed" : outcome.kind === "in-flight" ? "card token resolve already in flight" : `approval expired or no longer exists id=${outcome.binding.approvalId}`);
|
|
135
|
+
return true;
|
|
150
136
|
}
|
|
151
|
-
|
|
152
|
-
const
|
|
137
|
+
const { binding: consumed, result } = outcome;
|
|
138
|
+
const label = result.applied ? "resolved" : "already resolved";
|
|
153
139
|
const decision = "decision" in result.approval ? result.approval.decision : "none";
|
|
154
|
-
params.target.runtime.log?.(`[${params.target.account.accountId}] googlechat approval ${
|
|
140
|
+
params.target.runtime.log?.(`[${params.target.account.accountId}] googlechat approval ${label} id=${consumed.approvalId} status=${result.approval.status} decision=${decision} sender=${actor || "unknown"}`);
|
|
155
141
|
return true;
|
|
156
142
|
}
|
|
157
143
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as googlechatDirectoryAdapter } from "./channel.adapters-
|
|
1
|
+
import { t as googlechatDirectoryAdapter } from "./channel.adapters-BjvJ28vf.js";
|
|
2
2
|
//#region extensions/googlechat/directory-contract-api.ts
|
|
3
3
|
const googlechatDirectoryContractPlugin = {
|
|
4
4
|
id: "googlechat",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/googlechat",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.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.9.
|
|
15
|
+
"openclaw": ">=2026.9.3"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"openclaw": {
|
|
@@ -134,10 +134,10 @@
|
|
|
134
134
|
"minHostVersion": ">=2026.4.10"
|
|
135
135
|
},
|
|
136
136
|
"compat": {
|
|
137
|
-
"pluginApi": ">=2026.9.
|
|
137
|
+
"pluginApi": ">=2026.9.3"
|
|
138
138
|
},
|
|
139
139
|
"build": {
|
|
140
|
-
"openclawVersion": "2026.9.
|
|
140
|
+
"openclawVersion": "2026.9.3"
|
|
141
141
|
},
|
|
142
142
|
"release": {
|
|
143
143
|
"publishToClawHub": true,
|