@openclaw/googlechat 2026.9.1-beta.1 → 2026.9.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/{actions-DUdoL8WV.js → actions-6QiB4LOV.js} +10 -9
- package/dist/api.js +2 -2
- package/dist/{approval-auth-Pxi5Q60c.js → approval-auth-CEu4-wG6.js} +2 -2
- package/dist/approval-card-text-ChngxXdJ.js +6 -0
- package/dist/{approval-handler.runtime-Bhm1R0FC.js → approval-handler.runtime-BlNZVfJD.js} +24 -13
- package/dist/{channel-D2PMvPgX.js → channel-C_PzX4pt.js} +44 -35
- package/dist/{channel-base-BpHXDsur.js → channel-base-B3EzcV7X.js} +35 -23
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.adapters-aCFAB5lK.js → channel.adapters-CQxQqwUQ.js} +58 -25
- package/dist/{channel.runtime-CDUYuYp7.js → channel.runtime-DBXW-pey.js} +35 -53
- package/dist/directory-contract-api.js +1 -1
- package/dist/{secret-contract-BFYyuE0F.js → secret-contract-DmWM0kwM.js} +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/build/src/index.js +59 -40
- package/node_modules/google-auth-library/node_modules/gcp-metadata/build/src/index.js.map +1 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/package.json +20 -23
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/colours.d.ts +1 -29
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/colours.js +13 -13
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/colours.js.map +1 -1
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/index.d.ts +1 -0
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/index.js +1 -1
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/index.js.map +1 -1
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/logging-utils.d.ts +2 -135
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/logging-utils.js +35 -58
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/logging-utils.js.map +1 -1
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/temporal.js +8 -8
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/temporal.js.map +1 -1
- package/node_modules/google-auth-library/node_modules/google-logging-utils/package.json +16 -14
- package/node_modules/google-auth-library/package.json +7 -7
- package/openclaw.plugin.json +0 -5
- package/package.json +5 -5
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/LICENSE +0 -202
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/README.md +0 -73
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/colours.d.ts +0 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/colours.js +0 -81
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/colours.js.map +0 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/index.d.ts +0 -2
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/index.js +0 -31
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/index.js.map +0 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/logging-utils.d.ts +0 -89
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/logging-utils.js +0 -414
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/logging-utils.js.map +0 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/temporal.d.ts +0 -45
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/temporal.js +0 -68
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/temporal.js.map +0 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/package.json +0 -47
- /package/node_modules/google-auth-library/node_modules/{gcp-metadata/node_modules/google-logging-utils → google-logging-utils}/build/src/types.d.ts +0 -0
- /package/node_modules/google-auth-library/node_modules/{gcp-metadata/node_modules/google-logging-utils → google-logging-utils}/build/src/types.js +0 -0
- /package/node_modules/google-auth-library/node_modules/{gcp-metadata/node_modules/google-logging-utils → google-logging-utils}/build/src/types.js.map +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount } from "./channel-base-
|
|
2
|
-
import {
|
|
3
|
-
import { n as describeGoogleChatMessageTool } from "./channel-
|
|
1
|
+
import { l as resolveGoogleChatAccount } from "./channel-base-B3EzcV7X.js";
|
|
2
|
+
import { g as resolveGoogleChatOutboundSpace, x as sendGoogleChatMessage } from "./channel.adapters-CQxQqwUQ.js";
|
|
3
|
+
import { n as describeGoogleChatMessageTool } from "./channel-C_PzX4pt.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
|
|
@@ -50,15 +50,16 @@ const googlechatMessageActions = {
|
|
|
50
50
|
account,
|
|
51
51
|
target: to
|
|
52
52
|
});
|
|
53
|
+
const sent = await sendGoogleChatMessage({
|
|
54
|
+
account,
|
|
55
|
+
space,
|
|
56
|
+
text: content,
|
|
57
|
+
thread: threadId ?? void 0
|
|
58
|
+
});
|
|
53
59
|
return jsonResult({
|
|
54
60
|
ok: true,
|
|
55
61
|
to: space,
|
|
56
|
-
...
|
|
57
|
-
account,
|
|
58
|
-
space,
|
|
59
|
-
text: content,
|
|
60
|
-
thread: threadId ?? void 0
|
|
61
|
-
})
|
|
62
|
+
...sent
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
65
|
throw new Error(`Action ${action} is not supported for provider ${providerId}.`);
|
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-B3EzcV7X.js";
|
|
2
|
+
import { t as googlechatPlugin } from "./channel-C_PzX4pt.js";
|
|
3
3
|
export { googlechatPlugin, googlechatSetupAdapter, googlechatSetupWizard };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount } from "./channel-base-
|
|
2
|
-
import {
|
|
1
|
+
import { l as resolveGoogleChatAccount } from "./channel-base-B3EzcV7X.js";
|
|
2
|
+
import { m as normalizeGoogleChatTarget, p as isGoogleChatUserTarget } from "./channel.adapters-CQxQqwUQ.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,7 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount } from "./channel-base-
|
|
2
|
-
import {
|
|
3
|
-
import { i as shouldHandleGoogleChatNativeApprovalRequest, r as isGoogleChatNativeApprovalClientEnabled } from "./channel-
|
|
1
|
+
import { l as resolveGoogleChatAccount } from "./channel-base-B3EzcV7X.js";
|
|
2
|
+
import { F as unregisterGoogleChatManualApprovalFollowupSuppression, M as registerGoogleChatManualApprovalFollowupSuppression, O as createGoogleChatApprovalToken, P as unregisterGoogleChatApprovalCardBindings, S as updateGoogleChatMessage, T as buildGoogleChatApprovalActionParameters, g as resolveGoogleChatOutboundSpace, j as registerGoogleChatApprovalCardBinding, w as GOOGLECHAT_APPROVAL_ACTION, x as sendGoogleChatMessage } from "./channel.adapters-CQxQqwUQ.js";
|
|
3
|
+
import { i as shouldHandleGoogleChatNativeApprovalRequest, r as isGoogleChatNativeApprovalClientEnabled } from "./channel-C_PzX4pt.js";
|
|
4
|
+
import { t as escapeGoogleChatApprovalCardText } from "./approval-card-text-ChngxXdJ.js";
|
|
4
5
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
5
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
7
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -18,20 +19,17 @@ function resolveHandlerAccount(params) {
|
|
|
18
19
|
if (!account.enabled || account.credentialSource === "none" || account.tokenStatus === "configured_unavailable") return null;
|
|
19
20
|
return account;
|
|
20
21
|
}
|
|
21
|
-
function escapeGoogleChatText(text) {
|
|
22
|
-
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
23
|
-
}
|
|
24
22
|
function truncateText(text, maxChars = MAX_TEXT_PARAGRAPH_CHARS) {
|
|
25
23
|
return text.length <= maxChars ? text : `${truncateUtf16Safe(text, maxChars - 3)}...`;
|
|
26
24
|
}
|
|
27
25
|
function buildMetadataText(metadata) {
|
|
28
|
-
return metadata.map((item) => `<b>${
|
|
26
|
+
return metadata.map((item) => `<b>${escapeGoogleChatApprovalCardText(item.label)}:</b> ${escapeGoogleChatApprovalCardText(item.value)}`).join("<br>");
|
|
29
27
|
}
|
|
30
28
|
function formatDecision(decision) {
|
|
31
29
|
return decision === "allow-once" ? "Allowed once" : decision === "allow-always" ? "Allowed always" : "Denied";
|
|
32
30
|
}
|
|
33
31
|
function buildMainTextWidget(text) {
|
|
34
|
-
return { textParagraph: { text:
|
|
32
|
+
return { textParagraph: { text: escapeGoogleChatApprovalCardText(truncateText(text)) } };
|
|
35
33
|
}
|
|
36
34
|
function buildHtmlTextWidget(text) {
|
|
37
35
|
return { textParagraph: { text: truncateText(text) } };
|
|
@@ -50,7 +48,14 @@ function buildPluginPendingSections(view) {
|
|
|
50
48
|
if (view.approvalKind !== "plugin") return [];
|
|
51
49
|
return [{
|
|
52
50
|
header: "Request",
|
|
53
|
-
widgets: [buildHtmlTextWidget(`<b>${
|
|
51
|
+
widgets: [buildHtmlTextWidget(`<b>${escapeGoogleChatApprovalCardText(view.title)}</b>${view.description ? `<br>${escapeGoogleChatApprovalCardText(view.description)}` : ""}`)]
|
|
52
|
+
}];
|
|
53
|
+
}
|
|
54
|
+
function buildSystemAgentPendingSections(view) {
|
|
55
|
+
if (view.approvalKind !== "system-agent") return [];
|
|
56
|
+
return [{
|
|
57
|
+
header: "Change",
|
|
58
|
+
widgets: [buildMainTextWidget(view.operationSummary)]
|
|
54
59
|
}];
|
|
55
60
|
}
|
|
56
61
|
function buildMetadataSection(view) {
|
|
@@ -91,7 +96,7 @@ function buildPendingPayload(params) {
|
|
|
91
96
|
actionFunction,
|
|
92
97
|
view
|
|
93
98
|
});
|
|
94
|
-
const title = view.approvalKind === "plugin" ? "Plugin Approval Required" : "Exec Approval Required";
|
|
99
|
+
const title = view.approvalKind === "plugin" ? "Plugin Approval Required" : view.approvalKind === "system-agent" ? "OpenClaw Change Requires Approval" : "Exec Approval Required";
|
|
95
100
|
const subtitle = `Expires in ${Math.max(0, Math.ceil((view.expiresAtMs - nowMs) / 1e3))}s`;
|
|
96
101
|
const card = {
|
|
97
102
|
cardId: GOOGLECHAT_APPROVAL_CARD_ID,
|
|
@@ -103,6 +108,7 @@ function buildPendingPayload(params) {
|
|
|
103
108
|
sections: [
|
|
104
109
|
...buildExecPendingSections(view),
|
|
105
110
|
...buildPluginPendingSections(view),
|
|
111
|
+
...buildSystemAgentPendingSections(view),
|
|
106
112
|
...buildMetadataSection(view),
|
|
107
113
|
actionSection
|
|
108
114
|
]
|
|
@@ -125,11 +131,12 @@ function resolveApprovalActionFunction(params) {
|
|
|
125
131
|
}
|
|
126
132
|
function buildResolvedPayload(view) {
|
|
127
133
|
const resolvedBy = normalizeOptionalString(view.resolvedBy);
|
|
134
|
+
const decisionLabel = view.approvalKind === "system-agent" && view.terminalStatus === "cancelled" ? "Cancelled" : view.approvalKind === "system-agent" && view.applicationStatus === "applied" ? "Applied" : view.approvalKind === "system-agent" && view.applicationStatus === "not-applied" ? "Not applied" : formatDecision(view.decision);
|
|
128
135
|
return { cardsV2: [{
|
|
129
136
|
cardId: GOOGLECHAT_APPROVAL_CARD_ID,
|
|
130
137
|
card: {
|
|
131
138
|
header: {
|
|
132
|
-
title: `${view.approvalKind === "plugin" ? "Plugin" : "Exec"} Approval: ${
|
|
139
|
+
title: `${view.approvalKind === "plugin" ? "Plugin" : view.approvalKind === "system-agent" ? "OpenClaw Change" : "Exec"} Approval: ${decisionLabel}`,
|
|
133
140
|
subtitle: resolvedBy ? `Resolved by ${resolvedBy}` : "Resolved"
|
|
134
141
|
},
|
|
135
142
|
sections: buildMetadataSection(view)
|
|
@@ -141,7 +148,7 @@ function buildExpiredPayload(view) {
|
|
|
141
148
|
cardId: GOOGLECHAT_APPROVAL_CARD_ID,
|
|
142
149
|
card: {
|
|
143
150
|
header: {
|
|
144
|
-
title: `${view.approvalKind === "plugin" ? "Plugin" : "Exec"} Approval Expired`,
|
|
151
|
+
title: `${view.approvalKind === "plugin" ? "Plugin" : view.approvalKind === "system-agent" ? "OpenClaw Change" : "Exec"} Approval Expired`,
|
|
145
152
|
subtitle: "This approval request expired before it was resolved."
|
|
146
153
|
},
|
|
147
154
|
sections: buildMetadataSection(view)
|
|
@@ -149,7 +156,11 @@ function buildExpiredPayload(view) {
|
|
|
149
156
|
}] };
|
|
150
157
|
}
|
|
151
158
|
const googleChatApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
152
|
-
eventKinds: [
|
|
159
|
+
eventKinds: [
|
|
160
|
+
"exec",
|
|
161
|
+
"plugin",
|
|
162
|
+
"system-agent"
|
|
163
|
+
],
|
|
153
164
|
availability: {
|
|
154
165
|
isConfigured: ({ cfg, accountId }) => isGoogleChatNativeApprovalClientEnabled({
|
|
155
166
|
cfg,
|
|
@@ -1,10 +1,10 @@
|
|
|
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-
|
|
2
|
-
import { a as googlechatPairingTextAdapter,
|
|
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-CQxQqwUQ.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-CEu4-wG6.js";
|
|
6
6
|
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BLvSmTXT.js";
|
|
7
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-
|
|
7
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DmWM0kwM.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";
|
|
@@ -83,6 +83,23 @@ function shouldSuppressLocalGoogleChatExecApprovalPrompt(params) {
|
|
|
83
83
|
isNativeDeliveryEnabled: isGoogleChatNativeApprovalClientEnabled
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
+
const resolveGoogleChatOriginTarget = createChannelNativeOriginTargetResolver({
|
|
87
|
+
channel: "googlechat",
|
|
88
|
+
shouldHandleRequest: shouldHandleGoogleChatNativeApprovalRequest,
|
|
89
|
+
resolveTurnSourceTarget: resolveTurnSourceGoogleChatOriginTarget,
|
|
90
|
+
resolveSessionTarget: resolveSessionGoogleChatOriginTarget
|
|
91
|
+
});
|
|
92
|
+
const resolveGoogleChatApproverDmTargets = createChannelApproverDmTargetResolver({
|
|
93
|
+
shouldHandleRequest: shouldHandleGoogleChatNativeApprovalRequest,
|
|
94
|
+
resolveApprovers: getGoogleChatApprovalApprovers,
|
|
95
|
+
mapApprover: (approver, params) => {
|
|
96
|
+
const to = normalizeGoogleChatApproverId(approver);
|
|
97
|
+
return to ? {
|
|
98
|
+
to,
|
|
99
|
+
accountId: normalizeOptionalString(params.accountId)
|
|
100
|
+
} : null;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
86
103
|
const googleChatApprovalCapability = createApproverRestrictedNativeApprovalCapability({
|
|
87
104
|
channel: "googlechat",
|
|
88
105
|
channelLabel: "Google Chat",
|
|
@@ -113,25 +130,14 @@ const googleChatApprovalCapability = createApproverRestrictedNativeApprovalCapab
|
|
|
113
130
|
resolveNativeDeliveryMode: () => "channel",
|
|
114
131
|
requireMatchingTurnSourceChannel: true,
|
|
115
132
|
resolveSuppressionAccountId: ({ target, request }) => normalizeOptionalString(target.accountId) ?? normalizeOptionalString(request.request.turnSourceAccountId),
|
|
116
|
-
resolveOriginTarget:
|
|
117
|
-
|
|
118
|
-
shouldHandleRequest: shouldHandleGoogleChatNativeApprovalRequest,
|
|
119
|
-
resolveTurnSourceTarget: resolveTurnSourceGoogleChatOriginTarget,
|
|
120
|
-
resolveSessionTarget: resolveSessionGoogleChatOriginTarget
|
|
121
|
-
}),
|
|
122
|
-
resolveApproverDmTargets: createChannelApproverDmTargetResolver({
|
|
123
|
-
shouldHandleRequest: shouldHandleGoogleChatNativeApprovalRequest,
|
|
124
|
-
resolveApprovers: getGoogleChatApprovalApprovers,
|
|
125
|
-
mapApprover: (approver, params) => {
|
|
126
|
-
const to = normalizeGoogleChatApproverId(approver);
|
|
127
|
-
return to ? {
|
|
128
|
-
to,
|
|
129
|
-
accountId: normalizeOptionalString(params.accountId)
|
|
130
|
-
} : null;
|
|
131
|
-
}
|
|
132
|
-
}),
|
|
133
|
+
resolveOriginTarget: resolveGoogleChatOriginTarget,
|
|
134
|
+
resolveApproverDmTargets: resolveGoogleChatApproverDmTargets,
|
|
133
135
|
nativeRuntime: createLazyChannelApprovalNativeRuntimeAdapter({
|
|
134
|
-
eventKinds: [
|
|
136
|
+
eventKinds: [
|
|
137
|
+
"exec",
|
|
138
|
+
"plugin",
|
|
139
|
+
"system-agent"
|
|
140
|
+
],
|
|
135
141
|
isConfigured: ({ cfg, accountId }) => isGoogleChatNativeApprovalClientEnabled({
|
|
136
142
|
cfg,
|
|
137
143
|
accountId
|
|
@@ -142,20 +148,23 @@ const googleChatApprovalCapability = createApproverRestrictedNativeApprovalCapab
|
|
|
142
148
|
approvalKind,
|
|
143
149
|
request
|
|
144
150
|
}),
|
|
145
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
151
|
+
load: async () => (await import("./approval-handler.runtime-BlNZVfJD.js")).googleChatApprovalNativeRuntime
|
|
146
152
|
})
|
|
147
153
|
});
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region extensions/googlechat/src/doctor.ts
|
|
156
|
+
const isGoogleChatMutableAllowEntry = buildMutableAllowEntryDetector({
|
|
157
|
+
prefixes: [
|
|
158
|
+
"googlechat:",
|
|
159
|
+
"google-chat:",
|
|
160
|
+
"gchat:",
|
|
161
|
+
"users/"
|
|
162
|
+
],
|
|
163
|
+
stableIdPattern: /^[^@]+$/
|
|
164
|
+
});
|
|
148
165
|
const collectGoogleChatMutableAllowlistWarnings = createDangerousNameMatchingMutableAllowlistWarningCollector({
|
|
149
166
|
channel: "googlechat",
|
|
150
|
-
detector:
|
|
151
|
-
prefixes: [
|
|
152
|
-
"googlechat:",
|
|
153
|
-
"google-chat:",
|
|
154
|
-
"gchat:",
|
|
155
|
-
"users/"
|
|
156
|
-
],
|
|
157
|
-
stableIdPattern: /^[^@]+$/
|
|
158
|
-
}),
|
|
167
|
+
detector: isGoogleChatMutableAllowEntry,
|
|
159
168
|
collectLists: (scope) => collectStandardAllowlistLists(scope, {
|
|
160
169
|
includeGroups: true,
|
|
161
170
|
groupField: "users"
|
|
@@ -163,7 +172,7 @@ const collectGoogleChatMutableAllowlistWarnings = createDangerousNameMatchingMut
|
|
|
163
172
|
});
|
|
164
173
|
//#endregion
|
|
165
174
|
//#region extensions/googlechat/src/gateway.ts
|
|
166
|
-
const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
175
|
+
const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-DBXW-pey.js"), "googleChatChannelRuntime");
|
|
167
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.";
|
|
168
177
|
async function startGoogleChatGatewayAccount(ctx) {
|
|
169
178
|
const account = ctx.account;
|
|
@@ -241,13 +250,13 @@ function describeGoogleChatMessageTool({ cfg, accountId }) {
|
|
|
241
250
|
}
|
|
242
251
|
//#endregion
|
|
243
252
|
//#region extensions/googlechat/src/channel.ts
|
|
244
|
-
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
253
|
+
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-DBXW-pey.js"), "googleChatChannelRuntime");
|
|
245
254
|
const googlechatActions = {
|
|
246
255
|
describeMessageTool: describeGoogleChatMessageTool,
|
|
247
256
|
supportsAction: ({ action }) => action === "send",
|
|
248
257
|
extractToolSend: ({ args }) => extractToolSend(args, "sendMessage"),
|
|
249
258
|
handleAction: async (ctx) => {
|
|
250
|
-
const { googlechatMessageActions } = await import("./actions-
|
|
259
|
+
const { googlechatMessageActions } = await import("./actions-6QiB4LOV.js");
|
|
251
260
|
if (!googlechatMessageActions.handleAction) throw new Error("Google Chat actions are not available.");
|
|
252
261
|
return await googlechatMessageActions.handleAction(ctx);
|
|
253
262
|
}
|
|
@@ -14,7 +14,7 @@ import { createPatchedAccountSetupAdapter, createSetupInputPresenceValidator } f
|
|
|
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
|
-
const MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES =
|
|
17
|
+
const MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES = 65536;
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region extensions/googlechat/src/accounts.ts
|
|
20
20
|
const ENV_SERVICE_ACCOUNT$1 = "GOOGLE_CHAT_SERVICE_ACCOUNT";
|
|
@@ -76,7 +76,8 @@ function resolveCredentialsFromConfig(params) {
|
|
|
76
76
|
};
|
|
77
77
|
const file = normalizeOptionalString(account.serviceAccountFile);
|
|
78
78
|
if (file) {
|
|
79
|
-
const
|
|
79
|
+
const resolvedFile = resolveUserPath(file);
|
|
80
|
+
const result = tryReadSecretFileSync(resolvedFile, "Google Chat service account file", {
|
|
80
81
|
maxBytes: MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES,
|
|
81
82
|
rejectHardlinks: false,
|
|
82
83
|
rejectSymlink: false
|
|
@@ -102,7 +103,8 @@ function resolveCredentialsFromConfig(params) {
|
|
|
102
103
|
};
|
|
103
104
|
const envFile = normalizeOptionalString(process.env[ENV_SERVICE_ACCOUNT_FILE$1]);
|
|
104
105
|
if (envFile) {
|
|
105
|
-
const
|
|
106
|
+
const resolvedEnvFile = resolveUserPath(envFile);
|
|
107
|
+
const result = tryReadSecretFileSync(resolvedEnvFile, "Google Chat service account file", {
|
|
106
108
|
maxBytes: MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES,
|
|
107
109
|
rejectHardlinks: false,
|
|
108
110
|
rejectSymlink: false
|
|
@@ -155,10 +157,22 @@ function resolveGoogleChatAccount(params) {
|
|
|
155
157
|
});
|
|
156
158
|
}
|
|
157
159
|
function inspectGoogleChatAccount(params) {
|
|
158
|
-
|
|
160
|
+
const account = resolveGoogleChatAccountWithMode({
|
|
159
161
|
...params,
|
|
160
162
|
mode: "inspect"
|
|
161
163
|
});
|
|
164
|
+
return {
|
|
165
|
+
...account,
|
|
166
|
+
configured: isGoogleChatAccountConfigured(account),
|
|
167
|
+
audienceType: account.config.audienceType,
|
|
168
|
+
audience: account.config.audience,
|
|
169
|
+
webhookPath: account.config.webhookPath,
|
|
170
|
+
webhookUrl: account.config.webhookUrl,
|
|
171
|
+
dmPolicy: account.config.dmPolicy ?? "pairing"
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function isGoogleChatAccountConfigured(account) {
|
|
175
|
+
return account.tokenStatus ? account.tokenStatus !== "missing" : account.credentialSource !== "none";
|
|
162
176
|
}
|
|
163
177
|
const googlechatSetupAdapter = createPatchedAccountSetupAdapter({
|
|
164
178
|
channelKey: "googlechat",
|
|
@@ -252,6 +266,22 @@ const ENV_SERVICE_ACCOUNT = "GOOGLE_CHAT_SERVICE_ACCOUNT";
|
|
|
252
266
|
const ENV_SERVICE_ACCOUNT_FILE = "GOOGLE_CHAT_SERVICE_ACCOUNT_FILE";
|
|
253
267
|
const USE_ENV_FLAG = "__googlechatUseEnv";
|
|
254
268
|
const AUTH_METHOD_FLAG = "__googlechatAuthMethod";
|
|
269
|
+
const promptAllowFrom = createPromptParsedAllowFromForAccount({
|
|
270
|
+
defaultAccountId: resolveDefaultGoogleChatAccountId,
|
|
271
|
+
message: t("wizard.googlechat.allowFromPrompt"),
|
|
272
|
+
placeholder: "users/123456789, name@example.com",
|
|
273
|
+
parseEntries: (raw) => ({ entries: mergeAllowFromEntries(void 0, splitSetupEntries(raw)) }),
|
|
274
|
+
getExistingAllowFrom: ({ cfg, accountId }) => resolveGoogleChatAccount({
|
|
275
|
+
cfg,
|
|
276
|
+
accountId
|
|
277
|
+
}).config.allowFrom ?? [],
|
|
278
|
+
applyAllowFrom: ({ cfg, accountId, allowFrom }) => applySetupAccountConfigPatch({
|
|
279
|
+
cfg,
|
|
280
|
+
channelKey: channel,
|
|
281
|
+
accountId,
|
|
282
|
+
patch: { allowFrom }
|
|
283
|
+
})
|
|
284
|
+
});
|
|
255
285
|
const googlechatDmPolicy = createChannelDmPolicy({
|
|
256
286
|
label: "Google Chat",
|
|
257
287
|
channel,
|
|
@@ -265,22 +295,7 @@ const googlechatDmPolicy = createChannelDmPolicy({
|
|
|
265
295
|
accountId: account.accountId,
|
|
266
296
|
patch
|
|
267
297
|
}),
|
|
268
|
-
promptAllowFrom
|
|
269
|
-
defaultAccountId: resolveDefaultGoogleChatAccountId,
|
|
270
|
-
message: t("wizard.googlechat.allowFromPrompt"),
|
|
271
|
-
placeholder: "users/123456789, name@example.com",
|
|
272
|
-
parseEntries: (raw) => ({ entries: mergeAllowFromEntries(void 0, splitSetupEntries(raw)) }),
|
|
273
|
-
getExistingAllowFrom: ({ cfg, accountId }) => resolveGoogleChatAccount({
|
|
274
|
-
cfg,
|
|
275
|
-
accountId
|
|
276
|
-
}).config.allowFrom ?? [],
|
|
277
|
-
applyAllowFrom: ({ cfg, accountId, allowFrom }) => applySetupAccountConfigPatch({
|
|
278
|
-
cfg,
|
|
279
|
-
channelKey: channel,
|
|
280
|
-
accountId,
|
|
281
|
-
patch: { allowFrom }
|
|
282
|
-
})
|
|
283
|
-
})
|
|
298
|
+
promptAllowFrom
|
|
284
299
|
});
|
|
285
300
|
function createServiceAccountTextInput(params) {
|
|
286
301
|
return {
|
|
@@ -447,9 +462,6 @@ const googleChatConfigAdapter = createScopedChannelConfigAdapter({
|
|
|
447
462
|
}),
|
|
448
463
|
resolveDefaultTo: (account) => account.config.defaultTo
|
|
449
464
|
});
|
|
450
|
-
function isGoogleChatAccountConfigured(account) {
|
|
451
|
-
return account.tokenStatus ? account.tokenStatus !== "missing" : account.credentialSource !== "none";
|
|
452
|
-
}
|
|
453
465
|
function createGoogleChatPluginBase(params = {}) {
|
|
454
466
|
return {
|
|
455
467
|
id: GOOGLECHAT_CHANNEL_ID,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as googlechatPlugin } from "./channel-
|
|
1
|
+
import { t as googlechatPlugin } from "./channel-C_PzX4pt.js";
|
|
2
2
|
export { googlechatPlugin };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount, r as formatGoogleChatAllowFromEntry, u as MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES } from "./channel-base-
|
|
1
|
+
import { l as resolveGoogleChatAccount, r as formatGoogleChatAllowFromEntry, u as MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES } from "./channel-base-B3EzcV7X.js";
|
|
2
2
|
import { d as fetchWithSsrFGuard$1, 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";
|
|
@@ -16,6 +16,7 @@ import { createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, s
|
|
|
16
16
|
import { FormatCapabilityProfile, markdownToIR, renderMarkdownIRChunksWithinLimit, renderMarkdownWithMarkers, sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
17
17
|
import fs from "node:fs/promises";
|
|
18
18
|
import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
19
|
+
import { defineStableChannelIngressIdentity, identityEntryAuthenticationClassifier } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
19
20
|
import { buildChannelGroupsScopeTree, createAllowlistProviderOpenWarningCollector, createConditionalWarningCollector, resolveScopeRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
|
20
21
|
import { createChannelDirectoryAdapter, listResolvedDirectoryGroupEntriesFromMapKeys, listResolvedDirectoryUserEntriesFromAllowFrom } from "openclaw/plugin-sdk/directory-runtime";
|
|
21
22
|
//#region extensions/googlechat/src/approval-card-actions.ts
|
|
@@ -175,7 +176,7 @@ const GOOGLE_AUTH_PROVIDER_CERTS_URL = "https://www.googleapis.com/oauth2/v1/cer
|
|
|
175
176
|
const GOOGLE_AUTH_TOKEN_URI = "https://oauth2.googleapis.com/token";
|
|
176
177
|
const GOOGLE_AUTH_UNIVERSE_DOMAIN = "googleapis.com";
|
|
177
178
|
const GOOGLE_CLIENT_CERTS_URL_PREFIX = "https://www.googleapis.com/robot/v1/metadata/x509/";
|
|
178
|
-
const MAX_GOOGLE_AUTH_RESPONSE_BYTES =
|
|
179
|
+
const MAX_GOOGLE_AUTH_RESPONSE_BYTES = 1048576;
|
|
179
180
|
let googleAuthRuntimePromise = null;
|
|
180
181
|
function normalizeGoogleAuthPreparedRequestHeaders(config) {
|
|
181
182
|
if (!(config.headers instanceof Headers)) config.headers = new Headers(config.headers);
|
|
@@ -427,15 +428,11 @@ async function readGoogleAuthResponseBytes(response) {
|
|
|
427
428
|
if (done) break;
|
|
428
429
|
if (!value) continue;
|
|
429
430
|
total += value.byteLength;
|
|
430
|
-
if (total > MAX_GOOGLE_AUTH_RESPONSE_BYTES) {
|
|
431
|
-
try {
|
|
432
|
-
await reader.cancel("Google auth response exceeded buffer limit");
|
|
433
|
-
} catch {}
|
|
434
|
-
throw new Error(`Google auth response exceeds ${MAX_GOOGLE_AUTH_RESPONSE_BYTES} bytes.`);
|
|
435
|
-
}
|
|
431
|
+
if (total > MAX_GOOGLE_AUTH_RESPONSE_BYTES) throw new Error(`Google auth response exceeds ${MAX_GOOGLE_AUTH_RESPONSE_BYTES} bytes.`);
|
|
436
432
|
chunks.push(value);
|
|
437
433
|
}
|
|
438
434
|
} finally {
|
|
435
|
+
reader.cancel().catch(() => void 0);
|
|
439
436
|
reader.releaseLock();
|
|
440
437
|
}
|
|
441
438
|
const bytes = new Uint8Array(total);
|
|
@@ -528,17 +525,14 @@ async function getGoogleChatAccessToken(account) {
|
|
|
528
525
|
}
|
|
529
526
|
async function fetchChatCerts() {
|
|
530
527
|
const now = Date.now();
|
|
531
|
-
if (cachedCerts && now - cachedCerts.fetchedAt <
|
|
528
|
+
if (cachedCerts && now - cachedCerts.fetchedAt < 6e5) return cachedCerts.certs;
|
|
532
529
|
const { response, release } = await fetchWithSsrFGuard$1({
|
|
533
530
|
url: CHAT_CERTS_URL,
|
|
534
531
|
auditContext: "googlechat.auth.certs",
|
|
535
532
|
timeoutMs: GOOGLECHAT_CERT_FETCH_TIMEOUT_MS
|
|
536
533
|
});
|
|
537
534
|
try {
|
|
538
|
-
if (!response.ok) {
|
|
539
|
-
await response.body?.cancel().catch(() => void 0);
|
|
540
|
-
throw new Error(`Failed to fetch Chat certs (${response.status})`);
|
|
541
|
-
}
|
|
535
|
+
if (!response.ok) throw new Error(`Failed to fetch Chat certs (${response.status})`);
|
|
542
536
|
const certs = await readGoogleChatCertsResponse(response);
|
|
543
537
|
cachedCerts = {
|
|
544
538
|
fetchedAt: now,
|
|
@@ -614,12 +608,12 @@ async function verifyGoogleChatRequest(params) {
|
|
|
614
608
|
const CHAT_API_BASE = "https://chat.googleapis.com/v1";
|
|
615
609
|
const GOOGLECHAT_API_TIMEOUT_MS = 3e4;
|
|
616
610
|
const GOOGLECHAT_MEDIA_TIMEOUT_GRACE_MS = 3e4;
|
|
617
|
-
const GOOGLECHAT_MEDIA_MIN_BYTES_PER_SECOND =
|
|
618
|
-
const GOOGLECHAT_MEDIA_MAX_TIMEOUT_MS =
|
|
611
|
+
const GOOGLECHAT_MEDIA_MIN_BYTES_PER_SECOND = 262144;
|
|
612
|
+
const GOOGLECHAT_MEDIA_MAX_TIMEOUT_MS = 9e5;
|
|
619
613
|
const GOOGLECHAT_RESPONSE_READ_IDLE_TIMEOUT_MS = 3e4;
|
|
620
|
-
const GOOGLECHAT_JSON_RESPONSE_MAX_BYTES =
|
|
621
|
-
const GOOGLECHAT_ERROR_BODY_MAX_BYTES =
|
|
622
|
-
const GOOGLE_CHAT_MEDIA_RESPONSE_MAX_BYTES =
|
|
614
|
+
const GOOGLECHAT_JSON_RESPONSE_MAX_BYTES = 16777216;
|
|
615
|
+
const GOOGLECHAT_ERROR_BODY_MAX_BYTES = 16384;
|
|
616
|
+
const GOOGLE_CHAT_MEDIA_RESPONSE_MAX_BYTES = 20971520;
|
|
623
617
|
var GoogleChatApiError = class extends Error {
|
|
624
618
|
constructor(status, message) {
|
|
625
619
|
super(message);
|
|
@@ -640,12 +634,13 @@ async function readGoogleChatJsonResponse(response, label) {
|
|
|
640
634
|
});
|
|
641
635
|
}
|
|
642
636
|
async function readGoogleChatErrorResponse(response, label) {
|
|
643
|
-
|
|
637
|
+
const text = await readResponseTextSnippet(response, {
|
|
644
638
|
maxBytes: GOOGLECHAT_ERROR_BODY_MAX_BYTES,
|
|
645
639
|
maxChars: GOOGLECHAT_ERROR_BODY_MAX_BYTES,
|
|
646
640
|
chunkTimeoutMs: GOOGLECHAT_RESPONSE_READ_IDLE_TIMEOUT_MS,
|
|
647
641
|
onIdleTimeout: ({ chunkTimeoutMs }) => /* @__PURE__ */ new Error(`${label} error response stalled after ${chunkTimeoutMs}ms`)
|
|
648
|
-
}) ?? ""
|
|
642
|
+
}) ?? "";
|
|
643
|
+
return redactToolPayloadText(text);
|
|
649
644
|
}
|
|
650
645
|
const headersToObject = (headers) => headers instanceof Headers ? Object.fromEntries(headers.entries()) : Array.isArray(headers) ? Object.fromEntries(headers) : headers || {};
|
|
651
646
|
async function withGoogleChatResponse(params) {
|
|
@@ -1096,7 +1091,8 @@ function emitGoogleChatBlockquotes(text, markers) {
|
|
|
1096
1091
|
return rendered;
|
|
1097
1092
|
}
|
|
1098
1093
|
function prepareGoogleChatIR(text) {
|
|
1099
|
-
const
|
|
1094
|
+
const sanitized = sanitizeGoogleChatText(text);
|
|
1095
|
+
const ir = projectGoogleChatPlainLiterals(projectGoogleChatLinkLabels(projectDecodedGoogleChatResources(projectUnsafeCodeFallbacks(markdownToIR(sanitized, {
|
|
1100
1096
|
enableSpoilers: true,
|
|
1101
1097
|
enableTaskLists: true,
|
|
1102
1098
|
headingStyle: "rich",
|
|
@@ -1144,7 +1140,7 @@ function renderGoogleChatIR(ir, markers) {
|
|
|
1144
1140
|
if (!href || !label) return null;
|
|
1145
1141
|
const labelHasStyles = ir.styles.some((span) => span.start < link.end && span.end > link.start);
|
|
1146
1142
|
return /[<>|]/u.test(href) || /[<>|*_~`]/u.test(label) || labelHasStyles ? {
|
|
1147
|
-
start: link.
|
|
1143
|
+
start: link.end,
|
|
1148
1144
|
end: link.end,
|
|
1149
1145
|
open: "",
|
|
1150
1146
|
close: ` (${href})`
|
|
@@ -1163,7 +1159,7 @@ function formatGoogleChatTextChunks(text, limit = GOOGLE_CHAT_FORMAT_PROFILE.chu
|
|
|
1163
1159
|
return renderMarkdownIRChunksWithinLimit({
|
|
1164
1160
|
ir: prepared.ir,
|
|
1165
1161
|
limit: Math.min(limit, GOOGLE_CHAT_FORMAT_PROFILE.chunk.limit),
|
|
1166
|
-
measureRendered: (rendered) =>
|
|
1162
|
+
measureRendered: (rendered) => Buffer.byteLength(rendered, "utf8"),
|
|
1167
1163
|
renderChunk: (chunk) => renderGoogleChatIR(chunk, prepared.markers)
|
|
1168
1164
|
}).map((chunk) => chunk.rendered);
|
|
1169
1165
|
}
|
|
@@ -1184,8 +1180,44 @@ function resolveGoogleChatGroupRequireMention(params) {
|
|
|
1184
1180
|
}));
|
|
1185
1181
|
}
|
|
1186
1182
|
//#endregion
|
|
1183
|
+
//#region extensions/googlechat/src/ingress-identity.ts
|
|
1184
|
+
function normalizeGoogleChatUserId(raw) {
|
|
1185
|
+
const trimmed = normalizeOptionalString(raw) ?? "";
|
|
1186
|
+
if (!trimmed) return "";
|
|
1187
|
+
return normalizeLowercaseStringOrEmpty(trimmed.replace(/^users\//i, ""));
|
|
1188
|
+
}
|
|
1189
|
+
const GOOGLECHAT_EMAIL_KIND = "plugin:googlechat-email";
|
|
1190
|
+
function normalizeEntryValue(raw) {
|
|
1191
|
+
return normalizeLowercaseStringOrEmpty(raw ?? "");
|
|
1192
|
+
}
|
|
1193
|
+
function normalizeGoogleChatStableEntry(entry) {
|
|
1194
|
+
const withoutProvider = normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "");
|
|
1195
|
+
if (!withoutProvider) return null;
|
|
1196
|
+
return withoutProvider.startsWith("users/") ? normalizeGoogleChatUserId(withoutProvider) : withoutProvider;
|
|
1197
|
+
}
|
|
1198
|
+
function normalizeGoogleChatEmailEntry(entry) {
|
|
1199
|
+
if (normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "").startsWith("users/")) return null;
|
|
1200
|
+
const stable = normalizeGoogleChatStableEntry(entry);
|
|
1201
|
+
return stable?.includes("@") ? stable : null;
|
|
1202
|
+
}
|
|
1203
|
+
const googleChatIngressIdentity = defineStableChannelIngressIdentity({
|
|
1204
|
+
key: "sender-id",
|
|
1205
|
+
authentication: "verified",
|
|
1206
|
+
normalizeEntry: normalizeGoogleChatStableEntry,
|
|
1207
|
+
normalizeSubject: normalizeGoogleChatUserId,
|
|
1208
|
+
aliases: [{
|
|
1209
|
+
key: "email",
|
|
1210
|
+
kind: GOOGLECHAT_EMAIL_KIND,
|
|
1211
|
+
normalizeEntry: normalizeGoogleChatEmailEntry,
|
|
1212
|
+
normalizeSubject: normalizeEntryValue,
|
|
1213
|
+
authentication: "mutable"
|
|
1214
|
+
}],
|
|
1215
|
+
isWildcardEntry: (entry) => normalizeEntryValue(entry) === "*",
|
|
1216
|
+
resolveEntryId: ({ entryIndex, fieldKey }) => fieldKey === "stableId" ? `entry-${entryIndex + 1}:user` : `entry-${entryIndex + 1}:${fieldKey}`
|
|
1217
|
+
});
|
|
1218
|
+
//#endregion
|
|
1187
1219
|
//#region extensions/googlechat/src/channel.adapters.ts
|
|
1188
|
-
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
1220
|
+
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-DBXW-pey.js"), "googleChatChannelRuntime");
|
|
1189
1221
|
function createGoogleChatSendReceipt(params) {
|
|
1190
1222
|
const messageId = params.messageId?.trim();
|
|
1191
1223
|
return createMessageReceiptFromOutboundResults({
|
|
@@ -1235,6 +1267,7 @@ const googlechatSecurityAdapter = {
|
|
|
1235
1267
|
resolvePolicy: (account) => account.config.dmPolicy,
|
|
1236
1268
|
resolveAllowFrom: (account) => account.config.allowFrom,
|
|
1237
1269
|
allowFromPathSuffix: "",
|
|
1270
|
+
classifyEntryAuthentication: identityEntryAuthenticationClassifier(googleChatIngressIdentity),
|
|
1238
1271
|
normalizeEntry: (raw) => formatGoogleChatAllowFromEntry(raw)
|
|
1239
1272
|
},
|
|
1240
1273
|
collectWarnings: collectGoogleChatSecurityWarnings
|
|
@@ -1356,4 +1389,4 @@ const googlechatMessageAdapter = defineChannelMessageAdapter({
|
|
|
1356
1389
|
send: { text: googlechatOutboundAdapter.attachedResults.sendText }
|
|
1357
1390
|
});
|
|
1358
1391
|
//#endregion
|
|
1359
|
-
export {
|
|
1392
|
+
export { readGoogleChatApprovalActionToken as A, verifyGoogleChatRequest as C, completeGoogleChatApprovalCardBinding as D, claimGoogleChatApprovalCardBinding as E, unregisterGoogleChatManualApprovalFollowupSuppression as F, registerGoogleChatManualApprovalFollowupSuppression as M, releaseGoogleChatApprovalCardBinding as N, createGoogleChatApprovalToken as O, unregisterGoogleChatApprovalCardBindings as P, 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, registerGoogleChatApprovalCardBinding as j, getGoogleChatApprovalCardBinding 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 };
|