@effect-agent/platform-cloudflare 0.1.0-beta.85 → 0.1.0-beta.87
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 +9 -5
- package/dist/Alarm.mjs +10 -10
- package/dist/Alarm.mjs.map +1 -1
- package/dist/BrowserRestCapture.d.mts +3 -3
- package/dist/BrowserRestCapture.mjs +3 -3
- package/dist/BrowserRestCapture.mjs.map +1 -1
- package/dist/BrowserRestCrawl.d.mts +2 -2
- package/dist/BrowserRestCrawl.mjs +2 -2
- package/dist/BrowserRestCrawl.mjs.map +1 -1
- package/dist/CloudflareBindings.d.mts +2 -2
- package/dist/CloudflareBindings.mjs +2 -2
- package/dist/CloudflareBindings.mjs.map +1 -1
- package/dist/{CloudflareBrowser-D4YqaTAl.mjs → CloudflareBrowser-DV6kya1H.mjs} +4 -4
- package/dist/CloudflareBrowser-DV6kya1H.mjs.map +1 -0
- package/dist/{CloudflareBrowser-DJq53niJ.d.mts → CloudflareBrowser-Doe1M7R5.d.mts} +4 -4
- package/dist/CloudflareBrowser.d.mts +1 -1
- package/dist/CloudflareBrowser.mjs +1 -1
- package/dist/CloudflareCodeMode.d.mts +2 -2
- package/dist/CloudflareCodeMode.mjs +2 -2
- package/dist/CloudflareCodeMode.mjs.map +1 -1
- package/dist/CloudflareConfig.mjs +3 -3
- package/dist/CloudflareConfig.mjs.map +1 -1
- package/dist/CloudflareMemory.d.mts +26 -26
- package/dist/CloudflareMemory.mjs +11 -11
- package/dist/CloudflareMemory.mjs.map +1 -1
- package/dist/CloudflareScheduling.d.mts +3 -3
- package/dist/CloudflareScheduling.mjs +9 -9
- package/dist/CloudflareScheduling.mjs.map +1 -1
- package/dist/CloudflareSubscriptions.d.mts +5 -5
- package/dist/CloudflareSubscriptions.mjs +8 -8
- package/dist/CloudflareSubscriptions.mjs.map +1 -1
- package/dist/CloudflareThreadClient.d.mts +17 -17
- package/dist/CloudflareThreadClient.mjs +11 -11
- package/dist/CloudflareThreadClient.mjs.map +1 -1
- package/dist/InteractiveBrowser.d.mts +2 -2
- package/dist/InteractiveBrowser.mjs +3 -3
- package/dist/InteractiveBrowser.mjs.map +1 -1
- package/dist/ProtectedBrowser.d.mts +2 -2
- package/dist/ProtectedBrowser.mjs +2 -2
- package/dist/ProtectedBrowser.mjs.map +1 -1
- package/dist/{ThreadObject-DZMkwIBh.d.mts → ThreadObject-BMNq8kuv.d.mts} +71 -71
- package/dist/{ThreadObject-gyx8Qq03.mjs → ThreadObject-DvRG0dDz.mjs} +27 -27
- package/dist/ThreadObject-DvRG0dDz.mjs.map +1 -0
- package/dist/ThreadObject.d.mts +1 -1
- package/dist/ThreadObject.mjs +1 -1
- package/dist/WakeScheduler.d.mts +1 -1
- package/dist/WakeScheduler.mjs +2 -2
- package/dist/WakeScheduler.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{prepared-admission-DSi55W-7.mjs → prepared-admission-DU0_T-ev.mjs} +7 -7
- package/dist/prepared-admission-DU0_T-ev.mjs.map +1 -0
- package/package.json +1 -1
- package/src/Alarm.ts +24 -18
- package/src/BrowserRestCapture.ts +3 -3
- package/src/BrowserRestCrawl.ts +12 -12
- package/src/CloudflareBindings.ts +2 -2
- package/src/CloudflareCodeMode.ts +4 -4
- package/src/CloudflareConfig.ts +3 -3
- package/src/CloudflareMemory.ts +22 -22
- package/src/CloudflareScheduling.ts +11 -11
- package/src/CloudflareSubscriptions.ts +10 -14
- package/src/CloudflareThreadClient.ts +13 -13
- package/src/InteractiveBrowser.ts +15 -15
- package/src/ThreadObject.ts +14 -14
- package/src/WakeScheduler.ts +2 -2
- package/src/internal/browser-quick-action.ts +4 -4
- package/src/internal/layers.ts +47 -47
- package/src/internal/message-delivery.ts +11 -6
- package/src/internal/prepared-admission.ts +7 -7
- package/src/internal/transport.ts +1 -1
- package/src/protected-browser/binding.ts +2 -2
- package/src/protected-browser/native.ts +3 -3
- package/src/protected-browser/policy.ts +13 -13
- package/dist/CloudflareBrowser-D4YqaTAl.mjs.map +0 -1
- package/dist/ThreadObject-gyx8Qq03.mjs.map +0 -1
- package/dist/prepared-admission-DSi55W-7.mjs.map +0 -1
|
@@ -2,28 +2,28 @@ import { DurableObjectContext, ThreadObjectIdentity, ThreadObjectNamespace, Thre
|
|
|
2
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
4
|
import { HostProtocolError, SubmitRequest } from "./CloudflareThreadClient.mjs";
|
|
5
|
-
import { SubmissionId, ThreadId } from "@effect-agent/core/Identifiers";
|
|
6
|
-
import { AgentRegistration } from "@effect-agent/thread/AgentRegistration";
|
|
7
|
-
import { DurableAgentRuntime, DurableRuntimeConfig, RecoveryReport } from "@effect-agent/thread/DurableAgentRuntime";
|
|
8
|
-
import { AdmissionPolicyError, LedgerError, OwnershipLost, SettlementConflict, SubmissionLedger, SubmissionSnapshot } from "@effect-agent/thread/SubmissionLedger";
|
|
9
|
-
import { ThreadProjectionMaintenance } from "@effect-agent/thread/ThreadProjectionMaintenance";
|
|
10
5
|
import { Context, Crypto, Effect, Layer, Option, Schema, Scope } from "effect";
|
|
6
|
+
import { AgentRegistration } from "effect-agent/agent-registration";
|
|
7
|
+
import { DurableAgentRuntime, DurableRuntimeConfig, RecoveryReport } from "effect-agent/durable-agent-runtime";
|
|
8
|
+
import { SubmissionId, ThreadId } from "effect-agent/identifiers";
|
|
9
|
+
import { AdmissionPolicyError, LedgerError, OwnershipLost, SettlementConflict, SubmissionLedger, SubmissionSnapshot } from "effect-agent/submission-ledger";
|
|
10
|
+
import { ThreadProjectionMaintenance } from "effect-agent/thread-projection-maintenance";
|
|
11
11
|
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
12
12
|
import { DurableObject, DurableObjectState as DurableObjectState$1, WorkerEnvironment } from "effect-cf";
|
|
13
|
-
import { DigestError } from "
|
|
14
|
-
import { DurableRuntimeFailpoint, DurableRuntimeFailpointError, DurableRuntimeFailpointHandler } from "
|
|
15
|
-
import { OperationAuthorizerService, OperationDenied } from "
|
|
16
|
-
import { AppendConflict, FenceRejected, ThreadNotMaterialized, ThreadStore, ThreadStoreError } from "
|
|
17
|
-
import { PreparedInputAdmission } from "
|
|
18
|
-
import { PortRequest, PortResponse } from "@effect-agent/storage-cloudflare/
|
|
19
|
-
import { IntegrityReport, ObligationReport, ObligationThresholds, RecoveryExplanation, RetryCommand, RetryRefused } from "
|
|
20
|
-
import { RunJournalError } from "
|
|
21
|
-
import { WakeScheduler } from "
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { ToolReconciler } from "
|
|
13
|
+
import { DigestError } from "effect-agent/digest";
|
|
14
|
+
import { DurableRuntimeFailpoint, DurableRuntimeFailpointError, DurableRuntimeFailpointHandler } from "effect-agent/durable-failpoint";
|
|
15
|
+
import { OperationAuthorizerService, OperationDenied } from "effect-agent/operation-authorizer";
|
|
16
|
+
import { AppendConflict, FenceRejected, ThreadNotMaterialized, ThreadStore, ThreadStoreError } from "effect-agent/thread-store";
|
|
17
|
+
import { PreparedInputAdmission } from "effect-agent/prepared-input-admission";
|
|
18
|
+
import { PortRequest, PortResponse } from "@effect-agent/storage-cloudflare/port-protocol";
|
|
19
|
+
import { IntegrityReport, ObligationReport, ObligationThresholds, RecoveryExplanation, RetryCommand, RetryRefused } from "effect-agent/admin";
|
|
20
|
+
import { RunJournalError } from "effect-agent/run-journal";
|
|
21
|
+
import { WakeScheduler } from "effect-agent/wake-scheduler";
|
|
22
|
+
import { DoStorageFailpoint, DoStorageFailpointHandler } from "@effect-agent/storage-cloudflare/do-storage-failpoint";
|
|
23
|
+
import { DoStorageInitializationError } from "@effect-agent/storage-cloudflare/do-thread-store";
|
|
24
|
+
import { MessageDeliveryError, MessageDeliveryStore } from "effect-agent/message-delivery";
|
|
25
|
+
import { RunContextPreparation, RunCostEstimator, RunToolAuthorization, RunToolFailureObserver } from "effect-agent/run-options";
|
|
26
|
+
import { ToolReconciler } from "effect-agent/tool-reconciler";
|
|
27
27
|
//#region src/internal/progress-wait.d.ts
|
|
28
28
|
declare const ProgressWaitRegistry_base: Context.ServiceClass<ProgressWaitRegistry, "@effect-agent/platform-cloudflare/ProgressWaitRegistry", {
|
|
29
29
|
/** Register a Scope-owned cancellation signal, observing any early cancel tombstone. */
|
|
@@ -155,29 +155,29 @@ interface ThreadPublicationOptions<E = never, R = never, P = never> {
|
|
|
155
155
|
* Tool, Schema, and model requirements remain visible until satisfied by Layer composition.
|
|
156
156
|
* Use Layer.unwrap for registration values that need effectful application setup.
|
|
157
157
|
*/
|
|
158
|
-
declare const registeredLayer: <const Entries extends ReadonlyArray<AgentRegistration>, E = never, R = never>(registrations: Entries, options?: ThreadPublicationOptions<E, R>) => Layer.Layer<CloudflareDurableRuntimeServices, E | DigestError | MessageDeliveryError | DoStorageInitializationError, DurableObjectContext | ThreadObjectNamespace | Exclude<R, SqlClient | SubmissionLedger | ThreadStore> | Exclude<[Entries[number]] extends [never] ? never : Entries[number] extends (infer T_3) ? T_3 extends Entries[number] ? T_3 extends unknown ? (("attemptLayer" extends keyof T_3 ? T_3[keyof T_3 & "attemptLayer"] : undefined) extends (infer T_4) ? T_4 extends ("attemptLayer" extends keyof T_3 ? T_3[keyof T_3 & "attemptLayer"] : undefined) ? T_4 extends ((context: import("
|
|
159
|
-
readonly agent: infer A extends import("
|
|
160
|
-
} ? import("
|
|
161
|
-
readonly agent: infer D extends import("
|
|
162
|
-
readonly instructions: import("
|
|
163
|
-
readonly inputPrompt?: import("
|
|
158
|
+
declare const registeredLayer: <const Entries extends ReadonlyArray<AgentRegistration>, E = never, R = never>(registrations: Entries, options?: ThreadPublicationOptions<E, R>) => Layer.Layer<CloudflareDurableRuntimeServices, E | DigestError | MessageDeliveryError | DoStorageInitializationError, DurableObjectContext | ThreadObjectNamespace | Exclude<R, SqlClient | SubmissionLedger | ThreadStore> | Exclude<[Entries[number]] extends [never] ? never : Entries[number] extends (infer T_3) ? T_3 extends Entries[number] ? T_3 extends unknown ? (("attemptLayer" extends keyof T_3 ? T_3[keyof T_3 & "attemptLayer"] : undefined) extends (infer T_4) ? T_4 extends ("attemptLayer" extends keyof T_3 ? T_3[keyof T_3 & "attemptLayer"] : undefined) ? T_4 extends ((context: import("effect-agent/agent-registration").AgentAttemptContext) => Layer.Layer<infer Provides, never, infer Requires>) ? Requires | Exclude<T_3 extends {
|
|
159
|
+
readonly agent: infer A extends import("effect-agent/agent-registration").ExecutableAgentBinding;
|
|
160
|
+
} ? import("effect-agent/durable-agent-runtime").DurableWorkerRequirements<A> : T_3 extends {
|
|
161
|
+
readonly agent: infer D extends import("effect-agent/agent").Definition<Schema.Top, Schema.Top, unknown, import("effect/unstable/ai/Toolkit").Any, import("effect-agent/agent").RunDispositionDeclaration<never, Schema.Top> | undefined, unknown, Schema.Top | undefined> & {
|
|
162
|
+
readonly instructions: import("effect-agent/agent").InstructionSource<never, unknown, unknown>;
|
|
163
|
+
readonly inputPrompt?: import("effect-agent/agent").InputPromptSource<never, unknown, unknown> | undefined;
|
|
164
164
|
};
|
|
165
|
-
readonly model: infer M extends import("
|
|
166
|
-
} ? import("
|
|
165
|
+
readonly model: infer M extends import("effect-agent/agent-registration").ExecutableAgentBinding["model"];
|
|
166
|
+
} ? import("effect-agent/durable-agent-runtime").DurableWorkerRequirements<{
|
|
167
167
|
readonly definition: D;
|
|
168
168
|
readonly model: M;
|
|
169
169
|
}> : never, Provides> : T_3 extends {
|
|
170
|
-
readonly agent: infer A extends import("
|
|
171
|
-
} ? import("
|
|
172
|
-
readonly agent: infer D extends import("
|
|
173
|
-
readonly instructions: import("
|
|
174
|
-
readonly inputPrompt?: import("
|
|
170
|
+
readonly agent: infer A extends import("effect-agent/agent-registration").ExecutableAgentBinding;
|
|
171
|
+
} ? import("effect-agent/durable-agent-runtime").DurableWorkerRequirements<A> : T_3 extends {
|
|
172
|
+
readonly agent: infer D extends import("effect-agent/agent").Definition<Schema.Top, Schema.Top, unknown, import("effect/unstable/ai/Toolkit").Any, import("effect-agent/agent").RunDispositionDeclaration<never, Schema.Top> | undefined, unknown, Schema.Top | undefined> & {
|
|
173
|
+
readonly instructions: import("effect-agent/agent").InstructionSource<never, unknown, unknown>;
|
|
174
|
+
readonly inputPrompt?: import("effect-agent/agent").InputPromptSource<never, unknown, unknown> | undefined;
|
|
175
175
|
};
|
|
176
|
-
readonly model: infer M extends import("
|
|
177
|
-
} ? import("
|
|
176
|
+
readonly model: infer M extends import("effect-agent/agent-registration").ExecutableAgentBinding["model"];
|
|
177
|
+
} ? import("effect-agent/durable-agent-runtime").DurableWorkerRequirements<{
|
|
178
178
|
readonly definition: D;
|
|
179
179
|
readonly model: M;
|
|
180
|
-
}> : never : never : never) | ("reporting" extends keyof T_3 ? T_3[keyof T_3 & "reporting"] extends (infer T_5) ? T_5 extends T_3[keyof T_3 & "reporting"] ? T_5 extends readonly import("
|
|
180
|
+
}> : never : never : never) | ("reporting" extends keyof T_3 ? T_3[keyof T_3 & "reporting"] extends (infer T_5) ? T_5 extends T_3[keyof T_3 & "reporting"] ? T_5 extends readonly import("effect-agent/subagent-host").WorkerReporting<unknown, unknown>[] ? [T_5[number]] extends [never] ? never : T_5[number] extends import("effect-agent/subagent-host").WorkerReporting<unknown, infer R_1> ? Exclude<R_1, import("effect/Scope").Scope> : never : never : never : never : never) : never : never : never, import("effect/Scope").Scope> | CloudflareBootstrapServices>;
|
|
181
181
|
/** Preserve additional index services only when a projection Layer is actually supplied. */
|
|
182
182
|
declare function layer<const Entries extends ReadonlyArray<AgentRegistration>, E = never, R = never, P = never, PE = never, PR = never>(registrations: Entries, options: Omit<ThreadPublicationOptions<E, R>, "projection"> & {
|
|
183
183
|
readonly projection: Layer.Layer<ThreadProjectionMaintenance | P, PE, PR>;
|
|
@@ -240,7 +240,7 @@ type RuntimeServices = EndpointServices | ThreadObjectNamespace;
|
|
|
240
240
|
* runtime/maintenance instances. The native endpoint uses this path too: queue limits,
|
|
241
241
|
* idempotent receipts and the pre-admission generation/alarm commit have one owner.
|
|
242
242
|
*/
|
|
243
|
-
declare const submit: (threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">, request: SubmitRequest) => Effect.Effect<import("
|
|
243
|
+
declare const submit: (threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">, request: SubmitRequest) => Effect.Effect<import("effect-agent/receipt").Receipt, AdmissionLimitExceeded | DurableAlarmError | HostProtocolError | import("effect-agent/durable-agent-runtime").DurableSubmitFailure, CloudflareDurableRuntimeConfig | DurableAgentRuntime | DurableObjectContext | SubmissionLedger | ThreadMutationGate | ThreadObjectPlacement | ThreadPublication>;
|
|
244
244
|
declare const AdminExplainRequest_base: Schema.Class<AdminExplainRequest, Schema.Struct<{
|
|
245
245
|
readonly submissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
246
246
|
}>, {}>;
|
|
@@ -344,13 +344,13 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
344
344
|
readonly author: string;
|
|
345
345
|
readonly reason: string;
|
|
346
346
|
readonly resolution: {
|
|
347
|
+
readonly _tag: "SafeToRetry";
|
|
348
|
+
} | {
|
|
347
349
|
readonly _tag: "CompletedWithResult";
|
|
348
350
|
readonly result: Schema.Json;
|
|
349
351
|
readonly isFailure: boolean;
|
|
350
352
|
} | {
|
|
351
353
|
readonly _tag: "NeverHappened";
|
|
352
|
-
} | {
|
|
353
|
-
readonly _tag: "SafeToRetry";
|
|
354
354
|
} | {
|
|
355
355
|
readonly _tag: "AbortSubmission";
|
|
356
356
|
};
|
|
@@ -690,22 +690,26 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
690
690
|
} | {
|
|
691
691
|
readonly _tag: "AdminFailed";
|
|
692
692
|
readonly failure: {
|
|
693
|
-
readonly _tag: "
|
|
693
|
+
readonly _tag: "AdmissionPolicyError";
|
|
694
|
+
readonly reason: "occupied" | "refused" | "unavailable";
|
|
695
|
+
readonly code: string;
|
|
696
|
+
} | {
|
|
697
|
+
readonly _tag: "SettlementConflict";
|
|
698
|
+
readonly submissionId: string;
|
|
699
|
+
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
700
|
+
} | {
|
|
701
|
+
readonly _tag: "LedgerError";
|
|
694
702
|
readonly operation: string;
|
|
695
703
|
readonly message: string;
|
|
696
704
|
readonly cause?: Schema.Json | undefined;
|
|
697
705
|
} | {
|
|
698
|
-
readonly _tag: "
|
|
699
|
-
readonly message: string;
|
|
700
|
-
} | {
|
|
701
|
-
readonly _tag: "LedgerError";
|
|
706
|
+
readonly _tag: "ThreadStoreError";
|
|
702
707
|
readonly operation: string;
|
|
703
708
|
readonly message: string;
|
|
704
709
|
readonly cause?: Schema.Json | undefined;
|
|
705
710
|
} | {
|
|
706
|
-
readonly _tag: "
|
|
707
|
-
readonly
|
|
708
|
-
readonly code: string;
|
|
711
|
+
readonly _tag: "ThreadNotMaterialized";
|
|
712
|
+
readonly threadId: string;
|
|
709
713
|
} | {
|
|
710
714
|
readonly _tag: "AppendConflict";
|
|
711
715
|
readonly threadId: string;
|
|
@@ -713,6 +717,17 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
713
717
|
readonly reason: "batch-digest" | "record-identity" | "tail";
|
|
714
718
|
readonly actualTailSequence?: number | undefined;
|
|
715
719
|
readonly actualTailDigest?: string | undefined;
|
|
720
|
+
} | {
|
|
721
|
+
readonly _tag: "FenceRejected";
|
|
722
|
+
readonly threadId: string;
|
|
723
|
+
readonly actualEpoch: number;
|
|
724
|
+
readonly attemptedEpoch: number;
|
|
725
|
+
} | {
|
|
726
|
+
readonly _tag: "OperationDenied";
|
|
727
|
+
readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
|
|
728
|
+
readonly reason: string;
|
|
729
|
+
readonly threadId?: string | undefined;
|
|
730
|
+
readonly submissionId?: string | undefined;
|
|
716
731
|
} | {
|
|
717
732
|
readonly _tag: "DigestError";
|
|
718
733
|
readonly message: string;
|
|
@@ -721,42 +736,27 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
721
736
|
readonly _tag: "DurableRuntimeFailpointError";
|
|
722
737
|
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" | "update:after-canonical-append" | "update:after-delivery-insert" | "update:before-canonical-append" | "update:before-delivery-insert" | "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";
|
|
723
738
|
} | {
|
|
724
|
-
readonly _tag: "
|
|
725
|
-
readonly
|
|
739
|
+
readonly _tag: "OwnershipLost";
|
|
740
|
+
readonly submissionId: string;
|
|
726
741
|
readonly actualEpoch: number;
|
|
727
|
-
readonly attemptedEpoch: number;
|
|
728
742
|
} | {
|
|
729
|
-
readonly _tag: "
|
|
730
|
-
readonly
|
|
743
|
+
readonly _tag: "RunJournalError";
|
|
744
|
+
readonly message: string;
|
|
745
|
+
readonly cause?: Schema.Json | undefined;
|
|
731
746
|
} | {
|
|
732
|
-
readonly _tag: "
|
|
747
|
+
readonly _tag: "DurableAlarmError";
|
|
733
748
|
readonly operation: string;
|
|
734
749
|
readonly message: string;
|
|
735
750
|
readonly cause?: Schema.Json | undefined;
|
|
736
751
|
} | {
|
|
737
|
-
readonly _tag: "
|
|
738
|
-
readonly
|
|
739
|
-
readonly reason: string;
|
|
740
|
-
readonly threadId?: string | undefined;
|
|
741
|
-
readonly submissionId?: string | undefined;
|
|
752
|
+
readonly _tag: "HostProtocolError";
|
|
753
|
+
readonly message: string;
|
|
742
754
|
} | {
|
|
743
755
|
readonly _tag: "RetryRefused";
|
|
744
756
|
readonly submissionId: string;
|
|
745
757
|
readonly refusal: "await-approval-decision" | "await-unknown-resolution" | "settled";
|
|
746
758
|
readonly decisionTag: string;
|
|
747
759
|
readonly message: string;
|
|
748
|
-
} | {
|
|
749
|
-
readonly _tag: "RunJournalError";
|
|
750
|
-
readonly message: string;
|
|
751
|
-
readonly cause?: Schema.Json | undefined;
|
|
752
|
-
} | {
|
|
753
|
-
readonly _tag: "OwnershipLost";
|
|
754
|
-
readonly submissionId: string;
|
|
755
|
-
readonly actualEpoch: number;
|
|
756
|
-
} | {
|
|
757
|
-
readonly _tag: "SettlementConflict";
|
|
758
|
-
readonly submissionId: string;
|
|
759
|
-
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
760
760
|
};
|
|
761
761
|
}, Schema.SchemaError, never>;
|
|
762
762
|
declare const decodeAdminResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AdminFailed | ExplainedRecovery | ObligationsScanned | RetryExecuted | VerifiedIntegrity, Schema.SchemaError, never>;
|
|
@@ -771,7 +771,7 @@ type ThreadRpcOperation = typeof ThreadRpcOperation.Type;
|
|
|
771
771
|
* The producer comes from the actual runtime configuration, never from caller input. These
|
|
772
772
|
* guards supplement the existing current model/Tool and operation authorization policies.
|
|
773
773
|
*/
|
|
774
|
-
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/
|
|
774
|
+
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/do-storage-failpoint").DoStorageFailpoint | DurableObjectContext | DurableRuntimeConfig | import("effect-agent/durable-failpoint").DurableRuntimeFailpoint | import("effect-agent/run-options").RunContextPreparation | import("effect-agent/run-options").RunToolAuthorization | ThreadMaintenanceFailpoint | ThreadObjectPlacement | import("effect-agent/tool-reconciler").ToolReconciler | CloudflareDurableRuntimeServices>;
|
|
775
775
|
/** The public endpoints and effect-cf invocation hook of one Thread Object instance. */
|
|
776
776
|
interface Instance<EventServices = never> extends InstanceType<DurableObject.DurableObjectClass<Record<never, never>, RuntimeServices | EventServices>> {
|
|
777
777
|
submitEncoded(encoded: unknown, traceContext?: unknown): Promise<unknown>;
|
|
@@ -809,4 +809,4 @@ interface Class<EventServices = never> {
|
|
|
809
809
|
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>;
|
|
810
810
|
//#endregion
|
|
811
811
|
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 };
|
|
812
|
-
//# sourceMappingURL=ThreadObject-
|
|
812
|
+
//# sourceMappingURL=ThreadObject-BMNq8kuv.d.mts.map
|
|
@@ -3,38 +3,38 @@ import { DurableObjectContext, ThreadObjectIdentity, ThreadObjectNamespace, Thre
|
|
|
3
3
|
import { AdmissionLimitExceeded, CLOUDFLARE_RUNTIME_DEFAULTS, CloudflareDurableRuntimeConfig, CloudflareDurableRuntimeConfigValue, CloudflarePlatformConfigError } from "./CloudflareConfig.mjs";
|
|
4
4
|
import { DurableAlarmError, DurableAlarmService, ThreadMaintenance, ThreadMaintenanceFailpoint, ThreadMessageDelivery, ThreadMutationGate, ThreadPublication, publishCommitted } from "./Alarm.mjs";
|
|
5
5
|
import { AbortRecorded, ApprovalRecorded, CloudflareThreadClient, HostFailed, HostProtocolError, ObservedPage, ProgressCancelled, ProgressObserved, SettlementReached, SubmissionStatusResponse, SubmitSucceeded, UnknownResolutionRecorded, boundHostDiagnostic, decodeAbortCommand, decodeApprovalDecisionCommand, decodeAwaitProgressRequest, decodeCancelProgressRequest, decodeObservePageRequest, decodeReceipt, decodeSubmitRequest, decodeUnknownResolutionCommand, encodeHostResponse } from "./CloudflareThreadClient.mjs";
|
|
6
|
-
import { t as cloudflarePreparedInputAdmissionLayer } from "./prepared-admission-
|
|
6
|
+
import { t as cloudflarePreparedInputAdmissionLayer } from "./prepared-admission-DU0_T-ev.mjs";
|
|
7
7
|
import { cloudflareWakeSchedulerLayer } from "./WakeScheduler.mjs";
|
|
8
|
-
import { SubmissionId, ThreadId } from "@effect-agent/core/Identifiers";
|
|
9
|
-
import { compileRegistrations } from "@effect-agent/thread/AgentRegistration";
|
|
10
|
-
import { DurableAgentRuntime, DurableRuntimeConfig, RecoveryReport } from "@effect-agent/thread/DurableAgentRuntime";
|
|
11
|
-
import { AdmissionPolicyError, LedgerError, OwnershipLost, SettlementConflict, SubmissionLedger, SubmissionLookupById, SubmissionLookupByKey } from "@effect-agent/thread/SubmissionLedger";
|
|
12
|
-
import { ThreadProjectionMaintenance } from "@effect-agent/thread/ThreadProjectionMaintenance";
|
|
13
8
|
import { Cause, Clock, Context, Deferred, Duration, Effect, Layer, Option, Ref, Schema, Semaphore, Stream } from "effect";
|
|
9
|
+
import { compileRegistrations } from "effect-agent/agent-registration";
|
|
10
|
+
import { DurableAgentRuntime, DurableRuntimeConfig, RecoveryReport } from "effect-agent/durable-agent-runtime";
|
|
11
|
+
import { SubmissionId, ThreadId } from "effect-agent/identifiers";
|
|
12
|
+
import { AdmissionPolicyError, LedgerError, OwnershipLost, SettlementConflict, SubmissionLedger, SubmissionLookupById, SubmissionLookupByKey } from "effect-agent/submission-ledger";
|
|
13
|
+
import { ThreadProjectionMaintenance } from "effect-agent/thread-projection-maintenance";
|
|
14
14
|
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
15
|
-
import { PersistedJson, ProducerId } from "
|
|
15
|
+
import { PersistedJson, ProducerId } from "effect-agent/records";
|
|
16
16
|
import { DurableObject, DurableObjectState, WorkerEnvironment } from "effect-cf";
|
|
17
17
|
import { BrowserCrypto } from "@effect/platform-browser";
|
|
18
18
|
import { SqliteClient } from "@effect/sql-sqlite-do";
|
|
19
|
-
import { DigestError } from "
|
|
20
|
-
import { DurableRuntimeFailpoint, DurableRuntimeFailpointError } from "
|
|
21
|
-
import { OperationAuthorizationRequest, OperationAuthorizer, OperationDenied, operationAuthorizerLayer } from "
|
|
22
|
-
import { AppendConflict, FenceRejected, ThreadNotMaterialized, ThreadRead, ThreadStore, ThreadStoreError } from "
|
|
23
|
-
import "
|
|
24
|
-
import { LedgerLookupResult, PortFailed, PortProtocolError, PortSucceeded, decodePortRequest, encodePortResponse } from "@effect-agent/storage-cloudflare/
|
|
25
|
-
import { IntegrityReport, ObligationReport, ObligationThresholds, RecoveryExplanation, RetryCommand, RetryRefused } from "
|
|
26
|
-
import { RunJournalError } from "
|
|
27
|
-
import { WakeScheduler } from "
|
|
28
|
-
import {
|
|
29
|
-
import
|
|
30
|
-
import "@effect-agent/storage-cloudflare/
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import { ToolReconciler } from "
|
|
19
|
+
import { DigestError } from "effect-agent/digest";
|
|
20
|
+
import { DurableRuntimeFailpoint, DurableRuntimeFailpointError } from "effect-agent/durable-failpoint";
|
|
21
|
+
import { OperationAuthorizationRequest, OperationAuthorizer, OperationDenied, operationAuthorizerLayer } from "effect-agent/operation-authorizer";
|
|
22
|
+
import { AppendConflict, FenceRejected, ThreadNotMaterialized, ThreadRead, ThreadStore, ThreadStoreError } from "effect-agent/thread-store";
|
|
23
|
+
import "effect-agent/prepared-input-admission";
|
|
24
|
+
import { LedgerLookupResult, PortFailed, PortProtocolError, PortSucceeded, decodePortRequest, encodePortResponse } from "@effect-agent/storage-cloudflare/port-protocol";
|
|
25
|
+
import { IntegrityReport, ObligationReport, ObligationThresholds, RecoveryExplanation, RetryCommand, RetryRefused } from "effect-agent/admin";
|
|
26
|
+
import { RunJournalError } from "effect-agent/run-journal";
|
|
27
|
+
import { WakeScheduler } from "effect-agent/wake-scheduler";
|
|
28
|
+
import { doMessageDeliveryStoreLayer } from "@effect-agent/storage-cloudflare/do-message-delivery-store";
|
|
29
|
+
import "@effect-agent/storage-cloudflare/do-storage-failpoint";
|
|
30
|
+
import { submissionLedgerLayer } from "@effect-agent/storage-cloudflare/do-submission-ledger";
|
|
31
|
+
import { storageConfigLayer, storageFailpointLayer, threadStoreLayer } from "@effect-agent/storage-cloudflare/do-thread-store";
|
|
32
|
+
import { ThreadPortTransport, executePortRequest, portTransportFailure, routedSubmissionLedgerLayer, routedThreadStoreLayer } from "@effect-agent/storage-cloudflare/port-routing";
|
|
33
|
+
import { MessageDeliveryDriver, MessageDeliveryError, MessageDeliveryStore } from "effect-agent/message-delivery";
|
|
34
|
+
import { CurrentToolFailureObserver, RunContextPreparationPassthrough, RunToolAuthorization, toolFailureObserverLayer } from "effect-agent/run-options";
|
|
35
|
+
import { ToolReconciler } from "effect-agent/tool-reconciler";
|
|
36
36
|
//#region src/internal/message-delivery.ts
|
|
37
|
-
/** Every
|
|
37
|
+
/** Every write prearms its owner; the delivery due index owns its recovery deadline. */
|
|
38
38
|
const guardedMessageDeliveryStoreLayer = Layer.effect(MessageDeliveryStore, Effect.gen(function* () {
|
|
39
39
|
const store = yield* MessageDeliveryStore;
|
|
40
40
|
const mutations = yield* ThreadMutationGate;
|
|
@@ -46,7 +46,7 @@ const guardedMessageDeliveryStoreLayer = Layer.effect(MessageDeliveryStore, Effe
|
|
|
46
46
|
reason: "validation",
|
|
47
47
|
operation: "message owner"
|
|
48
48
|
}));
|
|
49
|
-
const mutate = (body) => mutations.withMutation(cacheGate.withPermit(Ref.set(deadline, void 0).pipe(Effect.andThen(body)))).pipe(Effect.catchTag("DurableAlarmError", () => MessageDeliveryError.make({
|
|
49
|
+
const mutate = (body) => mutations.withMutation(cacheGate.withPermit(Ref.set(deadline, void 0).pipe(Effect.andThen(body))), { invalidatesRecovery: false }).pipe(Effect.catchTag("DurableAlarmError", () => MessageDeliveryError.make({
|
|
50
50
|
reason: "storage",
|
|
51
51
|
operation: "prearm message delivery"
|
|
52
52
|
})));
|
|
@@ -832,4 +832,4 @@ const make = (applicationLayer, options) => {
|
|
|
832
832
|
//#endregion
|
|
833
833
|
export { layer as C, layerInHost as E, ThreadObjectPorts as S, layerHostConfig as T, encodeAdminResponse as _, AdminVerifyRequest as a, portCall as b, RetryExecuted as c, VerifiedIntegrity as d, decodeAdminExplainRequest as f, decodeRetryCommand as g, decodeObligationThresholds as h, AdminResponse as i, ThreadObject_exports as l, decodeAdminVerifyRequest as m, AdminFailed as n, ExplainedRecovery as o, decodeAdminResponse as p, AdminFailure as r, ObligationsScanned as s, AdminExplainRequest as t, ThreadRpcOperation as u, handleRpc as v, layerConfig as w, submit as x, make as y };
|
|
834
834
|
|
|
835
|
-
//# sourceMappingURL=ThreadObject-
|
|
835
|
+
//# sourceMappingURL=ThreadObject-DvRG0dDz.mjs.map
|