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.
Files changed (77) hide show
  1. package/dist/agent/cli/main.cjs +30 -30
  2. package/dist/agent/cli/main.js +2 -2
  3. package/dist/agent/cli/main.mjs +2 -2
  4. package/dist/agent/index.cjs +3 -3
  5. package/dist/agent/index.d.ts +1 -1
  6. package/dist/agent/index.js +2 -2
  7. package/dist/agent/index.mjs +2 -2
  8. package/dist/{chunk-HW2CLRJ3.mjs → chunk-22HYIE56.mjs} +6 -6
  9. package/dist/{chunk-GOEO763K.cjs → chunk-2XXQ3NVT.cjs} +19 -19
  10. package/dist/{chunk-QBVS3UYN.cjs → chunk-67256TKF.cjs} +54 -54
  11. package/dist/{chunk-BLXBZ6RE.mjs → chunk-6BNZS2A4.mjs} +1 -1
  12. package/dist/{chunk-EXBGIC66.js → chunk-6W5DC3TX.js} +1 -1
  13. package/dist/{chunk-OX6MF7SZ.mjs → chunk-AITYRQX2.mjs} +5 -5
  14. package/dist/{chunk-MUMBUXU6.mjs → chunk-BFNBU47C.mjs} +22 -6
  15. package/dist/{chunk-OO7BGCC3.cjs → chunk-CXWJII2N.cjs} +13 -13
  16. package/dist/{chunk-Z2YIDHRI.cjs → chunk-ENMKEX3N.cjs} +5 -5
  17. package/dist/{chunk-NQW3YUFN.cjs → chunk-EZ76UNHP.cjs} +18 -18
  18. package/dist/{chunk-5RVHSBJ6.mjs → chunk-ID2WOCBA.mjs} +3 -3
  19. package/dist/{chunk-RZGB3DXR.js → chunk-IHXF6NQG.js} +3 -3
  20. package/dist/{chunk-MA74OYCI.cjs → chunk-IHY2EJTT.cjs} +6 -6
  21. package/dist/{chunk-AQQQFNYD.mjs → chunk-IWAQQDYE.mjs} +1 -1
  22. package/dist/{chunk-C3CWI42G.js → chunk-J4F5KC3U.js} +1 -1
  23. package/dist/{chunk-ZDZNV6NA.cjs → chunk-JKHBEWQA.cjs} +23 -7
  24. package/dist/{chunk-5UBJT4RW.mjs → chunk-JM7WMSRR.mjs} +3 -3
  25. package/dist/{chunk-YQWZ7FZX.cjs → chunk-JQCQWO47.cjs} +5 -5
  26. package/dist/{chunk-B2VXVNIS.js → chunk-LI7WUVJN.js} +1 -1
  27. package/dist/{chunk-7FZUTJM3.cjs → chunk-LXNU3MRV.cjs} +14 -14
  28. package/dist/{chunk-FC5N5QHJ.js → chunk-NWONRWBT.js} +2 -2
  29. package/dist/{chunk-H4ZRUQZL.js → chunk-PG6CHG34.js} +3 -3
  30. package/dist/{chunk-GXOIUBKE.js → chunk-RZQK32C6.js} +2 -2
  31. package/dist/{chunk-EKLEDIVJ.mjs → chunk-S6KSHYAT.mjs} +2 -2
  32. package/dist/{chunk-URVS2OE2.mjs → chunk-SCHM2MDA.mjs} +2 -2
  33. package/dist/{chunk-A6EG5WRL.js → chunk-TAPB4NN5.js} +2 -2
  34. package/dist/{chunk-APQBU7TM.js → chunk-TN2P7RNK.js} +22 -6
  35. package/dist/{chunk-2R3RVNS2.js → chunk-U42YF6B2.js} +6 -6
  36. package/dist/{chunk-FYWWU3Z7.cjs → chunk-VXNWVAIG.cjs} +2 -2
  37. package/dist/{chunk-KAPZHDO4.mjs → chunk-WA65XP2P.mjs} +1 -1
  38. package/dist/{chunk-JWFOWPMB.js → chunk-XJSWDU2S.js} +5 -5
  39. package/dist/{chunk-4PKBNG2H.js → chunk-XO3TDAJE.js} +1 -1
  40. package/dist/{chunk-KDXNWGPB.mjs → chunk-XRRC5BBM.mjs} +1 -1
  41. package/dist/{chunk-DV644N7P.cjs → chunk-ZJC3JZIE.cjs} +16 -16
  42. package/dist/{chunk-3NKXUX4T.mjs → chunk-ZXLETUGQ.mjs} +2 -2
  43. package/dist/{chunk-6STX4PS3.cjs → chunk-ZZ2CMYJL.cjs} +13 -13
  44. package/dist/core/index.cjs +9 -7
  45. package/dist/core/index.d.ts +6 -6
  46. package/dist/core/index.js +8 -6
  47. package/dist/core/index.mjs +8 -6
  48. package/dist/{defaultClient-Cid0JoUR.d.ts → defaultClient-hyVSNzSJ.d.ts} +3 -3
  49. package/dist/{effect-DnGUuhw6.d.ts → effect-DbEMiMvv.d.ts} +8 -1
  50. package/dist/http/index.cjs +48 -48
  51. package/dist/http/index.d.ts +8 -8
  52. package/dist/http/index.js +6 -6
  53. package/dist/http/index.mjs +6 -6
  54. package/dist/http/testing.cjs +8 -8
  55. package/dist/http/testing.d.ts +4 -4
  56. package/dist/http/testing.js +4 -4
  57. package/dist/http/testing.mjs +4 -4
  58. package/dist/index.cjs +87 -85
  59. package/dist/index.d.ts +7 -7
  60. package/dist/index.js +9 -7
  61. package/dist/index.mjs +9 -7
  62. package/dist/{layer-D2LFcBVx.d.ts → layer-CsNGeVee.d.ts} +1 -1
  63. package/dist/observability/index.cjs +9 -9
  64. package/dist/observability/index.d.ts +7 -7
  65. package/dist/observability/index.js +8 -8
  66. package/dist/observability/index.mjs +8 -8
  67. package/dist/perf/cli.cjs +25 -25
  68. package/dist/perf/cli.js +10 -10
  69. package/dist/perf/cli.mjs +10 -10
  70. package/dist/perf/index.cjs +12 -12
  71. package/dist/perf/index.js +10 -10
  72. package/dist/perf/index.mjs +10 -10
  73. package/dist/{server-Bf1zNYZk.d.ts → server-BKKuzAW9.d.ts} +4 -4
  74. package/dist/{stream-I7bkvF7a.d.ts → stream-B8c_UKZq.d.ts} +1 -1
  75. package/dist/{tracer-DF83nLn6.d.ts → tracer-CS3yOXZx.d.ts} +2 -2
  76. package/dist/{tracing-CWV4gT0u.d.ts → tracing-DIAUf2x8.d.ts} +1 -1
  77. 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 _chunkYQWZ7FZXcjs = require('./chunk-YQWZ7FZX.cjs');
