brass-runtime 1.18.1 → 1.19.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/CHANGELOG.md +65 -0
- package/dist/agent/cli/main.cjs +31 -31
- package/dist/agent/cli/main.js +3 -3
- package/dist/agent/cli/main.mjs +3 -3
- package/dist/agent/index.cjs +4 -4
- package/dist/agent/index.js +3 -3
- package/dist/agent/index.mjs +3 -3
- package/dist/{chunk-22HZQG5F.js → chunk-2R3RVNS2.js} +6 -6
- package/dist/{chunk-YWLLH27R.mjs → chunk-3NKXUX4T.mjs} +2 -2
- package/dist/{chunk-IPSMXUWA.js → chunk-4PKBNG2H.js} +38 -18
- package/dist/{chunk-Z3ZZMQUZ.mjs → chunk-5RVHSBJ6.mjs} +182 -34
- package/dist/{chunk-B5FKOLTB.mjs → chunk-5UBJT4RW.mjs} +4 -4
- package/dist/{chunk-5RZ7YITF.cjs → chunk-6STX4PS3.cjs} +13 -13
- package/dist/{chunk-XPIMJQYS.cjs → chunk-7FZUTJM3.cjs} +400 -252
- package/dist/{chunk-YZ5LQ32F.js → chunk-A6EG5WRL.js} +3 -3
- package/dist/{chunk-TTSPIU3U.js → chunk-APQBU7TM.js} +53 -32
- package/dist/{chunk-BC6Q6BCO.mjs → chunk-AQQQFNYD.mjs} +38 -18
- package/dist/{chunk-OW5VHAOE.js → chunk-B2VXVNIS.js} +1 -1
- package/dist/{chunk-WCBNXPN6.mjs → chunk-BLXBZ6RE.mjs} +1 -1
- package/dist/{chunk-7VQLEN37.js → chunk-C3CWI42G.js} +1 -1
- package/dist/{chunk-WI7GZF3B.cjs → chunk-DV644N7P.cjs} +85 -85
- package/dist/{chunk-RBHNOKH4.mjs → chunk-EKLEDIVJ.mjs} +2 -2
- package/dist/{chunk-S4HXADU4.js → chunk-EXBGIC66.js} +1 -1
- package/dist/{chunk-LSYQ3C2M.js → chunk-FC5N5QHJ.js} +2 -2
- package/dist/{chunk-6MLAZPBL.mjs → chunk-FNWOH2T2.js} +18 -6
- package/dist/{chunk-WGE2FEZE.cjs → chunk-FYWWU3Z7.cjs} +2 -2
- package/dist/{chunk-2OW6IFY2.cjs → chunk-GOEO763K.cjs} +21 -21
- package/dist/{chunk-UAKAF32U.js → chunk-GXOIUBKE.js} +2 -2
- package/dist/{chunk-7DU7IQHK.js → chunk-H4ZRUQZL.js} +4 -4
- package/dist/{chunk-JWIEMBE6.mjs → chunk-HW2CLRJ3.mjs} +6 -6
- package/dist/{chunk-YGR2IN4R.js → chunk-JWFOWPMB.js} +163 -155
- package/dist/{chunk-6V2AWT4R.mjs → chunk-KAPZHDO4.mjs} +1 -1
- package/dist/{chunk-EEN5OTCR.mjs → chunk-KDXNWGPB.mjs} +1 -1
- package/dist/{chunk-UUMKZJRJ.cjs → chunk-KPOL2YEO.cjs} +18 -6
- package/dist/{chunk-J6DUHITE.cjs → chunk-MA74OYCI.cjs} +6 -6
- package/dist/{chunk-H626ZTDZ.mjs → chunk-MUMBUXU6.mjs} +53 -32
- package/dist/{chunk-5LC7V2OZ.cjs → chunk-NQW3YUFN.cjs} +18 -18
- package/dist/{chunk-EICAJDNX.cjs → chunk-OO7BGCC3.cjs} +54 -34
- package/dist/{chunk-7GBJYOX7.mjs → chunk-OX6MF7SZ.mjs} +163 -155
- package/dist/{chunk-WVSZOPGQ.cjs → chunk-QBVS3UYN.cjs} +245 -237
- package/dist/{chunk-WUDHOZIH.js → chunk-RZGB3DXR.js} +182 -34
- package/dist/{chunk-COOW7BJX.mjs → chunk-URVS2OE2.mjs} +3 -3
- package/dist/{chunk-HCJ4S3YB.js → chunk-UZQ3BB6W.mjs} +18 -6
- package/dist/{chunk-KNTJ7FQB.cjs → chunk-YQWZ7FZX.cjs} +5 -5
- package/dist/{chunk-ELIECDYN.cjs → chunk-Z2YIDHRI.cjs} +5 -5
- package/dist/{chunk-2JHJ4YHS.cjs → chunk-ZDZNV6NA.cjs} +59 -38
- package/dist/core/index.cjs +8 -8
- package/dist/core/index.js +7 -7
- package/dist/core/index.mjs +7 -7
- package/dist/http/index.cjs +54 -54
- package/dist/http/index.js +7 -7
- package/dist/http/index.mjs +7 -7
- package/dist/http/testing.cjs +9 -9
- package/dist/http/testing.js +5 -5
- package/dist/http/testing.mjs +5 -5
- package/dist/index.cjs +86 -86
- package/dist/index.js +8 -8
- package/dist/index.mjs +8 -8
- package/dist/observability/index.cjs +10 -10
- package/dist/observability/index.js +9 -9
- package/dist/observability/index.mjs +9 -9
- package/dist/perf/cli.cjs +26 -26
- package/dist/perf/cli.js +11 -11
- package/dist/perf/cli.mjs +11 -11
- package/dist/perf/index.cjs +13 -13
- package/dist/perf/index.js +11 -11
- package/dist/perf/index.mjs +11 -11
- package/dist/schema/index.cjs +2 -2
- package/dist/schema/index.js +1 -1
- package/dist/schema/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -237,7 +237,14 @@ function arraySchema(item) {
|
|
|
237
237
|
function objectSchema(shape, options = {}) {
|
|
238
238
|
const unknownKeys = options.unknownKeys ?? "strip";
|
|
239
239
|
const shapeEntries = Object.entries(shape);
|
|
240
|
-
const
|
|
240
|
+
const fieldKeys = new Array(shapeEntries.length);
|
|
241
|
+
const fieldSchemas = new Array(shapeEntries.length);
|
|
242
|
+
for (let i = 0; i < shapeEntries.length; i++) {
|
|
243
|
+
fieldKeys[i] = shapeEntries[i][0];
|
|
244
|
+
fieldSchemas[i] = shapeEntries[i][1];
|
|
245
|
+
}
|
|
246
|
+
const fieldCount = fieldKeys.length;
|
|
247
|
+
const knownKeys = unknownKeys === "strict" ? new Set(fieldKeys) : void 0;
|
|
241
248
|
return makeSchema("object", false, (input, path) => {
|
|
242
249
|
if (typeof input !== "object" || input === null || Array.isArray(input)) {
|
|
243
250
|
return fail([makeSchemaIssue(path, options.name ?? "object", input)]);
|
|
@@ -246,11 +253,13 @@ function objectSchema(shape, options = {}) {
|
|
|
246
253
|
const out = unknownKeys === "passthrough" ? { ...source } : {};
|
|
247
254
|
const childPath = path.length === 0 ? [] : [...path];
|
|
248
255
|
let issues;
|
|
249
|
-
for (
|
|
256
|
+
for (let i = 0; i < fieldCount; i++) {
|
|
257
|
+
const key = fieldKeys[i];
|
|
258
|
+
const fieldSchema = fieldSchemas[i];
|
|
250
259
|
childPath.push(key);
|
|
251
260
|
if (!(key in source)) {
|
|
252
261
|
if (!fieldSchema.isOptional) {
|
|
253
|
-
issues
|
|
262
|
+
if (!issues) issues = [];
|
|
254
263
|
issues.push(makeSchemaIssue(childPath, fieldSchema.name ?? fieldSchema.kind, void 0, "Required field is missing"));
|
|
255
264
|
}
|
|
256
265
|
childPath.pop();
|
|
@@ -261,15 +270,18 @@ function objectSchema(shape, options = {}) {
|
|
|
261
270
|
if (result.success) {
|
|
262
271
|
out[key] = result.data;
|
|
263
272
|
} else {
|
|
264
|
-
issues
|
|
265
|
-
|
|
273
|
+
if (!issues) issues = [];
|
|
274
|
+
const resultIssues = result.issues;
|
|
275
|
+
for (let j = 0; j < resultIssues.length; j++) {
|
|
276
|
+
issues.push(resultIssues[j]);
|
|
277
|
+
}
|
|
266
278
|
}
|
|
267
279
|
}
|
|
268
280
|
if (knownKeys) {
|
|
269
281
|
for (const key of Object.keys(source)) {
|
|
270
282
|
if (!knownKeys.has(key)) {
|
|
271
283
|
childPath.push(key);
|
|
272
|
-
issues
|
|
284
|
+
if (!issues) issues = [];
|
|
273
285
|
issues.push(makeSchemaIssue(childPath, "known key", source[key], "Unknown key is not allowed"));
|
|
274
286
|
childPath.pop();
|
|
275
287
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkZDZNV6NAcjs = require('./chunk-ZDZNV6NA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkMVGUEJ5Zcjs = require('./chunk-MVGUEJ5Z.cjs');
|
|
@@ -164,7 +164,7 @@ var EventBus = (_class = class {
|
|
|
164
164
|
subscribe(handler, perSubscriberCapacity = 2048) {
|
|
165
165
|
this.subs.push({
|
|
166
166
|
handler,
|
|
167
|
-
q:
|
|
167
|
+
q: _chunkZDZNV6NAcjs.makeBoundedRingBuffer.call(void 0, perSubscriberCapacity, perSubscriberCapacity, this.options),
|
|
168
168
|
dropped: 0
|
|
169
169
|
});
|
|
170
170
|
return () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkFYWWU3Z7cjs = require('./chunk-FYWWU3Z7.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk6STX4PS3cjs = require('./chunk-6STX4PS3.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ var _chunk5RZ7YITFcjs = require('./chunk-5RZ7YITF.cjs');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkZDZNV6NAcjs = require('./chunk-ZDZNV6NA.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -26,7 +26,7 @@ var _chunk2JHJ4YHScjs = require('./chunk-2JHJ4YHS.cjs');
|
|
|
26
26
|
var _chunkMVGUEJ5Zcjs = require('./chunk-MVGUEJ5Z.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _chunkKPOL2YEOcjs = require('./chunk-KPOL2YEO.cjs');
|
|
30
30
|
|
|
31
31
|
// src/core/types/cancel.ts
|
|
32
32
|
function makeCancelToken() {
|
|
@@ -63,19 +63,19 @@ function linkAbortController(token, ac) {
|
|
|
63
63
|
|
|
64
64
|
// src/core/runtime/dx.ts
|
|
65
65
|
function makeRuntime(env = {}, options = {}) {
|
|
66
|
-
return new (0,
|
|
66
|
+
return new (0, _chunkZDZNV6NAcjs.Runtime)({ ...options, env });
|
|
67
67
|
}
|
|
68
68
|
function runPromise(effect, envOrRuntime) {
|
|
69
|
-
if (envOrRuntime instanceof
|
|
70
|
-
return
|
|
69
|
+
if (envOrRuntime instanceof _chunkZDZNV6NAcjs.Runtime) return envOrRuntime.toPromise(effect);
|
|
70
|
+
return _chunkZDZNV6NAcjs.toPromise.call(void 0, effect, envOrRuntime);
|
|
71
71
|
}
|
|
72
72
|
function runExit(effect, envOrRuntime) {
|
|
73
73
|
return new Promise((resolve) => {
|
|
74
|
-
if (envOrRuntime instanceof
|
|
74
|
+
if (envOrRuntime instanceof _chunkZDZNV6NAcjs.Runtime) {
|
|
75
75
|
envOrRuntime.unsafeRunAsync(effect, resolve);
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
_chunkZDZNV6NAcjs.unsafeRunAsync.call(void 0, effect, envOrRuntime, resolve);
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
var runEffect = runPromise;
|
|
@@ -162,7 +162,7 @@ function makeSemaphore(n) {
|
|
|
162
162
|
released = true;
|
|
163
163
|
release();
|
|
164
164
|
};
|
|
165
|
-
const fiber =
|
|
165
|
+
const fiber = _chunkZDZNV6NAcjs.getCurrentFiber.call(void 0, );
|
|
166
166
|
_optionalChain([fiber, 'optionalAccess', _2 => _2.addFinalizer, 'call', _3 => _3(() => {
|
|
167
167
|
releaseOnce();
|
|
168
168
|
})]);
|
|
@@ -496,7 +496,7 @@ function makeTestRuntime(env, options = {}) {
|
|
|
496
496
|
const scheduler = new TestScheduler(options);
|
|
497
497
|
const clock = new TestClock(options.initialTimeMs, () => scheduler.flushAll(options.maxSteps), options.maxSteps);
|
|
498
498
|
const testEnv = withTestClock(_nullishCoalesce(env, () => ( {})), clock);
|
|
499
|
-
const runtime =
|
|
499
|
+
const runtime = _chunkZDZNV6NAcjs.Runtime.makeWithEngine(testEnv, "ts", { scheduler });
|
|
500
500
|
const flush = (maxTasks) => scheduler.flush(maxTasks);
|
|
501
501
|
const flushAll = (maxSteps) => scheduler.flushAll(maxSteps);
|
|
502
502
|
const advance = (ms) => clock.advance(ms);
|
|
@@ -567,7 +567,7 @@ function firstFailureValue(exit) {
|
|
|
567
567
|
return failure._tag === "Some" ? failure.value : void 0;
|
|
568
568
|
}
|
|
569
569
|
function makeAssertionRuntime(runtime) {
|
|
570
|
-
return _nullishCoalesce(runtime, () => (
|
|
570
|
+
return _nullishCoalesce(runtime, () => ( _chunkZDZNV6NAcjs.Runtime.make({})));
|
|
571
571
|
}
|
|
572
572
|
async function assertSucceeds(effect, expected, runtime) {
|
|
573
573
|
const rt = makeAssertionRuntime(runtime);
|
|
@@ -603,9 +603,9 @@ async function assertFailsWith(effect, predicate, runtime) {
|
|
|
603
603
|
}
|
|
604
604
|
async function assertCompletesWithin(effect, maxMs, runtime) {
|
|
605
605
|
const rt = makeAssertionRuntime(runtime);
|
|
606
|
-
const start =
|
|
606
|
+
const start = _chunkZDZNV6NAcjs.runtimeClockFromEnv.call(void 0, rt.env).now();
|
|
607
607
|
const result = await rt.toPromise(effect);
|
|
608
|
-
const elapsed =
|
|
608
|
+
const elapsed = _chunkZDZNV6NAcjs.runtimeClockFromEnv.call(void 0, rt.env).now() - start;
|
|
609
609
|
if (elapsed > maxMs) {
|
|
610
610
|
throw new Error(`Effect took ${elapsed.toFixed(1)}ms, expected < ${maxMs}ms`);
|
|
611
611
|
}
|
|
@@ -624,7 +624,7 @@ function flakyEffect(failCount, successValue, errorValue) {
|
|
|
624
624
|
}
|
|
625
625
|
function delayedEffect(ms, value) {
|
|
626
626
|
return _chunkMVGUEJ5Zcjs.asyncEffect.call(void 0, (env, cb) => {
|
|
627
|
-
const clock =
|
|
627
|
+
const clock = _chunkZDZNV6NAcjs.runtimeClockFromEnv.call(void 0, env);
|
|
628
628
|
const id = clock.setTimeout(() => cb(_chunkMVGUEJ5Zcjs.Exit.succeed(value)), ms);
|
|
629
629
|
return () => clock.clearTimeout(id);
|
|
630
630
|
});
|
|
@@ -638,10 +638,10 @@ function neverEffect() {
|
|
|
638
638
|
|
|
639
639
|
// src/core/runtime/configLayer.ts
|
|
640
640
|
function makeConfigLayer(tag, schema, source, options = {}) {
|
|
641
|
-
return
|
|
641
|
+
return _chunk6STX4PS3cjs.layerEffect.call(void 0,
|
|
642
642
|
tag,
|
|
643
643
|
(context) => _chunkMVGUEJ5Zcjs.asyncSync.call(void 0,
|
|
644
|
-
() =>
|
|
644
|
+
() => _chunkKPOL2YEOcjs.parseConfig.call(void 0, _nullishCoalesce(options.name, () => ( tag.name)), schema, readConfigSource(source, context))
|
|
645
645
|
)
|
|
646
646
|
);
|
|
647
647
|
}
|
|
@@ -829,7 +829,7 @@ var RuntimeRegistry = (_class4 = class {constructor() { _class4.prototype.__init
|
|
|
829
829
|
__init18() {this.recent = []}
|
|
830
830
|
__init19() {this.recentCap = 2e3}
|
|
831
831
|
emit(ev, ctx) {
|
|
832
|
-
const rec =
|
|
832
|
+
const rec = _chunkFYWWU3Z7cjs.makeRuntimeEventRecord.call(void 0, ev, ctx, this.seq++);
|
|
833
833
|
this.recent.push(rec);
|
|
834
834
|
if (this.recent.length > this.recentCap) this.recent.shift();
|
|
835
835
|
switch (rec.type) {
|
|
@@ -1174,7 +1174,7 @@ var Supervisor = (_class5 = class {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
record.restartTimes.push(now);
|
|
1176
1176
|
if (record.restart.schedule) {
|
|
1177
|
-
record.scheduleDriver ??=
|
|
1177
|
+
record.scheduleDriver ??= _chunk6STX4PS3cjs.makeScheduleDriver.call(void 0, record.restart.schedule, {
|
|
1178
1178
|
name: _nullishCoalesce(record.restart.schedule.name, () => ( "supervisor.restart")),
|
|
1179
1179
|
clock: this.scheduleClock()
|
|
1180
1180
|
});
|
|
@@ -1224,8 +1224,8 @@ var Supervisor = (_class5 = class {
|
|
|
1224
1224
|
scheduleClock() {
|
|
1225
1225
|
return {
|
|
1226
1226
|
now: this.clock,
|
|
1227
|
-
setTimeout:
|
|
1228
|
-
clearTimeout:
|
|
1227
|
+
setTimeout: _chunkZDZNV6NAcjs.liveClock.setTimeout,
|
|
1228
|
+
clearTimeout: _chunkZDZNV6NAcjs.liveClock.clearTimeout
|
|
1229
1229
|
};
|
|
1230
1230
|
}
|
|
1231
1231
|
}, _class5);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeRuntimeEventRecord
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-B2VXVNIS.js";
|
|
4
4
|
import {
|
|
5
5
|
layerEffect,
|
|
6
6
|
makeScheduleDriver
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EXBGIC66.js";
|
|
8
8
|
import {
|
|
9
9
|
Runtime,
|
|
10
10
|
getCurrentFiber,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
runtimeClockFromEnv,
|
|
13
13
|
toPromise,
|
|
14
14
|
unsafeRunAsync
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-APQBU7TM.js";
|
|
16
16
|
import {
|
|
17
17
|
Cause,
|
|
18
18
|
Exit,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "./chunk-UB4B6OFY.js";
|
|
27
27
|
import {
|
|
28
28
|
parseConfig
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-FNWOH2T2.js";
|
|
30
30
|
|
|
31
31
|
// src/core/types/cancel.ts
|
|
32
32
|
function makeCancelToken() {
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeFiberRef,
|
|
3
3
|
makeRuntimeRecorder
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EKLEDIVJ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
withHttpObservability
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OX6MF7SZ.mjs";
|
|
8
8
|
import {
|
|
9
9
|
makeObservability
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-URVS2OE2.mjs";
|
|
11
11
|
import {
|
|
12
12
|
EventBus
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KAPZHDO4.mjs";
|
|
14
14
|
import {
|
|
15
15
|
makeDefaultHttpClient,
|
|
16
16
|
makeHttp
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5RVHSBJ6.mjs";
|
|
18
18
|
import {
|
|
19
19
|
Runtime,
|
|
20
20
|
Scheduler
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-MUMBUXU6.mjs";
|
|
22
22
|
import {
|
|
23
23
|
asyncFlatMap,
|
|
24
24
|
asyncSucceed,
|