@systemfsoftware/agent-storage-sqlite 0.0.0-stage → 0.1.0

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.
Files changed (75) hide show
  1. package/LICENSE +21 -0
  2. package/dist/SqliteActivityStore-CSvw-3OJ.mjs +25 -0
  3. package/dist/SqliteActivityStore-CSvw-3OJ.mjs.map +1 -0
  4. package/dist/SqliteActivityStore-DM-gMSMv.d.mts +15 -0
  5. package/dist/SqliteActivityStore.d.mts +2 -0
  6. package/dist/SqliteActivityStore.mjs +1 -0
  7. package/dist/SqliteMessageDeliveryStore-C0D-jYWc.mjs +18 -0
  8. package/dist/SqliteMessageDeliveryStore-C0D-jYWc.mjs.map +1 -0
  9. package/dist/SqliteMessageDeliveryStore-D1pwnufl.d.mts +11 -0
  10. package/dist/SqliteMessageDeliveryStore.d.mts +2 -0
  11. package/dist/SqliteMessageDeliveryStore.mjs +1 -0
  12. package/dist/SqliteScheduleStore-CrH-tLQB.d.mts +12 -0
  13. package/dist/SqliteScheduleStore-Nph_W_Lg.mjs +19 -0
  14. package/dist/SqliteScheduleStore-Nph_W_Lg.mjs.map +1 -0
  15. package/dist/SqliteScheduleStore.d.mts +2 -0
  16. package/dist/SqliteScheduleStore.mjs +1 -0
  17. package/dist/SqliteStorageConfig-6HRtBHf8.d.mts +27 -0
  18. package/dist/SqliteStorageConfig-DN-WwQrw.mjs +32 -0
  19. package/dist/SqliteStorageConfig-DN-WwQrw.mjs.map +1 -0
  20. package/dist/SqliteStorageConfig.d.mts +2 -0
  21. package/dist/SqliteStorageConfig.mjs +1 -0
  22. package/dist/SqliteStorageError-Bc-iVib1.d.mts +71 -0
  23. package/dist/SqliteStorageError-d_tygf_W.mjs +79 -0
  24. package/dist/SqliteStorageError-d_tygf_W.mjs.map +1 -0
  25. package/dist/SqliteStorageError.d.mts +2 -0
  26. package/dist/SqliteStorageError.mjs +1 -0
  27. package/dist/SqliteStorageFailpoint-BqxmxFBb.mjs +15 -0
  28. package/dist/SqliteStorageFailpoint-BqxmxFBb.mjs.map +1 -0
  29. package/dist/SqliteStorageFailpoint-CJRyxmsW.d.mts +17 -0
  30. package/dist/SqliteStorageFailpoint.d.mts +2 -0
  31. package/dist/SqliteStorageFailpoint.mjs +1 -0
  32. package/dist/SqliteStorageVersion-Bayz1P9w.d.mts +8 -0
  33. package/dist/SqliteStorageVersion-BxAVd_1t.mjs +7 -0
  34. package/dist/SqliteStorageVersion-BxAVd_1t.mjs.map +1 -0
  35. package/dist/SqliteStorageVersion.d.mts +3 -0
  36. package/dist/SqliteStorageVersion.mjs +2 -0
  37. package/dist/SqliteSubmissionLedger-2lHitXAA.d.mts +25 -0
  38. package/dist/SqliteSubmissionLedger-DTWaRPjV.mjs +46 -0
  39. package/dist/SqliteSubmissionLedger-DTWaRPjV.mjs.map +1 -0
  40. package/dist/SqliteSubmissionLedger.d.mts +2 -0
  41. package/dist/SqliteSubmissionLedger.mjs +1 -0
  42. package/dist/SqliteSubscriptionStore-CFmi_ULJ.mjs +21 -0
  43. package/dist/SqliteSubscriptionStore-CFmi_ULJ.mjs.map +1 -0
  44. package/dist/SqliteSubscriptionStore-CRkOEBaa.d.mts +11 -0
  45. package/dist/SqliteSubscriptionStore.d.mts +2 -0
  46. package/dist/SqliteSubscriptionStore.mjs +1 -0
  47. package/dist/SqliteThreadStore-CUkk9A0Y.mjs +235 -0
  48. package/dist/SqliteThreadStore-CUkk9A0Y.mjs.map +1 -0
  49. package/dist/SqliteThreadStore-DKac999S.d.mts +89 -0
  50. package/dist/SqliteThreadStore.d.mts +2 -0
  51. package/dist/SqliteThreadStore.mjs +1 -0
  52. package/dist/index.d.mts +11 -0
  53. package/dist/index.mjs +11 -0
  54. package/dist/migrations-_uIpJR5O.mjs +240 -0
  55. package/dist/migrations-_uIpJR5O.mjs.map +1 -0
  56. package/dist/rolldown-runtime-D3KUYPsf.mjs +12 -0
  57. package/dist/sqlite-journal-3Zguf9OC.mjs +112 -0
  58. package/dist/sqlite-journal-3Zguf9OC.mjs.map +1 -0
  59. package/package.json +87 -3
  60. package/src/SqliteActivityStore.ts +35 -0
  61. package/src/SqliteMessageDeliveryStore.ts +23 -0
  62. package/src/SqliteScheduleStore.ts +38 -0
  63. package/src/SqliteStorageConfig.ts +31 -0
  64. package/src/SqliteStorageError.ts +96 -0
  65. package/src/SqliteStorageFailpoint.ts +22 -0
  66. package/src/SqliteStorageVersion.ts +2 -0
  67. package/src/SqliteSubmissionLedger.ts +80 -0
  68. package/src/SqliteSubscriptionStore.ts +31 -0
  69. package/src/SqliteThreadStore.ts +395 -0
  70. package/src/index.ts +10 -0
  71. package/src/internal/migrations.ts +396 -0
  72. package/src/internal/sqlite-client-layer.ts +19 -0
  73. package/src/internal/sqlite-journal.ts +205 -0
  74. package/src/internal/sqlite-ledger-errors.ts +25 -0
  75. package/README.md +0 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Daniel van der Merwe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,25 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
