effect-ci 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +52 -2
- package/dist/chunks/chunk-MZ5FQEN6.js +80 -0
- package/dist/chunks/chunk-U3DVQKHN.js +21 -0
- package/dist/chunks/chunk-WGBTI7DS.js +61 -0
- package/dist/chunks/chunk-WOG7K3QJ.js +84 -0
- package/dist/chunks/chunk-X4HGOXPL.js +2207 -0
- package/dist/chunks/local-bridge.js +1296 -0
- package/dist/chunks/src-FUJGARUK.js +1978 -0
- package/dist/command-diagnostics.js +12 -0
- package/dist/directory-deployment.js +167 -0
- package/dist/effect-ci.js +43 -0
- package/dist/index.js +103 -0
- package/dist/paths.js +8 -0
- package/dist/source-changes.js +11 -0
- package/dist/task-cache.js +64 -0
- package/dist/types/command-diagnostics.d.ts +24 -0
- package/dist/types/directory-deployment.d.ts +25 -0
- package/dist/types/index.d.ts +787 -0
- package/dist/types/observers.d.ts +35 -0
- package/dist/types/paths.d.ts +4 -0
- package/dist/types/source-changes.d.ts +34 -0
- package/dist/types/task-cache.d.ts +6 -0
- package/dist/types/turbo-bridge.d.ts +33 -0
- package/dist/types/turbo.d.ts +6 -0
- package/dist/types/vite-plus.d.ts +15 -0
- package/dist/vite-plus.js +8 -0
- package/package.json +88 -3
|
@@ -0,0 +1,1296 @@
|
|
|
1
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Pipeable.js
|
|
2
|
+
var pipeArguments = (self, args2) => {
|
|
3
|
+
switch (args2.length) {
|
|
4
|
+
case 0:
|
|
5
|
+
return self;
|
|
6
|
+
case 1:
|
|
7
|
+
return args2[0](self);
|
|
8
|
+
case 2:
|
|
9
|
+
return args2[1](args2[0](self));
|
|
10
|
+
case 3:
|
|
11
|
+
return args2[2](args2[1](args2[0](self)));
|
|
12
|
+
case 4:
|
|
13
|
+
return args2[3](args2[2](args2[1](args2[0](self))));
|
|
14
|
+
case 5:
|
|
15
|
+
return args2[4](args2[3](args2[2](args2[1](args2[0](self)))));
|
|
16
|
+
case 6:
|
|
17
|
+
return args2[5](args2[4](args2[3](args2[2](args2[1](args2[0](self))))));
|
|
18
|
+
case 7:
|
|
19
|
+
return args2[6](args2[5](args2[4](args2[3](args2[2](args2[1](args2[0](self)))))));
|
|
20
|
+
case 8:
|
|
21
|
+
return args2[7](args2[6](args2[5](args2[4](args2[3](args2[2](args2[1](args2[0](self))))))));
|
|
22
|
+
case 9:
|
|
23
|
+
return args2[8](args2[7](args2[6](args2[5](args2[4](args2[3](args2[2](args2[1](args2[0](self)))))))));
|
|
24
|
+
default: {
|
|
25
|
+
let ret = self;
|
|
26
|
+
for (let i = 0, len = args2.length; i < len; i++) {
|
|
27
|
+
ret = args2[i](ret);
|
|
28
|
+
}
|
|
29
|
+
return ret;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Function.js
|
|
35
|
+
var dual = function(arity, body) {
|
|
36
|
+
if (typeof arity === "function") {
|
|
37
|
+
return function() {
|
|
38
|
+
return arity(arguments) ? body.apply(this, arguments) : (self) => body(self, ...arguments);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
switch (arity) {
|
|
42
|
+
case 0:
|
|
43
|
+
case 1:
|
|
44
|
+
throw new RangeError(`Invalid arity ${arity}`);
|
|
45
|
+
case 2:
|
|
46
|
+
return function(a, b) {
|
|
47
|
+
if (arguments.length >= 2) {
|
|
48
|
+
return body(a, b);
|
|
49
|
+
}
|
|
50
|
+
return function(self) {
|
|
51
|
+
return body(self, a);
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
case 3:
|
|
55
|
+
return function(a, b, c) {
|
|
56
|
+
if (arguments.length >= 3) {
|
|
57
|
+
return body(a, b, c);
|
|
58
|
+
}
|
|
59
|
+
return function(self) {
|
|
60
|
+
return body(self, a, b);
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
default:
|
|
64
|
+
return function() {
|
|
65
|
+
if (arguments.length >= arity) {
|
|
66
|
+
return body.apply(this, arguments);
|
|
67
|
+
}
|
|
68
|
+
const args2 = arguments;
|
|
69
|
+
return function(self) {
|
|
70
|
+
return body(self, ...args2);
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
var identity = (a) => a;
|
|
76
|
+
|
|
77
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/equal.js
|
|
78
|
+
var getAllObjectKeys = (obj) => {
|
|
79
|
+
const keys = new Set(Reflect.ownKeys(obj));
|
|
80
|
+
if (obj.constructor === Object) return keys;
|
|
81
|
+
if (obj instanceof Error) {
|
|
82
|
+
keys.delete("stack");
|
|
83
|
+
}
|
|
84
|
+
const proto = Object.getPrototypeOf(obj);
|
|
85
|
+
let current = proto;
|
|
86
|
+
while (current !== null && current !== Object.prototype) {
|
|
87
|
+
const ownKeys = Reflect.ownKeys(current);
|
|
88
|
+
for (let i = 0; i < ownKeys.length; i++) {
|
|
89
|
+
keys.add(ownKeys[i]);
|
|
90
|
+
}
|
|
91
|
+
current = Object.getPrototypeOf(current);
|
|
92
|
+
}
|
|
93
|
+
if (keys.has("constructor") && typeof obj.constructor === "function" && proto === obj.constructor.prototype) {
|
|
94
|
+
keys.delete("constructor");
|
|
95
|
+
}
|
|
96
|
+
return keys;
|
|
97
|
+
};
|
|
98
|
+
var byReferenceInstances = /* @__PURE__ */ new WeakSet();
|
|
99
|
+
var viewBytes = (view) => new Uint8Array(view.buffer, view.byteOffset, view.byteLength);
|
|
100
|
+
var isArrayBufferLike = (u) => u instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && u instanceof SharedArrayBuffer;
|
|
101
|
+
var bufferBytes = (buffer) => {
|
|
102
|
+
try {
|
|
103
|
+
return new Uint8Array(buffer);
|
|
104
|
+
} catch {
|
|
105
|
+
return void 0;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/hash.js
|
|
110
|
+
var backEdges = 0;
|
|
111
|
+
var addBackEdge = () => {
|
|
112
|
+
backEdges++;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Predicate.js
|
|
116
|
+
function isFunction(input) {
|
|
117
|
+
return typeof input === "function";
|
|
118
|
+
}
|
|
119
|
+
function isObjectKeyword(input) {
|
|
120
|
+
return typeof input === "object" && input !== null || isFunction(input);
|
|
121
|
+
}
|
|
122
|
+
var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObjectKeyword(self) && property in self);
|
|
123
|
+
|
|
124
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Hash.js
|
|
125
|
+
var symbol = "~effect/Hash";
|
|
126
|
+
var hash = (self) => {
|
|
127
|
+
switch (typeof self) {
|
|
128
|
+
case "number":
|
|
129
|
+
return number(self);
|
|
130
|
+
case "bigint":
|
|
131
|
+
return string(self.toString(10));
|
|
132
|
+
case "string":
|
|
133
|
+
return string(self);
|
|
134
|
+
case "function":
|
|
135
|
+
case "object": {
|
|
136
|
+
if (self === null) {
|
|
137
|
+
break;
|
|
138
|
+
} else if (self instanceof Date) {
|
|
139
|
+
if (Number.isNaN(self.getTime())) {
|
|
140
|
+
return string("Invalid Date");
|
|
141
|
+
}
|
|
142
|
+
return string(self.toISOString());
|
|
143
|
+
} else if (self instanceof RegExp) {
|
|
144
|
+
return string(self.toString());
|
|
145
|
+
} else {
|
|
146
|
+
if (byReferenceInstances.has(self)) {
|
|
147
|
+
return random(self);
|
|
148
|
+
}
|
|
149
|
+
const cached = hashCache.get(self);
|
|
150
|
+
if (cached !== void 0) {
|
|
151
|
+
return cached;
|
|
152
|
+
}
|
|
153
|
+
if (visitedObjects.has(self)) {
|
|
154
|
+
addBackEdge();
|
|
155
|
+
return string("[Circular]");
|
|
156
|
+
}
|
|
157
|
+
visitedObjects.add(self);
|
|
158
|
+
const seen = backEdges;
|
|
159
|
+
let h;
|
|
160
|
+
try {
|
|
161
|
+
if (isHash(self)) {
|
|
162
|
+
h = self[symbol]();
|
|
163
|
+
} else if (typeof self === "function") {
|
|
164
|
+
h = random(self);
|
|
165
|
+
} else if (isArrayBufferLike(self)) {
|
|
166
|
+
const bytes = bufferBytes(self);
|
|
167
|
+
h = bytes === void 0 ? random(self) : array(bytes);
|
|
168
|
+
} else if (self instanceof DataView) {
|
|
169
|
+
h = array(viewBytes(self));
|
|
170
|
+
} else if (Array.isArray(self) || ArrayBuffer.isView(self)) {
|
|
171
|
+
h = array(self);
|
|
172
|
+
} else if (self instanceof Map) {
|
|
173
|
+
h = hashMap(self);
|
|
174
|
+
} else if (self instanceof Set) {
|
|
175
|
+
h = hashSet(self);
|
|
176
|
+
} else {
|
|
177
|
+
h = structure(self);
|
|
178
|
+
}
|
|
179
|
+
} finally {
|
|
180
|
+
visitedObjects.delete(self);
|
|
181
|
+
}
|
|
182
|
+
if (seen === backEdges) {
|
|
183
|
+
hashCache.set(self, h);
|
|
184
|
+
}
|
|
185
|
+
return h;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return optimize(mix(string(String(self))));
|
|
190
|
+
};
|
|
191
|
+
var random = (self) => {
|
|
192
|
+
if (!randomHashCache.has(self)) {
|
|
193
|
+
randomHashCache.set(self, optimize(Math.random() * 4294967296 | 0));
|
|
194
|
+
}
|
|
195
|
+
return randomHashCache.get(self);
|
|
196
|
+
};
|
|
197
|
+
var mix = (h) => {
|
|
198
|
+
h ^= h >>> 16;
|
|
199
|
+
h = Math.imul(h, 2246822507);
|
|
200
|
+
h ^= h >>> 13;
|
|
201
|
+
h = Math.imul(h, 3266489909);
|
|
202
|
+
return h ^ h >>> 16;
|
|
203
|
+
};
|
|
204
|
+
var combine = /* @__PURE__ */ dual(2, (self, b) => mix(Math.imul(self, 2654435761) + Math.imul(b, 2246822507)));
|
|
205
|
+
var optimize = (n) => n & 3221225471 | n >>> 1 & 1073741824;
|
|
206
|
+
var isHash = (u) => hasProperty(u, symbol) && typeof u[symbol] === "function";
|
|
207
|
+
var float64 = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8));
|
|
208
|
+
var number = (n) => {
|
|
209
|
+
const h = n | 0;
|
|
210
|
+
if (h === n) {
|
|
211
|
+
return optimize(h);
|
|
212
|
+
}
|
|
213
|
+
float64.setFloat64(0, n !== n ? NaN : n);
|
|
214
|
+
return optimize(combine(float64.getInt32(0), float64.getInt32(4)));
|
|
215
|
+
};
|
|
216
|
+
var string = (str) => {
|
|
217
|
+
let h = 5381, i = str.length;
|
|
218
|
+
while (i) {
|
|
219
|
+
h = h * 33 ^ str.charCodeAt(--i);
|
|
220
|
+
}
|
|
221
|
+
return optimize(h);
|
|
222
|
+
};
|
|
223
|
+
var structureKeys = (o, keys) => {
|
|
224
|
+
let h = 12289;
|
|
225
|
+
for (const key of keys) {
|
|
226
|
+
h ^= combine(hash(key), hash(o[key]));
|
|
227
|
+
}
|
|
228
|
+
return optimize(h);
|
|
229
|
+
};
|
|
230
|
+
var structure = (o) => structureKeys(o, getAllObjectKeys(o));
|
|
231
|
+
var unordered = (seed, f) => (iter) => {
|
|
232
|
+
let h = seed;
|
|
233
|
+
for (const element of iter) {
|
|
234
|
+
h ^= f(element);
|
|
235
|
+
}
|
|
236
|
+
return optimize(h);
|
|
237
|
+
};
|
|
238
|
+
var array = (arr) => {
|
|
239
|
+
let h = 6151;
|
|
240
|
+
for (const element of arr) {
|
|
241
|
+
h = combine(h, hash(element));
|
|
242
|
+
}
|
|
243
|
+
return optimize(h);
|
|
244
|
+
};
|
|
245
|
+
var hashMap = /* @__PURE__ */ unordered(/* @__PURE__ */ string("Map"), ([k, v]) => combine(hash(k), hash(v)));
|
|
246
|
+
var setSeed = /* @__PURE__ */ string("Set");
|
|
247
|
+
var hashSet = /* @__PURE__ */ unordered(setSeed, (element) => combine(setSeed, hash(element)));
|
|
248
|
+
var randomHashCache = /* @__PURE__ */ new WeakMap();
|
|
249
|
+
var hashCache = /* @__PURE__ */ new WeakMap();
|
|
250
|
+
var visitedObjects = /* @__PURE__ */ new WeakSet();
|
|
251
|
+
|
|
252
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Equal.js
|
|
253
|
+
var symbol2 = "~effect/Equal";
|
|
254
|
+
function equals() {
|
|
255
|
+
if (arguments.length === 1) {
|
|
256
|
+
return (self) => compareBoth(self, arguments[0]);
|
|
257
|
+
}
|
|
258
|
+
return compareBoth(arguments[0], arguments[1]);
|
|
259
|
+
}
|
|
260
|
+
function compareBoth(self, that) {
|
|
261
|
+
if (self === that) return true;
|
|
262
|
+
if (self == null || that == null) return false;
|
|
263
|
+
const selfType = typeof self;
|
|
264
|
+
if (selfType !== typeof that) {
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
if (selfType === "number" && self !== self && that !== that) {
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
if (selfType !== "object" && selfType !== "function") {
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
if (byReferenceInstances.has(self) || byReferenceInstances.has(that)) {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
return compareObjects(self, that);
|
|
277
|
+
}
|
|
278
|
+
function compareObjects(self, that) {
|
|
279
|
+
const depth = pathLeft.length;
|
|
280
|
+
for (let i = depth; i-- > 0; ) {
|
|
281
|
+
if (pathLeft[i] === self && pathRight[i] === that) return true;
|
|
282
|
+
}
|
|
283
|
+
if (depth) return compareOnPath(self, that);
|
|
284
|
+
let known = results.get(self);
|
|
285
|
+
if (!known) results.set(self, known = /* @__PURE__ */ new WeakMap());
|
|
286
|
+
let result = known.get(that);
|
|
287
|
+
if (result === void 0) known.set(that, result = compareOnPath(self, that));
|
|
288
|
+
return result;
|
|
289
|
+
}
|
|
290
|
+
function compareOnPath(self, that) {
|
|
291
|
+
pathLeft.push(self);
|
|
292
|
+
pathRight.push(that);
|
|
293
|
+
try {
|
|
294
|
+
return compareStructure(self, that);
|
|
295
|
+
} finally {
|
|
296
|
+
pathLeft.pop();
|
|
297
|
+
pathRight.pop();
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
var pathLeft = [];
|
|
301
|
+
var pathRight = [];
|
|
302
|
+
var results = /* @__PURE__ */ new WeakMap();
|
|
303
|
+
function compareStructure(self, that) {
|
|
304
|
+
if (hash(self) !== hash(that)) {
|
|
305
|
+
return false;
|
|
306
|
+
} else if (self instanceof Date) {
|
|
307
|
+
if (!(that instanceof Date)) return false;
|
|
308
|
+
const selfTime = self.getTime();
|
|
309
|
+
const thatTime = that.getTime();
|
|
310
|
+
return selfTime === thatTime || Number.isNaN(selfTime) && Number.isNaN(thatTime);
|
|
311
|
+
} else if (self instanceof RegExp) {
|
|
312
|
+
return that instanceof RegExp && self.toString() === that.toString();
|
|
313
|
+
}
|
|
314
|
+
const bothEquals = isEqual(self);
|
|
315
|
+
if (bothEquals !== isEqual(that) || typeof self === "function" && !bothEquals) {
|
|
316
|
+
return false;
|
|
317
|
+
} else if (bothEquals) {
|
|
318
|
+
return self[symbol2](that);
|
|
319
|
+
} else if (Array.isArray(self)) {
|
|
320
|
+
if (!Array.isArray(that) || self.length !== that.length) {
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
return compareArrays(self, that);
|
|
324
|
+
} else if (isArrayBufferLike(self)) {
|
|
325
|
+
if (!isArrayBufferLike(that) || self instanceof ArrayBuffer !== that instanceof ArrayBuffer) {
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
const selfBytes = bufferBytes(self);
|
|
329
|
+
const thatBytes = bufferBytes(that);
|
|
330
|
+
return selfBytes !== void 0 && thatBytes !== void 0 && compareTypedArrays(selfBytes, thatBytes);
|
|
331
|
+
} else if (ArrayBuffer.isView(self)) {
|
|
332
|
+
const selfIsDataView = self instanceof DataView;
|
|
333
|
+
if (!ArrayBuffer.isView(that) || self.byteLength !== that.byteLength || selfIsDataView !== that instanceof DataView) {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
if (selfIsDataView) {
|
|
337
|
+
return compareTypedArrays(viewBytes(self), viewBytes(that));
|
|
338
|
+
}
|
|
339
|
+
return compareTypedArrays(self, that);
|
|
340
|
+
} else if (self instanceof Map) {
|
|
341
|
+
if (!(that instanceof Map) || self.size !== that.size) {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
return compareHashed(self, that, entryHash, equalEntries);
|
|
345
|
+
} else if (self instanceof Set) {
|
|
346
|
+
if (!(that instanceof Set) || self.size !== that.size) {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
return compareHashed(self, that, hash, compareBoth);
|
|
350
|
+
}
|
|
351
|
+
return compareRecords(self, that);
|
|
352
|
+
}
|
|
353
|
+
function compareArrays(self, that) {
|
|
354
|
+
for (let i = 0; i < self.length; i++) {
|
|
355
|
+
if (!compareBoth(self[i], that[i])) {
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return true;
|
|
360
|
+
}
|
|
361
|
+
function compareTypedArrays(self, that) {
|
|
362
|
+
if (self.length !== that.length) {
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
for (let i = 0; i < self.length; i++) {
|
|
366
|
+
if (self[i] !== that[i]) {
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return true;
|
|
371
|
+
}
|
|
372
|
+
function compareRecords(self, that) {
|
|
373
|
+
const selfKeys = getAllObjectKeys(self);
|
|
374
|
+
const thatKeys = getAllObjectKeys(that);
|
|
375
|
+
if (selfKeys.size !== thatKeys.size) {
|
|
376
|
+
return false;
|
|
377
|
+
}
|
|
378
|
+
for (const key of selfKeys) {
|
|
379
|
+
if (!thatKeys.has(key) || !compareBoth(self[key], that[key])) {
|
|
380
|
+
return false;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return true;
|
|
384
|
+
}
|
|
385
|
+
function compareHashed(self, that, hashOf, equivalent) {
|
|
386
|
+
const groups = /* @__PURE__ */ new Map();
|
|
387
|
+
let remaining = 0;
|
|
388
|
+
for (const item of that) {
|
|
389
|
+
const h = hashOf(item);
|
|
390
|
+
const group = groups.get(h);
|
|
391
|
+
if (group) group.push(item);
|
|
392
|
+
else groups.set(h, [item]);
|
|
393
|
+
remaining++;
|
|
394
|
+
}
|
|
395
|
+
outer: for (const item of self) {
|
|
396
|
+
const group = groups.get(hashOf(item));
|
|
397
|
+
if (group) {
|
|
398
|
+
for (let i = 0; i < group.length; i++) {
|
|
399
|
+
if (equivalent(item, group[i])) {
|
|
400
|
+
group[i] = group[group.length - 1];
|
|
401
|
+
group.pop();
|
|
402
|
+
remaining--;
|
|
403
|
+
continue outer;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return false;
|
|
408
|
+
}
|
|
409
|
+
return remaining === 0;
|
|
410
|
+
}
|
|
411
|
+
var entryHash = (entry) => hash(entry[0]);
|
|
412
|
+
var equalEntries = (self, that) => compareBoth(self[0], that[0]) && compareBoth(self[1], that[1]);
|
|
413
|
+
var isEqual = (u) => hasProperty(u, symbol2) && typeof u[symbol2] === "function";
|
|
414
|
+
|
|
415
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Redactable.js
|
|
416
|
+
var symbolRedactable = /* @__PURE__ */ Symbol.for("~effect/Redactable");
|
|
417
|
+
var isRedactable = (u) => hasProperty(u, symbolRedactable);
|
|
418
|
+
function redact(u) {
|
|
419
|
+
if (isRedactable(u)) return getRedacted(u);
|
|
420
|
+
return u;
|
|
421
|
+
}
|
|
422
|
+
function getRedacted(redactable) {
|
|
423
|
+
return redactable[symbolRedactable](globalThis[currentFiberTypeId]?.context ?? emptyContext);
|
|
424
|
+
}
|
|
425
|
+
var currentFiberTypeId = "~effect/Fiber/currentFiber";
|
|
426
|
+
var emptyMap = /* @__PURE__ */ new Map();
|
|
427
|
+
var emptyContext = {
|
|
428
|
+
"~effect/Context": {},
|
|
429
|
+
base: emptyMap,
|
|
430
|
+
depth: 0,
|
|
431
|
+
mapUnsafe: emptyMap,
|
|
432
|
+
pipe() {
|
|
433
|
+
return pipeArguments(this, arguments);
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Formatter.js
|
|
438
|
+
function format(input, options) {
|
|
439
|
+
const space = options?.space ?? 0;
|
|
440
|
+
const ancestors = /* @__PURE__ */ new WeakSet();
|
|
441
|
+
const gap = !space ? "" : typeof space === "number" ? " ".repeat(space) : space;
|
|
442
|
+
const ind = (d) => gap.repeat(d);
|
|
443
|
+
const wrap = (v, body) => {
|
|
444
|
+
const ctor = v?.constructor;
|
|
445
|
+
return ctor && ctor !== Object.prototype.constructor && ctor.name ? `${ctor.name}(${body})` : body;
|
|
446
|
+
};
|
|
447
|
+
const ownKeys = (o) => {
|
|
448
|
+
try {
|
|
449
|
+
return Reflect.ownKeys(o);
|
|
450
|
+
} catch {
|
|
451
|
+
return ["[ownKeys threw]"];
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
function recur(v, d = 0) {
|
|
455
|
+
try {
|
|
456
|
+
return recurUnsafe(v, d);
|
|
457
|
+
} catch {
|
|
458
|
+
if (typeof v === "object" && v !== null || typeof v === "function") ancestors.delete(v);
|
|
459
|
+
return "[inspection threw]";
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function recurUnsafe(v, d = 0) {
|
|
463
|
+
if (typeof v === "string") return JSON.stringify(v);
|
|
464
|
+
if (typeof v === "number" || v == null || typeof v === "boolean" || typeof v === "symbol") return String(v);
|
|
465
|
+
if (typeof v === "bigint") return String(v) + "n";
|
|
466
|
+
if (typeof v === "object" || typeof v === "function") {
|
|
467
|
+
if (ancestors.has(v)) return CIRCULAR;
|
|
468
|
+
ancestors.add(v);
|
|
469
|
+
let output;
|
|
470
|
+
if (symbolRedactable in v) {
|
|
471
|
+
output = recur(getRedacted(v), d);
|
|
472
|
+
} else if (Array.isArray(v)) {
|
|
473
|
+
output = !gap || v.length <= 1 ? `[${v.map((x) => recur(x, d)).join(",")}]` : `[
|
|
474
|
+
${ind(d + 1)}${v.map((x) => recur(x, d + 1)).join(",\n" + ind(d + 1))}
|
|
475
|
+
${ind(d)}]`;
|
|
476
|
+
} else if (v instanceof Date) {
|
|
477
|
+
output = formatDate(v);
|
|
478
|
+
} else if (!options?.ignoreToString && hasProperty(v, "toString") && typeof v["toString"] === "function" && v["toString"] !== Object.prototype.toString && v["toString"] !== Array.prototype.toString) {
|
|
479
|
+
const s = safeToString(v);
|
|
480
|
+
output = v instanceof Error && v.cause !== void 0 ? `${s} (cause: ${recur(v.cause, d)})` : s;
|
|
481
|
+
} else if (Symbol.iterator in v) {
|
|
482
|
+
output = `${v.constructor.name}(${recur(Array.from(v), d)})`;
|
|
483
|
+
} else {
|
|
484
|
+
const keys = ownKeys(v);
|
|
485
|
+
if (!gap || keys.length <= 1) {
|
|
486
|
+
const body = `{${keys.map((k) => `${formatPropertyKey(k)}:${recur(safeGet(v, k), d)}`).join(",")}}`;
|
|
487
|
+
output = wrap(v, body);
|
|
488
|
+
} else {
|
|
489
|
+
const body = `{
|
|
490
|
+
${keys.map((k) => `${ind(d + 1)}${formatPropertyKey(k)}: ${recur(safeGet(v, k), d + 1)}`).join(",\n")}
|
|
491
|
+
${ind(d)}}`;
|
|
492
|
+
output = wrap(v, body);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
ancestors.delete(v);
|
|
496
|
+
return output;
|
|
497
|
+
}
|
|
498
|
+
return String(v);
|
|
499
|
+
}
|
|
500
|
+
return recur(input, 0);
|
|
501
|
+
}
|
|
502
|
+
var CIRCULAR = "[Circular]";
|
|
503
|
+
function formatPropertyKey(name) {
|
|
504
|
+
return typeof name === "string" ? JSON.stringify(name) : String(name);
|
|
505
|
+
}
|
|
506
|
+
function formatDate(date) {
|
|
507
|
+
try {
|
|
508
|
+
return date.toISOString();
|
|
509
|
+
} catch {
|
|
510
|
+
return "Invalid Date";
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
function safeToString(input) {
|
|
514
|
+
try {
|
|
515
|
+
const s = input.toString();
|
|
516
|
+
return typeof s === "string" ? s : String(s);
|
|
517
|
+
} catch {
|
|
518
|
+
return "[toString threw]";
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
function safeGet(input, key) {
|
|
522
|
+
try {
|
|
523
|
+
return input[key];
|
|
524
|
+
} catch {
|
|
525
|
+
return "[property access threw]";
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Inspectable.js
|
|
530
|
+
var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
531
|
+
var toJson = (input) => {
|
|
532
|
+
try {
|
|
533
|
+
input = redact(input);
|
|
534
|
+
if (hasProperty(input, "toJSON") && isFunction(input["toJSON"]) && input["toJSON"].length === 0) {
|
|
535
|
+
return input.toJSON();
|
|
536
|
+
} else if (Array.isArray(input)) {
|
|
537
|
+
return input.map(toJson);
|
|
538
|
+
}
|
|
539
|
+
return input;
|
|
540
|
+
} catch {
|
|
541
|
+
return "[toJSON threw]";
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
var BaseProto = {
|
|
545
|
+
toJSON() {
|
|
546
|
+
return toJson(this);
|
|
547
|
+
},
|
|
548
|
+
[NodeInspectSymbol]() {
|
|
549
|
+
return this.toJSON();
|
|
550
|
+
},
|
|
551
|
+
toString() {
|
|
552
|
+
return format(this.toJSON());
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
var Class = class {
|
|
556
|
+
/**
|
|
557
|
+
* Node.js custom inspection method.
|
|
558
|
+
*
|
|
559
|
+
* **When to use**
|
|
560
|
+
*
|
|
561
|
+
* Use to expose the class JSON representation to Node.js inspection.
|
|
562
|
+
*
|
|
563
|
+
* @since 2.0.0
|
|
564
|
+
*/
|
|
565
|
+
[NodeInspectSymbol]() {
|
|
566
|
+
return this.toJSON();
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Returns a formatted string representation of this object.
|
|
570
|
+
*
|
|
571
|
+
* **When to use**
|
|
572
|
+
*
|
|
573
|
+
* Use to format the class JSON representation as a string.
|
|
574
|
+
*
|
|
575
|
+
* @since 2.0.0
|
|
576
|
+
*/
|
|
577
|
+
toString() {
|
|
578
|
+
return format(this.toJSON());
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Utils.js
|
|
583
|
+
var SingleShotGen = class {
|
|
584
|
+
constructor(self) {
|
|
585
|
+
this.value = self;
|
|
586
|
+
this.done = false;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Yields the stored value once, then completes with the value sent back in.
|
|
590
|
+
*
|
|
591
|
+
* **When to use**
|
|
592
|
+
*
|
|
593
|
+
* Use to advance a `SingleShotGen` through its single yield and completion
|
|
594
|
+
* step.
|
|
595
|
+
*
|
|
596
|
+
* @since 2.0.0
|
|
597
|
+
*/
|
|
598
|
+
next(a) {
|
|
599
|
+
if (this.done) {
|
|
600
|
+
this.value = a;
|
|
601
|
+
return this;
|
|
602
|
+
}
|
|
603
|
+
this.done = true;
|
|
604
|
+
return {
|
|
605
|
+
value: this.value,
|
|
606
|
+
done: false
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/record.js
|
|
612
|
+
function assignProperty(self, key, value) {
|
|
613
|
+
if (key === "__proto__") {
|
|
614
|
+
Object.defineProperty(self, key, {
|
|
615
|
+
value,
|
|
616
|
+
writable: true,
|
|
617
|
+
enumerable: true,
|
|
618
|
+
configurable: true
|
|
619
|
+
});
|
|
620
|
+
} else {
|
|
621
|
+
;
|
|
622
|
+
self[key] = value;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
function assignProperties(self, source) {
|
|
626
|
+
if (!Object.hasOwn(source, "__proto__")) {
|
|
627
|
+
Object.assign(self, source);
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
631
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) {
|
|
632
|
+
assignProperty(self, key, source[key]);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/core.js
|
|
638
|
+
var EffectTypeId = `~effect/Effect`;
|
|
639
|
+
var ExitTypeId = `~effect/Exit`;
|
|
640
|
+
var effectVariance = {
|
|
641
|
+
_A: identity,
|
|
642
|
+
_E: identity,
|
|
643
|
+
_R: identity
|
|
644
|
+
};
|
|
645
|
+
var identifier = `${EffectTypeId}/identifier`;
|
|
646
|
+
var args = `${EffectTypeId}/args`;
|
|
647
|
+
var evaluate = `${EffectTypeId}/evaluate`;
|
|
648
|
+
var contA = `${EffectTypeId}/successCont`;
|
|
649
|
+
var contE = `${EffectTypeId}/failureCont`;
|
|
650
|
+
var contAll = `${EffectTypeId}/ensureCont`;
|
|
651
|
+
var PipeInspectableProto = {
|
|
652
|
+
pipe() {
|
|
653
|
+
return pipeArguments(this, arguments);
|
|
654
|
+
},
|
|
655
|
+
toJSON() {
|
|
656
|
+
return {
|
|
657
|
+
...this
|
|
658
|
+
};
|
|
659
|
+
},
|
|
660
|
+
toString() {
|
|
661
|
+
return format(this.toJSON(), {
|
|
662
|
+
ignoreToString: true,
|
|
663
|
+
space: 2
|
|
664
|
+
});
|
|
665
|
+
},
|
|
666
|
+
[NodeInspectSymbol]() {
|
|
667
|
+
return this.toJSON();
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
var StructuralProto = {
|
|
671
|
+
[symbol]() {
|
|
672
|
+
return structureKeys(this, Object.keys(this));
|
|
673
|
+
},
|
|
674
|
+
[symbol2](that) {
|
|
675
|
+
const selfKeys = Object.keys(this);
|
|
676
|
+
const thatKeys = Object.keys(that);
|
|
677
|
+
if (selfKeys.length !== thatKeys.length) return false;
|
|
678
|
+
for (let i = 0; i < selfKeys.length; i++) {
|
|
679
|
+
if (selfKeys[i] !== thatKeys[i] || !equals(this[selfKeys[i]], that[selfKeys[i]])) {
|
|
680
|
+
return false;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
return true;
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
var EffectProto = {
|
|
687
|
+
[EffectTypeId]: effectVariance,
|
|
688
|
+
...PipeInspectableProto,
|
|
689
|
+
[Symbol.iterator]() {
|
|
690
|
+
return new SingleShotGen(this);
|
|
691
|
+
},
|
|
692
|
+
toJSON() {
|
|
693
|
+
return {
|
|
694
|
+
_id: "Effect",
|
|
695
|
+
op: this[identifier],
|
|
696
|
+
...args in this ? {
|
|
697
|
+
args: this[args]
|
|
698
|
+
} : void 0
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
var isExit = (u) => hasProperty(u, ExitTypeId);
|
|
703
|
+
var CauseTypeId = "~effect/Cause";
|
|
704
|
+
var CauseReasonTypeId = "~effect/Cause/Reason";
|
|
705
|
+
var isCause = (self) => hasProperty(self, CauseTypeId);
|
|
706
|
+
var CauseImpl = class {
|
|
707
|
+
constructor(failures) {
|
|
708
|
+
this[CauseTypeId] = CauseTypeId;
|
|
709
|
+
this.reasons = failures;
|
|
710
|
+
}
|
|
711
|
+
pipe() {
|
|
712
|
+
return pipeArguments(this, arguments);
|
|
713
|
+
}
|
|
714
|
+
toJSON() {
|
|
715
|
+
return {
|
|
716
|
+
_id: "Cause",
|
|
717
|
+
reasons: this.reasons.map((f) => f.toJSON())
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
toString() {
|
|
721
|
+
return `Cause(${format(this.reasons)})`;
|
|
722
|
+
}
|
|
723
|
+
[NodeInspectSymbol]() {
|
|
724
|
+
return this.toJSON();
|
|
725
|
+
}
|
|
726
|
+
[symbol2](that) {
|
|
727
|
+
return isCause(that) && this.reasons.length === that.reasons.length && this.reasons.every((e, i) => equals(e, that.reasons[i]));
|
|
728
|
+
}
|
|
729
|
+
[symbol]() {
|
|
730
|
+
return array(this.reasons);
|
|
731
|
+
}
|
|
732
|
+
};
|
|
733
|
+
var annotationsMap = /* @__PURE__ */ new WeakMap();
|
|
734
|
+
var ReasonBase = class {
|
|
735
|
+
[CauseReasonTypeId];
|
|
736
|
+
annotations;
|
|
737
|
+
_tag;
|
|
738
|
+
constructor(_tag, annotations, originalError) {
|
|
739
|
+
this[CauseReasonTypeId] = CauseReasonTypeId;
|
|
740
|
+
this._tag = _tag;
|
|
741
|
+
if (annotations !== constEmptyAnnotations && typeof originalError === "object" && originalError !== null && annotations.size > 0) {
|
|
742
|
+
const prevAnnotations = annotationsMap.get(originalError);
|
|
743
|
+
if (prevAnnotations) {
|
|
744
|
+
annotations = new Map([...prevAnnotations, ...annotations]);
|
|
745
|
+
}
|
|
746
|
+
annotationsMap.set(originalError, annotations);
|
|
747
|
+
}
|
|
748
|
+
this.annotations = annotations;
|
|
749
|
+
}
|
|
750
|
+
annotate(annotations, options) {
|
|
751
|
+
if (annotations.mapUnsafe.size === 0) return this;
|
|
752
|
+
const newAnnotations = new Map(this.annotations);
|
|
753
|
+
annotations.mapUnsafe.forEach((value, key) => {
|
|
754
|
+
if (options?.overwrite !== true && newAnnotations.has(key)) return;
|
|
755
|
+
newAnnotations.set(key, value);
|
|
756
|
+
});
|
|
757
|
+
if (options?.overwrite !== true && newAnnotations.size === this.annotations.size) return this;
|
|
758
|
+
const self = Object.assign(Object.create(Object.getPrototypeOf(this)), this);
|
|
759
|
+
self.annotations = newAnnotations;
|
|
760
|
+
return self;
|
|
761
|
+
}
|
|
762
|
+
pipe() {
|
|
763
|
+
return pipeArguments(this, arguments);
|
|
764
|
+
}
|
|
765
|
+
toString() {
|
|
766
|
+
return format(this);
|
|
767
|
+
}
|
|
768
|
+
[NodeInspectSymbol]() {
|
|
769
|
+
return this.toString();
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
var constEmptyAnnotations = /* @__PURE__ */ new Map();
|
|
773
|
+
var Fail = class extends ReasonBase {
|
|
774
|
+
constructor(error, annotations = constEmptyAnnotations) {
|
|
775
|
+
super("Fail", annotations, error);
|
|
776
|
+
this.error = error;
|
|
777
|
+
}
|
|
778
|
+
toString() {
|
|
779
|
+
return `Fail(${format(this.error)})`;
|
|
780
|
+
}
|
|
781
|
+
toJSON() {
|
|
782
|
+
return {
|
|
783
|
+
_tag: "Fail",
|
|
784
|
+
error: this.error
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
[symbol2](that) {
|
|
788
|
+
return isFailReason(that) && equals(this.error, that.error) && equals(this.annotations, that.annotations);
|
|
789
|
+
}
|
|
790
|
+
[symbol]() {
|
|
791
|
+
return combine(string(this._tag))(combine(hash(this.error))(hash(this.annotations)));
|
|
792
|
+
}
|
|
793
|
+
};
|
|
794
|
+
var causeFromReasons = (reasons) => new CauseImpl(reasons);
|
|
795
|
+
var causeAddInterrupts = (self, interrupts) => {
|
|
796
|
+
const reasons = self.reasons.slice();
|
|
797
|
+
for (const reason of interrupts.reasons) {
|
|
798
|
+
if (isInterruptReason(reason) && !reasons.some((r) => isInterruptReason(r) && r.fiberId === reason.fiberId && r.annotations === reason.annotations)) {
|
|
799
|
+
reasons.push(reason);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
return reasons.length === self.reasons.length ? self : new CauseImpl(reasons);
|
|
803
|
+
};
|
|
804
|
+
var causeFail = (error) => new CauseImpl([new Fail(error)]);
|
|
805
|
+
var Die = class extends ReasonBase {
|
|
806
|
+
constructor(defect, annotations = constEmptyAnnotations) {
|
|
807
|
+
super("Die", annotations, defect);
|
|
808
|
+
this.defect = defect;
|
|
809
|
+
}
|
|
810
|
+
toString() {
|
|
811
|
+
return `Die(${format(this.defect)})`;
|
|
812
|
+
}
|
|
813
|
+
toJSON() {
|
|
814
|
+
return {
|
|
815
|
+
_tag: "Die",
|
|
816
|
+
defect: this.defect
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
[symbol2](that) {
|
|
820
|
+
return isDieReason(that) && equals(this.defect, that.defect) && equals(this.annotations, that.annotations);
|
|
821
|
+
}
|
|
822
|
+
[symbol]() {
|
|
823
|
+
return combine(string(this._tag))(combine(hash(this.defect))(hash(this.annotations)));
|
|
824
|
+
}
|
|
825
|
+
};
|
|
826
|
+
var causeDie = (defect) => new CauseImpl([new Die(defect)]);
|
|
827
|
+
var causeAnnotate = /* @__PURE__ */ dual((args2) => isCause(args2[0]), (self, annotations, options) => {
|
|
828
|
+
if (annotations.mapUnsafe.size === 0) return self;
|
|
829
|
+
return new CauseImpl(self.reasons.map((f) => f.annotate(annotations, options)));
|
|
830
|
+
});
|
|
831
|
+
var isFailReason = (self) => self._tag === "Fail";
|
|
832
|
+
var isDieReason = (self) => self._tag === "Die";
|
|
833
|
+
var isInterruptReason = (self) => self._tag === "Interrupt";
|
|
834
|
+
function defaultEvaluate(_fiber) {
|
|
835
|
+
return exitDie(`Effect.evaluate: Not implemented`);
|
|
836
|
+
}
|
|
837
|
+
var makePrimitiveProto = (options) => ({
|
|
838
|
+
...EffectProto,
|
|
839
|
+
[identifier]: options.op,
|
|
840
|
+
[evaluate]: options[evaluate] ?? defaultEvaluate,
|
|
841
|
+
[contA]: options[contA],
|
|
842
|
+
[contE]: options[contE],
|
|
843
|
+
[contAll]: options[contAll]
|
|
844
|
+
});
|
|
845
|
+
var makePrimitive = (options) => {
|
|
846
|
+
const Proto2 = makePrimitiveProto(options);
|
|
847
|
+
const PrimitiveImpl = function(value) {
|
|
848
|
+
this[args] = value;
|
|
849
|
+
};
|
|
850
|
+
PrimitiveImpl.prototype = Proto2;
|
|
851
|
+
return function(value) {
|
|
852
|
+
return new PrimitiveImpl(value);
|
|
853
|
+
};
|
|
854
|
+
};
|
|
855
|
+
var makeExit = (options) => {
|
|
856
|
+
const Proto2 = {
|
|
857
|
+
[ExitTypeId]: ExitTypeId,
|
|
858
|
+
_tag: options.op,
|
|
859
|
+
get [options.prop]() {
|
|
860
|
+
return this[args];
|
|
861
|
+
},
|
|
862
|
+
...makePrimitiveProto(options),
|
|
863
|
+
toString() {
|
|
864
|
+
return `${options.op}(${format(this[args])})`;
|
|
865
|
+
},
|
|
866
|
+
toJSON() {
|
|
867
|
+
return {
|
|
868
|
+
_id: "Exit",
|
|
869
|
+
_tag: options.op,
|
|
870
|
+
[options.prop]: this[args]
|
|
871
|
+
};
|
|
872
|
+
},
|
|
873
|
+
[symbol2](that) {
|
|
874
|
+
return isExit(that) && that._tag === this._tag && equals(this[args], that[args]);
|
|
875
|
+
},
|
|
876
|
+
[symbol]() {
|
|
877
|
+
return combine(string(options.op), hash(this[args]));
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
const ExitPrimitive = function(value) {
|
|
881
|
+
this[args] = value;
|
|
882
|
+
};
|
|
883
|
+
ExitPrimitive.prototype = Proto2;
|
|
884
|
+
return function(value) {
|
|
885
|
+
return new ExitPrimitive(value);
|
|
886
|
+
};
|
|
887
|
+
};
|
|
888
|
+
var exitSucceed = /* @__PURE__ */ makeExit({
|
|
889
|
+
op: "Success",
|
|
890
|
+
prop: "value",
|
|
891
|
+
[evaluate](fiber) {
|
|
892
|
+
const cont = fiber.getCont(contA);
|
|
893
|
+
return cont ? cont[contA](this[args], fiber, this) : fiber.yieldWith(this);
|
|
894
|
+
}
|
|
895
|
+
});
|
|
896
|
+
var StackTraceKey = {
|
|
897
|
+
key: "effect/Cause/StackTrace"
|
|
898
|
+
};
|
|
899
|
+
var exitFailCause = /* @__PURE__ */ makeExit({
|
|
900
|
+
op: "Failure",
|
|
901
|
+
prop: "cause",
|
|
902
|
+
[evaluate](fiber) {
|
|
903
|
+
let cause = this[args];
|
|
904
|
+
let annotated = false;
|
|
905
|
+
if (fiber.cache.stackFrame) {
|
|
906
|
+
cause = causeAnnotate(cause, {
|
|
907
|
+
mapUnsafe: /* @__PURE__ */ new Map([[StackTraceKey.key, fiber.cache.stackFrame]])
|
|
908
|
+
});
|
|
909
|
+
annotated = true;
|
|
910
|
+
}
|
|
911
|
+
let cont = fiber.getCont(contE);
|
|
912
|
+
const interruptedCause = fiber._interruptedCause;
|
|
913
|
+
if (interruptedCause && fiber.interruptible) {
|
|
914
|
+
let skippedHandler = false;
|
|
915
|
+
while (cont && fiber.interruptible) {
|
|
916
|
+
skippedHandler ||= identifier in cont;
|
|
917
|
+
cont = fiber.getCont(contE);
|
|
918
|
+
}
|
|
919
|
+
if (skippedHandler) {
|
|
920
|
+
cause = causeFromReasons(cause.reasons.filter((reason) => reason._tag !== "Fail"));
|
|
921
|
+
}
|
|
922
|
+
cause = causeAddInterrupts(cause, interruptedCause);
|
|
923
|
+
annotated = true;
|
|
924
|
+
}
|
|
925
|
+
return cont ? cont[contE](cause, fiber, annotated ? void 0 : this) : fiber.yieldWith(annotated ? exitFailCause(cause) : this);
|
|
926
|
+
}
|
|
927
|
+
});
|
|
928
|
+
var exitFail = (e) => exitFailCause(causeFail(e));
|
|
929
|
+
var exitDie = (defect) => exitFailCause(causeDie(defect));
|
|
930
|
+
var withFiber = /* @__PURE__ */ makePrimitive({
|
|
931
|
+
op: "WithFiber",
|
|
932
|
+
[evaluate](fiber) {
|
|
933
|
+
return this[args](fiber);
|
|
934
|
+
}
|
|
935
|
+
});
|
|
936
|
+
var withFiberSucceed = /* @__PURE__ */ makePrimitive({
|
|
937
|
+
op: "WithFiberSucceed",
|
|
938
|
+
[evaluate](fiber) {
|
|
939
|
+
const value = this[args](fiber);
|
|
940
|
+
const cont = fiber.getCont(contA);
|
|
941
|
+
return cont ? cont[contA](value, fiber) : fiber.yieldWith(exitSucceed(value));
|
|
942
|
+
}
|
|
943
|
+
});
|
|
944
|
+
var YieldableError = /* @__PURE__ */ (function() {
|
|
945
|
+
class YieldableError2 extends globalThis.Error {
|
|
946
|
+
}
|
|
947
|
+
const proto = /* @__PURE__ */ makePrimitiveProto({
|
|
948
|
+
op: "YieldableError",
|
|
949
|
+
[evaluate]() {
|
|
950
|
+
return exitFail(this);
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
delete proto.toString;
|
|
954
|
+
Object.assign(YieldableError2.prototype, proto);
|
|
955
|
+
return YieldableError2;
|
|
956
|
+
})();
|
|
957
|
+
var Error2 = /* @__PURE__ */ (function() {
|
|
958
|
+
const plainArgsSymbol = /* @__PURE__ */ Symbol.for("effect/Data/Error/plainArgs");
|
|
959
|
+
return class Base extends YieldableError {
|
|
960
|
+
constructor(args2) {
|
|
961
|
+
super(args2?.message, args2?.cause ? {
|
|
962
|
+
cause: args2.cause
|
|
963
|
+
} : void 0);
|
|
964
|
+
if (args2) {
|
|
965
|
+
assignProperties(this, args2);
|
|
966
|
+
Object.defineProperty(this, plainArgsSymbol, {
|
|
967
|
+
value: args2,
|
|
968
|
+
enumerable: false
|
|
969
|
+
});
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
toJSON() {
|
|
973
|
+
return {
|
|
974
|
+
...this[plainArgsSymbol],
|
|
975
|
+
...this
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
};
|
|
979
|
+
})();
|
|
980
|
+
var TaggedError = (tag) => {
|
|
981
|
+
class Base extends Error2 {
|
|
982
|
+
_tag = tag;
|
|
983
|
+
}
|
|
984
|
+
;
|
|
985
|
+
Base.prototype.name = tag;
|
|
986
|
+
return Base;
|
|
987
|
+
};
|
|
988
|
+
var NoSuchElementErrorTypeId = "~effect/Cause/NoSuchElementError";
|
|
989
|
+
var NoSuchElementError = class extends (/* @__PURE__ */ TaggedError("NoSuchElementError")) {
|
|
990
|
+
[NoSuchElementErrorTypeId] = NoSuchElementErrorTypeId;
|
|
991
|
+
constructor(message) {
|
|
992
|
+
super({
|
|
993
|
+
message
|
|
994
|
+
});
|
|
995
|
+
}
|
|
996
|
+
};
|
|
997
|
+
var DoneTypeId = "~effect/Cause/Done";
|
|
998
|
+
var DoneVoid = {
|
|
999
|
+
[DoneTypeId]: DoneTypeId,
|
|
1000
|
+
_tag: "Done",
|
|
1001
|
+
value: void 0
|
|
1002
|
+
};
|
|
1003
|
+
|
|
1004
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Effectable.js
|
|
1005
|
+
var Prototype = (options) => makePrimitiveProto({
|
|
1006
|
+
op: options.label,
|
|
1007
|
+
[evaluate]: options.evaluate
|
|
1008
|
+
});
|
|
1009
|
+
|
|
1010
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Context.js
|
|
1011
|
+
var ServiceTypeId = "~effect/Context/Service";
|
|
1012
|
+
var Service = function() {
|
|
1013
|
+
function KeyClass() {
|
|
1014
|
+
}
|
|
1015
|
+
const self = KeyClass;
|
|
1016
|
+
Object.setPrototypeOf(self, ServiceProto);
|
|
1017
|
+
const init = (key, options) => {
|
|
1018
|
+
self.key = key;
|
|
1019
|
+
if (options?.defaultValue) {
|
|
1020
|
+
self[ReferenceTypeId] = ReferenceTypeId;
|
|
1021
|
+
self.defaultValue = options.defaultValue;
|
|
1022
|
+
}
|
|
1023
|
+
if (options?.make) {
|
|
1024
|
+
;
|
|
1025
|
+
self.make = options.make;
|
|
1026
|
+
}
|
|
1027
|
+
if (options?.fiberCached) {
|
|
1028
|
+
cacheKeys.add(key);
|
|
1029
|
+
}
|
|
1030
|
+
return self;
|
|
1031
|
+
};
|
|
1032
|
+
return arguments.length > 0 ? init(arguments[0], arguments[1]) : init;
|
|
1033
|
+
};
|
|
1034
|
+
var ServiceProto = {
|
|
1035
|
+
[ServiceTypeId]: ServiceTypeId,
|
|
1036
|
+
.../* @__PURE__ */ Prototype({
|
|
1037
|
+
label: "Service",
|
|
1038
|
+
evaluate(fiber) {
|
|
1039
|
+
return exitSucceed(get(fiber.context, this));
|
|
1040
|
+
}
|
|
1041
|
+
}),
|
|
1042
|
+
toJSON() {
|
|
1043
|
+
return {
|
|
1044
|
+
_id: "Service",
|
|
1045
|
+
key: this.key
|
|
1046
|
+
};
|
|
1047
|
+
},
|
|
1048
|
+
of(self) {
|
|
1049
|
+
return self;
|
|
1050
|
+
},
|
|
1051
|
+
context(self) {
|
|
1052
|
+
return make(this, self);
|
|
1053
|
+
},
|
|
1054
|
+
use(f) {
|
|
1055
|
+
return withFiber((fiber) => f(get(fiber.context, this)));
|
|
1056
|
+
},
|
|
1057
|
+
useSync(f) {
|
|
1058
|
+
return withFiber((fiber) => exitSucceed(f(get(fiber.context, this))));
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
1061
|
+
var cacheKeys = /* @__PURE__ */ new Set();
|
|
1062
|
+
var ReferenceTypeId = "~effect/Context/Reference";
|
|
1063
|
+
var TypeId = "~effect/Context";
|
|
1064
|
+
var FlattenAfterBaseHits = 8;
|
|
1065
|
+
var makeImpl = (cacheRoot, base, overlay, depth, maxDepth) => {
|
|
1066
|
+
const self = Object.create(Proto);
|
|
1067
|
+
self.cacheRoot = cacheRoot ?? self;
|
|
1068
|
+
self.base = base;
|
|
1069
|
+
self.overlay = overlay;
|
|
1070
|
+
self.depth = depth;
|
|
1071
|
+
self._flat = void 0;
|
|
1072
|
+
self.baseHits = 0;
|
|
1073
|
+
self.maxDepth = maxDepth;
|
|
1074
|
+
return self;
|
|
1075
|
+
};
|
|
1076
|
+
var applyOverlays = (map, overlay) => {
|
|
1077
|
+
if (!overlay) return;
|
|
1078
|
+
applyOverlays(map, overlay.parent);
|
|
1079
|
+
map.set(overlay.key, overlay.value);
|
|
1080
|
+
};
|
|
1081
|
+
var flatten = (self) => {
|
|
1082
|
+
if (self._flat) return self._flat;
|
|
1083
|
+
if (!self.overlay) return self._flat = self.base;
|
|
1084
|
+
const map = new Map(self.base);
|
|
1085
|
+
applyOverlays(map, self.overlay);
|
|
1086
|
+
return self._flat = map;
|
|
1087
|
+
};
|
|
1088
|
+
var notFound = /* @__PURE__ */ Symbol();
|
|
1089
|
+
var lookup = (self, key) => {
|
|
1090
|
+
const impl = self;
|
|
1091
|
+
for (let overlay = impl.overlay; overlay; overlay = overlay.parent) {
|
|
1092
|
+
if (overlay.key === key) return overlay.value;
|
|
1093
|
+
}
|
|
1094
|
+
const value = impl.base.get(key);
|
|
1095
|
+
if (value === void 0 && !impl.base.has(key)) return notFound;
|
|
1096
|
+
if (impl.overlay && ++impl.baseHits >= impl.base.size && impl.baseHits >= FlattenAfterBaseHits) {
|
|
1097
|
+
impl.base = flatten(impl);
|
|
1098
|
+
impl.overlay = void 0;
|
|
1099
|
+
impl.depth = 0;
|
|
1100
|
+
}
|
|
1101
|
+
return value;
|
|
1102
|
+
};
|
|
1103
|
+
var makeUnsafe = (mapUnsafe, options) => {
|
|
1104
|
+
const maxDepth = options?.maxDepth;
|
|
1105
|
+
return makeImpl(void 0, mapUnsafe, void 0, 0, Number.isInteger(maxDepth) && maxDepth >= 0 ? maxDepth : 8);
|
|
1106
|
+
};
|
|
1107
|
+
var Proto = {
|
|
1108
|
+
get mapUnsafe() {
|
|
1109
|
+
return flatten(this);
|
|
1110
|
+
},
|
|
1111
|
+
...PipeInspectableProto,
|
|
1112
|
+
[TypeId]: {
|
|
1113
|
+
_Services: (_) => _
|
|
1114
|
+
},
|
|
1115
|
+
toJSON() {
|
|
1116
|
+
return {
|
|
1117
|
+
_id: "Context",
|
|
1118
|
+
services: Array.from(this.mapUnsafe).map(([key, value]) => ({
|
|
1119
|
+
key,
|
|
1120
|
+
value
|
|
1121
|
+
}))
|
|
1122
|
+
};
|
|
1123
|
+
},
|
|
1124
|
+
[symbol2](that) {
|
|
1125
|
+
if (!isContext(that)) return false;
|
|
1126
|
+
const self = this.mapUnsafe;
|
|
1127
|
+
const other = that.mapUnsafe;
|
|
1128
|
+
if (self.size !== other.size) return false;
|
|
1129
|
+
for (const [key, value] of self) {
|
|
1130
|
+
if (!other.has(key) || !equals(value, other.get(key))) return false;
|
|
1131
|
+
}
|
|
1132
|
+
return true;
|
|
1133
|
+
},
|
|
1134
|
+
[symbol]() {
|
|
1135
|
+
return number(this.mapUnsafe.size);
|
|
1136
|
+
}
|
|
1137
|
+
};
|
|
1138
|
+
var isContext = (u) => hasProperty(u, TypeId);
|
|
1139
|
+
var isReference = (u) => !!u[ReferenceTypeId];
|
|
1140
|
+
var make = (key, service) => makeUnsafe(/* @__PURE__ */ new Map([[key.key, service]]));
|
|
1141
|
+
var getUnsafe = /* @__PURE__ */ dual(2, (self, service) => {
|
|
1142
|
+
const value = lookup(self, service.key);
|
|
1143
|
+
if (value === notFound) {
|
|
1144
|
+
if (isReference(service)) return getDefaultValue(service);
|
|
1145
|
+
throw serviceNotFoundError(service);
|
|
1146
|
+
}
|
|
1147
|
+
return value;
|
|
1148
|
+
});
|
|
1149
|
+
var get = getUnsafe;
|
|
1150
|
+
var defaultValueCacheKey = "~effect/Context/defaultValue";
|
|
1151
|
+
var getDefaultValue = (ref) => {
|
|
1152
|
+
if (defaultValueCacheKey in ref) {
|
|
1153
|
+
return ref[defaultValueCacheKey];
|
|
1154
|
+
}
|
|
1155
|
+
return ref[defaultValueCacheKey] = ref.defaultValue();
|
|
1156
|
+
};
|
|
1157
|
+
var serviceNotFoundError = (service) => {
|
|
1158
|
+
const error = new Error(`Service not found${service.key ? `: ${String(service.key)}` : ""}`);
|
|
1159
|
+
if (error.stack) {
|
|
1160
|
+
const lines = error.stack.split("\n");
|
|
1161
|
+
lines.splice(1, 3);
|
|
1162
|
+
error.stack = lines.join("\n");
|
|
1163
|
+
}
|
|
1164
|
+
return error;
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
// ../cloudflare-dynamic-worker/src/project-protocol.ts
|
|
1168
|
+
var projectPolicy = Object.freeze({
|
|
1169
|
+
compatibilityDate: "2026-10-07",
|
|
1170
|
+
cpuMs: 50,
|
|
1171
|
+
subRequests: 0,
|
|
1172
|
+
maxModules: 16,
|
|
1173
|
+
maxSourceBytes: 64 * 1024,
|
|
1174
|
+
maxChecks: 16,
|
|
1175
|
+
maxResponseBytes: 4096,
|
|
1176
|
+
timeoutMs: 5e3
|
|
1177
|
+
});
|
|
1178
|
+
var encoder = new TextEncoder();
|
|
1179
|
+
var validModule = (path) => /^[a-zA-Z0-9_-]+(?:\/[a-zA-Z0-9_-]+)*\.js$/.test(path);
|
|
1180
|
+
function validateProject(request) {
|
|
1181
|
+
const entries = Object.entries(request.modules);
|
|
1182
|
+
if (!validModule(request.mainModule) || entries.length === 0 || entries.length > projectPolicy.maxModules || !Object.hasOwn(request.modules, request.mainModule)) throw new Error("Invalid project module manifest");
|
|
1183
|
+
let size = 0;
|
|
1184
|
+
const modules = /* @__PURE__ */ Object.create(null);
|
|
1185
|
+
for (const [path, source] of entries) {
|
|
1186
|
+
if (!validModule(path) || typeof source !== "string") throw new Error("Invalid project module manifest");
|
|
1187
|
+
size += encoder.encode(source).byteLength;
|
|
1188
|
+
if (size > projectPolicy.maxSourceBytes) throw new Error("Project source exceeds limit");
|
|
1189
|
+
modules[path] = source;
|
|
1190
|
+
}
|
|
1191
|
+
if (request.checks.length === 0 || request.checks.length > projectPolicy.maxChecks) throw new Error("Invalid project assertions");
|
|
1192
|
+
const names = /* @__PURE__ */ new Set();
|
|
1193
|
+
const checks = request.checks.map((check) => {
|
|
1194
|
+
if (!/^[a-zA-Z0-9 -]{1,64}$/.test(check.name) || names.has(check.name) || !/^\/[a-zA-Z0-9/_-]*$/.test(check.path) || !Number.isInteger(check.status) || check.status < 200 || check.status > 599 || typeof check.body !== "string" || encoder.encode(check.body).byteLength > projectPolicy.maxResponseBytes) throw new Error("Invalid project assertions");
|
|
1195
|
+
names.add(check.name);
|
|
1196
|
+
return { ...check };
|
|
1197
|
+
});
|
|
1198
|
+
return { mainModule: request.mainModule, modules, checks };
|
|
1199
|
+
}
|
|
1200
|
+
async function readBoundedText(response, maxBytes) {
|
|
1201
|
+
if (!response.body) return "";
|
|
1202
|
+
const reader = response.body.getReader(), chunks = [];
|
|
1203
|
+
let size = 0;
|
|
1204
|
+
try {
|
|
1205
|
+
while (true) {
|
|
1206
|
+
const { done, value } = await reader.read();
|
|
1207
|
+
if (done) break;
|
|
1208
|
+
size += value.byteLength;
|
|
1209
|
+
if (size > maxBytes) throw new Error("Response exceeds limit");
|
|
1210
|
+
chunks.push(value);
|
|
1211
|
+
}
|
|
1212
|
+
const bytes = new Uint8Array(size);
|
|
1213
|
+
let offset = 0;
|
|
1214
|
+
for (const chunk of chunks) {
|
|
1215
|
+
bytes.set(chunk, offset);
|
|
1216
|
+
offset += chunk.byteLength;
|
|
1217
|
+
}
|
|
1218
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
1219
|
+
} finally {
|
|
1220
|
+
await reader.cancel().catch(() => {
|
|
1221
|
+
});
|
|
1222
|
+
reader.releaseLock();
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
// ../cloudflare-dynamic-worker/src/project-service.ts
|
|
1227
|
+
var ProjectChecks = class extends Service()("@effect-ci-testbed/ProjectChecks") {
|
|
1228
|
+
};
|
|
1229
|
+
|
|
1230
|
+
// ../cloudflare-dynamic-worker/src/project-checks.ts
|
|
1231
|
+
async function runProjectChecks(loader, input) {
|
|
1232
|
+
const request = validateProject(input);
|
|
1233
|
+
const passed = [];
|
|
1234
|
+
for (const check of request.checks) {
|
|
1235
|
+
let timer;
|
|
1236
|
+
const abort = new AbortController();
|
|
1237
|
+
try {
|
|
1238
|
+
const child = loader.load({
|
|
1239
|
+
compatibilityDate: projectPolicy.compatibilityDate,
|
|
1240
|
+
compatibilityFlags: [],
|
|
1241
|
+
mainModule: request.mainModule,
|
|
1242
|
+
modules: request.modules,
|
|
1243
|
+
env: {},
|
|
1244
|
+
globalOutbound: null,
|
|
1245
|
+
limits: { cpuMs: projectPolicy.cpuMs, subRequests: projectPolicy.subRequests }
|
|
1246
|
+
}).getEntrypoint();
|
|
1247
|
+
await Promise.race([
|
|
1248
|
+
(async () => {
|
|
1249
|
+
const response = await child.fetch(new Request(`https://project.invalid${check.path}`, { signal: abort.signal }));
|
|
1250
|
+
const body = await readBoundedText(response, projectPolicy.maxResponseBytes);
|
|
1251
|
+
if (response.status !== check.status || body !== check.body) throw new Error("Assertion mismatch");
|
|
1252
|
+
})(),
|
|
1253
|
+
new Promise((_, reject) => {
|
|
1254
|
+
timer = setTimeout(() => {
|
|
1255
|
+
abort.abort();
|
|
1256
|
+
reject(new Error("Deadline exceeded"));
|
|
1257
|
+
}, projectPolicy.timeoutMs);
|
|
1258
|
+
})
|
|
1259
|
+
]);
|
|
1260
|
+
passed.push(check.name);
|
|
1261
|
+
} catch {
|
|
1262
|
+
throw new Error(`Project check failed: ${check.name}`);
|
|
1263
|
+
} finally {
|
|
1264
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
1265
|
+
abort.abort();
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
return { runtime: "dynamic-worker", passed, containers: 0 };
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
// ../cloudflare-dynamic-worker/src/local-bridge.ts
|
|
1272
|
+
var ready = {
|
|
1273
|
+
mainModule: "ready.js",
|
|
1274
|
+
modules: { "ready.js": "export default {fetch(){return new Response('ready')}}" },
|
|
1275
|
+
checks: [{ name: "runtime capability", path: "/", status: 200, body: "ready" }]
|
|
1276
|
+
};
|
|
1277
|
+
var local_bridge_default = { async fetch(request, env) {
|
|
1278
|
+
if (request.method === "GET" && new URL(request.url).pathname === "/ready") {
|
|
1279
|
+
try {
|
|
1280
|
+
await runProjectChecks(env.LOADER, ready);
|
|
1281
|
+
return new Response("ready");
|
|
1282
|
+
} catch {
|
|
1283
|
+
return new Response("Isolate unavailable", { status: 503 });
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
if (request.method !== "POST" || new URL(request.url).pathname !== "/check") return new Response("Not found", { status: 404 });
|
|
1287
|
+
try {
|
|
1288
|
+
return Response.json(await runProjectChecks(env.LOADER, await request.json()));
|
|
1289
|
+
} catch (error) {
|
|
1290
|
+
const message = error instanceof Error && /^Project check failed: [a-zA-Z0-9 -]{1,64}$/.test(error.message) ? error.message : "Isolated project assertions failed";
|
|
1291
|
+
return Response.json({ error: message }, { status: 422 });
|
|
1292
|
+
}
|
|
1293
|
+
} };
|
|
1294
|
+
export {
|
|
1295
|
+
local_bridge_default as default
|
|
1296
|
+
};
|