@openclaw/clickclack 2026.6.34 → 2026.6.35
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/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as getClickClackRuntime, c as DEFAULT_ACCOUNT_ID, d as resolveClickClackAccount, f as resolveDefaultClickClackAccountId, i as createClickClackClient, l as listClickClackAccountIds, n as buildClickClackTarget, o as setClickClackRuntime, r as parseClickClackTarget, s as clickClackConfigSchema, t as clickClackPlugin, u as listEnabledClickClackAccounts } from "./channel-
|
|
1
|
+
import { a as getClickClackRuntime, c as DEFAULT_ACCOUNT_ID, d as resolveClickClackAccount, f as resolveDefaultClickClackAccountId, i as createClickClackClient, l as listClickClackAccountIds, n as buildClickClackTarget, o as setClickClackRuntime, r as parseClickClackTarget, s as clickClackConfigSchema, t as clickClackPlugin, u as listEnabledClickClackAccounts } from "./channel-CWuHkhJi.js";
|
|
2
2
|
export { DEFAULT_ACCOUNT_ID, buildClickClackTarget, clickClackConfigSchema, clickClackPlugin, createClickClackClient, getClickClackRuntime, listClickClackAccountIds, listEnabledClickClackAccounts, parseClickClackTarget, resolveClickClackAccount, resolveDefaultClickClackAccountId, setClickClackRuntime };
|
|
@@ -13,8 +13,9 @@ import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-sch
|
|
|
13
13
|
import { z } from "zod";
|
|
14
14
|
import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
15
15
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
16
|
-
import { readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
16
|
+
import { readProviderJsonResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
17
17
|
import { WebSocket } from "ws";
|
|
18
|
+
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
18
19
|
//#region extensions/clickclack/src/accounts.ts
|
|
19
20
|
/**
|
|
20
21
|
* Resolves ClickClack account configuration from root channel config, named
|
|
@@ -214,6 +215,8 @@ async function resolveClickClackInboundAccess(params) {
|
|
|
214
215
|
* delivery code.
|
|
215
216
|
*/
|
|
216
217
|
const CLICKCLACK_ERROR_BODY_LIMIT_BYTES = 8 * 1024;
|
|
218
|
+
const CLICKCLACK_WEBSOCKET_MAX_PAYLOAD_BYTES = 16 * 1024 * 1024;
|
|
219
|
+
const CLICKCLACK_WEBSOCKET_HANDSHAKE_TIMEOUT_MS = 3e4;
|
|
217
220
|
/**
|
|
218
221
|
* Creates a typed client for the ClickClack API using bearer-token auth.
|
|
219
222
|
*/
|
|
@@ -236,7 +239,7 @@ function createClickClackClient(options) {
|
|
|
236
239
|
const detail = await readResponseTextLimited(response, CLICKCLACK_ERROR_BODY_LIMIT_BYTES);
|
|
237
240
|
throw new Error(`ClickClack ${response.status}: ${detail}`);
|
|
238
241
|
}
|
|
239
|
-
return await response
|
|
242
|
+
return await readProviderJsonResponse(response, "ClickClack response");
|
|
240
243
|
}
|
|
241
244
|
return {
|
|
242
245
|
me: async () => {
|
|
@@ -255,10 +258,13 @@ function createClickClackClient(options) {
|
|
|
255
258
|
return (await request(`/api/dms/${encodeURIComponent(conversationId)}/messages?after_seq=${afterSeq}&limit=${limit}`)).messages;
|
|
256
259
|
},
|
|
257
260
|
thread: async (messageId) => await request(`/api/messages/${encodeURIComponent(messageId)}/thread`),
|
|
258
|
-
createChannelMessage: async (channelId, body) => {
|
|
261
|
+
createChannelMessage: async (channelId, body, opts) => {
|
|
259
262
|
return (await request(`/api/channels/${encodeURIComponent(channelId)}/messages`, {
|
|
260
263
|
method: "POST",
|
|
261
|
-
body: JSON.stringify({
|
|
264
|
+
body: JSON.stringify({
|
|
265
|
+
body,
|
|
266
|
+
...opts?.quotedMessageId ? { quoted_message_id: opts.quotedMessageId } : {}
|
|
267
|
+
})
|
|
262
268
|
})).message;
|
|
263
269
|
},
|
|
264
270
|
createThreadReply: async (messageId, body) => {
|
|
@@ -276,10 +282,13 @@ function createClickClackClient(options) {
|
|
|
276
282
|
})
|
|
277
283
|
})).conversation;
|
|
278
284
|
},
|
|
279
|
-
createDirectMessage: async (conversationId, body) => {
|
|
285
|
+
createDirectMessage: async (conversationId, body, opts) => {
|
|
280
286
|
return (await request(`/api/dms/${encodeURIComponent(conversationId)}/messages`, {
|
|
281
287
|
method: "POST",
|
|
282
|
-
body: JSON.stringify({
|
|
288
|
+
body: JSON.stringify({
|
|
289
|
+
body,
|
|
290
|
+
...opts?.quotedMessageId ? { quoted_message_id: opts.quotedMessageId } : {}
|
|
291
|
+
})
|
|
283
292
|
})).message;
|
|
284
293
|
},
|
|
285
294
|
events: async (workspaceId, afterCursor) => {
|
|
@@ -292,7 +301,11 @@ function createClickClackClient(options) {
|
|
|
292
301
|
url.protocol = url.protocol === "https:" ? "wss:" : "ws:";
|
|
293
302
|
url.searchParams.set("workspace_id", workspaceId);
|
|
294
303
|
if (afterCursor) url.searchParams.set("after_cursor", afterCursor);
|
|
295
|
-
return new WebSocket(url, {
|
|
304
|
+
return new WebSocket(url, {
|
|
305
|
+
headers: { Authorization: `Bearer ${options.token}` },
|
|
306
|
+
handshakeTimeout: CLICKCLACK_WEBSOCKET_HANDSHAKE_TIMEOUT_MS,
|
|
307
|
+
maxPayload: CLICKCLACK_WEBSOCKET_MAX_PAYLOAD_BYTES
|
|
308
|
+
});
|
|
296
309
|
}
|
|
297
310
|
};
|
|
298
311
|
}
|
|
@@ -368,10 +381,12 @@ function looksLikeClickClackTarget(raw) {
|
|
|
368
381
|
* and direct messages.
|
|
369
382
|
*/
|
|
370
383
|
/**
|
|
371
|
-
* Sends text to a normalized ClickClack target and returns the created
|
|
372
|
-
* id
|
|
384
|
+
* Sends visible text to a normalized ClickClack target and returns the created
|
|
385
|
+
* message id, or undefined when sanitization removes all content.
|
|
373
386
|
*/
|
|
374
387
|
async function sendClickClackText(params) {
|
|
388
|
+
const text = sanitizeAssistantVisibleText(params.text);
|
|
389
|
+
if (!text) return;
|
|
375
390
|
const account = resolveClickClackAccount({
|
|
376
391
|
cfg: params.cfg,
|
|
377
392
|
accountId: params.accountId
|
|
@@ -384,28 +399,16 @@ async function sendClickClackText(params) {
|
|
|
384
399
|
const parsed = parseClickClackTarget(params.to);
|
|
385
400
|
const explicitThreadId = params.threadId == null ? "" : String(params.threadId);
|
|
386
401
|
const replyToId = params.replyToId == null ? "" : String(params.replyToId);
|
|
387
|
-
if (explicitThreadId ||
|
|
388
|
-
const rootId = explicitThreadId ||
|
|
389
|
-
|
|
390
|
-
return {
|
|
391
|
-
to: params.to,
|
|
392
|
-
messageId: message.id
|
|
393
|
-
};
|
|
402
|
+
if (explicitThreadId || parsed.kind === "thread") {
|
|
403
|
+
const rootId = explicitThreadId || parsed.id;
|
|
404
|
+
return (await client.createThreadReply(rootId, text)).id;
|
|
394
405
|
}
|
|
395
406
|
if (parsed.kind === "dm") {
|
|
396
407
|
const dm = await client.createDirectConversation(workspaceId, [parsed.id]);
|
|
397
|
-
|
|
398
|
-
return {
|
|
399
|
-
to: params.to,
|
|
400
|
-
messageId: message.id
|
|
401
|
-
};
|
|
408
|
+
return (await client.createDirectMessage(dm.id, text, { quotedMessageId: replyToId || void 0 })).id;
|
|
402
409
|
}
|
|
403
410
|
const channelId = await resolveChannelId(client, workspaceId, parsed.id);
|
|
404
|
-
|
|
405
|
-
return {
|
|
406
|
-
to: params.to,
|
|
407
|
-
messageId: message.id
|
|
408
|
-
};
|
|
411
|
+
return (await client.createChannelMessage(channelId, text, { quotedMessageId: replyToId || void 0 })).id;
|
|
409
412
|
}
|
|
410
413
|
//#endregion
|
|
411
414
|
//#region extensions/clickclack/src/inbound.ts
|
|
@@ -743,7 +746,7 @@ const clickClackMessageAdapter = defineChannelMessageAdapter({
|
|
|
743
746
|
messageSendingHooks: true
|
|
744
747
|
} },
|
|
745
748
|
send: { text: async (ctx) => {
|
|
746
|
-
const
|
|
749
|
+
const messageId = await sendClickClackText({
|
|
747
750
|
cfg: ctx.cfg,
|
|
748
751
|
accountId: ctx.accountId,
|
|
749
752
|
to: ctx.to,
|
|
@@ -754,12 +757,12 @@ const clickClackMessageAdapter = defineChannelMessageAdapter({
|
|
|
754
757
|
const threadId = ctx.threadId == null ? void 0 : String(ctx.threadId);
|
|
755
758
|
const replyToId = ctx.replyToId ?? void 0;
|
|
756
759
|
return {
|
|
757
|
-
messageId:
|
|
760
|
+
...messageId ? { messageId } : {},
|
|
758
761
|
receipt: createMessageReceiptFromOutboundResults({
|
|
759
|
-
results: [{
|
|
762
|
+
results: messageId ? [{
|
|
760
763
|
channel: CHANNEL_ID,
|
|
761
|
-
messageId
|
|
762
|
-
}],
|
|
764
|
+
messageId
|
|
765
|
+
}] : [],
|
|
763
766
|
threadId,
|
|
764
767
|
replyToId,
|
|
765
768
|
kind: "text"
|
|
@@ -861,14 +864,16 @@ const clickClackPlugin = createChatChannelPlugin({
|
|
|
861
864
|
base: { deliveryMode: "direct" },
|
|
862
865
|
attachedResults: {
|
|
863
866
|
channel: CHANNEL_ID,
|
|
864
|
-
sendText: async ({ cfg, to, text, accountId, threadId, replyToId }) =>
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
867
|
+
sendText: async ({ cfg, to, text, accountId, threadId, replyToId }) => {
|
|
868
|
+
return { messageId: await sendClickClackText({
|
|
869
|
+
cfg,
|
|
870
|
+
accountId,
|
|
871
|
+
to,
|
|
872
|
+
text,
|
|
873
|
+
threadId,
|
|
874
|
+
replyToId
|
|
875
|
+
}) ?? "" };
|
|
876
|
+
}
|
|
872
877
|
}
|
|
873
878
|
}
|
|
874
879
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as clickClackPlugin } from "./channel-
|
|
1
|
+
import { t as clickClackPlugin } from "./channel-CWuHkhJi.js";
|
|
2
2
|
export { clickClackPlugin };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { d as resolveClickClackAccount, i as createClickClackClient, o as setClickClackRuntime, r as parseClickClackTarget } from "./channel-
|
|
1
|
+
import { d as resolveClickClackAccount, i as createClickClackClient, o as setClickClackRuntime, r as parseClickClackTarget } from "./channel-CWuHkhJi.js";
|
|
2
2
|
import "./api.js";
|
|
3
3
|
export { createClickClackClient, parseClickClackTarget, resolveClickClackAccount, setClickClackRuntime };
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/clickclack",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.35",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/clickclack",
|
|
9
|
-
"version": "2026.6.
|
|
9
|
+
"version": "2026.6.35",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ws": "8.21.0",
|
|
12
12
|
"zod": "4.4.3"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"openclaw": ">=2026.6.
|
|
15
|
+
"openclaw": ">=2026.6.35"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"openclaw": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/clickclack",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.35",
|
|
4
4
|
"description": "OpenClaw ClickClack channel plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"zod": "4.4.3"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"openclaw": ">=2026.6.
|
|
16
|
+
"openclaw": ">=2026.6.35"
|
|
17
17
|
},
|
|
18
18
|
"peerDependenciesMeta": {
|
|
19
19
|
"openclaw": {
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"allowInvalidConfigRecovery": true
|
|
50
50
|
},
|
|
51
51
|
"compat": {
|
|
52
|
-
"pluginApi": ">=2026.6.
|
|
52
|
+
"pluginApi": ">=2026.6.35"
|
|
53
53
|
},
|
|
54
54
|
"build": {
|
|
55
|
-
"openclawVersion": "2026.6.
|
|
55
|
+
"openclawVersion": "2026.6.35",
|
|
56
56
|
"bundledDist": false
|
|
57
57
|
},
|
|
58
58
|
"release": {
|