2
+ import { makeSqlActivityStore } from "@systemfsoftware/agent-storage-sql/sql-activity-store";
3
+ import { ActivityMutationFailpoint, ActivityProcessorStore } from "@systemfsoftware/agent/activity-store";
4
+ import * as Effect from "effect/Effect";
5
+ import * as Layer from "effect/Layer";
6
+ import * as SqlClientService from "effect/sql/SqlClient";
7
+ // src/SqliteActivityStore.ts
8
+ var SqliteActivityStore_exports = /* @__PURE__ */ __exportAll({
9
+ activityProcessorStoreLayer: () => activityProcessorStoreLayer,
10
+ activityProcessorStoreLayerWithFailpoints: () => activityProcessorStoreLayerWithFailpoints
11
+ });
12
+ const makeActivityStore = Effect.fnUntraced(function* () {
13
+ const sql = yield* SqlClientService.SqlClient;
14
+ return yield* makeSqlActivityStore(sql.withTransaction);
15
+ });
16
+ /** SQLite activity progress with mutation failpoints kept injectable for recovery tests. */
17
+ const activityProcessorStoreLayerWithFailpoints = Layer.effect(ActivityProcessorStore, makeActivityStore());
18
+ /**
19
+ * Optional activity progress with scoped local sessions. Share the same SqlClient across
20
+ * live Layers for one physical database; separate processes cannot share an activity key.
21
+ */
22
+ const activityProcessorStoreLayer = activityProcessorStoreLayerWithFailpoints.pipe(Layer.provide(ActivityMutationFailpoint.layer));
23
+ export { activityProcessorStoreLayer as n, activityProcessorStoreLayerWithFailpoints as r, SqliteActivityStore_exports as t };
24
+
25
+ //# sourceMappingURL=SqliteActivityStore-CSvw-3OJ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqliteActivityStore-CSvw-3OJ.mjs","names":[],"sources":["../src/SqliteActivityStore.ts"],"sourcesContent":["import { makeSqlActivityStore } from '@systemfsoftware/agent-storage-sql/sql-activity-store'\nimport {\n ActivityMutationFailpoint,\n type ActivityMutationFailure,\n ActivityProcessorStore,\n type ActivityStoreError,\n} from '@systemfsoftware/agent/activity-store'\nimport * as Effect from 'effect/Effect'\nimport * as Layer from 'effect/Layer'\nimport * as SqlClientService from 'effect/sql/SqlClient'\n\nexport type SqliteActivityInitializationError = ActivityStoreError | ActivityMutationFailure\n\nconst makeActivityStore = Effect.fnUntraced(function*() {\n const sql = yield* SqlClientService.SqlClient\n\n return yield* makeSqlActivityStore(sql.withTransaction)\n})\n\n/** SQLite activity progress with mutation failpoints kept injectable for recovery tests. */\nexport const activityProcessorStoreLayerWithFailpoints: Layer.Layer<\n ActivityProcessorStore,\n SqliteActivityInitializationError,\n SqlClientService.SqlClient | ActivityMutationFailpoint\n> = Layer.effect(ActivityProcessorStore, makeActivityStore())\n\n/**\n * Optional activity progress with scoped local sessions. Share the same SqlClient across\n * live Layers for one physical database; separate processes cannot share an activity key.\n */\nexport const activityProcessorStoreLayer: Layer.Layer<\n ActivityProcessorStore,\n SqliteActivityInitializationError,\n SqlClientService.SqlClient\n> = activityProcessorStoreLayerWithFailpoints.pipe(Layer.provide(ActivityMutationFailpoint.layer))\n"],"mappings":";;;;;;;;;;;AAaA,MAAM,oBAAoB,OAAO,WAAW,aAAY;CACtD,MAAM,MAAM,OAAO,iBAAiB;CAEpC,OAAO,OAAO,qBAAqB,IAAI,eAAe;AACxD,CAAC;;AAGD,MAAa,4CAIT,MAAM,OAAO,wBAAwB,kBAAkB,CAAC;;;;;AAM5D,MAAa,8BAIT,0CAA0C,KAAK,MAAM,QAAQ,0BAA0B,KAAK,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { ActivityMutationFailpoint, ActivityMutationFailure, ActivityProcessorStore, ActivityStoreError } from "@systemfsoftware/agent/activity-store";
2
+ import * as Layer from "effect/Layer";
3
+ import * as SqlClientService from "effect/sql/SqlClient";
4
+ declare namespace SqliteActivityStore_d_exports {
5
+ export { SqliteActivityInitializationError, activityProcessorStoreLayer, activityProcessorStoreLayerWithFailpoints };
6
+ }
7
+ type SqliteActivityInitializationError = ActivityStoreError | ActivityMutationFailure;
8
+ /** SQLite activity progress with mutation failpoints kept injectable for recovery tests. */
9
+ declare const activityProcessorStoreLayerWithFailpoints: Layer.Layer<ActivityProcessorStore, SqliteActivityInitializationError, SqlClientService.SqlClient | ActivityMutationFailpoint>;
10
+ /**
11
+ * Optional activity progress with scoped local sessions. Share the same SqlClient across
12
+ * live Layers for one physical database; separate processes cannot share an activity key.
13
+ */
14
+ declare const activityProcessorStoreLayer: Layer.Layer<ActivityProcessorStore, SqliteActivityInitializationError, SqlClientService.SqlClient>;
15
+ export { activityProcessorStoreLayerWithFailpoints as i, SqliteActivityStore_d_exports as n, activityProcessorStoreLayer as r, SqliteActivityInitializationError as t };
@@ -0,0 +1,2 @@
1
+ import { i as activityProcessorStoreLayerWithFailpoints, r as activityProcessorStoreLayer, t as SqliteActivityInitializationError } from "./SqliteActivityStore-DM-gMSMv.mjs";
2
+ export { SqliteActivityInitializationError, activityProcessorStoreLayer, activityProcessorStoreLayerWithFailpoints };
@@ -0,0 +1 @@
1
+ export { n as activityProcessorStoreLayer, r as activityProcessorStoreLayerWithFailpoints } from "./SqliteActivityStore-CSvw-3OJ.mjs";
@@ -0,0 +1,18 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
2
+ import { makeSqlMessageDeliveryStore, registerCanonicalMessageWriter } from "@systemfsoftware/agent-storage-sql/sql-message-delivery-store";
3
+ import { MessageDeliveryStore } from "@systemfsoftware/agent/message-delivery";
4
+ import * as Effect from "effect/Effect";
5
+ import * as Layer from "effect/Layer";
6
+ import { n as initializeSqliteJournal } from "./sqlite-journal-3Zguf9OC.mjs";
7
+ // src/SqliteMessageDeliveryStore.ts
8
+ var SqliteMessageDeliveryStore_exports = /* @__PURE__ */ __exportAll({ messageDeliveryStoreLayer: () => messageDeliveryStoreLayer });
9
+ /** Source-owned message obligations in the host's existing SQLite database. */
10
+ const messageDeliveryStoreLayer = (limits) => Layer.effect(MessageDeliveryStore, Effect.gen(function* () {
11
+ const journal = yield* initializeSqliteJournal;
12
+ const store = yield* makeSqlMessageDeliveryStore(journal.owner, limits);
13
+ yield* registerCanonicalMessageWriter(journal.owner, store);
14
+ return store;
15
+ }));
16
+ export { messageDeliveryStoreLayer as n, SqliteMessageDeliveryStore_exports as t };
17
+
18
+ //# sourceMappingURL=SqliteMessageDeliveryStore-C0D-jYWc.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqliteMessageDeliveryStore-C0D-jYWc.mjs","names":[],"sources":["../src/SqliteMessageDeliveryStore.ts"],"sourcesContent":["import {\n makeSqlMessageDeliveryStore,\n registerCanonicalMessageWriter,\n} from '@systemfsoftware/agent-storage-sql/sql-message-delivery-store'\nimport { MessageDeliveryStore, type MessageDeliveryStoreLimits } from '@systemfsoftware/agent/message-delivery'\nimport * as Effect from 'effect/Effect'\nimport * as Layer from 'effect/Layer'\n\nimport { initializeSqliteJournal } from './internal/sqlite-journal'\n\n/** Source-owned message obligations in the host's existing SQLite database. */\nexport const messageDeliveryStoreLayer = (limits?: MessageDeliveryStoreLimits) =>\n Layer.effect(\n MessageDeliveryStore,\n Effect.gen(function*() {\n const journal = yield* initializeSqliteJournal\n const store = yield* makeSqlMessageDeliveryStore(journal.owner, limits)\n\n yield* registerCanonicalMessageWriter(journal.owner, store)\n\n return store\n }),\n )\n"],"mappings":";;;;;;;;;AAWA,MAAa,6BAA6B,WACxC,MAAM,OACJ,sBACA,OAAO,IAAI,aAAY;CACrB,MAAM,UAAU,OAAO;CACvB,MAAM,QAAQ,OAAO,4BAA4B,QAAQ,OAAO,MAAM;CAEtE,OAAO,+BAA+B,QAAQ,OAAO,KAAK;CAE1D,OAAO;AACT,CAAC,CACH"}
@@ -0,0 +1,11 @@
1
+ import { a as SqliteStorageCorruptionError, i as SqliteStorageCompatibilityError, o as SqliteStorageError } from "./SqliteStorageError-Bc-iVib1.mjs";
2
+ import { t as SqliteStorageConfig } from "./SqliteStorageConfig-6HRtBHf8.mjs";
3
+ import { t as SqliteStorageFailpoint } from "./SqliteStorageFailpoint-CJRyxmsW.mjs";
4
+ import { MessageDeliveryStore, MessageDeliveryStoreLimits } from "@systemfsoftware/agent/message-delivery";
5
+ import * as Layer from "effect/Layer";
6
+ declare namespace SqliteMessageDeliveryStore_d_exports {
7
+ export { messageDeliveryStoreLayer };
8
+ }
9
+ /** Source-owned message obligations in the host's existing SQLite database. */
10
+ declare const messageDeliveryStoreLayer: (limits?: MessageDeliveryStoreLimits) => Layer.Layer<MessageDeliveryStore, import("@systemfsoftware/agent/message-delivery").MessageDeliveryError | SqliteStorageCompatibilityError | SqliteStorageCorruptionError | SqliteStorageError, import("effect/crypto/Digest").Digest | import("effect/sql/SqlClient").SqlClient | SqliteStorageConfig | SqliteStorageFailpoint>;
11
+ export { messageDeliveryStoreLayer as n, SqliteMessageDeliveryStore_d_exports as t };
@@ -0,0 +1,2 @@
1
+ import { n as messageDeliveryStoreLayer } from "./SqliteMessageDeliveryStore-D1pwnufl.mjs";
2
+ export { messageDeliveryStoreLayer };
@@ -0,0 +1 @@
1
+ export { n as messageDeliveryStoreLayer } from "./SqliteMessageDeliveryStore-C0D-jYWc.mjs";
@@ -0,0 +1,12 @@
1
+ import { ScheduleStore } from "@systemfsoftware/agent/schedule";
2
+ import * as Layer from "effect/Layer";
3
+ import * as SqlClient from "effect/sql/SqlClient";
4
+ import { t as SqliteStorageConfig } from "./SqliteStorageConfig-6HRtBHf8.mjs";
5
+ import { t as SqliteStorageFailpoint } from "./SqliteStorageFailpoint-CJRyxmsW.mjs";
6
+ import { t as SqliteStorageInitializationError } from "./SqliteThreadStore-DKac999S.mjs";
7
+ declare namespace SqliteScheduleStore_d_exports {
8
+ export { scheduleStoreLayer };
9
+ }
10
+ /** SQLite implementation of the atomic ScheduleStore port. */
11
+ declare const scheduleStoreLayer: Layer.Layer<ScheduleStore, SqliteStorageInitializationError, SqliteStorageConfig | SqliteStorageFailpoint | SqlClient.SqlClient>;
12
+ export { scheduleStoreLayer as n, SqliteScheduleStore_d_exports as t };
@@ -0,0 +1,19 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
2
+ import { SqlScheduleWriteTransaction, makeSqlScheduleStore } from "@systemfsoftware/agent-storage-sql/sql-schedule-store";
3
+ import { ScheduleStore } from "@systemfsoftware/agent/schedule";
4
+ import * as Effect from "effect/Effect";
5
+ import * as Layer from "effect/Layer";
6
+ import * as SqlClient from "effect/sql/SqlClient";
7
+ import { i as initializeSqliteStorage } from "./sqlite-journal-3Zguf9OC.mjs";
8
+ // src/SqliteScheduleStore.ts
9
+ var SqliteScheduleStore_exports = /* @__PURE__ */ __exportAll({ scheduleStoreLayer: () => scheduleStoreLayer });
10
+ /** SQLite implementation of the atomic ScheduleStore port. */
11
+ const scheduleStoreLayer = Layer.effect(ScheduleStore, Effect.gen(function* () {
12
+ yield* initializeSqliteStorage();
13
+ return yield* makeSqlScheduleStore();
14
+ })).pipe(Layer.provide(Layer.effect(SqlScheduleWriteTransaction, Effect.gen(function* () {
15
+ return { run: (yield* SqlClient.SqlClient).withTransaction };
16
+ }))));
17
+ export { scheduleStoreLayer as n, SqliteScheduleStore_exports as t };
18
+
19
+ //# sourceMappingURL=SqliteScheduleStore-Nph_W_Lg.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqliteScheduleStore-Nph_W_Lg.mjs","names":[],"sources":["../src/SqliteScheduleStore.ts"],"sourcesContent":["import {\n makeSqlScheduleStore,\n SqlScheduleWriteTransaction,\n} from '@systemfsoftware/agent-storage-sql/sql-schedule-store'\nimport { ScheduleStore } from '@systemfsoftware/agent/schedule'\nimport * as Effect from 'effect/Effect'\nimport * as Layer from 'effect/Layer'\nimport * as SqlClient from 'effect/sql/SqlClient'\n\nimport { initializeSqliteStorage } from './internal/sqlite-journal'\nimport type { SqliteStorageConfig } from './SqliteStorageConfig'\nimport type { SqliteStorageFailpoint } from './SqliteStorageFailpoint'\nimport type { SqliteStorageInitializationError } from './SqliteThreadStore'\n\n/** SQLite implementation of the atomic ScheduleStore port. */\nexport const scheduleStoreLayer: Layer.Layer<\n ScheduleStore,\n SqliteStorageInitializationError,\n SqliteStorageConfig | SqliteStorageFailpoint | SqlClient.SqlClient\n> = Layer.effect(\n ScheduleStore,\n Effect.gen(function*() {\n yield* initializeSqliteStorage()\n\n return yield* makeSqlScheduleStore()\n }),\n).pipe(\n Layer.provide(\n Layer.effect(\n SqlScheduleWriteTransaction,\n Effect.gen(function*() {\n const sql = yield* SqlClient.SqlClient\n\n return { run: sql.withTransaction }\n }),\n ),\n ),\n)\n"],"mappings":";;;;;;;;;;AAeA,MAAa,qBAIT,MAAM,OACR,eACA,OAAO,IAAI,aAAY;CACrB,OAAO,wBAAwB;CAE/B,OAAO,OAAO,qBAAqB;AACrC,CAAC,CACH,CAAC,CAAC,KACA,MAAM,QACJ,MAAM,OACJ,6BACA,OAAO,IAAI,aAAY;CAGrB,OAAO,EAAE,MAAK,OAFK,UAAU,UAAA,CAEX,gBAAgB;AACpC,CAAC,CACH,CACF,CACF"}
@@ -0,0 +1,2 @@
1
+ import { n as scheduleStoreLayer } from "./SqliteScheduleStore-CrH-tLQB.mjs";
2
+ export { scheduleStoreLayer };
@@ -0,0 +1 @@
1
+ export { n as scheduleStoreLayer } from "./SqliteScheduleStore-Nph_W_Lg.mjs";
@@ -0,0 +1,27 @@
1
+ import * as Context from "effect/Context";
2
+ import * as Schema from "effect/Schema";
3
+ declare namespace SqliteStorageConfig_d_exports {
4
+ export { SqliteStorageConfig, SqliteStorageConfigValue };
5
+ }
6
+ declare const SqliteStorageConfigValue_base: Schema.Class<SqliteStorageConfigValue, Schema.Struct<{
7
+ readonly observationPollInterval: Schema.Int;
8
+ /** Bounded SQLITE_BUSY retry window for write-lock acquisition, in milliseconds. */
9
+ readonly busyTimeout: Schema.Int;
10
+ /** Connection synchronization selected at construction; FULL is the convenience default. */
11
+ readonly synchronous: Schema.Literals<readonly ["FULL", "NORMAL"]>;
12
+ /**
13
+ * Audit stored payload schemas, identities, and batch coverage while opening the store.
14
+ * Per-operation Schema decoding remains enabled; this complete scan is an explicit opt-in.
15
+ */
16
+ readonly verifyOnOpen: Schema.Boolean;
17
+ }>, {}>;
18
+ /**
19
+ * Validated construction configuration consumed by the SQLite storage Layer. The database
20
+ * identity itself belongs to the SqlClient Layer; duplicating it here could silently diverge
21
+ * from the connection actually in use.
22
+ */
23
+ declare class SqliteStorageConfigValue extends SqliteStorageConfigValue_base {}
24
+ declare const SqliteStorageConfig_base: Context.ServiceClass<SqliteStorageConfig, "@effect-agent/storage-sqlite/SqliteStorageConfig", SqliteStorageConfigValue>;
25
+ /** Explicit SQLite storage configuration authority. */
26
+ declare class SqliteStorageConfig extends SqliteStorageConfig_base {}
27
+ export { SqliteStorageConfigValue as n, SqliteStorageConfig_d_exports as r, SqliteStorageConfig as t };
@@ -0,0 +1,32 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
2
+ import * as Context from "effect/Context";
3
+ import * as Schema from "effect/Schema";
4
+ // src/SqliteStorageConfig.ts
5
+ var SqliteStorageConfig_exports = /* @__PURE__ */ __exportAll({
6
+ SqliteStorageConfig: () => SqliteStorageConfig,
7
+ SqliteStorageConfigValue: () => SqliteStorageConfigValue
8
+ });
9
+ const ObservationPollInterval = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
10
+ const BusyTimeoutMillis = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
11
+ /**
12
+ * Validated construction configuration consumed by the SQLite storage Layer. The database
13
+ * identity itself belongs to the SqlClient Layer; duplicating it here could silently diverge
14
+ * from the connection actually in use.
15
+ */
16
+ var SqliteStorageConfigValue = class extends Schema.Class("@effect-agent/storage-sqlite/SqliteStorageConfigValue")({
17
+ observationPollInterval: ObservationPollInterval,
18
+ /** Bounded SQLITE_BUSY retry window for write-lock acquisition, in milliseconds. */
19
+ busyTimeout: BusyTimeoutMillis,
20
+ /** Connection synchronization selected at construction; FULL is the convenience default. */
21
+ synchronous: Schema.Literals(["FULL", "NORMAL"]),
22
+ /**
23
+ * Audit stored payload schemas, identities, and batch coverage while opening the store.
24
+ * Per-operation Schema decoding remains enabled; this complete scan is an explicit opt-in.
25
+ */
26
+ verifyOnOpen: Schema.Boolean
27
+ }) {};
28
+ /** Explicit SQLite storage configuration authority. */
29
+ var SqliteStorageConfig = class extends Context.Service()("@effect-agent/storage-sqlite/SqliteStorageConfig") {};
30
+ export { SqliteStorageConfigValue as n, SqliteStorageConfig_exports as r, SqliteStorageConfig as t };
31
+
32
+ //# sourceMappingURL=SqliteStorageConfig-DN-WwQrw.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqliteStorageConfig-DN-WwQrw.mjs","names":[],"sources":["../src/SqliteStorageConfig.ts"],"sourcesContent":["import * as Context from 'effect/Context'\nimport * as Schema from 'effect/Schema'\n\nconst ObservationPollInterval = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))\nconst BusyTimeoutMillis = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))\n\n/**\n * Validated construction configuration consumed by the SQLite storage Layer. The database\n * identity itself belongs to the SqlClient Layer; duplicating it here could silently diverge\n * from the connection actually in use.\n */\nexport class SqliteStorageConfigValue extends Schema.Class<SqliteStorageConfigValue>(\n '@effect-agent/storage-sqlite/SqliteStorageConfigValue',\n)({\n observationPollInterval: ObservationPollInterval,\n /** Bounded SQLITE_BUSY retry window for write-lock acquisition, in milliseconds. */\n busyTimeout: BusyTimeoutMillis,\n /** Connection synchronization selected at construction; FULL is the convenience default. */\n synchronous: Schema.Literals(['FULL', 'NORMAL']),\n /**\n * Audit stored payload schemas, identities, and batch coverage while opening the store.\n * Per-operation Schema decoding remains enabled; this complete scan is an explicit opt-in.\n */\n verifyOnOpen: Schema.Boolean,\n}) {}\n\n/** Explicit SQLite storage configuration authority. */\nexport class SqliteStorageConfig extends Context.Service<\n SqliteStorageConfig,\n SqliteStorageConfigValue\n>()('@effect-agent/storage-sqlite/SqliteStorageConfig') {}\n"],"mappings":";;;;;;;;AAGA,MAAM,0BAA0B,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;AACjF,MAAM,oBAAoB,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;;;;;;AAO3E,IAAa,2BAAb,cAA8C,OAAO,MACnD,uDACF,CAAC,CAAC;CACA,yBAAyB;;CAEzB,aAAa;;CAEb,aAAa,OAAO,SAAS,CAAC,QAAQ,QAAQ,CAAC;;;;;CAK/C,cAAc,OAAO;AACvB,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,sBAAb,cAAyC,QAAQ,QAG/C,CAAC,CAAC,kDAAkD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { n as SqliteStorageConfigValue, t as SqliteStorageConfig } from "./SqliteStorageConfig-6HRtBHf8.mjs";
2
+ export { SqliteStorageConfig, SqliteStorageConfigValue };
@@ -0,0 +1 @@
1
+ export { t as SqliteStorageConfig, n as SqliteStorageConfigValue } from "./SqliteStorageConfig-DN-WwQrw.mjs";
@@ -0,0 +1,71 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { SqlStorageFailpointLocation as SqliteStorageFailpointLocation } from "@systemfsoftware/agent-storage-sql/sql-storage-failpoint";
3
+ declare namespace SqliteStorageError_d_exports {
4
+ export { SqliteAppendConflict, SqliteCheckpointConflict, SqliteLedgerError, SqliteStorageCompatibilityError, SqliteStorageCorruptionError, SqliteStorageError, SqliteStorageFailpointError, SqliteStorageFailpointLocation, SqliteWriteContention };
5
+ }
6
+ declare const SqliteStorageCompatibilityError_base: Schema.Class<SqliteStorageCompatibilityError, Schema.TaggedStruct<"SqliteStorageCompatibilityError", {
7
+ readonly actualVersion: Schema.Int;
8
+ readonly message: Schema.String;
9
+ readonly supportedVersion: Schema.Int;
10
+ }>, import("effect/Cause").YieldableError>;
11
+ /** The SQLite file uses a private-development format this adapter cannot read. */
12
+ declare class SqliteStorageCompatibilityError extends SqliteStorageCompatibilityError_base {}
13
+ declare const SqliteStorageCorruptionError_base: Schema.Class<SqliteStorageCorruptionError, Schema.TaggedStruct<"SqliteStorageCorruptionError", {
14
+ readonly message: Schema.String;
15
+ readonly rowKey: Schema.String;
16
+ readonly table: Schema.String;
17
+ }>, import("effect/Cause").YieldableError>;
18
+ /** Stored bytes failed the current Schema and cannot be used as recovery truth. */
19
+ declare class SqliteStorageCorruptionError extends SqliteStorageCorruptionError_base {}
20
+ declare const SqliteStorageError_base: Schema.Class<SqliteStorageError, Schema.TaggedStruct<"SqliteStorageError", {
21
+ readonly cause: Schema.optionalKey<Schema.Defect>;
22
+ readonly message: Schema.String;
23
+ readonly operation: Schema.String;
24
+ }>, import("effect/Cause").YieldableError>;
25
+ /** SQLite infrastructure failed while opening or operating the store. */
26
+ declare class SqliteStorageError extends SqliteStorageError_base {}
27
+ declare const SqliteLedgerError_base: Schema.Class<SqliteLedgerError, Schema.TaggedStruct<"SqliteLedgerError", {
28
+ readonly cause: Schema.optionalKey<Schema.Defect>;
29
+ readonly message: Schema.String;
30
+ readonly operation: Schema.String;
31
+ }>, import("effect/Cause").YieldableError>;
32
+ /**
33
+ * SQLite infrastructure failed while operating the Submission Ledger. Surfaces at the
34
+ * SubmissionLedger port as the typed `LedgerError` with this error preserved as its cause,
35
+ * so the adapter-level tag is never erased.
36
+ */
37
+ declare class SqliteLedgerError extends SqliteLedgerError_base {}
38
+ declare const SqliteAppendConflict_base: Schema.Class<SqliteAppendConflict, Schema.TaggedStruct<"SqliteAppendConflict", {
39
+ readonly message: Schema.String;
40
+ readonly reason: Schema.Literals<readonly ["batch-content", "record-identity", "tail", "stale-command"]>;
41
+ readonly actualTailSequence: Schema.optionalKey<Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">>;
42
+ }>, import("effect/Cause").YieldableError>;
43
+ /**
44
+ * A canonical batch retry conflicts with existing append state. Tail conflicts carry the
45
+ * actual committed tail as a diagnostic resume hint.
46
+ */
47
+ declare class SqliteAppendConflict extends SqliteAppendConflict_base {}
48
+ declare const SqliteWriteContention_base: Schema.Class<SqliteWriteContention, Schema.TaggedStruct<"SqliteWriteContention", {
49
+ readonly cause: Schema.optionalKey<Schema.Defect>;
50
+ readonly message: Schema.String;
51
+ readonly operation: Schema.String;
52
+ }>, import("effect/Cause").YieldableError>;
53
+ /**
54
+ * A write transaction could not acquire the SQLite write lock within the configured busy
55
+ * timeout (SQLITE_BUSY / SQLITE_LOCKED). Another transiently coexisting owner is writing;
56
+ * the operation did not mutate canonical state and is safe to retry.
57
+ */
58
+ declare class SqliteWriteContention extends SqliteWriteContention_base {}
59
+ declare const SqliteCheckpointConflict_base: Schema.Class<SqliteCheckpointConflict, Schema.TaggedStruct<"SqliteCheckpointConflict", {
60
+ readonly message: Schema.String;
61
+ }>, import("effect/Cause").YieldableError>;
62
+ /** A checkpoint conflicts with a previously stored checkpoint at the same offset. */
63
+ declare class SqliteCheckpointConflict extends SqliteCheckpointConflict_base {}
64
+ declare const SqliteStorageFailpointError_base: Schema.Class<SqliteStorageFailpointError, Schema.TaggedStruct<"SqliteStorageFailpointError", {
65
+ 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", "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:finalize-settlement:before", "ledger:finalize-settlement:after", "ledger:request-abort:before", "ledger:request-abort: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"]>;
66
+ }>, import("effect/Cause").YieldableError>;
67
+ /** Deterministic test-only fault or pause injected at a SQLite operation boundary. */
68
+ declare class SqliteStorageFailpointError extends SqliteStorageFailpointError_base {
69
+ get message(): string;
70
+ }
71
+ export { SqliteStorageCorruptionError as a, SqliteStorageFailpointError as c, SqliteStorageCompatibilityError as i, SqliteStorageFailpointLocation as l, SqliteCheckpointConflict as n, SqliteStorageError as o, SqliteLedgerError as r, SqliteStorageError_d_exports as s, SqliteAppendConflict as t, SqliteWriteContention as u };
@@ -0,0 +1,79 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
2
+ import { SqlStorageFailpointLocation, SqlStorageFailpointLocation as SqliteStorageFailpointLocation } from "@systemfsoftware/agent-storage-sql/sql-storage-failpoint";
3
+ import { CanonicalSequence } from "@systemfsoftware/agent/records";
4
+ import * as Schema from "effect/Schema";
5
+ // src/SqliteStorageError.ts
6
+ var SqliteStorageError_exports = /* @__PURE__ */ __exportAll({
7
+ SqliteAppendConflict: () => SqliteAppendConflict,
8
+ SqliteCheckpointConflict: () => SqliteCheckpointConflict,
9
+ SqliteLedgerError: () => SqliteLedgerError,
10
+ SqliteStorageCompatibilityError: () => SqliteStorageCompatibilityError,
11
+ SqliteStorageCorruptionError: () => SqliteStorageCorruptionError,
12
+ SqliteStorageError: () => SqliteStorageError,
13
+ SqliteStorageFailpointError: () => SqliteStorageFailpointError,
14
+ SqliteStorageFailpointLocation: () => SqliteStorageFailpointLocation,
15
+ SqliteWriteContention: () => SqliteWriteContention
16
+ });
17
+ /** The SQLite file uses a private-development format this adapter cannot read. */
18
+ var SqliteStorageCompatibilityError = class extends Schema.TaggedError()("SqliteStorageCompatibilityError", {
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 SqliteStorageCorruptionError = class extends Schema.TaggedError()("SqliteStorageCorruptionError", {
25
+ message: Schema.String,
26
+ rowKey: Schema.String,
27
+ table: Schema.String
28
+ }) {};
29
+ /** SQLite infrastructure failed while opening or operating the store. */
30
+ var SqliteStorageError = class extends Schema.TaggedError()("SqliteStorageError", {
31
+ cause: Schema.optionalKey(Schema.Defect()),
32
+ message: Schema.String,
33
+ operation: Schema.String
34
+ }) {};
35
+ /**
36
+ * SQLite infrastructure failed while operating the Submission Ledger. Surfaces at the
37
+ * SubmissionLedger port as the typed `LedgerError` with this error preserved as its cause,
38
+ * so the adapter-level tag is never erased.
39
+ */
40
+ var SqliteLedgerError = class extends Schema.TaggedError()("SqliteLedgerError", {
41
+ cause: Schema.optionalKey(Schema.Defect()),
42
+ message: Schema.String,
43
+ operation: Schema.String
44
+ }) {};
45
+ /**
46
+ * A canonical batch retry conflicts with existing append state. Tail conflicts carry the
47
+ * actual committed tail as a diagnostic resume hint.
48
+ */
49
+ var SqliteAppendConflict = class extends Schema.TaggedError()("SqliteAppendConflict", {
50
+ message: Schema.String,
51
+ reason: Schema.Literals([
52
+ "batch-content",
53
+ "record-identity",
54
+ "tail",
55
+ "stale-command"
56
+ ]),
57
+ actualTailSequence: Schema.optionalKey(CanonicalSequence)
58
+ }) {};
59
+ /**
60
+ * A write transaction could not acquire the SQLite write lock within the configured busy
61
+ * timeout (SQLITE_BUSY / SQLITE_LOCKED). Another transiently coexisting owner is writing;
62
+ * the operation did not mutate canonical state and is safe to retry.
63
+ */
64
+ var SqliteWriteContention = class extends Schema.TaggedError()("SqliteWriteContention", {
65
+ cause: Schema.optionalKey(Schema.Defect()),
66
+ message: Schema.String,
67
+ operation: Schema.String
68
+ }) {};
69
+ /** A checkpoint conflicts with a previously stored checkpoint at the same offset. */
70
+ var SqliteCheckpointConflict = class extends Schema.TaggedError()("SqliteCheckpointConflict", { message: Schema.String }) {};
71
+ /** Deterministic test-only fault or pause injected at a SQLite operation boundary. */
72
+ var SqliteStorageFailpointError = class extends Schema.TaggedError()("SqliteStorageFailpointError", { location: SqlStorageFailpointLocation }) {
73
+ get message() {
74
+ return `Injected SQLite storage failure at ${this.location}.`;
75
+ }
76
+ };
77
+ export { SqliteStorageCorruptionError as a, SqliteStorageFailpointError as c, SqliteStorageCompatibilityError as i, SqliteStorageFailpointLocation as l, SqliteCheckpointConflict as n, SqliteStorageError as o, SqliteLedgerError as r, SqliteStorageError_exports as s, SqliteAppendConflict as t, SqliteWriteContention as u };
78
+
79
+ //# sourceMappingURL=SqliteStorageError-d_tygf_W.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqliteStorageError-d_tygf_W.mjs","names":["SqliteStorageFailpointLocation"],"sources":["../src/SqliteStorageError.ts"],"sourcesContent":["import { SqlStorageFailpointLocation as SqliteStorageFailpointLocation } from '@systemfsoftware/agent-storage-sql/sql-storage-failpoint'\nimport { CanonicalSequence } from '@systemfsoftware/agent/records'\nimport * as Schema from 'effect/Schema'\n\n/** The SQLite file uses a private-development format this adapter cannot read. */\nexport class SqliteStorageCompatibilityError extends Schema.TaggedError<SqliteStorageCompatibilityError>()(\n 'SqliteStorageCompatibilityError',\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 SqliteStorageCorruptionError extends Schema.TaggedError<SqliteStorageCorruptionError>()(\n 'SqliteStorageCorruptionError',\n {\n message: Schema.String,\n rowKey: Schema.String,\n table: Schema.String,\n },\n) {}\n\n/** SQLite infrastructure failed while opening or operating the store. */\nexport class SqliteStorageError extends Schema.TaggedError<SqliteStorageError>()(\n 'SqliteStorageError',\n {\n cause: Schema.optionalKey(Schema.Defect()),\n message: Schema.String,\n operation: Schema.String,\n },\n) {}\n\n/**\n * SQLite infrastructure failed while operating the Submission Ledger. Surfaces at the\n * SubmissionLedger port as the typed `LedgerError` with this error preserved as its cause,\n * so the adapter-level tag is never erased.\n */\nexport class SqliteLedgerError extends Schema.TaggedError<SqliteLedgerError>()(\n 'SqliteLedgerError',\n {\n cause: Schema.optionalKey(Schema.Defect()),\n message: Schema.String,\n operation: Schema.String,\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 SqliteAppendConflict extends Schema.TaggedError<SqliteAppendConflict>()(\n 'SqliteAppendConflict',\n {\n message: Schema.String,\n reason: Schema.Literals(['batch-content', 'record-identity', 'tail', 'stale-command']),\n actualTailSequence: Schema.optionalKey(CanonicalSequence),\n },\n) {}\n\n/**\n * A write transaction could not acquire the SQLite write lock within the configured busy\n * timeout (SQLITE_BUSY / SQLITE_LOCKED). Another transiently coexisting owner is writing;\n * the operation did not mutate canonical state and is safe to retry.\n */\nexport class SqliteWriteContention extends Schema.TaggedError<SqliteWriteContention>()(\n 'SqliteWriteContention',\n {\n cause: Schema.optionalKey(Schema.Defect()),\n message: Schema.String,\n operation: Schema.String,\n },\n) {}\n\n/** A checkpoint conflicts with a previously stored checkpoint at the same offset. */\nexport class SqliteCheckpointConflict extends Schema.TaggedError<SqliteCheckpointConflict>()(\n 'SqliteCheckpointConflict',\n {\n message: Schema.String,\n },\n) {}\n\nexport { SqlStorageFailpointLocation as SqliteStorageFailpointLocation } from '@systemfsoftware/agent-storage-sql/sql-storage-failpoint'\n\n/** Deterministic test-only fault or pause injected at a SQLite operation boundary. */\nexport class SqliteStorageFailpointError extends Schema.TaggedError<SqliteStorageFailpointError>()(\n 'SqliteStorageFailpointError',\n {\n location: SqliteStorageFailpointLocation,\n },\n) {\n override get message() {\n return `Injected SQLite storage failure at ${this.location}.`\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAKA,IAAa,kCAAb,cAAqD,OAAO,YAA6C,CAAC,CACxG,mCACA;CACE,eAAe,OAAO;CACtB,SAAS,OAAO;CAChB,kBAAkB,OAAO;AAC3B,CACF,CAAC,CAAC,CAAC;;AAGH,IAAa,+BAAb,cAAkD,OAAO,YAA0C,CAAC,CAClG,gCACA;CACE,SAAS,OAAO;CAChB,QAAQ,OAAO;CACf,OAAO,OAAO;AAChB,CACF,CAAC,CAAC,CAAC;;AAGH,IAAa,qBAAb,cAAwC,OAAO,YAAgC,CAAC,CAC9E,sBACA;CACE,OAAO,OAAO,YAAY,OAAO,OAAO,CAAC;CACzC,SAAS,OAAO;CAChB,WAAW,OAAO;AACpB,CACF,CAAC,CAAC,CAAC;;;;;;AAOH,IAAa,oBAAb,cAAuC,OAAO,YAA+B,CAAC,CAC5E,qBACA;CACE,OAAO,OAAO,YAAY,OAAO,OAAO,CAAC;CACzC,SAAS,OAAO;CAChB,WAAW,OAAO;AACpB,CACF,CAAC,CAAC,CAAC;;;;;AAMH,IAAa,uBAAb,cAA0C,OAAO,YAAkC,CAAC,CAClF,wBACA;CACE,SAAS,OAAO;CAChB,QAAQ,OAAO,SAAS;EAAC;EAAiB;EAAmB;EAAQ;CAAe,CAAC;CACrF,oBAAoB,OAAO,YAAY,iBAAiB;AAC1D,CACF,CAAC,CAAC,CAAC;;;;;;AAOH,IAAa,wBAAb,cAA2C,OAAO,YAAmC,CAAC,CACpF,yBACA;CACE,OAAO,OAAO,YAAY,OAAO,OAAO,CAAC;CACzC,SAAS,OAAO;CAChB,WAAW,OAAO;AACpB,CACF,CAAC,CAAC,CAAC;;AAGH,IAAa,2BAAb,cAA8C,OAAO,YAAsC,CAAC,CAC1F,4BACA,EACE,SAAS,OAAO,OAClB,CACF,CAAC,CAAC,CAAC;;AAKH,IAAa,8BAAb,cAAiD,OAAO,YAAyC,CAAC,CAChG,+BACA,EACE,UAAUA,4BACZ,CACF,CAAC,CAAC;CACA,IAAa,UAAU;EACrB,OAAO,sCAAsC,KAAK,SAAS;CAC7D;AACF"}
@@ -0,0 +1,2 @@
1
+ import { a as SqliteStorageCorruptionError, c as SqliteStorageFailpointError, i as SqliteStorageCompatibilityError, l as SqliteStorageFailpointLocation, n as SqliteCheckpointConflict, o as SqliteStorageError, r as SqliteLedgerError, t as SqliteAppendConflict, u as SqliteWriteContention } from "./SqliteStorageError-Bc-iVib1.mjs";
2
+ export { SqliteAppendConflict, SqliteCheckpointConflict, SqliteLedgerError, SqliteStorageCompatibilityError, SqliteStorageCorruptionError, SqliteStorageError, SqliteStorageFailpointError, SqliteStorageFailpointLocation, SqliteWriteContention };
@@ -0,0 +1 @@
1
+ export { t as SqliteAppendConflict, n as SqliteCheckpointConflict, r as SqliteLedgerError, i as SqliteStorageCompatibilityError, a as SqliteStorageCorruptionError, o as SqliteStorageError, c as SqliteStorageFailpointError, l as SqliteStorageFailpointLocation, u as SqliteWriteContention } from "./SqliteStorageError-d_tygf_W.mjs";
@@ -0,0 +1,15 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
2
+ import * as Context from "effect/Context";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Layer from "effect/Layer";
5
+ // src/SqliteStorageFailpoint.ts
6
+ var SqliteStorageFailpoint_exports = /* @__PURE__ */ __exportAll({ SqliteStorageFailpoint: () => SqliteStorageFailpoint });
7
+ const noFailpoint = () => Effect.void;
8
+ /** Explicit fault-injection authority used at SQLite operation boundaries. */
9
+ var SqliteStorageFailpoint = class extends Context.Service()("@effect-agent/storage-sqlite/SqliteStorageFailpoint") {
10
+ /** Production default: no fault injection. */
11
+ static layer = Layer.succeed(this)({ hit: noFailpoint });
12
+ };
13
+ export { SqliteStorageFailpoint_exports as n, SqliteStorageFailpoint as t };
14
+
15
+ //# sourceMappingURL=SqliteStorageFailpoint-BqxmxFBb.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqliteStorageFailpoint-BqxmxFBb.mjs","names":[],"sources":["../src/SqliteStorageFailpoint.ts"],"sourcesContent":["import * as Context from 'effect/Context'\nimport * as Effect from 'effect/Effect'\nimport * as Layer from 'effect/Layer'\n\nimport type { SqliteStorageFailpointError, SqliteStorageFailpointLocation } from './SqliteStorageError'\n\nexport type SqliteStorageFailpointHandler = (\n location: SqliteStorageFailpointLocation,\n) => Effect.Effect<void, SqliteStorageFailpointError>\n\nconst noFailpoint: SqliteStorageFailpointHandler = () => Effect.void\n\n/** Explicit fault-injection authority used at SQLite operation boundaries. */\nexport class SqliteStorageFailpoint extends Context.Service<\n SqliteStorageFailpoint,\n {\n readonly hit: SqliteStorageFailpointHandler\n }\n>()('@effect-agent/storage-sqlite/SqliteStorageFailpoint') {\n /** Production default: no fault injection. */\n static readonly layer = Layer.succeed(this)({ hit: noFailpoint })\n}\n"],"mappings":";;;;;;AAUA,MAAM,oBAAmD,OAAO;;AAGhE,IAAa,yBAAb,cAA4C,QAAQ,QAKlD,CAAC,CAAC,qDAAqD,CAAC,CAAC;;CAEzD,OAAgB,QAAQ,MAAM,QAAQ,IAAI,CAAC,CAAC,EAAE,KAAK,YAAY,CAAC;AAClE"}
@@ -0,0 +1,17 @@
1
+ import * as Context from "effect/Context";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Layer from "effect/Layer";
4
+ import { c as SqliteStorageFailpointError, l as SqliteStorageFailpointLocation } from "./SqliteStorageError-Bc-iVib1.mjs";
5
+ declare namespace SqliteStorageFailpoint_d_exports {
6
+ export { SqliteStorageFailpoint, SqliteStorageFailpointHandler };
7
+ }
8
+ type SqliteStorageFailpointHandler = (location: SqliteStorageFailpointLocation) => Effect.Effect<void, SqliteStorageFailpointError>;
9
+ declare const SqliteStorageFailpoint_base: Context.ServiceClass<SqliteStorageFailpoint, "@effect-agent/storage-sqlite/SqliteStorageFailpoint", {
10
+ readonly hit: SqliteStorageFailpointHandler;
11
+ }>;
12
+ /** Explicit fault-injection authority used at SQLite operation boundaries. */
13
+ declare class SqliteStorageFailpoint extends SqliteStorageFailpoint_base {
14
+ /** Production default: no fault injection. */
15
+ static readonly layer: Layer.Layer<SqliteStorageFailpoint, never, never>;
16
+ }
17
+ export { SqliteStorageFailpointHandler as n, SqliteStorageFailpoint_d_exports as r, SqliteStorageFailpoint as t };
@@ -0,0 +1,2 @@
1
+ import { n as SqliteStorageFailpointHandler, t as SqliteStorageFailpoint } from "./SqliteStorageFailpoint-CJRyxmsW.mjs";
2
+ export { SqliteStorageFailpoint, SqliteStorageFailpointHandler };
@@ -0,0 +1 @@
1
+ export { t as SqliteStorageFailpoint } from "./SqliteStorageFailpoint-BqxmxFBb.mjs";
@@ -0,0 +1,8 @@
1
+ import "effect/Effect";
2
+ import "effect/sql/SqlClient";
3
+ import "./SqliteStorageError-Bc-iVib1.mjs";
4
+ declare const CurrentSqliteStorageVersion = 31;
5
+ declare namespace SqliteStorageVersion_d_exports {
6
+ export { CurrentSqliteStorageVersion };
7
+ }
8
+ export { CurrentSqliteStorageVersion as n, SqliteStorageVersion_d_exports as t };
@@ -0,0 +1,7 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
2
+ import "./migrations-_uIpJR5O.mjs";
3
+ // src/SqliteStorageVersion.ts
4
+ var SqliteStorageVersion_exports = /* @__PURE__ */ __exportAll({ CurrentSqliteStorageVersion: () => 31 });
5
+ export { SqliteStorageVersion_exports as t };
6
+
7
+ //# sourceMappingURL=SqliteStorageVersion-BxAVd_1t.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqliteStorageVersion-BxAVd_1t.mjs","names":[],"sources":["../src/SqliteStorageVersion.ts"],"sourcesContent":["/** Current adapter layout version; record encoding is versioned independently. */\nexport { CurrentSqliteStorageVersion } from './internal/migrations'\n"],"mappings":""}
@@ -0,0 +1,3 @@
1
+ /** Current adapter layout version; record encoding is versioned independently. */
2
+ import { n as CurrentSqliteStorageVersion } from "./SqliteStorageVersion-Bayz1P9w.mjs";
3
+ export { CurrentSqliteStorageVersion };
@@ -0,0 +1,2 @@
1
+ export { t as CurrentSqliteStorageVersion } from "./migrations-_uIpJR5O.mjs";
2
+ import "./SqliteStorageVersion-BxAVd_1t.mjs";
@@ -0,0 +1,25 @@
1
+ import { StorageOwner } from "@systemfsoftware/agent/run-storage";
2
+ import { SettlementPublisher } from "@systemfsoftware/agent/settlement-publisher";
3
+ import { SubmissionLedger } from "@systemfsoftware/agent/submission-ledger";
4
+ import * as CryptoDigest from "effect/crypto/Digest";
5
+ import * as SecureRandom from "effect/crypto/SecureRandom";
6
+ import * as Layer from "effect/Layer";
7
+ import * as SqlClientService from "effect/sql/SqlClient";
8
+ import { t as SqliteStorageConfig } from "./SqliteStorageConfig-6HRtBHf8.mjs";
9
+ import { t as SqliteStorageFailpoint } from "./SqliteStorageFailpoint-CJRyxmsW.mjs";
10
+ import { n as SqliteStorageOptions, t as SqliteStorageInitializationError } from "./SqliteThreadStore-DKac999S.mjs";
11
+ declare namespace SqliteSubmissionLedger_d_exports {
12
+ export { ledgerLayer, submissionLedgerLayer };
13
+ }
14
+ /**
15
+ * SQLite submission transitions and canonical settlement publication share the journal's
16
+ * database file, scoped owner, and mutation gate. Configuration, failpoint, SQL, Digest, and SecureRandom
17
+ * authority stay visible in the input channel.
18
+ */
19
+ declare const submissionLedgerLayer: Layer.Layer<SubmissionLedger | SettlementPublisher | StorageOwner, SqliteStorageInitializationError, SqliteStorageConfig | SqliteStorageFailpoint | SqlClientService.SqlClient | CryptoDigest.Digest | SecureRandom.SecureRandom>;
20
+ /**
21
+ * A composition-root Layer for submission transitions and settlement publication. Point it
22
+ * at the same exclusive client as ThreadStore so every mutation shares its local owner.
23
+ */
24
+ declare const ledgerLayer: (options: SqliteStorageOptions) => Layer.Layer<SubmissionLedger | SettlementPublisher | StorageOwner, SqliteStorageInitializationError>;
25
+ export { ledgerLayer as n, submissionLedgerLayer as r, SqliteSubmissionLedger_d_exports as t };
@@ -0,0 +1,46 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
2
+ import * as NodeCrypto from "@effect/platform-node/NodeCrypto";
3
+ import { makeSqlSubmissionLedgerKernel } from "@systemfsoftware/agent-storage-sql/sql-submission-ledger";
4
+ import { StorageOwner } from "@systemfsoftware/agent/run-storage";
5
+ import { SettlementPublisher } from "@systemfsoftware/agent/settlement-publisher";
6
+ import { SubmissionLedger } from "@systemfsoftware/agent/submission-ledger";
7
+ import * as Context from "effect/Context";
8
+ import * as Effect from "effect/Effect";
9
+ import * as Layer from "effect/Layer";
10
+ import { c as storageFailpointLayer, d as sqliteClientLayer, n as exclusiveHostClientLayer, s as storageConfigLayer, u as sqlFailure } from "./SqliteThreadStore-CUkk9A0Y.mjs";
11
+ import { a as sqliteErrors, n as initializeSqliteJournal } from "./sqlite-journal-3Zguf9OC.mjs";
12
+ import { t as SqliteStorageConfig } from "./SqliteStorageConfig-DN-WwQrw.mjs";
13
+ import { t as SqliteStorageFailpoint } from "./SqliteStorageFailpoint-BqxmxFBb.mjs";
14
+ // src/SqliteSubmissionLedger.ts
15
+ var SqliteSubmissionLedger_exports = /* @__PURE__ */ __exportAll({
16
+ ledgerLayer: () => ledgerLayer,
17
+ submissionLedgerLayer: () => submissionLedgerLayer
18
+ });
19
+ const makeServices = Effect.fnUntraced(function* () {
20
+ const failpoint = yield* SqliteStorageFailpoint;
21
+ const journal = yield* initializeSqliteJournal;
22
+ const services = yield* makeSqlSubmissionLedgerKernel(journal, {
23
+ errors: sqliteErrors,
24
+ hitFailpoint: failpoint.hit,
25
+ offsetPrefix: "effect-agent-sqlite@1:",
26
+ sqlFailure
27
+ });
28
+ return Context.make(SubmissionLedger, services.ledger).pipe(Context.add(SettlementPublisher, services.publisher), Context.add(StorageOwner, journal.owner));
29
+ });
30
+ /**
31
+ * SQLite submission transitions and canonical settlement publication share the journal's
32
+ * database file, scoped owner, and mutation gate. Configuration, failpoint, SQL, Digest, and SecureRandom
33
+ * authority stay visible in the input channel.
34
+ */
35
+ const submissionLedgerLayer = Layer.effectContext(makeServices()).pipe(Layer.provide(exclusiveHostClientLayer));
36
+ /**
37
+ * A composition-root Layer for submission transitions and settlement publication. Point it
38
+ * at the same exclusive client as ThreadStore so every mutation shares its local owner.
39
+ */
40
+ const ledgerLayer = (options) => Layer.unwrap(Effect.map(SqliteStorageConfig, (config) => submissionLedgerLayer.pipe(Layer.provide(Layer.mergeAll(Layer.succeed(SqliteStorageConfig)(config), storageFailpointLayer(options), sqliteClientLayer({
41
+ filename: options.filename,
42
+ disableWAL: true
43
+ }, "open SQLite"), NodeCrypto.layer))))).pipe(Layer.provide(storageConfigLayer(options)));
44
+ export { ledgerLayer as n, submissionLedgerLayer as r, SqliteSubmissionLedger_exports as t };
45
+
46
+ //# sourceMappingURL=SqliteSubmissionLedger-DTWaRPjV.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqliteSubmissionLedger-DTWaRPjV.mjs","names":[],"sources":["../src/SqliteSubmissionLedger.ts"],"sourcesContent":["import * as NodeCrypto from '@effect/platform-node/NodeCrypto'\nimport { makeSqlSubmissionLedgerKernel } from '@systemfsoftware/agent-storage-sql/sql-submission-ledger'\nimport { StorageOwner } from '@systemfsoftware/agent/run-storage'\nimport { SettlementPublisher } from '@systemfsoftware/agent/settlement-publisher'\nimport { SubmissionLedger } from '@systemfsoftware/agent/submission-ledger'\nimport * as Context from 'effect/Context'\nimport type * as CryptoDigest from 'effect/crypto/Digest'\nimport type * as SecureRandom from 'effect/crypto/SecureRandom'\nimport * as Effect from 'effect/Effect'\nimport * as Layer from 'effect/Layer'\nimport type * as SqlClientService from 'effect/sql/SqlClient'\n\nimport { sqliteClientLayer } from './internal/sqlite-client-layer'\nimport { initializeSqliteJournal, sqliteErrors } from './internal/sqlite-journal'\nimport { sqlFailure } from './internal/sqlite-ledger-errors'\nimport { SqliteStorageConfig } from './SqliteStorageConfig'\nimport { SqliteStorageFailpoint } from './SqliteStorageFailpoint'\nimport {\n exclusiveHostClientLayer,\n type SqliteStorageInitializationError,\n type SqliteStorageOptions,\n storageConfigLayer,\n storageFailpointLayer,\n} from './SqliteThreadStore'\n\nconst makeServices = Effect.fnUntraced(function*() {\n const failpoint = yield* SqliteStorageFailpoint\n const journal = yield* initializeSqliteJournal\n\n const services = yield* makeSqlSubmissionLedgerKernel(journal, {\n errors: sqliteErrors,\n hitFailpoint: failpoint.hit,\n offsetPrefix: 'effect-agent-sqlite@1:',\n sqlFailure,\n })\n\n return Context.make(SubmissionLedger, services.ledger).pipe(\n Context.add(SettlementPublisher, services.publisher),\n Context.add(StorageOwner, journal.owner),\n )\n})\n\n/**\n * SQLite submission transitions and canonical settlement publication share the journal's\n * database file, scoped owner, and mutation gate. Configuration, failpoint, SQL, Digest, and SecureRandom\n * authority stay visible in the input channel.\n */\nexport const submissionLedgerLayer: Layer.Layer<\n SubmissionLedger | SettlementPublisher | StorageOwner,\n SqliteStorageInitializationError,\n | SqliteStorageConfig\n | SqliteStorageFailpoint\n | SqlClientService.SqlClient\n | CryptoDigest.Digest\n | SecureRandom.SecureRandom\n> = Layer.effectContext(makeServices()).pipe(Layer.provide(exclusiveHostClientLayer))\n\n/**\n * A composition-root Layer for submission transitions and settlement publication. Point it\n * at the same exclusive client as ThreadStore so every mutation shares its local owner.\n */\nexport const ledgerLayer = (\n options: SqliteStorageOptions,\n): Layer.Layer<\n SubmissionLedger | SettlementPublisher | StorageOwner,\n SqliteStorageInitializationError\n> =>\n Layer.unwrap(\n Effect.map(SqliteStorageConfig, (config) =>\n submissionLedgerLayer.pipe(\n Layer.provide(\n Layer.mergeAll(\n Layer.succeed(SqliteStorageConfig)(config),\n storageFailpointLayer(options),\n sqliteClientLayer({ filename: options.filename, disableWAL: true }, 'open SQLite'),\n NodeCrypto.layer,\n ),\n ),\n )),\n ).pipe(Layer.provide(storageConfigLayer(options)))\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,MAAM,eAAe,OAAO,WAAW,aAAY;CACjD,MAAM,YAAY,OAAO;CACzB,MAAM,UAAU,OAAO;CAEvB,MAAM,WAAW,OAAO,8BAA8B,SAAS;EAC7D,QAAQ;EACR,cAAc,UAAU;EACxB,cAAc;EACd;CACF,CAAC;CAED,OAAO,QAAQ,KAAK,kBAAkB,SAAS,MAAM,CAAC,CAAC,KACrD,QAAQ,IAAI,qBAAqB,SAAS,SAAS,GACnD,QAAQ,IAAI,cAAc,QAAQ,KAAK,CACzC;AACF,CAAC;;;;;;AAOD,MAAa,wBAQT,MAAM,cAAc,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,QAAQ,wBAAwB,CAAC;;;;;AAMpF,MAAa,eACX,YAKA,MAAM,OACJ,OAAO,IAAI,sBAAsB,WAC/B,sBAAsB,KACpB,MAAM,QACJ,MAAM,SACJ,MAAM,QAAQ,mBAAmB,CAAC,CAAC,MAAM,GACzC,sBAAsB,OAAO,GAC7B,kBAAkB;CAAE,UAAU,QAAQ;CAAU,YAAY;AAAK,GAAG,aAAa,GACjF,WAAW,KACb,CACF,CACF,CAAC,CACL,CAAC,CAAC,KAAK,MAAM,QAAQ,mBAAmB,OAAO,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { n as ledgerLayer, r as submissionLedgerLayer } from "./SqliteSubmissionLedger-2lHitXAA.mjs";
2
+ export { ledgerLayer, submissionLedgerLayer };
@@ -0,0 +1 @@
1
+ export { n as ledgerLayer, r as submissionLedgerLayer } from "./SqliteSubmissionLedger-DTWaRPjV.mjs";