@kevisual/ai 0.0.9 → 0.0.11
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/ai-provider-browser.js +701 -494
- package/dist/ai-provider.js +495 -199
- package/package.json +17 -17
- package/src/provider/chat-adapter/dashscope.ts +1 -1
- package/src/provider/knowledge.ts +4 -3
- package/src/test/aliyun/test.ts +26 -0
- package/src/test/func-call/demo.ts +2 -2
- package/src/test/model-scope/index.ts +4 -4
|
@@ -48,97 +48,9 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
48
48
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
// node:process
|
|
52
|
-
var exports_process = {};
|
|
53
|
-
__export(exports_process, {
|
|
54
|
-
versions: () => versions,
|
|
55
|
-
version: () => version,
|
|
56
|
-
umask: () => umask,
|
|
57
|
-
title: () => title,
|
|
58
|
-
removeListener: () => removeListener,
|
|
59
|
-
removeAllListeners: () => removeAllListeners,
|
|
60
|
-
prependOnceListener: () => prependOnceListener,
|
|
61
|
-
prependListener: () => prependListener,
|
|
62
|
-
once: () => once,
|
|
63
|
-
on: () => on,
|
|
64
|
-
off: () => off,
|
|
65
|
-
nextTick: () => nextTick,
|
|
66
|
-
listeners: () => listeners,
|
|
67
|
-
env: () => env2,
|
|
68
|
-
emit: () => emit,
|
|
69
|
-
cwd: () => cwd,
|
|
70
|
-
chdir: () => chdir,
|
|
71
|
-
browser: () => browser,
|
|
72
|
-
binding: () => binding,
|
|
73
|
-
argv: () => argv,
|
|
74
|
-
addListener: () => addListener
|
|
75
|
-
});
|
|
76
|
-
function cleanUpNextTick() {
|
|
77
|
-
if (!draining || !currentQueue)
|
|
78
|
-
return;
|
|
79
|
-
if (draining = false, currentQueue.length)
|
|
80
|
-
queue = currentQueue.concat(queue);
|
|
81
|
-
else
|
|
82
|
-
queueIndex = -1;
|
|
83
|
-
if (queue.length)
|
|
84
|
-
drainQueue();
|
|
85
|
-
}
|
|
86
|
-
function drainQueue() {
|
|
87
|
-
if (draining)
|
|
88
|
-
return;
|
|
89
|
-
var timeout = setTimeout(cleanUpNextTick, 0);
|
|
90
|
-
draining = true;
|
|
91
|
-
var len = queue.length;
|
|
92
|
-
while (len) {
|
|
93
|
-
currentQueue = queue, queue = [];
|
|
94
|
-
while (++queueIndex < len)
|
|
95
|
-
if (currentQueue) {
|
|
96
|
-
var item = currentQueue[queueIndex];
|
|
97
|
-
item.fun.apply(null, item.array);
|
|
98
|
-
}
|
|
99
|
-
queueIndex = -1, len = queue.length;
|
|
100
|
-
}
|
|
101
|
-
currentQueue = null, draining = false, clearTimeout(timeout, 0);
|
|
102
|
-
}
|
|
103
|
-
function nextTick(fun) {
|
|
104
|
-
var args = new Array(arguments.length - 1);
|
|
105
|
-
if (arguments.length > 1)
|
|
106
|
-
for (var i = 1;i < arguments.length; i++)
|
|
107
|
-
args[i - 1] = arguments[i];
|
|
108
|
-
if (queue.push({ fun, args }), queue.length === 1 && !draining)
|
|
109
|
-
setTimeout(drainQueue, 0);
|
|
110
|
-
}
|
|
111
|
-
function noop2() {}
|
|
112
|
-
var queue, draining = false, currentQueue, queueIndex = -1, title = "browser", browser = true, env2, argv, version = "", versions, on, addListener, once, off, removeListener, removeAllListeners, emit, prependListener, prependOnceListener, listeners = function(name) {
|
|
113
|
-
return [];
|
|
114
|
-
}, binding = function(name) {
|
|
115
|
-
throw new Error("process.binding is not supported in browser polyfill");
|
|
116
|
-
}, cwd = function() {
|
|
117
|
-
return "/";
|
|
118
|
-
}, chdir = function(dir) {
|
|
119
|
-
throw new Error("process.chdir is not supported in browser polyfill");
|
|
120
|
-
}, umask = function() {
|
|
121
|
-
return 0;
|
|
122
|
-
};
|
|
123
|
-
var init_process = __esm(() => {
|
|
124
|
-
queue = [];
|
|
125
|
-
env2 = {};
|
|
126
|
-
argv = [];
|
|
127
|
-
versions = {};
|
|
128
|
-
on = noop2;
|
|
129
|
-
addListener = noop2;
|
|
130
|
-
once = noop2;
|
|
131
|
-
off = noop2;
|
|
132
|
-
removeListener = noop2;
|
|
133
|
-
removeAllListeners = noop2;
|
|
134
|
-
emit = noop2;
|
|
135
|
-
prependListener = noop2;
|
|
136
|
-
prependOnceListener = noop2;
|
|
137
|
-
});
|
|
138
|
-
|
|
139
51
|
// node:buffer
|
|
140
|
-
var
|
|
141
|
-
__export(
|
|
52
|
+
var exports_buffer = {};
|
|
53
|
+
__export(exports_buffer, {
|
|
142
54
|
transcode: () => transcode,
|
|
143
55
|
resolveObjectURL: () => resolveObjectURL,
|
|
144
56
|
kStringMaxLength: () => kStringMaxLength,
|
|
@@ -354,7 +266,7 @@ function fromObject(obj) {
|
|
|
354
266
|
return obj.copy(buf, 0, 0, len2), buf;
|
|
355
267
|
}
|
|
356
268
|
if (obj.length !== undefined) {
|
|
357
|
-
if (typeof obj.length !== "number" ||
|
|
269
|
+
if (typeof obj.length !== "number" || Number.isNaN(obj.length))
|
|
358
270
|
return createBuffer(0);
|
|
359
271
|
return fromArrayLike(obj);
|
|
360
272
|
}
|
|
@@ -492,11 +404,11 @@ function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
|
|
|
492
404
|
indexSize = 2, arrLength /= 2, valLength /= 2, byteOffset /= 2;
|
|
493
405
|
}
|
|
494
406
|
}
|
|
495
|
-
function read2(buf,
|
|
407
|
+
function read2(buf, i3) {
|
|
496
408
|
if (indexSize === 1)
|
|
497
|
-
return buf[
|
|
409
|
+
return buf[i3];
|
|
498
410
|
else
|
|
499
|
-
return buf.readUInt16BE(
|
|
411
|
+
return buf.readUInt16BE(i3 * indexSize);
|
|
500
412
|
}
|
|
501
413
|
let i2;
|
|
502
414
|
if (dir) {
|
|
@@ -541,7 +453,7 @@ function hexWrite(buf, string, offset, length) {
|
|
|
541
453
|
let i2;
|
|
542
454
|
for (i2 = 0;i2 < length; ++i2) {
|
|
543
455
|
let parsed = parseInt(string.substr(i2 * 2, 2), 16);
|
|
544
|
-
if (
|
|
456
|
+
if (Number.isNaN(parsed))
|
|
545
457
|
return i2;
|
|
546
458
|
buf[offset + i2] = parsed;
|
|
547
459
|
}
|
|
@@ -998,7 +910,7 @@ var init_buffer = __esm(() => {
|
|
|
998
910
|
return Buffer2.compare(this, b) === 0;
|
|
999
911
|
};
|
|
1000
912
|
Buffer2.prototype.inspect = function inspect() {
|
|
1001
|
-
let str2 = "", max =
|
|
913
|
+
let str2 = "", max = INSPECT_MAX_BYTES;
|
|
1002
914
|
if (str2 = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(), this.length > max)
|
|
1003
915
|
str2 += " ... ";
|
|
1004
916
|
return "<Buffer " + str2 + ">";
|
|
@@ -1497,6 +1409,7 @@ __export(exports_util, {
|
|
|
1497
1409
|
inherits: () => inherits,
|
|
1498
1410
|
format: () => format,
|
|
1499
1411
|
deprecate: () => deprecate,
|
|
1412
|
+
default: () => util_default,
|
|
1500
1413
|
debuglog: () => debuglog,
|
|
1501
1414
|
callbackifyOnRejected: () => callbackifyOnRejected,
|
|
1502
1415
|
callbackify: () => callbackify,
|
|
@@ -1813,10 +1726,10 @@ function callbackify(original) {
|
|
|
1813
1726
|
}
|
|
1814
1727
|
return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, Object.getOwnPropertyDescriptors(original)), callbackified;
|
|
1815
1728
|
}
|
|
1816
|
-
var formatRegExp, debuglog, inspect2, types = () => {}, months, promisify, TextEncoder2, TextDecoder;
|
|
1729
|
+
var formatRegExp, debuglog, inspect2, types = () => {}, months, promisify, TextEncoder2, TextDecoder, util_default;
|
|
1817
1730
|
var init_util = __esm(() => {
|
|
1818
1731
|
formatRegExp = /%[sdj%]/g;
|
|
1819
|
-
debuglog = ((debugs = {}, debugEnvRegex = {}, debugEnv) => ((debugEnv = typeof process !== "undefined" &&
|
|
1732
|
+
debuglog = ((debugs = {}, debugEnvRegex = {}, debugEnv) => ((debugEnv = typeof process !== "undefined" && false) && (debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase()), debugEnvRegex = new RegExp("^" + debugEnv + "$", "i"), (set) => {
|
|
1820
1733
|
if (set = set.toUpperCase(), !debugs[set])
|
|
1821
1734
|
if (debugEnvRegex.test(set))
|
|
1822
1735
|
debugs[set] = function(...args) {
|
|
@@ -1878,13 +1791,14 @@ var init_util = __esm(() => {
|
|
|
1878
1791
|
return Object.defineProperties(fn, Object.getOwnPropertyDescriptors(original));
|
|
1879
1792
|
});
|
|
1880
1793
|
({ TextEncoder: TextEncoder2, TextDecoder } = globalThis);
|
|
1794
|
+
util_default = { TextEncoder: TextEncoder2, TextDecoder, promisify, log: log2, inherits, _extend, callbackifyOnRejected, callbackify };
|
|
1881
1795
|
});
|
|
1882
1796
|
|
|
1883
1797
|
// node:events
|
|
1884
1798
|
var exports_events = {};
|
|
1885
1799
|
__export(exports_events, {
|
|
1886
1800
|
setMaxListeners: () => setMaxListeners2,
|
|
1887
|
-
once: () =>
|
|
1801
|
+
once: () => once2,
|
|
1888
1802
|
listenerCount: () => listenerCount2,
|
|
1889
1803
|
init: () => EventEmitter,
|
|
1890
1804
|
getMaxListeners: () => getMaxListeners2,
|
|
@@ -1932,7 +1846,7 @@ function overflowWarning(emitter, type2, handlers) {
|
|
|
1932
1846
|
function onceWrapper(type2, listener, ...args) {
|
|
1933
1847
|
this.removeListener(type2, listener), listener.apply(this, args);
|
|
1934
1848
|
}
|
|
1935
|
-
function
|
|
1849
|
+
function once2(emitter, type2, options) {
|
|
1936
1850
|
var signal = options?.signal;
|
|
1937
1851
|
if (validateAbortSignal(signal, "options.signal"), signal?.aborted)
|
|
1938
1852
|
throw new AbortError(undefined, { cause: signal?.reason });
|
|
@@ -2036,7 +1950,7 @@ var SymbolFor, kCapture, kErrorMonitor, kMaxEventTargetListeners, kMaxEventTarge
|
|
|
2036
1950
|
this._events = { __proto__: null }, this._eventsCount = 0;
|
|
2037
1951
|
if (this._maxListeners ??= undefined, this[kCapture] = opts?.captureRejections ? Boolean(opts?.captureRejections) : EventEmitterPrototype[kCapture])
|
|
2038
1952
|
this.emit = emitWithRejectionCapture;
|
|
2039
|
-
}, EventEmitterPrototype, emitWithoutRejectionCapture = function
|
|
1953
|
+
}, EventEmitterPrototype, emitWithoutRejectionCapture = function emit(type2, ...args) {
|
|
2040
1954
|
if (type2 === "error")
|
|
2041
1955
|
return emitError(this, args);
|
|
2042
1956
|
var { _events: events } = this;
|
|
@@ -2067,7 +1981,7 @@ var SymbolFor, kCapture, kErrorMonitor, kMaxEventTargetListeners, kMaxEventTarge
|
|
|
2067
1981
|
}
|
|
2068
1982
|
}
|
|
2069
1983
|
return true;
|
|
2070
|
-
}, emitWithRejectionCapture = function
|
|
1984
|
+
}, emitWithRejectionCapture = function emit2(type2, ...args) {
|
|
2071
1985
|
if (type2 === "error")
|
|
2072
1986
|
return emitError(this, args);
|
|
2073
1987
|
var { _events: events } = this;
|
|
@@ -2122,7 +2036,7 @@ var init_events = __esm(() => {
|
|
|
2122
2036
|
return this?._maxListeners ?? defaultMaxListeners;
|
|
2123
2037
|
};
|
|
2124
2038
|
EventEmitterPrototype.emit = emitWithoutRejectionCapture;
|
|
2125
|
-
EventEmitterPrototype.addListener = function
|
|
2039
|
+
EventEmitterPrototype.addListener = function addListener(type2, fn) {
|
|
2126
2040
|
checkListener(fn);
|
|
2127
2041
|
var events = this._events;
|
|
2128
2042
|
if (!events)
|
|
@@ -2141,7 +2055,7 @@ var init_events = __esm(() => {
|
|
|
2141
2055
|
return this;
|
|
2142
2056
|
};
|
|
2143
2057
|
EventEmitterPrototype.on = EventEmitterPrototype.addListener;
|
|
2144
|
-
EventEmitterPrototype.prependListener = function
|
|
2058
|
+
EventEmitterPrototype.prependListener = function prependListener(type2, fn) {
|
|
2145
2059
|
checkListener(fn);
|
|
2146
2060
|
var events = this._events;
|
|
2147
2061
|
if (!events)
|
|
@@ -2159,17 +2073,17 @@ var init_events = __esm(() => {
|
|
|
2159
2073
|
}
|
|
2160
2074
|
return this;
|
|
2161
2075
|
};
|
|
2162
|
-
EventEmitterPrototype.once = function
|
|
2076
|
+
EventEmitterPrototype.once = function once(type2, fn) {
|
|
2163
2077
|
checkListener(fn);
|
|
2164
2078
|
let bound = onceWrapper.bind(this, type2, fn);
|
|
2165
2079
|
return bound.listener = fn, this.addListener(type2, bound), this;
|
|
2166
2080
|
};
|
|
2167
|
-
EventEmitterPrototype.prependOnceListener = function
|
|
2081
|
+
EventEmitterPrototype.prependOnceListener = function prependOnceListener(type2, fn) {
|
|
2168
2082
|
checkListener(fn);
|
|
2169
2083
|
let bound = onceWrapper.bind(this, type2, fn);
|
|
2170
2084
|
return bound.listener = fn, this.prependListener(type2, bound), this;
|
|
2171
2085
|
};
|
|
2172
|
-
EventEmitterPrototype.removeListener = function
|
|
2086
|
+
EventEmitterPrototype.removeListener = function removeListener(type2, fn) {
|
|
2173
2087
|
checkListener(fn);
|
|
2174
2088
|
var { _events: events } = this;
|
|
2175
2089
|
if (!events)
|
|
@@ -2195,7 +2109,7 @@ var init_events = __esm(() => {
|
|
|
2195
2109
|
return this;
|
|
2196
2110
|
};
|
|
2197
2111
|
EventEmitterPrototype.off = EventEmitterPrototype.removeListener;
|
|
2198
|
-
EventEmitterPrototype.removeAllListeners = function
|
|
2112
|
+
EventEmitterPrototype.removeAllListeners = function removeAllListeners(type2) {
|
|
2199
2113
|
var { _events: events } = this;
|
|
2200
2114
|
if (type2 && events) {
|
|
2201
2115
|
if (events[type2])
|
|
@@ -2204,7 +2118,7 @@ var init_events = __esm(() => {
|
|
|
2204
2118
|
this._events = { __proto__: null };
|
|
2205
2119
|
return this;
|
|
2206
2120
|
};
|
|
2207
|
-
EventEmitterPrototype.listeners = function
|
|
2121
|
+
EventEmitterPrototype.listeners = function listeners(type2) {
|
|
2208
2122
|
var { _events: events } = this;
|
|
2209
2123
|
if (!events)
|
|
2210
2124
|
return [];
|
|
@@ -2249,7 +2163,7 @@ var init_events = __esm(() => {
|
|
|
2249
2163
|
}, set: (arg) => {
|
|
2250
2164
|
validateNumber2(arg, "defaultMaxListeners", 0), defaultMaxListeners = arg;
|
|
2251
2165
|
} }, kMaxEventTargetListeners: { value: kMaxEventTargetListeners, enumerable: false, configurable: false, writable: false }, kMaxEventTargetListenersWarned: { value: kMaxEventTargetListenersWarned, enumerable: false, configurable: false, writable: false } });
|
|
2252
|
-
Object.assign(EventEmitter, { once:
|
|
2166
|
+
Object.assign(EventEmitter, { once: once2, getEventListeners, getMaxListeners: getMaxListeners2, setMaxListeners: setMaxListeners2, EventEmitter, usingDomains: false, captureRejectionSymbol, errorMonitor: kErrorMonitor, addAbortListener, init: EventEmitter, listenerCount: listenerCount2 });
|
|
2253
2167
|
events_default = EventEmitter;
|
|
2254
2168
|
});
|
|
2255
2169
|
|
|
@@ -2713,10 +2627,10 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
2713
2627
|
return x !== null && typeof x === "object";
|
|
2714
2628
|
}
|
|
2715
2629
|
function getListeners(eventTarget) {
|
|
2716
|
-
let
|
|
2717
|
-
if (
|
|
2630
|
+
let listeners2 = listenersMap.get(eventTarget);
|
|
2631
|
+
if (listeners2 == null)
|
|
2718
2632
|
throw new TypeError("'this' is expected an EventTarget object, but got another value.");
|
|
2719
|
-
return
|
|
2633
|
+
return listeners2;
|
|
2720
2634
|
}
|
|
2721
2635
|
function defineEventAttributeDescriptor(eventName) {
|
|
2722
2636
|
return { get() {
|
|
@@ -2730,15 +2644,15 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
2730
2644
|
}, set(listener) {
|
|
2731
2645
|
if (typeof listener !== "function" && !isObject2(listener))
|
|
2732
2646
|
listener = null;
|
|
2733
|
-
let
|
|
2647
|
+
let listeners2 = getListeners(this), prev = null, node = listeners2.get(eventName);
|
|
2734
2648
|
while (node != null) {
|
|
2735
2649
|
if (node.listenerType === ATTRIBUTE)
|
|
2736
2650
|
if (prev !== null)
|
|
2737
2651
|
prev.next = node.next;
|
|
2738
2652
|
else if (node.next !== null)
|
|
2739
|
-
|
|
2653
|
+
listeners2.set(eventName, node.next);
|
|
2740
2654
|
else
|
|
2741
|
-
|
|
2655
|
+
listeners2.delete(eventName);
|
|
2742
2656
|
else
|
|
2743
2657
|
prev = node;
|
|
2744
2658
|
node = node.next;
|
|
@@ -2746,7 +2660,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
2746
2660
|
if (listener !== null) {
|
|
2747
2661
|
let newNode = { listener, listenerType: ATTRIBUTE, passive: false, once: false, next: null };
|
|
2748
2662
|
if (prev === null)
|
|
2749
|
-
|
|
2663
|
+
listeners2.set(eventName, newNode);
|
|
2750
2664
|
else
|
|
2751
2665
|
prev.next = newNode;
|
|
2752
2666
|
}
|
|
@@ -2784,9 +2698,9 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
2784
2698
|
return;
|
|
2785
2699
|
if (typeof listener !== "function" && !isObject2(listener))
|
|
2786
2700
|
throw new TypeError("'listener' should be a function or an object.");
|
|
2787
|
-
let
|
|
2701
|
+
let listeners2 = getListeners(this), optionsIsObj = isObject2(options), listenerType = (optionsIsObj ? Boolean(options.capture) : Boolean(options)) ? CAPTURE : BUBBLE, newNode = { listener, listenerType, passive: optionsIsObj && Boolean(options.passive), once: optionsIsObj && Boolean(options.once), next: null }, node = listeners2.get(eventName);
|
|
2788
2702
|
if (node === undefined) {
|
|
2789
|
-
|
|
2703
|
+
listeners2.set(eventName, newNode);
|
|
2790
2704
|
return;
|
|
2791
2705
|
}
|
|
2792
2706
|
let prev = null;
|
|
@@ -2799,15 +2713,15 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
2799
2713
|
}, removeEventListener(eventName, listener, options) {
|
|
2800
2714
|
if (listener == null)
|
|
2801
2715
|
return;
|
|
2802
|
-
let
|
|
2716
|
+
let listeners2 = getListeners(this), listenerType = (isObject2(options) ? Boolean(options.capture) : Boolean(options)) ? CAPTURE : BUBBLE, prev = null, node = listeners2.get(eventName);
|
|
2803
2717
|
while (node != null) {
|
|
2804
2718
|
if (node.listener === listener && node.listenerType === listenerType) {
|
|
2805
2719
|
if (prev !== null)
|
|
2806
2720
|
prev.next = node.next;
|
|
2807
2721
|
else if (node.next !== null)
|
|
2808
|
-
|
|
2722
|
+
listeners2.set(eventName, node.next);
|
|
2809
2723
|
else
|
|
2810
|
-
|
|
2724
|
+
listeners2.delete(eventName);
|
|
2811
2725
|
return;
|
|
2812
2726
|
}
|
|
2813
2727
|
prev = node, node = node.next;
|
|
@@ -2815,7 +2729,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
2815
2729
|
}, dispatchEvent(event) {
|
|
2816
2730
|
if (event == null || typeof event.type !== "string")
|
|
2817
2731
|
throw new TypeError('"event.type" should be a string.');
|
|
2818
|
-
let
|
|
2732
|
+
let listeners2 = getListeners(this), eventName = event.type, node = listeners2.get(eventName);
|
|
2819
2733
|
if (node == null)
|
|
2820
2734
|
return true;
|
|
2821
2735
|
let wrappedEvent = wrapEvent(this, event), prev = null;
|
|
@@ -2824,9 +2738,9 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
2824
2738
|
if (prev !== null)
|
|
2825
2739
|
prev.next = node.next;
|
|
2826
2740
|
else if (node.next !== null)
|
|
2827
|
-
|
|
2741
|
+
listeners2.set(eventName, node.next);
|
|
2828
2742
|
else
|
|
2829
|
-
|
|
2743
|
+
listeners2.delete(eventName);
|
|
2830
2744
|
else
|
|
2831
2745
|
prev = node;
|
|
2832
2746
|
if (setPassiveListener(wrappedEvent, node.passive ? node.listener : null), typeof node.listener === "function")
|
|
@@ -2914,7 +2828,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
2914
2828
|
module2.exports.AbortSignal = AbortSignal;
|
|
2915
2829
|
});
|
|
2916
2830
|
var require_util = __commonJS2((exports2, module2) => {
|
|
2917
|
-
var bufferModule = (init_buffer(), __toCommonJS(
|
|
2831
|
+
var bufferModule = (init_buffer(), __toCommonJS(exports_buffer)), { format: format2, inspect: inspect3 } = require_inspect(), { codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE3 } } = require_errors(), { kResistStopPropagation, AggregateError, SymbolDispose } = require_primordials(), AbortSignal = globalThis.AbortSignal || require_abort_controller().AbortSignal, AbortController2 = globalThis.AbortController || require_abort_controller().AbortController, AsyncFunction = Object.getPrototypeOf(async function() {}).constructor, Blob3 = globalThis.Blob || bufferModule.Blob, isBlob = typeof Blob3 !== "undefined" ? function isBlob(b) {
|
|
2918
2832
|
return b instanceof Blob3;
|
|
2919
2833
|
} : function isBlob(b) {
|
|
2920
2834
|
return false;
|
|
@@ -3141,7 +3055,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
3141
3055
|
module2.exports = { isInt32, isUint32, parseFileMode, validateArray, validateStringArray, validateBooleanArray, validateAbortSignalArray, validateBoolean: validateBoolean2, validateBuffer, validateDictionary, validateEncoding, validateFunction, validateInt32, validateInteger, validateNumber: validateNumber3, validateObject, validateOneOf, validatePlainFunction, validatePort, validateSignalName, validateString, validateUint32, validateUndefined, validateUnion, validateAbortSignal: validateAbortSignal2, validateLinkHeaderValue };
|
|
3142
3056
|
});
|
|
3143
3057
|
var require_process = __commonJS2((exports2, module2) => {
|
|
3144
|
-
module2.exports =
|
|
3058
|
+
module2.exports = globalThis.process;
|
|
3145
3059
|
});
|
|
3146
3060
|
var require_utils = __commonJS2((exports2, module2) => {
|
|
3147
3061
|
var { SymbolAsyncIterator, SymbolIterator, SymbolFor: SymbolFor2 } = require_primordials(), kIsDestroyed = SymbolFor2("nodejs.stream.destroyed"), kIsErrored = SymbolFor2("nodejs.stream.errored"), kIsReadable = SymbolFor2("nodejs.stream.readable"), kIsWritable = SymbolFor2("nodejs.stream.writable"), kIsDisturbed = SymbolFor2("nodejs.stream.disturbed"), kIsClosedPromise = SymbolFor2("nodejs.webstream.isClosedPromise"), kControllerErrorFunction = SymbolFor2("nodejs.webstream.controllerErrorFunction");
|
|
@@ -3673,13 +3587,13 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
3673
3587
|
if (cleanup(), EE.listenerCount(this, "error") === 0)
|
|
3674
3588
|
this.emit("error", er);
|
|
3675
3589
|
}
|
|
3676
|
-
|
|
3590
|
+
prependListener2(source, "error", onerror), prependListener2(dest, "error", onerror);
|
|
3677
3591
|
function cleanup() {
|
|
3678
3592
|
source.removeListener("data", ondata), dest.removeListener("drain", ondrain), source.removeListener("end", onend), source.removeListener("close", onclose), source.removeListener("error", onerror), dest.removeListener("error", onerror), source.removeListener("end", cleanup), source.removeListener("close", cleanup), dest.removeListener("close", cleanup);
|
|
3679
3593
|
}
|
|
3680
3594
|
return source.on("end", cleanup), source.on("close", cleanup), dest.on("close", cleanup), dest.emit("pipe", source), dest;
|
|
3681
3595
|
};
|
|
3682
|
-
function
|
|
3596
|
+
function prependListener2(emitter, event, fn) {
|
|
3683
3597
|
if (typeof emitter.prependListener === "function")
|
|
3684
3598
|
return emitter.prependListener(event, fn);
|
|
3685
3599
|
if (!emitter._events || !emitter._events[event])
|
|
@@ -3689,7 +3603,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
3689
3603
|
else
|
|
3690
3604
|
emitter._events[event] = [fn, emitter._events[event]];
|
|
3691
3605
|
}
|
|
3692
|
-
module2.exports = { Stream: Stream2, prependListener:
|
|
3606
|
+
module2.exports = { Stream: Stream2, prependListener: prependListener2 };
|
|
3693
3607
|
});
|
|
3694
3608
|
var require_add_abort_signal = __commonJS2((exports2, module2) => {
|
|
3695
3609
|
var { SymbolDispose } = require_primordials(), { AbortError: AbortError2, codes } = require_errors(), { isNodeStream, isWebStream, kControllerErrorFunction } = require_utils(), eos = require_end_of_stream(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE3 } = codes, addAbortListener2, validateAbortSignal2 = (signal, name) => {
|
|
@@ -3720,7 +3634,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
3720
3634
|
};
|
|
3721
3635
|
});
|
|
3722
3636
|
var require_buffer_list = __commonJS2((exports2, module2) => {
|
|
3723
|
-
var { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array: Uint8Array2 } = require_primordials(), { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(
|
|
3637
|
+
var { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array: Uint8Array2 } = require_primordials(), { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(exports_buffer)), { inspect: inspect3 } = require_util();
|
|
3724
3638
|
module2.exports = class BufferList {
|
|
3725
3639
|
constructor() {
|
|
3726
3640
|
this.head = null, this.tail = null, this.length = 0;
|
|
@@ -3859,7 +3773,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
3859
3773
|
});
|
|
3860
3774
|
var require_safe_buffer = __commonJS2((exports2, module2) => {
|
|
3861
3775
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
3862
|
-
var buffer = (init_buffer(), __toCommonJS(
|
|
3776
|
+
var buffer = (init_buffer(), __toCommonJS(exports_buffer)), Buffer3 = buffer.Buffer;
|
|
3863
3777
|
function copyProps(src, dst) {
|
|
3864
3778
|
for (var key in src)
|
|
3865
3779
|
dst[key] = src[key];
|
|
@@ -4113,7 +4027,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
4113
4027
|
}
|
|
4114
4028
|
});
|
|
4115
4029
|
var require_from = __commonJS2((exports2, module2) => {
|
|
4116
|
-
var process2 = require_process(), { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials(), { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(
|
|
4030
|
+
var process2 = require_process(), { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials(), { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(exports_buffer)), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE3, ERR_STREAM_NULL_VALUES } = require_errors().codes;
|
|
4117
4031
|
function from2(Readable, iterable, opts) {
|
|
4118
4032
|
let iterator;
|
|
4119
4033
|
if (typeof iterable === "string" || iterable instanceof Buffer3)
|
|
@@ -4175,7 +4089,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
4175
4089
|
var process2 = require_process(), { ArrayPrototypeIndexOf, NumberIsInteger, NumberIsNaN, NumberParseInt, ObjectDefineProperties, ObjectKeys, ObjectSetPrototypeOf, Promise: Promise2, SafeSet, SymbolAsyncDispose, SymbolAsyncIterator, Symbol: Symbol2 } = require_primordials();
|
|
4176
4090
|
module2.exports = Readable;
|
|
4177
4091
|
Readable.ReadableState = ReadableState;
|
|
4178
|
-
var { EventEmitter: EE } = (init_events(), __toCommonJS(exports_events)), { Stream: Stream2, prependListener:
|
|
4092
|
+
var { EventEmitter: EE } = (init_events(), __toCommonJS(exports_events)), { Stream: Stream2, prependListener: prependListener2 } = require_legacy(), { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(exports_buffer)), { addAbortSignal } = require_add_abort_signal(), eos = require_end_of_stream(), debug = require_util().debuglog("stream", (fn) => {
|
|
4179
4093
|
debug = fn;
|
|
4180
4094
|
}), BufferList = require_buffer_list(), destroyImpl = require_destroy(), { getHighWaterMark, getDefaultHighWaterMark } = require_state(), { aggregateTwoErrors, codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE3, ERR_METHOD_NOT_IMPLEMENTED, ERR_OUT_OF_RANGE: ERR_OUT_OF_RANGE3, ERR_STREAM_PUSH_AFTER_EOF, ERR_STREAM_UNSHIFT_AFTER_END_EVENT }, AbortError: AbortError2 } = require_errors(), { validateObject } = require_validators(), kPaused = Symbol2("kPaused"), { StringDecoder } = require_string_decoder(), from2 = require_from();
|
|
4181
4095
|
ObjectSetPrototypeOf(Readable.prototype, Stream2.prototype);
|
|
@@ -4496,7 +4410,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
4496
4410
|
dest.emit("error", er);
|
|
4497
4411
|
}
|
|
4498
4412
|
}
|
|
4499
|
-
|
|
4413
|
+
prependListener2(dest, "error", onerror);
|
|
4500
4414
|
function onclose() {
|
|
4501
4415
|
dest.removeListener("finish", onfinish), unpipe();
|
|
4502
4416
|
}
|
|
@@ -4793,7 +4707,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
4793
4707
|
var process2 = require_process(), { ArrayPrototypeSlice: ArrayPrototypeSlice2, Error: Error2, FunctionPrototypeSymbolHasInstance, ObjectDefineProperty, ObjectDefineProperties, ObjectSetPrototypeOf, StringPrototypeToLowerCase, Symbol: Symbol2, SymbolHasInstance } = require_primordials();
|
|
4794
4708
|
module2.exports = Writable;
|
|
4795
4709
|
Writable.WritableState = WritableState;
|
|
4796
|
-
var { EventEmitter: EE } = (init_events(), __toCommonJS(exports_events)), Stream2 = require_legacy().Stream, { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(
|
|
4710
|
+
var { EventEmitter: EE } = (init_events(), __toCommonJS(exports_events)), Stream2 = require_legacy().Stream, { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(exports_buffer)), destroyImpl = require_destroy(), { addAbortSignal } = require_add_abort_signal(), { getHighWaterMark, getDefaultHighWaterMark } = require_state(), { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE3, ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED, ERR_STREAM_ALREADY_FINISHED, ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING } = require_errors().codes, { errorOrDestroy } = destroyImpl;
|
|
4797
4711
|
ObjectSetPrototypeOf(Writable.prototype, Stream2.prototype);
|
|
4798
4712
|
ObjectSetPrototypeOf(Writable, Stream2);
|
|
4799
4713
|
function nop() {}
|
|
@@ -5175,7 +5089,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
5175
5089
|
};
|
|
5176
5090
|
});
|
|
5177
5091
|
var require_duplexify = __commonJS2((exports2, module2) => {
|
|
5178
|
-
var process2 = require_process(), bufferModule = (init_buffer(), __toCommonJS(
|
|
5092
|
+
var process2 = require_process(), bufferModule = (init_buffer(), __toCommonJS(exports_buffer)), { isReadable, isWritable, isIterable, isNodeStream, isReadableNodeStream, isWritableNodeStream, isDuplexNodeStream, isReadableStream, isWritableStream } = require_utils(), eos = require_end_of_stream(), { AbortError: AbortError2, codes: { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE3, ERR_INVALID_RETURN_VALUE } } = require_errors(), { destroyer } = require_destroy(), Duplex = require_duplex(), Readable = require_readable(), Writable = require_writable(), { createDeferredPromise } = require_util(), from2 = require_from(), Blob3 = globalThis.Blob || bufferModule.Blob, isBlob = typeof Blob3 !== "undefined" ? function isBlob(b) {
|
|
5179
5093
|
return b instanceof Blob3;
|
|
5180
5094
|
} : function isBlob(b) {
|
|
5181
5095
|
return false;
|
|
@@ -5862,7 +5776,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
5862
5776
|
if ((options === null || options === undefined ? undefined : options.highWaterMark) != null)
|
|
5863
5777
|
highWaterMark = MathFloor(options.highWaterMark);
|
|
5864
5778
|
return validateInteger(concurrency, "options.concurrency", 1), validateInteger(highWaterMark, "options.highWaterMark", 0), highWaterMark += concurrency, async function* map() {
|
|
5865
|
-
let signal = require_util().AbortSignalAny([options === null || options === undefined ? undefined : options.signal].filter(Boolean2)), stream = this,
|
|
5779
|
+
let signal = require_util().AbortSignalAny([options === null || options === undefined ? undefined : options.signal].filter(Boolean2)), stream = this, queue = [], signalOpt = { signal }, next, resume, done = false, cnt = 0;
|
|
5866
5780
|
function onCatch() {
|
|
5867
5781
|
done = true, afterItemProcessed();
|
|
5868
5782
|
}
|
|
@@ -5870,7 +5784,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
5870
5784
|
cnt -= 1, maybeResume();
|
|
5871
5785
|
}
|
|
5872
5786
|
function maybeResume() {
|
|
5873
|
-
if (resume && !done && cnt < concurrency &&
|
|
5787
|
+
if (resume && !done && cnt < concurrency && queue.length < highWaterMark)
|
|
5874
5788
|
resume(), resume = null;
|
|
5875
5789
|
}
|
|
5876
5790
|
async function pump() {
|
|
@@ -5887,17 +5801,17 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
5887
5801
|
} catch (err) {
|
|
5888
5802
|
val = PromiseReject(err);
|
|
5889
5803
|
}
|
|
5890
|
-
if (cnt += 1, PromisePrototypeThen(val, afterItemProcessed, onCatch),
|
|
5804
|
+
if (cnt += 1, PromisePrototypeThen(val, afterItemProcessed, onCatch), queue.push(val), next)
|
|
5891
5805
|
next(), next = null;
|
|
5892
|
-
if (!done && (
|
|
5806
|
+
if (!done && (queue.length >= highWaterMark || cnt >= concurrency))
|
|
5893
5807
|
await new Promise2((resolve) => {
|
|
5894
5808
|
resume = resolve;
|
|
5895
5809
|
});
|
|
5896
5810
|
}
|
|
5897
|
-
|
|
5811
|
+
queue.push(kEof);
|
|
5898
5812
|
} catch (err) {
|
|
5899
5813
|
let val = PromiseReject(err);
|
|
5900
|
-
PromisePrototypeThen(val, afterItemProcessed, onCatch),
|
|
5814
|
+
PromisePrototypeThen(val, afterItemProcessed, onCatch), queue.push(val);
|
|
5901
5815
|
} finally {
|
|
5902
5816
|
if (done = true, next)
|
|
5903
5817
|
next(), next = null;
|
|
@@ -5906,15 +5820,15 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
5906
5820
|
pump();
|
|
5907
5821
|
try {
|
|
5908
5822
|
while (true) {
|
|
5909
|
-
while (
|
|
5910
|
-
let val = await
|
|
5823
|
+
while (queue.length > 0) {
|
|
5824
|
+
let val = await queue[0];
|
|
5911
5825
|
if (val === kEof)
|
|
5912
5826
|
return;
|
|
5913
5827
|
if (signal.aborted)
|
|
5914
5828
|
throw new AbortError2;
|
|
5915
5829
|
if (val !== kEmpty)
|
|
5916
5830
|
yield val;
|
|
5917
|
-
|
|
5831
|
+
queue.shift(), maybeResume();
|
|
5918
5832
|
}
|
|
5919
5833
|
await new Promise2((resolve) => {
|
|
5920
5834
|
next = resolve;
|
|
@@ -6110,7 +6024,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
6110
6024
|
module2.exports = { finished, pipeline };
|
|
6111
6025
|
});
|
|
6112
6026
|
var require_stream2 = __commonJS2((exports2, module2) => {
|
|
6113
|
-
var { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(
|
|
6027
|
+
var { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(exports_buffer)), { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials(), { promisify: { custom: customPromisify } } = require_util(), { streamReturningOperators, promiseReturningOperators } = require_operators(), { codes: { ERR_ILLEGAL_CONSTRUCTOR } } = require_errors(), compose = require_compose(), { setDefaultHighWaterMark, getDefaultHighWaterMark } = require_state(), { pipeline } = require_pipeline(), { destroyer } = require_destroy(), eos = require_end_of_stream(), promises = require_promises(), utils = require_utils(), Stream2 = module2.exports = require_legacy().Stream;
|
|
6114
6028
|
Stream2.isDestroyed = utils.isDestroyed;
|
|
6115
6029
|
Stream2.isDisturbed = utils.isDisturbed;
|
|
6116
6030
|
Stream2.isErrored = utils.isErrored;
|
|
@@ -6164,12 +6078,7 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
6164
6078
|
});
|
|
6165
6079
|
var require_ours = __commonJS2((exports2, module2) => {
|
|
6166
6080
|
var Stream2 = require_stream();
|
|
6167
|
-
|
|
6168
|
-
let promises = Stream2.promises;
|
|
6169
|
-
module2.exports._uint8ArrayToBuffer = Stream2._uint8ArrayToBuffer, module2.exports._isUint8Array = Stream2._isUint8Array, module2.exports.isDisturbed = Stream2.isDisturbed, module2.exports.isErrored = Stream2.isErrored, module2.exports.isReadable = Stream2.isReadable, module2.exports.Readable = Stream2.Readable, module2.exports.Writable = Stream2.Writable, module2.exports.Duplex = Stream2.Duplex, module2.exports.Transform = Stream2.Transform, module2.exports.PassThrough = Stream2.PassThrough, module2.exports.addAbortSignal = Stream2.addAbortSignal, module2.exports.finished = Stream2.finished, module2.exports.destroy = Stream2.destroy, module2.exports.pipeline = Stream2.pipeline, module2.exports.compose = Stream2.compose, Object.defineProperty(Stream2, "promises", { configurable: true, enumerable: true, get() {
|
|
6170
|
-
return promises;
|
|
6171
|
-
} }), module2.exports.Stream = Stream2.Stream;
|
|
6172
|
-
} else {
|
|
6081
|
+
{
|
|
6173
6082
|
let CustomStream = require_stream2(), promises = require_promises(), originalDestroy = CustomStream.Readable.destroy;
|
|
6174
6083
|
module2.exports = CustomStream.Readable, module2.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer, module2.exports._isUint8Array = CustomStream._isUint8Array, module2.exports.isDisturbed = CustomStream.isDisturbed, module2.exports.isErrored = CustomStream.isErrored, module2.exports.isReadable = CustomStream.isReadable, module2.exports.Readable = CustomStream.Readable, module2.exports.Writable = CustomStream.Writable, module2.exports.Duplex = CustomStream.Duplex, module2.exports.Transform = CustomStream.Transform, module2.exports.PassThrough = CustomStream.PassThrough, module2.exports.addAbortSignal = CustomStream.addAbortSignal, module2.exports.finished = CustomStream.finished, module2.exports.destroy = CustomStream.destroy, module2.exports.destroy = originalDestroy, module2.exports.pipeline = CustomStream.pipeline, module2.exports.compose = CustomStream.compose, Object.defineProperty(CustomStream, "promises", { configurable: true, enumerable: true, get() {
|
|
6175
6084
|
return promises;
|
|
@@ -6203,6 +6112,7 @@ __export(exports_crypto, {
|
|
|
6203
6112
|
getDiffieHellman: () => getDiffieHellman2,
|
|
6204
6113
|
getCurves: () => getCurves,
|
|
6205
6114
|
getCiphers: () => getCiphers2,
|
|
6115
|
+
default: () => crypto_default,
|
|
6206
6116
|
createVerify: () => createVerify2,
|
|
6207
6117
|
createSign: () => createSign2,
|
|
6208
6118
|
createHmac: () => createHmac2,
|
|
@@ -6242,7 +6152,7 @@ var __create2, __getProtoOf2, __defProp2, __getOwnPropNames2, __hasOwnProp2, __t
|
|
|
6242
6152
|
return crypto.getRandomValues(array);
|
|
6243
6153
|
}, randomUUID = () => {
|
|
6244
6154
|
return crypto.randomUUID();
|
|
6245
|
-
}, hardcoded_curves, webcrypto;
|
|
6155
|
+
}, hardcoded_curves, webcrypto, crypto_default;
|
|
6246
6156
|
var init_crypto = __esm(() => {
|
|
6247
6157
|
__create2 = Object.create;
|
|
6248
6158
|
({ getPrototypeOf: __getProtoOf2, defineProperty: __defProp2, getOwnPropertyNames: __getOwnPropNames2 } = Object);
|
|
@@ -6274,9 +6184,9 @@ var init_crypto = __esm(() => {
|
|
|
6274
6184
|
});
|
|
6275
6185
|
require_default_encoding = __commonJS2((exports, module) => {
|
|
6276
6186
|
var defaultEncoding;
|
|
6277
|
-
if (
|
|
6187
|
+
if (globalThis.process && globalThis.process.browser)
|
|
6278
6188
|
defaultEncoding = "utf-8";
|
|
6279
|
-
else if (
|
|
6189
|
+
else if (globalThis.process && globalThis.process.version)
|
|
6280
6190
|
pVersionMajor = parseInt(process.version.split(".")[0].slice(1), 10), defaultEncoding = pVersionMajor >= 6 ? "utf-8" : "binary";
|
|
6281
6191
|
else
|
|
6282
6192
|
defaultEncoding = "utf-8";
|
|
@@ -6285,7 +6195,7 @@ var init_crypto = __esm(() => {
|
|
|
6285
6195
|
});
|
|
6286
6196
|
require_safe_buffer = __commonJS2((exports, module) => {
|
|
6287
6197
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
6288
|
-
var buffer = (init_buffer(), __toCommonJS(
|
|
6198
|
+
var buffer = (init_buffer(), __toCommonJS(exports_buffer)), Buffer22 = buffer.Buffer;
|
|
6289
6199
|
function copyProps(src, dst) {
|
|
6290
6200
|
for (var key in src)
|
|
6291
6201
|
dst[key] = src[key];
|
|
@@ -6363,9 +6273,9 @@ var init_crypto = __esm(() => {
|
|
|
6363
6273
|
module.exports = pbkdf2;
|
|
6364
6274
|
});
|
|
6365
6275
|
require_async = __commonJS2((exports, module) => {
|
|
6366
|
-
var Buffer22 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), sync = require_sync(), toBuffer = require_to_buffer(), ZERO_BUF, subtle =
|
|
6276
|
+
var Buffer22 = require_safe_buffer().Buffer, checkParameters = require_precondition(), defaultEncoding = require_default_encoding(), sync = require_sync(), toBuffer = require_to_buffer(), ZERO_BUF, subtle = globalThis.crypto && globalThis.crypto.subtle, toBrowser = { sha: "SHA-1", "sha-1": "SHA-1", sha1: "SHA-1", sha256: "SHA-256", "sha-256": "SHA-256", sha384: "SHA-384", "sha-384": "SHA-384", "sha-512": "SHA-512", sha512: "SHA-512" }, checks = [];
|
|
6367
6277
|
function checkNative(algo) {
|
|
6368
|
-
if (
|
|
6278
|
+
if (globalThis.process && !globalThis.process.browser)
|
|
6369
6279
|
return Promise.resolve(false);
|
|
6370
6280
|
if (!subtle || !subtle.importKey || !subtle.deriveBits)
|
|
6371
6281
|
return Promise.resolve(false);
|
|
@@ -6379,19 +6289,19 @@ var init_crypto = __esm(() => {
|
|
|
6379
6289
|
});
|
|
6380
6290
|
return checks[algo] = prom, prom;
|
|
6381
6291
|
}
|
|
6382
|
-
var
|
|
6292
|
+
var nextTick;
|
|
6383
6293
|
function getNextTick() {
|
|
6384
|
-
if (
|
|
6385
|
-
return
|
|
6386
|
-
if (
|
|
6387
|
-
|
|
6388
|
-
else if (
|
|
6389
|
-
|
|
6390
|
-
else if (
|
|
6391
|
-
|
|
6294
|
+
if (nextTick)
|
|
6295
|
+
return nextTick;
|
|
6296
|
+
if (globalThis.process && globalThis.process.nextTick)
|
|
6297
|
+
nextTick = globalThis.process.nextTick;
|
|
6298
|
+
else if (globalThis.queueMicrotask)
|
|
6299
|
+
nextTick = globalThis.queueMicrotask;
|
|
6300
|
+
else if (globalThis.setImmediate)
|
|
6301
|
+
nextTick = globalThis.setImmediate;
|
|
6392
6302
|
else
|
|
6393
|
-
|
|
6394
|
-
return
|
|
6303
|
+
nextTick = globalThis.setTimeout;
|
|
6304
|
+
return nextTick;
|
|
6395
6305
|
}
|
|
6396
6306
|
function browserPbkdf2(password, salt, iterations, length, algo) {
|
|
6397
6307
|
return subtle.importKey("raw", password, { name: "PBKDF2" }, false, ["deriveBits"]).then(function(key) {
|
|
@@ -6416,7 +6326,7 @@ var init_crypto = __esm(() => {
|
|
|
6416
6326
|
callback = digest, digest = undefined;
|
|
6417
6327
|
digest = digest || "sha1";
|
|
6418
6328
|
var algo = toBrowser[digest.toLowerCase()];
|
|
6419
|
-
if (!algo || typeof
|
|
6329
|
+
if (!algo || typeof globalThis.Promise !== "function") {
|
|
6420
6330
|
getNextTick()(function() {
|
|
6421
6331
|
var out;
|
|
6422
6332
|
try {
|
|
@@ -6510,7 +6420,7 @@ var init_crypto = __esm(() => {
|
|
|
6510
6420
|
if (typeof window !== "undefined" && typeof window.Buffer !== "undefined")
|
|
6511
6421
|
Buffer22 = window.Buffer;
|
|
6512
6422
|
else
|
|
6513
|
-
Buffer22 = (init_buffer(), __toCommonJS(
|
|
6423
|
+
Buffer22 = (init_buffer(), __toCommonJS(exports_buffer)).Buffer;
|
|
6514
6424
|
} catch (e) {}
|
|
6515
6425
|
BN.isBN = function isBN(num) {
|
|
6516
6426
|
if (num instanceof BN)
|
|
@@ -6559,15 +6469,15 @@ var init_crypto = __esm(() => {
|
|
|
6559
6469
|
this.length = Math.ceil(number.length / 3), this.words = new Array(this.length);
|
|
6560
6470
|
for (var i2 = 0;i2 < this.length; i2++)
|
|
6561
6471
|
this.words[i2] = 0;
|
|
6562
|
-
var j, w,
|
|
6472
|
+
var j, w, off = 0;
|
|
6563
6473
|
if (endian === "be") {
|
|
6564
6474
|
for (i2 = number.length - 1, j = 0;i2 >= 0; i2 -= 3)
|
|
6565
|
-
if (w = number[i2] | number[i2 - 1] << 8 | number[i2 - 2] << 16, this.words[j] |= w <<
|
|
6566
|
-
|
|
6475
|
+
if (w = number[i2] | number[i2 - 1] << 8 | number[i2 - 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26)
|
|
6476
|
+
off -= 26, j++;
|
|
6567
6477
|
} else if (endian === "le") {
|
|
6568
6478
|
for (i2 = 0, j = 0;i2 < number.length; i2 += 3)
|
|
6569
|
-
if (w = number[i2] | number[i2 + 1] << 8 | number[i2 + 2] << 16, this.words[j] |= w <<
|
|
6570
|
-
|
|
6479
|
+
if (w = number[i2] | number[i2 + 1] << 8 | number[i2 + 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26)
|
|
6480
|
+
off -= 26, j++;
|
|
6571
6481
|
}
|
|
6572
6482
|
return this.strip();
|
|
6573
6483
|
};
|
|
@@ -6590,20 +6500,20 @@ var init_crypto = __esm(() => {
|
|
|
6590
6500
|
this.length = Math.ceil((number.length - start) / 6), this.words = new Array(this.length);
|
|
6591
6501
|
for (var i2 = 0;i2 < this.length; i2++)
|
|
6592
6502
|
this.words[i2] = 0;
|
|
6593
|
-
var
|
|
6503
|
+
var off = 0, j = 0, w;
|
|
6594
6504
|
if (endian === "be")
|
|
6595
6505
|
for (i2 = number.length - 1;i2 >= start; i2 -= 2)
|
|
6596
|
-
if (w = parseHexByte(number, start, i2) <<
|
|
6597
|
-
|
|
6506
|
+
if (w = parseHexByte(number, start, i2) << off, this.words[j] |= w & 67108863, off >= 18)
|
|
6507
|
+
off -= 18, j += 1, this.words[j] |= w >>> 26;
|
|
6598
6508
|
else
|
|
6599
|
-
|
|
6509
|
+
off += 8;
|
|
6600
6510
|
else {
|
|
6601
6511
|
var parseLength = number.length - start;
|
|
6602
6512
|
for (i2 = parseLength % 2 === 0 ? start + 1 : start;i2 < number.length; i2 += 2)
|
|
6603
|
-
if (w = parseHexByte(number, start, i2) <<
|
|
6604
|
-
|
|
6513
|
+
if (w = parseHexByte(number, start, i2) << off, this.words[j] |= w & 67108863, off >= 18)
|
|
6514
|
+
off -= 18, j += 1, this.words[j] |= w >>> 26;
|
|
6605
6515
|
else
|
|
6606
|
-
|
|
6516
|
+
off += 8;
|
|
6607
6517
|
}
|
|
6608
6518
|
this.strip();
|
|
6609
6519
|
};
|
|
@@ -6671,11 +6581,11 @@ var init_crypto = __esm(() => {
|
|
|
6671
6581
|
var out;
|
|
6672
6582
|
if (base === 16 || base === "hex") {
|
|
6673
6583
|
out = "";
|
|
6674
|
-
var
|
|
6584
|
+
var off = 0, carry = 0;
|
|
6675
6585
|
for (var i2 = 0;i2 < this.length; i2++) {
|
|
6676
|
-
var w = this.words[i2], word = ((w <<
|
|
6677
|
-
if (carry = w >>> 24 -
|
|
6678
|
-
|
|
6586
|
+
var w = this.words[i2], word = ((w << off | carry) & 16777215).toString(16);
|
|
6587
|
+
if (carry = w >>> 24 - off & 16777215, off += 2, off >= 26)
|
|
6588
|
+
off -= 26, i2--;
|
|
6679
6589
|
if (carry !== 0 || i2 !== this.length - 1)
|
|
6680
6590
|
out = zeros[6 - word.length] + word + out;
|
|
6681
6591
|
else
|
|
@@ -6780,8 +6690,8 @@ var init_crypto = __esm(() => {
|
|
|
6780
6690
|
function toBitArray(num) {
|
|
6781
6691
|
var w = new Array(num.bitLength());
|
|
6782
6692
|
for (var bit = 0;bit < w.length; bit++) {
|
|
6783
|
-
var
|
|
6784
|
-
w[bit] = (num.words[
|
|
6693
|
+
var off = bit / 26 | 0, wbit = bit % 26;
|
|
6694
|
+
w[bit] = (num.words[off] & 1 << wbit) >>> wbit;
|
|
6785
6695
|
}
|
|
6786
6696
|
return w;
|
|
6787
6697
|
}
|
|
@@ -6884,11 +6794,11 @@ var init_crypto = __esm(() => {
|
|
|
6884
6794
|
return this.clone().inotn(width);
|
|
6885
6795
|
}, BN.prototype.setn = function setn(bit, val) {
|
|
6886
6796
|
assert(typeof bit === "number" && bit >= 0);
|
|
6887
|
-
var
|
|
6888
|
-
if (this._expand(
|
|
6889
|
-
this.words[
|
|
6797
|
+
var off = bit / 26 | 0, wbit = bit % 26;
|
|
6798
|
+
if (this._expand(off + 1), val)
|
|
6799
|
+
this.words[off] = this.words[off] | 1 << wbit;
|
|
6890
6800
|
else
|
|
6891
|
-
this.words[
|
|
6801
|
+
this.words[off] = this.words[off] & ~(1 << wbit);
|
|
6892
6802
|
return this.strip();
|
|
6893
6803
|
}, BN.prototype.iadd = function iadd(num) {
|
|
6894
6804
|
var r;
|
|
@@ -9789,11 +9699,11 @@ var init_crypto = __esm(() => {
|
|
|
9789
9699
|
if (buf[p.place] === 0)
|
|
9790
9700
|
return false;
|
|
9791
9701
|
var val = 0;
|
|
9792
|
-
for (var i2 = 0,
|
|
9793
|
-
val <<= 8, val |= buf[
|
|
9702
|
+
for (var i2 = 0, off = p.place;i2 < octetLen; i2++, off++)
|
|
9703
|
+
val <<= 8, val |= buf[off], val >>>= 0;
|
|
9794
9704
|
if (val <= 127)
|
|
9795
9705
|
return false;
|
|
9796
|
-
return p.place =
|
|
9706
|
+
return p.place = off, val;
|
|
9797
9707
|
}
|
|
9798
9708
|
function rmPadding(buf) {
|
|
9799
9709
|
var i2 = 0, len2 = buf.length - 1;
|
|
@@ -10185,7 +10095,7 @@ var init_crypto = __esm(() => {
|
|
|
10185
10095
|
if (typeof window !== "undefined" && typeof window.Buffer !== "undefined")
|
|
10186
10096
|
Buffer22 = window.Buffer;
|
|
10187
10097
|
else
|
|
10188
|
-
Buffer22 = (init_buffer(), __toCommonJS(
|
|
10098
|
+
Buffer22 = (init_buffer(), __toCommonJS(exports_buffer)).Buffer;
|
|
10189
10099
|
} catch (e) {}
|
|
10190
10100
|
BN.isBN = function isBN(num) {
|
|
10191
10101
|
if (num instanceof BN)
|
|
@@ -10234,15 +10144,15 @@ var init_crypto = __esm(() => {
|
|
|
10234
10144
|
this.length = Math.ceil(number.length / 3), this.words = new Array(this.length);
|
|
10235
10145
|
for (var i2 = 0;i2 < this.length; i2++)
|
|
10236
10146
|
this.words[i2] = 0;
|
|
10237
|
-
var j, w,
|
|
10147
|
+
var j, w, off = 0;
|
|
10238
10148
|
if (endian === "be") {
|
|
10239
10149
|
for (i2 = number.length - 1, j = 0;i2 >= 0; i2 -= 3)
|
|
10240
|
-
if (w = number[i2] | number[i2 - 1] << 8 | number[i2 - 2] << 16, this.words[j] |= w <<
|
|
10241
|
-
|
|
10150
|
+
if (w = number[i2] | number[i2 - 1] << 8 | number[i2 - 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26)
|
|
10151
|
+
off -= 26, j++;
|
|
10242
10152
|
} else if (endian === "le") {
|
|
10243
10153
|
for (i2 = 0, j = 0;i2 < number.length; i2 += 3)
|
|
10244
|
-
if (w = number[i2] | number[i2 + 1] << 8 | number[i2 + 2] << 16, this.words[j] |= w <<
|
|
10245
|
-
|
|
10154
|
+
if (w = number[i2] | number[i2 + 1] << 8 | number[i2 + 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26)
|
|
10155
|
+
off -= 26, j++;
|
|
10246
10156
|
}
|
|
10247
10157
|
return this.strip();
|
|
10248
10158
|
};
|
|
@@ -10265,20 +10175,20 @@ var init_crypto = __esm(() => {
|
|
|
10265
10175
|
this.length = Math.ceil((number.length - start) / 6), this.words = new Array(this.length);
|
|
10266
10176
|
for (var i2 = 0;i2 < this.length; i2++)
|
|
10267
10177
|
this.words[i2] = 0;
|
|
10268
|
-
var
|
|
10178
|
+
var off = 0, j = 0, w;
|
|
10269
10179
|
if (endian === "be")
|
|
10270
10180
|
for (i2 = number.length - 1;i2 >= start; i2 -= 2)
|
|
10271
|
-
if (w = parseHexByte(number, start, i2) <<
|
|
10272
|
-
|
|
10181
|
+
if (w = parseHexByte(number, start, i2) << off, this.words[j] |= w & 67108863, off >= 18)
|
|
10182
|
+
off -= 18, j += 1, this.words[j] |= w >>> 26;
|
|
10273
10183
|
else
|
|
10274
|
-
|
|
10184
|
+
off += 8;
|
|
10275
10185
|
else {
|
|
10276
10186
|
var parseLength = number.length - start;
|
|
10277
10187
|
for (i2 = parseLength % 2 === 0 ? start + 1 : start;i2 < number.length; i2 += 2)
|
|
10278
|
-
if (w = parseHexByte(number, start, i2) <<
|
|
10279
|
-
|
|
10188
|
+
if (w = parseHexByte(number, start, i2) << off, this.words[j] |= w & 67108863, off >= 18)
|
|
10189
|
+
off -= 18, j += 1, this.words[j] |= w >>> 26;
|
|
10280
10190
|
else
|
|
10281
|
-
|
|
10191
|
+
off += 8;
|
|
10282
10192
|
}
|
|
10283
10193
|
this.strip();
|
|
10284
10194
|
};
|
|
@@ -10346,11 +10256,11 @@ var init_crypto = __esm(() => {
|
|
|
10346
10256
|
var out;
|
|
10347
10257
|
if (base === 16 || base === "hex") {
|
|
10348
10258
|
out = "";
|
|
10349
|
-
var
|
|
10259
|
+
var off = 0, carry = 0;
|
|
10350
10260
|
for (var i2 = 0;i2 < this.length; i2++) {
|
|
10351
|
-
var w = this.words[i2], word = ((w <<
|
|
10352
|
-
if (carry = w >>> 24 -
|
|
10353
|
-
|
|
10261
|
+
var w = this.words[i2], word = ((w << off | carry) & 16777215).toString(16);
|
|
10262
|
+
if (carry = w >>> 24 - off & 16777215, off += 2, off >= 26)
|
|
10263
|
+
off -= 26, i2--;
|
|
10354
10264
|
if (carry !== 0 || i2 !== this.length - 1)
|
|
10355
10265
|
out = zeros[6 - word.length] + word + out;
|
|
10356
10266
|
else
|
|
@@ -10455,8 +10365,8 @@ var init_crypto = __esm(() => {
|
|
|
10455
10365
|
function toBitArray(num) {
|
|
10456
10366
|
var w = new Array(num.bitLength());
|
|
10457
10367
|
for (var bit = 0;bit < w.length; bit++) {
|
|
10458
|
-
var
|
|
10459
|
-
w[bit] = (num.words[
|
|
10368
|
+
var off = bit / 26 | 0, wbit = bit % 26;
|
|
10369
|
+
w[bit] = (num.words[off] & 1 << wbit) >>> wbit;
|
|
10460
10370
|
}
|
|
10461
10371
|
return w;
|
|
10462
10372
|
}
|
|
@@ -10559,11 +10469,11 @@ var init_crypto = __esm(() => {
|
|
|
10559
10469
|
return this.clone().inotn(width);
|
|
10560
10470
|
}, BN.prototype.setn = function setn(bit, val) {
|
|
10561
10471
|
assert(typeof bit === "number" && bit >= 0);
|
|
10562
|
-
var
|
|
10563
|
-
if (this._expand(
|
|
10564
|
-
this.words[
|
|
10472
|
+
var off = bit / 26 | 0, wbit = bit % 26;
|
|
10473
|
+
if (this._expand(off + 1), val)
|
|
10474
|
+
this.words[off] = this.words[off] | 1 << wbit;
|
|
10565
10475
|
else
|
|
10566
|
-
this.words[
|
|
10476
|
+
this.words[off] = this.words[off] & ~(1 << wbit);
|
|
10567
10477
|
return this.strip();
|
|
10568
10478
|
}, BN.prototype.iadd = function iadd(num) {
|
|
10569
10479
|
var r;
|
|
@@ -11648,7 +11558,7 @@ var init_crypto = __esm(() => {
|
|
|
11648
11558
|
if (typeof window !== "undefined" && typeof window.Buffer !== "undefined")
|
|
11649
11559
|
Buffer22 = window.Buffer;
|
|
11650
11560
|
else
|
|
11651
|
-
Buffer22 = (init_buffer(), __toCommonJS(
|
|
11561
|
+
Buffer22 = (init_buffer(), __toCommonJS(exports_buffer)).Buffer;
|
|
11652
11562
|
} catch (e) {}
|
|
11653
11563
|
BN.isBN = function isBN(num) {
|
|
11654
11564
|
if (num instanceof BN)
|
|
@@ -11697,15 +11607,15 @@ var init_crypto = __esm(() => {
|
|
|
11697
11607
|
this.length = Math.ceil(number.length / 3), this.words = new Array(this.length);
|
|
11698
11608
|
for (var i2 = 0;i2 < this.length; i2++)
|
|
11699
11609
|
this.words[i2] = 0;
|
|
11700
|
-
var j, w,
|
|
11610
|
+
var j, w, off = 0;
|
|
11701
11611
|
if (endian === "be") {
|
|
11702
11612
|
for (i2 = number.length - 1, j = 0;i2 >= 0; i2 -= 3)
|
|
11703
|
-
if (w = number[i2] | number[i2 - 1] << 8 | number[i2 - 2] << 16, this.words[j] |= w <<
|
|
11704
|
-
|
|
11613
|
+
if (w = number[i2] | number[i2 - 1] << 8 | number[i2 - 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26)
|
|
11614
|
+
off -= 26, j++;
|
|
11705
11615
|
} else if (endian === "le") {
|
|
11706
11616
|
for (i2 = 0, j = 0;i2 < number.length; i2 += 3)
|
|
11707
|
-
if (w = number[i2] | number[i2 + 1] << 8 | number[i2 + 2] << 16, this.words[j] |= w <<
|
|
11708
|
-
|
|
11617
|
+
if (w = number[i2] | number[i2 + 1] << 8 | number[i2 + 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26)
|
|
11618
|
+
off -= 26, j++;
|
|
11709
11619
|
}
|
|
11710
11620
|
return this.strip();
|
|
11711
11621
|
};
|
|
@@ -11728,20 +11638,20 @@ var init_crypto = __esm(() => {
|
|
|
11728
11638
|
this.length = Math.ceil((number.length - start) / 6), this.words = new Array(this.length);
|
|
11729
11639
|
for (var i2 = 0;i2 < this.length; i2++)
|
|
11730
11640
|
this.words[i2] = 0;
|
|
11731
|
-
var
|
|
11641
|
+
var off = 0, j = 0, w;
|
|
11732
11642
|
if (endian === "be")
|
|
11733
11643
|
for (i2 = number.length - 1;i2 >= start; i2 -= 2)
|
|
11734
|
-
if (w = parseHexByte(number, start, i2) <<
|
|
11735
|
-
|
|
11644
|
+
if (w = parseHexByte(number, start, i2) << off, this.words[j] |= w & 67108863, off >= 18)
|
|
11645
|
+
off -= 18, j += 1, this.words[j] |= w >>> 26;
|
|
11736
11646
|
else
|
|
11737
|
-
|
|
11647
|
+
off += 8;
|
|
11738
11648
|
else {
|
|
11739
11649
|
var parseLength = number.length - start;
|
|
11740
11650
|
for (i2 = parseLength % 2 === 0 ? start + 1 : start;i2 < number.length; i2 += 2)
|
|
11741
|
-
if (w = parseHexByte(number, start, i2) <<
|
|
11742
|
-
|
|
11651
|
+
if (w = parseHexByte(number, start, i2) << off, this.words[j] |= w & 67108863, off >= 18)
|
|
11652
|
+
off -= 18, j += 1, this.words[j] |= w >>> 26;
|
|
11743
11653
|
else
|
|
11744
|
-
|
|
11654
|
+
off += 8;
|
|
11745
11655
|
}
|
|
11746
11656
|
this.strip();
|
|
11747
11657
|
};
|
|
@@ -11809,11 +11719,11 @@ var init_crypto = __esm(() => {
|
|
|
11809
11719
|
var out;
|
|
11810
11720
|
if (base === 16 || base === "hex") {
|
|
11811
11721
|
out = "";
|
|
11812
|
-
var
|
|
11722
|
+
var off = 0, carry = 0;
|
|
11813
11723
|
for (var i2 = 0;i2 < this.length; i2++) {
|
|
11814
|
-
var w = this.words[i2], word = ((w <<
|
|
11815
|
-
if (carry = w >>> 24 -
|
|
11816
|
-
|
|
11724
|
+
var w = this.words[i2], word = ((w << off | carry) & 16777215).toString(16);
|
|
11725
|
+
if (carry = w >>> 24 - off & 16777215, off += 2, off >= 26)
|
|
11726
|
+
off -= 26, i2--;
|
|
11817
11727
|
if (carry !== 0 || i2 !== this.length - 1)
|
|
11818
11728
|
out = zeros[6 - word.length] + word + out;
|
|
11819
11729
|
else
|
|
@@ -11918,8 +11828,8 @@ var init_crypto = __esm(() => {
|
|
|
11918
11828
|
function toBitArray(num) {
|
|
11919
11829
|
var w = new Array(num.bitLength());
|
|
11920
11830
|
for (var bit = 0;bit < w.length; bit++) {
|
|
11921
|
-
var
|
|
11922
|
-
w[bit] = (num.words[
|
|
11831
|
+
var off = bit / 26 | 0, wbit = bit % 26;
|
|
11832
|
+
w[bit] = (num.words[off] & 1 << wbit) >>> wbit;
|
|
11923
11833
|
}
|
|
11924
11834
|
return w;
|
|
11925
11835
|
}
|
|
@@ -12022,11 +11932,11 @@ var init_crypto = __esm(() => {
|
|
|
12022
11932
|
return this.clone().inotn(width);
|
|
12023
11933
|
}, BN.prototype.setn = function setn(bit, val) {
|
|
12024
11934
|
assert(typeof bit === "number" && bit >= 0);
|
|
12025
|
-
var
|
|
12026
|
-
if (this._expand(
|
|
12027
|
-
this.words[
|
|
11935
|
+
var off = bit / 26 | 0, wbit = bit % 26;
|
|
11936
|
+
if (this._expand(off + 1), val)
|
|
11937
|
+
this.words[off] = this.words[off] | 1 << wbit;
|
|
12028
11938
|
else
|
|
12029
|
-
this.words[
|
|
11939
|
+
this.words[off] = this.words[off] & ~(1 << wbit);
|
|
12030
11940
|
return this.strip();
|
|
12031
11941
|
}, BN.prototype.iadd = function iadd(num) {
|
|
12032
11942
|
var r;
|
|
@@ -13132,7 +13042,7 @@ var init_crypto = __esm(() => {
|
|
|
13132
13042
|
};
|
|
13133
13043
|
});
|
|
13134
13044
|
require_buffer = __commonJS2((exports) => {
|
|
13135
|
-
var inherits2 = require_inherits(), Reporter = require_base2().Reporter, Buffer22 = (init_buffer(), __toCommonJS(
|
|
13045
|
+
var inherits2 = require_inherits(), Reporter = require_base2().Reporter, Buffer22 = (init_buffer(), __toCommonJS(exports_buffer)).Buffer;
|
|
13136
13046
|
function DecoderBuffer(base, options) {
|
|
13137
13047
|
if (Reporter.call(this, options), !Buffer22.isBuffer(base)) {
|
|
13138
13048
|
this.error("Input not Buffer");
|
|
@@ -13788,7 +13698,7 @@ var init_crypto = __esm(() => {
|
|
|
13788
13698
|
}
|
|
13789
13699
|
});
|
|
13790
13700
|
require_pem = __commonJS2((exports, module) => {
|
|
13791
|
-
var inherits2 = require_inherits(), Buffer22 = (init_buffer(), __toCommonJS(
|
|
13701
|
+
var inherits2 = require_inherits(), Buffer22 = (init_buffer(), __toCommonJS(exports_buffer)).Buffer, DERDecoder = require_der2();
|
|
13792
13702
|
function PEMDecoder(entity) {
|
|
13793
13703
|
DERDecoder.call(this, entity), this.enc = "pem";
|
|
13794
13704
|
}
|
|
@@ -13827,7 +13737,7 @@ var init_crypto = __esm(() => {
|
|
|
13827
13737
|
decoders.pem = require_pem();
|
|
13828
13738
|
});
|
|
13829
13739
|
require_der3 = __commonJS2((exports, module) => {
|
|
13830
|
-
var inherits2 = require_inherits(), Buffer22 = (init_buffer(), __toCommonJS(
|
|
13740
|
+
var inherits2 = require_inherits(), Buffer22 = (init_buffer(), __toCommonJS(exports_buffer)).Buffer, asn1 = require_asn1(), base = asn1.base, der = asn1.constants.der;
|
|
13831
13741
|
function DEREncoder(entity) {
|
|
13832
13742
|
this.enc = "der", this.name = entity.name, this.entity = entity, this.tree = new DERNode, this.tree._init(entity.body);
|
|
13833
13743
|
}
|
|
@@ -14389,7 +14299,7 @@ var init_crypto = __esm(() => {
|
|
|
14389
14299
|
if (typeof window !== "undefined" && typeof window.Buffer !== "undefined")
|
|
14390
14300
|
Buffer22 = window.Buffer;
|
|
14391
14301
|
else
|
|
14392
|
-
Buffer22 = (init_buffer(), __toCommonJS(
|
|
14302
|
+
Buffer22 = (init_buffer(), __toCommonJS(exports_buffer)).Buffer;
|
|
14393
14303
|
} catch (e) {}
|
|
14394
14304
|
BN.isBN = function isBN(num) {
|
|
14395
14305
|
if (num instanceof BN)
|
|
@@ -14438,15 +14348,15 @@ var init_crypto = __esm(() => {
|
|
|
14438
14348
|
this.length = Math.ceil(number.length / 3), this.words = new Array(this.length);
|
|
14439
14349
|
for (var i2 = 0;i2 < this.length; i2++)
|
|
14440
14350
|
this.words[i2] = 0;
|
|
14441
|
-
var j, w,
|
|
14351
|
+
var j, w, off = 0;
|
|
14442
14352
|
if (endian === "be") {
|
|
14443
14353
|
for (i2 = number.length - 1, j = 0;i2 >= 0; i2 -= 3)
|
|
14444
|
-
if (w = number[i2] | number[i2 - 1] << 8 | number[i2 - 2] << 16, this.words[j] |= w <<
|
|
14445
|
-
|
|
14354
|
+
if (w = number[i2] | number[i2 - 1] << 8 | number[i2 - 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26)
|
|
14355
|
+
off -= 26, j++;
|
|
14446
14356
|
} else if (endian === "le") {
|
|
14447
14357
|
for (i2 = 0, j = 0;i2 < number.length; i2 += 3)
|
|
14448
|
-
if (w = number[i2] | number[i2 + 1] << 8 | number[i2 + 2] << 16, this.words[j] |= w <<
|
|
14449
|
-
|
|
14358
|
+
if (w = number[i2] | number[i2 + 1] << 8 | number[i2 + 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26)
|
|
14359
|
+
off -= 26, j++;
|
|
14450
14360
|
}
|
|
14451
14361
|
return this.strip();
|
|
14452
14362
|
};
|
|
@@ -14469,20 +14379,20 @@ var init_crypto = __esm(() => {
|
|
|
14469
14379
|
this.length = Math.ceil((number.length - start) / 6), this.words = new Array(this.length);
|
|
14470
14380
|
for (var i2 = 0;i2 < this.length; i2++)
|
|
14471
14381
|
this.words[i2] = 0;
|
|
14472
|
-
var
|
|
14382
|
+
var off = 0, j = 0, w;
|
|
14473
14383
|
if (endian === "be")
|
|
14474
14384
|
for (i2 = number.length - 1;i2 >= start; i2 -= 2)
|
|
14475
|
-
if (w = parseHexByte(number, start, i2) <<
|
|
14476
|
-
|
|
14385
|
+
if (w = parseHexByte(number, start, i2) << off, this.words[j] |= w & 67108863, off >= 18)
|
|
14386
|
+
off -= 18, j += 1, this.words[j] |= w >>> 26;
|
|
14477
14387
|
else
|
|
14478
|
-
|
|
14388
|
+
off += 8;
|
|
14479
14389
|
else {
|
|
14480
14390
|
var parseLength = number.length - start;
|
|
14481
14391
|
for (i2 = parseLength % 2 === 0 ? start + 1 : start;i2 < number.length; i2 += 2)
|
|
14482
|
-
if (w = parseHexByte(number, start, i2) <<
|
|
14483
|
-
|
|
14392
|
+
if (w = parseHexByte(number, start, i2) << off, this.words[j] |= w & 67108863, off >= 18)
|
|
14393
|
+
off -= 18, j += 1, this.words[j] |= w >>> 26;
|
|
14484
14394
|
else
|
|
14485
|
-
|
|
14395
|
+
off += 8;
|
|
14486
14396
|
}
|
|
14487
14397
|
this.strip();
|
|
14488
14398
|
};
|
|
@@ -14550,11 +14460,11 @@ var init_crypto = __esm(() => {
|
|
|
14550
14460
|
var out;
|
|
14551
14461
|
if (base === 16 || base === "hex") {
|
|
14552
14462
|
out = "";
|
|
14553
|
-
var
|
|
14463
|
+
var off = 0, carry = 0;
|
|
14554
14464
|
for (var i2 = 0;i2 < this.length; i2++) {
|
|
14555
|
-
var w = this.words[i2], word = ((w <<
|
|
14556
|
-
if (carry = w >>> 24 -
|
|
14557
|
-
|
|
14465
|
+
var w = this.words[i2], word = ((w << off | carry) & 16777215).toString(16);
|
|
14466
|
+
if (carry = w >>> 24 - off & 16777215, off += 2, off >= 26)
|
|
14467
|
+
off -= 26, i2--;
|
|
14558
14468
|
if (carry !== 0 || i2 !== this.length - 1)
|
|
14559
14469
|
out = zeros[6 - word.length] + word + out;
|
|
14560
14470
|
else
|
|
@@ -14659,8 +14569,8 @@ var init_crypto = __esm(() => {
|
|
|
14659
14569
|
function toBitArray(num) {
|
|
14660
14570
|
var w = new Array(num.bitLength());
|
|
14661
14571
|
for (var bit = 0;bit < w.length; bit++) {
|
|
14662
|
-
var
|
|
14663
|
-
w[bit] = (num.words[
|
|
14572
|
+
var off = bit / 26 | 0, wbit = bit % 26;
|
|
14573
|
+
w[bit] = (num.words[off] & 1 << wbit) >>> wbit;
|
|
14664
14574
|
}
|
|
14665
14575
|
return w;
|
|
14666
14576
|
}
|
|
@@ -14763,11 +14673,11 @@ var init_crypto = __esm(() => {
|
|
|
14763
14673
|
return this.clone().inotn(width);
|
|
14764
14674
|
}, BN.prototype.setn = function setn(bit, val) {
|
|
14765
14675
|
assert(typeof bit === "number" && bit >= 0);
|
|
14766
|
-
var
|
|
14767
|
-
if (this._expand(
|
|
14768
|
-
this.words[
|
|
14676
|
+
var off = bit / 26 | 0, wbit = bit % 26;
|
|
14677
|
+
if (this._expand(off + 1), val)
|
|
14678
|
+
this.words[off] = this.words[off] | 1 << wbit;
|
|
14769
14679
|
else
|
|
14770
|
-
this.words[
|
|
14680
|
+
this.words[off] = this.words[off] & ~(1 << wbit);
|
|
14771
14681
|
return this.strip();
|
|
14772
14682
|
}, BN.prototype.iadd = function iadd(num) {
|
|
14773
14683
|
var r;
|
|
@@ -15793,7 +15703,7 @@ var init_crypto = __esm(() => {
|
|
|
15793
15703
|
if (typeof window !== "undefined" && typeof window.Buffer !== "undefined")
|
|
15794
15704
|
Buffer22 = window.Buffer;
|
|
15795
15705
|
else
|
|
15796
|
-
Buffer22 = (init_buffer(), __toCommonJS(
|
|
15706
|
+
Buffer22 = (init_buffer(), __toCommonJS(exports_buffer)).Buffer;
|
|
15797
15707
|
} catch (e) {}
|
|
15798
15708
|
BN.isBN = function isBN(num) {
|
|
15799
15709
|
if (num instanceof BN)
|
|
@@ -15842,15 +15752,15 @@ var init_crypto = __esm(() => {
|
|
|
15842
15752
|
this.length = Math.ceil(number.length / 3), this.words = new Array(this.length);
|
|
15843
15753
|
for (var i2 = 0;i2 < this.length; i2++)
|
|
15844
15754
|
this.words[i2] = 0;
|
|
15845
|
-
var j, w,
|
|
15755
|
+
var j, w, off = 0;
|
|
15846
15756
|
if (endian === "be") {
|
|
15847
15757
|
for (i2 = number.length - 1, j = 0;i2 >= 0; i2 -= 3)
|
|
15848
|
-
if (w = number[i2] | number[i2 - 1] << 8 | number[i2 - 2] << 16, this.words[j] |= w <<
|
|
15849
|
-
|
|
15758
|
+
if (w = number[i2] | number[i2 - 1] << 8 | number[i2 - 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26)
|
|
15759
|
+
off -= 26, j++;
|
|
15850
15760
|
} else if (endian === "le") {
|
|
15851
15761
|
for (i2 = 0, j = 0;i2 < number.length; i2 += 3)
|
|
15852
|
-
if (w = number[i2] | number[i2 + 1] << 8 | number[i2 + 2] << 16, this.words[j] |= w <<
|
|
15853
|
-
|
|
15762
|
+
if (w = number[i2] | number[i2 + 1] << 8 | number[i2 + 2] << 16, this.words[j] |= w << off & 67108863, this.words[j + 1] = w >>> 26 - off & 67108863, off += 24, off >= 26)
|
|
15763
|
+
off -= 26, j++;
|
|
15854
15764
|
}
|
|
15855
15765
|
return this._strip();
|
|
15856
15766
|
};
|
|
@@ -15875,20 +15785,20 @@ var init_crypto = __esm(() => {
|
|
|
15875
15785
|
this.length = Math.ceil((number.length - start) / 6), this.words = new Array(this.length);
|
|
15876
15786
|
for (var i2 = 0;i2 < this.length; i2++)
|
|
15877
15787
|
this.words[i2] = 0;
|
|
15878
|
-
var
|
|
15788
|
+
var off = 0, j = 0, w;
|
|
15879
15789
|
if (endian === "be")
|
|
15880
15790
|
for (i2 = number.length - 1;i2 >= start; i2 -= 2)
|
|
15881
|
-
if (w = parseHexByte(number, start, i2) <<
|
|
15882
|
-
|
|
15791
|
+
if (w = parseHexByte(number, start, i2) << off, this.words[j] |= w & 67108863, off >= 18)
|
|
15792
|
+
off -= 18, j += 1, this.words[j] |= w >>> 26;
|
|
15883
15793
|
else
|
|
15884
|
-
|
|
15794
|
+
off += 8;
|
|
15885
15795
|
else {
|
|
15886
15796
|
var parseLength = number.length - start;
|
|
15887
15797
|
for (i2 = parseLength % 2 === 0 ? start + 1 : start;i2 < number.length; i2 += 2)
|
|
15888
|
-
if (w = parseHexByte(number, start, i2) <<
|
|
15889
|
-
|
|
15798
|
+
if (w = parseHexByte(number, start, i2) << off, this.words[j] |= w & 67108863, off >= 18)
|
|
15799
|
+
off -= 18, j += 1, this.words[j] |= w >>> 26;
|
|
15890
15800
|
else
|
|
15891
|
-
|
|
15801
|
+
off += 8;
|
|
15892
15802
|
}
|
|
15893
15803
|
this._strip();
|
|
15894
15804
|
};
|
|
@@ -15971,11 +15881,11 @@ var init_crypto = __esm(() => {
|
|
|
15971
15881
|
var out;
|
|
15972
15882
|
if (base === 16 || base === "hex") {
|
|
15973
15883
|
out = "";
|
|
15974
|
-
var
|
|
15884
|
+
var off = 0, carry = 0;
|
|
15975
15885
|
for (var i2 = 0;i2 < this.length; i2++) {
|
|
15976
|
-
var w = this.words[i2], word = ((w <<
|
|
15977
|
-
if (carry = w >>> 24 -
|
|
15978
|
-
|
|
15886
|
+
var w = this.words[i2], word = ((w << off | carry) & 16777215).toString(16);
|
|
15887
|
+
if (carry = w >>> 24 - off & 16777215, off += 2, off >= 26)
|
|
15888
|
+
off -= 26, i2--;
|
|
15979
15889
|
if (carry !== 0 || i2 !== this.length - 1)
|
|
15980
15890
|
out = zeros[6 - word.length] + word + out;
|
|
15981
15891
|
else
|
|
@@ -16118,8 +16028,8 @@ var init_crypto = __esm(() => {
|
|
|
16118
16028
|
function toBitArray(num) {
|
|
16119
16029
|
var w = new Array(num.bitLength());
|
|
16120
16030
|
for (var bit = 0;bit < w.length; bit++) {
|
|
16121
|
-
var
|
|
16122
|
-
w[bit] = num.words[
|
|
16031
|
+
var off = bit / 26 | 0, wbit = bit % 26;
|
|
16032
|
+
w[bit] = num.words[off] >>> wbit & 1;
|
|
16123
16033
|
}
|
|
16124
16034
|
return w;
|
|
16125
16035
|
}
|
|
@@ -16222,11 +16132,11 @@ var init_crypto = __esm(() => {
|
|
|
16222
16132
|
return this.clone().inotn(width);
|
|
16223
16133
|
}, BN.prototype.setn = function setn(bit, val) {
|
|
16224
16134
|
assert(typeof bit === "number" && bit >= 0);
|
|
16225
|
-
var
|
|
16226
|
-
if (this._expand(
|
|
16227
|
-
this.words[
|
|
16135
|
+
var off = bit / 26 | 0, wbit = bit % 26;
|
|
16136
|
+
if (this._expand(off + 1), val)
|
|
16137
|
+
this.words[off] = this.words[off] | 1 << wbit;
|
|
16228
16138
|
else
|
|
16229
|
-
this.words[
|
|
16139
|
+
this.words[off] = this.words[off] & ~(1 << wbit);
|
|
16230
16140
|
return this._strip();
|
|
16231
16141
|
}, BN.prototype.iadd = function iadd(num) {
|
|
16232
16142
|
var r;
|
|
@@ -17394,7 +17304,7 @@ var init_crypto = __esm(() => {
|
|
|
17394
17304
|
exports.publicDecrypt = crypto2.publicDecrypt;
|
|
17395
17305
|
});
|
|
17396
17306
|
require_browser3 = __commonJS2((exports) => {
|
|
17397
|
-
var safeBuffer = require_safe_buffer(), randombytes = require_randombytes(), Buffer22 = safeBuffer.Buffer, kBufferMaxLength = safeBuffer.kMaxLength, crypto2 =
|
|
17307
|
+
var safeBuffer = require_safe_buffer(), randombytes = require_randombytes(), Buffer22 = safeBuffer.Buffer, kBufferMaxLength = safeBuffer.kMaxLength, crypto2 = globalThis.crypto || globalThis.msCrypto, kMaxUint32 = Math.pow(2, 32) - 1;
|
|
17398
17308
|
function assertOffset(offset, length) {
|
|
17399
17309
|
if (typeof offset !== "number" || offset !== offset)
|
|
17400
17310
|
throw new TypeError("offset must be a number");
|
|
@@ -17413,7 +17323,7 @@ var init_crypto = __esm(() => {
|
|
|
17413
17323
|
}
|
|
17414
17324
|
crypto2 && crypto2.getRandomValues, exports.randomFill = randomFill, exports.randomFillSync = randomFillSync;
|
|
17415
17325
|
function randomFill(buf, offset, size, cb) {
|
|
17416
|
-
if (!Buffer22.isBuffer(buf) && !(buf instanceof
|
|
17326
|
+
if (!Buffer22.isBuffer(buf) && !(buf instanceof globalThis.Uint8Array))
|
|
17417
17327
|
throw new TypeError('"buf" argument must be a Buffer or Uint8Array');
|
|
17418
17328
|
if (typeof offset === "function")
|
|
17419
17329
|
cb = offset, offset = 0, size = buf.length;
|
|
@@ -17440,7 +17350,7 @@ var init_crypto = __esm(() => {
|
|
|
17440
17350
|
function randomFillSync(buf, offset, size) {
|
|
17441
17351
|
if (typeof offset === "undefined")
|
|
17442
17352
|
offset = 0;
|
|
17443
|
-
if (!Buffer22.isBuffer(buf) && !(buf instanceof
|
|
17353
|
+
if (!Buffer22.isBuffer(buf) && !(buf instanceof globalThis.Uint8Array))
|
|
17444
17354
|
throw new TypeError('"buf" argument must be a Buffer or Uint8Array');
|
|
17445
17355
|
if (assertOffset(offset, buf.length), size === undefined)
|
|
17446
17356
|
size = buf.length - offset;
|
|
@@ -17545,6 +17455,7 @@ https://github.com/browserify/crypto-browserify`);
|
|
|
17545
17455
|
constants2 = cryptoBrowserify.constants;
|
|
17546
17456
|
hardcoded_curves = ["p192", "p224", "p256", "p384", "p521", "curve25519", "ed25519", "secp256k1", "secp224r1", "prime256v1", "prime192v1", "ed25519", "secp384r1", "secp521r1"];
|
|
17547
17457
|
webcrypto = crypto;
|
|
17458
|
+
crypto_default = crypto;
|
|
17548
17459
|
});
|
|
17549
17460
|
|
|
17550
17461
|
// node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/core.js
|
|
@@ -18764,7 +18675,7 @@ var require_enc_utf8 = __commonJS((exports, module) => {
|
|
|
18764
18675
|
});
|
|
18765
18676
|
});
|
|
18766
18677
|
|
|
18767
|
-
// node_modules/.pnpm/openai@
|
|
18678
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/tslib.mjs
|
|
18768
18679
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
18769
18680
|
if (kind === "m")
|
|
18770
18681
|
throw new TypeError("Private method is not writable");
|
|
@@ -18782,7 +18693,7 @@ function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
|
18782
18693
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
18783
18694
|
}
|
|
18784
18695
|
|
|
18785
|
-
// node_modules/.pnpm/openai@
|
|
18696
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/uuid.mjs
|
|
18786
18697
|
var uuid4 = function() {
|
|
18787
18698
|
const { crypto: crypto2 } = globalThis;
|
|
18788
18699
|
if (crypto2?.randomUUID) {
|
|
@@ -18794,7 +18705,7 @@ var uuid4 = function() {
|
|
|
18794
18705
|
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ randomByte() & 15 >> +c / 4).toString(16));
|
|
18795
18706
|
};
|
|
18796
18707
|
|
|
18797
|
-
// node_modules/.pnpm/openai@
|
|
18708
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/errors.mjs
|
|
18798
18709
|
function isAbortError(err) {
|
|
18799
18710
|
return typeof err === "object" && err !== null && (("name" in err) && err.name === "AbortError" || ("message" in err) && String(err.message).includes("FetchRequestCanceledException"));
|
|
18800
18711
|
}
|
|
@@ -18821,7 +18732,7 @@ var castToError = (err) => {
|
|
|
18821
18732
|
return new Error(err);
|
|
18822
18733
|
};
|
|
18823
18734
|
|
|
18824
|
-
// node_modules/.pnpm/openai@
|
|
18735
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/core/error.mjs
|
|
18825
18736
|
class OpenAIError extends Error {
|
|
18826
18737
|
}
|
|
18827
18738
|
|
|
@@ -18945,7 +18856,7 @@ class InvalidWebhookSignatureError extends Error {
|
|
|
18945
18856
|
}
|
|
18946
18857
|
}
|
|
18947
18858
|
|
|
18948
|
-
// node_modules/.pnpm/openai@
|
|
18859
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/values.mjs
|
|
18949
18860
|
var startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
|
|
18950
18861
|
var isAbsoluteURL = (url) => {
|
|
18951
18862
|
return startsWithSchemeRegexp.test(url);
|
|
@@ -18988,13 +18899,13 @@ var safeJSON = (text) => {
|
|
|
18988
18899
|
}
|
|
18989
18900
|
};
|
|
18990
18901
|
|
|
18991
|
-
// node_modules/.pnpm/openai@
|
|
18902
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/sleep.mjs
|
|
18992
18903
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
18993
18904
|
|
|
18994
|
-
// node_modules/.pnpm/openai@
|
|
18995
|
-
var VERSION = "
|
|
18905
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/version.mjs
|
|
18906
|
+
var VERSION = "6.6.0";
|
|
18996
18907
|
|
|
18997
|
-
// node_modules/.pnpm/openai@
|
|
18908
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/detect-platform.mjs
|
|
18998
18909
|
var isRunningInBrowser = () => {
|
|
18999
18910
|
return typeof window !== "undefined" && typeof window.document !== "undefined" && typeof navigator !== "undefined";
|
|
19000
18911
|
};
|
|
@@ -19123,7 +19034,7 @@ var getPlatformHeaders = () => {
|
|
|
19123
19034
|
return _platformHeaders ?? (_platformHeaders = getPlatformProperties());
|
|
19124
19035
|
};
|
|
19125
19036
|
|
|
19126
|
-
// node_modules/.pnpm/openai@
|
|
19037
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/shims.mjs
|
|
19127
19038
|
function getDefaultFetch() {
|
|
19128
19039
|
if (typeof fetch !== "undefined") {
|
|
19129
19040
|
return fetch;
|
|
@@ -19194,7 +19105,7 @@ async function CancelReadableStream(stream) {
|
|
|
19194
19105
|
await cancelPromise;
|
|
19195
19106
|
}
|
|
19196
19107
|
|
|
19197
|
-
// node_modules/.pnpm/openai@
|
|
19108
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/request-options.mjs
|
|
19198
19109
|
var FallbackEncoder = ({ headers, body }) => {
|
|
19199
19110
|
return {
|
|
19200
19111
|
bodyHeaders: {
|
|
@@ -19204,7 +19115,7 @@ var FallbackEncoder = ({ headers, body }) => {
|
|
|
19204
19115
|
};
|
|
19205
19116
|
};
|
|
19206
19117
|
|
|
19207
|
-
// node_modules/.pnpm/openai@
|
|
19118
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/qs/formats.mjs
|
|
19208
19119
|
var default_format = "RFC3986";
|
|
19209
19120
|
var default_formatter = (v) => String(v);
|
|
19210
19121
|
var formatters = {
|
|
@@ -19213,7 +19124,7 @@ var formatters = {
|
|
|
19213
19124
|
};
|
|
19214
19125
|
var RFC1738 = "RFC1738";
|
|
19215
19126
|
|
|
19216
|
-
// node_modules/.pnpm/openai@
|
|
19127
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/qs/utils.mjs
|
|
19217
19128
|
var has = (obj, key) => (has = Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty), has(obj, key));
|
|
19218
19129
|
var hex_table = /* @__PURE__ */ (() => {
|
|
19219
19130
|
const array = [];
|
|
@@ -19285,7 +19196,7 @@ function maybe_map(val, fn) {
|
|
|
19285
19196
|
return fn(val);
|
|
19286
19197
|
}
|
|
19287
19198
|
|
|
19288
|
-
// node_modules/.pnpm/openai@
|
|
19199
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/qs/stringify.mjs
|
|
19289
19200
|
var array_prefix_generators = {
|
|
19290
19201
|
brackets(prefix) {
|
|
19291
19202
|
return String(prefix) + "[]";
|
|
@@ -19512,7 +19423,7 @@ function stringify(object, opts = {}) {
|
|
|
19512
19423
|
}
|
|
19513
19424
|
return joined.length > 0 ? prefix + joined : "";
|
|
19514
19425
|
}
|
|
19515
|
-
// node_modules/.pnpm/openai@
|
|
19426
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/bytes.mjs
|
|
19516
19427
|
function concatBytes(buffers) {
|
|
19517
19428
|
let length = 0;
|
|
19518
19429
|
for (const buffer of buffers) {
|
|
@@ -19537,7 +19448,7 @@ function decodeUTF8(bytes) {
|
|
|
19537
19448
|
return (decodeUTF8_ ?? (decoder = new globalThis.TextDecoder, decodeUTF8_ = decoder.decode.bind(decoder)))(bytes);
|
|
19538
19449
|
}
|
|
19539
19450
|
|
|
19540
|
-
// node_modules/.pnpm/openai@
|
|
19451
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/decoders/line.mjs
|
|
19541
19452
|
var _LineDecoder_buffer;
|
|
19542
19453
|
var _LineDecoder_carriageReturnIndex;
|
|
19543
19454
|
|
|
@@ -19617,7 +19528,7 @@ function findDoubleNewlineIndex(buffer) {
|
|
|
19617
19528
|
return -1;
|
|
19618
19529
|
}
|
|
19619
19530
|
|
|
19620
|
-
// node_modules/.pnpm/openai@
|
|
19531
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/log.mjs
|
|
19621
19532
|
var levelNumbers = {
|
|
19622
19533
|
off: 0,
|
|
19623
19534
|
error: 200,
|
|
@@ -19689,7 +19600,7 @@ var formatRequestDetails = (details) => {
|
|
|
19689
19600
|
return details;
|
|
19690
19601
|
};
|
|
19691
19602
|
|
|
19692
|
-
// node_modules/.pnpm/openai@
|
|
19603
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/core/streaming.mjs
|
|
19693
19604
|
var _Stream_client;
|
|
19694
19605
|
|
|
19695
19606
|
class Stream {
|
|
@@ -19938,7 +19849,7 @@ function partition(str, delimiter) {
|
|
|
19938
19849
|
return [str, "", ""];
|
|
19939
19850
|
}
|
|
19940
19851
|
|
|
19941
|
-
// node_modules/.pnpm/openai@
|
|
19852
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/parse.mjs
|
|
19942
19853
|
async function defaultParseResponse(client, props) {
|
|
19943
19854
|
const { response, requestLogID, retryOfRequestLogID, startTime } = props;
|
|
19944
19855
|
const body = await (async () => {
|
|
@@ -19984,7 +19895,7 @@ function addRequestID(value, response) {
|
|
|
19984
19895
|
});
|
|
19985
19896
|
}
|
|
19986
19897
|
|
|
19987
|
-
// node_modules/.pnpm/openai@
|
|
19898
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/core/api-promise.mjs
|
|
19988
19899
|
var _APIPromise_client;
|
|
19989
19900
|
|
|
19990
19901
|
class APIPromise extends Promise {
|
|
@@ -20025,7 +19936,7 @@ class APIPromise extends Promise {
|
|
|
20025
19936
|
}
|
|
20026
19937
|
_APIPromise_client = new WeakMap;
|
|
20027
19938
|
|
|
20028
|
-
// node_modules/.pnpm/openai@
|
|
19939
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/core/pagination.mjs
|
|
20029
19940
|
var _AbstractPage_client;
|
|
20030
19941
|
|
|
20031
19942
|
class AbstractPage {
|
|
@@ -20123,7 +20034,38 @@ class CursorPage extends AbstractPage {
|
|
|
20123
20034
|
}
|
|
20124
20035
|
}
|
|
20125
20036
|
|
|
20126
|
-
|
|
20037
|
+
class ConversationCursorPage extends AbstractPage {
|
|
20038
|
+
constructor(client, response, body, options) {
|
|
20039
|
+
super(client, response, body, options);
|
|
20040
|
+
this.data = body.data || [];
|
|
20041
|
+
this.has_more = body.has_more || false;
|
|
20042
|
+
this.last_id = body.last_id || "";
|
|
20043
|
+
}
|
|
20044
|
+
getPaginatedItems() {
|
|
20045
|
+
return this.data ?? [];
|
|
20046
|
+
}
|
|
20047
|
+
hasNextPage() {
|
|
20048
|
+
if (this.has_more === false) {
|
|
20049
|
+
return false;
|
|
20050
|
+
}
|
|
20051
|
+
return super.hasNextPage();
|
|
20052
|
+
}
|
|
20053
|
+
nextPageRequestOptions() {
|
|
20054
|
+
const cursor = this.last_id;
|
|
20055
|
+
if (!cursor) {
|
|
20056
|
+
return null;
|
|
20057
|
+
}
|
|
20058
|
+
return {
|
|
20059
|
+
...this.options,
|
|
20060
|
+
query: {
|
|
20061
|
+
...maybeObj(this.options.query),
|
|
20062
|
+
after: cursor
|
|
20063
|
+
}
|
|
20064
|
+
};
|
|
20065
|
+
}
|
|
20066
|
+
}
|
|
20067
|
+
|
|
20068
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/uploads.mjs
|
|
20127
20069
|
var checkFileSupport = () => {
|
|
20128
20070
|
if (typeof File === "undefined") {
|
|
20129
20071
|
const { process: process2 } = globalThis;
|
|
@@ -20139,6 +20081,11 @@ function getName(value) {
|
|
|
20139
20081
|
return (typeof value === "object" && value !== null && (("name" in value) && value.name && String(value.name) || ("url" in value) && value.url && String(value.url) || ("filename" in value) && value.filename && String(value.filename) || ("path" in value) && value.path && String(value.path)) || "").split(/[\\/]/).pop() || undefined;
|
|
20140
20082
|
}
|
|
20141
20083
|
var isAsyncIterable = (value) => value != null && typeof value === "object" && typeof value[Symbol.asyncIterator] === "function";
|
|
20084
|
+
var maybeMultipartFormRequestOptions = async (opts, fetch2) => {
|
|
20085
|
+
if (!hasUploadableValue(opts.body))
|
|
20086
|
+
return opts;
|
|
20087
|
+
return { ...opts, body: await createForm(opts.body, fetch2) };
|
|
20088
|
+
};
|
|
20142
20089
|
var multipartFormRequestOptions = async (opts, fetch2) => {
|
|
20143
20090
|
return { ...opts, body: await createForm(opts.body, fetch2) };
|
|
20144
20091
|
};
|
|
@@ -20172,6 +20119,20 @@ var createForm = async (body, fetch2) => {
|
|
|
20172
20119
|
return form;
|
|
20173
20120
|
};
|
|
20174
20121
|
var isNamedBlob = (value) => value instanceof Blob && ("name" in value);
|
|
20122
|
+
var isUploadable = (value) => typeof value === "object" && value !== null && (value instanceof Response || isAsyncIterable(value) || isNamedBlob(value));
|
|
20123
|
+
var hasUploadableValue = (value) => {
|
|
20124
|
+
if (isUploadable(value))
|
|
20125
|
+
return true;
|
|
20126
|
+
if (Array.isArray(value))
|
|
20127
|
+
return value.some(hasUploadableValue);
|
|
20128
|
+
if (value && typeof value === "object") {
|
|
20129
|
+
for (const k in value) {
|
|
20130
|
+
if (hasUploadableValue(value[k]))
|
|
20131
|
+
return true;
|
|
20132
|
+
}
|
|
20133
|
+
}
|
|
20134
|
+
return false;
|
|
20135
|
+
};
|
|
20175
20136
|
var addFormValue = async (form, key, value) => {
|
|
20176
20137
|
if (value === undefined)
|
|
20177
20138
|
return;
|
|
@@ -20195,7 +20156,7 @@ var addFormValue = async (form, key, value) => {
|
|
|
20195
20156
|
}
|
|
20196
20157
|
};
|
|
20197
20158
|
|
|
20198
|
-
// node_modules/.pnpm/openai@
|
|
20159
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/to-file.mjs
|
|
20199
20160
|
var isBlobLike = (value) => value != null && typeof value === "object" && typeof value.size === "number" && typeof value.type === "string" && typeof value.text === "function" && typeof value.slice === "function" && typeof value.arrayBuffer === "function";
|
|
20200
20161
|
var isFileLike = (value) => value != null && typeof value === "object" && typeof value.name === "string" && typeof value.lastModified === "number" && isBlobLike(value);
|
|
20201
20162
|
var isResponseLike = (value) => value != null && typeof value === "object" && typeof value.url === "string" && typeof value.blob === "function";
|
|
@@ -20245,14 +20206,14 @@ function propsForError(value) {
|
|
|
20245
20206
|
const props = Object.getOwnPropertyNames(value);
|
|
20246
20207
|
return `; props: [${props.map((p) => `"${p}"`).join(", ")}]`;
|
|
20247
20208
|
}
|
|
20248
|
-
// node_modules/.pnpm/openai@
|
|
20209
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/core/resource.mjs
|
|
20249
20210
|
class APIResource {
|
|
20250
20211
|
constructor(client) {
|
|
20251
20212
|
this._client = client;
|
|
20252
20213
|
}
|
|
20253
20214
|
}
|
|
20254
20215
|
|
|
20255
|
-
// node_modules/.pnpm/openai@
|
|
20216
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/path.mjs
|
|
20256
20217
|
function encodeURIPath(str) {
|
|
20257
20218
|
return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
20258
20219
|
}
|
|
@@ -20307,18 +20268,120 @@ ${underline}`);
|
|
|
20307
20268
|
};
|
|
20308
20269
|
var path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
20309
20270
|
|
|
20310
|
-
// node_modules/.pnpm/openai@
|
|
20271
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/chat/completions/messages.mjs
|
|
20311
20272
|
class Messages extends APIResource {
|
|
20312
20273
|
list(completionID, query = {}, options) {
|
|
20313
20274
|
return this._client.getAPIList(path`/chat/completions/${completionID}/messages`, CursorPage, { query, ...options });
|
|
20314
20275
|
}
|
|
20315
20276
|
}
|
|
20316
|
-
// node_modules/.pnpm/openai@
|
|
20317
|
-
function
|
|
20318
|
-
return
|
|
20277
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/parser.mjs
|
|
20278
|
+
function isChatCompletionFunctionTool(tool) {
|
|
20279
|
+
return tool !== undefined && "function" in tool && tool.function !== undefined;
|
|
20280
|
+
}
|
|
20281
|
+
function isAutoParsableResponseFormat(response_format) {
|
|
20282
|
+
return response_format?.["$brand"] === "auto-parseable-response-format";
|
|
20283
|
+
}
|
|
20284
|
+
function isAutoParsableTool(tool) {
|
|
20285
|
+
return tool?.["$brand"] === "auto-parseable-tool";
|
|
20286
|
+
}
|
|
20287
|
+
function maybeParseChatCompletion(completion, params) {
|
|
20288
|
+
if (!params || !hasAutoParseableInput(params)) {
|
|
20289
|
+
return {
|
|
20290
|
+
...completion,
|
|
20291
|
+
choices: completion.choices.map((choice) => {
|
|
20292
|
+
assertToolCallsAreChatCompletionFunctionToolCalls(choice.message.tool_calls);
|
|
20293
|
+
return {
|
|
20294
|
+
...choice,
|
|
20295
|
+
message: {
|
|
20296
|
+
...choice.message,
|
|
20297
|
+
parsed: null,
|
|
20298
|
+
...choice.message.tool_calls ? {
|
|
20299
|
+
tool_calls: choice.message.tool_calls
|
|
20300
|
+
} : undefined
|
|
20301
|
+
}
|
|
20302
|
+
};
|
|
20303
|
+
})
|
|
20304
|
+
};
|
|
20305
|
+
}
|
|
20306
|
+
return parseChatCompletion(completion, params);
|
|
20307
|
+
}
|
|
20308
|
+
function parseChatCompletion(completion, params) {
|
|
20309
|
+
const choices = completion.choices.map((choice) => {
|
|
20310
|
+
if (choice.finish_reason === "length") {
|
|
20311
|
+
throw new LengthFinishReasonError;
|
|
20312
|
+
}
|
|
20313
|
+
if (choice.finish_reason === "content_filter") {
|
|
20314
|
+
throw new ContentFilterFinishReasonError;
|
|
20315
|
+
}
|
|
20316
|
+
assertToolCallsAreChatCompletionFunctionToolCalls(choice.message.tool_calls);
|
|
20317
|
+
return {
|
|
20318
|
+
...choice,
|
|
20319
|
+
message: {
|
|
20320
|
+
...choice.message,
|
|
20321
|
+
...choice.message.tool_calls ? {
|
|
20322
|
+
tool_calls: choice.message.tool_calls?.map((toolCall) => parseToolCall(params, toolCall)) ?? undefined
|
|
20323
|
+
} : undefined,
|
|
20324
|
+
parsed: choice.message.content && !choice.message.refusal ? parseResponseFormat(params, choice.message.content) : null
|
|
20325
|
+
}
|
|
20326
|
+
};
|
|
20327
|
+
});
|
|
20328
|
+
return { ...completion, choices };
|
|
20329
|
+
}
|
|
20330
|
+
function parseResponseFormat(params, content) {
|
|
20331
|
+
if (params.response_format?.type !== "json_schema") {
|
|
20332
|
+
return null;
|
|
20333
|
+
}
|
|
20334
|
+
if (params.response_format?.type === "json_schema") {
|
|
20335
|
+
if ("$parseRaw" in params.response_format) {
|
|
20336
|
+
const response_format = params.response_format;
|
|
20337
|
+
return response_format.$parseRaw(content);
|
|
20338
|
+
}
|
|
20339
|
+
return JSON.parse(content);
|
|
20340
|
+
}
|
|
20341
|
+
return null;
|
|
20342
|
+
}
|
|
20343
|
+
function parseToolCall(params, toolCall) {
|
|
20344
|
+
const inputTool = params.tools?.find((inputTool2) => isChatCompletionFunctionTool(inputTool2) && inputTool2.function?.name === toolCall.function.name);
|
|
20345
|
+
return {
|
|
20346
|
+
...toolCall,
|
|
20347
|
+
function: {
|
|
20348
|
+
...toolCall.function,
|
|
20349
|
+
parsed_arguments: isAutoParsableTool(inputTool) ? inputTool.$parseRaw(toolCall.function.arguments) : inputTool?.function.strict ? JSON.parse(toolCall.function.arguments) : null
|
|
20350
|
+
}
|
|
20351
|
+
};
|
|
20352
|
+
}
|
|
20353
|
+
function shouldParseToolCall(params, toolCall) {
|
|
20354
|
+
if (!params || !("tools" in params) || !params.tools) {
|
|
20355
|
+
return false;
|
|
20356
|
+
}
|
|
20357
|
+
const inputTool = params.tools?.find((inputTool2) => isChatCompletionFunctionTool(inputTool2) && inputTool2.function?.name === toolCall.function.name);
|
|
20358
|
+
return isChatCompletionFunctionTool(inputTool) && (isAutoParsableTool(inputTool) || inputTool?.function.strict || false);
|
|
20359
|
+
}
|
|
20360
|
+
function hasAutoParseableInput(params) {
|
|
20361
|
+
if (isAutoParsableResponseFormat(params.response_format)) {
|
|
20362
|
+
return true;
|
|
20363
|
+
}
|
|
20364
|
+
return params.tools?.some((t) => isAutoParsableTool(t) || t.type === "function" && t.function.strict === true) ?? false;
|
|
20365
|
+
}
|
|
20366
|
+
function assertToolCallsAreChatCompletionFunctionToolCalls(toolCalls) {
|
|
20367
|
+
for (const toolCall of toolCalls || []) {
|
|
20368
|
+
if (toolCall.type !== "function") {
|
|
20369
|
+
throw new OpenAIError(`Currently only \`function\` tool calls are supported; Received \`${toolCall.type}\``);
|
|
20370
|
+
}
|
|
20371
|
+
}
|
|
20372
|
+
}
|
|
20373
|
+
function validateInputTools(tools) {
|
|
20374
|
+
for (const tool of tools ?? []) {
|
|
20375
|
+
if (tool.type !== "function") {
|
|
20376
|
+
throw new OpenAIError(`Currently only \`function\` tool types support auto-parsing; Received \`${tool.type}\``);
|
|
20377
|
+
}
|
|
20378
|
+
if (tool.function.strict !== true) {
|
|
20379
|
+
throw new OpenAIError(`The \`${tool.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`);
|
|
20380
|
+
}
|
|
20381
|
+
}
|
|
20319
20382
|
}
|
|
20320
20383
|
|
|
20321
|
-
// node_modules/.pnpm/openai@
|
|
20384
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/chatCompletionUtils.mjs
|
|
20322
20385
|
var isAssistantMessage = (message) => {
|
|
20323
20386
|
return message?.role === "assistant";
|
|
20324
20387
|
};
|
|
@@ -20326,7 +20389,7 @@ var isToolMessage = (message) => {
|
|
|
20326
20389
|
return message?.role === "tool";
|
|
20327
20390
|
};
|
|
20328
20391
|
|
|
20329
|
-
// node_modules/.pnpm/openai@
|
|
20392
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/EventStream.mjs
|
|
20330
20393
|
var _EventStream_instances;
|
|
20331
20394
|
var _EventStream_connectedPromise;
|
|
20332
20395
|
var _EventStream_resolveConnectedPromise;
|
|
@@ -20479,100 +20542,12 @@ _EventStream_connectedPromise = new WeakMap, _EventStream_resolveConnectedPromis
|
|
|
20479
20542
|
return this._emit("error", new OpenAIError(String(error2)));
|
|
20480
20543
|
};
|
|
20481
20544
|
|
|
20482
|
-
// node_modules/.pnpm/openai@
|
|
20483
|
-
function
|
|
20484
|
-
return
|
|
20485
|
-
}
|
|
20486
|
-
function isAutoParsableTool(tool) {
|
|
20487
|
-
return tool?.["$brand"] === "auto-parseable-tool";
|
|
20488
|
-
}
|
|
20489
|
-
function maybeParseChatCompletion(completion, params) {
|
|
20490
|
-
if (!params || !hasAutoParseableInput(params)) {
|
|
20491
|
-
return {
|
|
20492
|
-
...completion,
|
|
20493
|
-
choices: completion.choices.map((choice) => ({
|
|
20494
|
-
...choice,
|
|
20495
|
-
message: {
|
|
20496
|
-
...choice.message,
|
|
20497
|
-
parsed: null,
|
|
20498
|
-
...choice.message.tool_calls ? {
|
|
20499
|
-
tool_calls: choice.message.tool_calls
|
|
20500
|
-
} : undefined
|
|
20501
|
-
}
|
|
20502
|
-
}))
|
|
20503
|
-
};
|
|
20504
|
-
}
|
|
20505
|
-
return parseChatCompletion(completion, params);
|
|
20506
|
-
}
|
|
20507
|
-
function parseChatCompletion(completion, params) {
|
|
20508
|
-
const choices = completion.choices.map((choice) => {
|
|
20509
|
-
if (choice.finish_reason === "length") {
|
|
20510
|
-
throw new LengthFinishReasonError;
|
|
20511
|
-
}
|
|
20512
|
-
if (choice.finish_reason === "content_filter") {
|
|
20513
|
-
throw new ContentFilterFinishReasonError;
|
|
20514
|
-
}
|
|
20515
|
-
return {
|
|
20516
|
-
...choice,
|
|
20517
|
-
message: {
|
|
20518
|
-
...choice.message,
|
|
20519
|
-
...choice.message.tool_calls ? {
|
|
20520
|
-
tool_calls: choice.message.tool_calls?.map((toolCall) => parseToolCall(params, toolCall)) ?? undefined
|
|
20521
|
-
} : undefined,
|
|
20522
|
-
parsed: choice.message.content && !choice.message.refusal ? parseResponseFormat(params, choice.message.content) : null
|
|
20523
|
-
}
|
|
20524
|
-
};
|
|
20525
|
-
});
|
|
20526
|
-
return { ...completion, choices };
|
|
20527
|
-
}
|
|
20528
|
-
function parseResponseFormat(params, content) {
|
|
20529
|
-
if (params.response_format?.type !== "json_schema") {
|
|
20530
|
-
return null;
|
|
20531
|
-
}
|
|
20532
|
-
if (params.response_format?.type === "json_schema") {
|
|
20533
|
-
if ("$parseRaw" in params.response_format) {
|
|
20534
|
-
const response_format = params.response_format;
|
|
20535
|
-
return response_format.$parseRaw(content);
|
|
20536
|
-
}
|
|
20537
|
-
return JSON.parse(content);
|
|
20538
|
-
}
|
|
20539
|
-
return null;
|
|
20540
|
-
}
|
|
20541
|
-
function parseToolCall(params, toolCall) {
|
|
20542
|
-
const inputTool = params.tools?.find((inputTool2) => inputTool2.function?.name === toolCall.function.name);
|
|
20543
|
-
return {
|
|
20544
|
-
...toolCall,
|
|
20545
|
-
function: {
|
|
20546
|
-
...toolCall.function,
|
|
20547
|
-
parsed_arguments: isAutoParsableTool(inputTool) ? inputTool.$parseRaw(toolCall.function.arguments) : inputTool?.function.strict ? JSON.parse(toolCall.function.arguments) : null
|
|
20548
|
-
}
|
|
20549
|
-
};
|
|
20550
|
-
}
|
|
20551
|
-
function shouldParseToolCall(params, toolCall) {
|
|
20552
|
-
if (!params) {
|
|
20553
|
-
return false;
|
|
20554
|
-
}
|
|
20555
|
-
const inputTool = params.tools?.find((inputTool2) => inputTool2.function?.name === toolCall.function.name);
|
|
20556
|
-
return isAutoParsableTool(inputTool) || inputTool?.function.strict || false;
|
|
20557
|
-
}
|
|
20558
|
-
function hasAutoParseableInput(params) {
|
|
20559
|
-
if (isAutoParsableResponseFormat(params.response_format)) {
|
|
20560
|
-
return true;
|
|
20561
|
-
}
|
|
20562
|
-
return params.tools?.some((t) => isAutoParsableTool(t) || t.type === "function" && t.function.strict === true) ?? false;
|
|
20563
|
-
}
|
|
20564
|
-
function validateInputTools(tools) {
|
|
20565
|
-
for (const tool of tools ?? []) {
|
|
20566
|
-
if (tool.type !== "function") {
|
|
20567
|
-
throw new OpenAIError(`Currently only \`function\` tool types support auto-parsing; Received \`${tool.type}\``);
|
|
20568
|
-
}
|
|
20569
|
-
if (tool.function.strict !== true) {
|
|
20570
|
-
throw new OpenAIError(`The \`${tool.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`);
|
|
20571
|
-
}
|
|
20572
|
-
}
|
|
20545
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/RunnableFunction.mjs
|
|
20546
|
+
function isRunnableFunctionWithParse(fn) {
|
|
20547
|
+
return typeof fn.parse === "function";
|
|
20573
20548
|
}
|
|
20574
20549
|
|
|
20575
|
-
// node_modules/.pnpm/openai@
|
|
20550
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/AbstractChatCompletionRunner.mjs
|
|
20576
20551
|
var _AbstractChatCompletionRunner_instances;
|
|
20577
20552
|
var _AbstractChatCompletionRunner_getFinalContent;
|
|
20578
20553
|
var _AbstractChatCompletionRunner_getFinalMessage;
|
|
@@ -20686,7 +20661,7 @@ class AbstractChatCompletionRunner extends EventStream {
|
|
|
20686
20661
|
async _runTools(client, params, options) {
|
|
20687
20662
|
const role = "tool";
|
|
20688
20663
|
const { tool_choice = "auto", stream, ...restParams } = params;
|
|
20689
|
-
const singleFunctionToCall = typeof tool_choice !== "string" && tool_choice?.function?.name;
|
|
20664
|
+
const singleFunctionToCall = typeof tool_choice !== "string" && tool_choice.type === "function" && tool_choice?.function?.name;
|
|
20690
20665
|
const { maxChatCompletions = DEFAULT_MAX_CHAT_COMPLETIONS } = options || {};
|
|
20691
20666
|
const inputTools = params.tools.map((tool) => {
|
|
20692
20667
|
if (isAutoParsableTool(tool)) {
|
|
@@ -20793,7 +20768,7 @@ _AbstractChatCompletionRunner_instances = new WeakSet, _AbstractChatCompletionRu
|
|
|
20793
20768
|
for (let i = this.messages.length - 1;i >= 0; i--) {
|
|
20794
20769
|
const message = this.messages[i];
|
|
20795
20770
|
if (isAssistantMessage(message) && message?.tool_calls?.length) {
|
|
20796
|
-
return message.tool_calls.at(-1)?.function;
|
|
20771
|
+
return message.tool_calls.filter((x) => x.type === "function").at(-1)?.function;
|
|
20797
20772
|
}
|
|
20798
20773
|
}
|
|
20799
20774
|
return;
|
|
@@ -20827,7 +20802,7 @@ _AbstractChatCompletionRunner_instances = new WeakSet, _AbstractChatCompletionRu
|
|
|
20827
20802
|
return typeof rawContent === "string" ? rawContent : rawContent === undefined ? "undefined" : JSON.stringify(rawContent);
|
|
20828
20803
|
};
|
|
20829
20804
|
|
|
20830
|
-
// node_modules/.pnpm/openai@
|
|
20805
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/ChatCompletionRunner.mjs
|
|
20831
20806
|
class ChatCompletionRunner extends AbstractChatCompletionRunner {
|
|
20832
20807
|
static runTools(client, params, options) {
|
|
20833
20808
|
const runner = new ChatCompletionRunner;
|
|
@@ -20845,7 +20820,8 @@ class ChatCompletionRunner extends AbstractChatCompletionRunner {
|
|
|
20845
20820
|
}
|
|
20846
20821
|
}
|
|
20847
20822
|
}
|
|
20848
|
-
|
|
20823
|
+
|
|
20824
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/_vendor/partial-json-parser/parser.mjs
|
|
20849
20825
|
var STR = 1;
|
|
20850
20826
|
var NUM = 2;
|
|
20851
20827
|
var ARR = 4;
|
|
@@ -21058,8 +21034,7 @@ var _parseJSON = (jsonString, allow) => {
|
|
|
21058
21034
|
return parseAny();
|
|
21059
21035
|
};
|
|
21060
21036
|
var partialParse = (input) => parseJSON(input, Allow.ALL ^ Allow.NUM);
|
|
21061
|
-
|
|
21062
|
-
// node_modules/.pnpm/openai@5.12.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/ChatCompletionStream.mjs
|
|
21037
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/ChatCompletionStream.mjs
|
|
21063
21038
|
var _ChatCompletionStream_instances;
|
|
21064
21039
|
var _ChatCompletionStream_params;
|
|
21065
21040
|
var _ChatCompletionStream_choiceEventStates;
|
|
@@ -21237,7 +21212,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
21237
21212
|
throw new Error("tool call snapshot missing `type`");
|
|
21238
21213
|
}
|
|
21239
21214
|
if (toolCallSnapshot.type === "function") {
|
|
21240
|
-
const inputTool = __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => tool
|
|
21215
|
+
const inputTool = __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => isChatCompletionFunctionTool(tool) && tool.function.name === toolCallSnapshot.function.name);
|
|
21241
21216
|
this._emit("tool_calls.function.arguments.done", {
|
|
21242
21217
|
name: toolCallSnapshot.function.name,
|
|
21243
21218
|
index: toolCallIndex,
|
|
@@ -21532,7 +21507,7 @@ function assertIsEmpty(obj) {
|
|
|
21532
21507
|
}
|
|
21533
21508
|
function assertNever(_x) {}
|
|
21534
21509
|
|
|
21535
|
-
// node_modules/.pnpm/openai@
|
|
21510
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/ChatCompletionStreamingRunner.mjs
|
|
21536
21511
|
class ChatCompletionStreamingRunner extends ChatCompletionStream {
|
|
21537
21512
|
static fromReadableStream(stream) {
|
|
21538
21513
|
const runner = new ChatCompletionStreamingRunner(null);
|
|
@@ -21550,7 +21525,7 @@ class ChatCompletionStreamingRunner extends ChatCompletionStream {
|
|
|
21550
21525
|
}
|
|
21551
21526
|
}
|
|
21552
21527
|
|
|
21553
|
-
// node_modules/.pnpm/openai@
|
|
21528
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/chat/completions/completions.mjs
|
|
21554
21529
|
class Completions extends APIResource {
|
|
21555
21530
|
constructor() {
|
|
21556
21531
|
super(...arguments);
|
|
@@ -21593,7 +21568,7 @@ class Completions extends APIResource {
|
|
|
21593
21568
|
}
|
|
21594
21569
|
Completions.Messages = Messages;
|
|
21595
21570
|
|
|
21596
|
-
// node_modules/.pnpm/openai@
|
|
21571
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/chat/chat.mjs
|
|
21597
21572
|
class Chat extends APIResource {
|
|
21598
21573
|
constructor() {
|
|
21599
21574
|
super(...arguments);
|
|
@@ -21601,7 +21576,7 @@ class Chat extends APIResource {
|
|
|
21601
21576
|
}
|
|
21602
21577
|
}
|
|
21603
21578
|
Chat.Completions = Completions;
|
|
21604
|
-
// node_modules/.pnpm/openai@
|
|
21579
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/headers.mjs
|
|
21605
21580
|
var brand_privateNullableHeaders = /* @__PURE__ */ Symbol("brand.privateNullableHeaders");
|
|
21606
21581
|
function* iterateHeaders(headers) {
|
|
21607
21582
|
if (!headers)
|
|
@@ -21664,7 +21639,7 @@ var buildHeaders = (newHeaders) => {
|
|
|
21664
21639
|
return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders };
|
|
21665
21640
|
};
|
|
21666
21641
|
|
|
21667
|
-
// node_modules/.pnpm/openai@
|
|
21642
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/audio/speech.mjs
|
|
21668
21643
|
class Speech extends APIResource {
|
|
21669
21644
|
create(body, options) {
|
|
21670
21645
|
return this._client.post("/audio/speech", {
|
|
@@ -21676,7 +21651,7 @@ class Speech extends APIResource {
|
|
|
21676
21651
|
}
|
|
21677
21652
|
}
|
|
21678
21653
|
|
|
21679
|
-
// node_modules/.pnpm/openai@
|
|
21654
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/audio/transcriptions.mjs
|
|
21680
21655
|
class Transcriptions extends APIResource {
|
|
21681
21656
|
create(body, options) {
|
|
21682
21657
|
return this._client.post("/audio/transcriptions", multipartFormRequestOptions({
|
|
@@ -21688,14 +21663,14 @@ class Transcriptions extends APIResource {
|
|
|
21688
21663
|
}
|
|
21689
21664
|
}
|
|
21690
21665
|
|
|
21691
|
-
// node_modules/.pnpm/openai@
|
|
21666
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/audio/translations.mjs
|
|
21692
21667
|
class Translations extends APIResource {
|
|
21693
21668
|
create(body, options) {
|
|
21694
21669
|
return this._client.post("/audio/translations", multipartFormRequestOptions({ body, ...options, __metadata: { model: body.model } }, this._client));
|
|
21695
21670
|
}
|
|
21696
21671
|
}
|
|
21697
21672
|
|
|
21698
|
-
// node_modules/.pnpm/openai@
|
|
21673
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/audio/audio.mjs
|
|
21699
21674
|
class Audio extends APIResource {
|
|
21700
21675
|
constructor() {
|
|
21701
21676
|
super(...arguments);
|
|
@@ -21707,7 +21682,7 @@ class Audio extends APIResource {
|
|
|
21707
21682
|
Audio.Transcriptions = Transcriptions;
|
|
21708
21683
|
Audio.Translations = Translations;
|
|
21709
21684
|
Audio.Speech = Speech;
|
|
21710
|
-
// node_modules/.pnpm/openai@
|
|
21685
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/batches.mjs
|
|
21711
21686
|
class Batches extends APIResource {
|
|
21712
21687
|
create(body, options) {
|
|
21713
21688
|
return this._client.post("/batches", { body, ...options });
|
|
@@ -21722,7 +21697,7 @@ class Batches extends APIResource {
|
|
|
21722
21697
|
return this._client.post(path`/batches/${batchID}/cancel`, options);
|
|
21723
21698
|
}
|
|
21724
21699
|
}
|
|
21725
|
-
// node_modules/.pnpm/openai@
|
|
21700
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/assistants.mjs
|
|
21726
21701
|
class Assistants extends APIResource {
|
|
21727
21702
|
create(body, options) {
|
|
21728
21703
|
return this._client.post("/assistants", {
|
|
@@ -21759,7 +21734,7 @@ class Assistants extends APIResource {
|
|
|
21759
21734
|
}
|
|
21760
21735
|
}
|
|
21761
21736
|
|
|
21762
|
-
// node_modules/.pnpm/openai@
|
|
21737
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/realtime/sessions.mjs
|
|
21763
21738
|
class Sessions extends APIResource {
|
|
21764
21739
|
create(body, options) {
|
|
21765
21740
|
return this._client.post("/realtime/sessions", {
|
|
@@ -21770,7 +21745,7 @@ class Sessions extends APIResource {
|
|
|
21770
21745
|
}
|
|
21771
21746
|
}
|
|
21772
21747
|
|
|
21773
|
-
// node_modules/.pnpm/openai@
|
|
21748
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/realtime/transcription-sessions.mjs
|
|
21774
21749
|
class TranscriptionSessions extends APIResource {
|
|
21775
21750
|
create(body, options) {
|
|
21776
21751
|
return this._client.post("/realtime/transcription_sessions", {
|
|
@@ -21781,7 +21756,7 @@ class TranscriptionSessions extends APIResource {
|
|
|
21781
21756
|
}
|
|
21782
21757
|
}
|
|
21783
21758
|
|
|
21784
|
-
// node_modules/.pnpm/openai@
|
|
21759
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/realtime/realtime.mjs
|
|
21785
21760
|
class Realtime extends APIResource {
|
|
21786
21761
|
constructor() {
|
|
21787
21762
|
super(...arguments);
|
|
@@ -21792,7 +21767,61 @@ class Realtime extends APIResource {
|
|
|
21792
21767
|
Realtime.Sessions = Sessions;
|
|
21793
21768
|
Realtime.TranscriptionSessions = TranscriptionSessions;
|
|
21794
21769
|
|
|
21795
|
-
// node_modules/.pnpm/openai@
|
|
21770
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/chatkit/sessions.mjs
|
|
21771
|
+
class Sessions2 extends APIResource {
|
|
21772
|
+
create(body, options) {
|
|
21773
|
+
return this._client.post("/chatkit/sessions", {
|
|
21774
|
+
body,
|
|
21775
|
+
...options,
|
|
21776
|
+
headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
|
|
21777
|
+
});
|
|
21778
|
+
}
|
|
21779
|
+
cancel(sessionID, options) {
|
|
21780
|
+
return this._client.post(path`/chatkit/sessions/${sessionID}/cancel`, {
|
|
21781
|
+
...options,
|
|
21782
|
+
headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
|
|
21783
|
+
});
|
|
21784
|
+
}
|
|
21785
|
+
}
|
|
21786
|
+
|
|
21787
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/chatkit/threads.mjs
|
|
21788
|
+
class Threads extends APIResource {
|
|
21789
|
+
retrieve(threadID, options) {
|
|
21790
|
+
return this._client.get(path`/chatkit/threads/${threadID}`, {
|
|
21791
|
+
...options,
|
|
21792
|
+
headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
|
|
21793
|
+
});
|
|
21794
|
+
}
|
|
21795
|
+
list(query = {}, options) {
|
|
21796
|
+
return this._client.getAPIList("/chatkit/threads", ConversationCursorPage, {
|
|
21797
|
+
query,
|
|
21798
|
+
...options,
|
|
21799
|
+
headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
|
|
21800
|
+
});
|
|
21801
|
+
}
|
|
21802
|
+
delete(threadID, options) {
|
|
21803
|
+
return this._client.delete(path`/chatkit/threads/${threadID}`, {
|
|
21804
|
+
...options,
|
|
21805
|
+
headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
|
|
21806
|
+
});
|
|
21807
|
+
}
|
|
21808
|
+
listItems(threadID, query = {}, options) {
|
|
21809
|
+
return this._client.getAPIList(path`/chatkit/threads/${threadID}/items`, ConversationCursorPage, { query, ...options, headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]) });
|
|
21810
|
+
}
|
|
21811
|
+
}
|
|
21812
|
+
|
|
21813
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/chatkit/chatkit.mjs
|
|
21814
|
+
class ChatKit extends APIResource {
|
|
21815
|
+
constructor() {
|
|
21816
|
+
super(...arguments);
|
|
21817
|
+
this.sessions = new Sessions2(this._client);
|
|
21818
|
+
this.threads = new Threads(this._client);
|
|
21819
|
+
}
|
|
21820
|
+
}
|
|
21821
|
+
ChatKit.Sessions = Sessions2;
|
|
21822
|
+
ChatKit.Threads = Threads;
|
|
21823
|
+
|
|
21824
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/threads/messages.mjs
|
|
21796
21825
|
class Messages2 extends APIResource {
|
|
21797
21826
|
create(threadID, body, options) {
|
|
21798
21827
|
return this._client.post(path`/threads/${threadID}/messages`, {
|
|
@@ -21832,7 +21861,7 @@ class Messages2 extends APIResource {
|
|
|
21832
21861
|
}
|
|
21833
21862
|
}
|
|
21834
21863
|
|
|
21835
|
-
// node_modules/.pnpm/openai@
|
|
21864
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/threads/runs/steps.mjs
|
|
21836
21865
|
class Steps extends APIResource {
|
|
21837
21866
|
retrieve(stepID, params, options) {
|
|
21838
21867
|
const { thread_id, run_id, ...query } = params;
|
|
@@ -21851,7 +21880,7 @@ class Steps extends APIResource {
|
|
|
21851
21880
|
});
|
|
21852
21881
|
}
|
|
21853
21882
|
}
|
|
21854
|
-
// node_modules/.pnpm/openai@
|
|
21883
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/base64.mjs
|
|
21855
21884
|
var toFloat32Array = (base64Str) => {
|
|
21856
21885
|
if (typeof Buffer !== "undefined") {
|
|
21857
21886
|
const buf = Buffer.from(base64Str, "base64");
|
|
@@ -21866,7 +21895,7 @@ var toFloat32Array = (base64Str) => {
|
|
|
21866
21895
|
return Array.from(new Float32Array(bytes.buffer));
|
|
21867
21896
|
}
|
|
21868
21897
|
};
|
|
21869
|
-
// node_modules/.pnpm/openai@
|
|
21898
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/env.mjs
|
|
21870
21899
|
var readEnv = (env) => {
|
|
21871
21900
|
if (typeof globalThis.process !== "undefined") {
|
|
21872
21901
|
return globalThis.process.env?.[env]?.trim() ?? undefined;
|
|
@@ -21876,7 +21905,7 @@ var readEnv = (env) => {
|
|
|
21876
21905
|
}
|
|
21877
21906
|
return;
|
|
21878
21907
|
};
|
|
21879
|
-
// node_modules/.pnpm/openai@
|
|
21908
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/AssistantStream.mjs
|
|
21880
21909
|
var _AssistantStream_instances;
|
|
21881
21910
|
var _a;
|
|
21882
21911
|
var _AssistantStream_events;
|
|
@@ -22415,7 +22444,7 @@ _a = AssistantStream, _AssistantStream_addEvent = function _AssistantStream_addE
|
|
|
22415
22444
|
};
|
|
22416
22445
|
function assertNever2(_x) {}
|
|
22417
22446
|
|
|
22418
|
-
// node_modules/.pnpm/openai@
|
|
22447
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/threads/runs/runs.mjs
|
|
22419
22448
|
class Runs extends APIResource {
|
|
22420
22449
|
constructor() {
|
|
22421
22450
|
super(...arguments);
|
|
@@ -22530,8 +22559,8 @@ class Runs extends APIResource {
|
|
|
22530
22559
|
}
|
|
22531
22560
|
Runs.Steps = Steps;
|
|
22532
22561
|
|
|
22533
|
-
// node_modules/.pnpm/openai@
|
|
22534
|
-
class
|
|
22562
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/threads/threads.mjs
|
|
22563
|
+
class Threads2 extends APIResource {
|
|
22535
22564
|
constructor() {
|
|
22536
22565
|
super(...arguments);
|
|
22537
22566
|
this.runs = new Runs(this._client);
|
|
@@ -22579,28 +22608,30 @@ class Threads extends APIResource {
|
|
|
22579
22608
|
return AssistantStream.createThreadAssistantStream(body, this._client.beta.threads, options);
|
|
22580
22609
|
}
|
|
22581
22610
|
}
|
|
22582
|
-
|
|
22583
|
-
|
|
22611
|
+
Threads2.Runs = Runs;
|
|
22612
|
+
Threads2.Messages = Messages2;
|
|
22584
22613
|
|
|
22585
|
-
// node_modules/.pnpm/openai@
|
|
22614
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/beta.mjs
|
|
22586
22615
|
class Beta extends APIResource {
|
|
22587
22616
|
constructor() {
|
|
22588
22617
|
super(...arguments);
|
|
22589
22618
|
this.realtime = new Realtime(this._client);
|
|
22619
|
+
this.chatkit = new ChatKit(this._client);
|
|
22590
22620
|
this.assistants = new Assistants(this._client);
|
|
22591
|
-
this.threads = new
|
|
22621
|
+
this.threads = new Threads2(this._client);
|
|
22592
22622
|
}
|
|
22593
22623
|
}
|
|
22594
22624
|
Beta.Realtime = Realtime;
|
|
22625
|
+
Beta.ChatKit = ChatKit;
|
|
22595
22626
|
Beta.Assistants = Assistants;
|
|
22596
|
-
Beta.Threads =
|
|
22597
|
-
// node_modules/.pnpm/openai@
|
|
22627
|
+
Beta.Threads = Threads2;
|
|
22628
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/completions.mjs
|
|
22598
22629
|
class Completions2 extends APIResource {
|
|
22599
22630
|
create(body, options) {
|
|
22600
22631
|
return this._client.post("/completions", { body, ...options, stream: body.stream ?? false });
|
|
22601
22632
|
}
|
|
22602
22633
|
}
|
|
22603
|
-
// node_modules/.pnpm/openai@
|
|
22634
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/containers/files/content.mjs
|
|
22604
22635
|
class Content extends APIResource {
|
|
22605
22636
|
retrieve(fileID, params, options) {
|
|
22606
22637
|
const { container_id } = params;
|
|
@@ -22612,7 +22643,7 @@ class Content extends APIResource {
|
|
|
22612
22643
|
}
|
|
22613
22644
|
}
|
|
22614
22645
|
|
|
22615
|
-
// node_modules/.pnpm/openai@
|
|
22646
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/containers/files/files.mjs
|
|
22616
22647
|
class Files extends APIResource {
|
|
22617
22648
|
constructor() {
|
|
22618
22649
|
super(...arguments);
|
|
@@ -22641,7 +22672,7 @@ class Files extends APIResource {
|
|
|
22641
22672
|
}
|
|
22642
22673
|
Files.Content = Content;
|
|
22643
22674
|
|
|
22644
|
-
// node_modules/.pnpm/openai@
|
|
22675
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/containers/containers.mjs
|
|
22645
22676
|
class Containers extends APIResource {
|
|
22646
22677
|
constructor() {
|
|
22647
22678
|
super(...arguments);
|
|
@@ -22664,7 +22695,50 @@ class Containers extends APIResource {
|
|
|
22664
22695
|
}
|
|
22665
22696
|
}
|
|
22666
22697
|
Containers.Files = Files;
|
|
22667
|
-
// node_modules/.pnpm/openai@
|
|
22698
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/conversations/items.mjs
|
|
22699
|
+
class Items extends APIResource {
|
|
22700
|
+
create(conversationID, params, options) {
|
|
22701
|
+
const { include, ...body } = params;
|
|
22702
|
+
return this._client.post(path`/conversations/${conversationID}/items`, {
|
|
22703
|
+
query: { include },
|
|
22704
|
+
body,
|
|
22705
|
+
...options
|
|
22706
|
+
});
|
|
22707
|
+
}
|
|
22708
|
+
retrieve(itemID, params, options) {
|
|
22709
|
+
const { conversation_id, ...query } = params;
|
|
22710
|
+
return this._client.get(path`/conversations/${conversation_id}/items/${itemID}`, { query, ...options });
|
|
22711
|
+
}
|
|
22712
|
+
list(conversationID, query = {}, options) {
|
|
22713
|
+
return this._client.getAPIList(path`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options });
|
|
22714
|
+
}
|
|
22715
|
+
delete(itemID, params, options) {
|
|
22716
|
+
const { conversation_id } = params;
|
|
22717
|
+
return this._client.delete(path`/conversations/${conversation_id}/items/${itemID}`, options);
|
|
22718
|
+
}
|
|
22719
|
+
}
|
|
22720
|
+
|
|
22721
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/conversations/conversations.mjs
|
|
22722
|
+
class Conversations extends APIResource {
|
|
22723
|
+
constructor() {
|
|
22724
|
+
super(...arguments);
|
|
22725
|
+
this.items = new Items(this._client);
|
|
22726
|
+
}
|
|
22727
|
+
create(body = {}, options) {
|
|
22728
|
+
return this._client.post("/conversations", { body, ...options });
|
|
22729
|
+
}
|
|
22730
|
+
retrieve(conversationID, options) {
|
|
22731
|
+
return this._client.get(path`/conversations/${conversationID}`, options);
|
|
22732
|
+
}
|
|
22733
|
+
update(conversationID, body, options) {
|
|
22734
|
+
return this._client.post(path`/conversations/${conversationID}`, { body, ...options });
|
|
22735
|
+
}
|
|
22736
|
+
delete(conversationID, options) {
|
|
22737
|
+
return this._client.delete(path`/conversations/${conversationID}`, options);
|
|
22738
|
+
}
|
|
22739
|
+
}
|
|
22740
|
+
Conversations.Items = Items;
|
|
22741
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/embeddings.mjs
|
|
22668
22742
|
class Embeddings extends APIResource {
|
|
22669
22743
|
create(body, options) {
|
|
22670
22744
|
const hasUserProvidedEncodingFormat = !!body.encoding_format;
|
|
@@ -22694,7 +22768,7 @@ class Embeddings extends APIResource {
|
|
|
22694
22768
|
});
|
|
22695
22769
|
}
|
|
22696
22770
|
}
|
|
22697
|
-
// node_modules/.pnpm/openai@
|
|
22771
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/evals/runs/output-items.mjs
|
|
22698
22772
|
class OutputItems extends APIResource {
|
|
22699
22773
|
retrieve(outputItemID, params, options) {
|
|
22700
22774
|
const { eval_id, run_id } = params;
|
|
@@ -22706,7 +22780,7 @@ class OutputItems extends APIResource {
|
|
|
22706
22780
|
}
|
|
22707
22781
|
}
|
|
22708
22782
|
|
|
22709
|
-
// node_modules/.pnpm/openai@
|
|
22783
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/evals/runs/runs.mjs
|
|
22710
22784
|
class Runs2 extends APIResource {
|
|
22711
22785
|
constructor() {
|
|
22712
22786
|
super(...arguments);
|
|
@@ -22736,7 +22810,7 @@ class Runs2 extends APIResource {
|
|
|
22736
22810
|
}
|
|
22737
22811
|
Runs2.OutputItems = OutputItems;
|
|
22738
22812
|
|
|
22739
|
-
// node_modules/.pnpm/openai@
|
|
22813
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/evals/evals.mjs
|
|
22740
22814
|
class Evals extends APIResource {
|
|
22741
22815
|
constructor() {
|
|
22742
22816
|
super(...arguments);
|
|
@@ -22759,7 +22833,7 @@ class Evals extends APIResource {
|
|
|
22759
22833
|
}
|
|
22760
22834
|
}
|
|
22761
22835
|
Evals.Runs = Runs2;
|
|
22762
|
-
// node_modules/.pnpm/openai@
|
|
22836
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/files.mjs
|
|
22763
22837
|
class Files2 extends APIResource {
|
|
22764
22838
|
create(body, options) {
|
|
22765
22839
|
return this._client.post("/files", multipartFormRequestOptions({ body, ...options }, this._client));
|
|
@@ -22796,11 +22870,11 @@ class Files2 extends APIResource {
|
|
|
22796
22870
|
return file;
|
|
22797
22871
|
}
|
|
22798
22872
|
}
|
|
22799
|
-
// node_modules/.pnpm/openai@
|
|
22873
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/methods.mjs
|
|
22800
22874
|
class Methods extends APIResource {
|
|
22801
22875
|
}
|
|
22802
22876
|
|
|
22803
|
-
// node_modules/.pnpm/openai@
|
|
22877
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/alpha/graders.mjs
|
|
22804
22878
|
class Graders extends APIResource {
|
|
22805
22879
|
run(body, options) {
|
|
22806
22880
|
return this._client.post("/fine_tuning/alpha/graders/run", { body, ...options });
|
|
@@ -22810,7 +22884,7 @@ class Graders extends APIResource {
|
|
|
22810
22884
|
}
|
|
22811
22885
|
}
|
|
22812
22886
|
|
|
22813
|
-
// node_modules/.pnpm/openai@
|
|
22887
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/alpha/alpha.mjs
|
|
22814
22888
|
class Alpha extends APIResource {
|
|
22815
22889
|
constructor() {
|
|
22816
22890
|
super(...arguments);
|
|
@@ -22819,7 +22893,7 @@ class Alpha extends APIResource {
|
|
|
22819
22893
|
}
|
|
22820
22894
|
Alpha.Graders = Graders;
|
|
22821
22895
|
|
|
22822
|
-
// node_modules/.pnpm/openai@
|
|
22896
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/checkpoints/permissions.mjs
|
|
22823
22897
|
class Permissions extends APIResource {
|
|
22824
22898
|
create(fineTunedModelCheckpoint, body, options) {
|
|
22825
22899
|
return this._client.getAPIList(path`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page, { body, method: "post", ...options });
|
|
@@ -22836,7 +22910,7 @@ class Permissions extends APIResource {
|
|
|
22836
22910
|
}
|
|
22837
22911
|
}
|
|
22838
22912
|
|
|
22839
|
-
// node_modules/.pnpm/openai@
|
|
22913
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.mjs
|
|
22840
22914
|
class Checkpoints extends APIResource {
|
|
22841
22915
|
constructor() {
|
|
22842
22916
|
super(...arguments);
|
|
@@ -22845,14 +22919,14 @@ class Checkpoints extends APIResource {
|
|
|
22845
22919
|
}
|
|
22846
22920
|
Checkpoints.Permissions = Permissions;
|
|
22847
22921
|
|
|
22848
|
-
// node_modules/.pnpm/openai@
|
|
22922
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/jobs/checkpoints.mjs
|
|
22849
22923
|
class Checkpoints2 extends APIResource {
|
|
22850
22924
|
list(fineTuningJobID, query = {}, options) {
|
|
22851
22925
|
return this._client.getAPIList(path`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query, ...options });
|
|
22852
22926
|
}
|
|
22853
22927
|
}
|
|
22854
22928
|
|
|
22855
|
-
// node_modules/.pnpm/openai@
|
|
22929
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/jobs/jobs.mjs
|
|
22856
22930
|
class Jobs extends APIResource {
|
|
22857
22931
|
constructor() {
|
|
22858
22932
|
super(...arguments);
|
|
@@ -22882,7 +22956,7 @@ class Jobs extends APIResource {
|
|
|
22882
22956
|
}
|
|
22883
22957
|
Jobs.Checkpoints = Checkpoints2;
|
|
22884
22958
|
|
|
22885
|
-
// node_modules/.pnpm/openai@
|
|
22959
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/fine-tuning.mjs
|
|
22886
22960
|
class FineTuning extends APIResource {
|
|
22887
22961
|
constructor() {
|
|
22888
22962
|
super(...arguments);
|
|
@@ -22896,11 +22970,11 @@ FineTuning.Methods = Methods;
|
|
|
22896
22970
|
FineTuning.Jobs = Jobs;
|
|
22897
22971
|
FineTuning.Checkpoints = Checkpoints;
|
|
22898
22972
|
FineTuning.Alpha = Alpha;
|
|
22899
|
-
// node_modules/.pnpm/openai@
|
|
22973
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/graders/grader-models.mjs
|
|
22900
22974
|
class GraderModels extends APIResource {
|
|
22901
22975
|
}
|
|
22902
22976
|
|
|
22903
|
-
// node_modules/.pnpm/openai@
|
|
22977
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/graders/graders.mjs
|
|
22904
22978
|
class Graders2 extends APIResource {
|
|
22905
22979
|
constructor() {
|
|
22906
22980
|
super(...arguments);
|
|
@@ -22908,7 +22982,7 @@ class Graders2 extends APIResource {
|
|
|
22908
22982
|
}
|
|
22909
22983
|
}
|
|
22910
22984
|
Graders2.GraderModels = GraderModels;
|
|
22911
|
-
// node_modules/.pnpm/openai@
|
|
22985
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/images.mjs
|
|
22912
22986
|
class Images extends APIResource {
|
|
22913
22987
|
createVariation(body, options) {
|
|
22914
22988
|
return this._client.post("/images/variations", multipartFormRequestOptions({ body, ...options }, this._client));
|
|
@@ -22920,7 +22994,7 @@ class Images extends APIResource {
|
|
|
22920
22994
|
return this._client.post("/images/generations", { body, ...options, stream: body.stream ?? false });
|
|
22921
22995
|
}
|
|
22922
22996
|
}
|
|
22923
|
-
// node_modules/.pnpm/openai@
|
|
22997
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/models.mjs
|
|
22924
22998
|
class Models extends APIResource {
|
|
22925
22999
|
retrieve(model, options) {
|
|
22926
23000
|
return this._client.get(path`/models/${model}`, options);
|
|
@@ -22932,13 +23006,61 @@ class Models extends APIResource {
|
|
|
22932
23006
|
return this._client.delete(path`/models/${model}`, options);
|
|
22933
23007
|
}
|
|
22934
23008
|
}
|
|
22935
|
-
// node_modules/.pnpm/openai@
|
|
23009
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/moderations.mjs
|
|
22936
23010
|
class Moderations extends APIResource {
|
|
22937
23011
|
create(body, options) {
|
|
22938
23012
|
return this._client.post("/moderations", { body, ...options });
|
|
22939
23013
|
}
|
|
22940
23014
|
}
|
|
22941
|
-
// node_modules/.pnpm/openai@
|
|
23015
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/realtime/calls.mjs
|
|
23016
|
+
class Calls extends APIResource {
|
|
23017
|
+
accept(callID, body, options) {
|
|
23018
|
+
return this._client.post(path`/realtime/calls/${callID}/accept`, {
|
|
23019
|
+
body,
|
|
23020
|
+
...options,
|
|
23021
|
+
headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
|
|
23022
|
+
});
|
|
23023
|
+
}
|
|
23024
|
+
hangup(callID, options) {
|
|
23025
|
+
return this._client.post(path`/realtime/calls/${callID}/hangup`, {
|
|
23026
|
+
...options,
|
|
23027
|
+
headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
|
|
23028
|
+
});
|
|
23029
|
+
}
|
|
23030
|
+
refer(callID, body, options) {
|
|
23031
|
+
return this._client.post(path`/realtime/calls/${callID}/refer`, {
|
|
23032
|
+
body,
|
|
23033
|
+
...options,
|
|
23034
|
+
headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
|
|
23035
|
+
});
|
|
23036
|
+
}
|
|
23037
|
+
reject(callID, body = {}, options) {
|
|
23038
|
+
return this._client.post(path`/realtime/calls/${callID}/reject`, {
|
|
23039
|
+
body,
|
|
23040
|
+
...options,
|
|
23041
|
+
headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
|
|
23042
|
+
});
|
|
23043
|
+
}
|
|
23044
|
+
}
|
|
23045
|
+
|
|
23046
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/realtime/client-secrets.mjs
|
|
23047
|
+
class ClientSecrets extends APIResource {
|
|
23048
|
+
create(body, options) {
|
|
23049
|
+
return this._client.post("/realtime/client_secrets", { body, ...options });
|
|
23050
|
+
}
|
|
23051
|
+
}
|
|
23052
|
+
|
|
23053
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/realtime/realtime.mjs
|
|
23054
|
+
class Realtime2 extends APIResource {
|
|
23055
|
+
constructor() {
|
|
23056
|
+
super(...arguments);
|
|
23057
|
+
this.clientSecrets = new ClientSecrets(this._client);
|
|
23058
|
+
this.calls = new Calls(this._client);
|
|
23059
|
+
}
|
|
23060
|
+
}
|
|
23061
|
+
Realtime2.ClientSecrets = ClientSecrets;
|
|
23062
|
+
Realtime2.Calls = Calls;
|
|
23063
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/ResponsesParser.mjs
|
|
22942
23064
|
function maybeParseResponse(response, params) {
|
|
22943
23065
|
if (!params || !hasAutoParseableInput2(params)) {
|
|
22944
23066
|
return {
|
|
@@ -23059,7 +23181,7 @@ function addOutputText(rsp) {
|
|
|
23059
23181
|
rsp.output_text = texts.join("");
|
|
23060
23182
|
}
|
|
23061
23183
|
|
|
23062
|
-
// node_modules/.pnpm/openai@
|
|
23184
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/responses/ResponseStream.mjs
|
|
23063
23185
|
var _ResponseStream_instances;
|
|
23064
23186
|
var _ResponseStream_params;
|
|
23065
23187
|
var _ResponseStream_currentResponseSnapshot;
|
|
@@ -23194,8 +23316,15 @@ class ResponseStream extends EventStream {
|
|
|
23194
23316
|
if (!output) {
|
|
23195
23317
|
throw new OpenAIError(`missing output at index ${event.output_index}`);
|
|
23196
23318
|
}
|
|
23197
|
-
|
|
23198
|
-
|
|
23319
|
+
const type = output.type;
|
|
23320
|
+
const part = event.part;
|
|
23321
|
+
if (type === "message" && part.type !== "reasoning_text") {
|
|
23322
|
+
output.content.push(part);
|
|
23323
|
+
} else if (type === "reasoning" && part.type === "reasoning_text") {
|
|
23324
|
+
if (!output.content) {
|
|
23325
|
+
output.content = [];
|
|
23326
|
+
}
|
|
23327
|
+
output.content.push(part);
|
|
23199
23328
|
}
|
|
23200
23329
|
break;
|
|
23201
23330
|
}
|
|
@@ -23226,6 +23355,23 @@ class ResponseStream extends EventStream {
|
|
|
23226
23355
|
}
|
|
23227
23356
|
break;
|
|
23228
23357
|
}
|
|
23358
|
+
case "response.reasoning_text.delta": {
|
|
23359
|
+
const output = snapshot.output[event.output_index];
|
|
23360
|
+
if (!output) {
|
|
23361
|
+
throw new OpenAIError(`missing output at index ${event.output_index}`);
|
|
23362
|
+
}
|
|
23363
|
+
if (output.type === "reasoning") {
|
|
23364
|
+
const content = output.content?.[event.content_index];
|
|
23365
|
+
if (!content) {
|
|
23366
|
+
throw new OpenAIError(`missing content at index ${event.content_index}`);
|
|
23367
|
+
}
|
|
23368
|
+
if (content.type !== "reasoning_text") {
|
|
23369
|
+
throw new OpenAIError(`expected content to be 'reasoning_text', got ${content.type}`);
|
|
23370
|
+
}
|
|
23371
|
+
content.text += event.delta;
|
|
23372
|
+
}
|
|
23373
|
+
break;
|
|
23374
|
+
}
|
|
23229
23375
|
case "response.completed": {
|
|
23230
23376
|
__classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, event.response, "f");
|
|
23231
23377
|
break;
|
|
@@ -23294,18 +23440,26 @@ function finalizeResponse(snapshot, params) {
|
|
|
23294
23440
|
return maybeParseResponse(snapshot, params);
|
|
23295
23441
|
}
|
|
23296
23442
|
|
|
23297
|
-
// node_modules/.pnpm/openai@
|
|
23443
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/responses/input-items.mjs
|
|
23298
23444
|
class InputItems extends APIResource {
|
|
23299
23445
|
list(responseID, query = {}, options) {
|
|
23300
23446
|
return this._client.getAPIList(path`/responses/${responseID}/input_items`, CursorPage, { query, ...options });
|
|
23301
23447
|
}
|
|
23302
23448
|
}
|
|
23303
23449
|
|
|
23304
|
-
// node_modules/.pnpm/openai@
|
|
23450
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/responses/input-tokens.mjs
|
|
23451
|
+
class InputTokens extends APIResource {
|
|
23452
|
+
count(body = {}, options) {
|
|
23453
|
+
return this._client.post("/responses/input_tokens", { body, ...options });
|
|
23454
|
+
}
|
|
23455
|
+
}
|
|
23456
|
+
|
|
23457
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/responses/responses.mjs
|
|
23305
23458
|
class Responses extends APIResource {
|
|
23306
23459
|
constructor() {
|
|
23307
23460
|
super(...arguments);
|
|
23308
23461
|
this.inputItems = new InputItems(this._client);
|
|
23462
|
+
this.inputTokens = new InputTokens(this._client);
|
|
23309
23463
|
}
|
|
23310
23464
|
create(body, options) {
|
|
23311
23465
|
return this._client.post("/responses", { body, ...options, stream: body.stream ?? false })._thenUnwrap((rsp) => {
|
|
@@ -23344,14 +23498,15 @@ class Responses extends APIResource {
|
|
|
23344
23498
|
}
|
|
23345
23499
|
}
|
|
23346
23500
|
Responses.InputItems = InputItems;
|
|
23347
|
-
|
|
23501
|
+
Responses.InputTokens = InputTokens;
|
|
23502
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/uploads/parts.mjs
|
|
23348
23503
|
class Parts extends APIResource {
|
|
23349
23504
|
create(uploadID, body, options) {
|
|
23350
23505
|
return this._client.post(path`/uploads/${uploadID}/parts`, multipartFormRequestOptions({ body, ...options }, this._client));
|
|
23351
23506
|
}
|
|
23352
23507
|
}
|
|
23353
23508
|
|
|
23354
|
-
// node_modules/.pnpm/openai@
|
|
23509
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/uploads/uploads.mjs
|
|
23355
23510
|
class Uploads extends APIResource {
|
|
23356
23511
|
constructor() {
|
|
23357
23512
|
super(...arguments);
|
|
@@ -23368,7 +23523,7 @@ class Uploads extends APIResource {
|
|
|
23368
23523
|
}
|
|
23369
23524
|
}
|
|
23370
23525
|
Uploads.Parts = Parts;
|
|
23371
|
-
// node_modules/.pnpm/openai@
|
|
23526
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/Util.mjs
|
|
23372
23527
|
var allSettledWithThrow = async (promises) => {
|
|
23373
23528
|
const results = await Promise.allSettled(promises);
|
|
23374
23529
|
const rejected = results.filter((result) => result.status === "rejected");
|
|
@@ -23387,7 +23542,7 @@ var allSettledWithThrow = async (promises) => {
|
|
|
23387
23542
|
return values2;
|
|
23388
23543
|
};
|
|
23389
23544
|
|
|
23390
|
-
// node_modules/.pnpm/openai@
|
|
23545
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/vector-stores/file-batches.mjs
|
|
23391
23546
|
class FileBatches extends APIResource {
|
|
23392
23547
|
create(vectorStoreID, body, options) {
|
|
23393
23548
|
return this._client.post(path`/vector_stores/${vectorStoreID}/file_batches`, {
|
|
@@ -23477,7 +23632,7 @@ class FileBatches extends APIResource {
|
|
|
23477
23632
|
}
|
|
23478
23633
|
}
|
|
23479
23634
|
|
|
23480
|
-
// node_modules/.pnpm/openai@
|
|
23635
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/vector-stores/files.mjs
|
|
23481
23636
|
class Files3 extends APIResource {
|
|
23482
23637
|
create(vectorStoreID, body, options) {
|
|
23483
23638
|
return this._client.post(path`/vector_stores/${vectorStoreID}/files`, {
|
|
@@ -23568,7 +23723,7 @@ class Files3 extends APIResource {
|
|
|
23568
23723
|
}
|
|
23569
23724
|
}
|
|
23570
23725
|
|
|
23571
|
-
// node_modules/.pnpm/openai@
|
|
23726
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/vector-stores/vector-stores.mjs
|
|
23572
23727
|
class VectorStores extends APIResource {
|
|
23573
23728
|
constructor() {
|
|
23574
23729
|
super(...arguments);
|
|
@@ -23619,7 +23774,33 @@ class VectorStores extends APIResource {
|
|
|
23619
23774
|
}
|
|
23620
23775
|
VectorStores.Files = Files3;
|
|
23621
23776
|
VectorStores.FileBatches = FileBatches;
|
|
23622
|
-
// node_modules/.pnpm/openai@
|
|
23777
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/videos.mjs
|
|
23778
|
+
class Videos extends APIResource {
|
|
23779
|
+
create(body, options) {
|
|
23780
|
+
return this._client.post("/videos", maybeMultipartFormRequestOptions({ body, ...options }, this._client));
|
|
23781
|
+
}
|
|
23782
|
+
retrieve(videoID, options) {
|
|
23783
|
+
return this._client.get(path`/videos/${videoID}`, options);
|
|
23784
|
+
}
|
|
23785
|
+
list(query = {}, options) {
|
|
23786
|
+
return this._client.getAPIList("/videos", ConversationCursorPage, { query, ...options });
|
|
23787
|
+
}
|
|
23788
|
+
delete(videoID, options) {
|
|
23789
|
+
return this._client.delete(path`/videos/${videoID}`, options);
|
|
23790
|
+
}
|
|
23791
|
+
downloadContent(videoID, query = {}, options) {
|
|
23792
|
+
return this._client.get(path`/videos/${videoID}/content`, {
|
|
23793
|
+
query,
|
|
23794
|
+
...options,
|
|
23795
|
+
headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]),
|
|
23796
|
+
__binaryResponse: true
|
|
23797
|
+
});
|
|
23798
|
+
}
|
|
23799
|
+
remix(videoID, body, options) {
|
|
23800
|
+
return this._client.post(path`/videos/${videoID}/remix`, maybeMultipartFormRequestOptions({ body, ...options }, this._client));
|
|
23801
|
+
}
|
|
23802
|
+
}
|
|
23803
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/webhooks.mjs
|
|
23623
23804
|
var _Webhooks_instances;
|
|
23624
23805
|
var _Webhooks_validateSecret;
|
|
23625
23806
|
var _Webhooks_getRequiredHeader;
|
|
@@ -23685,7 +23866,7 @@ _Webhooks_instances = new WeakSet, _Webhooks_validateSecret = function _Webhooks
|
|
|
23685
23866
|
}
|
|
23686
23867
|
return value;
|
|
23687
23868
|
};
|
|
23688
|
-
// node_modules/.pnpm/openai@
|
|
23869
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/client.mjs
|
|
23689
23870
|
var _OpenAI_instances;
|
|
23690
23871
|
var _a2;
|
|
23691
23872
|
var _OpenAI_encoder;
|
|
@@ -23711,10 +23892,13 @@ class OpenAI {
|
|
|
23711
23892
|
this.batches = new Batches(this);
|
|
23712
23893
|
this.uploads = new Uploads(this);
|
|
23713
23894
|
this.responses = new Responses(this);
|
|
23895
|
+
this.realtime = new Realtime2(this);
|
|
23896
|
+
this.conversations = new Conversations(this);
|
|
23714
23897
|
this.evals = new Evals(this);
|
|
23715
23898
|
this.containers = new Containers(this);
|
|
23899
|
+
this.videos = new Videos(this);
|
|
23716
23900
|
if (apiKey === undefined) {
|
|
23717
|
-
throw new OpenAIError("
|
|
23901
|
+
throw new OpenAIError("Missing credentials. Please pass an `apiKey`, or set the `OPENAI_API_KEY` environment variable.");
|
|
23718
23902
|
}
|
|
23719
23903
|
const options = {
|
|
23720
23904
|
apiKey,
|
|
@@ -23747,7 +23931,7 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
23747
23931
|
this.fetch = options.fetch ?? getDefaultFetch();
|
|
23748
23932
|
__classPrivateFieldSet(this, _OpenAI_encoder, FallbackEncoder, "f");
|
|
23749
23933
|
this._options = options;
|
|
23750
|
-
this.apiKey = apiKey;
|
|
23934
|
+
this.apiKey = typeof apiKey === "string" ? apiKey : "Missing Key";
|
|
23751
23935
|
this.organization = organization;
|
|
23752
23936
|
this.project = project;
|
|
23753
23937
|
this.webhookSecret = webhookSecret;
|
|
@@ -23791,6 +23975,24 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
23791
23975
|
makeStatusError(status, error2, message, headers) {
|
|
23792
23976
|
return APIError.generate(status, error2, message, headers);
|
|
23793
23977
|
}
|
|
23978
|
+
async _callApiKey() {
|
|
23979
|
+
const apiKey = this._options.apiKey;
|
|
23980
|
+
if (typeof apiKey !== "function")
|
|
23981
|
+
return false;
|
|
23982
|
+
let token;
|
|
23983
|
+
try {
|
|
23984
|
+
token = await apiKey();
|
|
23985
|
+
} catch (err) {
|
|
23986
|
+
if (err instanceof OpenAIError)
|
|
23987
|
+
throw err;
|
|
23988
|
+
throw new OpenAIError(`Failed to get token from 'apiKey' function: ${err.message}`, { cause: err });
|
|
23989
|
+
}
|
|
23990
|
+
if (typeof token !== "string" || !token) {
|
|
23991
|
+
throw new OpenAIError(`Expected 'apiKey' function argument to return a string but it returned ${token}`);
|
|
23992
|
+
}
|
|
23993
|
+
this.apiKey = token;
|
|
23994
|
+
return true;
|
|
23995
|
+
}
|
|
23794
23996
|
buildURL(path2, query, defaultBaseURL) {
|
|
23795
23997
|
const baseURL = !__classPrivateFieldGet(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
|
|
23796
23998
|
const url = isAbsoluteURL(path2) ? new URL(path2) : new URL(baseURL + (baseURL.endsWith("/") && path2.startsWith("/") ? path2.slice(1) : path2));
|
|
@@ -23803,7 +24005,9 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
23803
24005
|
}
|
|
23804
24006
|
return url.toString();
|
|
23805
24007
|
}
|
|
23806
|
-
async prepareOptions(options) {
|
|
24008
|
+
async prepareOptions(options) {
|
|
24009
|
+
await this._callApiKey();
|
|
24010
|
+
}
|
|
23807
24011
|
async prepareRequest(request, { url, options }) {}
|
|
23808
24012
|
get(path2, opts) {
|
|
23809
24013
|
return this.methodRequest("get", path2, opts);
|
|
@@ -23855,7 +24059,7 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
23855
24059
|
const controller = new AbortController;
|
|
23856
24060
|
const response = await this.fetchWithTimeout(url, req, timeout, controller).catch(castToError);
|
|
23857
24061
|
const headersTime = Date.now();
|
|
23858
|
-
if (response instanceof Error) {
|
|
24062
|
+
if (response instanceof globalThis.Error) {
|
|
23859
24063
|
const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;
|
|
23860
24064
|
if (options.signal?.aborted) {
|
|
23861
24065
|
throw new APIUserAbortError;
|
|
@@ -24054,7 +24258,7 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
24054
24258
|
return { bodyHeaders: undefined, body: undefined };
|
|
24055
24259
|
}
|
|
24056
24260
|
const headers = buildHeaders([rawHeaders]);
|
|
24057
|
-
if (ArrayBuffer.isView(body) || body instanceof ArrayBuffer || body instanceof DataView || typeof body === "string" && headers.values.has("content-type") || body instanceof Blob || body instanceof FormData || body instanceof URLSearchParams || globalThis.ReadableStream && body instanceof globalThis.ReadableStream) {
|
|
24261
|
+
if (ArrayBuffer.isView(body) || body instanceof ArrayBuffer || body instanceof DataView || typeof body === "string" && headers.values.has("content-type") || globalThis.Blob && body instanceof globalThis.Blob || body instanceof FormData || body instanceof URLSearchParams || globalThis.ReadableStream && body instanceof globalThis.ReadableStream) {
|
|
24058
24262
|
return { bodyHeaders: undefined, body };
|
|
24059
24263
|
} else if (typeof body === "object" && ((Symbol.asyncIterator in body) || (Symbol.iterator in body) && ("next" in body) && typeof body.next === "function")) {
|
|
24060
24264
|
return { bodyHeaders: undefined, body: ReadableStreamFrom(body) };
|
|
@@ -24099,9 +24303,12 @@ OpenAI.Beta = Beta;
|
|
|
24099
24303
|
OpenAI.Batches = Batches;
|
|
24100
24304
|
OpenAI.Uploads = Uploads;
|
|
24101
24305
|
OpenAI.Responses = Responses;
|
|
24306
|
+
OpenAI.Realtime = Realtime2;
|
|
24307
|
+
OpenAI.Conversations = Conversations;
|
|
24102
24308
|
OpenAI.Evals = Evals;
|
|
24103
24309
|
OpenAI.Containers = Containers;
|
|
24104
|
-
|
|
24310
|
+
OpenAI.Videos = Videos;
|
|
24311
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/azure.mjs
|
|
24105
24312
|
var _deployments_endpoints = new Set([
|
|
24106
24313
|
"/completions",
|
|
24107
24314
|
"/chat/completions",
|
|
@@ -24283,7 +24490,7 @@ class ModelScope extends BaseChat {
|
|
|
24283
24490
|
|
|
24284
24491
|
// src/provider/chat-adapter/dashscope.ts
|
|
24285
24492
|
class BailianChat extends BaseChat {
|
|
24286
|
-
static BASE_URL = "https://
|
|
24493
|
+
static BASE_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1";
|
|
24287
24494
|
constructor(options) {
|
|
24288
24495
|
const baseURL = options.baseURL || BailianChat.BASE_URL;
|
|
24289
24496
|
super({ ...options, baseURL });
|