brass-runtime 1.13.5 → 1.13.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/cli/main.cjs +2022 -0
- package/dist/agent/cli/main.js +184 -184
- package/dist/agent/cli/main.mjs +2 -2
- package/dist/agent/index.cjs +153 -0
- package/dist/agent/index.js +153 -153
- package/dist/agent/index.mjs +2 -2
- package/dist/{chunk-TGOMLZ65.js → chunk-2P4PD6D7.cjs} +10 -9
- package/dist/{chunk-6ECUD4N3.mjs → chunk-3R7ZYRK2.mjs} +1 -1
- package/dist/{chunk-T5XJDGTQ.mjs → chunk-7F2R7A2V.mjs} +10 -9
- package/dist/{chunk-QRPYH5J7.mjs → chunk-ATHSSDUF.js} +1 -1
- package/dist/chunk-INZBKOHY.js +2879 -0
- package/dist/chunk-L6KKKM66.js +2557 -0
- package/dist/{chunk-HRVX2IYW.js → chunk-XDINDYNA.cjs} +134 -134
- package/dist/chunk-XNOTJSMZ.mjs +407 -0
- package/dist/{chunk-3IF374MG.js → chunk-ZTDK2DLG.cjs} +68 -68
- package/dist/http/index.cjs +453 -0
- package/dist/http/index.js +74 -74
- package/dist/http/index.mjs +2 -2
- package/dist/index.cjs +855 -0
- package/dist/index.js +340 -340
- package/dist/index.mjs +2 -2
- package/package.json +7 -6
- package/dist/agent/cli/main.d.mts +0 -1
- package/dist/agent/index.d.mts +0 -688
- package/dist/effect-ISvXPLgc.d.mts +0 -797
- package/dist/http/index.d.mts +0 -154
- package/dist/index.d.mts +0 -258
- package/dist/stream-C0-LWnUP.d.mts +0 -66
package/dist/http/index.d.mts
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { A as Async, a as AsyncWithPromise } from '../effect-ISvXPLgc.mjs';
|
|
2
|
-
import { Z as ZStream } from '../stream-C0-LWnUP.mjs';
|
|
3
|
-
|
|
4
|
-
type RetryPolicy = {
|
|
5
|
-
maxRetries: number;
|
|
6
|
-
baseDelayMs: number;
|
|
7
|
-
maxDelayMs: number;
|
|
8
|
-
retryOnMethods?: HttpMethod[];
|
|
9
|
-
retryOnStatus?: (status: number) => boolean;
|
|
10
|
-
retryOnError?: (e: HttpError) => boolean;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
type HttpError = {
|
|
14
|
-
_tag: "Abort";
|
|
15
|
-
} | {
|
|
16
|
-
_tag: "BadUrl";
|
|
17
|
-
message: string;
|
|
18
|
-
} | {
|
|
19
|
-
_tag: "FetchError";
|
|
20
|
-
message: string;
|
|
21
|
-
};
|
|
22
|
-
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
|
|
23
|
-
type HttpInit = Omit<RequestInit, "method" | "body" | "headers">;
|
|
24
|
-
type HttpRequest = {
|
|
25
|
-
method: HttpMethod;
|
|
26
|
-
url: string;
|
|
27
|
-
headers?: Record<string, string>;
|
|
28
|
-
body?: string;
|
|
29
|
-
init?: HttpInit;
|
|
30
|
-
};
|
|
31
|
-
type HttpWireResponse = {
|
|
32
|
-
status: number;
|
|
33
|
-
statusText: string;
|
|
34
|
-
headers: Record<string, string>;
|
|
35
|
-
bodyText: string;
|
|
36
|
-
ms: number;
|
|
37
|
-
};
|
|
38
|
-
type MakeHttpConfig = {
|
|
39
|
-
baseUrl?: string;
|
|
40
|
-
headers?: Record<string, string>;
|
|
41
|
-
};
|
|
42
|
-
type HttpWireResponseStream = {
|
|
43
|
-
status: number;
|
|
44
|
-
statusText: string;
|
|
45
|
-
headers: Record<string, string>;
|
|
46
|
-
body: ZStream<unknown, HttpError, Uint8Array>;
|
|
47
|
-
ms: number;
|
|
48
|
-
};
|
|
49
|
-
type HttpClientStream = (req: HttpRequest) => Async<unknown, HttpError, HttpWireResponseStream>;
|
|
50
|
-
type HttpClient = HttpClientFn & {
|
|
51
|
-
with: (mw: HttpMiddleware) => HttpClient;
|
|
52
|
-
};
|
|
53
|
-
declare const withMiddleware: (mw: HttpMiddleware) => (c: HttpClient) => HttpClient;
|
|
54
|
-
declare const decorate: (run: HttpClientFn) => HttpClient;
|
|
55
|
-
type HttpClientFn = (req: HttpRequest) => Async<unknown, HttpError, HttpWireResponse>;
|
|
56
|
-
type HttpMiddleware = (next: HttpClientFn) => HttpClientFn;
|
|
57
|
-
declare const normalizeHeadersInit: (h: any) => Record<string, string> | undefined;
|
|
58
|
-
declare function makeHttpStream(cfg?: MakeHttpConfig): HttpClientStream;
|
|
59
|
-
declare function makeHttp(cfg?: MakeHttpConfig): HttpClient;
|
|
60
|
-
declare const withRetryStream: (p: RetryPolicy) => (next: HttpClientStream) => HttpClientStream;
|
|
61
|
-
|
|
62
|
-
type InitNoMethodBody = Omit<RequestInit, "method" | "body">;
|
|
63
|
-
type HttpMeta = {
|
|
64
|
-
request: HttpRequest;
|
|
65
|
-
urlFinal: string;
|
|
66
|
-
startedAt: number;
|
|
67
|
-
durationMs: number;
|
|
68
|
-
};
|
|
69
|
-
type HttpResponse<A> = {
|
|
70
|
-
status: number;
|
|
71
|
-
statusText: string;
|
|
72
|
-
headers: Record<string, string>;
|
|
73
|
-
body: A;
|
|
74
|
-
};
|
|
75
|
-
type HttpWireWithMeta = {
|
|
76
|
-
wire: HttpWireResponse;
|
|
77
|
-
meta: HttpMeta;
|
|
78
|
-
};
|
|
79
|
-
type HttpResponseWithMeta<A> = {
|
|
80
|
-
wire: HttpWireResponse;
|
|
81
|
-
response: HttpResponse<A>;
|
|
82
|
-
meta: HttpMeta;
|
|
83
|
-
};
|
|
84
|
-
type AnyInitWithHeaders = {
|
|
85
|
-
headers?: any;
|
|
86
|
-
} & Record<string, any>;
|
|
87
|
-
type Dx = {
|
|
88
|
-
request: (req: HttpRequest) => AsyncWithPromise<unknown, HttpError, HttpWireResponse>;
|
|
89
|
-
get: (url: string, init?: AnyInitWithHeaders) => AsyncWithPromise<unknown, HttpError, HttpWireResponse>;
|
|
90
|
-
post: (url: string, body?: string, init?: AnyInitWithHeaders) => AsyncWithPromise<unknown, HttpError, HttpWireResponse>;
|
|
91
|
-
getText: (url: string, init?: InitNoMethodBody) => AsyncWithPromise<unknown, HttpError, HttpResponse<string>>;
|
|
92
|
-
getJson: <A>(url: string, init?: InitNoMethodBody) => AsyncWithPromise<unknown, HttpError, HttpResponse<A>>;
|
|
93
|
-
postJson: <A>(url: string, bodyObj: unknown, init?: AnyInitWithHeaders) => AsyncWithPromise<unknown, HttpError, HttpResponse<A>>;
|
|
94
|
-
with: (mw: HttpMiddleware) => Dx;
|
|
95
|
-
withRetry: (p: RetryPolicy) => Dx;
|
|
96
|
-
wire: HttpClient;
|
|
97
|
-
};
|
|
98
|
-
declare function httpClient(cfg?: MakeHttpConfig): Dx;
|
|
99
|
-
declare function httpClientWithMeta(cfg?: MakeHttpConfig): {
|
|
100
|
-
request: (req: HttpRequest) => AsyncWithPromise<unknown, HttpError, {
|
|
101
|
-
wire: HttpWireResponse;
|
|
102
|
-
meta: HttpMeta;
|
|
103
|
-
}>;
|
|
104
|
-
get: (url: string, init?: InitNoMethodBody) => AsyncWithPromise<unknown, HttpError, {
|
|
105
|
-
wire: HttpWireResponse;
|
|
106
|
-
meta: HttpMeta;
|
|
107
|
-
}>;
|
|
108
|
-
getText: (url: string, init?: InitNoMethodBody) => AsyncWithPromise<unknown, HttpError, {
|
|
109
|
-
wire: HttpWireResponse;
|
|
110
|
-
response: {
|
|
111
|
-
status: number;
|
|
112
|
-
statusText: string;
|
|
113
|
-
headers: Record<string, string>;
|
|
114
|
-
body: string;
|
|
115
|
-
};
|
|
116
|
-
meta: HttpMeta;
|
|
117
|
-
}>;
|
|
118
|
-
getJson: <A>(url: string, init?: InitNoMethodBody) => AsyncWithPromise<unknown, HttpError, {
|
|
119
|
-
wire: HttpWireResponse;
|
|
120
|
-
response: {
|
|
121
|
-
status: number;
|
|
122
|
-
statusText: string;
|
|
123
|
-
headers: Record<string, string>;
|
|
124
|
-
body: A;
|
|
125
|
-
};
|
|
126
|
-
meta: HttpMeta;
|
|
127
|
-
}>;
|
|
128
|
-
post: (url: string, body?: string, init?: InitNoMethodBody) => AsyncWithPromise<unknown, HttpError, {
|
|
129
|
-
wire: HttpWireResponse;
|
|
130
|
-
meta: HttpMeta;
|
|
131
|
-
}>;
|
|
132
|
-
postJson: <A>(url: string, bodyObj: unknown, init?: HttpInit & {
|
|
133
|
-
headers?: Record<string, string>;
|
|
134
|
-
}) => AsyncWithPromise<unknown, HttpError, {
|
|
135
|
-
wire: HttpWireResponse;
|
|
136
|
-
response: {
|
|
137
|
-
status: number;
|
|
138
|
-
statusText: string;
|
|
139
|
-
headers: Record<string, string>;
|
|
140
|
-
body: A;
|
|
141
|
-
};
|
|
142
|
-
meta: HttpMeta;
|
|
143
|
-
}>;
|
|
144
|
-
};
|
|
145
|
-
declare function httpClientStream(cfg?: MakeHttpConfig): {
|
|
146
|
-
request: (req: HttpRequest) => AsyncWithPromise<unknown, HttpError, HttpWireResponseStream>;
|
|
147
|
-
getStream: (url: string, init?: InitNoMethodBody) => AsyncWithPromise<unknown, HttpError, HttpWireResponseStream>;
|
|
148
|
-
get: (url: string, init?: InitNoMethodBody) => AsyncWithPromise<unknown, HttpError, HttpWireResponseStream>;
|
|
149
|
-
with: (mw: (n: HttpClientStream) => HttpClientStream) => /*elided*/ any;
|
|
150
|
-
withRetry: (p: RetryPolicy) => /*elided*/ any;
|
|
151
|
-
wire: HttpClientStream;
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
export { type Dx, type HttpClient, type HttpClientFn, type HttpClientStream, type HttpError, type HttpInit, type HttpMeta, type HttpMethod, type HttpMiddleware, type HttpRequest, type HttpResponse, type HttpResponseWithMeta, type HttpWireResponse, type HttpWireResponseStream, type HttpWireWithMeta, type MakeHttpConfig, decorate, httpClient, httpClientStream, httpClientWithMeta, makeHttp, makeHttpStream, normalizeHeadersInit, withMiddleware, withRetryStream };
|
package/dist/index.d.mts
DELETED
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
import { F as FiberEngine, W as WasmEngineRuntime, A as Async, R as RuntimeFiber, b as FiberEngineStats, c as Fiber, d as FiberId, e as FiberStatus, E as Exit, f as RuntimeEvent, g as WasmBridge, h as OpcodeProgram, i as FiberId$1, j as EngineEvent, k as RefId, N as NodeId, l as OpcodeNode, S as Scope, m as RingBufferOptions, n as EngineStats, O as Option } from './effect-ISvXPLgc.mjs';
|
|
2
|
-
export { o as AsyncRegisterRef, a as AsyncWithPromise, p as BoundedRingBuffer, C as CancelToken, q as Canceler, r as Cause, s as CustomHostAction, D as DbHostAction, t as DecodeRef, u as DefaultHostExecutor, v as EngineKind, w as EngineSelection, x as EngineSelectionMode, y as FiberEngineKind, z as FlatMapRef, B as FoldFailureRef, G as FoldSuccessRef, H as HostAction, I as HostActionKind, J as HostActionResult, K as HostExecutionContext, L as HostExecutor, M as HostRegistry, P as HttpHostAction, Q as Interrupted, T as Joiner, U as None, V as NoopHooks, X as ProgramBuilder, Y as ProgramPatch, _ as PushStatus, $ as QueueHostAction, a0 as RingBuffer, a1 as RingBufferEngine, a2 as RingBufferStatsData, a3 as Runtime, a4 as RuntimeCapabilities, a5 as RuntimeEngineMode, a6 as RuntimeOptions, a7 as Scheduler, a8 as SchedulerEngine, a9 as SchedulerOptions, aa as SchedulerStats, ab as SchedulerStatsData, ac as ScopeId, ad as Some, ae as SyncRef, af as Task, ag as WasmFiberEngine, ah as WasmFiberEngineOptions, Z as ZIO, ai as acquireRelease, aj as async, ak as asyncCatchAll, al as asyncFail, am as asyncFlatMap, an as asyncFold, ao as asyncInterruptible, ap as asyncMap, aq as asyncMapError, ar as asyncSucceed, as as asyncSync, at as asyncTotal, au as catchAll, av as end, aw as engineStats, ax as fail, ay as flatMap, az as fork, aA as fromPromiseAbortable, aB as getBenchmarkBudget, aC as getCurrentFiber, aD as globalScheduler, aE as linkAbortController, aF as makeBoundedRingBuffer, aG as makeCancelToken, aH as map, aI as mapAsync, aJ as mapError, aK as mapTryAsync, aL as none, aM as orElseOptional, aN as runtimeCapabilities, aO as selectedEngineStats, aP as setBenchmarkBudget, aQ as some, aR as succeed, aS as sync, aT as toPromise, aU as unit, aV as unsafeGetCurrentRuntime, aW as unsafeRunAsync, aX as unsafeRunFoldWithEnv, aY as withAsyncPromise, aZ as withCurrentFiber, a_ as withScope, a$ as withScopeAsync } from './effect-ISvXPLgc.mjs';
|
|
3
|
-
import { Z as ZStream } from './stream-C0-LWnUP.mjs';
|
|
4
|
-
export { C as Concat, E as Emit, a as Empty, F as Flatten, b as FromPull, M as Managed, c as Merge, N as Normalize, S as Scoped, d as assertNever, e as collectStream, f as concatStream, g as emitStream, h as emptyStream, i as flattenStream, j as foreachStream, k as fromArray, l as fromPull, m as managedStream, n as mapStream, o as merge, p as mergeStream, r as rangeStream, s as streamFromReadableStream, u as uncons, q as unwrapScoped, w as widenOpt, z as zip } from './stream-C0-LWnUP.mjs';
|
|
5
|
-
|
|
6
|
-
declare class JsFiberEngine<R> implements FiberEngine<R> {
|
|
7
|
-
private readonly runtime;
|
|
8
|
-
readonly kind: "js";
|
|
9
|
-
private startedFibers;
|
|
10
|
-
constructor(runtime: WasmEngineRuntime<R> & any);
|
|
11
|
-
fork<E, A>(effect: Async<R, E, A>, scopeId?: number): RuntimeFiber<R, E, A>;
|
|
12
|
-
stats(): FiberEngineStats;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
type InternalFiberStatus = "queued" | "running" | "suspended" | "done" | "failed" | "interrupted";
|
|
16
|
-
declare class EngineFiberHandle<R, E, A> implements Fiber<E, A> {
|
|
17
|
-
private readonly onScheduledStep;
|
|
18
|
-
private readonly onInterrupt;
|
|
19
|
-
private readonly onJoiner?;
|
|
20
|
-
private readonly onQueued?;
|
|
21
|
-
readonly id: FiberId;
|
|
22
|
-
readonly runtime: WasmEngineRuntime<R> & any;
|
|
23
|
-
fiberContext: any;
|
|
24
|
-
name?: string;
|
|
25
|
-
scopeId?: number;
|
|
26
|
-
parentFiberId?: number;
|
|
27
|
-
private result;
|
|
28
|
-
private readonly joiners;
|
|
29
|
-
private readonly finalizers;
|
|
30
|
-
private finalizersDrained;
|
|
31
|
-
private internalStatus;
|
|
32
|
-
private queued;
|
|
33
|
-
constructor(id: FiberId, runtime: WasmEngineRuntime<R> & any, onScheduledStep: (fiberId: FiberId) => void, onInterrupt: (fiberId: FiberId, reason: unknown) => void, onJoiner?: ((fiberId: FiberId) => void) | undefined, onQueued?: ((fiberId: FiberId) => void) | undefined);
|
|
34
|
-
status(): FiberStatus;
|
|
35
|
-
engineStatus(): InternalFiberStatus;
|
|
36
|
-
setEngineStatus(status: InternalFiberStatus): void;
|
|
37
|
-
join(cb: (exit: Exit<E, A>) => void): void;
|
|
38
|
-
interrupt(): void;
|
|
39
|
-
addFinalizer(f: (exit: Exit<E, A>) => void): void;
|
|
40
|
-
schedule(tag?: string): void;
|
|
41
|
-
emit(ev: RuntimeEvent): void;
|
|
42
|
-
succeed(value: A): void;
|
|
43
|
-
fail(error: E): void;
|
|
44
|
-
die(defect: unknown): void;
|
|
45
|
-
interrupted(): void;
|
|
46
|
-
complete(exit: Exit<E, A>): void;
|
|
47
|
-
private runFinalizersOnce;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
declare class ReferenceWasmBridge implements WasmBridge {
|
|
51
|
-
readonly kind: "wasm-reference";
|
|
52
|
-
private nextFiberId;
|
|
53
|
-
private readonly fibers;
|
|
54
|
-
private started;
|
|
55
|
-
private completed;
|
|
56
|
-
private failed;
|
|
57
|
-
private interrupted;
|
|
58
|
-
createFiber(program: OpcodeProgram): FiberId$1;
|
|
59
|
-
poll(fiberId: FiberId$1): EngineEvent;
|
|
60
|
-
provideValue(fiberId: FiberId$1, valueRef: RefId): EngineEvent;
|
|
61
|
-
provideError(fiberId: FiberId$1, errorRef: RefId): EngineEvent;
|
|
62
|
-
provideEffect(fiberId: FiberId$1, root: NodeId, nodes: OpcodeNode[]): EngineEvent;
|
|
63
|
-
interrupt(fiberId: FiberId$1, reasonRef: RefId): EngineEvent;
|
|
64
|
-
dropFiber(fiberId: FiberId$1): void;
|
|
65
|
-
stats(): unknown;
|
|
66
|
-
private mustFiber;
|
|
67
|
-
private step;
|
|
68
|
-
private success;
|
|
69
|
-
private failure;
|
|
70
|
-
private suspend;
|
|
71
|
-
private markDone;
|
|
72
|
-
private markFailed;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
declare class WasmPackFiberBridge implements WasmBridge {
|
|
76
|
-
readonly kind: "wasm";
|
|
77
|
-
private readonly vm;
|
|
78
|
-
constructor(modulePath?: string);
|
|
79
|
-
createFiber(program: OpcodeProgram): FiberId$1;
|
|
80
|
-
poll(fiberId: FiberId$1): EngineEvent;
|
|
81
|
-
provideValue(fiberId: FiberId$1, valueRef: RefId): EngineEvent;
|
|
82
|
-
provideError(fiberId: FiberId$1, errorRef: RefId): EngineEvent;
|
|
83
|
-
provideEffect(fiberId: FiberId$1, root: NodeId, nodes: OpcodeNode[]): EngineEvent;
|
|
84
|
-
interrupt(fiberId: FiberId$1, reasonRef: RefId): EngineEvent;
|
|
85
|
-
dropFiber(fiberId: FiberId$1): void;
|
|
86
|
-
stats(): unknown;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
type WasmFiberRegistryStats = {
|
|
90
|
-
readonly live: number;
|
|
91
|
-
readonly queued: number;
|
|
92
|
-
readonly running: number;
|
|
93
|
-
readonly suspended: number;
|
|
94
|
-
readonly done: number;
|
|
95
|
-
readonly failed: number;
|
|
96
|
-
readonly interrupted: number;
|
|
97
|
-
readonly wakeQueueLen: number;
|
|
98
|
-
readonly registered: number;
|
|
99
|
-
readonly completed: number;
|
|
100
|
-
readonly wakeups: number;
|
|
101
|
-
readonly duplicateWakeups: number;
|
|
102
|
-
readonly joins: number;
|
|
103
|
-
};
|
|
104
|
-
type FiberRegistryStatus = "queued" | "running" | "suspended" | "done" | "failed" | "interrupted";
|
|
105
|
-
declare class WasmFiberRegistryBridge {
|
|
106
|
-
private readonly registry;
|
|
107
|
-
constructor();
|
|
108
|
-
registerFiber(fiberId: FiberId$1, parentId?: number, scopeId?: number): void;
|
|
109
|
-
markQueued(fiberId: FiberId$1): void;
|
|
110
|
-
markRunning(fiberId: FiberId$1): void;
|
|
111
|
-
markSuspended(fiberId: FiberId$1): void;
|
|
112
|
-
markDone(fiberId: FiberId$1, status: Exclude<FiberRegistryStatus, "queued" | "running" | "suspended">): number;
|
|
113
|
-
dropFiber(fiberId: FiberId$1): void;
|
|
114
|
-
addJoiner(fiberId: FiberId$1): void;
|
|
115
|
-
wake(fiberId: FiberId$1): boolean;
|
|
116
|
-
drainWakeup(): FiberId$1 | undefined;
|
|
117
|
-
drainWakeups(): FiberId$1[];
|
|
118
|
-
wakeQueueLength(): number;
|
|
119
|
-
stateOf(fiberId: FiberId$1): FiberRegistryStatus | "missing";
|
|
120
|
-
stats(): WasmFiberRegistryStats;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
declare function buffer<R, E, A>(stream: ZStream<{} & R, E, A>, capacity: number, strategy?: "backpressure" | "dropping" | "sliding"): ZStream<{} & R, E, A>;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* race(A, B):
|
|
127
|
-
* - corre A y B en paralelo
|
|
128
|
-
* - el primero que termine gana
|
|
129
|
-
* - el otro es cancelado
|
|
130
|
-
*/
|
|
131
|
-
declare function race<R, E, A>(left: Async<R, E, A>, right: Async<R, E, A>, parentScope: Scope<R>): Async<R, E, A>;
|
|
132
|
-
/**
|
|
133
|
-
* zipPar(A, B):
|
|
134
|
-
* - corre A y B en paralelo
|
|
135
|
-
* - si ambas terminan bien → éxito con (A, B)
|
|
136
|
-
* - si una falla → cancelar todo y devolver fallo
|
|
137
|
-
*/
|
|
138
|
-
declare function zipPar<R, E, A, B>(left: Async<R, E, A>, right: Async<R, E, B>, parentScope: Scope<R>): Async<R, E, [A, B]>;
|
|
139
|
-
/**
|
|
140
|
-
* collectAllPar:
|
|
141
|
-
* - corre todos en paralelo
|
|
142
|
-
* - si uno falla → cancela todos
|
|
143
|
-
* - si todos terminan bien → devuelve array de resultados
|
|
144
|
-
*/
|
|
145
|
-
declare function collectAllPar<R, E, A>(effects: ReadonlyArray<Async<R, E, A>>, parentScope: Scope<R>): Async<R, E, A[]>;
|
|
146
|
-
declare function raceWith<R, E, A, B, C>(left: Async<R, E, A>, right: Async<R, E, B>, parentScope: Scope<R>, onLeft: (exit: Exit<E, A>, rightFiber: Fiber<E, B>, scope: Scope<R>) => Async<R, E, C>, onRight: (exit: Exit<E, B>, leftFiber: Fiber<E, A>, scope: Scope<R>) => Async<R, E, C>): Async<R, E, C>;
|
|
147
|
-
|
|
148
|
-
type Strategy = "backpressure" | "dropping" | "sliding";
|
|
149
|
-
type QueueClosed = {
|
|
150
|
-
_tag: "QueueClosed";
|
|
151
|
-
};
|
|
152
|
-
type Queue<A> = {
|
|
153
|
-
offer: (a: A) => Async<unknown, never, boolean>;
|
|
154
|
-
take: () => Async<unknown, QueueClosed, A>;
|
|
155
|
-
size: () => number;
|
|
156
|
-
shutdown: () => void;
|
|
157
|
-
};
|
|
158
|
-
type QueueOptions = RingBufferOptions;
|
|
159
|
-
declare function bounded<A>(capacity: number, strategy?: Strategy, options?: QueueOptions): Async<unknown, unknown, Queue<A>>;
|
|
160
|
-
|
|
161
|
-
type HubStrategy = "BackPressure" | "Dropping" | "Sliding";
|
|
162
|
-
type HubClosed = {
|
|
163
|
-
_tag: "HubClosed";
|
|
164
|
-
};
|
|
165
|
-
type Subscription<A> = Queue<A> & {
|
|
166
|
-
unsubscribe: () => void;
|
|
167
|
-
};
|
|
168
|
-
type Hub<A> = {
|
|
169
|
-
publish: (a: A) => Async<unknown, never, boolean>;
|
|
170
|
-
publishAll: (as: Iterable<A>) => Async<unknown, never, boolean>;
|
|
171
|
-
subscribe: () => Async<unknown, HubClosed, Subscription<A>>;
|
|
172
|
-
shutdown: () => Async<unknown, any, any>;
|
|
173
|
-
};
|
|
174
|
-
declare function makeHub<A>(capacity: number, strategy?: HubStrategy): Hub<A>;
|
|
175
|
-
declare const broadcast: typeof makeHub;
|
|
176
|
-
declare function broadcastToHub<R, E, A>(stream: ZStream<R, E, A>, hub: Hub<A>): Async<R, E, void>;
|
|
177
|
-
declare function fromHub<A>(hub: Hub<A>): ZStream<unknown, HubClosed, A>;
|
|
178
|
-
|
|
179
|
-
type StreamChunkEngine = "auto" | "js" | "wasm";
|
|
180
|
-
type StreamChunkOptions = {
|
|
181
|
-
/**
|
|
182
|
-
* auto: use WASM when wasm/pkg is available, otherwise JS.
|
|
183
|
-
* js: always use the JS array chunker.
|
|
184
|
-
* wasm: require BrassWasmChunkBuffer from wasm/pkg.
|
|
185
|
-
*/
|
|
186
|
-
engine?: StreamChunkEngine;
|
|
187
|
-
};
|
|
188
|
-
type StreamChunkStats = {
|
|
189
|
-
len: number;
|
|
190
|
-
maxChunkSize: number;
|
|
191
|
-
emittedChunks: number;
|
|
192
|
-
emittedItems: number;
|
|
193
|
-
flushes: number;
|
|
194
|
-
};
|
|
195
|
-
type Chunker<A> = {
|
|
196
|
-
readonly length: number;
|
|
197
|
-
readonly maxChunkSize: number;
|
|
198
|
-
push(value: A): boolean;
|
|
199
|
-
isFull(): boolean;
|
|
200
|
-
isEmpty(): boolean;
|
|
201
|
-
takeChunk(): readonly A[];
|
|
202
|
-
clear(): void;
|
|
203
|
-
stats(): EngineStats<StreamChunkStats>;
|
|
204
|
-
};
|
|
205
|
-
declare function makeStreamChunker<A>(chunkSize: number, options?: StreamChunkOptions): Chunker<A>;
|
|
206
|
-
/**
|
|
207
|
-
* Re-chunk a stream so downstream operators receive arrays instead of single
|
|
208
|
-
* items. This is the intended WASM boundary: pay the JS↔WASM crossing while
|
|
209
|
-
* assembling chunks, then process bigger batches downstream.
|
|
210
|
-
*/
|
|
211
|
-
declare function chunks<R, E, A>(input: ZStream<R, E, A>, chunkSize: number, options?: StreamChunkOptions): ZStream<R, E, readonly A[]>;
|
|
212
|
-
declare function mapChunks<R, E, A, B>(input: ZStream<R, E, A>, chunkSize: number, f: (chunk: readonly A[]) => readonly B[], options?: StreamChunkOptions): ZStream<R, E, B>;
|
|
213
|
-
declare function mapChunksEffect<Rp, Ep, A, B>(chunkSize: number, f: (chunk: readonly A[]) => Async<Rp, Ep, readonly B[]>, options?: StreamChunkOptions): <R, E>(input: ZStream<R, E, A>) => ZStream<R & Rp, E | Ep, B>;
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* ZPipeline-style transformer.
|
|
217
|
-
*
|
|
218
|
-
* A pipeline that consumes `In` and produces `Out`, potentially requiring `Rp` and failing with `Ep`.
|
|
219
|
-
* When applied to a stream `ZStream<R, E, In>`, the result is `ZStream<R & Rp, E | Ep, Out>`.
|
|
220
|
-
*/
|
|
221
|
-
type ZPipeline<Rp, Ep, In, Out> = <R, E>(input: ZStream<R, E, In>) => ZStream<R & Rp, E | Ep, Out>;
|
|
222
|
-
/** Apply a pipeline to a stream (alias of `pipeline(stream)`). */
|
|
223
|
-
declare function via<R, E, A, Rp, Ep, B>(stream: ZStream<R, E, A>, pipeline: ZPipeline<Rp, Ep, A, B>): ZStream<R & Rp, E | Ep, B>;
|
|
224
|
-
/** Compose pipelines left-to-right (p1 >>> p2). */
|
|
225
|
-
declare function andThen<R1, E1, In, Mid, R2, E2, Out>(p1: ZPipeline<R1, E1, In, Mid>, p2: ZPipeline<R2, E2, Mid, Out>): ZPipeline<R1 & R2, E1 | E2, In, Out>;
|
|
226
|
-
/** Compose pipelines right-to-left (p2 <<< p1). */
|
|
227
|
-
declare function compose<R1, E1, In, Mid, R2, E2, Out>(p2: ZPipeline<R2, E2, Mid, Out>, p1: ZPipeline<R1, E1, In, Mid>): ZPipeline<R1 & R2, E1 | E2, In, Out>;
|
|
228
|
-
/** Identity pipeline. */
|
|
229
|
-
declare function identity<A>(): ZPipeline<unknown, never, A, A>;
|
|
230
|
-
/** Map elements. */
|
|
231
|
-
declare function mapP<A, B>(f: (a: A) => B): ZPipeline<unknown, never, A, B>;
|
|
232
|
-
/** Filter elements, preserving end/error. */
|
|
233
|
-
declare function filterP<A>(pred: (a: A) => boolean): ZPipeline<unknown, never, A, A>;
|
|
234
|
-
/**
|
|
235
|
-
* Filter-map (aka collectSome).
|
|
236
|
-
* If `f(a)` returns None, the element is dropped.
|
|
237
|
-
*/
|
|
238
|
-
declare function filterMapP<A, B>(f: (a: A) => Option<B>): ZPipeline<unknown, never, A, B>;
|
|
239
|
-
/** Take at most N elements. */
|
|
240
|
-
declare function takeP<A>(n: number): ZPipeline<unknown, never, A, A>;
|
|
241
|
-
/** Drop the first N elements. */
|
|
242
|
-
declare function dropP<A>(n: number): ZPipeline<unknown, never, A, A>;
|
|
243
|
-
declare function mapEffectP<Rp, Ep, A, B>(f: (a: A) => Async<Rp, Ep, B>): ZPipeline<Rp, Ep, A, B>;
|
|
244
|
-
/** Tap each element with an effect, preserving the element. */
|
|
245
|
-
declare function tapEffectP<Rp, Ep, A>(f: (a: A) => Async<Rp, Ep, any>): ZPipeline<Rp, Ep, A, A>;
|
|
246
|
-
/** Re-chunk a stream into arrays of up to `chunkSize` elements. */
|
|
247
|
-
declare function chunksP<A>(chunkSize: number, options?: StreamChunkOptions): ZPipeline<unknown, never, A, readonly A[]>;
|
|
248
|
-
/** Apply one effect per chunk and flatten the returned chunk back to elements. */
|
|
249
|
-
declare function mapChunksEffectP<Rp, Ep, A, B>(chunkSize: number, f: (chunk: readonly A[]) => Async<Rp, Ep, readonly B[]>, options?: StreamChunkOptions): ZPipeline<Rp, Ep, A, B>;
|
|
250
|
-
/** Buffer upstream using your existing queue-based buffer implementation. */
|
|
251
|
-
declare function bufferP<A>(capacity: number, strategy?: "backpressure" | "dropping" | "sliding"): ZPipeline<unknown, never, A, A>;
|
|
252
|
-
/**
|
|
253
|
-
* Group elements into arrays of size `n` (last chunk may be smaller).
|
|
254
|
-
* Example: [1,2,3,4,5].grouped(2) => [1,2],[3,4],[5]
|
|
255
|
-
*/
|
|
256
|
-
declare function groupedP<A>(n: number): ZPipeline<unknown, never, A, A[]>;
|
|
257
|
-
|
|
258
|
-
export { Async, EngineEvent, EngineFiberHandle, EngineStats, Exit, Fiber, FiberEngine, FiberEngineStats, FiberId, FiberStatus, type Hub, type HubClosed, type HubStrategy, type InternalFiberStatus, JsFiberEngine, NodeId, OpcodeNode, OpcodeProgram, Option, type Queue, type QueueClosed, type QueueOptions, RefId, ReferenceWasmBridge, RingBufferOptions, RuntimeFiber, Scope, type Strategy, type StreamChunkEngine, type StreamChunkOptions, type StreamChunkStats, type Subscription, WasmBridge, WasmEngineRuntime, WasmFiberRegistryBridge, type WasmFiberRegistryStats, WasmPackFiberBridge, type ZPipeline, ZStream, andThen, bounded, broadcast, broadcastToHub, buffer, bufferP, chunks, chunksP, collectAllPar, compose, dropP, filterMapP, filterP, fromHub, groupedP, identity, makeHub, makeStreamChunker, mapChunks, mapChunksEffect, mapChunksEffectP, mapEffectP, mapP, race, raceWith, takeP, tapEffectP, via, zipPar };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Z as ZIO, O as Option, E as Exit, A as Async } from './effect-ISvXPLgc.mjs';
|
|
2
|
-
|
|
3
|
-
type Empty<R, E, A> = {
|
|
4
|
-
readonly _tag: "Empty";
|
|
5
|
-
};
|
|
6
|
-
type Emit<R, E, A> = {
|
|
7
|
-
readonly _tag: "Emit";
|
|
8
|
-
readonly value: ZIO<R, E, A>;
|
|
9
|
-
};
|
|
10
|
-
type Concat<R, E, A> = {
|
|
11
|
-
readonly _tag: "Concat";
|
|
12
|
-
readonly left: ZStream<R, E, A>;
|
|
13
|
-
readonly right: ZStream<R, E, A>;
|
|
14
|
-
};
|
|
15
|
-
type Flatten<R, E, A> = {
|
|
16
|
-
readonly _tag: "Flatten";
|
|
17
|
-
readonly stream: ZStream<R, E, ZStream<R, E, A>>;
|
|
18
|
-
};
|
|
19
|
-
type FromPull<R, E, A> = {
|
|
20
|
-
readonly _tag: "FromPull";
|
|
21
|
-
readonly pull: ZIO<R, Option<E>, [A, ZStream<R, E, A>]>;
|
|
22
|
-
};
|
|
23
|
-
type Merge<R, E, A> = {
|
|
24
|
-
readonly _tag: "Merge";
|
|
25
|
-
readonly left: ZStream<R, E, A>;
|
|
26
|
-
readonly right: ZStream<R, E, A>;
|
|
27
|
-
readonly flip: boolean;
|
|
28
|
-
};
|
|
29
|
-
type Scoped<R, E, A> = {
|
|
30
|
-
readonly _tag: "Scoped";
|
|
31
|
-
readonly acquire: ZIO<R, E, ZStream<R, E, A>>;
|
|
32
|
-
readonly release: (exit: Exit<any, any>) => Async<R, any, void>;
|
|
33
|
-
};
|
|
34
|
-
type Managed<R, E, A> = {
|
|
35
|
-
readonly _tag: "Managed";
|
|
36
|
-
readonly acquire: ZIO<R, E, {
|
|
37
|
-
stream: ZStream<R, E, A>;
|
|
38
|
-
release: (exit: Exit<any, any>) => Async<R, any, void>;
|
|
39
|
-
}>;
|
|
40
|
-
};
|
|
41
|
-
type ZStream<R, E, A> = Empty<R, E, A> | Emit<R, E, A> | Concat<R, E, A> | FromPull<R, E, A> | Flatten<R, E, A> | Merge<R, E, A> | Scoped<R, E, A> | Managed<R, E, A>;
|
|
42
|
-
type Normalize<E> = (u: unknown) => E;
|
|
43
|
-
declare const widenOpt: <E1, E2>(opt: Option<E1>) => Option<E1 | E2>;
|
|
44
|
-
declare const fromPull: <R, E, A>(pull: ZIO<R, Option<E>, [A, ZStream<R, E, A>]>) => ZStream<R, E, A>;
|
|
45
|
-
declare const unwrapScoped: <R, E, A>(acquire: ZIO<R, E, ZStream<R, E, A>>, release: (exit: Exit<any, any>) => Async<R, any, void>) => ZStream<R, E, A>;
|
|
46
|
-
declare const managedStream: <R, E, A>(acquire: ZIO<R, E, {
|
|
47
|
-
stream: ZStream<R, E, A>;
|
|
48
|
-
release: (exit: Exit<any, any>) => Async<R, any, void>;
|
|
49
|
-
}>) => ZStream<R, E, A>;
|
|
50
|
-
declare const mergeStream: <R, E, A>(left: ZStream<R, E, A>, right: ZStream<R, E, A>, flip?: boolean) => ZStream<R, E, A>;
|
|
51
|
-
declare const emptyStream: <R, E, A>() => ZStream<R, E, A>;
|
|
52
|
-
declare const emitStream: <R, E, A>(value: ZIO<R, E, A>) => ZStream<R, E, A>;
|
|
53
|
-
declare const concatStream: <R, E, A>(left: ZStream<R, E, A>, right: ZStream<R, E, A>) => ZStream<R, E, A>;
|
|
54
|
-
declare const flattenStream: <R, E, A>(stream: ZStream<R, E, ZStream<R, E, A>>) => ZStream<R, E, A>;
|
|
55
|
-
declare function merge<R, E, A>(left: ZStream<R, E, A>, right: ZStream<R, E, A>): ZStream<R, E, A>;
|
|
56
|
-
declare function uncons<R, E, A>(self: ZStream<R, E, A>): ZIO<R, Option<E>, [A, ZStream<R, E, A>]>;
|
|
57
|
-
declare function assertNever(x: never, msg?: string): never;
|
|
58
|
-
declare function mapStream<R, E, A, B>(self: ZStream<R, E, A>, f: (a: A) => B): ZStream<R, E, B>;
|
|
59
|
-
declare function rangeStream(start: number, end: number): ZStream<unknown, never, number>;
|
|
60
|
-
declare function zip<R, E1, A, E2, B>(left: ZStream<R, E1, A>, right: ZStream<R, E2, B>): ZStream<R, E1 | E2, [A, B]>;
|
|
61
|
-
declare function foreachStream<R, E, A, R2, E2>(stream: ZStream<R, E, A>, f: (a: A) => Async<R2, E2, void>): Async<R & R2, E | E2, void>;
|
|
62
|
-
declare function fromArray<A>(values: readonly A[]): ZStream<unknown, never, A>;
|
|
63
|
-
declare function collectStream<R, E, A>(stream: ZStream<R, E, A>): ZIO<R, E, A[]>;
|
|
64
|
-
declare function streamFromReadableStream<E>(body: ReadableStream<Uint8Array> | null | undefined, normalizeError: Normalize<E>): ZStream<unknown, E, Uint8Array>;
|
|
65
|
-
|
|
66
|
-
export { type Concat as C, type Emit as E, type Flatten as F, type Managed as M, type Normalize as N, type Scoped as S, type ZStream as Z, type Empty as a, type FromPull as b, type Merge as c, assertNever as d, collectStream as e, concatStream as f, emitStream as g, emptyStream as h, flattenStream as i, foreachStream as j, fromArray as k, fromPull as l, managedStream as m, mapStream as n, merge as o, mergeStream as p, unwrapScoped as q, rangeStream as r, streamFromReadableStream as s, uncons as u, widenOpt as w, zip as z };
|