@batonfx/skills 0.3.6 → 0.4.0
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/.turbo/turbo-build.log +2 -2
- package/dist/index.js +2780 -609
- package/package.json +2 -2
- package/src/github-catalog.ts +80 -0
- package/src/hosted-catalog.ts +270 -0
- package/src/http-catalog.ts +29 -0
- package/src/index.ts +4 -0
- package/src/s3-catalog.ts +49 -0
- package/src/skill-document.ts +174 -0
- package/src/skill-loader.ts +30 -200
- package/test/hosted-catalog.test.ts +398 -0
- package/test/skill-loader.test.ts +67 -6
package/dist/index.js
CHANGED
|
@@ -14,10 +14,11 @@ var __export = (target, all) => {
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
// src/
|
|
18
|
-
var
|
|
19
|
-
__export(
|
|
20
|
-
|
|
17
|
+
// src/github-catalog.ts
|
|
18
|
+
var exports_github_catalog = {};
|
|
19
|
+
__export(exports_github_catalog, {
|
|
20
|
+
make: () => make42,
|
|
21
|
+
layer: () => layer4
|
|
21
22
|
});
|
|
22
23
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Context.js
|
|
23
24
|
var exports_Context = {};
|
|
@@ -266,6 +267,7 @@ function isError(input) {
|
|
|
266
267
|
function isIterable(input) {
|
|
267
268
|
return hasProperty(input, Symbol.iterator) || isString(input);
|
|
268
269
|
}
|
|
270
|
+
var or = /* @__PURE__ */ dual(2, (self, that) => (a) => self(a) || that(a));
|
|
269
271
|
|
|
270
272
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Hash.js
|
|
271
273
|
var symbol = "~effect/interfaces/Hash";
|
|
@@ -740,6 +742,15 @@ var BaseProto = {
|
|
|
740
742
|
}
|
|
741
743
|
};
|
|
742
744
|
|
|
745
|
+
class Class2 {
|
|
746
|
+
[NodeInspectSymbol]() {
|
|
747
|
+
return this.toJSON();
|
|
748
|
+
}
|
|
749
|
+
toString() {
|
|
750
|
+
return format(this.toJSON());
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
|
|
743
754
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Utils.js
|
|
744
755
|
class SingleShotGen {
|
|
745
756
|
called = false;
|
|
@@ -1268,6 +1279,19 @@ function make2(combine2, initialValue, combineAll) {
|
|
|
1268
1279
|
var make3 = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
|
|
1269
1280
|
var isStrictEquivalent = (x, y) => x === y;
|
|
1270
1281
|
var strictEqual = () => isStrictEquivalent;
|
|
1282
|
+
function Tuple(elements) {
|
|
1283
|
+
return make3((self, that) => {
|
|
1284
|
+
if (self.length !== that.length) {
|
|
1285
|
+
return false;
|
|
1286
|
+
}
|
|
1287
|
+
for (let i = 0;i < self.length; i++) {
|
|
1288
|
+
if (!elements[i](self[i], that[i])) {
|
|
1289
|
+
return false;
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
return true;
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1271
1295
|
function Array_(item) {
|
|
1272
1296
|
return make3((self, that) => {
|
|
1273
1297
|
if (self.length !== that.length)
|
|
@@ -1856,6 +1880,21 @@ var isArrayNonEmpty = (self) => self.length > 0;
|
|
|
1856
1880
|
var succeed2 = succeed;
|
|
1857
1881
|
var fail2 = fail;
|
|
1858
1882
|
var fromOption2 = fromOption;
|
|
1883
|
+
var try_ = (evaluate2) => {
|
|
1884
|
+
if (isFunction(evaluate2)) {
|
|
1885
|
+
try {
|
|
1886
|
+
return succeed2(evaluate2());
|
|
1887
|
+
} catch (e) {
|
|
1888
|
+
return fail2(e);
|
|
1889
|
+
}
|
|
1890
|
+
} else {
|
|
1891
|
+
try {
|
|
1892
|
+
return succeed2(evaluate2.try());
|
|
1893
|
+
} catch (e) {
|
|
1894
|
+
return fail2(evaluate2.catch(e));
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
};
|
|
1859
1898
|
var isResult2 = isResult;
|
|
1860
1899
|
var isFailure2 = isFailure;
|
|
1861
1900
|
var isSuccess2 = isSuccess;
|
|
@@ -1894,6 +1933,9 @@ var all2 = (input) => {
|
|
|
1894
1933
|
return succeed2(out);
|
|
1895
1934
|
};
|
|
1896
1935
|
|
|
1936
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Tuple.js
|
|
1937
|
+
var makeEquivalence3 = Tuple;
|
|
1938
|
+
|
|
1897
1939
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Iterable.js
|
|
1898
1940
|
var makeBy = (f, options) => {
|
|
1899
1941
|
const max2 = options?.length !== undefined ? Math.max(1, Math.floor(options.length)) : Infinity;
|
|
@@ -1993,6 +2035,7 @@ var filter2 = /* @__PURE__ */ dual(2, (self, predicate) => ({
|
|
|
1993
2035
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Record.js
|
|
1994
2036
|
var empty2 = () => ({});
|
|
1995
2037
|
var isEmptyRecord = (self) => Object.keys(self).length === 0;
|
|
2038
|
+
var has = /* @__PURE__ */ dual(2, (self, key) => Object.hasOwn(self, key));
|
|
1996
2039
|
var map3 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
1997
2040
|
const out = {
|
|
1998
2041
|
...self
|
|
@@ -2012,6 +2055,18 @@ var filter3 = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
|
2012
2055
|
return out;
|
|
2013
2056
|
});
|
|
2014
2057
|
var keys = (self) => Object.keys(self);
|
|
2058
|
+
var isSubrecordBy = (equivalence) => dual(2, (self, that) => {
|
|
2059
|
+
for (const key of keys(self)) {
|
|
2060
|
+
if (!has(that, key) || !equivalence(self[key], that[key])) {
|
|
2061
|
+
return false;
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
return true;
|
|
2065
|
+
});
|
|
2066
|
+
var makeEquivalence4 = (equivalence) => {
|
|
2067
|
+
const is = isSubrecordBy(equivalence);
|
|
2068
|
+
return (self, that) => is(self, that) && is(that, self);
|
|
2069
|
+
};
|
|
2015
2070
|
|
|
2016
2071
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Array.js
|
|
2017
2072
|
var Array2 = globalThis.Array;
|
|
@@ -2099,6 +2154,7 @@ var partition = /* @__PURE__ */ dual(2, (self, f) => {
|
|
|
2099
2154
|
}
|
|
2100
2155
|
return [excluded, satisfying];
|
|
2101
2156
|
});
|
|
2157
|
+
var makeEquivalence5 = Array_;
|
|
2102
2158
|
var dedupeWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
|
|
2103
2159
|
const input = fromIterable2(self);
|
|
2104
2160
|
if (isReadonlyArrayNonEmpty(input)) {
|
|
@@ -2904,9 +2960,9 @@ var currentStackTrace = (frame) => {
|
|
|
2904
2960
|
if (stack) {
|
|
2905
2961
|
const locationMatchAll = stack.matchAll(locationRegExp);
|
|
2906
2962
|
let match4 = false;
|
|
2907
|
-
for (const [,
|
|
2963
|
+
for (const [, location2] of locationMatchAll) {
|
|
2908
2964
|
match4 = true;
|
|
2909
|
-
out.push(` at ${current.name} (${
|
|
2965
|
+
out.push(` at ${current.name} (${location2})`);
|
|
2910
2966
|
}
|
|
2911
2967
|
if (!match4) {
|
|
2912
2968
|
out.push(` at ${current.name} (${stack.replace(/^at /, "")})`);
|
|
@@ -3274,7 +3330,7 @@ var failCauseSync = (evaluate2) => suspend(() => failCause(internalCall(evaluate
|
|
|
3274
3330
|
var die = (defect) => exitDie(defect);
|
|
3275
3331
|
var failSync = (error) => suspend(() => fail3(internalCall(error)));
|
|
3276
3332
|
var void_2 = /* @__PURE__ */ succeed3(undefined);
|
|
3277
|
-
var
|
|
3333
|
+
var try_2 = (options) => {
|
|
3278
3334
|
const evaluate2 = typeof options === "function" ? options : options.try;
|
|
3279
3335
|
const catcher = typeof options === "function" ? (cause) => new UnknownError(cause, "An error occurred in Effect.try") : options.catch;
|
|
3280
3336
|
return suspend(() => {
|
|
@@ -4885,6 +4941,8 @@ var clockWith = (f) => withFiber((fiber2) => f(fiber2.getRef(ClockRef)));
|
|
|
4885
4941
|
var sleep = (duration) => clockWith((clock) => clock.sleep(fromInputUnsafe(duration)));
|
|
4886
4942
|
var currentTimeMillis = /* @__PURE__ */ clockWith((clock) => clock.currentTimeMillis);
|
|
4887
4943
|
var TimeoutErrorTypeId = "~effect/Cause/TimeoutError";
|
|
4944
|
+
var isTimeoutError = (u) => hasProperty(u, TimeoutErrorTypeId);
|
|
4945
|
+
|
|
4888
4946
|
class TimeoutError extends (/* @__PURE__ */ TaggedError("TimeoutError")) {
|
|
4889
4947
|
[TimeoutErrorTypeId] = TimeoutErrorTypeId;
|
|
4890
4948
|
constructor(message) {
|
|
@@ -5159,10 +5217,12 @@ var map6 = causeMap;
|
|
|
5159
5217
|
var squash = causeSquash;
|
|
5160
5218
|
var hasFails2 = hasFails;
|
|
5161
5219
|
var findError2 = findError;
|
|
5220
|
+
var hasInterrupts2 = hasInterrupts;
|
|
5162
5221
|
var pretty = causePretty;
|
|
5163
5222
|
var isDone2 = isDone;
|
|
5164
5223
|
var Done2 = Done;
|
|
5165
5224
|
var done2 = done;
|
|
5225
|
+
var isTimeoutError2 = isTimeoutError;
|
|
5166
5226
|
var IllegalArgumentError2 = IllegalArgumentError;
|
|
5167
5227
|
var ExceededCapacityError2 = ExceededCapacityError;
|
|
5168
5228
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Chunk.js
|
|
@@ -5174,8 +5234,8 @@ function copy(src, srcPos, dest, destPos, len) {
|
|
|
5174
5234
|
return dest;
|
|
5175
5235
|
}
|
|
5176
5236
|
var emptyArray = [];
|
|
5177
|
-
var
|
|
5178
|
-
var _equivalence = /* @__PURE__ */
|
|
5237
|
+
var makeEquivalence6 = (isEquivalent) => make3((self, that) => self.length === that.length && toReadonlyArray(self).every((value, i) => isEquivalent(value, getUnsafe3(that, i))));
|
|
5238
|
+
var _equivalence = /* @__PURE__ */ makeEquivalence6(equals);
|
|
5179
5239
|
var ChunkProto = {
|
|
5180
5240
|
[TypeId5]: {
|
|
5181
5241
|
_A: (_) => _
|
|
@@ -5348,6 +5408,13 @@ var getUnsafe3 = /* @__PURE__ */ dual(2, (self, index) => {
|
|
|
5348
5408
|
}
|
|
5349
5409
|
});
|
|
5350
5410
|
var size = (self) => self.length;
|
|
5411
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Crypto.js
|
|
5412
|
+
var exports_Crypto = {};
|
|
5413
|
+
__export(exports_Crypto, {
|
|
5414
|
+
make: () => make10,
|
|
5415
|
+
Crypto: () => Crypto
|
|
5416
|
+
});
|
|
5417
|
+
|
|
5351
5418
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Effect.js
|
|
5352
5419
|
var exports_Effect = {};
|
|
5353
5420
|
__export(exports_Effect, {
|
|
@@ -5381,7 +5448,7 @@ __export(exports_Effect, {
|
|
|
5381
5448
|
txRetry: () => txRetry,
|
|
5382
5449
|
tx: () => tx,
|
|
5383
5450
|
tryPromise: () => tryPromise2,
|
|
5384
|
-
try: () =>
|
|
5451
|
+
try: () => try_3,
|
|
5385
5452
|
transposeOption: () => transposeOption2,
|
|
5386
5453
|
trackSuccesses: () => trackSuccesses,
|
|
5387
5454
|
trackErrors: () => trackErrors,
|
|
@@ -6004,7 +6071,7 @@ __export(exports_Schedule, {
|
|
|
6004
6071
|
});
|
|
6005
6072
|
|
|
6006
6073
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Data.js
|
|
6007
|
-
var
|
|
6074
|
+
var Class3 = class extends Class {
|
|
6008
6075
|
constructor(props) {
|
|
6009
6076
|
super();
|
|
6010
6077
|
if (props) {
|
|
@@ -7833,7 +7900,7 @@ var failSync2 = failSync;
|
|
|
7833
7900
|
var failCause4 = failCause;
|
|
7834
7901
|
var failCauseSync2 = failCauseSync;
|
|
7835
7902
|
var die3 = die;
|
|
7836
|
-
var
|
|
7903
|
+
var try_3 = try_2;
|
|
7837
7904
|
var yieldNow2 = yieldNow;
|
|
7838
7905
|
var yieldNowWith2 = yieldNowWith;
|
|
7839
7906
|
var withFiber2 = withFiber;
|
|
@@ -8153,8 +8220,294 @@ var mapBothEager2 = mapBothEager;
|
|
|
8153
8220
|
var flatMapEager2 = flatMapEager;
|
|
8154
8221
|
var catchEager2 = catchEager;
|
|
8155
8222
|
var fnUntracedEager2 = fnUntracedEager;
|
|
8223
|
+
|
|
8224
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/PlatformError.js
|
|
8225
|
+
var TypeId15 = "~effect/platform/PlatformError";
|
|
8226
|
+
|
|
8227
|
+
class BadArgument extends (/* @__PURE__ */ TaggedError2("BadArgument")) {
|
|
8228
|
+
get message() {
|
|
8229
|
+
return `${this.module}.${this.method}${this.description ? `: ${this.description}` : ""}`;
|
|
8230
|
+
}
|
|
8231
|
+
}
|
|
8232
|
+
|
|
8233
|
+
class SystemError extends Error3 {
|
|
8234
|
+
get message() {
|
|
8235
|
+
return `${this._tag}: ${this.module}.${this.method}${this.pathOrDescriptor !== undefined ? ` (${this.pathOrDescriptor})` : ""}${this.description ? `: ${this.description}` : ""}`;
|
|
8236
|
+
}
|
|
8237
|
+
}
|
|
8238
|
+
|
|
8239
|
+
class PlatformError extends (/* @__PURE__ */ TaggedError2("PlatformError")) {
|
|
8240
|
+
constructor(reason) {
|
|
8241
|
+
if ("cause" in reason) {
|
|
8242
|
+
super({
|
|
8243
|
+
reason,
|
|
8244
|
+
cause: reason.cause
|
|
8245
|
+
});
|
|
8246
|
+
} else {
|
|
8247
|
+
super({
|
|
8248
|
+
reason
|
|
8249
|
+
});
|
|
8250
|
+
}
|
|
8251
|
+
}
|
|
8252
|
+
[TypeId15] = TypeId15;
|
|
8253
|
+
get message() {
|
|
8254
|
+
return this.reason.message;
|
|
8255
|
+
}
|
|
8256
|
+
}
|
|
8257
|
+
var systemError = (options) => new PlatformError(new SystemError(options));
|
|
8258
|
+
var badArgument = (options) => new PlatformError(new BadArgument(options));
|
|
8259
|
+
|
|
8260
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Crypto.js
|
|
8261
|
+
var TypeId16 = "~effect/platform/Crypto";
|
|
8262
|
+
var Crypto = /* @__PURE__ */ Service("effect/Crypto");
|
|
8263
|
+
var make10 = (impl) => {
|
|
8264
|
+
const randomBytesUnsafe = impl.randomBytes;
|
|
8265
|
+
const randomBytes = (size2) => map8(validateSize("randomBytes", size2), randomBytesUnsafe);
|
|
8266
|
+
const nextDoubleUnsafe = () => {
|
|
8267
|
+
const bytes = randomBytesUnsafe(7);
|
|
8268
|
+
const value = (bytes[0] & 31) * 2 ** 48 + bytes[1] * 2 ** 40 + bytes[2] * 2 ** 32 + bytes[3] * 2 ** 24 + bytes[4] * 2 ** 16 + bytes[5] * 2 ** 8 + bytes[6];
|
|
8269
|
+
return value / 2 ** 53;
|
|
8270
|
+
};
|
|
8271
|
+
const nextIntUnsafe = () => Math.floor(nextDoubleUnsafe() * (Number.MAX_SAFE_INTEGER - Number.MIN_SAFE_INTEGER + 1)) + Number.MIN_SAFE_INTEGER;
|
|
8272
|
+
return Crypto.of({
|
|
8273
|
+
[TypeId16]: TypeId16,
|
|
8274
|
+
randomBytes,
|
|
8275
|
+
nextDoubleUnsafe,
|
|
8276
|
+
nextIntUnsafe,
|
|
8277
|
+
digest: impl.digest,
|
|
8278
|
+
random: sync3(() => nextDoubleUnsafe()),
|
|
8279
|
+
randomBoolean: sync3(() => nextDoubleUnsafe() > 0.5),
|
|
8280
|
+
randomInt: sync3(() => nextIntUnsafe()),
|
|
8281
|
+
randomBetween: (min3, max3) => sync3(() => nextDoubleUnsafe() * (max3 - min3) + min3),
|
|
8282
|
+
randomIntBetween(min3, max3, options) {
|
|
8283
|
+
const extra = options?.halfOpen === true ? 0 : 1;
|
|
8284
|
+
return sync3(() => {
|
|
8285
|
+
const minInt = Math.ceil(min3);
|
|
8286
|
+
const maxInt = Math.floor(max3);
|
|
8287
|
+
return Math.floor(nextDoubleUnsafe() * (maxInt - minInt + extra)) + minInt;
|
|
8288
|
+
});
|
|
8289
|
+
},
|
|
8290
|
+
randomShuffle: (elements) => sync3(() => {
|
|
8291
|
+
const buffer = Array.from(elements);
|
|
8292
|
+
for (let i = buffer.length - 1;i >= 1; i = i - 1) {
|
|
8293
|
+
const index = Math.min(i, Math.floor(nextDoubleUnsafe() * (i + 1)));
|
|
8294
|
+
const value = buffer[i];
|
|
8295
|
+
buffer[i] = buffer[index];
|
|
8296
|
+
buffer[index] = value;
|
|
8297
|
+
}
|
|
8298
|
+
return buffer;
|
|
8299
|
+
}),
|
|
8300
|
+
randomUUIDv4: sync3(() => formatUUIDv4(randomBytesUnsafe(16))),
|
|
8301
|
+
randomUUIDv7: clockWith2((clock) => succeed6(formatUUIDv7(clock.currentTimeMillisUnsafe(), randomBytesUnsafe(16))))
|
|
8302
|
+
});
|
|
8303
|
+
};
|
|
8304
|
+
var validateSize = (method, size2) => Number.isSafeInteger(size2) && size2 >= 0 ? succeed6(size2) : fail5(badArgument({
|
|
8305
|
+
module: "Crypto",
|
|
8306
|
+
method,
|
|
8307
|
+
description: "size must be a non-negative safe integer"
|
|
8308
|
+
}));
|
|
8309
|
+
var hex = (byte) => byte.toString(16).padStart(2, "0");
|
|
8310
|
+
var formatUUID = (bytes) => {
|
|
8311
|
+
const segments = [bytes.subarray(0, 4), bytes.subarray(4, 6), bytes.subarray(6, 8), bytes.subarray(8, 10), bytes.subarray(10, 16)];
|
|
8312
|
+
return segments.map((segment) => Array.from(segment, hex).join("")).join("-");
|
|
8313
|
+
};
|
|
8314
|
+
var formatUUIDv4 = (bytes) => {
|
|
8315
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
8316
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
8317
|
+
return formatUUID(bytes);
|
|
8318
|
+
};
|
|
8319
|
+
var maxUUIDv7Timestamp = 2 ** 48 - 1;
|
|
8320
|
+
var formatUUIDv7 = (timestampMillis, bytes) => {
|
|
8321
|
+
const timestamp = Math.min(Math.max(0, Math.trunc(timestampMillis)), maxUUIDv7Timestamp);
|
|
8322
|
+
bytes[0] = Math.floor(timestamp / 2 ** 40);
|
|
8323
|
+
bytes[1] = Math.floor(timestamp / 2 ** 32) & 255;
|
|
8324
|
+
bytes[2] = Math.floor(timestamp / 2 ** 24) & 255;
|
|
8325
|
+
bytes[3] = Math.floor(timestamp / 2 ** 16) & 255;
|
|
8326
|
+
bytes[4] = Math.floor(timestamp / 2 ** 8) & 255;
|
|
8327
|
+
bytes[5] = timestamp & 255;
|
|
8328
|
+
bytes[6] = bytes[6] & 15 | 112;
|
|
8329
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
8330
|
+
return formatUUID(bytes);
|
|
8331
|
+
};
|
|
8332
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Encoding.js
|
|
8333
|
+
var exports_Encoding = {};
|
|
8334
|
+
__export(exports_Encoding, {
|
|
8335
|
+
isEncodingError: () => isEncodingError,
|
|
8336
|
+
encodeHex: () => encodeHex,
|
|
8337
|
+
encodeBase64Url: () => encodeBase64Url,
|
|
8338
|
+
encodeBase64: () => encodeBase64,
|
|
8339
|
+
decodeHexString: () => decodeHexString,
|
|
8340
|
+
decodeHex: () => decodeHex,
|
|
8341
|
+
decodeBase64UrlString: () => decodeBase64UrlString,
|
|
8342
|
+
decodeBase64Url: () => decodeBase64Url,
|
|
8343
|
+
decodeBase64String: () => decodeBase64String,
|
|
8344
|
+
decodeBase64: () => decodeBase64,
|
|
8345
|
+
EncodingErrorTypeId: () => EncodingErrorTypeId,
|
|
8346
|
+
EncodingError: () => EncodingError
|
|
8347
|
+
});
|
|
8348
|
+
var EncodingErrorTypeId = "~effect/encoding/EncodingError";
|
|
8349
|
+
|
|
8350
|
+
class EncodingError extends (/* @__PURE__ */ TaggedError2("EncodingError")) {
|
|
8351
|
+
[EncodingErrorTypeId] = EncodingErrorTypeId;
|
|
8352
|
+
}
|
|
8353
|
+
var isEncodingError = (u) => hasProperty(u, EncodingErrorTypeId);
|
|
8354
|
+
var encodeBase64 = (input) => typeof input === "string" ? base64EncodeUint8Array(encoder.encode(input)) : base64EncodeUint8Array(input);
|
|
8355
|
+
var decodeBase64 = (str) => {
|
|
8356
|
+
const stripped = stripCrlf(str);
|
|
8357
|
+
const length = stripped.length;
|
|
8358
|
+
if (length % 4 !== 0) {
|
|
8359
|
+
return fail2(new EncodingError({
|
|
8360
|
+
kind: "Decode",
|
|
8361
|
+
module: "Base64",
|
|
8362
|
+
input: stripped,
|
|
8363
|
+
message: `Length must be a multiple of 4, but is ${length}`
|
|
8364
|
+
}));
|
|
8365
|
+
}
|
|
8366
|
+
const index = stripped.indexOf("=");
|
|
8367
|
+
if (index !== -1 && (index < length - 2 || index === length - 2 && stripped[length - 1] !== "=")) {
|
|
8368
|
+
return fail2(new EncodingError({
|
|
8369
|
+
kind: "Decode",
|
|
8370
|
+
module: "Base64",
|
|
8371
|
+
input: stripped,
|
|
8372
|
+
message: `Found a '=' character, but it is not at the end`
|
|
8373
|
+
}));
|
|
8374
|
+
}
|
|
8375
|
+
try {
|
|
8376
|
+
const missingOctets = stripped.endsWith("==") ? 2 : stripped.endsWith("=") ? 1 : 0;
|
|
8377
|
+
const result3 = new Uint8Array(3 * (length / 4) - missingOctets);
|
|
8378
|
+
for (let i = 0, j = 0;i < length; i += 4, j += 3) {
|
|
8379
|
+
const buffer = getBase64Code(stripped.charCodeAt(i)) << 18 | getBase64Code(stripped.charCodeAt(i + 1)) << 12 | getBase64Code(stripped.charCodeAt(i + 2)) << 6 | getBase64Code(stripped.charCodeAt(i + 3));
|
|
8380
|
+
result3[j] = buffer >> 16;
|
|
8381
|
+
result3[j + 1] = buffer >> 8 & 255;
|
|
8382
|
+
result3[j + 2] = buffer & 255;
|
|
8383
|
+
}
|
|
8384
|
+
return succeed2(result3);
|
|
8385
|
+
} catch (e) {
|
|
8386
|
+
return fail2(new EncodingError({
|
|
8387
|
+
kind: "Decode",
|
|
8388
|
+
module: "Base64",
|
|
8389
|
+
input: stripped,
|
|
8390
|
+
message: e instanceof Error ? e.message : "Invalid input"
|
|
8391
|
+
}));
|
|
8392
|
+
}
|
|
8393
|
+
};
|
|
8394
|
+
var decodeBase64String = (str) => map2(decodeBase64(str), (_) => decoder.decode(_));
|
|
8395
|
+
var encodeBase64Url = (input) => typeof input === "string" ? base64UrlEncodeUint8Array(encoder.encode(input)) : base64UrlEncodeUint8Array(input);
|
|
8396
|
+
var decodeBase64Url = (str) => {
|
|
8397
|
+
const stripped = stripCrlf(str);
|
|
8398
|
+
const length = stripped.length;
|
|
8399
|
+
if (length % 4 === 1) {
|
|
8400
|
+
return fail2(new EncodingError({
|
|
8401
|
+
module: "Base64Url",
|
|
8402
|
+
kind: "Decode",
|
|
8403
|
+
input: stripped,
|
|
8404
|
+
message: `Length should be a multiple of 4, but is ${length}`
|
|
8405
|
+
}));
|
|
8406
|
+
}
|
|
8407
|
+
if (!/^[-_A-Z0-9]*?={0,2}$/i.test(stripped)) {
|
|
8408
|
+
return fail2(new EncodingError({
|
|
8409
|
+
module: "Base64Url",
|
|
8410
|
+
kind: "Decode",
|
|
8411
|
+
input: stripped,
|
|
8412
|
+
message: "Invalid input"
|
|
8413
|
+
}));
|
|
8414
|
+
}
|
|
8415
|
+
let sanitized = length % 4 === 2 ? `${stripped}==` : length % 4 === 3 ? `${stripped}=` : stripped;
|
|
8416
|
+
sanitized = sanitized.replace(/-/g, "+").replace(/_/g, "/");
|
|
8417
|
+
return decodeBase64(sanitized);
|
|
8418
|
+
};
|
|
8419
|
+
var decodeBase64UrlString = (str) => map2(decodeBase64Url(str), (_) => decoder.decode(_));
|
|
8420
|
+
var encodeHex = (input) => typeof input === "string" ? hexEncodeUint8Array(encoder.encode(input)) : hexEncodeUint8Array(input);
|
|
8421
|
+
var decodeHex = (str) => {
|
|
8422
|
+
const bytes = new TextEncoder().encode(str);
|
|
8423
|
+
if (bytes.length % 2 !== 0) {
|
|
8424
|
+
return fail2(new EncodingError({
|
|
8425
|
+
module: "Hex",
|
|
8426
|
+
kind: "Decode",
|
|
8427
|
+
input: str,
|
|
8428
|
+
message: `Length must be a multiple of 2, but is ${bytes.length}`
|
|
8429
|
+
}));
|
|
8430
|
+
}
|
|
8431
|
+
try {
|
|
8432
|
+
const length = bytes.length / 2;
|
|
8433
|
+
const result3 = new Uint8Array(length);
|
|
8434
|
+
for (let i = 0;i < length; i++) {
|
|
8435
|
+
const a = fromHexChar(bytes[i * 2]);
|
|
8436
|
+
const b = fromHexChar(bytes[i * 2 + 1]);
|
|
8437
|
+
result3[i] = a << 4 | b;
|
|
8438
|
+
}
|
|
8439
|
+
return succeed2(result3);
|
|
8440
|
+
} catch (e) {
|
|
8441
|
+
return fail2(new EncodingError({
|
|
8442
|
+
module: "Hex",
|
|
8443
|
+
kind: "Decode",
|
|
8444
|
+
input: str,
|
|
8445
|
+
message: e instanceof Error ? e.message : "Invalid input"
|
|
8446
|
+
}));
|
|
8447
|
+
}
|
|
8448
|
+
};
|
|
8449
|
+
var decodeHexString = (str) => map2(decodeHex(str), (_) => decoder.decode(_));
|
|
8450
|
+
var encoder = /* @__PURE__ */ new TextEncoder;
|
|
8451
|
+
var decoder = /* @__PURE__ */ new TextDecoder;
|
|
8452
|
+
var stripCrlf = (str) => str.replace(/[\n\r]/g, "");
|
|
8453
|
+
var base64EncodeUint8Array = (bytes) => {
|
|
8454
|
+
const length = bytes.length;
|
|
8455
|
+
let result3 = "";
|
|
8456
|
+
let i;
|
|
8457
|
+
for (i = 2;i < length; i += 3) {
|
|
8458
|
+
result3 += base64abc[bytes[i - 2] >> 2];
|
|
8459
|
+
result3 += base64abc[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
|
|
8460
|
+
result3 += base64abc[(bytes[i - 1] & 15) << 2 | bytes[i] >> 6];
|
|
8461
|
+
result3 += base64abc[bytes[i] & 63];
|
|
8462
|
+
}
|
|
8463
|
+
if (i === length + 1) {
|
|
8464
|
+
result3 += base64abc[bytes[i - 2] >> 2];
|
|
8465
|
+
result3 += base64abc[(bytes[i - 2] & 3) << 4];
|
|
8466
|
+
result3 += "==";
|
|
8467
|
+
}
|
|
8468
|
+
if (i === length) {
|
|
8469
|
+
result3 += base64abc[bytes[i - 2] >> 2];
|
|
8470
|
+
result3 += base64abc[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
|
|
8471
|
+
result3 += base64abc[(bytes[i - 1] & 15) << 2];
|
|
8472
|
+
result3 += "=";
|
|
8473
|
+
}
|
|
8474
|
+
return result3;
|
|
8475
|
+
};
|
|
8476
|
+
function getBase64Code(charCode) {
|
|
8477
|
+
if (charCode >= base64codes.length) {
|
|
8478
|
+
throw new TypeError(`Invalid character ${String.fromCharCode(charCode)}`);
|
|
8479
|
+
}
|
|
8480
|
+
const code = base64codes[charCode];
|
|
8481
|
+
if (code === 255) {
|
|
8482
|
+
throw new TypeError(`Invalid character ${String.fromCharCode(charCode)}`);
|
|
8483
|
+
}
|
|
8484
|
+
return code;
|
|
8485
|
+
}
|
|
8486
|
+
var base64abc = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/"];
|
|
8487
|
+
var base64codes = [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 0, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51];
|
|
8488
|
+
var base64UrlEncodeUint8Array = (data) => base64EncodeUint8Array(data).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
8489
|
+
var hexEncodeUint8Array = (bytes) => {
|
|
8490
|
+
let result3 = "";
|
|
8491
|
+
for (let i = 0;i < bytes.length; ++i) {
|
|
8492
|
+
result3 += bytesToHex[bytes[i]];
|
|
8493
|
+
}
|
|
8494
|
+
return result3;
|
|
8495
|
+
};
|
|
8496
|
+
var fromHexChar = (byte) => {
|
|
8497
|
+
if (48 <= byte && byte <= 57) {
|
|
8498
|
+
return byte - 48;
|
|
8499
|
+
}
|
|
8500
|
+
if (97 <= byte && byte <= 102) {
|
|
8501
|
+
return byte - 97 + 10;
|
|
8502
|
+
}
|
|
8503
|
+
if (65 <= byte && byte <= 70) {
|
|
8504
|
+
return byte - 65 + 10;
|
|
8505
|
+
}
|
|
8506
|
+
throw new TypeError("Invalid input");
|
|
8507
|
+
};
|
|
8508
|
+
var bytesToHex = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
|
|
8156
8509
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Fiber.js
|
|
8157
|
-
var
|
|
8510
|
+
var TypeId17 = `~effect/Fiber/${version}`;
|
|
8158
8511
|
var join2 = fiberJoin;
|
|
8159
8512
|
var joinAll = fiberJoinAll;
|
|
8160
8513
|
var interrupt4 = fiberInterrupt;
|
|
@@ -8164,7 +8517,7 @@ var runIn = fiberRunIn;
|
|
|
8164
8517
|
var exports_FileSystem = {};
|
|
8165
8518
|
__export(exports_FileSystem, {
|
|
8166
8519
|
makeNoop: () => makeNoop,
|
|
8167
|
-
make: () =>
|
|
8520
|
+
make: () => make25,
|
|
8168
8521
|
layerNoop: () => layerNoop,
|
|
8169
8522
|
isFile: () => isFile,
|
|
8170
8523
|
WatchBackend: () => WatchBackend,
|
|
@@ -8221,11 +8574,12 @@ var value = (self) => {
|
|
|
8221
8574
|
throw new Error("Unable to get redacted value" + (self.label ? ` with label: "${self.label}"` : ""));
|
|
8222
8575
|
}
|
|
8223
8576
|
};
|
|
8577
|
+
var stringOrRedacted = (val) => typeof val === "string" ? val : value(val);
|
|
8224
8578
|
|
|
8225
8579
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Redacted.js
|
|
8226
|
-
var
|
|
8227
|
-
var isRedacted = (u) => hasProperty(u,
|
|
8228
|
-
var
|
|
8580
|
+
var TypeId18 = "~effect/data/Redacted";
|
|
8581
|
+
var isRedacted = (u) => hasProperty(u, TypeId18);
|
|
8582
|
+
var make11 = (value2, options) => {
|
|
8229
8583
|
const self = Object.create(Proto4);
|
|
8230
8584
|
if (options?.label) {
|
|
8231
8585
|
self.label = options.label;
|
|
@@ -8234,7 +8588,7 @@ var make10 = (value2, options) => {
|
|
|
8234
8588
|
return self;
|
|
8235
8589
|
};
|
|
8236
8590
|
var Proto4 = {
|
|
8237
|
-
[
|
|
8591
|
+
[TypeId18]: {
|
|
8238
8592
|
_A: (_) => _
|
|
8239
8593
|
},
|
|
8240
8594
|
label: undefined,
|
|
@@ -8253,16 +8607,16 @@ var Proto4 = {
|
|
|
8253
8607
|
}
|
|
8254
8608
|
};
|
|
8255
8609
|
var value2 = value;
|
|
8256
|
-
var
|
|
8610
|
+
var makeEquivalence7 = (isEquivalent) => make3((x, y) => isEquivalent(value2(x), value2(y)));
|
|
8257
8611
|
|
|
8258
8612
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/SchemaIssue.js
|
|
8259
|
-
var
|
|
8613
|
+
var TypeId19 = "~effect/SchemaIssue/Issue";
|
|
8260
8614
|
function isIssue(u) {
|
|
8261
|
-
return hasProperty(u,
|
|
8615
|
+
return hasProperty(u, TypeId19);
|
|
8262
8616
|
}
|
|
8263
8617
|
|
|
8264
8618
|
class Base {
|
|
8265
|
-
[
|
|
8619
|
+
[TypeId19] = TypeId19;
|
|
8266
8620
|
toString() {
|
|
8267
8621
|
return defaultFormatter(this);
|
|
8268
8622
|
}
|
|
@@ -8419,7 +8773,7 @@ function makeSingle(input, out) {
|
|
|
8419
8773
|
}
|
|
8420
8774
|
return makeFilterIssue(input, out);
|
|
8421
8775
|
}
|
|
8422
|
-
function
|
|
8776
|
+
function make12(input, ast, out) {
|
|
8423
8777
|
if (Array.isArray(out)) {
|
|
8424
8778
|
if (isReadonlyArrayNonEmpty(out)) {
|
|
8425
8779
|
if (out.length === 1) {
|
|
@@ -8570,20 +8924,20 @@ function redact2(issue) {
|
|
|
8570
8924
|
case "MissingKey":
|
|
8571
8925
|
return issue;
|
|
8572
8926
|
case "Forbidden":
|
|
8573
|
-
return new Forbidden(map(issue.actual,
|
|
8927
|
+
return new Forbidden(map(issue.actual, make11), issue.annotations);
|
|
8574
8928
|
case "Filter":
|
|
8575
|
-
return new Filter(
|
|
8929
|
+
return new Filter(make11(issue.actual), issue.filter, redact2(issue.issue));
|
|
8576
8930
|
case "Pointer":
|
|
8577
8931
|
return new Pointer(issue.path, redact2(issue.issue));
|
|
8578
8932
|
case "Encoding":
|
|
8579
8933
|
case "InvalidType":
|
|
8580
8934
|
case "InvalidValue":
|
|
8581
8935
|
case "Composite":
|
|
8582
|
-
return new InvalidValue(map(issue.actual,
|
|
8936
|
+
return new InvalidValue(map(issue.actual, make11));
|
|
8583
8937
|
case "AnyOf":
|
|
8584
8938
|
case "OneOf":
|
|
8585
8939
|
case "UnexpectedKey":
|
|
8586
|
-
return new InvalidValue(some2(
|
|
8940
|
+
return new InvalidValue(some2(make11(issue.actual)));
|
|
8587
8941
|
}
|
|
8588
8942
|
}
|
|
8589
8943
|
|
|
@@ -8619,7 +8973,7 @@ var Equivalence4 = Equivalence2;
|
|
|
8619
8973
|
var Order4 = Order2;
|
|
8620
8974
|
var fromDateUnsafe2 = fromDateUnsafe;
|
|
8621
8975
|
var makeZonedUnsafe2 = makeZonedUnsafe;
|
|
8622
|
-
var
|
|
8976
|
+
var make13 = make8;
|
|
8623
8977
|
var makeZonedFromString2 = makeZonedFromString;
|
|
8624
8978
|
var toUtc2 = toUtc;
|
|
8625
8979
|
var zoneMakeNamedUnsafe2 = zoneMakeNamedUnsafe;
|
|
@@ -8632,168 +8986,6 @@ var toEpochMillis2 = toEpochMillis;
|
|
|
8632
8986
|
var formatIso2 = formatIso;
|
|
8633
8987
|
var formatIsoZoned2 = formatIsoZoned;
|
|
8634
8988
|
|
|
8635
|
-
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Encoding.js
|
|
8636
|
-
var EncodingErrorTypeId = "~effect/encoding/EncodingError";
|
|
8637
|
-
|
|
8638
|
-
class EncodingError extends (/* @__PURE__ */ TaggedError2("EncodingError")) {
|
|
8639
|
-
[EncodingErrorTypeId] = EncodingErrorTypeId;
|
|
8640
|
-
}
|
|
8641
|
-
var encodeBase64 = (input) => typeof input === "string" ? base64EncodeUint8Array(encoder.encode(input)) : base64EncodeUint8Array(input);
|
|
8642
|
-
var decodeBase64 = (str) => {
|
|
8643
|
-
const stripped = stripCrlf(str);
|
|
8644
|
-
const length = stripped.length;
|
|
8645
|
-
if (length % 4 !== 0) {
|
|
8646
|
-
return fail2(new EncodingError({
|
|
8647
|
-
kind: "Decode",
|
|
8648
|
-
module: "Base64",
|
|
8649
|
-
input: stripped,
|
|
8650
|
-
message: `Length must be a multiple of 4, but is ${length}`
|
|
8651
|
-
}));
|
|
8652
|
-
}
|
|
8653
|
-
const index = stripped.indexOf("=");
|
|
8654
|
-
if (index !== -1 && (index < length - 2 || index === length - 2 && stripped[length - 1] !== "=")) {
|
|
8655
|
-
return fail2(new EncodingError({
|
|
8656
|
-
kind: "Decode",
|
|
8657
|
-
module: "Base64",
|
|
8658
|
-
input: stripped,
|
|
8659
|
-
message: `Found a '=' character, but it is not at the end`
|
|
8660
|
-
}));
|
|
8661
|
-
}
|
|
8662
|
-
try {
|
|
8663
|
-
const missingOctets = stripped.endsWith("==") ? 2 : stripped.endsWith("=") ? 1 : 0;
|
|
8664
|
-
const result3 = new Uint8Array(3 * (length / 4) - missingOctets);
|
|
8665
|
-
for (let i = 0, j = 0;i < length; i += 4, j += 3) {
|
|
8666
|
-
const buffer = getBase64Code(stripped.charCodeAt(i)) << 18 | getBase64Code(stripped.charCodeAt(i + 1)) << 12 | getBase64Code(stripped.charCodeAt(i + 2)) << 6 | getBase64Code(stripped.charCodeAt(i + 3));
|
|
8667
|
-
result3[j] = buffer >> 16;
|
|
8668
|
-
result3[j + 1] = buffer >> 8 & 255;
|
|
8669
|
-
result3[j + 2] = buffer & 255;
|
|
8670
|
-
}
|
|
8671
|
-
return succeed2(result3);
|
|
8672
|
-
} catch (e) {
|
|
8673
|
-
return fail2(new EncodingError({
|
|
8674
|
-
kind: "Decode",
|
|
8675
|
-
module: "Base64",
|
|
8676
|
-
input: stripped,
|
|
8677
|
-
message: e instanceof Error ? e.message : "Invalid input"
|
|
8678
|
-
}));
|
|
8679
|
-
}
|
|
8680
|
-
};
|
|
8681
|
-
var decodeBase64String = (str) => map2(decodeBase64(str), (_) => decoder.decode(_));
|
|
8682
|
-
var encodeBase64Url = (input) => typeof input === "string" ? base64UrlEncodeUint8Array(encoder.encode(input)) : base64UrlEncodeUint8Array(input);
|
|
8683
|
-
var decodeBase64Url = (str) => {
|
|
8684
|
-
const stripped = stripCrlf(str);
|
|
8685
|
-
const length = stripped.length;
|
|
8686
|
-
if (length % 4 === 1) {
|
|
8687
|
-
return fail2(new EncodingError({
|
|
8688
|
-
module: "Base64Url",
|
|
8689
|
-
kind: "Decode",
|
|
8690
|
-
input: stripped,
|
|
8691
|
-
message: `Length should be a multiple of 4, but is ${length}`
|
|
8692
|
-
}));
|
|
8693
|
-
}
|
|
8694
|
-
if (!/^[-_A-Z0-9]*?={0,2}$/i.test(stripped)) {
|
|
8695
|
-
return fail2(new EncodingError({
|
|
8696
|
-
module: "Base64Url",
|
|
8697
|
-
kind: "Decode",
|
|
8698
|
-
input: stripped,
|
|
8699
|
-
message: "Invalid input"
|
|
8700
|
-
}));
|
|
8701
|
-
}
|
|
8702
|
-
let sanitized = length % 4 === 2 ? `${stripped}==` : length % 4 === 3 ? `${stripped}=` : stripped;
|
|
8703
|
-
sanitized = sanitized.replace(/-/g, "+").replace(/_/g, "/");
|
|
8704
|
-
return decodeBase64(sanitized);
|
|
8705
|
-
};
|
|
8706
|
-
var decodeBase64UrlString = (str) => map2(decodeBase64Url(str), (_) => decoder.decode(_));
|
|
8707
|
-
var encodeHex = (input) => typeof input === "string" ? hexEncodeUint8Array(encoder.encode(input)) : hexEncodeUint8Array(input);
|
|
8708
|
-
var decodeHex = (str) => {
|
|
8709
|
-
const bytes = new TextEncoder().encode(str);
|
|
8710
|
-
if (bytes.length % 2 !== 0) {
|
|
8711
|
-
return fail2(new EncodingError({
|
|
8712
|
-
module: "Hex",
|
|
8713
|
-
kind: "Decode",
|
|
8714
|
-
input: str,
|
|
8715
|
-
message: `Length must be a multiple of 2, but is ${bytes.length}`
|
|
8716
|
-
}));
|
|
8717
|
-
}
|
|
8718
|
-
try {
|
|
8719
|
-
const length = bytes.length / 2;
|
|
8720
|
-
const result3 = new Uint8Array(length);
|
|
8721
|
-
for (let i = 0;i < length; i++) {
|
|
8722
|
-
const a = fromHexChar(bytes[i * 2]);
|
|
8723
|
-
const b = fromHexChar(bytes[i * 2 + 1]);
|
|
8724
|
-
result3[i] = a << 4 | b;
|
|
8725
|
-
}
|
|
8726
|
-
return succeed2(result3);
|
|
8727
|
-
} catch (e) {
|
|
8728
|
-
return fail2(new EncodingError({
|
|
8729
|
-
module: "Hex",
|
|
8730
|
-
kind: "Decode",
|
|
8731
|
-
input: str,
|
|
8732
|
-
message: e instanceof Error ? e.message : "Invalid input"
|
|
8733
|
-
}));
|
|
8734
|
-
}
|
|
8735
|
-
};
|
|
8736
|
-
var decodeHexString = (str) => map2(decodeHex(str), (_) => decoder.decode(_));
|
|
8737
|
-
var encoder = /* @__PURE__ */ new TextEncoder;
|
|
8738
|
-
var decoder = /* @__PURE__ */ new TextDecoder;
|
|
8739
|
-
var stripCrlf = (str) => str.replace(/[\n\r]/g, "");
|
|
8740
|
-
var base64EncodeUint8Array = (bytes) => {
|
|
8741
|
-
const length = bytes.length;
|
|
8742
|
-
let result3 = "";
|
|
8743
|
-
let i;
|
|
8744
|
-
for (i = 2;i < length; i += 3) {
|
|
8745
|
-
result3 += base64abc[bytes[i - 2] >> 2];
|
|
8746
|
-
result3 += base64abc[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
|
|
8747
|
-
result3 += base64abc[(bytes[i - 1] & 15) << 2 | bytes[i] >> 6];
|
|
8748
|
-
result3 += base64abc[bytes[i] & 63];
|
|
8749
|
-
}
|
|
8750
|
-
if (i === length + 1) {
|
|
8751
|
-
result3 += base64abc[bytes[i - 2] >> 2];
|
|
8752
|
-
result3 += base64abc[(bytes[i - 2] & 3) << 4];
|
|
8753
|
-
result3 += "==";
|
|
8754
|
-
}
|
|
8755
|
-
if (i === length) {
|
|
8756
|
-
result3 += base64abc[bytes[i - 2] >> 2];
|
|
8757
|
-
result3 += base64abc[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
|
|
8758
|
-
result3 += base64abc[(bytes[i - 1] & 15) << 2];
|
|
8759
|
-
result3 += "=";
|
|
8760
|
-
}
|
|
8761
|
-
return result3;
|
|
8762
|
-
};
|
|
8763
|
-
function getBase64Code(charCode) {
|
|
8764
|
-
if (charCode >= base64codes.length) {
|
|
8765
|
-
throw new TypeError(`Invalid character ${String.fromCharCode(charCode)}`);
|
|
8766
|
-
}
|
|
8767
|
-
const code = base64codes[charCode];
|
|
8768
|
-
if (code === 255) {
|
|
8769
|
-
throw new TypeError(`Invalid character ${String.fromCharCode(charCode)}`);
|
|
8770
|
-
}
|
|
8771
|
-
return code;
|
|
8772
|
-
}
|
|
8773
|
-
var base64abc = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/"];
|
|
8774
|
-
var base64codes = [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 0, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51];
|
|
8775
|
-
var base64UrlEncodeUint8Array = (data) => base64EncodeUint8Array(data).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
8776
|
-
var hexEncodeUint8Array = (bytes) => {
|
|
8777
|
-
let result3 = "";
|
|
8778
|
-
for (let i = 0;i < bytes.length; ++i) {
|
|
8779
|
-
result3 += bytesToHex[bytes[i]];
|
|
8780
|
-
}
|
|
8781
|
-
return result3;
|
|
8782
|
-
};
|
|
8783
|
-
var fromHexChar = (byte) => {
|
|
8784
|
-
if (48 <= byte && byte <= 57) {
|
|
8785
|
-
return byte - 48;
|
|
8786
|
-
}
|
|
8787
|
-
if (97 <= byte && byte <= 102) {
|
|
8788
|
-
return byte - 97 + 10;
|
|
8789
|
-
}
|
|
8790
|
-
if (65 <= byte && byte <= 70) {
|
|
8791
|
-
return byte - 65 + 10;
|
|
8792
|
-
}
|
|
8793
|
-
throw new TypeError("Invalid input");
|
|
8794
|
-
};
|
|
8795
|
-
var bytesToHex = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
|
|
8796
|
-
|
|
8797
8989
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/SchemaGetter.js
|
|
8798
8990
|
class Getter extends Class {
|
|
8799
8991
|
run;
|
|
@@ -8866,7 +9058,7 @@ function trim2() {
|
|
|
8866
9058
|
return transform(trim);
|
|
8867
9059
|
}
|
|
8868
9060
|
function parseJson(options) {
|
|
8869
|
-
return onSome((input) =>
|
|
9061
|
+
return onSome((input) => try_3({
|
|
8870
9062
|
try: () => some2(JSON.parse(input, options?.reviver)),
|
|
8871
9063
|
catch: (e) => new InvalidValue(some2(input), {
|
|
8872
9064
|
message: globalThis.String(e)
|
|
@@ -8874,7 +9066,7 @@ function parseJson(options) {
|
|
|
8874
9066
|
}));
|
|
8875
9067
|
}
|
|
8876
9068
|
function stringifyJson(options) {
|
|
8877
|
-
return onSome((input) =>
|
|
9069
|
+
return onSome((input) => try_3({
|
|
8878
9070
|
try: () => some2(JSON.stringify(input, options?.replacer, options?.space)),
|
|
8879
9071
|
catch: (e) => new InvalidValue(some2(input), {
|
|
8880
9072
|
message: globalThis.String(e)
|
|
@@ -8951,7 +9143,7 @@ function decodeUriComponent() {
|
|
|
8951
9143
|
}
|
|
8952
9144
|
function dateTimeUtcFromInput() {
|
|
8953
9145
|
return transformOrFail((input) => {
|
|
8954
|
-
return match(
|
|
9146
|
+
return match(make13(input), {
|
|
8955
9147
|
onNone: () => fail5(new InvalidValue(some2(input), {
|
|
8956
9148
|
message: "Invalid DateTime input"
|
|
8957
9149
|
})),
|
|
@@ -9068,9 +9260,9 @@ function collectBracketPathEntries(isLeaf) {
|
|
|
9068
9260
|
|
|
9069
9261
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/BigDecimal.js
|
|
9070
9262
|
var FINITE_INT_REGEXP = /^[+-]?\d+$/;
|
|
9071
|
-
var
|
|
9263
|
+
var TypeId20 = "~effect/BigDecimal";
|
|
9072
9264
|
var BigDecimalProto = {
|
|
9073
|
-
[
|
|
9265
|
+
[TypeId20]: TypeId20,
|
|
9074
9266
|
[symbol]() {
|
|
9075
9267
|
const normalized = normalize(this);
|
|
9076
9268
|
return combine(hash(normalized.value), number(normalized.scale));
|
|
@@ -9095,8 +9287,8 @@ var BigDecimalProto = {
|
|
|
9095
9287
|
return pipeArguments(this, arguments);
|
|
9096
9288
|
}
|
|
9097
9289
|
};
|
|
9098
|
-
var isBigDecimal = (u) => hasProperty(u,
|
|
9099
|
-
var
|
|
9290
|
+
var isBigDecimal = (u) => hasProperty(u, TypeId20);
|
|
9291
|
+
var make14 = (value3, scale) => {
|
|
9100
9292
|
const o = Object.create(BigDecimalProto);
|
|
9101
9293
|
o.value = value3;
|
|
9102
9294
|
o.scale = scale;
|
|
@@ -9106,7 +9298,7 @@ var makeNormalizedUnsafe = (value3, scale) => {
|
|
|
9106
9298
|
if (value3 !== bigint04 && value3 % bigint10 === bigint04) {
|
|
9107
9299
|
throw new RangeError("Value must be normalized");
|
|
9108
9300
|
}
|
|
9109
|
-
const o =
|
|
9301
|
+
const o = make14(value3, scale);
|
|
9110
9302
|
o.normalized = o;
|
|
9111
9303
|
return o;
|
|
9112
9304
|
};
|
|
@@ -9141,10 +9333,10 @@ var normalize = (self) => {
|
|
|
9141
9333
|
};
|
|
9142
9334
|
var scale = /* @__PURE__ */ dual(2, (self, scale2) => {
|
|
9143
9335
|
if (scale2 > self.scale) {
|
|
9144
|
-
return
|
|
9336
|
+
return make14(self.value * bigint10 ** BigInt(scale2 - self.scale), scale2);
|
|
9145
9337
|
}
|
|
9146
9338
|
if (scale2 < self.scale) {
|
|
9147
|
-
return
|
|
9339
|
+
return make14(self.value / bigint10 ** BigInt(self.scale - scale2), scale2);
|
|
9148
9340
|
}
|
|
9149
9341
|
return self;
|
|
9150
9342
|
});
|
|
@@ -9156,12 +9348,12 @@ var sum2 = /* @__PURE__ */ dual(2, (self, that) => {
|
|
|
9156
9348
|
return that;
|
|
9157
9349
|
}
|
|
9158
9350
|
if (self.scale > that.scale) {
|
|
9159
|
-
return
|
|
9351
|
+
return make14(scale(that, self.scale).value + self.value, self.scale);
|
|
9160
9352
|
}
|
|
9161
9353
|
if (self.scale < that.scale) {
|
|
9162
|
-
return
|
|
9354
|
+
return make14(scale(self, that.scale).value + that.value, that.scale);
|
|
9163
9355
|
}
|
|
9164
|
-
return
|
|
9356
|
+
return make14(self.value + that.value, self.scale);
|
|
9165
9357
|
});
|
|
9166
9358
|
var Order5 = /* @__PURE__ */ make4((self, that) => {
|
|
9167
9359
|
const scmp = Number2(sign(self), sign(that));
|
|
@@ -9179,7 +9371,7 @@ var Order5 = /* @__PURE__ */ make4((self, that) => {
|
|
|
9179
9371
|
var isLessThan3 = /* @__PURE__ */ isLessThan(Order5);
|
|
9180
9372
|
var isGreaterThan3 = /* @__PURE__ */ isGreaterThan(Order5);
|
|
9181
9373
|
var sign = (n) => n.value === bigint04 ? 0 : n.value < bigint04 ? -1 : 1;
|
|
9182
|
-
var abs = (n) => n.value < bigint04 ?
|
|
9374
|
+
var abs = (n) => n.value < bigint04 ? make14(-n.value, n.scale) : n;
|
|
9183
9375
|
var Equivalence5 = /* @__PURE__ */ make3((self, that) => {
|
|
9184
9376
|
if (self.scale > that.scale) {
|
|
9185
9377
|
return scale(that, self.scale).value === self.value;
|
|
@@ -9227,7 +9419,7 @@ var fromString = (s) => {
|
|
|
9227
9419
|
if (!Number.isSafeInteger(scale2)) {
|
|
9228
9420
|
return none2();
|
|
9229
9421
|
}
|
|
9230
|
-
return some2(
|
|
9422
|
+
return some2(make14(BigInt(digits), scale2));
|
|
9231
9423
|
};
|
|
9232
9424
|
var format3 = (n) => {
|
|
9233
9425
|
const normalized = normalize(n);
|
|
@@ -9242,14 +9434,14 @@ var format3 = (n) => {
|
|
|
9242
9434
|
before = "0";
|
|
9243
9435
|
after = "0".repeat(normalized.scale - absolute.length) + absolute;
|
|
9244
9436
|
} else {
|
|
9245
|
-
const
|
|
9246
|
-
if (
|
|
9247
|
-
const zeros =
|
|
9437
|
+
const location2 = absolute.length - normalized.scale;
|
|
9438
|
+
if (location2 > absolute.length) {
|
|
9439
|
+
const zeros = location2 - absolute.length;
|
|
9248
9440
|
before = `${absolute}${"0".repeat(zeros)}`;
|
|
9249
9441
|
after = "";
|
|
9250
9442
|
} else {
|
|
9251
|
-
after = absolute.slice(
|
|
9252
|
-
before = absolute.slice(0,
|
|
9443
|
+
after = absolute.slice(location2);
|
|
9444
|
+
before = absolute.slice(0, location2);
|
|
9253
9445
|
}
|
|
9254
9446
|
}
|
|
9255
9447
|
const complete = after === "" ? before : `${before}.${after}`;
|
|
@@ -9278,19 +9470,19 @@ var truncate = /* @__PURE__ */ dual(isBigDecimalArgs, (self, scale2 = 0) => {
|
|
|
9278
9470
|
if (self.scale <= scale2) {
|
|
9279
9471
|
return self;
|
|
9280
9472
|
}
|
|
9281
|
-
return
|
|
9473
|
+
return make14(self.value / bigint10 ** BigInt(self.scale - scale2), scale2);
|
|
9282
9474
|
});
|
|
9283
9475
|
var ceil = /* @__PURE__ */ dual(isBigDecimalArgs, (self, scale2 = 0) => {
|
|
9284
9476
|
const truncated = truncate(self, scale2);
|
|
9285
9477
|
if (isPositive(self) && isLessThan3(truncated, self)) {
|
|
9286
|
-
return sum2(truncated,
|
|
9478
|
+
return sum2(truncated, make14(bigint12, scale2));
|
|
9287
9479
|
}
|
|
9288
9480
|
return truncated;
|
|
9289
9481
|
});
|
|
9290
9482
|
var floor = /* @__PURE__ */ dual(isBigDecimalArgs, (self, scale2 = 0) => {
|
|
9291
9483
|
const truncated = truncate(self, scale2);
|
|
9292
9484
|
if (isNegative(self) && isGreaterThan3(truncated, self)) {
|
|
9293
|
-
return sum2(truncated,
|
|
9485
|
+
return sum2(truncated, make14(bigint_1, scale2));
|
|
9294
9486
|
}
|
|
9295
9487
|
return truncated;
|
|
9296
9488
|
});
|
|
@@ -9308,10 +9500,10 @@ class Middleware {
|
|
|
9308
9500
|
return new Middleware(this.encode, this.decode);
|
|
9309
9501
|
}
|
|
9310
9502
|
}
|
|
9311
|
-
var
|
|
9503
|
+
var TypeId21 = "~effect/SchemaTransformation/Transformation";
|
|
9312
9504
|
|
|
9313
9505
|
class Transformation {
|
|
9314
|
-
[
|
|
9506
|
+
[TypeId21] = TypeId21;
|
|
9315
9507
|
_tag = "Transformation";
|
|
9316
9508
|
decode;
|
|
9317
9509
|
encode;
|
|
@@ -9327,9 +9519,9 @@ class Transformation {
|
|
|
9327
9519
|
}
|
|
9328
9520
|
}
|
|
9329
9521
|
function isTransformation(u) {
|
|
9330
|
-
return hasProperty(u,
|
|
9522
|
+
return hasProperty(u, TypeId21);
|
|
9331
9523
|
}
|
|
9332
|
-
var
|
|
9524
|
+
var make15 = (options) => {
|
|
9333
9525
|
if (isTransformation(options)) {
|
|
9334
9526
|
return options;
|
|
9335
9527
|
}
|
|
@@ -9515,7 +9707,7 @@ var timeZoneFromString = /* @__PURE__ */ transformOrFail2({
|
|
|
9515
9707
|
});
|
|
9516
9708
|
var dateTimeUtcFromString = /* @__PURE__ */ transformOrFail2({
|
|
9517
9709
|
decode: (s) => {
|
|
9518
|
-
return match(
|
|
9710
|
+
return match(make13(s), {
|
|
9519
9711
|
onNone: () => fail5(new InvalidValue(some2(s), {
|
|
9520
9712
|
message: `Invalid UTC DateTime string: ${s}`
|
|
9521
9713
|
})),
|
|
@@ -9541,7 +9733,7 @@ function makeGuard(tag) {
|
|
|
9541
9733
|
return (ast) => ast._tag === tag;
|
|
9542
9734
|
}
|
|
9543
9735
|
function isAST(u) {
|
|
9544
|
-
return hasProperty(u,
|
|
9736
|
+
return hasProperty(u, TypeId22) && u[TypeId22] === TypeId22;
|
|
9545
9737
|
}
|
|
9546
9738
|
var isDeclaration = /* @__PURE__ */ makeGuard("Declaration");
|
|
9547
9739
|
var isNever2 = /* @__PURE__ */ makeGuard("Never");
|
|
@@ -9572,10 +9764,10 @@ class Context {
|
|
|
9572
9764
|
this.annotations = annotations;
|
|
9573
9765
|
}
|
|
9574
9766
|
}
|
|
9575
|
-
var
|
|
9767
|
+
var TypeId22 = "~effect/Schema";
|
|
9576
9768
|
|
|
9577
9769
|
class Base2 {
|
|
9578
|
-
[
|
|
9770
|
+
[TypeId22] = TypeId22;
|
|
9579
9771
|
annotations;
|
|
9580
9772
|
checks;
|
|
9581
9773
|
encoding;
|
|
@@ -10747,7 +10939,7 @@ class FilterGroup extends Class {
|
|
|
10747
10939
|
}
|
|
10748
10940
|
}
|
|
10749
10941
|
function makeFilter(filter7, annotations, aborted = false) {
|
|
10750
|
-
return new Filter2((input, ast, options) =>
|
|
10942
|
+
return new Filter2((input, ast, options) => make12(input, ast, filter7(input, ast, options)), annotations, aborted);
|
|
10751
10943
|
}
|
|
10752
10944
|
function makeFilterByGuard(is, annotations) {
|
|
10753
10945
|
return new Filter2((input) => is(input) ? undefined : new InvalidValue(some2(input)), annotations, true);
|
|
@@ -11260,49 +11452,13 @@ function nominal() {
|
|
|
11260
11452
|
});
|
|
11261
11453
|
}
|
|
11262
11454
|
|
|
11263
|
-
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/PlatformError.js
|
|
11264
|
-
var TypeId21 = "~effect/platform/PlatformError";
|
|
11265
|
-
|
|
11266
|
-
class BadArgument extends (/* @__PURE__ */ TaggedError2("BadArgument")) {
|
|
11267
|
-
get message() {
|
|
11268
|
-
return `${this.module}.${this.method}${this.description ? `: ${this.description}` : ""}`;
|
|
11269
|
-
}
|
|
11270
|
-
}
|
|
11271
|
-
|
|
11272
|
-
class SystemError extends Error3 {
|
|
11273
|
-
get message() {
|
|
11274
|
-
return `${this._tag}: ${this.module}.${this.method}${this.pathOrDescriptor !== undefined ? ` (${this.pathOrDescriptor})` : ""}${this.description ? `: ${this.description}` : ""}`;
|
|
11275
|
-
}
|
|
11276
|
-
}
|
|
11277
|
-
|
|
11278
|
-
class PlatformError extends (/* @__PURE__ */ TaggedError2("PlatformError")) {
|
|
11279
|
-
constructor(reason) {
|
|
11280
|
-
if ("cause" in reason) {
|
|
11281
|
-
super({
|
|
11282
|
-
reason,
|
|
11283
|
-
cause: reason.cause
|
|
11284
|
-
});
|
|
11285
|
-
} else {
|
|
11286
|
-
super({
|
|
11287
|
-
reason
|
|
11288
|
-
});
|
|
11289
|
-
}
|
|
11290
|
-
}
|
|
11291
|
-
[TypeId21] = TypeId21;
|
|
11292
|
-
get message() {
|
|
11293
|
-
return this.reason.message;
|
|
11294
|
-
}
|
|
11295
|
-
}
|
|
11296
|
-
var systemError = (options) => new PlatformError(new SystemError(options));
|
|
11297
|
-
var badArgument = (options) => new PlatformError(new BadArgument(options));
|
|
11298
|
-
|
|
11299
11455
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Latch.js
|
|
11300
11456
|
var makeUnsafe5 = makeLatchUnsafe;
|
|
11301
|
-
var
|
|
11457
|
+
var make16 = makeLatch;
|
|
11302
11458
|
|
|
11303
11459
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/MutableList.js
|
|
11304
11460
|
var Empty = /* @__PURE__ */ Symbol.for("effect/MutableList/Empty");
|
|
11305
|
-
var
|
|
11461
|
+
var make17 = () => ({
|
|
11306
11462
|
head: undefined,
|
|
11307
11463
|
tail: undefined,
|
|
11308
11464
|
length: 0
|
|
@@ -11465,9 +11621,9 @@ var filter7 = (self, f) => {
|
|
|
11465
11621
|
var remove2 = (self, value3) => filter7(self, (v) => v !== value3);
|
|
11466
11622
|
|
|
11467
11623
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/MutableRef.js
|
|
11468
|
-
var
|
|
11624
|
+
var TypeId23 = "~effect/MutableRef";
|
|
11469
11625
|
var MutableRefProto = {
|
|
11470
|
-
[
|
|
11626
|
+
[TypeId23]: TypeId23,
|
|
11471
11627
|
...PipeInspectableProto,
|
|
11472
11628
|
toJSON() {
|
|
11473
11629
|
return {
|
|
@@ -11476,7 +11632,7 @@ var MutableRefProto = {
|
|
|
11476
11632
|
};
|
|
11477
11633
|
}
|
|
11478
11634
|
};
|
|
11479
|
-
var
|
|
11635
|
+
var make18 = (value3) => {
|
|
11480
11636
|
const ref = Object.create(MutableRefProto);
|
|
11481
11637
|
ref.current = value3;
|
|
11482
11638
|
return ref;
|
|
@@ -11488,22 +11644,22 @@ var set2 = /* @__PURE__ */ dual(2, (self, value3) => {
|
|
|
11488
11644
|
});
|
|
11489
11645
|
|
|
11490
11646
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/PubSub.js
|
|
11491
|
-
var
|
|
11647
|
+
var TypeId24 = "~effect/PubSub";
|
|
11492
11648
|
var SubscriptionTypeId = "~effect/PubSub/Subscription";
|
|
11493
|
-
var
|
|
11494
|
-
var bounded = (capacity) =>
|
|
11649
|
+
var make19 = (options) => sync3(() => makePubSubUnsafe(options.atomicPubSub(), new Map, makeUnsafe3(), makeUnsafe5(false), make18(false), options.strategy()));
|
|
11650
|
+
var bounded = (capacity) => make19({
|
|
11495
11651
|
atomicPubSub: () => makeAtomicBounded(capacity),
|
|
11496
11652
|
strategy: () => new BackPressureStrategy
|
|
11497
11653
|
});
|
|
11498
|
-
var dropping = (capacity) =>
|
|
11654
|
+
var dropping = (capacity) => make19({
|
|
11499
11655
|
atomicPubSub: () => makeAtomicBounded(capacity),
|
|
11500
11656
|
strategy: () => new DroppingStrategy
|
|
11501
11657
|
});
|
|
11502
|
-
var sliding = (capacity) =>
|
|
11658
|
+
var sliding = (capacity) => make19({
|
|
11503
11659
|
atomicPubSub: () => makeAtomicBounded(capacity),
|
|
11504
11660
|
strategy: () => new SlidingStrategy
|
|
11505
11661
|
});
|
|
11506
|
-
var unbounded = (options) =>
|
|
11662
|
+
var unbounded = (options) => make19({
|
|
11507
11663
|
atomicPubSub: () => makeAtomicUnbounded(options),
|
|
11508
11664
|
strategy: () => new DroppingStrategy
|
|
11509
11665
|
});
|
|
@@ -11629,7 +11785,7 @@ var removeSubscribers = (subscribers, subscription, pollers) => {
|
|
|
11629
11785
|
subscribers.delete(subscription);
|
|
11630
11786
|
}
|
|
11631
11787
|
};
|
|
11632
|
-
var makeSubscriptionUnsafe = (pubsub, subscribers, strategy) => new SubscriptionImpl(pubsub, subscribers, pubsub.subscribe(),
|
|
11788
|
+
var makeSubscriptionUnsafe = (pubsub, subscribers, strategy) => new SubscriptionImpl(pubsub, subscribers, pubsub.subscribe(), make17(), makeUnsafe5(false), make18(false), strategy, pubsub.replayWindow());
|
|
11633
11789
|
|
|
11634
11790
|
class BoundedPubSubArb {
|
|
11635
11791
|
array;
|
|
@@ -12291,7 +12447,7 @@ class SubscriptionImpl {
|
|
|
12291
12447
|
}
|
|
12292
12448
|
|
|
12293
12449
|
class PubSubImpl {
|
|
12294
|
-
[
|
|
12450
|
+
[TypeId24] = {
|
|
12295
12451
|
_A: identity
|
|
12296
12452
|
};
|
|
12297
12453
|
pubsub;
|
|
@@ -12320,7 +12476,7 @@ var ensureCapacity = (capacity) => {
|
|
|
12320
12476
|
};
|
|
12321
12477
|
|
|
12322
12478
|
class BackPressureStrategy {
|
|
12323
|
-
publishers = /* @__PURE__ */
|
|
12479
|
+
publishers = /* @__PURE__ */ make17();
|
|
12324
12480
|
get shutdown() {
|
|
12325
12481
|
return withFiber2((fiber3) => forEach2(takeAll(this.publishers), ([_, deferred, last]) => last ? interruptWith(deferred, fiber3.id) : void_4, {
|
|
12326
12482
|
concurrency: "unbounded",
|
|
@@ -12558,7 +12714,7 @@ var emptyReplayWindow = {
|
|
|
12558
12714
|
};
|
|
12559
12715
|
|
|
12560
12716
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Queue.js
|
|
12561
|
-
var
|
|
12717
|
+
var TypeId25 = "~effect/Queue";
|
|
12562
12718
|
var EnqueueTypeId = "~effect/Queue/Enqueue";
|
|
12563
12719
|
var DequeueTypeId = "~effect/Queue/Dequeue";
|
|
12564
12720
|
var variance = {
|
|
@@ -12566,7 +12722,7 @@ var variance = {
|
|
|
12566
12722
|
_E: identity
|
|
12567
12723
|
};
|
|
12568
12724
|
var QueueProto = {
|
|
12569
|
-
[
|
|
12725
|
+
[TypeId25]: variance,
|
|
12570
12726
|
[EnqueueTypeId]: variance,
|
|
12571
12727
|
[DequeueTypeId]: variance,
|
|
12572
12728
|
...PipeInspectableProto,
|
|
@@ -12578,12 +12734,12 @@ var QueueProto = {
|
|
|
12578
12734
|
};
|
|
12579
12735
|
}
|
|
12580
12736
|
};
|
|
12581
|
-
var
|
|
12737
|
+
var make20 = (options) => withFiber((fiber3) => {
|
|
12582
12738
|
const self = Object.create(QueueProto);
|
|
12583
12739
|
self.dispatcher = fiber3.currentDispatcher;
|
|
12584
12740
|
self.capacity = options?.capacity ?? Number.POSITIVE_INFINITY;
|
|
12585
12741
|
self.strategy = options?.strategy ?? "suspend";
|
|
12586
|
-
self.messages =
|
|
12742
|
+
self.messages = make17();
|
|
12587
12743
|
self.scheduleRunning = false;
|
|
12588
12744
|
self.state = {
|
|
12589
12745
|
_tag: "Open",
|
|
@@ -12593,10 +12749,10 @@ var make19 = (options) => withFiber((fiber3) => {
|
|
|
12593
12749
|
};
|
|
12594
12750
|
return succeed3(self);
|
|
12595
12751
|
});
|
|
12596
|
-
var bounded2 = (capacity) =>
|
|
12752
|
+
var bounded2 = (capacity) => make20({
|
|
12597
12753
|
capacity
|
|
12598
12754
|
});
|
|
12599
|
-
var unbounded2 = () =>
|
|
12755
|
+
var unbounded2 = () => make20();
|
|
12600
12756
|
var offer = (self, message) => suspend(() => {
|
|
12601
12757
|
if (self.state._tag !== "Open") {
|
|
12602
12758
|
return exitFalse;
|
|
@@ -12976,10 +13132,10 @@ class SemaphoreImpl {
|
|
|
12976
13132
|
var toPull = (take5) => isExit2(take5) ? isSuccess4(take5) ? done2(take5.value) : take5 : succeed6(take5);
|
|
12977
13133
|
|
|
12978
13134
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Channel.js
|
|
12979
|
-
var
|
|
12980
|
-
var isChannel = (u) => hasProperty(u,
|
|
13135
|
+
var TypeId26 = "~effect/Channel";
|
|
13136
|
+
var isChannel = (u) => hasProperty(u, TypeId26);
|
|
12981
13137
|
var ChannelProto = {
|
|
12982
|
-
[
|
|
13138
|
+
[TypeId26]: {
|
|
12983
13139
|
_Env: identity,
|
|
12984
13140
|
_InErr: identity,
|
|
12985
13141
|
_InElem: identity,
|
|
@@ -13005,7 +13161,7 @@ var fromTransformBracket = (f) => fromTransform(fnUntraced2(function* (upstream,
|
|
|
13005
13161
|
}));
|
|
13006
13162
|
var toTransform = (channel) => channel.transform;
|
|
13007
13163
|
var DefaultChunkSize = 4096;
|
|
13008
|
-
var asyncQueue = (scope3, f, options) =>
|
|
13164
|
+
var asyncQueue = (scope3, f, options) => make20({
|
|
13009
13165
|
capacity: options?.bufferSize,
|
|
13010
13166
|
strategy: options?.strategy
|
|
13011
13167
|
}).pipe(tap5((queue) => addFinalizer2(scope3, shutdown2(queue))), tap5((queue) => forkIn2(provide(f(queue), scope3), scope3)));
|
|
@@ -13435,7 +13591,7 @@ var mergeAll3 = /* @__PURE__ */ dual(2, (channels, {
|
|
|
13435
13591
|
}) => fromTransformBracket(fnUntraced2(function* (upstream, scope3, forkedScope) {
|
|
13436
13592
|
const concurrencyN = concurrency === "unbounded" ? Number.MAX_SAFE_INTEGER : Math.max(1, concurrency);
|
|
13437
13593
|
const semaphore = switch_ ? undefined : makeUnsafe6(concurrencyN);
|
|
13438
|
-
const doneLatch = yield*
|
|
13594
|
+
const doneLatch = yield* make16(true);
|
|
13439
13595
|
const fibers = new Set;
|
|
13440
13596
|
const queue = yield* bounded2(bufferSize);
|
|
13441
13597
|
yield* addFinalizer2(forkedScope, shutdown2(queue));
|
|
@@ -13604,7 +13760,7 @@ var unwrap2 = (channel) => fromTransform((upstream, scope3) => {
|
|
|
13604
13760
|
var scoped3 = (self) => fromTransformBracket((upstream, scope3, forkedScope) => map8(provide(toTransform(self)(upstream, scope3), forkedScope), provide(forkedScope)));
|
|
13605
13761
|
var buffer = /* @__PURE__ */ dual(2, (self, options) => fromTransform(fnUntraced2(function* (upstream, scope3) {
|
|
13606
13762
|
const pull = yield* toTransform(self)(upstream, scope3);
|
|
13607
|
-
const queue = yield*
|
|
13763
|
+
const queue = yield* make20({
|
|
13608
13764
|
capacity: options.capacity === "unbounded" ? undefined : options.capacity,
|
|
13609
13765
|
strategy: options.capacity === "unbounded" ? undefined : options.strategy
|
|
13610
13766
|
});
|
|
@@ -13616,7 +13772,7 @@ var buffer = /* @__PURE__ */ dual(2, (self, options) => fromTransform(fnUntraced
|
|
|
13616
13772
|
})));
|
|
13617
13773
|
var bufferArray = /* @__PURE__ */ dual(2, (self, options) => fromTransform(fnUntraced2(function* (upstream, scope3) {
|
|
13618
13774
|
const pull = yield* toTransform(self)(upstream, scope3);
|
|
13619
|
-
const queue = yield*
|
|
13775
|
+
const queue = yield* make20({
|
|
13620
13776
|
capacity: options.capacity === "unbounded" ? undefined : options.capacity,
|
|
13621
13777
|
strategy: options.capacity === "unbounded" ? undefined : options.strategy
|
|
13622
13778
|
});
|
|
@@ -13743,7 +13899,7 @@ var runIntoQueueArray = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), (se
|
|
|
13743
13899
|
}))));
|
|
13744
13900
|
var toQueueArray = /* @__PURE__ */ dual((args2) => isChannel(args2[0]), /* @__PURE__ */ fnUntraced2(function* (self, options) {
|
|
13745
13901
|
const scope3 = yield* scope2;
|
|
13746
|
-
const queue = yield*
|
|
13902
|
+
const queue = yield* make20({
|
|
13747
13903
|
capacity: typeof options.capacity === "number" ? options.capacity : undefined,
|
|
13748
13904
|
strategy: typeof options.capacity === "number" ? options.strategy : undefined
|
|
13749
13905
|
});
|
|
@@ -13767,14 +13923,14 @@ var toPubSubTake = /* @__PURE__ */ dual(2, /* @__PURE__ */ fnUntraced2(function*
|
|
|
13767
13923
|
}));
|
|
13768
13924
|
|
|
13769
13925
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/internal/stream.js
|
|
13770
|
-
var
|
|
13926
|
+
var TypeId27 = "~effect/Stream";
|
|
13771
13927
|
var streamVariance = {
|
|
13772
13928
|
_R: identity,
|
|
13773
13929
|
_E: identity,
|
|
13774
13930
|
_A: identity
|
|
13775
13931
|
};
|
|
13776
13932
|
var StreamProto = {
|
|
13777
|
-
[
|
|
13933
|
+
[TypeId27]: streamVariance,
|
|
13778
13934
|
pipe() {
|
|
13779
13935
|
return pipeArguments(this, arguments);
|
|
13780
13936
|
}
|
|
@@ -13786,7 +13942,7 @@ var fromChannel = (channel) => {
|
|
|
13786
13942
|
};
|
|
13787
13943
|
|
|
13788
13944
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Sink.js
|
|
13789
|
-
var
|
|
13945
|
+
var TypeId28 = "~effect/Sink";
|
|
13790
13946
|
var endVoid = /* @__PURE__ */ succeed6([undefined]);
|
|
13791
13947
|
var sinkVariance = {
|
|
13792
13948
|
_A: identity,
|
|
@@ -13796,7 +13952,7 @@ var sinkVariance = {
|
|
|
13796
13952
|
_R: identity
|
|
13797
13953
|
};
|
|
13798
13954
|
var SinkProto = {
|
|
13799
|
-
[
|
|
13955
|
+
[TypeId28]: sinkVariance,
|
|
13800
13956
|
pipe() {
|
|
13801
13957
|
return pipeArguments(this, arguments);
|
|
13802
13958
|
}
|
|
@@ -13979,7 +14135,7 @@ __export(exports_Stream, {
|
|
|
13979
14135
|
mapAccumArray: () => mapAccumArray,
|
|
13980
14136
|
mapAccum: () => mapAccum3,
|
|
13981
14137
|
map: () => map10,
|
|
13982
|
-
make: () =>
|
|
14138
|
+
make: () => make24,
|
|
13983
14139
|
let: () => let_5,
|
|
13984
14140
|
iterate: () => iterate,
|
|
13985
14141
|
isStream: () => isStream,
|
|
@@ -14078,15 +14234,15 @@ __export(exports_Stream, {
|
|
|
14078
14234
|
aggregateWithin: () => aggregateWithin,
|
|
14079
14235
|
aggregate: () => aggregate,
|
|
14080
14236
|
accumulate: () => accumulate,
|
|
14081
|
-
TypeId: () =>
|
|
14237
|
+
TypeId: () => TypeId32,
|
|
14082
14238
|
Do: () => Do4,
|
|
14083
14239
|
DefaultChunkSize: () => DefaultChunkSize2
|
|
14084
14240
|
});
|
|
14085
14241
|
|
|
14086
14242
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/MutableHashMap.js
|
|
14087
|
-
var
|
|
14243
|
+
var TypeId29 = "~effect/collections/MutableHashMap";
|
|
14088
14244
|
var MutableHashMapProto = {
|
|
14089
|
-
[
|
|
14245
|
+
[TypeId29]: TypeId29,
|
|
14090
14246
|
[Symbol.iterator]() {
|
|
14091
14247
|
return this.backing[Symbol.iterator]();
|
|
14092
14248
|
},
|
|
@@ -14141,7 +14297,7 @@ var getFromBucket = (self, bucket, key) => {
|
|
|
14141
14297
|
}
|
|
14142
14298
|
return none2();
|
|
14143
14299
|
};
|
|
14144
|
-
var
|
|
14300
|
+
var has2 = /* @__PURE__ */ dual(2, (self, key) => isSome2(get3(self, key)));
|
|
14145
14301
|
var set3 = /* @__PURE__ */ dual(3, (self, key, value3) => {
|
|
14146
14302
|
if (self.backing.has(key) || isSimpleKey(key)) {
|
|
14147
14303
|
self.backing.set(key, value3);
|
|
@@ -14207,9 +14363,9 @@ var clear2 = (self) => {
|
|
|
14207
14363
|
var size2 = (self) => self.backing.size;
|
|
14208
14364
|
|
|
14209
14365
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/RcMap.js
|
|
14210
|
-
var
|
|
14366
|
+
var TypeId30 = "~effect/RcMap";
|
|
14211
14367
|
var makeUnsafe7 = (options) => ({
|
|
14212
|
-
[
|
|
14368
|
+
[TypeId30]: TypeId30,
|
|
14213
14369
|
lookup: options.lookup,
|
|
14214
14370
|
context: options.context,
|
|
14215
14371
|
scope: options.scope,
|
|
@@ -14223,7 +14379,7 @@ var makeUnsafe7 = (options) => ({
|
|
|
14223
14379
|
return pipeArguments(this, arguments);
|
|
14224
14380
|
}
|
|
14225
14381
|
});
|
|
14226
|
-
var
|
|
14382
|
+
var make21 = (options) => withFiber2((fiber3) => {
|
|
14227
14383
|
const context3 = fiber3.context;
|
|
14228
14384
|
const scope3 = get(context3, Scope);
|
|
14229
14385
|
const self = makeUnsafe7({
|
|
@@ -14285,7 +14441,7 @@ var release = (self, key, entry) => withFiber2((fiber3) => {
|
|
|
14285
14441
|
entry.refCount--;
|
|
14286
14442
|
if (entry.refCount > 0) {
|
|
14287
14443
|
return void_4;
|
|
14288
|
-
} else if (self.state._tag === "Closed" || !
|
|
14444
|
+
} else if (self.state._tag === "Closed" || !has2(self.state.map, key) || isZero(entry.idleTimeToLive)) {
|
|
14289
14445
|
if (self.state._tag === "Open") {
|
|
14290
14446
|
remove3(self.state.map, key);
|
|
14291
14447
|
}
|
|
@@ -14326,7 +14482,7 @@ var touch = /* @__PURE__ */ dual(2, (self, key) => clockWith2((clock) => {
|
|
|
14326
14482
|
}));
|
|
14327
14483
|
|
|
14328
14484
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/internal/rcRef.js
|
|
14329
|
-
var
|
|
14485
|
+
var TypeId31 = "~effect/RcRef";
|
|
14330
14486
|
var stateEmpty = {
|
|
14331
14487
|
_tag: "Empty"
|
|
14332
14488
|
};
|
|
@@ -14339,7 +14495,7 @@ var variance2 = {
|
|
|
14339
14495
|
};
|
|
14340
14496
|
|
|
14341
14497
|
class RcRefImpl {
|
|
14342
|
-
[
|
|
14498
|
+
[TypeId31] = variance2;
|
|
14343
14499
|
pipe() {
|
|
14344
14500
|
return pipeArguments(this, arguments);
|
|
14345
14501
|
}
|
|
@@ -14356,7 +14512,7 @@ class RcRefImpl {
|
|
|
14356
14512
|
this.idleTimeToLive = idleTimeToLive;
|
|
14357
14513
|
}
|
|
14358
14514
|
}
|
|
14359
|
-
var
|
|
14515
|
+
var make22 = (options) => withFiber2((fiber3) => {
|
|
14360
14516
|
const context3 = fiber3.context;
|
|
14361
14517
|
const scope3 = get(context3, Scope);
|
|
14362
14518
|
const ref = new RcRefImpl(options.acquire, context3, scope3, options.idleTimeToLive ? fromInputUnsafe(options.idleTimeToLive) : undefined);
|
|
@@ -14425,12 +14581,12 @@ var get5 = /* @__PURE__ */ fnUntraced2(function* (self_) {
|
|
|
14425
14581
|
});
|
|
14426
14582
|
|
|
14427
14583
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/RcRef.js
|
|
14428
|
-
var
|
|
14584
|
+
var make23 = make22;
|
|
14429
14585
|
var get6 = get5;
|
|
14430
14586
|
|
|
14431
14587
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Stream.js
|
|
14432
|
-
var
|
|
14433
|
-
var isStream = (u) => hasProperty(u,
|
|
14588
|
+
var TypeId32 = "~effect/Stream";
|
|
14589
|
+
var isStream = (u) => hasProperty(u, TypeId32);
|
|
14434
14590
|
var DefaultChunkSize2 = DefaultChunkSize;
|
|
14435
14591
|
var fromChannel3 = fromChannel;
|
|
14436
14592
|
var fromEffect2 = (effect2) => fromChannel3(fromEffect(map8(effect2, of)));
|
|
@@ -14473,7 +14629,7 @@ var toChannel2 = (stream) => stream.channel;
|
|
|
14473
14629
|
var callback3 = (f, options) => fromChannel3(callbackArray(f, options));
|
|
14474
14630
|
var empty9 = /* @__PURE__ */ fromChannel3(empty7);
|
|
14475
14631
|
var succeed8 = (value3) => fromChannel3(succeed7(of(value3)));
|
|
14476
|
-
var
|
|
14632
|
+
var make24 = (...values) => fromArray2(values);
|
|
14477
14633
|
var sync5 = (evaluate2) => fromChannel3(sync4(() => of(evaluate2())));
|
|
14478
14634
|
var suspend5 = (stream) => fromChannel3(suspend4(() => stream().channel));
|
|
14479
14635
|
var fail9 = (error) => fromChannel3(fail7(error));
|
|
@@ -14862,10 +15018,10 @@ var partitionQueue = /* @__PURE__ */ dual((args2) => isStream(args2[0]), /* @__P
|
|
|
14862
15018
|
const scope3 = yield* scope2;
|
|
14863
15019
|
const pull = yield* toPullScoped(self.channel, scope3);
|
|
14864
15020
|
const capacity = options?.capacity === "unbounded" ? undefined : options?.capacity ?? DefaultChunkSize2;
|
|
14865
|
-
const passes = yield*
|
|
15021
|
+
const passes = yield* make20({
|
|
14866
15022
|
capacity
|
|
14867
15023
|
});
|
|
14868
|
-
const fails = yield*
|
|
15024
|
+
const fails = yield* make20({
|
|
14869
15025
|
capacity
|
|
14870
15026
|
});
|
|
14871
15027
|
yield* gen3(function* () {
|
|
@@ -15013,7 +15169,7 @@ var withExecutionPlan3 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (se
|
|
|
15013
15169
|
return loop;
|
|
15014
15170
|
}));
|
|
15015
15171
|
var take6 = /* @__PURE__ */ dual(2, (self, n) => n < 1 ? empty9 : takeUntil(self, (_, i) => i === n - 1));
|
|
15016
|
-
var takeRight = /* @__PURE__ */ dual(2, (self, n) => mapAccumArray(self,
|
|
15172
|
+
var takeRight = /* @__PURE__ */ dual(2, (self, n) => mapAccumArray(self, make17, (list, arr) => {
|
|
15017
15173
|
appendAll2(list, arr);
|
|
15018
15174
|
if (list.length > n) {
|
|
15019
15175
|
takeNVoid(list, list.length - n);
|
|
@@ -15148,7 +15304,7 @@ var dropRight = /* @__PURE__ */ dual(2, (self, n) => {
|
|
|
15148
15304
|
if (n <= 0)
|
|
15149
15305
|
return self;
|
|
15150
15306
|
return transformPull2(self, (pull, _scope) => sync3(() => {
|
|
15151
|
-
const list =
|
|
15307
|
+
const list = make17();
|
|
15152
15308
|
const emit = flatMap5(pull, (arr) => {
|
|
15153
15309
|
appendAllUnsafe(list, arr);
|
|
15154
15310
|
const toTake = list.length - n;
|
|
@@ -15205,7 +15361,7 @@ var rechunk = /* @__PURE__ */ dual(2, (self, target) => {
|
|
|
15205
15361
|
var sliding2 = /* @__PURE__ */ dual(2, (self, chunkSize) => slidingSize(self, chunkSize, 1));
|
|
15206
15362
|
var slidingSize = /* @__PURE__ */ dual(3, (self, chunkSize, stepSize) => transformPull2(self, (upstream, _scope) => sync3(() => {
|
|
15207
15363
|
let cause = null;
|
|
15208
|
-
const list =
|
|
15364
|
+
const list = make17();
|
|
15209
15365
|
let emitted = false;
|
|
15210
15366
|
const pull = matchCauseEffect2(upstream, {
|
|
15211
15367
|
onSuccess(arr) {
|
|
@@ -15466,8 +15622,8 @@ var groupByImpl = (self, f, options) => transformPullBracket(self, fnUntraced2(f
|
|
|
15466
15622
|
const out = yield* unbounded2();
|
|
15467
15623
|
yield* addFinalizer2(scope3, shutdown2(out));
|
|
15468
15624
|
const queueMap = empty8();
|
|
15469
|
-
const queues = yield*
|
|
15470
|
-
lookup: (key) => acquireRelease2(
|
|
15625
|
+
const queues = yield* make21({
|
|
15626
|
+
lookup: (key) => acquireRelease2(make20({
|
|
15471
15627
|
capacity: options?.bufferSize ?? 4096
|
|
15472
15628
|
}).pipe(tap5((queue) => {
|
|
15473
15629
|
set3(queueMap, key, queue);
|
|
@@ -15545,7 +15701,7 @@ var aggregateWithin = /* @__PURE__ */ dual(3, (self, sink, schedule4) => fromCha
|
|
|
15545
15701
|
const pull = yield* toPullScoped(self.channel, _);
|
|
15546
15702
|
const pullLatch = makeUnsafe5(false);
|
|
15547
15703
|
const scheduleStep = Symbol();
|
|
15548
|
-
const buffer3 = yield*
|
|
15704
|
+
const buffer3 = yield* make20({
|
|
15549
15705
|
capacity: 0
|
|
15550
15706
|
});
|
|
15551
15707
|
yield* pull.pipe(pullLatch.whenOpen, flatMap5((arr) => {
|
|
@@ -15605,7 +15761,7 @@ var broadcastN = /* @__PURE__ */ dual(2, /* @__PURE__ */ fnUntraced2(function* (
|
|
|
15605
15761
|
}));
|
|
15606
15762
|
var makePubSub2 = (options) => acquireRelease2(options.capacity === "unbounded" ? unbounded(options) : options.strategy === "dropping" ? dropping(options) : options.strategy === "sliding" ? sliding(options) : bounded(options), shutdown);
|
|
15607
15763
|
var broadcast = /* @__PURE__ */ dual(2, (self, options) => map8(toPubSubTake2(self, options), fromPubSubTake2));
|
|
15608
|
-
var share = /* @__PURE__ */ dual(2, (self, options) => map8(
|
|
15764
|
+
var share = /* @__PURE__ */ dual(2, (self, options) => map8(make23({
|
|
15609
15765
|
acquire: broadcast(self, options),
|
|
15610
15766
|
idleTimeToLive: options.idleTimeToLive
|
|
15611
15767
|
}), (ref) => unwrap4(get6(ref))));
|
|
@@ -15921,7 +16077,7 @@ var toQueue = /* @__PURE__ */ dual(2, (self, options) => toQueueArray(self.chann
|
|
|
15921
16077
|
var runIntoQueue = /* @__PURE__ */ dual(2, (self, queue) => runIntoQueueArray(self.channel, queue));
|
|
15922
16078
|
|
|
15923
16079
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/FileSystem.js
|
|
15924
|
-
var
|
|
16080
|
+
var TypeId33 = "~effect/platform/FileSystem";
|
|
15925
16081
|
var Size = (bytes) => typeof bytes === "bigint" ? bytes : BigInt(bytes);
|
|
15926
16082
|
var KiB = (n) => Size(n * 1024);
|
|
15927
16083
|
var MiB = (n) => Size(n * 1024 * 1024);
|
|
@@ -15931,11 +16087,11 @@ var bigint1024 = /* @__PURE__ */ BigInt(1024);
|
|
|
15931
16087
|
var bigintPiB = bigint1024 * bigint1024 * bigint1024 * bigint1024 * bigint1024;
|
|
15932
16088
|
var PiB = (n) => Size(BigInt(n) * bigintPiB);
|
|
15933
16089
|
var FileSystem = /* @__PURE__ */ Service("effect/platform/FileSystem");
|
|
15934
|
-
var
|
|
16090
|
+
var make25 = (impl) => FileSystem.of({
|
|
15935
16091
|
...impl,
|
|
15936
|
-
[
|
|
16092
|
+
[TypeId33]: TypeId33,
|
|
15937
16093
|
exists: (path) => pipe(impl.access(path), as3(true), catchTag3("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed6(false) : fail5(e))),
|
|
15938
|
-
readFileString: (path, encoding) => flatMap5(impl.readFile(path), (_) =>
|
|
16094
|
+
readFileString: (path, encoding) => flatMap5(impl.readFile(path), (_) => try_3({
|
|
15939
16095
|
try: () => new TextDecoder(encoding).decode(_),
|
|
15940
16096
|
catch: (cause) => badArgument({
|
|
15941
16097
|
module: "FileSystem",
|
|
@@ -15972,7 +16128,7 @@ var make24 = (impl) => FileSystem.of({
|
|
|
15972
16128
|
flag: "w",
|
|
15973
16129
|
...options
|
|
15974
16130
|
}), map8((file) => forEach3((_) => file.writeAll(_))), unwrap3),
|
|
15975
|
-
writeFileString: (path, data, options) => flatMap5(
|
|
16131
|
+
writeFileString: (path, data, options) => flatMap5(try_3({
|
|
15976
16132
|
try: () => new TextEncoder().encode(data),
|
|
15977
16133
|
catch: (cause) => badArgument({
|
|
15978
16134
|
module: "FileSystem",
|
|
@@ -15990,7 +16146,7 @@ var notFound = (method, path) => systemError({
|
|
|
15990
16146
|
pathOrDescriptor: path
|
|
15991
16147
|
});
|
|
15992
16148
|
var makeNoop = (fileSystem) => FileSystem.of({
|
|
15993
|
-
[
|
|
16149
|
+
[TypeId33]: TypeId33,
|
|
15994
16150
|
access(path) {
|
|
15995
16151
|
return fail5(notFound("access", path));
|
|
15996
16152
|
},
|
|
@@ -16106,13 +16262,13 @@ __export(exports_HashMap, {
|
|
|
16106
16262
|
modifyAt: () => modifyAt2,
|
|
16107
16263
|
modify: () => modify3,
|
|
16108
16264
|
map: () => map12,
|
|
16109
|
-
make: () =>
|
|
16265
|
+
make: () => make27,
|
|
16110
16266
|
keys: () => keys4,
|
|
16111
16267
|
isHashMap: () => isHashMap2,
|
|
16112
16268
|
isEmpty: () => isEmpty2,
|
|
16113
16269
|
hasHash: () => hasHash2,
|
|
16114
16270
|
hasBy: () => hasBy2,
|
|
16115
|
-
has: () =>
|
|
16271
|
+
has: () => has4,
|
|
16116
16272
|
getUnsafe: () => getUnsafe5,
|
|
16117
16273
|
getHash: () => getHash2,
|
|
16118
16274
|
get: () => get8,
|
|
@@ -16699,7 +16855,7 @@ class HashMapImpl {
|
|
|
16699
16855
|
var emptyNode = /* @__PURE__ */ new EmptyNode;
|
|
16700
16856
|
var isHashMap = (u) => hasProperty(u, HashMapTypeId);
|
|
16701
16857
|
var empty10 = () => new HashMapImpl(false, 0, emptyNode, 0);
|
|
16702
|
-
var
|
|
16858
|
+
var make26 = (...entries) => fromIterable5(entries);
|
|
16703
16859
|
var fromIterable5 = (entries) => {
|
|
16704
16860
|
let root = emptyNode;
|
|
16705
16861
|
let size3 = 0;
|
|
@@ -16732,7 +16888,7 @@ var getUnsafe4 = /* @__PURE__ */ dual(2, (self, key) => {
|
|
|
16732
16888
|
}
|
|
16733
16889
|
throw new Error(`HashMap.getUnsafe: key not found: ${key}`);
|
|
16734
16890
|
});
|
|
16735
|
-
var
|
|
16891
|
+
var has3 = /* @__PURE__ */ dual(2, (self, key) => {
|
|
16736
16892
|
const impl = self;
|
|
16737
16893
|
return impl._root.has(0, hash(key), key);
|
|
16738
16894
|
});
|
|
@@ -16840,7 +16996,7 @@ var modifyAt = /* @__PURE__ */ dual(3, (self, key, f) => {
|
|
|
16840
16996
|
const current = get7(self, key);
|
|
16841
16997
|
const updated = f(current);
|
|
16842
16998
|
if (isNone2(updated)) {
|
|
16843
|
-
return
|
|
16999
|
+
return has3(self, key) ? remove4(self, key) : self;
|
|
16844
17000
|
}
|
|
16845
17001
|
return set4(self, key, updated.value);
|
|
16846
17002
|
});
|
|
@@ -16979,13 +17135,13 @@ var every = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
|
16979
17135
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/HashMap.js
|
|
16980
17136
|
var isHashMap2 = isHashMap;
|
|
16981
17137
|
var empty11 = empty10;
|
|
16982
|
-
var
|
|
17138
|
+
var make27 = make26;
|
|
16983
17139
|
var fromIterable6 = fromIterable5;
|
|
16984
17140
|
var isEmpty2 = isEmpty;
|
|
16985
17141
|
var get8 = get7;
|
|
16986
17142
|
var getHash2 = getHash;
|
|
16987
17143
|
var getUnsafe5 = getUnsafe4;
|
|
16988
|
-
var
|
|
17144
|
+
var has4 = has3;
|
|
16989
17145
|
var hasHash2 = hasHash;
|
|
16990
17146
|
var hasBy2 = hasBy;
|
|
16991
17147
|
var set5 = set4;
|
|
@@ -17019,10 +17175,10 @@ var every2 = every;
|
|
|
17019
17175
|
var exports_Path = {};
|
|
17020
17176
|
__export(exports_Path, {
|
|
17021
17177
|
layer: () => layer,
|
|
17022
|
-
TypeId: () =>
|
|
17178
|
+
TypeId: () => TypeId34,
|
|
17023
17179
|
Path: () => Path
|
|
17024
17180
|
});
|
|
17025
|
-
var
|
|
17181
|
+
var TypeId34 = "~effect/platform/Path";
|
|
17026
17182
|
var Path = /* @__PURE__ */ Service("effect/Path");
|
|
17027
17183
|
function normalizeStringPosix(path, allowAboveRoot) {
|
|
17028
17184
|
let res = "";
|
|
@@ -17199,7 +17355,7 @@ function encodePathChars(filepath) {
|
|
|
17199
17355
|
return filepath;
|
|
17200
17356
|
}
|
|
17201
17357
|
var posixImpl = /* @__PURE__ */ Path.of({
|
|
17202
|
-
[
|
|
17358
|
+
[TypeId34]: TypeId34,
|
|
17203
17359
|
resolve: resolve2,
|
|
17204
17360
|
normalize(path) {
|
|
17205
17361
|
if (path.length === 0)
|
|
@@ -17517,16 +17673,16 @@ __export(exports_Ref, {
|
|
|
17517
17673
|
modifySome: () => modifySome,
|
|
17518
17674
|
modify: () => modify4,
|
|
17519
17675
|
makeUnsafe: () => makeUnsafe8,
|
|
17520
|
-
make: () =>
|
|
17676
|
+
make: () => make28,
|
|
17521
17677
|
getUnsafe: () => getUnsafe6,
|
|
17522
17678
|
getAndUpdateSome: () => getAndUpdateSome,
|
|
17523
17679
|
getAndUpdate: () => getAndUpdate,
|
|
17524
17680
|
getAndSet: () => getAndSet,
|
|
17525
17681
|
get: () => get9
|
|
17526
17682
|
});
|
|
17527
|
-
var
|
|
17683
|
+
var TypeId35 = "~effect/Ref";
|
|
17528
17684
|
var RefProto = {
|
|
17529
|
-
[
|
|
17685
|
+
[TypeId35]: {
|
|
17530
17686
|
_A: identity
|
|
17531
17687
|
},
|
|
17532
17688
|
...PipeInspectableProto,
|
|
@@ -17539,10 +17695,10 @@ var RefProto = {
|
|
|
17539
17695
|
};
|
|
17540
17696
|
var makeUnsafe8 = (value3) => {
|
|
17541
17697
|
const self = Object.create(RefProto);
|
|
17542
|
-
self.ref =
|
|
17698
|
+
self.ref = make18(value3);
|
|
17543
17699
|
return self;
|
|
17544
17700
|
};
|
|
17545
|
-
var
|
|
17701
|
+
var make28 = (value3) => sync3(() => makeUnsafe8(value3));
|
|
17546
17702
|
var get9 = (self) => sync3(() => self.ref.current);
|
|
17547
17703
|
var set6 = /* @__PURE__ */ dual(2, (self, value3) => sync3(() => set2(self.ref, value3)));
|
|
17548
17704
|
var getAndSet = /* @__PURE__ */ dual(2, (self, value3) => sync3(() => {
|
|
@@ -17648,7 +17804,7 @@ __export(exports_Schema, {
|
|
|
17648
17804
|
makeIsBetween: () => makeIsBetween,
|
|
17649
17805
|
makeFilterGroup: () => makeFilterGroup,
|
|
17650
17806
|
makeFilter: () => makeFilter2,
|
|
17651
|
-
make: () =>
|
|
17807
|
+
make: () => make33,
|
|
17652
17808
|
link: () => link,
|
|
17653
17809
|
isUppercased: () => isUppercased,
|
|
17654
17810
|
isUnique: () => isUnique,
|
|
@@ -17774,7 +17930,7 @@ __export(exports_Schema, {
|
|
|
17774
17930
|
URLFromString: () => URLFromString,
|
|
17775
17931
|
URL: () => URL2,
|
|
17776
17932
|
TupleWithRest: () => TupleWithRest,
|
|
17777
|
-
Tuple: () =>
|
|
17933
|
+
Tuple: () => Tuple2,
|
|
17778
17934
|
Trimmed: () => Trimmed,
|
|
17779
17935
|
Trim: () => Trim,
|
|
17780
17936
|
Tree: () => Tree,
|
|
@@ -17853,7 +18009,7 @@ __export(exports_Schema, {
|
|
|
17853
18009
|
DateTimeUtc: () => DateTimeUtc,
|
|
17854
18010
|
DateFromString: () => DateFromString,
|
|
17855
18011
|
Date: () => Date4,
|
|
17856
|
-
Class: () =>
|
|
18012
|
+
Class: () => Class4,
|
|
17857
18013
|
Chunk: () => Chunk,
|
|
17858
18014
|
Char: () => Char,
|
|
17859
18015
|
CauseReason: () => CauseReason,
|
|
@@ -17876,7 +18032,7 @@ var HashSetProto = {
|
|
|
17876
18032
|
return hash(HashSetTypeId);
|
|
17877
18033
|
},
|
|
17878
18034
|
[symbol2](that) {
|
|
17879
|
-
return isHashSet(that) && size5(this) === size5(that) && every3(this, (value3) =>
|
|
18035
|
+
return isHashSet(that) && size5(this) === size5(that) && every3(this, (value3) => has5(that, value3));
|
|
17880
18036
|
},
|
|
17881
18037
|
[Symbol.iterator]() {
|
|
17882
18038
|
return keys3(keyMap(this));
|
|
@@ -17912,7 +18068,7 @@ var fromIterable7 = (values3) => {
|
|
|
17912
18068
|
}
|
|
17913
18069
|
return makeImpl(map13);
|
|
17914
18070
|
};
|
|
17915
|
-
var
|
|
18071
|
+
var has5 = (self, value3) => has3(keyMap(self), value3);
|
|
17916
18072
|
var size5 = (self) => size3(keyMap(self));
|
|
17917
18073
|
var every3 = (self, predicate) => {
|
|
17918
18074
|
for (const value3 of self) {
|
|
@@ -18059,17 +18215,17 @@ function appendObjectEntries(out, entries3) {
|
|
|
18059
18215
|
}
|
|
18060
18216
|
var max4 = /* @__PURE__ */ makeReducer2(ReducerMax);
|
|
18061
18217
|
var min4 = /* @__PURE__ */ makeReducer2(ReducerMin);
|
|
18062
|
-
var
|
|
18218
|
+
var or2 = /* @__PURE__ */ makeReducer2(ReducerOr);
|
|
18063
18219
|
var concat2 = /* @__PURE__ */ makeReducer2(/* @__PURE__ */ makeReducerConcat());
|
|
18064
18220
|
var combiner = /* @__PURE__ */ makeCombiner({
|
|
18065
|
-
integer:
|
|
18221
|
+
integer: or2,
|
|
18066
18222
|
maxLength: min4,
|
|
18067
18223
|
minLength: max4,
|
|
18068
|
-
noInfinity:
|
|
18069
|
-
noNaN:
|
|
18224
|
+
noInfinity: or2,
|
|
18225
|
+
noNaN: or2,
|
|
18070
18226
|
patterns: concat2,
|
|
18071
|
-
unique:
|
|
18072
|
-
valid:
|
|
18227
|
+
unique: or2,
|
|
18228
|
+
valid: or2
|
|
18073
18229
|
}, {
|
|
18074
18230
|
omitKeyWhen: isUndefined
|
|
18075
18231
|
});
|
|
@@ -18782,7 +18938,7 @@ function makeOption(schema) {
|
|
|
18782
18938
|
return none2();
|
|
18783
18939
|
};
|
|
18784
18940
|
}
|
|
18785
|
-
function
|
|
18941
|
+
function make30(schema) {
|
|
18786
18942
|
const parser = makeEffect(schema);
|
|
18787
18943
|
return (input, options) => {
|
|
18788
18944
|
const exit3 = runSyncExit2(parser(input, options));
|
|
@@ -19143,9 +19299,9 @@ var RegExp2 = globalThis.RegExp;
|
|
|
19143
19299
|
var escape = (string3) => string3.replace(/[/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
19144
19300
|
|
|
19145
19301
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/internal/schema/schema.js
|
|
19146
|
-
var
|
|
19302
|
+
var TypeId36 = "~effect/Schema/Schema";
|
|
19147
19303
|
var SchemaProto = {
|
|
19148
|
-
[
|
|
19304
|
+
[TypeId36]: TypeId36,
|
|
19149
19305
|
pipe() {
|
|
19150
19306
|
return pipeArguments(this, arguments);
|
|
19151
19307
|
},
|
|
@@ -19159,15 +19315,15 @@ var SchemaProto = {
|
|
|
19159
19315
|
return this.rebuild(appendChecks(this.ast, checks));
|
|
19160
19316
|
}
|
|
19161
19317
|
};
|
|
19162
|
-
function
|
|
19318
|
+
function make31(ast, options) {
|
|
19163
19319
|
const self = Object.create(SchemaProto);
|
|
19164
19320
|
if (options) {
|
|
19165
19321
|
Object.assign(self, options);
|
|
19166
19322
|
}
|
|
19167
19323
|
self.ast = ast;
|
|
19168
|
-
self.rebuild = (ast2) =>
|
|
19324
|
+
self.rebuild = (ast2) => make31(ast2, options);
|
|
19169
19325
|
self.makeEffect = (input, options2) => mapSchemaIssueEffect2(makeEffect(self)(input, options2));
|
|
19170
|
-
self.make =
|
|
19326
|
+
self.make = make30(self);
|
|
19171
19327
|
self.makeOption = makeOption(self);
|
|
19172
19328
|
return self;
|
|
19173
19329
|
}
|
|
@@ -19314,7 +19470,7 @@ function fromASTs(asts) {
|
|
|
19314
19470
|
function getEncodedSchema(last) {
|
|
19315
19471
|
const getLink = last.annotations?.toCodecJson ?? last.annotations?.toCodec;
|
|
19316
19472
|
if (isFunction(getLink)) {
|
|
19317
|
-
const tps = last.typeParameters.map((tp) =>
|
|
19473
|
+
const tps = last.typeParameters.map((tp) => make31(toEncoded(tp)));
|
|
19318
19474
|
const link = getLink(tps);
|
|
19319
19475
|
return replaceEncoding(last, [link]);
|
|
19320
19476
|
}
|
|
@@ -20444,10 +20600,10 @@ function walk_object(value3, walk) {
|
|
|
20444
20600
|
|
|
20445
20601
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Optic.js
|
|
20446
20602
|
function makeIso(get11, set7) {
|
|
20447
|
-
return
|
|
20603
|
+
return make32(new IsoNode(get11, set7));
|
|
20448
20604
|
}
|
|
20449
20605
|
function makeLens(get11, replace) {
|
|
20450
|
-
return
|
|
20606
|
+
return make32(new LensNode(get11, replace));
|
|
20451
20607
|
}
|
|
20452
20608
|
class IdentityNode {
|
|
20453
20609
|
_tag = "IdentityNode";
|
|
@@ -20555,7 +20711,7 @@ function compose(a, b) {
|
|
|
20555
20711
|
}
|
|
20556
20712
|
}
|
|
20557
20713
|
function makeOptional(getResult, set7) {
|
|
20558
|
-
return
|
|
20714
|
+
return make32(new OptionalNode(getResult, set7));
|
|
20559
20715
|
}
|
|
20560
20716
|
|
|
20561
20717
|
class OptionalImpl {
|
|
@@ -20574,13 +20730,13 @@ class OptionalImpl {
|
|
|
20574
20730
|
return (s) => getOrElse3(flatMap2(this.getResult(s), (a) => this.replaceResult(f(a), s)), () => s);
|
|
20575
20731
|
}
|
|
20576
20732
|
compose(that) {
|
|
20577
|
-
return
|
|
20733
|
+
return make32(compose(this.node, that.node));
|
|
20578
20734
|
}
|
|
20579
20735
|
key(key) {
|
|
20580
|
-
return
|
|
20736
|
+
return make32(compose(this.node, new PathNode([key])));
|
|
20581
20737
|
}
|
|
20582
20738
|
optionalKey(key) {
|
|
20583
|
-
return
|
|
20739
|
+
return make32(compose(this.node, new LensNode((s) => s[key], (a, s) => {
|
|
20584
20740
|
const copy2 = cloneShallow(s);
|
|
20585
20741
|
if (a === undefined) {
|
|
20586
20742
|
if (Array.isArray(copy2) && typeof key === "number") {
|
|
@@ -20595,17 +20751,17 @@ class OptionalImpl {
|
|
|
20595
20751
|
})));
|
|
20596
20752
|
}
|
|
20597
20753
|
check(...checks) {
|
|
20598
|
-
return
|
|
20754
|
+
return make32(compose(this.node, new CheckNode(checks)));
|
|
20599
20755
|
}
|
|
20600
20756
|
refine(refinement, annotations) {
|
|
20601
|
-
return
|
|
20757
|
+
return make32(compose(this.node, new CheckNode([makeFilterByGuard(refinement, annotations)])));
|
|
20602
20758
|
}
|
|
20603
20759
|
tag(tag) {
|
|
20604
|
-
return
|
|
20760
|
+
return make32(compose(this.node, new PrismNode((s) => s._tag === tag ? succeed2(s) : fail2(`Expected ${format(tag)} tag, got ${format(s._tag)}`), identity)));
|
|
20605
20761
|
}
|
|
20606
20762
|
at(key, ..._rest) {
|
|
20607
20763
|
const err = fail2(`Key ${format(key)} not found`);
|
|
20608
|
-
return
|
|
20764
|
+
return make32(compose(this.node, new OptionalNode((s) => Object.hasOwn(s, key) ? succeed2(s[key]) : err, (a, s) => {
|
|
20609
20765
|
if (Object.hasOwn(s, key)) {
|
|
20610
20766
|
const copy2 = cloneShallow(s);
|
|
20611
20767
|
copy2[key] = a;
|
|
@@ -20709,7 +20865,7 @@ class PrismImpl extends OptionalImpl {
|
|
|
20709
20865
|
return (s) => getOrElse3(map2(this.getResult(s), (a) => this.set(f(a))), () => s);
|
|
20710
20866
|
}
|
|
20711
20867
|
}
|
|
20712
|
-
function
|
|
20868
|
+
function make32(node) {
|
|
20713
20869
|
const op = recur4(node);
|
|
20714
20870
|
switch (op._tag) {
|
|
20715
20871
|
case "IsoNode":
|
|
@@ -20862,7 +21018,7 @@ function getCompositionTag(a, b) {
|
|
|
20862
21018
|
return "OptionalNode";
|
|
20863
21019
|
}
|
|
20864
21020
|
}
|
|
20865
|
-
var identityIso = /* @__PURE__ */
|
|
21021
|
+
var identityIso = /* @__PURE__ */ make32(identityNode);
|
|
20866
21022
|
function id() {
|
|
20867
21023
|
return identityIso;
|
|
20868
21024
|
}
|
|
@@ -31014,10 +31170,10 @@ var __type = "module";
|
|
|
31014
31170
|
var __version = "4.8.0";
|
|
31015
31171
|
var __commitHash = "c0da76fbcf6470339ad7bb2f0dfcebee06ede56c";
|
|
31016
31172
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/Schema.js
|
|
31017
|
-
var
|
|
31173
|
+
var TypeId37 = TypeId36;
|
|
31018
31174
|
function declareConstructor() {
|
|
31019
31175
|
return (typeParameters, run3, annotations) => {
|
|
31020
|
-
return
|
|
31176
|
+
return make33(new Declaration(typeParameters.map(getAST), (typeParameters2) => run3(typeParameters2.map((ast) => make33(ast))), annotations));
|
|
31021
31177
|
};
|
|
31022
31178
|
}
|
|
31023
31179
|
function declare(is2, annotations) {
|
|
@@ -31249,30 +31405,30 @@ function encodeUnknownSync2(schema, options) {
|
|
|
31249
31405
|
};
|
|
31250
31406
|
}
|
|
31251
31407
|
var encodeSync2 = encodeUnknownSync2;
|
|
31252
|
-
var
|
|
31408
|
+
var make33 = make31;
|
|
31253
31409
|
function asClass(schema) {
|
|
31254
31410
|
|
|
31255
|
-
class
|
|
31411
|
+
class Class4 {
|
|
31256
31412
|
}
|
|
31257
|
-
return Object.setPrototypeOf(
|
|
31413
|
+
return Object.setPrototypeOf(Class4, schema);
|
|
31258
31414
|
}
|
|
31259
31415
|
function isSchema(u) {
|
|
31260
|
-
return hasProperty(u,
|
|
31416
|
+
return hasProperty(u, TypeId37) && u[TypeId37] === TypeId37;
|
|
31261
31417
|
}
|
|
31262
|
-
var optionalKey2 = /* @__PURE__ */ lambda((schema) =>
|
|
31418
|
+
var optionalKey2 = /* @__PURE__ */ lambda((schema) => make33(optionalKey(schema.ast), {
|
|
31263
31419
|
schema
|
|
31264
31420
|
}));
|
|
31265
31421
|
var requiredKey = /* @__PURE__ */ lambda((self) => self.schema);
|
|
31266
31422
|
var optional = /* @__PURE__ */ lambda((self) => optionalKey2(UndefinedOr(self)));
|
|
31267
31423
|
var required = /* @__PURE__ */ lambda((self) => self.schema.members[0]);
|
|
31268
|
-
var mutableKey2 = /* @__PURE__ */ lambda((schema) =>
|
|
31424
|
+
var mutableKey2 = /* @__PURE__ */ lambda((schema) => make33(mutableKey(schema.ast), {
|
|
31269
31425
|
schema
|
|
31270
31426
|
}));
|
|
31271
31427
|
var readonlyKey = /* @__PURE__ */ lambda((self) => self.schema);
|
|
31272
|
-
var toType2 = /* @__PURE__ */ lambda((schema) =>
|
|
31428
|
+
var toType2 = /* @__PURE__ */ lambda((schema) => make33(toType(schema.ast), {
|
|
31273
31429
|
schema
|
|
31274
31430
|
}));
|
|
31275
|
-
var toEncoded2 = /* @__PURE__ */ lambda((schema) =>
|
|
31431
|
+
var toEncoded2 = /* @__PURE__ */ lambda((schema) => make33(toEncoded(schema.ast), {
|
|
31276
31432
|
schema
|
|
31277
31433
|
}));
|
|
31278
31434
|
var FlipTypeId = "~effect/Schema/flip";
|
|
@@ -31283,13 +31439,13 @@ function flip4(schema) {
|
|
|
31283
31439
|
if (isFlip$(schema)) {
|
|
31284
31440
|
return schema.schema.rebuild(flip3(schema.ast));
|
|
31285
31441
|
}
|
|
31286
|
-
return
|
|
31442
|
+
return make33(flip3(schema.ast), {
|
|
31287
31443
|
[FlipTypeId]: FlipTypeId,
|
|
31288
31444
|
schema
|
|
31289
31445
|
});
|
|
31290
31446
|
}
|
|
31291
31447
|
function Literal2(literal) {
|
|
31292
|
-
const out =
|
|
31448
|
+
const out = make33(new Literal(literal), {
|
|
31293
31449
|
literal,
|
|
31294
31450
|
transform(to) {
|
|
31295
31451
|
return out.pipe(decodeTo2(Literal2(to), {
|
|
@@ -31304,37 +31460,37 @@ function templateLiteralFromParts(parts) {
|
|
|
31304
31460
|
return new TemplateLiteral(parts.map((part) => isSchema(part) ? part.ast : new Literal(part)));
|
|
31305
31461
|
}
|
|
31306
31462
|
function TemplateLiteral2(parts) {
|
|
31307
|
-
return
|
|
31463
|
+
return make33(templateLiteralFromParts(parts), {
|
|
31308
31464
|
parts
|
|
31309
31465
|
});
|
|
31310
31466
|
}
|
|
31311
31467
|
function TemplateLiteralParser(parts) {
|
|
31312
|
-
return
|
|
31468
|
+
return make33(templateLiteralFromParts(parts).asTemplateLiteralParser(), {
|
|
31313
31469
|
parts
|
|
31314
31470
|
});
|
|
31315
31471
|
}
|
|
31316
31472
|
function Enum2(enums) {
|
|
31317
|
-
return
|
|
31473
|
+
return make33(new Enum(Object.keys(enums).filter((key) => typeof enums[enums[key]] !== "number").map((key) => [key, enums[key]])), {
|
|
31318
31474
|
enums
|
|
31319
31475
|
});
|
|
31320
31476
|
}
|
|
31321
|
-
var Never2 = /* @__PURE__ */
|
|
31322
|
-
var Any2 = /* @__PURE__ */
|
|
31323
|
-
var Unknown2 = /* @__PURE__ */
|
|
31324
|
-
var Null2 = /* @__PURE__ */
|
|
31325
|
-
var Undefined2 = /* @__PURE__ */
|
|
31326
|
-
var String5 = /* @__PURE__ */
|
|
31327
|
-
var Number6 = /* @__PURE__ */
|
|
31328
|
-
var Boolean4 = /* @__PURE__ */
|
|
31329
|
-
var Symbol3 = /* @__PURE__ */
|
|
31330
|
-
var BigInt5 = /* @__PURE__ */
|
|
31331
|
-
var Void2 = /* @__PURE__ */
|
|
31332
|
-
var ObjectKeyword2 = /* @__PURE__ */
|
|
31477
|
+
var Never2 = /* @__PURE__ */ make33(never3);
|
|
31478
|
+
var Any2 = /* @__PURE__ */ make33(any);
|
|
31479
|
+
var Unknown2 = /* @__PURE__ */ make33(unknown);
|
|
31480
|
+
var Null2 = /* @__PURE__ */ make33(null_);
|
|
31481
|
+
var Undefined2 = /* @__PURE__ */ make33(undefined_3);
|
|
31482
|
+
var String5 = /* @__PURE__ */ make33(string2);
|
|
31483
|
+
var Number6 = /* @__PURE__ */ make33(number2);
|
|
31484
|
+
var Boolean4 = /* @__PURE__ */ make33(boolean);
|
|
31485
|
+
var Symbol3 = /* @__PURE__ */ make33(symbol3);
|
|
31486
|
+
var BigInt5 = /* @__PURE__ */ make33(bigInt);
|
|
31487
|
+
var Void2 = /* @__PURE__ */ make33(void_5);
|
|
31488
|
+
var ObjectKeyword2 = /* @__PURE__ */ make33(objectKeyword);
|
|
31333
31489
|
function UniqueSymbol2(symbol4) {
|
|
31334
|
-
return
|
|
31490
|
+
return make33(new UniqueSymbol(symbol4));
|
|
31335
31491
|
}
|
|
31336
31492
|
function makeStruct(ast, fields) {
|
|
31337
|
-
return
|
|
31493
|
+
return make33(ast, {
|
|
31338
31494
|
fields,
|
|
31339
31495
|
mapFields(f, options) {
|
|
31340
31496
|
const fields2 = f(this.fields);
|
|
@@ -31411,19 +31567,19 @@ function extendTo(fields, derive) {
|
|
|
31411
31567
|
}
|
|
31412
31568
|
function Record(key, value3, options) {
|
|
31413
31569
|
const keyValueCombiner = options?.keyValueCombiner?.decode || options?.keyValueCombiner?.encode ? new KeyValueCombiner(options.keyValueCombiner.decode, options.keyValueCombiner.encode) : undefined;
|
|
31414
|
-
return
|
|
31570
|
+
return make33(record(key.ast, value3.ast, keyValueCombiner), {
|
|
31415
31571
|
key,
|
|
31416
31572
|
value: value3
|
|
31417
31573
|
});
|
|
31418
31574
|
}
|
|
31419
31575
|
function StructWithRest(schema, records) {
|
|
31420
|
-
return
|
|
31576
|
+
return make33(structWithRest(schema.ast, records.map(getAST)), {
|
|
31421
31577
|
schema,
|
|
31422
31578
|
records
|
|
31423
31579
|
});
|
|
31424
31580
|
}
|
|
31425
31581
|
function makeTuple(ast, elements) {
|
|
31426
|
-
return
|
|
31582
|
+
return make33(ast, {
|
|
31427
31583
|
elements,
|
|
31428
31584
|
mapElements(f, options) {
|
|
31429
31585
|
const elements2 = f(this.elements);
|
|
@@ -31431,19 +31587,19 @@ function makeTuple(ast, elements) {
|
|
|
31431
31587
|
}
|
|
31432
31588
|
});
|
|
31433
31589
|
}
|
|
31434
|
-
function
|
|
31590
|
+
function Tuple2(elements) {
|
|
31435
31591
|
return makeTuple(tuple(elements), elements);
|
|
31436
31592
|
}
|
|
31437
31593
|
function TupleWithRest(schema, rest) {
|
|
31438
|
-
return
|
|
31594
|
+
return make33(tupleWithRest(schema.ast, rest.map(getAST)), {
|
|
31439
31595
|
schema,
|
|
31440
31596
|
rest
|
|
31441
31597
|
});
|
|
31442
31598
|
}
|
|
31443
|
-
var ArraySchema = /* @__PURE__ */ lambda((schema) =>
|
|
31599
|
+
var ArraySchema = /* @__PURE__ */ lambda((schema) => make33(new Arrays(false, [], [schema.ast]), {
|
|
31444
31600
|
value: schema
|
|
31445
31601
|
}));
|
|
31446
|
-
var NonEmptyArray = /* @__PURE__ */ lambda((schema) =>
|
|
31602
|
+
var NonEmptyArray = /* @__PURE__ */ lambda((schema) => make33(new Arrays(false, [schema.ast], [schema.ast]), {
|
|
31447
31603
|
value: schema
|
|
31448
31604
|
}));
|
|
31449
31605
|
function ArrayEnsure(schema) {
|
|
@@ -31456,12 +31612,12 @@ function UniqueArray(item) {
|
|
|
31456
31612
|
return ArraySchema(item).check(isUnique());
|
|
31457
31613
|
}
|
|
31458
31614
|
var mutable = /* @__PURE__ */ lambda((schema) => {
|
|
31459
|
-
return
|
|
31615
|
+
return make33(new Arrays(true, schema.ast.elements, schema.ast.rest), {
|
|
31460
31616
|
schema
|
|
31461
31617
|
});
|
|
31462
31618
|
});
|
|
31463
31619
|
function makeUnion(ast, members) {
|
|
31464
|
-
return
|
|
31620
|
+
return make33(ast, {
|
|
31465
31621
|
members,
|
|
31466
31622
|
mapMembers(f, options) {
|
|
31467
31623
|
const members2 = f(this.members);
|
|
@@ -31474,7 +31630,7 @@ function Union2(members, options) {
|
|
|
31474
31630
|
}
|
|
31475
31631
|
function Literals(literals) {
|
|
31476
31632
|
const members = literals.map(Literal2);
|
|
31477
|
-
return
|
|
31633
|
+
return make33(union2(members, "anyOf", undefined), {
|
|
31478
31634
|
literals,
|
|
31479
31635
|
members,
|
|
31480
31636
|
mapMembers(f) {
|
|
@@ -31492,18 +31648,18 @@ var NullOr = /* @__PURE__ */ lambda((self) => Union2([self, Null2]));
|
|
|
31492
31648
|
var UndefinedOr = /* @__PURE__ */ lambda((self) => Union2([self, Undefined2]));
|
|
31493
31649
|
var NullishOr = /* @__PURE__ */ lambda((self) => Union2([self, Null2, Undefined2]));
|
|
31494
31650
|
function suspend6(f) {
|
|
31495
|
-
return
|
|
31651
|
+
return make33(new Suspend(() => f().ast));
|
|
31496
31652
|
}
|
|
31497
31653
|
function check2(...checks) {
|
|
31498
31654
|
return (self) => self.check(...checks);
|
|
31499
31655
|
}
|
|
31500
31656
|
function refine(refinement, annotations) {
|
|
31501
|
-
return (schema) =>
|
|
31657
|
+
return (schema) => make33(appendChecks(schema.ast, [makeFilterByGuard(refinement, annotations)]), {
|
|
31502
31658
|
schema
|
|
31503
31659
|
});
|
|
31504
31660
|
}
|
|
31505
31661
|
function brand2(identifier2) {
|
|
31506
|
-
return (schema) =>
|
|
31662
|
+
return (schema) => make33(brand(schema.ast, identifier2), {
|
|
31507
31663
|
schema,
|
|
31508
31664
|
identifier: identifier2
|
|
31509
31665
|
});
|
|
@@ -31514,12 +31670,12 @@ function fromBrand(identifier2, ctor) {
|
|
|
31514
31670
|
};
|
|
31515
31671
|
}
|
|
31516
31672
|
function middlewareDecoding2(decode) {
|
|
31517
|
-
return (schema) =>
|
|
31673
|
+
return (schema) => make33(middlewareDecoding(schema.ast, new Middleware(decode, identity)), {
|
|
31518
31674
|
schema
|
|
31519
31675
|
});
|
|
31520
31676
|
}
|
|
31521
31677
|
function middlewareEncoding2(encode) {
|
|
31522
|
-
return (schema) =>
|
|
31678
|
+
return (schema) => make33(middlewareEncoding(schema.ast, new Middleware(identity, encode)), {
|
|
31523
31679
|
schema
|
|
31524
31680
|
});
|
|
31525
31681
|
}
|
|
@@ -31537,7 +31693,7 @@ function catchEncodingWithContext(f) {
|
|
|
31537
31693
|
}
|
|
31538
31694
|
function decodeTo2(to, transformation) {
|
|
31539
31695
|
return (from) => {
|
|
31540
|
-
return
|
|
31696
|
+
return make33(decodeTo(from.ast, to.ast, transformation ? make15(transformation) : passthrough3()), {
|
|
31541
31697
|
from,
|
|
31542
31698
|
to
|
|
31543
31699
|
});
|
|
@@ -31559,7 +31715,7 @@ function encode(transformation) {
|
|
|
31559
31715
|
};
|
|
31560
31716
|
}
|
|
31561
31717
|
function withConstructorDefault2(defaultValue) {
|
|
31562
|
-
return (schema) =>
|
|
31718
|
+
return (schema) => make33(withConstructorDefault(schema.ast, mapSchemaErrorEffect(defaultValue)), {
|
|
31563
31719
|
schema
|
|
31564
31720
|
});
|
|
31565
31721
|
}
|
|
@@ -31658,7 +31814,7 @@ function TaggedUnion(casesByTag) {
|
|
|
31658
31814
|
isAnyOf,
|
|
31659
31815
|
match: match7
|
|
31660
31816
|
} = toTaggedUnion("_tag")(union6);
|
|
31661
|
-
return
|
|
31817
|
+
return make33(union6.ast, {
|
|
31662
31818
|
cases,
|
|
31663
31819
|
isAnyOf,
|
|
31664
31820
|
guards,
|
|
@@ -31678,7 +31834,7 @@ function instanceOf(constructor, annotations) {
|
|
|
31678
31834
|
}
|
|
31679
31835
|
function link() {
|
|
31680
31836
|
return (encodeTo2, transformation) => {
|
|
31681
|
-
return new Link(encodeTo2.ast,
|
|
31837
|
+
return new Link(encodeTo2.ast, make15(transformation));
|
|
31682
31838
|
};
|
|
31683
31839
|
}
|
|
31684
31840
|
var makeFilter2 = makeFilter;
|
|
@@ -32486,7 +32642,7 @@ function Option(value3) {
|
|
|
32486
32642
|
onSome: (t) => `some(${value4(t)})`
|
|
32487
32643
|
})
|
|
32488
32644
|
});
|
|
32489
|
-
return
|
|
32645
|
+
return make33(schema.ast, {
|
|
32490
32646
|
value: value3
|
|
32491
32647
|
});
|
|
32492
32648
|
}
|
|
@@ -32567,7 +32723,7 @@ function Result(success, failure) {
|
|
|
32567
32723
|
onFailure: (t) => `failure(${failure2(t)})`
|
|
32568
32724
|
})
|
|
32569
32725
|
});
|
|
32570
|
-
return
|
|
32726
|
+
return make33(schema.ast, {
|
|
32571
32727
|
success,
|
|
32572
32728
|
failure
|
|
32573
32729
|
});
|
|
@@ -32598,23 +32754,23 @@ function Redacted(value3, options) {
|
|
|
32598
32754
|
},
|
|
32599
32755
|
expected: "Redacted",
|
|
32600
32756
|
toCodecJson: ([value4]) => link()(redact3(value4), {
|
|
32601
|
-
decode: transform((e) =>
|
|
32757
|
+
decode: transform((e) => make11(e, {
|
|
32602
32758
|
label: options?.label
|
|
32603
32759
|
})),
|
|
32604
32760
|
encode: options?.disallowJsonEncode ? forbidden((oe) => "Cannot serialize Redacted" + (isSome2(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : transform(value2)
|
|
32605
32761
|
}),
|
|
32606
32762
|
toArbitrary: ([value4]) => () => ({
|
|
32607
|
-
arbitrary: value4.arbitrary.map((a) =>
|
|
32763
|
+
arbitrary: value4.arbitrary.map((a) => make11(a, {
|
|
32608
32764
|
label: options?.label
|
|
32609
32765
|
})),
|
|
32610
|
-
terminal: value4.terminal?.map((a) =>
|
|
32766
|
+
terminal: value4.terminal?.map((a) => make11(a, {
|
|
32611
32767
|
label: options?.label
|
|
32612
32768
|
}))
|
|
32613
32769
|
}),
|
|
32614
32770
|
toFormatter: () => globalThis.String,
|
|
32615
|
-
toEquivalence: ([value4]) =>
|
|
32771
|
+
toEquivalence: ([value4]) => makeEquivalence7(value4)
|
|
32616
32772
|
});
|
|
32617
|
-
return
|
|
32773
|
+
return make33(schema.ast, {
|
|
32618
32774
|
value: value3
|
|
32619
32775
|
});
|
|
32620
32776
|
}
|
|
@@ -32626,7 +32782,7 @@ function RedactedFromValue(value3, options) {
|
|
|
32626
32782
|
label: options?.label,
|
|
32627
32783
|
disallowJsonEncode: options?.disallowEncode
|
|
32628
32784
|
}), {
|
|
32629
|
-
decode: transform((t) =>
|
|
32785
|
+
decode: transform((t) => make11(t, {
|
|
32630
32786
|
label: options?.label
|
|
32631
32787
|
})),
|
|
32632
32788
|
encode: options?.disallowEncode ? forbidden((oe) => "Cannot encode Redacted" + (isSome2(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : transform(value2)
|
|
@@ -32687,7 +32843,7 @@ function CauseReason(error, defect) {
|
|
|
32687
32843
|
toEquivalence: ([error2, defect2]) => causeReasonToEquivalence(error2, defect2),
|
|
32688
32844
|
toFormatter: ([error2, defect2]) => causeReasonToFormatter(error2, defect2)
|
|
32689
32845
|
});
|
|
32690
|
-
return
|
|
32846
|
+
return make33(schema.ast, {
|
|
32691
32847
|
error,
|
|
32692
32848
|
defect
|
|
32693
32849
|
});
|
|
@@ -32759,7 +32915,7 @@ function Cause(error, defect) {
|
|
|
32759
32915
|
toEquivalence: ([error2, defect2]) => causeToEquivalence(error2, defect2),
|
|
32760
32916
|
toFormatter: ([error2, defect2]) => causeToFormatter(error2, defect2)
|
|
32761
32917
|
});
|
|
32762
|
-
return
|
|
32918
|
+
return make33(schema.ast, {
|
|
32763
32919
|
error,
|
|
32764
32920
|
defect
|
|
32765
32921
|
});
|
|
@@ -32914,7 +33070,7 @@ function Exit(value3, error, defect) {
|
|
|
32914
33070
|
};
|
|
32915
33071
|
}
|
|
32916
33072
|
});
|
|
32917
|
-
return
|
|
33073
|
+
return make33(schema.ast, {
|
|
32918
33074
|
value: value3,
|
|
32919
33075
|
error,
|
|
32920
33076
|
defect
|
|
@@ -32964,7 +33120,7 @@ function entriesArbitrary(fc, ctx, key, value3, fromIterable9) {
|
|
|
32964
33120
|
}
|
|
32965
33121
|
function ReadonlyMap(key, value3) {
|
|
32966
33122
|
const schema = declareConstructor()([key, value3], ([key2, value4]) => {
|
|
32967
|
-
const array4 = ArraySchema(
|
|
33123
|
+
const array4 = ArraySchema(Tuple2([key2, value4]));
|
|
32968
33124
|
return (input, ast, options) => {
|
|
32969
33125
|
if (input instanceof globalThis.Map) {
|
|
32970
33126
|
return mapBothEager2(decodeUnknownEffect(array4)([...input], options), {
|
|
@@ -32983,7 +33139,7 @@ function ReadonlyMap(key, value3) {
|
|
|
32983
33139
|
Type: `globalThis.ReadonlyMap<?, ?>`
|
|
32984
33140
|
},
|
|
32985
33141
|
expected: "ReadonlyMap",
|
|
32986
|
-
toCodec: ([key2, value4]) => link()(ArraySchema(
|
|
33142
|
+
toCodec: ([key2, value4]) => link()(ArraySchema(Tuple2([key2, value4])), transform2({
|
|
32987
33143
|
decode: (e) => new globalThis.Map(e),
|
|
32988
33144
|
encode: (map15) => [...map15.entries()]
|
|
32989
33145
|
})),
|
|
@@ -32998,14 +33154,14 @@ function ReadonlyMap(key, value3) {
|
|
|
32998
33154
|
return `ReadonlyMap(${size7}) { ${entries3.join(", ")} }`;
|
|
32999
33155
|
}
|
|
33000
33156
|
});
|
|
33001
|
-
return
|
|
33157
|
+
return make33(schema.ast, {
|
|
33002
33158
|
key,
|
|
33003
33159
|
value: value3
|
|
33004
33160
|
});
|
|
33005
33161
|
}
|
|
33006
33162
|
function HashMap(key, value3) {
|
|
33007
33163
|
const schema = declareConstructor()([key, value3], ([key2, value4]) => {
|
|
33008
|
-
const entries3 = ArraySchema(
|
|
33164
|
+
const entries3 = ArraySchema(Tuple2([key2, value4]));
|
|
33009
33165
|
return (input, ast, options) => {
|
|
33010
33166
|
if (isHashMap2(input)) {
|
|
33011
33167
|
return mapBothEager2(decodeUnknownEffect(entries3)(toEntries(input), options), {
|
|
@@ -33025,7 +33181,7 @@ function HashMap(key, value3) {
|
|
|
33025
33181
|
importDeclaration: `import * as HashMap from "effect/HashMap"`
|
|
33026
33182
|
},
|
|
33027
33183
|
expected: "HashMap",
|
|
33028
|
-
toCodec: ([key2, value4]) => link()(ArraySchema(
|
|
33184
|
+
toCodec: ([key2, value4]) => link()(ArraySchema(Tuple2([key2, value4])), transform2({
|
|
33029
33185
|
decode: fromIterable6,
|
|
33030
33186
|
encode: toEntries
|
|
33031
33187
|
})),
|
|
@@ -33040,7 +33196,7 @@ function HashMap(key, value3) {
|
|
|
33040
33196
|
return `HashMap(${size7}) { ${entries3.join(", ")} }`;
|
|
33041
33197
|
}
|
|
33042
33198
|
});
|
|
33043
|
-
return
|
|
33199
|
+
return make33(schema.ast, {
|
|
33044
33200
|
key,
|
|
33045
33201
|
value: value3
|
|
33046
33202
|
});
|
|
@@ -33081,7 +33237,7 @@ function ReadonlySet(value3) {
|
|
|
33081
33237
|
return `ReadonlySet(${size7}) { ${values3.join(", ")} }`;
|
|
33082
33238
|
}
|
|
33083
33239
|
});
|
|
33084
|
-
return
|
|
33240
|
+
return make33(schema.ast, {
|
|
33085
33241
|
value: value3
|
|
33086
33242
|
});
|
|
33087
33243
|
}
|
|
@@ -33121,7 +33277,7 @@ function HashSet(value3) {
|
|
|
33121
33277
|
return `HashSet(${size7}) { ${values3.join(", ")} }`;
|
|
33122
33278
|
}
|
|
33123
33279
|
});
|
|
33124
|
-
return
|
|
33280
|
+
return make33(schema.ast, {
|
|
33125
33281
|
value: value3
|
|
33126
33282
|
});
|
|
33127
33283
|
}
|
|
@@ -33151,7 +33307,7 @@ function Chunk(value3) {
|
|
|
33151
33307
|
encode: fromIterable2
|
|
33152
33308
|
})),
|
|
33153
33309
|
toArbitrary: ([value4]) => (fc, ctx) => collectionArbitrary(fc, ctx, value4.arbitrary, value4.terminal, fromIterable3),
|
|
33154
|
-
toEquivalence: ([value4]) =>
|
|
33310
|
+
toEquivalence: ([value4]) => makeEquivalence6(value4),
|
|
33155
33311
|
toFormatter: ([value4]) => (t) => {
|
|
33156
33312
|
const size7 = size(t);
|
|
33157
33313
|
if (size7 === 0) {
|
|
@@ -33161,7 +33317,7 @@ function Chunk(value3) {
|
|
|
33161
33317
|
return `Chunk(${size7}) { ${values3.join(", ")} }`;
|
|
33162
33318
|
}
|
|
33163
33319
|
});
|
|
33164
|
-
return
|
|
33320
|
+
return make33(schema.ast, {
|
|
33165
33321
|
value: value3
|
|
33166
33322
|
});
|
|
33167
33323
|
}
|
|
@@ -33178,7 +33334,7 @@ var RegExp3 = /* @__PURE__ */ instanceOf(globalThis.RegExp, {
|
|
|
33178
33334
|
source: String5,
|
|
33179
33335
|
flags: String5
|
|
33180
33336
|
}), transformOrFail2({
|
|
33181
|
-
decode: (e) =>
|
|
33337
|
+
decode: (e) => try_3({
|
|
33182
33338
|
try: () => new globalThis.RegExp(e.source, e.flags),
|
|
33183
33339
|
catch: (e2) => new InvalidValue(some2(e2), {
|
|
33184
33340
|
message: globalThis.String(e2)
|
|
@@ -33387,14 +33543,14 @@ var BigDecimal = /* @__PURE__ */ declare(isBigDecimal, {
|
|
|
33387
33543
|
return fc.tuple(fc.bigInt(), fc.integer({
|
|
33388
33544
|
min: 0,
|
|
33389
33545
|
max: bigDecimalDefaultMaxScale
|
|
33390
|
-
})).map(([value3, scale2]) =>
|
|
33546
|
+
})).map(([value3, scale2]) => make14(value3, scale2));
|
|
33391
33547
|
}
|
|
33392
33548
|
return fc.integer(bigDecimalScaleConstraints(ordered)).chain((scale2) => {
|
|
33393
33549
|
const constraints = bigDecimalValueConstraintsAtScale(ordered, scale2);
|
|
33394
33550
|
if (constraints === undefined) {
|
|
33395
33551
|
throw new globalThis.Error(bigDecimalInvalidOrderedConstraintsError);
|
|
33396
33552
|
}
|
|
33397
|
-
return fc.bigInt(constraints).map((value3) =>
|
|
33553
|
+
return fc.bigInt(constraints).map((value3) => make14(value3, scale2));
|
|
33398
33554
|
});
|
|
33399
33555
|
},
|
|
33400
33556
|
toFormatter: () => (bd) => format3(bd),
|
|
@@ -33463,7 +33619,7 @@ var FormData2 = /* @__PURE__ */ instanceOf(globalThis.FormData, {
|
|
|
33463
33619
|
Type: `globalThis.FormData`
|
|
33464
33620
|
},
|
|
33465
33621
|
expected: "FormData",
|
|
33466
|
-
toCodecJson: () => link()(ArraySchema(
|
|
33622
|
+
toCodecJson: () => link()(ArraySchema(Tuple2([String5, Union2([Struct({
|
|
33467
33623
|
_tag: tag("String"),
|
|
33468
33624
|
value: String5
|
|
33469
33625
|
}), Struct({
|
|
@@ -33524,7 +33680,7 @@ var NumberFromString = /* @__PURE__ */ String5.annotate({
|
|
|
33524
33680
|
var FiniteFromString = /* @__PURE__ */ String5.annotate({
|
|
33525
33681
|
expected: "a string that will be decoded as a finite number"
|
|
33526
33682
|
}).pipe(/* @__PURE__ */ decodeTo2(Finite, numberFromString));
|
|
33527
|
-
var BigIntFromString = /* @__PURE__ */
|
|
33683
|
+
var BigIntFromString = /* @__PURE__ */ make33(bigIntString).pipe(/* @__PURE__ */ decodeTo2(BigInt5, bigintFromString));
|
|
33528
33684
|
var Trimmed = /* @__PURE__ */ String5.check(/* @__PURE__ */ isTrimmed());
|
|
33529
33685
|
var Trim = /* @__PURE__ */ String5.annotate({
|
|
33530
33686
|
expected: "a string that will be decoded as a trimmed string"
|
|
@@ -33715,7 +33871,7 @@ function makeClass(Inherited, identifier2, struct2, annotations, proto) {
|
|
|
33715
33871
|
}
|
|
33716
33872
|
});
|
|
33717
33873
|
}
|
|
33718
|
-
static [
|
|
33874
|
+
static [TypeId37] = TypeId37;
|
|
33719
33875
|
get [ClassTypeId2]() {
|
|
33720
33876
|
return ClassTypeId2;
|
|
33721
33877
|
}
|
|
@@ -33784,7 +33940,7 @@ function getClassSchemaFactory(from, identifier2, annotations) {
|
|
|
33784
33940
|
return memo2;
|
|
33785
33941
|
}
|
|
33786
33942
|
const transformation = getClassTransformation(self);
|
|
33787
|
-
const to =
|
|
33943
|
+
const to = make33(new Declaration([from.ast], () => (input, ast) => {
|
|
33788
33944
|
return input instanceof self || hasProperty(input, getClassTypeId(identifier2)) ? succeed6(input) : fail5(new InvalidType(ast, some2(input)));
|
|
33789
33945
|
}, {
|
|
33790
33946
|
identifier: identifier2,
|
|
@@ -33804,9 +33960,9 @@ function getClassSchemaFactory(from, identifier2, annotations) {
|
|
|
33804
33960
|
function isStruct(schema) {
|
|
33805
33961
|
return isSchema(schema);
|
|
33806
33962
|
}
|
|
33807
|
-
var
|
|
33963
|
+
var Class4 = (identifier2) => (schema, annotations) => {
|
|
33808
33964
|
const struct2 = isStruct(schema) ? schema : Struct(schema);
|
|
33809
|
-
return makeClass(
|
|
33965
|
+
return makeClass(Class3, identifier2, struct2, annotations, (identifier3) => ({
|
|
33810
33966
|
toString() {
|
|
33811
33967
|
return `${identifier3}(${format({
|
|
33812
33968
|
...this
|
|
@@ -33822,7 +33978,7 @@ var TaggedClass = (identifier2) => {
|
|
|
33822
33978
|
}), {
|
|
33823
33979
|
unsafePreserveChecks: true
|
|
33824
33980
|
}) : TaggedStruct(tagValue, schema);
|
|
33825
|
-
return
|
|
33981
|
+
return Class4(identifier2 ?? tagValue)(struct2, annotations);
|
|
33826
33982
|
};
|
|
33827
33983
|
};
|
|
33828
33984
|
var ErrorClass = (identifier2) => (schema, annotations) => {
|
|
@@ -33990,7 +34146,7 @@ function toJsonSchemaDocument2(schema, options) {
|
|
|
33990
34146
|
};
|
|
33991
34147
|
}
|
|
33992
34148
|
function toCodecJson(schema) {
|
|
33993
|
-
return
|
|
34149
|
+
return make33(toCodecJsonTop(schema.ast), {
|
|
33994
34150
|
schema
|
|
33995
34151
|
});
|
|
33996
34152
|
}
|
|
@@ -34003,7 +34159,7 @@ function toCodecJsonBase(ast, recur5) {
|
|
|
34003
34159
|
case "Declaration": {
|
|
34004
34160
|
const getLink = ast.annotations?.toCodecJson ?? ast.annotations?.toCodec;
|
|
34005
34161
|
if (isFunction(getLink)) {
|
|
34006
|
-
const tps = isDeclaration(ast) ? ast.typeParameters.map((tp) =>
|
|
34162
|
+
const tps = isDeclaration(ast) ? ast.typeParameters.map((tp) => make31(toEncoded(tp))) : [];
|
|
34007
34163
|
const link2 = getLink(tps);
|
|
34008
34164
|
const to = recur5(link2.to);
|
|
34009
34165
|
return replaceEncoding(ast, to === link2.to ? [link2] : [new Link(to, link2.transformation)]);
|
|
@@ -34044,7 +34200,7 @@ function toCodecJsonBase(ast, recur5) {
|
|
|
34044
34200
|
return ast;
|
|
34045
34201
|
}
|
|
34046
34202
|
function toCodecIso(schema) {
|
|
34047
|
-
return
|
|
34203
|
+
return make33(toCodecIsoTop(toType(schema.ast)));
|
|
34048
34204
|
}
|
|
34049
34205
|
var toCodecIsoTop = /* @__PURE__ */ memoize((ast) => {
|
|
34050
34206
|
const out = toCodecIsoBase(ast, toCodecIsoTop);
|
|
@@ -34055,7 +34211,7 @@ function toCodecIsoBase(ast, recur5) {
|
|
|
34055
34211
|
case "Declaration": {
|
|
34056
34212
|
const getLink = ast.annotations?.toCodecIso ?? ast.annotations?.toCodec;
|
|
34057
34213
|
if (isFunction(getLink)) {
|
|
34058
|
-
const link2 = getLink(ast.typeParameters.map((tp) =>
|
|
34214
|
+
const link2 = getLink(ast.typeParameters.map((tp) => make31(tp)));
|
|
34059
34215
|
const to = recur5(link2.to);
|
|
34060
34216
|
return replaceEncoding(ast, to === link2.to ? [link2] : [new Link(to, link2.transformation)]);
|
|
34061
34217
|
}
|
|
@@ -34070,12 +34226,12 @@ function toCodecIsoBase(ast, recur5) {
|
|
|
34070
34226
|
return ast;
|
|
34071
34227
|
}
|
|
34072
34228
|
function toCodecStringTree(schema) {
|
|
34073
|
-
return
|
|
34229
|
+
return make33(serializerStringTree(schema.ast), {
|
|
34074
34230
|
schema
|
|
34075
34231
|
});
|
|
34076
34232
|
}
|
|
34077
34233
|
function toCodecArrayFromSingle(schema) {
|
|
34078
|
-
return
|
|
34234
|
+
return make33(toCodecArrayFromSingleTop(schema.ast));
|
|
34079
34235
|
}
|
|
34080
34236
|
function toEncoderXml(codec, options) {
|
|
34081
34237
|
const rootName = resolveIdentifier(codec.ast) ?? resolveTitle(codec.ast);
|
|
@@ -34199,7 +34355,7 @@ function serializerTree(ast, recur5, onMissingAnnotation) {
|
|
|
34199
34355
|
case "Declaration": {
|
|
34200
34356
|
const getLink = ast.annotations?.toCodecJson ?? ast.annotations?.toCodec;
|
|
34201
34357
|
if (isFunction(getLink)) {
|
|
34202
|
-
const tps = isDeclaration(ast) ? ast.typeParameters.map((tp) =>
|
|
34358
|
+
const tps = isDeclaration(ast) ? ast.typeParameters.map((tp) => make33(recur5(toEncoded(tp)))) : [];
|
|
34203
34359
|
const link2 = getLink(tps);
|
|
34204
34360
|
const to = recur5(link2.to);
|
|
34205
34361
|
return replaceEncoding(ast, to === link2.to ? [link2] : [new Link(to, link2.transformation)]);
|
|
@@ -34288,8 +34444,8 @@ function toIsoFocus(_) {
|
|
|
34288
34444
|
}
|
|
34289
34445
|
function overrideToCodecIso(to, transformation) {
|
|
34290
34446
|
return (schema) => {
|
|
34291
|
-
return
|
|
34292
|
-
toCodecIso: () => new Link(to.ast,
|
|
34447
|
+
return make33(annotate(schema.ast, {
|
|
34448
|
+
toCodecIso: () => new Link(to.ast, make15(transformation))
|
|
34293
34449
|
}), {
|
|
34294
34450
|
schema
|
|
34295
34451
|
});
|
|
@@ -34315,72 +34471,1791 @@ function Tree(node) {
|
|
|
34315
34471
|
const Tree2 = Union2([node, ArraySchema(Tree$ref), Record(String5, Tree$ref)]);
|
|
34316
34472
|
return Tree2;
|
|
34317
34473
|
}
|
|
34318
|
-
var Json2 = /* @__PURE__ */
|
|
34474
|
+
var Json2 = /* @__PURE__ */ make33(Json);
|
|
34319
34475
|
var JsonError = /* @__PURE__ */ Struct({
|
|
34320
34476
|
message: String5,
|
|
34321
34477
|
name: /* @__PURE__ */ optionalKey2(String5),
|
|
34322
34478
|
stack: /* @__PURE__ */ optionalKey2(String5),
|
|
34323
34479
|
cause: /* @__PURE__ */ optionalKey2(Json2)
|
|
34324
34480
|
});
|
|
34325
|
-
var MutableJson2 = /* @__PURE__ */
|
|
34481
|
+
var MutableJson2 = /* @__PURE__ */ make33(MutableJson);
|
|
34326
34482
|
function resolveAnnotations(schema) {
|
|
34327
34483
|
return resolve(schema.ast);
|
|
34328
34484
|
}
|
|
34329
34485
|
function resolveAnnotationsKey(schema) {
|
|
34330
34486
|
return schema.ast.context?.annotations;
|
|
34331
34487
|
}
|
|
34332
|
-
//
|
|
34333
|
-
var
|
|
34334
|
-
|
|
34335
|
-
|
|
34488
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/HttpClient.js
|
|
34489
|
+
var exports_HttpClient = {};
|
|
34490
|
+
__export(exports_HttpClient, {
|
|
34491
|
+
withScope: () => withScope,
|
|
34492
|
+
withRateLimiter: () => withRateLimiter,
|
|
34493
|
+
withCookiesRef: () => withCookiesRef,
|
|
34494
|
+
transformResponse: () => transformResponse,
|
|
34495
|
+
transform: () => transform4,
|
|
34496
|
+
tapRequest: () => tapRequest,
|
|
34497
|
+
tapError: () => tapError6,
|
|
34498
|
+
tap: () => tap7,
|
|
34499
|
+
retryTransient: () => retryTransient,
|
|
34500
|
+
retry: () => retry5,
|
|
34501
|
+
put: () => put2,
|
|
34502
|
+
post: () => post2,
|
|
34503
|
+
patch: () => patch2,
|
|
34504
|
+
options: () => options2,
|
|
34505
|
+
mapRequestInputEffect: () => mapRequestInputEffect,
|
|
34506
|
+
mapRequestInput: () => mapRequestInput,
|
|
34507
|
+
mapRequestEffect: () => mapRequestEffect,
|
|
34508
|
+
mapRequest: () => mapRequest,
|
|
34509
|
+
makeWith: () => makeWith2,
|
|
34510
|
+
make: () => make38,
|
|
34511
|
+
layerMergedContext: () => layerMergedContext,
|
|
34512
|
+
isHttpClient: () => isHttpClient,
|
|
34513
|
+
head: () => head2,
|
|
34514
|
+
get: () => get12,
|
|
34515
|
+
followRedirects: () => followRedirects,
|
|
34516
|
+
filterStatusOk: () => filterStatusOk2,
|
|
34517
|
+
filterStatus: () => filterStatus2,
|
|
34518
|
+
filterOrFail: () => filterOrFail3,
|
|
34519
|
+
filterOrElse: () => filterOrElse3,
|
|
34520
|
+
execute: () => execute,
|
|
34521
|
+
del: () => del2,
|
|
34522
|
+
catchTags: () => catchTags4,
|
|
34523
|
+
catchTag: () => catchTag5,
|
|
34524
|
+
catch: () => catch_6,
|
|
34525
|
+
TracerPropagationEnabled: () => TracerPropagationEnabled,
|
|
34526
|
+
TracerDisabledWhen: () => TracerDisabledWhen,
|
|
34527
|
+
SpanNameGenerator: () => SpanNameGenerator,
|
|
34528
|
+
HttpClient: () => HttpClient
|
|
34529
|
+
});
|
|
34530
|
+
|
|
34531
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/Cookies.js
|
|
34532
|
+
var TypeId38 = "~effect/http/Cookies";
|
|
34533
|
+
var CookieTypeId = "~effect/http/Cookies/Cookie";
|
|
34534
|
+
var Proto5 = {
|
|
34535
|
+
[TypeId38]: TypeId38,
|
|
34536
|
+
...BaseProto,
|
|
34537
|
+
toJSON() {
|
|
34538
|
+
return {
|
|
34539
|
+
_id: "effect/Cookies",
|
|
34540
|
+
cookies: map3(this.cookies, (cookie) => cookie.toJSON())
|
|
34541
|
+
};
|
|
34542
|
+
},
|
|
34543
|
+
pipe() {
|
|
34544
|
+
return pipeArguments(this, arguments);
|
|
34545
|
+
}
|
|
34546
|
+
};
|
|
34547
|
+
var fromReadonlyRecord = (cookies) => {
|
|
34548
|
+
const self = Object.create(Proto5);
|
|
34549
|
+
self.cookies = cookies;
|
|
34550
|
+
return self;
|
|
34551
|
+
};
|
|
34552
|
+
var fromIterable9 = (cookies) => {
|
|
34553
|
+
const record3 = {};
|
|
34554
|
+
for (const cookie of cookies) {
|
|
34555
|
+
record3[cookie.name] = cookie;
|
|
34556
|
+
}
|
|
34557
|
+
return fromReadonlyRecord(record3);
|
|
34558
|
+
};
|
|
34559
|
+
var fromSetCookie = (headers) => {
|
|
34560
|
+
const arrayHeaders = typeof headers === "string" ? [headers] : headers;
|
|
34561
|
+
const cookies = [];
|
|
34562
|
+
for (const header of arrayHeaders) {
|
|
34563
|
+
const cookie = parseSetCookie(header.trim());
|
|
34564
|
+
if (cookie) {
|
|
34565
|
+
cookies.push(cookie);
|
|
34566
|
+
}
|
|
34567
|
+
}
|
|
34568
|
+
return fromIterable9(cookies);
|
|
34569
|
+
};
|
|
34570
|
+
function parseSetCookie(header) {
|
|
34571
|
+
const parts = header.split(";").map((_) => _.trim()).filter((_) => _ !== "");
|
|
34572
|
+
if (parts.length === 0) {
|
|
34573
|
+
return;
|
|
34574
|
+
}
|
|
34575
|
+
const firstEqual = parts[0].indexOf("=");
|
|
34576
|
+
if (firstEqual === -1) {
|
|
34577
|
+
return;
|
|
34578
|
+
}
|
|
34579
|
+
const name = parts[0].slice(0, firstEqual);
|
|
34580
|
+
if (!fieldContentRegExp.test(name)) {
|
|
34336
34581
|
return;
|
|
34337
|
-
|
|
34338
|
-
|
|
34582
|
+
}
|
|
34583
|
+
const valueEncoded = parts[0].slice(firstEqual + 1);
|
|
34584
|
+
const value3 = tryDecodeURIComponent(valueEncoded);
|
|
34585
|
+
if (parts.length === 1) {
|
|
34586
|
+
return Object.assign(Object.create(CookieProto), {
|
|
34587
|
+
name,
|
|
34588
|
+
value: value3,
|
|
34589
|
+
valueEncoded
|
|
34590
|
+
});
|
|
34591
|
+
}
|
|
34592
|
+
const options = {};
|
|
34593
|
+
for (let i = 1;i < parts.length; i++) {
|
|
34594
|
+
const part = parts[i];
|
|
34595
|
+
const equalIndex = part.indexOf("=");
|
|
34596
|
+
const key = equalIndex === -1 ? part : part.slice(0, equalIndex).trim();
|
|
34597
|
+
const value4 = equalIndex === -1 ? undefined : part.slice(equalIndex + 1).trim();
|
|
34598
|
+
switch (key.toLowerCase()) {
|
|
34599
|
+
case "domain": {
|
|
34600
|
+
if (value4 === undefined) {
|
|
34601
|
+
break;
|
|
34602
|
+
}
|
|
34603
|
+
const domain2 = value4.trim().replace(/^\./, "");
|
|
34604
|
+
if (domain2) {
|
|
34605
|
+
options.domain = domain2;
|
|
34606
|
+
}
|
|
34607
|
+
break;
|
|
34608
|
+
}
|
|
34609
|
+
case "expires": {
|
|
34610
|
+
if (value4 === undefined) {
|
|
34611
|
+
break;
|
|
34612
|
+
}
|
|
34613
|
+
const date2 = new Date(value4);
|
|
34614
|
+
if (!isNaN(date2.getTime())) {
|
|
34615
|
+
options.expires = date2;
|
|
34616
|
+
}
|
|
34617
|
+
break;
|
|
34618
|
+
}
|
|
34619
|
+
case "max-age": {
|
|
34620
|
+
if (value4 === undefined) {
|
|
34621
|
+
break;
|
|
34622
|
+
}
|
|
34623
|
+
const maxAge = parseInt(value4, 10);
|
|
34624
|
+
if (!isNaN(maxAge)) {
|
|
34625
|
+
options.maxAge = seconds(maxAge);
|
|
34626
|
+
}
|
|
34627
|
+
break;
|
|
34628
|
+
}
|
|
34629
|
+
case "path": {
|
|
34630
|
+
if (value4 === undefined) {
|
|
34631
|
+
break;
|
|
34632
|
+
}
|
|
34633
|
+
if (value4[0] === "/") {
|
|
34634
|
+
options.path = value4;
|
|
34635
|
+
}
|
|
34636
|
+
break;
|
|
34637
|
+
}
|
|
34638
|
+
case "priority": {
|
|
34639
|
+
if (value4 === undefined) {
|
|
34640
|
+
break;
|
|
34641
|
+
}
|
|
34642
|
+
switch (value4.toLowerCase()) {
|
|
34643
|
+
case "low":
|
|
34644
|
+
options.priority = "low";
|
|
34645
|
+
break;
|
|
34646
|
+
case "medium":
|
|
34647
|
+
options.priority = "medium";
|
|
34648
|
+
break;
|
|
34649
|
+
case "high":
|
|
34650
|
+
options.priority = "high";
|
|
34651
|
+
break;
|
|
34652
|
+
}
|
|
34653
|
+
break;
|
|
34654
|
+
}
|
|
34655
|
+
case "httponly": {
|
|
34656
|
+
options.httpOnly = true;
|
|
34657
|
+
break;
|
|
34658
|
+
}
|
|
34659
|
+
case "secure": {
|
|
34660
|
+
options.secure = true;
|
|
34661
|
+
break;
|
|
34662
|
+
}
|
|
34663
|
+
case "partitioned": {
|
|
34664
|
+
options.partitioned = true;
|
|
34665
|
+
break;
|
|
34666
|
+
}
|
|
34667
|
+
case "samesite": {
|
|
34668
|
+
if (value4 === undefined) {
|
|
34669
|
+
break;
|
|
34670
|
+
}
|
|
34671
|
+
switch (value4.toLowerCase()) {
|
|
34672
|
+
case "lax":
|
|
34673
|
+
options.sameSite = "lax";
|
|
34674
|
+
break;
|
|
34675
|
+
case "strict":
|
|
34676
|
+
options.sameSite = "strict";
|
|
34677
|
+
break;
|
|
34678
|
+
case "none":
|
|
34679
|
+
options.sameSite = "none";
|
|
34680
|
+
break;
|
|
34681
|
+
}
|
|
34682
|
+
break;
|
|
34683
|
+
}
|
|
34684
|
+
}
|
|
34685
|
+
}
|
|
34686
|
+
return Object.assign(Object.create(CookieProto), {
|
|
34687
|
+
name,
|
|
34688
|
+
value: value3,
|
|
34689
|
+
valueEncoded,
|
|
34690
|
+
options: Object.keys(options).length > 0 ? options : undefined
|
|
34691
|
+
});
|
|
34692
|
+
}
|
|
34693
|
+
var isEmpty4 = (self) => isEmptyRecord(self.cookies);
|
|
34694
|
+
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
34695
|
+
var CookieProto = {
|
|
34696
|
+
[CookieTypeId]: CookieTypeId,
|
|
34697
|
+
...BaseProto,
|
|
34698
|
+
toJSON() {
|
|
34699
|
+
return {
|
|
34700
|
+
_id: "effect/Cookies/Cookie",
|
|
34701
|
+
name: this.name,
|
|
34702
|
+
value: this.value,
|
|
34703
|
+
options: this.options
|
|
34704
|
+
};
|
|
34705
|
+
}
|
|
34706
|
+
};
|
|
34707
|
+
var merge6 = /* @__PURE__ */ dual(2, (self, that) => fromReadonlyRecord({
|
|
34708
|
+
...self.cookies,
|
|
34709
|
+
...that.cookies
|
|
34710
|
+
}));
|
|
34711
|
+
var toCookieHeader = (self) => Object.values(self.cookies).map((cookie) => `${cookie.name}=${cookie.valueEncoded}`).join("; ");
|
|
34712
|
+
var tryDecodeURIComponent = (str) => {
|
|
34713
|
+
try {
|
|
34714
|
+
return decodeURIComponent(str);
|
|
34715
|
+
} catch (_) {
|
|
34716
|
+
return str;
|
|
34717
|
+
}
|
|
34718
|
+
};
|
|
34719
|
+
|
|
34720
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/Headers.js
|
|
34721
|
+
var TypeId39 = /* @__PURE__ */ Symbol.for("~effect/http/Headers");
|
|
34722
|
+
var Proto6 = /* @__PURE__ */ Object.defineProperties(/* @__PURE__ */ Object.create(null), {
|
|
34723
|
+
[TypeId39]: {
|
|
34724
|
+
value: TypeId39
|
|
34725
|
+
},
|
|
34726
|
+
[symbolRedactable]: {
|
|
34727
|
+
value(context4) {
|
|
34728
|
+
return redact4(this, get(context4, CurrentRedactedNames));
|
|
34729
|
+
}
|
|
34730
|
+
},
|
|
34731
|
+
toJSON: {
|
|
34732
|
+
value() {
|
|
34733
|
+
return redact(this);
|
|
34734
|
+
}
|
|
34735
|
+
},
|
|
34736
|
+
[symbol2]: {
|
|
34737
|
+
value(that) {
|
|
34738
|
+
return Equivalence7(this, that);
|
|
34739
|
+
}
|
|
34740
|
+
},
|
|
34741
|
+
[symbol]: {
|
|
34742
|
+
value() {
|
|
34743
|
+
return structure(this);
|
|
34744
|
+
}
|
|
34745
|
+
},
|
|
34746
|
+
toString: {
|
|
34747
|
+
value: BaseProto.toString
|
|
34748
|
+
},
|
|
34749
|
+
[NodeInspectSymbol]: {
|
|
34750
|
+
value: BaseProto[NodeInspectSymbol]
|
|
34751
|
+
}
|
|
34339
34752
|
});
|
|
34340
|
-
var
|
|
34341
|
-
|
|
34342
|
-
|
|
34343
|
-
|
|
34344
|
-
|
|
34345
|
-
|
|
34346
|
-
|
|
34347
|
-
|
|
34348
|
-
|
|
34753
|
+
var make34 = (input) => Object.assign(Object.create(Proto6), input);
|
|
34754
|
+
var Equivalence7 = /* @__PURE__ */ makeEquivalence4(/* @__PURE__ */ strictEqual());
|
|
34755
|
+
var empty13 = /* @__PURE__ */ Object.create(Proto6);
|
|
34756
|
+
var fromInput2 = (input) => {
|
|
34757
|
+
if (input === undefined) {
|
|
34758
|
+
return empty13;
|
|
34759
|
+
} else if (Symbol.iterator in input) {
|
|
34760
|
+
const out2 = Object.create(Proto6);
|
|
34761
|
+
for (const [k, v] of input) {
|
|
34762
|
+
out2[k.toLowerCase()] = v;
|
|
34763
|
+
}
|
|
34764
|
+
return out2;
|
|
34349
34765
|
}
|
|
34350
|
-
|
|
34766
|
+
const out = Object.create(Proto6);
|
|
34767
|
+
for (const [k, v] of Object.entries(input)) {
|
|
34768
|
+
if (Array.isArray(v)) {
|
|
34769
|
+
out[k.toLowerCase()] = v.join(", ");
|
|
34770
|
+
} else if (v !== undefined) {
|
|
34771
|
+
out[k.toLowerCase()] = v;
|
|
34772
|
+
}
|
|
34773
|
+
}
|
|
34774
|
+
return out;
|
|
34351
34775
|
};
|
|
34352
|
-
var
|
|
34353
|
-
|
|
34354
|
-
const
|
|
34355
|
-
|
|
34356
|
-
|
|
34357
|
-
|
|
34358
|
-
|
|
34359
|
-
|
|
34360
|
-
|
|
34776
|
+
var fromRecordUnsafe = (input) => Object.setPrototypeOf(input, Proto6);
|
|
34777
|
+
var set9 = /* @__PURE__ */ dual(3, (self, key, value3) => {
|
|
34778
|
+
const out = make34(self);
|
|
34779
|
+
out[key.toLowerCase()] = value3;
|
|
34780
|
+
return out;
|
|
34781
|
+
});
|
|
34782
|
+
var setAll = /* @__PURE__ */ dual(2, (self, headers) => make34({
|
|
34783
|
+
...self,
|
|
34784
|
+
...fromInput2(headers)
|
|
34785
|
+
}));
|
|
34786
|
+
var remove8 = /* @__PURE__ */ dual(2, (self, key) => {
|
|
34787
|
+
const out = make34(self);
|
|
34788
|
+
delete out[key.toLowerCase()];
|
|
34789
|
+
return out;
|
|
34790
|
+
});
|
|
34791
|
+
var redact4 = /* @__PURE__ */ dual(2, (self, key) => {
|
|
34792
|
+
const out = {
|
|
34793
|
+
...self
|
|
34794
|
+
};
|
|
34795
|
+
const modify5 = (key2) => {
|
|
34796
|
+
if (typeof key2 === "string") {
|
|
34797
|
+
const k = key2.toLowerCase();
|
|
34798
|
+
if (k in self) {
|
|
34799
|
+
out[k] = make11(self[k]);
|
|
34800
|
+
}
|
|
34801
|
+
} else {
|
|
34802
|
+
for (const name in self) {
|
|
34803
|
+
if (key2.test(name)) {
|
|
34804
|
+
out[name] = make11(self[name]);
|
|
34805
|
+
}
|
|
34806
|
+
}
|
|
34807
|
+
}
|
|
34808
|
+
};
|
|
34809
|
+
if (Array.isArray(key)) {
|
|
34810
|
+
for (let i = 0;i < key.length; i++) {
|
|
34811
|
+
modify5(key[i]);
|
|
34812
|
+
}
|
|
34813
|
+
} else {
|
|
34814
|
+
modify5(key);
|
|
34361
34815
|
}
|
|
34362
|
-
|
|
34363
|
-
|
|
34364
|
-
|
|
34365
|
-
|
|
34366
|
-
|
|
34816
|
+
return out;
|
|
34817
|
+
});
|
|
34818
|
+
var CurrentRedactedNames = /* @__PURE__ */ Reference("effect/Headers/CurrentRedactedNames", {
|
|
34819
|
+
defaultValue: () => ["authorization", "cookie", "set-cookie", "x-api-key"]
|
|
34820
|
+
});
|
|
34821
|
+
|
|
34822
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/HttpClientError.js
|
|
34823
|
+
var TypeId40 = "~effect/http/HttpClientError";
|
|
34824
|
+
var isHttpClientError = (u) => hasProperty(u, TypeId40);
|
|
34825
|
+
|
|
34826
|
+
class HttpClientError extends (/* @__PURE__ */ TaggedError2("HttpClientError")) {
|
|
34827
|
+
constructor(props) {
|
|
34828
|
+
if ("cause" in props.reason) {
|
|
34829
|
+
super({
|
|
34830
|
+
...props,
|
|
34831
|
+
cause: props.reason.cause
|
|
34832
|
+
});
|
|
34833
|
+
} else {
|
|
34834
|
+
super(props);
|
|
34835
|
+
}
|
|
34836
|
+
}
|
|
34837
|
+
[TypeId40] = TypeId40;
|
|
34838
|
+
get request() {
|
|
34839
|
+
return this.reason.request;
|
|
34840
|
+
}
|
|
34841
|
+
get response() {
|
|
34842
|
+
return "response" in this.reason ? this.reason.response : undefined;
|
|
34843
|
+
}
|
|
34844
|
+
get message() {
|
|
34845
|
+
return this.reason.message;
|
|
34846
|
+
}
|
|
34847
|
+
}
|
|
34848
|
+
var formatReason = (tag2) => tag2.endsWith("Error") ? tag2.slice(0, -5) : tag2;
|
|
34849
|
+
var formatMessage = (reason, description, info) => description ? `${reason}: ${description} (${info})` : `${reason} error (${info})`;
|
|
34850
|
+
class InvalidUrlError extends (/* @__PURE__ */ TaggedError2("InvalidUrlError")) {
|
|
34851
|
+
get methodAndUrl() {
|
|
34852
|
+
return `${this.request.method} ${this.request.url}`;
|
|
34853
|
+
}
|
|
34854
|
+
get message() {
|
|
34855
|
+
return formatMessage(formatReason(this._tag), this.description, this.methodAndUrl);
|
|
34856
|
+
}
|
|
34857
|
+
}
|
|
34858
|
+
|
|
34859
|
+
class StatusCodeError extends (/* @__PURE__ */ TaggedError2("StatusCodeError")) {
|
|
34860
|
+
get methodAndUrl() {
|
|
34861
|
+
return `${this.request.method} ${this.request.url}`;
|
|
34862
|
+
}
|
|
34863
|
+
get message() {
|
|
34864
|
+
const info = `${this.response.status} ${this.methodAndUrl}`;
|
|
34865
|
+
return formatMessage(formatReason(this._tag), this.description, info);
|
|
34866
|
+
}
|
|
34867
|
+
}
|
|
34868
|
+
|
|
34869
|
+
class DecodeError extends (/* @__PURE__ */ TaggedError2("DecodeError")) {
|
|
34870
|
+
get methodAndUrl() {
|
|
34871
|
+
return `${this.request.method} ${this.request.url}`;
|
|
34872
|
+
}
|
|
34873
|
+
get message() {
|
|
34874
|
+
const info = `${this.response.status} ${this.methodAndUrl}`;
|
|
34875
|
+
return formatMessage(formatReason(this._tag), this.description, info);
|
|
34876
|
+
}
|
|
34877
|
+
}
|
|
34878
|
+
|
|
34879
|
+
class EmptyBodyError extends (/* @__PURE__ */ TaggedError2("EmptyBodyError")) {
|
|
34880
|
+
get methodAndUrl() {
|
|
34881
|
+
return `${this.request.method} ${this.request.url}`;
|
|
34882
|
+
}
|
|
34883
|
+
get message() {
|
|
34884
|
+
const info = `${this.response.status} ${this.methodAndUrl}`;
|
|
34885
|
+
return formatMessage(formatReason(this._tag), this.description, info);
|
|
34886
|
+
}
|
|
34887
|
+
}
|
|
34888
|
+
|
|
34889
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/HttpClientRequest.js
|
|
34890
|
+
var exports_HttpClientRequest = {};
|
|
34891
|
+
__export(exports_HttpClientRequest, {
|
|
34892
|
+
updateUrl: () => updateUrl,
|
|
34893
|
+
trace: () => trace,
|
|
34894
|
+
toWebResult: () => toWebResult,
|
|
34895
|
+
toWeb: () => toWeb,
|
|
34896
|
+
toUrl: () => toUrl,
|
|
34897
|
+
setUrlParams: () => setUrlParams2,
|
|
34898
|
+
setUrlParam: () => setUrlParam,
|
|
34899
|
+
setUrl: () => setUrl,
|
|
34900
|
+
setMethod: () => setMethod,
|
|
34901
|
+
setHeaders: () => setHeaders,
|
|
34902
|
+
setHeader: () => setHeader,
|
|
34903
|
+
setHash: () => setHash2,
|
|
34904
|
+
setBody: () => setBody,
|
|
34905
|
+
schemaBodyJson: () => schemaBodyJson,
|
|
34906
|
+
removeHash: () => removeHash,
|
|
34907
|
+
put: () => put,
|
|
34908
|
+
prependUrl: () => prependUrl,
|
|
34909
|
+
post: () => post,
|
|
34910
|
+
patch: () => patch,
|
|
34911
|
+
options: () => options,
|
|
34912
|
+
modify: () => modify5,
|
|
34913
|
+
makeWith: () => makeWith,
|
|
34914
|
+
make: () => make37,
|
|
34915
|
+
isHttpClientRequest: () => isHttpClientRequest,
|
|
34916
|
+
head: () => head,
|
|
34917
|
+
get: () => get11,
|
|
34918
|
+
fromWeb: () => fromWeb,
|
|
34919
|
+
empty: () => empty16,
|
|
34920
|
+
delete: () => del,
|
|
34921
|
+
bodyUrlParams: () => bodyUrlParams,
|
|
34922
|
+
bodyUint8Array: () => bodyUint8Array,
|
|
34923
|
+
bodyText: () => bodyText,
|
|
34924
|
+
bodyStream: () => bodyStream,
|
|
34925
|
+
bodyJsonUnsafe: () => bodyJsonUnsafe,
|
|
34926
|
+
bodyJson: () => bodyJson,
|
|
34927
|
+
bodyFormDataRecord: () => bodyFormDataRecord,
|
|
34928
|
+
bodyFormData: () => bodyFormData,
|
|
34929
|
+
bodyFile: () => bodyFile,
|
|
34930
|
+
bearerToken: () => bearerToken,
|
|
34931
|
+
basicAuth: () => basicAuth,
|
|
34932
|
+
appendUrlParams: () => appendUrlParams,
|
|
34933
|
+
appendUrlParam: () => appendUrlParam,
|
|
34934
|
+
appendUrl: () => appendUrl,
|
|
34935
|
+
acceptJson: () => acceptJson,
|
|
34936
|
+
accept: () => accept
|
|
34937
|
+
});
|
|
34938
|
+
|
|
34939
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/UrlParams.js
|
|
34940
|
+
var TypeId41 = "~effect/http/UrlParams";
|
|
34941
|
+
var isUrlParams = (u) => hasProperty(u, TypeId41);
|
|
34942
|
+
var Proto7 = {
|
|
34943
|
+
...PipeInspectableProto,
|
|
34944
|
+
[TypeId41]: TypeId41,
|
|
34945
|
+
[Symbol.iterator]() {
|
|
34946
|
+
return this.params[Symbol.iterator]();
|
|
34947
|
+
},
|
|
34948
|
+
toJSON() {
|
|
34949
|
+
return {
|
|
34950
|
+
_id: "UrlParams",
|
|
34951
|
+
params: Object.fromEntries(this.params)
|
|
34952
|
+
};
|
|
34953
|
+
},
|
|
34954
|
+
[symbol2](that) {
|
|
34955
|
+
return Equivalence8(this, that);
|
|
34956
|
+
},
|
|
34957
|
+
[symbol]() {
|
|
34958
|
+
return array(this.params.flat());
|
|
34959
|
+
}
|
|
34960
|
+
};
|
|
34961
|
+
var make35 = (params) => {
|
|
34962
|
+
const self = Object.create(Proto7);
|
|
34963
|
+
self.params = params;
|
|
34964
|
+
return self;
|
|
34965
|
+
};
|
|
34966
|
+
var fromInput3 = (input) => {
|
|
34967
|
+
if (isUrlParams(input)) {
|
|
34968
|
+
return input;
|
|
34969
|
+
}
|
|
34970
|
+
const parsed = fromInputNested(input);
|
|
34971
|
+
const out = [];
|
|
34972
|
+
for (let i = 0;i < parsed.length; i++) {
|
|
34973
|
+
if (Array.isArray(parsed[i][0])) {
|
|
34974
|
+
const [keys5, value3] = parsed[i];
|
|
34975
|
+
out.push([`${keys5[0]}[${keys5.slice(1).join("][")}]`, value3]);
|
|
34976
|
+
} else {
|
|
34977
|
+
out.push(parsed[i]);
|
|
34978
|
+
}
|
|
34979
|
+
}
|
|
34980
|
+
return make35(out);
|
|
34981
|
+
};
|
|
34982
|
+
var fromInputNested = (input) => {
|
|
34983
|
+
const entries3 = typeof input[Symbol.iterator] === "function" ? fromIterable2(input) : Object.entries(input);
|
|
34984
|
+
const out = [];
|
|
34985
|
+
for (const [key, value3] of entries3) {
|
|
34986
|
+
if (Array.isArray(value3)) {
|
|
34987
|
+
for (let i = 0;i < value3.length; i++) {
|
|
34988
|
+
if (value3[i] !== undefined) {
|
|
34989
|
+
out.push([key, String(value3[i])]);
|
|
34990
|
+
}
|
|
34991
|
+
}
|
|
34992
|
+
} else if (typeof value3 === "object") {
|
|
34993
|
+
const nested = fromInputNested(value3);
|
|
34994
|
+
for (const [k, v] of nested) {
|
|
34995
|
+
out.push([[key, ...typeof k === "string" ? [k] : k], v]);
|
|
34996
|
+
}
|
|
34997
|
+
} else if (value3 !== undefined) {
|
|
34998
|
+
out.push([key, String(value3)]);
|
|
34999
|
+
}
|
|
35000
|
+
}
|
|
35001
|
+
return out;
|
|
35002
|
+
};
|
|
35003
|
+
var Equivalence8 = /* @__PURE__ */ make3((a, b) => arrayEquivalence(a.params, b.params));
|
|
35004
|
+
var arrayEquivalence = /* @__PURE__ */ makeEquivalence5(/* @__PURE__ */ makeEquivalence3([/* @__PURE__ */ strictEqual(), /* @__PURE__ */ strictEqual()]));
|
|
35005
|
+
var UrlParamsSchema = /* @__PURE__ */ declare(isUrlParams, {
|
|
35006
|
+
typeConstructor: {
|
|
35007
|
+
_tag: "effect/http/UrlParams"
|
|
35008
|
+
},
|
|
35009
|
+
generation: {
|
|
35010
|
+
runtime: `UrlParams.UrlParamsSchema`,
|
|
35011
|
+
Type: `UrlParams.UrlParams`,
|
|
35012
|
+
Encoded: `typeof UrlParams.UrlParamsSchema["Encoded"]`,
|
|
35013
|
+
importDeclaration: `import * as UrlParams from "effect/unstable/http/UrlParams"`
|
|
35014
|
+
},
|
|
35015
|
+
expected: "UrlParams",
|
|
35016
|
+
toEquivalence: () => Equivalence8,
|
|
35017
|
+
toCodec: () => link()(ArraySchema(Tuple2([String5, String5])), transform2({
|
|
35018
|
+
decode: make35,
|
|
35019
|
+
encode: (self) => self.params
|
|
35020
|
+
}))
|
|
35021
|
+
});
|
|
35022
|
+
var empty14 = /* @__PURE__ */ make35([]);
|
|
35023
|
+
var set10 = /* @__PURE__ */ dual(3, (self, key, value3) => make35(append(filter4(self.params, ([k]) => k !== key), [key, String(value3)])));
|
|
35024
|
+
var transform3 = /* @__PURE__ */ dual(2, (self, f) => make35(f(self.params)));
|
|
35025
|
+
var setAll2 = /* @__PURE__ */ dual(2, (self, input) => {
|
|
35026
|
+
const out = fromInput3(input);
|
|
35027
|
+
const params = out.params;
|
|
35028
|
+
const keys5 = new Set;
|
|
35029
|
+
for (let i = 0;i < params.length; i++) {
|
|
35030
|
+
keys5.add(params[i][0]);
|
|
35031
|
+
}
|
|
35032
|
+
for (let i = 0;i < self.params.length; i++) {
|
|
35033
|
+
if (keys5.has(self.params[i][0]))
|
|
35034
|
+
continue;
|
|
35035
|
+
params.push(self.params[i]);
|
|
35036
|
+
}
|
|
35037
|
+
return out;
|
|
35038
|
+
});
|
|
35039
|
+
var append3 = /* @__PURE__ */ dual(3, (self, key, value3) => make35(append(self.params, [key, String(value3)])));
|
|
35040
|
+
var appendAll3 = /* @__PURE__ */ dual(2, (self, input) => transform3(self, appendAll(fromInput3(input).params)));
|
|
35041
|
+
var toString = (input) => new URLSearchParams(fromInput3(input).params).toString();
|
|
35042
|
+
var toRecord = (self) => {
|
|
35043
|
+
const out = {};
|
|
35044
|
+
for (const [k, value3] of self.params) {
|
|
35045
|
+
const curr = out[k];
|
|
35046
|
+
if (curr === undefined) {
|
|
35047
|
+
out[k] = value3;
|
|
35048
|
+
} else if (typeof curr === "string") {
|
|
35049
|
+
out[k] = [curr, value3];
|
|
35050
|
+
} else {
|
|
35051
|
+
curr.push(value3);
|
|
35052
|
+
}
|
|
35053
|
+
}
|
|
35054
|
+
return out;
|
|
35055
|
+
};
|
|
35056
|
+
var toReadonlyRecord = toRecord;
|
|
35057
|
+
var schemaRecord = /* @__PURE__ */ UrlParamsSchema.pipe(/* @__PURE__ */ decodeTo2(/* @__PURE__ */ Record(String5, /* @__PURE__ */ Union2([String5, /* @__PURE__ */ NonEmptyArray(String5)])), /* @__PURE__ */ transform2({
|
|
35058
|
+
decode: toReadonlyRecord,
|
|
35059
|
+
encode: fromInput3
|
|
35060
|
+
})));
|
|
35061
|
+
|
|
35062
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/HttpBody.js
|
|
35063
|
+
var TypeId42 = "~effect/http/HttpBody";
|
|
35064
|
+
var HttpBodyErrorTypeId = "~effect/http/HttpBody/HttpBodyError";
|
|
35065
|
+
|
|
35066
|
+
class HttpBodyError extends (/* @__PURE__ */ TaggedError2("HttpBodyError")) {
|
|
35067
|
+
[HttpBodyErrorTypeId] = HttpBodyErrorTypeId;
|
|
35068
|
+
}
|
|
35069
|
+
|
|
35070
|
+
class Proto8 {
|
|
35071
|
+
[TypeId42];
|
|
35072
|
+
constructor() {
|
|
35073
|
+
this[TypeId42] = TypeId42;
|
|
35074
|
+
}
|
|
35075
|
+
[NodeInspectSymbol]() {
|
|
35076
|
+
return this.toJSON();
|
|
35077
|
+
}
|
|
35078
|
+
toString() {
|
|
35079
|
+
return format(this, {
|
|
35080
|
+
ignoreToString: true
|
|
35081
|
+
});
|
|
35082
|
+
}
|
|
35083
|
+
}
|
|
35084
|
+
|
|
35085
|
+
class Empty2 extends Proto8 {
|
|
35086
|
+
_tag = "Empty";
|
|
35087
|
+
toJSON() {
|
|
35088
|
+
return {
|
|
35089
|
+
_id: "effect/HttpBody",
|
|
35090
|
+
_tag: "Empty"
|
|
35091
|
+
};
|
|
35092
|
+
}
|
|
35093
|
+
}
|
|
35094
|
+
var empty15 = /* @__PURE__ */ new Empty2;
|
|
35095
|
+
|
|
35096
|
+
class Raw extends Proto8 {
|
|
35097
|
+
_tag = "Raw";
|
|
35098
|
+
body;
|
|
35099
|
+
contentType;
|
|
35100
|
+
contentLength;
|
|
35101
|
+
constructor(body, contentType, contentLength) {
|
|
35102
|
+
super();
|
|
35103
|
+
this.body = body;
|
|
35104
|
+
this.contentType = contentType;
|
|
35105
|
+
this.contentLength = contentLength;
|
|
35106
|
+
}
|
|
35107
|
+
toJSON() {
|
|
35108
|
+
return {
|
|
35109
|
+
_id: "effect/HttpBody",
|
|
35110
|
+
_tag: "Raw",
|
|
35111
|
+
body: this.body,
|
|
35112
|
+
contentType: this.contentType,
|
|
35113
|
+
contentLength: this.contentLength
|
|
35114
|
+
};
|
|
35115
|
+
}
|
|
35116
|
+
}
|
|
35117
|
+
var raw = (body, options) => new Raw(body, options?.contentType, options?.contentLength);
|
|
35118
|
+
|
|
35119
|
+
class Uint8Array3 extends Proto8 {
|
|
35120
|
+
_tag = "Uint8Array";
|
|
35121
|
+
body;
|
|
35122
|
+
contentType;
|
|
35123
|
+
contentLength;
|
|
35124
|
+
constructor(body, contentType, contentLength) {
|
|
35125
|
+
super();
|
|
35126
|
+
this.body = body;
|
|
35127
|
+
this.contentType = contentType;
|
|
35128
|
+
this.contentLength = contentLength;
|
|
35129
|
+
}
|
|
35130
|
+
toJSON() {
|
|
35131
|
+
const toString2 = this.contentType.startsWith("text/") || this.contentType.endsWith("json");
|
|
35132
|
+
return {
|
|
35133
|
+
_id: "effect/HttpBody",
|
|
35134
|
+
_tag: "Uint8Array",
|
|
35135
|
+
body: toString2 ? new TextDecoder().decode(this.body) : `Uint8Array(${this.body.length})`,
|
|
35136
|
+
contentType: this.contentType,
|
|
35137
|
+
contentLength: this.contentLength
|
|
35138
|
+
};
|
|
35139
|
+
}
|
|
35140
|
+
}
|
|
35141
|
+
var uint8Array2 = (body, contentType) => new Uint8Array3(body, contentType ?? "application/octet-stream", body.length);
|
|
35142
|
+
var encoder2 = /* @__PURE__ */ new TextEncoder;
|
|
35143
|
+
var text = (body, contentType) => uint8Array2(encoder2.encode(body), contentType ?? "text/plain");
|
|
35144
|
+
var jsonUnsafe = (body, contentType) => text(JSON.stringify(body), contentType ?? "application/json");
|
|
35145
|
+
var json2 = (body, contentType) => try_3({
|
|
35146
|
+
try: () => text(JSON.stringify(body), contentType ?? "application/json"),
|
|
35147
|
+
catch: (cause) => new HttpBodyError({
|
|
35148
|
+
reason: {
|
|
35149
|
+
_tag: "JsonError"
|
|
35150
|
+
},
|
|
35151
|
+
cause
|
|
35152
|
+
})
|
|
35153
|
+
});
|
|
35154
|
+
var jsonSchema = (schema, options) => {
|
|
35155
|
+
const encode2 = encodeUnknownEffect(toCodecJson(schema));
|
|
35156
|
+
return (body, contentType) => encode2(body, options).pipe(mapError3((issue) => new HttpBodyError({
|
|
35157
|
+
reason: {
|
|
35158
|
+
_tag: "SchemaError",
|
|
35159
|
+
issue
|
|
35160
|
+
},
|
|
35161
|
+
cause: issue
|
|
35162
|
+
})), flatMap5((body2) => json2(body2, contentType)));
|
|
35163
|
+
};
|
|
35164
|
+
var urlParams = (urlParams2, contentType) => text(toString(fromInput3(urlParams2)), contentType ?? "application/x-www-form-urlencoded");
|
|
35165
|
+
|
|
35166
|
+
class FormData3 extends Proto8 {
|
|
35167
|
+
_tag = "FormData";
|
|
35168
|
+
contentType = undefined;
|
|
35169
|
+
contentLength = undefined;
|
|
35170
|
+
formData;
|
|
35171
|
+
constructor(formData) {
|
|
35172
|
+
super();
|
|
35173
|
+
this.formData = formData;
|
|
35174
|
+
}
|
|
35175
|
+
toJSON() {
|
|
35176
|
+
return {
|
|
35177
|
+
_id: "effect/HttpBody",
|
|
35178
|
+
_tag: "FormData",
|
|
35179
|
+
formData: this.formData
|
|
35180
|
+
};
|
|
35181
|
+
}
|
|
35182
|
+
}
|
|
35183
|
+
var formData = (body) => new FormData3(body);
|
|
35184
|
+
var appendFormDataValue = (formData2, key, value3) => {
|
|
35185
|
+
if (value3 == null) {
|
|
35186
|
+
return;
|
|
35187
|
+
}
|
|
35188
|
+
if (typeof value3 === "object") {
|
|
35189
|
+
formData2.append(key, value3);
|
|
35190
|
+
return;
|
|
35191
|
+
}
|
|
35192
|
+
formData2.append(key, String(value3));
|
|
35193
|
+
};
|
|
35194
|
+
var formDataRecord = (entries3) => {
|
|
35195
|
+
const data = new globalThis.FormData;
|
|
35196
|
+
for (const [key, value3] of Object.entries(entries3)) {
|
|
35197
|
+
if (Array.isArray(value3)) {
|
|
35198
|
+
for (const item of value3) {
|
|
35199
|
+
appendFormDataValue(data, key, item);
|
|
35200
|
+
}
|
|
35201
|
+
} else {
|
|
35202
|
+
appendFormDataValue(data, key, value3);
|
|
35203
|
+
}
|
|
35204
|
+
}
|
|
35205
|
+
return formData(data);
|
|
35206
|
+
};
|
|
35207
|
+
|
|
35208
|
+
class Stream3 extends Proto8 {
|
|
35209
|
+
_tag = "Stream";
|
|
35210
|
+
stream;
|
|
35211
|
+
contentType;
|
|
35212
|
+
contentLength;
|
|
35213
|
+
constructor(stream2, contentType, contentLength) {
|
|
35214
|
+
super();
|
|
35215
|
+
this.stream = stream2;
|
|
35216
|
+
this.contentType = contentType;
|
|
35217
|
+
this.contentLength = contentLength;
|
|
35218
|
+
}
|
|
35219
|
+
toJSON() {
|
|
35220
|
+
return {
|
|
35221
|
+
_id: "effect/HttpBody",
|
|
35222
|
+
_tag: "Stream",
|
|
35223
|
+
contentType: this.contentType,
|
|
35224
|
+
contentLength: this.contentLength
|
|
35225
|
+
};
|
|
35226
|
+
}
|
|
35227
|
+
}
|
|
35228
|
+
var stream2 = (body, contentType, contentLength) => new Stream3(body, contentType ?? "application/octet-stream", contentLength);
|
|
35229
|
+
var file = (path, options) => flatMap5(FileSystem, (fs) => map8(fs.stat(path), (info) => stream2(fs.stream(path, options), options?.contentType, Number(info.size))));
|
|
35230
|
+
|
|
35231
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/HttpMethod.js
|
|
35232
|
+
var hasBody = (method) => method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE";
|
|
35233
|
+
var allShort = [["GET", "get"], ["POST", "post"], ["PUT", "put"], ["DELETE", "del"], ["PATCH", "patch"], ["HEAD", "head"], ["OPTIONS", "options"], ["TRACE", "trace"]];
|
|
35234
|
+
|
|
35235
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/Url.js
|
|
35236
|
+
var exports_Url = {};
|
|
35237
|
+
__export(exports_Url, {
|
|
35238
|
+
urlParams: () => urlParams2,
|
|
35239
|
+
setUsername: () => setUsername,
|
|
35240
|
+
setUrlParams: () => setUrlParams,
|
|
35241
|
+
setSearch: () => setSearch,
|
|
35242
|
+
setProtocol: () => setProtocol,
|
|
35243
|
+
setPort: () => setPort,
|
|
35244
|
+
setPathname: () => setPathname,
|
|
35245
|
+
setPassword: () => setPassword,
|
|
35246
|
+
setHref: () => setHref,
|
|
35247
|
+
setHostname: () => setHostname,
|
|
35248
|
+
setHost: () => setHost,
|
|
35249
|
+
setHash: () => setHash,
|
|
35250
|
+
mutate: () => mutate5,
|
|
35251
|
+
modifyUrlParams: () => modifyUrlParams,
|
|
35252
|
+
make: () => make36,
|
|
35253
|
+
fromString: () => fromString2,
|
|
35254
|
+
UrlError: () => UrlError
|
|
35255
|
+
});
|
|
35256
|
+
class UrlError extends (/* @__PURE__ */ TaggedError2("UrlError")) {
|
|
35257
|
+
}
|
|
35258
|
+
var make36 = (url, params, hash3) => try_({
|
|
35259
|
+
try: () => {
|
|
35260
|
+
const urlInstance = new URL(url, baseUrl());
|
|
35261
|
+
for (let i = 0;i < params.params.length; i++) {
|
|
35262
|
+
const [key, value3] = params.params[i];
|
|
35263
|
+
if (value3 !== undefined) {
|
|
35264
|
+
urlInstance.searchParams.append(key, value3);
|
|
35265
|
+
}
|
|
35266
|
+
}
|
|
35267
|
+
if (hash3 !== undefined) {
|
|
35268
|
+
urlInstance.hash = hash3;
|
|
35269
|
+
}
|
|
35270
|
+
return urlInstance;
|
|
35271
|
+
},
|
|
35272
|
+
catch: (cause) => new UrlError({
|
|
35273
|
+
cause
|
|
35274
|
+
})
|
|
35275
|
+
});
|
|
35276
|
+
var baseUrl = () => {
|
|
35277
|
+
if ("location" in globalThis && globalThis.location !== undefined && globalThis.location.origin !== undefined && globalThis.location.pathname !== undefined) {
|
|
35278
|
+
return location.origin + location.pathname;
|
|
35279
|
+
}
|
|
35280
|
+
return;
|
|
35281
|
+
};
|
|
35282
|
+
var fromString2 = (url, base2) => try_({
|
|
35283
|
+
try: () => new URL(url, base2),
|
|
35284
|
+
catch: () => new IllegalArgumentError2(`Invalid URL: "${url}"${base2 !== undefined ? ` with base "${base2}"` : ""}`)
|
|
35285
|
+
});
|
|
35286
|
+
var mutate5 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
35287
|
+
const copy2 = new URL(self);
|
|
35288
|
+
f(copy2);
|
|
35289
|
+
return copy2;
|
|
35290
|
+
});
|
|
35291
|
+
var immutableURLSetter = (property2) => dual(2, (url, value3) => mutate5(url, (url2) => {
|
|
35292
|
+
url2[property2] = value3;
|
|
35293
|
+
}));
|
|
35294
|
+
var setHash = /* @__PURE__ */ immutableURLSetter("hash");
|
|
35295
|
+
var setHost = /* @__PURE__ */ immutableURLSetter("host");
|
|
35296
|
+
var setHostname = /* @__PURE__ */ immutableURLSetter("hostname");
|
|
35297
|
+
var setHref = /* @__PURE__ */ immutableURLSetter("href");
|
|
35298
|
+
var setPassword = /* @__PURE__ */ dual(2, (url, password) => mutate5(url, (url2) => {
|
|
35299
|
+
url2.password = typeof password === "string" ? password : value2(password);
|
|
35300
|
+
}));
|
|
35301
|
+
var setPathname = /* @__PURE__ */ immutableURLSetter("pathname");
|
|
35302
|
+
var setPort = /* @__PURE__ */ immutableURLSetter("port");
|
|
35303
|
+
var setProtocol = /* @__PURE__ */ immutableURLSetter("protocol");
|
|
35304
|
+
var setSearch = /* @__PURE__ */ immutableURLSetter("search");
|
|
35305
|
+
var setUsername = /* @__PURE__ */ immutableURLSetter("username");
|
|
35306
|
+
var setUrlParams = /* @__PURE__ */ dual(2, (url, urlParams2) => mutate5(url, (url2) => {
|
|
35307
|
+
url2.search = toString(fromInput3(urlParams2));
|
|
35308
|
+
}));
|
|
35309
|
+
var urlParams2 = (url) => fromInput3(url.searchParams);
|
|
35310
|
+
var modifyUrlParams = /* @__PURE__ */ dual(2, (url, f) => mutate5(url, (url2) => {
|
|
35311
|
+
const params = f(fromInput3(url2.searchParams));
|
|
35312
|
+
url2.search = toString(params);
|
|
35313
|
+
}));
|
|
35314
|
+
|
|
35315
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/HttpClientRequest.js
|
|
35316
|
+
var TypeId43 = "~effect/http/HttpClientRequest";
|
|
35317
|
+
var isHttpClientRequest = (u) => hasProperty(u, TypeId43);
|
|
35318
|
+
var Proto9 = {
|
|
35319
|
+
[TypeId43]: TypeId43,
|
|
35320
|
+
...BaseProto,
|
|
35321
|
+
toJSON() {
|
|
35322
|
+
return {
|
|
35323
|
+
_id: "HttpClientRequest",
|
|
35324
|
+
method: this.method,
|
|
35325
|
+
url: this.url,
|
|
35326
|
+
urlParams: this.urlParams,
|
|
35327
|
+
hash: this.hash,
|
|
35328
|
+
headers: redact(this.headers),
|
|
35329
|
+
body: this.body.toJSON()
|
|
35330
|
+
};
|
|
35331
|
+
},
|
|
35332
|
+
pipe() {
|
|
35333
|
+
return pipeArguments(this, arguments);
|
|
35334
|
+
}
|
|
35335
|
+
};
|
|
35336
|
+
function makeWith(method, url, urlParams3, hash3, headers, body) {
|
|
35337
|
+
const self = Object.create(Proto9);
|
|
35338
|
+
self.method = method;
|
|
35339
|
+
self.url = url;
|
|
35340
|
+
self.urlParams = urlParams3;
|
|
35341
|
+
self.hash = hash3;
|
|
35342
|
+
self.headers = headers;
|
|
35343
|
+
self.body = body;
|
|
35344
|
+
return self;
|
|
35345
|
+
}
|
|
35346
|
+
var empty16 = /* @__PURE__ */ makeWith("GET", "", empty14, /* @__PURE__ */ none2(), empty13, empty15);
|
|
35347
|
+
var make37 = (method) => (url, options) => modify5(empty16, {
|
|
35348
|
+
method,
|
|
35349
|
+
url,
|
|
35350
|
+
...options ?? undefined
|
|
35351
|
+
});
|
|
35352
|
+
var get11 = /* @__PURE__ */ make37("GET");
|
|
35353
|
+
var post = /* @__PURE__ */ make37("POST");
|
|
35354
|
+
var patch = /* @__PURE__ */ make37("PATCH");
|
|
35355
|
+
var put = /* @__PURE__ */ make37("PUT");
|
|
35356
|
+
var del = /* @__PURE__ */ make37("DELETE");
|
|
35357
|
+
var head = /* @__PURE__ */ make37("HEAD");
|
|
35358
|
+
var options = /* @__PURE__ */ make37("OPTIONS");
|
|
35359
|
+
var trace = /* @__PURE__ */ make37("TRACE");
|
|
35360
|
+
var modify5 = /* @__PURE__ */ dual(2, (self, options2) => {
|
|
35361
|
+
let result4 = self;
|
|
35362
|
+
if (options2.method) {
|
|
35363
|
+
result4 = setMethod(result4, options2.method);
|
|
35364
|
+
}
|
|
35365
|
+
if (options2.url) {
|
|
35366
|
+
result4 = setUrl(result4, options2.url);
|
|
35367
|
+
}
|
|
35368
|
+
if (options2.headers) {
|
|
35369
|
+
result4 = setHeaders(result4, options2.headers);
|
|
35370
|
+
}
|
|
35371
|
+
if (options2.urlParams) {
|
|
35372
|
+
result4 = setUrlParams2(result4, options2.urlParams);
|
|
35373
|
+
}
|
|
35374
|
+
if (options2.hash) {
|
|
35375
|
+
result4 = setHash2(result4, options2.hash);
|
|
35376
|
+
}
|
|
35377
|
+
if (options2.body) {
|
|
35378
|
+
result4 = setBody(result4, options2.body);
|
|
35379
|
+
}
|
|
35380
|
+
if (options2.accept) {
|
|
35381
|
+
result4 = accept(result4, options2.accept);
|
|
35382
|
+
}
|
|
35383
|
+
if (options2.acceptJson) {
|
|
35384
|
+
result4 = acceptJson(result4);
|
|
35385
|
+
}
|
|
35386
|
+
return result4;
|
|
35387
|
+
});
|
|
35388
|
+
var setMethod = /* @__PURE__ */ dual(2, (self, method) => makeWith(method, self.url, self.urlParams, self.hash, self.headers, self.body));
|
|
35389
|
+
var setHeader = /* @__PURE__ */ dual(3, (self, key, value3) => makeWith(self.method, self.url, self.urlParams, self.hash, set9(self.headers, key, value3), self.body));
|
|
35390
|
+
var setHeaders = /* @__PURE__ */ dual(2, (self, input) => makeWith(self.method, self.url, self.urlParams, self.hash, setAll(self.headers, input), self.body));
|
|
35391
|
+
var basicAuth = /* @__PURE__ */ dual(3, (self, username, password) => setHeader(self, "Authorization", `Basic ${btoa(`${stringOrRedacted(username)}:${stringOrRedacted(password)}`)}`));
|
|
35392
|
+
var bearerToken = /* @__PURE__ */ dual(2, (self, token) => setHeader(self, "Authorization", `Bearer ${stringOrRedacted(token)}`));
|
|
35393
|
+
var accept = /* @__PURE__ */ dual(2, (self, mediaType) => setHeader(self, "Accept", mediaType));
|
|
35394
|
+
var acceptJson = /* @__PURE__ */ accept("application/json");
|
|
35395
|
+
var setUrl = /* @__PURE__ */ dual(2, (self, url) => {
|
|
35396
|
+
if (typeof url === "string") {
|
|
35397
|
+
return makeWith(self.method, url, self.urlParams, self.hash, self.headers, self.body);
|
|
35398
|
+
}
|
|
35399
|
+
const clone2 = new URL(url.toString());
|
|
35400
|
+
const urlParams3 = fromInput3(clone2.searchParams);
|
|
35401
|
+
const hash3 = fromNullishOr(clone2.hash === "" ? undefined : clone2.hash.slice(1));
|
|
35402
|
+
clone2.search = "";
|
|
35403
|
+
clone2.hash = "";
|
|
35404
|
+
return makeWith(self.method, clone2.toString(), urlParams3, hash3, self.headers, self.body);
|
|
35405
|
+
});
|
|
35406
|
+
var prependUrl = /* @__PURE__ */ dual(2, (self, path) => {
|
|
35407
|
+
if (path === "")
|
|
35408
|
+
return self;
|
|
35409
|
+
return makeWith(self.method, joinSegments(path, self.url), self.urlParams, self.hash, self.headers, self.body);
|
|
35410
|
+
});
|
|
35411
|
+
var appendUrl = /* @__PURE__ */ dual(2, (self, path) => {
|
|
35412
|
+
if (path === "")
|
|
35413
|
+
return self;
|
|
35414
|
+
return makeWith(self.method, joinSegments(self.url, path), self.urlParams, self.hash, self.headers, self.body);
|
|
35415
|
+
});
|
|
35416
|
+
var joinSegments = (first, second) => {
|
|
35417
|
+
const endsWithSlash = first.endsWith("/");
|
|
35418
|
+
const startsWithSlash = second.startsWith("/");
|
|
35419
|
+
const needsTrim = endsWithSlash && startsWithSlash;
|
|
35420
|
+
const needsSlash = !endsWithSlash && !startsWithSlash;
|
|
35421
|
+
return needsTrim ? first + second.slice(1) : needsSlash ? first + "/" + second : first + second;
|
|
35422
|
+
};
|
|
35423
|
+
var updateUrl = /* @__PURE__ */ dual(2, (self, f) => makeWith(self.method, f(self.url), self.urlParams, self.hash, self.headers, self.body));
|
|
35424
|
+
var setUrlParam = /* @__PURE__ */ dual(3, (self, key, value3) => makeWith(self.method, self.url, set10(self.urlParams, key, value3), self.hash, self.headers, self.body));
|
|
35425
|
+
var setUrlParams2 = /* @__PURE__ */ dual(2, (self, input) => makeWith(self.method, self.url, setAll2(self.urlParams, input), self.hash, self.headers, self.body));
|
|
35426
|
+
var appendUrlParam = /* @__PURE__ */ dual(3, (self, key, value3) => makeWith(self.method, self.url, append3(self.urlParams, key, value3), self.hash, self.headers, self.body));
|
|
35427
|
+
var appendUrlParams = /* @__PURE__ */ dual(2, (self, input) => makeWith(self.method, self.url, appendAll3(self.urlParams, input), self.hash, self.headers, self.body));
|
|
35428
|
+
var setHash2 = /* @__PURE__ */ dual(2, (self, hash3) => makeWith(self.method, self.url, self.urlParams, some2(hash3), self.headers, self.body));
|
|
35429
|
+
var removeHash = (self) => makeWith(self.method, self.url, self.urlParams, none2(), self.headers, self.body);
|
|
35430
|
+
var setBody = /* @__PURE__ */ dual(2, (self, body) => {
|
|
35431
|
+
let headers = self.headers;
|
|
35432
|
+
if (body._tag === "Empty" || body._tag === "FormData") {
|
|
35433
|
+
headers = remove8(remove8(headers, "Content-Type"), "Content-length");
|
|
35434
|
+
} else {
|
|
35435
|
+
if (body.contentType) {
|
|
35436
|
+
headers = set9(headers, "content-type", body.contentType);
|
|
35437
|
+
}
|
|
35438
|
+
if (body.contentLength !== undefined) {
|
|
35439
|
+
headers = set9(headers, "content-length", body.contentLength.toString());
|
|
35440
|
+
}
|
|
35441
|
+
}
|
|
35442
|
+
return makeWith(self.method, self.url, self.urlParams, self.hash, headers, body);
|
|
35443
|
+
});
|
|
35444
|
+
var bodyUint8Array = /* @__PURE__ */ dual((args2) => isHttpClientRequest(args2[0]), (self, body, contentType) => setBody(self, uint8Array2(body, contentType)));
|
|
35445
|
+
var bodyText = /* @__PURE__ */ dual((args2) => isHttpClientRequest(args2[0]), (self, body, contentType) => setBody(self, text(body, contentType)));
|
|
35446
|
+
var bodyJson = /* @__PURE__ */ dual(2, (self, body) => map8(json2(body), (body2) => setBody(self, body2)));
|
|
35447
|
+
var bodyJsonUnsafe = /* @__PURE__ */ dual(2, (self, body) => setBody(self, jsonUnsafe(body)));
|
|
35448
|
+
var schemaBodyJson = (schema, options2) => {
|
|
35449
|
+
const encode2 = jsonSchema(schema, options2);
|
|
35450
|
+
return dual(2, (self, body) => map8(encode2(body), (body2) => setBody(self, body2)));
|
|
35451
|
+
};
|
|
35452
|
+
var bodyUrlParams = /* @__PURE__ */ dual(2, (self, input) => setBody(self, urlParams(fromInput3(input))));
|
|
35453
|
+
var bodyFormData = /* @__PURE__ */ dual(2, (self, body) => setBody(self, formData(body)));
|
|
35454
|
+
var bodyFormDataRecord = /* @__PURE__ */ dual(2, (self, entries3) => setBody(self, formDataRecord(entries3)));
|
|
35455
|
+
var bodyStream = /* @__PURE__ */ dual((args2) => isHttpClientRequest(args2[0]), (self, body, options2) => setBody(self, stream2(body, options2?.contentType, options2?.contentLength)));
|
|
35456
|
+
var bodyFile = /* @__PURE__ */ dual((args2) => isHttpClientRequest(args2[0]), (self, path, options2) => map8(file(path, options2), (body) => setBody(self, body)));
|
|
35457
|
+
function toUrl(self) {
|
|
35458
|
+
const r = make36(self.url, self.urlParams, getOrUndefined(self.hash));
|
|
35459
|
+
if (isSuccess2(r)) {
|
|
35460
|
+
return some2(r.success);
|
|
35461
|
+
}
|
|
35462
|
+
return none2();
|
|
35463
|
+
}
|
|
35464
|
+
var fromWeb = (request3) => {
|
|
35465
|
+
const method = request3.method.toUpperCase();
|
|
35466
|
+
return modify5(empty16, {
|
|
35467
|
+
method,
|
|
35468
|
+
url: new URL(request3.url),
|
|
35469
|
+
headers: request3.headers,
|
|
35470
|
+
body: fromWebBody(request3, method)
|
|
35471
|
+
});
|
|
35472
|
+
};
|
|
35473
|
+
var fromWebBody = (request3, method) => {
|
|
35474
|
+
if (!hasBody(method) || request3.body === null) {
|
|
35475
|
+
return empty15;
|
|
35476
|
+
}
|
|
35477
|
+
return raw(request3.body, {
|
|
35478
|
+
contentType: request3.headers.get("content-type") ?? undefined,
|
|
35479
|
+
contentLength: parseContentLength(request3.headers.get("content-length"))
|
|
35480
|
+
});
|
|
35481
|
+
};
|
|
35482
|
+
var parseContentLength = (contentLength) => {
|
|
35483
|
+
if (contentLength === null) {
|
|
35484
|
+
return;
|
|
35485
|
+
}
|
|
35486
|
+
const parsed = Number.parseInt(contentLength, 10);
|
|
35487
|
+
return Number.isNaN(parsed) ? undefined : parsed;
|
|
35488
|
+
};
|
|
35489
|
+
var toWebResult = (self, options2) => {
|
|
35490
|
+
const url = make36(self.url, self.urlParams, getOrUndefined(self.hash));
|
|
35491
|
+
if (isFailure2(url)) {
|
|
35492
|
+
return fail2(url.failure);
|
|
35493
|
+
}
|
|
35494
|
+
const requestInit = {
|
|
35495
|
+
method: self.method,
|
|
35496
|
+
headers: self.headers
|
|
35497
|
+
};
|
|
35498
|
+
if (options2?.signal) {
|
|
35499
|
+
requestInit.signal = options2.signal;
|
|
35500
|
+
}
|
|
35501
|
+
if (hasBody(self.method)) {
|
|
35502
|
+
switch (self.body._tag) {
|
|
35503
|
+
case "Empty": {
|
|
35504
|
+
break;
|
|
35505
|
+
}
|
|
35506
|
+
case "Raw": {
|
|
35507
|
+
requestInit.body = self.body.body;
|
|
35508
|
+
if (isReadableStream(self.body.body)) {
|
|
35509
|
+
requestInit.duplex = "half";
|
|
35510
|
+
}
|
|
35511
|
+
break;
|
|
35512
|
+
}
|
|
35513
|
+
case "Uint8Array": {
|
|
35514
|
+
requestInit.body = self.body.body;
|
|
35515
|
+
break;
|
|
35516
|
+
}
|
|
35517
|
+
case "FormData": {
|
|
35518
|
+
requestInit.body = self.body.formData;
|
|
35519
|
+
break;
|
|
35520
|
+
}
|
|
35521
|
+
case "Stream": {
|
|
35522
|
+
requestInit.body = toReadableStreamWith(self.body.stream, options2?.context ?? empty());
|
|
35523
|
+
requestInit.duplex = "half";
|
|
34367
35524
|
break;
|
|
34368
35525
|
}
|
|
34369
35526
|
}
|
|
34370
35527
|
}
|
|
34371
|
-
return
|
|
35528
|
+
return try_({
|
|
35529
|
+
try: () => new Request(url.success, requestInit),
|
|
35530
|
+
catch: (cause) => new UrlError({
|
|
35531
|
+
cause
|
|
35532
|
+
})
|
|
35533
|
+
});
|
|
35534
|
+
};
|
|
35535
|
+
var isReadableStream = (u) => typeof ReadableStream !== "undefined" && u instanceof ReadableStream;
|
|
35536
|
+
var toWeb = (self, options2) => contextWith2((context4) => fromResult2(toWebResult(self, {
|
|
35537
|
+
context: context4,
|
|
35538
|
+
signal: options2?.signal
|
|
35539
|
+
})));
|
|
35540
|
+
|
|
35541
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/HttpClientResponse.js
|
|
35542
|
+
var exports_HttpClientResponse = {};
|
|
35543
|
+
__export(exports_HttpClientResponse, {
|
|
35544
|
+
stream: () => stream3,
|
|
35545
|
+
schemaNoBody: () => schemaNoBody,
|
|
35546
|
+
schemaJson: () => schemaJson,
|
|
35547
|
+
schemaHeaders: () => schemaHeaders,
|
|
35548
|
+
schemaBodyUrlParams: () => schemaBodyUrlParams,
|
|
35549
|
+
schemaBodyJson: () => schemaBodyJson2,
|
|
35550
|
+
matchStatus: () => matchStatus,
|
|
35551
|
+
fromWeb: () => fromWeb2,
|
|
35552
|
+
filterStatusOk: () => filterStatusOk,
|
|
35553
|
+
filterStatus: () => filterStatus,
|
|
35554
|
+
TypeId: () => TypeId45
|
|
35555
|
+
});
|
|
35556
|
+
|
|
35557
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/HttpIncomingMessage.js
|
|
35558
|
+
var TypeId44 = "~effect/http/HttpIncomingMessage";
|
|
35559
|
+
var schemaBodyJson2 = (schema, options2) => {
|
|
35560
|
+
const decode2 = decodeEffect2(toCodecJson(schema));
|
|
35561
|
+
return (self) => flatMap5(self.json, (u) => decode2(u, options2));
|
|
35562
|
+
};
|
|
35563
|
+
var schemaBodyUrlParams = (schema, options2) => {
|
|
35564
|
+
const decode2 = schemaRecord.pipe(decodeTo2(schema), decodeEffect2);
|
|
35565
|
+
return (self) => flatMap5(self.urlParamsBody, (u) => decode2(u, options2));
|
|
35566
|
+
};
|
|
35567
|
+
var schemaHeaders = (schema, options2) => {
|
|
35568
|
+
const decode2 = decodeUnknownEffect2(schema);
|
|
35569
|
+
return (self) => decode2(self.headers, options2);
|
|
35570
|
+
};
|
|
35571
|
+
var inspect = (self, that) => {
|
|
35572
|
+
const contentType = self.headers["content-type"] ?? "";
|
|
35573
|
+
let body;
|
|
35574
|
+
if (contentType.includes("application/json")) {
|
|
35575
|
+
try {
|
|
35576
|
+
body = runSync2(self.json);
|
|
35577
|
+
} catch (_) {}
|
|
35578
|
+
} else if (contentType.includes("text/") || contentType.includes("urlencoded")) {
|
|
35579
|
+
try {
|
|
35580
|
+
body = runSync2(self.text);
|
|
35581
|
+
} catch (_) {}
|
|
35582
|
+
}
|
|
35583
|
+
const obj = {
|
|
35584
|
+
...that,
|
|
35585
|
+
headers: redact(self.headers),
|
|
35586
|
+
remoteAddress: self.remoteAddress
|
|
35587
|
+
};
|
|
35588
|
+
if (body !== undefined) {
|
|
35589
|
+
obj.body = body;
|
|
35590
|
+
}
|
|
35591
|
+
return obj;
|
|
35592
|
+
};
|
|
35593
|
+
|
|
35594
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/HttpClientResponse.js
|
|
35595
|
+
var TypeId45 = "~effect/http/HttpClientResponse";
|
|
35596
|
+
var fromWeb2 = (request3, source) => new WebHttpClientResponse(request3, source);
|
|
35597
|
+
var schemaJson = (schema, options2) => {
|
|
35598
|
+
const decode2 = decodeEffect2(toCodecJson(schema).annotate({
|
|
35599
|
+
options: options2
|
|
35600
|
+
}));
|
|
35601
|
+
return (self) => flatMap5(self.json, (body) => decode2({
|
|
35602
|
+
status: self.status,
|
|
35603
|
+
headers: self.headers,
|
|
35604
|
+
body
|
|
35605
|
+
}));
|
|
35606
|
+
};
|
|
35607
|
+
var schemaNoBody = (schema, options2) => {
|
|
35608
|
+
const decode2 = decodeEffect2(schema.annotate({
|
|
35609
|
+
options: options2
|
|
35610
|
+
}));
|
|
35611
|
+
return (self) => decode2({
|
|
35612
|
+
status: self.status,
|
|
35613
|
+
headers: self.headers
|
|
35614
|
+
});
|
|
35615
|
+
};
|
|
35616
|
+
var stream3 = (effect2) => unwrap4(map8(effect2, (self) => self.stream));
|
|
35617
|
+
var matchStatus = /* @__PURE__ */ dual(2, (self, cases) => {
|
|
35618
|
+
const status = self.status;
|
|
35619
|
+
if (cases[status]) {
|
|
35620
|
+
return cases[status](self);
|
|
35621
|
+
} else if (status >= 200 && status < 300 && cases["2xx"]) {
|
|
35622
|
+
return cases["2xx"](self);
|
|
35623
|
+
} else if (status >= 300 && status < 400 && cases["3xx"]) {
|
|
35624
|
+
return cases["3xx"](self);
|
|
35625
|
+
} else if (status >= 400 && status < 500 && cases["4xx"]) {
|
|
35626
|
+
return cases["4xx"](self);
|
|
35627
|
+
} else if (status >= 500 && status < 600 && cases["5xx"]) {
|
|
35628
|
+
return cases["5xx"](self);
|
|
35629
|
+
}
|
|
35630
|
+
return cases.orElse(self);
|
|
35631
|
+
});
|
|
35632
|
+
var filterStatus = /* @__PURE__ */ dual(2, (self, f) => suspend3(() => f(self.status) ? succeed6(self) : fail5(new HttpClientError({
|
|
35633
|
+
reason: new StatusCodeError({
|
|
35634
|
+
response: self,
|
|
35635
|
+
request: self.request,
|
|
35636
|
+
description: "invalid status code"
|
|
35637
|
+
})
|
|
35638
|
+
}))));
|
|
35639
|
+
var filterStatusOk = (self) => self.status >= 200 && self.status < 300 ? succeed6(self) : fail5(new HttpClientError({
|
|
35640
|
+
reason: new StatusCodeError({
|
|
35641
|
+
response: self,
|
|
35642
|
+
request: self.request,
|
|
35643
|
+
description: "non 2xx status code"
|
|
35644
|
+
})
|
|
35645
|
+
}));
|
|
35646
|
+
|
|
35647
|
+
class WebHttpClientResponse extends Class2 {
|
|
35648
|
+
[TypeId44];
|
|
35649
|
+
[TypeId45];
|
|
35650
|
+
request;
|
|
35651
|
+
source;
|
|
35652
|
+
constructor(request3, source) {
|
|
35653
|
+
super();
|
|
35654
|
+
this.request = request3;
|
|
35655
|
+
this.source = source;
|
|
35656
|
+
this[TypeId44] = TypeId44;
|
|
35657
|
+
this[TypeId45] = TypeId45;
|
|
35658
|
+
}
|
|
35659
|
+
toJSON() {
|
|
35660
|
+
return inspect(this, {
|
|
35661
|
+
_id: "HttpClientResponse",
|
|
35662
|
+
request: this.request.toJSON(),
|
|
35663
|
+
status: this.status
|
|
35664
|
+
});
|
|
35665
|
+
}
|
|
35666
|
+
get status() {
|
|
35667
|
+
return this.source.status;
|
|
35668
|
+
}
|
|
35669
|
+
get headers() {
|
|
35670
|
+
return fromInput2(this.source.headers);
|
|
35671
|
+
}
|
|
35672
|
+
cachedCookies;
|
|
35673
|
+
get cookies() {
|
|
35674
|
+
if (this.cachedCookies) {
|
|
35675
|
+
return this.cachedCookies;
|
|
35676
|
+
}
|
|
35677
|
+
return this.cachedCookies = fromSetCookie(this.source.headers.getSetCookie());
|
|
35678
|
+
}
|
|
35679
|
+
get remoteAddress() {
|
|
35680
|
+
return none2();
|
|
35681
|
+
}
|
|
35682
|
+
get stream() {
|
|
35683
|
+
return this.source.body ? fromReadableStream({
|
|
35684
|
+
evaluate: () => this.source.body,
|
|
35685
|
+
onError: (cause) => new HttpClientError({
|
|
35686
|
+
reason: new DecodeError({
|
|
35687
|
+
request: this.request,
|
|
35688
|
+
response: this,
|
|
35689
|
+
cause
|
|
35690
|
+
})
|
|
35691
|
+
})
|
|
35692
|
+
}) : fail9(new HttpClientError({
|
|
35693
|
+
reason: new EmptyBodyError({
|
|
35694
|
+
request: this.request,
|
|
35695
|
+
response: this,
|
|
35696
|
+
description: "can not create stream from empty body"
|
|
35697
|
+
})
|
|
35698
|
+
}));
|
|
35699
|
+
}
|
|
35700
|
+
get json() {
|
|
35701
|
+
return flatMap5(this.text, (text2) => try_3({
|
|
35702
|
+
try: () => text2 === "" ? null : JSON.parse(text2),
|
|
35703
|
+
catch: (cause) => new HttpClientError({
|
|
35704
|
+
reason: new DecodeError({
|
|
35705
|
+
request: this.request,
|
|
35706
|
+
response: this,
|
|
35707
|
+
cause
|
|
35708
|
+
})
|
|
35709
|
+
})
|
|
35710
|
+
}));
|
|
35711
|
+
}
|
|
35712
|
+
textBody;
|
|
35713
|
+
get text() {
|
|
35714
|
+
if (this.textBody) {
|
|
35715
|
+
return this.textBody;
|
|
35716
|
+
}
|
|
35717
|
+
this.textBody = tryPromise2({
|
|
35718
|
+
try: () => this.source.text(),
|
|
35719
|
+
catch: (cause) => new HttpClientError({
|
|
35720
|
+
reason: new DecodeError({
|
|
35721
|
+
request: this.request,
|
|
35722
|
+
response: this,
|
|
35723
|
+
cause
|
|
35724
|
+
})
|
|
35725
|
+
})
|
|
35726
|
+
}).pipe(cached2, runSync2);
|
|
35727
|
+
this.arrayBufferBody = map8(this.textBody, (_) => new TextEncoder().encode(_).buffer);
|
|
35728
|
+
return this.textBody;
|
|
35729
|
+
}
|
|
35730
|
+
get urlParamsBody() {
|
|
35731
|
+
return flatMap5(this.text, (_) => try_3({
|
|
35732
|
+
try: () => fromInput3(new URLSearchParams(_)),
|
|
35733
|
+
catch: (cause) => new HttpClientError({
|
|
35734
|
+
reason: new DecodeError({
|
|
35735
|
+
request: this.request,
|
|
35736
|
+
response: this,
|
|
35737
|
+
cause
|
|
35738
|
+
})
|
|
35739
|
+
})
|
|
35740
|
+
}));
|
|
35741
|
+
}
|
|
35742
|
+
formDataBody;
|
|
35743
|
+
get formData() {
|
|
35744
|
+
return this.formDataBody ??= tryPromise2({
|
|
35745
|
+
try: () => this.source.formData(),
|
|
35746
|
+
catch: (cause) => new HttpClientError({
|
|
35747
|
+
reason: new DecodeError({
|
|
35748
|
+
request: this.request,
|
|
35749
|
+
response: this,
|
|
35750
|
+
cause
|
|
35751
|
+
})
|
|
35752
|
+
})
|
|
35753
|
+
}).pipe(cached2, runSync2);
|
|
35754
|
+
}
|
|
35755
|
+
arrayBufferBody;
|
|
35756
|
+
get arrayBuffer() {
|
|
35757
|
+
if (this.arrayBufferBody) {
|
|
35758
|
+
return this.arrayBufferBody;
|
|
35759
|
+
}
|
|
35760
|
+
this.arrayBufferBody = tryPromise2({
|
|
35761
|
+
try: () => this.source.arrayBuffer(),
|
|
35762
|
+
catch: (cause) => new HttpClientError({
|
|
35763
|
+
reason: new DecodeError({
|
|
35764
|
+
request: this.request,
|
|
35765
|
+
response: this,
|
|
35766
|
+
cause
|
|
35767
|
+
})
|
|
35768
|
+
})
|
|
35769
|
+
}).pipe(cached2, runSync2);
|
|
35770
|
+
this.textBody = map8(this.arrayBufferBody, (_) => new TextDecoder().decode(_));
|
|
35771
|
+
return this.arrayBufferBody;
|
|
35772
|
+
}
|
|
35773
|
+
pipe() {
|
|
35774
|
+
return pipeArguments(this, arguments);
|
|
35775
|
+
}
|
|
35776
|
+
}
|
|
35777
|
+
|
|
35778
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/HttpTraceContext.js
|
|
35779
|
+
var toHeaders = (span2) => fromRecordUnsafe({
|
|
35780
|
+
b3: `${span2.traceId}-${span2.spanId}-${span2.sampled ? "1" : "0"}${match(span2.parent, {
|
|
35781
|
+
onNone: () => "",
|
|
35782
|
+
onSome: (parent) => `-${parent.spanId}`
|
|
35783
|
+
})}`,
|
|
35784
|
+
traceparent: `00-${span2.traceId}-${span2.spanId}-${span2.sampled ? "01" : "00"}`
|
|
35785
|
+
});
|
|
35786
|
+
|
|
35787
|
+
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/http/HttpClient.js
|
|
35788
|
+
var TypeId46 = "~effect/http/HttpClient";
|
|
35789
|
+
var isHttpClient = (u) => hasProperty(u, TypeId46);
|
|
35790
|
+
var HttpClient = /* @__PURE__ */ Service("effect/HttpClient");
|
|
35791
|
+
var accessor = (method) => (...args2) => flatMap5(HttpClient, (client) => client[method](...args2));
|
|
35792
|
+
var execute = /* @__PURE__ */ accessor("execute");
|
|
35793
|
+
var get12 = /* @__PURE__ */ accessor("get");
|
|
35794
|
+
var head2 = /* @__PURE__ */ accessor("head");
|
|
35795
|
+
var post2 = /* @__PURE__ */ accessor("post");
|
|
35796
|
+
var patch2 = /* @__PURE__ */ accessor("patch");
|
|
35797
|
+
var put2 = /* @__PURE__ */ accessor("put");
|
|
35798
|
+
var del2 = /* @__PURE__ */ accessor("del");
|
|
35799
|
+
var options2 = /* @__PURE__ */ accessor("options");
|
|
35800
|
+
var transform4 = /* @__PURE__ */ dual(2, (self, f) => makeWith2(flatMap5((request3) => f(self.postprocess(succeed6(request3)), request3)), self.preprocess));
|
|
35801
|
+
var transformResponse = /* @__PURE__ */ dual(2, (self, f) => makeWith2((request3) => f(self.postprocess(request3)), self.preprocess));
|
|
35802
|
+
var catch_6 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, catch_3(f)));
|
|
35803
|
+
var catchTag5 = /* @__PURE__ */ dual(3, (self, tag2, f) => transformResponse(self, (effect2) => catchTag3(effect2, tag2, f)));
|
|
35804
|
+
var catchTags4 = /* @__PURE__ */ dual(2, (self, cases) => transformResponse(self, catchTags2(cases)));
|
|
35805
|
+
var filterOrElse3 = /* @__PURE__ */ dual(3, (self, f, orElse2) => transformResponse(self, filterOrElse2(f, orElse2)));
|
|
35806
|
+
var filterOrFail3 = /* @__PURE__ */ dual(3, (self, f, orFailWith) => transformResponse(self, filterOrFail2(f, orFailWith)));
|
|
35807
|
+
var filterStatus2 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, flatMap5(filterStatus(f))));
|
|
35808
|
+
var filterStatusOk2 = /* @__PURE__ */ transformResponse(/* @__PURE__ */ flatMap5(filterStatusOk));
|
|
35809
|
+
var makeWith2 = (postprocess, preprocess) => {
|
|
35810
|
+
const self = Object.create(Proto10);
|
|
35811
|
+
self.preprocess = preprocess;
|
|
35812
|
+
self.postprocess = postprocess;
|
|
35813
|
+
self.execute = function(request3) {
|
|
35814
|
+
return postprocess(preprocess(request3));
|
|
35815
|
+
};
|
|
35816
|
+
return self;
|
|
35817
|
+
};
|
|
35818
|
+
var Proto10 = {
|
|
35819
|
+
[TypeId46]: TypeId46,
|
|
35820
|
+
pipe() {
|
|
35821
|
+
return pipeArguments(this, arguments);
|
|
35822
|
+
},
|
|
35823
|
+
...BaseProto,
|
|
35824
|
+
toJSON() {
|
|
35825
|
+
return {
|
|
35826
|
+
_id: "effect/HttpClient"
|
|
35827
|
+
};
|
|
35828
|
+
},
|
|
35829
|
+
.../* @__PURE__ */ Object.fromEntries(/* @__PURE__ */ allShort.map(([fullMethod, method]) => [method, function(url, options3) {
|
|
35830
|
+
return this.execute(make37(fullMethod)(url, options3));
|
|
35831
|
+
}]))
|
|
35832
|
+
};
|
|
35833
|
+
var make38 = (f) => makeWith2((effect2) => flatMap5(effect2, (request3) => withFiber2((fiber3) => {
|
|
35834
|
+
const scopedController = scopedRequests.get(request3);
|
|
35835
|
+
const controller = scopedController ?? new AbortController;
|
|
35836
|
+
const urlResult = make36(request3.url, request3.urlParams, getOrUndefined(request3.hash));
|
|
35837
|
+
if (isFailure2(urlResult)) {
|
|
35838
|
+
return fail5(new HttpClientError({
|
|
35839
|
+
reason: new InvalidUrlError({
|
|
35840
|
+
request: request3,
|
|
35841
|
+
cause: urlResult.failure
|
|
35842
|
+
})
|
|
35843
|
+
}));
|
|
35844
|
+
}
|
|
35845
|
+
const url = urlResult.success;
|
|
35846
|
+
const tracerDisabled = fiber3.getRef(DisablePropagation) || fiber3.getRef(TracerDisabledWhen)(request3);
|
|
35847
|
+
if (tracerDisabled) {
|
|
35848
|
+
const effect3 = f(request3, url, controller.signal, fiber3);
|
|
35849
|
+
if (scopedController)
|
|
35850
|
+
return effect3;
|
|
35851
|
+
return uninterruptibleMask2((restore) => matchCauseEffect2(restore(effect3), {
|
|
35852
|
+
onSuccess(response) {
|
|
35853
|
+
responseRegistry.register(response, controller);
|
|
35854
|
+
return succeed6(new InterruptibleResponse(response, controller));
|
|
35855
|
+
},
|
|
35856
|
+
onFailure(cause) {
|
|
35857
|
+
if (hasInterrupts2(cause)) {
|
|
35858
|
+
controller.abort();
|
|
35859
|
+
}
|
|
35860
|
+
return failCause4(cause);
|
|
35861
|
+
}
|
|
35862
|
+
}));
|
|
35863
|
+
}
|
|
35864
|
+
return useSpan2(fiber3.getRef(SpanNameGenerator)(request3), {
|
|
35865
|
+
kind: "client"
|
|
35866
|
+
}, (span2) => {
|
|
35867
|
+
span2.attribute("http.request.method", request3.method);
|
|
35868
|
+
span2.attribute("server.address", url.origin);
|
|
35869
|
+
if (url.port !== "") {
|
|
35870
|
+
span2.attribute("server.port", +url.port);
|
|
35871
|
+
}
|
|
35872
|
+
span2.attribute("url.full", url.toString());
|
|
35873
|
+
span2.attribute("url.path", url.pathname);
|
|
35874
|
+
span2.attribute("url.scheme", url.protocol.slice(0, -1));
|
|
35875
|
+
const query = url.search.slice(1);
|
|
35876
|
+
if (query !== "") {
|
|
35877
|
+
span2.attribute("url.query", query);
|
|
35878
|
+
}
|
|
35879
|
+
const redactedHeaderNames = fiber3.getRef(CurrentRedactedNames);
|
|
35880
|
+
const redactedHeaders = redact4(request3.headers, redactedHeaderNames);
|
|
35881
|
+
for (const name in redactedHeaders) {
|
|
35882
|
+
span2.attribute(`http.request.header.${name}`, String(redactedHeaders[name]));
|
|
35883
|
+
}
|
|
35884
|
+
request3 = fiber3.getRef(TracerPropagationEnabled) ? setHeaders(request3, toHeaders(span2)) : request3;
|
|
35885
|
+
return uninterruptibleMask2((restore) => restore(f(request3, url, controller.signal, fiber3)).pipe(withParentSpan3(span2, {
|
|
35886
|
+
captureStackTrace: false
|
|
35887
|
+
}), matchCauseEffect2({
|
|
35888
|
+
onSuccess: (response) => {
|
|
35889
|
+
span2.attribute("http.response.status_code", response.status);
|
|
35890
|
+
const redactedHeaders2 = redact4(response.headers, redactedHeaderNames);
|
|
35891
|
+
for (const name in redactedHeaders2) {
|
|
35892
|
+
span2.attribute(`http.response.header.${name}`, String(redactedHeaders2[name]));
|
|
35893
|
+
}
|
|
35894
|
+
if (scopedController)
|
|
35895
|
+
return succeed6(response);
|
|
35896
|
+
responseRegistry.register(response, controller);
|
|
35897
|
+
return succeed6(new InterruptibleResponse(response, controller));
|
|
35898
|
+
},
|
|
35899
|
+
onFailure(cause) {
|
|
35900
|
+
if (!scopedController && hasInterrupts2(cause)) {
|
|
35901
|
+
controller.abort();
|
|
35902
|
+
}
|
|
35903
|
+
return failCause4(cause);
|
|
35904
|
+
}
|
|
35905
|
+
})));
|
|
35906
|
+
});
|
|
35907
|
+
})), succeed6);
|
|
35908
|
+
var mapRequest = /* @__PURE__ */ dual(2, (self, f) => makeWith2(self.postprocess, (request3) => map8(self.preprocess(request3), f)));
|
|
35909
|
+
var mapRequestEffect = /* @__PURE__ */ dual(2, (self, f) => makeWith2(self.postprocess, (request3) => flatMap5(self.preprocess(request3), f)));
|
|
35910
|
+
var mapRequestInput = /* @__PURE__ */ dual(2, (self, f) => makeWith2(self.postprocess, (request3) => self.preprocess(f(request3))));
|
|
35911
|
+
var mapRequestInputEffect = /* @__PURE__ */ dual(2, (self, f) => makeWith2(self.postprocess, (request3) => flatMap5(f(request3), self.preprocess)));
|
|
35912
|
+
var retry5 = /* @__PURE__ */ dual(2, (self, policy) => transformResponse(self, retry2(policy)));
|
|
35913
|
+
var retryTransient = /* @__PURE__ */ dual(2, (self, options3) => {
|
|
35914
|
+
const isOnlySchedule = isSchedule(options3);
|
|
35915
|
+
const retryOn = isOnlySchedule ? "errors-and-responses" : options3.retryOn ?? "errors-and-responses";
|
|
35916
|
+
const schedule4 = isOnlySchedule ? options3 : options3.schedule;
|
|
35917
|
+
const passthroughSchedule = schedule4 && passthrough(schedule4);
|
|
35918
|
+
const times = isOnlySchedule ? undefined : options3.times;
|
|
35919
|
+
return transformResponse(self, flow(retryOn === "errors-only" ? identity : repeat3({
|
|
35920
|
+
schedule: passthroughSchedule,
|
|
35921
|
+
times,
|
|
35922
|
+
while: isTransientResponse
|
|
35923
|
+
}), retryOn === "response-only" ? identity : retry2({
|
|
35924
|
+
while: isOnlySchedule || options3.while === undefined ? isTransientError : or(isTransientError, options3.while),
|
|
35925
|
+
schedule: schedule4,
|
|
35926
|
+
times
|
|
35927
|
+
})));
|
|
34372
35928
|
});
|
|
34373
|
-
|
|
34374
|
-
|
|
34375
|
-
|
|
34376
|
-
|
|
35929
|
+
var withRateLimiter = /* @__PURE__ */ dual(2, (self, options3) => {
|
|
35930
|
+
const initialState = {
|
|
35931
|
+
initial: true,
|
|
35932
|
+
limit: options3.limit,
|
|
35933
|
+
window: max2(fromInputUnsafe(options3.window), millis(1))
|
|
35934
|
+
};
|
|
35935
|
+
const states = new Map;
|
|
35936
|
+
const keyOption = options3.key;
|
|
35937
|
+
const resolveKey = typeof keyOption === "function" ? keyOption : constant(keyOption);
|
|
35938
|
+
const tokensOption = options3.tokens;
|
|
35939
|
+
const resolveTokens = typeof tokensOption === "function" ? tokensOption : constant(tokensOption ?? 1);
|
|
35940
|
+
const adaptiveLearningEnabled = !options3.disableAdaptiveLearning;
|
|
35941
|
+
const getState2 = (key) => {
|
|
35942
|
+
const current = states.get(key);
|
|
35943
|
+
if (current !== undefined) {
|
|
35944
|
+
return current;
|
|
35945
|
+
}
|
|
35946
|
+
states.set(key, initialState);
|
|
35947
|
+
return initialState;
|
|
35948
|
+
};
|
|
35949
|
+
const onResponse = options3.disableResponseInspection ? undefined : (clock, key, headers, tokens) => {
|
|
35950
|
+
const current = getState2(key);
|
|
35951
|
+
const next2 = parseRateLimiterState(current, clock, headers, tokens);
|
|
35952
|
+
if (next2.limit !== current.limit || !equals2(next2.window, current.window)) {
|
|
35953
|
+
states.set(key, next2);
|
|
35954
|
+
}
|
|
35955
|
+
};
|
|
35956
|
+
return transform4(self, function loop(effect2, request3) {
|
|
35957
|
+
const fiber3 = getCurrent();
|
|
35958
|
+
const clock = fiber3.getRef(Clock);
|
|
35959
|
+
const key = resolveKey(request3);
|
|
35960
|
+
const tokens = Math.max(resolveTokens(request3), 1);
|
|
35961
|
+
const current = getState2(key);
|
|
35962
|
+
function retry6(retryAfter) {
|
|
35963
|
+
if (options3.disableResponseInspection)
|
|
35964
|
+
return loop(effect2, request3);
|
|
35965
|
+
return retryAfter ? flatMap5(sleep2(retryAfter), () => loop(effect2, request3)) : loop(effect2, request3);
|
|
35966
|
+
}
|
|
35967
|
+
const inspectResponse = (response, adaptive) => {
|
|
35968
|
+
onResponse?.(clock, key, response.headers, tokens);
|
|
35969
|
+
if (options3.disableResponseInspection || response.status !== 429) {
|
|
35970
|
+
return succeed6(undefined);
|
|
35971
|
+
}
|
|
35972
|
+
const retryAfter = parseRetryAfter(clock, getHeader(response.headers, "retry-after"));
|
|
35973
|
+
if (retryAfter === undefined) {
|
|
35974
|
+
return succeed6(undefined);
|
|
35975
|
+
}
|
|
35976
|
+
const delay3 = parseRateLimitWindow(clock, response.headers) ?? retryAfter;
|
|
35977
|
+
if (adaptive === undefined) {
|
|
35978
|
+
return succeed6(delay3);
|
|
35979
|
+
}
|
|
35980
|
+
return as3(options3.limiter.adaptiveFeedback({
|
|
35981
|
+
key,
|
|
35982
|
+
epoch: adaptive.epoch,
|
|
35983
|
+
tokens,
|
|
35984
|
+
status: response.status,
|
|
35985
|
+
retryAfter: delay3
|
|
35986
|
+
}), delay3);
|
|
35987
|
+
};
|
|
35988
|
+
return flatMap5(options3.limiter.consume({
|
|
35989
|
+
algorithm: options3.algorithm,
|
|
35990
|
+
onExceeded: "delay",
|
|
35991
|
+
key,
|
|
35992
|
+
limit: current.limit,
|
|
35993
|
+
window: current.window,
|
|
35994
|
+
tokens
|
|
35995
|
+
}), ({
|
|
35996
|
+
delay: delay3
|
|
35997
|
+
}) => {
|
|
35998
|
+
const runAdaptive = () => {
|
|
35999
|
+
const runRequest = (adaptive) => {
|
|
36000
|
+
const request4 = matchEffect3(effect2, {
|
|
36001
|
+
onSuccess(response) {
|
|
36002
|
+
return flatMap5(inspectResponse(response, adaptive), (retryAfter) => {
|
|
36003
|
+
if (response.status !== 429)
|
|
36004
|
+
return succeed6(response);
|
|
36005
|
+
return retry6(retryAfter);
|
|
36006
|
+
});
|
|
36007
|
+
},
|
|
36008
|
+
onFailure(error) {
|
|
36009
|
+
if (isTooManyRequestsHttpClientError(error)) {
|
|
36010
|
+
return flatMap5(inspectResponse(error.reason.response, adaptive), (retryAfter) => retry6(retryAfter));
|
|
36011
|
+
}
|
|
36012
|
+
return fail5(error);
|
|
36013
|
+
}
|
|
36014
|
+
});
|
|
36015
|
+
return adaptive === undefined || isZero(adaptive.delay) ? request4 : delay2(request4, adaptive.delay);
|
|
36016
|
+
};
|
|
36017
|
+
if (!adaptiveLearningEnabled) {
|
|
36018
|
+
return runRequest(undefined);
|
|
36019
|
+
}
|
|
36020
|
+
return flatMap5(options3.limiter.adaptiveConsume({
|
|
36021
|
+
key,
|
|
36022
|
+
tokens,
|
|
36023
|
+
fallbackLimit: current.limit,
|
|
36024
|
+
fallbackWindow: current.window
|
|
36025
|
+
}), (adaptive) => {
|
|
36026
|
+
if (!isZero(adaptive.delay) && adaptive.phase === "cooldown") {
|
|
36027
|
+
return flatMap5(sleep2(adaptive.delay), runAdaptive);
|
|
36028
|
+
}
|
|
36029
|
+
return runRequest(adaptive);
|
|
36030
|
+
});
|
|
36031
|
+
};
|
|
36032
|
+
return isZero(delay3) ? runAdaptive() : flatMap5(sleep2(delay3), runAdaptive);
|
|
36033
|
+
});
|
|
36034
|
+
});
|
|
34377
36035
|
});
|
|
36036
|
+
var parseRateLimiterState = (state, clock, headers, tokens) => {
|
|
36037
|
+
const limit = parseRateLimitLimit(state, headers, tokens) ?? state.limit;
|
|
36038
|
+
const window = parseRateLimitWindow(clock, headers) ?? state.window;
|
|
36039
|
+
if (limit === state.limit && equals2(window, state.window)) {
|
|
36040
|
+
return state;
|
|
36041
|
+
}
|
|
36042
|
+
return {
|
|
36043
|
+
limit,
|
|
36044
|
+
window,
|
|
36045
|
+
initial: false
|
|
36046
|
+
};
|
|
36047
|
+
};
|
|
36048
|
+
var parseRateLimitLimit = (state, headers, tokens) => {
|
|
36049
|
+
const raw2 = getHeader(headers, "ratelimit-limit", "x-ratelimit-limit");
|
|
36050
|
+
const value3 = parseNumberHeader(raw2);
|
|
36051
|
+
if (value3 !== undefined && value3 > 0) {
|
|
36052
|
+
return value3;
|
|
36053
|
+
}
|
|
36054
|
+
const remaining = parseRateLimitRemaining(headers);
|
|
36055
|
+
if (remaining === undefined) {
|
|
36056
|
+
return;
|
|
36057
|
+
}
|
|
36058
|
+
return state.initial ? remaining + tokens : Math.max(remaining + tokens, state.limit);
|
|
36059
|
+
};
|
|
36060
|
+
var parseRateLimitRemaining = (headers) => {
|
|
36061
|
+
const raw2 = getHeader(headers, "ratelimit-remaining", "x-ratelimit-remaining");
|
|
36062
|
+
const value3 = parseNumberHeader(raw2);
|
|
36063
|
+
return value3 !== undefined && value3 >= 0 ? value3 : undefined;
|
|
36064
|
+
};
|
|
36065
|
+
var parseRateLimitWindow = (clock, headers) => {
|
|
36066
|
+
const resetAfter = parseResetAfter(getHeader(headers, "ratelimit-reset-after", "x-ratelimit-reset-after"));
|
|
36067
|
+
if (resetAfter !== undefined) {
|
|
36068
|
+
return resetAfter;
|
|
36069
|
+
}
|
|
36070
|
+
return parseResetHeader(clock, getHeader(headers, "ratelimit-reset", "x-ratelimit-reset"));
|
|
36071
|
+
};
|
|
36072
|
+
var parseRetryAfter = (clock, value3) => {
|
|
36073
|
+
if (value3 === undefined) {
|
|
36074
|
+
return;
|
|
36075
|
+
}
|
|
36076
|
+
const numeric = parseNumberHeader(value3);
|
|
36077
|
+
if (numeric !== undefined) {
|
|
36078
|
+
return max2(seconds(numeric), millis(1));
|
|
36079
|
+
}
|
|
36080
|
+
const parsedDate = Date.parse(value3);
|
|
36081
|
+
if (Number.isNaN(parsedDate)) {
|
|
36082
|
+
return;
|
|
36083
|
+
}
|
|
36084
|
+
const millis2 = parsedDate - clock.currentTimeMillisUnsafe();
|
|
36085
|
+
if (millis2 <= 0) {
|
|
36086
|
+
return millis(1);
|
|
36087
|
+
}
|
|
36088
|
+
return millis(millis2);
|
|
36089
|
+
};
|
|
36090
|
+
var parseResetAfter = (value3) => {
|
|
36091
|
+
const numeric = parseNumberHeader(value3);
|
|
36092
|
+
if (numeric === undefined || numeric <= 0) {
|
|
36093
|
+
return;
|
|
36094
|
+
}
|
|
36095
|
+
return max2(seconds(numeric), millis(1));
|
|
36096
|
+
};
|
|
36097
|
+
var parseResetHeader = (clock, value3) => {
|
|
36098
|
+
const numeric = parseNumberHeader(value3);
|
|
36099
|
+
if (numeric === undefined || numeric <= 0) {
|
|
36100
|
+
return;
|
|
36101
|
+
}
|
|
36102
|
+
const nowMillis = clock.currentTimeMillisUnsafe();
|
|
36103
|
+
if (numeric > 1000000000000) {
|
|
36104
|
+
return millis(Math.max(numeric - nowMillis, 1));
|
|
36105
|
+
}
|
|
36106
|
+
if (numeric > 1e9) {
|
|
36107
|
+
return millis(Math.max(numeric * 1000 - nowMillis, 1));
|
|
36108
|
+
}
|
|
36109
|
+
return max2(seconds(numeric), millis(1));
|
|
36110
|
+
};
|
|
36111
|
+
var parseNumberHeader = (value3) => {
|
|
36112
|
+
if (value3 === undefined) {
|
|
36113
|
+
return;
|
|
36114
|
+
}
|
|
36115
|
+
const match7 = /-?\d+(?:\.\d+)?/.exec(value3);
|
|
36116
|
+
if (match7 === null) {
|
|
36117
|
+
return;
|
|
36118
|
+
}
|
|
36119
|
+
const parsed = Number(match7[0]);
|
|
36120
|
+
return Number.isFinite(parsed) ? parsed : undefined;
|
|
36121
|
+
};
|
|
36122
|
+
var getHeader = (headers, ...keys5) => {
|
|
36123
|
+
for (let i = 0;i < keys5.length; i++) {
|
|
36124
|
+
const value3 = headers[keys5[i]];
|
|
36125
|
+
if (value3 !== undefined) {
|
|
36126
|
+
return value3;
|
|
36127
|
+
}
|
|
36128
|
+
}
|
|
36129
|
+
return;
|
|
36130
|
+
};
|
|
36131
|
+
var tap7 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, tap5(f)));
|
|
36132
|
+
var tapError6 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, tapError3(f)));
|
|
36133
|
+
var tapRequest = /* @__PURE__ */ dual(2, (self, f) => makeWith2(self.postprocess, (request3) => tap5(self.preprocess(request3), f)));
|
|
36134
|
+
var withCookiesRef = /* @__PURE__ */ dual(2, (self, ref) => makeWith2((request3) => tap5(self.postprocess(request3), (response) => update2(ref, (cookies) => merge6(cookies, response.cookies))), (request3) => flatMap5(self.preprocess(request3), (request4) => map8(get9(ref), (cookies) => isEmpty4(cookies) ? request4 : setHeader(request4, "cookie", toCookieHeader(cookies))))));
|
|
36135
|
+
var withScope = (self) => transform4(self, (effect2, request3) => {
|
|
36136
|
+
const controller = new AbortController;
|
|
36137
|
+
scopedRequests.set(request3, controller);
|
|
36138
|
+
return andThen4(addFinalizer3(() => sync3(() => controller.abort())), effect2);
|
|
36139
|
+
});
|
|
36140
|
+
var followRedirects = /* @__PURE__ */ dual((args2) => isHttpClient(args2[0]), (self, maxRedirects) => makeWith2((request3) => {
|
|
36141
|
+
const loop = (request4, redirects) => flatMap5(self.postprocess(succeed6(request4)), (response) => response.status >= 300 && response.status < 400 && response.headers.location && redirects < (maxRedirects ?? 10) ? loop(setUrl(request4, new URL(response.headers.location, response.request.url)), redirects + 1) : succeed6(response));
|
|
36142
|
+
return flatMap5(request3, (request4) => loop(request4, 0));
|
|
36143
|
+
}, self.preprocess));
|
|
36144
|
+
var TracerDisabledWhen = /* @__PURE__ */ Reference("effect/http/HttpClient/TracerDisabledWhen", {
|
|
36145
|
+
defaultValue: () => constFalse
|
|
36146
|
+
});
|
|
36147
|
+
var TracerPropagationEnabled = /* @__PURE__ */ Reference("effect/HttpClient/TracerPropagationEnabled", {
|
|
36148
|
+
defaultValue: constTrue
|
|
36149
|
+
});
|
|
36150
|
+
var SpanNameGenerator = /* @__PURE__ */ Reference("effect/http/HttpClient/SpanNameGenerator", {
|
|
36151
|
+
defaultValue: () => (request3) => `http.client ${request3.method}`
|
|
36152
|
+
});
|
|
36153
|
+
var layerMergedContext = (effect2) => effect(HttpClient)(contextWith2((context4) => map8(effect2, (client) => transformResponse(client, updateContext2((input) => merge(context4, input))))));
|
|
36154
|
+
var responseRegistry = /* @__PURE__ */ (() => {
|
|
36155
|
+
if ("FinalizationRegistry" in globalThis && globalThis.FinalizationRegistry) {
|
|
36156
|
+
const registry = /* @__PURE__ */ new FinalizationRegistry((controller) => {
|
|
36157
|
+
controller.abort();
|
|
36158
|
+
});
|
|
36159
|
+
return {
|
|
36160
|
+
register(response, controller) {
|
|
36161
|
+
registry.register(response, controller, response);
|
|
36162
|
+
},
|
|
36163
|
+
unregister(response) {
|
|
36164
|
+
registry.unregister(response);
|
|
36165
|
+
}
|
|
36166
|
+
};
|
|
36167
|
+
}
|
|
36168
|
+
const timers = /* @__PURE__ */ new Map;
|
|
36169
|
+
return {
|
|
36170
|
+
register(response, controller) {
|
|
36171
|
+
timers.set(response, setTimeout(() => controller.abort(), 5000));
|
|
36172
|
+
},
|
|
36173
|
+
unregister(response) {
|
|
36174
|
+
const timer = timers.get(response);
|
|
36175
|
+
if (timer === undefined)
|
|
36176
|
+
return;
|
|
36177
|
+
clearTimeout(timer);
|
|
36178
|
+
timers.delete(response);
|
|
36179
|
+
}
|
|
36180
|
+
};
|
|
36181
|
+
})();
|
|
36182
|
+
var scopedRequests = /* @__PURE__ */ new WeakMap;
|
|
36183
|
+
|
|
36184
|
+
class InterruptibleResponse {
|
|
36185
|
+
original;
|
|
36186
|
+
controller;
|
|
36187
|
+
constructor(original, controller) {
|
|
36188
|
+
this.original = original;
|
|
36189
|
+
this.controller = controller;
|
|
36190
|
+
}
|
|
36191
|
+
[TypeId45] = TypeId45;
|
|
36192
|
+
[TypeId44] = TypeId44;
|
|
36193
|
+
applyInterrupt(effect2) {
|
|
36194
|
+
return suspend3(() => {
|
|
36195
|
+
responseRegistry.unregister(this.original);
|
|
36196
|
+
return onInterrupt2(effect2, () => sync3(() => {
|
|
36197
|
+
this.controller.abort();
|
|
36198
|
+
}));
|
|
36199
|
+
});
|
|
36200
|
+
}
|
|
36201
|
+
get request() {
|
|
36202
|
+
return this.original.request;
|
|
36203
|
+
}
|
|
36204
|
+
get status() {
|
|
36205
|
+
return this.original.status;
|
|
36206
|
+
}
|
|
36207
|
+
get headers() {
|
|
36208
|
+
return this.original.headers;
|
|
36209
|
+
}
|
|
36210
|
+
get cookies() {
|
|
36211
|
+
return this.original.cookies;
|
|
36212
|
+
}
|
|
36213
|
+
get remoteAddress() {
|
|
36214
|
+
return this.original.remoteAddress;
|
|
36215
|
+
}
|
|
36216
|
+
get formData() {
|
|
36217
|
+
return this.applyInterrupt(this.original.formData);
|
|
36218
|
+
}
|
|
36219
|
+
get text() {
|
|
36220
|
+
return this.applyInterrupt(this.original.text);
|
|
36221
|
+
}
|
|
36222
|
+
get json() {
|
|
36223
|
+
return this.applyInterrupt(this.original.json);
|
|
36224
|
+
}
|
|
36225
|
+
get urlParamsBody() {
|
|
36226
|
+
return this.applyInterrupt(this.original.urlParamsBody);
|
|
36227
|
+
}
|
|
36228
|
+
get arrayBuffer() {
|
|
36229
|
+
return this.applyInterrupt(this.original.arrayBuffer);
|
|
36230
|
+
}
|
|
36231
|
+
get stream() {
|
|
36232
|
+
return suspend5(() => {
|
|
36233
|
+
responseRegistry.unregister(this.original);
|
|
36234
|
+
return ensuring4(this.original.stream, sync3(() => {
|
|
36235
|
+
this.controller.abort();
|
|
36236
|
+
}));
|
|
36237
|
+
});
|
|
36238
|
+
}
|
|
36239
|
+
toJSON() {
|
|
36240
|
+
return this.original.toJSON();
|
|
36241
|
+
}
|
|
36242
|
+
[NodeInspectSymbol]() {
|
|
36243
|
+
return this.original[NodeInspectSymbol]();
|
|
36244
|
+
}
|
|
36245
|
+
pipe() {
|
|
36246
|
+
return pipeArguments(this, arguments);
|
|
36247
|
+
}
|
|
36248
|
+
}
|
|
36249
|
+
var isTransientError = (error) => isTimeoutError2(error) || isTransientHttpError(error);
|
|
36250
|
+
var isTransientHttpError = (error) => isHttpClientError(error) && (error.reason._tag === "TransportError" || error.reason._tag === "StatusCodeError" && isTransientResponse(error.reason.response));
|
|
36251
|
+
var isTooManyRequestsHttpClientError = (error) => isHttpClientError(error) && error.reason._tag === "StatusCodeError" && error.reason.response.status === 429;
|
|
36252
|
+
var isTransientResponse = (response) => response.status === 408 || response.status === 429 || response.status === 500 || response.status === 502 || response.status === 503 || response.status === 504;
|
|
34378
36253
|
// ../../node_modules/.bun/effect@4.0.0-beta.93/node_modules/effect/dist/unstable/ai/Tool.js
|
|
34379
36254
|
var exports_Tool = {};
|
|
34380
36255
|
__export(exports_Tool, {
|
|
34381
36256
|
unsafeSecureJsonParse: () => unsafeSecureJsonParse,
|
|
34382
36257
|
providerDefined: () => providerDefined,
|
|
34383
|
-
make: () =>
|
|
36258
|
+
make: () => make39,
|
|
34384
36259
|
isUserDefined: () => isUserDefined,
|
|
34385
36260
|
isProviderDefined: () => isProviderDefined,
|
|
34386
36261
|
isEmptyParamsRecord: () => isEmptyParamsRecord,
|
|
@@ -34390,7 +36265,7 @@ __export(exports_Tool, {
|
|
|
34390
36265
|
getJsonSchema: () => getJsonSchema,
|
|
34391
36266
|
getDescription: () => getDescription,
|
|
34392
36267
|
dynamic: () => dynamic,
|
|
34393
|
-
TypeId: () =>
|
|
36268
|
+
TypeId: () => TypeId47,
|
|
34394
36269
|
Title: () => Title,
|
|
34395
36270
|
Strict: () => Strict,
|
|
34396
36271
|
Readonly: () => Readonly,
|
|
@@ -34403,14 +36278,14 @@ __export(exports_Tool, {
|
|
|
34403
36278
|
DynamicTypeId: () => DynamicTypeId,
|
|
34404
36279
|
Destructive: () => Destructive
|
|
34405
36280
|
});
|
|
34406
|
-
var
|
|
36281
|
+
var TypeId47 = "~effect/ai/Tool";
|
|
34407
36282
|
var ProviderDefinedTypeId = "~effect/ai/Tool/ProviderDefined";
|
|
34408
36283
|
var DynamicTypeId = "~effect/ai/Tool/Dynamic";
|
|
34409
|
-
var isUserDefined = (u) => hasProperty(u,
|
|
36284
|
+
var isUserDefined = (u) => hasProperty(u, TypeId47) && !isProviderDefined(u) && !isDynamic(u);
|
|
34410
36285
|
var isProviderDefined = (u) => hasProperty(u, ProviderDefinedTypeId);
|
|
34411
36286
|
var isDynamic = (u) => hasProperty(u, DynamicTypeId);
|
|
34412
|
-
var
|
|
34413
|
-
[
|
|
36287
|
+
var Proto11 = {
|
|
36288
|
+
[TypeId47]: {
|
|
34414
36289
|
_Requirements: identity
|
|
34415
36290
|
},
|
|
34416
36291
|
pipe() {
|
|
@@ -34453,71 +36328,71 @@ var Proto5 = {
|
|
|
34453
36328
|
}
|
|
34454
36329
|
};
|
|
34455
36330
|
var ProviderDefinedProto = {
|
|
34456
|
-
...
|
|
36331
|
+
...Proto11,
|
|
34457
36332
|
[ProviderDefinedTypeId]: ProviderDefinedTypeId
|
|
34458
36333
|
};
|
|
34459
36334
|
var DynamicProto = {
|
|
34460
|
-
...
|
|
36335
|
+
...Proto11,
|
|
34461
36336
|
[DynamicTypeId]: DynamicTypeId
|
|
34462
36337
|
};
|
|
34463
|
-
var userDefinedProto = (
|
|
34464
|
-
const self = Object.assign(Object.create(
|
|
34465
|
-
self.id = `effect/ai/Tool/${
|
|
36338
|
+
var userDefinedProto = (options3) => {
|
|
36339
|
+
const self = Object.assign(Object.create(Proto11), options3);
|
|
36340
|
+
self.id = `effect/ai/Tool/${options3.name}`;
|
|
34466
36341
|
return self;
|
|
34467
36342
|
};
|
|
34468
|
-
var providerDefinedProto = (
|
|
34469
|
-
...
|
|
36343
|
+
var providerDefinedProto = (options3) => Object.assign(Object.create(ProviderDefinedProto), {
|
|
36344
|
+
...options3
|
|
34470
36345
|
});
|
|
34471
|
-
var dynamicProto = (
|
|
34472
|
-
const self = Object.assign(Object.create(DynamicProto),
|
|
34473
|
-
self.id = `effect/ai/Tool/${
|
|
36346
|
+
var dynamicProto = (options3) => {
|
|
36347
|
+
const self = Object.assign(Object.create(DynamicProto), options3);
|
|
36348
|
+
self.id = `effect/ai/Tool/${options3.name}`;
|
|
34474
36349
|
return self;
|
|
34475
36350
|
};
|
|
34476
|
-
var
|
|
34477
|
-
const successSchema =
|
|
34478
|
-
const failureSchema =
|
|
36351
|
+
var make39 = (name, options3) => {
|
|
36352
|
+
const successSchema = options3?.success ?? Void2;
|
|
36353
|
+
const failureSchema = options3?.failure ?? Never2;
|
|
34479
36354
|
return userDefinedProto({
|
|
34480
36355
|
name,
|
|
34481
|
-
description:
|
|
34482
|
-
parametersSchema:
|
|
36356
|
+
description: options3?.description,
|
|
36357
|
+
parametersSchema: options3?.parameters ?? EmptyParams,
|
|
34483
36358
|
successSchema,
|
|
34484
36359
|
failureSchema,
|
|
34485
|
-
failureMode:
|
|
36360
|
+
failureMode: options3?.failureMode ?? "error",
|
|
34486
36361
|
annotations: empty(),
|
|
34487
|
-
needsApproval:
|
|
36362
|
+
needsApproval: options3?.needsApproval
|
|
34488
36363
|
});
|
|
34489
36364
|
};
|
|
34490
|
-
var dynamic = (name,
|
|
34491
|
-
const successSchema =
|
|
34492
|
-
const failureSchema =
|
|
34493
|
-
const rawParameters =
|
|
36365
|
+
var dynamic = (name, options3) => {
|
|
36366
|
+
const successSchema = options3?.success ?? Unknown2;
|
|
36367
|
+
const failureSchema = options3?.failure ?? Never2;
|
|
36368
|
+
const rawParameters = options3?.parameters ?? Unknown2;
|
|
34494
36369
|
const isEffectSchema = isSchema(rawParameters);
|
|
34495
36370
|
const parametersSchema = isEffectSchema ? rawParameters : Unknown2;
|
|
34496
|
-
const
|
|
36371
|
+
const jsonSchema2 = isEffectSchema ? undefined : rawParameters;
|
|
34497
36372
|
return dynamicProto({
|
|
34498
36373
|
name,
|
|
34499
|
-
description:
|
|
36374
|
+
description: options3?.description,
|
|
34500
36375
|
parametersSchema,
|
|
34501
36376
|
successSchema,
|
|
34502
36377
|
failureSchema,
|
|
34503
|
-
failureMode:
|
|
36378
|
+
failureMode: options3?.failureMode ?? "error",
|
|
34504
36379
|
annotations: empty(),
|
|
34505
|
-
needsApproval:
|
|
34506
|
-
jsonSchema
|
|
36380
|
+
needsApproval: options3?.needsApproval,
|
|
36381
|
+
jsonSchema: jsonSchema2
|
|
34507
36382
|
});
|
|
34508
36383
|
};
|
|
34509
|
-
var providerDefined = (
|
|
36384
|
+
var providerDefined = (options3) => (args2) => {
|
|
34510
36385
|
const failureMode = isNotUndefined(args2) && "failureMode" in args2 ? args2.failureMode : undefined;
|
|
34511
|
-
const successSchema =
|
|
34512
|
-
const failureSchema =
|
|
36386
|
+
const successSchema = options3?.success ?? Void2;
|
|
36387
|
+
const failureSchema = options3?.failure ?? Never2;
|
|
34513
36388
|
return providerDefinedProto({
|
|
34514
|
-
id:
|
|
34515
|
-
name:
|
|
34516
|
-
providerName:
|
|
36389
|
+
id: options3.id,
|
|
36390
|
+
name: options3.customName,
|
|
36391
|
+
providerName: options3.providerName,
|
|
34517
36392
|
args: args2,
|
|
34518
|
-
argsSchema:
|
|
34519
|
-
requiresHandler:
|
|
34520
|
-
parametersSchema:
|
|
36393
|
+
argsSchema: options3?.args ?? Void2,
|
|
36394
|
+
requiresHandler: options3.requiresHandler ?? false,
|
|
36395
|
+
parametersSchema: options3?.parameters ?? Void2,
|
|
34521
36396
|
successSchema,
|
|
34522
36397
|
failureSchema,
|
|
34523
36398
|
failureMode: failureMode ?? "error"
|
|
@@ -34557,15 +36432,15 @@ var getDescription = (tool) => {
|
|
|
34557
36432
|
}
|
|
34558
36433
|
return;
|
|
34559
36434
|
};
|
|
34560
|
-
var getJsonSchema = (tool,
|
|
36435
|
+
var getJsonSchema = (tool, options3) => {
|
|
34561
36436
|
if (isDynamic(tool) && tool.jsonSchema !== undefined) {
|
|
34562
36437
|
return tool.jsonSchema;
|
|
34563
36438
|
}
|
|
34564
|
-
return getJsonSchemaFromSchema(tool.parametersSchema,
|
|
36439
|
+
return getJsonSchemaFromSchema(tool.parametersSchema, options3);
|
|
34565
36440
|
};
|
|
34566
|
-
var getJsonSchemaFromSchema = (schema,
|
|
34567
|
-
if (isNotUndefined(
|
|
34568
|
-
return
|
|
36441
|
+
var getJsonSchemaFromSchema = (schema, options3) => {
|
|
36442
|
+
if (isNotUndefined(options3?.transformer)) {
|
|
36443
|
+
return options3.transformer(schema).jsonSchema;
|
|
34569
36444
|
}
|
|
34570
36445
|
const document = toJsonSchemaDocument2(schema);
|
|
34571
36446
|
if (Object.keys(document.definitions).length > 0) {
|
|
@@ -34599,12 +36474,12 @@ var Strict = /* @__PURE__ */ Reference("effect/ai/Tool/Strict", {
|
|
|
34599
36474
|
var getStrictMode = (tool) => get(tool.annotations, Strict);
|
|
34600
36475
|
var suspectProtoRx = /"__proto__"\s*:/;
|
|
34601
36476
|
var suspectConstructorRx = /"constructor"\s*:/;
|
|
34602
|
-
function _parse(
|
|
34603
|
-
const obj = JSON.parse(
|
|
36477
|
+
function _parse(text2) {
|
|
36478
|
+
const obj = JSON.parse(text2);
|
|
34604
36479
|
if (obj === null || typeof obj !== "object") {
|
|
34605
36480
|
return obj;
|
|
34606
36481
|
}
|
|
34607
|
-
if (suspectProtoRx.test(
|
|
36482
|
+
if (suspectProtoRx.test(text2) === false && suspectConstructorRx.test(text2) === false) {
|
|
34608
36483
|
return obj;
|
|
34609
36484
|
}
|
|
34610
36485
|
return filter13(obj);
|
|
@@ -34631,11 +36506,11 @@ function filter13(obj) {
|
|
|
34631
36506
|
}
|
|
34632
36507
|
return obj;
|
|
34633
36508
|
}
|
|
34634
|
-
var unsafeSecureJsonParse = (
|
|
36509
|
+
var unsafeSecureJsonParse = (text2) => {
|
|
34635
36510
|
const prevLimit = getStackTraceLimit();
|
|
34636
36511
|
setStackTraceLimit(0);
|
|
34637
36512
|
try {
|
|
34638
|
-
return _parse(
|
|
36513
|
+
return _parse(text2);
|
|
34639
36514
|
} finally {
|
|
34640
36515
|
setStackTraceLimit(prevLimit);
|
|
34641
36516
|
}
|
|
@@ -34800,10 +36675,18 @@ var layerMemory = exports_Layer.effect(ToolOutputStore, exports_Ref.make({ next:
|
|
|
34800
36675
|
return [exports_Option.some(id2), { next: next2 + 1, records: exports_HashMap.set(records, id2, { toolCallId, content }) }];
|
|
34801
36676
|
})
|
|
34802
36677
|
}))));
|
|
34803
|
-
var
|
|
36678
|
+
var encoder3 = new TextEncoder;
|
|
34804
36679
|
var decoder2 = new TextDecoder;
|
|
34805
36680
|
|
|
34806
36681
|
// ../core/src/compaction.ts
|
|
36682
|
+
var AgentSummary = exports_Schema.Struct({
|
|
36683
|
+
goal: exports_Schema.String,
|
|
36684
|
+
facts: exports_Schema.Array(exports_Schema.String),
|
|
36685
|
+
decisions: exports_Schema.Array(exports_Schema.String),
|
|
36686
|
+
openQuestions: exports_Schema.Array(exports_Schema.String),
|
|
36687
|
+
toolFindings: exports_Schema.Array(exports_Schema.String)
|
|
36688
|
+
});
|
|
36689
|
+
|
|
34807
36690
|
class CompactionError extends exports_Schema.TaggedErrorClass()("@batonfx/core/CompactionError", {
|
|
34808
36691
|
message: exports_Schema.String,
|
|
34809
36692
|
cause: exports_Schema.optionalKey(exports_Schema.Defect())
|
|
@@ -34882,9 +36765,11 @@ var exports_skill_source = {};
|
|
|
34882
36765
|
__export(exports_skill_source, {
|
|
34883
36766
|
testLayer: () => testLayer,
|
|
34884
36767
|
selectListings: () => selectListings,
|
|
36768
|
+
merge: () => merge7,
|
|
34885
36769
|
makeListing: () => makeListing,
|
|
36770
|
+
layer: () => layer2,
|
|
34886
36771
|
fromSkills: () => fromSkills,
|
|
34887
|
-
empty: () =>
|
|
36772
|
+
empty: () => empty17,
|
|
34888
36773
|
SkillSourceError: () => SkillSourceError,
|
|
34889
36774
|
SkillSource: () => SkillSource,
|
|
34890
36775
|
DESCRIPTION_CAP: () => DESCRIPTION_CAP
|
|
@@ -34895,7 +36780,7 @@ class SkillSourceError extends exports_Schema.TaggedErrorClass()("@batonfx/core/
|
|
|
34895
36780
|
cause: exports_Schema.optionalKey(exports_Schema.Defect())
|
|
34896
36781
|
}) {
|
|
34897
36782
|
}
|
|
34898
|
-
var DESCRIPTION_CAP =
|
|
36783
|
+
var DESCRIPTION_CAP = 1024;
|
|
34899
36784
|
|
|
34900
36785
|
class SkillSource extends exports_Context.Service()("@batonfx/core/SkillSource") {
|
|
34901
36786
|
}
|
|
@@ -34908,8 +36793,27 @@ var fromSkills = (skills) => {
|
|
|
34908
36793
|
get: (name) => exports_Effect.succeed(byName.get(name))
|
|
34909
36794
|
}));
|
|
34910
36795
|
};
|
|
34911
|
-
var
|
|
36796
|
+
var empty17 = fromSkills([]);
|
|
34912
36797
|
var testLayer = (implementation) => exports_Layer.succeed(SkillSource, SkillSource.of(implementation));
|
|
36798
|
+
var merge7 = (sources) => ({
|
|
36799
|
+
all: exports_Effect.forEach(sources, (source) => source.all).pipe(exports_Effect.map((groups) => {
|
|
36800
|
+
const byName = new Map;
|
|
36801
|
+
for (const skills of groups) {
|
|
36802
|
+
for (const skill of skills)
|
|
36803
|
+
byName.set(skill.frontmatter.name, skill);
|
|
36804
|
+
}
|
|
36805
|
+
return [...byName.values()];
|
|
36806
|
+
})),
|
|
36807
|
+
get: (name) => exports_Effect.gen(function* () {
|
|
36808
|
+
for (const source of sources.toReversed()) {
|
|
36809
|
+
const found = yield* source.get(name);
|
|
36810
|
+
if (found !== undefined)
|
|
36811
|
+
return found;
|
|
36812
|
+
}
|
|
36813
|
+
return;
|
|
36814
|
+
})
|
|
36815
|
+
});
|
|
36816
|
+
var layer2 = (sources) => exports_Layer.effect(SkillSource, exports_Effect.forEach(sources, (source) => source).pipe(exports_Effect.map((built) => SkillSource.of(merge7(built)))));
|
|
34913
36817
|
var estimatedTokens = (listing) => Math.ceil(listing.length / 4);
|
|
34914
36818
|
var usageRank = (skill, recentlyUsed) => {
|
|
34915
36819
|
const index2 = recentlyUsed.indexOf(skill.frontmatter.name);
|
|
@@ -34964,8 +36868,10 @@ var decision = {
|
|
|
34964
36868
|
}),
|
|
34965
36869
|
stop: { _tag: "Stop" }
|
|
34966
36870
|
};
|
|
34967
|
-
var
|
|
34968
|
-
|
|
36871
|
+
var recurs2 = (n) => ({
|
|
36872
|
+
decide: (info) => exports_Effect.succeed(info.turn < n + 1 ? decision.continue() : decision.stop),
|
|
36873
|
+
...Number.isFinite(n) ? { snapshot: { _tag: "Recurs", count: n } } : {}
|
|
36874
|
+
});
|
|
34969
36875
|
var defaultPolicy = recurs2(8);
|
|
34970
36876
|
|
|
34971
36877
|
// ../core/src/agent.ts
|
|
@@ -34984,11 +36890,19 @@ var activateSkillTool = exports_Tool.make(activateSkillToolName, {
|
|
|
34984
36890
|
var defaultParameters = exports_Schema.Struct({ prompt: exports_Schema.String });
|
|
34985
36891
|
// ../core/src/handoff.ts
|
|
34986
36892
|
var defaultTransferParameters = exports_Schema.Struct({ prompt: exports_Schema.String });
|
|
34987
|
-
// src/
|
|
34988
|
-
var
|
|
34989
|
-
|
|
36893
|
+
// src/hosted-catalog.ts
|
|
36894
|
+
var exports_hosted_catalog = {};
|
|
36895
|
+
__export(exports_hosted_catalog, {
|
|
36896
|
+
validateSkillPath: () => validateSkillPath,
|
|
36897
|
+
resolveRelative: () => resolveRelative,
|
|
36898
|
+
make: () => make41,
|
|
36899
|
+
layer: () => layer3,
|
|
36900
|
+
ManifestSkill: () => ManifestSkill,
|
|
36901
|
+
Manifest: () => Manifest
|
|
36902
|
+
});
|
|
36903
|
+
|
|
36904
|
+
// src/skill-document.ts
|
|
34990
36905
|
var sourceError = (source, message, cause) => new exports_skill_source.SkillSourceError({ source, message, ...cause === undefined ? {} : { cause } });
|
|
34991
|
-
var mapPlatformError = (source, error) => sourceError(source, error.message, error);
|
|
34992
36906
|
var normalizeKey = (key) => key.replace(/[-_]/g, "").toLowerCase();
|
|
34993
36907
|
var stripQuotes = (value3) => {
|
|
34994
36908
|
const trimmed = value3.trim();
|
|
@@ -35024,7 +36938,9 @@ var setValue = (target, key, value3) => {
|
|
|
35024
36938
|
target.whenToUse = value3;
|
|
35025
36939
|
break;
|
|
35026
36940
|
case "allowedtools":
|
|
35027
|
-
if (
|
|
36941
|
+
if (typeof value3 === "string")
|
|
36942
|
+
target.allowedTools = value3.split(/\s+/).filter((item) => item.length > 0);
|
|
36943
|
+
else if (Array.isArray(value3))
|
|
35028
36944
|
target.allowedTools = value3;
|
|
35029
36945
|
break;
|
|
35030
36946
|
case "disablemodelinvocation":
|
|
@@ -35065,18 +36981,18 @@ var parseHeader = (source, block) => exports_Effect.sync(() => {
|
|
|
35065
36981
|
if (separator === -1)
|
|
35066
36982
|
continue;
|
|
35067
36983
|
const key = line.slice(0, separator).trim();
|
|
35068
|
-
const
|
|
35069
|
-
if (
|
|
36984
|
+
const raw2 = line.slice(separator + 1).trim();
|
|
36985
|
+
if (raw2.length === 0) {
|
|
35070
36986
|
const values3 = [];
|
|
35071
36987
|
while ((lines[index2 + 1]?.trimStart().startsWith("- ") ?? false) === true) {
|
|
35072
36988
|
index2 += 1;
|
|
35073
36989
|
values3.push(stripQuotes((lines[index2] ?? "").trimStart().slice(2)));
|
|
35074
36990
|
}
|
|
35075
36991
|
setValue(parsed, key, values3);
|
|
35076
|
-
} else if (
|
|
35077
|
-
setValue(parsed, key, parseInlineArray(
|
|
36992
|
+
} else if (raw2.startsWith("[") && raw2.endsWith("]")) {
|
|
36993
|
+
setValue(parsed, key, parseInlineArray(raw2));
|
|
35078
36994
|
} else {
|
|
35079
|
-
setValue(parsed, key, parseBoolean(
|
|
36995
|
+
setValue(parsed, key, parseBoolean(raw2) ?? stripQuotes(raw2));
|
|
35080
36996
|
}
|
|
35081
36997
|
}
|
|
35082
36998
|
return parsed;
|
|
@@ -35097,47 +37013,21 @@ var splitDocument = (source, content) => exports_Effect.gen(function* () {
|
|
|
35097
37013
|
`), lines.slice(close2 + 1).join(`
|
|
35098
37014
|
`)];
|
|
35099
37015
|
});
|
|
35100
|
-
var
|
|
35101
|
-
|
|
35102
|
-
const
|
|
35103
|
-
|
|
35104
|
-
|
|
35105
|
-
const namespace = segments.slice(0, -1).join(":");
|
|
35106
|
-
return baseName.includes(":") || namespace.length === 0 ? baseName : `${namespace}:${baseName}`;
|
|
35107
|
-
};
|
|
35108
|
-
var parseDocument = (source, content, name) => exports_Effect.gen(function* () {
|
|
35109
|
-
const [header, body] = yield* splitDocument(source, content);
|
|
35110
|
-
const parsed = yield* parseHeader(source, header);
|
|
35111
|
-
if (parsed.description === undefined || parsed.description.length === 0) {
|
|
35112
|
-
return yield* exports_Effect.fail(sourceError(source, "SKILL.md frontmatter requires description"));
|
|
37016
|
+
var validateName = (source, name) => /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/.test(name) && !name.includes("--") ? exports_Effect.succeed(name) : exports_Effect.fail(sourceError(source, "SKILL.md name must be 1-64 lowercase alphanumeric or single-hyphen-separated characters"));
|
|
37017
|
+
var parseFrontmatter = (source, block, directoryName) => exports_Effect.gen(function* () {
|
|
37018
|
+
const parsed = yield* parseHeader(source, block);
|
|
37019
|
+
if (parsed.name === undefined) {
|
|
37020
|
+
return yield* exports_Effect.fail(sourceError(source, "SKILL.md frontmatter requires name"));
|
|
35113
37021
|
}
|
|
35114
|
-
|
|
35115
|
-
|
|
35116
|
-
|
|
35117
|
-
name,
|
|
35118
|
-
description: parsed.description,
|
|
35119
|
-
...parsed.whenToUse === undefined ? {} : { whenToUse: parsed.whenToUse },
|
|
35120
|
-
...parsed.allowedTools === undefined ? {} : { allowedTools: parsed.allowedTools },
|
|
35121
|
-
...parsed.disableModelInvocation === undefined ? {} : { disableModelInvocation: parsed.disableModelInvocation },
|
|
35122
|
-
...parsed.userInvocable === undefined ? {} : { userInvocable: parsed.userInvocable },
|
|
35123
|
-
...parsed.contextFork === undefined ? {} : { contextFork: parsed.contextFork },
|
|
35124
|
-
...parsed.agent === undefined ? {} : { agent: parsed.agent },
|
|
35125
|
-
...parsed.model === undefined ? {} : { model: parsed.model },
|
|
35126
|
-
...parsed.paths === undefined ? {} : { paths: parsed.paths }
|
|
35127
|
-
}
|
|
35128
|
-
};
|
|
35129
|
-
});
|
|
35130
|
-
var readHeader = (fs, source, bytes) => fs.stream(source, { bytesToRead: bytes, chunkSize: bytes }).pipe(exports_Stream.runFold(() => "", (content, chunk) => `${content}${decoder3.decode(chunk)}`), exports_Effect.mapError((error) => mapPlatformError(source, error)));
|
|
35131
|
-
var loadSkill = (fs, path, file, relativeFile, descriptionCap, frontmatterMaxBytes) => exports_Effect.gen(function* () {
|
|
35132
|
-
const header = yield* readHeader(fs, file, frontmatterMaxBytes);
|
|
35133
|
-
const [headerBlock] = yield* splitDocument(file, header);
|
|
35134
|
-
const parsed = yield* parseHeader(file, headerBlock);
|
|
35135
|
-
const name = namespacedName(path, relativeFile, parsed.name);
|
|
35136
|
-
if (parsed.description === undefined || parsed.description.length === 0) {
|
|
35137
|
-
return yield* exports_Effect.fail(sourceError(file, "SKILL.md frontmatter requires description"));
|
|
37022
|
+
yield* validateName(source, parsed.name);
|
|
37023
|
+
if (parsed.name !== directoryName) {
|
|
37024
|
+
return yield* exports_Effect.fail(sourceError(source, `SKILL.md name must match directory ${directoryName}`));
|
|
35138
37025
|
}
|
|
35139
|
-
|
|
35140
|
-
|
|
37026
|
+
if (parsed.description === undefined || parsed.description.length === 0 || parsed.description.length > 1024) {
|
|
37027
|
+
return yield* exports_Effect.fail(sourceError(source, "SKILL.md description must contain 1-1024 characters"));
|
|
37028
|
+
}
|
|
37029
|
+
return {
|
|
37030
|
+
name: parsed.name,
|
|
35141
37031
|
description: parsed.description,
|
|
35142
37032
|
...parsed.whenToUse === undefined ? {} : { whenToUse: parsed.whenToUse },
|
|
35143
37033
|
...parsed.allowedTools === undefined ? {} : { allowedTools: parsed.allowedTools },
|
|
@@ -35148,10 +37038,286 @@ var loadSkill = (fs, path, file, relativeFile, descriptionCap, frontmatterMaxByt
|
|
|
35148
37038
|
...parsed.model === undefined ? {} : { model: parsed.model },
|
|
35149
37039
|
...parsed.paths === undefined ? {} : { paths: parsed.paths }
|
|
35150
37040
|
};
|
|
37041
|
+
});
|
|
37042
|
+
var parseDocument = (source, content, directoryName) => exports_Effect.gen(function* () {
|
|
37043
|
+
const [header, body] = yield* splitDocument(source, content);
|
|
37044
|
+
return { frontmatter: yield* parseFrontmatter(source, header, directoryName), body };
|
|
37045
|
+
});
|
|
37046
|
+
|
|
37047
|
+
// src/hosted-catalog.ts
|
|
37048
|
+
var ManifestSkill = exports_Schema.Struct({
|
|
37049
|
+
name: exports_Schema.String,
|
|
37050
|
+
description: exports_Schema.String,
|
|
37051
|
+
skillPath: exports_Schema.String,
|
|
37052
|
+
sha256: exports_Schema.String,
|
|
37053
|
+
whenToUse: exports_Schema.optionalKey(exports_Schema.String),
|
|
37054
|
+
allowedTools: exports_Schema.optionalKey(exports_Schema.Array(exports_Schema.String)),
|
|
37055
|
+
disableModelInvocation: exports_Schema.optionalKey(exports_Schema.Boolean),
|
|
37056
|
+
userInvocable: exports_Schema.optionalKey(exports_Schema.Boolean),
|
|
37057
|
+
contextFork: exports_Schema.optionalKey(exports_Schema.Boolean),
|
|
37058
|
+
agent: exports_Schema.optionalKey(exports_Schema.String),
|
|
37059
|
+
model: exports_Schema.optionalKey(exports_Schema.String),
|
|
37060
|
+
paths: exports_Schema.optionalKey(exports_Schema.Array(exports_Schema.String))
|
|
37061
|
+
});
|
|
37062
|
+
var Manifest = exports_Schema.Struct({
|
|
37063
|
+
version: exports_Schema.Literal(1),
|
|
37064
|
+
skills: exports_Schema.Array(ManifestSkill)
|
|
37065
|
+
});
|
|
37066
|
+
var decoder3 = new TextDecoder("utf-8", { fatal: true });
|
|
37067
|
+
var sourceError2 = (source, message, cause) => new exports_skill_source.SkillSourceError({ source, message, ...cause === undefined ? {} : { cause } });
|
|
37068
|
+
var safeInteger = (source, name, value3, minimum) => Number.isSafeInteger(value3) && value3 >= minimum ? exports_Effect.succeed(value3) : exports_Effect.fail(sourceError2(source, `${name} must be a safe integer >= ${minimum}`));
|
|
37069
|
+
var request3 = (url, headers) => {
|
|
37070
|
+
let value3 = exports_HttpClientRequest.get(url);
|
|
37071
|
+
for (const [name, header] of Object.entries(headers ?? {}))
|
|
37072
|
+
value3 = exports_HttpClientRequest.setHeader(value3, name, header);
|
|
37073
|
+
return value3;
|
|
37074
|
+
};
|
|
37075
|
+
var fetchBytes = (client, source, url, headers, maxBytes) => client.execute(request3(url, headers)).pipe(exports_Effect.flatMap(exports_HttpClientResponse.filterStatusOk), exports_Effect.mapError((error) => sourceError2(source, "Hosted skill request failed", error)), exports_Effect.flatMap((response) => response.stream.pipe(exports_Stream.mapError((error) => sourceError2(source, "Hosted skill request failed", error)), exports_Stream.runFoldEffect(() => ({ size: 0, chunks: [] }), (state, chunk) => {
|
|
37076
|
+
const size7 = state.size + chunk.byteLength;
|
|
37077
|
+
if (size7 > maxBytes) {
|
|
37078
|
+
return exports_Effect.fail(sourceError2(source, `Hosted skill response exceeds ${maxBytes} bytes`));
|
|
37079
|
+
}
|
|
37080
|
+
state.chunks.push(chunk);
|
|
37081
|
+
return exports_Effect.succeed({ size: size7, chunks: state.chunks });
|
|
37082
|
+
}), exports_Effect.map(({ chunks: chunks2, size: size7 }) => {
|
|
37083
|
+
const bytes = new Uint8Array(size7);
|
|
37084
|
+
let offset = 0;
|
|
37085
|
+
for (const chunk of chunks2) {
|
|
37086
|
+
bytes.set(chunk, offset);
|
|
37087
|
+
offset += chunk.byteLength;
|
|
37088
|
+
}
|
|
37089
|
+
return bytes;
|
|
37090
|
+
}))));
|
|
37091
|
+
var decodeText2 = (source, bytes) => exports_Effect.try({
|
|
37092
|
+
try: () => decoder3.decode(bytes),
|
|
37093
|
+
catch: (cause) => sourceError2(source, "Hosted skill response is not valid UTF-8", cause)
|
|
37094
|
+
});
|
|
37095
|
+
var frontmatter = (entry) => ({
|
|
37096
|
+
name: entry.name,
|
|
37097
|
+
description: entry.description,
|
|
37098
|
+
...entry.whenToUse === undefined ? {} : { whenToUse: entry.whenToUse },
|
|
37099
|
+
...entry.allowedTools === undefined ? {} : { allowedTools: entry.allowedTools },
|
|
37100
|
+
...entry.disableModelInvocation === undefined ? {} : { disableModelInvocation: entry.disableModelInvocation },
|
|
37101
|
+
...entry.userInvocable === undefined ? {} : { userInvocable: entry.userInvocable },
|
|
37102
|
+
...entry.contextFork === undefined ? {} : { contextFork: entry.contextFork },
|
|
37103
|
+
...entry.agent === undefined ? {} : { agent: entry.agent },
|
|
37104
|
+
...entry.model === undefined ? {} : { model: entry.model },
|
|
37105
|
+
...entry.paths === undefined ? {} : { paths: entry.paths }
|
|
37106
|
+
});
|
|
37107
|
+
var sameFrontmatter = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
37108
|
+
var validateSkillPath = (source, skillPath) => {
|
|
37109
|
+
const segments = skillPath.split("/");
|
|
37110
|
+
return skillPath.length > 0 && !skillPath.startsWith("/") && !skillPath.includes("\\") && !skillPath.includes("%") && !skillPath.includes("?") && !skillPath.includes("#") && segments.every((segment) => segment.length > 0 && segment !== "." && segment !== "..") ? exports_Effect.succeed(skillPath) : exports_Effect.fail(sourceError2(source, `Unsafe hosted skill path: ${skillPath}`));
|
|
37111
|
+
};
|
|
37112
|
+
var resolveRelative = (source, manifestUrl, skillPath) => exports_Effect.gen(function* () {
|
|
37113
|
+
yield* validateSkillPath(source, skillPath);
|
|
37114
|
+
const manifest = yield* exports_Effect.fromResult(exports_Url.fromString(manifestUrl)).pipe(exports_Effect.mapError((error) => sourceError2(source, "Invalid manifest URL", error)));
|
|
37115
|
+
const directory = yield* exports_Effect.fromResult(exports_Url.fromString(".", manifest)).pipe(exports_Effect.mapError((error) => sourceError2(source, "Invalid manifest directory URL", error)));
|
|
37116
|
+
const resolved = yield* exports_Effect.fromResult(exports_Url.fromString(skillPath, directory)).pipe(exports_Effect.mapError((error) => sourceError2(source, "Invalid hosted skill URL", error)));
|
|
37117
|
+
if (resolved.origin !== manifest.origin || !resolved.pathname.startsWith(directory.pathname)) {
|
|
37118
|
+
return yield* exports_Effect.fail(sourceError2(source, `Hosted skill path escapes manifest directory: ${skillPath}`));
|
|
37119
|
+
}
|
|
37120
|
+
return resolved.toString();
|
|
37121
|
+
});
|
|
37122
|
+
var make41 = (options3) => exports_Effect.gen(function* () {
|
|
37123
|
+
const client = yield* exports_HttpClient.HttpClient;
|
|
37124
|
+
const crypto = yield* exports_Crypto.Crypto;
|
|
37125
|
+
const manifestMaxBytes = yield* safeInteger(options3.source, "manifestMaxBytes", options3.manifestMaxBytes ?? 1024 * 1024, 1);
|
|
37126
|
+
const bodyMaxBytes = yield* safeInteger(options3.source, "bodyMaxBytes", options3.bodyMaxBytes ?? 1024 * 1024, 1);
|
|
37127
|
+
const maxSkills = yield* safeInteger(options3.source, "maxSkills", options3.maxSkills ?? 1000, 1);
|
|
37128
|
+
const descriptionCap = yield* safeInteger(options3.source, "descriptionCap", options3.descriptionCap ?? exports_skill_source.DESCRIPTION_CAP, 0);
|
|
37129
|
+
const manifestBytes = yield* fetchBytes(client, options3.source, options3.manifestUrl, options3.manifestHeaders, manifestMaxBytes);
|
|
37130
|
+
const manifestText = yield* decodeText2(options3.source, manifestBytes);
|
|
37131
|
+
const manifest = yield* exports_Schema.decodeUnknownEffect(exports_Schema.fromJsonString(Manifest))(manifestText).pipe(exports_Effect.mapError((error) => sourceError2(options3.source, "Invalid hosted skill manifest", error)));
|
|
37132
|
+
if (manifest.skills.length > maxSkills) {
|
|
37133
|
+
return yield* exports_Effect.fail(sourceError2(options3.source, `Hosted skill manifest exceeds ${maxSkills} skills`));
|
|
37134
|
+
}
|
|
37135
|
+
const byName = new Map;
|
|
37136
|
+
for (const entry of manifest.skills) {
|
|
37137
|
+
yield* validateName(options3.source, entry.name);
|
|
37138
|
+
if (entry.description.length === 0 || entry.description.length > 1024) {
|
|
37139
|
+
return yield* exports_Effect.fail(sourceError2(options3.source, "Hosted skill description must contain 1-1024 characters"));
|
|
37140
|
+
}
|
|
37141
|
+
if (!/^[0-9a-f]{64}$/.test(entry.sha256)) {
|
|
37142
|
+
return yield* exports_Effect.fail(sourceError2(options3.source, `Invalid SHA-256 for hosted skill ${entry.name}`));
|
|
37143
|
+
}
|
|
37144
|
+
if (byName.has(entry.name)) {
|
|
37145
|
+
return yield* exports_Effect.fail(sourceError2(options3.source, `Duplicate hosted skill name: ${entry.name}`));
|
|
37146
|
+
}
|
|
37147
|
+
const pathSegments = entry.skillPath.split("/");
|
|
37148
|
+
if (pathSegments.at(-1) !== "SKILL.md" || pathSegments.at(-2) !== entry.name) {
|
|
37149
|
+
return yield* exports_Effect.fail(sourceError2(options3.source, `Hosted skill path directory must match skill name: ${entry.name}`));
|
|
37150
|
+
}
|
|
37151
|
+
const skillUrl = yield* options3.resolveSkillUrl(entry.skillPath);
|
|
37152
|
+
const metadata = frontmatter(entry);
|
|
37153
|
+
const body = fetchBytes(client, options3.source, skillUrl, options3.bodyHeaders, bodyMaxBytes).pipe(exports_Effect.flatMap((bytes) => crypto.digest("SHA-256", bytes).pipe(exports_Effect.mapError((error) => sourceError2(options3.source, `Unable to hash hosted skill ${entry.name}`, error)), exports_Effect.flatMap((actual) => exports_Encoding.encodeHex(actual) === entry.sha256 ? decodeText2(options3.source, bytes) : exports_Effect.fail(sourceError2(options3.source, `SHA-256 mismatch for hosted skill ${entry.name}`))))), exports_Effect.flatMap((content) => parseDocument(options3.source, content, entry.name).pipe(exports_Effect.flatMap((document) => sameFrontmatter(document.frontmatter, metadata) ? exports_Effect.succeed(document.body) : exports_Effect.fail(sourceError2(options3.source, `Frontmatter mismatch for hosted skill ${entry.name}`))))));
|
|
37154
|
+
const tools = options3.toolsBySkill !== undefined && Object.hasOwn(options3.toolsBySkill, entry.name) ? options3.toolsBySkill[entry.name] ?? [] : [];
|
|
37155
|
+
byName.set(entry.name, {
|
|
37156
|
+
frontmatter: metadata,
|
|
37157
|
+
listing: exports_skill_source.makeListing(metadata, descriptionCap),
|
|
37158
|
+
body,
|
|
37159
|
+
tools
|
|
37160
|
+
});
|
|
37161
|
+
}
|
|
37162
|
+
const skills = [...byName.values()];
|
|
37163
|
+
return {
|
|
37164
|
+
all: exports_Effect.succeed(skills),
|
|
37165
|
+
get: (name) => exports_Effect.succeed(byName.get(name))
|
|
37166
|
+
};
|
|
37167
|
+
});
|
|
37168
|
+
var layer3 = (options3) => exports_Layer.effect(exports_skill_source.SkillSource, make41(options3).pipe(exports_Effect.map(exports_skill_source.SkillSource.of)));
|
|
37169
|
+
|
|
37170
|
+
// src/github-catalog.ts
|
|
37171
|
+
var encodedPath = (value3) => value3.split("/").filter((segment) => segment.length > 0).map(encodeURIComponent).join("/");
|
|
37172
|
+
var make42 = (options3) => {
|
|
37173
|
+
const source = options3.source ?? `github:${options3.owner}/${options3.repo}@${options3.ref}`;
|
|
37174
|
+
if (!/^[0-9a-fA-F]{40}$|^[0-9a-fA-F]{64}$/.test(options3.ref)) {
|
|
37175
|
+
return exports_Effect.fail(new exports_skill_source.SkillSourceError({ source, message: "GitHub skill catalog ref must be a commit id" }));
|
|
37176
|
+
}
|
|
37177
|
+
if (!/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$/.test(options3.owner) || !/^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,98}[A-Za-z0-9])?$/.test(options3.repo)) {
|
|
37178
|
+
return exports_Effect.fail(new exports_skill_source.SkillSourceError({ source, message: "Invalid GitHub owner or repository" }));
|
|
37179
|
+
}
|
|
37180
|
+
return exports_Effect.gen(function* () {
|
|
37181
|
+
if ((options3.root?.length ?? 0) > 0)
|
|
37182
|
+
yield* validateSkillPath(source, options3.root ?? "");
|
|
37183
|
+
yield* validateSkillPath(source, options3.manifestName ?? "skills.json");
|
|
37184
|
+
const apiBase = yield* exports_Effect.fromResult(exports_Url.fromString(options3.apiBaseUrl ?? "https://api.github.com")).pipe(exports_Effect.mapError((cause) => new exports_skill_source.SkillSourceError({ source, message: "Invalid GitHub API base URL", cause })));
|
|
37185
|
+
if (apiBase.protocol !== "https:" || apiBase.username.length > 0 || apiBase.password.length > 0 || apiBase.search.length > 0 || apiBase.hash.length > 0) {
|
|
37186
|
+
return yield* exports_Effect.fail(new exports_skill_source.SkillSourceError({ source, message: "Invalid GitHub API base URL" }));
|
|
37187
|
+
}
|
|
37188
|
+
const base2 = apiBase.toString().replace(/\/$/, "");
|
|
37189
|
+
const root = encodedPath(options3.root ?? "");
|
|
37190
|
+
const manifestName = encodedPath(options3.manifestName ?? "skills.json");
|
|
37191
|
+
const repository = `${base2}/repos/${encodeURIComponent(options3.owner)}/${encodeURIComponent(options3.repo)}/contents`;
|
|
37192
|
+
const rootUrl = `${repository}/${root.length === 0 ? "" : `${root}/`}`;
|
|
37193
|
+
const manifestUrl = `${rootUrl}${manifestName}?ref=${encodeURIComponent(options3.ref)}`;
|
|
37194
|
+
const headers = {
|
|
37195
|
+
accept: "application/vnd.github.raw+json",
|
|
37196
|
+
"x-github-api-version": "2022-11-28"
|
|
37197
|
+
};
|
|
37198
|
+
return yield* make41({
|
|
37199
|
+
...options3,
|
|
37200
|
+
source,
|
|
37201
|
+
manifestUrl,
|
|
37202
|
+
manifestHeaders: headers,
|
|
37203
|
+
bodyHeaders: headers,
|
|
37204
|
+
resolveSkillUrl: (skillPath) => validateSkillPath(source, skillPath).pipe(exports_Effect.map((safePath) => `${rootUrl}${encodedPath(safePath)}?ref=${encodeURIComponent(options3.ref)}`))
|
|
37205
|
+
});
|
|
37206
|
+
});
|
|
37207
|
+
};
|
|
37208
|
+
var layer4 = (options3) => exports_skill_source.layer([make42(options3)]);
|
|
37209
|
+
// src/http-catalog.ts
|
|
37210
|
+
var exports_http_catalog = {};
|
|
37211
|
+
__export(exports_http_catalog, {
|
|
37212
|
+
make: () => make43,
|
|
37213
|
+
layer: () => layer5
|
|
37214
|
+
});
|
|
37215
|
+
var invalidUrl = (cause) => new exports_skill_source.SkillSourceError({ source: "http-skill-catalog", message: "Invalid manifest URL", cause });
|
|
37216
|
+
var make43 = (options3) => {
|
|
37217
|
+
return exports_Effect.gen(function* () {
|
|
37218
|
+
const parsed = yield* exports_Effect.fromResult(exports_Url.fromString(options3.manifestUrl)).pipe(exports_Effect.mapError(invalidUrl));
|
|
37219
|
+
const source = options3.source ?? `${parsed.origin}${parsed.pathname}`;
|
|
37220
|
+
return yield* make41({
|
|
37221
|
+
...options3,
|
|
37222
|
+
source,
|
|
37223
|
+
resolveSkillUrl: (skillPath) => resolveRelative(source, options3.manifestUrl, skillPath)
|
|
37224
|
+
});
|
|
37225
|
+
});
|
|
37226
|
+
};
|
|
37227
|
+
var layer5 = (options3) => exports_skill_source.layer([make43(options3)]);
|
|
37228
|
+
// src/instructions-files.ts
|
|
37229
|
+
var exports_instructions_files = {};
|
|
37230
|
+
__export(exports_instructions_files, {
|
|
37231
|
+
loadInstructionFiles: () => loadInstructionFiles
|
|
37232
|
+
});
|
|
37233
|
+
var DEFAULT_FILENAMES = ["AGENTS.md", "CLAUDE.md"];
|
|
37234
|
+
var readIfExists = (fs, file2) => exports_Effect.gen(function* () {
|
|
37235
|
+
if (!(yield* fs.exists(file2)))
|
|
37236
|
+
return;
|
|
37237
|
+
const content = yield* fs.readFileString(file2);
|
|
37238
|
+
return { path: file2, content };
|
|
37239
|
+
});
|
|
37240
|
+
var ancestors = (path, cwd) => {
|
|
37241
|
+
const directories = [];
|
|
37242
|
+
let cursor = path.resolve(cwd);
|
|
37243
|
+
while (true) {
|
|
37244
|
+
directories.push(cursor);
|
|
37245
|
+
const parent = path.dirname(cursor);
|
|
37246
|
+
if (parent === cursor)
|
|
37247
|
+
break;
|
|
37248
|
+
cursor = parent;
|
|
37249
|
+
}
|
|
37250
|
+
return directories.toReversed();
|
|
37251
|
+
};
|
|
37252
|
+
var loadInstructionFiles = (options3 = {}) => exports_Effect.gen(function* () {
|
|
37253
|
+
const fs = yield* exports_FileSystem.FileSystem;
|
|
37254
|
+
const path = yield* exports_Path.Path;
|
|
37255
|
+
const filenames = options3.filenames ?? DEFAULT_FILENAMES;
|
|
37256
|
+
const files = [];
|
|
37257
|
+
for (const globalFile of options3.globalFiles ?? []) {
|
|
37258
|
+
const loaded = yield* readIfExists(fs, globalFile);
|
|
37259
|
+
if (loaded !== undefined)
|
|
37260
|
+
files.push(loaded);
|
|
37261
|
+
}
|
|
37262
|
+
for (const directory of ancestors(path, options3.cwd ?? ".")) {
|
|
37263
|
+
for (const filename of filenames) {
|
|
37264
|
+
const loaded = yield* readIfExists(fs, path.join(directory, filename));
|
|
37265
|
+
if (loaded !== undefined) {
|
|
37266
|
+
files.push(loaded);
|
|
37267
|
+
break;
|
|
37268
|
+
}
|
|
37269
|
+
}
|
|
37270
|
+
}
|
|
37271
|
+
return files;
|
|
37272
|
+
});
|
|
37273
|
+
// src/s3-catalog.ts
|
|
37274
|
+
var exports_s3_catalog = {};
|
|
37275
|
+
__export(exports_s3_catalog, {
|
|
37276
|
+
make: () => make44,
|
|
37277
|
+
layer: () => layer6
|
|
37278
|
+
});
|
|
37279
|
+
var segments = (value3) => value3.split("/").filter((segment) => segment.length > 0).map(encodeURIComponent).join("/");
|
|
37280
|
+
var make44 = (options3) => {
|
|
37281
|
+
const source = options3.source ?? `s3://${options3.bucket}/${options3.prefix ?? ""}`;
|
|
37282
|
+
if (!/^[a-z0-9](?:[a-z0-9-]{1,61})[a-z0-9]$/.test(options3.bucket) || !/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])$/.test(options3.region)) {
|
|
37283
|
+
return exports_Effect.fail(new exports_skill_source.SkillSourceError({ source, message: "Invalid S3 bucket or region for hosted skill catalog" }));
|
|
37284
|
+
}
|
|
37285
|
+
return exports_Effect.gen(function* () {
|
|
37286
|
+
if ((options3.prefix?.length ?? 0) > 0)
|
|
37287
|
+
yield* validateSkillPath(source, options3.prefix ?? "");
|
|
37288
|
+
yield* validateSkillPath(source, options3.manifestName ?? "skills.json");
|
|
37289
|
+
const prefix = segments(options3.prefix ?? "");
|
|
37290
|
+
const manifestName = segments(options3.manifestName ?? "skills.json");
|
|
37291
|
+
const manifestUrl = `https://${options3.bucket}.s3.${options3.region}.amazonaws.com/${prefix.length === 0 ? "" : `${prefix}/`}${manifestName}`;
|
|
37292
|
+
return yield* make41({
|
|
37293
|
+
...options3,
|
|
37294
|
+
source,
|
|
37295
|
+
manifestUrl,
|
|
37296
|
+
resolveSkillUrl: (skillPath) => resolveRelative(source, manifestUrl, skillPath)
|
|
37297
|
+
});
|
|
37298
|
+
});
|
|
37299
|
+
};
|
|
37300
|
+
var layer6 = (options3) => exports_skill_source.layer([make44(options3)]);
|
|
37301
|
+
// src/skill-loader.ts
|
|
37302
|
+
var exports_skill_loader = {};
|
|
37303
|
+
__export(exports_skill_loader, {
|
|
37304
|
+
make: () => make45,
|
|
37305
|
+
layer: () => layer7
|
|
37306
|
+
});
|
|
37307
|
+
var DEFAULT_ROOTS = [".agents/skills", ".claude/skills", ".pi/skills"];
|
|
37308
|
+
var decoder4 = new TextDecoder;
|
|
37309
|
+
var sourceError3 = (source, message, cause) => new exports_skill_source.SkillSourceError({ source, message, ...cause === undefined ? {} : { cause } });
|
|
37310
|
+
var mapPlatformError = (source, error) => sourceError3(source, error.message, error);
|
|
37311
|
+
var readHeader = (fs, source, bytes) => fs.stream(source, { bytesToRead: bytes, chunkSize: bytes }).pipe(exports_Stream.runFold(() => "", (content, chunk) => `${content}${decoder4.decode(chunk)}`), exports_Effect.mapError((error) => mapPlatformError(source, error)));
|
|
37312
|
+
var loadSkill = (fs, path, file2, relativeFile, descriptionCap, frontmatterMaxBytes) => exports_Effect.gen(function* () {
|
|
37313
|
+
const header = yield* readHeader(fs, file2, frontmatterMaxBytes);
|
|
37314
|
+
const [headerBlock] = yield* splitDocument(file2, header);
|
|
37315
|
+
const directoryName = path.basename(path.dirname(relativeFile));
|
|
37316
|
+
const frontmatter2 = yield* parseFrontmatter(file2, headerBlock, directoryName);
|
|
35151
37317
|
return {
|
|
35152
|
-
frontmatter,
|
|
35153
|
-
listing: exports_skill_source.makeListing(
|
|
35154
|
-
body: fs.readFileString(
|
|
37318
|
+
frontmatter: frontmatter2,
|
|
37319
|
+
listing: exports_skill_source.makeListing(frontmatter2, descriptionCap),
|
|
37320
|
+
body: fs.readFileString(file2).pipe(exports_Effect.mapError((error) => mapPlatformError(file2, error)), exports_Effect.flatMap((content) => parseDocument(file2, content, directoryName).pipe(exports_Effect.map((document) => document.body)))),
|
|
35155
37321
|
tools: []
|
|
35156
37322
|
};
|
|
35157
37323
|
});
|
|
@@ -35167,13 +37333,13 @@ var discoverRoot = (fs, path, cwd, root, descriptionCap, frontmatterMaxBytes) =>
|
|
|
35167
37333
|
}
|
|
35168
37334
|
return skills;
|
|
35169
37335
|
});
|
|
35170
|
-
var
|
|
37336
|
+
var make45 = (options3 = {}) => exports_Effect.gen(function* () {
|
|
35171
37337
|
const fs = yield* exports_FileSystem.FileSystem;
|
|
35172
37338
|
const path = yield* exports_Path.Path;
|
|
35173
|
-
const cwd =
|
|
35174
|
-
const roots =
|
|
35175
|
-
const descriptionCap =
|
|
35176
|
-
const frontmatterMaxBytes =
|
|
37339
|
+
const cwd = options3.cwd === undefined ? "." : path.resolve(options3.cwd);
|
|
37340
|
+
const roots = options3.roots ?? DEFAULT_ROOTS;
|
|
37341
|
+
const descriptionCap = options3.descriptionCap ?? exports_skill_source.DESCRIPTION_CAP;
|
|
37342
|
+
const frontmatterMaxBytes = options3.frontmatterMaxBytes ?? 64 * 1024;
|
|
35177
37343
|
const byName = new Map;
|
|
35178
37344
|
for (const root of roots) {
|
|
35179
37345
|
for (const skill of yield* discoverRoot(fs, path, cwd, root, descriptionCap, frontmatterMaxBytes)) {
|
|
@@ -35181,12 +37347,17 @@ var layer2 = (options = {}) => exports_Layer.effect(exports_skill_source.SkillSo
|
|
|
35181
37347
|
}
|
|
35182
37348
|
}
|
|
35183
37349
|
const skills = [...byName.values()];
|
|
35184
|
-
return
|
|
37350
|
+
return {
|
|
35185
37351
|
all: exports_Effect.succeed(skills),
|
|
35186
37352
|
get: (name) => exports_Effect.succeed(byName.get(name))
|
|
35187
|
-
}
|
|
35188
|
-
})
|
|
37353
|
+
};
|
|
37354
|
+
});
|
|
37355
|
+
var layer7 = (options3 = {}) => exports_Layer.effect(exports_skill_source.SkillSource, make45(options3).pipe(exports_Effect.map(exports_skill_source.SkillSource.of)));
|
|
35189
37356
|
export {
|
|
35190
37357
|
exports_skill_loader as SkillLoader,
|
|
35191
|
-
|
|
37358
|
+
exports_s3_catalog as S3Catalog,
|
|
37359
|
+
exports_instructions_files as InstructionFiles,
|
|
37360
|
+
exports_http_catalog as HttpCatalog,
|
|
37361
|
+
exports_hosted_catalog as HostedCatalog,
|
|
37362
|
+
exports_github_catalog as GitHubCatalog
|
|
35192
37363
|
};
|