perstack 0.0.123 → 0.0.124
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/bin/cli.js +531 -1587
- package/dist/bin/cli.js.map +1 -1
- package/dist/{chunk-D_gEzPfs.js → chunk-DORXReHP.js} +12 -22
- package/dist/{devtools-Bhpwh697.js → devtools-Bu9H6b8U.js} +53 -82
- package/dist/{devtools-Bhpwh697.js.map → devtools-Bu9H6b8U.js.map} +1 -1
- package/dist/{dist-CtJ4Bmgn.js → dist-BaZPOblZ.js} +3 -13
- package/dist/{dist-CtJ4Bmgn.js.map → dist-BaZPOblZ.js.map} +1 -1
- package/dist/{dist-ByKamhCW.js → dist-RHs5gh6F.js} +404 -525
- package/dist/dist-RHs5gh6F.js.map +1 -0
- package/dist/{from-Bc9kdEMW.js → from-CDHHdxdc.js} +10 -55
- package/dist/{from-Bc9kdEMW.js.map → from-CDHHdxdc.js.map} +1 -1
- package/dist/{multipart-parser-BTFMhKVK.js → multipart-parser-DXNPpbYa.js} +7 -9
- package/dist/{multipart-parser-BTFMhKVK.js.map → multipart-parser-DXNPpbYa.js.map} +1 -1
- package/dist/{resolve-expert-NYqP4qog.js → resolve-expert-temTHQyu.js} +3 -4
- package/dist/{resolve-expert-NYqP4qog.js.map → resolve-expert-temTHQyu.js.map} +1 -1
- package/dist/{src-ziv0IPUn.js → src-Cl4mko2y.js} +8 -22
- package/dist/{src-ziv0IPUn.js.map → src-Cl4mko2y.js.map} +1 -1
- package/dist/{token-CG9AEZQ3.js → token-C9_l0CGs.js} +5 -7
- package/dist/{token-CG9AEZQ3.js.map → token-C9_l0CGs.js.map} +1 -1
- package/dist/{token-error-_b-fOBh2.js → token-error-Bru5BVnt.js} +3 -4
- package/dist/{token-error-_b-fOBh2.js.map → token-error-Bru5BVnt.js.map} +1 -1
- package/dist/token-util-DVMOukJX.js +4 -0
- package/dist/{token-util-BNFarwY-.js → token-util-D_6sOotR.js} +4 -8
- package/dist/{token-util-BNFarwY-.js.map → token-util-D_6sOotR.js.map} +1 -1
- package/package.json +3 -3
- package/dist/dist-ByKamhCW.js.map +0 -1
- package/dist/token-util-nX2KFqwd.js +0 -6
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { n as __esmMin } from "./chunk-
|
|
2
|
-
import { a as File, i as init_esm_min, n as FormData, t as init_from } from "./from-
|
|
3
|
-
|
|
1
|
+
import { n as __esmMin } from "./chunk-DORXReHP.js";
|
|
2
|
+
import { a as File, i as init_esm_min, n as FormData, t as init_from } from "./from-CDHHdxdc.js";
|
|
4
3
|
//#region ../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/utils/multipart-parser.js
|
|
5
4
|
function _fileName(headerValue) {
|
|
6
5
|
const m = headerValue.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);
|
|
@@ -78,7 +77,8 @@ async function toFormData(Body, ct) {
|
|
|
78
77
|
return formData;
|
|
79
78
|
}
|
|
80
79
|
var s, S, f, F, LF, CR, SPACE, HYPHEN, COLON, A, Z, lower, noop, MultipartParser;
|
|
81
|
-
|
|
80
|
+
//#endregion
|
|
81
|
+
__esmMin((() => {
|
|
82
82
|
init_from();
|
|
83
83
|
init_esm_min();
|
|
84
84
|
s = 0;
|
|
@@ -290,9 +290,7 @@ var init_multipart_parser = __esmMin((() => {
|
|
|
290
290
|
else if (this.state !== S.END) throw new Error("MultipartParser.end(): stream ended unexpectedly");
|
|
291
291
|
}
|
|
292
292
|
};
|
|
293
|
-
}));
|
|
294
|
-
|
|
295
|
-
//#endregion
|
|
296
|
-
init_multipart_parser();
|
|
293
|
+
}))();
|
|
297
294
|
export { toFormData };
|
|
298
|
-
|
|
295
|
+
|
|
296
|
+
//# sourceMappingURL=multipart-parser-DXNPpbYa.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multipart-parser-BTFMhKVK.js","names":[],"sources":["../../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/utils/multipart-parser.js"],"sourcesContent":["import {File} from 'fetch-blob/from.js';\nimport {FormData} from 'formdata-polyfill/esm.min.js';\n\nlet s = 0;\nconst S = {\n\tSTART_BOUNDARY: s++,\n\tHEADER_FIELD_START: s++,\n\tHEADER_FIELD: s++,\n\tHEADER_VALUE_START: s++,\n\tHEADER_VALUE: s++,\n\tHEADER_VALUE_ALMOST_DONE: s++,\n\tHEADERS_ALMOST_DONE: s++,\n\tPART_DATA_START: s++,\n\tPART_DATA: s++,\n\tEND: s++\n};\n\nlet f = 1;\nconst F = {\n\tPART_BOUNDARY: f,\n\tLAST_BOUNDARY: f *= 2\n};\n\nconst LF = 10;\nconst CR = 13;\nconst SPACE = 32;\nconst HYPHEN = 45;\nconst COLON = 58;\nconst A = 97;\nconst Z = 122;\n\nconst lower = c => c | 0x20;\n\nconst noop = () => {};\n\nclass MultipartParser {\n\t/**\n\t * @param {string} boundary\n\t */\n\tconstructor(boundary) {\n\t\tthis.index = 0;\n\t\tthis.flags = 0;\n\n\t\tthis.onHeaderEnd = noop;\n\t\tthis.onHeaderField = noop;\n\t\tthis.onHeadersEnd = noop;\n\t\tthis.onHeaderValue = noop;\n\t\tthis.onPartBegin = noop;\n\t\tthis.onPartData = noop;\n\t\tthis.onPartEnd = noop;\n\n\t\tthis.boundaryChars = {};\n\n\t\tboundary = '\\r\\n--' + boundary;\n\t\tconst ui8a = new Uint8Array(boundary.length);\n\t\tfor (let i = 0; i < boundary.length; i++) {\n\t\t\tui8a[i] = boundary.charCodeAt(i);\n\t\t\tthis.boundaryChars[ui8a[i]] = true;\n\t\t}\n\n\t\tthis.boundary = ui8a;\n\t\tthis.lookbehind = new Uint8Array(this.boundary.length + 8);\n\t\tthis.state = S.START_BOUNDARY;\n\t}\n\n\t/**\n\t * @param {Uint8Array} data\n\t */\n\twrite(data) {\n\t\tlet i = 0;\n\t\tconst length_ = data.length;\n\t\tlet previousIndex = this.index;\n\t\tlet {lookbehind, boundary, boundaryChars, index, state, flags} = this;\n\t\tconst boundaryLength = this.boundary.length;\n\t\tconst boundaryEnd = boundaryLength - 1;\n\t\tconst bufferLength = data.length;\n\t\tlet c;\n\t\tlet cl;\n\n\t\tconst mark = name => {\n\t\t\tthis[name + 'Mark'] = i;\n\t\t};\n\n\t\tconst clear = name => {\n\t\t\tdelete this[name + 'Mark'];\n\t\t};\n\n\t\tconst callback = (callbackSymbol, start, end, ui8a) => {\n\t\t\tif (start === undefined || start !== end) {\n\t\t\t\tthis[callbackSymbol](ui8a && ui8a.subarray(start, end));\n\t\t\t}\n\t\t};\n\n\t\tconst dataCallback = (name, clear) => {\n\t\t\tconst markSymbol = name + 'Mark';\n\t\t\tif (!(markSymbol in this)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (clear) {\n\t\t\t\tcallback(name, this[markSymbol], i, data);\n\t\t\t\tdelete this[markSymbol];\n\t\t\t} else {\n\t\t\t\tcallback(name, this[markSymbol], data.length, data);\n\t\t\t\tthis[markSymbol] = 0;\n\t\t\t}\n\t\t};\n\n\t\tfor (i = 0; i < length_; i++) {\n\t\t\tc = data[i];\n\n\t\t\tswitch (state) {\n\t\t\t\tcase S.START_BOUNDARY:\n\t\t\t\t\tif (index === boundary.length - 2) {\n\t\t\t\t\t\tif (c === HYPHEN) {\n\t\t\t\t\t\t\tflags |= F.LAST_BOUNDARY;\n\t\t\t\t\t\t} else if (c !== CR) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (index - 1 === boundary.length - 2) {\n\t\t\t\t\t\tif (flags & F.LAST_BOUNDARY && c === HYPHEN) {\n\t\t\t\t\t\t\tstate = S.END;\n\t\t\t\t\t\t\tflags = 0;\n\t\t\t\t\t\t} else if (!(flags & F.LAST_BOUNDARY) && c === LF) {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t\tcallback('onPartBegin');\n\t\t\t\t\t\t\tstate = S.HEADER_FIELD_START;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c !== boundary[index + 2]) {\n\t\t\t\t\t\tindex = -2;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c === boundary[index + 2]) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADER_FIELD_START:\n\t\t\t\t\tstate = S.HEADER_FIELD;\n\t\t\t\t\tmark('onHeaderField');\n\t\t\t\t\tindex = 0;\n\t\t\t\t\t// falls through\n\t\t\t\tcase S.HEADER_FIELD:\n\t\t\t\t\tif (c === CR) {\n\t\t\t\t\t\tclear('onHeaderField');\n\t\t\t\t\t\tstate = S.HEADERS_ALMOST_DONE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tindex++;\n\t\t\t\t\tif (c === HYPHEN) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c === COLON) {\n\t\t\t\t\t\tif (index === 1) {\n\t\t\t\t\t\t\t// empty header field\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdataCallback('onHeaderField', true);\n\t\t\t\t\t\tstate = S.HEADER_VALUE_START;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcl = lower(c);\n\t\t\t\t\tif (cl < A || cl > Z) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADER_VALUE_START:\n\t\t\t\t\tif (c === SPACE) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tmark('onHeaderValue');\n\t\t\t\t\tstate = S.HEADER_VALUE;\n\t\t\t\t\t// falls through\n\t\t\t\tcase S.HEADER_VALUE:\n\t\t\t\t\tif (c === CR) {\n\t\t\t\t\t\tdataCallback('onHeaderValue', true);\n\t\t\t\t\t\tcallback('onHeaderEnd');\n\t\t\t\t\t\tstate = S.HEADER_VALUE_ALMOST_DONE;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADER_VALUE_ALMOST_DONE:\n\t\t\t\t\tif (c !== LF) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate = S.HEADER_FIELD_START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADERS_ALMOST_DONE:\n\t\t\t\t\tif (c !== LF) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tcallback('onHeadersEnd');\n\t\t\t\t\tstate = S.PART_DATA_START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.PART_DATA_START:\n\t\t\t\t\tstate = S.PART_DATA;\n\t\t\t\t\tmark('onPartData');\n\t\t\t\t\t// falls through\n\t\t\t\tcase S.PART_DATA:\n\t\t\t\t\tpreviousIndex = index;\n\n\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t// boyer-moore derrived algorithm to safely skip non-boundary data\n\t\t\t\t\t\ti += boundaryEnd;\n\t\t\t\t\t\twhile (i < bufferLength && !(data[i] in boundaryChars)) {\n\t\t\t\t\t\t\ti += boundaryLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ti -= boundaryEnd;\n\t\t\t\t\t\tc = data[i];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index < boundary.length) {\n\t\t\t\t\t\tif (boundary[index] === c) {\n\t\t\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t\t\tdataCallback('onPartData', true);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (index === boundary.length) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\tif (c === CR) {\n\t\t\t\t\t\t\t// CR = part boundary\n\t\t\t\t\t\t\tflags |= F.PART_BOUNDARY;\n\t\t\t\t\t\t} else if (c === HYPHEN) {\n\t\t\t\t\t\t\t// HYPHEN = end boundary\n\t\t\t\t\t\t\tflags |= F.LAST_BOUNDARY;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (index - 1 === boundary.length) {\n\t\t\t\t\t\tif (flags & F.PART_BOUNDARY) {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t\tif (c === LF) {\n\t\t\t\t\t\t\t\t// unset the PART_BOUNDARY flag\n\t\t\t\t\t\t\t\tflags &= ~F.PART_BOUNDARY;\n\t\t\t\t\t\t\t\tcallback('onPartEnd');\n\t\t\t\t\t\t\t\tcallback('onPartBegin');\n\t\t\t\t\t\t\t\tstate = S.HEADER_FIELD_START;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (flags & F.LAST_BOUNDARY) {\n\t\t\t\t\t\t\tif (c === HYPHEN) {\n\t\t\t\t\t\t\t\tcallback('onPartEnd');\n\t\t\t\t\t\t\t\tstate = S.END;\n\t\t\t\t\t\t\t\tflags = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t// when matching a possible boundary, keep a lookbehind reference\n\t\t\t\t\t\t// in case it turns out to be a false lead\n\t\t\t\t\t\tlookbehind[index - 1] = c;\n\t\t\t\t\t} else if (previousIndex > 0) {\n\t\t\t\t\t\t// if our boundary turned out to be rubbish, the captured lookbehind\n\t\t\t\t\t\t// belongs to partData\n\t\t\t\t\t\tconst _lookbehind = new Uint8Array(lookbehind.buffer, lookbehind.byteOffset, lookbehind.byteLength);\n\t\t\t\t\t\tcallback('onPartData', 0, previousIndex, _lookbehind);\n\t\t\t\t\t\tpreviousIndex = 0;\n\t\t\t\t\t\tmark('onPartData');\n\n\t\t\t\t\t\t// reconsider the current character even so it interrupted the sequence\n\t\t\t\t\t\t// it could be the beginning of a new sequence\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.END:\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(`Unexpected state entered: ${state}`);\n\t\t\t}\n\t\t}\n\n\t\tdataCallback('onHeaderField');\n\t\tdataCallback('onHeaderValue');\n\t\tdataCallback('onPartData');\n\n\t\t// Update properties for the next call\n\t\tthis.index = index;\n\t\tthis.state = state;\n\t\tthis.flags = flags;\n\t}\n\n\tend() {\n\t\tif ((this.state === S.HEADER_FIELD_START && this.index === 0) ||\n\t\t\t(this.state === S.PART_DATA && this.index === this.boundary.length)) {\n\t\t\tthis.onPartEnd();\n\t\t} else if (this.state !== S.END) {\n\t\t\tthrow new Error('MultipartParser.end(): stream ended unexpectedly');\n\t\t}\n\t}\n}\n\nfunction _fileName(headerValue) {\n\t// matches either a quoted-string or a token (RFC 2616 section 19.5.1)\n\tconst m = headerValue.match(/\\bfilename=(\"(.*?)\"|([^()<>@,;:\\\\\"/[\\]?={}\\s\\t]+))($|;\\s)/i);\n\tif (!m) {\n\t\treturn;\n\t}\n\n\tconst match = m[2] || m[3] || '';\n\tlet filename = match.slice(match.lastIndexOf('\\\\') + 1);\n\tfilename = filename.replace(/%22/g, '\"');\n\tfilename = filename.replace(/&#(\\d{4});/g, (m, code) => {\n\t\treturn String.fromCharCode(code);\n\t});\n\treturn filename;\n}\n\nexport async function toFormData(Body, ct) {\n\tif (!/multipart/i.test(ct)) {\n\t\tthrow new TypeError('Failed to fetch');\n\t}\n\n\tconst m = ct.match(/boundary=(?:\"([^\"]+)\"|([^;]+))/i);\n\n\tif (!m) {\n\t\tthrow new TypeError('no or bad content-type header, no multipart boundary');\n\t}\n\n\tconst parser = new MultipartParser(m[1] || m[2]);\n\n\tlet headerField;\n\tlet headerValue;\n\tlet entryValue;\n\tlet entryName;\n\tlet contentType;\n\tlet filename;\n\tconst entryChunks = [];\n\tconst formData = new FormData();\n\n\tconst onPartData = ui8a => {\n\t\tentryValue += decoder.decode(ui8a, {stream: true});\n\t};\n\n\tconst appendToFile = ui8a => {\n\t\tentryChunks.push(ui8a);\n\t};\n\n\tconst appendFileToFormData = () => {\n\t\tconst file = new File(entryChunks, filename, {type: contentType});\n\t\tformData.append(entryName, file);\n\t};\n\n\tconst appendEntryToFormData = () => {\n\t\tformData.append(entryName, entryValue);\n\t};\n\n\tconst decoder = new TextDecoder('utf-8');\n\tdecoder.decode();\n\n\tparser.onPartBegin = function () {\n\t\tparser.onPartData = onPartData;\n\t\tparser.onPartEnd = appendEntryToFormData;\n\n\t\theaderField = '';\n\t\theaderValue = '';\n\t\tentryValue = '';\n\t\tentryName = '';\n\t\tcontentType = '';\n\t\tfilename = null;\n\t\tentryChunks.length = 0;\n\t};\n\n\tparser.onHeaderField = function (ui8a) {\n\t\theaderField += decoder.decode(ui8a, {stream: true});\n\t};\n\n\tparser.onHeaderValue = function (ui8a) {\n\t\theaderValue += decoder.decode(ui8a, {stream: true});\n\t};\n\n\tparser.onHeaderEnd = function () {\n\t\theaderValue += decoder.decode();\n\t\theaderField = headerField.toLowerCase();\n\n\t\tif (headerField === 'content-disposition') {\n\t\t\t// matches either a quoted-string or a token (RFC 2616 section 19.5.1)\n\t\t\tconst m = headerValue.match(/\\bname=(\"([^\"]*)\"|([^()<>@,;:\\\\\"/[\\]?={}\\s\\t]+))/i);\n\n\t\t\tif (m) {\n\t\t\t\tentryName = m[2] || m[3] || '';\n\t\t\t}\n\n\t\t\tfilename = _fileName(headerValue);\n\n\t\t\tif (filename) {\n\t\t\t\tparser.onPartData = appendToFile;\n\t\t\t\tparser.onPartEnd = appendFileToFormData;\n\t\t\t}\n\t\t} else if (headerField === 'content-type') {\n\t\t\tcontentType = headerValue;\n\t\t}\n\n\t\theaderValue = '';\n\t\theaderField = '';\n\t};\n\n\tfor await (const chunk of Body) {\n\t\tparser.write(chunk);\n\t}\n\n\tparser.end();\n\n\treturn formData;\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AA+TA,SAAS,UAAU,aAAa;CAE/B,MAAM,IAAI,YAAY,MAAM,6DAA6D;AACzF,KAAI,CAAC,EACJ;CAGD,MAAM,QAAQ,EAAE,MAAM,EAAE,MAAM;CAC9B,IAAI,WAAW,MAAM,MAAM,MAAM,YAAY,KAAK,GAAG,EAAE;AACvD,YAAW,SAAS,QAAQ,QAAQ,KAAI;AACxC,YAAW,SAAS,QAAQ,gBAAgB,GAAG,SAAS;AACvD,SAAO,OAAO,aAAa,KAAK;GAC/B;AACF,QAAO;;AAGR,eAAsB,WAAW,MAAM,IAAI;AAC1C,KAAI,CAAC,aAAa,KAAK,GAAG,CACzB,OAAM,IAAI,UAAU,kBAAkB;CAGvC,MAAM,IAAI,GAAG,MAAM,kCAAkC;AAErD,KAAI,CAAC,EACJ,OAAM,IAAI,UAAU,uDAAuD;CAG5E,MAAM,SAAS,IAAI,gBAAgB,EAAE,MAAM,EAAE,GAAG;CAEhD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM,cAAc,EAAE;CACtB,MAAM,WAAW,IAAI,UAAU;CAE/B,MAAM,cAAa,SAAQ;AAC1B,gBAAc,QAAQ,OAAO,MAAM,EAAC,QAAQ,MAAK,CAAC;;CAGnD,MAAM,gBAAe,SAAQ;AAC5B,cAAY,KAAK,KAAK;;CAGvB,MAAM,6BAA6B;EAClC,MAAM,OAAO,IAAI,KAAK,aAAa,UAAU,EAAC,MAAM,aAAY,CAAC;AACjE,WAAS,OAAO,WAAW,KAAK;;CAGjC,MAAM,8BAA8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AW;YACN,KAAK,UAAU,EAAE,IAC3B,OAAM,IAAI,MAAM,mDAAmD"}
|
|
1
|
+
{"version":3,"file":"multipart-parser-DXNPpbYa.js","names":[],"sources":["../../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/utils/multipart-parser.js"],"sourcesContent":["import {File} from 'fetch-blob/from.js';\nimport {FormData} from 'formdata-polyfill/esm.min.js';\n\nlet s = 0;\nconst S = {\n\tSTART_BOUNDARY: s++,\n\tHEADER_FIELD_START: s++,\n\tHEADER_FIELD: s++,\n\tHEADER_VALUE_START: s++,\n\tHEADER_VALUE: s++,\n\tHEADER_VALUE_ALMOST_DONE: s++,\n\tHEADERS_ALMOST_DONE: s++,\n\tPART_DATA_START: s++,\n\tPART_DATA: s++,\n\tEND: s++\n};\n\nlet f = 1;\nconst F = {\n\tPART_BOUNDARY: f,\n\tLAST_BOUNDARY: f *= 2\n};\n\nconst LF = 10;\nconst CR = 13;\nconst SPACE = 32;\nconst HYPHEN = 45;\nconst COLON = 58;\nconst A = 97;\nconst Z = 122;\n\nconst lower = c => c | 0x20;\n\nconst noop = () => {};\n\nclass MultipartParser {\n\t/**\n\t * @param {string} boundary\n\t */\n\tconstructor(boundary) {\n\t\tthis.index = 0;\n\t\tthis.flags = 0;\n\n\t\tthis.onHeaderEnd = noop;\n\t\tthis.onHeaderField = noop;\n\t\tthis.onHeadersEnd = noop;\n\t\tthis.onHeaderValue = noop;\n\t\tthis.onPartBegin = noop;\n\t\tthis.onPartData = noop;\n\t\tthis.onPartEnd = noop;\n\n\t\tthis.boundaryChars = {};\n\n\t\tboundary = '\\r\\n--' + boundary;\n\t\tconst ui8a = new Uint8Array(boundary.length);\n\t\tfor (let i = 0; i < boundary.length; i++) {\n\t\t\tui8a[i] = boundary.charCodeAt(i);\n\t\t\tthis.boundaryChars[ui8a[i]] = true;\n\t\t}\n\n\t\tthis.boundary = ui8a;\n\t\tthis.lookbehind = new Uint8Array(this.boundary.length + 8);\n\t\tthis.state = S.START_BOUNDARY;\n\t}\n\n\t/**\n\t * @param {Uint8Array} data\n\t */\n\twrite(data) {\n\t\tlet i = 0;\n\t\tconst length_ = data.length;\n\t\tlet previousIndex = this.index;\n\t\tlet {lookbehind, boundary, boundaryChars, index, state, flags} = this;\n\t\tconst boundaryLength = this.boundary.length;\n\t\tconst boundaryEnd = boundaryLength - 1;\n\t\tconst bufferLength = data.length;\n\t\tlet c;\n\t\tlet cl;\n\n\t\tconst mark = name => {\n\t\t\tthis[name + 'Mark'] = i;\n\t\t};\n\n\t\tconst clear = name => {\n\t\t\tdelete this[name + 'Mark'];\n\t\t};\n\n\t\tconst callback = (callbackSymbol, start, end, ui8a) => {\n\t\t\tif (start === undefined || start !== end) {\n\t\t\t\tthis[callbackSymbol](ui8a && ui8a.subarray(start, end));\n\t\t\t}\n\t\t};\n\n\t\tconst dataCallback = (name, clear) => {\n\t\t\tconst markSymbol = name + 'Mark';\n\t\t\tif (!(markSymbol in this)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (clear) {\n\t\t\t\tcallback(name, this[markSymbol], i, data);\n\t\t\t\tdelete this[markSymbol];\n\t\t\t} else {\n\t\t\t\tcallback(name, this[markSymbol], data.length, data);\n\t\t\t\tthis[markSymbol] = 0;\n\t\t\t}\n\t\t};\n\n\t\tfor (i = 0; i < length_; i++) {\n\t\t\tc = data[i];\n\n\t\t\tswitch (state) {\n\t\t\t\tcase S.START_BOUNDARY:\n\t\t\t\t\tif (index === boundary.length - 2) {\n\t\t\t\t\t\tif (c === HYPHEN) {\n\t\t\t\t\t\t\tflags |= F.LAST_BOUNDARY;\n\t\t\t\t\t\t} else if (c !== CR) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (index - 1 === boundary.length - 2) {\n\t\t\t\t\t\tif (flags & F.LAST_BOUNDARY && c === HYPHEN) {\n\t\t\t\t\t\t\tstate = S.END;\n\t\t\t\t\t\t\tflags = 0;\n\t\t\t\t\t\t} else if (!(flags & F.LAST_BOUNDARY) && c === LF) {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t\tcallback('onPartBegin');\n\t\t\t\t\t\t\tstate = S.HEADER_FIELD_START;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c !== boundary[index + 2]) {\n\t\t\t\t\t\tindex = -2;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c === boundary[index + 2]) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADER_FIELD_START:\n\t\t\t\t\tstate = S.HEADER_FIELD;\n\t\t\t\t\tmark('onHeaderField');\n\t\t\t\t\tindex = 0;\n\t\t\t\t\t// falls through\n\t\t\t\tcase S.HEADER_FIELD:\n\t\t\t\t\tif (c === CR) {\n\t\t\t\t\t\tclear('onHeaderField');\n\t\t\t\t\t\tstate = S.HEADERS_ALMOST_DONE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tindex++;\n\t\t\t\t\tif (c === HYPHEN) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c === COLON) {\n\t\t\t\t\t\tif (index === 1) {\n\t\t\t\t\t\t\t// empty header field\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdataCallback('onHeaderField', true);\n\t\t\t\t\t\tstate = S.HEADER_VALUE_START;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcl = lower(c);\n\t\t\t\t\tif (cl < A || cl > Z) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADER_VALUE_START:\n\t\t\t\t\tif (c === SPACE) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tmark('onHeaderValue');\n\t\t\t\t\tstate = S.HEADER_VALUE;\n\t\t\t\t\t// falls through\n\t\t\t\tcase S.HEADER_VALUE:\n\t\t\t\t\tif (c === CR) {\n\t\t\t\t\t\tdataCallback('onHeaderValue', true);\n\t\t\t\t\t\tcallback('onHeaderEnd');\n\t\t\t\t\t\tstate = S.HEADER_VALUE_ALMOST_DONE;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADER_VALUE_ALMOST_DONE:\n\t\t\t\t\tif (c !== LF) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate = S.HEADER_FIELD_START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.HEADERS_ALMOST_DONE:\n\t\t\t\t\tif (c !== LF) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tcallback('onHeadersEnd');\n\t\t\t\t\tstate = S.PART_DATA_START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.PART_DATA_START:\n\t\t\t\t\tstate = S.PART_DATA;\n\t\t\t\t\tmark('onPartData');\n\t\t\t\t\t// falls through\n\t\t\t\tcase S.PART_DATA:\n\t\t\t\t\tpreviousIndex = index;\n\n\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t// boyer-moore derrived algorithm to safely skip non-boundary data\n\t\t\t\t\t\ti += boundaryEnd;\n\t\t\t\t\t\twhile (i < bufferLength && !(data[i] in boundaryChars)) {\n\t\t\t\t\t\t\ti += boundaryLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ti -= boundaryEnd;\n\t\t\t\t\t\tc = data[i];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index < boundary.length) {\n\t\t\t\t\t\tif (boundary[index] === c) {\n\t\t\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t\t\tdataCallback('onPartData', true);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (index === boundary.length) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\tif (c === CR) {\n\t\t\t\t\t\t\t// CR = part boundary\n\t\t\t\t\t\t\tflags |= F.PART_BOUNDARY;\n\t\t\t\t\t\t} else if (c === HYPHEN) {\n\t\t\t\t\t\t\t// HYPHEN = end boundary\n\t\t\t\t\t\t\tflags |= F.LAST_BOUNDARY;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (index - 1 === boundary.length) {\n\t\t\t\t\t\tif (flags & F.PART_BOUNDARY) {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t\tif (c === LF) {\n\t\t\t\t\t\t\t\t// unset the PART_BOUNDARY flag\n\t\t\t\t\t\t\t\tflags &= ~F.PART_BOUNDARY;\n\t\t\t\t\t\t\t\tcallback('onPartEnd');\n\t\t\t\t\t\t\t\tcallback('onPartBegin');\n\t\t\t\t\t\t\t\tstate = S.HEADER_FIELD_START;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (flags & F.LAST_BOUNDARY) {\n\t\t\t\t\t\t\tif (c === HYPHEN) {\n\t\t\t\t\t\t\t\tcallback('onPartEnd');\n\t\t\t\t\t\t\t\tstate = S.END;\n\t\t\t\t\t\t\t\tflags = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t// when matching a possible boundary, keep a lookbehind reference\n\t\t\t\t\t\t// in case it turns out to be a false lead\n\t\t\t\t\t\tlookbehind[index - 1] = c;\n\t\t\t\t\t} else if (previousIndex > 0) {\n\t\t\t\t\t\t// if our boundary turned out to be rubbish, the captured lookbehind\n\t\t\t\t\t\t// belongs to partData\n\t\t\t\t\t\tconst _lookbehind = new Uint8Array(lookbehind.buffer, lookbehind.byteOffset, lookbehind.byteLength);\n\t\t\t\t\t\tcallback('onPartData', 0, previousIndex, _lookbehind);\n\t\t\t\t\t\tpreviousIndex = 0;\n\t\t\t\t\t\tmark('onPartData');\n\n\t\t\t\t\t\t// reconsider the current character even so it interrupted the sequence\n\t\t\t\t\t\t// it could be the beginning of a new sequence\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase S.END:\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(`Unexpected state entered: ${state}`);\n\t\t\t}\n\t\t}\n\n\t\tdataCallback('onHeaderField');\n\t\tdataCallback('onHeaderValue');\n\t\tdataCallback('onPartData');\n\n\t\t// Update properties for the next call\n\t\tthis.index = index;\n\t\tthis.state = state;\n\t\tthis.flags = flags;\n\t}\n\n\tend() {\n\t\tif ((this.state === S.HEADER_FIELD_START && this.index === 0) ||\n\t\t\t(this.state === S.PART_DATA && this.index === this.boundary.length)) {\n\t\t\tthis.onPartEnd();\n\t\t} else if (this.state !== S.END) {\n\t\t\tthrow new Error('MultipartParser.end(): stream ended unexpectedly');\n\t\t}\n\t}\n}\n\nfunction _fileName(headerValue) {\n\t// matches either a quoted-string or a token (RFC 2616 section 19.5.1)\n\tconst m = headerValue.match(/\\bfilename=(\"(.*?)\"|([^()<>@,;:\\\\\"/[\\]?={}\\s\\t]+))($|;\\s)/i);\n\tif (!m) {\n\t\treturn;\n\t}\n\n\tconst match = m[2] || m[3] || '';\n\tlet filename = match.slice(match.lastIndexOf('\\\\') + 1);\n\tfilename = filename.replace(/%22/g, '\"');\n\tfilename = filename.replace(/&#(\\d{4});/g, (m, code) => {\n\t\treturn String.fromCharCode(code);\n\t});\n\treturn filename;\n}\n\nexport async function toFormData(Body, ct) {\n\tif (!/multipart/i.test(ct)) {\n\t\tthrow new TypeError('Failed to fetch');\n\t}\n\n\tconst m = ct.match(/boundary=(?:\"([^\"]+)\"|([^;]+))/i);\n\n\tif (!m) {\n\t\tthrow new TypeError('no or bad content-type header, no multipart boundary');\n\t}\n\n\tconst parser = new MultipartParser(m[1] || m[2]);\n\n\tlet headerField;\n\tlet headerValue;\n\tlet entryValue;\n\tlet entryName;\n\tlet contentType;\n\tlet filename;\n\tconst entryChunks = [];\n\tconst formData = new FormData();\n\n\tconst onPartData = ui8a => {\n\t\tentryValue += decoder.decode(ui8a, {stream: true});\n\t};\n\n\tconst appendToFile = ui8a => {\n\t\tentryChunks.push(ui8a);\n\t};\n\n\tconst appendFileToFormData = () => {\n\t\tconst file = new File(entryChunks, filename, {type: contentType});\n\t\tformData.append(entryName, file);\n\t};\n\n\tconst appendEntryToFormData = () => {\n\t\tformData.append(entryName, entryValue);\n\t};\n\n\tconst decoder = new TextDecoder('utf-8');\n\tdecoder.decode();\n\n\tparser.onPartBegin = function () {\n\t\tparser.onPartData = onPartData;\n\t\tparser.onPartEnd = appendEntryToFormData;\n\n\t\theaderField = '';\n\t\theaderValue = '';\n\t\tentryValue = '';\n\t\tentryName = '';\n\t\tcontentType = '';\n\t\tfilename = null;\n\t\tentryChunks.length = 0;\n\t};\n\n\tparser.onHeaderField = function (ui8a) {\n\t\theaderField += decoder.decode(ui8a, {stream: true});\n\t};\n\n\tparser.onHeaderValue = function (ui8a) {\n\t\theaderValue += decoder.decode(ui8a, {stream: true});\n\t};\n\n\tparser.onHeaderEnd = function () {\n\t\theaderValue += decoder.decode();\n\t\theaderField = headerField.toLowerCase();\n\n\t\tif (headerField === 'content-disposition') {\n\t\t\t// matches either a quoted-string or a token (RFC 2616 section 19.5.1)\n\t\t\tconst m = headerValue.match(/\\bname=(\"([^\"]*)\"|([^()<>@,;:\\\\\"/[\\]?={}\\s\\t]+))/i);\n\n\t\t\tif (m) {\n\t\t\t\tentryName = m[2] || m[3] || '';\n\t\t\t}\n\n\t\t\tfilename = _fileName(headerValue);\n\n\t\t\tif (filename) {\n\t\t\t\tparser.onPartData = appendToFile;\n\t\t\t\tparser.onPartEnd = appendFileToFormData;\n\t\t\t}\n\t\t} else if (headerField === 'content-type') {\n\t\t\tcontentType = headerValue;\n\t\t}\n\n\t\theaderValue = '';\n\t\theaderField = '';\n\t};\n\n\tfor await (const chunk of Body) {\n\t\tparser.write(chunk);\n\t}\n\n\tparser.end();\n\n\treturn formData;\n}\n"],"x_google_ignoreList":[0],"mappings":";;;AA+TA,SAAS,UAAU,aAAa;CAE/B,MAAM,IAAI,YAAY,MAAM,6DAA6D;AACzF,KAAI,CAAC,EACJ;CAGD,MAAM,QAAQ,EAAE,MAAM,EAAE,MAAM;CAC9B,IAAI,WAAW,MAAM,MAAM,MAAM,YAAY,KAAK,GAAG,EAAE;AACvD,YAAW,SAAS,QAAQ,QAAQ,KAAI;AACxC,YAAW,SAAS,QAAQ,gBAAgB,GAAG,SAAS;AACvD,SAAO,OAAO,aAAa,KAAK;GAC/B;AACF,QAAO;;AAGR,eAAsB,WAAW,MAAM,IAAI;AAC1C,KAAI,CAAC,aAAa,KAAK,GAAG,CACzB,OAAM,IAAI,UAAU,kBAAkB;CAGvC,MAAM,IAAI,GAAG,MAAM,kCAAkC;AAErD,KAAI,CAAC,EACJ,OAAM,IAAI,UAAU,uDAAuD;CAG5E,MAAM,SAAS,IAAI,gBAAgB,EAAE,MAAM,EAAE,GAAG;CAEhD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM,cAAc,EAAE;CACtB,MAAM,WAAW,IAAI,UAAU;CAE/B,MAAM,cAAa,SAAQ;AAC1B,gBAAc,QAAQ,OAAO,MAAM,EAAC,QAAQ,MAAK,CAAC;;CAGnD,MAAM,gBAAe,SAAQ;AAC5B,cAAY,KAAK,KAAK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b,QAAK,QAAQ;;EAGd,MAAM;AACL,OAAK,KAAK,UAAU,EAAE,sBAAsB,KAAK,UAAU,KACzD,KAAK,UAAU,EAAE,aAAa,KAAK,UAAU,KAAK,SAAS,OAC5D,MAAK,WAAW;YACN,KAAK,UAAU,EAAE,IAC3B,OAAM,IAAI,MAAM,mDAAmD"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { jt as PerstackError, t as createApiClient } from "./dist-
|
|
2
|
-
|
|
1
|
+
import { jt as PerstackError, t as createApiClient } from "./dist-RHs5gh6F.js";
|
|
3
2
|
//#region ../../packages/runtime/src/helpers/resolve-expert.ts
|
|
4
3
|
async function resolveExpertToRun(expertKey, experts, clientOptions) {
|
|
5
4
|
if (experts[expertKey]) return experts[expertKey];
|
|
@@ -63,7 +62,7 @@ function toRuntimeExpert(key, expert) {
|
|
|
63
62
|
defaultModelTier: expert.defaultModelTier
|
|
64
63
|
};
|
|
65
64
|
}
|
|
66
|
-
|
|
67
65
|
//#endregion
|
|
68
66
|
export { resolveExpertToRun };
|
|
69
|
-
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=resolve-expert-temTHQyu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-expert-
|
|
1
|
+
{"version":3,"file":"resolve-expert-temTHQyu.js","names":[],"sources":["../../../packages/runtime/src/helpers/resolve-expert.ts"],"sourcesContent":["import { createApiClient } from \"@perstack/api-client\"\nimport {\n type Expert,\n type ModelTier,\n PerstackError,\n type RuntimeVersion,\n type Skill,\n} from \"@perstack/core\"\n\nexport async function resolveExpertToRun(\n expertKey: string,\n experts: Record<string, Expert>,\n clientOptions: {\n perstackApiBaseUrl: string\n perstackApiKey?: string\n },\n): Promise<Expert> {\n if (experts[expertKey]) {\n return experts[expertKey]\n }\n const client = createApiClient({\n baseUrl: clientOptions.perstackApiBaseUrl,\n apiKey: clientOptions.perstackApiKey ?? \"\",\n })\n const result = await client.experts.get(expertKey)\n if (!result.ok) {\n throw new PerstackError(`Failed to resolve expert \"${expertKey}\": ${result.error.message}`)\n }\n const allExperts = result.data.data.definition.experts\n if (!allExperts[expertKey]) {\n throw new PerstackError(`Expert \"${expertKey}\" not found in API response`)\n }\n // Store all experts from the definition (coordinator + delegates)\n for (const [key, expert] of Object.entries(allExperts)) {\n if (!experts[key]) {\n experts[key] = toRuntimeExpert(key, expert)\n }\n }\n return experts[expertKey]\n}\n\nfunction toRuntimeExpert(\n key: string,\n expert: {\n name: string\n version: string\n minRuntimeVersion?: RuntimeVersion\n description?: string\n instruction: string\n skills?: Record<\n string,\n | {\n type: \"mcpStdioSkill\"\n name: string\n description: string\n rule?: string\n pick?: string[]\n omit?: string[]\n command: \"npx\" | \"uvx\"\n packageName: string\n requiredEnv?: string[]\n }\n | {\n type: \"mcpSseSkill\"\n name: string\n description: string\n rule?: string\n pick?: string[]\n omit?: string[]\n endpoint: string\n }\n | {\n type: \"interactiveSkill\"\n name: string\n description: string\n rule?: string\n tools: Record<string, { description: string; inputJsonSchema: string }>\n }\n >\n delegates?: string[]\n tags?: string[]\n defaultModelTier?: ModelTier\n },\n): Expert {\n const skills: Record<string, Skill> = Object.fromEntries(\n Object.entries(expert.skills ?? {}).map(([name, skill]) => {\n switch (skill.type) {\n case \"mcpStdioSkill\":\n return [\n name,\n {\n type: skill.type,\n name,\n description: skill.description,\n rule: skill.rule,\n pick: skill.pick ?? [],\n omit: skill.omit ?? [],\n command: skill.command,\n packageName: skill.packageName,\n requiredEnv: skill.requiredEnv ?? [],\n },\n ]\n case \"mcpSseSkill\":\n return [\n name,\n {\n type: skill.type,\n name,\n description: skill.description,\n rule: skill.rule,\n pick: skill.pick ?? [],\n omit: skill.omit ?? [],\n endpoint: skill.endpoint,\n },\n ]\n case \"interactiveSkill\":\n return [\n name,\n {\n type: skill.type,\n name,\n description: skill.description,\n rule: skill.rule,\n tools: Object.fromEntries(\n Object.entries(skill.tools).map(([toolName, tool]) => [\n toolName,\n {\n name: toolName,\n description: tool.description,\n inputSchema: JSON.parse(tool.inputJsonSchema),\n },\n ]),\n ),\n },\n ]\n default: {\n throw new PerstackError(`Unknown skill type: ${(skill as { type: string }).type}`)\n }\n }\n }),\n )\n return {\n key,\n name: expert.name,\n version: expert.version,\n minRuntimeVersion: expert.minRuntimeVersion ?? \"v1.0\",\n description: expert.description ?? \"\",\n instruction: expert.instruction,\n skills,\n delegates: expert.delegates ?? [],\n tags: expert.tags ?? [],\n defaultModelTier: expert.defaultModelTier,\n }\n}\n"],"mappings":";;AASA,eAAsB,mBACpB,WACA,SACA,eAIiB;AACjB,KAAI,QAAQ,WACV,QAAO,QAAQ;CAMjB,MAAM,SAAS,MAJA,gBAAgB;EAC7B,SAAS,cAAc;EACvB,QAAQ,cAAc,kBAAkB;EACzC,CAAC,CAC0B,QAAQ,IAAI,UAAU;AAClD,KAAI,CAAC,OAAO,GACV,OAAM,IAAI,cAAc,6BAA6B,UAAU,KAAK,OAAO,MAAM,UAAU;CAE7F,MAAM,aAAa,OAAO,KAAK,KAAK,WAAW;AAC/C,KAAI,CAAC,WAAW,WACd,OAAM,IAAI,cAAc,WAAW,UAAU,6BAA6B;AAG5E,MAAK,MAAM,CAAC,KAAK,WAAW,OAAO,QAAQ,WAAW,CACpD,KAAI,CAAC,QAAQ,KACX,SAAQ,OAAO,gBAAgB,KAAK,OAAO;AAG/C,QAAO,QAAQ;;AAGjB,SAAS,gBACP,KACA,QAwCQ;CACR,MAAM,SAAgC,OAAO,YAC3C,OAAO,QAAQ,OAAO,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW;AACzD,UAAQ,MAAM,MAAd;GACE,KAAK,gBACH,QAAO,CACL,MACA;IACE,MAAM,MAAM;IACZ;IACA,aAAa,MAAM;IACnB,MAAM,MAAM;IACZ,MAAM,MAAM,QAAQ,EAAE;IACtB,MAAM,MAAM,QAAQ,EAAE;IACtB,SAAS,MAAM;IACf,aAAa,MAAM;IACnB,aAAa,MAAM,eAAe,EAAE;IACrC,CACF;GACH,KAAK,cACH,QAAO,CACL,MACA;IACE,MAAM,MAAM;IACZ;IACA,aAAa,MAAM;IACnB,MAAM,MAAM;IACZ,MAAM,MAAM,QAAQ,EAAE;IACtB,MAAM,MAAM,QAAQ,EAAE;IACtB,UAAU,MAAM;IACjB,CACF;GACH,KAAK,mBACH,QAAO,CACL,MACA;IACE,MAAM,MAAM;IACZ;IACA,aAAa,MAAM;IACnB,MAAM,MAAM;IACZ,OAAO,OAAO,YACZ,OAAO,QAAQ,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,UAAU,CACpD,UACA;KACE,MAAM;KACN,aAAa,KAAK;KAClB,aAAa,KAAK,MAAM,KAAK,gBAAgB;KAC9C,CACF,CAAC,CACH;IACF,CACF;GACH,QACE,OAAM,IAAI,cAAc,uBAAwB,MAA2B,OAAO;;GAGtF,CACH;AACD,QAAO;EACL;EACA,MAAM,OAAO;EACb,SAAS,OAAO;EAChB,mBAAmB,OAAO,qBAAqB;EAC/C,aAAa,OAAO,eAAe;EACnC,aAAa,OAAO;EACpB;EACA,WAAW,OAAO,aAAa,EAAE;EACjC,MAAM,OAAO,QAAQ,EAAE;EACvB,kBAAkB,OAAO;EAC1B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __esmMin } from "./chunk-
|
|
2
|
-
import {
|
|
1
|
+
import { n as __esmMin } from "./chunk-DORXReHP.js";
|
|
2
|
+
import { i as init_esm_min, n as FormData, o as Blob, r as formDataToBlob, s as init_fetch_blob, t as init_from } from "./from-CDHHdxdc.js";
|
|
3
3
|
import { deprecate, promisify, types } from "node:util";
|
|
4
4
|
import Stream, { PassThrough, pipeline } from "node:stream";
|
|
5
5
|
import { isIP } from "node:net";
|
|
@@ -8,7 +8,6 @@ import { Buffer as Buffer$1 } from "node:buffer";
|
|
|
8
8
|
import zlib from "node:zlib";
|
|
9
9
|
import https from "node:https";
|
|
10
10
|
import { format } from "node:url";
|
|
11
|
-
|
|
12
11
|
//#region ../../node_modules/.bun/data-uri-to-buffer@4.0.1/node_modules/data-uri-to-buffer/dist/index.js
|
|
13
12
|
/**
|
|
14
13
|
* Returns a `Buffer` instance from the given data URI `uri`.
|
|
@@ -45,7 +44,6 @@ function dataUriToBuffer(uri) {
|
|
|
45
44
|
return buffer;
|
|
46
45
|
}
|
|
47
46
|
var init_dist = __esmMin((() => {}));
|
|
48
|
-
|
|
49
47
|
//#endregion
|
|
50
48
|
//#region ../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/errors/base.js
|
|
51
49
|
var FetchBaseError;
|
|
@@ -64,7 +62,6 @@ var init_base = __esmMin((() => {
|
|
|
64
62
|
}
|
|
65
63
|
};
|
|
66
64
|
}));
|
|
67
|
-
|
|
68
65
|
//#endregion
|
|
69
66
|
//#region ../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/errors/fetch-error.js
|
|
70
67
|
var FetchError;
|
|
@@ -85,7 +82,6 @@ var init_fetch_error = __esmMin((() => {
|
|
|
85
82
|
}
|
|
86
83
|
};
|
|
87
84
|
}));
|
|
88
|
-
|
|
89
85
|
//#endregion
|
|
90
86
|
//#region ../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/utils/is.js
|
|
91
87
|
var NAME, isURLSearchParameters, isBlob, isAbortSignal, isDomainOrSubdomain, isSameProtocol;
|
|
@@ -109,7 +105,6 @@ var init_is = __esmMin((() => {
|
|
|
109
105
|
return new URL(original).protocol === new URL(destination).protocol;
|
|
110
106
|
};
|
|
111
107
|
}));
|
|
112
|
-
|
|
113
108
|
//#endregion
|
|
114
109
|
//#region ../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/body.js
|
|
115
110
|
/**
|
|
@@ -214,7 +209,7 @@ var init_body = __esmMin((() => {
|
|
|
214
209
|
for (const [name, value] of parameters) formData.append(name, value);
|
|
215
210
|
return formData;
|
|
216
211
|
}
|
|
217
|
-
const { toFormData } = await import("./multipart-parser-
|
|
212
|
+
const { toFormData } = await import("./multipart-parser-DXNPpbYa.js");
|
|
218
213
|
return toFormData(this.body, ct);
|
|
219
214
|
}
|
|
220
215
|
/**
|
|
@@ -303,7 +298,6 @@ var init_body = __esmMin((() => {
|
|
|
303
298
|
else await pipeline$1(body, dest);
|
|
304
299
|
};
|
|
305
300
|
}));
|
|
306
|
-
|
|
307
301
|
//#endregion
|
|
308
302
|
//#region ../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/headers.js
|
|
309
303
|
/**
|
|
@@ -471,7 +465,6 @@ var init_headers = __esmMin((() => {
|
|
|
471
465
|
return result;
|
|
472
466
|
}, {}));
|
|
473
467
|
}));
|
|
474
|
-
|
|
475
468
|
//#endregion
|
|
476
469
|
//#region ../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/utils/is-redirect.js
|
|
477
470
|
var redirectStatus, isRedirect;
|
|
@@ -487,7 +480,6 @@ var init_is_redirect = __esmMin((() => {
|
|
|
487
480
|
return redirectStatus.has(code);
|
|
488
481
|
};
|
|
489
482
|
}));
|
|
490
|
-
|
|
491
483
|
//#endregion
|
|
492
484
|
//#region ../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/response.js
|
|
493
485
|
var INTERNALS$1, Response;
|
|
@@ -605,7 +597,6 @@ var init_response = __esmMin((() => {
|
|
|
605
597
|
clone: { enumerable: true }
|
|
606
598
|
});
|
|
607
599
|
}));
|
|
608
|
-
|
|
609
600
|
//#endregion
|
|
610
601
|
//#region ../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/utils/get-search.js
|
|
611
602
|
var getSearch;
|
|
@@ -617,7 +608,6 @@ var init_get_search = __esmMin((() => {
|
|
|
617
608
|
return parsedURL.href[lastOffset - hash.length] === "?" ? "?" : "";
|
|
618
609
|
};
|
|
619
610
|
}));
|
|
620
|
-
|
|
621
611
|
//#endregion
|
|
622
612
|
//#region ../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/utils/referrer.js
|
|
623
613
|
/**
|
|
@@ -763,7 +753,6 @@ var init_referrer = __esmMin((() => {
|
|
|
763
753
|
]);
|
|
764
754
|
DEFAULT_REFERRER_POLICY = "strict-origin-when-cross-origin";
|
|
765
755
|
}));
|
|
766
|
-
|
|
767
756
|
//#endregion
|
|
768
757
|
//#region ../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/request.js
|
|
769
758
|
/**
|
|
@@ -914,7 +903,6 @@ var init_request = __esmMin((() => {
|
|
|
914
903
|
};
|
|
915
904
|
};
|
|
916
905
|
}));
|
|
917
|
-
|
|
918
906
|
//#endregion
|
|
919
907
|
//#region ../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/errors/abort-error.js
|
|
920
908
|
var AbortError;
|
|
@@ -926,7 +914,6 @@ var init_abort_error = __esmMin((() => {
|
|
|
926
914
|
}
|
|
927
915
|
};
|
|
928
916
|
}));
|
|
929
|
-
|
|
930
917
|
//#endregion
|
|
931
918
|
//#region ../../node_modules/.bun/node-fetch@3.3.2/node_modules/node-fetch/src/index.js
|
|
932
919
|
/**
|
|
@@ -1166,7 +1153,8 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
|
|
|
1166
1153
|
});
|
|
1167
1154
|
}
|
|
1168
1155
|
var supportedSchemas;
|
|
1169
|
-
|
|
1156
|
+
//#endregion
|
|
1157
|
+
__esmMin((() => {
|
|
1170
1158
|
init_dist();
|
|
1171
1159
|
init_body();
|
|
1172
1160
|
init_response();
|
|
@@ -1184,9 +1172,7 @@ var init_src = __esmMin((() => {
|
|
|
1184
1172
|
"http:",
|
|
1185
1173
|
"https:"
|
|
1186
1174
|
]);
|
|
1187
|
-
}));
|
|
1188
|
-
|
|
1189
|
-
//#endregion
|
|
1190
|
-
init_src();
|
|
1175
|
+
}))();
|
|
1191
1176
|
export { fetch as default };
|
|
1192
|
-
|
|
1177
|
+
|
|
1178
|
+
//# sourceMappingURL=src-Cl4mko2y.js.map
|