@alchemy.run/test 0.0.0 → 2.0.0-beta.85

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.
Files changed (119) hide show
  1. package/LICENSE +201 -0
  2. package/bin/alchemy-test.ts +2 -0
  3. package/lib/Alchemy.d.ts +78 -0
  4. package/lib/Alchemy.d.ts.map +1 -0
  5. package/lib/Alchemy.js +194 -0
  6. package/lib/Alchemy.js.map +1 -0
  7. package/lib/Api.d.ts +134 -0
  8. package/lib/Api.d.ts.map +1 -0
  9. package/lib/Api.js +245 -0
  10. package/lib/Api.js.map +1 -0
  11. package/lib/Bun.d.ts +67 -0
  12. package/lib/Bun.d.ts.map +1 -0
  13. package/lib/Bun.js +143 -0
  14. package/lib/Bun.js.map +1 -0
  15. package/lib/Capture.d.ts +10 -0
  16. package/lib/Capture.d.ts.map +1 -0
  17. package/lib/Capture.js +68 -0
  18. package/lib/Capture.js.map +1 -0
  19. package/lib/Core.d.ts +287 -0
  20. package/lib/Core.d.ts.map +1 -0
  21. package/lib/Core.js +429 -0
  22. package/lib/Core.js.map +1 -0
  23. package/lib/DevCli.d.ts +47 -0
  24. package/lib/DevCli.d.ts.map +1 -0
  25. package/lib/DevCli.js +181 -0
  26. package/lib/DevCli.js.map +1 -0
  27. package/lib/Expect.d.ts +84 -0
  28. package/lib/Expect.d.ts.map +1 -0
  29. package/lib/Expect.js +518 -0
  30. package/lib/Expect.js.map +1 -0
  31. package/lib/FileLog.d.ts +27 -0
  32. package/lib/FileLog.d.ts.map +1 -0
  33. package/lib/FileLog.js +136 -0
  34. package/lib/FileLog.js.map +1 -0
  35. package/lib/Http.d.ts +109 -0
  36. package/lib/Http.d.ts.map +1 -0
  37. package/lib/Http.js +123 -0
  38. package/lib/Http.js.map +1 -0
  39. package/lib/Model.d.ts +98 -0
  40. package/lib/Model.d.ts.map +1 -0
  41. package/lib/Model.js +59 -0
  42. package/lib/Model.js.map +1 -0
  43. package/lib/PlainReporter.d.ts +19 -0
  44. package/lib/PlainReporter.d.ts.map +1 -0
  45. package/lib/PlainReporter.js +348 -0
  46. package/lib/PlainReporter.js.map +1 -0
  47. package/lib/Plan.d.ts +19 -0
  48. package/lib/Plan.d.ts.map +1 -0
  49. package/lib/Plan.js +32 -0
  50. package/lib/Plan.js.map +1 -0
  51. package/lib/Registry.d.ts +34 -0
  52. package/lib/Registry.d.ts.map +1 -0
  53. package/lib/Registry.js +80 -0
  54. package/lib/Registry.js.map +1 -0
  55. package/lib/Reporter.d.ts +160 -0
  56. package/lib/Reporter.d.ts.map +1 -0
  57. package/lib/Reporter.js +9 -0
  58. package/lib/Reporter.js.map +1 -0
  59. package/lib/Runner.d.ts +51 -0
  60. package/lib/Runner.d.ts.map +1 -0
  61. package/lib/Runner.js +1052 -0
  62. package/lib/Runner.js.map +1 -0
  63. package/lib/StrayOutput.d.ts +8 -0
  64. package/lib/StrayOutput.d.ts.map +1 -0
  65. package/lib/StrayOutput.js +259 -0
  66. package/lib/StrayOutput.js.map +1 -0
  67. package/lib/Tags.d.ts +17 -0
  68. package/lib/Tags.d.ts.map +1 -0
  69. package/lib/Tags.js +84 -0
  70. package/lib/Tags.js.map +1 -0
  71. package/lib/TestState.d.ts +12 -0
  72. package/lib/TestState.d.ts.map +1 -0
  73. package/lib/TestState.js +15 -0
  74. package/lib/TestState.js.map +1 -0
  75. package/lib/Tui.d.ts +4 -0
  76. package/lib/Tui.d.ts.map +1 -0
  77. package/lib/Tui.js +1137 -0
  78. package/lib/Tui.js.map +1 -0
  79. package/lib/Vitest.d.ts +58 -0
  80. package/lib/Vitest.d.ts.map +1 -0
  81. package/lib/Vitest.js +132 -0
  82. package/lib/Vitest.js.map +1 -0
  83. package/lib/WorktreeStage.d.ts +17 -0
  84. package/lib/WorktreeStage.d.ts.map +1 -0
  85. package/lib/WorktreeStage.js +48 -0
  86. package/lib/WorktreeStage.js.map +1 -0
  87. package/lib/cli.d.ts +2 -0
  88. package/lib/cli.d.ts.map +1 -0
  89. package/lib/cli.js +222 -0
  90. package/lib/cli.js.map +1 -0
  91. package/lib/index.d.ts +14 -0
  92. package/lib/index.d.ts.map +1 -0
  93. package/lib/index.js +12 -0
  94. package/lib/index.js.map +1 -0
  95. package/package.json +73 -3
  96. package/src/Alchemy.ts +335 -0
  97. package/src/Api.ts +521 -0
  98. package/src/Bun.ts +256 -0
  99. package/src/Capture.ts +72 -0
  100. package/src/Core.ts +872 -0
  101. package/src/DevCli.ts +229 -0
  102. package/src/Expect.ts +763 -0
  103. package/src/FileLog.ts +158 -0
  104. package/src/Http.ts +201 -0
  105. package/src/Model.ts +160 -0
  106. package/src/PlainReporter.ts +426 -0
  107. package/src/Plan.ts +45 -0
  108. package/src/Registry.ts +101 -0
  109. package/src/Reporter.ts +171 -0
  110. package/src/Runner.ts +1341 -0
  111. package/src/StrayOutput.ts +283 -0
  112. package/src/Tags.ts +100 -0
  113. package/src/TestState.ts +35 -0
  114. package/src/Tui.ts +1272 -0
  115. package/src/Vitest.ts +239 -0
  116. package/src/WorktreeStage.ts +45 -0
  117. package/src/cli.ts +330 -0
  118. package/src/index.ts +57 -0
  119. package/README.md +0 -9
