effect-cf 0.23.0 → 0.24.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.
@@ -0,0 +1,192 @@
1
+ import { c as WorkerEnvironment, s as WorkerEnv } from "./Binding-Bq_FPzlt.mjs";
2
+ import { c as DurableObjectState, l as DurableObjectStateService, o as WorkflowInstanceStatusName } from "./WorkflowBinding-BECGNTzu.mjs";
3
+ import { Effect, Layer } from "effect";
4
+ import { DurableObject } from "cloudflare:workers";
5
+ import { adminSecretsStore as adminSecretsStore$1, getQueueResult, introspectWorkflow as introspectWorkflow$1, introspectWorkflowInstance as introspectWorkflowInstance$1 } from "cloudflare:test";
6
+ //#region src/Vitest.d.ts
7
+ /**
8
+ * Provides the Workers pool environment as both {@link WorkerEnvironment} and
9
+ * the active Effect `ConfigProvider`.
10
+ */
11
+ declare const layer: Layer.Layer<WorkerEnvironment>;
12
+ /** Constructor shape shared by Effect-backed Worker entrypoints. */
13
+ interface WorkerConstructor<Instance> {
14
+ new (context: globalThis.ExecutionContext, env: WorkerEnv): Instance;
15
+ }
16
+ /**
17
+ * Creates an `ExecutionContext` and drains all `waitUntil` work before the
18
+ * returned effect completes, including when `use` fails or is interrupted.
19
+ */
20
+ declare const withExecutionContext: <A, E, R>(use: (context: globalThis.ExecutionContext) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
21
+ interface FetchWorker {
22
+ fetch(request: Request): Promise<Response>;
23
+ }
24
+ /**
25
+ * Invokes an Effect-backed Worker fetch handler and drains its `waitUntil`
26
+ * work before returning the response.
27
+ */
28
+ declare const fetch: <Instance extends FetchWorker>(Worker: WorkerConstructor<Instance>, request: Request<unknown, CfProperties<unknown>>, workerEnv?: Cloudflare.Env | undefined) => Effect.Effect<Response, never, never>;
29
+ /** Modules-format scheduled handler accepted by {@link scheduled}. */
30
+ type ScheduledHandler = NonNullable<globalThis.ExportedHandler<WorkerEnv>["scheduled"]>;
31
+ /** Options used to construct a scheduled event controller. */
32
+ interface ScheduledOptions {
33
+ readonly scheduledTime?: number | Date;
34
+ readonly cron?: string;
35
+ }
36
+ /**
37
+ * Invokes a modules-format scheduled handler and drains its `waitUntil` work.
38
+ */
39
+ declare const scheduled: (handler: ExportedHandlerScheduledHandler<Cloudflare.Env, unknown>, options?: ScheduledOptions | undefined, workerEnv?: Cloudflare.Env | undefined) => Effect.Effect<ScheduledController, never, never>;
40
+ type AnyPagesFunction = globalThis.PagesFunction<WorkerEnv, string, any>;
41
+ interface PagesEventContextInitBase {
42
+ readonly request: Request<unknown, IncomingRequestCfProperties>;
43
+ readonly functionPath?: string;
44
+ readonly next?: (request: Request) => Response | Promise<Response>;
45
+ }
46
+ type PagesEventContextInitParams<Context> = Context extends globalThis.EventContext<unknown, infer Params, unknown> ? [Params] extends [never] ? {
47
+ readonly params?: Record<string, never>;
48
+ } : {
49
+ readonly params: Record<Params, string | Array<string>>;
50
+ } : never;
51
+ type PagesEventContextInitData<Context> = Context extends globalThis.EventContext<unknown, string, infer Data> ? Data extends Record<string, never> ? {
52
+ readonly data?: Data;
53
+ } : {
54
+ readonly data: Data;
55
+ } : never;
56
+ /** Initialization accepted by Pool Workers for a Pages Function. */
57
+ type PagesEventContextInit<Function extends AnyPagesFunction> = PagesEventContextInitBase & PagesEventContextInitParams<Parameters<Function>[0]> & PagesEventContextInitData<Parameters<Function>[0]>;
58
+ /**
59
+ * Invokes a Pages Function with a typed event context and drains its
60
+ * `waitUntil` work, including when the function fails.
61
+ */
62
+ declare const pages: <Function extends AnyPagesFunction>(handler: Function, init: PagesEventContextInit<Function>) => Effect.Effect<Response, never, never>;
63
+ interface QueueWorker {
64
+ queue(batch: globalThis.MessageBatch): Promise<void>;
65
+ }
66
+ /** Input message accepted by Pool Workers' `createMessageBatch` helper. */
67
+ type QueueMessage<Body> = {
68
+ readonly id: string;
69
+ readonly timestamp: Date;
70
+ readonly attempts: number;
71
+ } & ({
72
+ readonly body: Body;
73
+ } | {
74
+ readonly serializedBody: ArrayBuffer | ArrayBufferView;
75
+ });
76
+ /** Acknowledgement and retry result returned by Pool Workers. */
77
+ type QueueResult = Awaited<ReturnType<typeof getQueueResult>>;
78
+ /** Result of invoking a queue consumer through {@link queue}. */
79
+ interface QueueRunResult<Body> {
80
+ readonly batch: globalThis.MessageBatch<Body>;
81
+ readonly result: QueueResult;
82
+ }
83
+ /**
84
+ * Invokes an Effect-backed queue consumer, drains its `waitUntil` work, and
85
+ * returns Pool Workers' acknowledgement and retry result.
86
+ */
87
+ declare const queue: <Body, Instance extends QueueWorker>(Worker: WorkerConstructor<Instance>, queueName: string, messages: readonly QueueMessage<Body>[], workerEnv?: Cloudflare.Env | undefined) => Effect.Effect<QueueRunResult<Body>, never, never>;
88
+ /**
89
+ * Runs an Effect inside the I/O context of a Durable Object instance.
90
+ *
91
+ * The caller's Effect context is preserved, and the instance's native state is
92
+ * provided as {@link DurableObjectState}. A wrapped state service is also
93
+ * passed to `use` for direct access.
94
+ */
95
+ declare const runInDurableObject: <Object extends DurableObject, A, E, R>(stub: DurableObjectStub<Object>, use: (instance: Object, state: DurableObjectStateService) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, DurableObjectState>>;
96
+ /** Immediately runs and removes a scheduled Durable Object alarm. */
97
+ declare const runDurableObjectAlarm: (stub: DurableObjectStub<DurableObject<Cloudflare.Env, {}>>) => Effect.Effect<boolean, never, never>;
98
+ /** Options controlling how Durable Object eviction handles WebSockets. */
99
+ interface DurableObjectEvictionOptions {
100
+ readonly webSockets?: "close" | "hibernate";
101
+ }
102
+ /** Gracefully evicts one running Durable Object while preserving durable storage. */
103
+ declare const evictDurableObject: (stub: DurableObjectStub<DurableObject<Cloudflare.Env, {}>>, options?: DurableObjectEvictionOptions | undefined) => Effect.Effect<void, never, never>;
104
+ /** Lists all IDs created in a Durable Object namespace. */
105
+ declare const listDurableObjectIds: <Object extends DurableObject | undefined>(namespace: DurableObjectNamespace<Object>) => Effect.Effect<DurableObjectId[], never, never>;
106
+ /** Deletes data from all bindings attached to the current test Worker. */
107
+ declare const reset: () => Effect.Effect<void, never, never>;
108
+ /** Aborts all Durable Object instances without deleting their persisted data. */
109
+ declare const abortAllDurableObjects: () => Effect.Effect<void, never, never>;
110
+ /** Gracefully evicts all running Durable Objects while preserving durable storage. */
111
+ declare const evictAllDurableObjects: (options?: DurableObjectEvictionOptions | undefined) => Effect.Effect<void, never, never>;
112
+ /** A D1 migration accepted by Pool Workers. */
113
+ interface D1Migration {
114
+ readonly name: string;
115
+ readonly queries: ReadonlyArray<string>;
116
+ }
117
+ /** Applies all D1 migrations that have not already been recorded. */
118
+ declare const applyD1Migrations: (database: D1Database, migrations: readonly D1Migration[], migrationsTableName?: string | undefined) => Effect.Effect<void, never, never>;
119
+ type NativeSecretsStoreAdmin = ReturnType<typeof adminSecretsStore$1>;
120
+ /** Secret metadata returned by {@link SecretsStoreAdmin.list}. */
121
+ interface SecretsStoreSecret {
122
+ readonly name: string;
123
+ readonly metadata?: {
124
+ readonly uuid: string;
125
+ };
126
+ }
127
+ /** Effect-native wrapper around Pool Workers' Secrets Store admin API. */
128
+ interface SecretsStoreAdmin {
129
+ readonly raw: NativeSecretsStoreAdmin;
130
+ readonly create: (value: string) => Effect.Effect<string>;
131
+ readonly update: (value: string, id: string) => Effect.Effect<string>;
132
+ readonly duplicate: (id: string, newName: string) => Effect.Effect<string>;
133
+ readonly delete: (id: string) => Effect.Effect<void>;
134
+ readonly list: Effect.Effect<Array<SecretsStoreSecret>>;
135
+ readonly get: (id: string) => Effect.Effect<string>;
136
+ }
137
+ /** Acquires an Effect-native admin client for a Secrets Store binding. */
138
+ declare const adminSecretsStore: (binding: {
139
+ get(): Promise<string>;
140
+ }) => Effect.Effect<SecretsStoreAdmin, never, never>;
141
+ type NativeWorkflowIntrospector = Awaited<ReturnType<typeof introspectWorkflow$1>>;
142
+ type NativeWorkflowInstanceIntrospector = Awaited<ReturnType<typeof introspectWorkflowInstance$1>>;
143
+ /** Identifies one occurrence of a Workflow step or sleep. */
144
+ interface WorkflowStepTarget {
145
+ readonly name: string;
146
+ readonly index?: number;
147
+ }
148
+ /** Event delivered to a mocked Workflow `waitForEvent` operation. */
149
+ interface WorkflowMockEvent {
150
+ readonly type: string;
151
+ readonly payload: unknown;
152
+ }
153
+ /** Effect-native Workflow behavior modifier. */
154
+ interface WorkflowInstanceModifier {
155
+ readonly disableSleeps: (steps?: ReadonlyArray<WorkflowStepTarget>) => Effect.Effect<void>;
156
+ readonly disableRetryDelays: (steps?: ReadonlyArray<WorkflowStepTarget>) => Effect.Effect<void>;
157
+ readonly mockStepResult: (step: WorkflowStepTarget, result: unknown) => Effect.Effect<void>;
158
+ readonly mockStepError: (step: WorkflowStepTarget, error: Error, times?: number) => Effect.Effect<void>;
159
+ readonly forceStepTimeout: (step: WorkflowStepTarget, times?: number) => Effect.Effect<void>;
160
+ readonly mockEvent: (event: WorkflowMockEvent) => Effect.Effect<void>;
161
+ readonly forceEventTimeout: (step: WorkflowStepTarget) => Effect.Effect<void>;
162
+ }
163
+ /** Effect-native introspector for one Workflow instance. */
164
+ interface WorkflowInstanceIntrospector {
165
+ readonly raw: NativeWorkflowInstanceIntrospector;
166
+ readonly modify: <A, E, R>(use: (modifier: WorkflowInstanceModifier) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
167
+ readonly waitForStepResult: (step: WorkflowStepTarget) => Effect.Effect<unknown>;
168
+ readonly waitForStatus: (status: WorkflowInstanceStatusName) => Effect.Effect<void>;
169
+ readonly getOutput: Effect.Effect<unknown>;
170
+ readonly getError: Effect.Effect<{
171
+ readonly name: string;
172
+ readonly message: string;
173
+ }>;
174
+ }
175
+ /** Effect-native introspector for subsequently created Workflow instances. */
176
+ interface WorkflowIntrospector {
177
+ readonly raw: NativeWorkflowIntrospector;
178
+ readonly modifyAll: <A, E, R>(use: (modifier: WorkflowInstanceModifier) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
179
+ readonly get: Effect.Effect<ReadonlyArray<WorkflowInstanceIntrospector>>;
180
+ }
181
+ /**
182
+ * Acquires an Effect-native Workflow introspector that is disposed when the
183
+ * surrounding Effect scope closes.
184
+ */
185
+ declare const introspectWorkflow: (workflow: Workflow<unknown>) => Effect.Effect<WorkflowIntrospector, never, import("effect/Scope").Scope>;
186
+ /**
187
+ * Acquires an Effect-native Workflow instance introspector that is disposed
188
+ * when the surrounding Effect scope closes.
189
+ */
190
+ declare const introspectWorkflowInstance: (workflow: Workflow<unknown>, instanceId: string) => Effect.Effect<WorkflowInstanceIntrospector, never, import("effect/Scope").Scope>;
191
+ //#endregion
192
+ export { D1Migration, DurableObjectEvictionOptions, PagesEventContextInit, QueueMessage, QueueResult, QueueRunResult, ScheduledHandler, ScheduledOptions, SecretsStoreAdmin, SecretsStoreSecret, WorkerConstructor, WorkflowInstanceIntrospector, WorkflowInstanceModifier, WorkflowIntrospector, WorkflowMockEvent, WorkflowStepTarget, abortAllDurableObjects, adminSecretsStore, applyD1Migrations, evictAllDurableObjects, evictDurableObject, fetch, introspectWorkflow, introspectWorkflowInstance, layer, listDurableObjectIds, pages, queue, reset, runDurableObjectAlarm, runInDurableObject, scheduled, withExecutionContext };
@@ -0,0 +1,184 @@
1
+ import { d as WorkerConfig, f as WorkerEnvironment, r as fromDurableObjectState, t as DurableObjectState } from "./DurableObjectState-8sgBJB0s.mjs";
2
+ import { ConfigProvider, Effect, Exit, Layer } from "effect";
3
+ import { env } from "cloudflare:workers";
4
+ import { abortAllDurableObjects as abortAllDurableObjects$1, adminSecretsStore as adminSecretsStore$1, applyD1Migrations as applyD1Migrations$1, createExecutionContext, createMessageBatch, createPagesEventContext, createScheduledController, evictAllDurableObjects as evictAllDurableObjects$1, evictDurableObject as evictDurableObject$1, getQueueResult, introspectWorkflow as introspectWorkflow$1, introspectWorkflowInstance as introspectWorkflowInstance$1, listDurableObjectIds as listDurableObjectIds$1, reset as reset$1, runDurableObjectAlarm as runDurableObjectAlarm$1, runInDurableObject as runInDurableObject$1, waitOnExecutionContext } from "cloudflare:test";
5
+ //#region src/Vitest.ts
6
+ /**
7
+ * Effect-native helpers for tests running in Cloudflare's Vitest Workers pool.
8
+ *
9
+ * Import this module through the `effect-cf/vitest` subpath. It is intended to
10
+ * run inside the Workers test runtime, where `cloudflare:test` is available.
11
+ */
12
+ const currentEnv = env;
13
+ /**
14
+ * Provides the Workers pool environment as both {@link WorkerEnvironment} and
15
+ * the active Effect `ConfigProvider`.
16
+ */
17
+ const layer = Layer.mergeAll(Layer.succeed(WorkerEnvironment, currentEnv), ConfigProvider.layer(WorkerConfig.providerFromEnv(currentEnv)));
18
+ /**
19
+ * Creates an `ExecutionContext` and drains all `waitUntil` work before the
20
+ * returned effect completes, including when `use` fails or is interrupted.
21
+ */
22
+ const withExecutionContext = Effect.fn("effect-cf/vitest/withExecutionContext")(function* (use) {
23
+ return yield* Effect.acquireUseRelease(Effect.sync(createExecutionContext), use, (context) => Effect.promise(() => waitOnExecutionContext(context)));
24
+ });
25
+ /**
26
+ * Invokes an Effect-backed Worker fetch handler and drains its `waitUntil`
27
+ * work before returning the response.
28
+ */
29
+ const fetch = Effect.fn("effect-cf/vitest/fetch")(function* (Worker, request, workerEnv = currentEnv) {
30
+ return yield* withExecutionContext(Effect.fnUntraced(function* (context) {
31
+ const worker = new Worker(context, workerEnv);
32
+ return yield* Effect.promise(() => worker.fetch(request));
33
+ }));
34
+ });
35
+ /**
36
+ * Invokes a modules-format scheduled handler and drains its `waitUntil` work.
37
+ */
38
+ const scheduled = Effect.fn("effect-cf/vitest/scheduled")(function* (handler, options, workerEnv = currentEnv) {
39
+ const controller = createScheduledController(options);
40
+ yield* withExecutionContext((context) => Effect.promise(async () => handler(controller, workerEnv, context)));
41
+ return controller;
42
+ });
43
+ /**
44
+ * Invokes a Pages Function with a typed event context and drains its
45
+ * `waitUntil` work, including when the function fails.
46
+ */
47
+ const pages = Effect.fn("effect-cf/vitest/pages")(function* (handler, init) {
48
+ return yield* Effect.acquireUseRelease(Effect.sync(() => createPagesEventContext(init)), (context) => Effect.promise(async () => handler(context)), (context) => Effect.promise(() => waitOnExecutionContext(context)));
49
+ });
50
+ /**
51
+ * Invokes an Effect-backed queue consumer, drains its `waitUntil` work, and
52
+ * returns Pool Workers' acknowledgement and retry result.
53
+ */
54
+ const queue = Effect.fn("effect-cf/vitest/queue")(function* (Worker, queueName, messages, workerEnv = currentEnv) {
55
+ return yield* withExecutionContext(Effect.fnUntraced(function* (context) {
56
+ const batch = createMessageBatch(queueName, [...messages]);
57
+ const worker = new Worker(context, workerEnv);
58
+ yield* Effect.promise(() => worker.queue(batch));
59
+ return {
60
+ batch,
61
+ result: yield* Effect.promise(() => getQueueResult(batch, context))
62
+ };
63
+ }));
64
+ });
65
+ /**
66
+ * Runs an Effect inside the I/O context of a Durable Object instance.
67
+ *
68
+ * The caller's Effect context is preserved, and the instance's native state is
69
+ * provided as {@link DurableObjectState}. A wrapped state service is also
70
+ * passed to `use` for direct access.
71
+ */
72
+ const runInDurableObject = Effect.fn("effect-cf/vitest/runInDurableObject")(function* (stub, use) {
73
+ const context = yield* Effect.context();
74
+ return yield* yield* Effect.promise(() => runInDurableObject$1(stub, (instance, nativeState) => {
75
+ const state = fromDurableObjectState(nativeState);
76
+ const effect = Effect.provideService(use(instance, state), DurableObjectState, state);
77
+ return Effect.runPromiseExitWith(context)(effect);
78
+ }));
79
+ });
80
+ /** Immediately runs and removes a scheduled Durable Object alarm. */
81
+ const runDurableObjectAlarm = Effect.fn("effect-cf/vitest/runDurableObjectAlarm")(function* (stub) {
82
+ return yield* Effect.promise(() => runDurableObjectAlarm$1(stub));
83
+ });
84
+ /** Gracefully evicts one running Durable Object while preserving durable storage. */
85
+ const evictDurableObject = Effect.fn("effect-cf/vitest/evictDurableObject")(function* (stub, options) {
86
+ yield* Effect.promise(() => evictDurableObject$1(stub, options));
87
+ });
88
+ /** Lists all IDs created in a Durable Object namespace. */
89
+ const listDurableObjectIds = Effect.fn("effect-cf/vitest/listDurableObjectIds")(function* (namespace) {
90
+ return yield* Effect.promise(() => listDurableObjectIds$1(namespace));
91
+ });
92
+ /** Deletes data from all bindings attached to the current test Worker. */
93
+ const reset = Effect.fn("effect-cf/vitest/reset")(function* () {
94
+ yield* Effect.promise(reset$1);
95
+ });
96
+ /** Aborts all Durable Object instances without deleting their persisted data. */
97
+ const abortAllDurableObjects = Effect.fn("effect-cf/vitest/abortAllDurableObjects")(function* () {
98
+ yield* Effect.promise(abortAllDurableObjects$1);
99
+ });
100
+ /** Gracefully evicts all running Durable Objects while preserving durable storage. */
101
+ const evictAllDurableObjects = Effect.fn("effect-cf/vitest/evictAllDurableObjects")(function* (options) {
102
+ yield* Effect.promise(() => evictAllDurableObjects$1(options));
103
+ });
104
+ /** Applies all D1 migrations that have not already been recorded. */
105
+ const applyD1Migrations = Effect.fn("effect-cf/vitest/applyD1Migrations")(function* (database, migrations, migrationsTableName) {
106
+ yield* Effect.promise(() => applyD1Migrations$1(database, migrations.map(({ name, queries }) => ({
107
+ name,
108
+ queries: [...queries]
109
+ })), migrationsTableName));
110
+ });
111
+ /** Acquires an Effect-native admin client for a Secrets Store binding. */
112
+ const adminSecretsStore = Effect.fn("effect-cf/vitest/adminSecretsStore")(function* (binding) {
113
+ const admin = yield* Effect.sync(() => adminSecretsStore$1(binding));
114
+ return {
115
+ raw: admin,
116
+ create: (value) => Effect.promise(() => admin.create(value)),
117
+ update: (value, id) => Effect.promise(() => admin.update(value, id)),
118
+ duplicate: (id, newName) => Effect.promise(() => admin.duplicate(id, newName)),
119
+ delete: (id) => Effect.promise(() => admin.delete(id)),
120
+ list: Effect.promise(() => admin.list()),
121
+ get: (id) => Effect.promise(() => admin.get(id))
122
+ };
123
+ });
124
+ const wrapWorkflowModifier = (modifier) => ({
125
+ disableSleeps: (steps) => Effect.promise(() => modifier.disableSleeps(steps === void 0 ? void 0 : [...steps])),
126
+ disableRetryDelays: (steps) => Effect.promise(() => modifier.disableRetryDelays(steps === void 0 ? void 0 : [...steps])),
127
+ mockStepResult: (step, result) => Effect.promise(() => modifier.mockStepResult(step, result)),
128
+ mockStepError: (step, error, times) => Effect.promise(() => modifier.mockStepError(step, error, times)),
129
+ forceStepTimeout: (step, times) => Effect.promise(async () => {
130
+ await modifier.forceStepTimeout(step, times);
131
+ }),
132
+ mockEvent: (event) => Effect.promise(() => modifier.mockEvent(event)),
133
+ forceEventTimeout: (step) => Effect.promise(() => modifier.forceEventTimeout(step))
134
+ });
135
+ const runWorkflowModifier = Effect.fnUntraced(function* (register, use) {
136
+ const context = yield* Effect.context();
137
+ return yield* yield* Effect.promise(async () => {
138
+ let callbackExit;
139
+ try {
140
+ await register(async (modifier) => {
141
+ callbackExit = await Effect.runPromiseExitWith(context)(use(wrapWorkflowModifier(modifier)));
142
+ if (Exit.isFailure(callbackExit)) throw callbackExit;
143
+ });
144
+ } catch (cause) {
145
+ if (callbackExit !== void 0 && Exit.isFailure(callbackExit)) return callbackExit;
146
+ throw cause;
147
+ }
148
+ if (callbackExit === void 0) throw new Error("Pool Workers did not invoke the Workflow modifier callback");
149
+ return callbackExit;
150
+ });
151
+ });
152
+ const wrapWorkflowInstanceIntrospector = (introspector) => ({
153
+ raw: introspector,
154
+ modify: (use) => runWorkflowModifier((callback) => introspector.modify(callback), use),
155
+ waitForStepResult: (step) => Effect.promise(() => introspector.waitForStepResult(step)),
156
+ waitForStatus: (status) => Effect.promise(() => introspector.waitForStatus(status)),
157
+ getOutput: Effect.promise(() => introspector.getOutput()),
158
+ getError: Effect.promise(() => introspector.getError())
159
+ });
160
+ const wrapWorkflowIntrospector = (introspector) => ({
161
+ raw: introspector,
162
+ modifyAll: (use) => runWorkflowModifier((callback) => introspector.modifyAll(callback), use),
163
+ get: Effect.promise(async () => {
164
+ return (await introspector.get()).map(wrapWorkflowInstanceIntrospector);
165
+ })
166
+ });
167
+ /**
168
+ * Acquires an Effect-native Workflow introspector that is disposed when the
169
+ * surrounding Effect scope closes.
170
+ */
171
+ const introspectWorkflow = Effect.fn("effect-cf/vitest/introspectWorkflow")(function* (workflow) {
172
+ const introspector = yield* Effect.acquireDisposable(Effect.promise(() => introspectWorkflow$1(workflow)));
173
+ return wrapWorkflowIntrospector(introspector);
174
+ });
175
+ /**
176
+ * Acquires an Effect-native Workflow instance introspector that is disposed
177
+ * when the surrounding Effect scope closes.
178
+ */
179
+ const introspectWorkflowInstance = Effect.fn("effect-cf/vitest/introspectWorkflowInstance")(function* (workflow, instanceId) {
180
+ const introspector = yield* Effect.acquireDisposable(Effect.promise(() => introspectWorkflowInstance$1(workflow, instanceId)));
181
+ return wrapWorkflowInstanceIntrospector(introspector);
182
+ });
183
+ //#endregion
184
+ export { abortAllDurableObjects, adminSecretsStore, applyD1Migrations, evictAllDurableObjects, evictDurableObject, fetch, introspectWorkflow, introspectWorkflowInstance, layer, listDurableObjectIds, pages, queue, reset, runDurableObjectAlarm, runInDurableObject, scheduled, withExecutionContext };