brass-runtime 1.16.0 → 1.16.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 (210) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +283 -18
  3. package/dist/agent/cli/main.cjs +38 -38
  4. package/dist/agent/cli/main.js +6 -6
  5. package/dist/agent/cli/main.mjs +6 -6
  6. package/dist/agent/index.cjs +7 -7
  7. package/dist/agent/index.d.ts +1 -1
  8. package/dist/agent/index.js +6 -6
  9. package/dist/agent/index.mjs +6 -6
  10. package/dist/chunk-2HQTDLHF.mjs +683 -0
  11. package/dist/chunk-36I3M4UC.mjs +370 -0
  12. package/dist/{chunk-QY5FKYEQ.js → chunk-3AYM6WPJ.js} +570 -51
  13. package/dist/chunk-3LOYJFRR.cjs +300 -0
  14. package/dist/chunk-3Y2RIUMM.js +300 -0
  15. package/dist/{chunk-N6VHMOWB.cjs → chunk-4ROBZFL6.cjs} +128 -128
  16. package/dist/{chunk-NC5SDRYE.js → chunk-52OB2ROS.js} +4 -4
  17. package/dist/{chunk-JX3LZQJH.cjs → chunk-52PPNNI4.cjs} +82 -20
  18. package/dist/{chunk-5YOQOXEQ.cjs → chunk-5EC274J5.cjs} +676 -293
  19. package/dist/chunk-5QC7LRZ3.js +229 -0
  20. package/dist/{chunk-7TL2LHQJ.js → chunk-5VRJNBLZ.mjs} +524 -141
  21. package/dist/chunk-62AZW6UT.cjs +313 -0
  22. package/dist/chunk-6IXXWIUM.js +683 -0
  23. package/dist/chunk-74ZTY6CP.js +2871 -0
  24. package/dist/chunk-76YMRMH2.cjs +777 -0
  25. package/dist/chunk-7CMJS3QE.mjs +2871 -0
  26. package/dist/{chunk-2WC63LJK.mjs → chunk-7JIJOVCT.js} +20 -10
  27. package/dist/{chunk-FM4W4QPL.js → chunk-A2OM6NEH.mjs} +5 -4
  28. package/dist/chunk-AGR5B2BC.cjs +683 -0
  29. package/dist/chunk-AVNQLJ5V.js +777 -0
  30. package/dist/chunk-B33ICAKP.js +313 -0
  31. package/dist/{chunk-J3H54ZRV.mjs → chunk-B5JD23U7.mjs} +1 -1
  32. package/dist/chunk-BABBZK4Y.js +2024 -0
  33. package/dist/{chunk-U5KWK3PX.mjs → chunk-C3MDXTRZ.js} +11 -0
  34. package/dist/{chunk-F5EUMJL7.mjs → chunk-CIZFIMK5.js} +55 -5
  35. package/dist/{chunk-SPUEME2B.cjs → chunk-CZIVE6NT.cjs} +12 -1
  36. package/dist/{chunk-TDVMADDN.js → chunk-DNFJLJMW.mjs} +11 -0
  37. package/dist/chunk-DNFO2EIZ.mjs +777 -0
  38. package/dist/{chunk-XDZOO4L5.js → chunk-EJ6BPYVR.mjs} +79 -17
  39. package/dist/{chunk-JNFRRJYH.cjs → chunk-ENKODRU3.cjs} +242 -192
  40. package/dist/chunk-EOC4UHBS.mjs +229 -0
  41. package/dist/{chunk-7LVI2GIN.js → chunk-FH2X7BVP.js} +507 -72
  42. package/dist/{chunk-OOGJ73B6.js → chunk-FHQGHPMO.mjs} +20 -10
  43. package/dist/{chunk-WQ5QNU5R.cjs → chunk-GLE2WY7Z.cjs} +652 -217
  44. package/dist/{chunk-G6IQOE4P.mjs → chunk-GYM3LLGS.mjs} +507 -72
  45. package/dist/chunk-HLWLMW2F.mjs +2024 -0
  46. package/dist/{chunk-TVN5I4U6.cjs → chunk-JF5WGYJJ.cjs} +25 -24
  47. package/dist/{chunk-CY33PGEX.mjs → chunk-KH4SYAOS.mjs} +570 -51
  48. package/dist/chunk-KN32XNTH.mjs +313 -0
  49. package/dist/chunk-KQLYONSE.cjs +2871 -0
  50. package/dist/{chunk-7HUOJA4W.cjs → chunk-KZJQ723N.cjs} +90 -80
  51. package/dist/{chunk-CCKHV5BT.mjs → chunk-L2SYFEBS.js} +5 -4
  52. package/dist/{chunk-IJT6RRQ5.cjs → chunk-L6VB5N7Q.cjs} +20 -9
  53. package/dist/{chunk-ZGLD4TVZ.mjs → chunk-MBEJI5HF.mjs} +4 -4
  54. package/dist/{chunk-PRWCB3QL.mjs → chunk-MIIYDLGM.js} +524 -141
  55. package/dist/{chunk-H55LI6WY.js → chunk-MOO4L7F4.mjs} +15 -4
  56. package/dist/{chunk-7XOPAB5Q.js → chunk-MT3OWDPC.mjs} +55 -5
  57. package/dist/chunk-MVGUEJ5Z.cjs +370 -0
  58. package/dist/chunk-PD4EJTQC.cjs +229 -0
  59. package/dist/chunk-PWC3RBQE.mjs +300 -0
  60. package/dist/{chunk-MWXMNYJS.cjs → chunk-Q2I37RP3.cjs} +643 -124
  61. package/dist/{chunk-VFIUZG7J.mjs → chunk-RKGKFN2A.js} +79 -17
  62. package/dist/{chunk-NYL4D7SK.cjs → chunk-SA6HUJVI.cjs} +5 -5
  63. package/dist/{chunk-K2T3DV26.mjs → chunk-TRM4JUZQ.js} +15 -4
  64. package/dist/chunk-UB4B6OFY.js +370 -0
  65. package/dist/{chunk-G3XGCZDQ.js → chunk-UCUBNWM2.js} +1 -1
  66. package/dist/chunk-VN44DYYT.cjs +2024 -0
  67. package/dist/{client-CtFmoDvM.d.ts → client-CZHU674n.d.ts} +211 -36
  68. package/dist/core/index.cjs +135 -9
  69. package/dist/core/index.d.ts +238 -33
  70. package/dist/core/index.js +155 -29
  71. package/dist/core/index.mjs +155 -29
  72. package/dist/{effect-CGNl5Rqp.d.ts → effect-DIUHZ9IN.d.ts} +89 -1
  73. package/dist/effectRunner-CFLC32IK.cjs +8 -0
  74. package/dist/{effectRunner-A4CHJXJI.js → effectRunner-L4S7IPT3.js} +2 -2
  75. package/dist/{effectRunner-OPUF6QRN.mjs → effectRunner-NNGG75QA.mjs} +2 -2
  76. package/dist/http/index.cjs +324 -2986
  77. package/dist/http/index.d.ts +54 -68
  78. package/dist/http/index.js +238 -2900
  79. package/dist/http/index.mjs +238 -2900
  80. package/dist/http/testing.cjs +14 -12
  81. package/dist/http/testing.d.ts +5 -4
  82. package/dist/http/testing.js +10 -8
  83. package/dist/http/testing.mjs +10 -8
  84. package/dist/index.cjs +423 -255
  85. package/dist/index.d.ts +87 -69
  86. package/dist/index.js +301 -133
  87. package/dist/index.mjs +301 -133
  88. package/dist/observability/index.cjs +16 -531
  89. package/dist/observability/index.d.ts +81 -8
  90. package/dist/observability/index.js +23 -538
  91. package/dist/observability/index.mjs +23 -538
  92. package/dist/perf/cli.cjs +401 -0
  93. package/dist/perf/cli.d.ts +1 -0
  94. package/dist/perf/cli.js +401 -0
  95. package/dist/perf/cli.mjs +401 -0
  96. package/dist/perf/index.cjs +141 -0
  97. package/dist/perf/index.d.ts +483 -0
  98. package/dist/perf/index.js +141 -0
  99. package/dist/perf/index.mjs +141 -0
  100. package/dist/schedule-CK3Ml_7p.d.ts +259 -0
  101. package/dist/schema/index.cjs +6 -2
  102. package/dist/schema/index.d.ts +3 -1
  103. package/dist/schema/index.js +5 -1
  104. package/dist/schema/index.mjs +5 -1
  105. package/dist/{server-C8hDXA74.d.ts → server-GJPg8ZSG.d.ts} +4 -3
  106. package/dist/{stream-dvSs0QS5.d.ts → stream-B4oK9JFP.d.ts} +1 -1
  107. package/dist/{tracer-B5tRH9H7.d.ts → tracer-Hwt1cl7h.d.ts} +13 -54
  108. package/dist/{tracing-Dt9S_6V8.d.ts → tracing-DqbTKGcf.d.ts} +1 -1
  109. package/docs/ARCHITECTURE.md +292 -0
  110. package/docs/README.md +63 -0
  111. package/docs/adr/0001-ai-context-pack.md +32 -0
  112. package/docs/agent-apply-mode.md +104 -0
  113. package/docs/agent-approvals.md +110 -0
  114. package/docs/agent-batch.md +185 -0
  115. package/docs/agent-boundaries.md +112 -0
  116. package/docs/agent-chat-sessions.md +160 -0
  117. package/docs/agent-ci.md +17 -0
  118. package/docs/agent-cli.md +405 -0
  119. package/docs/agent-config.md +480 -0
  120. package/docs/agent-context-discovery.md +159 -0
  121. package/docs/agent-copilot-like-dx.md +126 -0
  122. package/docs/agent-declarative-optimized-planning.md +138 -0
  123. package/docs/agent-dx.md +224 -0
  124. package/docs/agent-env-files.md +126 -0
  125. package/docs/agent-follow-up-context.md +43 -0
  126. package/docs/agent-global-usage.md +180 -0
  127. package/docs/agent-init.md +109 -0
  128. package/docs/agent-install-and-configure.md +516 -0
  129. package/docs/agent-language-workspace-ux.md +99 -0
  130. package/docs/agent-llm-adapters.md +123 -0
  131. package/docs/agent-local-install.md +190 -0
  132. package/docs/agent-local-tests.md +51 -0
  133. package/docs/agent-observability.md +155 -0
  134. package/docs/agent-patch-quality-loop.md +162 -0
  135. package/docs/agent-presets.md +22 -0
  136. package/docs/agent-project-commands.md +237 -0
  137. package/docs/agent-project-intelligence.md +156 -0
  138. package/docs/agent-redaction.md +18 -0
  139. package/docs/agent-release-readiness.md +76 -0
  140. package/docs/agent-rollback-safety.md +162 -0
  141. package/docs/agent-rollback.md +23 -0
  142. package/docs/agent-run-artifacts.md +16 -0
  143. package/docs/agent-vscode-auto-discovery.md +137 -0
  144. package/docs/agent-vscode-batch-runner.md +100 -0
  145. package/docs/agent-vscode-chat-layout.md +90 -0
  146. package/docs/agent-vscode-clean-install.md +147 -0
  147. package/docs/agent-vscode-code-actions.md +70 -0
  148. package/docs/agent-vscode-diff-preview.md +45 -0
  149. package/docs/agent-vscode-inline-assist.md +56 -0
  150. package/docs/agent-vscode-install.md +186 -0
  151. package/docs/agent-vscode-model-setup.md +97 -0
  152. package/docs/agent-vscode-patch-preview.md +92 -0
  153. package/docs/agent-vscode-problems.md +79 -0
  154. package/docs/agent-vscode-project-dashboard.md +106 -0
  155. package/docs/agent-vscode-run-history.md +92 -0
  156. package/docs/agent-vscode-ux.md +73 -0
  157. package/docs/ai/INVARIANTS.md +84 -0
  158. package/docs/ai/PROJECT_MAP.md +338 -0
  159. package/docs/ai/PUBLIC_API.md +336 -0
  160. package/docs/ai/VALIDATION_MATRIX.md +67 -0
  161. package/docs/api-polish.md +37 -0
  162. package/docs/cancellation.md +162 -0
  163. package/docs/coverage.md +46 -0
  164. package/docs/getting-started.md +159 -0
  165. package/docs/guides/README.md +40 -0
  166. package/docs/guides/circuit-breaker.md +89 -0
  167. package/docs/guides/error-handling.md +91 -0
  168. package/docs/guides/getting-started.md +107 -0
  169. package/docs/guides/layers.md +189 -0
  170. package/docs/guides/metrics.md +101 -0
  171. package/docs/guides/resource-management.md +141 -0
  172. package/docs/guides/retry.md +215 -0
  173. package/docs/guides/semaphore.md +66 -0
  174. package/docs/guides/streams.md +117 -0
  175. package/docs/guides/supervisors.md +98 -0
  176. package/docs/guides/testing.md +162 -0
  177. package/docs/guides/tracing.md +71 -0
  178. package/docs/http-recipes.md +399 -0
  179. package/docs/http.md +749 -0
  180. package/docs/modules.md +285 -0
  181. package/docs/observability-collector-smoke.md +31 -0
  182. package/docs/observability-framework-examples.md +98 -0
  183. package/docs/observability.md +542 -0
  184. package/docs/otel-collector-smoke.yaml +27 -0
  185. package/docs/performance-profiler.md +199 -0
  186. package/docs/production-readiness.md +73 -0
  187. package/docs/recipes/README.md +12 -0
  188. package/docs/recipes/http-server.md +45 -0
  189. package/docs/recipes/layers.md +44 -0
  190. package/docs/recipes/performance.md +47 -0
  191. package/docs/recipes/runtime.md +41 -0
  192. package/docs/recipes/testing.md +41 -0
  193. package/docs/release.md +53 -0
  194. package/docs/wasm-bounded-queues.md +44 -0
  195. package/docs/wasm-engine-observability-benchmarks.md +85 -0
  196. package/docs/wasm-fiber-engine.md +117 -0
  197. package/docs/wasm-scheduler-state-machine.md +122 -0
  198. package/docs/wasm-stream-chunks.md +54 -0
  199. package/package.json +22 -2
  200. package/dist/chunk-45F7OKGT.cjs +0 -104
  201. package/dist/chunk-7V4KY4RL.mjs +0 -104
  202. package/dist/chunk-DJQ7OMMB.cjs +0 -144
  203. package/dist/chunk-GOV47PPB.mjs +0 -552
  204. package/dist/chunk-JF4XXPZ5.cjs +0 -552
  205. package/dist/chunk-KCPT2D6G.js +0 -552
  206. package/dist/chunk-NOYZIMUJ.mjs +0 -144
  207. package/dist/chunk-PNVFW245.js +0 -144
  208. package/dist/chunk-ROJC3NBJ.js +0 -104
  209. package/dist/effectRunner-3ZHAD3LE.cjs +0 -8
  210. package/dist/schedule-Fque9Abz.d.ts +0 -70
