@effect-agent/storage-cloudflare 0.1.0-beta.45 → 0.1.0-beta.46
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/DoMemoryStore.d.mts +24 -0
- package/dist/DoMemoryStore.mjs +50 -0
- package/dist/DoMemoryStore.mjs.map +1 -0
- package/dist/DoScheduleStore.d.mts +36 -0
- package/dist/DoScheduleStore.mjs +369 -0
- package/dist/DoScheduleStore.mjs.map +1 -0
- package/dist/DoStorageConfig.d.mts +45 -0
- package/dist/DoStorageConfig.mjs +52 -0
- package/dist/DoStorageConfig.mjs.map +1 -0
- package/dist/{do-storage-failpoint-9XB9tuif.d.mts → DoStorageError-Qwybzk0O.d.mts} +6 -15
- package/dist/DoStorageError.d.mts +2 -0
- package/dist/DoStorageError.mjs +158 -0
- package/dist/DoStorageError.mjs.map +1 -0
- package/dist/DoStorageFailpoint.d.mts +17 -0
- package/dist/{do-storage-failpoint-C-Qtchs7.mjs → DoStorageFailpoint.mjs} +5 -3
- package/dist/DoStorageFailpoint.mjs.map +1 -0
- package/dist/{testing.d.mts → DoStorageFailpointTesting.d.mts} +4 -3
- package/dist/{testing.mjs → DoStorageFailpointTesting.mjs} +3 -3
- package/dist/DoStorageFailpointTesting.mjs.map +1 -0
- package/dist/DoStorageVersion-KrYUXqeJ.d.mts +10 -0
- package/dist/DoStorageVersion.d.mts +2 -0
- package/dist/DoStorageVersion.mjs +8 -0
- package/dist/DoStorageVersion.mjs.map +1 -0
- package/dist/DoSubmissionLedger.d.mts +23 -0
- package/dist/DoSubmissionLedger.mjs +1716 -0
- package/dist/DoSubmissionLedger.mjs.map +1 -0
- package/dist/DoSubscriptionStore.d.mts +25 -0
- package/dist/DoSubscriptionStore.mjs +720 -0
- package/dist/DoSubscriptionStore.mjs.map +1 -0
- package/dist/DoThreadStore-D9ebIYPv.mjs +1083 -0
- package/dist/DoThreadStore-D9ebIYPv.mjs.map +1 -0
- package/dist/DoThreadStore.d.mts +59 -0
- package/dist/DoThreadStore.mjs +5 -0
- package/dist/MemoryProtocol.d.mts +19796 -0
- package/dist/MemoryProtocol.mjs +182 -0
- package/dist/MemoryProtocol.mjs.map +1 -0
- package/dist/PortProtocol.d.mts +1587 -0
- package/dist/PortProtocol.mjs +175 -0
- package/dist/PortProtocol.mjs.map +1 -0
- package/dist/PortRouting.d.mts +82 -0
- package/dist/PortRouting.mjs +404 -0
- package/dist/PortRouting.mjs.map +1 -0
- package/dist/index.d.mts +13 -21619
- package/dist/index.mjs +13 -4954
- package/dist/migrations-Bo4GU-pp.mjs +236 -0
- package/dist/migrations-Bo4GU-pp.mjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/package.json +1 -1
- package/src/{do-memory-store.ts → DoMemoryStore.ts} +5 -2
- package/src/{do-schedule-store.ts → DoScheduleStore.ts} +6 -4
- package/src/{errors.ts → DoStorageError.ts} +1 -1
- package/src/{do-storage-failpoint.ts → DoStorageFailpoint.ts} +1 -1
- package/src/{do-storage-failpoint-testing.ts → DoStorageFailpointTesting.ts} +2 -2
- package/src/DoStorageVersion.ts +2 -0
- package/src/{do-ledger.ts → DoSubmissionLedger.ts} +22 -20
- package/src/{do-subscription-store.ts → DoSubscriptionStore.ts} +10 -8
- package/src/{do-thread-store.ts → DoThreadStore.ts} +19 -21
- package/src/{memory-protocol.ts → MemoryProtocol.ts} +15 -10
- package/src/{port-protocol.ts → PortProtocol.ts} +13 -11
- package/src/{routing.ts → PortRouting.ts} +10 -8
- package/src/index.ts +12 -36
- package/src/{do-journal.ts → internal/do-journal.ts} +2 -2
- package/dist/do-storage-failpoint-C-Qtchs7.mjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/testing.mjs.map +0 -1
- package/src/testing.ts +0 -2
- /package/src/{do-storage-config.ts → DoStorageConfig.ts} +0 -0
- /package/src/{migrations.ts → internal/migrations.ts} +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { Context, Schema } from "effect";
|
|
3
|
+
//#region src/DoStorageConfig.ts
|
|
4
|
+
var DoStorageConfig_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
DEFAULT_MAX_STORED_VALUE_BYTES: () => DEFAULT_MAX_STORED_VALUE_BYTES,
|
|
6
|
+
DoStorageConfig: () => DoStorageConfig,
|
|
7
|
+
DoStorageConfigValue: () => DoStorageConfigValue
|
|
8
|
+
});
|
|
9
|
+
const ObservationPollInterval = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
|
|
10
|
+
const OwnershipLeaseMillis = Schema.Int.check(Schema.isGreaterThan(0));
|
|
11
|
+
/**
|
|
12
|
+
* Default per-value byte bound, kept under the Durable Object platform's 2 MB SQLite value
|
|
13
|
+
* limit with a safety margin. This is the DC analogue of Node's 16 MB `BoundedStoredText`
|
|
14
|
+
* bound: both fail typed before mutating, only the threshold differs (a documented DN/DC
|
|
15
|
+
* behavioral difference; Travel Planner payloads sit orders of magnitude below both).
|
|
16
|
+
*/
|
|
17
|
+
const DEFAULT_MAX_STORED_VALUE_BYTES = 19e5;
|
|
18
|
+
/** The hard schema ceiling for the configurable bound: never at or above the platform limit. */
|
|
19
|
+
const MaxStoredValueBytes = Schema.Int.check(Schema.isGreaterThan(0), Schema.isLessThanOrEqualTo(2e6));
|
|
20
|
+
/**
|
|
21
|
+
* Validated construction configuration consumed by the Durable Object storage Layers. The
|
|
22
|
+
* storage identity itself belongs to the SqlClient Layer (built from `ctx.storage`);
|
|
23
|
+
* duplicating it here could silently diverge from the handle actually in use.
|
|
24
|
+
*/
|
|
25
|
+
var DoStorageConfigValue = class extends Schema.Class("@effect-agent/storage-cloudflare/DoStorageConfigValue")({
|
|
26
|
+
observationPollInterval: ObservationPollInterval,
|
|
27
|
+
/**
|
|
28
|
+
* Submission ownership lease duration in milliseconds (D5). Inside one Durable Object the
|
|
29
|
+
* object itself is the serialized owner, so the lease's primary DC role is fencing work
|
|
30
|
+
* across DO incarnations (an evicted incarnation's claim becomes reclaimable); correctness
|
|
31
|
+
* never depends on it because every canonical append is fenced by producer epoch.
|
|
32
|
+
*/
|
|
33
|
+
ownershipLeaseDuration: OwnershipLeaseMillis,
|
|
34
|
+
/**
|
|
35
|
+
* Maximum bytes for any single stored text value (canonical batch/record JSON, admission
|
|
36
|
+
* input payload, checkpoint JSON). Enforced typed BEFORE any write; must stay under the
|
|
37
|
+
* platform's 2 MB per-value limit.
|
|
38
|
+
*/
|
|
39
|
+
maxStoredValueBytes: MaxStoredValueBytes,
|
|
40
|
+
/**
|
|
41
|
+
* Re-verify every stored payload and digest chain while opening the store. Per-operation
|
|
42
|
+
* Schema decoding and the digest chain already fail clearly on corrupt rows, so the full
|
|
43
|
+
* scan is an explicit opt-in integrity audit rather than a startup requirement.
|
|
44
|
+
*/
|
|
45
|
+
verifyOnOpen: Schema.Boolean
|
|
46
|
+
}) {};
|
|
47
|
+
/** Explicit Durable Object storage configuration authority. */
|
|
48
|
+
var DoStorageConfig = class extends Context.Service()("@effect-agent/storage-cloudflare/DoStorageConfig") {};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { DEFAULT_MAX_STORED_VALUE_BYTES, DoStorageConfig, DoStorageConfigValue, DoStorageConfig_exports as t };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=DoStorageConfig.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DoStorageConfig.mjs","names":[],"sources":["../src/DoStorageConfig.ts"],"sourcesContent":["import { Context, Schema } from \"effect\";\n\nconst ObservationPollInterval = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));\nconst OwnershipLeaseMillis = Schema.Int.check(Schema.isGreaterThan(0));\n\n/**\n * Default per-value byte bound, kept under the Durable Object platform's 2 MB SQLite value\n * limit with a safety margin. This is the DC analogue of Node's 16 MB `BoundedStoredText`\n * bound: both fail typed before mutating, only the threshold differs (a documented DN/DC\n * behavioral difference; Travel Planner payloads sit orders of magnitude below both).\n */\nexport const DEFAULT_MAX_STORED_VALUE_BYTES = 1_900_000;\n\n/** The hard schema ceiling for the configurable bound: never at or above the platform limit. */\nconst MaxStoredValueBytes = Schema.Int.check(\n Schema.isGreaterThan(0),\n Schema.isLessThanOrEqualTo(2_000_000),\n);\n\n/**\n * Validated construction configuration consumed by the Durable Object storage Layers. The\n * storage identity itself belongs to the SqlClient Layer (built from `ctx.storage`);\n * duplicating it here could silently diverge from the handle actually in use.\n */\nexport class DoStorageConfigValue extends Schema.Class<DoStorageConfigValue>(\n \"@effect-agent/storage-cloudflare/DoStorageConfigValue\",\n)({\n observationPollInterval: ObservationPollInterval,\n /**\n * Submission ownership lease duration in milliseconds (D5). Inside one Durable Object the\n * object itself is the serialized owner, so the lease's primary DC role is fencing work\n * across DO incarnations (an evicted incarnation's claim becomes reclaimable); correctness\n * never depends on it because every canonical append is fenced by producer epoch.\n */\n ownershipLeaseDuration: OwnershipLeaseMillis,\n /**\n * Maximum bytes for any single stored text value (canonical batch/record JSON, admission\n * input payload, checkpoint JSON). Enforced typed BEFORE any write; must stay under the\n * platform's 2 MB per-value limit.\n */\n maxStoredValueBytes: MaxStoredValueBytes,\n /**\n * Re-verify every stored payload and digest chain while opening the store. Per-operation\n * Schema decoding and the digest chain already fail clearly on corrupt rows, so the full\n * scan is an explicit opt-in integrity audit rather than a startup requirement.\n */\n verifyOnOpen: Schema.Boolean,\n}) {}\n\n/** Explicit Durable Object storage configuration authority. */\nexport class DoStorageConfig extends Context.Service<DoStorageConfig, DoStorageConfigValue>()(\n \"@effect-agent/storage-cloudflare/DoStorageConfig\",\n) {}\n"],"mappings":";;;;;;;;AAEA,MAAM,0BAA0B,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;AACjF,MAAM,uBAAuB,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;;;;;;;AAQrE,MAAa,iCAAiC;;AAG9C,MAAM,sBAAsB,OAAO,IAAI,MACrC,OAAO,cAAc,CAAC,GACtB,OAAO,oBAAoB,GAAS,CACtC;;;;;;AAOA,IAAa,uBAAb,cAA0C,OAAO,MAC/C,uDACF,CAAC,CAAC;CACA,yBAAyB;;;;;;;CAOzB,wBAAwB;;;;;;CAMxB,qBAAqB;;;;;;CAMrB,cAAc,OAAO;AACvB,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,kBAAb,cAAqC,QAAQ,QAA+C,CAAC,CAC3F,kDACF,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare namespace DoStorageError_d_exports {
|
|
3
|
+
export { DoAppendConflict, DoCheckpointConflict, DoFenceRejected, DoLedgerError, DoStorageCompatibilityError, DoStorageCorruptionError, DoStorageError, DoStorageFailpointError, DoStorageFailpointLocation, DoValueBoundExceeded };
|
|
4
|
+
}
|
|
3
5
|
declare const DoStorageCompatibilityError_base: Schema.Class<DoStorageCompatibilityError, Schema.TaggedStruct<"DoStorageCompatibilityError", {
|
|
4
6
|
readonly actualVersion: Schema.Int;
|
|
5
7
|
readonly message: Schema.String;
|
|
@@ -92,16 +94,5 @@ declare class DoStorageFailpointError extends DoStorageFailpointError_base {
|
|
|
92
94
|
get message(): string;
|
|
93
95
|
}
|
|
94
96
|
//#endregion
|
|
95
|
-
|
|
96
|
-
|
|
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
|
|
97
|
+
export { DoStorageCompatibilityError as a, DoStorageError_d_exports as c, DoValueBoundExceeded as d, DoLedgerError as i, DoStorageFailpointError as l, DoCheckpointConflict as n, DoStorageCorruptionError as o, DoFenceRejected as r, DoStorageError as s, DoAppendConflict as t, DoStorageFailpointLocation as u };
|
|
98
|
+
//# sourceMappingURL=DoStorageError-Qwybzk0O.d.mts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as DoStorageCompatibilityError, d as DoValueBoundExceeded, i as DoLedgerError, l as DoStorageFailpointError, n as DoCheckpointConflict, o as DoStorageCorruptionError, r as DoFenceRejected, s as DoStorageError, t as DoAppendConflict, u as DoStorageFailpointLocation } from "./DoStorageError-Qwybzk0O.mjs";
|
|
2
|
+
export { DoAppendConflict, DoCheckpointConflict, DoFenceRejected, DoLedgerError, DoStorageCompatibilityError, DoStorageCorruptionError, DoStorageError, DoStorageFailpointError, DoStorageFailpointLocation, DoValueBoundExceeded };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { CanonicalSequence, ProducerEpoch } from "@effect-agent/thread/Records";
|
|
4
|
+
//#region src/DoStorageError.ts
|
|
5
|
+
var DoStorageError_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
DoAppendConflict: () => DoAppendConflict,
|
|
7
|
+
DoCheckpointConflict: () => DoCheckpointConflict,
|
|
8
|
+
DoFenceRejected: () => DoFenceRejected,
|
|
9
|
+
DoLedgerError: () => DoLedgerError,
|
|
10
|
+
DoStorageCompatibilityError: () => DoStorageCompatibilityError,
|
|
11
|
+
DoStorageCorruptionError: () => DoStorageCorruptionError,
|
|
12
|
+
DoStorageError: () => DoStorageError,
|
|
13
|
+
DoStorageFailpointError: () => DoStorageFailpointError,
|
|
14
|
+
DoStorageFailpointLocation: () => DoStorageFailpointLocation,
|
|
15
|
+
DoValueBoundExceeded: () => DoValueBoundExceeded
|
|
16
|
+
});
|
|
17
|
+
/** The Durable Object's SQLite storage uses a private-development format this adapter cannot read. */
|
|
18
|
+
var DoStorageCompatibilityError = class extends Schema.TaggedError()("DoStorageCompatibilityError", {
|
|
19
|
+
actualVersion: Schema.Int,
|
|
20
|
+
message: Schema.String,
|
|
21
|
+
supportedVersion: Schema.Int
|
|
22
|
+
}) {};
|
|
23
|
+
/** Stored bytes failed the current Schema and cannot be used as recovery truth. */
|
|
24
|
+
var DoStorageCorruptionError = class extends Schema.TaggedError()("DoStorageCorruptionError", {
|
|
25
|
+
message: Schema.String,
|
|
26
|
+
rowKey: Schema.String,
|
|
27
|
+
table: Schema.String
|
|
28
|
+
}) {};
|
|
29
|
+
/** Durable Object SQLite infrastructure failed while opening or operating the store. */
|
|
30
|
+
var DoStorageError = class extends Schema.TaggedError()("DoStorageError", {
|
|
31
|
+
cause: Schema.optionalKey(Schema.Defect()),
|
|
32
|
+
message: Schema.String,
|
|
33
|
+
operation: Schema.String
|
|
34
|
+
}) {};
|
|
35
|
+
/**
|
|
36
|
+
* Durable Object SQLite infrastructure failed while operating the Submission Ledger. Surfaces
|
|
37
|
+
* at the SubmissionLedger port as the typed `LedgerError` with this error preserved as its
|
|
38
|
+
* cause, so the adapter-level tag is never erased.
|
|
39
|
+
*/
|
|
40
|
+
var DoLedgerError = class extends Schema.TaggedError()("DoLedgerError", {
|
|
41
|
+
cause: Schema.optionalKey(Schema.Defect()),
|
|
42
|
+
message: Schema.String,
|
|
43
|
+
operation: Schema.String
|
|
44
|
+
}) {};
|
|
45
|
+
/**
|
|
46
|
+
* A value to be stored exceeds the configured Durable Object per-value bound
|
|
47
|
+
* (`DoStorageConfigValue.maxStoredValueBytes`, kept under the platform's 2 MB SQLite value
|
|
48
|
+
* limit). The refusal happens typed BEFORE any durable mutation; no partial state is written.
|
|
49
|
+
* Payloads of this size are the designed overflow case for a future R2-backed AttachmentStore
|
|
50
|
+
* (deployment spec §3.1, deferred until a real attachment requirement exists).
|
|
51
|
+
*/
|
|
52
|
+
var DoValueBoundExceeded = class extends Schema.TaggedError()("DoValueBoundExceeded", {
|
|
53
|
+
actualBytes: Schema.Int,
|
|
54
|
+
maxBytes: Schema.Int,
|
|
55
|
+
operation: Schema.String
|
|
56
|
+
}) {
|
|
57
|
+
get message() {
|
|
58
|
+
return `A stored value of ${this.actualBytes} bytes exceeds the Durable Object per-value bound of ${this.maxBytes} bytes during ${this.operation}. Nothing was written. Values of this size are the designed R2 AttachmentStore overflow path (deferred, deployment spec §3.1).`;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* A canonical batch retry conflicts with existing append state. Tail conflicts carry the
|
|
63
|
+
* actual committed tail as a diagnostic resume hint.
|
|
64
|
+
*/
|
|
65
|
+
var DoAppendConflict = class extends Schema.TaggedError()("DoAppendConflict", {
|
|
66
|
+
message: Schema.String,
|
|
67
|
+
reason: Schema.Literals([
|
|
68
|
+
"batch-digest",
|
|
69
|
+
"record-identity",
|
|
70
|
+
"tail"
|
|
71
|
+
]),
|
|
72
|
+
actualTailSequence: Schema.optionalKey(CanonicalSequence),
|
|
73
|
+
actualTailDigest: Schema.optionalKey(Schema.String)
|
|
74
|
+
}) {};
|
|
75
|
+
/**
|
|
76
|
+
* A producer epoch does not match the Thread's current writer registration. Appends
|
|
77
|
+
* require the exact registered epoch, so both older and newer unregistered epochs are fenced;
|
|
78
|
+
* a newer epoch takes over by materializing first.
|
|
79
|
+
*/
|
|
80
|
+
var DoFenceRejected = class extends Schema.TaggedError()("DoFenceRejected", {
|
|
81
|
+
actualEpoch: ProducerEpoch,
|
|
82
|
+
message: Schema.String,
|
|
83
|
+
producerEpoch: ProducerEpoch
|
|
84
|
+
}) {};
|
|
85
|
+
/** A checkpoint conflicts with a previously stored checkpoint at the same offset. */
|
|
86
|
+
var DoCheckpointConflict = class extends Schema.TaggedError()("DoCheckpointConflict", { message: Schema.String }) {};
|
|
87
|
+
/**
|
|
88
|
+
* Deterministic fault-injection locations at Durable Object storage operation boundaries.
|
|
89
|
+
*
|
|
90
|
+
* The string list is copied VERBATIM from `SqliteStorageFailpointLocation`
|
|
91
|
+
* (`packages/storage-sqlite/src/errors.ts`) so every crash-matrix row keeps the same name on
|
|
92
|
+
* both platforms — the DN process-kill evidence and the DC eviction evidence address identical
|
|
93
|
+
* locations. There is intentionally no Cloudflare-only location.
|
|
94
|
+
*/
|
|
95
|
+
const DoStorageFailpointLocation = Schema.Literals([
|
|
96
|
+
"materialize:before",
|
|
97
|
+
"materialize:after",
|
|
98
|
+
"append:before",
|
|
99
|
+
"append:after-batch-insert",
|
|
100
|
+
"append:after-record-insert",
|
|
101
|
+
"append:after-tail-update",
|
|
102
|
+
"append:after",
|
|
103
|
+
"export:after-thread-read",
|
|
104
|
+
"save-checkpoint:before",
|
|
105
|
+
"save-checkpoint:after",
|
|
106
|
+
"ledger:admit:before",
|
|
107
|
+
"ledger:admit:after",
|
|
108
|
+
"ledger:mark-ready:before",
|
|
109
|
+
"ledger:mark-ready:after",
|
|
110
|
+
"ledger:claim:before",
|
|
111
|
+
"ledger:claim:after",
|
|
112
|
+
"ledger:mark-input-applied:before",
|
|
113
|
+
"ledger:mark-input-applied:after",
|
|
114
|
+
"ledger:renew:before",
|
|
115
|
+
"ledger:renew:after",
|
|
116
|
+
"ledger:reserve-settlement:before",
|
|
117
|
+
"ledger:reserve-settlement:after",
|
|
118
|
+
"ledger:finalize-settlement:before",
|
|
119
|
+
"ledger:finalize-settlement:after",
|
|
120
|
+
"ledger:request-abort:before",
|
|
121
|
+
"ledger:request-abort:after",
|
|
122
|
+
"ledger:release:before",
|
|
123
|
+
"ledger:release:after",
|
|
124
|
+
"ledger:claim-joining:before",
|
|
125
|
+
"ledger:claim-joining:after",
|
|
126
|
+
"ledger:mark-joined:before",
|
|
127
|
+
"ledger:mark-joined:after",
|
|
128
|
+
"ledger:revert-joining:before",
|
|
129
|
+
"ledger:revert-joining:after",
|
|
130
|
+
"ledger:suspend:before",
|
|
131
|
+
"ledger:suspend:after",
|
|
132
|
+
"ledger:approval-decision:before",
|
|
133
|
+
"ledger:approval-decision:after",
|
|
134
|
+
"ledger:mark-unknown:before",
|
|
135
|
+
"ledger:mark-unknown:after",
|
|
136
|
+
"ledger:unknown-resolution:before",
|
|
137
|
+
"ledger:unknown-resolution:after",
|
|
138
|
+
"ledger:child-reservation:before",
|
|
139
|
+
"ledger:child-reservation:after",
|
|
140
|
+
"ledger:child-attach:before",
|
|
141
|
+
"ledger:child-attach:after",
|
|
142
|
+
"ledger:child-release-pending:before",
|
|
143
|
+
"ledger:child-release-pending:after",
|
|
144
|
+
"ledger:child-release:before",
|
|
145
|
+
"ledger:child-release:after",
|
|
146
|
+
"ledger:child-settled:before",
|
|
147
|
+
"ledger:child-settled:after"
|
|
148
|
+
]);
|
|
149
|
+
/** Deterministic test-only fault or pause injected at a Durable Object storage boundary. */
|
|
150
|
+
var DoStorageFailpointError = class extends Schema.TaggedError()("DoStorageFailpointError", { location: DoStorageFailpointLocation }) {
|
|
151
|
+
get message() {
|
|
152
|
+
return `Injected Durable Object storage failure at ${this.location}.`;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
//#endregion
|
|
156
|
+
export { DoAppendConflict, DoCheckpointConflict, DoFenceRejected, DoLedgerError, DoStorageCompatibilityError, DoStorageCorruptionError, DoStorageError, DoStorageFailpointError, DoStorageFailpointLocation, DoValueBoundExceeded, DoStorageError_exports as t };
|
|
157
|
+
|
|
158
|
+
//# sourceMappingURL=DoStorageError.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DoStorageError.mjs","names":[],"sources":["../src/DoStorageError.ts"],"sourcesContent":["import { CanonicalSequence, ProducerEpoch } from \"@effect-agent/thread/Records\";\nimport { Schema } from \"effect\";\n\n/** The Durable Object's SQLite storage uses a private-development format this adapter cannot read. */\nexport class DoStorageCompatibilityError extends Schema.TaggedError<DoStorageCompatibilityError>()(\n \"DoStorageCompatibilityError\",\n {\n actualVersion: Schema.Int,\n message: Schema.String,\n supportedVersion: Schema.Int,\n },\n) {}\n\n/** Stored bytes failed the current Schema and cannot be used as recovery truth. */\nexport class DoStorageCorruptionError extends Schema.TaggedError<DoStorageCorruptionError>()(\n \"DoStorageCorruptionError\",\n {\n message: Schema.String,\n rowKey: Schema.String,\n table: Schema.String,\n },\n) {}\n\n/** Durable Object SQLite infrastructure failed while opening or operating the store. */\nexport class DoStorageError extends Schema.TaggedError<DoStorageError>()(\"DoStorageError\", {\n cause: Schema.optionalKey(Schema.Defect()),\n message: Schema.String,\n operation: Schema.String,\n}) {}\n\n/**\n * Durable Object SQLite infrastructure failed while operating the Submission Ledger. Surfaces\n * at the SubmissionLedger port as the typed `LedgerError` with this error preserved as its\n * cause, so the adapter-level tag is never erased.\n */\nexport class DoLedgerError extends Schema.TaggedError<DoLedgerError>()(\"DoLedgerError\", {\n cause: Schema.optionalKey(Schema.Defect()),\n message: Schema.String,\n operation: Schema.String,\n}) {}\n\n/**\n * A value to be stored exceeds the configured Durable Object per-value bound\n * (`DoStorageConfigValue.maxStoredValueBytes`, kept under the platform's 2 MB SQLite value\n * limit). The refusal happens typed BEFORE any durable mutation; no partial state is written.\n * Payloads of this size are the designed overflow case for a future R2-backed AttachmentStore\n * (deployment spec §3.1, deferred until a real attachment requirement exists).\n */\nexport class DoValueBoundExceeded extends Schema.TaggedError<DoValueBoundExceeded>()(\n \"DoValueBoundExceeded\",\n {\n actualBytes: Schema.Int,\n maxBytes: Schema.Int,\n operation: Schema.String,\n },\n) {\n override get message() {\n return (\n `A stored value of ${this.actualBytes} bytes exceeds the Durable Object per-value bound ` +\n `of ${this.maxBytes} bytes during ${this.operation}. Nothing was written. Values of this ` +\n \"size are the designed R2 AttachmentStore overflow path (deferred, deployment spec §3.1).\"\n );\n }\n}\n\n/**\n * A canonical batch retry conflicts with existing append state. Tail conflicts carry the\n * actual committed tail as a diagnostic resume hint.\n */\nexport class DoAppendConflict extends Schema.TaggedError<DoAppendConflict>()(\"DoAppendConflict\", {\n message: Schema.String,\n reason: Schema.Literals([\"batch-digest\", \"record-identity\", \"tail\"]),\n actualTailSequence: Schema.optionalKey(CanonicalSequence),\n actualTailDigest: Schema.optionalKey(Schema.String),\n}) {}\n\n/**\n * A producer epoch does not match the Thread's current writer registration. Appends\n * require the exact registered epoch, so both older and newer unregistered epochs are fenced;\n * a newer epoch takes over by materializing first.\n */\nexport class DoFenceRejected extends Schema.TaggedError<DoFenceRejected>()(\"DoFenceRejected\", {\n actualEpoch: ProducerEpoch,\n message: Schema.String,\n producerEpoch: ProducerEpoch,\n}) {}\n\n/** A checkpoint conflicts with a previously stored checkpoint at the same offset. */\nexport class DoCheckpointConflict extends Schema.TaggedError<DoCheckpointConflict>()(\n \"DoCheckpointConflict\",\n {\n message: Schema.String,\n },\n) {}\n\n/**\n * Deterministic fault-injection locations at Durable Object storage operation boundaries.\n *\n * The string list is copied VERBATIM from `SqliteStorageFailpointLocation`\n * (`packages/storage-sqlite/src/errors.ts`) so every crash-matrix row keeps the same name on\n * both platforms — the DN process-kill evidence and the DC eviction evidence address identical\n * locations. There is intentionally no Cloudflare-only location.\n */\nexport const DoStorageFailpointLocation = Schema.Literals([\n \"materialize:before\",\n \"materialize:after\",\n \"append:before\",\n \"append:after-batch-insert\",\n \"append:after-record-insert\",\n \"append:after-tail-update\",\n \"append:after\",\n \"export:after-thread-read\",\n \"save-checkpoint:before\",\n \"save-checkpoint:after\",\n \"ledger:admit:before\",\n \"ledger:admit:after\",\n \"ledger:mark-ready:before\",\n \"ledger:mark-ready:after\",\n \"ledger:claim:before\",\n \"ledger:claim:after\",\n \"ledger:mark-input-applied:before\",\n \"ledger:mark-input-applied:after\",\n \"ledger:renew:before\",\n \"ledger:renew:after\",\n \"ledger:reserve-settlement:before\",\n \"ledger:reserve-settlement:after\",\n \"ledger:finalize-settlement:before\",\n \"ledger:finalize-settlement:after\",\n \"ledger:request-abort:before\",\n \"ledger:request-abort:after\",\n \"ledger:release:before\",\n \"ledger:release:after\",\n \"ledger:claim-joining:before\",\n \"ledger:claim-joining:after\",\n \"ledger:mark-joined:before\",\n \"ledger:mark-joined:after\",\n \"ledger:revert-joining:before\",\n \"ledger:revert-joining:after\",\n \"ledger:suspend:before\",\n \"ledger:suspend:after\",\n \"ledger:approval-decision:before\",\n \"ledger:approval-decision:after\",\n \"ledger:mark-unknown:before\",\n \"ledger:mark-unknown:after\",\n \"ledger:unknown-resolution:before\",\n \"ledger:unknown-resolution:after\",\n \"ledger:child-reservation:before\",\n \"ledger:child-reservation:after\",\n \"ledger:child-attach:before\",\n \"ledger:child-attach:after\",\n \"ledger:child-release-pending:before\",\n \"ledger:child-release-pending:after\",\n \"ledger:child-release:before\",\n \"ledger:child-release:after\",\n \"ledger:child-settled:before\",\n \"ledger:child-settled:after\",\n]);\n\nexport type DoStorageFailpointLocation = typeof DoStorageFailpointLocation.Type;\n\n/** Deterministic test-only fault or pause injected at a Durable Object storage boundary. */\nexport class DoStorageFailpointError extends Schema.TaggedError<DoStorageFailpointError>()(\n \"DoStorageFailpointError\",\n {\n location: DoStorageFailpointLocation,\n },\n) {\n override get message() {\n return `Injected Durable Object storage failure at ${this.location}.`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAIA,IAAa,8BAAb,cAAiD,OAAO,YAAyC,CAAC,CAChG,+BACA;CACE,eAAe,OAAO;CACtB,SAAS,OAAO;CAChB,kBAAkB,OAAO;AAC3B,CACF,CAAC,CAAC,CAAC;;AAGH,IAAa,2BAAb,cAA8C,OAAO,YAAsC,CAAC,CAC1F,4BACA;CACE,SAAS,OAAO;CAChB,QAAQ,OAAO;CACf,OAAO,OAAO;AAChB,CACF,CAAC,CAAC,CAAC;;AAGH,IAAa,iBAAb,cAAoC,OAAO,YAA4B,CAAC,CAAC,kBAAkB;CACzF,OAAO,OAAO,YAAY,OAAO,OAAO,CAAC;CACzC,SAAS,OAAO;CAChB,WAAW,OAAO;AACpB,CAAC,CAAC,CAAC,CAAC;;;;;;AAOJ,IAAa,gBAAb,cAAmC,OAAO,YAA2B,CAAC,CAAC,iBAAiB;CACtF,OAAO,OAAO,YAAY,OAAO,OAAO,CAAC;CACzC,SAAS,OAAO;CAChB,WAAW,OAAO;AACpB,CAAC,CAAC,CAAC,CAAC;;;;;;;;AASJ,IAAa,uBAAb,cAA0C,OAAO,YAAkC,CAAC,CAClF,wBACA;CACE,aAAa,OAAO;CACpB,UAAU,OAAO;CACjB,WAAW,OAAO;AACpB,CACF,CAAC,CAAC;CACA,IAAa,UAAU;EACrB,OACE,qBAAqB,KAAK,YAAY,uDAChC,KAAK,SAAS,gBAAgB,KAAK,UAAU;CAGvD;AACF;;;;;AAMA,IAAa,mBAAb,cAAsC,OAAO,YAA8B,CAAC,CAAC,oBAAoB;CAC/F,SAAS,OAAO;CAChB,QAAQ,OAAO,SAAS;EAAC;EAAgB;EAAmB;CAAM,CAAC;CACnE,oBAAoB,OAAO,YAAY,iBAAiB;CACxD,kBAAkB,OAAO,YAAY,OAAO,MAAM;AACpD,CAAC,CAAC,CAAC,CAAC;;;;;;AAOJ,IAAa,kBAAb,cAAqC,OAAO,YAA6B,CAAC,CAAC,mBAAmB;CAC5F,aAAa;CACb,SAAS,OAAO;CAChB,eAAe;AACjB,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,uBAAb,cAA0C,OAAO,YAAkC,CAAC,CAClF,wBACA,EACE,SAAS,OAAO,OAClB,CACF,CAAC,CAAC,CAAC;;;;;;;;;AAUH,MAAa,6BAA6B,OAAO,SAAS;CACxD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAKD,IAAa,0BAAb,cAA6C,OAAO,YAAqC,CAAC,CACxF,2BACA,EACE,UAAU,2BACZ,CACF,CAAC,CAAC;CACA,IAAa,UAAU;EACrB,OAAO,8CAA8C,KAAK,SAAS;CACrE;AACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { l as DoStorageFailpointError, u as DoStorageFailpointLocation } from "./DoStorageError-Qwybzk0O.mjs";
|
|
2
|
+
import { Context, Effect, Layer } from "effect";
|
|
3
|
+
declare namespace DoStorageFailpoint_d_exports {
|
|
4
|
+
export { DoStorageFailpoint, DoStorageFailpointHandler };
|
|
5
|
+
}
|
|
6
|
+
type DoStorageFailpointHandler = (location: DoStorageFailpointLocation) => Effect.Effect<void, DoStorageFailpointError>;
|
|
7
|
+
declare const DoStorageFailpoint_base: Context.ServiceClass<DoStorageFailpoint, "@effect-agent/storage-cloudflare/DoStorageFailpoint", {
|
|
8
|
+
readonly hit: DoStorageFailpointHandler;
|
|
9
|
+
}>;
|
|
10
|
+
/** Explicit fault-injection authority used at Durable Object storage operation boundaries. */
|
|
11
|
+
declare class DoStorageFailpoint extends DoStorageFailpoint_base {
|
|
12
|
+
/** Production default: no fault injection. */
|
|
13
|
+
static readonly layer: Layer.Layer<DoStorageFailpoint, never, never>;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DoStorageFailpoint, DoStorageFailpointHandler, DoStorageFailpoint_d_exports as t };
|
|
17
|
+
//# sourceMappingURL=DoStorageFailpoint.d.mts.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
1
2
|
import { Context, Effect, Layer } from "effect";
|
|
2
|
-
//#region src/
|
|
3
|
+
//#region src/DoStorageFailpoint.ts
|
|
4
|
+
var DoStorageFailpoint_exports = /* @__PURE__ */ __exportAll({ DoStorageFailpoint: () => DoStorageFailpoint });
|
|
3
5
|
const noFailpoint = () => Effect.void;
|
|
4
6
|
/** Explicit fault-injection authority used at Durable Object storage operation boundaries. */
|
|
5
7
|
var DoStorageFailpoint = class extends Context.Service()("@effect-agent/storage-cloudflare/DoStorageFailpoint") {
|
|
@@ -7,6 +9,6 @@ var DoStorageFailpoint = class extends Context.Service()("@effect-agent/storage-
|
|
|
7
9
|
static layer = Layer.succeed(this)({ hit: noFailpoint });
|
|
8
10
|
};
|
|
9
11
|
//#endregion
|
|
10
|
-
export { DoStorageFailpoint as t };
|
|
12
|
+
export { DoStorageFailpoint, DoStorageFailpoint_exports as t };
|
|
11
13
|
|
|
12
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=DoStorageFailpoint.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DoStorageFailpoint.mjs","names":[],"sources":["../src/DoStorageFailpoint.ts"],"sourcesContent":["import { Context, Effect, Layer } from \"effect\";\n\nimport type { DoStorageFailpointError, DoStorageFailpointLocation } from \"./DoStorageError.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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { u as DoStorageFailpointLocation } from "./DoStorageError-Qwybzk0O.mjs";
|
|
2
|
+
import { DoStorageFailpoint, DoStorageFailpointHandler } from "./DoStorageFailpoint.mjs";
|
|
2
3
|
import { Context, Effect, Layer } from "effect";
|
|
3
|
-
//#region src/
|
|
4
|
+
//#region src/DoStorageFailpointTesting.d.ts
|
|
4
5
|
declare const DoStorageFailpointTestControl_base: Context.ServiceClass<DoStorageFailpointTestControl, "@effect-agent/storage-cloudflare/DoStorageFailpointTestControl", {
|
|
5
6
|
readonly clear: Effect.Effect<void>;
|
|
6
7
|
readonly setHandler: (handler: DoStorageFailpointHandler) => Effect.Effect<void>;
|
|
@@ -30,4 +31,4 @@ declare const evictionFailpointHandler: (options: {
|
|
|
30
31
|
}) => DoStorageFailpointHandler;
|
|
31
32
|
//#endregion
|
|
32
33
|
export { DoStorageFailpointTestControl, evictionFailpointHandler };
|
|
33
|
-
//# sourceMappingURL=
|
|
34
|
+
//# sourceMappingURL=DoStorageFailpointTesting.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DoStorageFailpoint } from "./DoStorageFailpoint.mjs";
|
|
2
2
|
import { Context, Effect, Layer, Ref } from "effect";
|
|
3
|
-
//#region src/
|
|
3
|
+
//#region src/DoStorageFailpointTesting.ts
|
|
4
4
|
const noFailpoint = () => Effect.void;
|
|
5
5
|
/** Test-only control for replacing the active Durable Object failpoint handler. */
|
|
6
6
|
var DoStorageFailpointTestControl = class DoStorageFailpointTestControl extends Context.Service()("@effect-agent/storage-cloudflare/DoStorageFailpointTestControl") {
|
|
@@ -32,4 +32,4 @@ const evictionFailpointHandler = (options) => (location) => options.isArmed(loca
|
|
|
32
32
|
//#endregion
|
|
33
33
|
export { DoStorageFailpointTestControl, evictionFailpointHandler };
|
|
34
34
|
|
|
35
|
-
//# sourceMappingURL=
|
|
35
|
+
//# sourceMappingURL=DoStorageFailpointTesting.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DoStorageFailpointTesting.mjs","names":[],"sources":["../src/DoStorageFailpointTesting.ts"],"sourcesContent":["import { Context, Effect, Layer, Ref } from \"effect\";\n\nimport type { DoStorageFailpointLocation } from \"./DoStorageError.ts\";\nimport { DoStorageFailpoint, type DoStorageFailpointHandler } from \"./DoStorageFailpoint.ts\";\n\nconst noFailpoint: DoStorageFailpointHandler = () => Effect.void;\n\n/** Test-only control for replacing the active Durable Object failpoint handler. */\nexport class DoStorageFailpointTestControl extends Context.Service<\n DoStorageFailpointTestControl,\n {\n readonly clear: Effect.Effect<void>;\n readonly setHandler: (handler: DoStorageFailpointHandler) => Effect.Effect<void>;\n }\n>()(\"@effect-agent/storage-cloudflare/DoStorageFailpointTestControl\") {\n /** Reusable test Layer with a control service backed by the same handler Ref. */\n static readonly layer = Layer.effectContext(\n Effect.gen(function* () {\n const handler = yield* Ref.make<DoStorageFailpointHandler>(noFailpoint);\n\n return Context.make(\n DoStorageFailpoint,\n DoStorageFailpoint.of({\n hit: (location) => Ref.get(handler).pipe(Effect.flatMap((current) => current(location))),\n }),\n ).pipe(\n Context.add(\n DoStorageFailpointTestControl,\n DoStorageFailpointTestControl.of({\n clear: Ref.set(handler, noFailpoint),\n setHandler: (next) => Ref.set(handler, next),\n }),\n ),\n );\n }),\n );\n}\n\n/**\n * The DC-specific eviction failpoint mode: instead of failing typed, an armed hit evicts the\n * Durable Object through an injected `evict` thunk — in production-shaped harnesses that thunk\n * is `() => ctx.abort()`, the platform's real failure mode. `ctx.abort()` never returns (it\n * throws while destroying the in-memory instance and every in-flight implicit or explicit\n * storage transaction rolls back), so an armed hit ends the current Attempt exactly like an\n * unannounced platform eviction; DO storage — the only correctness-critical state — survives\n * for the next incarnation, which the persisted alarm wakes without any incoming request.\n *\n * The handles stay injected: this package never imports `cloudflare:workers`, so the harness\n * that owns a `DurableObjectState` supplies the thunk.\n */\nexport const evictionFailpointHandler =\n (options: {\n readonly isArmed: (location: DoStorageFailpointLocation) => Effect.Effect<boolean>;\n /** Kills the incarnation — e.g. `() => ctx.abort()`. Typed `void` because the platform\n * declares `abort` as returning, but it throws while destroying the instance. */\n readonly evict: (location: DoStorageFailpointLocation) => void;\n }): DoStorageFailpointHandler =>\n (location) =>\n options.isArmed(location).pipe(\n Effect.flatMap((armed) =>\n armed\n ? // `ctx.abort()` throws while destroying the instance; that throw surfaces as a\n // defect in the (already dying) incarnation. The defensive throw below keeps the\n // guarantee — nothing after an armed hit may observe in-memory state — even if a\n // harness supplies an evict thunk that returns.\n Effect.sync((): never => {\n options.evict(location);\n throw new Error(\n `Durable Object eviction did not interrupt execution at ${location}.`,\n );\n })\n : Effect.void,\n ),\n );\n"],"mappings":";;;AAKA,MAAM,oBAA+C,OAAO;;AAG5D,IAAa,gCAAb,MAAa,sCAAsC,QAAQ,QAMzD,CAAC,CAAC,gEAAgE,CAAC,CAAC;;CAEpE,OAAgB,QAAQ,MAAM,cAC5B,OAAO,IAAI,aAAa;EACtB,MAAM,UAAU,OAAO,IAAI,KAAgC,WAAW;EAEtE,OAAO,QAAQ,KACb,oBACA,mBAAmB,GAAG,EACpB,MAAM,aAAa,IAAI,IAAI,OAAO,CAAC,CAAC,KAAK,OAAO,SAAS,YAAY,QAAQ,QAAQ,CAAC,CAAC,EACzF,CAAC,CACH,CAAC,CAAC,KACA,QAAQ,IACN,+BACA,8BAA8B,GAAG;GAC/B,OAAO,IAAI,IAAI,SAAS,WAAW;GACnC,aAAa,SAAS,IAAI,IAAI,SAAS,IAAI;EAC7C,CAAC,CACH,CACF;CACF,CAAC,CACH;AACF;;;;;;;;;;;;;AAcA,MAAa,4BACV,aAMA,aACC,QAAQ,QAAQ,QAAQ,CAAC,CAAC,KACxB,OAAO,SAAS,UACd,QAKI,OAAO,WAAkB;CACvB,QAAQ,MAAM,QAAQ;CACtB,MAAM,IAAI,MACR,0DAA0D,SAAS,EACrE;AACF,CAAC,IACD,OAAO,IACb,CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SqliteMigrator } from "@effect/sql-sqlite-do";
|
|
2
|
+
//#region src/internal/migrations.d.ts
|
|
3
|
+
/** The current storage version recorded in `effect_agent_meta`. */
|
|
4
|
+
declare const CurrentDoStorageVersion = 2;
|
|
5
|
+
declare namespace DoStorageVersion_d_exports {
|
|
6
|
+
export { CurrentDoStorageVersion };
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { CurrentDoStorageVersion as n, DoStorageVersion_d_exports as t };
|
|
10
|
+
//# sourceMappingURL=DoStorageVersion-KrYUXqeJ.d.mts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { t as CurrentDoStorageVersion } from "./migrations-Bo4GU-pp.mjs";
|
|
3
|
+
//#region src/DoStorageVersion.ts
|
|
4
|
+
var DoStorageVersion_exports = /* @__PURE__ */ __exportAll({ CurrentDoStorageVersion: () => 2 });
|
|
5
|
+
//#endregion
|
|
6
|
+
export { CurrentDoStorageVersion, DoStorageVersion_exports as t };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=DoStorageVersion.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DoStorageVersion.mjs","names":[],"sources":["../src/DoStorageVersion.ts"],"sourcesContent":["/** Public DoStorageVersion API. Implementation helpers remain private. */\nexport { CurrentDoStorageVersion } from \"./internal/migrations.ts\";\n"],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DoStorageConfig } from "./DoStorageConfig.mjs";
|
|
2
|
+
import { DoStorageFailpoint } from "./DoStorageFailpoint.mjs";
|
|
3
|
+
import { DoStorageInitializationError, DoStorageOptions } from "./DoThreadStore.mjs";
|
|
4
|
+
import { Crypto, Layer } from "effect";
|
|
5
|
+
import * as SqlClientService from "effect/unstable/sql/SqlClient";
|
|
6
|
+
import { SubmissionLedger } from "@effect-agent/thread/SubmissionLedger";
|
|
7
|
+
declare namespace DoSubmissionLedger_d_exports {
|
|
8
|
+
export { ledgerLayer, submissionLedgerLayer };
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Durable Object SubmissionLedger implementation sharing the journal's private SQLite
|
|
12
|
+
* database, storage-backed transaction discipline, and producer-epoch fencing substrate.
|
|
13
|
+
* Configuration, failpoint, SQL, and Crypto authority stay visible in the input channel.
|
|
14
|
+
*/
|
|
15
|
+
declare const submissionLedgerLayer: Layer.Layer<SubmissionLedger, DoStorageInitializationError, DoStorageConfig | DoStorageFailpoint | SqlClientService.SqlClient | Crypto.Crypto>;
|
|
16
|
+
/**
|
|
17
|
+
* A composition-root convenience Layer for the durable Submission Ledger. Point it at the
|
|
18
|
+
* same `ctx.storage` as the ThreadStore so claims fence the same producer epochs.
|
|
19
|
+
*/
|
|
20
|
+
declare const ledgerLayer: (options: DoStorageOptions) => Layer.Layer<SubmissionLedger, DoStorageInitializationError>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { ledgerLayer, submissionLedgerLayer, DoSubmissionLedger_d_exports as t };
|
|
23
|
+
//# sourceMappingURL=DoSubmissionLedger.d.mts.map
|