@effect-agent/storage-cloudflare 0.1.0-beta.38 → 0.1.0-beta.40

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.
@@ -0,0 +1,107 @@
1
+ import { Context, Effect, Layer, Schema } from "effect";
2
+ //#region src/errors.d.ts
3
+ declare const DoStorageCompatibilityError_base: Schema.Class<DoStorageCompatibilityError, Schema.TaggedStruct<"DoStorageCompatibilityError", {
4
+ readonly actualVersion: Schema.Int;
5
+ readonly message: Schema.String;
6
+ readonly supportedVersion: Schema.Int;
7
+ }>, import("effect/Cause").YieldableError>;
8
+ /** The Durable Object's SQLite storage uses a private-development format this adapter cannot read. */
9
+ declare class DoStorageCompatibilityError extends DoStorageCompatibilityError_base {}
10
+ declare const DoStorageCorruptionError_base: Schema.Class<DoStorageCorruptionError, Schema.TaggedStruct<"DoStorageCorruptionError", {
11
+ readonly message: Schema.String;
12
+ readonly rowKey: Schema.String;
13
+ readonly table: Schema.String;
14
+ }>, import("effect/Cause").YieldableError>;
15
+ /** Stored bytes failed the current Schema and cannot be used as recovery truth. */
16
+ declare class DoStorageCorruptionError extends DoStorageCorruptionError_base {}
17
+ declare const DoStorageError_base: Schema.Class<DoStorageError, Schema.TaggedStruct<"DoStorageError", {
18
+ readonly cause: Schema.optionalKey<Schema.Defect>;
19
+ readonly message: Schema.String;
20
+ readonly operation: Schema.String;
21
+ }>, import("effect/Cause").YieldableError>;
22
+ /** Durable Object SQLite infrastructure failed while opening or operating the store. */
23
+ declare class DoStorageError extends DoStorageError_base {}
24
+ declare const DoLedgerError_base: Schema.Class<DoLedgerError, Schema.TaggedStruct<"DoLedgerError", {
25
+ readonly cause: Schema.optionalKey<Schema.Defect>;
26
+ readonly message: Schema.String;
27
+ readonly operation: Schema.String;
28
+ }>, import("effect/Cause").YieldableError>;
29
+ /**
30
+ * Durable Object SQLite infrastructure failed while operating the Submission Ledger. Surfaces
31
+ * at the SubmissionLedger port as the typed `LedgerError` with this error preserved as its
32
+ * cause, so the adapter-level tag is never erased.
33
+ */
34
+ declare class DoLedgerError extends DoLedgerError_base {}
35
+ declare const DoValueBoundExceeded_base: Schema.Class<DoValueBoundExceeded, Schema.TaggedStruct<"DoValueBoundExceeded", {
36
+ readonly actualBytes: Schema.Int;
37
+ readonly maxBytes: Schema.Int;
38
+ readonly operation: Schema.String;
39
+ }>, import("effect/Cause").YieldableError>;
40
+ /**
41
+ * A value to be stored exceeds the configured Durable Object per-value bound
42
+ * (`DoStorageConfigValue.maxStoredValueBytes`, kept under the platform's 2 MB SQLite value
43
+ * limit). The refusal happens typed BEFORE any durable mutation; no partial state is written.
44
+ * Payloads of this size are the designed overflow case for a future R2-backed AttachmentStore
45
+ * (deployment spec §3.1, deferred until a real attachment requirement exists).
46
+ */
47
+ declare class DoValueBoundExceeded extends DoValueBoundExceeded_base {
48
+ get message(): string;
49
+ }
50
+ declare const DoAppendConflict_base: Schema.Class<DoAppendConflict, Schema.TaggedStruct<"DoAppendConflict", {
51
+ readonly message: Schema.String;
52
+ readonly reason: Schema.Literals<readonly ["batch-digest", "record-identity", "tail"]>;
53
+ readonly actualTailSequence: Schema.optionalKey<Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">>;
54
+ readonly actualTailDigest: Schema.optionalKey<Schema.String>;
55
+ }>, import("effect/Cause").YieldableError>;
56
+ /**
57
+ * A canonical batch retry conflicts with existing append state. Tail conflicts carry the
58
+ * actual committed tail as a diagnostic resume hint.
59
+ */
60
+ declare class DoAppendConflict extends DoAppendConflict_base {}
61
+ declare const DoFenceRejected_base: Schema.Class<DoFenceRejected, Schema.TaggedStruct<"DoFenceRejected", {
62
+ readonly actualEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
63
+ readonly message: Schema.String;
64
+ readonly producerEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
65
+ }>, import("effect/Cause").YieldableError>;
66
+ /**
67
+ * A producer epoch does not match the Thread's current writer registration. Appends
68
+ * require the exact registered epoch, so both older and newer unregistered epochs are fenced;
69
+ * a newer epoch takes over by materializing first.
70
+ */
71
+ declare class DoFenceRejected extends DoFenceRejected_base {}
72
+ declare const DoCheckpointConflict_base: Schema.Class<DoCheckpointConflict, Schema.TaggedStruct<"DoCheckpointConflict", {
73
+ readonly message: Schema.String;
74
+ }>, import("effect/Cause").YieldableError>;
75
+ /** A checkpoint conflicts with a previously stored checkpoint at the same offset. */
76
+ declare class DoCheckpointConflict extends DoCheckpointConflict_base {}
77
+ /**
78
+ * Deterministic fault-injection locations at Durable Object storage operation boundaries.
79
+ *
80
+ * The string list is copied VERBATIM from `SqliteStorageFailpointLocation`
81
+ * (`packages/storage-sqlite/src/errors.ts`) so every crash-matrix row keeps the same name on
82
+ * both platforms — the DN process-kill evidence and the DC eviction evidence address identical
83
+ * locations. There is intentionally no Cloudflare-only location.
84
+ */
85
+ declare const DoStorageFailpointLocation: Schema.Literals<readonly ["materialize:before", "materialize:after", "append:before", "append:after-batch-insert", "append:after-record-insert", "append:after-tail-update", "append:after", "export:after-thread-read", "save-checkpoint:before", "save-checkpoint:after", "ledger:admit:before", "ledger:admit:after", "ledger:mark-ready:before", "ledger:mark-ready:after", "ledger:claim:before", "ledger:claim:after", "ledger:mark-input-applied:before", "ledger:mark-input-applied:after", "ledger:renew:before", "ledger:renew:after", "ledger:reserve-settlement:before", "ledger:reserve-settlement:after", "ledger:finalize-settlement:before", "ledger:finalize-settlement:after", "ledger:request-abort:before", "ledger:request-abort:after", "ledger:release:before", "ledger:release:after", "ledger:claim-joining:before", "ledger:claim-joining:after", "ledger:mark-joined:before", "ledger:mark-joined:after", "ledger:revert-joining:before", "ledger:revert-joining:after", "ledger:suspend:before", "ledger:suspend:after", "ledger:approval-decision:before", "ledger:approval-decision:after", "ledger:mark-unknown:before", "ledger:mark-unknown:after", "ledger:unknown-resolution:before", "ledger:unknown-resolution:after", "ledger:child-reservation:before", "ledger:child-reservation:after", "ledger:child-attach:before", "ledger:child-attach:after", "ledger:child-release-pending:before", "ledger:child-release-pending:after", "ledger:child-release:before", "ledger:child-release:after", "ledger:child-settled:before", "ledger:child-settled:after"]>;
86
+ type DoStorageFailpointLocation = typeof DoStorageFailpointLocation.Type;
87
+ declare const DoStorageFailpointError_base: Schema.Class<DoStorageFailpointError, Schema.TaggedStruct<"DoStorageFailpointError", {
88
+ readonly location: Schema.Literals<readonly ["materialize:before", "materialize:after", "append:before", "append:after-batch-insert", "append:after-record-insert", "append:after-tail-update", "append:after", "export:after-thread-read", "save-checkpoint:before", "save-checkpoint:after", "ledger:admit:before", "ledger:admit:after", "ledger:mark-ready:before", "ledger:mark-ready:after", "ledger:claim:before", "ledger:claim:after", "ledger:mark-input-applied:before", "ledger:mark-input-applied:after", "ledger:renew:before", "ledger:renew:after", "ledger:reserve-settlement:before", "ledger:reserve-settlement:after", "ledger:finalize-settlement:before", "ledger:finalize-settlement:after", "ledger:request-abort:before", "ledger:request-abort:after", "ledger:release:before", "ledger:release:after", "ledger:claim-joining:before", "ledger:claim-joining:after", "ledger:mark-joined:before", "ledger:mark-joined:after", "ledger:revert-joining:before", "ledger:revert-joining:after", "ledger:suspend:before", "ledger:suspend:after", "ledger:approval-decision:before", "ledger:approval-decision:after", "ledger:mark-unknown:before", "ledger:mark-unknown:after", "ledger:unknown-resolution:before", "ledger:unknown-resolution:after", "ledger:child-reservation:before", "ledger:child-reservation:after", "ledger:child-attach:before", "ledger:child-attach:after", "ledger:child-release-pending:before", "ledger:child-release-pending:after", "ledger:child-release:before", "ledger:child-release:after", "ledger:child-settled:before", "ledger:child-settled:after"]>;
89
+ }>, import("effect/Cause").YieldableError>;
90
+ /** Deterministic test-only fault or pause injected at a Durable Object storage boundary. */
91
+ declare class DoStorageFailpointError extends DoStorageFailpointError_base {
92
+ get message(): string;
93
+ }
94
+ //#endregion
95
+ //#region src/do-storage-failpoint.d.ts
96
+ type DoStorageFailpointHandler = (location: DoStorageFailpointLocation) => Effect.Effect<void, DoStorageFailpointError>;
97
+ declare const DoStorageFailpoint_base: Context.ServiceClass<DoStorageFailpoint, "@effect-agent/storage-cloudflare/DoStorageFailpoint", {
98
+ readonly hit: DoStorageFailpointHandler;
99
+ }>;
100
+ /** Explicit fault-injection authority used at Durable Object storage operation boundaries. */
101
+ declare class DoStorageFailpoint extends DoStorageFailpoint_base {
102
+ /** Production default: no fault injection. */
103
+ static readonly layer: Layer.Layer<DoStorageFailpoint, never, never>;
104
+ }
105
+ //#endregion
106
+ export { DoFenceRejected as a, DoStorageCorruptionError as c, DoStorageFailpointLocation as d, DoValueBoundExceeded as f, DoCheckpointConflict as i, DoStorageError as l, DoStorageFailpointHandler as n, DoLedgerError as o, DoAppendConflict as r, DoStorageCompatibilityError as s, DoStorageFailpoint as t, DoStorageFailpointError as u };
107
+ //# sourceMappingURL=do-storage-failpoint-9XB9tuif.d.mts.map
@@ -0,0 +1,12 @@
1
+ import { Context, Effect, Layer } from "effect";
2
+ //#region src/do-storage-failpoint.ts
3
+ const noFailpoint = () => Effect.void;
4
+ /** Explicit fault-injection authority used at Durable Object storage operation boundaries. */
5
+ var DoStorageFailpoint = class extends Context.Service()("@effect-agent/storage-cloudflare/DoStorageFailpoint") {
6
+ /** Production default: no fault injection. */
7
+ static layer = Layer.succeed(this)({ hit: noFailpoint });
8
+ };
9
+ //#endregion
10
+ export { DoStorageFailpoint as t };
11
+
12
+ //# sourceMappingURL=do-storage-failpoint-C-Qtchs7.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"do-storage-failpoint-C-Qtchs7.mjs","names":[],"sources":["../src/do-storage-failpoint.ts"],"sourcesContent":["import { Context, Effect, Layer } from \"effect\";\n\nimport type { DoStorageFailpointError, DoStorageFailpointLocation } from \"./errors.ts\";\n\nexport type DoStorageFailpointHandler = (\n location: DoStorageFailpointLocation,\n) => Effect.Effect<void, DoStorageFailpointError>;\n\nconst noFailpoint: DoStorageFailpointHandler = () => Effect.void;\n\n/** Explicit fault-injection authority used at Durable Object storage operation boundaries. */\nexport class DoStorageFailpoint extends Context.Service<\n DoStorageFailpoint,\n {\n readonly hit: DoStorageFailpointHandler;\n }\n>()(\"@effect-agent/storage-cloudflare/DoStorageFailpoint\") {\n /** Production default: no fault injection. */\n static readonly layer = Layer.succeed(this)({ hit: noFailpoint });\n}\n"],"mappings":";;AAQA,MAAM,oBAA+C,OAAO;;AAG5D,IAAa,qBAAb,cAAwC,QAAQ,QAK9C,CAAC,CAAC,qDAAqD,CAAC,CAAC;;CAEzD,OAAgB,QAAQ,MAAM,QAAQ,IAAI,CAAC,CAAC,EAAE,KAAK,YAAY,CAAC;AAClE"}