@effect-agent/platform-cloudflare 0.1.0-beta.79 → 0.1.0-beta.80
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/dist/Alarm.d.mts +17 -5
- package/dist/Alarm.mjs +48 -12
- package/dist/Alarm.mjs.map +1 -1
- package/dist/CloudflareBindings.d.mts +14 -7
- package/dist/CloudflareBindings.mjs +10 -7
- package/dist/CloudflareBindings.mjs.map +1 -1
- package/dist/CloudflareScheduling.mjs +2 -2
- package/dist/CloudflareSubscriptions.mjs +1 -1
- package/dist/CloudflareThreadClient.d.mts +41 -41
- package/dist/CloudflareThreadClient.mjs +3 -3
- package/dist/CloudflareThreadClient.mjs.map +1 -1
- package/dist/{ThreadObject-MuU9xAyn.d.mts → ThreadObject-3uDpKfB3.d.mts} +82 -44
- package/dist/{ThreadObject-KJf_5Isr.mjs → ThreadObject-DGkXv41C.mjs} +213 -68
- package/dist/ThreadObject-DGkXv41C.mjs.map +1 -0
- package/dist/ThreadObject.d.mts +2 -2
- package/dist/ThreadObject.mjs +2 -2
- package/dist/WakeScheduler.d.mts +2 -2
- package/dist/WakeScheduler.mjs +6 -6
- package/dist/WakeScheduler.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{prepared-admission-G7N4DDqS.mjs → prepared-admission-DSi55W-7.mjs} +2 -2
- package/dist/{prepared-admission-G7N4DDqS.mjs.map → prepared-admission-DSi55W-7.mjs.map} +1 -1
- package/package.json +1 -1
- package/src/Alarm.ts +91 -14
- package/src/CloudflareBindings.ts +15 -6
- package/src/CloudflareThreadClient.ts +3 -3
- package/src/ThreadObject.ts +284 -59
- package/src/WakeScheduler.ts +6 -6
- package/src/internal/layers.ts +150 -22
- package/src/internal/message-delivery.ts +37 -21
- package/src/internal/transport.ts +2 -2
- package/dist/ThreadObject-KJf_5Isr.mjs.map +0 -1
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { DurableObjectContext, ThreadObjectIdentity, ThreadObjectNamespace } from "./CloudflareBindings.mjs";
|
|
2
|
-
import { c as CloudflarePlatformConfigError, o as CloudflareDurableRuntimeConfig } from "./CloudflareConfig-f3CqTel1.mjs";
|
|
1
|
+
import { DurableObjectContext, ThreadObjectIdentity, ThreadObjectNamespace, ThreadObjectPlacement } from "./CloudflareBindings.mjs";
|
|
2
|
+
import { c as CloudflarePlatformConfigError, o as CloudflareDurableRuntimeConfig, t as AdmissionLimitExceeded } from "./CloudflareConfig-f3CqTel1.mjs";
|
|
3
3
|
import { DurableAlarmError, DurableAlarmService, ThreadMaintenance, ThreadMaintenanceFailpoint, ThreadMaintenanceFailpointHandler, ThreadMutationGate, ThreadPublication } from "./Alarm.mjs";
|
|
4
|
-
import { HostProtocolError } from "./CloudflareThreadClient.mjs";
|
|
4
|
+
import { HostProtocolError, SubmitRequest } from "./CloudflareThreadClient.mjs";
|
|
5
|
+
import { SubmissionId, ThreadId } from "@effect-agent/core/Identifiers";
|
|
5
6
|
import { AgentRegistration } from "@effect-agent/thread/AgentRegistration";
|
|
6
7
|
import { DurableAgentRuntime, DurableRuntimeConfig, RecoveryReport } from "@effect-agent/thread/DurableAgentRuntime";
|
|
7
|
-
import { AdmissionPolicyError, LedgerError, OwnershipLost, SettlementConflict, SubmissionLedger } from "@effect-agent/thread/SubmissionLedger";
|
|
8
|
+
import { AdmissionPolicyError, LedgerError, OwnershipLost, SettlementConflict, SubmissionLedger, SubmissionSnapshot } from "@effect-agent/thread/SubmissionLedger";
|
|
8
9
|
import { ThreadProjectionMaintenance } from "@effect-agent/thread/ThreadProjectionMaintenance";
|
|
9
|
-
import { Context, Crypto, Effect, Layer, Schema, Scope } from "effect";
|
|
10
|
+
import { Context, Crypto, Effect, Layer, Option, Schema, Scope } from "effect";
|
|
10
11
|
import { DurableObject, DurableObjectState as DurableObjectState$1, WorkerEnvironment } from "effect-cf";
|
|
11
12
|
import { DigestError } from "@effect-agent/thread/Digest";
|
|
12
13
|
import { DurableRuntimeFailpoint, DurableRuntimeFailpointError, DurableRuntimeFailpointHandler } from "@effect-agent/thread/DurableFailpoint";
|
|
13
14
|
import { OperationAuthorizerService, OperationDenied } from "@effect-agent/thread/OperationAuthorizer";
|
|
14
15
|
import { AppendConflict, FenceRejected, ThreadNotMaterialized, ThreadStore, ThreadStoreError } from "@effect-agent/thread/ThreadStore";
|
|
16
|
+
import { PreparedInputAdmission } from "@effect-agent/thread/PreparedInputAdmission";
|
|
15
17
|
import { PortRequest, PortResponse } from "@effect-agent/storage-cloudflare/PortProtocol";
|
|
16
18
|
import { IntegrityReport, ObligationReport, ObligationThresholds, RecoveryExplanation, RetryCommand, RetryRefused } from "@effect-agent/thread/Admin";
|
|
17
19
|
import { RunJournalError } from "@effect-agent/thread/RunJournal";
|
|
@@ -99,7 +101,7 @@ interface CloudflareDurableRuntimeOptions {
|
|
|
99
101
|
readonly toolReconciler?: Layer.Layer<ToolReconciler> | undefined;
|
|
100
102
|
}
|
|
101
103
|
/** Services supplied before the application graph is built, including its dependencies. */
|
|
102
|
-
type CloudflareBootstrapServices = CloudflareDurableRuntimeConfig | ThreadObjectIdentity | DurableRuntimeConfig | Crypto.Crypto | DoStorageFailpoint | DurableRuntimeFailpoint | ThreadMaintenanceFailpoint | RunContextPreparation | RunToolAuthorization | ToolReconciler;
|
|
104
|
+
type CloudflareBootstrapServices = CloudflareDurableRuntimeConfig | ThreadObjectIdentity | ThreadObjectPlacement | DurableRuntimeConfig | Crypto.Crypto | DoStorageFailpoint | DurableRuntimeFailpoint | ThreadMaintenanceFailpoint | RunContextPreparation | RunToolAuthorization | ToolReconciler;
|
|
103
105
|
/** Every construction failure of the assembled Cloudflare durable runtime stack. */
|
|
104
106
|
type CloudflareDurableRuntimeInitializationError = CloudflarePlatformConfigError | DigestError | MessageDeliveryError | DoStorageInitializationError;
|
|
105
107
|
/**
|
|
@@ -110,6 +112,8 @@ type CloudflareDurableRuntimeInitializationError = CloudflarePlatformConfigError
|
|
|
110
112
|
type CloudflareDurableRuntimeServices = DurableAgentRuntime | SubmissionLedger | ThreadStore | MessageDeliveryStore | WakeScheduler | DurableAlarmService | ThreadMaintenance | ThreadMutationGate | ThreadPublication | ThreadProjectionMaintenance | ThreadObjectPorts | ProgressWaitRegistry | SqlClient;
|
|
111
113
|
declare const ThreadObjectPorts_base: Context.ServiceClass<ThreadObjectPorts, "@effect-agent/platform-cloudflare/ThreadObjectPorts", {
|
|
112
114
|
readonly handle: (request: PortRequest) => Effect.Effect<PortResponse>;
|
|
115
|
+
/** Local-only identity check before a bound RPC can read or mutate a Submission. */
|
|
116
|
+
readonly lookupSubmission: (submissionId: SubmissionId) => Effect.Effect<Option.Option<SubmissionSnapshot>, LedgerError>;
|
|
113
117
|
}>;
|
|
114
118
|
/**
|
|
115
119
|
* Owner-side execution port for a `portCall` request the wire endpoint has already decoded.
|
|
@@ -118,12 +122,14 @@ declare const ThreadObjectPorts_base: Context.ServiceClass<ThreadObjectPorts, "@
|
|
|
118
122
|
* encode.
|
|
119
123
|
*/
|
|
120
124
|
declare class ThreadObjectPorts extends ThreadObjectPorts_base {}
|
|
125
|
+
/** Native one-Thread configuration; retains its existing producer and logical identities. */
|
|
126
|
+
declare const layerConfig: (options: CloudflareDurableRuntimeOptions) => Layer.Layer<CloudflareBootstrapServices, CloudflarePlatformConfigError, DurableObjectContext>;
|
|
121
127
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
128
|
+
* Configuration for an application Object owning several logical Threads. The producer is
|
|
129
|
+
* the stable physical Object. No logical identity is installed globally: handleRpc binds and
|
|
130
|
+
* validates it per request using the placement guard and this actual runtime producer.
|
|
125
131
|
*/
|
|
126
|
-
declare const
|
|
132
|
+
declare const layerHostConfig: (options: CloudflareDurableRuntimeOptions, ownsThread: (threadId: ThreadId) => boolean) => Layer.Layer<Exclude<CloudflareBootstrapServices, ThreadObjectIdentity>, CloudflarePlatformConfigError, DurableObjectContext>;
|
|
127
133
|
interface ThreadPublicationOptions<E = never, R = never, P = never> {
|
|
128
134
|
/**
|
|
129
135
|
* Optional host outbox consumer, built once per incarnation with RAW LOCAL ThreadStore and
|
|
@@ -181,8 +187,21 @@ declare function layer<const Entries extends ReadonlyArray<AgentRegistration>, E
|
|
|
181
187
|
readonly projection: Layer.Layer<ThreadProjectionMaintenance | P, PE, PR>;
|
|
182
188
|
}): Layer.Layer<Layer.Success<ReturnType<typeof registeredLayer<Entries, E | PE, R | PR>>> | P, Layer.Error<ReturnType<typeof registeredLayer<Entries, E | PE, R | PR>>>, Layer.Services<ReturnType<typeof registeredLayer<Entries, E | PE, R | PR>>>>;
|
|
183
189
|
declare function layer<const Entries extends ReadonlyArray<AgentRegistration>, E = never, R = never>(registrations: Entries, options?: ThreadPublicationOptions<E, R>): ReturnType<typeof registeredLayer<Entries, E, R>>;
|
|
190
|
+
/**
|
|
191
|
+
* Build the application runtime over the existing owner SqlClient and native ports, then
|
|
192
|
+
* assemble its one maintenance coordinator. The application may acquire its Bindings from
|
|
193
|
+
* those ports and expose extra services, including ThreadHostMaintenance. It must not acquire
|
|
194
|
+
* another runtime stack or require ThreadMaintenance while constructing this Layer.
|
|
195
|
+
* Supply layerHostConfig and deterministic placement; dispatch addressed ingress with handleRpc.
|
|
196
|
+
*/
|
|
197
|
+
declare function layerInHost<A, E, R, P = never, PE = never, PR = never>(application: Layer.Layer<DurableAgentRuntime | A, E, R>, options: Omit<ThreadPublicationOptions<PE, PR>, "projection"> & {
|
|
198
|
+
readonly projection: Layer.Layer<ThreadProjectionMaintenance | P, PE, PR>;
|
|
199
|
+
}): Layer.Layer<CloudflareDurableRuntimeServices | A | P, Layer.Error<ReturnType<typeof sharedLayer<A, E, R, PE, PR>>>, Layer.Services<ReturnType<typeof sharedLayer<A, E, Exclude<R, P>, PE, PR>>>>;
|
|
200
|
+
declare function layerInHost<A, E, R, PE = never, PR = never>(application: Layer.Layer<DurableAgentRuntime | A, E, R>, options?: ThreadPublicationOptions<PE, PR>): ReturnType<typeof sharedLayer<A, E, R, PE, PR>>;
|
|
201
|
+
type HostRuntimeServices = Exclude<CloudflareDurableRuntimeServices, DurableAgentRuntime | ThreadMaintenance>;
|
|
202
|
+
declare const sharedLayer: <A, E, R, PE = never, PR = never>(application: Layer.Layer<DurableAgentRuntime | A, E, R>, options?: ThreadPublicationOptions<PE, PR>) => Layer.Layer<CloudflareDurableRuntimeServices | A, DoStorageInitializationError | MessageDeliveryError | E | PE, DurableObjectContext | ThreadObjectNamespace | Exclude<CloudflareBootstrapServices, ThreadObjectIdentity> | SqlClient | Exclude<R, HostRuntimeServices | PreparedInputAdmission> | Exclude<PR, ThreadStore | SubmissionLedger | SqlClient>>;
|
|
184
203
|
declare namespace ThreadObject_d_exports {
|
|
185
|
-
export { AdminExplainRequest, AdminFailed, AdminFailure, AdminResponse, AdminVerifyRequest, CloudflareBootstrapServices as BootstrapServices, Class, ExplainedRecovery, CloudflareDurableRuntimeInitializationError as InitializationError, Instance, ObligationsScanned, Options, ThreadPublicationOptions as PublicationOptions, RetryExecuted, CloudflareDurableRuntimeOptions as RuntimeOptions, CloudflareDurableRuntimeServices as Services, VerifiedIntegrity, decodeAdminExplainRequest, decodeAdminResponse, decodeAdminVerifyRequest, decodeObligationThresholds, decodeRetryCommand, encodeAdminResponse, layer, layerConfig, make };
|
|
204
|
+
export { AdminExplainRequest, AdminFailed, AdminFailure, AdminResponse, AdminVerifyRequest, CloudflareBootstrapServices as BootstrapServices, Class, ExplainedRecovery, CloudflareDurableRuntimeInitializationError as InitializationError, Instance, ObligationsScanned, Options, ThreadPublicationOptions as PublicationOptions, RetryExecuted, CloudflareDurableRuntimeOptions as RuntimeOptions, CloudflareDurableRuntimeServices as Services, ThreadObjectPorts, ThreadRpcOperation, VerifiedIntegrity, decodeAdminExplainRequest, decodeAdminResponse, decodeAdminVerifyRequest, decodeObligationThresholds, decodeRetryCommand, encodeAdminResponse, handleRpc, layer, layerConfig, layerHostConfig, layerInHost, make, portCall, submit };
|
|
186
205
|
}
|
|
187
206
|
/**
|
|
188
207
|
* `ThreadObject.make(application, options)` — the Thread Durable Object
|
|
@@ -219,6 +238,13 @@ interface Options<ApplicationServices = never, EventServices = never, EventLayer
|
|
|
219
238
|
}
|
|
220
239
|
type EndpointServices = CloudflareDurableRuntimeServices | CloudflareBootstrapServices | DurableObjectContext;
|
|
221
240
|
type RuntimeServices = EndpointServices | ThreadObjectNamespace;
|
|
241
|
+
/**
|
|
242
|
+
* Admit an already Schema-decoded request to a logical Thread in this physical owner.
|
|
243
|
+
* Custom hosts validate local placement before calling this Effect and provide their same
|
|
244
|
+
* runtime/maintenance instances. The native endpoint uses this path too: queue limits,
|
|
245
|
+
* idempotent receipts and the pre-admission generation/alarm commit have one owner.
|
|
246
|
+
*/
|
|
247
|
+
declare const submit: (threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">, request: SubmitRequest) => Effect.Effect<import("@effect-agent/core/Receipt").Receipt, AdmissionLimitExceeded | DurableAlarmError | HostProtocolError | import("@effect-agent/thread/DurableAgentRuntime").DurableSubmitFailure, CloudflareDurableRuntimeConfig | DurableAgentRuntime | DurableObjectContext | SubmissionLedger | ThreadMutationGate | ThreadObjectPlacement | ThreadPublication>;
|
|
222
248
|
declare const AdminExplainRequest_base: Schema.Class<AdminExplainRequest, Schema.Struct<{
|
|
223
249
|
readonly submissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
224
250
|
}>, {}>;
|
|
@@ -322,13 +348,13 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
322
348
|
readonly author: string;
|
|
323
349
|
readonly reason: string;
|
|
324
350
|
readonly resolution: {
|
|
325
|
-
readonly _tag: "SafeToRetry";
|
|
326
|
-
} | {
|
|
327
351
|
readonly _tag: "CompletedWithResult";
|
|
328
352
|
readonly result: Schema.Json;
|
|
329
353
|
readonly isFailure: boolean;
|
|
330
354
|
} | {
|
|
331
355
|
readonly _tag: "NeverHappened";
|
|
356
|
+
} | {
|
|
357
|
+
readonly _tag: "SafeToRetry";
|
|
332
358
|
} | {
|
|
333
359
|
readonly _tag: "AbortSubmission";
|
|
334
360
|
};
|
|
@@ -673,26 +699,17 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
673
699
|
readonly message: string;
|
|
674
700
|
readonly cause?: Schema.Json | undefined;
|
|
675
701
|
} | {
|
|
676
|
-
readonly _tag: "
|
|
677
|
-
readonly reason: "occupied" | "refused" | "unavailable";
|
|
678
|
-
readonly code: string;
|
|
679
|
-
} | {
|
|
680
|
-
readonly _tag: "SettlementConflict";
|
|
681
|
-
readonly submissionId: string;
|
|
682
|
-
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
683
|
-
} | {
|
|
684
|
-
readonly _tag: "LedgerError";
|
|
685
|
-
readonly operation: string;
|
|
702
|
+
readonly _tag: "HostProtocolError";
|
|
686
703
|
readonly message: string;
|
|
687
|
-
readonly cause?: Schema.Json | undefined;
|
|
688
704
|
} | {
|
|
689
|
-
readonly _tag: "
|
|
705
|
+
readonly _tag: "LedgerError";
|
|
690
706
|
readonly operation: string;
|
|
691
707
|
readonly message: string;
|
|
692
708
|
readonly cause?: Schema.Json | undefined;
|
|
693
709
|
} | {
|
|
694
|
-
readonly _tag: "
|
|
695
|
-
readonly
|
|
710
|
+
readonly _tag: "AdmissionPolicyError";
|
|
711
|
+
readonly reason: "occupied" | "refused" | "unavailable";
|
|
712
|
+
readonly code: string;
|
|
696
713
|
} | {
|
|
697
714
|
readonly _tag: "AppendConflict";
|
|
698
715
|
readonly threadId: string;
|
|
@@ -700,11 +717,26 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
700
717
|
readonly reason: "batch-digest" | "record-identity" | "tail";
|
|
701
718
|
readonly actualTailSequence?: number | undefined;
|
|
702
719
|
readonly actualTailDigest?: string | undefined;
|
|
720
|
+
} | {
|
|
721
|
+
readonly _tag: "DigestError";
|
|
722
|
+
readonly message: string;
|
|
723
|
+
readonly cause?: Schema.Json | undefined;
|
|
724
|
+
} | {
|
|
725
|
+
readonly _tag: "DurableRuntimeFailpointError";
|
|
726
|
+
readonly location: "abort:after-intent" | "approval:after-request-append" | "approval:after-suspend" | "checkpoint:after-save" | "checkpoint:before-save" | "claim:after-claim" | "compaction:after-canonical-append" | "compaction:before-canonical-append" | "input:after-canonical-append" | "join:after-canonical-append" | "join:after-claim" | "policy:after-reservation-append" | "policy:before-reservation-append" | "resolve:after-intent" | "run:after-start-append" | "run:before-start-append" | "step:after-step-append" | "subagent:after-admit" | "subagent:after-child-abort-intent" | "subagent:after-child-ready" | "subagent:after-join-append" | "subagent:after-release" | "subagent:after-release-pending" | "subagent:after-request-append" | "subagent:after-reserve" | "subagent:after-sibling-settle" | "subagent:after-start-append" | "subagent:after-suspend" | "subagent:before-join-append" | "submit:after-admit" | "submit:after-materialize" | "terminalize:after-canonical-append" | "terminalize:after-reserve" | "tools:after-prepared-append" | "tools:before-prepared-append" | "turn:after-canonical-append" | "turn:after-response-append" | "turn:after-results-append" | "worker:after-completion-append" | "worker:after-origin-append" | "worker:after-report-append" | "worker:after-report-delivery" | "worker:after-source-append" | "worker:after-subtree-append" | "worker:before-completion-append" | "worker:before-origin-append" | "worker:before-report-append" | "worker:before-report-delivery" | "worker:before-source-append" | "worker:before-subtree-append";
|
|
703
727
|
} | {
|
|
704
728
|
readonly _tag: "FenceRejected";
|
|
705
729
|
readonly threadId: string;
|
|
706
730
|
readonly actualEpoch: number;
|
|
707
731
|
readonly attemptedEpoch: number;
|
|
732
|
+
} | {
|
|
733
|
+
readonly _tag: "ThreadNotMaterialized";
|
|
734
|
+
readonly threadId: string;
|
|
735
|
+
} | {
|
|
736
|
+
readonly _tag: "ThreadStoreError";
|
|
737
|
+
readonly operation: string;
|
|
738
|
+
readonly message: string;
|
|
739
|
+
readonly cause?: Schema.Json | undefined;
|
|
708
740
|
} | {
|
|
709
741
|
readonly _tag: "OperationDenied";
|
|
710
742
|
readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
|
|
@@ -712,32 +744,38 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
712
744
|
readonly threadId?: string | undefined;
|
|
713
745
|
readonly submissionId?: string | undefined;
|
|
714
746
|
} | {
|
|
715
|
-
readonly _tag: "
|
|
747
|
+
readonly _tag: "SettlementConflict";
|
|
716
748
|
readonly submissionId: string;
|
|
717
|
-
readonly
|
|
718
|
-
readonly decisionTag: string;
|
|
719
|
-
readonly message: string;
|
|
720
|
-
} | {
|
|
721
|
-
readonly _tag: "RunJournalError";
|
|
722
|
-
readonly message: string;
|
|
723
|
-
readonly cause?: Schema.Json | undefined;
|
|
724
|
-
} | {
|
|
725
|
-
readonly _tag: "DigestError";
|
|
726
|
-
readonly message: string;
|
|
727
|
-
readonly cause?: Schema.Json | undefined;
|
|
749
|
+
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
728
750
|
} | {
|
|
729
751
|
readonly _tag: "OwnershipLost";
|
|
730
752
|
readonly submissionId: string;
|
|
731
753
|
readonly actualEpoch: number;
|
|
732
754
|
} | {
|
|
733
|
-
readonly _tag: "
|
|
734
|
-
readonly
|
|
755
|
+
readonly _tag: "RunJournalError";
|
|
756
|
+
readonly message: string;
|
|
757
|
+
readonly cause?: Schema.Json | undefined;
|
|
735
758
|
} | {
|
|
736
|
-
readonly _tag: "
|
|
759
|
+
readonly _tag: "RetryRefused";
|
|
760
|
+
readonly submissionId: string;
|
|
761
|
+
readonly refusal: "await-approval-decision" | "await-unknown-resolution" | "settled";
|
|
762
|
+
readonly decisionTag: string;
|
|
737
763
|
readonly message: string;
|
|
738
764
|
};
|
|
739
765
|
}, Schema.SchemaError, never>;
|
|
740
766
|
declare const decodeAdminResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AdminFailed | ExplainedRecovery | ObligationsScanned | RetryExecuted | VerifiedIntegrity, Schema.SchemaError, never>;
|
|
767
|
+
declare const portCall: (encoded: unknown) => Effect.Effect<unknown, never, ThreadObjectPorts | ThreadMaintenance | DurableAlarmService | ThreadObjectIdentity>;
|
|
768
|
+
/** The per-Thread wire operations supported by native and application-owned endpoints. */
|
|
769
|
+
declare const ThreadRpcOperation: Schema.Literals<readonly ["submitEncoded", "submissionStatusEncoded", "awaitSettlementEncoded", "awaitProgressEncoded", "cancelProgressEncoded", "observePage", "abortEncoded", "resolveApprovalEncoded", "resolveUnknownEncoded", "portCall", "wake"]>;
|
|
770
|
+
type ThreadRpcOperation = typeof ThreadRpcOperation.Type;
|
|
771
|
+
/**
|
|
772
|
+
* Bind an addressed request to its logical Thread while sharing one physical runtime. This
|
|
773
|
+
* validates local placement before invoking the same native handlers. Receipts, Submission
|
|
774
|
+
* commands and port envelopes must match this identity; progress cancellation is Thread-scoped.
|
|
775
|
+
* The producer comes from the actual runtime configuration, never from caller input. These
|
|
776
|
+
* guards supplement the existing current model/Tool and operation authorization policies.
|
|
777
|
+
*/
|
|
778
|
+
declare const handleRpc: (threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">, operation: "abortEncoded" | "awaitProgressEncoded" | "awaitSettlementEncoded" | "cancelProgressEncoded" | "observePage" | "portCall" | "resolveApprovalEncoded" | "resolveUnknownEncoded" | "submissionStatusEncoded" | "submitEncoded" | "wake", encoded: unknown) => Effect.Effect<unknown, HostProtocolError, CloudflareDurableRuntimeConfig | import("effect/Crypto").Crypto | import("@effect-agent/storage-cloudflare/DoStorageFailpoint").DoStorageFailpoint | DurableObjectContext | DurableRuntimeConfig | import("@effect-agent/thread/DurableFailpoint").DurableRuntimeFailpoint | import("@effect-agent/engine/RunOptions").RunContextPreparation | import("@effect-agent/engine/RunOptions").RunToolAuthorization | ThreadMaintenanceFailpoint | ThreadObjectPlacement | import("@effect-agent/thread/ToolReconciler").ToolReconciler | CloudflareDurableRuntimeServices>;
|
|
741
779
|
/** The public endpoints and effect-cf invocation hook of one Thread Object instance. */
|
|
742
780
|
interface Instance<EventServices = never> extends InstanceType<DurableObject.DurableObjectClass<Record<never, never>, RuntimeServices | EventServices>> {
|
|
743
781
|
submitEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
|
|
@@ -774,5 +812,5 @@ interface Class<EventServices = never> {
|
|
|
774
812
|
*/
|
|
775
813
|
declare const make: <ApplicationServices, ApplicationError, EventServices = never, EventLayerError = never>(applicationLayer: Layer.Layer<CloudflareDurableRuntimeServices | ApplicationServices, ApplicationError, CloudflareBootstrapServices | DurableObjectState$1.DurableObjectState | WorkerEnvironment | DurableObjectContext | ThreadObjectNamespace>, options: Options<ApplicationServices, EventServices, EventLayerError>) => Class<ApplicationServices | EventServices>;
|
|
776
814
|
//#endregion
|
|
777
|
-
export {
|
|
778
|
-
//# sourceMappingURL=ThreadObject-
|
|
815
|
+
export { ThreadPublicationOptions as A, portCall as C, CloudflareDurableRuntimeOptions as D, CloudflareDurableRuntimeInitializationError as E, layerConfig as M, layerHostConfig as N, CloudflareDurableRuntimeServices as O, layerInHost as P, make as S, CloudflareBootstrapServices as T, decodeAdminVerifyRequest as _, AdminVerifyRequest as a, encodeAdminResponse as b, Instance as c, RetryExecuted as d, ThreadObject_d_exports as f, decodeAdminResponse as g, decodeAdminExplainRequest as h, AdminResponse as i, layer as j, ThreadObjectPorts as k, ObligationsScanned as l, VerifiedIntegrity as m, AdminFailed as n, Class as o, ThreadRpcOperation as p, AdminFailure as r, ExplainedRecovery as s, AdminExplainRequest as t, Options as u, decodeObligationThresholds as v, submit as w, handleRpc as x, decodeRetryCommand as y };
|
|
816
|
+
//# sourceMappingURL=ThreadObject-3uDpKfB3.d.mts.map
|