@agenr/openclaw-plugin 1.5.0 → 2026.6.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/LICENSE +21 -661
- package/README.md +1 -0
- package/dist/build-before-turn-artifact-NPUHVWFE.js +71 -0
- package/dist/build-recall-artifact-F3LS3PZX.js +62 -0
- package/dist/chunk-5AXMFBHR.js +14 -0
- package/dist/chunk-5AYIXQRF.js +4452 -0
- package/dist/chunk-5TIP2EPP.js +6944 -0
- package/dist/chunk-GAERET5Q.js +2070 -0
- package/dist/chunk-GF3PX3VM.js +41 -0
- package/dist/chunk-GKZQ5AG5.js +44 -0
- package/dist/chunk-LDJN7CVU.js +3231 -0
- package/dist/chunk-MC3C2XM5.js +148 -0
- package/dist/chunk-NBS62ES5.js +3012 -0
- package/dist/chunk-NSLTJBUC.js +270 -0
- package/dist/chunk-OJSIZDZD.js +9 -0
- package/dist/chunk-OWGQWQUP.js +45 -0
- package/dist/chunk-Q5UTJXHZ.js +1069 -0
- package/dist/chunk-SOQW7356.js +2416 -0
- package/dist/chunk-VBPYU7GO.js +597 -0
- package/dist/chunk-VTHBPXDQ.js +1750 -0
- package/dist/chunk-XFJ4S4G2.js +1679 -0
- package/dist/chunk-Y5NB3FTH.js +106 -0
- package/dist/chunk-ZX55JBV2.js +4451 -0
- package/dist/index.js +1905 -15298
- package/dist/lifecycle-checkpoint-IAC5FCQU.js +154 -0
- package/dist/scan-6JKPOQHD.js +6 -0
- package/dist/service-EKFACEN6.js +15 -0
- package/dist/service-RHNB5AEQ.js +861 -0
- package/dist/sink-AUAAWC5O.js +8 -0
- package/openclaw.plugin.json +148 -11
- package/package.json +7 -5
- package/dist/anthropic-RE4XNAKE.js +0 -5515
- package/dist/azure-openai-responses-IQLXOCZS.js +0 -190
- package/dist/chunk-6DQXEU2A.js +0 -32306
- package/dist/chunk-EAQYK3U2.js +0 -41
- package/dist/chunk-HNWLZUWE.js +0 -31
- package/dist/chunk-JRUUYSFL.js +0 -262
- package/dist/chunk-OLOUBEE5.js +0 -14022
- package/dist/chunk-P5HNPYGQ.js +0 -174
- package/dist/chunk-RD7BUOBD.js +0 -416
- package/dist/chunk-RWWH2U4W.js +0 -7056
- package/dist/chunk-SEOMNQGB.js +0 -86
- package/dist/chunk-SQLXP7LT.js +0 -4792
- package/dist/chunk-URGOKODJ.js +0 -17
- package/dist/dist-R6ESEJ6P.js +0 -1244
- package/dist/google-NAVXTQLO.js +0 -371
- package/dist/google-gemini-cli-NKYJWHX2.js +0 -712
- package/dist/google-vertex-ZBJ2EDRH.js +0 -414
- package/dist/mistral-SBQYC4J5.js +0 -38407
- package/dist/multipart-parser-DV373IRF.js +0 -371
- package/dist/openai-codex-responses-XN3T3DEN.js +0 -712
- package/dist/openai-completions-75ZFOFU6.js +0 -657
- package/dist/openai-responses-DCK4BVNT.js +0 -198
- package/dist/src-T5RRS2HN.js +0 -1408
|
@@ -1,371 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FormData,
|
|
3
|
-
file_default,
|
|
4
|
-
init_esm_min,
|
|
5
|
-
init_from
|
|
6
|
-
} from "./chunk-SQLXP7LT.js";
|
|
7
|
-
import {
|
|
8
|
-
__esm
|
|
9
|
-
} from "./chunk-EAQYK3U2.js";
|
|
10
|
-
|
|
11
|
-
// ../../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/utils/multipart-parser.js
|
|
12
|
-
function _fileName(headerValue) {
|
|
13
|
-
const m = headerValue.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);
|
|
14
|
-
if (!m) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const match = m[2] || m[3] || "";
|
|
18
|
-
let filename = match.slice(match.lastIndexOf("\\") + 1);
|
|
19
|
-
filename = filename.replace(/%22/g, '"');
|
|
20
|
-
filename = filename.replace(/&#(\d{4});/g, (m2, code) => {
|
|
21
|
-
return String.fromCharCode(code);
|
|
22
|
-
});
|
|
23
|
-
return filename;
|
|
24
|
-
}
|
|
25
|
-
async function toFormData(Body, ct) {
|
|
26
|
-
if (!/multipart/i.test(ct)) {
|
|
27
|
-
throw new TypeError("Failed to fetch");
|
|
28
|
-
}
|
|
29
|
-
const m = ct.match(/boundary=(?:"([^"]+)"|([^;]+))/i);
|
|
30
|
-
if (!m) {
|
|
31
|
-
throw new TypeError("no or bad content-type header, no multipart boundary");
|
|
32
|
-
}
|
|
33
|
-
const parser = new MultipartParser(m[1] || m[2]);
|
|
34
|
-
let headerField;
|
|
35
|
-
let headerValue;
|
|
36
|
-
let entryValue;
|
|
37
|
-
let entryName;
|
|
38
|
-
let contentType;
|
|
39
|
-
let filename;
|
|
40
|
-
const entryChunks = [];
|
|
41
|
-
const formData = new FormData();
|
|
42
|
-
const onPartData = (ui8a) => {
|
|
43
|
-
entryValue += decoder.decode(ui8a, { stream: true });
|
|
44
|
-
};
|
|
45
|
-
const appendToFile = (ui8a) => {
|
|
46
|
-
entryChunks.push(ui8a);
|
|
47
|
-
};
|
|
48
|
-
const appendFileToFormData = () => {
|
|
49
|
-
const file = new file_default(entryChunks, filename, { type: contentType });
|
|
50
|
-
formData.append(entryName, file);
|
|
51
|
-
};
|
|
52
|
-
const appendEntryToFormData = () => {
|
|
53
|
-
formData.append(entryName, entryValue);
|
|
54
|
-
};
|
|
55
|
-
const decoder = new TextDecoder("utf-8");
|
|
56
|
-
decoder.decode();
|
|
57
|
-
parser.onPartBegin = function() {
|
|
58
|
-
parser.onPartData = onPartData;
|
|
59
|
-
parser.onPartEnd = appendEntryToFormData;
|
|
60
|
-
headerField = "";
|
|
61
|
-
headerValue = "";
|
|
62
|
-
entryValue = "";
|
|
63
|
-
entryName = "";
|
|
64
|
-
contentType = "";
|
|
65
|
-
filename = null;
|
|
66
|
-
entryChunks.length = 0;
|
|
67
|
-
};
|
|
68
|
-
parser.onHeaderField = function(ui8a) {
|
|
69
|
-
headerField += decoder.decode(ui8a, { stream: true });
|
|
70
|
-
};
|
|
71
|
-
parser.onHeaderValue = function(ui8a) {
|
|
72
|
-
headerValue += decoder.decode(ui8a, { stream: true });
|
|
73
|
-
};
|
|
74
|
-
parser.onHeaderEnd = function() {
|
|
75
|
-
headerValue += decoder.decode();
|
|
76
|
-
headerField = headerField.toLowerCase();
|
|
77
|
-
if (headerField === "content-disposition") {
|
|
78
|
-
const m2 = headerValue.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);
|
|
79
|
-
if (m2) {
|
|
80
|
-
entryName = m2[2] || m2[3] || "";
|
|
81
|
-
}
|
|
82
|
-
filename = _fileName(headerValue);
|
|
83
|
-
if (filename) {
|
|
84
|
-
parser.onPartData = appendToFile;
|
|
85
|
-
parser.onPartEnd = appendFileToFormData;
|
|
86
|
-
}
|
|
87
|
-
} else if (headerField === "content-type") {
|
|
88
|
-
contentType = headerValue;
|
|
89
|
-
}
|
|
90
|
-
headerValue = "";
|
|
91
|
-
headerField = "";
|
|
92
|
-
};
|
|
93
|
-
for await (const chunk of Body) {
|
|
94
|
-
parser.write(chunk);
|
|
95
|
-
}
|
|
96
|
-
parser.end();
|
|
97
|
-
return formData;
|
|
98
|
-
}
|
|
99
|
-
var s, S, f, F, LF, CR, SPACE, HYPHEN, COLON, A, Z, lower, noop, MultipartParser;
|
|
100
|
-
var init_multipart_parser = __esm({
|
|
101
|
-
"../../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/utils/multipart-parser.js"() {
|
|
102
|
-
init_from();
|
|
103
|
-
init_esm_min();
|
|
104
|
-
s = 0;
|
|
105
|
-
S = {
|
|
106
|
-
START_BOUNDARY: s++,
|
|
107
|
-
HEADER_FIELD_START: s++,
|
|
108
|
-
HEADER_FIELD: s++,
|
|
109
|
-
HEADER_VALUE_START: s++,
|
|
110
|
-
HEADER_VALUE: s++,
|
|
111
|
-
HEADER_VALUE_ALMOST_DONE: s++,
|
|
112
|
-
HEADERS_ALMOST_DONE: s++,
|
|
113
|
-
PART_DATA_START: s++,
|
|
114
|
-
PART_DATA: s++,
|
|
115
|
-
END: s++
|
|
116
|
-
};
|
|
117
|
-
f = 1;
|
|
118
|
-
F = {
|
|
119
|
-
PART_BOUNDARY: f,
|
|
120
|
-
LAST_BOUNDARY: f *= 2
|
|
121
|
-
};
|
|
122
|
-
LF = 10;
|
|
123
|
-
CR = 13;
|
|
124
|
-
SPACE = 32;
|
|
125
|
-
HYPHEN = 45;
|
|
126
|
-
COLON = 58;
|
|
127
|
-
A = 97;
|
|
128
|
-
Z = 122;
|
|
129
|
-
lower = (c) => c | 32;
|
|
130
|
-
noop = () => {
|
|
131
|
-
};
|
|
132
|
-
MultipartParser = class {
|
|
133
|
-
/**
|
|
134
|
-
* @param {string} boundary
|
|
135
|
-
*/
|
|
136
|
-
constructor(boundary) {
|
|
137
|
-
this.index = 0;
|
|
138
|
-
this.flags = 0;
|
|
139
|
-
this.onHeaderEnd = noop;
|
|
140
|
-
this.onHeaderField = noop;
|
|
141
|
-
this.onHeadersEnd = noop;
|
|
142
|
-
this.onHeaderValue = noop;
|
|
143
|
-
this.onPartBegin = noop;
|
|
144
|
-
this.onPartData = noop;
|
|
145
|
-
this.onPartEnd = noop;
|
|
146
|
-
this.boundaryChars = {};
|
|
147
|
-
boundary = "\r\n--" + boundary;
|
|
148
|
-
const ui8a = new Uint8Array(boundary.length);
|
|
149
|
-
for (let i = 0; i < boundary.length; i++) {
|
|
150
|
-
ui8a[i] = boundary.charCodeAt(i);
|
|
151
|
-
this.boundaryChars[ui8a[i]] = true;
|
|
152
|
-
}
|
|
153
|
-
this.boundary = ui8a;
|
|
154
|
-
this.lookbehind = new Uint8Array(this.boundary.length + 8);
|
|
155
|
-
this.state = S.START_BOUNDARY;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* @param {Uint8Array} data
|
|
159
|
-
*/
|
|
160
|
-
write(data) {
|
|
161
|
-
let i = 0;
|
|
162
|
-
const length_ = data.length;
|
|
163
|
-
let previousIndex = this.index;
|
|
164
|
-
let { lookbehind, boundary, boundaryChars, index, state, flags } = this;
|
|
165
|
-
const boundaryLength = this.boundary.length;
|
|
166
|
-
const boundaryEnd = boundaryLength - 1;
|
|
167
|
-
const bufferLength = data.length;
|
|
168
|
-
let c;
|
|
169
|
-
let cl;
|
|
170
|
-
const mark = (name) => {
|
|
171
|
-
this[name + "Mark"] = i;
|
|
172
|
-
};
|
|
173
|
-
const clear = (name) => {
|
|
174
|
-
delete this[name + "Mark"];
|
|
175
|
-
};
|
|
176
|
-
const callback = (callbackSymbol, start, end, ui8a) => {
|
|
177
|
-
if (start === void 0 || start !== end) {
|
|
178
|
-
this[callbackSymbol](ui8a && ui8a.subarray(start, end));
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
const dataCallback = (name, clear2) => {
|
|
182
|
-
const markSymbol = name + "Mark";
|
|
183
|
-
if (!(markSymbol in this)) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
if (clear2) {
|
|
187
|
-
callback(name, this[markSymbol], i, data);
|
|
188
|
-
delete this[markSymbol];
|
|
189
|
-
} else {
|
|
190
|
-
callback(name, this[markSymbol], data.length, data);
|
|
191
|
-
this[markSymbol] = 0;
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
for (i = 0; i < length_; i++) {
|
|
195
|
-
c = data[i];
|
|
196
|
-
switch (state) {
|
|
197
|
-
case S.START_BOUNDARY:
|
|
198
|
-
if (index === boundary.length - 2) {
|
|
199
|
-
if (c === HYPHEN) {
|
|
200
|
-
flags |= F.LAST_BOUNDARY;
|
|
201
|
-
} else if (c !== CR) {
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
index++;
|
|
205
|
-
break;
|
|
206
|
-
} else if (index - 1 === boundary.length - 2) {
|
|
207
|
-
if (flags & F.LAST_BOUNDARY && c === HYPHEN) {
|
|
208
|
-
state = S.END;
|
|
209
|
-
flags = 0;
|
|
210
|
-
} else if (!(flags & F.LAST_BOUNDARY) && c === LF) {
|
|
211
|
-
index = 0;
|
|
212
|
-
callback("onPartBegin");
|
|
213
|
-
state = S.HEADER_FIELD_START;
|
|
214
|
-
} else {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
if (c !== boundary[index + 2]) {
|
|
220
|
-
index = -2;
|
|
221
|
-
}
|
|
222
|
-
if (c === boundary[index + 2]) {
|
|
223
|
-
index++;
|
|
224
|
-
}
|
|
225
|
-
break;
|
|
226
|
-
case S.HEADER_FIELD_START:
|
|
227
|
-
state = S.HEADER_FIELD;
|
|
228
|
-
mark("onHeaderField");
|
|
229
|
-
index = 0;
|
|
230
|
-
// falls through
|
|
231
|
-
case S.HEADER_FIELD:
|
|
232
|
-
if (c === CR) {
|
|
233
|
-
clear("onHeaderField");
|
|
234
|
-
state = S.HEADERS_ALMOST_DONE;
|
|
235
|
-
break;
|
|
236
|
-
}
|
|
237
|
-
index++;
|
|
238
|
-
if (c === HYPHEN) {
|
|
239
|
-
break;
|
|
240
|
-
}
|
|
241
|
-
if (c === COLON) {
|
|
242
|
-
if (index === 1) {
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
dataCallback("onHeaderField", true);
|
|
246
|
-
state = S.HEADER_VALUE_START;
|
|
247
|
-
break;
|
|
248
|
-
}
|
|
249
|
-
cl = lower(c);
|
|
250
|
-
if (cl < A || cl > Z) {
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
break;
|
|
254
|
-
case S.HEADER_VALUE_START:
|
|
255
|
-
if (c === SPACE) {
|
|
256
|
-
break;
|
|
257
|
-
}
|
|
258
|
-
mark("onHeaderValue");
|
|
259
|
-
state = S.HEADER_VALUE;
|
|
260
|
-
// falls through
|
|
261
|
-
case S.HEADER_VALUE:
|
|
262
|
-
if (c === CR) {
|
|
263
|
-
dataCallback("onHeaderValue", true);
|
|
264
|
-
callback("onHeaderEnd");
|
|
265
|
-
state = S.HEADER_VALUE_ALMOST_DONE;
|
|
266
|
-
}
|
|
267
|
-
break;
|
|
268
|
-
case S.HEADER_VALUE_ALMOST_DONE:
|
|
269
|
-
if (c !== LF) {
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
state = S.HEADER_FIELD_START;
|
|
273
|
-
break;
|
|
274
|
-
case S.HEADERS_ALMOST_DONE:
|
|
275
|
-
if (c !== LF) {
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
callback("onHeadersEnd");
|
|
279
|
-
state = S.PART_DATA_START;
|
|
280
|
-
break;
|
|
281
|
-
case S.PART_DATA_START:
|
|
282
|
-
state = S.PART_DATA;
|
|
283
|
-
mark("onPartData");
|
|
284
|
-
// falls through
|
|
285
|
-
case S.PART_DATA:
|
|
286
|
-
previousIndex = index;
|
|
287
|
-
if (index === 0) {
|
|
288
|
-
i += boundaryEnd;
|
|
289
|
-
while (i < bufferLength && !(data[i] in boundaryChars)) {
|
|
290
|
-
i += boundaryLength;
|
|
291
|
-
}
|
|
292
|
-
i -= boundaryEnd;
|
|
293
|
-
c = data[i];
|
|
294
|
-
}
|
|
295
|
-
if (index < boundary.length) {
|
|
296
|
-
if (boundary[index] === c) {
|
|
297
|
-
if (index === 0) {
|
|
298
|
-
dataCallback("onPartData", true);
|
|
299
|
-
}
|
|
300
|
-
index++;
|
|
301
|
-
} else {
|
|
302
|
-
index = 0;
|
|
303
|
-
}
|
|
304
|
-
} else if (index === boundary.length) {
|
|
305
|
-
index++;
|
|
306
|
-
if (c === CR) {
|
|
307
|
-
flags |= F.PART_BOUNDARY;
|
|
308
|
-
} else if (c === HYPHEN) {
|
|
309
|
-
flags |= F.LAST_BOUNDARY;
|
|
310
|
-
} else {
|
|
311
|
-
index = 0;
|
|
312
|
-
}
|
|
313
|
-
} else if (index - 1 === boundary.length) {
|
|
314
|
-
if (flags & F.PART_BOUNDARY) {
|
|
315
|
-
index = 0;
|
|
316
|
-
if (c === LF) {
|
|
317
|
-
flags &= ~F.PART_BOUNDARY;
|
|
318
|
-
callback("onPartEnd");
|
|
319
|
-
callback("onPartBegin");
|
|
320
|
-
state = S.HEADER_FIELD_START;
|
|
321
|
-
break;
|
|
322
|
-
}
|
|
323
|
-
} else if (flags & F.LAST_BOUNDARY) {
|
|
324
|
-
if (c === HYPHEN) {
|
|
325
|
-
callback("onPartEnd");
|
|
326
|
-
state = S.END;
|
|
327
|
-
flags = 0;
|
|
328
|
-
} else {
|
|
329
|
-
index = 0;
|
|
330
|
-
}
|
|
331
|
-
} else {
|
|
332
|
-
index = 0;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
if (index > 0) {
|
|
336
|
-
lookbehind[index - 1] = c;
|
|
337
|
-
} else if (previousIndex > 0) {
|
|
338
|
-
const _lookbehind = new Uint8Array(lookbehind.buffer, lookbehind.byteOffset, lookbehind.byteLength);
|
|
339
|
-
callback("onPartData", 0, previousIndex, _lookbehind);
|
|
340
|
-
previousIndex = 0;
|
|
341
|
-
mark("onPartData");
|
|
342
|
-
i--;
|
|
343
|
-
}
|
|
344
|
-
break;
|
|
345
|
-
case S.END:
|
|
346
|
-
break;
|
|
347
|
-
default:
|
|
348
|
-
throw new Error(`Unexpected state entered: ${state}`);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
dataCallback("onHeaderField");
|
|
352
|
-
dataCallback("onHeaderValue");
|
|
353
|
-
dataCallback("onPartData");
|
|
354
|
-
this.index = index;
|
|
355
|
-
this.state = state;
|
|
356
|
-
this.flags = flags;
|
|
357
|
-
}
|
|
358
|
-
end() {
|
|
359
|
-
if (this.state === S.HEADER_FIELD_START && this.index === 0 || this.state === S.PART_DATA && this.index === this.boundary.length) {
|
|
360
|
-
this.onPartEnd();
|
|
361
|
-
} else if (this.state !== S.END) {
|
|
362
|
-
throw new Error("MultipartParser.end(): stream ended unexpectedly");
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
init_multipart_parser();
|
|
369
|
-
export {
|
|
370
|
-
toFormData
|
|
371
|
-
};
|