brass-runtime 1.13.2 → 1.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1,855 @@
1
- import {b,p,d,k,a,f as f$1}from'./chunk-JAQUSSUV.js';export{l as assertNever,r as collectStream,h as concatStream,g as emitStream,f as emptyStream,i as flattenStream,p as foreachStream,q as fromArray,b as fromPull,d as managedStream,m as mapStream,j as merge,e as mergeStream,n as rangeStream,s as streamFromReadableStream,k as uncons,c as unwrapScoped,a as widenOpt,o as zip}from'./chunk-JAQUSSUV.js';import {h,H,j,i,l,f,d as d$1,r,O,s,b as b$1,g,G as G$1,aa}from'./chunk-LTHJNW5A.js';export{a as Async,t as Cause,Q as DefaultHostExecutor,U as EngineFiberHandle,u as Exit,S as HostRegistry,R as JsFiberEngine,_ as NoopHooks,T as ProgramBuilder,E as PushStatus,V as ReferenceWasmBridge,F as RingBuffer,$ as Runtime,M as RuntimeFiber,I as Scheduler,fa as Scope,Y as WasmFiberEngine,X as WasmFiberRegistryBridge,W as WasmPackFiberBridge,m as acquireRelease,j as async,c as asyncCatchAll,g as asyncFail,l as asyncFlatMap,b as asyncFold,n as asyncInterruptible,k as asyncMap,d as asyncMapError,f as asyncSucceed,h as asyncSync,i as asyncTotal,B as catchAll,ka as collectAllPar,D as end,w as fail,z as flatMap,aa as fork,da as fromPromiseAbortable,L as getBenchmarkBudget,N as getCurrentFiber,J as globalScheduler,H as makeBoundedRingBuffer,y as map,p as mapAsync,A as mapError,q as mapTryAsync,r as none,C as orElseOptional,ia as race,la as raceWith,Z as runtimeCapabilities,K as setBenchmarkBudget,s as some,v as succeed,x as sync,ca as toPromise,e as unit,O as unsafeGetCurrentRuntime,ba as unsafeRunAsync,ea as unsafeRunFoldWithEnv,o as withAsyncPromise,P as withCurrentFiber,ha as withScope,ga as withScopeAsync,ja as zipPar}from'./chunk-LTHJNW5A.js';function En(){let n=false,e=new Set;return {isCancelled:()=>n,onCancel:r=>{if(n){try{r();}catch{}return ()=>{}}return e.add(r),()=>{e.delete(r);}},cancel:()=>{n||(n=true,e.forEach(r=>r()),e.clear());}}}function An(n,e){return n.onCancel(()=>e.abort())}var C=class{head=null;tail=null;len=0;get length(){return this.len}isEmpty(){return this.len===0}push(e){let t={value:e,next:null,prev:this.tail,removed:false};return this.tail?this.tail.next=t:this.head=t,this.tail=t,this.len++,t}shift(){let e=this.head;if(e)return this.unlink(e),e.value}remove(e){e.removed||this.unlink(e);}unlink(e){e.removed=true;let{prev:t,next:r}=e;t?t.next=r:this.head=r,r?r.prev=t:this.tail=t,e.next=null,e.prev=null,this.len--;}};function B(n,e="backpressure",t={}){return h(()=>X(n,e,t))}function X(n,e,t){let r=H(n,n,t),i=false,a={_tag:"QueueClosed"},o=new C,s=new C;return {size:()=>r.length,shutdown:()=>{if(!i){for(i=true;s.length>0;)s.shift()({_tag:"Failure",cause:{_tag:"Fail",error:a}});for(;o.length>0;)o.shift().cb(false);r.clear();}},offer:l=>j((f,y)=>{if(i){y({_tag:"Success",value:false});return}if(s.length>0){s.shift()({_tag:"Success",value:l}),y({_tag:"Success",value:true});return}if(r.length<n){r.push(l),y({_tag:"Success",value:true});return}if(e==="dropping"){y({_tag:"Success",value:false});return}if(e==="sliding"){r.shift(),r.push(l),y({_tag:"Success",value:true});return}let R=o.push({a:l,cb:E=>y({_tag:"Success",value:E})});return ()=>{o.remove(R);}}),take:()=>j((l,f)=>{if(r.length>0){let c=r.shift();if(f({_tag:"Success",value:c}),o.length>0&&r.length<n){let E=o.shift();r.push(E.a),E.cb(true);}return}if(o.length>0){let c=o.shift();c.cb(true),f({_tag:"Success",value:c.a});return}if(i){f({_tag:"Failure",cause:{_tag:"Fail",error:a}});return}let y=s.push(f);return ()=>{s.remove(y);}})}}var Y={_tag:"End"};function q(n,e,t="backpressure"){let r$1=false,i=null,a=null,o=n,s$1=c=>f(c._tag==="None"?Y:{_tag:"Fail",error:c.value}),u=([c,E])=>h(()=>(o=E,{_tag:"Elem",value:c})),l$1=()=>b$1(k(o),s$1,u),f$1=c=>l(B(e,t),E=>{i=E;let x,Z=()=>x._tag!=="Elem"?f(void 0):Q(),v=z=>(x=z,l(i.offer(z),Z)),Q=()=>l(l$1(),v);return a=aa(Q(),c),f(void 0)}),y={_tag:"Async",register:(c,E)=>{(()=>{if(!r$1){r$1=true,O().fork(f$1(c)).join(()=>{R(c,E);});return}R(c,E);})();}};function R(c,E){let x=i.take();O().fork(x).join(Z=>{if(Z._tag!=="Success")return;let v=Z.value;switch(v._tag){case "Elem":E({_tag:"Success",value:[v.value,b(y)]});return;case "End":a?.interrupt?.(),E({_tag:"Failure",cause:{_tag:"Fail",error:r}});return;case "Fail":a?.interrupt?.(),E({_tag:"Failure",cause:{_tag:"Fail",error:s(v.error)}});return}});}return b(y)}var $=n=>n==="BackPressure"?"backpressure":n==="Dropping"?"dropping":"sliding";function ee(n,e="BackPressure"){let t=new Set,r=false,i$1=u=>{if(r)return f(false);let l$1=t.size;if(l$1===0)return f(true);if(l$1===1)return t.values().next().value.offer(u);let f$1=f(true);for(let y of t)f$1=l(f$1,R=>l(y.offer(u),c=>f(R&&c)));return f$1};return {publish:i$1,publishAll:u=>{let l$1=f(true),f$1=u[Symbol.iterator]();for(;;){let y=f$1.next();if(y.done)break;let R=y.value;l$1=l(l$1,c=>l(i$1(R),E=>f(c&&E)));}return l$1},subscribe:()=>r?i(()=>{throw {_tag:"HubClosed"}}):l(B(n,$(e)),u=>h(()=>(t.add(u),{...u,unsubscribe:()=>{t.has(u)&&(t.delete(u),u.shutdown());}}))),shutdown:()=>h(()=>{if(!r){r=true;for(let u of t)u.shutdown();t.clear();}})}}var $n=ee;function et(n,e){return p(n,t=>l(e.publish(t),()=>f(void 0)))}function nt(n){return d(l(n.subscribe(),e=>{let t=b(l(d$1(e.take(),r$1=>r),r=>f([r,t])));return f({stream:t,release:r=>h(()=>e.unsubscribe())})}))}var _;function G(){return _!==void 0||(_=G$1()?.BrassWasmChunkBuffer??null),_}var P=class{constructor(e,t=false){this.maxChunkSize=e;this.fallbackUsed=t;}maxChunkSize;fallbackUsed;engine="js";values=[];emittedChunks=0;emittedItems=0;flushes=0;get length(){return this.values.length}push(e){return this.values.length>=this.maxChunkSize?false:(this.values.push(e),true)}isFull(){return this.values.length>=this.maxChunkSize}isEmpty(){return this.values.length===0}takeChunk(){this.flushes+=1;let e=this.values;return this.values=[],e.length>0&&(this.emittedChunks+=1,this.emittedItems+=e.length),e}clear(){this.values=[];}stats(){return {engine:"js",fallbackUsed:this.fallbackUsed,data:{len:this.values.length,maxChunkSize:this.maxChunkSize,emittedChunks:this.emittedChunks,emittedItems:this.emittedItems,flushes:this.flushes}}}},T=class{engine="wasm";fallbackUsed=false;inner;constructor(e){let t=G();if(!t)throw new Error("brass-runtime wasm chunk buffer is not available. Run npm run build:wasm first.");this.inner=new t(e);}get length(){return this.inner.len()}get maxChunkSize(){return this.inner.max_chunk_size()}push(e){return this.inner.push(e)}isFull(){return this.inner.is_full()}isEmpty(){return this.inner.is_empty()}takeChunk(){return Array.from(this.inner.take_chunk())}clear(){this.inner.clear();}stats(){return {engine:"wasm",fallbackUsed:false,data:JSON.parse(this.inner.stats_json())}}};function ne(n,e={}){let t=Math.max(1,n|0),r=e.engine??"auto";return r==="js"?new P(t,false):r==="wasm"?new T(t):G()?new T(t):new P(t,true)}function F(n,e,t={}){let r$1=Math.max(1,e|0),i=o=>b(a(o,ne(r$1,t))),a=(o,s)=>b$1(k(o),u=>u._tag==="None"&&!s.isEmpty()?f([s.takeChunk(),b(g(r))]):g(u),([u,l])=>(s.push(u),s.isFull()?f([s.takeChunk(),i(l)]):a(l,s)));return i(n)}function pt(n,e,t,r={}){let i=(a,o)=>{if(a.length>0){let[s,...u]=a;return b(f([s,i(u,o)]))}return b(b$1(k(o),s=>g(s),([s,u])=>{let l=t(s);return k(i(l,u))}))};return i([],F(n,e,r))}function L(n,e,t={}){return(r=>{let i=F(r,n,t),a$1=(o,s)=>{if(o.length>0){let[u,...l]=o;return b(f([u,a$1(l,s)]))}return b(b$1(d$1(k(s),u=>a(u)),u=>g(u),([u,l])=>b$1(d$1(e(u),f=>({_tag:"Some",value:f})),f=>g(f),f=>k(a$1(f,l)))))};return a$1([],i)})}function kt(n,e){return e(n)}function te(n,e){return(t=>e(n(t)))}function bt(n,e){return te(e,n)}function xt(){return(n=>n)}function vt(n){return(e=>{let t=a=>g(a),r=([a,o])=>f([n(a),i(o)]),i=a=>b(b$1(k(a),t,r));return i(e)})}function Ct(n){return(e=>{let t=o=>g(o),r=([o,s])=>n(o)?f([o,a(s)]):i(s),i=o=>b$1(k(o),t,r),a=o=>b(i(o));return a(e)})}function Zt(n){return(e=>{let t=a=>g(a),r=a=>b$1(k(a),t,([o,s])=>{let u=n(o);return u._tag==="Some"?f([u.value,i(s)]):r(s)}),i=a=>b(r(a));return i(e)})}function wt(n){let e=Math.max(0,n|0);return(t=>{let r=(i,a)=>a<=0?f$1():b(b$1(k(i),o=>g(o),([o,s])=>f([o,r(s,a-1)])));return r(t,e)})}function Ot(n){let e=Math.max(0,n|0);return(t=>{let r=(i,a)=>a<=0?i:b(b$1(k(i),o=>g(o),([o,s])=>k(r(s,a-1))));return r(t,e)})}function re(n){return(e=>{let t=i=>d$1(i,a=>s(a)),r=i=>b(b$1(d$1(k(i),a$1=>a(a$1)),a=>g(a),([a,o])=>b$1(t(n(a)),s=>g(s),s=>f([s,r(o)]))));return r(e)})}function Bt(n){return re(e=>l(n(e),()=>f(e)))}function _t(n,e={}){return(t=>F(t,n,e))}function Pt(n,e,t={}){return L(n,e,t)}function Tt(n,e="backpressure"){return(t=>q(t,n,e))}function Ft(n){let e=Math.max(1,n|0);return(t=>{let r=(a,o,s)=>o<=0?f({chunk:s,rest:a}):b$1(k(a),u=>u._tag==="None"?f({chunk:s,rest:f$1()}):g(u),([u,l])=>r(l,o-1,[...s,u])),i=a=>b(b$1(k(a),o=>g(o),([o,s])=>l(r(s,e-1,[o]),({chunk:u,rest:l})=>f([u,i(l)]))));return i(t)})}function It(n,e,t=false){return {engine:n,data:e,fallbackUsed:t}}function Ht(n,e,t){return {requested:n,engine:e,data:t,fallbackUsed:n==="auto"&&e!=="wasm"}}export{te as andThen,B as bounded,$n as broadcast,et as broadcastToHub,q as buffer,Tt as bufferP,F as chunks,_t as chunksP,bt as compose,Ot as dropP,It as engineStats,Zt as filterMapP,Ct as filterP,nt as fromHub,Ft as groupedP,xt as identity,An as linkAbortController,En as makeCancelToken,ee as makeHub,ne as makeStreamChunker,pt as mapChunks,L as mapChunksEffect,Pt as mapChunksEffectP,re as mapEffectP,vt as mapP,Ht as selectedEngineStats,wt as takeP,Bt as tapEffectP,kt as via};
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3;
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+ var _chunk3IF374MGjs = require('./chunk-3IF374MG.js');
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ var _chunkTGOMLZ65js = require('./chunk-TGOMLZ65.js');
90
+
91
+ // src/core/types/cancel.ts
92
+ function makeCancelToken() {
93
+ let cancelled = false;
94
+ const listeners = /* @__PURE__ */ new Set();
95
+ const cancel = () => {
96
+ if (cancelled) return;
97
+ cancelled = true;
98
+ listeners.forEach((f) => f());
99
+ listeners.clear();
100
+ };
101
+ return {
102
+ isCancelled: () => cancelled,
103
+ onCancel: (f) => {
104
+ if (cancelled) {
105
+ try {
106
+ f();
107
+ } catch (e2) {
108
+ }
109
+ return () => {
110
+ };
111
+ }
112
+ listeners.add(f);
113
+ return () => {
114
+ listeners.delete(f);
115
+ };
116
+ },
117
+ cancel
118
+ };
119
+ }
120
+ function linkAbortController(token, ac) {
121
+ return token.onCancel(() => ac.abort());
122
+ }
123
+
124
+ // src/core/runtime/linkedQueue.ts
125
+ var LinkedQueue = (_class = class {constructor() { _class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this); }
126
+ __init() {this.head = null}
127
+ __init2() {this.tail = null}
128
+ __init3() {this.len = 0}
129
+ get length() {
130
+ return this.len;
131
+ }
132
+ isEmpty() {
133
+ return this.len === 0;
134
+ }
135
+ push(value) {
136
+ const node = { value, next: null, prev: this.tail, removed: false };
137
+ if (this.tail) this.tail.next = node;
138
+ else this.head = node;
139
+ this.tail = node;
140
+ this.len++;
141
+ return node;
142
+ }
143
+ shift() {
144
+ const h = this.head;
145
+ if (!h) return void 0;
146
+ this.unlink(h);
147
+ return h.value;
148
+ }
149
+ remove(node) {
150
+ if (node.removed) return;
151
+ this.unlink(node);
152
+ }
153
+ unlink(node) {
154
+ node.removed = true;
155
+ const { prev, next } = node;
156
+ if (prev) prev.next = next;
157
+ else this.head = next;
158
+ if (next) next.prev = prev;
159
+ else this.tail = prev;
160
+ node.next = null;
161
+ node.prev = null;
162
+ this.len--;
163
+ }
164
+ }, _class);
165
+
166
+ // src/core/stream/queue.ts
167
+ function bounded(capacity, strategy = "backpressure", options = {}) {
168
+ return _chunkTGOMLZ65js.asyncSync.call(void 0, () => makeQueue(capacity, strategy, options));
169
+ }
170
+ function makeQueue(capacity, strategy, options) {
171
+ const items = _chunkTGOMLZ65js.makeBoundedRingBuffer.call(void 0, capacity, capacity, options);
172
+ let closed = false;
173
+ const QueueClosedErr = { _tag: "QueueClosed" };
174
+ const offerWaiters = new LinkedQueue();
175
+ const takers = new LinkedQueue();
176
+ const shutdown = () => {
177
+ if (closed) return;
178
+ closed = true;
179
+ while (takers.length > 0) {
180
+ const t = takers.shift();
181
+ t({ _tag: "Failure", cause: { _tag: "Fail", error: QueueClosedErr } });
182
+ }
183
+ while (offerWaiters.length > 0) {
184
+ const w = offerWaiters.shift();
185
+ w.cb(false);
186
+ }
187
+ items.clear();
188
+ };
189
+ return {
190
+ size: () => items.length,
191
+ shutdown,
192
+ offer: (a) => _chunkTGOMLZ65js.async.call(void 0, (_env, cb) => {
193
+ if (closed) {
194
+ cb({ _tag: "Success", value: false });
195
+ return;
196
+ }
197
+ if (takers.length > 0) {
198
+ const t = takers.shift();
199
+ t({ _tag: "Success", value: a });
200
+ cb({ _tag: "Success", value: true });
201
+ return;
202
+ }
203
+ if (items.length < capacity) {
204
+ items.push(a);
205
+ cb({ _tag: "Success", value: true });
206
+ return;
207
+ }
208
+ if (strategy === "dropping") {
209
+ cb({ _tag: "Success", value: false });
210
+ return;
211
+ }
212
+ if (strategy === "sliding") {
213
+ items.shift();
214
+ items.push(a);
215
+ cb({ _tag: "Success", value: true });
216
+ return;
217
+ }
218
+ const node = offerWaiters.push({
219
+ a,
220
+ cb: (ok) => cb({ _tag: "Success", value: ok })
221
+ });
222
+ const canceler = () => {
223
+ offerWaiters.remove(node);
224
+ };
225
+ return canceler;
226
+ }),
227
+ take: () => _chunkTGOMLZ65js.async.call(void 0, (_env, cb) => {
228
+ if (items.length > 0) {
229
+ const a = items.shift();
230
+ cb({ _tag: "Success", value: a });
231
+ if (offerWaiters.length > 0 && items.length < capacity) {
232
+ const w = offerWaiters.shift();
233
+ items.push(w.a);
234
+ w.cb(true);
235
+ }
236
+ return;
237
+ }
238
+ if (offerWaiters.length > 0) {
239
+ const w = offerWaiters.shift();
240
+ w.cb(true);
241
+ cb({ _tag: "Success", value: w.a });
242
+ return;
243
+ }
244
+ if (closed) {
245
+ cb({ _tag: "Failure", cause: { _tag: "Fail", error: QueueClosedErr } });
246
+ return;
247
+ }
248
+ const node = takers.push(cb);
249
+ const canceler = () => {
250
+ takers.remove(node);
251
+ };
252
+ return canceler;
253
+ })
254
+ };
255
+ }
256
+
257
+ // src/core/stream/buffer.ts
258
+ var SIGNAL_END = { _tag: "End" };
259
+ function buffer(stream, capacity, strategy = "backpressure") {
260
+ let started = false;
261
+ let q = null;
262
+ let producer = null;
263
+ let upstream = stream;
264
+ const onUpstreamFailure = (opt) => _chunkTGOMLZ65js.asyncSucceed.call(void 0,
265
+ opt._tag === "None" ? SIGNAL_END : { _tag: "Fail", error: opt.value }
266
+ );
267
+ const onUpstreamSuccess = ([a, tail]) => _chunkTGOMLZ65js.asyncSync.call(void 0, () => {
268
+ upstream = tail;
269
+ return { _tag: "Elem", value: a };
270
+ });
271
+ const nextSignal = () => _chunkTGOMLZ65js.asyncFold.call(void 0,
272
+ _chunk3IF374MGjs.uncons.call(void 0, upstream),
273
+ onUpstreamFailure,
274
+ onUpstreamSuccess
275
+ );
276
+ const start = (env) => _chunkTGOMLZ65js.asyncFlatMap.call(void 0, bounded(capacity, strategy), (_q) => {
277
+ q = _q;
278
+ let lastSig;
279
+ const afterOffer = () => {
280
+ if (lastSig._tag !== "Elem") {
281
+ return _chunkTGOMLZ65js.asyncSucceed.call(void 0, void 0);
282
+ }
283
+ return loop();
284
+ };
285
+ const onSignal = (sig) => {
286
+ lastSig = sig;
287
+ return _chunkTGOMLZ65js.asyncFlatMap.call(void 0, q.offer(sig), afterOffer);
288
+ };
289
+ const loop = () => _chunkTGOMLZ65js.asyncFlatMap.call(void 0, nextSignal(), onSignal);
290
+ producer = _chunkTGOMLZ65js.fork.call(void 0, loop(), env);
291
+ return _chunkTGOMLZ65js.asyncSucceed.call(void 0, void 0);
292
+ });
293
+ const pullDown = {
294
+ _tag: "Async",
295
+ register: (env, cb) => {
296
+ const go = () => {
297
+ if (!started) {
298
+ started = true;
299
+ _chunkTGOMLZ65js.unsafeGetCurrentRuntime.call(void 0, ).fork(start(env)).join(() => {
300
+ pullFromQueue(env, cb);
301
+ });
302
+ return;
303
+ }
304
+ pullFromQueue(env, cb);
305
+ };
306
+ go();
307
+ }
308
+ };
309
+ function pullFromQueue(env, cb) {
310
+ const takeEff = q.take();
311
+ _chunkTGOMLZ65js.unsafeGetCurrentRuntime.call(void 0, ).fork(takeEff).join((ex) => {
312
+ if (ex._tag !== "Success") return;
313
+ const sig = ex.value;
314
+ switch (sig._tag) {
315
+ case "Elem":
316
+ cb({ _tag: "Success", value: [sig.value, _chunk3IF374MGjs.fromPull.call(void 0, pullDown)] });
317
+ return;
318
+ case "End":
319
+ _optionalChain([producer, 'optionalAccess', _ => _.interrupt, 'optionalCall', _2 => _2()]);
320
+ cb({ _tag: "Failure", cause: { _tag: "Fail", error: _chunkTGOMLZ65js.none } });
321
+ return;
322
+ case "Fail":
323
+ _optionalChain([producer, 'optionalAccess', _3 => _3.interrupt, 'optionalCall', _4 => _4()]);
324
+ cb({ _tag: "Failure", cause: { _tag: "Fail", error: _chunkTGOMLZ65js.some.call(void 0, sig.error) } });
325
+ return;
326
+ }
327
+ });
328
+ }
329
+ return _chunk3IF374MGjs.fromPull.call(void 0, pullDown);
330
+ }
331
+
332
+ // src/core/stream/hub.ts
333
+ var toQueueStrategy = (s) => s === "BackPressure" ? "backpressure" : s === "Dropping" ? "dropping" : "sliding";
334
+ function makeHub(capacity, strategy = "BackPressure") {
335
+ const queues = /* @__PURE__ */ new Set();
336
+ let closed = false;
337
+ const publish = (a) => {
338
+ if (closed) return _chunkTGOMLZ65js.asyncSucceed.call(void 0, false);
339
+ const size = queues.size;
340
+ if (size === 0) return _chunkTGOMLZ65js.asyncSucceed.call(void 0, true);
341
+ if (size === 1) {
342
+ const q = queues.values().next().value;
343
+ return q.offer(a);
344
+ }
345
+ let eff = _chunkTGOMLZ65js.asyncSucceed.call(void 0, true);
346
+ for (const q of queues) {
347
+ eff = _chunkTGOMLZ65js.asyncFlatMap.call(void 0,
348
+ eff,
349
+ (okSoFar) => _chunkTGOMLZ65js.asyncFlatMap.call(void 0, q.offer(a), (ok) => _chunkTGOMLZ65js.asyncSucceed.call(void 0, okSoFar && ok))
350
+ );
351
+ }
352
+ return eff;
353
+ };
354
+ const publishAll = (as) => {
355
+ let eff = _chunkTGOMLZ65js.asyncSucceed.call(void 0, true);
356
+ const it = as[Symbol.iterator]();
357
+ while (true) {
358
+ const n = it.next();
359
+ if (n.done) break;
360
+ const a = n.value;
361
+ eff = _chunkTGOMLZ65js.asyncFlatMap.call(void 0,
362
+ eff,
363
+ (okSoFar) => _chunkTGOMLZ65js.asyncFlatMap.call(void 0, publish(a), (ok) => _chunkTGOMLZ65js.asyncSucceed.call(void 0, okSoFar && ok))
364
+ );
365
+ }
366
+ return eff;
367
+ };
368
+ const subscribe = () => {
369
+ if (closed) {
370
+ return _chunkTGOMLZ65js.asyncTotal.call(void 0, () => {
371
+ throw { _tag: "HubClosed" };
372
+ });
373
+ }
374
+ return _chunkTGOMLZ65js.asyncFlatMap.call(void 0,
375
+ bounded(capacity, toQueueStrategy(strategy)),
376
+ (q) => _chunkTGOMLZ65js.asyncSync.call(void 0, () => {
377
+ queues.add(q);
378
+ return {
379
+ ...q,
380
+ unsubscribe: () => {
381
+ if (!queues.has(q)) return;
382
+ queues.delete(q);
383
+ q.shutdown();
384
+ }
385
+ };
386
+ })
387
+ );
388
+ };
389
+ const shutdown = () => _chunkTGOMLZ65js.asyncSync.call(void 0, () => {
390
+ if (closed) return;
391
+ closed = true;
392
+ for (const q of queues) q.shutdown();
393
+ queues.clear();
394
+ });
395
+ return {
396
+ publish,
397
+ publishAll,
398
+ subscribe,
399
+ shutdown
400
+ };
401
+ }
402
+ var broadcast = makeHub;
403
+ function broadcastToHub(stream, hub) {
404
+ return _chunk3IF374MGjs.foreachStream.call(void 0,
405
+ stream,
406
+ (a) => _chunkTGOMLZ65js.asyncFlatMap.call(void 0, hub.publish(a), () => _chunkTGOMLZ65js.asyncSucceed.call(void 0, void 0))
407
+ );
408
+ }
409
+ function fromHub(hub) {
410
+ return _chunk3IF374MGjs.managedStream.call(void 0,
411
+ _chunkTGOMLZ65js.asyncFlatMap.call(void 0, hub.subscribe(), (sub) => {
412
+ const loop = _chunk3IF374MGjs.fromPull.call(void 0,
413
+ _chunkTGOMLZ65js.asyncFlatMap.call(void 0,
414
+ _chunkTGOMLZ65js.asyncMapError.call(void 0, sub.take(), (_queueClosed) => _chunkTGOMLZ65js.none),
415
+ (a) => _chunkTGOMLZ65js.asyncSucceed.call(void 0, [a, loop])
416
+ )
417
+ );
418
+ return _chunkTGOMLZ65js.asyncSucceed.call(void 0, {
419
+ stream: loop,
420
+ release: (_exit) => _chunkTGOMLZ65js.asyncSync.call(void 0, () => sub.unsubscribe())
421
+ });
422
+ })
423
+ );
424
+ }
425
+
426
+ // src/core/stream/chunks.ts
427
+ var cachedWasmChunkCtor;
428
+ function resolveWasmChunkBuffer() {
429
+ if (cachedWasmChunkCtor !== void 0) return cachedWasmChunkCtor;
430
+ const mod = _chunkTGOMLZ65js.resolveWasmModule.call(void 0, );
431
+ cachedWasmChunkCtor = _nullishCoalesce(_optionalChain([mod, 'optionalAccess', _5 => _5.BrassWasmChunkBuffer]), () => ( null));
432
+ return cachedWasmChunkCtor;
433
+ }
434
+ var JsChunker = (_class2 = class {
435
+ constructor(maxChunkSize, fallbackUsed = false) {;_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);
436
+ this.maxChunkSize = maxChunkSize;
437
+ this.fallbackUsed = fallbackUsed;
438
+ }
439
+
440
+
441
+ __init4() {this.engine = "js"}
442
+ __init5() {this.values = []}
443
+ __init6() {this.emittedChunks = 0}
444
+ __init7() {this.emittedItems = 0}
445
+ __init8() {this.flushes = 0}
446
+ get length() {
447
+ return this.values.length;
448
+ }
449
+ push(value) {
450
+ if (this.values.length >= this.maxChunkSize) return false;
451
+ this.values.push(value);
452
+ return true;
453
+ }
454
+ isFull() {
455
+ return this.values.length >= this.maxChunkSize;
456
+ }
457
+ isEmpty() {
458
+ return this.values.length === 0;
459
+ }
460
+ takeChunk() {
461
+ this.flushes += 1;
462
+ const chunk = this.values;
463
+ this.values = [];
464
+ if (chunk.length > 0) {
465
+ this.emittedChunks += 1;
466
+ this.emittedItems += chunk.length;
467
+ }
468
+ return chunk;
469
+ }
470
+ clear() {
471
+ this.values = [];
472
+ }
473
+ stats() {
474
+ return {
475
+ engine: "js",
476
+ fallbackUsed: this.fallbackUsed,
477
+ data: {
478
+ len: this.values.length,
479
+ maxChunkSize: this.maxChunkSize,
480
+ emittedChunks: this.emittedChunks,
481
+ emittedItems: this.emittedItems,
482
+ flushes: this.flushes
483
+ }
484
+ };
485
+ }
486
+ }, _class2);
487
+ var WasmChunker = (_class3 = class {
488
+ __init9() {this.engine = "wasm"}
489
+ __init10() {this.fallbackUsed = false}
490
+
491
+ constructor(maxChunkSize) {;_class3.prototype.__init9.call(this);_class3.prototype.__init10.call(this);
492
+ const Ctor = resolveWasmChunkBuffer();
493
+ if (!Ctor) {
494
+ throw new Error("brass-runtime wasm chunk buffer is not available. Run npm run build:wasm first.");
495
+ }
496
+ this.inner = new Ctor(maxChunkSize);
497
+ }
498
+ get length() {
499
+ return this.inner.len();
500
+ }
501
+ get maxChunkSize() {
502
+ return this.inner.max_chunk_size();
503
+ }
504
+ push(value) {
505
+ return this.inner.push(value);
506
+ }
507
+ isFull() {
508
+ return this.inner.is_full();
509
+ }
510
+ isEmpty() {
511
+ return this.inner.is_empty();
512
+ }
513
+ takeChunk() {
514
+ return Array.from(this.inner.take_chunk());
515
+ }
516
+ clear() {
517
+ this.inner.clear();
518
+ }
519
+ stats() {
520
+ return { engine: "wasm", fallbackUsed: false, data: JSON.parse(this.inner.stats_json()) };
521
+ }
522
+ }, _class3);
523
+ function makeStreamChunker(chunkSize, options = {}) {
524
+ const size = Math.max(1, chunkSize | 0);
525
+ const engine = _nullishCoalesce(options.engine, () => ( "auto"));
526
+ if (engine === "js") return new JsChunker(size, false);
527
+ if (engine === "wasm") return new WasmChunker(size);
528
+ return resolveWasmChunkBuffer() ? new WasmChunker(size) : new JsChunker(size, true);
529
+ }
530
+ function chunks(input, chunkSize, options = {}) {
531
+ const size = Math.max(1, chunkSize | 0);
532
+ const loop = (cur) => _chunk3IF374MGjs.fromPull.call(void 0, fillChunk(cur, makeStreamChunker(size, options)));
533
+ const fillChunk = (cur, chunker) => _chunkTGOMLZ65js.asyncFold.call(void 0,
534
+ _chunk3IF374MGjs.uncons.call(void 0, cur),
535
+ (opt) => {
536
+ if (opt._tag === "None" && !chunker.isEmpty()) {
537
+ return _chunkTGOMLZ65js.asyncSucceed.call(void 0, [chunker.takeChunk(), _chunk3IF374MGjs.fromPull.call(void 0, _chunkTGOMLZ65js.asyncFail.call(void 0, _chunkTGOMLZ65js.none))]);
538
+ }
539
+ return _chunkTGOMLZ65js.asyncFail.call(void 0, opt);
540
+ },
541
+ ([a, tail]) => {
542
+ chunker.push(a);
543
+ if (chunker.isFull()) {
544
+ return _chunkTGOMLZ65js.asyncSucceed.call(void 0, [chunker.takeChunk(), loop(tail)]);
545
+ }
546
+ return fillChunk(tail, chunker);
547
+ }
548
+ );
549
+ return loop(input);
550
+ }
551
+ function mapChunks(input, chunkSize, f, options = {}) {
552
+ const pullOne = (pending, rest) => {
553
+ if (pending.length > 0) {
554
+ const [head, ...tail] = pending;
555
+ return _chunk3IF374MGjs.fromPull.call(void 0, _chunkTGOMLZ65js.asyncSucceed.call(void 0, [head, pullOne(tail, rest)]));
556
+ }
557
+ return _chunk3IF374MGjs.fromPull.call(void 0,
558
+ _chunkTGOMLZ65js.asyncFold.call(void 0,
559
+ _chunk3IF374MGjs.uncons.call(void 0, rest),
560
+ (opt) => _chunkTGOMLZ65js.asyncFail.call(void 0, opt),
561
+ ([chunk, tail]) => {
562
+ const mapped = f(chunk);
563
+ return _chunk3IF374MGjs.uncons.call(void 0, pullOne(mapped, tail));
564
+ }
565
+ )
566
+ );
567
+ };
568
+ return pullOne([], chunks(input, chunkSize, options));
569
+ }
570
+ function mapChunksEffect(chunkSize, f, options = {}) {
571
+ return ((input) => {
572
+ const chunked = chunks(input, chunkSize, options);
573
+ const pullOne = (pending, rest) => {
574
+ if (pending.length > 0) {
575
+ const [head, ...tail] = pending;
576
+ return _chunk3IF374MGjs.fromPull.call(void 0, _chunkTGOMLZ65js.asyncSucceed.call(void 0, [head, pullOne(tail, rest)]));
577
+ }
578
+ return _chunk3IF374MGjs.fromPull.call(void 0,
579
+ _chunkTGOMLZ65js.asyncFold.call(void 0,
580
+ _chunkTGOMLZ65js.asyncMapError.call(void 0, _chunk3IF374MGjs.uncons.call(void 0, rest), (opt) => _chunk3IF374MGjs.widenOpt.call(void 0, opt)),
581
+ (opt) => _chunkTGOMLZ65js.asyncFail.call(void 0, opt),
582
+ ([chunk, tail]) => _chunkTGOMLZ65js.asyncFold.call(void 0,
583
+ _chunkTGOMLZ65js.asyncMapError.call(void 0, f(chunk), (e) => ({ _tag: "Some", value: e })),
584
+ (opt) => _chunkTGOMLZ65js.asyncFail.call(void 0, opt),
585
+ (mapped) => _chunk3IF374MGjs.uncons.call(void 0, pullOne(mapped, tail))
586
+ )
587
+ )
588
+ );
589
+ };
590
+ return pullOne([], chunked);
591
+ });
592
+ }
593
+
594
+ // src/core/stream/pipeline.ts
595
+ function via(stream, pipeline) {
596
+ return pipeline(stream);
597
+ }
598
+ function andThen(p1, p2) {
599
+ return ((input) => p2(p1(input)));
600
+ }
601
+ function compose(p2, p1) {
602
+ return andThen(p1, p2);
603
+ }
604
+ function identity() {
605
+ return ((input) => input);
606
+ }
607
+ function mapP(f) {
608
+ return ((input) => {
609
+ const onError = (opt) => _chunkTGOMLZ65js.asyncFail.call(void 0, opt);
610
+ const onSuccess = ([a, tail]) => _chunkTGOMLZ65js.asyncSucceed.call(void 0, [f(a), loop(tail)]);
611
+ const loop = (cur) => _chunk3IF374MGjs.fromPull.call(void 0,
612
+ _chunkTGOMLZ65js.asyncFold.call(void 0, _chunk3IF374MGjs.uncons.call(void 0, cur), onError, onSuccess)
613
+ );
614
+ return loop(input);
615
+ });
616
+ }
617
+ function filterP(pred) {
618
+ return ((input) => {
619
+ const onError = (opt) => _chunkTGOMLZ65js.asyncFail.call(void 0, opt);
620
+ const onSuccess = ([a, tail]) => pred(a) ? _chunkTGOMLZ65js.asyncSucceed.call(void 0, [a, loop(tail)]) : next(tail);
621
+ const next = (cur) => _chunkTGOMLZ65js.asyncFold.call(void 0, _chunk3IF374MGjs.uncons.call(void 0, cur), onError, onSuccess);
622
+ const loop = (cur) => _chunk3IF374MGjs.fromPull.call(void 0, next(cur));
623
+ return loop(input);
624
+ });
625
+ }
626
+ function filterMapP(f) {
627
+ return ((input) => {
628
+ const onError = (opt) => _chunkTGOMLZ65js.asyncFail.call(void 0, opt);
629
+ const next = (cur) => _chunkTGOMLZ65js.asyncFold.call(void 0,
630
+ _chunk3IF374MGjs.uncons.call(void 0, cur),
631
+ onError,
632
+ ([a, tail]) => {
633
+ const ob = f(a);
634
+ return ob._tag === "Some" ? _chunkTGOMLZ65js.asyncSucceed.call(void 0, [ob.value, loop(tail)]) : next(tail);
635
+ }
636
+ );
637
+ const loop = (cur) => _chunk3IF374MGjs.fromPull.call(void 0, next(cur));
638
+ return loop(input);
639
+ });
640
+ }
641
+ function takeP(n) {
642
+ const m = Math.max(0, n | 0);
643
+ return ((input) => {
644
+ const loop = (cur, remaining) => {
645
+ if (remaining <= 0) return _chunk3IF374MGjs.emptyStream.call(void 0, );
646
+ return _chunk3IF374MGjs.fromPull.call(void 0,
647
+ _chunkTGOMLZ65js.asyncFold.call(void 0,
648
+ _chunk3IF374MGjs.uncons.call(void 0, cur),
649
+ (opt) => _chunkTGOMLZ65js.asyncFail.call(void 0, opt),
650
+ ([a, tail]) => _chunkTGOMLZ65js.asyncSucceed.call(void 0, [a, loop(tail, remaining - 1)])
651
+ )
652
+ );
653
+ };
654
+ return loop(input, m);
655
+ });
656
+ }
657
+ function dropP(n) {
658
+ const m = Math.max(0, n | 0);
659
+ return ((input) => {
660
+ const skip = (cur, remaining) => {
661
+ if (remaining <= 0) return cur;
662
+ return _chunk3IF374MGjs.fromPull.call(void 0,
663
+ _chunkTGOMLZ65js.asyncFold.call(void 0,
664
+ _chunk3IF374MGjs.uncons.call(void 0, cur),
665
+ (opt) => _chunkTGOMLZ65js.asyncFail.call(void 0, opt),
666
+ ([_a, tail]) => _chunk3IF374MGjs.uncons.call(void 0, skip(tail, remaining - 1))
667
+ )
668
+ );
669
+ };
670
+ return skip(input, m);
671
+ });
672
+ }
673
+ function mapEffectP(f) {
674
+ return ((input) => {
675
+ const raiseToOpt = (fa) => _chunkTGOMLZ65js.asyncMapError.call(void 0, fa, (e) => _chunkTGOMLZ65js.some.call(void 0, e));
676
+ const loop = (cur) => _chunk3IF374MGjs.fromPull.call(void 0,
677
+ _chunkTGOMLZ65js.asyncFold.call(void 0,
678
+ _chunkTGOMLZ65js.asyncMapError.call(void 0,
679
+ _chunk3IF374MGjs.uncons.call(void 0, cur),
680
+ (opt) => _chunk3IF374MGjs.widenOpt.call(void 0, opt)
681
+ ),
682
+ (opt) => _chunkTGOMLZ65js.asyncFail.call(void 0, opt),
683
+ ([a, tail]) => _chunkTGOMLZ65js.asyncFold.call(void 0,
684
+ raiseToOpt(f(a)),
685
+ // Async<Rp, ...>
686
+ (opt2) => _chunkTGOMLZ65js.asyncFail.call(void 0, opt2),
687
+ (b) => _chunkTGOMLZ65js.asyncSucceed.call(void 0, [b, loop(tail)])
688
+ )
689
+ )
690
+ );
691
+ return loop(input);
692
+ });
693
+ }
694
+ function tapEffectP(f) {
695
+ return mapEffectP((a) => _chunkTGOMLZ65js.asyncFlatMap.call(void 0, f(a), () => _chunkTGOMLZ65js.asyncSucceed.call(void 0, a)));
696
+ }
697
+ function chunksP(chunkSize, options = {}) {
698
+ return ((input) => chunks(input, chunkSize, options));
699
+ }
700
+ function mapChunksEffectP(chunkSize, f, options = {}) {
701
+ return mapChunksEffect(chunkSize, f, options);
702
+ }
703
+ function bufferP(capacity, strategy = "backpressure") {
704
+ return ((input) => buffer(input, capacity, strategy));
705
+ }
706
+ function groupedP(n) {
707
+ const size = Math.max(1, n | 0);
708
+ return ((input) => {
709
+ const gather = (cur, remaining, acc) => {
710
+ if (remaining <= 0) return _chunkTGOMLZ65js.asyncSucceed.call(void 0, { chunk: acc, rest: cur });
711
+ return _chunkTGOMLZ65js.asyncFold.call(void 0,
712
+ _chunk3IF374MGjs.uncons.call(void 0, cur),
713
+ (opt) => {
714
+ if (opt._tag === "None") return _chunkTGOMLZ65js.asyncSucceed.call(void 0, { chunk: acc, rest: _chunk3IF374MGjs.emptyStream.call(void 0, ) });
715
+ return _chunkTGOMLZ65js.asyncFail.call(void 0, opt);
716
+ },
717
+ ([a, tail]) => gather(tail, remaining - 1, [...acc, a])
718
+ );
719
+ };
720
+ const loop = (cur) => _chunk3IF374MGjs.fromPull.call(void 0,
721
+ _chunkTGOMLZ65js.asyncFold.call(void 0,
722
+ _chunk3IF374MGjs.uncons.call(void 0, cur),
723
+ (opt) => _chunkTGOMLZ65js.asyncFail.call(void 0, opt),
724
+ ([a, tail]) => _chunkTGOMLZ65js.asyncFlatMap.call(void 0,
725
+ gather(tail, size - 1, [a]),
726
+ ({ chunk, rest }) => _chunkTGOMLZ65js.asyncSucceed.call(void 0, [chunk, loop(rest)])
727
+ )
728
+ )
729
+ );
730
+ return loop(input);
731
+ });
732
+ }
733
+
734
+ // src/core/runtime/engineStats.ts
735
+ function engineStats(engine, data, fallbackUsed = false) {
736
+ return { engine, data, fallbackUsed };
737
+ }
738
+ function selectedEngineStats(requested, engine, data) {
739
+ return { requested, engine, data, fallbackUsed: requested === "auto" && engine !== "wasm" };
740
+ }
741
+
742
+
743
+
744
+
745
+
746
+
747
+
748
+
749
+
750
+
751
+
752
+
753
+
754
+
755
+
756
+
757
+
758
+
759
+
760
+
761
+
762
+
763
+
764
+
765
+
766
+
767
+
768
+
769
+
770
+
771
+
772
+
773
+
774
+
775
+
776
+
777
+
778
+
779
+
780
+
781
+
782
+
783
+
784
+
785
+
786
+
787
+
788
+
789
+
790
+
791
+
792
+
793
+
794
+
795
+
796
+
797
+
798
+
799
+
800
+
801
+
802
+
803
+
804
+
805
+
806
+
807
+
808
+
809
+
810
+
811
+
812
+
813
+
814
+
815
+
816
+
817
+
818
+
819
+
820
+
821
+
822
+
823
+
824
+
825
+
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+
834
+
835
+
836
+
837
+
838
+
839
+
840
+
841
+
842
+
843
+
844
+
845
+
846
+
847
+
848
+
849
+
850
+
851
+
852
+
853
+
854
+
855
+ exports.Async = _chunkTGOMLZ65js.Async; exports.Cause = _chunkTGOMLZ65js.Cause; exports.DefaultHostExecutor = _chunkTGOMLZ65js.DefaultHostExecutor; exports.EngineFiberHandle = _chunkTGOMLZ65js.EngineFiberHandle; exports.Exit = _chunkTGOMLZ65js.Exit; exports.HostRegistry = _chunkTGOMLZ65js.HostRegistry; exports.JsFiberEngine = _chunkTGOMLZ65js.JsFiberEngine; exports.NoopHooks = _chunkTGOMLZ65js.NoopHooks; exports.ProgramBuilder = _chunkTGOMLZ65js.ProgramBuilder; exports.PushStatus = _chunkTGOMLZ65js.PushStatus; exports.ReferenceWasmBridge = _chunkTGOMLZ65js.ReferenceWasmBridge; exports.RingBuffer = _chunkTGOMLZ65js.RingBuffer; exports.Runtime = _chunkTGOMLZ65js.Runtime; exports.RuntimeFiber = _chunkTGOMLZ65js.RuntimeFiber; exports.Scheduler = _chunkTGOMLZ65js.Scheduler; exports.Scope = _chunkTGOMLZ65js.Scope; exports.WasmFiberEngine = _chunkTGOMLZ65js.WasmFiberEngine; exports.WasmFiberRegistryBridge = _chunkTGOMLZ65js.WasmFiberRegistryBridge; exports.WasmPackFiberBridge = _chunkTGOMLZ65js.WasmPackFiberBridge; exports.acquireRelease = _chunkTGOMLZ65js.acquireRelease; exports.andThen = andThen; exports.assertNever = _chunk3IF374MGjs.assertNever; exports.async = _chunkTGOMLZ65js.async; exports.asyncCatchAll = _chunkTGOMLZ65js.asyncCatchAll; exports.asyncFail = _chunkTGOMLZ65js.asyncFail; exports.asyncFlatMap = _chunkTGOMLZ65js.asyncFlatMap; exports.asyncFold = _chunkTGOMLZ65js.asyncFold; exports.asyncInterruptible = _chunkTGOMLZ65js.asyncInterruptible; exports.asyncMap = _chunkTGOMLZ65js.asyncMap; exports.asyncMapError = _chunkTGOMLZ65js.asyncMapError; exports.asyncSucceed = _chunkTGOMLZ65js.asyncSucceed; exports.asyncSync = _chunkTGOMLZ65js.asyncSync; exports.asyncTotal = _chunkTGOMLZ65js.asyncTotal; exports.bounded = bounded; exports.broadcast = broadcast; exports.broadcastToHub = broadcastToHub; exports.buffer = buffer; exports.bufferP = bufferP; exports.catchAll = _chunkTGOMLZ65js.catchAll; exports.chunks = chunks; exports.chunksP = chunksP; exports.collectAllPar = _chunkTGOMLZ65js.collectAllPar; exports.collectStream = _chunk3IF374MGjs.collectStream; exports.compose = compose; exports.concatStream = _chunk3IF374MGjs.concatStream; exports.dropP = dropP; exports.emitStream = _chunk3IF374MGjs.emitStream; exports.emptyStream = _chunk3IF374MGjs.emptyStream; exports.end = _chunkTGOMLZ65js.end; exports.engineStats = engineStats; exports.fail = _chunkTGOMLZ65js.fail; exports.filterMapP = filterMapP; exports.filterP = filterP; exports.flatMap = _chunkTGOMLZ65js.flatMap; exports.flattenStream = _chunk3IF374MGjs.flattenStream; exports.foreachStream = _chunk3IF374MGjs.foreachStream; exports.fork = _chunkTGOMLZ65js.fork; exports.fromArray = _chunk3IF374MGjs.fromArray; exports.fromHub = fromHub; exports.fromPromiseAbortable = _chunkTGOMLZ65js.fromPromiseAbortable; exports.fromPull = _chunk3IF374MGjs.fromPull; exports.getBenchmarkBudget = _chunkTGOMLZ65js.getBenchmarkBudget; exports.getCurrentFiber = _chunkTGOMLZ65js.getCurrentFiber; exports.globalScheduler = _chunkTGOMLZ65js.globalScheduler; exports.groupedP = groupedP; exports.identity = identity; exports.linkAbortController = linkAbortController; exports.makeBoundedRingBuffer = _chunkTGOMLZ65js.makeBoundedRingBuffer; exports.makeCancelToken = makeCancelToken; exports.makeHub = makeHub; exports.makeStreamChunker = makeStreamChunker; exports.managedStream = _chunk3IF374MGjs.managedStream; exports.map = _chunkTGOMLZ65js.map; exports.mapAsync = _chunkTGOMLZ65js.mapAsync; exports.mapChunks = mapChunks; exports.mapChunksEffect = mapChunksEffect; exports.mapChunksEffectP = mapChunksEffectP; exports.mapEffectP = mapEffectP; exports.mapError = _chunkTGOMLZ65js.mapError; exports.mapP = mapP; exports.mapStream = _chunk3IF374MGjs.mapStream; exports.mapTryAsync = _chunkTGOMLZ65js.mapTryAsync; exports.merge = _chunk3IF374MGjs.merge; exports.mergeStream = _chunk3IF374MGjs.mergeStream; exports.none = _chunkTGOMLZ65js.none; exports.orElseOptional = _chunkTGOMLZ65js.orElseOptional; exports.race = _chunkTGOMLZ65js.race; exports.raceWith = _chunkTGOMLZ65js.raceWith; exports.rangeStream = _chunk3IF374MGjs.rangeStream; exports.runtimeCapabilities = _chunkTGOMLZ65js.runtimeCapabilities; exports.selectedEngineStats = selectedEngineStats; exports.setBenchmarkBudget = _chunkTGOMLZ65js.setBenchmarkBudget; exports.some = _chunkTGOMLZ65js.some; exports.streamFromReadableStream = _chunk3IF374MGjs.streamFromReadableStream; exports.succeed = _chunkTGOMLZ65js.succeed; exports.sync = _chunkTGOMLZ65js.sync; exports.takeP = takeP; exports.tapEffectP = tapEffectP; exports.toPromise = _chunkTGOMLZ65js.toPromise; exports.uncons = _chunk3IF374MGjs.uncons; exports.unit = _chunkTGOMLZ65js.unit; exports.unsafeGetCurrentRuntime = _chunkTGOMLZ65js.unsafeGetCurrentRuntime; exports.unsafeRunAsync = _chunkTGOMLZ65js.unsafeRunAsync; exports.unsafeRunFoldWithEnv = _chunkTGOMLZ65js.unsafeRunFoldWithEnv; exports.unwrapScoped = _chunk3IF374MGjs.unwrapScoped; exports.via = via; exports.widenOpt = _chunk3IF374MGjs.widenOpt; exports.withAsyncPromise = _chunkTGOMLZ65js.withAsyncPromise; exports.withCurrentFiber = _chunkTGOMLZ65js.withCurrentFiber; exports.withScope = _chunkTGOMLZ65js.withScope; exports.withScopeAsync = _chunkTGOMLZ65js.withScopeAsync; exports.zip = _chunk3IF374MGjs.zip; exports.zipPar = _chunkTGOMLZ65js.zipPar;