@effect-agent/platform-cloudflare 0.1.0-beta.49 → 0.1.0-beta.50
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/CloudflareCodeMode.mjs +0 -7
- package/dist/CloudflareCodeMode.mjs.map +1 -1
- package/dist/CloudflareThreadClient.d.mts +66 -65
- package/dist/InteractiveBrowser.mjs +2 -1
- package/dist/InteractiveBrowser.mjs.map +1 -1
- package/dist/{ThreadObject-D-NmQZC0.d.mts → ThreadObject-CmeEjnBK.d.mts} +30 -30
- package/dist/ThreadObject.d.mts +1 -1
- package/dist/index.d.mts +1 -1
- package/package.json +1 -1
- package/src/CloudflareCodeMode.ts +0 -12
- package/src/InteractiveBrowser.ts +3 -1
|
@@ -286,13 +286,13 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
286
286
|
readonly author: string;
|
|
287
287
|
readonly reason: string;
|
|
288
288
|
readonly resolution: {
|
|
289
|
+
readonly _tag: "SafeToRetry";
|
|
290
|
+
} | {
|
|
289
291
|
readonly _tag: "CompletedWithResult";
|
|
290
292
|
readonly result: Schema.Json;
|
|
291
293
|
readonly isFailure: boolean;
|
|
292
294
|
} | {
|
|
293
295
|
readonly _tag: "NeverHappened";
|
|
294
|
-
} | {
|
|
295
|
-
readonly _tag: "SafeToRetry";
|
|
296
296
|
} | {
|
|
297
297
|
readonly _tag: "AbortSubmission";
|
|
298
298
|
};
|
|
@@ -632,38 +632,14 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
632
632
|
} | {
|
|
633
633
|
readonly _tag: "AdminFailed";
|
|
634
634
|
readonly failure: {
|
|
635
|
-
readonly _tag: "
|
|
636
|
-
readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
|
|
637
|
-
readonly reason: string;
|
|
638
|
-
readonly threadId?: string | undefined;
|
|
639
|
-
readonly submissionId?: string | undefined;
|
|
640
|
-
} | {
|
|
641
|
-
readonly _tag: "RetryRefused";
|
|
635
|
+
readonly _tag: "SettlementConflict";
|
|
642
636
|
readonly submissionId: string;
|
|
643
|
-
readonly
|
|
644
|
-
readonly decisionTag: string;
|
|
645
|
-
readonly message: string;
|
|
637
|
+
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
646
638
|
} | {
|
|
647
639
|
readonly _tag: "LedgerError";
|
|
648
640
|
readonly operation: string;
|
|
649
641
|
readonly message: string;
|
|
650
642
|
readonly cause?: Schema.Json | undefined;
|
|
651
|
-
} | {
|
|
652
|
-
readonly _tag: "RunJournalError";
|
|
653
|
-
readonly message: string;
|
|
654
|
-
readonly cause?: Schema.Json | undefined;
|
|
655
|
-
} | {
|
|
656
|
-
readonly _tag: "DigestError";
|
|
657
|
-
readonly message: string;
|
|
658
|
-
readonly cause?: Schema.Json | undefined;
|
|
659
|
-
} | {
|
|
660
|
-
readonly _tag: "OwnershipLost";
|
|
661
|
-
readonly submissionId: string;
|
|
662
|
-
readonly actualEpoch: number;
|
|
663
|
-
} | {
|
|
664
|
-
readonly _tag: "SettlementConflict";
|
|
665
|
-
readonly submissionId: string;
|
|
666
|
-
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
667
643
|
} | {
|
|
668
644
|
readonly _tag: "ThreadStoreError";
|
|
669
645
|
readonly operation: string;
|
|
@@ -684,9 +660,33 @@ declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | Obl
|
|
|
684
660
|
readonly threadId: string;
|
|
685
661
|
readonly actualEpoch: number;
|
|
686
662
|
readonly attemptedEpoch: number;
|
|
663
|
+
} | {
|
|
664
|
+
readonly _tag: "OperationDenied";
|
|
665
|
+
readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
|
|
666
|
+
readonly reason: string;
|
|
667
|
+
readonly threadId?: string | undefined;
|
|
668
|
+
readonly submissionId?: string | undefined;
|
|
669
|
+
} | {
|
|
670
|
+
readonly _tag: "RetryRefused";
|
|
671
|
+
readonly submissionId: string;
|
|
672
|
+
readonly refusal: "await-approval-decision" | "await-unknown-resolution" | "settled";
|
|
673
|
+
readonly decisionTag: string;
|
|
674
|
+
readonly message: string;
|
|
675
|
+
} | {
|
|
676
|
+
readonly _tag: "RunJournalError";
|
|
677
|
+
readonly message: string;
|
|
678
|
+
readonly cause?: Schema.Json | undefined;
|
|
679
|
+
} | {
|
|
680
|
+
readonly _tag: "DigestError";
|
|
681
|
+
readonly message: string;
|
|
682
|
+
readonly cause?: Schema.Json | undefined;
|
|
683
|
+
} | {
|
|
684
|
+
readonly _tag: "OwnershipLost";
|
|
685
|
+
readonly submissionId: string;
|
|
686
|
+
readonly actualEpoch: number;
|
|
687
687
|
} | {
|
|
688
688
|
readonly _tag: "DurableRuntimeFailpointError";
|
|
689
|
-
readonly location: "abort:after-intent" | "approval:after-request-append" | "approval:after-suspend" | "claim:after-claim" | "compaction:after-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" | "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";
|
|
689
|
+
readonly location: "abort:after-intent" | "approval:after-request-append" | "approval:after-suspend" | "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" | "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";
|
|
690
690
|
} | {
|
|
691
691
|
readonly _tag: "DurableAlarmError";
|
|
692
692
|
readonly operation: string;
|
|
@@ -732,4 +732,4 @@ interface Class<EventServices = never> {
|
|
|
732
732
|
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>;
|
|
733
733
|
//#endregion
|
|
734
734
|
export { CloudflareDurableRuntimeOptions as C, layerConfig as E, CloudflareDurableRuntimeInitializationError as S, layer as T, decodeObligationThresholds as _, AdminVerifyRequest as a, make as b, Instance as c, RetryExecuted as d, ThreadObject_d_exports as f, decodeAdminVerifyRequest as g, decodeAdminResponse as h, AdminResponse as i, ObligationsScanned as l, decodeAdminExplainRequest as m, AdminFailed as n, Class as o, VerifiedIntegrity as p, AdminFailure as r, ExplainedRecovery as s, AdminExplainRequest as t, Options as u, decodeRetryCommand as v, CloudflareDurableRuntimeServices as w, CloudflareBootstrapServices as x, encodeAdminResponse as y };
|
|
735
|
-
//# sourceMappingURL=ThreadObject-
|
|
735
|
+
//# sourceMappingURL=ThreadObject-CmeEjnBK.d.mts.map
|
package/dist/ThreadObject.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as CloudflareDurableRuntimeOptions, E as layerConfig, S as CloudflareDurableRuntimeInitializationError, T as layer, _ as decodeObligationThresholds, a as AdminVerifyRequest, b as make, c as Instance, d as RetryExecuted, g as decodeAdminVerifyRequest, h as decodeAdminResponse, i as AdminResponse, l as ObligationsScanned, m as decodeAdminExplainRequest, n as AdminFailed, o as Class, p as VerifiedIntegrity, r as AdminFailure, s as ExplainedRecovery, t as AdminExplainRequest, u as Options, v as decodeRetryCommand, w as CloudflareDurableRuntimeServices, x as CloudflareBootstrapServices, y as encodeAdminResponse } from "./ThreadObject-
|
|
1
|
+
import { C as CloudflareDurableRuntimeOptions, E as layerConfig, S as CloudflareDurableRuntimeInitializationError, T as layer, _ as decodeObligationThresholds, a as AdminVerifyRequest, b as make, c as Instance, d as RetryExecuted, g as decodeAdminVerifyRequest, h as decodeAdminResponse, i as AdminResponse, l as ObligationsScanned, m as decodeAdminExplainRequest, n as AdminFailed, o as Class, p as VerifiedIntegrity, r as AdminFailure, s as ExplainedRecovery, t as AdminExplainRequest, u as Options, v as decodeRetryCommand, w as CloudflareDurableRuntimeServices, x as CloudflareBootstrapServices, y as encodeAdminResponse } from "./ThreadObject-CmeEjnBK.mjs";
|
|
2
2
|
export { AdminExplainRequest, AdminFailed, AdminFailure, AdminResponse, AdminVerifyRequest, type CloudflareBootstrapServices as BootstrapServices, Class, ExplainedRecovery, type CloudflareDurableRuntimeInitializationError as InitializationError, Instance, ObligationsScanned, Options, RetryExecuted, type CloudflareDurableRuntimeOptions as RuntimeOptions, type CloudflareDurableRuntimeServices as Services, VerifiedIntegrity, decodeAdminExplainRequest, decodeAdminResponse, decodeAdminVerifyRequest, decodeObligationThresholds, decodeRetryCommand, encodeAdminResponse, layer, layerConfig, make };
|
package/dist/index.d.mts
CHANGED
|
@@ -7,6 +7,6 @@ import { t as CloudflareMemory_d_exports } from "./CloudflareMemory.mjs";
|
|
|
7
7
|
import { t as CloudflareScheduling_d_exports } from "./CloudflareScheduling.mjs";
|
|
8
8
|
import { t as CloudflareSubscriptions_d_exports } from "./CloudflareSubscriptions.mjs";
|
|
9
9
|
import { t as CloudflareThreadClient_d_exports } from "./CloudflareThreadClient.mjs";
|
|
10
|
-
import { f as ThreadObject_d_exports } from "./ThreadObject-
|
|
10
|
+
import { f as ThreadObject_d_exports } from "./ThreadObject-CmeEjnBK.mjs";
|
|
11
11
|
import { t as WakeScheduler_d_exports } from "./WakeScheduler.mjs";
|
|
12
12
|
export { Alarm_d_exports as Alarm, CloudflareBindings_d_exports as CloudflareBindings, CloudflareBrowser_d_exports as CloudflareBrowser, CloudflareCodeMode_d_exports as CloudflareCodeMode, CloudflareConfig_d_exports as CloudflareConfig, CloudflareMemory_d_exports as CloudflareMemory, CloudflareScheduling_d_exports as CloudflareScheduling, CloudflareSubscriptions_d_exports as CloudflareSubscriptions, CloudflareThreadClient_d_exports as CloudflareThreadClient, ThreadObject_d_exports as ThreadObject, WakeScheduler_d_exports as WakeScheduler };
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@effect-agent/platform-cloudflare","version":"0.1.0-beta.
|
|
1
|
+
{"name":"@effect-agent/platform-cloudflare","version":"0.1.0-beta.50","dependencies":{"@effect-agent/core":"0.1.0-beta.50","@effect-agent/engine":"0.1.0-beta.50","@effect-agent/sandbox":"0.1.0-beta.50","@effect-agent/storage-cloudflare":"0.1.0-beta.50","@effect-agent/thread":"0.1.0-beta.50","@effect/platform-browser":"4.0.0-rc.112","@effect/sql-sqlite-do":"4.0.0-rc.112"},"devDependencies":{"@cloudflare/puppeteer":"1.1.0","@cloudflare/vitest-pool-workers":"0.21.3","@cloudflare/workers-types":"5.20260825.1","@effect-agent/capabilities":"0.1.0-beta.50","@effect-agent/testing":"0.1.0-beta.50","@effect/platform-node":"4.0.0-rc.112","@effect/sql-d1":"4.0.0-rc.112","@effect/vitest":"4.0.0-rc.112","effect":"4.0.0-rc.112","effect-cf":"0.40.0","esbuild":"0.28.1","miniflare":"5.20260811.1-alpha","typescript":"7.0.2","vite-plus":"0.3.0","vitest":"4.1.11"},"peerDependencies":{"@cloudflare/puppeteer":"^1.1.0","effect":"^4.0.0-rc.112","effect-cf":"^0.40.0"},"exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./Alarm":{"types":"./dist/Alarm.d.mts","default":"./dist/Alarm.mjs"},"./BrowserRestCapture":{"types":"./dist/BrowserRestCapture.d.mts","default":"./dist/BrowserRestCapture.mjs"},"./BrowserRestCrawl":{"types":"./dist/BrowserRestCrawl.d.mts","default":"./dist/BrowserRestCrawl.mjs"},"./CloudflareBindings":{"types":"./dist/CloudflareBindings.d.mts","default":"./dist/CloudflareBindings.mjs"},"./CloudflareBrowser":{"types":"./dist/CloudflareBrowser.d.mts","default":"./dist/CloudflareBrowser.mjs"},"./CloudflareCodeMode":{"types":"./dist/CloudflareCodeMode.d.mts","default":"./dist/CloudflareCodeMode.mjs"},"./CloudflareConfig":{"types":"./dist/CloudflareConfig.d.mts","default":"./dist/CloudflareConfig.mjs"},"./CloudflareMemory":{"types":"./dist/CloudflareMemory.d.mts","default":"./dist/CloudflareMemory.mjs"},"./CloudflareScheduling":{"types":"./dist/CloudflareScheduling.d.mts","default":"./dist/CloudflareScheduling.mjs"},"./CloudflareSubscriptions":{"types":"./dist/CloudflareSubscriptions.d.mts","default":"./dist/CloudflareSubscriptions.mjs"},"./CloudflareThreadClient":{"types":"./dist/CloudflareThreadClient.d.mts","default":"./dist/CloudflareThreadClient.mjs"},"./InteractiveBrowser":{"types":"./dist/InteractiveBrowser.d.mts","default":"./dist/InteractiveBrowser.mjs"},"./ProtectedBrowser":{"types":"./dist/ProtectedBrowser.d.mts","default":"./dist/ProtectedBrowser.mjs"},"./ThreadObject":{"types":"./dist/ThreadObject.d.mts","default":"./dist/ThreadObject.mjs"},"./WakeScheduler":{"types":"./dist/WakeScheduler.d.mts","default":"./dist/WakeScheduler.mjs"}},"description":"Cloudflare Layer assembly for Effect Agent: Durable Objects and Browser Run adapters.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/danieljvdm/effect-agent.git","directory":"packages/platform-cloudflare"},"files":["dist","src"],"type":"module","sideEffects":[],"publishConfig":{"access":"public"},"scripts":{"build":"vp pack","check":"tsc --noEmit -p tsconfig.json"},"peerDependenciesMeta":{"@cloudflare/puppeteer":{"optional":true}}}
|
|
@@ -230,10 +230,6 @@ const HarnessCompleted = Schema.TaggedStruct("completed", {
|
|
|
230
230
|
resultBytes: Schema.Natural,
|
|
231
231
|
});
|
|
232
232
|
|
|
233
|
-
const HarnessSourceInvalid = Schema.TaggedStruct("source-invalid", {
|
|
234
|
-
message: Schema.String,
|
|
235
|
-
});
|
|
236
|
-
|
|
237
233
|
const HarnessNotAFunction = Schema.TaggedStruct("source-not-a-function", {
|
|
238
234
|
actual: Schema.String,
|
|
239
235
|
});
|
|
@@ -270,7 +266,6 @@ const HarnessProtocol = Schema.TaggedStruct("protocol", {
|
|
|
270
266
|
|
|
271
267
|
const HarnessOutcome = Schema.Union([
|
|
272
268
|
HarnessCompleted,
|
|
273
|
-
HarnessSourceInvalid,
|
|
274
269
|
HarnessNotAFunction,
|
|
275
270
|
HarnessProgramFailed,
|
|
276
271
|
HarnessLogLimit,
|
|
@@ -735,13 +730,6 @@ const makeExecute = (
|
|
|
735
730
|
}),
|
|
736
731
|
});
|
|
737
732
|
}
|
|
738
|
-
case "source-invalid": {
|
|
739
|
-
return yield* CodeSourceError.make({
|
|
740
|
-
implementation: dynamicWorkerImplementation,
|
|
741
|
-
reason: "invalid",
|
|
742
|
-
message: outcome.value.message.slice(0, 8_000),
|
|
743
|
-
});
|
|
744
|
-
}
|
|
745
733
|
case "source-not-a-function": {
|
|
746
734
|
return yield* CodeSourceError.make({
|
|
747
735
|
implementation: dynamicWorkerImplementation,
|
|
@@ -1949,6 +1949,8 @@ const makeHostService = (
|
|
|
1949
1949
|
): Effect.fn.Return<BrowserRunInteractiveSession, InteractiveBrowserError, Scope.Scope> {
|
|
1950
1950
|
const fixedPolicy = yield* snapshotPolicy(policy);
|
|
1951
1951
|
const startedAt = yield* Effect.clockWith((clock) => clock.currentTimeMillis);
|
|
1952
|
+
// Late SDK replies outlive the opening fiber; cleanup retains this pass's clock.
|
|
1953
|
+
const runCleanup = Effect.runPromiseWith(Context.make(Clock.Clock, yield* Clock.Clock));
|
|
1952
1954
|
|
|
1953
1955
|
const state: HandleState = {
|
|
1954
1956
|
closed: { value: false },
|
|
@@ -1978,7 +1980,7 @@ const makeHostService = (
|
|
|
1978
1980
|
closeLateAcquisition(
|
|
1979
1981
|
signal,
|
|
1980
1982
|
() => binding.launch(keepAliveMillis(fixedPolicy)),
|
|
1981
|
-
(acquired) =>
|
|
1983
|
+
(acquired) => runCleanup(closeAcquired(acquired)),
|
|
1982
1984
|
),
|
|
1983
1985
|
catch: (cause) =>
|
|
1984
1986
|
isCapacityRefusal(cause)
|