@effect-agent/storage-cloudflare 0.0.1-beta.4 → 0.0.1-beta.6
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/index.mjs +11 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/src/errors.ts +14 -17
- package/src/port-protocol.ts +1 -1
- package/src/routing.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-agent/storage-cloudflare",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.6",
|
|
4
4
|
"description": "Durable Object SQLite storage adapters and the routed port protocol for Effect Agent on Cloudflare.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
"test": "vitest run"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@effect-agent/session": "0.0.1-beta.
|
|
32
|
-
"@effect/platform-browser": "4.0.0-beta.
|
|
33
|
-
"@effect/sql-sqlite-do": "4.0.0-beta.
|
|
34
|
-
"effect": "4.0.0-beta.
|
|
31
|
+
"@effect-agent/session": "0.0.1-beta.6",
|
|
32
|
+
"@effect/platform-browser": "4.0.0-beta.107",
|
|
33
|
+
"@effect/sql-sqlite-do": "4.0.0-beta.107",
|
|
34
|
+
"effect": "4.0.0-beta.107"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@cloudflare/vitest-pool-workers": "0.21.3",
|
|
38
38
|
"@cloudflare/workers-types": "5.20260813.1",
|
|
39
|
-
"@effect-agent/testing": "0.0.1-beta.
|
|
40
|
-
"@effect/vitest": "4.0.0-beta.
|
|
39
|
+
"@effect-agent/testing": "0.0.1-beta.5",
|
|
40
|
+
"@effect/vitest": "4.0.0-beta.107",
|
|
41
41
|
"typescript": "7.0.2",
|
|
42
42
|
"vite-plus": "0.2.6",
|
|
43
43
|
"vitest": "4.1.10"
|
package/src/errors.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { CanonicalSequence, ProducerEpoch } from "@effect-agent/session";
|
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
|
|
4
4
|
/** The Durable Object's SQLite storage uses a private-development format this adapter cannot read. */
|
|
5
|
-
export class DoStorageCompatibilityError extends Schema.
|
|
5
|
+
export class DoStorageCompatibilityError extends Schema.TaggedError<DoStorageCompatibilityError>()(
|
|
6
6
|
"DoStorageCompatibilityError",
|
|
7
7
|
{
|
|
8
8
|
actualVersion: Schema.Int,
|
|
@@ -12,7 +12,7 @@ export class DoStorageCompatibilityError extends Schema.TaggedErrorClass<DoStora
|
|
|
12
12
|
) {}
|
|
13
13
|
|
|
14
14
|
/** Stored bytes failed the current Schema and cannot be used as recovery truth. */
|
|
15
|
-
export class DoStorageCorruptionError extends Schema.
|
|
15
|
+
export class DoStorageCorruptionError extends Schema.TaggedError<DoStorageCorruptionError>()(
|
|
16
16
|
"DoStorageCorruptionError",
|
|
17
17
|
{
|
|
18
18
|
message: Schema.String,
|
|
@@ -22,7 +22,7 @@ export class DoStorageCorruptionError extends Schema.TaggedErrorClass<DoStorageC
|
|
|
22
22
|
) {}
|
|
23
23
|
|
|
24
24
|
/** Durable Object SQLite infrastructure failed while opening or operating the store. */
|
|
25
|
-
export class DoStorageError extends Schema.
|
|
25
|
+
export class DoStorageError extends Schema.TaggedError<DoStorageError>()("DoStorageError", {
|
|
26
26
|
cause: Schema.optionalKey(Schema.Defect()),
|
|
27
27
|
message: Schema.String,
|
|
28
28
|
operation: Schema.String,
|
|
@@ -33,7 +33,7 @@ export class DoStorageError extends Schema.TaggedErrorClass<DoStorageError>()("D
|
|
|
33
33
|
* at the SubmissionLedger port as the typed `LedgerError` with this error preserved as its
|
|
34
34
|
* cause, so the adapter-level tag is never erased.
|
|
35
35
|
*/
|
|
36
|
-
export class DoLedgerError extends Schema.
|
|
36
|
+
export class DoLedgerError extends Schema.TaggedError<DoLedgerError>()("DoLedgerError", {
|
|
37
37
|
cause: Schema.optionalKey(Schema.Defect()),
|
|
38
38
|
message: Schema.String,
|
|
39
39
|
operation: Schema.String,
|
|
@@ -46,7 +46,7 @@ export class DoLedgerError extends Schema.TaggedErrorClass<DoLedgerError>()("DoL
|
|
|
46
46
|
* Payloads of this size are the designed overflow case for a future R2-backed AttachmentStore
|
|
47
47
|
* (deployment spec §3.1, deferred until a real attachment requirement exists).
|
|
48
48
|
*/
|
|
49
|
-
export class DoValueBoundExceeded extends Schema.
|
|
49
|
+
export class DoValueBoundExceeded extends Schema.TaggedError<DoValueBoundExceeded>()(
|
|
50
50
|
"DoValueBoundExceeded",
|
|
51
51
|
{
|
|
52
52
|
actualBytes: Schema.Int,
|
|
@@ -67,29 +67,26 @@ export class DoValueBoundExceeded extends Schema.TaggedErrorClass<DoValueBoundEx
|
|
|
67
67
|
* A canonical batch retry conflicts with existing append state. Tail conflicts carry the
|
|
68
68
|
* actual committed tail as a diagnostic resume hint.
|
|
69
69
|
*/
|
|
70
|
-
export class DoAppendConflict extends Schema.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
actualTailDigest: Schema.optionalKey(Schema.String),
|
|
77
|
-
},
|
|
78
|
-
) {}
|
|
70
|
+
export class DoAppendConflict extends Schema.TaggedError<DoAppendConflict>()("DoAppendConflict", {
|
|
71
|
+
message: Schema.String,
|
|
72
|
+
reason: Schema.Literals(["batch-digest", "record-identity", "tail"]),
|
|
73
|
+
actualTailSequence: Schema.optionalKey(CanonicalSequence),
|
|
74
|
+
actualTailDigest: Schema.optionalKey(Schema.String),
|
|
75
|
+
}) {}
|
|
79
76
|
|
|
80
77
|
/**
|
|
81
78
|
* A producer epoch does not match the Conversation's current writer registration. Appends
|
|
82
79
|
* require the exact registered epoch, so both older and newer unregistered epochs are fenced;
|
|
83
80
|
* a newer epoch takes over by materializing first.
|
|
84
81
|
*/
|
|
85
|
-
export class DoFenceRejected extends Schema.
|
|
82
|
+
export class DoFenceRejected extends Schema.TaggedError<DoFenceRejected>()("DoFenceRejected", {
|
|
86
83
|
actualEpoch: ProducerEpoch,
|
|
87
84
|
message: Schema.String,
|
|
88
85
|
producerEpoch: ProducerEpoch,
|
|
89
86
|
}) {}
|
|
90
87
|
|
|
91
88
|
/** A checkpoint conflicts with a previously stored checkpoint at the same offset. */
|
|
92
|
-
export class DoCheckpointConflict extends Schema.
|
|
89
|
+
export class DoCheckpointConflict extends Schema.TaggedError<DoCheckpointConflict>()(
|
|
93
90
|
"DoCheckpointConflict",
|
|
94
91
|
{
|
|
95
92
|
message: Schema.String,
|
|
@@ -161,7 +158,7 @@ export const DoStorageFailpointLocation = Schema.Literals([
|
|
|
161
158
|
export type DoStorageFailpointLocation = typeof DoStorageFailpointLocation.Type;
|
|
162
159
|
|
|
163
160
|
/** Deterministic test-only fault or pause injected at a Durable Object storage boundary. */
|
|
164
|
-
export class DoStorageFailpointError extends Schema.
|
|
161
|
+
export class DoStorageFailpointError extends Schema.TaggedError<DoStorageFailpointError>()(
|
|
165
162
|
"DoStorageFailpointError",
|
|
166
163
|
{
|
|
167
164
|
location: DoStorageFailpointLocation,
|
package/src/port-protocol.ts
CHANGED
|
@@ -75,7 +75,7 @@ export const boundPortDiagnostic = (value: string): string =>
|
|
|
75
75
|
* except `resolveAdmission`, which folds it into `AdmissionIndeterminate` because a
|
|
76
76
|
* non-answer is never proof of absence (SUB-031).
|
|
77
77
|
*/
|
|
78
|
-
export class PortProtocolError extends Schema.
|
|
78
|
+
export class PortProtocolError extends Schema.TaggedError<PortProtocolError>()(
|
|
79
79
|
"PortProtocolError",
|
|
80
80
|
{
|
|
81
81
|
message: BoundedDiagnostic,
|
package/src/routing.ts
CHANGED
|
@@ -81,7 +81,7 @@ const UUID_HEAD_PATTERN =
|
|
|
81
81
|
* authority was unreachable, which is exactly the case `AdmissionIndeterminate` was
|
|
82
82
|
* specified for (SUB-031).
|
|
83
83
|
*/
|
|
84
|
-
export class PortTransportError extends Schema.
|
|
84
|
+
export class PortTransportError extends Schema.TaggedError<PortTransportError>()(
|
|
85
85
|
"PortTransportError",
|
|
86
86
|
{
|
|
87
87
|
target: Schema.String,
|