@xyo-network/event-kit-node 2.1.0 → 2.2.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 (36) hide show
  1. package/README.md +53 -34
  2. package/dist/node/bestEffortSnapshotWorker.d.ts +44 -0
  3. package/dist/node/bestEffortSnapshotWorker.d.ts.map +1 -0
  4. package/dist/node/bestEffortTypes.d.ts +55 -0
  5. package/dist/node/bestEffortTypes.d.ts.map +1 -0
  6. package/dist/node/filesystemCursorStore.d.ts.map +1 -1
  7. package/dist/node/filesystemJson.d.ts.map +1 -1
  8. package/dist/node/filesystemPublisherOutbox.d.ts.map +1 -1
  9. package/dist/node/filesystemWakeInbox.d.ts +3 -20
  10. package/dist/node/filesystemWakeInbox.d.ts.map +1 -1
  11. package/dist/node/filesystemWakeQueue.d.ts +10 -19
  12. package/dist/node/filesystemWakeQueue.d.ts.map +1 -1
  13. package/dist/node/handshake.mjs +12 -11
  14. package/dist/node/handshake.mjs.map +2 -2
  15. package/dist/node/index.d.ts +8 -1
  16. package/dist/node/index.d.ts.map +1 -1
  17. package/dist/node/index.mjs +1909 -609
  18. package/dist/node/index.mjs.map +4 -4
  19. package/dist/node/privateSqlite.d.ts +19 -0
  20. package/dist/node/privateSqlite.d.ts.map +1 -0
  21. package/dist/node/receiverAuthority.d.ts +102 -0
  22. package/dist/node/receiverAuthority.d.ts.map +1 -0
  23. package/dist/node/receiverMigration.d.ts +16 -0
  24. package/dist/node/receiverMigration.d.ts.map +1 -0
  25. package/dist/node/receiverMigrationInventory.d.ts +6 -0
  26. package/dist/node/receiverMigrationInventory.d.ts.map +1 -0
  27. package/dist/node/receiverMigrationSnapshot.d.ts +6 -0
  28. package/dist/node/receiverMigrationSnapshot.d.ts.map +1 -0
  29. package/dist/node/receiverMigrationTypes.d.ts +113 -0
  30. package/dist/node/receiverMigrationTypes.d.ts.map +1 -0
  31. package/dist/node/runtime.mjs.map +2 -2
  32. package/dist/node/sqliteBestEffortInbox.d.ts +20 -0
  33. package/dist/node/sqliteBestEffortInbox.d.ts.map +1 -0
  34. package/dist/node/sqliteWakeQueue.d.ts +83 -17
  35. package/dist/node/sqliteWakeQueue.d.ts.map +1 -1
  36. package/package.json +13 -13
@@ -0,0 +1,20 @@
1
+ import type { BestEffortDirtyTarget, PersistentBestEffortInbox } from './bestEffortTypes.ts';
2
+ export interface SqliteBestEffortInboxOptions {
3
+ /** An immutable host application/consumer identifier. Do not share with Durable Delivery. */
4
+ readonly consumerId: string;
5
+ /** Finite per-index replay capacity; unexpired records are never evicted. */
6
+ readonly maxSecurityRecords: number;
7
+ /** Finite exact binding capacity, including retained completed targets. */
8
+ readonly maxTargets?: number;
9
+ readonly nowSeconds?: () => number;
10
+ readonly path: string;
11
+ /** Acceleration only. Failure is repaired by durable scanning or a matching duplicate. */
12
+ readonly requestWork?: (target: BestEffortDirtyTarget) => void | Promise<void>;
13
+ }
14
+ /**
15
+ * SQLite co-commits security, receive-clock high water and dirty generation in
16
+ * one writer transaction. Only the Best Effort namespace is decoded. No callback
17
+ * or external queue participates in the durability boundary.
18
+ */
19
+ export declare function createSqliteBestEffortInbox(options: SqliteBestEffortInboxOptions): Promise<PersistentBestEffortInbox>;
20
+ //# sourceMappingURL=sqliteBestEffortInbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqliteBestEffortInbox.d.ts","sourceRoot":"","sources":["../../src/sqliteBestEffortInbox.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACiB,qBAAqB,EAAyB,yBAAyB,EACnG,MAAM,sBAAsB,CAAA;AAG7B,MAAM,WAAW,4BAA4B;IAC3C,6FAA6F;IAC7F,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,6EAA6E;IAC7E,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;IACnC,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,MAAM,CAAA;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,0FAA0F;IAC1F,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC/E;AAgFD;;;;GAIG;AACH,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAwQ3H"}
@@ -1,25 +1,91 @@
1
1
  import type { WakeQueue } from '@xyo-network/event-kit-protocol';
