brass-runtime 1.15.0 → 1.16.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 +409 -137
- package/dist/agent/cli/main.cjs +40 -35
- package/dist/agent/cli/main.js +9 -4
- package/dist/agent/cli/main.mjs +9 -4
- package/dist/agent/index.cjs +8 -4
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +7 -3
- package/dist/agent/index.mjs +7 -3
- package/dist/{chunk-PPUXIH5R.js → chunk-2WC63LJK.mjs} +11 -7
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/chunk-45F7OKGT.cjs +104 -0
- package/dist/chunk-5YOQOXEQ.cjs +2491 -0
- package/dist/{chunk-STVLQ3XD.cjs → chunk-7HUOJA4W.cjs} +78 -74
- package/dist/{chunk-BMH5AV44.js → chunk-7LVI2GIN.js} +251 -370
- package/dist/chunk-7TL2LHQJ.js +2491 -0
- package/dist/chunk-7V4KY4RL.mjs +104 -0
- package/dist/chunk-7XOPAB5Q.js +2143 -0
- package/dist/chunk-CCKHV5BT.mjs +193 -0
- package/dist/{chunk-AR22SXML.js → chunk-CY33PGEX.mjs} +488 -421
- package/dist/chunk-DJQ7OMMB.cjs +144 -0
- package/dist/chunk-F5EUMJL7.mjs +2143 -0
- package/dist/chunk-FM4W4QPL.js +193 -0
- package/dist/{chunk-TO7IKXYT.js → chunk-G3XGCZDQ.js} +1 -1
- package/dist/{chunk-BDF4AMWX.mjs → chunk-G6IQOE4P.mjs} +251 -370
- package/dist/chunk-GOV47PPB.mjs +552 -0
- package/dist/chunk-H55LI6WY.js +93 -0
- package/dist/chunk-IJT6RRQ5.cjs +93 -0
- package/dist/{chunk-ELOOF35R.mjs → chunk-J3H54ZRV.mjs} +1 -1
- package/dist/chunk-JF4XXPZ5.cjs +552 -0
- package/dist/chunk-JNFRRJYH.cjs +2143 -0
- package/dist/chunk-JX3LZQJH.cjs +354 -0
- package/dist/chunk-K2T3DV26.mjs +93 -0
- package/dist/chunk-KCPT2D6G.js +552 -0
- package/dist/chunk-MWXMNYJS.cjs +1110 -0
- package/dist/{chunk-VEZNF5GZ.cjs → chunk-N6VHMOWB.cjs} +130 -126
- package/dist/{chunk-3QMOKAS5.js → chunk-NC5SDRYE.js} +9 -5
- package/dist/chunk-NOYZIMUJ.mjs +144 -0
- package/dist/{chunk-R3R2FVLG.cjs → chunk-NYL4D7SK.cjs} +5 -5
- package/dist/chunk-OBGZSXTJ.cjs +10 -0
- package/dist/{chunk-4NHES7VK.mjs → chunk-OOGJ73B6.js} +11 -7
- package/dist/chunk-PNVFW245.js +144 -0
- package/dist/chunk-PRWCB3QL.mjs +2491 -0
- package/dist/{chunk-JFPU5GQI.mjs → chunk-QY5FKYEQ.js} +488 -421
- package/dist/chunk-ROJC3NBJ.js +104 -0
- package/dist/chunk-SPUEME2B.cjs +343 -0
- package/dist/chunk-TDVMADDN.js +343 -0
- package/dist/chunk-TVN5I4U6.cjs +193 -0
- package/dist/chunk-U5KWK3PX.mjs +343 -0
- package/dist/chunk-VFIUZG7J.mjs +354 -0
- package/dist/{chunk-TGIFUAK4.cjs → chunk-WQ5QNU5R.cjs} +459 -578
- package/dist/chunk-XDZOO4L5.js +354 -0
- package/dist/chunk-Y6FXYEAI.mjs +10 -0
- package/dist/{chunk-K6M7MDZ4.mjs → chunk-ZGLD4TVZ.mjs} +9 -5
- package/dist/client-CtFmoDvM.d.ts +645 -0
- package/dist/core/index.cjs +72 -4
- package/dist/core/index.d.ts +92 -198
- package/dist/core/index.js +106 -38
- package/dist/core/index.mjs +106 -38
- package/dist/{effect-CMOQKX8y.d.ts → effect-CGNl5Rqp.d.ts} +107 -1
- package/dist/effectRunner-3ZHAD3LE.cjs +8 -0
- package/dist/effectRunner-A4CHJXJI.js +8 -0
- package/dist/effectRunner-OPUF6QRN.mjs +8 -0
- package/dist/http/index.cjs +2189 -1271
- package/dist/http/index.d.ts +830 -270
- package/dist/http/index.js +2008 -1090
- package/dist/http/index.mjs +2008 -1090
- package/dist/http/testing.cjs +159 -0
- package/dist/http/testing.d.ts +42 -0
- package/dist/http/testing.js +159 -0
- package/dist/http/testing.mjs +159 -0
- package/dist/index.cjs +246 -178
- package/dist/index.d.ts +9 -35
- package/dist/index.js +120 -52
- package/dist/index.mjs +120 -52
- package/dist/observability/index.cjs +677 -0
- package/dist/observability/index.d.ts +79 -0
- package/dist/observability/index.js +677 -0
- package/dist/observability/index.mjs +677 -0
- package/dist/schedule-Fque9Abz.d.ts +70 -0
- package/dist/schema/index.cjs +25 -0
- package/dist/schema/index.d.ts +177 -0
- package/dist/schema/index.js +25 -0
- package/dist/schema/index.mjs +25 -0
- package/dist/server-C8hDXA74.d.ts +674 -0
- package/dist/{stream-FQm9h4Mg.d.ts → stream-dvSs0QS5.d.ts} +1 -1
- package/dist/tracer-B5tRH9H7.d.ts +230 -0
- package/dist/tracing-Dt9S_6V8.d.ts +148 -0
- package/package.json +27 -1
- package/dist/chunk-BDYEENHT.js +0 -224
- package/dist/chunk-MS34J5LY.cjs +0 -224
- package/dist/chunk-UMAZLXAB.mjs +0 -224
- package/dist/chunk-XPZNXSVN.cjs +0 -1043
- package/dist/tracing-DNT9jEbr.d.ts +0 -106
package/dist/core/index.cjs
CHANGED
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
+
var _chunkMWXMNYJScjs = require('../chunk-MWXMNYJS.cjs');
|
|
40
41
|
|
|
41
42
|
|
|
42
43
|
|
|
@@ -47,7 +48,6 @@
|
|
|
47
48
|
|
|
48
49
|
|
|
49
50
|
|
|
50
|
-
var _chunkXPZNXSVNcjs = require('../chunk-XPZNXSVN.cjs');
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
@@ -55,7 +55,6 @@ var _chunkXPZNXSVNcjs = require('../chunk-XPZNXSVN.cjs');
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
var _chunkMS34J5LYcjs = require('../chunk-MS34J5LY.cjs');
|
|
59
58
|
|
|
60
59
|
|
|
61
60
|
|
|
@@ -71,12 +70,14 @@ var _chunkMS34J5LYcjs = require('../chunk-MS34J5LY.cjs');
|
|
|
71
70
|
|
|
72
71
|
|
|
73
72
|
|
|
73
|
+
var _chunkJF4XXPZ5cjs = require('../chunk-JF4XXPZ5.cjs');
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
|
|
80
|
+
var _chunk45F7OKGTcjs = require('../chunk-45F7OKGT.cjs');
|
|
80
81
|
|
|
81
82
|
|
|
82
83
|
|
|
@@ -84,10 +85,12 @@ var _chunkMS34J5LYcjs = require('../chunk-MS34J5LY.cjs');
|
|
|
84
85
|
|
|
85
86
|
|
|
86
87
|
|
|
88
|
+
var _chunkJX3LZQJHcjs = require('../chunk-JX3LZQJH.cjs');
|
|
87
89
|
|
|
88
90
|
|
|
89
91
|
|
|
90
92
|
|
|
93
|
+
var _chunkTVN5I4U6cjs = require('../chunk-TVN5I4U6.cjs');
|
|
91
94
|
|
|
92
95
|
|
|
93
96
|
|
|
@@ -107,9 +110,9 @@ var _chunkMS34J5LYcjs = require('../chunk-MS34J5LY.cjs');
|
|
|
107
110
|
|
|
108
111
|
|
|
109
112
|
|
|
110
|
-
var _chunkTGIFUAK4cjs = require('../chunk-TGIFUAK4.cjs');
|
|
111
113
|
|
|
112
114
|
|
|
115
|
+
var _chunkWQ5QNU5Rcjs = require('../chunk-WQ5QNU5R.cjs');
|
|
113
116
|
|
|
114
117
|
|
|
115
118
|
|
|
@@ -141,6 +144,9 @@ var _chunkTGIFUAK4cjs = require('../chunk-TGIFUAK4.cjs');
|
|
|
141
144
|
|
|
142
145
|
|
|
143
146
|
|
|
147
|
+
var _chunkDJQ7OMMBcjs = require('../chunk-DJQ7OMMB.cjs');
|
|
148
|
+
require('../chunk-SPUEME2B.cjs');
|
|
149
|
+
require('../chunk-OBGZSXTJ.cjs');
|
|
144
150
|
|
|
145
151
|
|
|
146
152
|
|
|
@@ -213,4 +219,66 @@ var _chunkTGIFUAK4cjs = require('../chunk-TGIFUAK4.cjs');
|
|
|
213
219
|
|
|
214
220
|
|
|
215
221
|
|
|
216
|
-
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
exports.Async = _chunkDJQ7OMMBcjs.Async; exports.Cause = _chunkDJQ7OMMBcjs.Cause; exports.EventBus = _chunkJX3LZQJHcjs.EventBus; exports.Exit = _chunkDJQ7OMMBcjs.Exit; exports.InMemoryTracer = _chunkJX3LZQJHcjs.InMemoryTracer; exports.NoopHooks = _chunkWQ5QNU5Rcjs.NoopHooks; exports.Resource = _chunkJF4XXPZ5cjs.Resource; exports.Runtime = _chunkWQ5QNU5Rcjs.Runtime; exports.RuntimeFiber = _chunkWQ5QNU5Rcjs.RuntimeFiber; exports.RuntimeRegistry = _chunkMWXMNYJScjs.RuntimeRegistry; exports.Scope = _chunkTVN5I4U6cjs.Scope; exports.Supervisor = _chunkMWXMNYJScjs.Supervisor; exports.abortablePromiseStats = _chunkWQ5QNU5Rcjs.abortablePromiseStats; exports.acquireRelease = _chunkDJQ7OMMBcjs.acquireRelease; exports.andThenSchedule = _chunkJF4XXPZ5cjs.andThen; exports.assertCompletesWithin = _chunkMWXMNYJScjs.assertCompletesWithin; exports.assertFails = _chunkMWXMNYJScjs.assertFails; exports.assertFailsWith = _chunkMWXMNYJScjs.assertFailsWith; exports.assertSucceeds = _chunkMWXMNYJScjs.assertSucceeds; exports.async = _chunkDJQ7OMMBcjs.asyncEffect; exports.asyncCatchAll = _chunkDJQ7OMMBcjs.asyncCatchAll; exports.asyncFail = _chunkDJQ7OMMBcjs.asyncFail; exports.asyncFlatMap = _chunkDJQ7OMMBcjs.asyncFlatMap; exports.asyncFold = _chunkDJQ7OMMBcjs.asyncFold; exports.asyncInterruptible = _chunkDJQ7OMMBcjs.asyncInterruptible; exports.asyncMap = _chunkDJQ7OMMBcjs.asyncMap; exports.asyncMapError = _chunkDJQ7OMMBcjs.asyncMapError; exports.asyncSucceed = _chunkDJQ7OMMBcjs.asyncSucceed; exports.asyncSync = _chunkDJQ7OMMBcjs.asyncSync; exports.asyncTotal = _chunkDJQ7OMMBcjs.asyncTotal; exports.bracket = _chunkJF4XXPZ5cjs.bracket; exports.catchAll = _chunkDJQ7OMMBcjs.catchAll; exports.catchTag = _chunkMWXMNYJScjs.catchTag; exports.catchTags = _chunkMWXMNYJScjs.catchTags; exports.composeLayer = _chunkMWXMNYJScjs.compose; exports.consoleJsonLogger = _chunkMWXMNYJScjs.consoleJsonLogger; exports.contramapSchedule = _chunkJF4XXPZ5cjs.contramap; exports.ctxExtend = _chunkWQ5QNU5Rcjs.ctxExtend; exports.ctxToObject = _chunkWQ5QNU5Rcjs.ctxToObject; exports.defaultTracer = _chunkMWXMNYJScjs.defaultTracer; exports.delayedEffect = _chunkMWXMNYJScjs.delayedEffect; exports.derivedRef = _chunkMWXMNYJScjs.derivedRef; exports.dumpAllFibers = _chunkMWXMNYJScjs.dumpAllFibers; exports.elapsed = _chunkJF4XXPZ5cjs.elapsed; exports.emptyContext = _chunkWQ5QNU5Rcjs.emptyContext; exports.end = _chunkDJQ7OMMBcjs.end; exports.ensuring = _chunkJF4XXPZ5cjs.ensuring; exports.exponential = _chunkJF4XXPZ5cjs.exponential; exports.fail = _chunkDJQ7OMMBcjs.fail; exports.fibonacci = _chunkJF4XXPZ5cjs.fibonacci; exports.fixed = _chunkJF4XXPZ5cjs.fixed; exports.flakyEffect = _chunkMWXMNYJScjs.flakyEffect; exports.flatMap = _chunkDJQ7OMMBcjs.flatMap; exports.fork = _chunkWQ5QNU5Rcjs.fork; exports.fromPromiseAbortable = _chunkWQ5QNU5Rcjs.fromPromiseAbortable; exports.getBenchmarkBudget = _chunkWQ5QNU5Rcjs.getBenchmarkBudget; exports.getCurrentFiber = _chunkWQ5QNU5Rcjs.getCurrentFiber; exports.gracefulShutdown = _chunkMWXMNYJScjs.gracefulShutdown; exports.intersect = _chunkJF4XXPZ5cjs.intersect; exports.jitter = _chunkJF4XXPZ5cjs.jitter; exports.jittered = _chunkJF4XXPZ5cjs.jittered; exports.jitteredSchedule = _chunkJF4XXPZ5cjs.jitteredSchedule; exports.joinSupervised = _chunkMWXMNYJScjs.joinSupervised; exports.layer = _chunkMWXMNYJScjs.layer; exports.layerFail = _chunkMWXMNYJScjs.layerFail; exports.layerFrom = _chunkMWXMNYJScjs.layerFrom; exports.layerSucceed = _chunkMWXMNYJScjs.layerSucceed; exports.linkAbortController = _chunkMWXMNYJScjs.linkAbortController; exports.makeCancelToken = _chunkMWXMNYJScjs.makeCancelToken; exports.makeCircuitBreaker = _chunkJF4XXPZ5cjs.makeCircuitBreaker; exports.makeMetrics = _chunkJX3LZQJHcjs.makeMetrics; exports.makeRef = _chunkMWXMNYJScjs.makeRef; exports.makeResource = _chunkJF4XXPZ5cjs.makeResource; exports.makeRuntimeEventRecord = _chunkJX3LZQJHcjs.makeRuntimeEventRecord; exports.makeSemaphore = _chunkMWXMNYJScjs.makeSemaphore; exports.makeSupervisor = _chunkMWXMNYJScjs.makeSupervisor; exports.makeTestRuntime = _chunkMWXMNYJScjs.makeTestRuntime; exports.makeTracer = _chunkMWXMNYJScjs.makeTracer; exports.makeWorkerPool = _chunkMWXMNYJScjs.makeWorkerPool; exports.managed = _chunkJF4XXPZ5cjs.managed; exports.managedAll = _chunkJF4XXPZ5cjs.managedAll; exports.map = _chunkDJQ7OMMBcjs.map; exports.mapAsync = _chunkDJQ7OMMBcjs.mapAsync; exports.mapError = _chunkDJQ7OMMBcjs.mapError; exports.mapErrorTyped = _chunkMWXMNYJScjs.mapError; exports.mapLayer = _chunkMWXMNYJScjs.mapLayer; exports.mapSchedule = _chunkJF4XXPZ5cjs.map; exports.mapTryAsync = _chunkDJQ7OMMBcjs.mapTryAsync; exports.mergeLayer = _chunkMWXMNYJScjs.merge; exports.neverEffect = _chunkMWXMNYJScjs.neverEffect; exports.none = _chunkDJQ7OMMBcjs.none; exports.orElse = _chunkMWXMNYJScjs.orElse; exports.orElseOptional = _chunkDJQ7OMMBcjs.orElseOptional; exports.provideLayer = _chunkMWXMNYJScjs.provideLayer; exports.recurs = _chunkJF4XXPZ5cjs.recurs; exports.registerShutdownHooks = _chunkMWXMNYJScjs.registerShutdownHooks; exports.repeatWithSchedule = _chunkJF4XXPZ5cjs.repeatWithSchedule; exports.resetAbortablePromiseStats = _chunkWQ5QNU5Rcjs.resetAbortablePromiseStats; exports.resource = _chunkJF4XXPZ5cjs.resource; exports.resourceAll = _chunkJF4XXPZ5cjs.resourceAll; exports.resourceFromManaged = _chunkJF4XXPZ5cjs.resourceFromManaged; exports.resourceSucceed = _chunkJF4XXPZ5cjs.resourceSucceed; exports.retry = _chunk45F7OKGTcjs.retry; exports.retryN = _chunk45F7OKGTcjs.retryN; exports.retryWithBackoff = _chunk45F7OKGTcjs.retryWithBackoff; exports.retryWithSchedule = _chunkJF4XXPZ5cjs.retryWithSchedule; exports.runtimeEventRecordContext = _chunkJX3LZQJHcjs.runtimeEventRecordContext; exports.runtimeForCaller = _chunkWQ5QNU5Rcjs.runtimeForCaller; exports.runtimeHooksToEventHandler = _chunkJX3LZQJHcjs.runtimeHooksToEventHandler; exports.setBenchmarkBudget = _chunkWQ5QNU5Rcjs.setBenchmarkBudget; exports.sleep = _chunk45F7OKGTcjs.sleep; exports.some = _chunkDJQ7OMMBcjs.some; exports.succeed = _chunkDJQ7OMMBcjs.succeed; exports.supervise = _chunkMWXMNYJScjs.supervise; exports.sync = _chunkDJQ7OMMBcjs.sync; exports.tagError = _chunkMWXMNYJScjs.tagError; exports.takeSchedule = _chunkJF4XXPZ5cjs.take; exports.timeout = _chunk45F7OKGTcjs.timeout; exports.toPromise = _chunkWQ5QNU5Rcjs.toPromise; exports.toPromiseByCaller = _chunkWQ5QNU5Rcjs.toPromiseByCaller; exports.union = _chunkJF4XXPZ5cjs.union; exports.unit = _chunkDJQ7OMMBcjs.unit; exports.unsafeGetCurrentRuntime = _chunkWQ5QNU5Rcjs.unsafeGetCurrentRuntime; exports.unsafeRunAsync = _chunkWQ5QNU5Rcjs.unsafeRunAsync; exports.unsafeRunFoldWithEnv = _chunkWQ5QNU5Rcjs.unsafeRunFoldWithEnv; exports.useManaged = _chunkJF4XXPZ5cjs.useManaged; exports.useResource = _chunkJF4XXPZ5cjs.useResource; exports.whileInput = _chunkJF4XXPZ5cjs.whileInput; exports.windowed = _chunkJF4XXPZ5cjs.windowed; exports.withAsyncPromise = _chunkDJQ7OMMBcjs.withAsyncPromise; exports.withCurrentFiber = _chunkWQ5QNU5Rcjs.withCurrentFiber; exports.withScope = _chunkTVN5I4U6cjs.withScope; exports.withScopeAsync = _chunkTVN5I4U6cjs.withScopeAsync;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { A as Async, E as Exit,
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
import { A as Async, f as Runtime, E as Exit, R as RuntimeHooks, g as RuntimeRegistry, k as Fiber } from '../effect-CGNl5Rqp.js';
|
|
2
|
+
export { u as AbortablePromiseFinish, v as AbortablePromiseLabelStats, w as AbortablePromiseOptions, x as AbortablePromiseOutcome, y as AbortablePromiseStats, C as AsyncWithPromise, G as CancelToken, H as Canceler, I as Cause, K as ContextNode, Y as FiberContext, l as FiberId, $ as FiberInfo, a3 as FiberRunState, m as FiberStatus, af as Interrupted, J as JSONValue, ai as None, aj as NoopHooks, O as Option, c as RuntimeEmitContext, b as RuntimeEvent, d as RuntimeEventRecord, i as RuntimeFiber, h as RuntimeOptions, e as RuntimeSpanLink, S as Scope, aB as ScopeId, aC as ScopeInfo, aD as Some, T as TraceContext, Z as ZIO, aI as abortablePromiseStats, aJ as acquireRelease, aK as async, aL as asyncCatchAll, aM as asyncFail, aN as asyncFlatMap, aO as asyncFold, aP as asyncInterruptible, aQ as asyncMap, aR as asyncMapError, aS as asyncSucceed, aT as asyncSync, aU as asyncTotal, aV as catchAll, aW as ctxExtend, aX as ctxToObject, aY as emptyContext, aZ as end, a$ as fail, b0 as flatMap, b1 as fork, b2 as fromPromiseAbortable, b3 as getBenchmarkBudget, b4 as getCurrentFiber, b8 as linkAbortController, ba as makeCancelToken, bc as makeRuntimeEventRecord, bd as map, be as mapAsync, bf as mapError, bg as mapTryAsync, bh as none, bi as orElseOptional, bj as resetAbortablePromiseStats, bl as runtimeEventRecordContext, bm as runtimeForCaller, bp as setBenchmarkBudget, bq as some, br as succeed, bs as sync, bt as toPromise, bu as toPromiseByCaller, bv as unit, bw as unsafeGetCurrentRuntime, bx as unsafeRunAsync, by as unsafeRunFoldWithEnv, bz as withAsyncPromise, bA as withCurrentFiber, bB as withScope, bC as withScopeAsync } from '../effect-CGNl5Rqp.js';
|
|
3
|
+
export { M as ManagedResource, R as Resource, R as ResourceDescriptor, S as Span, a as SpanContext, b as SpanEvent, c as SpanStatus, T as Tracer, d as TracerConfig, e as bracket, f as ensuring, m as makeResource, g as makeTracer, h as managed, i as managedAll, r as resource, j as resourceAll, k as resourceFromManaged, l as resourceSucceed, u as useManaged, n as useResource } from '../tracing-Dt9S_6V8.js';
|
|
4
|
+
import { S as Schedule } from '../schedule-Fque9Abz.js';
|
|
5
|
+
export { a as ScheduleDecision, b as andThenSchedule, c as contramapSchedule, e as elapsed, d as exponential, f as fibonacci, g as fixed, i as intersect, j as jitter, h as jittered, k as jitteredSchedule, m as mapSchedule, r as recurs, l as repeatWithSchedule, n as retryWithSchedule, t as takeSchedule, u as union, w as whileInput, o as windowed } from '../schedule-Fque9Abz.js';
|
|
6
|
+
export { B as BrassEnv, f as CircuitBreaker, g as CircuitBreakerConfig, h as CircuitBreakerError, i as CircuitBreakerState, C as CircuitBreakerStats, j as Counter, E as EventBus, k as EventBusOptions, l as EventHandler, G as Gauge, H as Histogram, m as HistogramBuckets, I as InMemoryTracer, e as InMemoryTracerOptions, n as InMemoryTracerStats, a as MetricExemplar, b as MetricSnapshot, o as MetricType, p as MetricValue, M as MetricsRegistry, R as RuntimeSpan, q as RuntimeSpanEvent, d as RuntimeTraceIdGenerator, r as defaultTracer, s as makeCircuitBreaker, t as makeMetrics, u as runtimeHooksToEventHandler } from '../tracer-B5tRH9H7.js';
|
|
4
7
|
|
|
5
8
|
type TimeoutError = {
|
|
6
9
|
readonly _tag: "TimeoutError";
|
|
@@ -67,74 +70,6 @@ declare function retryWithBackoff<R, E, A>(effect: Async<R, E, A>, opts?: {
|
|
|
67
70
|
shouldRetry?: (error: unknown, attempt: number) => boolean;
|
|
68
71
|
}): Async<R, E, A>;
|
|
69
72
|
|
|
70
|
-
/**
|
|
71
|
-
* Acquires a resource, uses it, and guarantees release regardless of outcome.
|
|
72
|
-
*
|
|
73
|
-
* - `acquire` runs uninterruptibly (once started, it completes)
|
|
74
|
-
* - `use` runs with the acquired resource
|
|
75
|
-
* - `release` runs after `use` completes (success, failure, or interruption)
|
|
76
|
-
*
|
|
77
|
-
* ```ts
|
|
78
|
-
* const result = bracket(
|
|
79
|
-
* openConnection(), // acquire
|
|
80
|
-
* (conn) => queryDatabase(conn), // use
|
|
81
|
-
* (conn, exit) => conn.close() // release (always runs)
|
|
82
|
-
* );
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
declare function bracket<R, E, A, B>(acquire: Async<R, E, A>, use: (resource: A) => Async<R, E, B>, release: (resource: A, exit: Exit<E, B>) => Async<R, any, void>): Async<R, E, B>;
|
|
86
|
-
/**
|
|
87
|
-
* Runs `effect` and then runs `finalizer` regardless of the outcome.
|
|
88
|
-
* The finalizer receives the exit value for inspection.
|
|
89
|
-
*
|
|
90
|
-
* ```ts
|
|
91
|
-
* const result = ensuring(
|
|
92
|
-
* doWork(),
|
|
93
|
-
* (exit) => logCompletion(exit)
|
|
94
|
-
* );
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
declare function ensuring<R, E, A>(effect: Async<R, E, A>, finalizer: (exit: Exit<E, A>) => Async<R, any, void>): Async<R, E, A>;
|
|
98
|
-
/**
|
|
99
|
-
* A Managed resource describes how to acquire and release a resource.
|
|
100
|
-
* It can be used multiple times — each `use` call acquires a fresh instance.
|
|
101
|
-
*
|
|
102
|
-
* ```ts
|
|
103
|
-
* const dbPool = managed(
|
|
104
|
-
* createPool({ max: 10 }),
|
|
105
|
-
* (pool) => pool.close()
|
|
106
|
-
* );
|
|
107
|
-
*
|
|
108
|
-
* // Use it:
|
|
109
|
-
* const result = useManaged(dbPool, (pool) => pool.query("SELECT 1"));
|
|
110
|
-
* ```
|
|
111
|
-
*/
|
|
112
|
-
type Managed<R, E, A> = {
|
|
113
|
-
readonly _tag: "Managed";
|
|
114
|
-
readonly acquire: Async<R, E, A>;
|
|
115
|
-
readonly release: (resource: A, exit: Exit<any, any>) => Async<R, any, void>;
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Creates a Managed resource descriptor.
|
|
119
|
-
*/
|
|
120
|
-
declare function managed<R, E, A>(acquire: Async<R, E, A>, release: (resource: A, exit?: Exit<any, any>) => Async<R, any, void>): Managed<R, E, A>;
|
|
121
|
-
/**
|
|
122
|
-
* Uses a Managed resource: acquires, runs the body, and releases.
|
|
123
|
-
*/
|
|
124
|
-
declare function useManaged<R, E, A, B>(m: Managed<R, E, A>, body: (resource: A) => Async<R, E, B>): Async<R, E, B>;
|
|
125
|
-
/**
|
|
126
|
-
* Combines multiple Managed resources. All are acquired in order,
|
|
127
|
-
* and released in reverse order (LIFO).
|
|
128
|
-
*
|
|
129
|
-
* ```ts
|
|
130
|
-
* const resources = managedAll([dbPool, cacheConn, fileHandle]);
|
|
131
|
-
* const result = useManaged(resources, ([db, cache, file]) => ...);
|
|
132
|
-
* ```
|
|
133
|
-
*/
|
|
134
|
-
declare function managedAll<R, E, Resources extends readonly any[]>(manageds: {
|
|
135
|
-
[K in keyof Resources]: Managed<R, E, Resources[K]>;
|
|
136
|
-
}): Managed<R, E, Resources>;
|
|
137
|
-
|
|
138
73
|
type Semaphore = {
|
|
139
74
|
/** Current number of available permits. */
|
|
140
75
|
readonly available: () => number;
|
|
@@ -209,53 +144,6 @@ declare function makeRef<A>(initial: A): Ref<A>;
|
|
|
209
144
|
*/
|
|
210
145
|
declare function derivedRef<A, B>(parent: Ref<A>, get: (a: A) => B, set: (a: A, b: B) => A): Ref<B>;
|
|
211
146
|
|
|
212
|
-
type ScheduleDecision = {
|
|
213
|
-
readonly continue: boolean;
|
|
214
|
-
readonly delayMs: number;
|
|
215
|
-
};
|
|
216
|
-
/**
|
|
217
|
-
* A Schedule<I, O> takes an input I (typically the error or output of an effect)
|
|
218
|
-
* and decides whether to continue and with what delay.
|
|
219
|
-
*/
|
|
220
|
-
type Schedule<I, O> = {
|
|
221
|
-
readonly _tag: "Schedule";
|
|
222
|
-
/** Initial state */
|
|
223
|
-
readonly initial: () => any;
|
|
224
|
-
/** Given current state and input, produce a decision and next state */
|
|
225
|
-
readonly step: (state: any, input: I) => [ScheduleDecision, any, O];
|
|
226
|
-
};
|
|
227
|
-
/** Retry/repeat up to N times with no delay. */
|
|
228
|
-
declare function recurs(n: number): Schedule<unknown, number>;
|
|
229
|
-
/** Fixed delay between each retry/repeat. */
|
|
230
|
-
declare function fixed(delayMs: number): Schedule<unknown, number>;
|
|
231
|
-
/** Exponential backoff: delay doubles each time, capped at maxDelayMs. */
|
|
232
|
-
declare function exponential(baseMs: number, maxMs?: number): Schedule<unknown, number>;
|
|
233
|
-
/** Exponential backoff with full jitter (random in [0, delay]). */
|
|
234
|
-
declare function jittered(baseMs: number, maxMs?: number): Schedule<unknown, number>;
|
|
235
|
-
/** Stop after a total elapsed time. */
|
|
236
|
-
declare function elapsed(maxMs: number): Schedule<unknown, number>;
|
|
237
|
-
/** Only continue while a predicate holds on the input. */
|
|
238
|
-
declare function whileInput<I>(pred: (input: I) => boolean): Schedule<I, I>;
|
|
239
|
-
/** Limit a schedule to N repetitions. */
|
|
240
|
-
declare function take<I, O>(schedule: Schedule<I, O>, n: number): Schedule<I, O>;
|
|
241
|
-
/** Compose two schedules: use the first, then switch to the second. */
|
|
242
|
-
declare function andThen<I, O1, O2>(first: Schedule<I, O1>, second: Schedule<I, O2>): Schedule<I, O1 | O2>;
|
|
243
|
-
/** Run both schedules and continue while BOTH say continue. Use max delay. */
|
|
244
|
-
declare function intersect<I, O1, O2>(left: Schedule<I, O1>, right: Schedule<I, O2>): Schedule<I, [O1, O2]>;
|
|
245
|
-
/** Run both schedules and continue while EITHER says continue. Use min delay. */
|
|
246
|
-
declare function union<I, O1, O2>(left: Schedule<I, O1>, right: Schedule<I, O2>): Schedule<I, [O1, O2]>;
|
|
247
|
-
/**
|
|
248
|
-
* Retry an effect according to a schedule.
|
|
249
|
-
* The schedule receives the error as input on each failure.
|
|
250
|
-
*/
|
|
251
|
-
declare function retryWithSchedule<R, E, A, O>(effect: Async<R, E, A>, schedule: Schedule<E, O>): Async<R, E, A>;
|
|
252
|
-
/**
|
|
253
|
-
* Repeat an effect according to a schedule.
|
|
254
|
-
* The schedule receives the success value as input on each iteration.
|
|
255
|
-
* Returns the last successful value.
|
|
256
|
-
*/
|
|
257
|
-
declare function repeatWithSchedule<R, E, A, O>(effect: Async<R, E, A>, schedule: Schedule<A, O>): Async<R, E, A>;
|
|
258
|
-
|
|
259
147
|
type ShutdownConfig = {
|
|
260
148
|
/** Max time to wait for in-flight work to complete. Default: 30000ms */
|
|
261
149
|
readonly timeoutMs?: number;
|
|
@@ -517,85 +405,10 @@ type WorkerPoolStats = {
|
|
|
517
405
|
*/
|
|
518
406
|
declare function makeWorkerPool(config?: WorkerPoolConfig): WorkerPool;
|
|
519
407
|
|
|
520
|
-
type
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
readonly value: number;
|
|
525
|
-
readonly labels: Record<string, string>;
|
|
526
|
-
readonly timestamp: number;
|
|
527
|
-
};
|
|
528
|
-
type HistogramBuckets = {
|
|
529
|
-
readonly boundaries: readonly number[];
|
|
530
|
-
counts: number[];
|
|
531
|
-
sum: number;
|
|
532
|
-
count: number;
|
|
533
|
-
min: number;
|
|
534
|
-
max: number;
|
|
535
|
-
};
|
|
536
|
-
type MetricsRegistry = {
|
|
537
|
-
/** Create or get a counter. */
|
|
538
|
-
readonly counter: (name: string, labels?: Record<string, string>) => Counter;
|
|
539
|
-
/** Create or get a gauge. */
|
|
540
|
-
readonly gauge: (name: string, labels?: Record<string, string>) => Gauge;
|
|
541
|
-
/** Create or get a histogram. */
|
|
542
|
-
readonly histogram: (name: string, boundaries?: number[], labels?: Record<string, string>) => Histogram;
|
|
543
|
-
/** Get all current metric values. */
|
|
544
|
-
readonly snapshot: () => MetricSnapshot;
|
|
545
|
-
/** Reset all metrics. */
|
|
546
|
-
readonly reset: () => void;
|
|
547
|
-
};
|
|
548
|
-
type Counter = {
|
|
549
|
-
readonly increment: (n?: number) => void;
|
|
550
|
-
readonly value: () => number;
|
|
551
|
-
};
|
|
552
|
-
type Gauge = {
|
|
553
|
-
readonly set: (value: number) => void;
|
|
554
|
-
readonly increment: (n?: number) => void;
|
|
555
|
-
readonly decrement: (n?: number) => void;
|
|
556
|
-
readonly value: () => number;
|
|
557
|
-
};
|
|
558
|
-
type Histogram = {
|
|
559
|
-
readonly observe: (value: number) => void;
|
|
560
|
-
readonly buckets: () => HistogramBuckets;
|
|
561
|
-
readonly percentile: (p: number) => number;
|
|
562
|
-
};
|
|
563
|
-
type MetricSnapshot = {
|
|
564
|
-
readonly counters: Array<{
|
|
565
|
-
name: string;
|
|
566
|
-
labels: Record<string, string>;
|
|
567
|
-
value: number;
|
|
568
|
-
}>;
|
|
569
|
-
readonly gauges: Array<{
|
|
570
|
-
name: string;
|
|
571
|
-
labels: Record<string, string>;
|
|
572
|
-
value: number;
|
|
573
|
-
}>;
|
|
574
|
-
readonly histograms: Array<{
|
|
575
|
-
name: string;
|
|
576
|
-
labels: Record<string, string>;
|
|
577
|
-
buckets: HistogramBuckets;
|
|
578
|
-
}>;
|
|
579
|
-
};
|
|
580
|
-
/**
|
|
581
|
-
* Creates a metrics registry.
|
|
582
|
-
*
|
|
583
|
-
* ```ts
|
|
584
|
-
* const metrics = makeMetrics();
|
|
585
|
-
*
|
|
586
|
-
* const requestCount = metrics.counter("http_requests_total", { method: "GET" });
|
|
587
|
-
* requestCount.increment();
|
|
588
|
-
*
|
|
589
|
-
* const latency = metrics.histogram("http_request_duration_ms");
|
|
590
|
-
* latency.observe(42.5);
|
|
591
|
-
*
|
|
592
|
-
* const activeConns = metrics.gauge("active_connections");
|
|
593
|
-
* activeConns.set(10);
|
|
594
|
-
*
|
|
595
|
-
* console.log(metrics.snapshot());
|
|
596
|
-
* ```
|
|
597
|
-
*/
|
|
598
|
-
declare function makeMetrics(): MetricsRegistry;
|
|
408
|
+
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
409
|
+
declare function consoleJsonLogger(): RuntimeHooks;
|
|
410
|
+
|
|
411
|
+
declare function dumpAllFibers(reg: RuntimeRegistry): string;
|
|
599
412
|
|
|
600
413
|
/**
|
|
601
414
|
* Base type for tagged errors. All errors should extend this pattern:
|
|
@@ -670,4 +483,85 @@ declare function tagError<R, E, A, Tag extends string, Fields extends Record<str
|
|
|
670
483
|
*/
|
|
671
484
|
declare function orElse<R, E, A, R2, E2, B>(effect: Async<R, E, A>, fallback: (error: E) => Async<R2, E2, B>): Async<R & R2, E2, A | B>;
|
|
672
485
|
|
|
673
|
-
|
|
486
|
+
type SupervisorStrategy = "one-for-one" | "all-for-one";
|
|
487
|
+
type SupervisorEscalation = "ignore" | "shutdown";
|
|
488
|
+
type SupervisorRestartMode = "never" | "always" | "on-failure";
|
|
489
|
+
type SupervisedChildStatus = "running" | "restarting" | "succeeded" | "failed" | "interrupted";
|
|
490
|
+
type SupervisorRestartContext = {
|
|
491
|
+
readonly supervisorId: number;
|
|
492
|
+
readonly childId: number;
|
|
493
|
+
readonly name?: string;
|
|
494
|
+
readonly restartCount: number;
|
|
495
|
+
readonly exit: Exit<any, any>;
|
|
496
|
+
};
|
|
497
|
+
type SupervisorRestartPolicy = SupervisorRestartMode | {
|
|
498
|
+
readonly mode?: SupervisorRestartMode;
|
|
499
|
+
readonly maxRestarts?: number;
|
|
500
|
+
readonly withinMs?: number;
|
|
501
|
+
readonly delayMs?: number | ((context: SupervisorRestartContext) => number);
|
|
502
|
+
readonly schedule?: Schedule<SupervisorRestartContext, unknown>;
|
|
503
|
+
};
|
|
504
|
+
type SupervisorEvent = {
|
|
505
|
+
readonly type: "child-start" | "child-end" | "child-restart" | "child-escalate" | "shutdown";
|
|
506
|
+
readonly supervisorId: number;
|
|
507
|
+
readonly childId?: number;
|
|
508
|
+
readonly name?: string;
|
|
509
|
+
readonly status?: SupervisedChildStatus;
|
|
510
|
+
readonly restartCount?: number;
|
|
511
|
+
readonly delayMs?: number;
|
|
512
|
+
readonly exit?: Exit<any, any>;
|
|
513
|
+
readonly reason?: string;
|
|
514
|
+
};
|
|
515
|
+
type SupervisorConfig = {
|
|
516
|
+
readonly strategy?: SupervisorStrategy;
|
|
517
|
+
readonly restart?: SupervisorRestartPolicy;
|
|
518
|
+
readonly escalation?: SupervisorEscalation;
|
|
519
|
+
readonly clock?: () => number;
|
|
520
|
+
readonly onEvent?: (event: SupervisorEvent) => void;
|
|
521
|
+
};
|
|
522
|
+
type SupervisedChildSpec<R, E, A> = {
|
|
523
|
+
readonly name?: string;
|
|
524
|
+
readonly effect: Async<R, E, A> | (() => Async<R, E, A>);
|
|
525
|
+
readonly restart?: SupervisorRestartPolicy;
|
|
526
|
+
};
|
|
527
|
+
type SupervisedFiber<E, A> = {
|
|
528
|
+
readonly id: number;
|
|
529
|
+
readonly name?: string;
|
|
530
|
+
readonly current: () => Fiber<E, A> | undefined;
|
|
531
|
+
readonly status: () => SupervisedChildStatus;
|
|
532
|
+
readonly restartCount: () => number;
|
|
533
|
+
readonly interrupt: () => void;
|
|
534
|
+
readonly join: (cb: (exit: Exit<E, A>) => void) => void;
|
|
535
|
+
};
|
|
536
|
+
declare class Supervisor<R> {
|
|
537
|
+
private readonly runtime;
|
|
538
|
+
readonly id: number;
|
|
539
|
+
private readonly records;
|
|
540
|
+
private readonly strategy;
|
|
541
|
+
private readonly restart;
|
|
542
|
+
private readonly escalation;
|
|
543
|
+
private readonly clock;
|
|
544
|
+
private readonly onEvent?;
|
|
545
|
+
private closed;
|
|
546
|
+
constructor(runtime: Runtime<R>, config?: SupervisorConfig);
|
|
547
|
+
start<E, A>(spec: SupervisedChildSpec<R, E, A>): SupervisedFiber<E, A>;
|
|
548
|
+
startAll<const Specs extends readonly SupervisedChildSpec<R, any, any>[]>(specs: Specs): {
|
|
549
|
+
[K in keyof Specs]: Specs[K] extends SupervisedChildSpec<R, infer E, infer A> ? SupervisedFiber<E, A> : never;
|
|
550
|
+
};
|
|
551
|
+
shutdown(): Async<R, never, void>;
|
|
552
|
+
private handle;
|
|
553
|
+
private launch;
|
|
554
|
+
private onChildExit;
|
|
555
|
+
private restartAll;
|
|
556
|
+
private scheduleRestart;
|
|
557
|
+
private nextDelay;
|
|
558
|
+
private escalate;
|
|
559
|
+
private finish;
|
|
560
|
+
private restartContext;
|
|
561
|
+
private emit;
|
|
562
|
+
}
|
|
563
|
+
declare function makeSupervisor<R>(runtime: Runtime<R>, config?: SupervisorConfig): Supervisor<R>;
|
|
564
|
+
declare function supervise<R, E, A>(runtime: Runtime<R>, spec: SupervisedChildSpec<R, E, A>, config?: SupervisorConfig): SupervisedFiber<E, A>;
|
|
565
|
+
declare function joinSupervised<E, A>(fiber: SupervisedFiber<E, A>): Async<unknown, E, A>;
|
|
566
|
+
|
|
567
|
+
export { Async, Exit, Fiber, type Layer, type LogLevel, type Ref, type RetryPolicy, type RetryState, Runtime, RuntimeHooks, RuntimeRegistry, Schedule, type Semaphore, type SemaphoreStats, type ShutdownConfig, type ShutdownStats, type SupervisedChildSpec, type SupervisedChildStatus, type SupervisedFiber, Supervisor, type SupervisorConfig, type SupervisorEscalation, type SupervisorEvent, type SupervisorRestartContext, type SupervisorRestartMode, type SupervisorRestartPolicy, type SupervisorStrategy, type TaggedError, type TestRuntimeOptions, type TimeoutError, type WorkerPool, type WorkerPoolConfig, type WorkerPoolError, type WorkerPoolStats, assertCompletesWithin, assertFails, assertFailsWith, assertSucceeds, catchTag, catchTags, compose as composeLayer, consoleJsonLogger, delayedEffect, derivedRef, dumpAllFibers, flakyEffect, gracefulShutdown, joinSupervised, layer, layerFail, layerFrom, layerSucceed, makeRef, makeSemaphore, makeSupervisor, makeTestRuntime, makeWorkerPool, mapError as mapErrorTyped, mapLayer, merge as mergeLayer, neverEffect, orElse, provideLayer, registerShutdownHooks, retry, retryN, retryWithBackoff, sleep, supervise, tagError, timeout };
|