@effect-agent/platform-cloudflare 0.1.0-beta.45 → 0.1.0-beta.47
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 +119 -0
- package/dist/Alarm.mjs +317 -0
- package/dist/Alarm.mjs.map +1 -0
- package/dist/{browser-rest-capture.d.mts → BrowserRestCapture.d.mts} +5 -4
- package/dist/{browser-rest-capture.mjs → BrowserRestCapture.mjs} +5 -4
- package/dist/BrowserRestCapture.mjs.map +1 -0
- package/dist/{browser-rest-crawl.d.mts → BrowserRestCrawl.d.mts} +4 -3
- package/dist/{browser-rest-crawl.mjs → BrowserRestCrawl.mjs} +4 -3
- package/dist/BrowserRestCrawl.mjs.map +1 -0
- package/dist/{bindings-BrVEOkfe.d.mts → CloudflareBindings.d.mts} +7 -5
- package/dist/CloudflareBindings.mjs +98 -0
- package/dist/CloudflareBindings.mjs.map +1 -0
- package/dist/{browser-quick-action.mjs → CloudflareBrowser-1jeZx3_g.mjs} +19 -4
- package/dist/CloudflareBrowser-1jeZx3_g.mjs.map +1 -0
- package/dist/{browser-quick-action.d.mts → CloudflareBrowser-DJq53niJ.d.mts} +9 -18
- package/dist/CloudflareBrowser.d.mts +2 -0
- package/dist/CloudflareBrowser.mjs +2 -0
- package/dist/CloudflareCodeMode.d.mts +44 -0
- package/dist/CloudflareCodeMode.mjs +618 -0
- package/dist/CloudflareCodeMode.mjs.map +1 -0
- package/dist/CloudflareConfig-f3CqTel1.d.mts +101 -0
- package/dist/CloudflareConfig.d.mts +2 -0
- package/dist/CloudflareConfig.mjs +122 -0
- package/dist/CloudflareConfig.mjs.map +1 -0
- package/dist/CloudflareMemory.d.mts +140 -0
- package/dist/CloudflareMemory.mjs +168 -0
- package/dist/CloudflareMemory.mjs.map +1 -0
- package/dist/{scheduling.d.mts → CloudflareScheduling.d.mts} +9 -6
- package/dist/{scheduling.mjs → CloudflareScheduling.mjs} +22 -8
- package/dist/CloudflareScheduling.mjs.map +1 -0
- package/dist/{subscriptions.d.mts → CloudflareSubscriptions.d.mts} +11 -6
- package/dist/{subscriptions.mjs → CloudflareSubscriptions.mjs} +26 -7
- package/dist/CloudflareSubscriptions.mjs.map +1 -0
- package/dist/CloudflareThreadClient.d.mts +715 -0
- package/dist/CloudflareThreadClient.mjs +364 -0
- package/dist/CloudflareThreadClient.mjs.map +1 -0
- package/dist/{interactive-browser.d.mts → InteractiveBrowser.d.mts} +5 -4
- package/dist/{interactive-browser.mjs → InteractiveBrowser.mjs} +6 -4
- package/dist/InteractiveBrowser.mjs.map +1 -0
- package/dist/{protected-browser.d.mts → ProtectedBrowser.d.mts} +4 -3
- package/dist/{protected-browser.mjs → ProtectedBrowser.mjs} +4 -3
- package/dist/ProtectedBrowser.mjs.map +1 -0
- package/dist/ThreadObject-IrGuIO4a.mjs +575 -0
- package/dist/ThreadObject-IrGuIO4a.mjs.map +1 -0
- package/dist/ThreadObject-TEgOO0YM.d.mts +735 -0
- package/dist/ThreadObject.d.mts +2 -0
- package/dist/ThreadObject.mjs +3 -0
- package/dist/WakeScheduler.d.mts +23 -0
- package/dist/WakeScheduler.mjs +60 -0
- package/dist/WakeScheduler.mjs.map +1 -0
- package/dist/boundary-BguazVkh.mjs +42 -0
- package/dist/boundary-BguazVkh.mjs.map +1 -0
- package/dist/{browser-session-lifecycle-ZGgb3pnK.mjs → browser-session-lifecycle-CUbVfEgP.mjs} +2 -2
- package/dist/browser-session-lifecycle-CUbVfEgP.mjs.map +1 -0
- package/dist/{browser-session-lifecycle-DqntvG-Y.d.mts → browser-session-lifecycle-DJpqLXy_.d.mts} +2 -2
- package/dist/index.d.mts +12 -1833
- package/dist/index.mjs +12 -1357
- package/dist/prepared-admission-DRBhl2Sp.mjs +63 -0
- package/dist/prepared-admission-DRBhl2Sp.mjs.map +1 -0
- package/package.json +1 -1
- package/src/{alarm.ts → Alarm.ts} +6 -7
- package/src/{browser-rest-capture.ts → BrowserRestCapture.ts} +3 -3
- package/src/{browser-rest-crawl.ts → BrowserRestCrawl.ts} +2 -2
- package/src/{bindings.ts → CloudflareBindings.ts} +2 -2
- package/src/CloudflareBrowser.ts +15 -0
- package/src/{code-mode-executor.ts → CloudflareCodeMode.ts} +3 -3
- package/src/{config.ts → CloudflareConfig.ts} +3 -2
- package/src/{memory.ts → CloudflareMemory.ts} +15 -12
- package/src/{scheduling.ts → CloudflareScheduling.ts} +12 -11
- package/src/{subscriptions.ts → CloudflareSubscriptions.ts} +14 -12
- package/src/{client.ts → CloudflareThreadClient.ts} +27 -20
- package/src/{interactive-browser.ts → InteractiveBrowser.ts} +9 -5
- package/src/{thread-object.ts → ThreadObject.ts} +37 -29
- package/src/{wake-scheduler.ts → WakeScheduler.ts} +5 -5
- package/src/index.ts +11 -30
- package/src/{browser-quick-action.ts → internal/browser-quick-action.ts} +10 -8
- package/src/{layers.ts → internal/layers.ts} +39 -30
- package/src/{prepared-admission.ts → internal/prepared-admission.ts} +7 -7
- package/src/{transport.ts → internal/transport.ts} +5 -2
- package/src/protected-browser/binding.ts +3 -2
- package/src/protected-browser/native.ts +2 -2
- package/src/protected-browser/policy.ts +2 -2
- package/dist/browser-quick-action.mjs.map +0 -1
- package/dist/browser-rest-capture.mjs.map +0 -1
- package/dist/browser-rest-crawl.mjs.map +0 -1
- package/dist/browser-session-lifecycle-ZGgb3pnK.mjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/interactive-browser.mjs.map +0 -1
- package/dist/prepared-admission-BhW2eT_a.mjs +0 -890
- package/dist/prepared-admission-BhW2eT_a.mjs.map +0 -1
- package/dist/protected-browser.mjs.map +0 -1
- package/dist/scheduling.mjs.map +0 -1
- package/dist/subscriptions.mjs.map +0 -1
- /package/src/{protected-browser.ts → ProtectedBrowser.ts} +0 -0
- /package/src/{boundary.ts → internal/boundary.ts} +0 -0
- /package/src/{browser-session-lifecycle.ts → internal/browser-session-lifecycle.ts} +0 -0
- /package/src/{progress-wait.ts → internal/progress-wait.ts} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { CloudflareThreadClient } from "./CloudflareThreadClient.mjs";
|
|
2
|
+
import "@effect-agent/thread/DurableAgentRuntime";
|
|
3
|
+
import { Effect, Layer } from "effect";
|
|
4
|
+
import "@effect-agent/core/Identifiers";
|
|
5
|
+
import { PersistedJson } from "@effect-agent/thread/Records";
|
|
6
|
+
import { ScheduleStorageError, ScheduledInputAdmission, ScheduledInputRetryable } from "@effect-agent/thread/Schedule";
|
|
7
|
+
import { PreparedInputAdmission } from "@effect-agent/thread/PreparedInputAdmission";
|
|
8
|
+
import "@effect-agent/thread/Subscription";
|
|
9
|
+
//#region src/internal/prepared-admission.ts
|
|
10
|
+
const passthroughAgent = (agentId) => ({ definition: {
|
|
11
|
+
id: agentId,
|
|
12
|
+
input: PersistedJson
|
|
13
|
+
} });
|
|
14
|
+
/** Ordinary prepared admission through one freshly addressed Thread Object call. */
|
|
15
|
+
const cloudflarePreparedInputAdmissionLayer = Layer.effect(PreparedInputAdmission, Effect.gen(function* () {
|
|
16
|
+
const client = yield* CloudflareThreadClient;
|
|
17
|
+
return PreparedInputAdmission.of({ submit: (envelope) => client.submit(passthroughAgent(envelope.agentId), envelope.input, {
|
|
18
|
+
threadId: envelope.threadId,
|
|
19
|
+
principal: envelope.deliveryPrincipal,
|
|
20
|
+
idempotencyKey: envelope.admissionKey,
|
|
21
|
+
definitions: envelope.definitions
|
|
22
|
+
}).pipe(Effect.catchTags({
|
|
23
|
+
AdmissionConflict: () => ScheduleStorageError.make({
|
|
24
|
+
operation: "prepared admission",
|
|
25
|
+
reason: "corrupt"
|
|
26
|
+
}),
|
|
27
|
+
AdmissionLimitExceeded: () => ScheduledInputRetryable.make({ reason: "capacity" }),
|
|
28
|
+
ThreadClientError: (error) => ScheduledInputRetryable.make({ reason: error.overloaded === true ? "capacity" : "transport" }),
|
|
29
|
+
HostProtocolError: () => ScheduledInputRetryable.make({ reason: "ambiguous" }),
|
|
30
|
+
LedgerError: () => ScheduledInputRetryable.make({ reason: "storage" }),
|
|
31
|
+
ThreadStoreError: () => ScheduledInputRetryable.make({ reason: "storage" }),
|
|
32
|
+
DurableAlarmError: () => ScheduledInputRetryable.make({ reason: "storage" }),
|
|
33
|
+
AgentInputError: () => ScheduleStorageError.make({
|
|
34
|
+
operation: "prepared admission",
|
|
35
|
+
reason: "corrupt"
|
|
36
|
+
}),
|
|
37
|
+
DigestError: () => ScheduleStorageError.make({
|
|
38
|
+
operation: "prepared admission",
|
|
39
|
+
reason: "corrupt"
|
|
40
|
+
}),
|
|
41
|
+
ThreadNotMaterialized: () => ScheduledInputRetryable.make({ reason: "storage" }),
|
|
42
|
+
AppendConflict: () => ScheduledInputRetryable.make({ reason: "ambiguous" }),
|
|
43
|
+
FenceRejected: () => ScheduledInputRetryable.make({ reason: "ambiguous" }),
|
|
44
|
+
DurableRuntimeFailpointError: () => ScheduledInputRetryable.make({ reason: "ambiguous" })
|
|
45
|
+
})) });
|
|
46
|
+
}));
|
|
47
|
+
const preparedFromSchedule = (envelope) => ({
|
|
48
|
+
schemaVersion: 1,
|
|
49
|
+
threadId: envelope.threadId,
|
|
50
|
+
deliveryPrincipal: envelope.deliveryPrincipal,
|
|
51
|
+
agentId: envelope.agentId,
|
|
52
|
+
definitions: envelope.definitions,
|
|
53
|
+
input: envelope.input,
|
|
54
|
+
inputDigest: envelope.inputDigest,
|
|
55
|
+
admissionKey: envelope.admissionKey,
|
|
56
|
+
authorization: envelope.authorization
|
|
57
|
+
});
|
|
58
|
+
/** Compatibility adapter retaining Scheduling's public admission port. */
|
|
59
|
+
const cloudflareScheduledInputAdmissionLayer = Layer.effect(ScheduledInputAdmission, Effect.map(PreparedInputAdmission, (admission) => ScheduledInputAdmission.of({ submit: (envelope) => admission.submit(preparedFromSchedule(envelope)) })));
|
|
60
|
+
//#endregion
|
|
61
|
+
export { cloudflareScheduledInputAdmissionLayer as n, cloudflarePreparedInputAdmissionLayer as t };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=prepared-admission-DRBhl2Sp.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepared-admission-DRBhl2Sp.mjs","names":[],"sources":["../src/internal/prepared-admission.ts"],"sourcesContent":["import { type AgentId } from \"@effect-agent/core/Identifiers\";\nimport { type DurableSubmitAgent } from \"@effect-agent/thread/DurableAgentRuntime\";\nimport { PreparedInputAdmission } from \"@effect-agent/thread/PreparedInputAdmission\";\nimport { PersistedJson } from \"@effect-agent/thread/Records\";\nimport {\n type ScheduledEnvelope,\n ScheduledInputAdmission,\n ScheduledInputRetryable,\n ScheduleStorageError,\n} from \"@effect-agent/thread/Schedule\";\nimport { type PreparedInput } from \"@effect-agent/thread/Subscription\";\nimport { Effect, Layer } from \"effect\";\n\nimport { CloudflareThreadClient, type ThreadClientError } from \"../CloudflareThreadClient.ts\";\n\nconst passthroughAgent = (agentId: AgentId): DurableSubmitAgent<typeof PersistedJson> => ({\n definition: { id: agentId, input: PersistedJson },\n});\n\n/** Ordinary prepared admission through one freshly addressed Thread Object call. */\nexport const cloudflarePreparedInputAdmissionLayer: Layer.Layer<\n PreparedInputAdmission,\n never,\n CloudflareThreadClient\n> = Layer.effect(\n PreparedInputAdmission,\n Effect.gen(function* () {\n const client = yield* CloudflareThreadClient;\n\n return PreparedInputAdmission.of({\n submit: (envelope) =>\n client\n .submit(passthroughAgent(envelope.agentId), envelope.input, {\n threadId: envelope.threadId,\n principal: envelope.deliveryPrincipal,\n idempotencyKey: envelope.admissionKey,\n definitions: envelope.definitions,\n })\n .pipe(\n Effect.catchTags({\n AdmissionConflict: () =>\n ScheduleStorageError.make({ operation: \"prepared admission\", reason: \"corrupt\" }),\n AdmissionLimitExceeded: () => ScheduledInputRetryable.make({ reason: \"capacity\" }),\n ThreadClientError: (error: ThreadClientError) =>\n ScheduledInputRetryable.make({\n reason: error.overloaded === true ? \"capacity\" : \"transport\",\n }),\n HostProtocolError: () => ScheduledInputRetryable.make({ reason: \"ambiguous\" }),\n LedgerError: () => ScheduledInputRetryable.make({ reason: \"storage\" }),\n ThreadStoreError: () => ScheduledInputRetryable.make({ reason: \"storage\" }),\n DurableAlarmError: () => ScheduledInputRetryable.make({ reason: \"storage\" }),\n AgentInputError: () =>\n ScheduleStorageError.make({ operation: \"prepared admission\", reason: \"corrupt\" }),\n DigestError: () =>\n ScheduleStorageError.make({ operation: \"prepared admission\", reason: \"corrupt\" }),\n ThreadNotMaterialized: () => ScheduledInputRetryable.make({ reason: \"storage\" }),\n AppendConflict: () => ScheduledInputRetryable.make({ reason: \"ambiguous\" }),\n FenceRejected: () => ScheduledInputRetryable.make({ reason: \"ambiguous\" }),\n DurableRuntimeFailpointError: () =>\n ScheduledInputRetryable.make({ reason: \"ambiguous\" }),\n }),\n ),\n });\n }),\n);\n\nconst preparedFromSchedule = (envelope: ScheduledEnvelope): PreparedInput => ({\n schemaVersion: 1,\n threadId: envelope.threadId,\n deliveryPrincipal: envelope.deliveryPrincipal,\n agentId: envelope.agentId,\n definitions: envelope.definitions,\n input: envelope.input,\n inputDigest: envelope.inputDigest,\n admissionKey: envelope.admissionKey,\n authorization: envelope.authorization,\n});\n\n/** Compatibility adapter retaining Scheduling's public admission port. */\nexport const cloudflareScheduledInputAdmissionLayer: Layer.Layer<\n ScheduledInputAdmission,\n never,\n PreparedInputAdmission\n> = Layer.effect(\n ScheduledInputAdmission,\n Effect.map(PreparedInputAdmission, (admission) =>\n ScheduledInputAdmission.of({\n submit: (envelope) => admission.submit(preparedFromSchedule(envelope)),\n }),\n ),\n);\n"],"mappings":";;;;;;;;;AAeA,MAAM,oBAAoB,aAAgE,EACxF,YAAY;CAAE,IAAI;CAAS,OAAO;AAAc,EAClD;;AAGA,MAAa,wCAIT,MAAM,OACR,wBACA,OAAO,IAAI,aAAa;CACtB,MAAM,SAAS,OAAO;CAEtB,OAAO,uBAAuB,GAAG,EAC/B,SAAS,aACP,OACG,OAAO,iBAAiB,SAAS,OAAO,GAAG,SAAS,OAAO;EAC1D,UAAU,SAAS;EACnB,WAAW,SAAS;EACpB,gBAAgB,SAAS;EACzB,aAAa,SAAS;CACxB,CAAC,CAAC,CACD,KACC,OAAO,UAAU;EACf,yBACE,qBAAqB,KAAK;GAAE,WAAW;GAAsB,QAAQ;EAAU,CAAC;EAClF,8BAA8B,wBAAwB,KAAK,EAAE,QAAQ,WAAW,CAAC;EACjF,oBAAoB,UAClB,wBAAwB,KAAK,EAC3B,QAAQ,MAAM,eAAe,OAAO,aAAa,YACnD,CAAC;EACH,yBAAyB,wBAAwB,KAAK,EAAE,QAAQ,YAAY,CAAC;EAC7E,mBAAmB,wBAAwB,KAAK,EAAE,QAAQ,UAAU,CAAC;EACrE,wBAAwB,wBAAwB,KAAK,EAAE,QAAQ,UAAU,CAAC;EAC1E,yBAAyB,wBAAwB,KAAK,EAAE,QAAQ,UAAU,CAAC;EAC3E,uBACE,qBAAqB,KAAK;GAAE,WAAW;GAAsB,QAAQ;EAAU,CAAC;EAClF,mBACE,qBAAqB,KAAK;GAAE,WAAW;GAAsB,QAAQ;EAAU,CAAC;EAClF,6BAA6B,wBAAwB,KAAK,EAAE,QAAQ,UAAU,CAAC;EAC/E,sBAAsB,wBAAwB,KAAK,EAAE,QAAQ,YAAY,CAAC;EAC1E,qBAAqB,wBAAwB,KAAK,EAAE,QAAQ,YAAY,CAAC;EACzE,oCACE,wBAAwB,KAAK,EAAE,QAAQ,YAAY,CAAC;CACxD,CAAC,CACH,EACN,CAAC;AACH,CAAC,CACH;AAEA,MAAM,wBAAwB,cAAgD;CAC5E,eAAe;CACf,UAAU,SAAS;CACnB,mBAAmB,SAAS;CAC5B,SAAS,SAAS;CAClB,aAAa,SAAS;CACtB,OAAO,SAAS;CAChB,aAAa,SAAS;CACtB,cAAc,SAAS;CACvB,eAAe,SAAS;AAC1B;;AAGA,MAAa,yCAIT,MAAM,OACR,yBACA,OAAO,IAAI,yBAAyB,cAClC,wBAAwB,GAAG,EACzB,SAAS,aAAa,UAAU,OAAO,qBAAqB,QAAQ,CAAC,EACvE,CAAC,CACH,CACF"}
|
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.47","dependencies":{"@effect-agent/core":"0.1.0-beta.47","@effect-agent/engine":"0.1.0-beta.47","@effect-agent/sandbox":"0.1.0-beta.47","@effect-agent/storage-cloudflare":"0.1.0-beta.47","@effect-agent/thread":"0.1.0-beta.47","@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.47","@effect-agent/testing":"0.1.0-beta.47","@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","publishConfig":{"access":"public"},"scripts":{"build":"vp pack","check":"tsc --noEmit -p tsconfig.json"},"peerDependenciesMeta":{"@cloudflare/puppeteer":{"optional":true}}}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { type DurableBindingFailure } from "@effect-agent/thread/AgentRegistration";
|
|
1
2
|
import {
|
|
2
3
|
DurableAgentRuntime,
|
|
3
|
-
SubmissionLedger,
|
|
4
|
-
type DurableBindingFailure,
|
|
5
4
|
type DurableWorkerFailure,
|
|
6
5
|
type RecoveryReport,
|
|
7
|
-
|
|
8
|
-
} from "@effect-agent/thread";
|
|
6
|
+
} from "@effect-agent/thread/DurableAgentRuntime";
|
|
7
|
+
import { SubmissionLedger, type SubmissionSnapshot } from "@effect-agent/thread/SubmissionLedger";
|
|
9
8
|
import {
|
|
10
9
|
Clock,
|
|
11
10
|
Context,
|
|
@@ -19,9 +18,9 @@ import {
|
|
|
19
18
|
Stream,
|
|
20
19
|
} from "effect";
|
|
21
20
|
|
|
22
|
-
import { ThreadObjectIdentity, DurableObjectContext } from "./
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
21
|
+
import { ThreadObjectIdentity, DurableObjectContext } from "./CloudflareBindings.ts";
|
|
22
|
+
import { CloudflareDurableRuntimeConfig } from "./CloudflareConfig.ts";
|
|
23
|
+
import { safeCauseMessage } from "./internal/boundary.ts";
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
26
|
* The single multiplexed Durable Object alarm (decision D-P6-2). A Durable Object has ONE
|
|
@@ -14,20 +14,20 @@ import {
|
|
|
14
14
|
PageScrapeCaptured,
|
|
15
15
|
PageStructuredCaptured,
|
|
16
16
|
PageCaptureUnsupportedError,
|
|
17
|
-
SandboxImplementation,
|
|
18
17
|
type PageCaptureAction,
|
|
19
18
|
type PageCaptureCapture,
|
|
20
19
|
type PageCaptureError,
|
|
21
20
|
type PageCaptureOutput,
|
|
22
21
|
type PageCaptureRequest,
|
|
23
|
-
} from "@effect-agent/sandbox";
|
|
22
|
+
} from "@effect-agent/sandbox/PageCapture";
|
|
23
|
+
import { SandboxImplementation } from "@effect-agent/sandbox/Sandbox";
|
|
24
24
|
import { Effect, Layer, Option, Redacted, Schema, Stream } from "effect";
|
|
25
25
|
import { HttpClient, HttpClientRequest, type HttpClientError } from "effect/unstable/http";
|
|
26
26
|
|
|
27
27
|
import {
|
|
28
28
|
BrowserQuickActionWorkersAi,
|
|
29
29
|
type BrowserQuickActionWorkersAiPolicy,
|
|
30
|
-
} from "./
|
|
30
|
+
} from "./CloudflareBrowser.ts";
|
|
31
31
|
|
|
32
32
|
/** Node-safe REST PageCapture implementation; it never imports Worker runtime modules. */
|
|
33
33
|
export const browserRestCaptureImplementation = SandboxImplementation.make({
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
PageCrawlRateLimitedError,
|
|
6
6
|
PageCrawlRecord,
|
|
7
7
|
PageCrawlTerminalError,
|
|
8
|
-
SandboxImplementation,
|
|
9
8
|
type PageCrawlCrawl,
|
|
10
9
|
type PageCrawlError,
|
|
11
10
|
type PageCrawlRequest,
|
|
12
|
-
} from "@effect-agent/sandbox";
|
|
11
|
+
} from "@effect-agent/sandbox/PageCrawl";
|
|
12
|
+
import { SandboxImplementation } from "@effect-agent/sandbox/Sandbox";
|
|
13
13
|
import {
|
|
14
14
|
Duration,
|
|
15
15
|
Effect,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type ThreadId } from "@effect-agent/core/Identifiers";
|
|
2
|
+
import { type ProducerId } from "@effect-agent/thread/Records";
|
|
3
3
|
import { Context, Effect, Layer, Predicate, Schema } from "effect";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Public CloudflareBrowser API. Implementation helpers remain private. */
|
|
2
|
+
export {
|
|
3
|
+
BrowserQuickActionBrowserBinding,
|
|
4
|
+
BrowserQuickActionRpcError,
|
|
5
|
+
BrowserQuickActionWorkersAi,
|
|
6
|
+
BrowserQuickActionWorkersAiPolicyError,
|
|
7
|
+
browserQuickActionCaptureLayer,
|
|
8
|
+
browserQuickActionWorkersAiCaptureLayer,
|
|
9
|
+
browserQuickActionScreenshotLayer,
|
|
10
|
+
CloudflareBrowser,
|
|
11
|
+
type BrowserQuickActionCaptureOptions,
|
|
12
|
+
type BrowserQuickActionClient,
|
|
13
|
+
type BrowserQuickActionWorkersAiPolicy,
|
|
14
|
+
type CloudflareBrowserOptions,
|
|
15
|
+
} from "./internal/browser-quick-action.ts";
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
CodeOutputLimitError,
|
|
15
15
|
CodeProgramFailedError,
|
|
16
16
|
CodeSourceError,
|
|
17
|
-
SandboxImplementation,
|
|
18
17
|
type CodeExecutorExecute,
|
|
19
18
|
type CodeExecutionRequest,
|
|
20
|
-
} from "@effect-agent/sandbox";
|
|
19
|
+
} from "@effect-agent/sandbox/CodeExecutor";
|
|
20
|
+
import { SandboxImplementation } from "@effect-agent/sandbox/Sandbox";
|
|
21
21
|
import { RpcTarget } from "cloudflare:workers";
|
|
22
22
|
import { Clock, Duration, Effect, Exit, Fiber, Layer, Option, Queue, Schema } from "effect";
|
|
23
23
|
|
|
24
|
-
import { safeCauseDiagnostic, safeCauseMessage } from "./boundary.ts";
|
|
24
|
+
import { safeCauseDiagnostic, safeCauseMessage } from "./internal/boundary.ts";
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* The Cloudflare Dynamic Worker `CodeExecutor` adapter (C4 of ADR-0017;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { DEFAULT_MAX_STORED_VALUE_BYTES } from "@effect-agent/storage-cloudflare";
|
|
2
|
-
import {
|
|
1
|
+
import { DEFAULT_MAX_STORED_VALUE_BYTES } from "@effect-agent/storage-cloudflare/DoStorageConfig";
|
|
2
|
+
import { DeploymentId } from "@effect-agent/thread/Records";
|
|
3
|
+
import { DEFAULT_OWNERSHIP_LEASE_DURATION } from "@effect-agent/thread/SubmissionLedger";
|
|
3
4
|
import { Context, Duration, Schema } from "effect";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
+
import * as Memory from "@effect-agent/core/Memory";
|
|
2
|
+
import * as MemoryNamespace from "@effect-agent/core/MemoryNamespace";
|
|
3
|
+
import { MemoryNamespaceAddress } from "@effect-agent/core/MemoryNamespace";
|
|
4
|
+
import { type MemoryLookup, MemoryRecallLimits } from "@effect-agent/core/MemoryReference";
|
|
5
|
+
import { MemoryAccess } from "@effect-agent/core/MemoryRevalidation";
|
|
1
6
|
import {
|
|
2
|
-
type MemoryLookup,
|
|
3
7
|
type MemoryReader,
|
|
4
8
|
type MemoryWrite,
|
|
5
|
-
Memory,
|
|
6
|
-
MemoryAccess,
|
|
7
9
|
MemoryDocument,
|
|
8
10
|
MemoryMutationFailpoint,
|
|
9
|
-
MemoryNamespace,
|
|
10
|
-
MemoryNamespaceAddress,
|
|
11
|
-
MemoryRecallLimits,
|
|
12
11
|
MemoryStorageError,
|
|
13
12
|
MemoryWriter,
|
|
13
|
+
} from "@effect-agent/core/MemoryStore";
|
|
14
|
+
import {
|
|
14
15
|
type MemoryIndexSearch,
|
|
15
|
-
type SemanticCandidateLimits,
|
|
16
16
|
type SemanticMemoryProfile,
|
|
17
|
-
} from "@effect-agent/core";
|
|
17
|
+
} from "@effect-agent/core/SemanticMemoryIndex";
|
|
18
|
+
import { type SemanticCandidateLimits } from "@effect-agent/core/SemanticMemoryRevalidation";
|
|
18
19
|
import {
|
|
19
20
|
type DoMemoryStorageLimits,
|
|
21
|
+
defaultDoMemoryStorageLimits,
|
|
22
|
+
doMemoryStoreLayerWithFailpoints,
|
|
23
|
+
} from "@effect-agent/storage-cloudflare/DoMemoryStore";
|
|
24
|
+
import {
|
|
20
25
|
type MemoryOwnerAuthorizer,
|
|
21
26
|
decodeMemoryWire,
|
|
22
|
-
defaultDoMemoryStorageLimits,
|
|
23
27
|
defaultMemoryRpcLimits,
|
|
24
|
-
doMemoryStoreLayerWithFailpoints,
|
|
25
28
|
encodeMemoryWire,
|
|
26
29
|
handleMemoryOwnerRequest,
|
|
27
30
|
MemoryOwnerIdentity,
|
|
@@ -30,8 +33,8 @@ import {
|
|
|
30
33
|
MemoryRpcError,
|
|
31
34
|
MemoryRpcLimits,
|
|
32
35
|
type MemoryOwnerFailure,
|
|
33
|
-
} from "@effect-agent/storage-cloudflare";
|
|
34
|
-
import { Principal } from "@effect-agent/thread";
|
|
36
|
+
} from "@effect-agent/storage-cloudflare/MemoryProtocol";
|
|
37
|
+
import { Principal } from "@effect-agent/thread/SubmissionLedger";
|
|
35
38
|
import { Clock, Context, Effect, Layer, Schema } from "effect";
|
|
36
39
|
import {
|
|
37
40
|
DurableObject as EffectCfDurableObject,
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { AgentId } from "@effect-agent/core";
|
|
1
|
+
import { AgentId } from "@effect-agent/core/Identifiers";
|
|
2
2
|
import {
|
|
3
3
|
DoScheduleAlarmControl,
|
|
4
4
|
DoScheduleTransaction,
|
|
5
5
|
scheduleStoreLayer,
|
|
6
|
-
} from "@effect-agent/storage-cloudflare";
|
|
6
|
+
} from "@effect-agent/storage-cloudflare/DoScheduleStore";
|
|
7
|
+
import { type DurableSubmitAgent } from "@effect-agent/thread/DurableAgentRuntime";
|
|
8
|
+
import { DefinitionDigests, PersistedJson } from "@effect-agent/thread/Records";
|
|
7
9
|
import {
|
|
8
|
-
DefinitionDigests,
|
|
9
|
-
PersistedJson,
|
|
10
|
-
type DurableSubmitAgent,
|
|
11
10
|
ScheduleAuthorizationError,
|
|
12
11
|
type ScheduleAuthorizer,
|
|
13
12
|
ScheduleCapacityError,
|
|
@@ -25,13 +24,15 @@ import {
|
|
|
25
24
|
ScheduleStorageError,
|
|
26
25
|
ScheduleTimingRequest,
|
|
27
26
|
ScheduleValidationError,
|
|
27
|
+
defaultSchedulingLimits,
|
|
28
|
+
} from "@effect-agent/thread/Schedule";
|
|
29
|
+
import { scheduleOwnerKey } from "@effect-agent/thread/ScheduleTransition";
|
|
30
|
+
import {
|
|
28
31
|
Scheduling,
|
|
29
32
|
ScheduleDriver,
|
|
30
33
|
type ScheduleManagementFailure,
|
|
31
|
-
defaultSchedulingLimits,
|
|
32
|
-
scheduleOwnerKey,
|
|
33
34
|
ScheduleWakeNoop,
|
|
34
|
-
} from "@effect-agent/thread";
|
|
35
|
+
} from "@effect-agent/thread/Scheduling";
|
|
35
36
|
import { BrowserCrypto } from "@effect/platform-browser";
|
|
36
37
|
import { SqliteClient } from "@effect/sql-sqlite-do";
|
|
37
38
|
import { Clock, Context, DateTime, Effect, Layer, Schema } from "effect";
|
|
@@ -42,12 +43,12 @@ import {
|
|
|
42
43
|
type WorkerEnvironment,
|
|
43
44
|
} from "effect-cf";
|
|
44
45
|
|
|
45
|
-
import type { ThreadObjectNamespace } from "./
|
|
46
|
-
import { CloudflareThreadClient } from "./
|
|
46
|
+
import type { ThreadObjectNamespace } from "./CloudflareBindings.ts";
|
|
47
|
+
import { CloudflareThreadClient } from "./CloudflareThreadClient.ts";
|
|
47
48
|
import {
|
|
48
49
|
cloudflarePreparedInputAdmissionLayer,
|
|
49
50
|
cloudflareScheduledInputAdmissionLayer,
|
|
50
|
-
} from "./prepared-admission.ts";
|
|
51
|
+
} from "./internal/prepared-admission.ts";
|
|
51
52
|
|
|
52
53
|
const SCHEDULE_ALARM_TAG = "effect-agent/ScheduleOwnerWake";
|
|
53
54
|
const SCHEDULE_ALARM_ID = "driver";
|
|
@@ -2,30 +2,32 @@ import {
|
|
|
2
2
|
DoSubscriptionAlarmControl,
|
|
3
3
|
DoSubscriptionTransaction,
|
|
4
4
|
doSubscriptionStoreLayer,
|
|
5
|
-
} from "@effect-agent/storage-cloudflare";
|
|
5
|
+
} from "@effect-agent/storage-cloudflare/DoSubscriptionStore";
|
|
6
|
+
import { type EventSources } from "@effect-agent/thread/EventSource";
|
|
7
|
+
import { PersistedJson } from "@effect-agent/thread/Records";
|
|
8
|
+
import { Principal } from "@effect-agent/thread/SubmissionLedger";
|
|
6
9
|
import {
|
|
7
10
|
EventAcknowledgement,
|
|
8
11
|
EventSourceVersion,
|
|
9
|
-
type EventSources,
|
|
10
|
-
type SubscriptionInputBindings,
|
|
11
|
-
PersistedJson,
|
|
12
|
-
Principal,
|
|
13
12
|
SourcePartition,
|
|
14
13
|
type SubscriptionAuthorizer,
|
|
15
14
|
SubscriptionConfiguration,
|
|
16
|
-
SubscriptionDriver,
|
|
17
15
|
SubscriptionDeliverySnapshot,
|
|
18
16
|
SubscriptionError,
|
|
19
17
|
SubscriptionFailpointError,
|
|
20
|
-
SubscriptionIntake,
|
|
21
18
|
SubscriptionKey,
|
|
22
19
|
SubscriptionScope,
|
|
23
20
|
type SubscriptionLimits,
|
|
24
21
|
SubscriptionSnapshot,
|
|
25
22
|
SubscriptionSourceError,
|
|
26
|
-
Subscriptions,
|
|
27
23
|
defaultSubscriptionLimits,
|
|
28
|
-
} from "@effect-agent/thread";
|
|
24
|
+
} from "@effect-agent/thread/Subscription";
|
|
25
|
+
import { type SubscriptionInputBindings } from "@effect-agent/thread/SubscriptionInput";
|
|
26
|
+
import {
|
|
27
|
+
SubscriptionDriver,
|
|
28
|
+
SubscriptionIntake,
|
|
29
|
+
Subscriptions,
|
|
30
|
+
} from "@effect-agent/thread/Subscriptions";
|
|
29
31
|
import { BrowserCrypto } from "@effect/platform-browser";
|
|
30
32
|
import { SqliteClient } from "@effect/sql-sqlite-do";
|
|
31
33
|
import { Cause, Clock, Context, DateTime, Effect, Layer, Schema } from "effect";
|
|
@@ -36,9 +38,9 @@ import {
|
|
|
36
38
|
type WorkerEnvironment,
|
|
37
39
|
} from "effect-cf";
|
|
38
40
|
|
|
39
|
-
import { type ThreadObjectNamespace } from "./
|
|
40
|
-
import { CloudflareThreadClient } from "./
|
|
41
|
-
import { cloudflarePreparedInputAdmissionLayer } from "./prepared-admission.ts";
|
|
41
|
+
import { type ThreadObjectNamespace } from "./CloudflareBindings.ts";
|
|
42
|
+
import { CloudflareThreadClient } from "./CloudflareThreadClient.ts";
|
|
43
|
+
import { cloudflarePreparedInputAdmissionLayer } from "./internal/prepared-admission.ts";
|
|
42
44
|
|
|
43
45
|
const SUBSCRIPTION_ALARM_TAG = "effect-agent/SubscriptionPartitionWake";
|
|
44
46
|
const SUBSCRIPTION_ALARM_ID = "driver";
|
|
@@ -1,43 +1,50 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AgentInputError } from "@effect-agent/core/AgentError";
|
|
2
|
+
import { AgentId, type ThreadId } from "@effect-agent/core/Identifiers";
|
|
3
|
+
import { DigestError } from "@effect-agent/thread/Digest";
|
|
4
|
+
import {
|
|
5
|
+
Receipt,
|
|
6
|
+
type DurableSubmitAgent,
|
|
7
|
+
type DurableSubmitOptions,
|
|
8
|
+
} from "@effect-agent/thread/DurableAgentRuntime";
|
|
9
|
+
import { DurableRuntimeFailpointError } from "@effect-agent/thread/DurableFailpoint";
|
|
10
|
+
import { OperationDenied } from "@effect-agent/thread/OperationAuthorizer";
|
|
11
|
+
import {
|
|
12
|
+
CanonicalRecordEnvelope,
|
|
13
|
+
CanonicalSequence,
|
|
14
|
+
DefinitionDigests,
|
|
15
|
+
PersistedJson,
|
|
16
|
+
} from "@effect-agent/thread/Records";
|
|
2
17
|
import {
|
|
3
18
|
AbortCommand,
|
|
4
19
|
AbortIntent,
|
|
5
20
|
AdmissionConflict,
|
|
6
|
-
AppendConflict,
|
|
7
21
|
ApprovalConflict,
|
|
8
22
|
ApprovalDecisionCommand,
|
|
9
23
|
ApprovalDecisionIntent,
|
|
10
|
-
CanonicalRecordEnvelope,
|
|
11
|
-
CanonicalSequence,
|
|
12
|
-
ThreadNotMaterialized,
|
|
13
|
-
ThreadStoreError,
|
|
14
|
-
DefinitionDigests,
|
|
15
|
-
DigestError,
|
|
16
|
-
DurableRuntimeFailpointError,
|
|
17
|
-
FenceRejected,
|
|
18
24
|
IdempotencyKey,
|
|
19
25
|
JoinedToHost,
|
|
20
26
|
LedgerError,
|
|
21
|
-
OperationDenied,
|
|
22
|
-
PersistedJson,
|
|
23
27
|
Principal,
|
|
24
|
-
Receipt,
|
|
25
28
|
Settlement,
|
|
26
29
|
SettlementConflict,
|
|
27
30
|
UnknownResolutionCommand,
|
|
28
31
|
UnknownResolutionConflict,
|
|
29
32
|
UnknownResolutionIntent,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
} from "@effect-agent/thread/SubmissionLedger";
|
|
34
|
+
import {
|
|
35
|
+
AppendConflict,
|
|
36
|
+
ThreadNotMaterialized,
|
|
37
|
+
ThreadStoreError,
|
|
38
|
+
FenceRejected,
|
|
39
|
+
} from "@effect-agent/thread/ThreadStore";
|
|
33
40
|
import { BrowserCrypto } from "@effect/platform-browser";
|
|
34
41
|
import { Context, Crypto, Duration, Effect, Layer, Schema } from "effect";
|
|
35
42
|
import { RpcTracing } from "effect-cf";
|
|
36
43
|
|
|
37
|
-
import { DurableAlarmError } from "./
|
|
38
|
-
import { ThreadObjectNamespace, type ThreadObjectRpc } from "./
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
44
|
+
import { DurableAlarmError } from "./Alarm.ts";
|
|
45
|
+
import { ThreadObjectNamespace, type ThreadObjectRpc } from "./CloudflareBindings.ts";
|
|
46
|
+
import { AdmissionLimitExceeded } from "./CloudflareConfig.ts";
|
|
47
|
+
import { cloudflareFailureSignals, safeCauseMessage } from "./internal/boundary.ts";
|
|
41
48
|
|
|
42
49
|
/**
|
|
43
50
|
* The Worker↔Thread-Object host protocol (plan §1.4): Schema envelopes for the host
|
|
@@ -24,12 +24,12 @@ import {
|
|
|
24
24
|
InteractiveBrowserProtocolError,
|
|
25
25
|
InteractiveBrowserTargetUrl,
|
|
26
26
|
InteractiveBrowserUnsupportedError,
|
|
27
|
-
PageScreenshotResult,
|
|
28
|
-
SandboxImplementation,
|
|
29
27
|
type BrowserHandle,
|
|
30
28
|
type InteractiveBrowserError,
|
|
31
29
|
type InteractiveBrowserNetworkPolicy,
|
|
32
|
-
} from "@effect-agent/sandbox";
|
|
30
|
+
} from "@effect-agent/sandbox/InteractiveBrowser";
|
|
31
|
+
import { PageScreenshotResult } from "@effect-agent/sandbox/PageScreenshot";
|
|
32
|
+
import { SandboxImplementation } from "@effect-agent/sandbox/Sandbox";
|
|
33
33
|
import {
|
|
34
34
|
Context,
|
|
35
35
|
Clock,
|
|
@@ -47,8 +47,12 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
BrowserRunSessionLifecycle,
|
|
49
49
|
type BrowserRunLifecycleOptions,
|
|
50
|
-
} from "./browser-session-lifecycle.ts";
|
|
51
|
-
|
|
50
|
+
} from "./internal/browser-session-lifecycle.ts";
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
BrowserRunCleanupError,
|
|
54
|
+
BrowserRunSessionLifecycle,
|
|
55
|
+
} from "./internal/browser-session-lifecycle.ts";
|
|
52
56
|
|
|
53
57
|
export const browserRunInteractiveImplementation = SandboxImplementation.make({
|
|
54
58
|
isolation: "isolated",
|
|
@@ -1,40 +1,48 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { SubmissionId } from "@effect-agent/core";
|
|
1
|
+
import { type AgentId } from "@effect-agent/core/Identifiers";
|
|
2
|
+
import { SubmissionId } from "@effect-agent/core/Identifiers";
|
|
3
3
|
import {
|
|
4
4
|
decodePortRequest,
|
|
5
5
|
encodePortResponse,
|
|
6
6
|
type PortRequest,
|
|
7
|
-
} from "@effect-agent/storage-cloudflare";
|
|
7
|
+
} from "@effect-agent/storage-cloudflare/PortProtocol";
|
|
8
8
|
import {
|
|
9
|
-
AppendConflict,
|
|
10
|
-
ThreadNotMaterialized,
|
|
11
|
-
ThreadRead,
|
|
12
|
-
ThreadStore,
|
|
13
|
-
ThreadStoreError,
|
|
14
|
-
DigestError,
|
|
15
|
-
DurableAgentRuntime,
|
|
16
|
-
DurableRuntimeFailpointError,
|
|
17
|
-
FenceRejected,
|
|
18
9
|
IntegrityReport,
|
|
19
|
-
LedgerError,
|
|
20
10
|
ObligationReport,
|
|
21
11
|
ObligationThresholds,
|
|
12
|
+
RecoveryExplanation,
|
|
13
|
+
RetryCommand,
|
|
14
|
+
RetryRefused,
|
|
15
|
+
} from "@effect-agent/thread/Admin";
|
|
16
|
+
import { DigestError } from "@effect-agent/thread/Digest";
|
|
17
|
+
import {
|
|
18
|
+
DurableAgentRuntime,
|
|
19
|
+
RecoveryReport,
|
|
20
|
+
type DurableSubmitAgent,
|
|
21
|
+
} from "@effect-agent/thread/DurableAgentRuntime";
|
|
22
|
+
import { DurableRuntimeFailpointError } from "@effect-agent/thread/DurableFailpoint";
|
|
23
|
+
import {
|
|
22
24
|
OperationAuthorizationRequest,
|
|
23
25
|
OperationAuthorizer,
|
|
24
26
|
OperationDenied,
|
|
27
|
+
} from "@effect-agent/thread/OperationAuthorizer";
|
|
28
|
+
import { PersistedJson } from "@effect-agent/thread/Records";
|
|
29
|
+
import { RunJournalError } from "@effect-agent/thread/RunJournal";
|
|
30
|
+
import {
|
|
31
|
+
LedgerError,
|
|
25
32
|
OwnershipLost,
|
|
26
|
-
PersistedJson,
|
|
27
|
-
RecoveryExplanation,
|
|
28
|
-
RecoveryReport,
|
|
29
|
-
RetryCommand,
|
|
30
|
-
RetryRefused,
|
|
31
|
-
RunJournalError,
|
|
32
33
|
SettlementConflict,
|
|
33
34
|
SubmissionLedger,
|
|
34
35
|
SubmissionLookupByKey,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
} from "@effect-agent/thread/SubmissionLedger";
|
|
37
|
+
import {
|
|
38
|
+
AppendConflict,
|
|
39
|
+
ThreadNotMaterialized,
|
|
40
|
+
ThreadRead,
|
|
41
|
+
ThreadStore,
|
|
42
|
+
ThreadStoreError,
|
|
43
|
+
FenceRejected,
|
|
44
|
+
} from "@effect-agent/thread/ThreadStore";
|
|
45
|
+
import { WakeScheduler } from "@effect-agent/thread/WakeScheduler";
|
|
38
46
|
import { Effect, Layer, Option, Schema, Stream } from "effect";
|
|
39
47
|
import {
|
|
40
48
|
DurableObject as EffectCfDurableObject,
|
|
@@ -47,14 +55,15 @@ import {
|
|
|
47
55
|
DurableAlarmError,
|
|
48
56
|
DurableAlarmService,
|
|
49
57
|
type MaintenancePassFailure,
|
|
50
|
-
} from "./
|
|
58
|
+
} from "./Alarm.ts";
|
|
51
59
|
import {
|
|
52
60
|
ThreadObjectIdentity,
|
|
53
61
|
DurableObjectContext,
|
|
54
62
|
ThreadObjectNamespace,
|
|
55
63
|
threadNamespaceFromEnv,
|
|
56
64
|
type CloudflareBindingError,
|
|
57
|
-
} from "./
|
|
65
|
+
} from "./CloudflareBindings.ts";
|
|
66
|
+
import { AdmissionLimitExceeded, CloudflareDurableRuntimeConfig } from "./CloudflareConfig.ts";
|
|
58
67
|
import {
|
|
59
68
|
AbortRecorded,
|
|
60
69
|
ApprovalRecorded,
|
|
@@ -78,8 +87,7 @@ import {
|
|
|
78
87
|
encodeHostResponse,
|
|
79
88
|
type HostFailure,
|
|
80
89
|
type HostResponse,
|
|
81
|
-
} from "./
|
|
82
|
-
import { AdmissionLimitExceeded, CloudflareDurableRuntimeConfig } from "./config.ts";
|
|
90
|
+
} from "./CloudflareThreadClient.ts";
|
|
83
91
|
import {
|
|
84
92
|
layerConfig,
|
|
85
93
|
ThreadObjectPorts,
|
|
@@ -87,8 +95,8 @@ import {
|
|
|
87
95
|
type CloudflareDurableRuntimeOptions,
|
|
88
96
|
type CloudflareDurableRuntimeServices,
|
|
89
97
|
type CloudflareBootstrapServices,
|
|
90
|
-
} from "./layers.ts";
|
|
91
|
-
import { ProgressWaitRegistry } from "./progress-wait.ts";
|
|
98
|
+
} from "./internal/layers.ts";
|
|
99
|
+
import { ProgressWaitRegistry } from "./internal/progress-wait.ts";
|
|
92
100
|
|
|
93
101
|
export {
|
|
94
102
|
layer,
|
|
@@ -97,7 +105,7 @@ export {
|
|
|
97
105
|
type CloudflareDurableRuntimeServices as Services,
|
|
98
106
|
type CloudflareDurableRuntimeInitializationError as InitializationError,
|
|
99
107
|
type CloudflareBootstrapServices as BootstrapServices,
|
|
100
|
-
} from "./layers.ts";
|
|
108
|
+
} from "./internal/layers.ts";
|
|
101
109
|
|
|
102
110
|
/**
|
|
103
111
|
* `ThreadObject.make(application, options)` — the Thread Durable Object
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { makeWakeSubscriptionHub, WakeScheduler } from "@effect-agent/thread";
|
|
1
|
+
import { type ThreadId } from "@effect-agent/core/Identifiers";
|
|
2
|
+
import { makeWakeSubscriptionHub, WakeScheduler } from "@effect-agent/thread/WakeScheduler";
|
|
3
3
|
import { Effect, Layer, PubSub, Schema, Stream } from "effect";
|
|
4
4
|
|
|
5
|
-
import { DurableAlarmService } from "./
|
|
6
|
-
import { ThreadObjectIdentity, ThreadObjectNamespace } from "./
|
|
7
|
-
import { safeCauseMessage } from "./boundary.ts";
|
|
5
|
+
import { DurableAlarmService } from "./Alarm.ts";
|
|
6
|
+
import { ThreadObjectIdentity, ThreadObjectNamespace } from "./CloudflareBindings.ts";
|
|
7
|
+
import { safeCauseMessage } from "./internal/boundary.ts";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Bounded in-memory wake buffer for same-incarnation `awaitSettlement` subscribers. Wake
|