@@ -1,29 +1,45 @@
1
1
  import {
2
+ Layer,
3
+ LayerContext,
4
+ MissingLayerServiceError,
2
5
  RuntimeRegistry,
3
6
  Supervisor,
7
+ TestClock,
8
+ TestScheduler,
4
9
  assertCompletesWithin,
5
10
  assertFails,
6
11
  assertFailsWith,
7
12
  assertSucceeds,
13
+ buildLayer,
8
14
  catchTag,
9
15
  catchTags,
10
16
  compose,
11
17
  consoleJsonLogger,
12
18
  defaultTracer,
19
+ defineLayer,
20
+ defineService,
13
21
  delayedEffect,
14
22
  derivedRef,
15
23
  dumpAllFibers,
16
24
  flakyEffect,
25
+ formatLayerError,
26
+ getService,
17
27
  gracefulShutdown,
18
28
  joinSupervised,
19
29
  layer,
30
+ layerEffect,
20
31
  layerFail,
21
32
  layerFrom,
33
+ layerFromContext,
22
34
  layerSucceed,
35
+ layerValue,
23
36
  linkAbortController,
24
37
  makeCancelToken,
38
+ makeLayerScope,
25
39
  makeRef,
40
+ makeRuntime,
26
41
  makeSemaphore,
42
+ makeServiceTag,
27
43
  makeSupervisor,
28
44
  makeTestRuntime,
29
45
  makeTracer,
@@ -33,51 +49,96 @@ import {
33
49
  merge,
34
50
  neverEffect,
35
51
  orElse,
52
+ provide,
53
+ provideContext,
36
54
  provideLayer,
55
+ provideLayerContext,
37
56
  registerShutdownHooks,
57
+ runEffect,
58
+ runExit,
59
+ runPromise,
60
+ serviceTag,
38
61
  supervise,
39
62
  tagError
40
- } from "../chunk-CY33PGEX.mjs";
63
+ } from "../chunk-KH4SYAOS.mjs";
41
64
  import {
42
65
  Resource,
43
- andThen,
44
66
  bracket,
67
+ ensuring,
68
+ makeCircuitBreaker,
69
+ makeResource,
70
+ managed,
71
+ managedAll,
72
+ resource,
73
+ resourceAll,
74
+ resourceFromManaged,
75
+ resourceSucceed,
76
+ useManaged,
77
+ useResource
78
+ } from "../chunk-KN32XNTH.mjs";
79
+ import {
80
+ fiberRefSnapshot,
81
+ getFiberRef,
82
+ locallyFiberRef,
83
+ locallyFiberRefWith,
84
+ makeFiberRef,
85
+ makeRuntimeRecorder,
86
+ modifyFiberRef,
87
+ setFiberRef,
88
+ unsafeGetFiberRef,
89
+ unsafeSetFiberRef,
90
+ updateFiberRef
91
+ } from "../chunk-EOC4UHBS.mjs";
92
+ import {
93
+ Schedule,
94
+ andThen,
45
95
  contramap,
46
96
  elapsed,
47
- ensuring,
48
97
  exponential,
49
98
  fibonacci,
50
99
  fixed,
100
+ forever,
51
101
  intersect,
52
102
  jitter,
53
103
  jittered,
54
104
  jitteredSchedule,
55
- makeCircuitBreaker,
56
- makeResource,
57
- managed,
58
- managedAll,
105
+ linear,
106
+ makeScheduleDriver,
59
107
  map as map2,
108
+ maxDelay,
109
+ maxElapsed,
110
+ named,
111
+ never,
112
+ once,
113
+ poll,
60
114
  recurs,
115
+ repeat,
61
116
  repeatWithSchedule,
62
- resource,
63
- resourceAll,
64
- resourceFromManaged,
65
- resourceSucceed,
117
+ retry,
118
+ retry2,
119
+ retryN,
120
+ retryWithBackoff,
66
121
  retryWithSchedule,
122
+ runSchedule,
123
+ scheduleDriver,
124
+ sleep,
125
+ spaced,
67
126
  take,
127
+ tapDecision,
128
+ timeout,
68
129
  union,
69
- useManaged,
70
- useResource,
130
+ untilInput,
131
+ untilOutput,
132
+ upTo,
71
133
  whileInput,
134
+ whileOutput,
72
135
  windowed
73
- } from "../chunk-GOV47PPB.mjs";
136
+ } from "../chunk-2HQTDLHF.mjs";
74
137
  import {
75
- retry,
76
- retryN,
77
- retryWithBackoff,
78
- sleep,
79
- timeout
80
- } from "../chunk-7V4KY4RL.mjs";
138
+ Scope,
139
+ withScope,
140
+ withScopeAsync
141
+ } from "../chunk-A2OM6NEH.mjs";
81
142
  import {
82
143
  EventBus,
83
144
  InMemoryTracer,
@@ -85,12 +146,7 @@ import {
85
146
  makeRuntimeEventRecord,
86
147
  runtimeEventRecordContext,
87
148
  runtimeHooksToEventHandler
88
- } from "../chunk-VFIUZG7J.mjs";
89
- import {
90
- Scope,
91
- withScope,
92
- withScopeAsync
93
- } from "../chunk-CCKHV5BT.mjs";
149
+ } from "../chunk-EJ6BPYVR.mjs";
94
150
  import {
95
151
  NoopHooks,
96
152
  Runtime,
@@ -103,7 +159,9 @@ import {
103
159
  fromPromiseAbortable,
104
160
  getBenchmarkBudget,
105
161
  getCurrentFiber,
162
+ liveClock,
106
163
  resetAbortablePromiseStats,
164
+ runtimeClockFromEnv,
107
165
  runtimeForCaller,
108
166
  setBenchmarkBudget,
109
167
  toPromise,
@@ -112,7 +170,7 @@ import {
112
170
  unsafeRunAsync,
113
171
  unsafeRunFoldWithEnv,
114
172
  withCurrentFiber
115
- } from "../chunk-G6IQOE4P.mjs";
173
+ } from "../chunk-GYM3LLGS.mjs";
116
174
  import {
117
175
  Async,
118
176
  Cause,
@@ -133,19 +191,25 @@ import {
133
191
  end,
134
192
  fail,
135
193
  flatMap,
194
+ formatCause,
195
+ interruptible,
196
+ isCause,
136
197
  map,
137
198
  mapAsync,
138
199
  mapError,
139
200
  mapTryAsync,
140
201
  none,
141
202
  orElseOptional,
203
+ prettyCause,
142
204
  some,
143
205
  succeed,
144
206
  sync,
207
+ uninterruptible,
208
+ uninterruptibleMask,
145
209
  unit,
146
210
  withAsyncPromise
147
- } from "../chunk-NOYZIMUJ.mjs";
148
- import "../chunk-U5KWK3PX.mjs";
211
+ } from "../chunk-36I3M4UC.mjs";
212
+ import "../chunk-DNFJLJMW.mjs";
149
213
  import "../chunk-Y6FXYEAI.mjs";
150
214
  export {
151
215
  Async,
@@ -153,13 +217,19 @@ export {
153
217
  EventBus,
154
218
  Exit,
155
219
  InMemoryTracer,
220
+ Layer,
221
+ LayerContext,
222
+ MissingLayerServiceError,
156
223
  NoopHooks,
157
224
  Resource,
158
225
  Runtime,
159
226
  RuntimeFiber,
160
227
  RuntimeRegistry,
228
+ Schedule,
161
229
  Scope,
162
230
  Supervisor,
231
+ TestClock,
232
+ TestScheduler,
163
233
  abortablePromiseStats,
164
234
  acquireRelease,
165
235
  andThen as andThenSchedule,
@@ -179,6 +249,7 @@ export {
179
249
  asyncSync,
180
250
  asyncTotal,
181
251
  bracket,
252
+ buildLayer,
182
253
  catchAll,
183
254
  catchTag,
184
255
  catchTags,
@@ -188,6 +259,8 @@ export {
188
259
  ctxExtend,
189
260
  ctxToObject,
190
261
  defaultTracer,
262
+ defineLayer,
263
+ defineService,
191
264
  delayedEffect,
192
265
  derivedRef,
193
266
  dumpAllFibers,
@@ -197,32 +270,53 @@ export {
197
270
  ensuring,
198
271
  exponential,
199
272
  fail,
273
+ fiberRefSnapshot,
200
274
  fibonacci,
201
275
  fixed,
202
276
  flakyEffect,
203
277
  flatMap,
278
+ forever,
204
279
  fork,
280
+ formatCause,
281
+ formatLayerError,
205
282
  fromPromiseAbortable,
206
283
  getBenchmarkBudget,
207
284
  getCurrentFiber,
285
+ getFiberRef,
286
+ getService,
208
287
  gracefulShutdown,
288
+ interruptible,
209
289
  intersect,
290
+ isCause,
210
291
  jitter,
211
292
  jittered,
212
293
  jitteredSchedule,
213
294
  joinSupervised,
214
295
  layer,
296
+ layerEffect,
215
297
  layerFail,
216
298
  layerFrom,
299
+ layerFromContext,
217
300
  layerSucceed,
301
+ layerValue,
302
+ linear,
218
303
  linkAbortController,
304
+ liveClock,
305
+ locallyFiberRef,
306
+ locallyFiberRefWith,
219
307
  makeCancelToken,
220
308
  makeCircuitBreaker,
309
+ makeFiberRef,
310
+ makeLayerScope,
221
311
  makeMetrics,
222
312
  makeRef,
223
313
  makeResource,
314
+ makeRuntime,
224
315
  makeRuntimeEventRecord,
316
+ makeRuntimeRecorder,
317
+ makeScheduleDriver,
225
318
  makeSemaphore,
319
+ makeServiceTag,
226
320
  makeSupervisor,
227
321
  makeTestRuntime,
228
322
  makeTracer,
@@ -236,15 +330,27 @@ export {
236
330
  mapLayer,
237
331
  map2 as mapSchedule,
238
332
  mapTryAsync,
333
+ maxDelay,
334
+ maxElapsed,
239
335
  merge as mergeLayer,
336
+ modifyFiberRef,
337
+ named as namedSchedule,
338
+ never,
240
339
  neverEffect,
241
340
  none,
341
+ once,
242
342
  orElse,
243
343
  orElseOptional,
344
+ poll as pollWithSchedule,
345
+ prettyCause,
346
+ provide,
347
+ provideContext,
244
348
  provideLayer,
349
+ provideLayerContext,
245
350
  recurs,
246
351
  registerShutdownHooks,
247
352
  repeatWithSchedule,
353
+ repeat as repeatWithScheduleAlias,
248
354
  resetAbortablePromiseStats,
249
355
  resource,
250
356
  resourceAll,
@@ -254,28 +360,48 @@ export {
254
360
  retryN,
255
361
  retryWithBackoff,
256
362
  retryWithSchedule,
363
+ retry2 as retryWithScheduleAlias,
364
+ runEffect,
365
+ runExit,
366
+ runPromise,
367
+ runSchedule,
368
+ runtimeClockFromEnv,
257
369
  runtimeEventRecordContext,
258
370
  runtimeForCaller,
259
371
  runtimeHooksToEventHandler,
372
+ scheduleDriver,
373
+ serviceTag,
260
374
  setBenchmarkBudget,
375
+ setFiberRef,
261
376
  sleep,
262
377
  some,
378
+ spaced,
263
379
  succeed,
264
380
  supervise,
265
381
  sync,
266
382
  tagError,
267
383
  take as takeSchedule,
384
+ tapDecision,
268
385
  timeout,
269
386
  toPromise,
270
387
  toPromiseByCaller,
388
+ uninterruptible,
389
+ uninterruptibleMask,
271
390
  union,
272
391
  unit,
273
392
  unsafeGetCurrentRuntime,
393
+ unsafeGetFiberRef,
274
394
  unsafeRunAsync,
275
395
  unsafeRunFoldWithEnv,
396
+ unsafeSetFiberRef,
397
+ untilInput,
398
+ untilOutput,
399
+ upTo,
400
+ updateFiberRef,
276
401
  useManaged,
277
402
  useResource,
278
403
  whileInput,
404
+ whileOutput,
279
405
  windowed,
280
406
  withAsyncPromise,
281
407
  withCurrentFiber,
@@ -232,6 +232,16 @@ type RuntimeEvent = {
232
232
  } | {
233
233
  type: "supervisor.shutdown";
234
234
  supervisorId: number;
235
+ } | {
236
+ type: "schedule.decision";
237
+ name?: string;
238
+ attempt: number;
239
+ elapsedMs: number;
240
+ delayMs: number;
241
+ continue: boolean;
242
+ reason?: string;
243
+ input?: unknown;
244
+ output?: unknown;
235
245
  } | {
236
246
  type: "log";
237
247
  level: "debug" | "info" | "warn" | "error";
@@ -669,6 +679,7 @@ declare class WasmFiberEngine<R> implements FiberEngine<R> {
669
679
  private scheduleHostAction;
670
680
  private onTimerExpired;
671
681
  private resumeWithExit;
682
+ private completeCause;
672
683
  private resumeWithValue;
673
684
  private resumeWithError;
674
685
  private schedulerTag;
@@ -749,6 +760,7 @@ declare class Runtime<R> {
749
760
  shutdown(): Promise<void> | void;
750
761
  unsafeRunAsync<E, A>(effect: Async<R, E, A>, cb: (exit: Exit<E, A>) => void): void;
751
762
  toPromise<E, A>(effect: Async<R, E, A>): Promise<A>;
763
+ private tryRunNativeTopLevel;
752
764
  unsafeRun<E, A>(effect: Async<R, E, A>): void;
753
765
  delay<E, A>(ms: number, eff: Async<R, E, A>): Async<R, E, A>;
754
766
  static make<R>(env: R, scheduler?: Scheduler): Runtime<R>;
@@ -841,6 +853,7 @@ type TraceContext = {
841
853
  type FiberContext = {
842
854
  log: ContextNode;
843
855
  trace: TraceContext | null;
856
+ fiberRefs?: Map<number, unknown>;
844
857
  };
845
858
 
846
859
  type FiberId = number;
@@ -870,6 +883,7 @@ declare class RuntimeFiber<R, E, A> implements Fiber<E, A> {
870
883
  private readonly stack;
871
884
  private readonly fiberFinalizers;
872
885
  private finalizersDrained;
886
+ private interruptibilityDepth;
873
887
  fiberContext: FiberContext;
874
888
  name?: string;
875
889
  scopeId?: number;
@@ -903,8 +917,15 @@ declare class RuntimeFiber<R, E, A> implements Fiber<E, A> {
903
917
  schedule(tag?: string): void;
904
918
  private runFinalizersOnce;
905
919
  private notify;
920
+ private isInterruptible;
921
+ private shouldInterruptNow;
922
+ private enterInterruptibility;
923
+ private restoreInterruptibility;
924
+ private fiberRefs;
925
+ private restoreFiberRef;
906
926
  private onSuccess;
907
927
  private onFailure;
928
+ private onCause;
908
929
  private budget;
909
930
  private step;
910
931
  /**
@@ -970,6 +991,8 @@ declare function withScopeAsync<R, E, A>(runtime: Runtime<R>, f: (scope: Scope<R
970
991
  declare function withScope<R>(runtime: Runtime<R>, f: (scope: Scope<R>) => void): Async<R, never, void>;
971
992
  declare function withScope<R, E, A>(runtime: Runtime<R>, f: (scope: Scope<R>) => Async<R, E, A>): Async<R, E, A>;
972
993
 
994
+ type InterruptibilityMode = "uninterruptible" | "interruptible";
995
+ type RestoreInterruptibility = <R, E, A>(effect: Async<R, E, A>) => Async<R, E, A>;
973
996
  type Async<R, E, A> = {
974
997
  readonly _tag: "Succeed";
975
998
  readonly value: A;
@@ -995,12 +1018,29 @@ type Async<R, E, A> = {
995
1018
  readonly _tag: "Fork";
996
1019
  readonly effect: Async<any, any, any>;
997
1020
  readonly scopeId?: number;
1021
+ } | {
1022
+ readonly _tag: "Interruptibility";
1023
+ readonly mode: InterruptibilityMode;
1024
+ readonly effect: Async<any, any, A>;
1025
+ } | {
1026
+ readonly _tag: "InterruptibilityMask";
1027
+ readonly body: (restore: RestoreInterruptibility) => Async<any, any, A>;
1028
+ } | {
1029
+ readonly _tag: "InterruptibilityRestore";
1030
+ readonly depth: number;
1031
+ readonly effect: Async<any, any, A>;
1032
+ } | {
1033
+ readonly _tag: "FiberRefLocally";
1034
+ readonly refId: number;
1035
+ readonly value: unknown;
1036
+ readonly effect: Async<any, any, A>;
998
1037
  };
999
1038
  declare const Async: {
1000
1039
  succeed: <R, E, A>(value: A) => Async<R, E, A>;
1001
1040
  fail: <R, E, A = never>(error: E) => Async<R, E, A>;
1002
1041
  sync: <R, E, A>(thunk: (env: R) => A) => Async<R, E, A>;
1003
1042
  async: <R, E, A>(register: (env: R, cb: (exit: Exit<E, A>) => void) => void | (() => void)) => Async<R, E, A>;
1043
+ interruptibility: <R, E, A>(mode: InterruptibilityMode, effect: Async<R, E, A>) => Async<R, E, A>;
1004
1044
  };
1005
1045
  declare function asyncFold<R, E, A, RFail, EFail, B, RSuccess, ESuccess, C>(fa: Async<R, E, A>, onFailure: (e: E) => Async<RFail, EFail, B>, onSuccess: (a: A) => Async<RSuccess, ESuccess, C>): Async<R & RFail & RSuccess, EFail | ESuccess, B | C>;
1006
1046
  declare function asyncCatchAll<R, E, A, R2, E2, B>(fa: Async<R, E, A>, handler: (e: E) => Async<R2, E2, B>): Async<R & R2, E2, A | B>;
@@ -1035,6 +1075,12 @@ type Option<A> = None | Some<A>;
1035
1075
  declare const none: Option<never>;
1036
1076
  declare const some: <A>(value: A) => Option<A>;
1037
1077
 
1078
+ type CausePrettyOptions<E = unknown> = {
1079
+ readonly renderError?: (error: E) => string;
1080
+ readonly renderDefect?: (defect: unknown) => string;
1081
+ readonly indent?: string;
1082
+ readonly singleLine?: boolean;
1083
+ };
1038
1084
  type Cause<E> = {
1039
1085
  readonly _tag: "Fail";
1040
1086
  readonly error: E;
@@ -1043,12 +1089,51 @@ type Cause<E> = {
1043
1089
  } | {
1044
1090
  readonly _tag: "Die";
1045
1091
  readonly defect: unknown;
1092
+ } | {
1093
+ readonly _tag: "Then";
1094
+ readonly left: Cause<E>;
1095
+ readonly right: Cause<E>;
1096
+ } | {
1097
+ readonly _tag: "Both";
1098
+ readonly left: Cause<E>;
1099
+ readonly right: Cause<E>;
1046
1100
  };
1047
1101
  declare const Cause: {
1048
1102
  fail: <E>(error: E) => Cause<E>;
1049
1103
  interrupt: <E = never>() => Cause<E>;
1050
1104
  die: <E = never>(defect: unknown) => Cause<E>;
1105
+ then: <E, E2>(left: Cause<E>, right: Cause<E2>) => Cause<E | E2>;
1106
+ both: <E, E2>(left: Cause<E>, right: Cause<E2>) => Cause<E | E2>;
1107
+ isCause: typeof isCauseValue;
1108
+ failures: typeof causeFailures;
1109
+ defects: typeof causeDefects;
1110
+ firstFailure: typeof firstCauseFailure;
1111
+ firstDefect: typeof firstCauseDefect;
1112
+ containsFailure: typeof causeContainsFailure;
1113
+ containsDefect: typeof causeContainsDefect;
1114
+ containsInterrupt: typeof causeContainsInterrupt;
1115
+ isInterruptedOnly: typeof causeIsInterruptedOnly;
1116
+ isFailureOnly: typeof causeIsFailureOnly;
1117
+ squash: typeof squashCause;
1118
+ toError: typeof causeToError;
1119
+ pretty: typeof prettyCause;
1120
+ format: typeof prettyCause;
1051
1121
  };
1122
+ declare function isCause(value: unknown): value is Cause<unknown>;
1123
+ declare function prettyCause<E>(cause: Cause<E>, options?: CausePrettyOptions<E>): string;
1124
+ declare const formatCause: typeof prettyCause;
1125
+ declare function isCauseValue(value: unknown): value is Cause<unknown>;
1126
+ declare function causeFailures<E>(cause: Cause<E>): readonly E[];
1127
+ declare function causeDefects<E>(cause: Cause<E>): readonly unknown[];
1128
+ declare function firstCauseFailure<E>(cause: Cause<E>): Option<E>;
1129
+ declare function firstCauseDefect<E>(cause: Cause<E>): Option<unknown>;
1130
+ declare function causeContainsFailure<E>(cause: Cause<E>): boolean;
1131
+ declare function causeContainsDefect<E>(cause: Cause<E>): boolean;
1132
+ declare function causeContainsInterrupt<E>(cause: Cause<E>): boolean;
1133
+ declare function causeIsInterruptedOnly<E>(cause: Cause<E>): boolean;
1134
+ declare function causeIsFailureOnly<E>(cause: Cause<E>): boolean;
1135
+ declare function squashCause<E>(cause: Cause<E>): unknown;
1136
+ declare function causeToError<E>(cause: Cause<E>): Error;
1052
1137
  type Exit<E, A> = {
1053
1138
  _tag: "Success";
1054
1139
  value: A;
@@ -1068,7 +1153,10 @@ declare const map: <R, E, A, B>(fa: ZIO<R, E, A>, f: (a: A) => B) => Async<R, E,
1068
1153
  declare const flatMap: <R, E, A, R2, E2, B>(fa: ZIO<R, E, A>, f: (a: A) => ZIO<R2, E2, B>) => ZIO<R & R2, E | E2, B>;
1069
1154
  declare const mapError: <R, E, E2, A>(fa: ZIO<R, E, A>, f: (e: E) => E2) => ZIO<R, E2, A>;
1070
1155
  declare const catchAll: <R, E, A, R2, E2, B>(fa: ZIO<R, E, A>, handler: (e: E) => ZIO<R2, E2, B>) => ZIO<R & R2, E2, A | B>;
1156
+ declare const uninterruptible: <R, E, A>(effect: ZIO<R, E, A>) => ZIO<R, E, A>;
1157
+ declare const interruptible: <R, E, A>(effect: ZIO<R, E, A>) => ZIO<R, E, A>;
1158
+ declare function uninterruptibleMask<R, E, A>(body: (restore: RestoreInterruptibility) => ZIO<R, E, A>): ZIO<R, E, A>;
1071
1159
  declare function orElseOptional<R, E, A, R2, A2>(fa: ZIO<R, Option<E>, A>, that: () => ZIO<R2, Option<E>, A2>): ZIO<R & R2, Option<E>, A | A2>;
1072
1160
  declare const end: <E>() => ZIO<unknown, Option<E>, never>;
1073
1161
 
1074
- export { type FiberInfo as $, Async as A, type Baggage as B, type AsyncWithPromise as C, type RingLike as D, Exit as E, type FiberEngine as F, type CancelToken as G, type Canceler as H, Cause as I, type JSONValue as J, type ContextNode as K, type CustomHostAction as L, type DbHostAction as M, type NodeId as N, type Option as O, type DecodeRef as P, DefaultHostExecutor as Q, type RuntimeHooks as R, Scope as S, type TraceContext as T, type EngineKind as U, type EngineSelection as V, type WasmEngineRuntime as W, type EngineSelectionMode as X, type FiberContext as Y, type ZIO as Z, type FiberEngineKind as _, type RingBufferOptions as a, fail as a$, type FiberReadyQueue as a0, type FiberReadyQueueOptions as a1, type FiberReadyQueueStats as a2, type FiberRunState as a3, type FlatMapRef as a4, type FoldFailureRef as a5, type FoldSuccessRef as a6, type HostAction as a7, type HostActionKind as a8, type HostActionResult as a9, type SchedulerStatsData as aA, type ScopeId as aB, type ScopeInfo as aC, type Some as aD, type SyncRef as aE, type Task as aF, WasmFiberEngine as aG, type WasmFiberEngineOptions as aH, abortablePromiseStats as aI, acquireRelease as aJ, asyncEffect as aK, asyncCatchAll as aL, asyncFail as aM, asyncFlatMap as aN, asyncFold as aO, asyncInterruptible as aP, asyncMap as aQ, asyncMapError as aR, asyncSucceed as aS, asyncSync as aT, asyncTotal as aU, catchAll as aV, ctxExtend as aW, ctxToObject as aX, emptyContext as aY, end as aZ, engineStats as a_, type HostExecutionContext as aa, type HostExecutor as ab, HostRegistry as ac, type HostRegistryStats as ad, type HttpHostAction as ae, type Interrupted as af, type Joiner as ag, type LaneStatsData as ah, type None as ai, NoopHooks as aj, ProgramBuilder as ak, type ProgramPatch as al, PushStatus as am, type QueueHostAction as an, type ReadyQueueScheduleKind as ao, RingBuffer as ap, type RingBufferEngine as aq, type RingBufferStatsData as ar, type RuntimeCapabilities as as, type RuntimeEngineMode as at, type ScheduleResult as au, Scheduler as av, type SchedulerEngine as aw, type SchedulerLaneMode as ax, type SchedulerOptions as ay, type SchedulerStats as az, type RuntimeEvent as b, flatMap as b0, fork as b1, fromPromiseAbortable as b2, getBenchmarkBudget as b3, getCurrentFiber as b4, globalScheduler as b5, inferCallerLaneFromStack as b6, laneTag as b7, linkAbortController as b8, makeBoundedRingBuffer as b9, withCurrentFiber as bA, withScope as bB, withScopeAsync as bC, makeCancelToken as ba, makeFiberReadyQueue as bb, makeRuntimeEventRecord as bc, map as bd, mapAsync as be, mapError as bf, mapTryAsync as bg, none as bh, orElseOptional as bi, resetAbortablePromiseStats as bj, runtimeCapabilities as bk, runtimeEventRecordContext as bl, runtimeForCaller as bm, sanitizeLaneKey as bn, selectedEngineStats as bo, setBenchmarkBudget as bp, some as bq, succeed as br, sync as bs, toPromise as bt, toPromiseByCaller as bu, unit as bv, unsafeGetCurrentRuntime as bw, unsafeRunAsync as bx, unsafeRunFoldWithEnv as by, withAsyncPromise as bz, type RuntimeEmitContext as c, type RuntimeEventRecord as d, type RuntimeSpanLink as e, Runtime as f, RuntimeRegistry as g, type RuntimeOptions as h, RuntimeFiber as i, type FiberEngineStats as j, type Fiber as k, type FiberId as l, type FiberStatus as m, type WasmBridge as n, type OpcodeProgram as o, type FiberId$1 as p, type EngineEvent as q, type RefId as r, type OpcodeNode as s, type EngineStats as t, type AbortablePromiseFinish as u, type AbortablePromiseLabelStats as v, type AbortablePromiseOptions as w, type AbortablePromiseOutcome as x, type AbortablePromiseStats as y, type AsyncRegisterRef as z };
1162
+ export { type FiberEngineKind as $, Async as A, type Baggage as B, type AsyncWithPromise as C, type RingLike as D, Exit as E, type FiberEngine as F, type CancelToken as G, type Canceler as H, Cause as I, type JSONValue as J, type CausePrettyOptions as K, type ContextNode as L, type CustomHostAction as M, type NodeId as N, type Option as O, type DbHostAction as P, type DecodeRef as Q, type RuntimeHooks as R, Scope as S, type TraceContext as T, DefaultHostExecutor as U, type EngineKind as V, type WasmEngineRuntime as W, type EngineSelection as X, type EngineSelectionMode as Y, type ZIO as Z, type FiberContext as _, type RuntimeEmitContext as a, emptyContext as a$, type FiberInfo as a0, type FiberReadyQueue as a1, type FiberReadyQueueOptions as a2, type FiberReadyQueueStats as a3, type FiberRunState as a4, type FlatMapRef as a5, type FoldFailureRef as a6, type FoldSuccessRef as a7, type HostAction as a8, type HostActionKind as a9, type SchedulerLaneMode as aA, type SchedulerOptions as aB, type SchedulerStats as aC, type SchedulerStatsData as aD, type ScopeId as aE, type ScopeInfo as aF, type Some as aG, type SyncRef as aH, type Task as aI, WasmFiberEngine as aJ, type WasmFiberEngineOptions as aK, abortablePromiseStats as aL, acquireRelease as aM, asyncEffect as aN, asyncCatchAll as aO, asyncFail as aP, asyncFlatMap as aQ, asyncFold as aR, asyncInterruptible as aS, asyncMap as aT, asyncMapError as aU, asyncSucceed as aV, asyncSync as aW, asyncTotal as aX, catchAll as aY, ctxExtend as aZ, ctxToObject as a_, type HostActionResult as aa, type HostExecutionContext as ab, type HostExecutor as ac, HostRegistry as ad, type HostRegistryStats as ae, type HttpHostAction as af, type Interrupted as ag, type InterruptibilityMode as ah, type Joiner as ai, type LaneStatsData as aj, type None as ak, NoopHooks as al, ProgramBuilder as am, type ProgramPatch as an, PushStatus as ao, type QueueHostAction as ap, type ReadyQueueScheduleKind as aq, type RestoreInterruptibility as ar, RingBuffer as as, type RingBufferEngine as at, type RingBufferStatsData as au, type RuntimeCapabilities as av, type RuntimeEngineMode as aw, type ScheduleResult as ax, Scheduler as ay, type SchedulerEngine as az, type RingBufferOptions as b, end as b0, engineStats as b1, fail as b2, flatMap as b3, fork as b4, formatCause as b5, fromPromiseAbortable as b6, getBenchmarkBudget as b7, getCurrentFiber as b8, globalScheduler as b9, toPromise as bA, toPromiseByCaller as bB, uninterruptible as bC, uninterruptibleMask as bD, unit as bE, unsafeGetCurrentRuntime as bF, unsafeRunAsync as bG, unsafeRunFoldWithEnv as bH, withAsyncPromise as bI, withCurrentFiber as bJ, withScope as bK, withScopeAsync as bL, inferCallerLaneFromStack as ba, interruptible as bb, isCause as bc, laneTag as bd, linkAbortController as be, makeBoundedRingBuffer as bf, makeCancelToken as bg, makeFiberReadyQueue as bh, makeRuntimeEventRecord as bi, map as bj, mapAsync as bk, mapError as bl, mapTryAsync as bm, none as bn, orElseOptional as bo, prettyCause as bp, resetAbortablePromiseStats as bq, runtimeCapabilities as br, runtimeEventRecordContext as bs, runtimeForCaller as bt, sanitizeLaneKey as bu, selectedEngineStats as bv, setBenchmarkBudget as bw, some as bx, succeed as by, sync as bz, type RuntimeEvent as c, type RuntimeEventRecord as d, type RuntimeSpanLink as e, Runtime as f, RuntimeRegistry as g, type RuntimeOptions as h, RuntimeFiber as i, type FiberEngineStats as j, type Fiber as k, type FiberId as l, type FiberStatus as m, type WasmBridge as n, type OpcodeProgram as o, type FiberId$1 as p, type EngineEvent as q, type RefId as r, type OpcodeNode as s, type EngineStats as t, type AbortablePromiseFinish as u, type AbortablePromiseLabelStats as v, type AbortablePromiseOptions as w, type AbortablePromiseOutcome as x, type AbortablePromiseStats as y, type AsyncRegisterRef as z };
@@ -0,0 +1,8 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkL6VB5N7Qcjs = require('./chunk-L6VB5N7Q.cjs');
4
+ require('./chunk-MVGUEJ5Z.cjs');
5
+ require('./chunk-OBGZSXTJ.cjs');
6
+
7
+
8
+ exports.registerHttpEffect = _chunkL6VB5N7Qcjs.registerHttpEffect;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  registerHttpEffect
3
- } from "./chunk-H55LI6WY.js";
4
- import "./chunk-PNVFW245.js";
3
+ } from "./chunk-TRM4JUZQ.js";
4
+ import "./chunk-UB4B6OFY.js";
5
5
  import "./chunk-3RG5ZIWI.js";
6
6
  export {
7
7
  registerHttpEffect
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  registerHttpEffect
3
- } from "./chunk-K2T3DV26.mjs";
4
- import "./chunk-NOYZIMUJ.mjs";
3
+ } from "./chunk-MOO4L7F4.mjs";
4
+ import "./chunk-36I3M4UC.mjs";
5
5
  import "./chunk-Y6FXYEAI.mjs";
6
6
  export {
7
7
  registerHttpEffect