brass-runtime 1.19.0 → 1.19.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/dist/agent/cli/main.cjs +30 -30
- package/dist/agent/cli/main.js +2 -2
- package/dist/agent/cli/main.mjs +2 -2
- package/dist/agent/index.cjs +3 -3
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +2 -2
- package/dist/agent/index.mjs +2 -2
- package/dist/{chunk-HW2CLRJ3.mjs → chunk-22HYIE56.mjs} +6 -6
- package/dist/{chunk-GOEO763K.cjs → chunk-2XXQ3NVT.cjs} +19 -19
- package/dist/{chunk-QBVS3UYN.cjs → chunk-67256TKF.cjs} +54 -54
- package/dist/{chunk-BLXBZ6RE.mjs → chunk-6BNZS2A4.mjs} +1 -1
- package/dist/{chunk-EXBGIC66.js → chunk-6W5DC3TX.js} +1 -1
- package/dist/{chunk-OX6MF7SZ.mjs → chunk-AITYRQX2.mjs} +5 -5
- package/dist/{chunk-MUMBUXU6.mjs → chunk-BFNBU47C.mjs} +22 -6
- package/dist/{chunk-OO7BGCC3.cjs → chunk-CXWJII2N.cjs} +13 -13
- package/dist/{chunk-Z2YIDHRI.cjs → chunk-ENMKEX3N.cjs} +5 -5
- package/dist/{chunk-NQW3YUFN.cjs → chunk-EZ76UNHP.cjs} +18 -18
- package/dist/{chunk-5RVHSBJ6.mjs → chunk-ID2WOCBA.mjs} +3 -3
- package/dist/{chunk-RZGB3DXR.js → chunk-IHXF6NQG.js} +3 -3
- package/dist/{chunk-MA74OYCI.cjs → chunk-IHY2EJTT.cjs} +6 -6
- package/dist/{chunk-AQQQFNYD.mjs → chunk-IWAQQDYE.mjs} +1 -1
- package/dist/{chunk-C3CWI42G.js → chunk-J4F5KC3U.js} +1 -1
- package/dist/{chunk-ZDZNV6NA.cjs → chunk-JKHBEWQA.cjs} +23 -7
- package/dist/{chunk-5UBJT4RW.mjs → chunk-JM7WMSRR.mjs} +3 -3
- package/dist/{chunk-YQWZ7FZX.cjs → chunk-JQCQWO47.cjs} +5 -5
- package/dist/{chunk-B2VXVNIS.js → chunk-LI7WUVJN.js} +1 -1
- package/dist/{chunk-7FZUTJM3.cjs → chunk-LXNU3MRV.cjs} +14 -14
- package/dist/{chunk-FC5N5QHJ.js → chunk-NWONRWBT.js} +2 -2
- package/dist/{chunk-H4ZRUQZL.js → chunk-PG6CHG34.js} +3 -3
- package/dist/{chunk-GXOIUBKE.js → chunk-RZQK32C6.js} +2 -2
- package/dist/{chunk-EKLEDIVJ.mjs → chunk-S6KSHYAT.mjs} +2 -2
- package/dist/{chunk-URVS2OE2.mjs → chunk-SCHM2MDA.mjs} +2 -2
- package/dist/{chunk-A6EG5WRL.js → chunk-TAPB4NN5.js} +2 -2
- package/dist/{chunk-APQBU7TM.js → chunk-TN2P7RNK.js} +22 -6
- package/dist/{chunk-2R3RVNS2.js → chunk-U42YF6B2.js} +6 -6
- package/dist/{chunk-FYWWU3Z7.cjs → chunk-VXNWVAIG.cjs} +2 -2
- package/dist/{chunk-KAPZHDO4.mjs → chunk-WA65XP2P.mjs} +1 -1
- package/dist/{chunk-JWFOWPMB.js → chunk-XJSWDU2S.js} +5 -5
- package/dist/{chunk-4PKBNG2H.js → chunk-XO3TDAJE.js} +1 -1
- package/dist/{chunk-KDXNWGPB.mjs → chunk-XRRC5BBM.mjs} +1 -1
- package/dist/{chunk-DV644N7P.cjs → chunk-ZJC3JZIE.cjs} +16 -16
- package/dist/{chunk-3NKXUX4T.mjs → chunk-ZXLETUGQ.mjs} +2 -2
- package/dist/{chunk-6STX4PS3.cjs → chunk-ZZ2CMYJL.cjs} +13 -13
- package/dist/core/index.cjs +9 -7
- package/dist/core/index.d.ts +6 -6
- package/dist/core/index.js +8 -6
- package/dist/core/index.mjs +8 -6
- package/dist/{defaultClient-Cid0JoUR.d.ts → defaultClient-hyVSNzSJ.d.ts} +3 -3
- package/dist/{effect-DnGUuhw6.d.ts → effect-DbEMiMvv.d.ts} +8 -1
- package/dist/http/index.cjs +48 -48
- package/dist/http/index.d.ts +8 -8
- package/dist/http/index.js +6 -6
- package/dist/http/index.mjs +6 -6
- package/dist/http/testing.cjs +8 -8
- package/dist/http/testing.d.ts +4 -4
- package/dist/http/testing.js +4 -4
- package/dist/http/testing.mjs +4 -4
- package/dist/index.cjs +87 -85
- package/dist/index.d.ts +7 -7
- package/dist/index.js +9 -7
- package/dist/index.mjs +9 -7
- package/dist/{layer-D2LFcBVx.d.ts → layer-CsNGeVee.d.ts} +1 -1
- package/dist/observability/index.cjs +9 -9
- package/dist/observability/index.d.ts +7 -7
- package/dist/observability/index.js +8 -8
- package/dist/observability/index.mjs +8 -8
- package/dist/perf/cli.cjs +25 -25
- package/dist/perf/cli.js +10 -10
- package/dist/perf/cli.mjs +10 -10
- package/dist/perf/index.cjs +12 -12
- package/dist/perf/index.js +10 -10
- package/dist/perf/index.mjs +10 -10
- package/dist/{server-Bf1zNYZk.d.ts → server-BKKuzAW9.d.ts} +4 -4
- package/dist/{stream-I7bkvF7a.d.ts → stream-B8c_UKZq.d.ts} +1 -1
- package/dist/{tracer-DF83nLn6.d.ts → tracer-CS3yOXZx.d.ts} +2 -2
- package/dist/{tracing-CWV4gT0u.d.ts → tracing-DIAUf2x8.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkJQCQWO47cjs = require('./chunk-JQCQWO47.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk67256TKFcjs = require('./chunk-67256TKF.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkZJC3JZIEcjs = require('./chunk-ZJC3JZIE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkVXNWVAIGcjs = require('./chunk-VXNWVAIG.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkLXNU3MRVcjs = require('./chunk-LXNU3MRV.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkJKHBEWQAcjs = require('./chunk-JKHBEWQA.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -299,10 +299,10 @@ function makeRuntimeCase(variant, chainDepth) {
|
|
|
299
299
|
maxCapacity: 8192,
|
|
300
300
|
flushBudget: 2048
|
|
301
301
|
};
|
|
302
|
-
const scheduler = variant === "wide-scheduler" ? new (0,
|
|
303
|
-
const recorder = variant === "recorder" ?
|
|
304
|
-
const hooks = _nullishCoalesce(_optionalChain([recorder, 'optionalAccess', _8 => _8.hooks]), () => ( (variant === "active-hooks" ? new (0,
|
|
305
|
-
const runtime =
|
|
302
|
+
const scheduler = variant === "wide-scheduler" ? new (0, _chunkJKHBEWQAcjs.Scheduler)(schedulerConfig) : void 0;
|
|
303
|
+
const recorder = variant === "recorder" ? _chunkJQCQWO47cjs.makeRuntimeRecorder.call(void 0, { maxEvents: 1e4 }) : void 0;
|
|
304
|
+
const hooks = _nullishCoalesce(_optionalChain([recorder, 'optionalAccess', _8 => _8.hooks]), () => ( (variant === "active-hooks" ? new (0, _chunkVXNWVAIGcjs.EventBus)() : void 0)));
|
|
305
|
+
const runtime = _chunkJKHBEWQAcjs.Runtime.makeWithEngine(hooks ? {} : {}, "ts", {
|
|
306
306
|
hooks,
|
|
307
307
|
...scheduler ? { scheduler } : {},
|
|
308
308
|
inferLane: false
|
|
@@ -349,7 +349,7 @@ function makeFlatMapChain(depth) {
|
|
|
349
349
|
return effect;
|
|
350
350
|
}
|
|
351
351
|
function makeFiberRefProgram(depth) {
|
|
352
|
-
const ref =
|
|
352
|
+
const ref = _chunkJQCQWO47cjs.makeFiberRef.call(void 0, 0);
|
|
353
353
|
let effect = ref.set(0);
|
|
354
354
|
for (let i = 0; i < depth; i++) {
|
|
355
355
|
effect = _chunkMVGUEJ5Zcjs.asyncFlatMap.call(void 0, effect, () => ref.update((n) => n + 1));
|
|
@@ -651,7 +651,7 @@ async function profileHttpLayers(options = {}) {
|
|
|
651
651
|
}
|
|
652
652
|
async function runScenario(scenario) {
|
|
653
653
|
const server = await startDummyServer(scenario.delayMs);
|
|
654
|
-
const observability = scenario.variant === "default-json-observed" ?
|
|
654
|
+
const observability = scenario.variant === "default-json-observed" ? _chunkZJC3JZIEcjs.makeObservability.call(void 0, {
|
|
655
655
|
logs: false,
|
|
656
656
|
traces: { maxFinishedSpans: 1e4 },
|
|
657
657
|
autoStart: false
|
|
@@ -838,9 +838,9 @@ function makeDefaultJsonRunner(server, scenario, preset, disableAdaptiveLimiter
|
|
|
838
838
|
}
|
|
839
839
|
function makeProfileRuntime(concurrency, observability) {
|
|
840
840
|
const capacity = Math.max(65536, concurrency * 8);
|
|
841
|
-
return
|
|
841
|
+
return _chunkJKHBEWQAcjs.Runtime.makeWithEngine(_nullishCoalesce(_optionalChain([observability, 'optionalAccess', _30 => _30.env]), () => ( {})), "ts", {
|
|
842
842
|
hooks: _optionalChain([observability, 'optionalAccess', _31 => _31.hooks]),
|
|
843
|
-
scheduler: new (0,
|
|
843
|
+
scheduler: new (0, _chunkJKHBEWQAcjs.Scheduler)({
|
|
844
844
|
laneMode: "single",
|
|
845
845
|
initialCapacity: capacity,
|
|
846
846
|
maxCapacity: capacity,
|
|
@@ -862,24 +862,24 @@ function baseHttpConfig(baseUrl, scenario) {
|
|
|
862
862
|
};
|
|
863
863
|
}
|
|
864
864
|
function makeWireClient(baseUrl, scenario) {
|
|
865
|
-
return
|
|
865
|
+
return _chunkLXNU3MRVcjs.makeHttp.call(void 0, baseHttpConfig(baseUrl, scenario));
|
|
866
866
|
}
|
|
867
867
|
function makeMinimalClient(baseUrl, scenario) {
|
|
868
|
-
return
|
|
868
|
+
return _chunkLXNU3MRVcjs.makeDefaultHttpClient.call(void 0, {
|
|
869
869
|
preset: "minimal",
|
|
870
870
|
compression: false,
|
|
871
871
|
...baseHttpConfig(baseUrl, scenario)
|
|
872
872
|
});
|
|
873
873
|
}
|
|
874
874
|
function makeDefaultClient(baseUrl, scenario, preset, disableAdaptiveLimiter, observability) {
|
|
875
|
-
return
|
|
875
|
+
return _chunkLXNU3MRVcjs.makeDefaultHttpClient.call(void 0, {
|
|
876
876
|
preset,
|
|
877
877
|
compression: false,
|
|
878
878
|
...baseHttpConfig(baseUrl, scenario),
|
|
879
879
|
...disableAdaptiveLimiter ? { adaptiveLimiter: false } : {},
|
|
880
880
|
...observability ? {
|
|
881
881
|
middleware: [
|
|
882
|
-
|
|
882
|
+
_chunk67256TKFcjs.withHttpObservability.call(void 0, {
|
|
883
883
|
metrics: observability.metrics,
|
|
884
884
|
logs: false,
|
|
885
885
|
spans: {},
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
} from "./chunk-MOO4L7F4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
streamFromReadableStream
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IWAQQDYE.mjs";
|
|
7
7
|
import {
|
|
8
8
|
layerEffect,
|
|
9
9
|
makeScheduleDriver,
|
|
10
10
|
makeServiceTag,
|
|
11
11
|
sleep
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-XRRC5BBM.mjs";
|
|
13
13
|
import {
|
|
14
14
|
fromPromiseAbortable,
|
|
15
15
|
resolveWasmModule,
|
|
16
16
|
toPromise
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-BFNBU47C.mjs";
|
|
18
18
|
import {
|
|
19
19
|
Cause,
|
|
20
20
|
asyncEffect,
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
} from "./chunk-TRM4JUZQ.js";
|
|
4
4
|
import {
|
|
5
5
|
streamFromReadableStream
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XO3TDAJE.js";
|
|
7
7
|
import {
|
|
8
8
|
layerEffect,
|
|
9
9
|
makeScheduleDriver,
|
|
10
10
|
makeServiceTag,
|
|
11
11
|
sleep
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6W5DC3TX.js";
|
|
13
13
|
import {
|
|
14
14
|
fromPromiseAbortable,
|
|
15
15
|
resolveWasmModule,
|
|
16
16
|
toPromise
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TN2P7RNK.js";
|
|
18
18
|
import {
|
|
19
19
|
Cause,
|
|
20
20
|
asyncEffect,
|
|
@@ -4,7 +4,7 @@ var _chunkSA6HUJVIcjs = require('./chunk-SA6HUJVI.cjs');
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkJKHBEWQAcjs = require('./chunk-JKHBEWQA.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -1914,7 +1914,7 @@ var runLoop = (state, scope, runStartedAt) => {
|
|
|
1914
1914
|
})
|
|
1915
1915
|
);
|
|
1916
1916
|
};
|
|
1917
|
-
var runAgent = (runtime, goal) =>
|
|
1917
|
+
var runAgent = (runtime, goal) => _chunkJKHBEWQAcjs.withScopeAsync.call(void 0,
|
|
1918
1918
|
runtime,
|
|
1919
1919
|
(scope) => _chunkMVGUEJ5Zcjs.asyncFlatMap.call(void 0,
|
|
1920
1920
|
nowMillis(),
|
|
@@ -2219,14 +2219,14 @@ var parseRipgrep = (stdout) => stdout.split("\n").filter(Boolean).map((line) =>
|
|
|
2219
2219
|
return { path, line: Number(lineNo), text: rest.join(":") };
|
|
2220
2220
|
});
|
|
2221
2221
|
var makeNodeFileSystem = (shell) => ({
|
|
2222
|
-
readFile: (path) =>
|
|
2222
|
+
readFile: (path) => _chunkJKHBEWQAcjs.fromPromiseAbortable.call(void 0,
|
|
2223
2223
|
async (signal) => {
|
|
2224
2224
|
const { readFile } = await dynamicImport2("node:fs/promises");
|
|
2225
2225
|
return readFile(path, { encoding: "utf8", signal });
|
|
2226
2226
|
},
|
|
2227
2227
|
(cause) => ({ _tag: "FsError", operation: "readFile", cause })
|
|
2228
2228
|
),
|
|
2229
|
-
exists: (path) =>
|
|
2229
|
+
exists: (path) => _chunkJKHBEWQAcjs.fromPromiseAbortable.call(void 0,
|
|
2230
2230
|
async (signal) => {
|
|
2231
2231
|
if (signal.aborted) return false;
|
|
2232
2232
|
const { stat } = await dynamicImport2("node:fs/promises");
|
|
@@ -2607,7 +2607,7 @@ var loadNodeAgentConfig = async (options) => {
|
|
|
2607
2607
|
// src/agent/llm/openAICompatible.ts
|
|
2608
2608
|
var extractText = (json) => _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([json, 'optionalAccess', _150 => _150.choices, 'optionalAccess', _151 => _151[0], 'optionalAccess', _152 => _152.message, 'optionalAccess', _153 => _153.content]), () => ( _optionalChain([json, 'optionalAccess', _154 => _154.output_text]))), () => ( _optionalChain([json, 'optionalAccess', _155 => _155.content, 'optionalAccess', _156 => _156[0], 'optionalAccess', _157 => _157.text]))), () => ( JSON.stringify(json)));
|
|
2609
2609
|
var makeOpenAICompatibleLLM = (config) => ({
|
|
2610
|
-
complete: (request) =>
|
|
2610
|
+
complete: (request) => _chunkJKHBEWQAcjs.fromPromiseAbortable.call(void 0,
|
|
2611
2611
|
async (signal) => {
|
|
2612
2612
|
const res = await fetch(config.endpoint, {
|
|
2613
2613
|
method: "POST",
|
|
@@ -2699,7 +2699,7 @@ var responseErrorMessage = async (res) => {
|
|
|
2699
2699
|
}
|
|
2700
2700
|
};
|
|
2701
2701
|
var makeGoogleGenerativeAILLM = (config) => ({
|
|
2702
|
-
complete: (request) =>
|
|
2702
|
+
complete: (request) => _chunkJKHBEWQAcjs.fromPromiseAbortable.call(void 0,
|
|
2703
2703
|
async (signal) => {
|
|
2704
2704
|
const res = await fetch(makeGenerateContentEndpoint(config), {
|
|
2705
2705
|
method: "POST",
|
|
@@ -2860,7 +2860,9 @@ var Runtime = class _Runtime {
|
|
|
2860
2860
|
this.forkPolicy = makeForkPolicy(this.env, this.hooks);
|
|
2861
2861
|
this.fiberEngine = this.makeFiberEngine(this.engineMode, args.wasm);
|
|
2862
2862
|
this.fallbackUsed = false;
|
|
2863
|
+
this.staticFastPathOk = this.hooks === NoopHooks && this.scheduler === globalScheduler && !this.inferLane && this.engineMode === "ts";
|
|
2863
2864
|
}
|
|
2865
|
+
|
|
2864
2866
|
makeFiberEngine(mode, wasm) {
|
|
2865
2867
|
if (mode === "ts") return new JsFiberEngine(this);
|
|
2866
2868
|
if (mode === "wasm") return new WasmFiberEngine(this, wasm);
|
|
@@ -2990,11 +2992,8 @@ var Runtime = class _Runtime {
|
|
|
2990
2992
|
});
|
|
2991
2993
|
}
|
|
2992
2994
|
tryRunNativeTopLevel(effect, cb) {
|
|
2993
|
-
if (this.
|
|
2995
|
+
if (!this.staticFastPathOk) return false;
|
|
2994
2996
|
if (getCurrentFiber() !== null) return false;
|
|
2995
|
-
if (this.scheduler !== globalScheduler) return false;
|
|
2996
|
-
if (this.inferLane) return false;
|
|
2997
|
-
if (this.engineMode !== "ts") return false;
|
|
2998
2997
|
new NativeTopLevelRunner(this, effect, cb).start();
|
|
2999
2998
|
return true;
|
|
3000
2999
|
}
|
|
@@ -3070,16 +3069,25 @@ var NativeTopLevelRunner = (_class16 = class {
|
|
|
3070
3069
|
this.runLoop();
|
|
3071
3070
|
}
|
|
3072
3071
|
runLoop() {
|
|
3073
|
-
this
|
|
3072
|
+
const prevFiber = setCurrentFiber(this);
|
|
3073
|
+
try {
|
|
3074
3074
|
this.yielded = false;
|
|
3075
3075
|
let budget = NATIVE_FAST_PATH_STEP_BUDGET;
|
|
3076
3076
|
while (!this.result && budget-- > 0) {
|
|
3077
3077
|
const current = this.current;
|
|
3078
3078
|
switch (current._tag) {
|
|
3079
3079
|
case "Succeed":
|
|
3080
|
+
if (!this.stack || this.stack.length === 0) {
|
|
3081
|
+
this.notify(_chunkMVGUEJ5Zcjs.Exit.succeed(current.value));
|
|
3082
|
+
return;
|
|
3083
|
+
}
|
|
3080
3084
|
this.onSuccess(current.value);
|
|
3081
3085
|
break;
|
|
3082
3086
|
case "Fail":
|
|
3087
|
+
if (!this.stack || this.stack.length === 0) {
|
|
3088
|
+
this.notify(_chunkMVGUEJ5Zcjs.Exit.failCause(_chunkMVGUEJ5Zcjs.Cause.fail(current.error)));
|
|
3089
|
+
return;
|
|
3090
|
+
}
|
|
3083
3091
|
this.onCause(_chunkMVGUEJ5Zcjs.Cause.fail(current.error));
|
|
3084
3092
|
break;
|
|
3085
3093
|
case "Sync":
|
|
@@ -3156,7 +3164,9 @@ var NativeTopLevelRunner = (_class16 = class {
|
|
|
3156
3164
|
this.yielded = true;
|
|
3157
3165
|
queueMicrotask(() => this.runLoop());
|
|
3158
3166
|
}
|
|
3159
|
-
}
|
|
3167
|
+
} finally {
|
|
3168
|
+
setCurrentFiber(prevFiber);
|
|
3169
|
+
}
|
|
3160
3170
|
}
|
|
3161
3171
|
runAsync(current) {
|
|
3162
3172
|
let registered = false;
|
|
@@ -4136,6 +4146,11 @@ function withCurrentFiber(fiber, f) {
|
|
|
4136
4146
|
_current = prev;
|
|
4137
4147
|
}
|
|
4138
4148
|
}
|
|
4149
|
+
function setCurrentFiber(fiber) {
|
|
4150
|
+
const prev = _current;
|
|
4151
|
+
_current = fiber;
|
|
4152
|
+
return prev;
|
|
4153
|
+
}
|
|
4139
4154
|
|
|
4140
4155
|
// src/core/runtime/engine/JsFiberEngine.ts
|
|
4141
4156
|
var JsFiberEngine = (_class18 = class {
|
|
@@ -4400,4 +4415,5 @@ function withScope(runtime, f) {
|
|
|
4400
4415
|
|
|
4401
4416
|
|
|
4402
4417
|
|
|
4403
|
-
|
|
4418
|
+
|
|
4419
|
+
exports.PushStatus = PushStatus; exports.RingBuffer = RingBuffer; exports.resolveWasmModule = resolveWasmModule; exports.makeBoundedRingBuffer = makeBoundedRingBuffer; exports.sanitizeLaneKey = sanitizeLaneKey; exports.laneTag = laneTag; exports.inferCallerLaneFromStack = inferCallerLaneFromStack; exports.Scheduler = Scheduler; exports.globalScheduler = globalScheduler; exports.emptyContext = emptyContext; exports.ctxExtend = ctxExtend; exports.ctxToObject = ctxToObject; exports.DefaultHostExecutor = DefaultHostExecutor; exports.JsFiberEngine = JsFiberEngine; exports.HostRegistry = HostRegistry; exports.ProgramBuilder = ProgramBuilder; exports.EngineFiberHandle = EngineFiberHandle; exports.ABI_VERSION = ABI_VERSION; exports.EVENT_WORDS = EVENT_WORDS; exports.NONE_U32 = NONE_U32; exports.OpcodeTagCode = OpcodeTagCode; exports.EventKindCode = EventKindCode; exports.encodeOpcodeProgram = encodeOpcodeProgram; exports.encodeOpcodeNodes = encodeOpcodeNodes; exports.decodeEvent = decodeEvent; exports.decodeEventBatch = decodeEventBatch; exports.WasmPackFiberBridge = WasmPackFiberBridge; exports.WasmFiberRegistryBridge = WasmFiberRegistryBridge; exports.makeFiberReadyQueue = makeFiberReadyQueue; exports.WasmFiberEngine = WasmFiberEngine; exports.runtimeCapabilities = runtimeCapabilities; exports.liveClock = liveClock; exports.runtimeClockFromEnv = runtimeClockFromEnv; exports.NoopHooks = NoopHooks; exports.Runtime = Runtime; exports.fork = fork; exports.runtimeForCaller = runtimeForCaller; exports.toPromiseByCaller = toPromiseByCaller; exports.unsafeRunAsync = unsafeRunAsync; exports.toPromise = toPromise; exports.setAbortablePromisePerLabelTracking = setAbortablePromisePerLabelTracking; exports.recordAbortablePromiseStart = recordAbortablePromiseStart; exports.recordAbortablePromiseFinish = recordAbortablePromiseFinish; exports.abortablePromiseStats = abortablePromiseStats; exports.resetAbortablePromiseStats = resetAbortablePromiseStats; exports.fromPromiseAbortable = fromPromiseAbortable; exports.unsafeRunFoldWithEnv = unsafeRunFoldWithEnv; exports.setBenchmarkBudget = setBenchmarkBudget; exports.getBenchmarkBudget = getBenchmarkBudget; exports.RuntimeFiber = RuntimeFiber; exports.getCurrentFiber = getCurrentFiber; exports.unsafeGetCurrentRuntime = unsafeGetCurrentRuntime; exports.withCurrentFiber = withCurrentFiber; exports.setCurrentFiber = setCurrentFiber; exports.Scope = Scope; exports.withScopeAsync = withScopeAsync; exports.withScope = withScope;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeRuntimeEventRecord
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WA65XP2P.mjs";
|
|
4
4
|
import {
|
|
5
5
|
layerEffect,
|
|
6
6
|
makeScheduleDriver
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XRRC5BBM.mjs";
|
|
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-BFNBU47C.mjs";
|
|
16
16
|
import {
|
|
17
17
|
Cause,
|
|
18
18
|
Exit,
|
|
@@ -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; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkVXNWVAIGcjs = require('./chunk-VXNWVAIG.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkJKHBEWQAcjs = require('./chunk-JKHBEWQA.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -73,9 +73,9 @@ function fiberRefSnapshot() {
|
|
|
73
73
|
return new Map(currentFiberRefs(false));
|
|
74
74
|
}
|
|
75
75
|
function currentFiberRefs(create) {
|
|
76
|
-
const fiber =
|
|
76
|
+
const fiber = _chunkJKHBEWQAcjs.getCurrentFiber.call(void 0, );
|
|
77
77
|
if (!fiber) return void 0;
|
|
78
|
-
fiber.fiberContext ??= { log:
|
|
78
|
+
fiber.fiberContext ??= { log: _chunkJKHBEWQAcjs.emptyContext, trace: null };
|
|
79
79
|
if (!fiber.fiberContext.fiberRefs && create) fiber.fiberContext.fiberRefs = /* @__PURE__ */ new Map();
|
|
80
80
|
return fiber.fiberContext.fiberRefs;
|
|
81
81
|
}
|
|
@@ -98,7 +98,7 @@ function makeRuntimeRecorder(options = {}) {
|
|
|
98
98
|
return out;
|
|
99
99
|
};
|
|
100
100
|
const emit = (ev, ctx) => {
|
|
101
|
-
records[next] =
|
|
101
|
+
records[next] = _chunkVXNWVAIGcjs.makeRuntimeEventRecord.call(void 0, ev, ctx, seq++);
|
|
102
102
|
next = (next + 1) % capacity;
|
|
103
103
|
if (size < capacity) size++;
|
|
104
104
|
else dropped++;
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
var _chunkL6VB5N7Qcjs = require('./chunk-L6VB5N7Q.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCXWJII2Ncjs = require('./chunk-CXWJII2N.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkZZ2CMYJLcjs = require('./chunk-ZZ2CMYJL.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkJKHBEWQAcjs = require('./chunk-JKHBEWQA.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -346,7 +346,7 @@ var WasmRetryPlannerBridge = class {
|
|
|
346
346
|
}
|
|
347
347
|
};
|
|
348
348
|
function makeWasmRetryPlanner() {
|
|
349
|
-
const mod =
|
|
349
|
+
const mod = _chunkJKHBEWQAcjs.resolveWasmModule.call(void 0, );
|
|
350
350
|
const Ctor = _optionalChain([mod, 'optionalAccess', _9 => _9.BrassWasmRetryPlanner]);
|
|
351
351
|
if (!Ctor) throw new Error("brass-runtime wasm retry planner is not available. Run npm run build:wasm first.");
|
|
352
352
|
return new WasmRetryPlannerBridge(Ctor);
|
|
@@ -528,7 +528,7 @@ var withRetry = (p) => (next) => {
|
|
|
528
528
|
_optionalChain([wasmPlanner, 'optionalAccess', _15 => _15.drop, 'call', _16 => _16(id)]);
|
|
529
529
|
}
|
|
530
530
|
};
|
|
531
|
-
const scheduleDriver = effectivePolicy.schedule ?
|
|
531
|
+
const scheduleDriver = effectivePolicy.schedule ? _chunkZZ2CMYJLcjs.makeScheduleDriver.call(void 0, effectivePolicy.schedule, {
|
|
532
532
|
name: _nullishCoalesce(effectivePolicy.schedule.name, () => ( "http.retry")),
|
|
533
533
|
startedAtMs: startedAt,
|
|
534
534
|
onDecision: effectivePolicy.onScheduleDecision
|
|
@@ -606,7 +606,7 @@ var WasmHttpPermitPoolBridge = (_class = class {
|
|
|
606
606
|
}
|
|
607
607
|
}, _class);
|
|
608
608
|
function makeWasmHttpPermitPool(options) {
|
|
609
|
-
const mod =
|
|
609
|
+
const mod = _chunkJKHBEWQAcjs.resolveWasmModule.call(void 0, );
|
|
610
610
|
const Ctor = _optionalChain([mod, 'optionalAccess', _17 => _17.BrassWasmHttpPermitPool]);
|
|
611
611
|
if (!Ctor) throw new Error("brass-runtime wasm HTTP permit pool is not available. Run npm run build:wasm first.");
|
|
612
612
|
return new WasmHttpPermitPoolBridge(Ctor, options);
|
|
@@ -2600,7 +2600,7 @@ function makeFetchStreamTransport() {
|
|
|
2600
2600
|
});
|
|
2601
2601
|
const headers = headersOf(response);
|
|
2602
2602
|
const latencyMs = Math.round(nowMs() - started);
|
|
2603
|
-
const body =
|
|
2603
|
+
const body = _chunkCXWJII2Ncjs.streamFromReadableStream.call(void 0, response.body, normalizeHttpError, {
|
|
2604
2604
|
signal: linkedSignal.signal,
|
|
2605
2605
|
onRelease: linkedSignal.cleanup
|
|
2606
2606
|
});
|
|
@@ -3135,7 +3135,7 @@ function makeHttpStream(cfg = {}) {
|
|
|
3135
3135
|
const url = resolveRequestUrl(req, baseUrl);
|
|
3136
3136
|
if (!(url instanceof URL)) return _chunkMVGUEJ5Zcjs.asyncFail.call(void 0, url);
|
|
3137
3137
|
const timeoutMs = resolvePositiveTimeout(_nullishCoalesce(req.timeoutMs, () => ( cfg.timeoutMs)));
|
|
3138
|
-
return
|
|
3138
|
+
return _chunkJKHBEWQAcjs.fromPromiseAbortable.call(void 0,
|
|
3139
3139
|
async (signal, env) => {
|
|
3140
3140
|
let lease;
|
|
3141
3141
|
const linkedSignal = linkAbortSignals(signal, _optionalChain([req, 'access', _76 => _76.init, 'optionalAccess', _77 => _77.signal]));
|
|
@@ -3200,7 +3200,7 @@ function makeHttp(cfg = {}) {
|
|
|
3200
3200
|
if (!adaptiveLimiter && !pool && timeoutMs === void 0) {
|
|
3201
3201
|
return runDirectTransport(req, url, transport, metrics);
|
|
3202
3202
|
}
|
|
3203
|
-
return
|
|
3203
|
+
return _chunkJKHBEWQAcjs.fromPromiseAbortable.call(void 0,
|
|
3204
3204
|
async (signal, env) => {
|
|
3205
3205
|
let lease;
|
|
3206
3206
|
const linkedSignal = linkAbortSignals(signal, _optionalChain([req, 'access', _78 => _78.init, 'optionalAccess', _79 => _79.signal]));
|
|
@@ -3278,7 +3278,7 @@ var withRetryStream = (p) => (next) => {
|
|
|
3278
3278
|
method: req.method,
|
|
3279
3279
|
timestamp: Date.now()
|
|
3280
3280
|
})]);
|
|
3281
|
-
return _chunkMVGUEJ5Zcjs.asyncFlatMap.call(void 0,
|
|
3281
|
+
return _chunkMVGUEJ5Zcjs.asyncFlatMap.call(void 0, _chunkZZ2CMYJLcjs.sleep.call(void 0, d), () => loop(attempt + 1));
|
|
3282
3282
|
},
|
|
3283
3283
|
(w) => {
|
|
3284
3284
|
const canRetry = attempt < p.maxRetries && retryOnStatus(w.status) && remainingBudget() > 0;
|
|
@@ -3296,7 +3296,7 @@ var withRetryStream = (p) => (next) => {
|
|
|
3296
3296
|
method: req.method,
|
|
3297
3297
|
timestamp: Date.now()
|
|
3298
3298
|
})]);
|
|
3299
|
-
return _chunkMVGUEJ5Zcjs.asyncFlatMap.call(void 0,
|
|
3299
|
+
return _chunkMVGUEJ5Zcjs.asyncFlatMap.call(void 0, _chunkZZ2CMYJLcjs.sleep.call(void 0, d), () => loop(attempt + 1));
|
|
3300
3300
|
}
|
|
3301
3301
|
);
|
|
3302
3302
|
return loop(0);
|
|
@@ -6080,7 +6080,7 @@ function makeDefaultHttpClient(config = {}) {
|
|
|
6080
6080
|
});
|
|
6081
6081
|
}
|
|
6082
6082
|
function buildDefaultClient(wire, meta) {
|
|
6083
|
-
const withPromise = (eff) => _chunkMVGUEJ5Zcjs.withAsyncPromise.call(void 0, (e, env) =>
|
|
6083
|
+
const withPromise = (eff) => _chunkMVGUEJ5Zcjs.withAsyncPromise.call(void 0, (e, env) => _chunkJKHBEWQAcjs.toPromise.call(void 0, e, env))(eff);
|
|
6084
6084
|
const requestRaw = (req) => wire(req);
|
|
6085
6085
|
const request = (req) => withPromise(requestRaw(req));
|
|
6086
6086
|
const get = (url, init) => request(buildHttpRequest("GET", url, init));
|
|
@@ -6263,10 +6263,10 @@ function isLeanPreset(preset) {
|
|
|
6263
6263
|
}
|
|
6264
6264
|
|
|
6265
6265
|
// src/http/layer.ts
|
|
6266
|
-
var HttpClientService =
|
|
6266
|
+
var HttpClientService = _chunkZZ2CMYJLcjs.makeServiceTag.call(void 0, "HttpClient");
|
|
6267
6267
|
function makeDefaultHttpClientLayer(config = {}, options = {}) {
|
|
6268
6268
|
const tag = _nullishCoalesce(options.tag, () => ( HttpClientService));
|
|
6269
|
-
return
|
|
6269
|
+
return _chunkZZ2CMYJLcjs.layerEffect.call(void 0,
|
|
6270
6270
|
tag,
|
|
6271
6271
|
(context) => _chunkMVGUEJ5Zcjs.asyncSync.call(void 0,
|
|
6272
6272
|
() => makeDefaultHttpClient(resolveDefaultHttpClientLayerConfig(config, context))
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeRuntimeEventRecord
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LI7WUVJN.js";
|
|
4
4
|
import {
|
|
5
5
|
layerEffect,
|
|
6
6
|
makeScheduleDriver
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6W5DC3TX.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-TN2P7RNK.js";
|
|
16
16
|
import {
|
|
17
17
|
Cause,
|
|
18
18
|
Exit,
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
EventBus,
|
|
3
3
|
InMemoryTracer,
|
|
4
4
|
makeMetrics
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WA65XP2P.mjs";
|
|
6
6
|
import {
|
|
7
7
|
Runtime,
|
|
8
8
|
ctxExtend,
|
|
9
9
|
ctxToObject,
|
|
10
10
|
emptyContext,
|
|
11
11
|
getCurrentFiber
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BFNBU47C.mjs";
|
|
13
13
|
import {
|
|
14
14
|
asyncFail,
|
|
15
15
|
asyncFlatMap,
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
EventBus,
|
|
3
3
|
InMemoryTracer,
|
|
4
4
|
makeMetrics
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LI7WUVJN.js";
|
|
6
6
|
import {
|
|
7
7
|
Runtime,
|
|
8
8
|
ctxExtend,
|
|
9
9
|
ctxToObject,
|
|
10
10
|
emptyContext,
|
|
11
11
|
getCurrentFiber
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TN2P7RNK.js";
|
|
13
13
|
import {
|
|
14
14
|
asyncFail,
|
|
15
15
|
asyncFlatMap,
|