2
2
  export interface SqliteWakeQueueOptions {
3
- /** Database file path, or `:memory:` for a throwaway store. */
4
3
  readonly path: string;
5
4
  }
6
5
  export interface SqliteWakeQueue extends WakeQueue {
7
- /** Releases the underlying handle. */
8
- close: () => void;
6
+ close(): void;
9
7
  }
10
- /**
11
- * SQLite-backed `WakeQueue`.
12
- *
13
- * Every state change is a single statement under WAL, so a claim cannot be
14
- * observed half-applied and two callers cannot lease one row: the claim is an
15
- * `UPDATE … WHERE state = 'pending'` whose affected-row count decides the
16
- * winner. That is the transactional form of the lease the filesystem provider
17
- * approximates with `link`.
18
- *
19
- * WAL also permits concurrent readers with one writer, so several processes on
20
- * one host can share the file. It does not coordinate across hosts.
21
- *
22
- * Uses Node's built-in `node:sqlite`, which still emits an ExperimentalWarning.
23
- */
8
+ /** FULL/WAL queue; old unfenced databases require explicit offline migration. */
24
9
  export declare function createSqliteWakeQueue(options: SqliteWakeQueueOptions): Promise<SqliteWakeQueue>;
10
+ /** Atomic production composition: identities and work live in one database. */
11
+ export declare function createSqliteWakeReceiver(options: SqliteWakeQueueOptions): Promise<{
12
+ queue: WakeQueue<{
13
+ audience: string;
14
+ deploymentId: string;
15
+ event: {
16
+ schema: "network.xyo.event.wake.envelope" & {
17
+ readonly __schema: true;
18
+ };
19
+ authorizationChainId: string;
20
+ deploymentId: string;
21
+ wakeId: string;
22
+ deliveryMode: "best-effort" | "durable";
23
+ source: {
24
+ kind: "xl1-finalized";
25
+ chainId: string;
26
+ } | {
27
+ kind: "ethereum-finalized";
28
+ chainId: string;
29
+ genesisHash: string;
30
+ } | {
31
+ kind: "utc-interval";
32
+ scheduleId: string;
33
+ anchorSeconds: number;
34
+ intervalSeconds: number;
35
+ };
36
+ fromPosition: number;
37
+ toPosition: number;
38
+ filterHash: string;
39
+ issuedAt: number;
40
+ queueId?: string | undefined;
41
+ };
42
+ eventHash: string;
43
+ fromPosition: number;
44
+ toPosition: number;
45
+ jti: string;
46
+ publisher: string;
47
+ wakeId: string;
48
+ queueId?: string | undefined;
49
+ }>;
50
+ inbox: import("@xyo-network/event-kit-protocol").AtomicWakeInbox<{
51
+ audience: string;
52
+ deploymentId: string;
53
+ event: {
54
+ schema: "network.xyo.event.wake.envelope" & {
55
+ readonly __schema: true;
56
+ };
57
+ authorizationChainId: string;
58
+ deploymentId: string;
59
+ wakeId: string;
60
+ deliveryMode: "best-effort" | "durable";
61
+ source: {
62
+ kind: "xl1-finalized";
63
+ chainId: string;
64
+ } | {
65
+ kind: "ethereum-finalized";
66
+ chainId: string;
67
+ genesisHash: string;
68
+ } | {
69
+ kind: "utc-interval";
70
+ scheduleId: string;
71
+ anchorSeconds: number;
72
+ intervalSeconds: number;
73
+ };
74
+ fromPosition: number;
75
+ toPosition: number;
76
+ filterHash: string;
77
+ issuedAt: number;
78
+ queueId?: string | undefined;
79
+ };
80
+ eventHash: string;
81
+ fromPosition: number;
82
+ toPosition: number;
83
+ jti: string;
84
+ publisher: string;
85
+ wakeId: string;
86
+ queueId?: string | undefined;
87
+ }>;
88
+ close: () => void;
89
+ pruneExpiredTokens: (nowSeconds: number) => Promise<number>;
90
+ }>;
25
91
  //# sourceMappingURL=sqliteWakeQueue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sqliteWakeQueue.d.ts","sourceRoot":"","sources":["../../src/sqliteWakeQueue.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAGV,SAAS,EACV,MAAM,iCAAiC,CAAA;AAExC,MAAM,WAAW,sBAAsB;IACrC,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,sCAAsC;IACtC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAOD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,eAAe,CAAC,CAmE1B"}
