@openclaw/clickclack 2026.10.10 → 2026.11.5-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/.setup/{channel-CaLQ1zSw.mjs → channel-ByAANbh8.mjs} +363 -504
- package/dist/.setup/{resolve-C2XmZanM.mjs → resolve-CRj6QjdF.mjs} +27 -41
- package/dist/.setup/{rolldown-runtime-nwUcYXjP.mjs → rolldown-runtime-782esTHO.mjs} +0 -1
- package/dist/.setup/{runtime-api-HO9-jJAP.mjs → runtime-api-BsRK-sfA.mjs} +324 -368
- package/dist/.setup/{setup-claim-D50o9egr.mjs → setup-claim-BAKxfObl.mjs} +4 -9
- package/dist/.setup/{setup-plugin-api-COv8knUv.mjs → setup-plugin-api-BTqE973B.mjs} +1 -1
- package/dist/.setup/setup-plugin-api-CfuhJJvK.mjs +1 -0
- package/dist/.setup/{setup-surface-BuNtdRQY.mjs → setup-surface-5wSYr6p2.mjs} +5 -5
- package/dist/.setup/{setup-verify-CSI-GwUA.mjs → setup-verify-IayKkFWq.mjs} +12 -24
- package/dist/.source-module-urls/aa673c321fe9be084b8926cbe5388ff5e2a41371389e19ca60a1983f2b634030.json +1 -1
- package/dist/api.js +3 -3
- package/dist/channel-plugin-api.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime-api.js +4 -4
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
- package/node_modules/zod/src/v4/core/compile.ts +9 -0
- package/node_modules/zod/src/v4/core/schemas.ts +35 -1
- package/node_modules/zod/src/v4/core/util.ts +13 -0
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/v4/core/compile.cjs +8 -0
- package/node_modules/zod/v4/core/compile.js +8 -0
- package/node_modules/zod/v4/core/schemas.cjs +30 -0
- package/node_modules/zod/v4/core/schemas.d.cts +3 -1
- package/node_modules/zod/v4/core/schemas.d.ts +3 -1
- package/node_modules/zod/v4/core/schemas.js +30 -0
- package/node_modules/zod/v4/core/util.cjs +15 -0
- package/node_modules/zod/v4/core/util.d.cts +2 -0
- package/node_modules/zod/v4/core/util.d.ts +2 -0
- package/node_modules/zod/v4/core/util.js +14 -0
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/package.json +5 -7
- package/dist/.setup/setup-plugin-api-wzfSSaGz.mjs +0 -1
- package/node_modules/ws/LICENSE +0 -20
- package/node_modules/ws/README.md +0 -548
- package/node_modules/ws/browser.js +0 -8
- package/node_modules/ws/index.js +0 -22
- package/node_modules/ws/lib/buffer-util.js +0 -131
- package/node_modules/ws/lib/constants.js +0 -19
- package/node_modules/ws/lib/event-target.js +0 -292
- package/node_modules/ws/lib/extension.js +0 -203
- package/node_modules/ws/lib/limiter.js +0 -55
- package/node_modules/ws/lib/permessage-deflate.js +0 -530
- package/node_modules/ws/lib/receiver.js +0 -743
- package/node_modules/ws/lib/sender.js +0 -607
- package/node_modules/ws/lib/stream.js +0 -161
- package/node_modules/ws/lib/subprotocol.js +0 -62
- package/node_modules/ws/lib/validation.js +0 -152
- package/node_modules/ws/lib/websocket-server.js +0 -562
- package/node_modules/ws/lib/websocket.js +0 -1421
- package/node_modules/ws/package.json +0 -74
- package/node_modules/ws/wrapper.mjs +0 -21
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WebSocket } from "openclaw/plugin-sdk/websocket-runtime";
|
|
2
2
|
import { bufferToBlobPart } from "openclaw/plugin-sdk/blob-runtime";
|
|
3
3
|
import { captureEffectAuthority } from "openclaw/plugin-sdk/fetch-runtime";
|
|
4
4
|
import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
5
5
|
import { readProviderJsonResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
6
|
-
import path from "node:path";
|
|
7
|
-
// extensions/clickclack/src/ws-runtime.ts
|
|
8
|
-
const require = createRequire(import.meta.url);
|
|
9
|
-
const WebSocket = require(path.join(path.dirname(require.resolve("ws/package.json")), "index.js"));
|
|
10
6
|
// extensions/clickclack/src/http-client.ts
|
|
11
7
|
/**
|
|
12
8
|
* Serializes optional provenance into the wire fields. Unknown JSON fields
|
|
@@ -69,31 +65,25 @@ function createClickClackClient(options) {
|
|
|
69
65
|
for (const [key, value] of Object.entries(headers)) requestHeaders.set(key, value);
|
|
70
66
|
if (correlationId) requestHeaders.set(CLICKCLACK_CORRELATION_ID_HEADER, correlationId);
|
|
71
67
|
if (init.body && !(init.body instanceof FormData)) requestHeaders.set("Content-Type", "application/json");
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
...init,
|
|
79
|
-
...controller ? { signal: controller.signal } : {},
|
|
80
|
-
headers: requestHeaders
|
|
81
|
-
});
|
|
68
|
+
const response = await captureEffectAuthority().initiate(() => {
|
|
69
|
+
options.beforeRequest?.();
|
|
70
|
+
return fetcher(`${baseUrl}${path}`, {
|
|
71
|
+
...init,
|
|
72
|
+
...requestOptions.timeoutMs !== void 0 && !init.signal ? { signal: AbortSignal.timeout(requestOptions.timeoutMs) } : {},
|
|
73
|
+
headers: requestHeaders
|
|
82
74
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return await readProviderJsonResponse(response, "ClickClack response", { maxBytes: CLICKCLACK_INBOUND_JSON_LIMIT_BYTES });
|
|
94
|
-
} finally {
|
|
95
|
-
if (timeout) clearTimeout(timeout);
|
|
75
|
+
});
|
|
76
|
+
if (!response.ok) {
|
|
77
|
+
const detail = await readResponseTextLimited(response, CLICKCLACK_ERROR_BODY_LIMIT_BYTES);
|
|
78
|
+
throw new ClickClackHttpError(response.status, redactToolPayloadText(detail), response.headers);
|
|
79
|
+
}
|
|
80
|
+
if (requestOptions.responseMode === "none") {
|
|
81
|
+
try {
|
|
82
|
+
await response.body?.cancel();
|
|
83
|
+
} catch {}
|
|
84
|
+
return;
|
|
96
85
|
}
|
|
86
|
+
return await readProviderJsonResponse(response, "ClickClack response", { maxBytes: CLICKCLACK_INBOUND_JSON_LIMIT_BYTES });
|
|
97
87
|
}
|
|
98
88
|
async function requestObject(key, path, init) {
|
|
99
89
|
return (await request(path, init))[key];
|
|
@@ -109,11 +99,15 @@ function createClickClackClient(options) {
|
|
|
109
99
|
...typeof data.tail_cursor === "string" ? { tailCursor: data.tail_cursor } : {}
|
|
110
100
|
};
|
|
111
101
|
}
|
|
112
|
-
async function createMessage(path, body, opts) {
|
|
102
|
+
async function createMessage(path, body, opts, activity) {
|
|
113
103
|
return requestObject("message", path, {
|
|
114
104
|
method: "POST",
|
|
115
105
|
body: JSON.stringify({
|
|
116
106
|
body,
|
|
107
|
+
...activity ? {
|
|
108
|
+
kind: activity.kind,
|
|
109
|
+
turn_id: activity.turnId
|
|
110
|
+
} : {},
|
|
117
111
|
...opts?.quotedMessageId ? { quoted_message_id: opts.quotedMessageId } : {},
|
|
118
112
|
...opts?.nonce ? { nonce: opts.nonce } : {},
|
|
119
113
|
...provenanceFields(opts?.provenance)
|
|
@@ -139,12 +133,12 @@ function createClickClackClient(options) {
|
|
|
139
133
|
return async (id, afterSeq, limit = 20) => requestObject("messages", `/api/${resource}/${encodeURIComponent(id)}/messages?after_seq=${afterSeq}&limit=${limit}`);
|
|
140
134
|
}
|
|
141
135
|
return {
|
|
142
|
-
me:
|
|
136
|
+
me: () => requestObject("user", "/api/me"),
|
|
143
137
|
setBotCommands: async (commands) => requestObject("bot_commands", "/api/bots/self/commands", {
|
|
144
138
|
method: "PUT",
|
|
145
139
|
body: JSON.stringify({ commands })
|
|
146
140
|
}),
|
|
147
|
-
workspaces:
|
|
141
|
+
workspaces: () => requestObject("workspaces", "/api/workspaces"),
|
|
148
142
|
channels: async (workspaceId) => requestObject("channels", `/api/workspaces/${encodeURIComponent(workspaceId)}/channels`),
|
|
149
143
|
createChannel: async (workspaceId, channel) => requestObject("channel", `/api/workspaces/${encodeURIComponent(workspaceId)}/channels`, {
|
|
150
144
|
method: "POST",
|
|
@@ -200,7 +194,7 @@ function createClickClackClient(options) {
|
|
|
200
194
|
directMessages: messageList("dms"),
|
|
201
195
|
thread: async (messageId) => await request(`/api/messages/${encodeURIComponent(messageId)}/thread`),
|
|
202
196
|
message: async (messageId) => requestObject("message", `/api/messages/${encodeURIComponent(messageId)}`),
|
|
203
|
-
findMessageByNonce:
|
|
197
|
+
findMessageByNonce: (params) => findByNonce("message", params),
|
|
204
198
|
createChannelMessage: async (channelId, body, opts) => createMessage(`/api/channels/${encodeURIComponent(channelId)}/messages`, body, opts),
|
|
205
199
|
createThreadReply: async (messageId, body, opts) => createMessage(`/api/messages/${encodeURIComponent(messageId)}/thread/replies`, body, {
|
|
206
200
|
nonce: opts?.nonce,
|
|
@@ -238,15 +232,7 @@ function createClickClackClient(options) {
|
|
|
238
232
|
*/
|
|
239
233
|
createActivityMessage: async (params) => {
|
|
240
234
|
if (!params.channelId && !params.conversationId) throw new Error("createActivityMessage requires a channelId or conversationId");
|
|
241
|
-
return
|
|
242
|
-
method: "POST",
|
|
243
|
-
body: JSON.stringify({
|
|
244
|
-
body: params.body,
|
|
245
|
-
kind: params.kind,
|
|
246
|
-
turn_id: params.turnId,
|
|
247
|
-
...provenanceFields(params.provenance)
|
|
248
|
-
})
|
|
249
|
-
});
|
|
235
|
+
return createMessage(params.channelId ? `/api/channels/${encodeURIComponent(params.channelId)}/messages` : `/api/dms/${encodeURIComponent(params.conversationId ?? "")}/messages`, params.body, { provenance: params.provenance }, params);
|
|
250
236
|
},
|
|
251
237
|
updateMessageBody: async (messageId, body) => requestObject("message", `/api/messages/${encodeURIComponent(messageId)}`, {
|
|
252
238
|
method: "PATCH",
|