@yielded/agent-platform-cloudflare 0.1.0-beta.176 → 0.1.0-beta.178
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-7uipp6LW.mjs → Alarm-CZO-Gbts.mjs} +16 -31
- package/dist/Alarm-CZO-Gbts.mjs.map +1 -0
- package/dist/Alarm.d.mts +3 -19
- package/dist/Alarm.mjs +2 -1
- package/dist/CloudflareBindings.d.mts +8 -1
- package/dist/CloudflareBindings.mjs +8 -1
- package/dist/CloudflareBindings.mjs.map +1 -1
- package/dist/CloudflareCodeMode.mjs +4 -0
- package/dist/CloudflareCodeMode.mjs.map +1 -1
- package/dist/CloudflareScheduling.mjs +2 -2
- package/dist/CloudflareSubscriptions.mjs +2 -2
- package/dist/{CloudflareThreadClient-HO_3rkM7.d.mts → CloudflareThreadClient-Bo0cBJe9.d.mts} +246 -96
- package/dist/{CloudflareThreadClient-bA3lGA_2.mjs → CloudflareThreadClient-CEUjVwis.mjs} +69 -62
- package/dist/CloudflareThreadClient-CEUjVwis.mjs.map +1 -0
- package/dist/CloudflareThreadClient.d.mts +2 -2
- package/dist/CloudflareThreadClient.mjs +2 -2
- package/dist/{ThreadObject-CxNlhoPL.d.mts → ThreadObject-DQfv28fe.d.mts} +9 -9
- package/dist/{ThreadObject-SNcCsrS2.mjs → ThreadObject-v-mwNRZ0.mjs} +5 -5
- package/dist/{ThreadObject-SNcCsrS2.mjs.map → ThreadObject-v-mwNRZ0.mjs.map} +1 -1
- package/dist/ThreadObject.d.mts +1 -1
- package/dist/ThreadObject.mjs +1 -1
- package/dist/WakeScheduler.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/{prepared-admission-BvMiFR41.mjs → prepared-admission-C3uBqIz0.mjs} +2 -2
- package/dist/{prepared-admission-BvMiFR41.mjs.map → prepared-admission-C3uBqIz0.mjs.map} +1 -1
- package/package.json +1 -1
- package/src/Alarm.ts +6 -10
- package/src/CloudflareBindings.ts +10 -0
- package/src/CloudflareCodeMode.ts +4 -0
- package/src/CloudflareThreadClient.ts +134 -113
- package/dist/Alarm-7uipp6LW.mjs.map +0 -1
- package/dist/CloudflareThreadClient-bA3lGA_2.mjs.map +0 -1
package/dist/ThreadObject.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as ThreadHostMutation, C as make, D as CloudflareDurableRuntimeInitializationError, E as CloudflareBootstrapServices, F as layerHostConfig, I as layerInHost, M as ThreadPublicationOptions, N as layer, O as CloudflareDurableRuntimeOptions, P as layerConfig, S as handleRpc, T as submit, _ as decodeAdminResponse, a as AdminVerifyRequest, b as decodeRetryCommand, c as Instance, d as RetryExecuted, g as decodeAdminExplainRequest, h as alarms, i as AdminResponse, j as ThreadObjectPorts, k as CloudflareDurableRuntimeServices, l as ObligationsScanned, m as VerifiedIntegrity, n as AdminFailed, o as Class, p as ThreadRpcOperation, r as AdminFailure, s as ExplainedRecovery, t as AdminExplainRequest, u as Options, v as decodeAdminVerifyRequest, w as portCall, x as encodeAdminResponse, y as decodeObligationThresholds } from "./ThreadObject-
|
|
1
|
+
import { A as ThreadHostMutation, C as make, D as CloudflareDurableRuntimeInitializationError, E as CloudflareBootstrapServices, F as layerHostConfig, I as layerInHost, M as ThreadPublicationOptions, N as layer, O as CloudflareDurableRuntimeOptions, P as layerConfig, S as handleRpc, T as submit, _ as decodeAdminResponse, a as AdminVerifyRequest, b as decodeRetryCommand, c as Instance, d as RetryExecuted, g as decodeAdminExplainRequest, h as alarms, i as AdminResponse, j as ThreadObjectPorts, k as CloudflareDurableRuntimeServices, l as ObligationsScanned, m as VerifiedIntegrity, n as AdminFailed, o as Class, p as ThreadRpcOperation, r as AdminFailure, s as ExplainedRecovery, t as AdminExplainRequest, u as Options, v as decodeAdminVerifyRequest, w as portCall, x as encodeAdminResponse, y as decodeObligationThresholds } from "./ThreadObject-DQfv28fe.mjs";
|
|
2
2
|
export { AdminExplainRequest, AdminFailed, AdminFailure, AdminResponse, AdminVerifyRequest, type CloudflareBootstrapServices as BootstrapServices, Class, ExplainedRecovery, type CloudflareDurableRuntimeInitializationError as InitializationError, Instance, ObligationsScanned, Options, type ThreadPublicationOptions as PublicationOptions, RetryExecuted, type CloudflareDurableRuntimeOptions as RuntimeOptions, type CloudflareDurableRuntimeServices as Services, type ThreadHostMutation, ThreadObjectPorts, ThreadRpcOperation, VerifiedIntegrity, alarms, decodeAdminExplainRequest, decodeAdminResponse, decodeAdminVerifyRequest, decodeObligationThresholds, decodeRetryCommand, encodeAdminResponse, handleRpc, layer, layerConfig, layerHostConfig, layerInHost, make, portCall, submit };
|
package/dist/ThreadObject.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as ThreadObjectPorts, D as layerInHost, E as layerHostConfig, S as submit, T as layerConfig, _ as decodeRetryCommand, a as AdminVerifyRequest, b as make, c as RetryExecuted, d as VerifiedIntegrity, f as alarms, g as decodeObligationThresholds, h as decodeAdminVerifyRequest, i as AdminResponse, m as decodeAdminResponse, n as AdminFailed, o as ExplainedRecovery, p as decodeAdminExplainRequest, r as AdminFailure, s as ObligationsScanned, t as AdminExplainRequest, u as ThreadRpcOperation, v as encodeAdminResponse, w as layer, x as portCall, y as handleRpc } from "./ThreadObject-
|
|
1
|
+
import { C as ThreadObjectPorts, D as layerInHost, E as layerHostConfig, S as submit, T as layerConfig, _ as decodeRetryCommand, a as AdminVerifyRequest, b as make, c as RetryExecuted, d as VerifiedIntegrity, f as alarms, g as decodeObligationThresholds, h as decodeAdminVerifyRequest, i as AdminResponse, m as decodeAdminResponse, n as AdminFailed, o as ExplainedRecovery, p as decodeAdminExplainRequest, r as AdminFailure, s as ObligationsScanned, t as AdminExplainRequest, u as ThreadRpcOperation, v as encodeAdminResponse, w as layer, x as portCall, y as handleRpc } from "./ThreadObject-v-mwNRZ0.mjs";
|
|
2
2
|
export { AdminExplainRequest, AdminFailed, AdminFailure, AdminResponse, AdminVerifyRequest, ExplainedRecovery, ObligationsScanned, RetryExecuted, ThreadObjectPorts, ThreadRpcOperation, VerifiedIntegrity, alarms, decodeAdminExplainRequest, decodeAdminResponse, decodeAdminVerifyRequest, decodeObligationThresholds, decodeRetryCommand, encodeAdminResponse, handleRpc, layer, layerConfig, layerHostConfig, layerInHost, make, portCall, submit };
|
package/dist/WakeScheduler.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { ThreadObjectNamespace, ThreadObjectPlacement, callThreadObject } from "./CloudflareBindings.mjs";
|
|
3
3
|
import { r as safeCauseMessage } from "./boundary-BguazVkh.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { n as DurableAlarmService } from "./Alarm-CZO-Gbts.mjs";
|
|
5
5
|
import { CurrentNativeSource } from "@yielded/agent-storage-cloudflare/port-routing";
|
|
6
6
|
import "@yielded/agent/identifiers";
|
|
7
7
|
import { WakeScheduler, makeWakeSubscriptionHub } from "@yielded/agent/wake-scheduler";
|
package/dist/index.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ import { t as CloudflareCodeMode_d_exports } from "./CloudflareCodeMode.mjs";
|
|
|
10
10
|
import { t as CloudflareMemory_d_exports } from "./CloudflareMemory.mjs";
|
|
11
11
|
import { t as CloudflareScheduling_d_exports } from "./CloudflareScheduling.mjs";
|
|
12
12
|
import { t as CloudflareSubscriptions_d_exports } from "./CloudflareSubscriptions.mjs";
|
|
13
|
-
import { m as CloudflareThreadClient_d_exports } from "./CloudflareThreadClient-
|
|
14
|
-
import { f as ThreadObject_d_exports } from "./ThreadObject-
|
|
13
|
+
import { m as CloudflareThreadClient_d_exports } from "./CloudflareThreadClient-Bo0cBJe9.mjs";
|
|
14
|
+
import { f as ThreadObject_d_exports } from "./ThreadObject-DQfv28fe.mjs";
|
|
15
15
|
import { t as WakeScheduler_d_exports } from "./WakeScheduler.mjs";
|
|
16
16
|
export { Alarm_d_exports as Alarm, BrowserCredentials_d_exports as BrowserCredentials, BrowserSession_d_exports as BrowserSession, BrowserUse_d_exports as BrowserUse, CloudflareAiGateway_d_exports as CloudflareAiGateway, 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/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as CloudflareBindings_exports } from "./CloudflareBindings.mjs";
|
|
2
2
|
import { t as CloudflareConfig_exports } from "./CloudflareConfig.mjs";
|
|
3
|
-
import { t as Alarm_exports } from "./Alarm-
|
|
3
|
+
import { t as Alarm_exports } from "./Alarm-CZO-Gbts.mjs";
|
|
4
4
|
import { t as CloudflareBrowser_exports } from "./CloudflareBrowser-Vt8qTdYW.mjs";
|
|
5
5
|
import { t as CloudflareCodeMode_exports } from "./CloudflareCodeMode.mjs";
|
|
6
6
|
import { t as CloudflareMemory_exports } from "./CloudflareMemory.mjs";
|
|
7
|
-
import { s as CloudflareThreadClient_exports } from "./CloudflareThreadClient-
|
|
7
|
+
import { s as CloudflareThreadClient_exports } from "./CloudflareThreadClient-CEUjVwis.mjs";
|
|
8
8
|
import { t as CloudflareScheduling_exports } from "./CloudflareScheduling.mjs";
|
|
9
9
|
import { t as CloudflareSubscriptions_exports } from "./CloudflareSubscriptions.mjs";
|
|
10
10
|
import { t as WakeScheduler_exports } from "./WakeScheduler.mjs";
|
|
11
|
-
import { l as ThreadObject_exports } from "./ThreadObject-
|
|
11
|
+
import { l as ThreadObject_exports } from "./ThreadObject-v-mwNRZ0.mjs";
|
|
12
12
|
import { t as CloudflareAiGateway_exports } from "./CloudflareAiGateway.mjs";
|
|
13
13
|
import { t as BrowserCredentials_exports } from "./BrowserCredentials.mjs";
|
|
14
14
|
import { i as BrowserSession_exports } from "./BrowserSession-aovMjfL4.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as CloudflareThreadClient } from "./CloudflareThreadClient-
|
|
1
|
+
import { o as CloudflareThreadClient } from "./CloudflareThreadClient-CEUjVwis.mjs";
|
|
2
2
|
import "@yielded/agent/durable-agent-runtime";
|
|
3
3
|
import "@yielded/agent/identifiers";
|
|
4
4
|
import { Effect, Layer } from "effect";
|
|
@@ -70,4 +70,4 @@ const cloudflareScheduledInputAdmissionLayer = Layer.effect(ScheduledInputAdmiss
|
|
|
70
70
|
//#endregion
|
|
71
71
|
export { cloudflareScheduledInputAdmissionLayer as n, cloudflarePreparedInputAdmissionLayer as t };
|
|
72
72
|
|
|
73
|
-
//# sourceMappingURL=prepared-admission-
|
|
73
|
+
//# sourceMappingURL=prepared-admission-C3uBqIz0.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepared-admission-
|
|
1
|
+
{"version":3,"file":"prepared-admission-C3uBqIz0.mjs","names":[],"sources":["../src/internal/prepared-admission.ts"],"sourcesContent":["import { type DurableSubmitAgent } from \"@yielded/agent/durable-agent-runtime\";\nimport { type AgentId } from \"@yielded/agent/identifiers\";\nimport { PreparedInputAdmission } from \"@yielded/agent/prepared-input-admission\";\nimport { PersistedJson } from \"@yielded/agent/records\";\nimport {\n type ScheduledEnvelope,\n ScheduledInputAdmission,\n ScheduledInputRetryable,\n ScheduledInputRefused,\n ScheduleStorageError,\n} from \"@yielded/agent/schedule\";\nimport { type PreparedInput } from \"@yielded/agent/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 submissionStatus: (receipt) =>\n client\n .submissionStatus(receipt)\n .pipe(Effect.mapError(() => ScheduledInputRetryable.make({ reason: \"storage\" }))),\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 ...(envelope.admissionGroup === undefined\n ? {}\n : { admissionGroup: envelope.admissionGroup }),\n ...(envelope.admissionFence === undefined\n ? {}\n : { admissionFence: envelope.admissionFence }),\n ...(envelope.workerAdmission === undefined\n ? {}\n : { workerAdmission: envelope.workerAdmission }),\n ...(envelope.messageAdmission === undefined\n ? {}\n : { messageAdmission: envelope.messageAdmission }),\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 AdmissionPolicyError: (error) =>\n error.reason === \"refused\"\n ? ScheduledInputRefused.make({ code: error.code })\n : ScheduledInputRetryable.make({\n reason: error.reason === \"occupied\" ? \"capacity\" : \"storage\",\n }),\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 OwnershipLost: () => 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 ...(envelope.admissionGroup === undefined ? {} : { admissionGroup: envelope.admissionGroup }),\n ...(envelope.admissionFence === undefined ? {} : { admissionFence: envelope.admissionFence }),\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":";;;;;;;;;AAgBA,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,mBAAmB,YACjB,OACG,iBAAiB,OAAO,CAAC,CACzB,KAAK,OAAO,eAAe,wBAAwB,KAAK,EAAE,QAAQ,UAAU,CAAC,CAAC,CAAC;EACpF,SAAS,aACP,OACG,OAAO,iBAAiB,SAAS,OAAO,GAAG,SAAS,OAAO;GAC1D,UAAU,SAAS;GACnB,WAAW,SAAS;GACpB,gBAAgB,SAAS;GACzB,GAAI,SAAS,mBAAmB,KAAA,IAC5B,CAAC,IACD,EAAE,gBAAgB,SAAS,eAAe;GAC9C,GAAI,SAAS,mBAAmB,KAAA,IAC5B,CAAC,IACD,EAAE,gBAAgB,SAAS,eAAe;GAC9C,GAAI,SAAS,oBAAoB,KAAA,IAC7B,CAAC,IACD,EAAE,iBAAiB,SAAS,gBAAgB;GAChD,GAAI,SAAS,qBAAqB,KAAA,IAC9B,CAAC,IACD,EAAE,kBAAkB,SAAS,iBAAiB;GAClD,aAAa,SAAS;EACxB,CAAC,CAAC,CACD,KACC,OAAO,UAAU;GACf,yBACE,qBAAqB,KAAK;IAAE,WAAW;IAAsB,QAAQ;GAAU,CAAC;GAClF,8BAA8B,wBAAwB,KAAK,EAAE,QAAQ,WAAW,CAAC;GACjF,oBAAoB,UAClB,wBAAwB,KAAK,EAC3B,QAAQ,MAAM,eAAe,OAAO,aAAa,YACnD,CAAC;GACH,yBAAyB,wBAAwB,KAAK,EAAE,QAAQ,YAAY,CAAC;GAC7E,uBAAuB,UACrB,MAAM,WAAW,YACb,sBAAsB,KAAK,EAAE,MAAM,MAAM,KAAK,CAAC,IAC/C,wBAAwB,KAAK,EAC3B,QAAQ,MAAM,WAAW,aAAa,aAAa,UACrD,CAAC;GACP,mBAAmB,wBAAwB,KAAK,EAAE,QAAQ,UAAU,CAAC;GACrE,wBAAwB,wBAAwB,KAAK,EAAE,QAAQ,UAAU,CAAC;GAC1E,yBAAyB,wBAAwB,KAAK,EAAE,QAAQ,UAAU,CAAC;GAC3E,uBACE,qBAAqB,KAAK;IAAE,WAAW;IAAsB,QAAQ;GAAU,CAAC;GAClF,mBACE,qBAAqB,KAAK;IAAE,WAAW;IAAsB,QAAQ;GAAU,CAAC;GAClF,6BAA6B,wBAAwB,KAAK,EAAE,QAAQ,UAAU,CAAC;GAC/E,sBAAsB,wBAAwB,KAAK,EAAE,QAAQ,YAAY,CAAC;GAC1E,qBAAqB,wBAAwB,KAAK,EAAE,QAAQ,YAAY,CAAC;GACzE,oCACE,wBAAwB,KAAK,EAAE,QAAQ,YAAY,CAAC;EACxD,CAAC,CACH;CACN,CAAC;AACH,CAAC,CACH;AAEA,MAAM,wBAAwB,cAAgD;CAC5E,eAAe;CACf,UAAU,SAAS;CACnB,mBAAmB,SAAS;CAC5B,GAAI,SAAS,mBAAmB,KAAA,IAAY,CAAC,IAAI,EAAE,gBAAgB,SAAS,eAAe;CAC3F,GAAI,SAAS,mBAAmB,KAAA,IAAY,CAAC,IAAI,EAAE,gBAAgB,SAAS,eAAe;CAC3F,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":"@yielded/agent-platform-cloudflare","version":"0.1.0-beta.
|
|
1
|
+
{"name":"@yielded/agent-platform-cloudflare","version":"0.1.0-beta.178","dependencies":{"@effect/platform-browser":"4.0.4","@effect/sql-sqlite-do":"4.0.4","@yielded/agent":"0.1.0-beta.178","@yielded/agent-storage-cloudflare":"0.1.0-beta.178","@yielded/agent-storage-sql":"0.1.0-beta.178","puppeteer-core":"24.29.0"},"devDependencies":{"@cloudflare/vitest-plugin":"1.4.0","@cloudflare/workers-types":"5.20260926.1","@effect/platform-node":"4.0.4","@effect/sql-d1":"4.0.4","@effect/vitest":"4.0.4","@yielded/agent-testing":"0.1.0-beta.178","effect":"4.0.4","effect-cf":"0.56.4","esbuild":"0.28.1","miniflare":"5.20260811.1-alpha","typescript":"7.0.2","vite":"npm:@voidzero-dev/vite-plus-core@1.1.0","vite-plus":"1.1.0","vitest":"5.0.3"},"peerDependencies":{"effect":"^4.0.3","effect-cf":"^0.56.0"},"exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./alarm":{"types":"./dist/Alarm.d.mts","default":"./dist/Alarm.mjs"},"./browser-rest-capture":{"types":"./dist/BrowserRestCapture.d.mts","default":"./dist/BrowserRestCapture.mjs"},"./browser-rest-crawl":{"types":"./dist/BrowserRestCrawl.d.mts","default":"./dist/BrowserRestCrawl.mjs"},"./cloudflare-bindings":{"types":"./dist/CloudflareBindings.d.mts","default":"./dist/CloudflareBindings.mjs"},"./cloudflare-browser":{"types":"./dist/CloudflareBrowser.d.mts","default":"./dist/CloudflareBrowser.mjs"},"./cloudflare-code-mode":{"types":"./dist/CloudflareCodeMode.d.mts","default":"./dist/CloudflareCodeMode.mjs"},"./cloudflare-config":{"types":"./dist/CloudflareConfig.d.mts","default":"./dist/CloudflareConfig.mjs"},"./cloudflare-memory":{"types":"./dist/CloudflareMemory.d.mts","default":"./dist/CloudflareMemory.mjs"},"./cloudflare-scheduling":{"types":"./dist/CloudflareScheduling.d.mts","default":"./dist/CloudflareScheduling.mjs"},"./cloudflare-subscriptions":{"types":"./dist/CloudflareSubscriptions.d.mts","default":"./dist/CloudflareSubscriptions.mjs"},"./cloudflare-thread-client":{"types":"./dist/CloudflareThreadClient.d.mts","default":"./dist/CloudflareThreadClient.mjs"},"./interactive-browser":{"types":"./dist/InteractiveBrowser.d.mts","default":"./dist/InteractiveBrowser.mjs"},"./browser-session":{"types":"./dist/BrowserSession.d.mts","default":"./dist/BrowserSession.mjs"},"./browser-credentials":{"types":"./dist/BrowserCredentials.d.mts","default":"./dist/BrowserCredentials.mjs"},"./thread-object":{"types":"./dist/ThreadObject.d.mts","default":"./dist/ThreadObject.mjs"},"./wake-scheduler":{"types":"./dist/WakeScheduler.d.mts","default":"./dist/WakeScheduler.mjs"},"./cloudflare-ai-gateway":{"types":"./dist/CloudflareAiGateway.d.mts","default":"./dist/CloudflareAiGateway.mjs"},"./browser-use":{"types":"./dist/BrowserUse.d.mts","default":"./dist/BrowserUse.mjs"}},"description":"Cloudflare Layer assembly for Effect Agent: Durable Objects and Browser Run adapters.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/yielded-dev/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"}}
|
package/src/Alarm.ts
CHANGED
|
@@ -47,7 +47,11 @@ import { DurableObjectAlarm, DurableObjectStorage } from "effect-cf";
|
|
|
47
47
|
import { SqlClient } from "effect/sql/SqlClient";
|
|
48
48
|
import { SqlError, UnknownError } from "effect/sql/SqlError";
|
|
49
49
|
|
|
50
|
-
import {
|
|
50
|
+
import {
|
|
51
|
+
DurableAlarmError,
|
|
52
|
+
DurableObjectContext,
|
|
53
|
+
ThreadObjectPlacement,
|
|
54
|
+
} from "./CloudflareBindings.ts";
|
|
51
55
|
import { AuxiliaryDispatchMillis, CloudflareDurableRuntimeConfig } from "./CloudflareConfig.ts";
|
|
52
56
|
import { safeCauseMessage } from "./internal/boundary.ts";
|
|
53
57
|
import * as DueQueue from "./internal/due-queue.ts";
|
|
@@ -62,15 +66,7 @@ import * as DueQueue from "./internal/due-queue.ts";
|
|
|
62
66
|
* restores the alarm atomically.
|
|
63
67
|
*/
|
|
64
68
|
|
|
65
|
-
|
|
66
|
-
export class DurableAlarmError extends Schema.TaggedError<DurableAlarmError>()(
|
|
67
|
-
"DurableAlarmError",
|
|
68
|
-
{
|
|
69
|
-
operation: Schema.String,
|
|
70
|
-
message: Schema.String,
|
|
71
|
-
cause: Schema.optionalKey(Schema.Defect()),
|
|
72
|
-
},
|
|
73
|
-
) {}
|
|
69
|
+
export { DurableAlarmError } from "./CloudflareBindings.ts";
|
|
74
70
|
|
|
75
71
|
/** Content-free operational notice: pending work now retries at the hourly ceiling. */
|
|
76
72
|
class MaintenanceRetryParked extends Schema.TaggedError<MaintenanceRetryParked>()(
|
|
@@ -206,3 +206,13 @@ export class ThreadObjectPlacement extends Context.Service<
|
|
|
206
206
|
readonly threadId?: ThreadId;
|
|
207
207
|
}
|
|
208
208
|
>()("@effect-agent/platform-cloudflare/ThreadObjectPlacement") {}
|
|
209
|
+
|
|
210
|
+
/** The Durable Object alarm API failed; surfaces on host entry points as a typed refusal. */
|
|
211
|
+
export class DurableAlarmError extends Schema.TaggedError<DurableAlarmError>()(
|
|
212
|
+
"DurableAlarmError",
|
|
213
|
+
{
|
|
214
|
+
operation: Schema.String,
|
|
215
|
+
message: Schema.String,
|
|
216
|
+
cause: Schema.optionalKey(Schema.Defect()),
|
|
217
|
+
},
|
|
218
|
+
) {}
|
|
@@ -147,6 +147,10 @@ export default class CodeModeHarness extends WorkerEntrypoint {
|
|
|
147
147
|
return outcome.value;
|
|
148
148
|
}
|
|
149
149
|
if (outcome !== null && typeof outcome === "object" && outcome._tag === "CodeHostCallFailure") {
|
|
150
|
+
if (outcome.error !== null && typeof outcome.error === "object") {
|
|
151
|
+
const display = JSON.stringify(outcome.error);
|
|
152
|
+
Object.defineProperty(outcome.error, Symbol.toPrimitive, { value: () => display });
|
|
153
|
+
}
|
|
150
154
|
throw outcome.error;
|
|
151
155
|
}
|
|
152
156
|
fatal = fatal ?? { _tag: "protocol", message: "host returned an unrecognized outcome" };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AgentInputError } from "@yielded/agent/agent-error";
|
|
2
2
|
import { DigestError } from "@yielded/agent/digest";
|
|
3
3
|
import {
|
|
4
|
-
Receipt,
|
|
5
4
|
type DurableSubmitAgent,
|
|
6
5
|
type DurableSubmitOptions,
|
|
7
6
|
} from "@yielded/agent/durable-agent-runtime";
|
|
@@ -9,6 +8,7 @@ import { DurableRuntimeFailpointError } from "@yielded/agent/durable-failpoint";
|
|
|
9
8
|
import { AgentId, type ThreadId } from "@yielded/agent/identifiers";
|
|
10
9
|
import { InputMessage } from "@yielded/agent/messaging";
|
|
11
10
|
import { OperationDenied } from "@yielded/agent/operation-authorizer";
|
|
11
|
+
import { Receipt } from "@yielded/agent/receipt";
|
|
12
12
|
import {
|
|
13
13
|
CanonicalRecordEnvelope,
|
|
14
14
|
CanonicalSequence,
|
|
@@ -47,9 +47,9 @@ import {
|
|
|
47
47
|
import { Context, Crypto, Duration, Effect, Layer, Predicate, Schema, Stream } from "effect";
|
|
48
48
|
import { RpcTargets, RpcTracing } from "effect-cf";
|
|
49
49
|
|
|
50
|
-
import { DurableAlarmError } from "./Alarm.ts";
|
|
51
50
|
import {
|
|
52
51
|
callThreadObject,
|
|
52
|
+
DurableAlarmError,
|
|
53
53
|
ThreadObjectNamespace,
|
|
54
54
|
type ThreadObjectRpc,
|
|
55
55
|
} from "./CloudflareBindings.ts";
|
|
@@ -284,7 +284,9 @@ export type HostResponse = typeof HostResponse.Type;
|
|
|
284
284
|
// ---------------------------------------------------------------------------
|
|
285
285
|
|
|
286
286
|
export const decodeSubmitRequest = Schema.decodeUnknownEffect(SubmitRequest);
|
|
287
|
-
|
|
287
|
+
// Encode the caller's fields directly: constructing a Class first would validate the
|
|
288
|
+
// same envelope twice. The Object still decodes its untrusted request independently.
|
|
289
|
+
export const encodeSubmitRequest = Schema.encodeEffect(Schema.Struct(SubmitRequest.fields));
|
|
288
290
|
export const decodeReceipt = Schema.decodeUnknownEffect(Receipt);
|
|
289
291
|
export const encodeReceipt = Schema.encodeEffect(Receipt);
|
|
290
292
|
export const decodeAwaitSettlementRequest = Schema.decodeUnknownEffect(AwaitSettlementRequest);
|
|
@@ -388,10 +390,14 @@ const liveTextProtocolFailure = () =>
|
|
|
388
390
|
|
|
389
391
|
const decodeLiveTextFrame = Schema.decodeUnknownSync(Schema.fromJsonString(LiveTextFrame));
|
|
390
392
|
|
|
391
|
-
|
|
393
|
+
/**
|
|
394
|
+
* Validate untrusted NDJSON at the final consumer, including frame bounds, thread,
|
|
395
|
+
* sequence and text lifecycle. Stream loss invalidates all provisional drafts.
|
|
396
|
+
*/
|
|
397
|
+
export const decodeLiveText = <E, R>(
|
|
392
398
|
threadId: ThreadId,
|
|
393
|
-
source:
|
|
394
|
-
): Stream.Stream<LiveTextFrame,
|
|
399
|
+
source: Stream.Stream<Uint8Array, E, R>,
|
|
400
|
+
): Stream.Stream<LiveTextFrame, E | HostProtocolError, R> =>
|
|
395
401
|
Stream.suspend(() => {
|
|
396
402
|
const decoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: false });
|
|
397
403
|
let pending = "";
|
|
@@ -459,17 +465,7 @@ const decodeLiveText = (
|
|
|
459
465
|
return true;
|
|
460
466
|
});
|
|
461
467
|
|
|
462
|
-
return
|
|
463
|
-
evaluate: () => source,
|
|
464
|
-
// The subscription Scope owns the single bounded cancellation after this reader unlocks.
|
|
465
|
-
releaseLockOnEnd: true,
|
|
466
|
-
onError: (cause) =>
|
|
467
|
-
ThreadClientError.make({
|
|
468
|
-
threadId,
|
|
469
|
-
message: "Provisional text disconnected; discard drafts and read canonical records",
|
|
470
|
-
cause,
|
|
471
|
-
}),
|
|
472
|
-
}).pipe(
|
|
468
|
+
return source.pipe(
|
|
473
469
|
Stream.mapEffect(
|
|
474
470
|
Effect.fnUntraced(function* (chunk) {
|
|
475
471
|
if (!(chunk instanceof Uint8Array)) return yield* liveTextProtocolFailure();
|
|
@@ -573,6 +569,14 @@ export class CloudflareThreadClient extends Context.Service<
|
|
|
573
569
|
* Scope the stream: interruption cancels its remote subscription.
|
|
574
570
|
*/
|
|
575
571
|
readonly watchText: (threadId: ThreadId) => Stream.Stream<LiveTextFrame, ClientObserveFailure>;
|
|
572
|
+
/**
|
|
573
|
+
* Forward producer NDJSON bytes without decoding or re-encoding frames.
|
|
574
|
+
* The final consumer must use `decodeLiveText` to validate untrusted frames.
|
|
575
|
+
* Interruption cancels the remote subscription; buffers remain producer-bounded.
|
|
576
|
+
*/
|
|
577
|
+
readonly watchTextBytes: (
|
|
578
|
+
threadId: ThreadId,
|
|
579
|
+
) => Stream.Stream<Uint8Array, ClientObserveFailure>;
|
|
576
580
|
/** One bounded page of canonical records. */
|
|
577
581
|
readonly readPage: (
|
|
578
582
|
threadId: ThreadId,
|
|
@@ -780,6 +784,115 @@ export class CloudflareThreadClient extends Context.Service<
|
|
|
780
784
|
);
|
|
781
785
|
});
|
|
782
786
|
|
|
787
|
+
const watchTextBytes = (
|
|
788
|
+
threadId: ThreadId,
|
|
789
|
+
): Stream.Stream<Uint8Array, ClientObserveFailure> =>
|
|
790
|
+
Stream.unwrap(
|
|
791
|
+
Effect.gen(function* () {
|
|
792
|
+
const traceArgs =
|
|
793
|
+
rpcTracing === undefined ? [] : yield* RpcTracing.withRpcTraceContext([]);
|
|
794
|
+
|
|
795
|
+
const openingFailure = (cause: unknown) =>
|
|
796
|
+
ThreadClientError.make({
|
|
797
|
+
threadId,
|
|
798
|
+
message: "Provisional text observation could not reach the Thread Object",
|
|
799
|
+
cause,
|
|
800
|
+
...cloudflareFailureSignals(cause),
|
|
801
|
+
});
|
|
802
|
+
|
|
803
|
+
// Retain the original RPC promise: resolving through callThreadObject would
|
|
804
|
+
// erase its optional native disposer before an interrupted opening can use it.
|
|
805
|
+
const target = yield* RpcTargets.get(namespace, threadId, () =>
|
|
806
|
+
namespace.get(threadId),
|
|
807
|
+
).pipe(Effect.mapError(openingFailure));
|
|
808
|
+
|
|
809
|
+
let request: Promise<unknown> | undefined;
|
|
810
|
+
let received: unknown;
|
|
811
|
+
let closed = false;
|
|
812
|
+
|
|
813
|
+
const cancel = () => {
|
|
814
|
+
const value = received;
|
|
815
|
+
|
|
816
|
+
received = undefined;
|
|
817
|
+
|
|
818
|
+
return value instanceof ReadableStream && !value.locked
|
|
819
|
+
? value.cancel().catch(() => undefined)
|
|
820
|
+
: Promise.resolve();
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
// Install ownership before invoking foreign code, not after its promise settles.
|
|
824
|
+
yield* Effect.addFinalizer(() =>
|
|
825
|
+
Effect.try({
|
|
826
|
+
try: () => {
|
|
827
|
+
closed = true;
|
|
828
|
+
if (Predicate.hasProperty(request, Symbol.dispose)) {
|
|
829
|
+
const dispose = request[Symbol.dispose];
|
|
830
|
+
|
|
831
|
+
if (typeof dispose === "function") dispose.call(request);
|
|
832
|
+
}
|
|
833
|
+
},
|
|
834
|
+
catch: () => undefined,
|
|
835
|
+
}).pipe(
|
|
836
|
+
Effect.ignore,
|
|
837
|
+
Effect.andThen(
|
|
838
|
+
Effect.tryPromise({ try: cancel, catch: () => undefined }).pipe(
|
|
839
|
+
Effect.interruptible,
|
|
840
|
+
Effect.timeout(PROGRESS_CANCELLATION_TIMEOUT),
|
|
841
|
+
Effect.ignore,
|
|
842
|
+
),
|
|
843
|
+
),
|
|
844
|
+
),
|
|
845
|
+
);
|
|
846
|
+
|
|
847
|
+
const raw = yield* Effect.tryPromise({
|
|
848
|
+
try: () => {
|
|
849
|
+
request = target.watchTextEncoded(
|
|
850
|
+
Schema.encodeSync(WatchTextRequest)({ schemaVersion: 1 }),
|
|
851
|
+
...traceArgs,
|
|
852
|
+
);
|
|
853
|
+
|
|
854
|
+
return request.then((value) => {
|
|
855
|
+
received = value;
|
|
856
|
+
|
|
857
|
+
// A custom endpoint may return a plain, non-cancellable promise. Keep
|
|
858
|
+
// late cleanup on that native promise chain; it starts no Effect fiber.
|
|
859
|
+
return closed ? cancel().then(() => value) : value;
|
|
860
|
+
});
|
|
861
|
+
},
|
|
862
|
+
catch: openingFailure,
|
|
863
|
+
}).pipe(
|
|
864
|
+
Effect.interruptible,
|
|
865
|
+
Effect.tapCause(() => RpcTargets.invalidate(target)),
|
|
866
|
+
);
|
|
867
|
+
|
|
868
|
+
if (raw instanceof ReadableStream)
|
|
869
|
+
return Stream.fromReadableStream<Uint8Array, ThreadClientError>({
|
|
870
|
+
evaluate: () => raw,
|
|
871
|
+
// The subscription Scope cancels after the reader releases its lock.
|
|
872
|
+
releaseLockOnEnd: true,
|
|
873
|
+
onError: (cause) =>
|
|
874
|
+
ThreadClientError.make({
|
|
875
|
+
threadId,
|
|
876
|
+
message:
|
|
877
|
+
"Provisional text disconnected; discard drafts and read canonical records",
|
|
878
|
+
cause,
|
|
879
|
+
}),
|
|
880
|
+
});
|
|
881
|
+
|
|
882
|
+
const response = yield* decodeHostResponse(raw).pipe(
|
|
883
|
+
Effect.mapError(liveTextProtocolFailure),
|
|
884
|
+
);
|
|
885
|
+
|
|
886
|
+
if (
|
|
887
|
+
response._tag === "HostFailed" &&
|
|
888
|
+
Schema.is(ClientObserveHostFailure)(response.failure)
|
|
889
|
+
)
|
|
890
|
+
return yield* response.failure;
|
|
891
|
+
|
|
892
|
+
return yield* liveTextProtocolFailure();
|
|
893
|
+
}),
|
|
894
|
+
);
|
|
895
|
+
|
|
783
896
|
return CloudflareThreadClient.of({
|
|
784
897
|
submit: Effect.fnUntraced(function* <InputSchema extends Schema.Top>(
|
|
785
898
|
agent: DurableSubmitAgent<InputSchema>,
|
|
@@ -802,7 +915,7 @@ export class CloudflareThreadClient extends Context.Service<
|
|
|
802
915
|
),
|
|
803
916
|
);
|
|
804
917
|
|
|
805
|
-
const request =
|
|
918
|
+
const request = {
|
|
806
919
|
agentId: agent.definition.id,
|
|
807
920
|
principal: options.principal,
|
|
808
921
|
idempotencyKey: options.idempotencyKey,
|
|
@@ -820,7 +933,7 @@ export class CloudflareThreadClient extends Context.Service<
|
|
|
820
933
|
: { messageAdmission: options.messageAdmission }),
|
|
821
934
|
definitions: options.definitions,
|
|
822
935
|
inputPayload,
|
|
823
|
-
}
|
|
936
|
+
};
|
|
824
937
|
|
|
825
938
|
const encoded = yield* encodeSubmitRequest(request).pipe(
|
|
826
939
|
Effect.mapError((error) =>
|
|
@@ -925,100 +1038,8 @@ export class CloudflareThreadClient extends Context.Service<
|
|
|
925
1038
|
yield* attempt(0).pipe(Effect.onInterrupt(() => cancelProgress(threadId, waiterId)));
|
|
926
1039
|
}),
|
|
927
1040
|
|
|
928
|
-
watchText: (threadId) =>
|
|
929
|
-
|
|
930
|
-
Effect.gen(function* () {
|
|
931
|
-
const traceArgs =
|
|
932
|
-
rpcTracing === undefined ? [] : yield* RpcTracing.withRpcTraceContext([]);
|
|
933
|
-
|
|
934
|
-
const openingFailure = (cause: unknown) =>
|
|
935
|
-
ThreadClientError.make({
|
|
936
|
-
threadId,
|
|
937
|
-
message: "Provisional text observation could not reach the Thread Object",
|
|
938
|
-
cause,
|
|
939
|
-
...cloudflareFailureSignals(cause),
|
|
940
|
-
});
|
|
941
|
-
|
|
942
|
-
// Retain the original RPC promise: resolving through callThreadObject would
|
|
943
|
-
// erase its optional native disposer before an interrupted opening can use it.
|
|
944
|
-
const target = yield* RpcTargets.get(namespace, threadId, () =>
|
|
945
|
-
namespace.get(threadId),
|
|
946
|
-
).pipe(Effect.mapError(openingFailure));
|
|
947
|
-
|
|
948
|
-
let request: Promise<unknown> | undefined;
|
|
949
|
-
let received: unknown;
|
|
950
|
-
let closed = false;
|
|
951
|
-
|
|
952
|
-
const cancel = () => {
|
|
953
|
-
const value = received;
|
|
954
|
-
|
|
955
|
-
received = undefined;
|
|
956
|
-
|
|
957
|
-
return value instanceof ReadableStream && !value.locked
|
|
958
|
-
? value.cancel().catch(() => undefined)
|
|
959
|
-
: Promise.resolve();
|
|
960
|
-
};
|
|
961
|
-
|
|
962
|
-
// Install ownership before invoking foreign code, not after its promise settles.
|
|
963
|
-
yield* Effect.addFinalizer(() =>
|
|
964
|
-
Effect.try({
|
|
965
|
-
try: () => {
|
|
966
|
-
closed = true;
|
|
967
|
-
if (Predicate.hasProperty(request, Symbol.dispose)) {
|
|
968
|
-
const dispose = request[Symbol.dispose];
|
|
969
|
-
|
|
970
|
-
if (typeof dispose === "function") dispose.call(request);
|
|
971
|
-
}
|
|
972
|
-
},
|
|
973
|
-
catch: () => undefined,
|
|
974
|
-
}).pipe(
|
|
975
|
-
Effect.ignore,
|
|
976
|
-
Effect.andThen(
|
|
977
|
-
Effect.tryPromise({ try: cancel, catch: () => undefined }).pipe(
|
|
978
|
-
Effect.interruptible,
|
|
979
|
-
Effect.timeout(PROGRESS_CANCELLATION_TIMEOUT),
|
|
980
|
-
Effect.ignore,
|
|
981
|
-
),
|
|
982
|
-
),
|
|
983
|
-
),
|
|
984
|
-
);
|
|
985
|
-
|
|
986
|
-
const raw = yield* Effect.tryPromise({
|
|
987
|
-
try: () => {
|
|
988
|
-
request = target.watchTextEncoded(
|
|
989
|
-
Schema.encodeSync(WatchTextRequest)({ schemaVersion: 1 }),
|
|
990
|
-
...traceArgs,
|
|
991
|
-
);
|
|
992
|
-
|
|
993
|
-
return request.then((value) => {
|
|
994
|
-
received = value;
|
|
995
|
-
|
|
996
|
-
// A custom endpoint may return a plain, non-cancellable promise. Keep
|
|
997
|
-
// late cleanup on that native promise chain; it starts no Effect fiber.
|
|
998
|
-
return closed ? cancel().then(() => value) : value;
|
|
999
|
-
});
|
|
1000
|
-
},
|
|
1001
|
-
catch: openingFailure,
|
|
1002
|
-
}).pipe(
|
|
1003
|
-
Effect.interruptible,
|
|
1004
|
-
Effect.tapCause(() => RpcTargets.invalidate(target)),
|
|
1005
|
-
);
|
|
1006
|
-
|
|
1007
|
-
if (raw instanceof ReadableStream) return decodeLiveText(threadId, raw);
|
|
1008
|
-
|
|
1009
|
-
const response = yield* decodeHostResponse(raw).pipe(
|
|
1010
|
-
Effect.mapError(liveTextProtocolFailure),
|
|
1011
|
-
);
|
|
1012
|
-
|
|
1013
|
-
if (
|
|
1014
|
-
response._tag === "HostFailed" &&
|
|
1015
|
-
Schema.is(ClientObserveHostFailure)(response.failure)
|
|
1016
|
-
)
|
|
1017
|
-
return yield* response.failure;
|
|
1018
|
-
|
|
1019
|
-
return yield* liveTextProtocolFailure();
|
|
1020
|
-
}),
|
|
1021
|
-
),
|
|
1041
|
+
watchText: (threadId) => decodeLiveText(threadId, watchTextBytes(threadId)),
|
|
1042
|
+
watchTextBytes,
|
|
1022
1043
|
|
|
1023
1044
|
readPage,
|
|
1024
1045
|
|