@x-otto/cli 0.0.1-alpha.26 → 0.0.1-alpha.27
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/build-id-qqwcRIIo.js +3 -0
- package/dist/build-id-qqwcRIIo.js.map +1 -0
- package/dist/bundled-extensions/plugin-otto-wire-protocols/plugin-dist/plugin.cjs +191 -191
- package/dist/{command-dispatcher-EVWOCt5A.js → command-dispatcher-BAGD22R5.js} +6 -6
- package/dist/{command-dispatcher-EVWOCt5A.js.map → command-dispatcher-BAGD22R5.js.map} +1 -1
- package/dist/feedback-D-MbjPWK.js +2 -0
- package/dist/{feedback-Ck89ov3N.js → feedback-xqqf3WAI.js} +2 -2
- package/dist/{feedback-Ck89ov3N.js.map → feedback-xqqf3WAI.js.map} +1 -1
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/{parse-cli-B6VCNGky.js → parse-cli-zqdoXysv.js} +2 -2
- package/dist/{parse-cli-B6VCNGky.js.map → parse-cli-zqdoXysv.js.map} +1 -1
- package/dist/{version-Cgg1o8OT.js → version-D0-O45ux.js} +2 -2
- package/dist/{version-Cgg1o8OT.js.map → version-D0-O45ux.js.map} +1 -1
- package/package.json +13 -13
- package/dist/build-id-9kqUImot.js +0 -3
- package/dist/build-id-9kqUImot.js.map +0 -1
- package/dist/feedback-E_-kbQNN.js +0 -2
|
@@ -11812,8 +11812,8 @@ var require_util = __commonJS({
|
|
|
11812
11812
|
0
|
|
11813
11813
|
// 240-255
|
|
11814
11814
|
]);
|
|
11815
|
-
function isTokenCharCode(
|
|
11816
|
-
return validTokenChars[
|
|
11815
|
+
function isTokenCharCode(c) {
|
|
11816
|
+
return validTokenChars[c] === 1;
|
|
11817
11817
|
}
|
|
11818
11818
|
var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;
|
|
11819
11819
|
function isValidHTTPToken(characters) {
|
|
@@ -11869,16 +11869,16 @@ var require_util = __commonJS({
|
|
|
11869
11869
|
return noop3;
|
|
11870
11870
|
}
|
|
11871
11871
|
let s1 = null;
|
|
11872
|
-
let
|
|
11872
|
+
let s2 = null;
|
|
11873
11873
|
const fastTimer = timers.setFastTimeout(() => {
|
|
11874
11874
|
s1 = setImmediate(() => {
|
|
11875
|
-
|
|
11875
|
+
s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts));
|
|
11876
11876
|
});
|
|
11877
11877
|
}, opts.timeout);
|
|
11878
11878
|
return () => {
|
|
11879
11879
|
timers.clearFastTimeout(fastTimer);
|
|
11880
11880
|
clearImmediate(s1);
|
|
11881
|
-
clearImmediate(
|
|
11881
|
+
clearImmediate(s2);
|
|
11882
11882
|
};
|
|
11883
11883
|
} : (socketWeakRef, opts) => {
|
|
11884
11884
|
if (!opts.timeout) {
|
|
@@ -13606,7 +13606,7 @@ var require_constants2 = __commonJS({
|
|
|
13606
13606
|
exports2.HEADER_CHARS.push(i2);
|
|
13607
13607
|
}
|
|
13608
13608
|
}
|
|
13609
|
-
exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS.filter((
|
|
13609
|
+
exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS.filter((c) => c !== 44);
|
|
13610
13610
|
exports2.QUOTED_STRING = [" ", " "];
|
|
13611
13611
|
for (let i2 = 33; i2 <= 255; i2++) {
|
|
13612
13612
|
if (i2 !== 34 && i2 !== 92) {
|
|
@@ -14415,7 +14415,7 @@ var require_webidl = __commonJS({
|
|
|
14415
14415
|
}
|
|
14416
14416
|
};
|
|
14417
14417
|
webidl.brandCheckMultiple = function(List) {
|
|
14418
|
-
const prototypes = List.map((
|
|
14418
|
+
const prototypes = List.map((c) => webidl.util.MakeTypeAssertion(c));
|
|
14419
14419
|
return (V3) => {
|
|
14420
14420
|
if (prototypes.every((typeCheck) => !typeCheck(V3))) {
|
|
14421
14421
|
const err = new TypeError("Illegal invocation");
|
|
@@ -14474,8 +14474,8 @@ var require_webidl = __commonJS({
|
|
|
14474
14474
|
NULL,
|
|
14475
14475
|
OBJECT
|
|
14476
14476
|
};
|
|
14477
|
-
webidl.util.TypeValueToString = function(
|
|
14478
|
-
switch (webidl.util.Type(
|
|
14477
|
+
webidl.util.TypeValueToString = function(o2) {
|
|
14478
|
+
switch (webidl.util.Type(o2)) {
|
|
14479
14479
|
case UNDEFINED:
|
|
14480
14480
|
return "Undefined";
|
|
14481
14481
|
case BOOLEAN:
|
|
@@ -14658,7 +14658,7 @@ var require_webidl = __commonJS({
|
|
|
14658
14658
|
};
|
|
14659
14659
|
};
|
|
14660
14660
|
webidl.dictionaryConverter = function(converters) {
|
|
14661
|
-
converters.sort((
|
|
14661
|
+
converters.sort((a2, b3) => (a2.key > b3.key) - (a2.key < b3.key));
|
|
14662
14662
|
return (dictionary, prefix, argument) => {
|
|
14663
14663
|
const dict = {};
|
|
14664
14664
|
if (dictionary != null && webidl.util.Type(dictionary) !== OBJECT) {
|
|
@@ -15033,10 +15033,10 @@ var require_util2 = __commonJS({
|
|
|
15033
15033
|
}
|
|
15034
15034
|
function isValidReasonPhrase(statusText) {
|
|
15035
15035
|
for (let i2 = 0; i2 < statusText.length; ++i2) {
|
|
15036
|
-
const
|
|
15037
|
-
if (!(
|
|
15038
|
-
|
|
15039
|
-
|
|
15036
|
+
const c = statusText.charCodeAt(i2);
|
|
15037
|
+
if (!(c === 9 || // HTAB
|
|
15038
|
+
c >= 32 && c <= 126 || // SP / VCHAR
|
|
15039
|
+
c >= 128 && c <= 255)) {
|
|
15040
15040
|
return false;
|
|
15041
15041
|
}
|
|
15042
15042
|
}
|
|
@@ -15908,17 +15908,17 @@ var require_formdata = __commonJS({
|
|
|
15908
15908
|
}
|
|
15909
15909
|
}
|
|
15910
15910
|
[nodeUtil.inspect.custom](depth, options) {
|
|
15911
|
-
const state = this.#state.reduce((
|
|
15912
|
-
if (
|
|
15913
|
-
if (Array.isArray(
|
|
15914
|
-
|
|
15911
|
+
const state = this.#state.reduce((a2, b3) => {
|
|
15912
|
+
if (a2[b3.name]) {
|
|
15913
|
+
if (Array.isArray(a2[b3.name])) {
|
|
15914
|
+
a2[b3.name].push(b3.value);
|
|
15915
15915
|
} else {
|
|
15916
|
-
|
|
15916
|
+
a2[b3.name] = [a2[b3.name], b3.value];
|
|
15917
15917
|
}
|
|
15918
15918
|
} else {
|
|
15919
|
-
|
|
15919
|
+
a2[b3.name] = b3.value;
|
|
15920
15920
|
}
|
|
15921
|
-
return
|
|
15921
|
+
return a2;
|
|
15922
15922
|
}, { __proto__: null });
|
|
15923
15923
|
options.depth ??= depth;
|
|
15924
15924
|
options.colors ??= true;
|
|
@@ -16356,8 +16356,8 @@ var require_body = __commonJS({
|
|
|
16356
16356
|
stream = new ReadableStream({
|
|
16357
16357
|
pull() {
|
|
16358
16358
|
},
|
|
16359
|
-
start(
|
|
16360
|
-
controller =
|
|
16359
|
+
start(c) {
|
|
16360
|
+
controller = c;
|
|
16361
16361
|
},
|
|
16362
16362
|
cancel() {
|
|
16363
16363
|
},
|
|
@@ -16549,8 +16549,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
16549
16549
|
if (this_.body == null) {
|
|
16550
16550
|
let controller;
|
|
16551
16551
|
const emptyStream = new ReadableStream({
|
|
16552
|
-
start: (
|
|
16553
|
-
controller =
|
|
16552
|
+
start: (c) => {
|
|
16553
|
+
controller = c;
|
|
16554
16554
|
},
|
|
16555
16555
|
pull: () => Promise.resolve(),
|
|
16556
16556
|
cancel: () => Promise.resolve()
|
|
@@ -16707,7 +16707,7 @@ var require_client_h1 = __commonJS({
|
|
|
16707
16707
|
* @param {number} len
|
|
16708
16708
|
* @returns {number}
|
|
16709
16709
|
*/
|
|
16710
|
-
wasm_on_url: (
|
|
16710
|
+
wasm_on_url: (p2, at, len) => {
|
|
16711
16711
|
return 0;
|
|
16712
16712
|
},
|
|
16713
16713
|
/**
|
|
@@ -16716,8 +16716,8 @@ var require_client_h1 = __commonJS({
|
|
|
16716
16716
|
* @param {number} len
|
|
16717
16717
|
* @returns {number}
|
|
16718
16718
|
*/
|
|
16719
|
-
wasm_on_status: (
|
|
16720
|
-
assert(currentParser.ptr ===
|
|
16719
|
+
wasm_on_status: (p2, at, len) => {
|
|
16720
|
+
assert(currentParser.ptr === p2);
|
|
16721
16721
|
const start = at - currentBufferPtr + currentBufferRef.byteOffset;
|
|
16722
16722
|
return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
16723
16723
|
},
|
|
@@ -16725,8 +16725,8 @@ var require_client_h1 = __commonJS({
|
|
|
16725
16725
|
* @param {number} p
|
|
16726
16726
|
* @returns {number}
|
|
16727
16727
|
*/
|
|
16728
|
-
wasm_on_message_begin: (
|
|
16729
|
-
assert(currentParser.ptr ===
|
|
16728
|
+
wasm_on_message_begin: (p2) => {
|
|
16729
|
+
assert(currentParser.ptr === p2);
|
|
16730
16730
|
return currentParser.onMessageBegin();
|
|
16731
16731
|
},
|
|
16732
16732
|
/**
|
|
@@ -16735,8 +16735,8 @@ var require_client_h1 = __commonJS({
|
|
|
16735
16735
|
* @param {number} len
|
|
16736
16736
|
* @returns {number}
|
|
16737
16737
|
*/
|
|
16738
|
-
wasm_on_header_field: (
|
|
16739
|
-
assert(currentParser.ptr ===
|
|
16738
|
+
wasm_on_header_field: (p2, at, len) => {
|
|
16739
|
+
assert(currentParser.ptr === p2);
|
|
16740
16740
|
const start = at - currentBufferPtr + currentBufferRef.byteOffset;
|
|
16741
16741
|
return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
16742
16742
|
},
|
|
@@ -16746,8 +16746,8 @@ var require_client_h1 = __commonJS({
|
|
|
16746
16746
|
* @param {number} len
|
|
16747
16747
|
* @returns {number}
|
|
16748
16748
|
*/
|
|
16749
|
-
wasm_on_header_value: (
|
|
16750
|
-
assert(currentParser.ptr ===
|
|
16749
|
+
wasm_on_header_value: (p2, at, len) => {
|
|
16750
|
+
assert(currentParser.ptr === p2);
|
|
16751
16751
|
const start = at - currentBufferPtr + currentBufferRef.byteOffset;
|
|
16752
16752
|
return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
16753
16753
|
},
|
|
@@ -16758,8 +16758,8 @@ var require_client_h1 = __commonJS({
|
|
|
16758
16758
|
* @param {0|1} shouldKeepAlive
|
|
16759
16759
|
* @returns {number}
|
|
16760
16760
|
*/
|
|
16761
|
-
wasm_on_headers_complete: (
|
|
16762
|
-
assert(currentParser.ptr ===
|
|
16761
|
+
wasm_on_headers_complete: (p2, statusCode, upgrade, shouldKeepAlive) => {
|
|
16762
|
+
assert(currentParser.ptr === p2);
|
|
16763
16763
|
return currentParser.onHeadersComplete(statusCode, upgrade === 1, shouldKeepAlive === 1);
|
|
16764
16764
|
},
|
|
16765
16765
|
/**
|
|
@@ -16768,8 +16768,8 @@ var require_client_h1 = __commonJS({
|
|
|
16768
16768
|
* @param {number} len
|
|
16769
16769
|
* @returns {number}
|
|
16770
16770
|
*/
|
|
16771
|
-
wasm_on_body: (
|
|
16772
|
-
assert(currentParser.ptr ===
|
|
16771
|
+
wasm_on_body: (p2, at, len) => {
|
|
16772
|
+
assert(currentParser.ptr === p2);
|
|
16773
16773
|
const start = at - currentBufferPtr + currentBufferRef.byteOffset;
|
|
16774
16774
|
return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
16775
16775
|
},
|
|
@@ -16777,8 +16777,8 @@ var require_client_h1 = __commonJS({
|
|
|
16777
16777
|
* @param {number} p
|
|
16778
16778
|
* @returns {number}
|
|
16779
16779
|
*/
|
|
16780
|
-
wasm_on_message_complete: (
|
|
16781
|
-
assert(currentParser.ptr ===
|
|
16780
|
+
wasm_on_message_complete: (p2) => {
|
|
16781
|
+
assert(currentParser.ptr === p2);
|
|
16782
16782
|
return currentParser.onMessageComplete();
|
|
16783
16783
|
}
|
|
16784
16784
|
}
|
|
@@ -20006,14 +20006,14 @@ var require_balanced_pool = __commonJS({
|
|
|
20006
20006
|
var kWeight = /* @__PURE__ */ Symbol("kWeight");
|
|
20007
20007
|
var kMaxWeightPerServer = /* @__PURE__ */ Symbol("kMaxWeightPerServer");
|
|
20008
20008
|
var kErrorPenalty = /* @__PURE__ */ Symbol("kErrorPenalty");
|
|
20009
|
-
function getGreatestCommonDivisor(
|
|
20010
|
-
if (
|
|
20009
|
+
function getGreatestCommonDivisor(a2, b3) {
|
|
20010
|
+
if (a2 === 0) return b3;
|
|
20011
20011
|
while (b3 !== 0) {
|
|
20012
20012
|
const t3 = b3;
|
|
20013
|
-
b3 =
|
|
20014
|
-
|
|
20013
|
+
b3 = a2 % b3;
|
|
20014
|
+
a2 = t3;
|
|
20015
20015
|
}
|
|
20016
|
-
return
|
|
20016
|
+
return a2;
|
|
20017
20017
|
}
|
|
20018
20018
|
function defaultFactory(origin, opts) {
|
|
20019
20019
|
return new Pool(origin, opts);
|
|
@@ -20085,7 +20085,7 @@ var require_balanced_pool = __commonJS({
|
|
|
20085
20085
|
return this[kClients].find((pool) => pool[kUrl].origin === upstreamOrigin && pool.closed !== true && pool.destroyed !== true);
|
|
20086
20086
|
}
|
|
20087
20087
|
get upstreams() {
|
|
20088
|
-
return this[kClients].filter((dispatcher) => dispatcher.closed !== true && dispatcher.destroyed !== true).map((
|
|
20088
|
+
return this[kClients].filter((dispatcher) => dispatcher.closed !== true && dispatcher.destroyed !== true).map((p2) => p2[kUrl].origin);
|
|
20089
20089
|
}
|
|
20090
20090
|
[kGetDispatcher]() {
|
|
20091
20091
|
if (this[kClients].length === 0) {
|
|
@@ -29082,8 +29082,8 @@ var require_headers = __commonJS({
|
|
|
29082
29082
|
}
|
|
29083
29083
|
return headersList.sortedMap = headers;
|
|
29084
29084
|
}
|
|
29085
|
-
function compareHeaderName(
|
|
29086
|
-
return
|
|
29085
|
+
function compareHeaderName(a2, b3) {
|
|
29086
|
+
return a2[0] < b3[0] ? -1 : 1;
|
|
29087
29087
|
}
|
|
29088
29088
|
var HeadersList = class _HeadersList {
|
|
29089
29089
|
/** @type {[string, string][]|null} */
|
|
@@ -29373,17 +29373,17 @@ var require_headers = __commonJS({
|
|
|
29373
29373
|
options.depth ??= depth;
|
|
29374
29374
|
return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`;
|
|
29375
29375
|
}
|
|
29376
|
-
static getHeadersGuard(
|
|
29377
|
-
return
|
|
29376
|
+
static getHeadersGuard(o2) {
|
|
29377
|
+
return o2.#guard;
|
|
29378
29378
|
}
|
|
29379
|
-
static setHeadersGuard(
|
|
29380
|
-
|
|
29379
|
+
static setHeadersGuard(o2, guard) {
|
|
29380
|
+
o2.#guard = guard;
|
|
29381
29381
|
}
|
|
29382
29382
|
/**
|
|
29383
29383
|
* @param {Headers} o
|
|
29384
29384
|
*/
|
|
29385
|
-
static getHeadersList(
|
|
29386
|
-
return
|
|
29385
|
+
static getHeadersList(o2) {
|
|
29386
|
+
return o2.#headersList;
|
|
29387
29387
|
}
|
|
29388
29388
|
/**
|
|
29389
29389
|
* @param {Headers} target
|
|
@@ -29724,12 +29724,12 @@ var require_response = __commonJS({
|
|
|
29724
29724
|
...state
|
|
29725
29725
|
};
|
|
29726
29726
|
return new Proxy(response, {
|
|
29727
|
-
get(target,
|
|
29728
|
-
return
|
|
29727
|
+
get(target, p2) {
|
|
29728
|
+
return p2 in state ? state[p2] : target[p2];
|
|
29729
29729
|
},
|
|
29730
|
-
set(target,
|
|
29731
|
-
assert(!(
|
|
29732
|
-
target[
|
|
29730
|
+
set(target, p2, value) {
|
|
29731
|
+
assert(!(p2 in state));
|
|
29732
|
+
target[p2] = value;
|
|
29733
29733
|
return true;
|
|
29734
29734
|
}
|
|
29735
29735
|
});
|
|
@@ -30917,18 +30917,18 @@ var require_fetch = __commonJS({
|
|
|
30917
30917
|
}
|
|
30918
30918
|
function fetch2(input, init = void 0) {
|
|
30919
30919
|
webidl.argumentLengthCheck(arguments, 1, "globalThis.fetch");
|
|
30920
|
-
let
|
|
30920
|
+
let p2 = Promise.withResolvers();
|
|
30921
30921
|
let requestObject;
|
|
30922
30922
|
try {
|
|
30923
30923
|
requestObject = new Request(input, init);
|
|
30924
30924
|
} catch (e4) {
|
|
30925
|
-
|
|
30926
|
-
return
|
|
30925
|
+
p2.reject(e4);
|
|
30926
|
+
return p2.promise;
|
|
30927
30927
|
}
|
|
30928
30928
|
const request = getRequestState(requestObject);
|
|
30929
30929
|
if (requestObject.signal.aborted) {
|
|
30930
|
-
abortFetch(
|
|
30931
|
-
return
|
|
30930
|
+
abortFetch(p2, request, null, requestObject.signal.reason, null);
|
|
30931
|
+
return p2.promise;
|
|
30932
30932
|
}
|
|
30933
30933
|
const globalObject = request.client.globalObject;
|
|
30934
30934
|
if (globalObject?.constructor?.name === "ServiceWorkerGlobalScope") {
|
|
@@ -30944,7 +30944,7 @@ var require_fetch = __commonJS({
|
|
|
30944
30944
|
assert(controller != null);
|
|
30945
30945
|
controller.abort(requestObject.signal.reason);
|
|
30946
30946
|
const realResponse = responseObject?.deref();
|
|
30947
|
-
abortFetch(
|
|
30947
|
+
abortFetch(p2, request, realResponse, requestObject.signal.reason, controller.controller);
|
|
30948
30948
|
}
|
|
30949
30949
|
);
|
|
30950
30950
|
const cleanupAbortListeners = () => {
|
|
@@ -30956,18 +30956,18 @@ var require_fetch = __commonJS({
|
|
|
30956
30956
|
return;
|
|
30957
30957
|
}
|
|
30958
30958
|
if (response.aborted) {
|
|
30959
|
-
abortFetch(
|
|
30959
|
+
abortFetch(p2, request, responseObject, controller.serializedAbortReason, controller.controller);
|
|
30960
30960
|
cleanupAbortListeners();
|
|
30961
30961
|
return;
|
|
30962
30962
|
}
|
|
30963
30963
|
if (response.type === "error") {
|
|
30964
|
-
|
|
30964
|
+
p2.reject(new TypeError("fetch failed", { cause: response.error }));
|
|
30965
30965
|
cleanupAbortListeners();
|
|
30966
30966
|
return;
|
|
30967
30967
|
}
|
|
30968
30968
|
responseObject = new WeakRef(fromInnerResponse(response, "immutable"));
|
|
30969
|
-
|
|
30970
|
-
|
|
30969
|
+
p2.resolve(responseObject.deref());
|
|
30970
|
+
p2 = null;
|
|
30971
30971
|
};
|
|
30972
30972
|
controller = fetching({
|
|
30973
30973
|
request,
|
|
@@ -30982,7 +30982,7 @@ var require_fetch = __commonJS({
|
|
|
30982
30982
|
// See https://github.com/nodejs/undici/issues/4627
|
|
30983
30983
|
requestObject
|
|
30984
30984
|
});
|
|
30985
|
-
return
|
|
30985
|
+
return p2.promise;
|
|
30986
30986
|
}
|
|
30987
30987
|
function finalizeAndReportTiming(response, initiatorType = "other") {
|
|
30988
30988
|
if (response.type === "error" && response.aborted) {
|
|
@@ -31020,9 +31020,9 @@ var require_fetch = __commonJS({
|
|
|
31020
31020
|
);
|
|
31021
31021
|
}
|
|
31022
31022
|
var markResourceTiming = performance.markResourceTiming;
|
|
31023
|
-
function abortFetch(
|
|
31024
|
-
if (
|
|
31025
|
-
|
|
31023
|
+
function abortFetch(p2, request, responseObject, error, controller) {
|
|
31024
|
+
if (p2) {
|
|
31025
|
+
p2.reject(error);
|
|
31026
31026
|
}
|
|
31027
31027
|
if (request.body?.stream != null && isReadable(request.body.stream)) {
|
|
31028
31028
|
request.body.stream.cancel(error).catch((err) => {
|
|
@@ -31997,11 +31997,11 @@ var require_cache3 = __commonJS({
|
|
|
31997
31997
|
webidl.argumentLengthCheck(arguments, 1, prefix);
|
|
31998
31998
|
request = webidl.converters.RequestInfo(request);
|
|
31999
31999
|
options = webidl.converters.CacheQueryOptions(options, prefix, "options");
|
|
32000
|
-
const
|
|
32001
|
-
if (
|
|
32000
|
+
const p2 = this.#internalMatchAll(request, options, 1);
|
|
32001
|
+
if (p2.length === 0) {
|
|
32002
32002
|
return;
|
|
32003
32003
|
}
|
|
32004
|
-
return
|
|
32004
|
+
return p2[0];
|
|
32005
32005
|
}
|
|
32006
32006
|
async matchAll(request = void 0, options = {}) {
|
|
32007
32007
|
webidl.brandCheck(this, _Cache);
|
|
@@ -32092,8 +32092,8 @@ var require_cache3 = __commonJS({
|
|
|
32092
32092
|
}));
|
|
32093
32093
|
responsePromises.push(responsePromise.promise);
|
|
32094
32094
|
}
|
|
32095
|
-
const
|
|
32096
|
-
const responses = await
|
|
32095
|
+
const p2 = Promise.all(responsePromises);
|
|
32096
|
+
const responses = await p2;
|
|
32097
32097
|
const operations = [];
|
|
32098
32098
|
let index = 0;
|
|
32099
32099
|
for (const response of responses) {
|
|
@@ -34474,10 +34474,10 @@ var require_websocket = __commonJS({
|
|
|
34474
34474
|
if (typeof protocols === "string") {
|
|
34475
34475
|
protocols = [protocols];
|
|
34476
34476
|
}
|
|
34477
|
-
if (protocols.length !== new Set(protocols.map((
|
|
34477
|
+
if (protocols.length !== new Set(protocols.map((p2) => p2.toLowerCase())).size) {
|
|
34478
34478
|
throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError");
|
|
34479
34479
|
}
|
|
34480
|
-
if (protocols.length > 0 && !protocols.every((
|
|
34480
|
+
if (protocols.length > 0 && !protocols.every((p2) => isValidSubprotocol(p2))) {
|
|
34481
34481
|
throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError");
|
|
34482
34482
|
}
|
|
34483
34483
|
this.#url = new URL(urlRecord.href);
|
|
@@ -35016,10 +35016,10 @@ var require_websocketstream = __commonJS({
|
|
|
35016
35016
|
const baseURL = environmentSettingsObject.settingsObject.baseUrl;
|
|
35017
35017
|
const urlRecord = getURLRecord(url, baseURL);
|
|
35018
35018
|
const protocols = options.protocols;
|
|
35019
|
-
if (protocols.length !== new Set(protocols.map((
|
|
35019
|
+
if (protocols.length !== new Set(protocols.map((p2) => p2.toLowerCase())).size) {
|
|
35020
35020
|
throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError");
|
|
35021
35021
|
}
|
|
35022
|
-
if (protocols.length > 0 && !protocols.every((
|
|
35022
|
+
if (protocols.length > 0 && !protocols.every((p2) => isValidSubprotocol(p2))) {
|
|
35023
35023
|
throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError");
|
|
35024
35024
|
}
|
|
35025
35025
|
this.#url = urlRecord.toString();
|
|
@@ -36138,27 +36138,27 @@ __export(plugin_exports, {
|
|
|
36138
36138
|
module.exports = __toCommonJS(plugin_exports);
|
|
36139
36139
|
|
|
36140
36140
|
// otto-sdk-shim:otto-plugin-sdk
|
|
36141
|
-
var definePlugin = (
|
|
36141
|
+
var definePlugin = (f2) => f2;
|
|
36142
36142
|
|
|
36143
36143
|
// ../../extensions/plugin-otto-wire-protocols/src/anthropic-messages.ts
|
|
36144
36144
|
var import_node_crypto = require("node:crypto");
|
|
36145
36145
|
|
|
36146
36146
|
// ../../node_modules/.pnpm/@anthropic-ai+sdk@0.88.0_zod@4.4.3/node_modules/@anthropic-ai/sdk/internal/tslib.mjs
|
|
36147
|
-
function __classPrivateFieldSet(receiver, state, value, kind,
|
|
36147
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f2) {
|
|
36148
36148
|
if (kind === "m")
|
|
36149
36149
|
throw new TypeError("Private method is not writable");
|
|
36150
|
-
if (kind === "a" && !
|
|
36150
|
+
if (kind === "a" && !f2)
|
|
36151
36151
|
throw new TypeError("Private accessor was defined without a setter");
|
|
36152
|
-
if (typeof state === "function" ? receiver !== state || !
|
|
36152
|
+
if (typeof state === "function" ? receiver !== state || !f2 : !state.has(receiver))
|
|
36153
36153
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
36154
|
-
return kind === "a" ?
|
|
36154
|
+
return kind === "a" ? f2.call(receiver, value) : f2 ? f2.value = value : state.set(receiver, value), value;
|
|
36155
36155
|
}
|
|
36156
|
-
function __classPrivateFieldGet(receiver, state, kind,
|
|
36157
|
-
if (kind === "a" && !
|
|
36156
|
+
function __classPrivateFieldGet(receiver, state, kind, f2) {
|
|
36157
|
+
if (kind === "a" && !f2)
|
|
36158
36158
|
throw new TypeError("Private accessor was defined without a getter");
|
|
36159
|
-
if (typeof state === "function" ? receiver !== state || !
|
|
36159
|
+
if (typeof state === "function" ? receiver !== state || !f2 : !state.has(receiver))
|
|
36160
36160
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
36161
|
-
return kind === "m" ?
|
|
36161
|
+
return kind === "m" ? f2 : kind === "a" ? f2.call(receiver) : f2 ? f2.value : state.get(receiver);
|
|
36162
36162
|
}
|
|
36163
36163
|
|
|
36164
36164
|
// ../../node_modules/.pnpm/@anthropic-ai+sdk@0.88.0_zod@4.4.3/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs
|
|
@@ -36170,7 +36170,7 @@ var uuid4 = function() {
|
|
|
36170
36170
|
}
|
|
36171
36171
|
const u8 = new Uint8Array(1);
|
|
36172
36172
|
const randomByte = crypto ? () => crypto.getRandomValues(u8)[0] : () => Math.random() * 255 & 255;
|
|
36173
|
-
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (
|
|
36173
|
+
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ randomByte() & 15 >> +c / 4).toString(16));
|
|
36174
36174
|
};
|
|
36175
36175
|
|
|
36176
36176
|
// ../../node_modules/.pnpm/@anthropic-ai+sdk@0.88.0_zod@4.4.3/node_modules/@anthropic-ai/sdk/internal/errors.mjs
|
|
@@ -37074,7 +37074,7 @@ var APIPromise = class _APIPromise extends Promise {
|
|
|
37074
37074
|
* to your `tsconfig.json`.
|
|
37075
37075
|
*/
|
|
37076
37076
|
asResponse() {
|
|
37077
|
-
return this.responsePromise.then((
|
|
37077
|
+
return this.responsePromise.then((p2) => p2.response);
|
|
37078
37078
|
}
|
|
37079
37079
|
/**
|
|
37080
37080
|
* Gets the parsed response data, the raw `Response` instance and the ID of the request,
|
|
@@ -37366,7 +37366,7 @@ function propsForError(value) {
|
|
|
37366
37366
|
if (typeof value !== "object" || value === null)
|
|
37367
37367
|
return "";
|
|
37368
37368
|
const props = Object.getOwnPropertyNames(value);
|
|
37369
|
-
return `; props: [${props.map((
|
|
37369
|
+
return `; props: [${props.map((p2) => `"${p2}"`).join(", ")}]`;
|
|
37370
37370
|
}
|
|
37371
37371
|
|
|
37372
37372
|
// ../../node_modules/.pnpm/@anthropic-ai+sdk@0.88.0_zod@4.4.3/node_modules/@anthropic-ai/sdk/core/resource.mjs
|
|
@@ -37476,7 +37476,7 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path2(stat
|
|
|
37476
37476
|
error: `Value "${match[0]}" can't be safely passed as a path parameter`
|
|
37477
37477
|
});
|
|
37478
37478
|
}
|
|
37479
|
-
invalidSegments.sort((
|
|
37479
|
+
invalidSegments.sort((a2, b3) => a2.start - b3.start);
|
|
37480
37480
|
if (invalidSegments.length > 0) {
|
|
37481
37481
|
let lastEnd = 0;
|
|
37482
37482
|
const underline = invalidSegments.reduce((acc, segment) => {
|
|
@@ -42198,8 +42198,8 @@ function Ne() {
|
|
|
42198
42198
|
function Pe(e4, t3) {
|
|
42199
42199
|
let n3 = Ae(), r3 = Me(), i2 = { target: n3 ? `pino-pretty` : `pino/file`, options: n3 ? { colorize: true, destination: 2 } : { destination: 2 }, level: t3 };
|
|
42200
42200
|
if (!e4 || e4 === `stdout` || e4 === `stderr`) return r3 ? [{ target: `pino/file`, options: { destination: Ne(), mkdir: true }, level: t3 }] : [i2];
|
|
42201
|
-
let
|
|
42202
|
-
return r3 ? [
|
|
42201
|
+
let a2 = { target: `pino/file`, options: { destination: je(e4), mkdir: true }, level: t3 };
|
|
42202
|
+
return r3 ? [a2] : [a2, i2];
|
|
42203
42203
|
}
|
|
42204
42204
|
var E2 = new import_node_stream.PassThrough();
|
|
42205
42205
|
var Fe = new t();
|
|
@@ -42253,43 +42253,43 @@ function St(e4) {
|
|
|
42253
42253
|
return typeof t3 == `object` && t3 && `kind` in t3 ? t3.kind : `external`;
|
|
42254
42254
|
}
|
|
42255
42255
|
async function* Ct(e4) {
|
|
42256
|
-
let { url: t3, method: n3 = `POST`, headers: r3 = {}, body: i2, signal:
|
|
42257
|
-
|
|
42256
|
+
let { url: t3, method: n3 = `POST`, headers: r3 = {}, body: i2, signal: a2 } = e4, { timeout: o2, idleTimeout: s2, firstTokenIdleTimeout: c } = xt(e4), l2 = new AbortController(), u3 = a2 ? AbortSignal.any([a2, l2.signal]) : l2.signal, d2 = setTimeout(() => l2.abort(yt), o2), f2, p2 = false, m = () => {
|
|
42257
|
+
f2 && clearTimeout(f2), f2 = setTimeout(() => l2.abort(vt), bt(p2, { idleTimeout: s2, firstTokenIdleTimeout: c }));
|
|
42258
42258
|
}, h2;
|
|
42259
42259
|
try {
|
|
42260
|
-
let
|
|
42261
|
-
if (!
|
|
42262
|
-
let e5 = await
|
|
42263
|
-
|
|
42260
|
+
let a3 = I2(e4.proxy), o3 = { method: n3, headers: { "content-type": `application/json`, accept: `text/event-stream`, ...r3 }, body: i2 ? typeof i2 == `string` ? i2 : JSON.stringify(i2) : void 0, signal: u3 }, s3 = await fetch(t3, a3 ? { ...o3, dispatcher: a3 } : o3);
|
|
42261
|
+
if (!s3.ok) {
|
|
42262
|
+
let e5 = await s3.text(), t4 = `BAD_RESPONSE`;
|
|
42263
|
+
s3.status === 429 ? t4 = `RATE_LIMIT` : s3.status === 529 ? t4 = `OVERLOADED` : s3.status >= 500 ? t4 = `SERVER_ERROR` : s3.status >= 400 && (t4 = `REQUEST_ERROR`);
|
|
42264
42264
|
let n4;
|
|
42265
42265
|
try {
|
|
42266
42266
|
let t5 = JSON.parse(e5)?.error;
|
|
42267
42267
|
n4 = t5?.code ?? t5?.type;
|
|
42268
42268
|
} catch {
|
|
42269
42269
|
}
|
|
42270
|
-
throw new S(`Http request failed ${
|
|
42270
|
+
throw new S(`Http request failed ${s3.status}: ${e5}`, { code: t4, status: s3.status, headers: s3.headers, errorType: n4 });
|
|
42271
42271
|
}
|
|
42272
|
-
if (e4.onResponse?.(
|
|
42273
|
-
h2 =
|
|
42274
|
-
let
|
|
42272
|
+
if (e4.onResponse?.(s3.headers), !s3.body) throw new S(`Response body is empty`, { code: `BAD_RESPONSE` });
|
|
42273
|
+
h2 = s3.body.getReader();
|
|
42274
|
+
let c2 = new TextDecoder(), l3 = [], d3 = createParser({ onEvent(e5) {
|
|
42275
42275
|
l3.push({ event: e5.event || void 0, data: e5.data, id: e5.id || void 0 });
|
|
42276
42276
|
} });
|
|
42277
42277
|
for (m(); ; ) {
|
|
42278
42278
|
let { done: e5, value: t4 } = await h2.read();
|
|
42279
42279
|
if (e5) break;
|
|
42280
|
-
for (m(),
|
|
42280
|
+
for (m(), d3.feed(c2.decode(t4, { stream: true })); l3.length > 0; ) {
|
|
42281
42281
|
let e6 = l3.shift();
|
|
42282
|
-
e6 && (
|
|
42282
|
+
e6 && (p2 || (p2 = true, m()), yield e6);
|
|
42283
42283
|
}
|
|
42284
42284
|
}
|
|
42285
|
-
for (
|
|
42285
|
+
for (d3.feed(c2.decode()); l3.length > 0; ) {
|
|
42286
42286
|
let e5 = l3.shift();
|
|
42287
|
-
e5 && (
|
|
42287
|
+
e5 && (p2 || (p2 = true, m()), yield e5);
|
|
42288
42288
|
}
|
|
42289
42289
|
} catch (e5) {
|
|
42290
42290
|
throw e5 instanceof S ? e5 : l2.signal.aborted || e5 instanceof DOMException && e5.name === `AbortError` ? new S(`Stream aborted or timed out`, { code: `TIMEOUT`, cause: e5 instanceof Error ? e5 : Error(String(e5)), abortKind: St(l2) }) : new S(`Stream request failed`, { code: `NETWORK_ERROR`, cause: e5 instanceof Error ? e5 : Error(String(e5)) });
|
|
42291
42291
|
} finally {
|
|
42292
|
-
clearTimeout(
|
|
42292
|
+
clearTimeout(d2), f2 && clearTimeout(f2), h2 && h2.cancel().catch(() => {
|
|
42293
42293
|
});
|
|
42294
42294
|
}
|
|
42295
42295
|
}
|
|
@@ -42412,15 +42412,15 @@ var fn = K2 ? performance.now() : 0;
|
|
|
42412
42412
|
var Y = He(`@x-otto/shared:file-lock`);
|
|
42413
42413
|
|
|
42414
42414
|
// ../interchange/dist/index.js
|
|
42415
|
-
var
|
|
42416
|
-
function
|
|
42417
|
-
let n3 =
|
|
42418
|
-
return { base64: r3, mediaType: ((n3 ? n3[1] : ``) || t3 || ``).toLowerCase(), valid:
|
|
42415
|
+
var l = /^data:([^;,]*)(?:;[^,]*)?,(.*)$/s;
|
|
42416
|
+
function u2(e4, t3) {
|
|
42417
|
+
let n3 = l.exec(e4), r3 = (n3 ? n3[2] ?? `` : e4).replace(/\s+/g, ``);
|
|
42418
|
+
return { base64: r3, mediaType: ((n3 ? n3[1] : ``) || t3 || ``).toLowerCase(), valid: d(r3) };
|
|
42419
42419
|
}
|
|
42420
|
-
function
|
|
42420
|
+
function d(e4) {
|
|
42421
42421
|
return e4.length === 0 || e4 === `undefined` || e4.length % 4 == 1 ? false : /^[A-Za-z0-9+/]*={0,2}$/.test(e4);
|
|
42422
42422
|
}
|
|
42423
|
-
function
|
|
42423
|
+
function f(e4, t3) {
|
|
42424
42424
|
switch (e4.toLowerCase()) {
|
|
42425
42425
|
case `image/jpeg`:
|
|
42426
42426
|
case `image/jpg`:
|
|
@@ -42432,10 +42432,10 @@ function c(e4, t3) {
|
|
|
42432
42432
|
case `image/webp`:
|
|
42433
42433
|
return `image/webp`;
|
|
42434
42434
|
default:
|
|
42435
|
-
return
|
|
42435
|
+
return p(t3);
|
|
42436
42436
|
}
|
|
42437
42437
|
}
|
|
42438
|
-
function
|
|
42438
|
+
function p(e4) {
|
|
42439
42439
|
return e4.startsWith(`/9j/`) ? `image/jpeg` : e4.startsWith(`iVBOR`) ? `image/png` : e4.startsWith(`R0lGOD`) ? `image/gif` : e4.startsWith(`UklGR`) ? `image/webp` : `image/png`;
|
|
42440
42440
|
}
|
|
42441
42441
|
|
|
@@ -42513,7 +42513,7 @@ function w2(t3) {
|
|
|
42513
42513
|
for (let r3 of g(t3.messages)) if (r3.role === `user`) typeof r3.content == `string` ? n3.push({ role: `user`, content: x3(r3.content) }) : n3.push({ role: `user`, content: r3.content.map((t4) => {
|
|
42514
42514
|
if (t4.type === `text`) return { type: `text`, text: x3(t4.text) };
|
|
42515
42515
|
if (t4.type === `image`) {
|
|
42516
|
-
let { base64: n4, mediaType: r4, valid: i2 } =
|
|
42516
|
+
let { base64: n4, mediaType: r4, valid: i2 } = u2(t4.source, t4.mime);
|
|
42517
42517
|
return i2 ? { type: `image_url`, image_url: { url: `data:${r4 || `image/png`};base64,${n4}` } } : { type: `text`, text: `[image omitted: corrupted or empty data]` };
|
|
42518
42518
|
}
|
|
42519
42519
|
return { type: `text`, text: `[unsupported]` };
|
|
@@ -42554,10 +42554,10 @@ function ie2(e4) {
|
|
|
42554
42554
|
if (!n4) return;
|
|
42555
42555
|
let r4 = n4.match(/^(\d+(?:\.\d+)?)(m|s|ms)$/);
|
|
42556
42556
|
if (!r4) return;
|
|
42557
|
-
let i2 = Number(r4[1]),
|
|
42558
|
-
if (
|
|
42559
|
-
if (
|
|
42560
|
-
if (
|
|
42557
|
+
let i2 = Number(r4[1]), a2 = r4[2];
|
|
42558
|
+
if (a2 === `ms`) return i2;
|
|
42559
|
+
if (a2 === `s`) return i2 * 1e3;
|
|
42560
|
+
if (a2 === `m`) return i2 * 60 * 1e3;
|
|
42561
42561
|
}, r3 = { remainingRequests: t3(`x-ratelimit-remaining-requests`), remainingTokens: t3(`x-ratelimit-remaining-tokens`), limitRequests: t3(`x-ratelimit-limit-requests`), limitTokens: t3(`x-ratelimit-limit-tokens`), resetRequestsMs: n3(`x-ratelimit-reset-requests`), resetTokensMs: n3(`x-ratelimit-reset-tokens`) };
|
|
42562
42562
|
if (!Object.values(r3).every((e5) => e5 === void 0)) return r3;
|
|
42563
42563
|
}
|
|
@@ -42599,8 +42599,8 @@ function A2(e4, t3) {
|
|
|
42599
42599
|
if (n3 < 0) return e4;
|
|
42600
42600
|
let r3 = e4.content[n3], i2 = M(r3.text, t3);
|
|
42601
42601
|
if (!i2) return e4;
|
|
42602
|
-
let
|
|
42603
|
-
return
|
|
42602
|
+
let a2 = [...e4.content], o2 = r3.text.slice(0, i2.matchStart).trimEnd();
|
|
42603
|
+
return o2.length > 0 ? a2[n3] = { ...r3, text: o2 } : a2.splice(n3, 1), a2.push(k3(`recovered_${n3}`, i2.name, i2.argumentsJson)), { ...e4, content: a2 };
|
|
42604
42604
|
}
|
|
42605
42605
|
var le = /<invoke name="([^"]+)">((?:(?!<invoke name=")[\s\S])*?)<\/invoke>\s*$/;
|
|
42606
42606
|
var j2 = /<parameter name="([^"]+)">([\s\S]*?)<\/parameter>/g;
|
|
@@ -42609,9 +42609,9 @@ function M(e4, t3) {
|
|
|
42609
42609
|
if (!r3) return null;
|
|
42610
42610
|
let i2 = r3[1];
|
|
42611
42611
|
if (!t3.has(i2)) return null;
|
|
42612
|
-
let
|
|
42613
|
-
for (j2.lastIndex = 0; (
|
|
42614
|
-
return { name: i2, argumentsJson: JSON.stringify(
|
|
42612
|
+
let a2 = {}, o2 = r3[2], s2;
|
|
42613
|
+
for (j2.lastIndex = 0; (s2 = j2.exec(o2)) !== null; ) a2[s2[1]] = s2[2];
|
|
42614
|
+
return { name: i2, argumentsJson: JSON.stringify(a2), matchStart: r3.index };
|
|
42615
42615
|
}
|
|
42616
42616
|
function N2() {
|
|
42617
42617
|
return { ...D2(), textContent: ``, thinkingText: ``, toolCalls: /* @__PURE__ */ new Map(), stopReason: `end_turn` };
|
|
@@ -42645,7 +42645,7 @@ function I3(e4) {
|
|
|
42645
42645
|
}
|
|
42646
42646
|
}
|
|
42647
42647
|
async function* pe2(e4) {
|
|
42648
|
-
let { url: t3, headers: r3, body: i2, identity:
|
|
42648
|
+
let { url: t3, headers: r3, body: i2, identity: a2, signal: o2, timeout: s2, idleTimeout: c, onResponse: l2, registeredToolNames: d2 } = e4, f2 = N2(), p2 = (e5 = false) => F3(a2, P2(f2, e5), f2, f2.stopReason), m = false, h2 = false, g2 = false, _2, v2 = Ct({ url: t3, body: i2, headers: r3, signal: o2, timeout: s2, idleTimeout: c, onResponse: (e5) => {
|
|
42649
42649
|
_2 = e5, l2?.(e5);
|
|
42650
42650
|
} });
|
|
42651
42651
|
try {
|
|
@@ -42658,35 +42658,35 @@ async function* pe2(e4) {
|
|
|
42658
42658
|
continue;
|
|
42659
42659
|
}
|
|
42660
42660
|
if (t4.error) {
|
|
42661
|
-
let e6 = t4.error, r5 = typeof e6.message == `string` ? e6.message : JSON.stringify(e6), i4 = e6.code,
|
|
42662
|
-
throw new Ce(`Chat Completions stream error: ${r5}`, { code: `PROVIDER_API_ERROR`, status:
|
|
42661
|
+
let e6 = t4.error, r5 = typeof e6.message == `string` ? e6.message : JSON.stringify(e6), i4 = e6.code, a4 = typeof i4 == `number` ? i4 : typeof i4 == `string` && /^\d+/.test(i4) ? Number(i4.match(/^\d+/)?.[0]) : void 0;
|
|
42662
|
+
throw new Ce(`Chat Completions stream error: ${r5}`, { code: `PROVIDER_API_ERROR`, status: a4 });
|
|
42663
42663
|
}
|
|
42664
42664
|
if (t4.usage) {
|
|
42665
42665
|
let e6 = t4.usage, n3 = e6.prompt_tokens ?? 0, r5 = e6.completion_tokens ?? 0, i4 = e6.prompt_tokens_details?.cached_tokens ?? e6.prompt_cache_hit_tokens ?? 0;
|
|
42666
|
-
|
|
42666
|
+
f2.inputTokens = n3 - i4, f2.cacheReadTokens = i4, f2.outputTokens = r5;
|
|
42667
42667
|
}
|
|
42668
42668
|
let r4 = t4.choices?.[0];
|
|
42669
42669
|
if (!r4) continue;
|
|
42670
42670
|
let i3 = r4.delta;
|
|
42671
|
-
if (m || (m = true, yield { type: `start`, partial:
|
|
42671
|
+
if (m || (m = true, yield { type: `start`, partial: p2() }), r4.finish_reason && (f2.stopReason = I3(r4.finish_reason)), !i3) continue;
|
|
42672
42672
|
if (i3.content) {
|
|
42673
42673
|
let e6 = i3.content;
|
|
42674
|
-
h2 || (h2 = true, yield { type: `text_start`, index: 0, partial:
|
|
42674
|
+
h2 || (h2 = true, yield { type: `text_start`, index: 0, partial: p2() }), f2.textContent += e6, yield { type: `text_delta`, index: 0, delta: e6, partial: p2() };
|
|
42675
42675
|
}
|
|
42676
|
-
let
|
|
42677
|
-
if (
|
|
42676
|
+
let a3 = i3.reasoning_content ?? i3.reasoning ?? i3.reasoning_text ?? null;
|
|
42677
|
+
if (a3 && (g2 || (g2 = true, yield { type: `thinking_start`, index: 0, partial: p2() }), f2.thinkingText += a3, yield { type: `thinking_delta`, index: 0, delta: a3, partial: p2() }), i3.tool_calls) for (let e6 of i3.tool_calls) {
|
|
42678
42678
|
let t5 = e6.index, n3 = e6.function;
|
|
42679
|
-
|
|
42680
|
-
let r5 =
|
|
42679
|
+
f2.toolCalls.has(t5) || (f2.toolCalls.set(t5, { id: e6.id ?? `call_${t5}`, name: n3?.name ?? ``, argumentsJson: `` }), yield { type: `tool_call_start`, index: t5, partial: p2() });
|
|
42680
|
+
let r5 = f2.toolCalls.get(t5);
|
|
42681
42681
|
if (n3?.arguments) {
|
|
42682
42682
|
let e7 = n3.arguments;
|
|
42683
|
-
r5.argumentsJson += e7, yield { type: `tool_call_delta`, index: t5, delta: e7, partial:
|
|
42683
|
+
r5.argumentsJson += e7, yield { type: `tool_call_delta`, index: t5, delta: e7, partial: p2() };
|
|
42684
42684
|
}
|
|
42685
42685
|
}
|
|
42686
42686
|
}
|
|
42687
|
-
g2 && (yield { type: `thinking_end`, index: 0, content:
|
|
42688
|
-
for (let [e5, t4] of
|
|
42689
|
-
yield { type: `done`, reason:
|
|
42687
|
+
g2 && (yield { type: `thinking_end`, index: 0, content: f2.thinkingText, partial: p2() }), h2 && (yield { type: `text_end`, index: 0, content: f2.textContent, partial: p2() });
|
|
42688
|
+
for (let [e5, t4] of f2.toolCalls) yield { type: `tool_call_end`, index: e5, toolCall: k3(t4.id, t4.name, t4.argumentsJson), partial: p2() };
|
|
42689
|
+
yield { type: `done`, reason: f2.stopReason, message: A2(p2(true), d2 ?? /* @__PURE__ */ new Set()), providerUsage: E3(_2) };
|
|
42690
42690
|
} catch (e5) {
|
|
42691
42691
|
yield { type: `error`, error: e5 instanceof Error ? e5 : new Ce(`Unknown Chat Completions stream error`, { code: `PROVIDER_STREAM_ERROR` }) };
|
|
42692
42692
|
}
|
|
@@ -42714,15 +42714,15 @@ var ge = /[\u0000-\u001f\u007f]/g;
|
|
|
42714
42714
|
function R3(e4, t3, n3, r3) {
|
|
42715
42715
|
let i2 = /* @__PURE__ */ new Map();
|
|
42716
42716
|
if (!e4) return i2;
|
|
42717
|
-
for (let [
|
|
42718
|
-
let e5 =
|
|
42717
|
+
for (let [a2, o2] of Object.entries(e4)) {
|
|
42718
|
+
let e5 = a2.trim();
|
|
42719
42719
|
if (!he.test(e5)) {
|
|
42720
|
-
n3?.warn({ provider: r3, source: t3, header:
|
|
42720
|
+
n3?.warn({ provider: r3, source: t3, header: a2 }, `dropped request header with invalid name (RFC 7230 token expected)`);
|
|
42721
42721
|
continue;
|
|
42722
42722
|
}
|
|
42723
|
-
if (typeof
|
|
42724
|
-
let
|
|
42725
|
-
|
|
42723
|
+
if (typeof o2 != `string`) continue;
|
|
42724
|
+
let s2 = o2.replace(ge, ``).trim();
|
|
42725
|
+
s2 && i2.set(e5.toLowerCase(), { name: e5, value: s2 });
|
|
42726
42726
|
}
|
|
42727
42727
|
return i2;
|
|
42728
42728
|
}
|
|
@@ -42737,25 +42737,25 @@ function _e(e4) {
|
|
|
42737
42737
|
return Object.keys(t3).length > 0 ? t3 : void 0;
|
|
42738
42738
|
}
|
|
42739
42739
|
function ve(e4) {
|
|
42740
|
-
let { logger: t3, diagnosticLabel: n3, allowAuthHeaderOverride: r3 } = e4, i2 = [{ label: `protocolDefaults`, entries: R3(e4.protocolDefaults, `protocolDefaults`, t3, n3) }, { label: `staticHeaders`, entries: R3(e4.staticHeaders, `staticHeaders`, t3, n3) }, { label: `tokenDerived`, entries: R3(_e(e4.tokenDerived), `tokenDerived`, t3, n3) }, { label: `customized`, entries: R3(e4.customized, `customized`, t3, n3) }],
|
|
42741
|
-
for (let { label: e5, entries:
|
|
42742
|
-
if (!r3 &&
|
|
42743
|
-
t3?.warn({ provider: n3, source: e5, header:
|
|
42740
|
+
let { logger: t3, diagnosticLabel: n3, allowAuthHeaderOverride: r3 } = e4, i2 = [{ label: `protocolDefaults`, entries: R3(e4.protocolDefaults, `protocolDefaults`, t3, n3) }, { label: `staticHeaders`, entries: R3(e4.staticHeaders, `staticHeaders`, t3, n3) }, { label: `tokenDerived`, entries: R3(_e(e4.tokenDerived), `tokenDerived`, t3, n3) }, { label: `customized`, entries: R3(e4.customized, `customized`, t3, n3) }], a2 = /* @__PURE__ */ new Set([`staticHeaders`, `tokenDerived`, `customized`]), o2 = /* @__PURE__ */ new Map();
|
|
42741
|
+
for (let { label: e5, entries: s3 } of i2) for (let [i3, c] of s3) {
|
|
42742
|
+
if (!r3 && a2.has(e5) && me.has(i3)) {
|
|
42743
|
+
t3?.warn({ provider: n3, source: e5, header: c.name }, `dropped attempt to override auth header (declare allowAuthHeaderOverride to permit)`);
|
|
42744
42744
|
continue;
|
|
42745
42745
|
}
|
|
42746
|
-
let
|
|
42747
|
-
|
|
42746
|
+
let s4 = o2.get(i3);
|
|
42747
|
+
s4 && e5 === `customized` && s4.value !== c.value && t3?.debug({ provider: n3, header: c.name }, `customizeRequest overrode a previously declared request header`), o2.set(i3, c);
|
|
42748
42748
|
}
|
|
42749
|
-
for (let [i3,
|
|
42750
|
-
if (r3 &&
|
|
42751
|
-
t3?.debug({ provider: n3, header:
|
|
42749
|
+
for (let [i3, a3] of R3(e4.auth, `auth`, t3, n3)) {
|
|
42750
|
+
if (r3 && o2.has(i3)) {
|
|
42751
|
+
t3?.debug({ provider: n3, header: a3.name }, `provider-declared auth header kept (allowAuthHeaderOverride); otto-resolved credential not applied`);
|
|
42752
42752
|
continue;
|
|
42753
42753
|
}
|
|
42754
|
-
|
|
42754
|
+
o2.set(i3, a3);
|
|
42755
42755
|
}
|
|
42756
|
-
let
|
|
42757
|
-
for (let { name: e5, value: t4 } of
|
|
42758
|
-
return
|
|
42756
|
+
let s2 = {};
|
|
42757
|
+
for (let { name: e5, value: t4 } of o2.values()) s2[e5] = t4;
|
|
42758
|
+
return s2;
|
|
42759
42759
|
}
|
|
42760
42760
|
var z2 = He(`@x-otto/provider:oauth:templates`);
|
|
42761
42761
|
|
|
@@ -42895,7 +42895,7 @@ function withMessageCacheBreakpoint(messages, cacheControl = CACHE_CONTROL) {
|
|
|
42895
42895
|
}
|
|
42896
42896
|
function buildSystemBlocks(systemPrompt, segments, cacheControl = CACHE_CONTROL) {
|
|
42897
42897
|
const source = segments && segments.length > 0 ? segments : systemPrompt ? [{ text: systemPrompt }] : [];
|
|
42898
|
-
const blocks = source.filter((
|
|
42898
|
+
const blocks = source.filter((s2) => s2.text.length > 0);
|
|
42899
42899
|
if (blocks.length === 0) {
|
|
42900
42900
|
return void 0;
|
|
42901
42901
|
}
|
|
@@ -42940,13 +42940,13 @@ function buildAnthropicMessages(messages, model) {
|
|
|
42940
42940
|
content.push({ type: "text", text: part.text });
|
|
42941
42941
|
}
|
|
42942
42942
|
} else if (part.type === "image") {
|
|
42943
|
-
const { base64, mediaType, valid } =
|
|
42943
|
+
const { base64, mediaType, valid } = u2(part.source, part.mime);
|
|
42944
42944
|
if (valid) {
|
|
42945
42945
|
content.push({
|
|
42946
42946
|
type: "image",
|
|
42947
42947
|
source: {
|
|
42948
42948
|
type: "base64",
|
|
42949
|
-
media_type:
|
|
42949
|
+
media_type: f(mediaType, base64),
|
|
42950
42950
|
data: base64
|
|
42951
42951
|
}
|
|
42952
42952
|
});
|
|
@@ -42986,19 +42986,19 @@ function buildAnthropicMessages(messages, model) {
|
|
|
42986
42986
|
}
|
|
42987
42987
|
} else if (msg.role === "tool_result") {
|
|
42988
42988
|
const toolContent = [];
|
|
42989
|
-
for (const
|
|
42990
|
-
if (
|
|
42991
|
-
if (
|
|
42992
|
-
toolContent.push({ type: "text", text:
|
|
42989
|
+
for (const c of msg.content) {
|
|
42990
|
+
if (c.type === "text") {
|
|
42991
|
+
if (c.text.length > 0) {
|
|
42992
|
+
toolContent.push({ type: "text", text: c.text });
|
|
42993
42993
|
}
|
|
42994
|
-
} else if (
|
|
42995
|
-
const { base64, mediaType, valid } =
|
|
42994
|
+
} else if (c.type === "image") {
|
|
42995
|
+
const { base64, mediaType, valid } = u2(c.source, c.mime);
|
|
42996
42996
|
if (valid) {
|
|
42997
42997
|
toolContent.push({
|
|
42998
42998
|
type: "image",
|
|
42999
42999
|
source: {
|
|
43000
43000
|
type: "base64",
|
|
43001
|
-
media_type:
|
|
43001
|
+
media_type: f(mediaType, base64),
|
|
43002
43002
|
data: base64
|
|
43003
43003
|
}
|
|
43004
43004
|
});
|
|
@@ -43074,14 +43074,14 @@ function buildAssistantMessage(state, final = false) {
|
|
|
43074
43074
|
function dispatchStreamEvent(event, state) {
|
|
43075
43075
|
switch (event.type) {
|
|
43076
43076
|
case "message_start": {
|
|
43077
|
-
const
|
|
43078
|
-
state.inputTokens =
|
|
43079
|
-
state.outputTokens =
|
|
43080
|
-
if (
|
|
43081
|
-
state.cacheReadTokens =
|
|
43077
|
+
const u3 = event.message.usage;
|
|
43078
|
+
state.inputTokens = u3.input_tokens;
|
|
43079
|
+
state.outputTokens = u3.output_tokens;
|
|
43080
|
+
if (u3.cache_read_input_tokens != null) {
|
|
43081
|
+
state.cacheReadTokens = u3.cache_read_input_tokens;
|
|
43082
43082
|
}
|
|
43083
|
-
if (
|
|
43084
|
-
state.cacheWriteTokens =
|
|
43083
|
+
if (u3.cache_creation_input_tokens != null) {
|
|
43084
|
+
state.cacheWriteTokens = u3.cache_creation_input_tokens;
|
|
43085
43085
|
}
|
|
43086
43086
|
return [];
|
|
43087
43087
|
}
|
|
@@ -43410,7 +43410,7 @@ function buildResponsesInput(context) {
|
|
|
43410
43410
|
return { type: "input_text", text: x3(part.text) };
|
|
43411
43411
|
}
|
|
43412
43412
|
if (part.type === "image") {
|
|
43413
|
-
const { base64, mediaType, valid } =
|
|
43413
|
+
const { base64, mediaType, valid } = u2(part.source, part.mime);
|
|
43414
43414
|
if (!valid) {
|
|
43415
43415
|
return { type: "input_text", text: "[image omitted: corrupted or empty data]" };
|
|
43416
43416
|
}
|
|
@@ -43424,20 +43424,20 @@ function buildResponsesInput(context) {
|
|
|
43424
43424
|
});
|
|
43425
43425
|
}
|
|
43426
43426
|
} else if (msg.role === "assistant") {
|
|
43427
|
-
const textParts = msg.content.filter((
|
|
43427
|
+
const textParts = msg.content.filter((c) => c.type === "text").filter((c) => c.text.trim().length > 0).map((c) => x3(c.text)).join("");
|
|
43428
43428
|
if (textParts) {
|
|
43429
43429
|
input.push({
|
|
43430
43430
|
role: "assistant",
|
|
43431
43431
|
content: [{ type: "output_text", text: textParts }]
|
|
43432
43432
|
});
|
|
43433
43433
|
}
|
|
43434
|
-
for (const
|
|
43435
|
-
if (
|
|
43434
|
+
for (const c of msg.content) {
|
|
43435
|
+
if (c.type === "tool_call") {
|
|
43436
43436
|
input.push({
|
|
43437
43437
|
type: "function_call",
|
|
43438
|
-
call_id:
|
|
43439
|
-
name:
|
|
43440
|
-
arguments: JSON.stringify(
|
|
43438
|
+
call_id: c.id,
|
|
43439
|
+
name: c.name,
|
|
43440
|
+
arguments: JSON.stringify(c.arguments)
|
|
43441
43441
|
});
|
|
43442
43442
|
}
|
|
43443
43443
|
}
|
|
@@ -43446,7 +43446,7 @@ function buildResponsesInput(context) {
|
|
|
43446
43446
|
type: "function_call_output",
|
|
43447
43447
|
call_id: msg.toolCallId,
|
|
43448
43448
|
output: x3(
|
|
43449
|
-
msg.content.map((
|
|
43449
|
+
msg.content.map((c) => c.type === "text" ? c.text : "").join("")
|
|
43450
43450
|
)
|
|
43451
43451
|
});
|
|
43452
43452
|
} else if (msg.role === "system_notification") {
|
|
@@ -43727,7 +43727,7 @@ var OpenAIResponsesStream = class {
|
|
|
43727
43727
|
yield* result.events;
|
|
43728
43728
|
if (result.fatal) return;
|
|
43729
43729
|
}
|
|
43730
|
-
const orderedTools = [...state.blocks.entries()].sort(([
|
|
43730
|
+
const orderedTools = [...state.blocks.entries()].sort(([a2], [b3]) => a2 - b3);
|
|
43731
43731
|
for (const [index, block] of orderedTools) {
|
|
43732
43732
|
if (block.kind === "tool_call") {
|
|
43733
43733
|
yield {
|
|
@@ -43877,7 +43877,7 @@ function createOpenAICompletionsProvider(options = {}) {
|
|
|
43877
43877
|
// ../../extensions/plugin-otto-wire-protocols/plugin.ts
|
|
43878
43878
|
function adaptToOpenAICompletions(input) {
|
|
43879
43879
|
return createOpenAICompletionsProvider({
|
|
43880
|
-
resolveKey: () => input.resolveAuth().then((
|
|
43880
|
+
resolveKey: () => input.resolveAuth().then((a2) => a2?.token),
|
|
43881
43881
|
headers: input.headers,
|
|
43882
43882
|
tokenDerivedHeaders: input.tokenDerivedHeaders,
|
|
43883
43883
|
logger: input.logger,
|
|
@@ -43888,7 +43888,7 @@ function adaptToOpenAICompletions(input) {
|
|
|
43888
43888
|
}
|
|
43889
43889
|
function adaptToOpenAIResponses(input) {
|
|
43890
43890
|
return createOpenAIResponsesProvider({
|
|
43891
|
-
resolveKey: () => input.resolveAuth().then((
|
|
43891
|
+
resolveKey: () => input.resolveAuth().then((a2) => a2?.token),
|
|
43892
43892
|
resolveBaseUrl: input.resolveBaseUrl,
|
|
43893
43893
|
tokenDerivedHeaders: input.tokenDerivedHeaders,
|
|
43894
43894
|
headers: input.headers,
|