effect-cf 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +8 -6
- package/dist/{Artifacts-DcoXcRP5.d.mts → Artifacts-DnHQA-Ax.d.mts} +42 -25
- package/dist/Artifacts-rq3hUKQE.mjs +257 -0
- package/dist/{Binding-COCtoJXa.d.mts → Binding-xJJJPmiD.d.mts} +6 -5
- package/dist/ComputerArtifacts.d.mts +55 -0
- package/dist/ComputerArtifacts.mjs +95 -0
- package/dist/ComputerWorkspace.d.mts +279 -0
- package/dist/ComputerWorkspace.mjs +577 -0
- package/dist/ComputerWorkspaceHost.d.mts +1 -1
- package/dist/ComputerWorkspaceHost.mjs +18 -16
- package/dist/{WorkflowBinding-D5iWzCUa.d.mts → DurableObjectState-B3uFY1eM.d.mts} +90 -141
- package/dist/{DurableObjectState-CEh0DVw7.mjs → DurableObjectState-BjkK2kwH.mjs} +4 -49
- package/dist/ErrorMessage-BM0K-Nik.mjs +46 -0
- package/dist/{Hyperdrive-6p59yyVk.d.mts → Hyperdrive-z-9fFz15.d.mts} +2 -2
- package/dist/HyperdrivePg.d.mts +2 -2
- package/dist/Vitest.d.mts +6 -4
- package/dist/Vitest.mjs +2 -1
- package/dist/WorkflowBinding-wZ-yGHow.d.mts +74 -0
- package/dist/index.d.mts +92 -398
- package/dist/index.mjs +323 -1105
- package/package.json +12 -1
- package/src/AiGateway.ts +62 -7
- package/src/AnalyticsEngine.ts +17 -13
- package/src/Artifacts.ts +111 -47
- package/src/Binding.ts +34 -23
- package/src/BrowserRendering.ts +72 -33
- package/src/CloudflareOtlp.ts +8 -5
- package/src/ComputerArtifacts.ts +17 -9
- package/src/ComputerWorkspace.ts +202 -98
- package/src/ComputerWorkspaceHost.ts +55 -27
- package/src/ContainerNamespace.ts +8 -9
- package/src/D1.ts +8 -14
- package/src/DurableObject.ts +27 -11
- package/src/DurableObjectAlarm.ts +17 -5
- package/src/DurableObjectDefinition.ts +89 -72
- package/src/DurableObjectNamespace.ts +26 -12
- package/src/DurableObjectRpcWebSocket.ts +9 -10
- package/src/DurableObjectState.ts +1 -0
- package/src/DurableObjectStorage.ts +5 -2
- package/src/DurableObjectWebSocket.ts +4 -1
- package/src/Email.ts +26 -25
- package/src/Hyperdrive.ts +4 -10
- package/src/Images.ts +12 -14
- package/src/Kv.ts +15 -17
- package/src/Queue.ts +2 -1
- package/src/QueueBinding.ts +7 -12
- package/src/QueueDefinition.ts +7 -2
- package/src/R2.ts +33 -24
- package/src/Rpc.ts +15 -21
- package/src/RpcDefinition.ts +33 -38
- package/src/ServiceBinding.ts +26 -8
- package/src/Vectorize.ts +45 -18
- package/src/Vitest.ts +9 -3
- package/src/WebTransport.ts +11 -5
- package/src/Worker.ts +91 -21
- package/src/WorkerDefinition.ts +143 -63
- package/src/WorkersAi.ts +50 -28
- package/src/Workflow.ts +66 -13
- package/src/WorkflowBinding.ts +18 -25
- package/src/WorkflowDefinition.ts +4 -2
- package/src/index.ts +0 -2
- package/src/internal/Entrypoint.ts +29 -13
- package/src/internal/ErrorMessage.ts +7 -6
- package/src/internal/RpcInvocation.ts +34 -11
- package/src/internal/Runtime.ts +33 -22
- package/src/internal/WorkerContext.ts +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import { a as Environment_d_exports, c as WorkerEnvironment, i as Binding_d_exports, n as BindingService, o as WorkerConfig, r as BindingValidationError, s as WorkerEnv, t as BindingNotFoundError } from "./Binding-
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { a as Environment_d_exports, c as WorkerEnvironment, i as Binding_d_exports, n as BindingService, o as WorkerConfig, r as BindingValidationError, s as WorkerEnv, t as BindingNotFoundError } from "./Binding-xJJJPmiD.mjs";
|
|
2
|
+
import { l as Artifacts_d_exports } from "./Artifacts-DnHQA-Ax.mjs";
|
|
3
|
+
import { C as Rpc_d_exports, D as StorageOperationError, E as DurableObjectStorage_d_exports, S as Provider, T as DurableWebSocket, _ as Definition$4, a as NativeRequest, b as RpcDefinition_d_exports, c as WorkerDefinition_d_exports, d as AsyncMethodCloudflareReturn, f as AsyncMethodKey, g as QueueBinding_d_exports, h as QueueDefinition_d_exports, i as ExecutionContext, l as ServiceBinding_d_exports, m as Queue_d_exports, o as WorkerContext, p as AsyncMethodSuccess, r as DurableObjectState_d_exports, s as Worker_d_exports, t as DurableObjectState, u as AsyncMethodArgs, v as Method$2, w as DurableObjectWebSocket_d_exports, x as ServiceFreeSchema$1, y as ReservedMethodName$2 } from "./DurableObjectState-B3uFY1eM.mjs";
|
|
4
|
+
import { t as Hyperdrive_d_exports } from "./Hyperdrive-z-9fFz15.mjs";
|
|
5
|
+
import { a as WorkflowInstanceCreateOptions, i as WorkflowInstanceCreateBatchOptions, n as WorkflowBinding_d_exports, r as WorkflowInstance, s as WorkflowOperationError, t as WorkflowBindingClient } from "./WorkflowBinding-wZ-yGHow.mjs";
|
|
6
|
+
import { Cause, Config, Context, Data, DateTime, Duration, Effect, Layer, Option, Predicate, Redacted, Schema, Scope } from "effect";
|
|
6
7
|
import { Headers as Headers$1, HttpClient, HttpClientResponse } from "effect/unstable/http";
|
|
7
|
-
import { OtlpExporter } from "effect/unstable/observability";
|
|
8
|
+
import { OtlpExporter, OtlpResource } from "effect/unstable/observability";
|
|
8
9
|
import { D1Client } from "@effect/sql-d1";
|
|
9
10
|
import { DurableObject, WorkflowEntrypoint, WorkflowEvent, WorkflowSleepDuration, WorkflowStep, WorkflowStepConfig, WorkflowStepContext, WorkflowStepEvent, WorkflowTimeoutDuration } from "cloudflare:workers";
|
|
10
11
|
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
11
12
|
import * as RpcServer from "effect/unstable/rpc/RpcServer";
|
|
12
13
|
import { SqliteClient } from "@effect/sql-sqlite-do";
|
|
13
|
-
import { CommitView, GitClient, GitCloneOptions, GitCommitOptions, GitDiffOptions, GitFetchOptions, GitLogOptions, GitUpdateRefOptions } from "@cloudflare/computer/git";
|
|
14
|
-
import { ExecSyncResult, RuntimeExecOptions, RuntimeGetOptions, RuntimeKillOptions, ShellValue, SkippedEntry, ThinkWorkspaceCompatibility, WorkspaceClient, WorkspaceRuntimeResult, WorkspaceRuntimeValue } from "@cloudflare/computer";
|
|
15
14
|
import { SqlClient } from "effect/unstable/sql";
|
|
16
15
|
import * as Tracer from "effect/Tracer";
|
|
17
|
-
import { ArtifactClient, ArtifactImportOptions, ArtifactImportSource, ArtifactRepoSummary, ArtifactScope, ArtifactsCLIInput, ArtifactsCLIResult, RemoteAddFn } from "@cloudflare/computer/artifacts";
|
|
18
|
-
import { ShareOptions } from "@cloudflare/computer/assets";
|
|
19
16
|
declare namespace WorkersAi_d_exports {
|
|
20
|
-
export { LayerOptions$14 as LayerOptions, Tag$13 as Tag, TagClass$12 as TagClass, WorkersAiAsyncBatchResponse, WorkersAiBinding, WorkersAiClient, WorkersAiDefinition, WorkersAiEmbeddingInput, WorkersAiEmbeddingResponse, WorkersAiModelsSearchObject, WorkersAiModelsSearchParams, WorkersAiOperationError, WorkersAiOptions, WorkersAiService, embeddingResponse, isWorkersAiBinding, layer$14 as layer, make$13 as make, makeClient$
|
|
17
|
+
export { LayerOptions$14 as LayerOptions, Tag$13 as Tag, TagClass$12 as TagClass, WorkersAiAsyncBatchResponse, WorkersAiBinding, WorkersAiClient, WorkersAiDefinition, WorkersAiEmbeddingInput, WorkersAiEmbeddingResponse, WorkersAiModelsSearchObject, WorkersAiModelsSearchParams, WorkersAiOperationError, WorkersAiOptions, WorkersAiService, embeddingResponse, isWorkersAiBinding, layer$14 as layer, make$13 as make, makeClient$11 as makeClient };
|
|
21
18
|
}
|
|
22
19
|
declare const WorkersAiOperationError_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 & {
|
|
23
20
|
readonly _tag: "WorkersAiOperationError";
|
|
@@ -40,10 +37,11 @@ type WorkersAiOptions = AiOptions;
|
|
|
40
37
|
type WorkersAiModelsSearchParams = AiModelsSearchParams;
|
|
41
38
|
type WorkersAiModelsSearchObject = AiModelsSearchObject;
|
|
42
39
|
type WorkersAiAsyncBatchResponse = AiAsyncBatchResponse;
|
|
43
|
-
type WorkersAiEmbeddingInput = AiTextEmbeddingsInput | Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input |
|
|
40
|
+
type WorkersAiEmbeddingInput = AiTextEmbeddingsInput | Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input | Parameters<WorkersAiBinding["run"]>[1];
|
|
41
|
+
declare const embeddingDimensionsKey = "shape";
|
|
44
42
|
interface WorkersAiEmbeddingResponse {
|
|
45
43
|
readonly data: ReadonlyArray<ReadonlyArray<number>>;
|
|
46
|
-
readonly
|
|
44
|
+
readonly [embeddingDimensionsKey]: ReadonlyArray<number>;
|
|
47
45
|
}
|
|
48
46
|
interface WorkersAiClient<ModelList extends AiModelListType = AiModels> {
|
|
49
47
|
readonly aiGatewayLogId: Effect.Effect<string | null, WorkersAiOperationError>;
|
|
@@ -63,7 +61,7 @@ interface WorkersAiClient<ModelList extends AiModelListType = AiModels> {
|
|
|
63
61
|
readonly stream: true;
|
|
64
62
|
}, options?: WorkersAiOptions): Effect.Effect<ReadableStream, WorkersAiOperationError>;
|
|
65
63
|
<Name extends keyof ModelList>(model: Name, input: ModelList[Name]["inputs"], options?: WorkersAiOptions): Effect.Effect<ModelList[Name]["postProcessedOutputs"], WorkersAiOperationError>;
|
|
66
|
-
<Input extends
|
|
64
|
+
<Input extends Parameters<WorkersAiBinding["run"]>[1], Output = Awaited<ReturnType<WorkersAiBinding["run"]>>>(model: string, input: Input, options?: WorkersAiOptions): Effect.Effect<Output, WorkersAiOperationError>;
|
|
67
65
|
};
|
|
68
66
|
readonly runEmbedding: <Input extends WorkersAiEmbeddingInput>(model: string, input: Input, options?: WorkersAiOptions) => Effect.Effect<WorkersAiEmbeddingResponse, WorkersAiOperationError>;
|
|
69
67
|
readonly models: (params?: WorkersAiModelsSearchParams) => Effect.Effect<ReadonlyArray<WorkersAiModelsSearchObject>, WorkersAiOperationError>;
|
|
@@ -85,17 +83,18 @@ interface TagClass$12<Self, Id extends string, ModelList extends AiModelListType
|
|
|
85
83
|
readonly id: Id;
|
|
86
84
|
readonly layer: (options: LayerOptions$14) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
87
85
|
}
|
|
88
|
-
|
|
86
|
+
type WorkersAiBindingValue = Schema.Schema.Type<typeof Schema.Unknown>;
|
|
87
|
+
declare const isWorkersAiBinding: (value: WorkersAiBindingValue) => value is WorkersAiBinding;
|
|
89
88
|
declare const embeddingResponse: (value: {
|
|
90
89
|
readonly data?: ReadonlyArray<ReadonlyArray<number>>;
|
|
91
|
-
readonly
|
|
90
|
+
readonly [embeddingDimensionsKey]?: ReadonlyArray<number>;
|
|
92
91
|
}) => WorkersAiEmbeddingResponse;
|
|
93
|
-
declare const makeClient$
|
|
92
|
+
declare const makeClient$11: <ModelList extends AiModelListType = AiModels>(definition: WorkersAiDefinition) => (ai: WorkersAiBinding<ModelList>) => WorkersAiClient<ModelList>;
|
|
94
93
|
declare const layer$14: <Self, ModelList extends AiModelListType = AiModels>(tag: Context.Service<Self, WorkersAiClient<ModelList>>, definition: WorkersAiDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
95
94
|
declare const make$13: <Id extends string>(id: Id) => TagClass$12<WorkersAiService<Id>, Id, AiModels>;
|
|
96
95
|
declare const Tag$13: <Self>() => <Id extends string, ModelList extends AiModelListType = AiModels>(id: Id) => TagClass$12<Self, Id, ModelList>;
|
|
97
96
|
declare namespace AiGateway_d_exports {
|
|
98
|
-
export { AiGatewayBinding, AiGatewayClient, AiGatewayDefinition, AiGatewayFetchOptions, AiGatewayHeaders, AiGatewayLog, AiGatewayOperationError, AiGatewayPatchLog, AiGatewayProvider, AiGatewayRunOptions, AiGatewayService, AiGatewayUniversalRequest, LayerOptions$13 as LayerOptions, Tag$12 as Tag, TagClass$11 as TagClass, isAiGatewayBinding, layer$13 as layer, make$12 as make, makeClient$
|
|
97
|
+
export { AiGatewayBinding, AiGatewayClient, AiGatewayDefinition, AiGatewayFetchOptions, AiGatewayHeaders, AiGatewayLog, AiGatewayOperationError, AiGatewayPatchLog, AiGatewayProvider, AiGatewayRunOptions, AiGatewayService, AiGatewayUniversalRequest, LayerOptions$13 as LayerOptions, Tag$12 as Tag, TagClass$11 as TagClass, isAiGatewayBinding, layer$13 as layer, make$12 as make, makeClient$10 as makeClient, makeClientFromAi, makeHttpClient };
|
|
99
98
|
}
|
|
100
99
|
declare const AiGatewayOperationError_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 & {
|
|
101
100
|
readonly _tag: "AiGatewayOperationError";
|
|
@@ -125,6 +124,7 @@ type AiGatewayProvider = NonNullable<Parameters<AiGatewayBinding["getUrl"]>[0]>;
|
|
|
125
124
|
type AiGatewayUniversalRequest = Exclude<AiGatewayRunData, ReadonlyArray<unknown>>;
|
|
126
125
|
type AiGatewayHeaders = NonNullable<AiGatewayUniversalRequest["headers"]>;
|
|
127
126
|
type AiGatewayRunOptions = Parameters<CloudflareAiGateway["run"]>[1];
|
|
127
|
+
type AiGatewayBindingCandidate = Parameters<typeof isWorkersAiBinding>[0];
|
|
128
128
|
interface AiGatewayFetchOptions {
|
|
129
129
|
readonly provider?: AiGatewayProvider;
|
|
130
130
|
readonly path?: string;
|
|
@@ -155,8 +155,8 @@ interface TagClass$11<Self, Id extends string> extends Context.ServiceClass<Self
|
|
|
155
155
|
readonly id: Id;
|
|
156
156
|
readonly layer: (options: LayerOptions$13) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError | AiGatewayOperationError, WorkerEnvironment>;
|
|
157
157
|
}
|
|
158
|
-
declare const isAiGatewayBinding: (value:
|
|
159
|
-
declare const makeClient$
|
|
158
|
+
declare const isAiGatewayBinding: (value: AiGatewayBindingCandidate) => value is WorkersAiBinding;
|
|
159
|
+
declare const makeClient$10: (definition: AiGatewayDefinition, gateway: AiGatewayBinding) => {
|
|
160
160
|
definition: AiGatewayDefinition;
|
|
161
161
|
run: (data: import("@cloudflare/workers-types").AIGatewayUniversalRequest | readonly import("@cloudflare/workers-types").AIGatewayUniversalRequest[], options?: {
|
|
162
162
|
gateway?: import("@cloudflare/workers-types").UniversalGatewayOptions;
|
|
@@ -178,7 +178,7 @@ declare const layer$13: <Self>(tag: Context.Service<Self, AiGatewayClient>, defi
|
|
|
178
178
|
declare const make$12: <Id extends string>(id: Id) => TagClass$11<AiGatewayService<Id>, Id>;
|
|
179
179
|
declare const Tag$12: <Self>() => <Id extends string>(id: Id) => TagClass$11<Self, Id>;
|
|
180
180
|
declare namespace AnalyticsEngine_d_exports {
|
|
181
|
-
export { AnalyticsEngineBinding, AnalyticsEngineClient, AnalyticsEngineDataPoint, AnalyticsEngineDataPointSchema, AnalyticsEngineDefinition, AnalyticsEngineFieldValue, AnalyticsEngineFieldValueSchema, AnalyticsEngineInvalidWritePolicy, AnalyticsEngineOperationError, AnalyticsEngineQueryClient, AnalyticsEngineQueryColumn, AnalyticsEngineQueryDefinition, AnalyticsEngineQueryError, AnalyticsEngineQueryOptions, AnalyticsEngineQueryResult, AnalyticsEngineQueryRow, AnalyticsEngineQueryService, AnalyticsEngineService, AnalyticsEngineWriteError, AnalyticsEngineWriteOptions, AnalyticsEngineWritePolicy, AnalyticsEngineWriteValidationError, AnalyticsEngineWriteViolation, LayerOptions$12 as LayerOptions, QueryConfigOptions, QueryTag, QueryTagClass, Tag$11 as Tag, TagClass$10 as TagClass, isAnalyticsEngineDataset, layer$12 as layer, layerFetch, layerFetchConfig, make$11 as make, makeClient$
|
|
181
|
+
export { AnalyticsEngineBinding, AnalyticsEngineClient, AnalyticsEngineDataPoint, AnalyticsEngineDataPointSchema, AnalyticsEngineDefinition, AnalyticsEngineFieldValue, AnalyticsEngineFieldValueSchema, AnalyticsEngineInvalidWritePolicy, AnalyticsEngineOperationError, AnalyticsEngineQueryClient, AnalyticsEngineQueryColumn, AnalyticsEngineQueryDefinition, AnalyticsEngineQueryError, AnalyticsEngineQueryOptions, AnalyticsEngineQueryResult, AnalyticsEngineQueryRow, AnalyticsEngineQueryService, AnalyticsEngineService, AnalyticsEngineWriteError, AnalyticsEngineWriteOptions, AnalyticsEngineWritePolicy, AnalyticsEngineWriteValidationError, AnalyticsEngineWriteViolation, LayerOptions$12 as LayerOptions, QueryConfigOptions, QueryTag, QueryTagClass, Tag$11 as Tag, TagClass$10 as TagClass, isAnalyticsEngineDataset, layer$12 as layer, layerFetch, layerFetchConfig, make$11 as make, makeClient$9 as makeClient, makeQuery, makeQueryClient, queryConfig, queryLayer, queryLayerConfig, writeLimits };
|
|
182
182
|
}
|
|
183
183
|
declare const writeLimits: {
|
|
184
184
|
readonly maxBlobs: 20;
|
|
@@ -327,8 +327,8 @@ interface QueryTagClass<Self, Id extends string> extends Context.ServiceClass<Se
|
|
|
327
327
|
readonly layerFetchConfig: (config?: Config.Config<AnalyticsEngineQueryDefinition>) => Layer.Layer<Self, Config.ConfigError>;
|
|
328
328
|
}
|
|
329
329
|
declare const makeQueryClient: (definition: AnalyticsEngineQueryDefinition) => Effect.Effect<AnalyticsEngineQueryClient, never, HttpClient.HttpClient>;
|
|
330
|
-
declare const isAnalyticsEngineDataset: (value:
|
|
331
|
-
declare const makeClient$
|
|
330
|
+
declare const isAnalyticsEngineDataset: <Candidate>(value: Candidate) => value is Candidate & AnalyticsEngineBinding;
|
|
331
|
+
declare const makeClient$9: (definition: AnalyticsEngineDefinition, defaults?: AnalyticsEngineWritePolicy) => (dataset: AnalyticsEngineBinding) => AnalyticsEngineClient;
|
|
332
332
|
declare const queryConfig: (options?: QueryConfigOptions) => Config.Config<{
|
|
333
333
|
accountId: string;
|
|
334
334
|
apiToken: Redacted.Redacted<string>;
|
|
@@ -344,7 +344,7 @@ declare const makeQuery: <Id extends string>(id: Id) => QueryTagClass<AnalyticsE
|
|
|
344
344
|
declare const Tag$11: <Self>() => <Id extends string>(id: Id) => TagClass$10<Self, Id>;
|
|
345
345
|
declare const QueryTag: <Self>() => <Id extends string>(id: Id) => QueryTagClass<Self, Id>;
|
|
346
346
|
declare namespace BrowserRendering_d_exports {
|
|
347
|
-
export { BrowserRenderingBinding, BrowserRenderingBrowserClient, BrowserRenderingBrowserLike, BrowserRenderingClient, BrowserRenderingConnect, BrowserRenderingDefinition, BrowserRenderingLaunch, BrowserRenderingOperationError, BrowserRenderingPageClient, BrowserRenderingPageLike, BrowserRenderingService, LayerOptions$11 as LayerOptions, Tag$10 as Tag, TagClass$9 as TagClass, isBrowserRenderingBinding, layer$11 as layer, make$10 as make, makeClient$
|
|
347
|
+
export { BrowserRenderingBinding, BrowserRenderingBrowserClient, BrowserRenderingBrowserLike, BrowserRenderingClient, BrowserRenderingConnect, BrowserRenderingDefinition, BrowserRenderingExternalResult, BrowserRenderingLaunch, BrowserRenderingMethodOptions, BrowserRenderingOperationError, BrowserRenderingPageClient, BrowserRenderingPageFunction, BrowserRenderingPageLike, BrowserRenderingService, LayerOptions$11 as LayerOptions, Tag$10 as Tag, TagClass$9 as TagClass, isBrowserRenderingBinding, layer$11 as layer, make$10 as make, makeClient$8 as makeClient };
|
|
348
348
|
}
|
|
349
349
|
declare const BrowserRenderingOperationError_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 & {
|
|
350
350
|
readonly _tag: "BrowserRenderingOperationError";
|
|
@@ -363,6 +363,9 @@ interface BrowserRenderingDefinition {
|
|
|
363
363
|
readonly binding: string;
|
|
364
364
|
}
|
|
365
365
|
type BrowserRenderingBinding = object;
|
|
366
|
+
interface BrowserRenderingMethodOptions {}
|
|
367
|
+
type BrowserRenderingExternalResult = Awaited<ReturnType<Response["json"]>>;
|
|
368
|
+
type BrowserRenderingPageFunction = string | Function;
|
|
366
369
|
type BrowserRenderingLaunch<RawBinding, Browser, LaunchOptions = unknown> = (binding: RawBinding, options?: LaunchOptions) => Promise<Browser>;
|
|
367
370
|
type BrowserRenderingConnect<RawBinding, Browser, ConnectOptions = unknown> = (binding: RawBinding, options?: ConnectOptions) => Promise<Browser>;
|
|
368
371
|
interface BrowserRenderingBrowserLike<Page = BrowserRenderingPageLike> {
|
|
@@ -372,22 +375,22 @@ interface BrowserRenderingBrowserLike<Page = BrowserRenderingPageLike> {
|
|
|
372
375
|
readonly version?: () => Promise<string>;
|
|
373
376
|
}
|
|
374
377
|
interface BrowserRenderingPageLike {
|
|
375
|
-
readonly goto?: (url: string, options?:
|
|
376
|
-
readonly setContent?: (html: string, options?:
|
|
378
|
+
readonly goto?: (url: string, options?: BrowserRenderingMethodOptions) => Promise<BrowserRenderingExternalResult>;
|
|
379
|
+
readonly setContent?: (html: string, options?: BrowserRenderingMethodOptions) => Promise<void>;
|
|
377
380
|
readonly content?: () => Promise<string>;
|
|
378
|
-
readonly screenshot?: (options?:
|
|
379
|
-
readonly pdf?: (options?:
|
|
380
|
-
readonly evaluate?: (pageFunction:
|
|
381
|
-
readonly close?: (options?:
|
|
381
|
+
readonly screenshot?: (options?: BrowserRenderingMethodOptions) => Promise<Uint8Array | string>;
|
|
382
|
+
readonly pdf?: (options?: BrowserRenderingMethodOptions) => Promise<Uint8Array>;
|
|
383
|
+
readonly evaluate?: (pageFunction: BrowserRenderingPageFunction, ...args: ReadonlyArray<unknown>) => Promise<BrowserRenderingExternalResult>;
|
|
384
|
+
readonly close?: (options?: BrowserRenderingMethodOptions) => Promise<void>;
|
|
382
385
|
}
|
|
383
386
|
interface BrowserRenderingPageClient<Page extends BrowserRenderingPageLike> {
|
|
384
387
|
readonly raw: Page;
|
|
385
388
|
readonly goto: (url: string, options?: Parameters<NonNullable<Page["goto"]>>[1]) => Effect.Effect<Awaited<ReturnType<NonNullable<Page["goto"]>>>, BrowserRenderingOperationError>;
|
|
386
389
|
readonly setContent: (html: string, options?: Parameters<NonNullable<Page["setContent"]>>[1]) => Effect.Effect<void, BrowserRenderingOperationError>;
|
|
387
390
|
readonly content: Effect.Effect<string, BrowserRenderingOperationError>;
|
|
388
|
-
readonly screenshot:
|
|
389
|
-
readonly pdf:
|
|
390
|
-
readonly evaluate:
|
|
391
|
+
readonly screenshot: (options?: Parameters<NonNullable<Page["screenshot"]>>[0]) => Effect.Effect<Awaited<ReturnType<NonNullable<Page["screenshot"]>>>, BrowserRenderingOperationError>;
|
|
392
|
+
readonly pdf: (options?: Parameters<NonNullable<Page["pdf"]>>[0]) => Effect.Effect<Awaited<ReturnType<NonNullable<Page["pdf"]>>>, BrowserRenderingOperationError>;
|
|
393
|
+
readonly evaluate: (pageFunction: Parameters<NonNullable<Page["evaluate"]>>[0], ...args: ReadonlyArray<unknown>) => Effect.Effect<Awaited<ReturnType<NonNullable<Page["evaluate"]>>>, BrowserRenderingOperationError>;
|
|
391
394
|
readonly close: (options?: Parameters<NonNullable<Page["close"]>>[0]) => Effect.Effect<void, BrowserRenderingOperationError>;
|
|
392
395
|
}
|
|
393
396
|
interface BrowserRenderingBrowserClient<Browser extends BrowserRenderingBrowserLike<Page>, Page extends BrowserRenderingPageLike> {
|
|
@@ -417,13 +420,13 @@ interface TagClass$9<Self, Id extends string> extends Context.ServiceClass<Self,
|
|
|
417
420
|
readonly id: Id;
|
|
418
421
|
readonly layer: (options: LayerOptions$11) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
419
422
|
}
|
|
420
|
-
declare const isBrowserRenderingBinding: (value:
|
|
421
|
-
declare const makeClient$
|
|
423
|
+
declare const isBrowserRenderingBinding: <Candidate>(value: Candidate) => value is Candidate & BrowserRenderingBinding;
|
|
424
|
+
declare const makeClient$8: <RawBinding extends BrowserRenderingBinding = BrowserRenderingBinding>(definition: BrowserRenderingDefinition) => (binding: RawBinding) => BrowserRenderingClient<RawBinding>;
|
|
422
425
|
declare const layer$11: <Self>(tag: Context.Service<Self, BrowserRenderingClient>, definition: BrowserRenderingDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
423
426
|
declare const make$10: <Id extends string>(id: Id) => TagClass$9<BrowserRenderingService<Id>, Id>;
|
|
424
427
|
declare const Tag$10: <Self>() => <Id extends string>(id: Id) => TagClass$9<Self, Id>;
|
|
425
428
|
declare namespace Cache_d_exports {
|
|
426
|
-
export { CacheClient, CacheOperation, CacheOperationError, CacheQueryOptions, CacheRequest, CacheStorage, CacheStorageClient, layer$10 as layer, layerFrom, makeCacheClient, makeClient$
|
|
429
|
+
export { CacheClient, CacheOperation, CacheOperationError, CacheQueryOptions, CacheRequest, CacheStorage, CacheStorageClient, layer$10 as layer, layerFrom, makeCacheClient, makeClient$7 as makeClient };
|
|
427
430
|
}
|
|
428
431
|
/** Request key accepted by Cloudflare's Cache API. */
|
|
429
432
|
type CacheRequest = CloudflareRequestInfo | URL;
|
|
@@ -470,7 +473,7 @@ declare class CacheStorage extends CacheStorage_base {}
|
|
|
470
473
|
/** Wraps a native Cloudflare `Cache` instance. */
|
|
471
474
|
declare const makeCacheClient: (cache: CloudflareCache, name?: string) => CacheClient;
|
|
472
475
|
/** Wraps a native Cloudflare `CacheStorage` instance. */
|
|
473
|
-
declare const makeClient$
|
|
476
|
+
declare const makeClient$7: (storage: CloudflareCacheStorage) => CacheStorageClient;
|
|
474
477
|
/** Provides Cache API services from an explicit native `CacheStorage` instance. */
|
|
475
478
|
declare const layerFrom: (storage: CloudflareCacheStorage) => Layer.Layer<CacheStorage>;
|
|
476
479
|
/** Provides Cache API services from Cloudflare's global `caches` object. */
|
|
@@ -478,6 +481,7 @@ declare const layer$10: Layer.Layer<CacheStorage>;
|
|
|
478
481
|
declare namespace CloudflareOtlp_d_exports {
|
|
479
482
|
export { DurableObjectLayerOptions, LayerOptions$10 as LayerOptions, ResourceOptions, Serialization, Signal, WorkerLayerOptions, layer$9 as layer, layerDurableObject, layerJson, layerProtobuf, layerWorker };
|
|
480
483
|
}
|
|
484
|
+
type ResourceAttributes = NonNullable<Parameters<typeof OtlpResource.make>[0]["attributes"]>;
|
|
481
485
|
/** Telemetry signal groups supported by the Cloudflare OTLP layers. */
|
|
482
486
|
type Signal = "logs" | "traces" | "metrics";
|
|
483
487
|
/** OTLP payload serialization used by the Effect OTLP exporters. */
|
|
@@ -497,7 +501,7 @@ interface ResourceOptions {
|
|
|
497
501
|
/** Explicit service version. Takes precedence over OTEL environment variables. */
|
|
498
502
|
readonly serviceVersion?: string;
|
|
499
503
|
/** Additional resource attributes attached to exported telemetry. */
|
|
500
|
-
readonly attributes?:
|
|
504
|
+
readonly attributes?: ResourceAttributes;
|
|
501
505
|
}
|
|
502
506
|
/** Options shared by all Cloudflare OTLP telemetry layers. */
|
|
503
507
|
interface LayerOptions$10 {
|
|
@@ -573,331 +577,6 @@ declare const layerWorker: (options?: WorkerLayerOptions) => Layer.Layer<OtlpExp
|
|
|
573
577
|
* backend can tolerate high-cardinality resource attributes.
|
|
574
578
|
*/
|
|
575
579
|
declare const layerDurableObject: (options?: DurableObjectLayerOptions) => Layer.Layer<OtlpExporter.Flusher, never, DurableObjectState>;
|
|
576
|
-
declare namespace ComputerArtifacts_d_exports {
|
|
577
|
-
export { ComputerArtifactImportOptions, ComputerArtifactImportSource, ComputerArtifactRepoSummary, ComputerArtifactScope, ComputerArtifactsCliInput, ComputerArtifactsCliResult, ComputerArtifactsClient, ComputerArtifactsClientOptions, ComputerArtifactsRemoteAdd, fromClient, makeClient$7 as makeClient };
|
|
578
|
-
}
|
|
579
|
-
/** External Git source accepted by a session-scoped repository import. */
|
|
580
|
-
type ComputerArtifactImportSource = Readonly<ArtifactImportSource>;
|
|
581
|
-
/** Target options accepted by a session-scoped repository import. */
|
|
582
|
-
type ComputerArtifactImportOptions = Readonly<ArtifactImportOptions>;
|
|
583
|
-
/** Repository metadata returned by a session-scoped list operation. */
|
|
584
|
-
type ComputerArtifactRepoSummary = Readonly<ArtifactRepoSummary>;
|
|
585
|
-
/** Token scope accepted by the upstream session facade. */
|
|
586
|
-
type ComputerArtifactScope = ArtifactScope;
|
|
587
|
-
/** Optional Git remote-registration seam accepted by the argv API. */
|
|
588
|
-
type ComputerArtifactsRemoteAdd = RemoteAddFn;
|
|
589
|
-
/** Input to the session-scoped `artifacts` argv API. */
|
|
590
|
-
type ComputerArtifactsCliInput = ArtifactsCLIInput;
|
|
591
|
-
/** Result from the session-scoped `artifacts` argv API. */
|
|
592
|
-
type ComputerArtifactsCliResult = Readonly<ArtifactsCLIResult>;
|
|
593
|
-
/** Options used when wrapping a session-scoped Artifacts client. */
|
|
594
|
-
interface ComputerArtifactsClientOptions {
|
|
595
|
-
/** Binding name attached to errors and tracing spans. Defaults to `ARTIFACTS`. */
|
|
596
|
-
readonly binding?: string;
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* Effect-native facade over `@cloudflare/computer/artifacts`.
|
|
600
|
-
*
|
|
601
|
-
* Repository names are local to {@link sessionId}. Prefixing and filtering are
|
|
602
|
-
* intentionally delegated to the upstream `createArtifact` implementation so
|
|
603
|
-
* this client and the worker-shell `artifacts` command always use the same
|
|
604
|
-
* namespace convention.
|
|
605
|
-
*/
|
|
606
|
-
interface ComputerArtifactsClient {
|
|
607
|
-
readonly sessionId: string;
|
|
608
|
-
readonly create: (name: RepoName, options?: ArtifactsCreateOptions) => Effect.Effect<ArtifactsCreateRepoResult, ArtifactsOperationError>;
|
|
609
|
-
readonly get: (name: RepoName) => Effect.Effect<ArtifactsRepoInfo, ArtifactsOperationError>;
|
|
610
|
-
readonly list: Effect.Effect<ReadonlyArray<ComputerArtifactRepoSummary>, ArtifactsOperationError>;
|
|
611
|
-
readonly import: (name: RepoName, source: ComputerArtifactImportSource, options?: ComputerArtifactImportOptions) => Effect.Effect<ArtifactsCreateRepoResult, ArtifactsOperationError>;
|
|
612
|
-
readonly delete: (name: RepoName) => Effect.Effect<boolean, ArtifactsOperationError>;
|
|
613
|
-
readonly createToken: (name: RepoName, scope?: ComputerArtifactScope, ttl?: number) => Effect.Effect<ArtifactsCreateTokenResult, ArtifactsOperationError>;
|
|
614
|
-
readonly listTokens: (name: RepoName) => Effect.Effect<ArtifactsTokenListResult, ArtifactsOperationError>;
|
|
615
|
-
readonly getToken: (name: RepoName, id: string) => Effect.Effect<ArtifactsTokenInfo, ArtifactsOperationError>;
|
|
616
|
-
readonly revokeToken: (name: RepoName, tokenOrId: string) => Effect.Effect<boolean, ArtifactsOperationError>;
|
|
617
|
-
readonly cli: (input: ComputerArtifactsCliInput) => Effect.Effect<ComputerArtifactsCliResult, ArtifactsOperationError>;
|
|
618
|
-
readonly rawUnsafe: Effect.Effect<ArtifactClient>;
|
|
619
|
-
}
|
|
620
|
-
/** Wraps an already-created upstream session client. */
|
|
621
|
-
declare const fromClient: (client: ArtifactClient, options?: ComputerArtifactsClientOptions) => ComputerArtifactsClient;
|
|
622
|
-
/**
|
|
623
|
-
* Creates an Effect-native session client directly from a Worker Artifacts
|
|
624
|
-
* binding. `@cloudflare/computer` is loaded only when this Effect runs, keeping
|
|
625
|
-
* the optional peer out of applications that do not use this integration.
|
|
626
|
-
*/
|
|
627
|
-
declare const makeClient$7: (bindingValue: ArtifactsBinding, sessionId: string, options?: ComputerArtifactsClientOptions | undefined) => Effect.Effect<ComputerArtifactsClient, ArtifactsOperationError, never>;
|
|
628
|
-
declare namespace ComputerWorkspace_d_exports {
|
|
629
|
-
export { ComputerWorkspace, ComputerWorkspaceAssets, ComputerWorkspaceFilesystem, ComputerWorkspaceGit, ComputerWorkspaceRuntime, ComputerWorkspaceShape, ComputerWorkspaceThink, ListDirectoryOptions, ReadTextFileOptions, RemovePathOptions, WorkspaceAssetsError, WorkspaceDirectoryEntry, WorkspaceEntryStat, WorkspaceExec, WorkspaceExecChunk, WorkspaceExecCollect, WorkspaceExecEncoding, WorkspaceExecError, WorkspaceExecEvent, WorkspaceExecOptions, WorkspaceExecResult, WorkspaceExecRun, WorkspaceExecSignal, WorkspaceExecSkippedEntry, WorkspaceExecSyncResult, WorkspaceFindOptions, WorkspaceFoundEntry, WorkspaceFsError, WorkspaceGetExec, WorkspaceGetExecOptions, WorkspaceGitCheckoutOptions, WorkspaceGitCloneOptions, WorkspaceGitCommit, WorkspaceGitCommitOptions, WorkspaceGitDiffOptions, WorkspaceGitError, WorkspaceGitFetchOptions, WorkspaceGitFetchResult, WorkspaceGitLogOptions, WorkspaceGitPerson, WorkspaceGitUpdateRefOptions, WorkspaceGrepMatch, WorkspaceGrepOptions, WorkspaceMkdirOptions, WorkspaceReadEncoding, WorkspaceReadFile, WorkspaceReadFileOptions, WorkspaceRuntimeValue$1 as WorkspaceRuntimeValue, WorkspaceWriteFileContent, WorkspaceWriteFileOptions, fromWorkspaceClient };
|
|
630
|
-
}
|
|
631
|
-
type CloudflareWorkspaceFilesystem = WorkspaceClient["fs"];
|
|
632
|
-
type CloudflareReadFileOptions = Parameters<CloudflareWorkspaceFilesystem["readFile"]>[1];
|
|
633
|
-
type CloudflareReaddirOptions = Parameters<CloudflareWorkspaceFilesystem["readdir"]>[1];
|
|
634
|
-
type CloudflareFindOptions = Parameters<CloudflareWorkspaceFilesystem["find"]>[2];
|
|
635
|
-
type CloudflareGrepOptions = Parameters<CloudflareWorkspaceFilesystem["grep"]>[2];
|
|
636
|
-
type CloudflareRmOptions = Parameters<CloudflareWorkspaceFilesystem["rm"]>[1];
|
|
637
|
-
type CloudflareMkdirOptions = Parameters<CloudflareWorkspaceFilesystem["mkdir"]>[1];
|
|
638
|
-
type CloudflareWriteFileContent = Parameters<CloudflareWorkspaceFilesystem["writeFile"]>[1];
|
|
639
|
-
type CloudflareWriteFileOptions = Parameters<CloudflareWorkspaceFilesystem["writeFile"]>[2];
|
|
640
|
-
type CloudflareWorkspaceDirentResult = Awaited<ReturnType<CloudflareWorkspaceFilesystem["readdir"]>>[number];
|
|
641
|
-
type CloudflareWorkspaceStatResult = Awaited<ReturnType<CloudflareWorkspaceFilesystem["stat"]>>;
|
|
642
|
-
type CloudflareWorkspaceFoundEntry = Awaited<ReturnType<CloudflareWorkspaceFilesystem["find"]>>[number];
|
|
643
|
-
type CloudflareWorkspaceGrepMatch = Awaited<ReturnType<CloudflareWorkspaceFilesystem["grep"]>>[number];
|
|
644
|
-
declare const WorkspaceFsError_base: Schema.Class<WorkspaceFsError, Schema.TaggedStruct<"WorkspaceFsError", {
|
|
645
|
-
readonly operation: Schema.String;
|
|
646
|
-
readonly path: Schema.String;
|
|
647
|
-
readonly message: Schema.String;
|
|
648
|
-
readonly code: Schema.optionalKey<Schema.String>;
|
|
649
|
-
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
650
|
-
}>, import("effect/Cause").YieldableError>;
|
|
651
|
-
/**
|
|
652
|
-
* Workspace errors use `Schema.TaggedError`, unlike most local binding errors,
|
|
653
|
-
* because workspace operations commonly sit behind Durable Object RPC methods.
|
|
654
|
-
* The schema form preserves the operation-family tags across that boundary.
|
|
655
|
-
*/
|
|
656
|
-
declare class WorkspaceFsError extends WorkspaceFsError_base {}
|
|
657
|
-
declare const WorkspaceGitError_base: Schema.Class<WorkspaceGitError, Schema.TaggedStruct<"WorkspaceGitError", {
|
|
658
|
-
readonly operation: Schema.String;
|
|
659
|
-
readonly message: Schema.String;
|
|
660
|
-
readonly code: Schema.optionalKey<Schema.String>;
|
|
661
|
-
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
662
|
-
}>, import("effect/Cause").YieldableError>;
|
|
663
|
-
/** Schema-serializable error for a workspace Git operation. */
|
|
664
|
-
declare class WorkspaceGitError extends WorkspaceGitError_base {}
|
|
665
|
-
declare const WorkspaceExecError_base: Schema.Class<WorkspaceExecError, Schema.TaggedStruct<"WorkspaceExecError", {
|
|
666
|
-
readonly operation: Schema.String;
|
|
667
|
-
readonly message: Schema.String;
|
|
668
|
-
readonly code: Schema.optionalKey<Schema.String>;
|
|
669
|
-
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
670
|
-
}>, import("effect/Cause").YieldableError>;
|
|
671
|
-
/** Schema-serializable error for a workspace runtime operation. */
|
|
672
|
-
declare class WorkspaceExecError extends WorkspaceExecError_base {}
|
|
673
|
-
declare const WorkspaceAssetsError_base: Schema.Class<WorkspaceAssetsError, Schema.TaggedStruct<"WorkspaceAssetsError", {
|
|
674
|
-
readonly operation: Schema.String;
|
|
675
|
-
readonly path: Schema.String;
|
|
676
|
-
readonly message: Schema.String;
|
|
677
|
-
readonly code: Schema.optionalKey<Schema.String>;
|
|
678
|
-
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
679
|
-
}>, import("effect/Cause").YieldableError>;
|
|
680
|
-
/** Schema-serializable error for a workspace Assets operation. */
|
|
681
|
-
declare class WorkspaceAssetsError extends WorkspaceAssetsError_base {}
|
|
682
|
-
type WorkspaceReadFileOptions = Omit<CloudflareReadFileOptions, "encoding">;
|
|
683
|
-
type ReadTextFileOptions = WorkspaceReadFileOptions;
|
|
684
|
-
type ListDirectoryOptions = CloudflareReaddirOptions;
|
|
685
|
-
type WorkspaceDirectoryEntry = CloudflareWorkspaceDirentResult;
|
|
686
|
-
type WorkspaceEntryStat = CloudflareWorkspaceStatResult;
|
|
687
|
-
type WorkspaceFindOptions = CloudflareFindOptions;
|
|
688
|
-
type WorkspaceFoundEntry = CloudflareWorkspaceFoundEntry;
|
|
689
|
-
type WorkspaceGrepOptions = CloudflareGrepOptions;
|
|
690
|
-
type WorkspaceGrepMatch = CloudflareWorkspaceGrepMatch;
|
|
691
|
-
type RemovePathOptions = CloudflareRmOptions;
|
|
692
|
-
type WorkspaceMkdirOptions = CloudflareMkdirOptions;
|
|
693
|
-
type WorkspaceWriteFileContent = CloudflareWriteFileContent;
|
|
694
|
-
type WorkspaceWriteFileOptions = CloudflareWriteFileOptions;
|
|
695
|
-
/** Explicit read mode. Text remains the default for consumer-port compatibility. */
|
|
696
|
-
type WorkspaceReadEncoding = "utf8" | "stream";
|
|
697
|
-
interface WorkspaceReadFile {
|
|
698
|
-
(path: string, options?: WorkspaceReadFileOptions & {
|
|
699
|
-
readonly encoding?: "utf8";
|
|
700
|
-
}): Effect.Effect<string, WorkspaceFsError>;
|
|
701
|
-
(path: string, options: WorkspaceReadFileOptions & {
|
|
702
|
-
readonly encoding: "stream";
|
|
703
|
-
}): Effect.Effect<ReadableStream<Uint8Array>, WorkspaceFsError>;
|
|
704
|
-
}
|
|
705
|
-
/** Complete Effect wrapper of `WorkspaceClient.fs`. */
|
|
706
|
-
interface ComputerWorkspaceFilesystem {
|
|
707
|
-
readonly readFile: WorkspaceReadFile;
|
|
708
|
-
readonly stat: (path: string) => Effect.Effect<WorkspaceEntryStat, WorkspaceFsError>;
|
|
709
|
-
readonly lstat: (path: string) => Effect.Effect<WorkspaceEntryStat, WorkspaceFsError>;
|
|
710
|
-
readonly exists: (path: string) => Effect.Effect<boolean, WorkspaceFsError>;
|
|
711
|
-
readonly readlink: (path: string) => Effect.Effect<string, WorkspaceFsError>;
|
|
712
|
-
readonly readdir: (path: string, options?: ListDirectoryOptions) => Effect.Effect<ReadonlyArray<WorkspaceDirectoryEntry>, WorkspaceFsError>;
|
|
713
|
-
readonly find: (directory: string, pattern?: string, options?: WorkspaceFindOptions) => Effect.Effect<ReadonlyArray<WorkspaceFoundEntry>, WorkspaceFsError>;
|
|
714
|
-
readonly ls: (prefix: string) => Effect.Effect<ReadonlyArray<string>, WorkspaceFsError>;
|
|
715
|
-
readonly grep: (pattern: string, path: string, options?: WorkspaceGrepOptions) => Effect.Effect<ReadonlyArray<WorkspaceGrepMatch>, WorkspaceFsError>;
|
|
716
|
-
readonly writeFile: (path: string, content: WorkspaceWriteFileContent, options?: WorkspaceWriteFileOptions) => Effect.Effect<void, WorkspaceFsError>;
|
|
717
|
-
readonly mkdir: (path: string, options?: WorkspaceMkdirOptions) => Effect.Effect<void, WorkspaceFsError>;
|
|
718
|
-
readonly rm: (path: string, options?: RemovePathOptions) => Effect.Effect<void, WorkspaceFsError>;
|
|
719
|
-
readonly chmod: (path: string, mode: number) => Effect.Effect<void, WorkspaceFsError>;
|
|
720
|
-
readonly symlink: (target: string, path: string) => Effect.Effect<void, WorkspaceFsError>;
|
|
721
|
-
}
|
|
722
|
-
type WorkspaceGitCloneOptions = GitCloneOptions;
|
|
723
|
-
type WorkspaceGitFetchOptions = GitFetchOptions;
|
|
724
|
-
type WorkspaceGitFetchResult = Awaited<ReturnType<GitClient["fetch"]>>;
|
|
725
|
-
type WorkspaceGitCheckoutOptions = Parameters<GitClient["checkout"]>[0];
|
|
726
|
-
type WorkspaceGitUpdateRefOptions = GitUpdateRefOptions;
|
|
727
|
-
type WorkspaceGitDiffOptions = GitDiffOptions;
|
|
728
|
-
type WorkspaceGitCommitOptions = GitCommitOptions;
|
|
729
|
-
interface WorkspaceGitLogOptions extends Omit<GitLogOptions, "depth"> {
|
|
730
|
-
/** Preferred upstream name for the history bound. */
|
|
731
|
-
readonly depth?: number;
|
|
732
|
-
/** Consumer-port compatibility alias for `depth`. */
|
|
733
|
-
readonly maxCount?: number;
|
|
734
|
-
}
|
|
735
|
-
type WorkspaceGitPerson = CommitView["author"] & {
|
|
736
|
-
/** Consumer-port compatibility alias for `timestamp`. */
|
|
737
|
-
readonly timestampSeconds: number;
|
|
738
|
-
};
|
|
739
|
-
interface WorkspaceGitCommit {
|
|
740
|
-
readonly oid: string;
|
|
741
|
-
readonly message: string;
|
|
742
|
-
readonly tree: string;
|
|
743
|
-
readonly parent: ReadonlyArray<string>;
|
|
744
|
-
/** Consumer-port compatibility alias for `parent`. */
|
|
745
|
-
readonly parents: ReadonlyArray<string>;
|
|
746
|
-
readonly author: WorkspaceGitPerson;
|
|
747
|
-
readonly committer: WorkspaceGitPerson;
|
|
748
|
-
}
|
|
749
|
-
type EffectGitMethod<Method> = Method extends ((...args: infer Args) => Promise<infer Success>) ? (...args: Args) => Effect.Effect<Success, WorkspaceGitError> : never;
|
|
750
|
-
type EffectGitClient = { readonly [Name in keyof GitClient]: EffectGitMethod<GitClient[Name]>; };
|
|
751
|
-
/** Complete Effect wrapper of the `@cloudflare/computer/git` client. */
|
|
752
|
-
type ComputerWorkspaceGit = Omit<EffectGitClient, "log" | "revParse"> & {
|
|
753
|
-
readonly log: (options?: WorkspaceGitLogOptions) => Effect.Effect<ReadonlyArray<WorkspaceGitCommit>, WorkspaceGitError>;
|
|
754
|
-
readonly revParse: {
|
|
755
|
-
(ref: string): Effect.Effect<string, WorkspaceGitError>;
|
|
756
|
-
(options: Parameters<GitClient["revParse"]>[0]): Effect.Effect<string, WorkspaceGitError>;
|
|
757
|
-
};
|
|
758
|
-
};
|
|
759
|
-
type WorkspaceExecSignal = NonNullable<RuntimeKillOptions["signal"]>;
|
|
760
|
-
type WorkspaceRuntimeValue$1 = WorkspaceRuntimeValue;
|
|
761
|
-
type WorkspaceExecEncoding = "utf8" | "binary";
|
|
762
|
-
type WorkspaceExecSyncResult = ExecSyncResult;
|
|
763
|
-
type WorkspaceExecSkippedEntry = SkippedEntry;
|
|
764
|
-
type CloudflareEncoding<Encoding extends WorkspaceExecEncoding> = Encoding extends "utf8" ? "utf8" : undefined;
|
|
765
|
-
type WorkspaceExecChunk<Encoding extends WorkspaceExecEncoding> = Encoding extends "utf8" ? string : Uint8Array;
|
|
766
|
-
type WorkspaceExecOptions<Encoding extends WorkspaceExecEncoding = "utf8"> = Omit<RuntimeExecOptions, "encoding" | "timeoutMs"> & {
|
|
767
|
-
readonly encoding?: Encoding;
|
|
768
|
-
/** Upstream runtime option name. */
|
|
769
|
-
readonly timeoutMs?: number;
|
|
770
|
-
/** Consumer-port compatibility alias for `timeoutMs`. */
|
|
771
|
-
readonly timeoutMillis?: number;
|
|
772
|
-
};
|
|
773
|
-
type WorkspaceGetExecOptions<Encoding extends WorkspaceExecEncoding = "utf8"> = Omit<RuntimeGetOptions, "encoding"> & {
|
|
774
|
-
readonly encoding?: Encoding;
|
|
775
|
-
};
|
|
776
|
-
type WorkspaceExecEvent<Encoding extends WorkspaceExecEncoding = "utf8"> = ({
|
|
777
|
-
readonly _tag: "Stdout";
|
|
778
|
-
readonly id: string;
|
|
779
|
-
readonly sequence: number;
|
|
780
|
-
readonly chunk: WorkspaceExecChunk<Encoding>;
|
|
781
|
-
} & (Encoding extends "utf8" ? {
|
|
782
|
-
readonly text: string;
|
|
783
|
-
} : {
|
|
784
|
-
readonly bytes: Uint8Array;
|
|
785
|
-
})) | ({
|
|
786
|
-
readonly _tag: "Stderr";
|
|
787
|
-
readonly id: string;
|
|
788
|
-
readonly sequence: number;
|
|
789
|
-
readonly chunk: WorkspaceExecChunk<Encoding>;
|
|
790
|
-
} & (Encoding extends "utf8" ? {
|
|
791
|
-
readonly text: string;
|
|
792
|
-
} : {
|
|
793
|
-
readonly bytes: Uint8Array;
|
|
794
|
-
})) | {
|
|
795
|
-
readonly _tag: "Exit";
|
|
796
|
-
readonly id: string;
|
|
797
|
-
readonly sequence: number;
|
|
798
|
-
readonly exitCode: number;
|
|
799
|
-
readonly value?: WorkspaceRuntimeValue$1;
|
|
800
|
-
};
|
|
801
|
-
interface WorkspaceExecResult<Encoding extends WorkspaceExecEncoding = "utf8"> {
|
|
802
|
-
readonly status: WorkspaceRuntimeResult<CloudflareEncoding<Encoding>>["status"];
|
|
803
|
-
readonly exitCode: number;
|
|
804
|
-
readonly stdout: WorkspaceExecChunk<Encoding>;
|
|
805
|
-
readonly stderr: WorkspaceExecChunk<Encoding>;
|
|
806
|
-
readonly value?: WorkspaceRuntimeValue$1;
|
|
807
|
-
readonly pushed: number;
|
|
808
|
-
readonly pulled: number;
|
|
809
|
-
readonly skipped: ReadonlyArray<WorkspaceExecSkippedEntry>;
|
|
810
|
-
readonly sync: WorkspaceExecSyncResult;
|
|
811
|
-
}
|
|
812
|
-
interface WorkspaceExecRun<Encoding extends WorkspaceExecEncoding = "utf8"> {
|
|
813
|
-
readonly id: string;
|
|
814
|
-
readonly backend: string;
|
|
815
|
-
/**
|
|
816
|
-
* Live output. Like the upstream handle, `events` and `result` are mutually
|
|
817
|
-
* exclusive consumers of a run.
|
|
818
|
-
*/
|
|
819
|
-
readonly events: Stream.Stream<WorkspaceExecEvent<Encoding>, WorkspaceExecError>;
|
|
820
|
-
readonly result: Effect.Effect<WorkspaceExecResult<Encoding>, WorkspaceExecError>;
|
|
821
|
-
readonly kill: (signal?: WorkspaceExecSignal) => Effect.Effect<void, WorkspaceExecError>;
|
|
822
|
-
}
|
|
823
|
-
interface WorkspaceExec {
|
|
824
|
-
(strings: TemplateStringsArray, ...values: Array<ShellValue>): Effect.Effect<WorkspaceExecRun<"utf8">, WorkspaceExecError, Scope.Scope>;
|
|
825
|
-
(command: string, options?: WorkspaceExecOptions<"utf8">): Effect.Effect<WorkspaceExecRun<"utf8">, WorkspaceExecError, Scope.Scope>;
|
|
826
|
-
(command: string, options: WorkspaceExecOptions<"binary">): Effect.Effect<WorkspaceExecRun<"binary">, WorkspaceExecError, Scope.Scope>;
|
|
827
|
-
}
|
|
828
|
-
interface WorkspaceGetExec {
|
|
829
|
-
(id: string, options?: WorkspaceGetExecOptions<"utf8">): Effect.Effect<WorkspaceExecRun<"utf8">, WorkspaceExecError, Scope.Scope>;
|
|
830
|
-
(id: string, options: WorkspaceGetExecOptions<"binary">): Effect.Effect<WorkspaceExecRun<"binary">, WorkspaceExecError, Scope.Scope>;
|
|
831
|
-
}
|
|
832
|
-
interface WorkspaceExecCollect {
|
|
833
|
-
(strings: TemplateStringsArray, ...values: Array<ShellValue>): Effect.Effect<WorkspaceExecResult<"utf8">, WorkspaceExecError>;
|
|
834
|
-
(command: string, options?: WorkspaceExecOptions<"utf8">): Effect.Effect<WorkspaceExecResult<"utf8">, WorkspaceExecError>;
|
|
835
|
-
(command: string, options: WorkspaceExecOptions<"binary">): Effect.Effect<WorkspaceExecResult<"binary">, WorkspaceExecError>;
|
|
836
|
-
}
|
|
837
|
-
/** Complete Effect wrapper of `WorkspaceClient.runtime`. */
|
|
838
|
-
interface ComputerWorkspaceRuntime {
|
|
839
|
-
readonly exec: WorkspaceExec;
|
|
840
|
-
readonly execCollect: WorkspaceExecCollect;
|
|
841
|
-
readonly getExec: WorkspaceGetExec;
|
|
842
|
-
readonly killExec: (id: string, options?: RuntimeKillOptions) => Effect.Effect<void, WorkspaceExecError>;
|
|
843
|
-
readonly disposeExec: (id: string, options?: {
|
|
844
|
-
readonly backend?: string;
|
|
845
|
-
}) => Effect.Effect<void, WorkspaceExecError>;
|
|
846
|
-
}
|
|
847
|
-
/** Effect wrapper over a configured local `Workspace.assets` client. */
|
|
848
|
-
interface ComputerWorkspaceAssets {
|
|
849
|
-
readonly share: (path: string, options: ShareOptions) => Effect.Effect<string, WorkspaceAssetsError>;
|
|
850
|
-
}
|
|
851
|
-
type EffectThinkMethod<Method> = Method extends ((...args: infer Args) => Promise<infer Success>) ? (...args: Args) => Effect.Effect<Success, WorkspaceFsError> : never;
|
|
852
|
-
/** Effect wrapper of the optional Think compatibility surface. */
|
|
853
|
-
type ComputerWorkspaceThink = { readonly [Name in keyof ThinkWorkspaceCompatibility]: EffectThinkMethod<ThinkWorkspaceCompatibility[Name]>; };
|
|
854
|
-
/** Effect service over every client surface exposed by Cloudflare Computer. */
|
|
855
|
-
interface ComputerWorkspaceShape {
|
|
856
|
-
readonly fs: ComputerWorkspaceFilesystem;
|
|
857
|
-
readonly git: ComputerWorkspaceGit;
|
|
858
|
-
readonly runtime: ComputerWorkspaceRuntime;
|
|
859
|
-
readonly artifacts: ComputerArtifactsClient;
|
|
860
|
-
readonly assets: ComputerWorkspaceAssets | undefined;
|
|
861
|
-
readonly think: ComputerWorkspaceThink | undefined;
|
|
862
|
-
/** Flat filesystem aliases retained for mechanical consumer migration. */
|
|
863
|
-
readonly readFile: WorkspaceReadFile;
|
|
864
|
-
readonly stat: ComputerWorkspaceFilesystem["stat"];
|
|
865
|
-
readonly lstat: ComputerWorkspaceFilesystem["lstat"];
|
|
866
|
-
readonly exists: ComputerWorkspaceFilesystem["exists"];
|
|
867
|
-
readonly readlink: ComputerWorkspaceFilesystem["readlink"];
|
|
868
|
-
readonly readdir: ComputerWorkspaceFilesystem["readdir"];
|
|
869
|
-
readonly listDirectory: ComputerWorkspaceFilesystem["readdir"];
|
|
870
|
-
readonly find: ComputerWorkspaceFilesystem["find"];
|
|
871
|
-
readonly ls: ComputerWorkspaceFilesystem["ls"];
|
|
872
|
-
readonly grep: ComputerWorkspaceFilesystem["grep"];
|
|
873
|
-
readonly writeFile: ComputerWorkspaceFilesystem["writeFile"];
|
|
874
|
-
readonly mkdir: ComputerWorkspaceFilesystem["mkdir"];
|
|
875
|
-
readonly rm: ComputerWorkspaceFilesystem["rm"];
|
|
876
|
-
readonly removePath: ComputerWorkspaceFilesystem["rm"];
|
|
877
|
-
readonly chmod: ComputerWorkspaceFilesystem["chmod"];
|
|
878
|
-
readonly symlink: ComputerWorkspaceFilesystem["symlink"];
|
|
879
|
-
/** Flat runtime aliases retained for mechanical consumer migration. */
|
|
880
|
-
readonly exec: WorkspaceExec;
|
|
881
|
-
readonly execCollect: WorkspaceExecCollect;
|
|
882
|
-
readonly getExec: WorkspaceGetExec;
|
|
883
|
-
readonly killExec: ComputerWorkspaceRuntime["killExec"];
|
|
884
|
-
readonly disposeExec: ComputerWorkspaceRuntime["disposeExec"];
|
|
885
|
-
}
|
|
886
|
-
/**
|
|
887
|
-
* Wraps a client whose lifetime is owned by the caller. Prefer
|
|
888
|
-
* {@link ComputerWorkspace.layer} in Durable Objects so the parent client and
|
|
889
|
-
* every runtime handle are disposed by Effect `Scope`.
|
|
890
|
-
*/
|
|
891
|
-
declare const fromWorkspaceClient: (client: WorkspaceClient) => ComputerWorkspaceShape;
|
|
892
|
-
declare const ComputerWorkspace_base: Context.ServiceClass<ComputerWorkspace, "effect-cf/ComputerWorkspace", ComputerWorkspaceShape>;
|
|
893
|
-
/** Effect service for the workspace owned by the enclosing Durable Object. */
|
|
894
|
-
declare class ComputerWorkspace extends ComputerWorkspace_base {
|
|
895
|
-
/**
|
|
896
|
-
* Acquires the single workspace registered by `withComputerWorkspace` and
|
|
897
|
-
* releases its RPC client when the layer scope closes.
|
|
898
|
-
*/
|
|
899
|
-
static readonly layer: Layer.Layer<ComputerWorkspace, never, DurableObjectState>;
|
|
900
|
-
}
|
|
901
580
|
declare namespace ContainerNamespace_d_exports {
|
|
902
581
|
export { ContainerInstanceClient, ContainerNamespace, ContainerNamespaceClient, ContainerNamespaceDefinition, ContainerNamespaceResource, ContainerNamespaceService, ContainerNamespaceStaticClient, ContainerOperationError, ContainerReadinessOptions, ContainerSignal, ContainerStartAndWaitForPortsOptions, ContainerStartOptions, ContainerState, ContainerStopSignal, ContainerStub, ContainerStubOf, ContainerWaitOptions, LayerOptions$9 as LayerOptions, Tag$9 as Tag, TagClass$8 as TagClass, isContainerNamespaceResource, layer$8 as layer, make$9 as make, makeClient$6 as makeClient };
|
|
903
582
|
}
|
|
@@ -1035,7 +714,7 @@ interface TagClass$8<Self, Id extends string, Namespace extends ContainerNamespa
|
|
|
1035
714
|
readonly id: Id;
|
|
1036
715
|
readonly layer: (options: LayerOptions$9) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1037
716
|
}
|
|
1038
|
-
declare const isContainerNamespaceResource: (value:
|
|
717
|
+
declare const isContainerNamespaceResource: <Candidate>(value: Candidate) => value is Candidate & ContainerNamespaceResource;
|
|
1039
718
|
declare const makeClient$6: (definition: ContainerNamespaceDefinition) => <Namespace extends ContainerNamespaceResource>(namespace: Namespace) => ContainerNamespaceClient<Namespace>;
|
|
1040
719
|
declare const layer$8: <Self, Namespace extends ContainerNamespaceResource>(tag: Context.Service<Self, ContainerNamespaceClient<Namespace>>, definition: ContainerNamespaceDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1041
720
|
declare const make$9: <Id extends string>(id: Id) => TagClass$8<ContainerNamespaceService<Id>, Id, ContainerNamespaceResource>;
|
|
@@ -1102,8 +781,9 @@ declare namespace DurableObjectNamespace_d_exports {
|
|
|
1102
781
|
interface DurableObjectFetcher {
|
|
1103
782
|
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
1104
783
|
}
|
|
1105
|
-
type RpcClient<Api> = { readonly [Key in keyof Api as Key extends string ? Api[Key] extends ((...args: Array<any>) =>
|
|
784
|
+
type RpcClient<Api> = { readonly [Key in keyof Api as Key extends string ? Api[Key] extends ((...args: Array<any>) => any) ? Key : never : never]: Api[Key]; };
|
|
1106
785
|
type ReservedMethodName$1 = ReservedMethodName | "fetch";
|
|
786
|
+
type NamespaceCandidate = Parameters<typeof Predicate.isUnknown>[0];
|
|
1107
787
|
/**
|
|
1108
788
|
* Cloudflare Durable Object stub, optionally enriched with RPC methods.
|
|
1109
789
|
*/
|
|
@@ -1304,7 +984,7 @@ type DurableObjectNamespaceStaticClient<R, Api extends object, Definition extend
|
|
|
1304
984
|
readonly scopedCall: <Method extends StubMethodKey<Api>>(stub: DurableObjectStubClient<Api>, method: Method, ...args: StubMethodArgs<Api, Method>) => Effect.Effect<Awaited<StubMethodSuccess<Api, Method>>, unknown, Scope.Scope | R>;
|
|
1305
985
|
readonly rawUnsafe: () => Effect.Effect<DurableObjectNamespaceClient<Api>, never, R>;
|
|
1306
986
|
};
|
|
1307
|
-
declare const isDurableObjectNamespaceClient: <Api extends object>(value:
|
|
987
|
+
declare const isDurableObjectNamespaceClient: <Api extends object>(value: NamespaceCandidate) => value is DurableObjectNamespaceClient<Api>;
|
|
1308
988
|
declare const makeClient$5: <Api extends object, const Definition extends Definition$3.Any | undefined = undefined>(definition: DurableObjectNamespaceBindingDefinition<Definition>) => ((namespace: DurableObjectNamespaceClient<Api>) => DurableObjectNamespaceEffectClient<Api, Definition>);
|
|
1309
989
|
declare const layer$7: <Self, Api extends object, const Definition extends Definition$3.Any | undefined = undefined>(tag: Context.Service<Self, DurableObjectNamespaceEffectClient<Api, Definition>>, definition: DurableObjectNamespaceBindingDefinition<Definition>) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1310
990
|
declare const makeDirectMethods: <R, Api extends object, Definition extends Definition$3.Any | undefined>(rpcDefinition: Definition | undefined, helpers: {
|
|
@@ -1329,22 +1009,22 @@ declare namespace Method$1 {
|
|
|
1329
1009
|
export type Args<Self extends Any> = ArgsFromSchemas<Self["args"]>;
|
|
1330
1010
|
export type EncodedArgs<Self extends Any> = EncodedArgsFromSchemas<Self["args"]>;
|
|
1331
1011
|
export type Success<Self extends Any> = Schema.Schema.Type<Self["success"]>;
|
|
1332
|
-
export type EncodedSuccess<
|
|
1012
|
+
export type EncodedSuccess<_Self extends Any> = Schema.Json;
|
|
1333
1013
|
export {};
|
|
1334
1014
|
}
|
|
1335
1015
|
type Methods = Record<string, Method$1.Any>;
|
|
1336
1016
|
/**
|
|
1337
1017
|
* RPC contract for a Durable Object class.
|
|
1338
1018
|
*/
|
|
1339
|
-
interface Definition$3<Id extends string = string,
|
|
1019
|
+
interface Definition$3<Id extends string = string, MethodDefinitions extends Methods = Methods> {
|
|
1340
1020
|
readonly id: Id;
|
|
1341
|
-
readonly methods:
|
|
1021
|
+
readonly methods: MethodDefinitions;
|
|
1342
1022
|
}
|
|
1343
1023
|
declare namespace Definition$3 {
|
|
1344
1024
|
type Any = Definition$3<string, Methods>;
|
|
1345
1025
|
}
|
|
1346
1026
|
type ReservedMethodName = ReservedMethodName$2 | "fetch" | "alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError";
|
|
1347
|
-
type NoReservedMethods<
|
|
1027
|
+
type NoReservedMethods<MethodDefinitions extends Methods> = Extract<keyof MethodDefinitions, ReservedMethodName> extends never ? MethodDefinitions : never;
|
|
1348
1028
|
/**
|
|
1349
1029
|
* Promise-based client API derived from a Durable Object definition.
|
|
1350
1030
|
*/
|
|
@@ -1363,26 +1043,24 @@ interface Options$2<ROut, Self extends Definition$3.Any, REvent = never, EventLa
|
|
|
1363
1043
|
type LayerOptions$8 = {
|
|
1364
1044
|
readonly binding: string;
|
|
1365
1045
|
};
|
|
1366
|
-
type TagClass$7<Self, Id extends string,
|
|
1046
|
+
type TagClass$7<Self, Id extends string, MethodDefinitions extends Methods> = Context.ServiceClass<Self, `effect-cf/DurableObject/${Id}`, DurableObjectNamespaceEffectClient<Api<Definition$3<Id, MethodDefinitions>>, Definition$3<Id, MethodDefinitions>>> & DurableObjectNamespaceStaticClient<Self, Api<Definition$3<Id, MethodDefinitions>>, Definition$3<Id, MethodDefinitions>> & {
|
|
1367
1047
|
readonly id: Id;
|
|
1368
|
-
readonly methods:
|
|
1369
|
-
readonly make: <ROut, LayerError, REvent = never, EventLayerError = never>(layer: Layer.Layer<ROut, LayerError, DurableObjectState | WorkerEnvironment>, options: Options$2<ROut, Definition$3<Id,
|
|
1048
|
+
readonly methods: MethodDefinitions;
|
|
1049
|
+
readonly make: <ROut, LayerError, REvent = never, EventLayerError = never>(layer: Layer.Layer<ROut, LayerError, DurableObjectState | WorkerEnvironment>, options: Options$2<ROut, Definition$3<Id, MethodDefinitions>, REvent, EventLayerError>) => DurableObjectClass<Handlers<ROut | REvent, Definition$3<Id, MethodDefinitions>>, ROut | REvent>;
|
|
1370
1050
|
readonly layer: (options: LayerOptions$8) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1371
1051
|
};
|
|
1372
1052
|
/**
|
|
1373
1053
|
* Defines a single RPC method schema in a Durable Object definition.
|
|
1374
1054
|
*/
|
|
1375
|
-
declare
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
declare const make$7: <Id extends string, const MethodsShape extends Methods>(id: Id, methods: MethodsShape & NoReservedMethods<MethodsShape>) => TagClass$7<Definition$3<Id, MethodsShape>, Id, MethodsShape>;
|
|
1385
|
-
declare const Tag$8: <Self>() => <Id extends string, const MethodsShape extends Methods>(id: Id, methods: MethodsShape & NoReservedMethods<MethodsShape>) => TagClass$7<Self, Id, MethodsShape>;
|
|
1055
|
+
declare function method<Success extends ServiceFreeSchema>(definition: {
|
|
1056
|
+
readonly success: Success;
|
|
1057
|
+
}): Method$1<readonly [], Success>;
|
|
1058
|
+
declare function method<const Args extends ReadonlyArray<ServiceFreeSchema>, Success extends ServiceFreeSchema>(definition: {
|
|
1059
|
+
readonly args: Args;
|
|
1060
|
+
readonly success: Success;
|
|
1061
|
+
}): Method$1<Args, Success>;
|
|
1062
|
+
declare const make$7: <Id extends string, const MethodDefinitions extends Methods>(id: Id, methods: MethodDefinitions & NoReservedMethods<MethodDefinitions>) => TagClass$7<Definition$3<Id, MethodDefinitions>, Id, MethodDefinitions>;
|
|
1063
|
+
declare const Tag$8: <Self>() => <Id extends string, const MethodDefinitions extends Methods>(id: Id, methods: MethodDefinitions & NoReservedMethods<MethodDefinitions>) => TagClass$7<Self, Id, MethodDefinitions>;
|
|
1386
1064
|
declare const DurableObject$1: typeof Tag$8;
|
|
1387
1065
|
/**
|
|
1388
1066
|
* Helper for implementing handlers with the exact method shape of a definition.
|
|
@@ -1393,7 +1071,7 @@ declare const implement$2: <ROut, const Self extends Definition$3.Any>(_definiti
|
|
|
1393
1071
|
*/
|
|
1394
1072
|
type HandlerEffect<ROut, Self extends Definition$3.Any, Key extends keyof Self["methods"]> = DurableObjectHandler<ROut, Method$1.Success<Self["methods"][Key]>>;
|
|
1395
1073
|
declare namespace DurableObject_d_exports {
|
|
1396
|
-
export { Api, Definition$3 as Definition, DurableObjectClass, DurableObjectHandler, DurableObjectOptions, DurableObjectRpc, DurableObjectRpcShape, HandlerEffect, Handlers, LayerOptions$8 as LayerOptions, Method$1 as Method, Methods, NoReservedMethods, Options$2 as Options, ReservedMethodName, RpcHandlers, ServerApi, ServiceFreeSchema, Tag$8 as Tag, TagClass$7 as TagClass, implement$2 as implement, make$6 as make, method };
|
|
1074
|
+
export { Api, Definition$3 as Definition, DurableObjectClass, DurableObjectHandler, DurableObjectOptions, DurableObjectRpc, DurableObjectRpcApi, DurableObjectRpcApi as DurableObjectRpcShape, HandlerEffect, Handlers, LayerOptions$8 as LayerOptions, Method$1 as Method, Methods, NoReservedMethods, Options$2 as Options, ReservedMethodName, RpcHandlers, ServerApi, ServiceFreeSchema, Tag$8 as Tag, TagClass$7 as TagClass, implement$2 as implement, make$6 as make, method };
|
|
1397
1075
|
}
|
|
1398
1076
|
type RuntimeContext$1<ROut> = DurableObjectState | WorkerEnvironment | ROut;
|
|
1399
1077
|
type HandlerContext<ROut> = RuntimeContext$1<ROut> | Scope.Scope;
|
|
@@ -1406,8 +1084,8 @@ type DurableObjectHandler<ROut, A = unknown> = Effect.Effect<A, unknown, Handler
|
|
|
1406
1084
|
* Shape of Durable Object RPC handlers passed to {@link make}.
|
|
1407
1085
|
*/
|
|
1408
1086
|
type DurableObjectRpc<ROut> = Record<string, (...args: Array<any>) => DurableObjectHandler<ROut>>;
|
|
1409
|
-
type
|
|
1410
|
-
type RpcHandlers<ROut, Api> = { readonly [Key in keyof Api as Key extends keyof DurableObject<WorkerEnv> ? never : Key extends string ? [Api[Key]] extends [never] ? never : Api[Key] extends ((...args: Array<any>) => Promise<
|
|
1087
|
+
type DurableObjectRpcApi<Rpc extends DurableObjectRpc<ROut>, ROut> = { readonly [Key in keyof Rpc]: Rpc[Key] extends ((...args: infer Args) => Effect.Effect<infer A, unknown, HandlerContext<ROut>>) ? (...args: Args) => Promise<A> : never; };
|
|
1088
|
+
type RpcHandlers<ROut, Api> = { readonly [Key in keyof Api as Key extends keyof DurableObject<WorkerEnv> ? never : Key extends string ? [Api[Key]] extends [never] ? never : Api[Key] extends ((...args: Array<any>) => Promise<any>) ? Key : never : never]: Api[Key] extends ((...args: infer Args) => Promise<infer A>) ? (...args: Args) => DurableObjectHandler<ROut, A> : never; };
|
|
1411
1089
|
/**
|
|
1412
1090
|
* Options for creating a Durable Object class backed by Effect handlers.
|
|
1413
1091
|
*/
|
|
@@ -1455,12 +1133,12 @@ interface DurableObjectOptions<RRuntime, REvent = never, EventLayerError = never
|
|
|
1455
1133
|
readonly alarm?: (alarmInfo?: globalThis.AlarmInvocationInfo) => Effect.Effect<void, unknown, HandlerContext<RRuntime | REvent>>;
|
|
1456
1134
|
readonly webSocketMessage?: (socket: DurableWebSocket, message: string | ArrayBuffer) => Effect.Effect<void, unknown, HandlerContext<RRuntime | REvent>>;
|
|
1457
1135
|
readonly webSocketClose?: (socket: DurableWebSocket, code: number, reason: string, wasClean: boolean) => Effect.Effect<void, unknown, HandlerContext<RRuntime | REvent>>;
|
|
1458
|
-
readonly webSocketError?: (socket: DurableWebSocket,
|
|
1136
|
+
readonly webSocketError?: (socket: DurableWebSocket, cause: unknown) => Effect.Effect<void, unknown, HandlerContext<RRuntime | REvent>>;
|
|
1459
1137
|
}
|
|
1460
1138
|
/**
|
|
1461
1139
|
* Cloudflare `DurableObject` constructor produced by {@link make}.
|
|
1462
1140
|
*/
|
|
1463
|
-
type DurableObjectClass<Rpc extends DurableObjectRpc<ROut>, ROut> = new (state: globalThis.DurableObjectState, env: WorkerEnv) => DurableObject<WorkerEnv> &
|
|
1141
|
+
type DurableObjectClass<Rpc extends DurableObjectRpc<ROut>, ROut> = new (state: globalThis.DurableObjectState, env: WorkerEnv) => DurableObject<WorkerEnv> & DurableObjectRpcApi<Rpc, ROut>;
|
|
1464
1142
|
/**
|
|
1465
1143
|
* Creates a Durable Object class backed by a single managed Effect runtime.
|
|
1466
1144
|
*/
|
|
@@ -1819,7 +1497,7 @@ interface DurableObjectRpcWebSocketService {
|
|
|
1819
1497
|
readonly accept: (socket: DurableWebSocket) => Effect.Effect<void>;
|
|
1820
1498
|
readonly message: (socket: DurableWebSocket, message: NativeWebSocketMessage) => Effect.Effect<void>;
|
|
1821
1499
|
readonly close: (socket: DurableWebSocket) => Effect.Effect<void>;
|
|
1822
|
-
readonly error: (socket: DurableWebSocket,
|
|
1500
|
+
readonly error: (socket: DurableWebSocket, cause: unknown) => Effect.Effect<void>;
|
|
1823
1501
|
}
|
|
1824
1502
|
declare const DurableObjectRpcWebSocket_base: Context.ServiceClass<DurableObjectRpcWebSocket, "effect-cf/DurableObjectRpcWebSocket", DurableObjectRpcWebSocketService>;
|
|
1825
1503
|
/**
|
|
@@ -1953,7 +1631,7 @@ interface TagClass$6<Self, Id extends string> extends Context.ServiceClass<Self,
|
|
|
1953
1631
|
* because the encoded MIME size is only known once Cloudflare composes it.
|
|
1954
1632
|
*/
|
|
1955
1633
|
declare const validateMessage: (message: EmailMessageBuilder) => ReadonlyArray<EmailViolation>;
|
|
1956
|
-
declare const isEmailBinding: (value:
|
|
1634
|
+
declare const isEmailBinding: <Candidate>(value: Candidate) => value is Candidate & EmailBinding;
|
|
1957
1635
|
declare const makeClient$4: (definition: EmailDefinition, options?: EmailSendOptions) => (email: EmailBinding) => EmailClient;
|
|
1958
1636
|
declare const layer$4: <Self>(tag: Context.Service<Self, EmailClient>, definition: LayerOptions$6) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1959
1637
|
declare const make$5: <Id extends string>(id: Id) => TagClass$6<EmailService<Id>, Id>;
|
|
@@ -2127,7 +1805,7 @@ declare const draw: {
|
|
|
2127
1805
|
(draw: DrawStepOptions): (steps: Steps) => Steps;
|
|
2128
1806
|
(steps: Steps, draw: DrawStepOptions): Steps;
|
|
2129
1807
|
};
|
|
2130
|
-
declare const isImagesBinding: (value:
|
|
1808
|
+
declare const isImagesBinding: <Candidate>(value: Candidate) => value is Candidate & ImagesRuntimeBinding;
|
|
2131
1809
|
declare const makeClient$3: (definition: ImagesDefinition) => (images: ImagesRuntimeBinding) => ImagesClient;
|
|
2132
1810
|
declare const layer$3: <Self>(tag: Context.Service<Self, ImagesClient>, definition: ImagesDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2133
1811
|
declare const make$4: <Id extends string>(id: Id) => TagClass$5<ImagesService<Id>, Id>;
|
|
@@ -2215,7 +1893,7 @@ interface TagClass$4<Self, Id extends string, Key, Value, EncodedValue> extends
|
|
|
2215
1893
|
readonly valueSchema: Schema.Codec<Value, EncodedValue>;
|
|
2216
1894
|
readonly layer: (options: LayerOptions$4) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2217
1895
|
}
|
|
2218
|
-
declare const isKvNamespace: (value:
|
|
1896
|
+
declare const isKvNamespace: <Candidate>(value: Candidate) => value is Candidate & KVNamespace;
|
|
2219
1897
|
declare const makeClient$2: <Key, Value, EncodedValue>(definition: KvDefinition<Key, Value, EncodedValue>) => ((kv: KVNamespace) => KvClient<Key, Value, EncodedValue>);
|
|
2220
1898
|
declare const layer$2: <Self, Key, Value, EncodedValue>(tag: Context.Service<Self, KvClient<Key, Value, EncodedValue>>, definition: KvDefinition<Key, Value, EncodedValue>) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2221
1899
|
declare const Tag$5: <Self>() => <Id extends string, Key, Value, EncodedValue>(id: Id, definition: {
|
|
@@ -2301,7 +1979,8 @@ interface TagClass$3<Self, Id extends string> extends Context.ServiceClass<Self,
|
|
|
2301
1979
|
readonly id: Id;
|
|
2302
1980
|
readonly layer: (options: LayerOptions$3) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2303
1981
|
}
|
|
2304
|
-
|
|
1982
|
+
type R2BindingValue = Schema.Schema.Type<typeof Schema.Unknown>;
|
|
1983
|
+
declare const isR2Bucket: (value: R2BindingValue) => value is CloudflareR2Bucket;
|
|
2305
1984
|
declare const makeClient$1: (definition: R2Definition) => ((bucket: CloudflareR2Bucket) => R2Client);
|
|
2306
1985
|
declare const layer$1: <Self>(tag: Context.Service<Self, R2Client>, definition: R2Definition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2307
1986
|
declare const make$3: <Id extends string>(id: Id) => TagClass$3<R2Service<Id>, Id>;
|
|
@@ -2365,7 +2044,8 @@ interface TagClass$2<Self, Id extends string> extends Context.ServiceClass<Self,
|
|
|
2365
2044
|
readonly id: Id;
|
|
2366
2045
|
readonly layer: (options: LayerOptions$2) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2367
2046
|
}
|
|
2368
|
-
|
|
2047
|
+
type VectorizeBindingValue = Schema.Schema.Type<typeof Schema.Unknown>;
|
|
2048
|
+
declare const isVectorizeBinding: (value: VectorizeBindingValue) => value is VectorizeBinding;
|
|
2369
2049
|
declare const makeClient: (definition: VectorizeDefinition) => (index: VectorizeBinding) => VectorizeClient;
|
|
2370
2050
|
declare const layer: <Self>(tag: Context.Service<Self, VectorizeClient>, definition: VectorizeDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2371
2051
|
declare const make$2: <Id extends string>(id: Id) => TagClass$2<VectorizeService<Id>, Id>;
|
|
@@ -2486,7 +2166,7 @@ declare const Tag$2: <Self>() => <Id extends string, Payload extends ServiceFree
|
|
|
2486
2166
|
declare const Workflow: typeof Tag$2;
|
|
2487
2167
|
declare const implement$1: <ROut, const Self extends Definition$1.Any>(_definition: Self, handler: Handler$1<ROut, Self>) => Handler$1<ROut, Self>;
|
|
2488
2168
|
declare namespace Workflow_d_exports {
|
|
2489
|
-
export { Definition, Handler, LayerOptions, Options, Tag$1 as Tag, TagClass, WorkflowClass, WorkflowEvent$1 as WorkflowEvent, WorkflowEventService, WorkflowHandler, WorkflowOptions, WorkflowRunContext, WorkflowStep$1 as WorkflowStep, WorkflowStepContext$1 as WorkflowStepContext, WorkflowStepError, WorkflowStepService, implement, make, sleep, sleepUntil, step, waitForEvent };
|
|
2169
|
+
export { Definition, Handler, LayerOptions, Options, Tag$1 as Tag, TagClass, WorkflowClass, WorkflowEvent$1 as WorkflowEvent, WorkflowEventService, WorkflowHandler, WorkflowOptions, WorkflowRunContext, WorkflowStep$1 as WorkflowStep, WorkflowStepContext$1 as WorkflowStepContext, WorkflowStepError, WorkflowStepNonRetryableError, WorkflowStepService, implement, make, sleep, sleepUntil, step, waitForEvent };
|
|
2490
2170
|
}
|
|
2491
2171
|
interface WorkflowEventService<Payload = unknown> {
|
|
2492
2172
|
readonly raw: WorkflowEvent<unknown>;
|
|
@@ -2497,7 +2177,7 @@ interface WorkflowEventService<Payload = unknown> {
|
|
|
2497
2177
|
}
|
|
2498
2178
|
declare const WorkflowEvent_base: Context.ServiceClass<WorkflowEvent$1, "effect-cf/WorkflowEvent", WorkflowEventService<unknown>>;
|
|
2499
2179
|
declare class WorkflowEvent$1 extends WorkflowEvent_base {}
|
|
2500
|
-
declare const WorkflowStepError_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]; }>) =>
|
|
2180
|
+
declare const WorkflowStepError_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]; }>) => Cause.YieldableError & {
|
|
2501
2181
|
readonly _tag: "WorkflowStepError";
|
|
2502
2182
|
} & Readonly<A>;
|
|
2503
2183
|
/** Failure raised when a Cloudflare Workflow step operation rejects. */
|
|
@@ -2508,6 +2188,20 @@ declare class WorkflowStepError extends WorkflowStepError_base<{
|
|
|
2508
2188
|
}> {
|
|
2509
2189
|
get message(): string;
|
|
2510
2190
|
}
|
|
2191
|
+
declare const WorkflowStepNonRetryableError_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]; }>) => Cause.YieldableError & {
|
|
2192
|
+
readonly _tag: "WorkflowStepNonRetryableError";
|
|
2193
|
+
} & Readonly<A>;
|
|
2194
|
+
/**
|
|
2195
|
+
* Typed step failure that Cloudflare must treat as terminal instead of retrying.
|
|
2196
|
+
*
|
|
2197
|
+
* The workflow boundary converts this value into Cloudflare's native
|
|
2198
|
+
* `NonRetryableError` while preserving the original cause and its message.
|
|
2199
|
+
*/
|
|
2200
|
+
declare class WorkflowStepNonRetryableError extends WorkflowStepNonRetryableError_base<{
|
|
2201
|
+
readonly cause: unknown;
|
|
2202
|
+
}> {
|
|
2203
|
+
get message(): string;
|
|
2204
|
+
}
|
|
2511
2205
|
interface WorkflowStepService {
|
|
2512
2206
|
readonly raw: WorkflowStep;
|
|
2513
2207
|
do<A, E, R>(name: string, effect: Effect.Effect<A, E, R>, config?: WorkflowStepConfig): Effect.Effect<A, WorkflowStepError, Exclude<R, WorkflowStepContext$1>>;
|
|
@@ -2553,4 +2247,4 @@ declare const implement: typeof implement$1;
|
|
|
2553
2247
|
type Handler<ROut, Self extends Definition$1.Any> = Handler$1<ROut, Self>;
|
|
2554
2248
|
type Options<ROut, Self extends Definition$1.Any> = Options$1<ROut, Self>;
|
|
2555
2249
|
//#endregion
|
|
2556
|
-
export { AiGateway_d_exports as AiGateway, AnalyticsEngine_d_exports as AnalyticsEngine, Artifacts_d_exports as Artifacts, Binding_d_exports as Binding, BrowserRendering_d_exports as BrowserRendering, Cache_d_exports as Cache, CloudflareOtlp_d_exports as CloudflareOtlp,
|
|
2250
|
+
export { AiGateway_d_exports as AiGateway, AnalyticsEngine_d_exports as AnalyticsEngine, Artifacts_d_exports as Artifacts, Binding_d_exports as Binding, BrowserRendering_d_exports as BrowserRendering, Cache_d_exports as Cache, CloudflareOtlp_d_exports as CloudflareOtlp, ContainerNamespace_d_exports as ContainerNamespace, D1_d_exports as D1, DurableObject_d_exports as DurableObject, DurableObjectAlarm_d_exports as DurableObjectAlarm, DurableObjectDefinition_d_exports as DurableObjectDefinition, DurableObjectNamespace_d_exports as DurableObjectNamespace, DurableObjectRpcWebSocket_d_exports as DurableObjectRpcWebSocket, DurableObjectSqlite_d_exports as DurableObjectSqlite, DurableObjectState_d_exports as DurableObjectState, DurableObjectStorage_d_exports as DurableObjectStorage, DurableObjectWebSocket_d_exports as DurableObjectWebSocket, Email_d_exports as Email, Environment_d_exports as Environment, Hyperdrive_d_exports as Hyperdrive, Images_d_exports as Images, Kv_d_exports as Kv, Queue_d_exports as Queue, QueueBinding_d_exports as QueueBinding, QueueDefinition_d_exports as QueueDefinition, R2_d_exports as R2, Rpc_d_exports as Rpc, RpcDefinition_d_exports as RpcDefinition, ServiceBinding_d_exports as ServiceBinding, Vectorize_d_exports as Vectorize, WebTransport_d_exports as WebTransport, Worker_d_exports as Worker, WorkerConfig, WorkerDefinition_d_exports as WorkerDefinition, type WorkerEnv, WorkerEnvironment, WorkersAi_d_exports as WorkersAi, Workflow_d_exports as Workflow, WorkflowBinding_d_exports as WorkflowBinding, WorkflowDefinition_d_exports as WorkflowDefinition };
|