@openclaw/googlechat 2026.7.1 → 2026.7.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions-I93fRoRd.js +76 -0
- package/dist/api.js +2 -2
- package/dist/approval-auth-CMMwmCPY.js +30 -0
- package/dist/{approval-handler.runtime-BnkufknT.js → approval-handler.runtime-DcSqrj8k.js} +5 -4
- package/dist/{channel-_o671C-U.js → channel-9ZeBzfmP.js} +17 -20
- package/dist/{channel-base-DJICAvKH.js → channel-base-B16U1bY7.js} +0 -1
- package/dist/channel-config-api.js +1 -2
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.adapters-FEj7zUjh.js → channel.adapters-CvESEXlT.js} +77 -142
- package/dist/{channel.runtime-CYmt7Ybo.js → channel.runtime-B0u_Dy7b.js} +145 -116
- package/dist/config-api-CsD0IFxF.js +3 -0
- package/dist/directory-contract-api.js +1 -1
- package/dist/{doctor-contract-BcEqUZ4j.js → doctor-contract-CvhD0eoX.js} +19 -3
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{runtime-api-BbVoWRxq.js → runtime-api-1v-DgldF.js} +3 -6
- package/dist/runtime-api.js +3 -2
- package/dist/{secret-contract-lCMHqumt.js → secret-contract-D__4IIu_.js} +19 -26
- package/dist/secret-contract-api.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/npm-shrinkwrap.json +3 -4
- package/openclaw.plugin.json +72 -48
- package/package.json +4 -6
- package/dist/actions-BacnMHv0.js +0 -159
- package/dist/approval-auth-C_BVZZFA.js +0 -27
package/openclaw.plugin.json
CHANGED
|
@@ -370,33 +370,45 @@
|
|
|
370
370
|
"exclusiveMinimum": 0,
|
|
371
371
|
"maximum": 9007199254740991
|
|
372
372
|
},
|
|
373
|
-
"
|
|
374
|
-
"type": "string",
|
|
375
|
-
"enum": [
|
|
376
|
-
"length",
|
|
377
|
-
"newline"
|
|
378
|
-
]
|
|
379
|
-
},
|
|
380
|
-
"blockStreaming": {
|
|
381
|
-
"type": "boolean"
|
|
382
|
-
},
|
|
383
|
-
"blockStreamingCoalesce": {
|
|
373
|
+
"streaming": {
|
|
384
374
|
"type": "object",
|
|
385
375
|
"properties": {
|
|
386
|
-
"
|
|
387
|
-
"type": "
|
|
388
|
-
"
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
"type": "integer",
|
|
393
|
-
"exclusiveMinimum": 0,
|
|
394
|
-
"maximum": 9007199254740991
|
|
376
|
+
"chunkMode": {
|
|
377
|
+
"type": "string",
|
|
378
|
+
"enum": [
|
|
379
|
+
"length",
|
|
380
|
+
"newline"
|
|
381
|
+
]
|
|
395
382
|
},
|
|
396
|
-
"
|
|
397
|
-
"type": "
|
|
398
|
-
"
|
|
399
|
-
|
|
383
|
+
"block": {
|
|
384
|
+
"type": "object",
|
|
385
|
+
"properties": {
|
|
386
|
+
"enabled": {
|
|
387
|
+
"type": "boolean"
|
|
388
|
+
},
|
|
389
|
+
"coalesce": {
|
|
390
|
+
"type": "object",
|
|
391
|
+
"properties": {
|
|
392
|
+
"minChars": {
|
|
393
|
+
"type": "integer",
|
|
394
|
+
"exclusiveMinimum": 0,
|
|
395
|
+
"maximum": 9007199254740991
|
|
396
|
+
},
|
|
397
|
+
"maxChars": {
|
|
398
|
+
"type": "integer",
|
|
399
|
+
"exclusiveMinimum": 0,
|
|
400
|
+
"maximum": 9007199254740991
|
|
401
|
+
},
|
|
402
|
+
"idleMs": {
|
|
403
|
+
"type": "integer",
|
|
404
|
+
"minimum": 0,
|
|
405
|
+
"maximum": 9007199254740991
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
"additionalProperties": false
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
"additionalProperties": false
|
|
400
412
|
}
|
|
401
413
|
},
|
|
402
414
|
"additionalProperties": false
|
|
@@ -841,33 +853,45 @@
|
|
|
841
853
|
"exclusiveMinimum": 0,
|
|
842
854
|
"maximum": 9007199254740991
|
|
843
855
|
},
|
|
844
|
-
"
|
|
845
|
-
"type": "string",
|
|
846
|
-
"enum": [
|
|
847
|
-
"length",
|
|
848
|
-
"newline"
|
|
849
|
-
]
|
|
850
|
-
},
|
|
851
|
-
"blockStreaming": {
|
|
852
|
-
"type": "boolean"
|
|
853
|
-
},
|
|
854
|
-
"blockStreamingCoalesce": {
|
|
856
|
+
"streaming": {
|
|
855
857
|
"type": "object",
|
|
856
858
|
"properties": {
|
|
857
|
-
"
|
|
858
|
-
"type": "
|
|
859
|
-
"
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
"type": "integer",
|
|
864
|
-
"exclusiveMinimum": 0,
|
|
865
|
-
"maximum": 9007199254740991
|
|
859
|
+
"chunkMode": {
|
|
860
|
+
"type": "string",
|
|
861
|
+
"enum": [
|
|
862
|
+
"length",
|
|
863
|
+
"newline"
|
|
864
|
+
]
|
|
866
865
|
},
|
|
867
|
-
"
|
|
868
|
-
"type": "
|
|
869
|
-
"
|
|
870
|
-
|
|
866
|
+
"block": {
|
|
867
|
+
"type": "object",
|
|
868
|
+
"properties": {
|
|
869
|
+
"enabled": {
|
|
870
|
+
"type": "boolean"
|
|
871
|
+
},
|
|
872
|
+
"coalesce": {
|
|
873
|
+
"type": "object",
|
|
874
|
+
"properties": {
|
|
875
|
+
"minChars": {
|
|
876
|
+
"type": "integer",
|
|
877
|
+
"exclusiveMinimum": 0,
|
|
878
|
+
"maximum": 9007199254740991
|
|
879
|
+
},
|
|
880
|
+
"maxChars": {
|
|
881
|
+
"type": "integer",
|
|
882
|
+
"exclusiveMinimum": 0,
|
|
883
|
+
"maximum": 9007199254740991
|
|
884
|
+
},
|
|
885
|
+
"idleMs": {
|
|
886
|
+
"type": "integer",
|
|
887
|
+
"minimum": 0,
|
|
888
|
+
"maximum": 9007199254740991
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
"additionalProperties": false
|
|
892
|
+
}
|
|
893
|
+
},
|
|
894
|
+
"additionalProperties": false
|
|
871
895
|
}
|
|
872
896
|
},
|
|
873
897
|
"additionalProperties": false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/googlechat",
|
|
3
|
-
"version": "2026.7.1",
|
|
3
|
+
"version": "2026.7.2-beta.1",
|
|
4
4
|
"description": "OpenClaw Google Chat channel plugin for spaces and direct messages.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,12 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"gaxios": "7.1.5",
|
|
12
11
|
"google-auth-library": "10.9.0",
|
|
13
12
|
"zod": "4.4.3"
|
|
14
13
|
},
|
|
15
14
|
"peerDependencies": {
|
|
16
|
-
"openclaw": ">=2026.7.1"
|
|
15
|
+
"openclaw": ">=2026.7.2-beta.1"
|
|
17
16
|
},
|
|
18
17
|
"peerDependenciesMeta": {
|
|
19
18
|
"openclaw": {
|
|
@@ -71,10 +70,10 @@
|
|
|
71
70
|
"minHostVersion": ">=2026.4.10"
|
|
72
71
|
},
|
|
73
72
|
"compat": {
|
|
74
|
-
"pluginApi": ">=2026.7.1"
|
|
73
|
+
"pluginApi": ">=2026.7.2-beta.1"
|
|
75
74
|
},
|
|
76
75
|
"build": {
|
|
77
|
-
"openclawVersion": "2026.7.1"
|
|
76
|
+
"openclawVersion": "2026.7.2-beta.1"
|
|
78
77
|
},
|
|
79
78
|
"release": {
|
|
80
79
|
"publishToClawHub": true,
|
|
@@ -92,7 +91,6 @@
|
|
|
92
91
|
"README.md"
|
|
93
92
|
],
|
|
94
93
|
"bundledDependencies": [
|
|
95
|
-
"gaxios",
|
|
96
94
|
"google-auth-library",
|
|
97
95
|
"zod"
|
|
98
96
|
]
|
package/dist/actions-BacnMHv0.js
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount, o as listEnabledGoogleChatAccounts } from "./channel-base-DJICAvKH.js";
|
|
2
|
-
import { S as uploadGoogleChatAttachment, b as sendGoogleChatMessage, g as deleteGoogleChatReaction, m as createGoogleChatReaction, p as resolveGoogleChatOutboundSpace, v as listGoogleChatReactions } from "./channel.adapters-FEj7zUjh.js";
|
|
3
|
-
import { P as getGoogleChatRuntime } from "./runtime-api-BbVoWRxq.js";
|
|
4
|
-
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
5
|
-
import { createActionGate, jsonResult, readPositiveIntegerParam, readReactionParams, readStringParam } from "openclaw/plugin-sdk/channel-actions";
|
|
6
|
-
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
7
|
-
//#region extensions/googlechat/src/actions.ts
|
|
8
|
-
const providerId = "googlechat";
|
|
9
|
-
function listEnabledAccounts(cfg) {
|
|
10
|
-
return listEnabledGoogleChatAccounts(cfg).filter((account) => account.enabled && account.credentialSource !== "none");
|
|
11
|
-
}
|
|
12
|
-
function isReactionsEnabled(accounts) {
|
|
13
|
-
for (const account of accounts) if (createActionGate(account.config.actions)("reactions")) return true;
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
function resolveAppUserNames(account) {
|
|
17
|
-
return new Set(["users/app", account.config.botUser?.trim()].filter(Boolean));
|
|
18
|
-
}
|
|
19
|
-
async function loadGoogleChatActionMedia(params) {
|
|
20
|
-
const runtime = getGoogleChatRuntime();
|
|
21
|
-
return /^https?:\/\//i.test(params.mediaUrl) ? await runtime.channel.media.readRemoteMediaBuffer({
|
|
22
|
-
url: params.mediaUrl,
|
|
23
|
-
maxBytes: params.maxBytes
|
|
24
|
-
}) : await loadOutboundMediaFromUrl(params.mediaUrl, {
|
|
25
|
-
maxBytes: params.maxBytes,
|
|
26
|
-
mediaAccess: params.mediaAccess,
|
|
27
|
-
mediaLocalRoots: params.mediaLocalRoots,
|
|
28
|
-
mediaReadFile: params.mediaReadFile
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
const googlechatMessageActions = {
|
|
32
|
-
describeMessageTool: ({ cfg, accountId }) => {
|
|
33
|
-
const accounts = accountId ? [resolveGoogleChatAccount({
|
|
34
|
-
cfg,
|
|
35
|
-
accountId
|
|
36
|
-
})].filter((account) => account.enabled && account.credentialSource !== "none") : listEnabledAccounts(cfg);
|
|
37
|
-
if (accounts.length === 0) return null;
|
|
38
|
-
const actions = /* @__PURE__ */ new Set([]);
|
|
39
|
-
actions.add("send");
|
|
40
|
-
actions.add("upload-file");
|
|
41
|
-
if (isReactionsEnabled(accounts)) {
|
|
42
|
-
actions.add("react");
|
|
43
|
-
actions.add("reactions");
|
|
44
|
-
}
|
|
45
|
-
return { actions: Array.from(actions) };
|
|
46
|
-
},
|
|
47
|
-
extractToolSend: ({ args }) => {
|
|
48
|
-
return extractToolSend(args, "sendMessage");
|
|
49
|
-
},
|
|
50
|
-
handleAction: async ({ action, params, cfg, accountId, mediaAccess, mediaLocalRoots, mediaReadFile }) => {
|
|
51
|
-
const account = resolveGoogleChatAccount({
|
|
52
|
-
cfg,
|
|
53
|
-
accountId
|
|
54
|
-
});
|
|
55
|
-
if (account.credentialSource === "none") throw new Error("Google Chat credentials are missing.");
|
|
56
|
-
if (action === "send" || action === "upload-file") {
|
|
57
|
-
const to = readStringParam(params, "to", { required: true });
|
|
58
|
-
const content = readStringParam(params, "message", {
|
|
59
|
-
required: action === "send",
|
|
60
|
-
allowEmpty: true
|
|
61
|
-
}) ?? readStringParam(params, "initialComment", { allowEmpty: true }) ?? "";
|
|
62
|
-
const mediaUrl = readStringParam(params, "media", { trim: false }) ?? readStringParam(params, "filePath", { trim: false }) ?? readStringParam(params, "path", { trim: false });
|
|
63
|
-
const threadId = readStringParam(params, "threadId") ?? readStringParam(params, "replyTo");
|
|
64
|
-
const space = await resolveGoogleChatOutboundSpace({
|
|
65
|
-
account,
|
|
66
|
-
target: to
|
|
67
|
-
});
|
|
68
|
-
if (mediaUrl) {
|
|
69
|
-
const loaded = await loadGoogleChatActionMedia({
|
|
70
|
-
mediaUrl,
|
|
71
|
-
maxBytes: (account.config.mediaMaxMb ?? 20) * 1024 * 1024,
|
|
72
|
-
mediaAccess,
|
|
73
|
-
mediaLocalRoots,
|
|
74
|
-
mediaReadFile
|
|
75
|
-
});
|
|
76
|
-
const uploadFileName = readStringParam(params, "filename") ?? readStringParam(params, "title") ?? loaded.fileName ?? "attachment";
|
|
77
|
-
const upload = await uploadGoogleChatAttachment({
|
|
78
|
-
account,
|
|
79
|
-
space,
|
|
80
|
-
filename: uploadFileName,
|
|
81
|
-
buffer: loaded.buffer,
|
|
82
|
-
contentType: loaded.contentType
|
|
83
|
-
});
|
|
84
|
-
return jsonResult({
|
|
85
|
-
ok: true,
|
|
86
|
-
to: space,
|
|
87
|
-
...await sendGoogleChatMessage({
|
|
88
|
-
account,
|
|
89
|
-
space,
|
|
90
|
-
text: content,
|
|
91
|
-
thread: threadId ?? void 0,
|
|
92
|
-
attachments: upload.attachmentUploadToken ? [{
|
|
93
|
-
attachmentUploadToken: upload.attachmentUploadToken,
|
|
94
|
-
contentName: uploadFileName
|
|
95
|
-
}] : void 0
|
|
96
|
-
})
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
if (action === "upload-file") throw new Error("upload-file requires media, filePath, or path");
|
|
100
|
-
return jsonResult({
|
|
101
|
-
ok: true,
|
|
102
|
-
to: space,
|
|
103
|
-
...await sendGoogleChatMessage({
|
|
104
|
-
account,
|
|
105
|
-
space,
|
|
106
|
-
text: content,
|
|
107
|
-
thread: threadId ?? void 0
|
|
108
|
-
})
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
if (action === "react") {
|
|
112
|
-
const messageName = readStringParam(params, "messageId", { required: true });
|
|
113
|
-
const { emoji, remove, isEmpty } = readReactionParams(params, { removeErrorMessage: "Emoji is required to remove a Google Chat reaction." });
|
|
114
|
-
if (remove || isEmpty) {
|
|
115
|
-
const reactions = await listGoogleChatReactions({
|
|
116
|
-
account,
|
|
117
|
-
messageName
|
|
118
|
-
});
|
|
119
|
-
const appUsers = resolveAppUserNames(account);
|
|
120
|
-
const toRemove = reactions.filter((reaction) => {
|
|
121
|
-
const userName = reaction.user?.name?.trim();
|
|
122
|
-
if (appUsers.size > 0 && !appUsers.has(userName ?? "")) return false;
|
|
123
|
-
if (emoji) return reaction.emoji?.unicode === emoji;
|
|
124
|
-
return true;
|
|
125
|
-
});
|
|
126
|
-
for (const reaction of toRemove) {
|
|
127
|
-
if (!reaction.name) continue;
|
|
128
|
-
await deleteGoogleChatReaction({
|
|
129
|
-
account,
|
|
130
|
-
reactionName: reaction.name
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
return jsonResult({
|
|
134
|
-
ok: true,
|
|
135
|
-
removed: toRemove.length
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
return jsonResult({
|
|
139
|
-
ok: true,
|
|
140
|
-
reaction: await createGoogleChatReaction({
|
|
141
|
-
account,
|
|
142
|
-
messageName,
|
|
143
|
-
emoji
|
|
144
|
-
})
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
if (action === "reactions") return jsonResult({
|
|
148
|
-
ok: true,
|
|
149
|
-
reactions: await listGoogleChatReactions({
|
|
150
|
-
account,
|
|
151
|
-
messageName: readStringParam(params, "messageId", { required: true }),
|
|
152
|
-
limit: readPositiveIntegerParam(params, "limit") ?? void 0
|
|
153
|
-
})
|
|
154
|
-
});
|
|
155
|
-
throw new Error(`Action ${action} is not supported for provider ${providerId}.`);
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
//#endregion
|
|
159
|
-
export { googlechatMessageActions };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount } from "./channel-base-DJICAvKH.js";
|
|
2
|
-
import { d as normalizeGoogleChatTarget, u as isGoogleChatUserTarget } from "./channel.adapters-FEj7zUjh.js";
|
|
3
|
-
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
-
import { createResolvedApproverActionAuthAdapter, resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
5
|
-
//#region extensions/googlechat/src/approval-auth.ts
|
|
6
|
-
function normalizeGoogleChatApproverId(value) {
|
|
7
|
-
const normalized = normalizeGoogleChatTarget(String(value));
|
|
8
|
-
if (!normalized || !isGoogleChatUserTarget(normalized)) return;
|
|
9
|
-
const suffix = normalizeLowercaseStringOrEmpty(normalized.slice(6));
|
|
10
|
-
if (!suffix || suffix.includes("@")) return;
|
|
11
|
-
return `users/${suffix}`;
|
|
12
|
-
}
|
|
13
|
-
function getGoogleChatApprovalApprovers(params) {
|
|
14
|
-
const account = resolveGoogleChatAccount(params).config;
|
|
15
|
-
return resolveApprovalApprovers({
|
|
16
|
-
allowFrom: account.dm?.allowFrom,
|
|
17
|
-
defaultTo: account.defaultTo,
|
|
18
|
-
normalizeApprover: normalizeGoogleChatApproverId
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
const googleChatApprovalAuth = createResolvedApproverActionAuthAdapter({
|
|
22
|
-
channelLabel: "Google Chat",
|
|
23
|
-
resolveApprovers: getGoogleChatApprovalApprovers,
|
|
24
|
-
normalizeSenderId: (value) => normalizeGoogleChatApproverId(value)
|
|
25
|
-
});
|
|
26
|
-
//#endregion
|
|
27
|
-
export { googleChatApprovalAuth as n, normalizeGoogleChatApproverId as r, getGoogleChatApprovalApprovers as t };
|