1
+ {"version":3,"file":"sqliteWakeQueue.d.ts","sourceRoot":"","sources":["../../src/sqliteWakeQueue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAIhE,MAAM,WAAW,sBAAsB;IAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AACjE,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAAG,KAAK,IAAI,IAAI,CAAA;CAAE;AAEpE,iFAAiF;AACjF,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC,CAGrG;AAED,+EAA+E;AAC/E,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAMnC,MAAM;GAEhD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xyo-network/event-kit-node",
3
- "version": "2.1.0",
4
- "description": "Node 24+ Event Kit durability, handshake clients, and SQLite source publisher runtime",
3
+ "version": "2.2.0",
4
+ "description": "Node 26+ Event Kit durability, handshake clients, and SQLite source publisher runtime",
5
5
  "keywords": [
6
6
  "xyo",
7
7
  "xl1",
@@ -41,11 +41,11 @@
41
41
  "README.md"
42
42
  ],
43
43
  "dependencies": {
44
- "@xyo-network/event-kit-actor": "~2.1.0",
45
- "@xyo-network/event-kit-protocol": "~2.1.0",
46
- "@xyo-network/event-kit-schemas": "~2.1.0",
47
- "@xyo-network/event-kit-statement-graph": "~2.1.0",
48
- "@xyo-network/event-kit-xl1": "~2.1.0"
44
+ "@xyo-network/event-kit-actor": "~2.2.0",
45
+ "@xyo-network/event-kit-protocol": "~2.2.0",
46
+ "@xyo-network/event-kit-schemas": "~2.2.0",
47
+ "@xyo-network/event-kit-statement-graph": "~2.2.0",
48
+ "@xyo-network/event-kit-xl1": "~2.2.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@ariestools/actor": "~2.0.0",
@@ -54,9 +54,9 @@
54
54
  "@ariestools/toolchain": "~10.0.8",
55
55
  "@ariestools/tsconfig": "~10.0.8",
56
56
  "@opentelemetry/api": "~1.9.1",
57
- "@types/node": "~26.6.3",
58
- "@xyo-network/event-kit-http": "~2.1.0",
59
- "@xyo-network/event-kit-testing": "~2.1.0",
57
+ "@types/node": "~26.6.4",
58
+ "@xyo-network/event-kit-http": "~2.2.0",
59
+ "@xyo-network/event-kit-testing": "~2.2.0",
60
60
  "@xyo-network/sdk": "~8.0.1",
61
61
  "@xyo-network/sdk-protocol": "~8.0.1",
62
62
  "@xyo-network/xl1-protocol": "~5.8.0",
@@ -66,12 +66,12 @@
66
66
  "@xyo-network/xl1-statement-graph-sdk": "~0.5.4",
67
67
  "ajv": "~8.20.0",
68
68
  "async-mutex": "~0.5.0",
69
- "eslint": "~10.11.0",
69
+ "eslint": "~10.12.0",
70
70
  "eslint-import-resolver-typescript": "~4.4.5",
71
71
  "ethers": "~6.17.0",
72
72
  "tslib": "~2.8.1",
73
73
  "typescript": "~6.0.3",
74
- "vite": "~8.3.1",
74
+ "vite": "~8.3.2",
75
75
  "vitest": "~5.0.3",
76
76
  "zod": "~4.6.5"
77
77
  },
@@ -92,7 +92,7 @@
92
92
  "zod": "^4.6"
93
93
  },
94
94
  "engines": {
95
- "node": ">=24"
95
+ "node": ">=26"
96
96
  },
97
97
  "publishConfig": {
98
98
  "access": "public"