4
+ var _chunkJQCQWO47cjs = require('./chunk-JQCQWO47.cjs');
5
5
 
6
6
 
7
- var _chunkQBVS3UYNcjs = require('./chunk-QBVS3UYN.cjs');
7
+ var _chunk67256TKFcjs = require('./chunk-67256TKF.cjs');
8
8
 
9
9
 
10
- var _chunkDV644N7Pcjs = require('./chunk-DV644N7P.cjs');
10
+ var _chunkZJC3JZIEcjs = require('./chunk-ZJC3JZIE.cjs');
11
11
 
12
12
 
13
- var _chunkFYWWU3Z7cjs = require('./chunk-FYWWU3Z7.cjs');
13
+ var _chunkVXNWVAIGcjs = require('./chunk-VXNWVAIG.cjs');
14
14
 
15
15
 
16
16
 
17
- var _chunk7FZUTJM3cjs = require('./chunk-7FZUTJM3.cjs');
17
+ var _chunkLXNU3MRVcjs = require('./chunk-LXNU3MRV.cjs');
18
18
 
19
19
 
20
20
 
21
- var _chunkZDZNV6NAcjs = require('./chunk-ZDZNV6NA.cjs');
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, _chunkZDZNV6NAcjs.Scheduler)(schedulerConfig) : void 0;
303
- const recorder = variant === "recorder" ? _chunkYQWZ7FZXcjs.makeRuntimeRecorder.call(void 0, { maxEvents: 1e4 }) : void 0;
304
- const hooks = _nullishCoalesce(_optionalChain([recorder, 'optionalAccess', _8 => _8.hooks]), () => ( (variant === "active-hooks" ? new (0, _chunkFYWWU3Z7cjs.EventBus)() : void 0)));
305
- const runtime = _chunkZDZNV6NAcjs.Runtime.makeWithEngine(hooks ? {} : {}, "ts", {
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 = _chunkYQWZ7FZXcjs.makeFiberRef.call(void 0, 0);
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" ? _chunkDV644N7Pcjs.makeObservability.call(void 0, {
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 _chunkZDZNV6NAcjs.Runtime.makeWithEngine(_nullishCoalesce(_optionalChain([observability, 'optionalAccess', _30 => _30.env]), () => ( {})), "ts", {
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, _chunkZDZNV6NAcjs.Scheduler)({
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 _chunk7FZUTJM3cjs.makeHttp.call(void 0, baseHttpConfig(baseUrl, scenario));
865
+ return _chunkLXNU3MRVcjs.makeHttp.call(void 0, baseHttpConfig(baseUrl, scenario));
866
866
  }
867
867
  function makeMinimalClient(baseUrl, scenario) {
868
- return _chunk7FZUTJM3cjs.makeDefaultHttpClient.call(void 0, {
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 _chunk7FZUTJM3cjs.makeDefaultHttpClient.call(void 0, {
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
- _chunkQBVS3UYNcjs.withHttpObservability.call(void 0, {
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-AQQQFNYD.mjs";
6
+ } from "./chunk-IWAQQDYE.mjs";
7
7
  import {
8
8
  layerEffect,
9
9
  makeScheduleDriver,
10
10
  makeServiceTag,
11
11
  sleep
12
- } from "./chunk-KDXNWGPB.mjs";
12
+ } from "./chunk-XRRC5BBM.mjs";
13
13
  import {
14
14
  fromPromiseAbortable,
15
15
  resolveWasmModule,
16
16
  toPromise
17
- } from "./chunk-MUMBUXU6.mjs";
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-4PKBNG2H.js";
6
+ } from "./chunk-XO3TDAJE.js";
7
7
  import {
8
8
  layerEffect,
9
9
  makeScheduleDriver,
10
10
  makeServiceTag,
11
11
  sleep
12
- } from "./chunk-EXBGIC66.js";
12
+ } from "./chunk-6W5DC3TX.js";
13
13
  import {
14
14
  fromPromiseAbortable,
15
15
  resolveWasmModule,
16
16
  toPromise
17
- } from "./chunk-APQBU7TM.js";
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 _chunkZDZNV6NAcjs = require('./chunk-ZDZNV6NA.cjs');
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) => _chunkZDZNV6NAcjs.withScopeAsync.call(void 0,
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) => _chunkZDZNV6NAcjs.fromPromiseAbortable.call(void 0,
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) => _chunkZDZNV6NAcjs.fromPromiseAbortable.call(void 0,
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) => _chunkZDZNV6NAcjs.fromPromiseAbortable.call(void 0,
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) => _chunkZDZNV6NAcjs.fromPromiseAbortable.call(void 0,
2702
+ complete: (request) => _chunkJKHBEWQAcjs.fromPromiseAbortable.call(void 0,
2703
2703
  async (signal) => {
2704
2704
  const res = await fetch(makeGenerateContentEndpoint(config), {
2705
2705
  method: "POST",
@@ -6,7 +6,7 @@ import {
6
6
  getCurrentFiber,
7
7
  unsafeGetCurrentRuntime,
8
8
  unsafeRunFoldWithEnv
9
- } from "./chunk-MUMBUXU6.mjs";
9
+ } from "./chunk-BFNBU47C.mjs";
10
10
  import {
11
11
  Cause,
12
12
  Exit,
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  fromPromiseAbortable,
6
6
  withScopeAsync
7
- } from "./chunk-APQBU7TM.js";
7
+ } from "./chunk-TN2P7RNK.js";
8
8
  import {
9
9
  Cause,
10
10
  Exit,
@@ -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.hooks !== NoopHooks) return false;
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.withFrame(() => {
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
- 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.Scope = Scope; exports.withScopeAsync = withScopeAsync; exports.withScope = withScope;
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-KAPZHDO4.mjs";
3
+ } from "./chunk-WA65XP2P.mjs";
4
4
  import {
5
5
  layerEffect,
6
6
  makeScheduleDriver
7
- } from "./chunk-KDXNWGPB.mjs";
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-MUMBUXU6.mjs";
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 _chunkFYWWU3Z7cjs = require('./chunk-FYWWU3Z7.cjs');
3
+ var _chunkVXNWVAIGcjs = require('./chunk-VXNWVAIG.cjs');
4
4
 
5
5
 
6
6
 
7
- var _chunkZDZNV6NAcjs = require('./chunk-ZDZNV6NA.cjs');
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 = _chunkZDZNV6NAcjs.getCurrentFiber.call(void 0, );
76
+ const fiber = _chunkJKHBEWQAcjs.getCurrentFiber.call(void 0, );
77
77
  if (!fiber) return void 0;
78
- fiber.fiberContext ??= { log: _chunkZDZNV6NAcjs.emptyContext, trace: null };
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] = _chunkFYWWU3Z7cjs.makeRuntimeEventRecord.call(void 0, ev, ctx, seq++);
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++;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  makeBoundedRingBuffer
3
- } from "./chunk-APQBU7TM.js";
3
+ } from "./chunk-TN2P7RNK.js";
4
4
  import {
5
5
  Cause
6
6
  } from "./chunk-UB4B6OFY.js";
@@ -3,18 +3,18 @@
3
3
  var _chunkL6VB5N7Qcjs = require('./chunk-L6VB5N7Q.cjs');
4
4
 
5
5
 
6
- var _chunkOO7BGCC3cjs = require('./chunk-OO7BGCC3.cjs');
6
+ var _chunkCXWJII2Ncjs = require('./chunk-CXWJII2N.cjs');
7
7
 
8
8
 
9
9
 
10
10
 
11
11
 
12
- var _chunk6STX4PS3cjs = require('./chunk-6STX4PS3.cjs');
12
+ var _chunkZZ2CMYJLcjs = require('./chunk-ZZ2CMYJL.cjs');
13
13
 
14
14
 
15
15
 
16
16
 
17
- var _chunkZDZNV6NAcjs = require('./chunk-ZDZNV6NA.cjs');
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 = _chunkZDZNV6NAcjs.resolveWasmModule.call(void 0, );
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 ? _chunk6STX4PS3cjs.makeScheduleDriver.call(void 0, 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 = _chunkZDZNV6NAcjs.resolveWasmModule.call(void 0, );
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 = _chunkOO7BGCC3cjs.streamFromReadableStream.call(void 0, response.body, normalizeHttpError, {
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 _chunkZDZNV6NAcjs.fromPromiseAbortable.call(void 0,
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 _chunkZDZNV6NAcjs.fromPromiseAbortable.call(void 0,
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, _chunk6STX4PS3cjs.sleep.call(void 0, d), () => loop(attempt + 1));
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, _chunk6STX4PS3cjs.sleep.call(void 0, d), () => loop(attempt + 1));
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) => _chunkZDZNV6NAcjs.toPromise.call(void 0, e, env))(eff);
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 = _chunk6STX4PS3cjs.makeServiceTag.call(void 0, "HttpClient");
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 _chunk6STX4PS3cjs.layerEffect.call(void 0,
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
  layerEffect,
3
3
  makeServiceTag
4
- } from "./chunk-EXBGIC66.js";
4
+ } from "./chunk-6W5DC3TX.js";
5
5
  import {
6
6
  Runtime
7
- } from "./chunk-APQBU7TM.js";
7
+ } from "./chunk-TN2P7RNK.js";
8
8
  import {
9
9
  asyncSync
10
10
  } from "./chunk-UB4B6OFY.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  makeRuntimeEventRecord
3
- } from "./chunk-B2VXVNIS.js";
3
+ } from "./chunk-LI7WUVJN.js";
4
4
  import {
5
5
  layerEffect,
6
6
  makeScheduleDriver
7
- } from "./chunk-EXBGIC66.js";
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-APQBU7TM.js";
15
+ } from "./chunk-TN2P7RNK.js";
16
16
  import {
17
17
  Cause,
18
18
  Exit,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  makeRuntimeEventRecord
3
- } from "./chunk-B2VXVNIS.js";
3
+ } from "./chunk-LI7WUVJN.js";
4
4
  import {
5
5
  emptyContext,
6
6
  getCurrentFiber
7
- } from "./chunk-APQBU7TM.js";
7
+ } from "./chunk-TN2P7RNK.js";
8
8
  import {
9
9
  Cause,
10
10
  asyncFlatMap,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  makeRuntimeEventRecord
3
- } from "./chunk-KAPZHDO4.mjs";
3
+ } from "./chunk-WA65XP2P.mjs";
4
4
  import {
5
5
  emptyContext,
6
6
  getCurrentFiber
7
- } from "./chunk-MUMBUXU6.mjs";
7
+ } from "./chunk-BFNBU47C.mjs";
8
8
  import {
9
9
  Cause,
10
10
  asyncFlatMap,
@@ -2,14 +2,14 @@ import {
2
2
  EventBus,
3
3
  InMemoryTracer,
4
4
  makeMetrics
5
- } from "./chunk-KAPZHDO4.mjs";
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-MUMBUXU6.mjs";
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-B2VXVNIS.js";
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-APQBU7TM.js";
12
+ } from "./chunk-TN2P7RNK.js";
13
13
  import {
14
14
  asyncFail,
15
15
  asyncFlatMap,