effect-cf 0.39.1 → 0.40.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 +18 -0
- package/README.md +9 -1
- package/dist/AiGateway.d.mts +86 -0
- package/dist/AiGateway.mjs +178 -0
- package/dist/AnalyticsEngine.d.mts +170 -0
- package/dist/AnalyticsEngine.mjs +275 -0
- package/dist/{Artifacts-B3r3RuTB.d.mts → Artifacts.d.mts} +8 -5
- package/dist/{Artifacts-CBxWGeZB.mjs → Artifacts.mjs} +9 -5
- package/dist/Binding.d.mts +45 -0
- package/dist/{Binding-C82jRhdr.mjs → Binding.mjs} +8 -4
- package/dist/BrowserRendering.d.mts +85 -0
- package/dist/BrowserRendering.mjs +81 -0
- package/dist/Cache.d.mts +40 -0
- package/dist/Cache.mjs +51 -0
- package/dist/CloudflareOtlp.d.mts +95 -0
- package/dist/CloudflareOtlp.mjs +125 -0
- package/dist/CloudflareTracer.d.mts +20 -0
- package/dist/CloudflareTracer.mjs +69 -0
- package/dist/ComputerArtifacts.d.mts +2 -2
- package/dist/ComputerArtifacts.mjs +3 -2
- package/dist/ComputerWorkspace.d.mts +36 -31
- package/dist/ComputerWorkspace.mjs +8 -3
- package/dist/ComputerWorkspaceHost.d.mts +1 -1
- package/dist/ComputerWorkspaceHost.mjs +1 -1
- package/dist/{ContainerNamespace-DbLaeFhN.d.mts → ContainerNamespace.d.mts} +16 -12
- package/dist/ContainerNamespace.mjs +165 -0
- package/dist/D1.d.mts +33 -0
- package/dist/D1.mjs +32 -0
- package/dist/DurableObject.d.mts +103 -0
- package/dist/DurableObject.mjs +77 -0
- package/dist/DurableObjectAlarm.d.mts +187 -0
- package/dist/DurableObjectAlarm.mjs +344 -0
- package/dist/DurableObjectDefinition.d.mts +87 -0
- package/dist/DurableObjectDefinition.mjs +125 -0
- package/dist/DurableObjectNamespace.d.mts +154 -0
- package/dist/DurableObjectNamespace.mjs +144 -0
- package/dist/DurableObjectRpcWebSocket.d.mts +112 -0
- package/dist/DurableObjectRpcWebSocket.mjs +547 -0
- package/dist/DurableObjectSqlite.d.mts +11 -0
- package/dist/DurableObjectSqlite.mjs +16 -0
- package/dist/DurableObjectState.d.mts +65 -0
- package/dist/DurableObjectState.mjs +47 -0
- package/dist/DurableObjectStorage.d.mts +112 -0
- package/dist/{DurableObjectState-DLL0YgBd.mjs → DurableObjectStorage.mjs} +19 -157
- package/dist/DurableObjectWebSocket.d.mts +83 -0
- package/dist/DurableObjectWebSocket.mjs +120 -0
- package/dist/Email.d.mts +106 -0
- package/dist/Email.mjs +247 -0
- package/dist/Environment.d.mts +59 -0
- package/dist/{ErrorMessage-Byx2OgNd.mjs → Environment.mjs} +7 -18
- package/dist/{Hyperdrive-HrwFlZ6x.d.mts → Hyperdrive.d.mts} +8 -5
- package/dist/Hyperdrive.mjs +32 -0
- package/dist/HyperdrivePg.d.mts +4 -3
- package/dist/HyperdrivePg.mjs +3 -1
- package/dist/Images.d.mts +191 -0
- package/dist/Images.mjs +112 -0
- package/dist/Kv.d.mts +84 -0
- package/dist/Kv.mjs +132 -0
- package/dist/Mcp.d.mts +5 -3
- package/dist/Mcp.mjs +13 -4
- package/dist/Queue.d.mts +68 -0
- package/dist/Queue.mjs +54 -0
- package/dist/QueueBinding.d.mts +42 -0
- package/dist/QueueBinding.mjs +69 -0
- package/dist/QueueDefinition.d.mts +48 -0
- package/dist/QueueDefinition.mjs +63 -0
- package/dist/R2.d.mts +89 -0
- package/dist/R2.mjs +117 -0
- package/dist/Rpc.d.mts +29 -0
- package/dist/Rpc.mjs +28 -0
- package/dist/RpcDefinition.d.mts +116 -0
- package/dist/RpcDefinition.mjs +184 -0
- package/dist/RpcTracing.d.mts +52 -0
- package/dist/RpcTracing.mjs +77 -0
- package/dist/Sandbox.d.mts +10 -5
- package/dist/Sandbox.mjs +9 -3
- package/dist/ServiceBinding.d.mts +112 -0
- package/dist/ServiceBinding.mjs +145 -0
- package/dist/Vectorize.d.mts +68 -0
- package/dist/Vectorize.mjs +76 -0
- package/dist/Vitest.d.mts +6 -4
- package/dist/Vitest.mjs +8 -4
- package/dist/WebTransport.d.mts +66 -0
- package/dist/WebTransport.mjs +63 -0
- package/dist/Worker.d.mts +139 -0
- package/dist/Worker.mjs +141 -0
- package/dist/WorkerDefinition.d.mts +100 -0
- package/dist/WorkerDefinition.mjs +103 -0
- package/dist/WorkersAi.d.mts +84 -0
- package/dist/WorkersAi.mjs +84 -0
- package/dist/Workflow.d.mts +91 -0
- package/dist/Workflow.mjs +139 -0
- package/dist/{WorkflowBinding-DtVykUCz.d.mts → WorkflowBinding.d.mts} +14 -10
- package/dist/WorkflowBinding.mjs +100 -0
- package/dist/WorkflowDefinition.d.mts +51 -0
- package/dist/WorkflowDefinition.mjs +69 -0
- package/dist/{rolldown-runtime-D7D4PA-g.mjs → _virtual/_rolldown/runtime.mjs} +1 -1
- package/dist/index.d.mts +40 -1800
- package/dist/index.mjs +40 -3123
- package/dist/{ComputerWorkspaceHostRegistry-CY5Fv4Ng.mjs → internal/ComputerWorkspaceHostRegistry.mjs} +1 -1
- package/dist/internal/Entrypoint.mjs +37 -0
- package/dist/internal/ErrorMessage.mjs +17 -0
- package/dist/internal/NativeCallback.mjs +33 -0
- package/dist/internal/RpcInvocation.d.mts +13 -0
- package/dist/internal/RpcInvocation.mjs +34 -0
- package/dist/internal/Runtime.mjs +31 -0
- package/dist/internal/Telemetry.mjs +20 -0
- package/dist/{WorkerContext-Yobnfw-K.mjs → internal/WorkerContext.mjs} +4 -31
- package/package.json +1 -1
- package/src/AiGateway.ts +5 -1
- package/src/AnalyticsEngine.ts +14 -19
- package/src/Artifacts.ts +6 -1
- package/src/Binding.ts +5 -1
- package/src/BrowserRendering.ts +5 -1
- package/src/Cache.ts +5 -1
- package/src/CloudflareOtlp.ts +12 -10
- package/src/CloudflareTracer.ts +7 -1
- package/src/ComputerArtifacts.ts +2 -1
- package/src/ComputerWorkspace.ts +7 -1
- package/src/ContainerNamespace.ts +6 -1
- package/src/D1.ts +4 -1
- package/src/DurableObject.ts +122 -29
- package/src/DurableObjectAlarm.ts +185 -52
- package/src/DurableObjectDefinition.ts +22 -22
- package/src/DurableObjectNamespace.ts +4 -1
- package/src/DurableObjectRpcWebSocket.ts +7 -1
- package/src/DurableObjectSqlite.ts +2 -1
- package/src/DurableObjectState.ts +4 -1
- package/src/DurableObjectStorage.ts +11 -13
- package/src/DurableObjectWebSocket.ts +5 -1
- package/src/Email.ts +5 -1
- package/src/Environment.ts +6 -1
- package/src/Hyperdrive.ts +4 -1
- package/src/HyperdrivePg.ts +3 -1
- package/src/Images.ts +7 -1
- package/src/Kv.ts +7 -1
- package/src/Mcp.ts +13 -13
- package/src/Queue.ts +3 -1
- package/src/QueueBinding.ts +5 -1
- package/src/QueueDefinition.ts +4 -1
- package/src/R2.ts +7 -1
- package/src/Rpc.ts +4 -1
- package/src/RpcDefinition.ts +4 -1
- package/src/RpcTracing.ts +9 -1
- package/src/Sandbox.ts +7 -1
- package/src/ServiceBinding.ts +6 -1
- package/src/Vectorize.ts +7 -1
- package/src/Vitest.ts +5 -1
- package/src/WebTransport.ts +6 -1
- package/src/Worker.ts +10 -16
- package/src/WorkerDefinition.ts +3 -1
- package/src/WorkersAi.ts +7 -1
- package/src/Workflow.ts +8 -11
- package/src/WorkflowBinding.ts +6 -1
- package/src/WorkflowDefinition.ts +4 -1
- package/src/internal/Entrypoint.ts +3 -1
- package/src/internal/ErrorMessage.ts +1 -1
- package/src/internal/NativeCallback.ts +3 -1
- package/src/internal/RpcInvocation.ts +5 -1
- package/src/internal/Runtime.ts +5 -1
- package/src/internal/Telemetry.ts +4 -3
- package/src/internal/WorkerContext.ts +3 -1
- package/dist/Binding-DKcLrQCM.d.mts +0 -94
- package/dist/DurableObjectState-DJ0K-zyd.d.mts +0 -244
- package/dist/Worker-XsGJsCJX.mjs +0 -885
- package/dist/Worker-gV4mDqIs.d.mts +0 -641
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Schema as S,
|
|
13
|
-
} from "effect";
|
|
1
|
+
import * as Cause from "effect/Cause";
|
|
2
|
+
import * as Clock from "effect/Clock";
|
|
3
|
+
import * as Data from "effect/Data";
|
|
4
|
+
import * as Duration from "effect/Duration";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Exit from "effect/Exit";
|
|
7
|
+
import * as Fiber from "effect/Fiber";
|
|
8
|
+
import * as Option from "effect/Option";
|
|
9
|
+
import * as Predicate from "effect/Predicate";
|
|
10
|
+
import * as Result from "effect/Result";
|
|
11
|
+
import * as S from "effect/Schema";
|
|
14
12
|
|
|
15
13
|
import * as ErrorMessage from "./internal/ErrorMessage";
|
|
16
14
|
import { runNativeCallback } from "./internal/NativeCallback";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Data from "effect/Data";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Option from "effect/Option";
|
|
4
|
+
import * as Result from "effect/Result";
|
|
5
|
+
import * as S from "effect/Schema";
|
|
2
6
|
|
|
3
7
|
import { DurableObjectState } from "./DurableObjectState";
|
|
4
8
|
import * as ErrorMessage from "./internal/ErrorMessage";
|
package/src/Email.ts
CHANGED
|
@@ -4,7 +4,11 @@ import type {
|
|
|
4
4
|
EmailSendResult as CloudflareEmailSendResult,
|
|
5
5
|
SendEmail as CloudflareSendEmail,
|
|
6
6
|
} from "@cloudflare/workers-types";
|
|
7
|
-
import
|
|
7
|
+
import * as Context from "effect/Context";
|
|
8
|
+
import * as Data from "effect/Data";
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
|
+
import * as Predicate from "effect/Predicate";
|
|
11
|
+
import type { Layer } from "effect";
|
|
8
12
|
|
|
9
13
|
import * as Binding from "./Binding";
|
|
10
14
|
import type { WorkerEnvironment } from "./Environment";
|
package/src/Environment.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Config from "effect/Config";
|
|
2
|
+
import * as ConfigProvider from "effect/ConfigProvider";
|
|
3
|
+
import * as Context from "effect/Context";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Predicate from "effect/Predicate";
|
|
6
|
+
import type { Layer } from "effect";
|
|
2
7
|
|
|
3
8
|
export type WorkerEnv = Cloudflare.Env;
|
|
4
9
|
|
package/src/Hyperdrive.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Predicate from "effect/Predicate";
|
|
4
|
+
import type { Layer } from "effect";
|
|
2
5
|
|
|
3
6
|
import * as Binding from "./Binding";
|
|
4
7
|
import type { WorkerEnvironment } from "./Environment";
|
package/src/HyperdrivePg.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { PgClient } from "@effect/sql-pg";
|
|
2
|
-
import
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import * as Redacted from "effect/Redacted";
|
|
3
5
|
import type { SqlClient, SqlError } from "effect/unstable/sql";
|
|
4
6
|
|
|
5
7
|
import type * as Binding from "./Binding";
|
package/src/Images.ts
CHANGED
|
@@ -21,7 +21,13 @@ import type {
|
|
|
21
21
|
Response as CloudflareResponse,
|
|
22
22
|
TextOptions as CloudflareTextOptions,
|
|
23
23
|
} from "@cloudflare/workers-types";
|
|
24
|
-
import
|
|
24
|
+
import * as Context from "effect/Context";
|
|
25
|
+
import * as Data from "effect/Data";
|
|
26
|
+
import * as Effect from "effect/Effect";
|
|
27
|
+
import * as Function from "effect/Function";
|
|
28
|
+
import * as Option from "effect/Option";
|
|
29
|
+
import * as Predicate from "effect/Predicate";
|
|
30
|
+
import type { Layer } from "effect";
|
|
25
31
|
|
|
26
32
|
import * as Binding from "./Binding";
|
|
27
33
|
import type { WorkerEnvironment } from "./Environment";
|
package/src/Kv.ts
CHANGED
|
@@ -2,7 +2,13 @@ import type {
|
|
|
2
2
|
KVNamespaceListOptions as CloudflareKVNamespaceListOptions,
|
|
3
3
|
KVNamespacePutOptions as CloudflareKVNamespacePutOptions,
|
|
4
4
|
} from "@cloudflare/workers-types";
|
|
5
|
-
import
|
|
5
|
+
import * as Context from "effect/Context";
|
|
6
|
+
import * as Data from "effect/Data";
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import * as Option from "effect/Option";
|
|
9
|
+
import * as Predicate from "effect/Predicate";
|
|
10
|
+
import * as S from "effect/Schema";
|
|
11
|
+
import type { Layer } from "effect";
|
|
6
12
|
|
|
7
13
|
import * as Binding from "./Binding";
|
|
8
14
|
import type { WorkerEnvironment } from "./Environment";
|
package/src/Mcp.ts
CHANGED
|
@@ -11,19 +11,19 @@ import {
|
|
|
11
11
|
type ServerOptions,
|
|
12
12
|
type StandardSchemaWithJSON,
|
|
13
13
|
} from "@modelcontextprotocol/server";
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
import {
|
|
14
|
+
import * as Cause from "effect/Cause";
|
|
15
|
+
import * as Context from "effect/Context";
|
|
16
|
+
import * as Effect from "effect/Effect";
|
|
17
|
+
import * as Exit from "effect/Exit";
|
|
18
|
+
import * as Option from "effect/Option";
|
|
19
|
+
import * as Predicate from "effect/Predicate";
|
|
20
|
+
import * as Schema from "effect/Schema";
|
|
21
|
+
import * as Sink from "effect/Sink";
|
|
22
|
+
import * as Stream from "effect/Stream";
|
|
23
|
+
import type { JsonSchema } from "effect";
|
|
24
|
+
import * as AiError from "effect/unstable/ai/AiError";
|
|
25
|
+
import * as Tool from "effect/unstable/ai/Tool";
|
|
26
|
+
import type { Toolkit } from "effect/unstable/ai";
|
|
27
27
|
|
|
28
28
|
import { NativeRequest } from "./Worker";
|
|
29
29
|
import { runNativeCallback } from "./internal/NativeCallback";
|
package/src/Queue.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Data from "effect/Data";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import type { Scope } from "effect";
|
|
2
4
|
|
|
3
5
|
import type { ExecutionContext, WorkerContext } from "./Worker";
|
|
4
6
|
import type { WorkerEnvironment } from "./Environment";
|
package/src/QueueBinding.ts
CHANGED
|
@@ -7,7 +7,11 @@ import type {
|
|
|
7
7
|
QueueSendOptions as CloudflareQueueSendOptions,
|
|
8
8
|
QueueSendResponse as CloudflareQueueSendResponse,
|
|
9
9
|
} from "@cloudflare/workers-types";
|
|
10
|
-
import
|
|
10
|
+
import * as Data from "effect/Data";
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import * as Predicate from "effect/Predicate";
|
|
13
|
+
import * as S from "effect/Schema";
|
|
14
|
+
import type { Context } from "effect";
|
|
11
15
|
|
|
12
16
|
import * as Binding from "./Binding";
|
|
13
17
|
import type * as RpcDefinition from "./RpcDefinition";
|
package/src/QueueDefinition.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as S from "effect/Schema";
|
|
4
|
+
import type { Layer, Scope } from "effect";
|
|
2
5
|
|
|
3
6
|
import type * as Binding from "./Binding";
|
|
4
7
|
import type { WorkerEnvironment } from "./Environment";
|
package/src/R2.ts
CHANGED
|
@@ -12,7 +12,13 @@ import type {
|
|
|
12
12
|
R2UploadPartOptions as CloudflareR2UploadPartOptions,
|
|
13
13
|
R2UploadedPart as CloudflareR2UploadedPart,
|
|
14
14
|
} from "@cloudflare/workers-types";
|
|
15
|
-
import
|
|
15
|
+
import * as Context from "effect/Context";
|
|
16
|
+
import * as Data from "effect/Data";
|
|
17
|
+
import * as Effect from "effect/Effect";
|
|
18
|
+
import * as Option from "effect/Option";
|
|
19
|
+
import * as Predicate from "effect/Predicate";
|
|
20
|
+
import * as Schema from "effect/Schema";
|
|
21
|
+
import type { Layer } from "effect";
|
|
16
22
|
|
|
17
23
|
import * as Binding from "./Binding";
|
|
18
24
|
import type { WorkerEnvironment } from "./Environment";
|
package/src/Rpc.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { RpcStub, RpcTarget } from "cloudflare:workers";
|
|
2
|
-
import
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Predicate from "effect/Predicate";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import type { Scope } from "effect";
|
|
3
6
|
|
|
4
7
|
import { decodeWireError } from "./RpcDefinition";
|
|
5
8
|
|
package/src/RpcDefinition.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Data from "effect/Data";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Predicate from "effect/Predicate";
|
|
4
|
+
import * as S from "effect/Schema";
|
|
2
5
|
|
|
3
6
|
import type * as Rpc from "./Rpc";
|
|
4
7
|
import * as ErrorMessage from "./internal/ErrorMessage";
|
package/src/RpcTracing.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Cause from "effect/Cause";
|
|
2
|
+
import * as Clock from "effect/Clock";
|
|
3
|
+
import * as Context from "effect/Context";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Exit from "effect/Exit";
|
|
6
|
+
import * as Option from "effect/Option";
|
|
7
|
+
import * as References from "effect/References";
|
|
8
|
+
import * as Schema from "effect/Schema";
|
|
9
|
+
import * as Tracer from "effect/Tracer";
|
|
2
10
|
|
|
3
11
|
/**
|
|
4
12
|
* Live native RPC metadata. Opted-in receivers reserve a valid trailing value
|
package/src/Sandbox.ts
CHANGED
|
@@ -32,7 +32,13 @@ import type {
|
|
|
32
32
|
WaitForPortOptions,
|
|
33
33
|
WatchOptions,
|
|
34
34
|
} from "@cloudflare/sandbox";
|
|
35
|
-
import
|
|
35
|
+
import * as Context from "effect/Context";
|
|
36
|
+
import * as Data from "effect/Data";
|
|
37
|
+
import * as Effect from "effect/Effect";
|
|
38
|
+
import * as Option from "effect/Option";
|
|
39
|
+
import * as Predicate from "effect/Predicate";
|
|
40
|
+
import * as Stream from "effect/Stream";
|
|
41
|
+
import type { Layer } from "effect";
|
|
36
42
|
|
|
37
43
|
import * as Binding from "./Binding";
|
|
38
44
|
import type { ContainerStartOptions, ContainerStopSignal } from "./ContainerNamespace";
|
package/src/ServiceBinding.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Data from "effect/Data";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Option from "effect/Option";
|
|
4
|
+
import * as Predicate from "effect/Predicate";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
|
+
import type { Context, Scope } from "effect";
|
|
2
7
|
|
|
3
8
|
import * as Binding from "./Binding";
|
|
4
9
|
import * as CloudflareRpc from "./Rpc";
|
package/src/Vectorize.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Data from "effect/Data";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Option from "effect/Option";
|
|
5
|
+
import * as Predicate from "effect/Predicate";
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import type { Layer } from "effect";
|
|
2
8
|
import type {
|
|
3
9
|
Vectorize as CloudflareVectorize,
|
|
4
10
|
VectorizeAsyncMutation as CloudflareVectorizeAsyncMutation,
|
package/src/Vitest.ts
CHANGED
|
@@ -24,7 +24,11 @@ import {
|
|
|
24
24
|
runInDurableObject as runInDurableObjectPromise,
|
|
25
25
|
waitOnExecutionContext,
|
|
26
26
|
} from "cloudflare:test";
|
|
27
|
-
import
|
|
27
|
+
import * as ConfigProvider from "effect/ConfigProvider";
|
|
28
|
+
import * as Effect from "effect/Effect";
|
|
29
|
+
import * as Exit from "effect/Exit";
|
|
30
|
+
import * as Layer from "effect/Layer";
|
|
31
|
+
import * as Schema from "effect/Schema";
|
|
28
32
|
|
|
29
33
|
import {
|
|
30
34
|
DurableObjectState,
|
package/src/WebTransport.ts
CHANGED
|
@@ -30,7 +30,12 @@
|
|
|
30
30
|
* the edge does provide.
|
|
31
31
|
*/
|
|
32
32
|
import type { Request as CloudflareRequest } from "@cloudflare/workers-types";
|
|
33
|
-
import
|
|
33
|
+
import * as Data from "effect/Data";
|
|
34
|
+
import * as Effect from "effect/Effect";
|
|
35
|
+
import * as Option from "effect/Option";
|
|
36
|
+
import * as Predicate from "effect/Predicate";
|
|
37
|
+
import * as Result from "effect/Result";
|
|
38
|
+
import * as S from "effect/Schema";
|
|
34
39
|
|
|
35
40
|
/**
|
|
36
41
|
* Metadata Cloudflare's edge reports about the inbound client connection.
|
package/src/Worker.ts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import { WorkerEntrypoint as CloudflareWorkerEntrypoint } from "cloudflare:workers";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
HttpEffect,
|
|
14
|
-
HttpMiddleware,
|
|
15
|
-
HttpServerRequest,
|
|
16
|
-
HttpServerResponse,
|
|
17
|
-
} from "effect/unstable/http";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
|
+
import * as References from "effect/References";
|
|
6
|
+
import * as Tracer from "effect/Tracer";
|
|
7
|
+
import type { Cause, ManagedRuntime, Scope } from "effect";
|
|
8
|
+
import * as HttpEffect from "effect/unstable/http/HttpEffect";
|
|
9
|
+
import * as HttpMiddleware from "effect/unstable/http/HttpMiddleware";
|
|
10
|
+
import * as HttpServerRequest from "effect/unstable/http/HttpServerRequest";
|
|
11
|
+
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
|
|
18
12
|
|
|
19
13
|
import { WorkerEnvironment, type WorkerEnv } from "./Environment";
|
|
20
14
|
import { fromMessage, fromMessageBatch, type QueueHandler } from "./Queue";
|
package/src/WorkerDefinition.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import type { Layer, Schema as S } from "effect";
|
|
2
4
|
|
|
3
5
|
import type * as Binding from "./Binding";
|
|
4
6
|
import type { WorkerEnvironment } from "./Environment";
|
package/src/WorkersAi.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Data from "effect/Data";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Option from "effect/Option";
|
|
5
|
+
import * as Predicate from "effect/Predicate";
|
|
6
|
+
import * as S from "effect/Schema";
|
|
7
|
+
import type { Layer } from "effect";
|
|
2
8
|
import type {
|
|
3
9
|
Ai as CloudflareAi,
|
|
4
10
|
AiAsyncBatchResponse,
|
package/src/Workflow.ts
CHANGED
|
@@ -9,17 +9,14 @@ import {
|
|
|
9
9
|
type WorkflowTimeoutDuration,
|
|
10
10
|
} from "cloudflare:workers";
|
|
11
11
|
import { NonRetryableError as CloudflareNonRetryableError } from "cloudflare:workflows";
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Option,
|
|
21
|
-
type Scope,
|
|
22
|
-
} from "effect";
|
|
12
|
+
import * as Cause from "effect/Cause";
|
|
13
|
+
import * as Context from "effect/Context";
|
|
14
|
+
import * as Data from "effect/Data";
|
|
15
|
+
import * as Effect from "effect/Effect";
|
|
16
|
+
import * as FiberSet from "effect/FiberSet";
|
|
17
|
+
import * as Layer from "effect/Layer";
|
|
18
|
+
import * as Option from "effect/Option";
|
|
19
|
+
import type { ManagedRuntime, Scope } from "effect";
|
|
23
20
|
|
|
24
21
|
import { WorkerEnvironment, type WorkerEnv } from "./Environment";
|
|
25
22
|
import { ExecutionContext, WorkerContext } from "./Worker";
|
package/src/WorkflowBinding.ts
CHANGED
|
@@ -7,7 +7,12 @@ import type {
|
|
|
7
7
|
WorkflowInstanceRestartOptions as CloudflareWorkflowInstanceRestartOptions,
|
|
8
8
|
WorkflowInstanceTerminateOptions as CloudflareWorkflowInstanceTerminateOptions,
|
|
9
9
|
} from "@cloudflare/workers-types";
|
|
10
|
-
import
|
|
10
|
+
import * as Data from "effect/Data";
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import * as Option from "effect/Option";
|
|
13
|
+
import * as Predicate from "effect/Predicate";
|
|
14
|
+
import * as S from "effect/Schema";
|
|
15
|
+
import type { Context } from "effect";
|
|
11
16
|
|
|
12
17
|
import * as Binding from "./Binding";
|
|
13
18
|
import type * as RpcDefinition from "./RpcDefinition";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as S from "effect/Schema";
|
|
4
|
+
import type { Layer } from "effect";
|
|
2
5
|
|
|
3
6
|
import type * as Binding from "./Binding";
|
|
4
7
|
import type { WorkerEnvironment } from "./Environment";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Layer from "effect/Layer";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
2
4
|
|
|
3
5
|
import * as RpcDefinition from "../RpcDefinition";
|
|
4
6
|
import { RpcTraceContext, type ReceiverOptions, type RpcInvocationInfo } from "../RpcTracing";
|
|
@@ -21,4 +21,4 @@ export const causeMessage = (cause: unknown): string => {
|
|
|
21
21
|
export const violationsMessage = (
|
|
22
22
|
violations: ReadonlyArray<{ readonly path: string; readonly message: string }>,
|
|
23
23
|
): string => violations.map((violation) => `${violation.path}: ${violation.message}`).join("; ");
|
|
24
|
-
import
|
|
24
|
+
import * as Predicate from "effect/Predicate";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Exit from "effect/Exit";
|
|
3
|
+
import * as FiberSet from "effect/FiberSet";
|
|
2
4
|
|
|
3
5
|
type RunCallback<A, E, R> = (effect: Effect.Effect<A, E, R>) => Promise<Exit.Exit<A, E>>;
|
|
4
6
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Option from "effect/Option";
|
|
4
|
+
import * as Predicate from "effect/Predicate";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
2
6
|
|
|
3
7
|
import type * as CloudflareRpc from "../Rpc";
|
|
4
8
|
import type { RpcInvocationInfo } from "../RpcTracing";
|
package/src/internal/Runtime.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as ConfigProvider from "effect/ConfigProvider";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import * as ManagedRuntime from "effect/ManagedRuntime";
|
|
5
|
+
import type { Scope, Tracer } from "effect";
|
|
2
6
|
|
|
3
7
|
import { WorkerConfig, WorkerEnvironment, type WorkerEnv } from "../Environment";
|
|
4
8
|
import { provideEntrypointServices } from "./Entrypoint";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Option from "effect/Option";
|
|
3
|
+
import { Flusher } from "effect/unstable/observability/OtlpExporter";
|
|
3
4
|
|
|
4
5
|
/** Maximum event lifetime spent on an internally scheduled telemetry flush. */
|
|
5
6
|
const scheduledFlushTimeout = "2 seconds";
|
|
@@ -15,7 +16,7 @@ export const scheduleTelemetryFlush = <R>(
|
|
|
15
16
|
waitUntil: (flush: Effect.Effect<void>) => Effect.Effect<void, never, R>,
|
|
16
17
|
): Effect.Effect<void, never, R> =>
|
|
17
18
|
Effect.gen(function* () {
|
|
18
|
-
const flusher = yield* Effect.serviceOption(
|
|
19
|
+
const flusher = yield* Effect.serviceOption(Flusher);
|
|
19
20
|
|
|
20
21
|
if (Option.isNone(flusher)) {
|
|
21
22
|
return;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { Config, ConfigProvider, Context, Effect, Layer, Predicate } from "effect";
|
|
2
|
-
declare namespace Environment_d_exports {
|
|
3
|
-
export { WorkerConfig, WorkerEnv, WorkerEnvironment };
|
|
4
|
-
}
|
|
5
|
-
type WorkerEnv = Cloudflare.Env;
|
|
6
|
-
declare const WorkerEnvironment_base: Context.ServiceClass<WorkerEnvironment, "effect-cf/WorkerEnvironment", Cloudflare.Env>;
|
|
7
|
-
/**
|
|
8
|
-
* Context service for reading worker bindings from the current `env` object.
|
|
9
|
-
*/
|
|
10
|
-
declare class WorkerEnvironment extends WorkerEnvironment_base {}
|
|
11
|
-
type ScalarConfigValue = string | number | boolean;
|
|
12
|
-
type ScalarConfigKey = Extract<{ readonly [Key in keyof Cloudflare.Env]-?: NonNullable<Cloudflare.Env[Key]> extends ScalarConfigValue ? Key : never; }[keyof Cloudflare.Env], string>;
|
|
13
|
-
declare namespace WorkerConfig {
|
|
14
|
-
type Scalar = ScalarConfigValue;
|
|
15
|
-
type Key = ScalarConfigKey;
|
|
16
|
-
/** Read a scalar Cloudflare var or secret as a string. */
|
|
17
|
-
const string: <const Name extends Key>(name: Name) => Config.Config<string>;
|
|
18
|
-
/** Read a scalar Cloudflare secret as a redacted string. */
|
|
19
|
-
const redacted: <const Name extends Key>(name: Name) => Config.Config<import("effect/Redacted").Redacted<string>>;
|
|
20
|
-
/** Read a scalar Cloudflare var or secret as a number. */
|
|
21
|
-
const number: <const Name extends Key>(name: Name) => Config.Config<number>;
|
|
22
|
-
/** Read a scalar Cloudflare var or secret as an integer. */
|
|
23
|
-
const integer: <const Name extends Key>(name: Name) => Config.Config<number>;
|
|
24
|
-
/** Read a scalar Cloudflare var or secret as a boolean. */
|
|
25
|
-
const boolean: <const Name extends Key>(name: Name) => Config.Config<boolean>;
|
|
26
|
-
interface ProviderOptions {
|
|
27
|
-
/**
|
|
28
|
-
* Keep empty-string env values as explicit `""` config values.
|
|
29
|
-
*
|
|
30
|
-
* By default (absent or `false`), empty strings are treated as missing
|
|
31
|
-
* config, matching `ConfigProvider.fromEnvRecord`.
|
|
32
|
-
*/
|
|
33
|
-
readonly preserveEmptyStrings?: boolean;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Build a `ConfigProvider` from a Cloudflare worker `env` object.
|
|
37
|
-
*
|
|
38
|
-
* Scalar vars and secrets use Effect's environment-record semantics;
|
|
39
|
-
* Cloudflare binding objects are ignored.
|
|
40
|
-
*
|
|
41
|
-
* Empty-string values are treated as missing config by default; pass
|
|
42
|
-
* `{ preserveEmptyStrings: true }` to keep them as explicit values.
|
|
43
|
-
*/
|
|
44
|
-
const providerFromEnv: (env: WorkerEnv, options?: ProviderOptions) => ConfigProvider.ConfigProvider;
|
|
45
|
-
const providerWith: (makeProvider: (env: WorkerEnv) => ConfigProvider.ConfigProvider) => Effect.Effect<ConfigProvider.ConfigProvider, never, WorkerEnvironment>;
|
|
46
|
-
const provider: Effect.Effect<ConfigProvider.ConfigProvider, never, WorkerEnvironment>;
|
|
47
|
-
/**
|
|
48
|
-
* Replace the active Effect `ConfigProvider` with one backed by the current
|
|
49
|
-
* Cloudflare worker `env` object.
|
|
50
|
-
*/
|
|
51
|
-
const providerLayer: Layer.Layer<never, never, WorkerEnvironment>;
|
|
52
|
-
const layerWith: (makeProvider: (env: WorkerEnv) => ConfigProvider.ConfigProvider) => Layer.Layer<never, never, WorkerEnvironment>;
|
|
53
|
-
}
|
|
54
|
-
declare namespace Binding_d_exports {
|
|
55
|
-
export { BindingNotFoundError, BindingService, BindingValidationError, Service, TypeId, ValidationOptions, layer };
|
|
56
|
-
}
|
|
57
|
-
declare const TypeId: "~effect-cf/Binding";
|
|
58
|
-
type TypeId = typeof TypeId;
|
|
59
|
-
declare const BindingNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
60
|
-
readonly _tag: "BindingNotFoundError";
|
|
61
|
-
} & Readonly<A>;
|
|
62
|
-
/** Error raised when a configured binding does not exist on `env`. */
|
|
63
|
-
declare class BindingNotFoundError extends BindingNotFoundError_base<{
|
|
64
|
-
readonly binding: string;
|
|
65
|
-
readonly message: string;
|
|
66
|
-
}> {}
|
|
67
|
-
declare const BindingValidationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
68
|
-
readonly _tag: "BindingValidationError";
|
|
69
|
-
} & Readonly<A>;
|
|
70
|
-
/** Error raised when a binding exists but does not match the expected shape. */
|
|
71
|
-
declare class BindingValidationError extends BindingValidationError_base<{
|
|
72
|
-
readonly binding: string;
|
|
73
|
-
readonly expected: string;
|
|
74
|
-
readonly actual: string;
|
|
75
|
-
readonly message: string;
|
|
76
|
-
}> {}
|
|
77
|
-
interface ValidationOptions {
|
|
78
|
-
readonly expected?: string;
|
|
79
|
-
}
|
|
80
|
-
type BindingCandidate = Parameters<typeof Predicate.isUnknown>[0];
|
|
81
|
-
interface BindingService<Self, Id extends string, Service> extends Context.ServiceClass<Self, `effect-cf/Binding/${Id}`, Service> {
|
|
82
|
-
readonly [TypeId]: TypeId;
|
|
83
|
-
readonly id: Id;
|
|
84
|
-
readonly binding: string;
|
|
85
|
-
readonly layer: Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
86
|
-
}
|
|
87
|
-
declare function layer<Self, Resource>(tag: Context.Service<Self, Resource>, binding: string, isResource: (value: BindingCandidate) => value is Resource, wrap?: undefined, options?: ValidationOptions): Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
88
|
-
declare function layer<Self, Resource, Service>(tag: Context.Service<Self, Service>, binding: string, isResource: (value: BindingCandidate) => value is Resource, wrap: (resource: Resource) => Service, options?: ValidationOptions): Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
89
|
-
declare const Service: <Self>() => {
|
|
90
|
-
<Id extends string, Resource>(id: Id, binding: string, isResource: (value: BindingCandidate) => value is Resource, wrap?: undefined, options?: ValidationOptions): BindingService<Self, Id, Resource>;
|
|
91
|
-
<Id extends string, Resource, Service>(id: Id, binding: string, isResource: (value: BindingCandidate) => value is Resource, wrap: (resource: Resource) => Service, options?: ValidationOptions): BindingService<Self, Id, Service>;
|
|
92
|
-
};
|
|
93
|
-
//#endregion
|
|
94
|
-
export { Environment_d_exports as a, WorkerEnvironment as c, Binding_d_exports as i, BindingService as n, WorkerConfig as o, BindingValidationError as r, WorkerEnv as s, BindingNotFoundError as t };
|