brass-runtime 1.15.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 (209) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +673 -136
  3. package/dist/agent/cli/main.cjs +40 -35
  4. package/dist/agent/cli/main.js +9 -4
  5. package/dist/agent/cli/main.mjs +9 -4
  6. package/dist/agent/index.cjs +8 -4
  7. package/dist/agent/index.d.ts +1 -1
  8. package/dist/agent/index.js +7 -3
  9. package/dist/agent/index.mjs +7 -3
  10. package/dist/chunk-2HQTDLHF.mjs +683 -0
  11. package/dist/chunk-36I3M4UC.mjs +370 -0
  12. package/dist/chunk-3AYM6WPJ.js +1629 -0
  13. package/dist/chunk-3LOYJFRR.cjs +300 -0
  14. package/dist/chunk-3RG5ZIWI.js +10 -0
  15. package/dist/chunk-3Y2RIUMM.js +300 -0
  16. package/dist/{chunk-VEZNF5GZ.cjs → chunk-4ROBZFL6.cjs} +130 -126
  17. package/dist/{chunk-3QMOKAS5.js → chunk-52OB2ROS.js} +9 -5
  18. package/dist/chunk-52PPNNI4.cjs +416 -0
  19. package/dist/chunk-5EC274J5.cjs +2874 -0
  20. package/dist/chunk-5QC7LRZ3.js +229 -0
  21. package/dist/chunk-5VRJNBLZ.mjs +2874 -0
  22. package/dist/chunk-62AZW6UT.cjs +313 -0
  23. package/dist/chunk-6IXXWIUM.js +683 -0
  24. package/dist/chunk-74ZTY6CP.js +2871 -0
  25. package/dist/chunk-76YMRMH2.cjs +777 -0
  26. package/dist/chunk-7CMJS3QE.mjs +2871 -0
  27. package/dist/{chunk-4NHES7VK.mjs → chunk-7JIJOVCT.js} +27 -13
  28. package/dist/chunk-A2OM6NEH.mjs +194 -0
  29. package/dist/chunk-AGR5B2BC.cjs +683 -0
  30. package/dist/chunk-AVNQLJ5V.js +777 -0
  31. package/dist/chunk-B33ICAKP.js +313 -0
  32. package/dist/{chunk-ELOOF35R.mjs → chunk-B5JD23U7.mjs} +1 -1
  33. package/dist/chunk-BABBZK4Y.js +2024 -0
  34. package/dist/chunk-C3MDXTRZ.js +354 -0
  35. package/dist/chunk-CIZFIMK5.js +2193 -0
  36. package/dist/chunk-CZIVE6NT.cjs +354 -0
  37. package/dist/chunk-DNFJLJMW.mjs +354 -0
  38. package/dist/chunk-DNFO2EIZ.mjs +777 -0
  39. package/dist/chunk-EJ6BPYVR.mjs +416 -0
  40. package/dist/chunk-ENKODRU3.cjs +2193 -0
  41. package/dist/chunk-EOC4UHBS.mjs +229 -0
  42. package/dist/{chunk-BMH5AV44.js → chunk-FH2X7BVP.js} +756 -440
  43. package/dist/{chunk-PPUXIH5R.js → chunk-FHQGHPMO.mjs} +27 -13
  44. package/dist/{chunk-TGIFUAK4.cjs → chunk-GLE2WY7Z.cjs} +951 -635
  45. package/dist/{chunk-BDF4AMWX.mjs → chunk-GYM3LLGS.mjs} +756 -440
  46. package/dist/chunk-HLWLMW2F.mjs +2024 -0
  47. package/dist/chunk-JF5WGYJJ.cjs +194 -0
  48. package/dist/chunk-KH4SYAOS.mjs +1629 -0
  49. package/dist/chunk-KN32XNTH.mjs +313 -0
  50. package/dist/chunk-KQLYONSE.cjs +2871 -0
  51. package/dist/{chunk-STVLQ3XD.cjs → chunk-KZJQ723N.cjs} +92 -78
  52. package/dist/chunk-L2SYFEBS.js +194 -0
  53. package/dist/chunk-L6VB5N7Q.cjs +104 -0
  54. package/dist/{chunk-K6M7MDZ4.mjs → chunk-MBEJI5HF.mjs} +9 -5
  55. package/dist/chunk-MIIYDLGM.js +2874 -0
  56. package/dist/chunk-MOO4L7F4.mjs +104 -0
  57. package/dist/chunk-MT3OWDPC.mjs +2193 -0
  58. package/dist/chunk-MVGUEJ5Z.cjs +370 -0
  59. package/dist/chunk-OBGZSXTJ.cjs +10 -0
  60. package/dist/chunk-PD4EJTQC.cjs +229 -0
  61. package/dist/chunk-PWC3RBQE.mjs +300 -0
  62. package/dist/chunk-Q2I37RP3.cjs +1629 -0
  63. package/dist/chunk-RKGKFN2A.js +416 -0
  64. package/dist/{chunk-R3R2FVLG.cjs → chunk-SA6HUJVI.cjs} +5 -5
  65. package/dist/chunk-TRM4JUZQ.js +104 -0
  66. package/dist/chunk-UB4B6OFY.js +370 -0
  67. package/dist/{chunk-TO7IKXYT.js → chunk-UCUBNWM2.js} +1 -1
  68. package/dist/chunk-VN44DYYT.cjs +2024 -0
  69. package/dist/chunk-Y6FXYEAI.mjs +10 -0
  70. package/dist/client-CZHU674n.d.ts +820 -0
  71. package/dist/core/index.cjs +198 -4
  72. package/dist/core/index.d.ts +311 -212
  73. package/dist/core/index.js +237 -43
  74. package/dist/core/index.mjs +237 -43
  75. package/dist/{effect-CMOQKX8y.d.ts → effect-DIUHZ9IN.d.ts} +195 -1
  76. package/dist/effectRunner-CFLC32IK.cjs +8 -0
  77. package/dist/effectRunner-L4S7IPT3.js +8 -0
  78. package/dist/effectRunner-NNGG75QA.mjs +8 -0
  79. package/dist/http/index.cjs +1227 -2971
  80. package/dist/http/index.d.ts +826 -280
  81. package/dist/http/index.js +1089 -2833
  82. package/dist/http/index.mjs +1089 -2833
  83. package/dist/http/testing.cjs +161 -0
  84. package/dist/http/testing.d.ts +43 -0
  85. package/dist/http/testing.js +161 -0
  86. package/dist/http/testing.mjs +161 -0
  87. package/dist/index.cjs +486 -250
  88. package/dist/index.d.ts +87 -95
  89. package/dist/index.js +391 -155
  90. package/dist/index.mjs +391 -155
  91. package/dist/observability/index.cjs +162 -0
  92. package/dist/observability/index.d.ts +152 -0
  93. package/dist/observability/index.js +162 -0
  94. package/dist/observability/index.mjs +162 -0
  95. package/dist/perf/cli.cjs +401 -0
  96. package/dist/perf/cli.d.ts +1 -0
  97. package/dist/perf/cli.js +401 -0
  98. package/dist/perf/cli.mjs +401 -0
  99. package/dist/perf/index.cjs +141 -0
  100. package/dist/perf/index.d.ts +483 -0
  101. package/dist/perf/index.js +141 -0
  102. package/dist/perf/index.mjs +141 -0
  103. package/dist/schedule-CK3Ml_7p.d.ts +259 -0
  104. package/dist/schema/index.cjs +29 -0
  105. package/dist/schema/index.d.ts +179 -0
  106. package/dist/schema/index.js +29 -0
  107. package/dist/schema/index.mjs +29 -0
  108. package/dist/server-GJPg8ZSG.d.ts +675 -0
  109. package/dist/{stream-FQm9h4Mg.d.ts → stream-B4oK9JFP.d.ts} +1 -1
  110. package/dist/tracer-Hwt1cl7h.d.ts +189 -0
  111. package/dist/tracing-DqbTKGcf.d.ts +148 -0
  112. package/docs/ARCHITECTURE.md +292 -0
  113. package/docs/README.md +63 -0
  114. package/docs/adr/0001-ai-context-pack.md +32 -0
  115. package/docs/agent-apply-mode.md +104 -0
  116. package/docs/agent-approvals.md +110 -0
  117. package/docs/agent-batch.md +185 -0
  118. package/docs/agent-boundaries.md +112 -0
  119. package/docs/agent-chat-sessions.md +160 -0
  120. package/docs/agent-ci.md +17 -0
  121. package/docs/agent-cli.md +405 -0
  122. package/docs/agent-config.md +480 -0
  123. package/docs/agent-context-discovery.md +159 -0
  124. package/docs/agent-copilot-like-dx.md +126 -0
  125. package/docs/agent-declarative-optimized-planning.md +138 -0
  126. package/docs/agent-dx.md +224 -0
  127. package/docs/agent-env-files.md +126 -0
  128. package/docs/agent-follow-up-context.md +43 -0
  129. package/docs/agent-global-usage.md +180 -0
  130. package/docs/agent-init.md +109 -0
  131. package/docs/agent-install-and-configure.md +516 -0
  132. package/docs/agent-language-workspace-ux.md +99 -0
  133. package/docs/agent-llm-adapters.md +123 -0
  134. package/docs/agent-local-install.md +190 -0
  135. package/docs/agent-local-tests.md +51 -0
  136. package/docs/agent-observability.md +155 -0
  137. package/docs/agent-patch-quality-loop.md +162 -0
  138. package/docs/agent-presets.md +22 -0
  139. package/docs/agent-project-commands.md +237 -0
  140. package/docs/agent-project-intelligence.md +156 -0
  141. package/docs/agent-redaction.md +18 -0
  142. package/docs/agent-release-readiness.md +76 -0
  143. package/docs/agent-rollback-safety.md +162 -0
  144. package/docs/agent-rollback.md +23 -0
  145. package/docs/agent-run-artifacts.md +16 -0
  146. package/docs/agent-vscode-auto-discovery.md +137 -0
  147. package/docs/agent-vscode-batch-runner.md +100 -0
  148. package/docs/agent-vscode-chat-layout.md +90 -0
  149. package/docs/agent-vscode-clean-install.md +147 -0
  150. package/docs/agent-vscode-code-actions.md +70 -0
  151. package/docs/agent-vscode-diff-preview.md +45 -0
  152. package/docs/agent-vscode-inline-assist.md +56 -0
  153. package/docs/agent-vscode-install.md +186 -0
  154. package/docs/agent-vscode-model-setup.md +97 -0
  155. package/docs/agent-vscode-patch-preview.md +92 -0
  156. package/docs/agent-vscode-problems.md +79 -0
  157. package/docs/agent-vscode-project-dashboard.md +106 -0
  158. package/docs/agent-vscode-run-history.md +92 -0
  159. package/docs/agent-vscode-ux.md +73 -0
  160. package/docs/ai/INVARIANTS.md +84 -0
  161. package/docs/ai/PROJECT_MAP.md +338 -0
  162. package/docs/ai/PUBLIC_API.md +336 -0
  163. package/docs/ai/VALIDATION_MATRIX.md +67 -0
  164. package/docs/api-polish.md +37 -0
  165. package/docs/cancellation.md +162 -0
  166. package/docs/coverage.md +46 -0
  167. package/docs/getting-started.md +159 -0
  168. package/docs/guides/README.md +40 -0
  169. package/docs/guides/circuit-breaker.md +89 -0
  170. package/docs/guides/error-handling.md +91 -0
  171. package/docs/guides/getting-started.md +107 -0
  172. package/docs/guides/layers.md +189 -0
  173. package/docs/guides/metrics.md +101 -0
  174. package/docs/guides/resource-management.md +141 -0
  175. package/docs/guides/retry.md +215 -0
  176. package/docs/guides/semaphore.md +66 -0
  177. package/docs/guides/streams.md +117 -0
  178. package/docs/guides/supervisors.md +98 -0
  179. package/docs/guides/testing.md +162 -0
  180. package/docs/guides/tracing.md +71 -0
  181. package/docs/http-recipes.md +399 -0
  182. package/docs/http.md +749 -0
  183. package/docs/modules.md +285 -0
  184. package/docs/observability-collector-smoke.md +31 -0
  185. package/docs/observability-framework-examples.md +98 -0
  186. package/docs/observability.md +542 -0
  187. package/docs/otel-collector-smoke.yaml +27 -0
  188. package/docs/performance-profiler.md +199 -0
  189. package/docs/production-readiness.md +73 -0
  190. package/docs/recipes/README.md +12 -0
  191. package/docs/recipes/http-server.md +45 -0
  192. package/docs/recipes/layers.md +44 -0
  193. package/docs/recipes/performance.md +47 -0
  194. package/docs/recipes/runtime.md +41 -0
  195. package/docs/recipes/testing.md +41 -0
  196. package/docs/release.md +53 -0
  197. package/docs/wasm-bounded-queues.md +44 -0
  198. package/docs/wasm-engine-observability-benchmarks.md +85 -0
  199. package/docs/wasm-fiber-engine.md +117 -0
  200. package/docs/wasm-scheduler-state-machine.md +122 -0
  201. package/docs/wasm-stream-chunks.md +54 -0
  202. package/package.json +48 -2
  203. package/dist/chunk-AR22SXML.js +0 -1043
  204. package/dist/chunk-BDYEENHT.js +0 -224
  205. package/dist/chunk-JFPU5GQI.mjs +0 -1043
  206. package/dist/chunk-MS34J5LY.cjs +0 -224
  207. package/dist/chunk-UMAZLXAB.mjs +0 -224
  208. package/dist/chunk-XPZNXSVN.cjs +0 -1043
  209. package/dist/tracing-DNT9jEbr.d.ts +0 -106