package/lib/Core.d.ts ADDED
@@ -0,0 +1,287 @@
1
+ import { AlchemyContext } from "alchemy/AlchemyContext";
2
+ import { ArtifactStore } from "alchemy/Artifacts";
3
+ import { AuthProviders } from "alchemy/Auth/AuthProvider";
4
+ import type { Input } from "alchemy/Input";
5
+ import * as Interaction from "alchemy/Interaction";
6
+ import * as RpcProviderProxy from "alchemy/Local/RpcProviderProxy";
7
+ import * as RpcSpawner from "alchemy/Local/RpcSpawner";
8
+ import * as Plan from "alchemy/Plan";
9
+ import type { ResourceSelection, SelectionOutput } from "alchemy/ResourceSelection";
10
+ import { type CompiledStack, Stack, type StackDefinition, type StackEffect, type StackServices } from "alchemy/Stack";
11
+ import { Stage } from "alchemy/Stage";
12
+ import * as State from "alchemy/State";
13
+ /** @effect-diagnostics anyUnknownInErrorContext:off */
14
+ import * as Config from "effect/Config";
15
+ import * as Effect from "effect/Effect";
16
+ import * as HttpClient from "effect/http/HttpClient";
17
+ import * as Layer from "effect/Layer";
18
+ import * as Option from "effect/Option";
19
+ import * as Scope from "effect/Scope";
20
+ /**
21
+ * Configuration shared by every test in a file. Pass to `Test.make(...)`.
22
+ */
23
+ export interface MakeOptions<ROut = any> {
24
+ /** Provider layer for the stack — e.g. `AWS.providers()`, `Cloudflare.providers()`. */
25
+ providers: Layer.Layer<ROut, never, StackServices>;
26
+ /** State store for top-level `deploy(Stack)` / `destroy(Stack)`; defaults to {@link State.localState}. */
27
+ state?: Layer.Layer<State.State, never, StackServices>;
28
+ /** Override the current profile; otherwise resolved from env or the built-in `default`. */
29
+ profile?: string;
30
+ /**
31
+ * Default stage for deploy/destroy. Defaults to `test_$USER` (or
32
+ * `test_$USERNAME` on Windows, `test_unknown` if neither is set) so two
33
+ * people running the same suite against one account don't collide.
34
+ * Does **not** read `$ALCHEMY_STAGE` — that is the CLI deploy/dev stage.
35
+ */
36
+ stage?: string;
37
+ /**
38
+ * Engine-level adoption policy for this test run. When `true`, resources
39
+ * without prior state will be adopted from the cloud via `provider.read`
40
+ * (matching the CLI's `--adopt` flag). Defaults to `false`.
41
+ */
42
+ adopt?: boolean;
43
+ /**
44
+ * Run providers in local-dev mode (matching the CLI's `alchemy dev` flag).
45
+ * When `true`, resources like Cloudflare Workers run locally via workerd
46
+ * instead of being deployed to the cloud. When omitted, falls back to the
47
+ * `ALCHEMY_DEV` environment variable (`"1"` / `"true"` enable it).
48
+ *
49
+ * {@link ALCHEMY_TEST_DEV} (`ALCHEMY_TEST_DEV=1`) overrides this — use it
50
+ * to force an entire existing live suite through local providers without
51
+ * editing each `Test.make({ dev: true })`.
52
+ */
53
+ dev?: boolean;
54
+ /**
55
+ * Run local providers behind the RPC sidecar proxy, matching the process
56
+ * topology of the real `alchemy dev` command: an {@link RpcProviderProxy}
57
+ * is installed, so `RpcProvider.providerServicesEffect` layers (e.g.
58
+ * Cloudflare's `localRuntimeServices()`) are EMPTY in the test process and
59
+ * RPC-backed providers run their lifecycle in a spawned sidecar process.
60
+ *
61
+ * Defaults to the resolved `dev` flag — dev tests run the real `alchemy
62
+ * dev` topology unless they opt out. In-process dev (`sidecar: false`)
63
+ * masks missing main-process lifecycle dependencies (the class of bug
64
+ * behind #1007, where D1's local migrations only failed under `alchemy
65
+ * dev`); it remains available because it IS still a real production path —
66
+ * a plain `alchemy deploy` deleting a `providerMode: "local"` state row
67
+ * runs the local provider in-process — and because in-process runs are
68
+ * easier to debug.
69
+ *
70
+ * Fully lazy: only the proxy facade is installed up front. The spawner
71
+ * HTTP server starts — and a sidecar child process is forked — on the
72
+ * first provider session request (a deploy/destroy building an RPC-backed
73
+ * local provider); a dev file that never does starts no processes at all.
74
+ * Once started, the sidecar lives for the whole test file (its own scope,
75
+ * closed by the adapter's final cleanup hook), so `beforeAll(deploy(Stack))`
76
+ * + per-test requests work the same way they do under a real `alchemy dev`
77
+ * session.
78
+ *
79
+ * Pass an object to run the sidecar with options: `omitEnv` lists prefixes
80
+ * of environment variables the sidecar must not inherit (e.g.
81
+ * `["CLOUDFLARE_"]` to exercise credential-free dev while the shell
82
+ * exports credentials).
83
+ */
84
+ sidecar?: boolean | SidecarOptions;
85
+ }
86
+ /** Options for the dev sidecar process — see {@link MakeOptions.sidecar}. */
87
+ export interface SidecarOptions {
88
+ /** Prefixes of environment variables withheld from the sidecar. */
89
+ readonly omitEnv?: ReadonlyArray<string>;
90
+ }
91
+ /**
92
+ * The RPC sidecar topology used by the real `alchemy dev` command, in one
93
+ * process-local layer: an {@link RpcSpawner} HTTP server that forks sidecar
94
+ * processes on demand, and an {@link RpcProviderProxy} pointed at it.
95
+ */
96
+ export declare const sidecarProxy: (options: {
97
+ profile?: string;
98
+ omitEnv?: ReadonlyArray<string>;
99
+ }) => Layer.Layer<RpcProviderProxy.RpcProviderProxy | RpcSpawner.RpcSpawner, import("effect/http/HttpServerError").ServeError, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | HttpClient.HttpClient>;
100
+ /**
101
+ * Force every `Test.make` into (or out of) local-dev mode, regardless of
102
+ * the file's `dev` option. Unset leaves the option / `ALCHEMY_DEV` fallback
103
+ * in place. Accepts the usual truthy/falsey strings (`true`/`1`/`yes`/`on`,
104
+ * `false`/`0`/`no`/`off`).
105
+ */
106
+ export declare const ALCHEMY_TEST_DEV: Config.Config<Option.Option<boolean>>;
107
+ /** The `ALCHEMY_TEST_DEV` override, if the env var is set. */
108
+ export declare const alchemyTestDevOverride: () => Option.Option<boolean>;
109
+ /** Resolve the effective `dev` flag: `ALCHEMY_TEST_DEV`, then options, then `ALCHEMY_DEV`. */
110
+ export declare const resolveDev: (options: {
111
+ dev?: boolean;
112
+ }) => boolean;
113
+ /** Resolve the effective `sidecar` flag: defaults to the resolved `dev` flag. */
114
+ export declare const resolveSidecar: (options: MakeOptions) => boolean;
115
+ /**
116
+ * Default test stage: `ALCHEMY_TEST_STAGE`, then `test_$USER` (or
117
+ * `test_$USERNAME` / `test_unknown`). The runner sets ALCHEMY_TEST_STAGE to
118
+ * `test_$USER_<worktree>` in a linked git worktree, so concurrent worktrees
119
+ * sharing a cloud account stay isolated.
120
+ * Matches the CLI's `live_$USER` / `dev_$USER` per-developer isolation.
121
+ */
122
+ export declare const defaultStage: () => string;
123
+ /** File-level stage: a string override, otherwise {@link defaultStage}. */
124
+ export declare const resolveStage: (options: {
125
+ stage?: string;
126
+ }) => string;
127
+ /**
128
+ * The sidecar runtime handed to each adapter's `make(...)`.
129
+ *
130
+ * `provide` installs a lazy {@link RpcProviderProxy} facade into an effect.
131
+ * Installing the facade is free: the spawner HTTP server only starts (and,
132
+ * downstream of it, a sidecar child process is only forked) when a provider
133
+ * actually requests a session — i.e. when a deploy/destroy builds an
134
+ * RPC-backed local provider. A dev file that never does starts nothing.
135
+ *
136
+ * The spawner (and the sidecar children it forks) is a PROCESS-WIDE
137
+ * SINGLETON shared by every test file, refcounted per handle: all files run
138
+ * in one bun process, and a per-file sidecar means a per-file bun child that
139
+ * imports the entire alchemy + distilled module graph — dozens of concurrent
140
+ * files at hundreds of MB each OOMs the machine. Stack isolation is
141
+ * preserved because each RPC session carries its own stack environment (see
142
+ * `SESSION_ENV_PARAM` in Local/RpcServerEnvironment.ts) and the child builds
143
+ * a provider context per stack. The singleton's scope closes when the LAST
144
+ * handle closes; `Test.make` runs at collection time (before any test), so
145
+ * the refcount cannot dip to zero while later files still need it. Adapters
146
+ * run `close` from the same final cleanup hook that closes the shared scope.
147
+ */
148
+ export interface SidecarHandle {
149
+ readonly provide: <A, E, R>(eff: Effect.Effect<A, E, R>) => Effect.Effect<A, any, any>;
150
+ readonly close: Effect.Effect<void>;
151
+ }
152
+ /** Payload-free counts; observing them never starts the singleton. */
153
+ export declare const sidecarDiagnostics: Effect.Effect<{
154
+ sessions: number;
155
+ testSessions: number;
156
+ owners: number;
157
+ connections: number;
158
+ singletons: number;
159
+ reservations: number;
160
+ started: number;
161
+ }, never, never>;
162
+ export declare const makeSidecarHandle: <ROut = any>(options: MakeOptions<ROut>) => SidecarHandle | undefined;
163
+ export type TestEffect<A, Req = never> = StackEffect<A, any, Req>;
164
+ /**
165
+ * Start capturing what the resource `fqn` logs — its processes' output (a dev
166
+ * Worker's console, a Vite dev server) and alchemy's lines about it — whether
167
+ * its provider runs in the dev sidecar or in-process. Start it before the
168
+ * deploy; the returned effect reads every line since, without ANSI styling.
169
+ * The capture ends with the enclosing scope.
170
+ */
171
+ export declare const captureResourceLog: (fqn: string) => Effect.Effect<Effect.Effect<string>, never, Scope.Scope>;
172
+ /**
173
+ * Build the per-test runtime and return a self-contained Effect.
174
+ *
175
+ * Mirrors {@link "../bin/alchemy.js"} composition: ConfigProvider via
176
+ * `loadConfigProvider` + `withProfileOverride`, an empty `AuthProviders`
177
+ * registry that the user's `providers` layer populates, the platform layers,
178
+ * and the configured state store. Adapters wrap this into runner-specific
179
+ * thunks (`bun.test` -> `runPromise`, `it.live` -> as-is).
180
+ *
181
+ * When `scope` is provided, scoped resources (like the Cloudflare dev
182
+ * sidecar) survive past this effect and are tied to the lifetime of the
183
+ * provided scope instead. The runner is responsible for closing it.
184
+ *
185
+ * When `scope` is omitted, the effect runs with `Effect.scoped` and any
186
+ * scoped resources are torn down as soon as it resolves.
187
+ */
188
+ export declare const toEffect: <A, ROut = any>(effect: TestEffect<A>, options: MakeOptions<ROut>, scope?: Scope.Scope, sidecar?: SidecarHandle) => Effect.Effect<A, any, never>;
189
+ /** Promise wrapper around {@link toEffect} for `bun.test`-style runners. */
190
+ export declare const run: <A, ROut = any>(effect: TestEffect<A>, options: MakeOptions<ROut>, scope?: Scope.Scope, sidecar?: SidecarHandle) => Promise<A>;
191
+ /**
192
+ * Wrap an effect so it runs with `options.providers` + a placeholder Stack +
193
+ * Stage in scope. Used by `test.provider` so user code can call provider SDK
194
+ * APIs (e.g. `DynamoDB.describeTable`) directly inside the test body.
195
+ */
196
+ export declare const withProviders: <A, E, R, ROut>(effect: Effect.Effect<A, E, R>, options: MakeOptions<ROut>, stackName: string) => Effect.Effect<A, E, Exclude<R, ROut | Stack | Stage>>;
197
+ /**
198
+ * Curried `deploy` for the test factory: bakes in the configured stage and
199
+ * adds the telemetry layer the CLI uses, so `beforeAll(deploy(Stack))` works
200
+ * the same way as `alchemy deploy`.
201
+ *
202
+ * `scope`, when supplied, is forwarded down so the dev sidecar (and other
203
+ * scoped resources) lives until the caller closes it instead of dying as
204
+ * soon as `deploy` resolves. The test harness uses this to keep workerd
205
+ * alive across `beforeAll` → tests → `afterAll`.
206
+ */
207
+ export interface DeployCallOptions extends Plan.MakePlanOptions {
208
+ stage?: string;
209
+ scope?: Scope.Scope;
210
+ }
211
+ export type DeployResult<A> = Effect.Effect<Input.Resolve<A>, Effect.Error<ReturnType<typeof deployStack<A>>>, Effect.Services<ReturnType<typeof deployStack<A>>>>;
212
+ export interface FilteredDeployCallOptions extends Omit<DeployCallOptions, keyof ResourceSelection>, ResourceSelection {
213
+ }
214
+ type FullDeployCall = [options?: DeployCallOptions];
215
+ /**
216
+ * Filtered deploys return void; the whole declaration still evaluates.
217
+ * With an explicit output type, filtering also requires the Call tuple type.
218
+ */
219
+ export interface Deploy {
220
+ <A, Call extends [options?: FilteredDeployCallOptions] = FullDeployCall>(stack: TestEffect<CompiledStack<A>, Stage | AlchemyContext>, ...call: Call): DeployResult<SelectionOutput<A, Call[0]>>;
221
+ }
222
+ export declare function deploy<A, Call extends [options?: FilteredDeployCallOptions] = FullDeployCall>(options: MakeOptions, stack: TestEffect<CompiledStack<A>, Stage | AlchemyContext>, ...call: Call): DeployResult<SelectionOutput<A, Call[0]>>;
223
+ declare const deployStack: <A>(options: MakeOptions, stack: TestEffect<CompiledStack<A>, Stage | AlchemyContext>, callOptions?: FilteredDeployCallOptions) => Effect.Effect<Input.Resolve<A> | undefined, import("alchemy/Auth/AuthProvider").AuthError | Config.ConfigError | import("alchemy/Auth/Demand").CredentialsRequired | import("alchemy").DestroyError | import("alchemy/Output").InvalidReferenceError | import("alchemy/Output").MissingSourceError | import("alchemy/Auth/AuthProvider").NeedsReauth | import("effect/PlatformError").PlatformError | State.StateStoreError, ArtifactStore | AuthProviders | Interaction.Interaction | State.State>;
224
+ /** Bind test-file options and the shared runtime scope without erasing output types. */
225
+ export declare const makeDeploy: (options: MakeOptions, scope: Scope.Scope) => Deploy;
226
+ export declare const destroy: <ROut>(options: MakeOptions, stack: StackDefinition<ROut>, callOptions?: {
227
+ stage?: string;
228
+ scope?: Scope.Scope;
229
+ include?: never;
230
+ exclude?: never;
231
+ }) => Effect.Effect<undefined, import("alchemy/Auth/AuthProvider").AuthError | Config.ConfigError | import("alchemy/Auth/Demand").CredentialsRequired | import("alchemy").DestroyError | import("alchemy/Output").InvalidReferenceError | import("alchemy/Output").MissingSourceError | import("alchemy/Auth/AuthProvider").NeedsReauth | import("effect/PlatformError").PlatformError | State.StateStoreError, ArtifactStore | AuthProviders | Interaction.Interaction | State.State>;
232
+ /**
233
+ * In-test scratch stack handed to `test.provider(name, (stack) => ...)`.
234
+ *
235
+ * Each scratch stack owns a private state store that is shared between
236
+ * successive `deploy`/`destroy` calls AND visible to the user's test body
237
+ * (so `yield* State` / `state.get(...)` see the same store the deploys
238
+ * mutated). This makes create / update / replace / delete paths exercisable
239
+ * without polluting other tests in the same file.
240
+ *
241
+ * When the adapter can name the test file (the alchemy-test runner), the
242
+ * store is DURABLE — rows live under `.alchemy/state/{file}-{test}/{stage}`
243
+ * on disk. Durability is what makes an interrupted destroy recoverable: the
244
+ * engine persists a `deleting` row before every `provider.delete` and only
245
+ * drops it on success, so a run killed mid-delete (e.g. the runner's
246
+ * teardown-abandonment after a test timeout) leaves resumable rows that the
247
+ * NEXT run's leading `stack.destroy()` (or the `Effect.ensuring` teardown)
248
+ * picks up and drains. An in-memory scratch dies with the process, silently
249
+ * orphaning every cloud resource whose delete was still in flight.
250
+ */
251
+ export interface ScratchStack<ROut = any> {
252
+ readonly name: string;
253
+ /** Stage this scratch deploys to ({@link resolveStage} of the file options). */
254
+ readonly stage: string;
255
+ /** The shared in-memory state Layer for this scratch. @internal */
256
+ readonly state: Layer.Layer<State.State, never, never>;
257
+ /** Filters leave other rows and stack outputs untouched; declaration still runs. */
258
+ deploy<A, E, R, Call extends [options?: Plan.FilteredPlanOptions] = []>(effect: Effect.Effect<A, E, R>, ...call: Call): Effect.Effect<SelectionOutput<Input.Resolve<A>, Call[0]>, any, Exclude<R, ROut | StackServices>>;
259
+ /**
260
+ * Build a plan against the scratch's shared state WITHOUT applying it.
261
+ *
262
+ * Use this to assert on the planned action for a resource (e.g. that a
263
+ * downstream dependency stays `noop` when only an upstream resource
264
+ * changes) without mutating the cloud. Plans run against whatever state
265
+ * prior `deploy(...)` calls persisted.
266
+ */
267
+ plan<A, E, R, Call extends [options?: Plan.FilteredPlanOptions] = []>(effect: Effect.Effect<A, E, R>, ...call: Call): Effect.Effect<Plan.Plan<SelectionOutput<A, Call[0]>>, any, Exclude<R, ROut | StackServices>>;
268
+ destroy(options?: {
269
+ include?: never;
270
+ exclude?: never;
271
+ }): Effect.Effect<void, any, never>;
272
+ }
273
+ /**
274
+ * Build a fresh `ScratchStack` for `test.provider`.
275
+ *
276
+ * With `file` (the registration-time test file, supplied by the
277
+ * alchemy-test adapter): the store is the durable `.alchemy/state` local
278
+ * store and the stack name is namespaced by file so interrupted destroys
279
+ * leave resumable rows for the next run (see {@link ScratchStack}).
280
+ *
281
+ * Without `file` (bun/vitest adapters, which cannot name their file at
282
+ * registration time): falls back to a private in-memory store — isolated,
283
+ * but discarded with the process.
284
+ */
285
+ export declare const scratchStack: <ROut>(options: MakeOptions<ROut>, name: string, file?: string) => ScratchStack<ROut>;
286
+ export {};
287
+ //# sourceMappingURL=Core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Core.d.ts","sourceRoot":"","sources":["../src/Core.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAsB,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAA6B,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAS1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,gBAAgB,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,UAAU,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AAKvC,uDAAuD;AACvD,OAAO,K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