@openclaw/clickclack 2026.11.3 → 2026.11.5-beta.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/.setup/{channel-BX2RqmGn.mjs → channel-D3WIuNxS.mjs} +398 -506
- package/dist/.setup/{resolve-B-W04sGX.mjs → resolve-BgFJI_p4.mjs} +28 -52
- package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-BBjsoOtd.mjs} +0 -1
- package/dist/.setup/{runtime-api-DIu-sNJs.mjs → runtime-api-CMReYU7v.mjs} +325 -371
- package/dist/.setup/secret-contract-api--45pFCg3.mjs +2 -0
- package/dist/.setup/{setup-claim-BJPvHiWS.mjs → setup-claim-Ca2nzQHc.mjs} +4 -9
- package/dist/.setup/{setup-plugin-api-BiMffAUC.mjs → setup-plugin-api-CFG0EYat.mjs} +1 -1
- package/dist/.setup/setup-plugin-api-Cg_ECaNj.mjs +1 -0
- package/dist/.setup/{setup-surface-fPdDl0l2.mjs → setup-surface-CSITttSD.mjs} +5 -5
- package/dist/.setup/{setup-verify-B5iJBDrk.mjs → setup-verify-DLfG0Fyt.mjs} +12 -24
- package/dist/.source-module-urls/aa673c321fe9be084b8926cbe5388ff5e2a41371389e19ca60a1983f2b634030.json +1 -0
- package/dist/api.js +3 -3
- package/dist/channel-plugin-api.js +1 -2
- package/dist/doctor-contract-api.js +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime-api.js +4 -4
- package/dist/secret-contract-api.js +1 -2
- package/dist/setup-entry.js +2 -2
- package/dist/setup-plugin-api.js +1 -2
- 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/secret-contract-api-CBcsgIYZ.mjs +0 -3
- package/dist/.setup/setup-plugin-api-bSnZClKM.mjs +0 -2
- 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,14 +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 { fetchWithSsrFGuard, ssrfPolicyFromHttpBaseUrlAllowedOrigin } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
7
|
-
import path from "node:path";
|
|
8
|
-
//#region extensions/clickclack/src/ws-runtime.ts
|
|
9
|
-
const require = createRequire(import.meta.url);
|
|
10
|
-
const WebSocket = require(path.join(path.dirname(require.resolve("ws/package.json")), "index.js"));
|
|
11
|
-
//#endregion
|
|
12
6
|
//#region extensions/clickclack/src/http-client.ts
|
|
13
7
|
/**
|
|
14
8
|
* Serializes optional provenance into the wire fields. Unknown JSON fields
|
|
@@ -60,7 +54,7 @@ function normalizeClickClackCorrelationId(value) {
|
|
|
60
54
|
}
|
|
61
55
|
function createClickClackClient(options) {
|
|
62
56
|
const baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
63
|
-
const
|
|
57
|
+
const fetcher = options.fetch ?? fetch;
|
|
64
58
|
const correlationId = normalizeClickClackCorrelationId(options.correlationId);
|
|
65
59
|
const headers = {
|
|
66
60
|
Authorization: `Bearer ${options.token}`,
|
|
@@ -71,39 +65,25 @@ function createClickClackClient(options) {
|
|
|
71
65
|
for (const [key, value] of Object.entries(headers)) requestHeaders.set(key, value);
|
|
72
66
|
if (correlationId) requestHeaders.set(CLICKCLACK_CORRELATION_ID_HEADER, correlationId);
|
|
73
67
|
if (init.body && !(init.body instanceof FormData)) requestHeaders.set("Content-Type", "application/json");
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
auditContext: "clickclack-api"
|
|
88
|
-
}));
|
|
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
|
|
74
|
+
});
|
|
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") {
|
|
89
81
|
try {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
if (requestOptions.responseMode === "none") {
|
|
95
|
-
try {
|
|
96
|
-
await response.body?.cancel();
|
|
97
|
-
} catch {}
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
return await readProviderJsonResponse(response, "ClickClack response", { maxBytes: CLICKCLACK_INBOUND_JSON_LIMIT_BYTES });
|
|
101
|
-
} finally {
|
|
102
|
-
await release();
|
|
103
|
-
}
|
|
104
|
-
} finally {
|
|
105
|
-
if (timeout) clearTimeout(timeout);
|
|
82
|
+
await response.body?.cancel();
|
|
83
|
+
} catch {}
|
|
84
|
+
return;
|
|
106
85
|
}
|
|
86
|
+
return await readProviderJsonResponse(response, "ClickClack response", { maxBytes: CLICKCLACK_INBOUND_JSON_LIMIT_BYTES });
|
|
107
87
|
}
|
|
108
88
|
async function requestObject(key, path, init) {
|
|
109
89
|
return (await request(path, init))[key];
|
|
@@ -119,11 +99,15 @@ function createClickClackClient(options) {
|
|
|
119
99
|
...typeof data.tail_cursor === "string" ? { tailCursor: data.tail_cursor } : {}
|
|
120
100
|
};
|
|
121
101
|
}
|
|
122
|
-
async function createMessage(path, body, opts) {
|
|
102
|
+
async function createMessage(path, body, opts, activity) {
|
|
123
103
|
return requestObject("message", path, {
|
|
124
104
|
method: "POST",
|
|
125
105
|
body: JSON.stringify({
|
|
126
106
|
body,
|
|
107
|
+
...activity ? {
|
|
108
|
+
kind: activity.kind,
|
|
109
|
+
turn_id: activity.turnId
|
|
110
|
+
} : {},
|
|
127
111
|
...opts?.quotedMessageId ? { quoted_message_id: opts.quotedMessageId } : {},
|
|
128
112
|
...opts?.nonce ? { nonce: opts.nonce } : {},
|
|
129
113
|
...provenanceFields(opts?.provenance)
|
|
@@ -149,12 +133,12 @@ function createClickClackClient(options) {
|
|
|
149
133
|
return async (id, afterSeq, limit = 20) => requestObject("messages", `/api/${resource}/${encodeURIComponent(id)}/messages?after_seq=${afterSeq}&limit=${limit}`);
|
|
150
134
|
}
|
|
151
135
|
return {
|
|
152
|
-
me:
|
|
136
|
+
me: () => requestObject("user", "/api/me"),
|
|
153
137
|
setBotCommands: async (commands) => requestObject("bot_commands", "/api/bots/self/commands", {
|
|
154
138
|
method: "PUT",
|
|
155
139
|
body: JSON.stringify({ commands })
|
|
156
140
|
}),
|
|
157
|
-
workspaces:
|
|
141
|
+
workspaces: () => requestObject("workspaces", "/api/workspaces"),
|
|
158
142
|
channels: async (workspaceId) => requestObject("channels", `/api/workspaces/${encodeURIComponent(workspaceId)}/channels`),
|
|
159
143
|
createChannel: async (workspaceId, channel) => requestObject("channel", `/api/workspaces/${encodeURIComponent(workspaceId)}/channels`, {
|
|
160
144
|
method: "POST",
|
|
@@ -210,7 +194,7 @@ function createClickClackClient(options) {
|
|
|
210
194
|
directMessages: messageList("dms"),
|
|
211
195
|
thread: async (messageId) => await request(`/api/messages/${encodeURIComponent(messageId)}/thread`),
|
|
212
196
|
message: async (messageId) => requestObject("message", `/api/messages/${encodeURIComponent(messageId)}`),
|
|
213
|
-
findMessageByNonce:
|
|
197
|
+
findMessageByNonce: (params) => findByNonce("message", params),
|
|
214
198
|
createChannelMessage: async (channelId, body, opts) => createMessage(`/api/channels/${encodeURIComponent(channelId)}/messages`, body, opts),
|
|
215
199
|
createThreadReply: async (messageId, body, opts) => createMessage(`/api/messages/${encodeURIComponent(messageId)}/thread/replies`, body, {
|
|
216
200
|
nonce: opts?.nonce,
|
|
@@ -248,15 +232,7 @@ function createClickClackClient(options) {
|
|
|
248
232
|
*/
|
|
249
233
|
createActivityMessage: async (params) => {
|
|
250
234
|
if (!params.channelId && !params.conversationId) throw new Error("createActivityMessage requires a channelId or conversationId");
|
|
251
|
-
return
|
|
252
|
-
method: "POST",
|
|
253
|
-
body: JSON.stringify({
|
|
254
|
-
body: params.body,
|
|
255
|
-
kind: params.kind,
|
|
256
|
-
turn_id: params.turnId,
|
|
257
|
-
...provenanceFields(params.provenance)
|
|
258
|
-
})
|
|
259
|
-
});
|
|
235
|
+
return createMessage(params.channelId ? `/api/channels/${encodeURIComponent(params.channelId)}/messages` : `/api/dms/${encodeURIComponent(params.conversationId ?? "")}/messages`, params.body, { provenance: params.provenance }, params);
|
|
260
236
|
},
|
|
261
237
|
updateMessageBody: async (messageId, body) => requestObject("message", `/api/messages/${encodeURIComponent(messageId)}`, {
|
|
262
238
|
method: "PATCH",
|