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