better-effect 0.11.0 → 0.13.0
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/README.md +544 -10
- package/dist/adapters/iti.d.mts +3 -2
- package/dist/adapters/iti.d.mts.map +1 -1
- package/dist/adapters/iti.mjs +11 -10
- package/dist/adapters/iti.mjs.map +1 -1
- package/dist/bun.d.mts +43 -0
- package/dist/bun.d.mts.map +1 -0
- package/dist/bun.mjs +40 -0
- package/dist/bun.mjs.map +1 -0
- package/dist/{context-BUEf1qjL.mjs → context-BphfFUMO.mjs} +4 -2
- package/dist/context-BphfFUMO.mjs.map +1 -0
- package/dist/current-request-CIU7AHhF.d.mts +22 -0
- package/dist/current-request-CIU7AHhF.d.mts.map +1 -0
- package/dist/current-request-DDKNyymv.mjs +20 -0
- package/dist/current-request-DDKNyymv.mjs.map +1 -0
- package/dist/disposable-CP-Q2H3l.mjs +57 -0
- package/dist/disposable-CP-Q2H3l.mjs.map +1 -0
- package/dist/{effect-2ZcGZI8A.mjs → effect-CPdV7Yv8.mjs} +56 -10
- package/dist/effect-CPdV7Yv8.mjs.map +1 -0
- package/dist/hono.d.mts +7 -5
- package/dist/hono.d.mts.map +1 -1
- package/dist/hono.mjs +88 -30
- package/dist/hono.mjs.map +1 -1
- package/dist/{index-heuaRmXR.d.mts → index-AiKM71-u.d.mts} +3 -1
- package/dist/{index-heuaRmXR.d.mts.map → index-AiKM71-u.d.mts.map} +1 -1
- package/dist/index-BodMy6rO.d.mts +180 -0
- package/dist/index-BodMy6rO.d.mts.map +1 -0
- package/dist/{index-C7Qild0_.d.mts → index-CCi07kUw.d.mts} +15 -151
- package/dist/index-CCi07kUw.d.mts.map +1 -0
- package/dist/index-DAKn0qHk.d.mts +19 -0
- package/dist/index-DAKn0qHk.d.mts.map +1 -0
- package/dist/{index-DStz0JMN.d.mts → index-cXgyMa0v.d.mts} +75 -22
- package/dist/index-cXgyMa0v.d.mts.map +1 -0
- package/dist/index.d.mts +7 -4
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/dist/{internal-identity-DmUpBeeL.mjs → internal-identity-CbXoZIfw.mjs} +3 -3
- package/dist/internal-identity-CbXoZIfw.mjs.map +1 -0
- package/dist/{signal-B97cs85Z.mjs → layer-D16GKxuX.mjs} +31 -112
- package/dist/layer-D16GKxuX.mjs.map +1 -0
- package/dist/next.d.mts +116 -0
- package/dist/next.d.mts.map +1 -0
- package/dist/next.mjs +68 -0
- package/dist/next.mjs.map +1 -0
- package/dist/node-context-Ca18oNSg.mjs +25 -0
- package/dist/node-context-Ca18oNSg.mjs.map +1 -0
- package/dist/node-context-DczjAcrX.d.mts +12 -0
- package/dist/node-context-DczjAcrX.d.mts.map +1 -0
- package/dist/node.d.mts +51 -0
- package/dist/node.d.mts.map +1 -0
- package/dist/node.mjs +233 -0
- package/dist/node.mjs.map +1 -0
- package/dist/observer-9nhbL7Pr.d.mts +68 -0
- package/dist/observer-9nhbL7Pr.d.mts.map +1 -0
- package/dist/opentelemetry.d.mts +94 -0
- package/dist/opentelemetry.d.mts.map +1 -0
- package/dist/opentelemetry.mjs +453 -0
- package/dist/opentelemetry.mjs.map +1 -0
- package/dist/{index-rQhZk3Nt.d.mts → outcome-DI8LPIQ4.d.mts} +27 -72
- package/dist/outcome-DI8LPIQ4.d.mts.map +1 -0
- package/dist/{scope-GGnmTQck.mjs → program-metadata-BxjGkT17.mjs} +19 -4
- package/dist/program-metadata-BxjGkT17.mjs.map +1 -0
- package/dist/registration-drnZk0SY.mjs +182 -0
- package/dist/registration-drnZk0SY.mjs.map +1 -0
- package/dist/runtime/explicit.d.mts +1 -1
- package/dist/runtime/explicit.mjs +1 -1
- package/dist/runtime/node.d.mts +3 -12
- package/dist/runtime/node.mjs +2 -24
- package/dist/{runtime-DnMn0X0X.mjs → runtime-C_55ofnL.mjs} +245 -67
- package/dist/runtime-C_55ofnL.mjs.map +1 -0
- package/dist/signal-nfgFyNCk.mjs +52 -0
- package/dist/signal-nfgFyNCk.mjs.map +1 -0
- package/dist/{standard-services-BFBq-4lo.mjs → standard-services-vnGIafkS.mjs} +200 -30
- package/dist/standard-services-vnGIafkS.mjs.map +1 -0
- package/dist/standard-services.d.mts +4 -3
- package/dist/standard-services.mjs +4 -3
- package/dist/testing.d.mts +67 -7
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +192 -9
- package/dist/testing.mjs.map +1 -1
- package/dist/types-oihI-ESv.d.mts +54 -0
- package/dist/types-oihI-ESv.d.mts.map +1 -0
- package/dist/web-Bq3MfMrj.mjs +147 -0
- package/dist/web-Bq3MfMrj.mjs.map +1 -0
- package/dist/web.d.mts +47 -0
- package/dist/web.d.mts.map +1 -0
- package/dist/web.mjs +2 -0
- package/package.json +39 -3
- package/dist/context-BUEf1qjL.mjs.map +0 -1
- package/dist/effect-2ZcGZI8A.mjs.map +0 -1
- package/dist/errors-Dnjhzbt0.mjs +0 -99
- package/dist/errors-Dnjhzbt0.mjs.map +0 -1
- package/dist/index-C7Qild0_.d.mts.map +0 -1
- package/dist/index-DStz0JMN.d.mts.map +0 -1
- package/dist/index-rQhZk3Nt.d.mts.map +0 -1
- package/dist/internal-identity-DmUpBeeL.mjs.map +0 -1
- package/dist/runtime/node.d.mts.map +0 -1
- package/dist/runtime/node.mjs.map +0 -1
- package/dist/runtime-DnMn0X0X.mjs.map +0 -1
- package/dist/scope-GGnmTQck.mjs.map +0 -1
- package/dist/signal-B97cs85Z.mjs.map +0 -1
- package/dist/standard-services-BFBq-4lo.mjs.map +0 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { M as AnyService, h as ScopeOutcome } from "./index-AiKM71-u.mjs";
|
|
2
|
+
import { _ as CompleteInput, a as RuntimeShutdownDiagnostic, d as LayerBackend, g as CompleteExecutionLayer, h as CompleteExecution, i as RuntimeRunOptions, n as RuntimeDisposeOptions, p as Layer, r as RuntimeOptions, w as ProvidedEnvironment, y as LayerInput } from "./outcome-DI8LPIQ4.mjs";
|
|
3
|
+
import "./observer-9nhbL7Pr.mjs";
|
|
4
|
+
import "./index-DAKn0qHk.mjs";
|
|
5
|
+
import "./index-CCi07kUw.mjs";
|
|
6
|
+
import { Result, UnhandledException } from "better-result";
|
|
7
|
+
//#region src/runtime/types.d.ts
|
|
8
|
+
/** A detached diagnostic view of one active Runtime execution. */
|
|
9
|
+
type RuntimeExecutionInspection = {
|
|
10
|
+
readonly executionId: string;
|
|
11
|
+
readonly name?: string;
|
|
12
|
+
readonly startedAt: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A detached, immutable diagnostic view of a Runtime.
|
|
16
|
+
*
|
|
17
|
+
* Inspection never exposes Service instances, providers, Scopes or arbitrary
|
|
18
|
+
* execution attributes. It is informational only and is not a synchronization
|
|
19
|
+
* primitive or readiness guarantee.
|
|
20
|
+
*/
|
|
21
|
+
type RuntimeInspection = {
|
|
22
|
+
readonly state: 'active' | 'disposing' | 'disposed';
|
|
23
|
+
readonly warmup: 'idle' | 'running' | 'completed' | 'failed';
|
|
24
|
+
readonly activeExecutions: number;
|
|
25
|
+
readonly executions: readonly RuntimeExecutionInspection[];
|
|
26
|
+
readonly services: readonly string[];
|
|
27
|
+
readonly shutdownSignalAborted: boolean;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Name a Runtime type from a concrete Layer without repeating its provided
|
|
31
|
+
* branded Service instance union.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* type AppRuntime = RuntimeFor<typeof AppLive>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
type RuntimeFor<L extends LayerInput> = Runtime<Layer.Provided<L>>;
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/runtime/runtime.d.ts
|
|
41
|
+
type RuntimeOptionsInput = RuntimeOptions & RuntimeRunOptions;
|
|
42
|
+
/**
|
|
43
|
+
* Long-lived execution environment backed by a complete Layer.
|
|
44
|
+
*
|
|
45
|
+
* A Runtime owns Layer resources until `dispose()` is called. Each `run()` is
|
|
46
|
+
* isolated in a child Scope, while Layer-scoped resources remain shared.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const runtime = await Runtime.make(AppLive)
|
|
51
|
+
* const result = await runtime.run(loadUser('u1'))
|
|
52
|
+
* await runtime.dispose()
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @typeParam Provided The branded Service instances supplied by the Layer.
|
|
56
|
+
*/
|
|
57
|
+
declare class Runtime<Provided extends AnyService = any> {
|
|
58
|
+
private readonly handle;
|
|
59
|
+
private constructor();
|
|
60
|
+
/**
|
|
61
|
+
* Create a long-lived Runtime that owns its Layer resources.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const runtime = await Runtime.make(AppLive)
|
|
66
|
+
* const result = await runtime.run(program)
|
|
67
|
+
* await runtime.dispose()
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
static make<L extends LayerInput>(layer: L & CompleteInput<L>, backend: LayerBackend, options?: RuntimeOptions): Promise<Runtime<ProvidedEnvironment<L>>>;
|
|
71
|
+
static make<L extends LayerInput>(layer: L & CompleteInput<L>, options?: RuntimeOptions): Promise<Runtime<ProvidedEnvironment<L>>>;
|
|
72
|
+
/**
|
|
73
|
+
* Run one program and dispose its Layer resources before resolving.
|
|
74
|
+
*
|
|
75
|
+
* This is convenient for request-style or command-style execution where a
|
|
76
|
+
* Runtime should not outlive the operation.
|
|
77
|
+
*/
|
|
78
|
+
static run<A, L extends LayerInput>(layer: L & CompleteInput<L>, backend: LayerBackend, program: CompleteExecution<ProvidedEnvironment<L>, A>, options?: RuntimeOptionsInput): Promise<Awaited<A>>;
|
|
79
|
+
static run<A, L extends LayerInput>(layer: L & CompleteInput<L>, program: CompleteExecution<ProvidedEnvironment<L>, A>, options?: RuntimeOptionsInput): Promise<Awaited<A>>;
|
|
80
|
+
static run<A, L extends LayerInput>(layer: L & CompleteInput<L>, options: RuntimeOptionsInput, program: CompleteExecution<ProvidedEnvironment<L>, A>): Promise<Awaited<A>>;
|
|
81
|
+
/** Run a callback with a managed Runtime and always dispose it afterward. */
|
|
82
|
+
static use<A, L extends LayerInput>(layer: L & CompleteInput<L>, use: (runtime: Runtime<ProvidedEnvironment<L>>) => A | PromiseLike<A>, options?: RuntimeOptions): Promise<Awaited<A>>;
|
|
83
|
+
/** Resolve every Layer provider and dispose the Runtime if warmup fails. */
|
|
84
|
+
warmup(): Promise<void>;
|
|
85
|
+
/** Return a detached diagnostic snapshot without changing Runtime state. */
|
|
86
|
+
inspect(): RuntimeInspection;
|
|
87
|
+
/** Run one execution in this Runtime's child Scope. */
|
|
88
|
+
run<A>(program: CompleteExecution<Provided, A>, options?: RuntimeRunOptions): Promise<Awaited<A>>;
|
|
89
|
+
/** Run one execution with a Layer owned by that execution's child Scope. */
|
|
90
|
+
runWith<Request extends LayerInput, A>(layer: Request & CompleteExecutionLayer<Provided, Request>, program: CompleteExecution<Provided | ProvidedEnvironment<Request>, A>, options?: RuntimeRunOptions): Promise<Awaited<A>>;
|
|
91
|
+
private runUnchecked;
|
|
92
|
+
/** Stop new executions and release the Runtime's Layer resources. */
|
|
93
|
+
dispose(options?: RuntimeDisposeOptions): Promise<void>;
|
|
94
|
+
/** @deprecated Scope outcomes are kept for internal compatibility. */
|
|
95
|
+
dispose(outcome: ScopeOutcome): Promise<void>;
|
|
96
|
+
/** Release Runtime-owned resources through JavaScript's async disposal protocol. */
|
|
97
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
98
|
+
private disposeWithOutcome;
|
|
99
|
+
}
|
|
100
|
+
/** Type-level aliases for naming Runtime handles and shutdown options. */
|
|
101
|
+
declare namespace Runtime {
|
|
102
|
+
/** Name a Runtime type from a concrete Layer. */
|
|
103
|
+
type For<L extends LayerInput> = RuntimeFor<L>;
|
|
104
|
+
/** Optional Runtime shutdown configuration. */
|
|
105
|
+
type Options = RuntimeOptions;
|
|
106
|
+
/** Optional signal supplied to one managed Runtime execution. */
|
|
107
|
+
type RunOptions = RuntimeRunOptions;
|
|
108
|
+
/** Cooperative shutdown policy for a managed Runtime. */
|
|
109
|
+
type DisposeOptions = RuntimeDisposeOptions;
|
|
110
|
+
/** Diagnostic reported for aggregated Runtime shutdown cleanup failures. */
|
|
111
|
+
type ShutdownDiagnostic = RuntimeShutdownDiagnostic;
|
|
112
|
+
/** Detached diagnostic snapshot returned by `Runtime.inspect()`. */
|
|
113
|
+
type Inspection = RuntimeInspection;
|
|
114
|
+
/** Detached diagnostic view of one active execution. */
|
|
115
|
+
type ExecutionInspection = RuntimeExecutionInspection;
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/runtime/signal.d.ts
|
|
119
|
+
/** Yieldable access to the signal of the current Runtime execution. */
|
|
120
|
+
declare const CurrentAbortSignal: {
|
|
121
|
+
readonly [Symbol.iterator]: () => Generator<never, AbortSignal, unknown>;
|
|
122
|
+
};
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/function/pipe.d.ts
|
|
125
|
+
type Unary<A, B> = (value: A) => B;
|
|
126
|
+
declare function pipe<A>(value: A): A;
|
|
127
|
+
declare function pipe<A, B>(value: A, ab: Unary<A, B>): B;
|
|
128
|
+
declare function pipe<A, B, C>(value: A, ab: Unary<A, B>, bc: Unary<B, C>): C;
|
|
129
|
+
declare function pipe<A, B, C, D>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>): D;
|
|
130
|
+
declare function pipe<A, B, C, D, E>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>): E;
|
|
131
|
+
declare function pipe<A, B, C, D, E, F>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>, ef: Unary<E, F>): F;
|
|
132
|
+
declare function pipe<A, B, C, D, E, F, G>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>, ef: Unary<E, F>, fg: Unary<F, G>): G;
|
|
133
|
+
declare function pipe<A, B, C, D, E, F, G, H>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>, ef: Unary<E, F>, fg: Unary<F, G>, gh: Unary<G, H>): H;
|
|
134
|
+
declare function pipe<A, B, C, D, E, F, G, H, I>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>, ef: Unary<E, F>, fg: Unary<F, G>, gh: Unary<G, H>, hi: Unary<H, I>): I;
|
|
135
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>, ef: Unary<E, F>, fg: Unary<F, G>, gh: Unary<G, H>, hi: Unary<H, I>, ij: Unary<I, J>): J;
|
|
136
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J, K>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>, ef: Unary<E, F>, fg: Unary<F, G>, gh: Unary<G, H>, hi: Unary<H, I>, ij: Unary<I, J>, jk: Unary<J, K>): K;
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/resource/errors.d.ts
|
|
139
|
+
declare const ResourceReleaseFailure_base: import("better-result").TaggedErrorClass<"ResourceReleaseFailure">;
|
|
140
|
+
/** Describes a failure encountered while releasing a Resource. */
|
|
141
|
+
declare class ResourceReleaseFailure extends ResourceReleaseFailure_base<{
|
|
142
|
+
readonly resource: string;
|
|
143
|
+
readonly cause: unknown;
|
|
144
|
+
readonly message: string;
|
|
145
|
+
}> {}
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region src/resource/types.d.ts
|
|
148
|
+
/** A value that may be delivered synchronously or through a thenable. */
|
|
149
|
+
type MaybePromise<T> = T | PromiseLike<T>;
|
|
150
|
+
/** A synchronous or asynchronous better-result Result operation. */
|
|
151
|
+
type AsyncResult<T, E> = MaybePromise<Result<T, E>>;
|
|
152
|
+
/** The allowed return value of a custom Resource release callback. */
|
|
153
|
+
type ReleaseOutcome = void | Result<void, unknown>;
|
|
154
|
+
/** Receives release failures for diagnostics without changing error precedence. */
|
|
155
|
+
type ReleaseFailureObserver = (failure: ResourceReleaseFailure) => MaybePromise<void>;
|
|
156
|
+
/** Options controlling `Resource.acquireUseRelease`. */
|
|
157
|
+
type AcquireUseReleaseOptions<R, A, AcquireError, UseError> = {
|
|
158
|
+
/** Human-readable name included in release failures. */
|
|
159
|
+
readonly name: string;
|
|
160
|
+
/** Acquire the resource. A failure skips use and release. */
|
|
161
|
+
readonly acquire: () => AsyncResult<R, AcquireError>;
|
|
162
|
+
/** Use the acquired resource. Release is attempted afterward. */
|
|
163
|
+
readonly use: (resource: R) => AsyncResult<A, UseError>;
|
|
164
|
+
/** Release the resource, or omit it to use its disposal protocol. */
|
|
165
|
+
readonly release?: (resource: R) => MaybePromise<ReleaseOutcome>;
|
|
166
|
+
/**
|
|
167
|
+
* Observe cleanup failures without changing error precedence. This is most
|
|
168
|
+
* useful when both `use` and `release` can fail.
|
|
169
|
+
*/
|
|
170
|
+
readonly onReleaseFailure?: ReleaseFailureObserver;
|
|
171
|
+
};
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/resource/resource.d.ts
|
|
174
|
+
declare const Resource: {
|
|
175
|
+
/** Acquire, use, and release a resource with deterministic error precedence. */
|
|
176
|
+
readonly acquireUseRelease: <R, A, AcquireError, UseError>({ name, acquire, use, release, onReleaseFailure }: AcquireUseReleaseOptions<R, A, AcquireError, UseError>) => Promise<Result<A, AcquireError | UseError | UnhandledException | ResourceReleaseFailure>>;
|
|
177
|
+
};
|
|
178
|
+
//#endregion
|
|
179
|
+
export { ReleaseOutcome as a, CurrentAbortSignal as c, RuntimeFor as d, RuntimeInspection as f, ReleaseFailureObserver as i, Runtime as l, AcquireUseReleaseOptions as n, ResourceReleaseFailure as o, AsyncResult as r, pipe as s, Resource as t, RuntimeExecutionInspection as u };
|
|
180
|
+
//# sourceMappingURL=index-BodMy6rO.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BodMy6rO.d.mts","names":[],"sources":["../src/runtime/types.ts","../src/runtime/runtime.ts","../src/runtime/signal.ts","../src/function/pipe.ts","../src/resource/errors.ts","../src/resource/types.ts","../src/resource/resource.ts"],"mappings":";;;;;;;;KAMY;WACD;WACA;WACA;;;;;;;;;KAUC;WACD;WACA;WACA;WACA,qBAAqB;WACrB;WACA;;;;;;;;;;;KAYC,WAAW,UAAU,cAAc,QAAQ,MAAM,SAAS;;;KCNjE,sBAAsB,iBAAiB;;;;;;;;;;;;;;;;cA8C/B,QAAQ,iBAAiB;mBACC;UAA9B;;;;;;;;;;;SAYA,KAAK,UAAU,YACpB,OAAO,IAAI,cAAc,IACzB,SAAS,cACT,UAAU,iBACT,QAAQ,QAAQ,oBAAoB;SAEhC,KAAK,UAAU,YACpB,OAAO,IAAI,cAAc,IACzB,UAAU,iBACT,QAAQ,QAAQ,oBAAoB;;;;;;;SAwBhC,IAAI,GAAG,UAAU,YACtB,OAAO,IAAI,cAAc,IACzB,SAAS,cACT,SAAS,kBAAkB,oBAAoB,IAAI,IACnD,UAAU,sBACT,QAAQ,QAAQ;SAEZ,IAAI,GAAG,UAAU,YACtB,OAAO,IAAI,cAAc,IACzB,SAAS,kBAAkB,oBAAoB,IAAI,IACnD,UAAU,sBACT,QAAQ,QAAQ;SAEZ,IAAI,GAAG,UAAU,YACtB,OAAO,IAAI,cAAc,IACzB,SAAS,qBACT,SAAS,kBAAkB,oBAAoB,IAAI,KAClD,QAAQ,QAAQ;;SA2EZ,IAAI,GAAG,UAAU,YACtB,OAAO,IAAI,cAAc,IACzB,MAAM,SAAS,QAAQ,oBAAoB,QAAQ,IAAI,YAAY,IACnE,UAAU,iBACT,QAAQ,QAAQ;;EAiDb,UAAU;;EAehB,WAAW;;EAKX,IAA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ACjC;WACA;WACA;;;;;KCCC,aAAa,KAAK,IAAI,YAAY;;KAGlC,YAAY,GAAG,KAAK,aAAa,OAAW,GAAG;;KAG/C,wBAAwB;;KAGxB,0BAA0B,SAAS,2BAA2B;;KAG9D,yBAAyB,GAAG,GAAG,cAAc;;WAE9C;;WAGA,eAAe,YAAY,GAAG;;WAG9B,MAAM,UAAU,MAAM,YAAY,GAAG;;WAGrC,WAAW,UAAU,MAAM,aAAa;;;;;WAMxC,mBAAmB;;;;cCqBjB;;WA3Bc,oBAAA,GAAG,GAAG,cAAc,YAAQ,MAAA,SAAA,KAAA,SAAA,oBAMpD,yBAAyB,GAAG,GAAG,cAAc,cAAY,QAC1D,OAAW,GAAG,eAAe,WAAW,qBAAqB"}
|
|
@@ -1,95 +1,5 @@
|
|
|
1
|
-
import { A as ProgramFromGenerator, C as EffectError, D as EffectYield, E as EffectSuccess, M as AnyService, S as Effect$1, T as EffectRequirements, f as DisposableResource, h as ScopeOutcome, k as Program$1, p as MaybePromise
|
|
2
|
-
import { C as CompleteExecutionLayer, E as LayerInput, S as CompleteExecution, a as RuntimeShutdownDiagnostic, b as Layer, i as RuntimeRunOptions, j as ProvidedEnvironment, n as RuntimeDisposeOptions, r as RuntimeOptions, v as LayerBackend, w as CompleteInput } from "./index-rQhZk3Nt.mjs";
|
|
1
|
+
import { A as ProgramFromGenerator, C as EffectError, D as EffectYield, E as EffectSuccess, M as AnyService, S as Effect$1, T as EffectRequirements, f as DisposableResource, h as ScopeOutcome, k as Program$1, p as MaybePromise, w as EffectFromGenerator, x as AnyEffect } from "./index-AiKM71-u.mjs";
|
|
3
2
|
import { Err, Result, UnhandledException } from "better-result";
|
|
4
|
-
//#region src/runtime/types.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Name a Runtime type from a concrete Layer without repeating its provided
|
|
7
|
-
* branded Service instance union.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* type AppRuntime = RuntimeFor<typeof AppLive>
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
type RuntimeFor<L extends LayerInput> = Runtime<Layer.Provided<L>>;
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/runtime/runtime.d.ts
|
|
17
|
-
/**
|
|
18
|
-
* Long-lived execution environment backed by a complete Layer.
|
|
19
|
-
*
|
|
20
|
-
* A Runtime owns Layer resources until `dispose()` is called. Each `run()` is
|
|
21
|
-
* isolated in a child Scope, while Layer-scoped resources remain shared.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const runtime = await Runtime.make(AppLive)
|
|
26
|
-
* const result = await runtime.run(loadUser('u1'))
|
|
27
|
-
* await runtime.dispose()
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* @typeParam Provided The branded Service instances supplied by the Layer.
|
|
31
|
-
*/
|
|
32
|
-
declare class Runtime<Provided extends AnyService = any> {
|
|
33
|
-
private readonly handle;
|
|
34
|
-
private constructor();
|
|
35
|
-
/**
|
|
36
|
-
* Create a long-lived Runtime that owns its Layer resources.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```ts
|
|
40
|
-
* const runtime = await Runtime.make(AppLive)
|
|
41
|
-
* const result = await runtime.run(program)
|
|
42
|
-
* await runtime.dispose()
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
static make<L extends LayerInput>(layer: L & CompleteInput<L>, backend: LayerBackend, options?: RuntimeOptions): Promise<Runtime<ProvidedEnvironment<L>>>;
|
|
46
|
-
static make<L extends LayerInput>(layer: L & CompleteInput<L>, options?: RuntimeOptions): Promise<Runtime<ProvidedEnvironment<L>>>;
|
|
47
|
-
/**
|
|
48
|
-
* Run one program and dispose its Layer resources before resolving.
|
|
49
|
-
*
|
|
50
|
-
* This is convenient for request-style or command-style execution where a
|
|
51
|
-
* Runtime should not outlive the operation.
|
|
52
|
-
*/
|
|
53
|
-
static run<A, L extends LayerInput>(layer: L & CompleteInput<L>, backend: LayerBackend, program: CompleteExecution<ProvidedEnvironment<L>, A>, options?: RuntimeOptions): Promise<Awaited<A>>;
|
|
54
|
-
static run<A, L extends LayerInput>(layer: L & CompleteInput<L>, program: CompleteExecution<ProvidedEnvironment<L>, A>, options?: RuntimeOptions): Promise<Awaited<A>>;
|
|
55
|
-
static run<A, L extends LayerInput>(layer: L & CompleteInput<L>, options: RuntimeOptions, program: CompleteExecution<ProvidedEnvironment<L>, A>): Promise<Awaited<A>>;
|
|
56
|
-
/** Run a callback with a managed Runtime and always dispose it afterward. */
|
|
57
|
-
static use<A, L extends LayerInput>(layer: L & CompleteInput<L>, use: (runtime: Runtime<ProvidedEnvironment<L>>) => A | PromiseLike<A>, options?: RuntimeOptions): Promise<Awaited<A>>;
|
|
58
|
-
/** Resolve every Layer provider and dispose the Runtime if warmup fails. */
|
|
59
|
-
warmup(): Promise<void>;
|
|
60
|
-
/** Run one execution in this Runtime's child Scope. */
|
|
61
|
-
run<A>(program: CompleteExecution<Provided, A>, options?: RuntimeRunOptions): Promise<Awaited<A>>;
|
|
62
|
-
/** Run one execution with a Layer owned by that execution's child Scope. */
|
|
63
|
-
runWith<Request extends LayerInput, A>(layer: Request & CompleteExecutionLayer<Provided, Request>, program: CompleteExecution<Provided | ProvidedEnvironment<Request>, A>, options?: RuntimeRunOptions): Promise<Awaited<A>>;
|
|
64
|
-
private runUnchecked;
|
|
65
|
-
/** Stop new executions and release the Runtime's Layer resources. */
|
|
66
|
-
dispose(options?: RuntimeDisposeOptions): Promise<void>;
|
|
67
|
-
/** @deprecated Scope outcomes are kept for internal compatibility. */
|
|
68
|
-
dispose(outcome: ScopeOutcome): Promise<void>;
|
|
69
|
-
/** Release Runtime-owned resources through JavaScript's async disposal protocol. */
|
|
70
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
71
|
-
private disposeWithOutcome;
|
|
72
|
-
}
|
|
73
|
-
/** Type-level aliases for naming Runtime handles and shutdown options. */
|
|
74
|
-
declare namespace Runtime {
|
|
75
|
-
/** Name a Runtime type from a concrete Layer. */
|
|
76
|
-
type For<L extends LayerInput> = RuntimeFor<L>;
|
|
77
|
-
/** Optional Runtime shutdown configuration. */
|
|
78
|
-
type Options = RuntimeOptions;
|
|
79
|
-
/** Optional signal supplied to one managed Runtime execution. */
|
|
80
|
-
type RunOptions = RuntimeRunOptions;
|
|
81
|
-
/** Cooperative shutdown policy for a managed Runtime. */
|
|
82
|
-
type DisposeOptions = RuntimeDisposeOptions;
|
|
83
|
-
/** Diagnostic reported for aggregated Runtime shutdown cleanup failures. */
|
|
84
|
-
type ShutdownDiagnostic = RuntimeShutdownDiagnostic;
|
|
85
|
-
}
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region src/runtime/signal.d.ts
|
|
88
|
-
/** Yieldable access to the signal of the current Runtime execution. */
|
|
89
|
-
declare const CurrentAbortSignal: {
|
|
90
|
-
readonly [Symbol.iterator]: () => Generator<never, AbortSignal, unknown>;
|
|
91
|
-
};
|
|
92
|
-
//#endregion
|
|
93
3
|
//#region src/effect/combinators.d.ts
|
|
94
4
|
type EffectInput<A, E> = Result<A, E> | PromiseLike<Result<A, E>>;
|
|
95
5
|
type AnyEffectInput = EffectInput<any, any>;
|
|
@@ -341,6 +251,8 @@ type ProgramAllResultsResult<Programs extends readonly AnyProgram[]> = Program$1
|
|
|
341
251
|
type ProgramForEachResult<Child extends AnyProgram> = Program$1<ReadonlyArray<EffectSuccess<Child>>, EffectError<Child>, EffectRequirements<Child>>;
|
|
342
252
|
type ProgramAllOptions = {
|
|
343
253
|
readonly concurrency?: number;
|
|
254
|
+
/** Optional diagnostic name for the collection execution. */
|
|
255
|
+
readonly name?: string;
|
|
344
256
|
};
|
|
345
257
|
/**
|
|
346
258
|
* Compose `better-result` operations while preserving Service requirements in
|
|
@@ -366,6 +278,12 @@ declare function gen<Yield extends EffectYield, Returned extends AnyResult>(body
|
|
|
366
278
|
/** Build a lazy Program without running its generator. */
|
|
367
279
|
declare function fn<Yield extends EffectYield, Returned extends AnyResult>(body: () => Generator<Yield, Returned, unknown>): ProgramFromGenerator<Yield, Returned>;
|
|
368
280
|
declare function fn<Yield extends EffectYield, Returned extends AnyResult>(body: () => AsyncGenerator<Yield, Returned, unknown>): ProgramFromGenerator<Yield, Returned>;
|
|
281
|
+
type ProgramNamedOperation = {
|
|
282
|
+
<Input extends AnyProgram>(program: Input): Input;
|
|
283
|
+
};
|
|
284
|
+
/** Attach a lazy diagnostic name to a Program without invoking it. */
|
|
285
|
+
declare function programNamed(name: string): ProgramNamedOperation;
|
|
286
|
+
declare function programNamed<Input extends AnyProgram>(name: string, program: Input): Input;
|
|
369
287
|
/** Build a lazy Program collection with optional bounded concurrency. */
|
|
370
288
|
declare function programAll<const Programs extends readonly AnyProgram[]>(programs: Programs, options?: ProgramAllOptions): ProgramAllResult<Programs>;
|
|
371
289
|
/** Build a lazy Program collection from an input array and Program factory. */
|
|
@@ -374,6 +292,7 @@ declare function programForEach<const Items extends readonly unknown[], Child ex
|
|
|
374
292
|
declare function programAllResults<const Programs extends readonly AnyProgram[]>(programs: Programs, options?: ProgramAllOptions): ProgramAllResultsResult<Programs>;
|
|
375
293
|
/** Value-level namespace for lazy Program combinators. */
|
|
376
294
|
declare const Program: {
|
|
295
|
+
readonly named: typeof programNamed;
|
|
377
296
|
readonly all: typeof programAll;
|
|
378
297
|
readonly forEach: typeof programForEach;
|
|
379
298
|
readonly allResults: typeof programAllResults;
|
|
@@ -399,7 +318,7 @@ declare const Program: {
|
|
|
399
318
|
* )
|
|
400
319
|
* ```
|
|
401
320
|
*/
|
|
402
|
-
declare function acquireRelease<R>(acquire: () => MaybePromise
|
|
321
|
+
declare function acquireRelease<R>(acquire: () => MaybePromise<R>, release: (resource: R, outcome: ScopeOutcome) => MaybePromise<void>): AsyncGenerator<Err<never, UnhandledException>, R, unknown>;
|
|
403
322
|
/**
|
|
404
323
|
* Acquire a Result-valued resource and register only successful acquisitions.
|
|
405
324
|
*
|
|
@@ -407,14 +326,14 @@ declare function acquireRelease<R>(acquire: () => MaybePromise$1<R>, release: (r
|
|
|
407
326
|
* unexpected acquisition and registration failures are normalized by
|
|
408
327
|
* `better-result`. Release failures remain Scope cleanup failures.
|
|
409
328
|
*/
|
|
410
|
-
declare function acquireReleaseResult<R, E>(acquire: () => MaybePromise
|
|
329
|
+
declare function acquireReleaseResult<R, E>(acquire: () => MaybePromise<Result<R, E>>, release: (resource: R, outcome: ScopeOutcome) => MaybePromise<void>): AsyncGenerator<Err<never, E | UnhandledException>, R, unknown>;
|
|
411
330
|
/**
|
|
412
331
|
* Lazily acquire and register a disposable resource in the current Scope.
|
|
413
332
|
*
|
|
414
333
|
* Disposal is delegated to `Scope.add`, including protocol preference,
|
|
415
334
|
* validation, race-safe registration, and cleanup error handling.
|
|
416
335
|
*/
|
|
417
|
-
declare function acquireDisposable<R extends DisposableResource>(acquire: () => MaybePromise
|
|
336
|
+
declare function acquireDisposable<R extends DisposableResource>(acquire: () => MaybePromise<R>): AsyncGenerator<Err<never, UnhandledException>, R, unknown>;
|
|
418
337
|
/**
|
|
419
338
|
* Register an already-acquired disposable resource in the current Scope.
|
|
420
339
|
*
|
|
@@ -477,60 +396,5 @@ declare namespace Effect {
|
|
|
477
396
|
type Any = AnyEffect;
|
|
478
397
|
}
|
|
479
398
|
//#endregion
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
declare function pipe<A>(value: A): A;
|
|
483
|
-
declare function pipe<A, B>(value: A, ab: Unary<A, B>): B;
|
|
484
|
-
declare function pipe<A, B, C>(value: A, ab: Unary<A, B>, bc: Unary<B, C>): C;
|
|
485
|
-
declare function pipe<A, B, C, D>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>): D;
|
|
486
|
-
declare function pipe<A, B, C, D, E>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>): E;
|
|
487
|
-
declare function pipe<A, B, C, D, E, F>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>, ef: Unary<E, F>): F;
|
|
488
|
-
declare function pipe<A, B, C, D, E, F, G>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>, ef: Unary<E, F>, fg: Unary<F, G>): G;
|
|
489
|
-
declare function pipe<A, B, C, D, E, F, G, H>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>, ef: Unary<E, F>, fg: Unary<F, G>, gh: Unary<G, H>): H;
|
|
490
|
-
declare function pipe<A, B, C, D, E, F, G, H, I>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>, ef: Unary<E, F>, fg: Unary<F, G>, gh: Unary<G, H>, hi: Unary<H, I>): I;
|
|
491
|
-
declare function pipe<A, B, C, D, E, F, G, H, I, J>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>, ef: Unary<E, F>, fg: Unary<F, G>, gh: Unary<G, H>, hi: Unary<H, I>, ij: Unary<I, J>): J;
|
|
492
|
-
declare function pipe<A, B, C, D, E, F, G, H, I, J, K>(value: A, ab: Unary<A, B>, bc: Unary<B, C>, cd: Unary<C, D>, de: Unary<D, E>, ef: Unary<E, F>, fg: Unary<F, G>, gh: Unary<G, H>, hi: Unary<H, I>, ij: Unary<I, J>, jk: Unary<J, K>): K;
|
|
493
|
-
//#endregion
|
|
494
|
-
//#region src/resource/errors.d.ts
|
|
495
|
-
declare const ResourceReleaseFailure_base: import("better-result").TaggedErrorClass<"ResourceReleaseFailure">;
|
|
496
|
-
/** Describes a failure encountered while releasing a Resource. */
|
|
497
|
-
declare class ResourceReleaseFailure extends ResourceReleaseFailure_base<{
|
|
498
|
-
readonly resource: string;
|
|
499
|
-
readonly cause: unknown;
|
|
500
|
-
readonly message: string;
|
|
501
|
-
}> {}
|
|
502
|
-
//#endregion
|
|
503
|
-
//#region src/resource/types.d.ts
|
|
504
|
-
/** A value that may be delivered synchronously or through a thenable. */
|
|
505
|
-
type MaybePromise<T> = T | PromiseLike<T>;
|
|
506
|
-
/** A synchronous or asynchronous better-result Result operation. */
|
|
507
|
-
type AsyncResult<T, E> = MaybePromise<Result<T, E>>;
|
|
508
|
-
/** The allowed return value of a custom Resource release callback. */
|
|
509
|
-
type ReleaseOutcome = void | Result<void, unknown>;
|
|
510
|
-
/** Receives release failures for diagnostics without changing error precedence. */
|
|
511
|
-
type ReleaseFailureObserver = (failure: ResourceReleaseFailure) => MaybePromise<void>;
|
|
512
|
-
/** Options controlling `Resource.acquireUseRelease`. */
|
|
513
|
-
type AcquireUseReleaseOptions<R, A, AcquireError, UseError> = {
|
|
514
|
-
/** Human-readable name included in release failures. */
|
|
515
|
-
readonly name: string;
|
|
516
|
-
/** Acquire the resource. A failure skips use and release. */
|
|
517
|
-
readonly acquire: () => AsyncResult<R, AcquireError>;
|
|
518
|
-
/** Use the acquired resource. Release is attempted afterward. */
|
|
519
|
-
readonly use: (resource: R) => AsyncResult<A, UseError>;
|
|
520
|
-
/** Release the resource, or omit it to use its disposal protocol. */
|
|
521
|
-
readonly release?: (resource: R) => MaybePromise<ReleaseOutcome>;
|
|
522
|
-
/**
|
|
523
|
-
* Observe cleanup failures without changing error precedence. This is most
|
|
524
|
-
* useful when both `use` and `release` can fail.
|
|
525
|
-
*/
|
|
526
|
-
readonly onReleaseFailure?: ReleaseFailureObserver;
|
|
527
|
-
};
|
|
528
|
-
//#endregion
|
|
529
|
-
//#region src/resource/resource.d.ts
|
|
530
|
-
declare const Resource: {
|
|
531
|
-
/** Acquire, use, and release a resource with deterministic error precedence. */
|
|
532
|
-
readonly acquireUseRelease: <R, A, AcquireError, UseError>({ name, acquire, use, release, onReleaseFailure }: AcquireUseReleaseOptions<R, A, AcquireError, UseError>) => Promise<Result<A, AcquireError | UseError | UnhandledException | ResourceReleaseFailure>>;
|
|
533
|
-
};
|
|
534
|
-
//#endregion
|
|
535
|
-
export { ReleaseOutcome as a, Effect as c, CurrentAbortSignal as d, Runtime as f, ReleaseFailureObserver as i, Program as l, AcquireUseReleaseOptions as n, ResourceReleaseFailure as o, RuntimeFor as p, AsyncResult as r, pipe as s, Resource as t, ProgramAllOptions as u };
|
|
536
|
-
//# sourceMappingURL=index-C7Qild0_.d.mts.map
|
|
399
|
+
export { Program as n, ProgramAllOptions as r, Effect as t };
|
|
400
|
+
//# sourceMappingURL=index-CCi07kUw.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CCi07kUw.d.mts","names":[],"sources":["../src/effect/combinators.ts","../src/effect/program-combinators.ts","../src/effect/effect.ts"],"mappings":";;;KAYK,YAAY,GAAG,KAAK,OAAW,GAAG,KAAK,YAAY,OAAW,GAAG;KAEjE,iBAAiB;KACjB,iBAAiB;KACjB,sBAAsB,YAAY;KAIlC,cAAc,OAAO,UAAU,cAAc,uBAAuB,QAAQ,UAAU;KAEtF,aAAa,OAAO,KAAK,SAAO,GAAG,YAAY,QAAQ,mBAAmB;KAE1E,kBAAkB,OAAO,MAAM,SAAO,cAAc,QAAQ,IAAI,mBAAmB;KAEnF,cAAc,OAAO,QAAQ,SAChC,cAAc,OACd,YAAY,SAAS,YAAY,OACjC,mBAAmB,SAAS,mBAAmB;KAG5C,cAAc,OAAO,QAAQ,cAAc,OAAO;KAElD,mBAAmB,OAAO,QAAQ,QAAQ,cAAc,OAAO;KAE/D,eAAa,GAAG;GAClB,OAAO,QAAQ,QAAQ,YAAY,UAAU,cAAc,OAAO,aAAa,OAAO;;KAGpF,oBAAkB,IAAI;GACxB,OAAO,QAAQ,QAAQ,iBAAiB,MAAM,cAAc,OAAO,kBAAkB,OAAO;;KAG1F,mBAAiB;GACnB,OAAO,QAAQ,QAAQ,iBAAiB,cAAc,OAAO;;KAG3D,sBAAsB,GAAG;GAC3B,OAAO,QAAQ,QAAQ,YAAY,UAAU,mBAAmB,OAAO;;KAGrE,aAAa,SAAS,SACzB,cAAc,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,UAAU,oBAC5B,UAAU,IACT,eAAe,WAAW,qBAAqB;;;;;;;KAY7C;WACM,YAAY;WACZ,WAAW;WACX,uBAAuB;WACvB,6BAA6B;WAC7B,0BAA0B;WAC1B,YAAY;WACZ,YAAY;WACZ,iBAAiB;WACjB,gBAAgB;WAChB,qBAAqB;WACrB,YAAY;WACZ,iBAAiB;WACjB,iBAAiB;WACjB,sBAAsB;WACtB,gBAAgB;WAChB,qBAAqB;WACrB,mBAAmB;WACnB,0BAA0B;WAC1B,gBAAgB;WAChB,qBAAqB;WACrB,gBAAgB;WAChB,WAAW;WACX,eAAe;WACf,cAAc;WACd,YAAY;WACZ,YAAY;;cAGV,QAAQ;;kBAwDI;;OAEX,QAAQ,GAAG,GAAG,UAAU,sBAAsB,YAAY,GAAG,GAAG;;OAGhE,QAAQ,KAAK,cAAc;;OAG3B,MAAM,KAAK,YAAY;;OAGvB,aAAa,KAAK,mBAAmB;;OAGrC,MAAM"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { N as AnyServiceToken } from "./index-AiKM71-u.mjs";
|
|
2
|
+
import { d as LayerBackend, f as LayerBackendDisposeOptions, m as LayerRegistration } from "./outcome-DI8LPIQ4.mjs";
|
|
3
|
+
import "./observer-9nhbL7Pr.mjs";
|
|
4
|
+
//#region src/layer/map-layer-backend.d.ts
|
|
5
|
+
/** Native map-backed Layer backend used by Runtime when no adapter is supplied. */
|
|
6
|
+
declare class MapLayerBackend implements LayerBackend {
|
|
7
|
+
private readonly providers;
|
|
8
|
+
private readonly instances;
|
|
9
|
+
private readonly pending;
|
|
10
|
+
/** Register a provider, rejecting duplicate or colliding Service tags. */
|
|
11
|
+
register(registration: LayerRegistration): void;
|
|
12
|
+
/** Resolve and cache a provider instance by Service tag. */
|
|
13
|
+
resolve<T extends AnyServiceToken>(token: T): Promise<InstanceType<T>>;
|
|
14
|
+
/** Clear pending acquisitions, cached instances, and provider registrations. */
|
|
15
|
+
disposeAll(options?: LayerBackendDisposeOptions): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { MapLayerBackend as t };
|
|
19
|
+
//# sourceMappingURL=index-DAKn0qHk.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DAKn0qHk.d.mts","names":[],"sources":["../src/layer/map-layer-backend.ts"],"mappings":";;;;;cAca,2BAA2B;mBACrB;mBAEA;mBAEA;;EAGjB,SAAS,cAAc;;EAiBjB,QAAQ,UAAU,iBAAiB,OAAO,IAAI,QAAQ,aAAa;;EA6CnE,WAAW,UAAU,6BAA6B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { H as ServiceToken, I as ServiceIdentity, b as Service, j as ServiceRequirement } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
import "./index-
|
|
1
|
+
import { H as ServiceToken, I as ServiceIdentity, b as Service, j as ServiceRequirement } from "./index-AiKM71-u.mjs";
|
|
2
|
+
import { A as ProviderEntry, x as LayerResult } from "./outcome-DI8LPIQ4.mjs";
|
|
3
|
+
import "./index-BodMy6rO.mjs";
|
|
4
|
+
import "./current-request-CIU7AHhF.mjs";
|
|
4
5
|
import { Err, StandardSchemaV1, UnhandledException } from "better-result";
|
|
5
6
|
//#region src/standard-services/config.d.ts
|
|
6
7
|
/** Raw string values supplied to a configuration schema. */
|
|
@@ -67,7 +68,59 @@ declare class Config extends Config_base {
|
|
|
67
68
|
/** The default lazy host-environment Config provider. */
|
|
68
69
|
declare const ConfigLive: LayerResult<ProviderEntry<Config, never>>;
|
|
69
70
|
//#endregion
|
|
71
|
+
//#region src/standard-services/id-generator.d.ts
|
|
72
|
+
/** Thrown when the host does not expose the supported Web Crypto UUID API. */
|
|
73
|
+
declare class IdGeneratorUnavailableError extends Error {
|
|
74
|
+
constructor();
|
|
75
|
+
}
|
|
76
|
+
/** Thrown when an {@link IdGeneratorTest} queue has no IDs left. */
|
|
77
|
+
declare class IdGeneratorExhaustedError extends Error {
|
|
78
|
+
readonly generated: number;
|
|
79
|
+
constructor(generated: number);
|
|
80
|
+
}
|
|
81
|
+
declare const IdGenerator_base: (abstract new () => ServiceIdentity<"IdGenerator">) & {
|
|
82
|
+
readonly name: string;
|
|
83
|
+
readonly serviceTag: "IdGenerator";
|
|
84
|
+
} & {
|
|
85
|
+
readonly of: Service.FactoryOf<IdGenerator, "IdGenerator">;
|
|
86
|
+
readonly [Symbol.asyncIterator]: (this: ServiceToken<"IdGenerator", IdGenerator & ServiceIdentity<"IdGenerator">>) => AsyncGenerator<ServiceRequirement<IdGenerator>, IdGenerator, unknown>;
|
|
87
|
+
};
|
|
88
|
+
/** Host-backed UUID string ID service. */
|
|
89
|
+
declare class IdGenerator extends IdGenerator_base {
|
|
90
|
+
/** Generate a cryptographically strong UUID string using the host Web Crypto API. */
|
|
91
|
+
next(): string;
|
|
92
|
+
}
|
|
93
|
+
/** The default host IdGenerator provider. */
|
|
94
|
+
declare const IdGeneratorLive: LayerResult<ProviderEntry<IdGenerator, never>>;
|
|
95
|
+
type IdFactory = (index: number) => string;
|
|
96
|
+
/** Deterministic queue- or factory-backed IdGenerator implementation for tests. */
|
|
97
|
+
declare class IdGeneratorTest implements Service.Contract<IdGenerator> {
|
|
98
|
+
private readonly queue;
|
|
99
|
+
private factory;
|
|
100
|
+
private generatedCount;
|
|
101
|
+
constructor(ids?: readonly string[]);
|
|
102
|
+
/** Number of IDs successfully returned by this test generator. */
|
|
103
|
+
get generated(): number;
|
|
104
|
+
/** Number of queued IDs still available, or Infinity for a factory. */
|
|
105
|
+
get remaining(): number;
|
|
106
|
+
/** Return the next queued or factory-generated string ID. */
|
|
107
|
+
next(): string;
|
|
108
|
+
/**
|
|
109
|
+
* Create a factory-backed generator. The factory receives a monotonic
|
|
110
|
+
* zero-based index: the first call receives 0, then 1, and so on.
|
|
111
|
+
*/
|
|
112
|
+
static from(factory: IdFactory): IdGeneratorTest;
|
|
113
|
+
/** Create a Layer for this generator, allocating a fresh empty queue by default. */
|
|
114
|
+
static layer(generator?: IdGeneratorTest): LayerResult<ProviderEntry<IdGenerator, never>>;
|
|
115
|
+
}
|
|
116
|
+
/** Compatible functional shorthand for {@link IdGeneratorTest.layer}. */
|
|
117
|
+
declare const IdGeneratorTestLayer: (generator?: IdGeneratorTest) => LayerResult<ProviderEntry<IdGenerator, never>>;
|
|
118
|
+
//#endregion
|
|
70
119
|
//#region src/standard-services/index.d.ts
|
|
120
|
+
/** Optional cooperative cancellation for a host or test Clock sleep. */
|
|
121
|
+
type ClockSleepOptions = {
|
|
122
|
+
readonly signal?: AbortSignal;
|
|
123
|
+
};
|
|
71
124
|
declare const Clock_base: (abstract new () => ServiceIdentity<"Clock">) & {
|
|
72
125
|
readonly name: string;
|
|
73
126
|
readonly serviceTag: "Clock";
|
|
@@ -78,21 +131,36 @@ declare const Clock_base: (abstract new () => ServiceIdentity<"Clock">) & {
|
|
|
78
131
|
/** Host-backed time and waiting service. */
|
|
79
132
|
declare class Clock extends Clock_base {
|
|
80
133
|
now(): Date;
|
|
81
|
-
|
|
134
|
+
/** Rejects with the signal reason, or an AbortError-compatible fallback. */
|
|
135
|
+
sleep(milliseconds: number, options?: ClockSleepOptions): Promise<void>;
|
|
82
136
|
}
|
|
83
137
|
/** The default host Clock provider. */
|
|
84
138
|
declare const ClockLive: LayerResult<ProviderEntry<Clock, never>>;
|
|
139
|
+
/** Limits deadline advances performed by `ClockTest.runAll`. */
|
|
140
|
+
type ClockTestRunAllOptions = {
|
|
141
|
+
readonly maxSteps?: number;
|
|
142
|
+
};
|
|
85
143
|
/** Deterministic Clock implementation for tests. */
|
|
86
144
|
declare class ClockTest implements Service.Contract<Clock> {
|
|
87
145
|
private currentTime;
|
|
88
146
|
private readonly waiters;
|
|
89
147
|
constructor(initial?: Date | number);
|
|
148
|
+
/** Number of sleeps that have not been settled or cancelled. */
|
|
149
|
+
get pendingSleeps(): number;
|
|
90
150
|
now(): Date;
|
|
151
|
+
/** Set an absolute time; moving backward leaves existing absolute deadlines unchanged. */
|
|
91
152
|
setTime(value: Date | number): void;
|
|
92
153
|
advance(milliseconds: number): void;
|
|
93
|
-
sleep(milliseconds: number): Promise<void>;
|
|
154
|
+
sleep(milliseconds: number, options?: ClockSleepOptions): Promise<void>;
|
|
155
|
+
/** Advance synchronously; due Promise continuations run after this method returns. */
|
|
156
|
+
advanceToNext(): boolean;
|
|
157
|
+
/** Advance all pending deadlines, guarding at 1,000 steps by default. */
|
|
158
|
+
runAll(options?: ClockTestRunAllOptions): Promise<number>;
|
|
94
159
|
static layer(initial?: Date | number): LayerResult<ProviderEntry<Clock, never>>;
|
|
160
|
+
private enqueueWaiter;
|
|
161
|
+
private cancelWaiter;
|
|
95
162
|
private flushWaiters;
|
|
163
|
+
private finishWaiter;
|
|
96
164
|
}
|
|
97
165
|
declare const ClockTestLayer: (initial?: Date | number) => LayerResult<ProviderEntry<Clock, never>>;
|
|
98
166
|
declare const Random_base: (abstract new () => ServiceIdentity<"Random">) & {
|
|
@@ -162,21 +230,6 @@ declare class LoggerTest implements Service.Contract<Logger> {
|
|
|
162
230
|
static layer(logger?: LoggerTest): LayerResult<ProviderEntry<Logger, never>>;
|
|
163
231
|
}
|
|
164
232
|
declare const LoggerTestLayer: () => LayerResult<ProviderEntry<Logger, never>>;
|
|
165
|
-
declare const CurrentRequest_base: (abstract new () => ServiceIdentity<"CurrentRequest">) & {
|
|
166
|
-
readonly name: string;
|
|
167
|
-
readonly serviceTag: "CurrentRequest";
|
|
168
|
-
} & {
|
|
169
|
-
readonly of: Service.FactoryOf<CurrentRequest, "CurrentRequest">;
|
|
170
|
-
readonly [Symbol.asyncIterator]: (this: ServiceToken<"CurrentRequest", CurrentRequest & ServiceIdentity<"CurrentRequest">>) => AsyncGenerator<ServiceRequirement<CurrentRequest>, CurrentRequest, unknown>;
|
|
171
|
-
};
|
|
172
|
-
/** Execution-local request value carried by a normal Service provider. */
|
|
173
|
-
declare class CurrentRequest extends CurrentRequest_base {
|
|
174
|
-
readonly value: unknown;
|
|
175
|
-
readonly request: unknown;
|
|
176
|
-
constructor(value: unknown);
|
|
177
|
-
static layer(value: unknown): LayerResult<ProviderEntry<CurrentRequest, never>>;
|
|
178
|
-
}
|
|
179
|
-
declare const CurrentRequestLayer: (value: unknown) => LayerResult<ProviderEntry<CurrentRequest, never>>;
|
|
180
233
|
//#endregion
|
|
181
|
-
export {
|
|
182
|
-
//# sourceMappingURL=index-
|
|
234
|
+
export { ConfigOutput as A, IdGeneratorUnavailableError as C, ConfigInput as D, ConfigFromEnvOptions as E, ConfigValue as F, StandardSchemaV1 as I, ConfigSourceError as M, ConfigSourceOptions as N, ConfigIssue as O, ConfigValidationError as P, IdGeneratorTestLayer as S, ConfigError as T, RandomSeededLayer as _, ClockTestLayer as a, IdGeneratorLive as b, LoggerData as c, LoggerLive as d, LoggerTest as f, RandomSeeded as g, RandomLive as h, ClockTest as i, ConfigSource as j, ConfigLive as k, LoggerEvent as l, Random as m, ClockLive as n, ClockTestRunAllOptions as o, LoggerTestLayer as p, ClockSleepOptions as r, Logger as s, Clock as t, LoggerLevel as u, IdGenerator as v, Config as w, IdGeneratorTest as x, IdGeneratorExhaustedError as y };
|
|
235
|
+
//# sourceMappingURL=index-cXgyMa0v.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-cXgyMa0v.d.mts","names":[],"sources":["../src/standard-services/config.ts","../src/standard-services/id-generator.ts","../src/standard-services/index.ts"],"mappings":";;;;;;;KAcY,eAAe,SAAS;;KAGxB;WACD;WACA,YAAY;;;KAIX,qBAAqB,eAAe,oBAAoB;WACzD,QAAQ;;;KAIP,aAAa,eAAe,oBAAoB,iBAAiB,YAAY;;KAG7E,YAAY,eAAe,oBAAoB,iBAAiB,WAAW;;KAG3E,cAAc,iBAAiB;;;cAG9B,8BAA8B;WAChC,QAAQ,cAAc;WACtB;;;;cAIE,0BAA0B;WAC5B;WACA;WACA;;;KAIC,cAAc,wBAAwB,oBAAoB;KAEjE,YAAY,qBAAqB,QAAQ,K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iB,YAAA,cAAA;UAI/B;UAUA;UAUA;UAaA;;cAqBG,iBAAkB,UAAS,kBAAiB,YAAA,cAAA;;;;;;;;;cAG5C,eAAe;EAC1B;EAIA,QAAQ;;;cAUG,YAAU,YAAA,cAAA;;cAGV,wBAAwB,QAAQ,SAAS;UAC5C;EAEI,YAAA;EAQZ;EAKA,QAAQ;SAQD,MAAM,eAAY,YAAA,cAAA;;cAKd,oBAAqB,iBAAY,YAAA,cAAA;KAElC;KAEA;EACV,OAAO;EACP;EACA,OAAO;;KAGG,kEAMC;YACG,cAAc;;;;;;;;;;cAqBjB,eAAe;EAC1B,IAAI,OAAO;EACX,IAAI,OAAO,aAAa,iBAAiB,OAAO;EAahD,MAAM,iBAAiB,OAAO;EAI9B,KAAK,iBAAiB,OAAO;EAI7B,KAAK,iBAAiB,OAAO;EAI7B,MAAM,iBAAiB,OAAO;;;cAMnB,YAAU,YAAA,cAAA;;cAGV,sBAAsB,QAAQ,SAAS;WACzC,QAAQ;EAEjB,IAAI,OAAO;EACX,IAAI,OAAO,aAAa,iBAAiB,OAAO;EAOhD,MAAM,iBAAiB,OAAO;EAI9B,KAAK,iBAAiB,OAAO;EAI7B,KAAK,iBAAiB,OAAO;EAI7B,MAAM,iBAAiB,OAAO;EAI9B;SAIO;;;;SAKA,MAAM,SAAQ,aAA6B,YAAA,cAAA;;cAKvC,uBAAe,YAAA,cAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { B as ServiceTag, C as EffectError, D as EffectYield, E as EffectSuccess, F as ServiceContract, H as ServiceToken, I as ServiceIdentity, M as AnyService, N as AnyServiceToken, P as ServiceClass, R as ServiceInstance, T as EffectRequirements, U as ServiceTokenOf, _ as ScopeCloseError, a as ServiceResolver, b as Service, c as RuntimeContextStorage, d as CleanupFailureDiagnostic, f as DisposableResource, g as ResourceNotDisposableError, h as ScopeOutcome, i as ServiceRuntimeNotConfiguredError, j as ServiceRequirement, l as CloseableScope, m as ScopeFinalizer, n as ServiceAcquisitionError, o as ServiceRuntime, r as ServiceNotFoundError, s as RuntimeContext, t as CircularDependencyError, u as Scope, v as ScopeClosedError, x as AnyEffect, y as ScopeRuntimeNotConfiguredError, z as ServiceRequirements } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
1
|
+
import { B as ServiceTag, C as EffectError, D as EffectYield, E as EffectSuccess, F as ServiceContract, H as ServiceToken, I as ServiceIdentity, M as AnyService, N as AnyServiceToken, P as ServiceClass, R as ServiceInstance, T as EffectRequirements, U as ServiceTokenOf, _ as ScopeCloseError, a as ServiceResolver, b as Service, c as RuntimeContextStorage, d as CleanupFailureDiagnostic, f as DisposableResource, g as ResourceNotDisposableError, h as ScopeOutcome, i as ServiceRuntimeNotConfiguredError, j as ServiceRequirement, l as CloseableScope, m as ScopeFinalizer, n as ServiceAcquisitionError, o as ServiceRuntime, r as ServiceNotFoundError, s as RuntimeContext, t as CircularDependencyError, u as Scope, v as ScopeClosedError, x as AnyEffect, y as ScopeRuntimeNotConfiguredError, z as ServiceRequirements } from "./index-AiKM71-u.mjs";
|
|
2
|
+
import { a as RuntimeShutdownDiagnostic, c as LayerGeneratorYieldError, d as LayerBackend, f as LayerBackendDisposeOptions, i as RuntimeRunOptions, l as LayerRegistrationError, m as LayerRegistration, n as RuntimeDisposeOptions, o as DuplicateServiceError, p as Layer, r as RuntimeOptions, s as LayerDisposeError, t as CleanupFailureObserver, u as ServiceTagCollisionError } from "./outcome-DI8LPIQ4.mjs";
|
|
3
|
+
import { a as RuntimeObserver, c as RuntimeServiceResolveEvent, i as RuntimeExecutionStartEvent, n as RuntimeExecutionEndEvent, o as RuntimeResourceReleaseEvent, r as RuntimeExecutionMetadata, s as RuntimeServiceAcquireEvent, t as RuntimeExecutionAttributes } from "./observer-9nhbL7Pr.mjs";
|
|
4
|
+
import { t as MapLayerBackend } from "./index-DAKn0qHk.mjs";
|
|
5
|
+
import { a as ReleaseOutcome, c as CurrentAbortSignal, d as RuntimeFor, f as RuntimeInspection, i as ReleaseFailureObserver, l as Runtime, n as AcquireUseReleaseOptions, o as ResourceReleaseFailure, r as AsyncResult, s as pipe, t as Resource, u as RuntimeExecutionInspection } from "./index-BodMy6rO.mjs";
|
|
4
6
|
import { t as RuntimeContextNotConfiguredError } from "./errors-BKcsQ0ip.mjs";
|
|
5
|
-
|
|
7
|
+
import { n as Program, r as ProgramAllOptions, t as Effect } from "./index-CCi07kUw.mjs";
|
|
8
|
+
export { type AcquireUseReleaseOptions, type AnyEffect, type AnyService, type AnyServiceToken, type AsyncResult, CircularDependencyError, type CleanupFailureDiagnostic, type CleanupFailureObserver, type CloseableScope, CurrentAbortSignal, type DisposableResource, DuplicateServiceError, Effect, type EffectError, type EffectRequirements, type EffectSuccess, type EffectYield, Layer, type LayerBackend, type LayerBackendDisposeOptions, LayerDisposeError, LayerGeneratorYieldError, type LayerRegistration, LayerRegistrationError, MapLayerBackend, Program, type ProgramAllOptions, type ReleaseFailureObserver, type ReleaseOutcome, Resource, ResourceNotDisposableError, ResourceReleaseFailure, Runtime, type RuntimeContext, RuntimeContextNotConfiguredError, type RuntimeContextStorage, type RuntimeDisposeOptions, type RuntimeExecutionAttributes, type RuntimeExecutionEndEvent, type RuntimeExecutionInspection, type RuntimeExecutionMetadata, type RuntimeExecutionStartEvent, type RuntimeFor, type RuntimeInspection, RuntimeObserver, type RuntimeOptions, type RuntimeResourceReleaseEvent, type RuntimeRunOptions, type RuntimeServiceAcquireEvent, type RuntimeServiceResolveEvent, type RuntimeShutdownDiagnostic, Scope, ScopeCloseError, ScopeClosedError, type ScopeFinalizer, type ScopeOutcome, ScopeRuntimeNotConfiguredError, Service, ServiceAcquisitionError, type ServiceClass, type ServiceContract, type ServiceIdentity, type ServiceInstance, ServiceNotFoundError, type ServiceRequirement, type ServiceRequirements, type ServiceResolver, ServiceRuntime, ServiceRuntimeNotConfiguredError, type ServiceTag, ServiceTagCollisionError, type ServiceToken, type ServiceTokenOf, pipe };
|