@@ -92,6 +92,7 @@ declare function makeBoundedRingBuffer<T>(initialCapacity: number, maxCapacity?:
92
92
 
93
93
  type Task = () => void;
94
94
  type ScheduleResult = "accepted" | "dropped";
95
+ type SchedulerLaneMode = "fair" | "single";
95
96
  type SchedulerEngine = "ts" | "wasm";
96
97
  type LaneStatsData = {
97
98
  key: string;
@@ -116,6 +117,8 @@ type SchedulerStatsData = {
116
117
  type SchedulerStats = EngineStats<SchedulerStatsData>;
117
118
  type SchedulerOptions = RingBufferOptions & {
118
119
  engine?: SchedulerEngine;
120
+ /** fair keeps per-lane round-robin scheduling; single uses one direct TS queue for maximum throughput. */
121
+ laneMode?: SchedulerLaneMode;
119
122
  initialCapacity?: number;
120
123
  maxCapacity?: number;
121
124
  flushBudget?: number;
@@ -138,6 +141,7 @@ declare function inferCallerLaneFromStack(stack?: string | undefined, fallback?:
138
141
  declare class Scheduler {
139
142
  private readonly engine;
140
143
  private readonly js?;
144
+ private readonly jsSingle?;
141
145
  private readonly wasm?;
142
146
  private readonly flushBudget;
143
147
  private readonly microThreshold;
@@ -146,6 +150,7 @@ declare class Scheduler {
146
150
  private readonly maxLanes;
147
151
  private readonly fallbackUsed;
148
152
  private readonly boundFlush;
153
+ private shiftedTag;
149
154
  constructor(options?: SchedulerOptions);
150
155
  schedule(task: Task, tag?: string): ScheduleResult;
151
156
  scheduleBatch(tasks: Array<{
@@ -157,10 +162,13 @@ declare class Scheduler {
157
162
  private scheduleBatchWasm;
158
163
  private getOrCreateLane;
159
164
  private createLane;
165
+ private scheduleJsSingle;
166
+ private scheduleBatchJsSingle;
160
167
  private scheduleJs;
161
168
  private requestFlush;
162
169
  private flush;
163
170
  private flushWasm;
171
+ private flushJsSingle;
164
172
  private shiftFromNextLane;
165
173
  private flushJs;
166
174
  }
@@ -193,17 +201,83 @@ type RuntimeEvent = {
193
201
  scopeId: number;
194
202
  status: "success" | "failure" | "interrupted";
195
203
  error?: unknown;
204
+ } | {
205
+ type: "supervisor.child.start";
206
+ supervisorId: number;
207
+ childId: number;
208
+ name?: string;
209
+ restartCount: number;
210
+ } | {
211
+ type: "supervisor.child.end";
212
+ supervisorId: number;
213
+ childId: number;
214
+ name?: string;
215
+ status: "success" | "failure" | "interrupted";
216
+ error?: unknown;
217
+ } | {
218
+ type: "supervisor.child.restart";
219
+ supervisorId: number;
220
+ childId: number;
221
+ name?: string;
222
+ restartCount: number;
223
+ delayMs: number;
224
+ reason?: string;
225
+ } | {
226
+ type: "supervisor.child.escalate";
227
+ supervisorId: number;
228
+ childId: number;
229
+ name?: string;
230
+ reason?: string;
231
+ error?: unknown;
232
+ } | {
233
+ type: "supervisor.shutdown";
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;
196
245
  } | {
197
246
  type: "log";
198
247
  level: "debug" | "info" | "warn" | "error";
199
248
  message: string;
200
249
  fields?: Record<string, unknown>;
250
+ } | {
251
+ type: "span.start";
252
+ name: string;
253
+ attributes?: Record<string, unknown>;
254
+ links?: RuntimeSpanLink[];
255
+ } | {
256
+ type: "span.event";
257
+ name: string;
258
+ attributes?: Record<string, unknown>;
259
+ } | {
260
+ type: "span.end";
261
+ name?: string;
262
+ status: "success" | "failure" | "interrupted";
263
+ error?: unknown;
264
+ attributes?: Record<string, unknown>;
201
265
  };
202
266
  type RuntimeEmitContext = {
203
267
  fiberId?: number;
204
268
  scopeId?: number;
205
269
  traceId?: string;
206
270
  spanId?: string;
271
+ parentSpanId?: string;
272
+ traceState?: string;
273
+ baggage?: Record<string, string>;
274
+ sampled?: boolean;
275
+ };
276
+ type RuntimeSpanLink = {
277
+ traceId: string;
278
+ spanId: string;
279
+ traceState?: string;
280
+ attributes?: Record<string, string | number | boolean>;
207
281
  };
208
282
  interface RuntimeHooks {
209
283
  emit(ev: RuntimeEvent, ctx: RuntimeEmitContext): void;
@@ -212,6 +286,13 @@ type RuntimeEventRecord = RuntimeEvent & RuntimeEmitContext & {
212
286
  seq: number;
213
287
  wallTs: number;
214
288
  ts: number;
289
+ /**
290
+ * The ambient fiber/scope from RuntimeEmitContext. Event payload fields
291
+ * keep priority in the merged record, so these preserve the context when
292
+ * an event also has a fiberId/scopeId of its own.
293
+ */
294
+ contextFiberId?: number;
295
+ contextScopeId?: number;
215
296
  /**
216
297
  * Convenience fields for generic event consumers. They are present for
217
298
  * log events and absent for fiber/scope events, but keeping them optional
@@ -222,6 +303,8 @@ type RuntimeEventRecord = RuntimeEvent & RuntimeEmitContext & {
222
303
  message?: string;
223
304
  fields?: Record<string, unknown>;
224
305
  };
306
+ declare function makeRuntimeEventRecord(ev: RuntimeEvent, ctx: RuntimeEmitContext, seq: number): RuntimeEventRecord;
307
+ declare function runtimeEventRecordContext(record: RuntimeEventRecord): RuntimeEmitContext;
225
308
 
226
309
  type FiberRunState = "Queued" | "Running" | "Suspended" | "Done";
227
310
  type FiberInfo = {
@@ -528,9 +611,36 @@ interface WasmBridge {
528
611
  }
529
612
  type Joiner<E, A> = (exit: Exit<E, A>) => void;
530
613
 
614
+ type ReadyQueueScheduleKind = "micro" | "macro" | "none" | "dropped";
615
+ type FiberReadyQueueStats = {
616
+ readonly engine: "ts" | "wasm";
617
+ readonly fallbackUsed: boolean;
618
+ readonly data: unknown;
619
+ };
620
+ interface FiberReadyQueue {
621
+ readonly engine: "ts" | "wasm";
622
+ enqueue(fiberId: FiberId$1, tag: string): ReadyQueueScheduleKind;
623
+ beginFlush(): number;
624
+ shift(): FiberId$1 | undefined;
625
+ endFlush(ran: number): ReadyQueueScheduleKind;
626
+ len(): number;
627
+ clear(): void;
628
+ stats(): FiberReadyQueueStats;
629
+ }
630
+ type FiberReadyQueueOptions = {
631
+ readonly engine?: "ts" | "wasm";
632
+ readonly flushBudget?: number;
633
+ readonly microThreshold?: number;
634
+ readonly laneCapacity?: number;
635
+ readonly laneBudget?: number;
636
+ readonly maxLanes?: number;
637
+ };
638
+ declare function makeFiberReadyQueue(options?: FiberReadyQueueOptions): FiberReadyQueue;
639
+
531
640
  type WasmFiberEngineOptions = {
532
641
  readonly bridge?: WasmBridge;
533
642
  readonly modulePath?: string;
643
+ readonly readyQueue?: Omit<FiberReadyQueueOptions, "engine">;
534
644
  };
535
645
  declare class WasmFiberEngine<R> implements FiberEngine<R> {
536
646
  private readonly runtime;
@@ -569,6 +679,7 @@ declare class WasmFiberEngine<R> implements FiberEngine<R> {
569
679
  private scheduleHostAction;
570
680
  private onTimerExpired;
571
681
  private resumeWithExit;
682
+ private completeCause;
572
683
  private resumeWithValue;
573
684
  private resumeWithError;
574
685
  private schedulerTag;
@@ -649,6 +760,7 @@ declare class Runtime<R> {
649
760
  shutdown(): Promise<void> | void;
650
761
  unsafeRunAsync<E, A>(effect: Async<R, E, A>, cb: (exit: Exit<E, A>) => void): void;
651
762
  toPromise<E, A>(effect: Async<R, E, A>): Promise<A>;
763
+ private tryRunNativeTopLevel;
652
764
  unsafeRun<E, A>(effect: Async<R, E, A>): void;
653
765
  delay<E, A>(ms: number, eff: Async<R, E, A>): Async<R, E, A>;
654
766
  static make<R>(env: R, scheduler?: Scheduler): Runtime<R>;
@@ -726,15 +838,22 @@ type ContextNode = {
726
838
  parent: ContextNode | null;
727
839
  patch: Record<string, JSONValue>;
728
840
  };
841
+ declare const emptyContext: ContextNode;
842
+ declare function ctxExtend(parent: ContextNode, patch: Record<string, JSONValue>): ContextNode;
843
+ declare function ctxToObject(ctx: ContextNode): Record<string, JSONValue>;
844
+ type Baggage = Record<string, string>;
729
845
  type TraceContext = {
730
846
  traceId: string;
731
847
  spanId: string;
732
848
  parentSpanId?: string;
733
849
  sampled?: boolean;
850
+ traceState?: string;
851
+ baggage?: Baggage;
734
852
  };
735
853
  type FiberContext = {
736
854
  log: ContextNode;
737
855
  trace: TraceContext | null;
856
+ fiberRefs?: Map<number, unknown>;
738
857
  };
739
858
 
740
859
  type FiberId = number;
@@ -764,6 +883,7 @@ declare class RuntimeFiber<R, E, A> implements Fiber<E, A> {
764
883
  private readonly stack;
765
884
  private readonly fiberFinalizers;
766
885
  private finalizersDrained;
886
+ private interruptibilityDepth;
767
887
  fiberContext: FiberContext;
768
888
  name?: string;
769
889
  scopeId?: number;
@@ -797,8 +917,15 @@ declare class RuntimeFiber<R, E, A> implements Fiber<E, A> {
797
917
  schedule(tag?: string): void;
798
918
  private runFinalizersOnce;
799
919
  private notify;
920
+ private isInterruptible;
921
+ private shouldInterruptNow;
922
+ private enterInterruptibility;
923
+ private restoreInterruptibility;
924
+ private fiberRefs;
925
+ private restoreFiberRef;
800
926
  private onSuccess;
801
927
  private onFailure;
928
+ private onCause;
802
929
  private budget;
803
930
  private step;
804
931
  /**
@@ -864,6 +991,8 @@ declare function withScopeAsync<R, E, A>(runtime: Runtime<R>, f: (scope: Scope<R
864
991
  declare function withScope<R>(runtime: Runtime<R>, f: (scope: Scope<R>) => void): Async<R, never, void>;
865
992
  declare function withScope<R, E, A>(runtime: Runtime<R>, f: (scope: Scope<R>) => Async<R, E, A>): Async<R, E, A>;
866
993
 
994
+ type InterruptibilityMode = "uninterruptible" | "interruptible";
995
+ type RestoreInterruptibility = <R, E, A>(effect: Async<R, E, A>) => Async<R, E, A>;
867
996
  type Async<R, E, A> = {
868
997
  readonly _tag: "Succeed";
869
998
  readonly value: A;
@@ -889,12 +1018,29 @@ type Async<R, E, A> = {
889
1018
  readonly _tag: "Fork";
890
1019
  readonly effect: Async<any, any, any>;
891
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>;
892
1037
  };
893
1038
  declare const Async: {
894
1039
  succeed: <R, E, A>(value: A) => Async<R, E, A>;
895
1040
  fail: <R, E, A = never>(error: E) => Async<R, E, A>;
896
1041
  sync: <R, E, A>(thunk: (env: R) => A) => Async<R, E, A>;
897
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>;
898
1044
  };
899
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>;
900
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>;
@@ -929,6 +1075,12 @@ type Option<A> = None | Some<A>;
929
1075
  declare const none: Option<never>;
930
1076
  declare const some: <A>(value: A) => Option<A>;
931
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
+ };
932
1084
  type Cause<E> = {
933
1085
  readonly _tag: "Fail";
934
1086
  readonly error: E;
@@ -937,12 +1089,51 @@ type Cause<E> = {
937
1089
  } | {
938
1090
  readonly _tag: "Die";
939
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>;
940
1100
  };
941
1101
  declare const Cause: {
942
1102
  fail: <E>(error: E) => Cause<E>;
943
1103
  interrupt: <E = never>() => Cause<E>;
944
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;
945
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;
946
1137
  type Exit<E, A> = {
947
1138
  _tag: "Success";
948
1139
  value: A;
@@ -962,7 +1153,10 @@ declare const map: <R, E, A, B>(fa: ZIO<R, E, A>, f: (a: A) => B) => Async<R, E,
962
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>;
963
1154
  declare const mapError: <R, E, E2, A>(fa: ZIO<R, E, A>, f: (e: E) => E2) => ZIO<R, E2, A>;
964
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>;
965
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>;
966
1160
  declare const end: <E>() => ZIO<unknown, Option<E>, never>;
967
1161
 
968
- export { type Joiner as $, Async as A, type EngineKind as B, type CancelToken as C, type DbHostAction as D, Exit as E, type FiberEngine as F, type EngineSelection as G, type EngineSelectionMode as H, type FiberEngineKind as I, type FlatMapRef as J, type FoldFailureRef as K, type FoldSuccessRef as L, type HostAction as M, type NodeId as N, type Option as O, type HostActionKind as P, type HostActionResult as Q, RuntimeFiber as R, Scope as S, type HostExecutionContext as T, type HostExecutor as U, HostRegistry as V, type WasmEngineRuntime as W, type HostRegistryStats as X, type HttpHostAction as Y, type ZIO as Z, type Interrupted as _, type FiberEngineStats as a, sanitizeLaneKey as a$, type LaneStatsData as a0, type None as a1, NoopHooks as a2, ProgramBuilder as a3, type ProgramPatch as a4, PushStatus as a5, type QueueHostAction as a6, RingBuffer as a7, type RingBufferEngine as a8, type RingBufferStatsData as a9, asyncSucceed as aA, asyncSync as aB, asyncTotal as aC, catchAll as aD, end as aE, engineStats as aF, fail as aG, flatMap as aH, fork as aI, fromPromiseAbortable as aJ, getBenchmarkBudget as aK, getCurrentFiber as aL, globalScheduler as aM, inferCallerLaneFromStack as aN, laneTag as aO, linkAbortController as aP, makeBoundedRingBuffer as aQ, makeCancelToken as aR, map as aS, mapAsync as aT, mapError as aU, mapTryAsync as aV, none as aW, orElseOptional as aX, resetAbortablePromiseStats as aY, runtimeCapabilities as aZ, runtimeForCaller as a_, Runtime as aa, type RuntimeCapabilities as ab, type RuntimeEngineMode as ac, type RuntimeOptions as ad, type ScheduleResult as ae, Scheduler as af, type SchedulerEngine as ag, type SchedulerOptions as ah, type SchedulerStats as ai, type SchedulerStatsData as aj, type ScopeId as ak, type Some as al, type SyncRef as am, type Task as an, WasmFiberEngine as ao, type WasmFiberEngineOptions as ap, abortablePromiseStats as aq, acquireRelease as ar, asyncEffect as as, asyncCatchAll as at, asyncFail as au, asyncFlatMap as av, asyncFold as aw, asyncInterruptible as ax, asyncMap as ay, asyncMapError as az, type Fiber as b, selectedEngineStats as b0, setBenchmarkBudget as b1, some as b2, succeed as b3, sync as b4, toPromise as b5, toPromiseByCaller as b6, unit as b7, unsafeGetCurrentRuntime as b8, unsafeRunAsync as b9, unsafeRunFoldWithEnv as ba, withAsyncPromise as bb, withCurrentFiber as bc, withScope as bd, withScopeAsync as be, type FiberId as c, type FiberStatus as d, type RuntimeEvent as e, type WasmBridge as f, type OpcodeProgram as g, type FiberId$1 as h, type EngineEvent as i, type RefId as j, type OpcodeNode as k, type RingBufferOptions as l, type EngineStats as m, type AbortablePromiseFinish as n, type AbortablePromiseLabelStats as o, type AbortablePromiseOptions as p, type AbortablePromiseOutcome as q, type AbortablePromiseStats as r, type AsyncRegisterRef as s, type AsyncWithPromise as t, type RingLike as u, type Canceler as v, Cause as w, type CustomHostAction as x, type DecodeRef as y, DefaultHostExecutor 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;
@@ -0,0 +1,8 @@
1
+ import {
2
+ registerHttpEffect
3
+ } from "./chunk-TRM4JUZQ.js";
4
+ import "./chunk-UB4B6OFY.js";
5
+ import "./chunk-3RG5ZIWI.js";
6
+ export {
7
+ registerHttpEffect
8
+ };
@@ -0,0 +1,8 @@
1
+ import {
2
+ registerHttpEffect
3
+ } from "./chunk-MOO4L7F4.mjs";
4
+ import "./chunk-36I3M4UC.mjs";
5
+ import "./chunk-Y6FXYEAI.mjs";
6
+ export {
7
+ registerHttpEffect
8
+ };