@uuaid/pillar 0.2.0-alpha.16 → 0.2.0-alpha.17

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/README.md CHANGED
@@ -15,7 +15,7 @@ exchanges encrypted, signed envelopes through the pillar network — a
15
15
  store-and-forward carrier mesh with a LimeWire/BitTorrent-style seed topology:
16
16
  no single carrier is the only store.
17
17
 
18
- **Minimal requirements:** Node.js >= 20, outbound HTTPS. That's it. Carrier
18
+ **Minimal requirements:** Node.js >= 22, outbound HTTPS. That's it. Carrier
19
19
  mode needs no inbound ports, no daemon, no account. One identity = one
20
20
  keychain file + one SQLite mailbox.
21
21
 
package/bin/carrier.mjs CHANGED
@@ -10,6 +10,7 @@
10
10
  * authenticate per-request with their own keys. No accounts, no state
11
11
  * about who exists — pure store-and-forward.
12
12
  */
13
+ import "../src/node-check.mjs"; // must stay the first import: refuses Node < 22 before any dependency loads
13
14
  import { CarrierServer } from "../src/net/carrier-server.mjs";
14
15
 
15
16
  function parseArgs(argv) {
@@ -10,6 +10,7 @@
10
10
  * Exits 0 on reply(status ok), 3 on reply(status error), 4 on timeout.
11
11
  * See INTERACTION-CONVENTION.md for the wire contract.
12
12
  */
13
+ import "../src/node-check.mjs"; // must stay the first import: refuses Node < 22 before any dependency loads
13
14
  import { existsSync, readFileSync } from "node:fs";
14
15
  import { join } from "node:path";
15
16
  import { homedir } from "node:os";
@@ -10,6 +10,7 @@
10
10
  * The broker never receives a DEK. `send` prints metadata only; the secret ref
11
11
  * exists solely inside the recipient-encrypted Pillar envelope.
12
12
  */
13
+ import "../src/node-check.mjs"; // must stay the first import: refuses Node < 22 before any dependency loads
13
14
  import { readFileSync, writeFileSync } from "node:fs";
14
15
  import { homedir } from "node:os";
15
16
  import { join } from "node:path";
@@ -22,6 +22,7 @@
22
22
  * `agents.json` is passed through untouched: this process owns the seed list,
23
23
  * not the address book.
24
24
  */
25
+ import "../src/node-check.mjs"; // must stay the first import: refuses Node < 22 before any dependency loads
25
26
  import { createServer } from "node:http";
26
27
  import { readFileSync, existsSync, mkdirSync } from "node:fs";
27
28
  import { homedir } from "node:os";
@@ -42,6 +42,7 @@
42
42
  * (who absorbs the fee: the seller, the buyer, or 50/50) or --payout N (the
43
43
  * parties' own number; a "mutual" agreement). No default is ever derived.
44
44
  */
45
+ import "../src/node-check.mjs"; // must stay the first import: refuses Node < 22 before any dependency loads
45
46
  import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
46
47
  import { join, dirname } from "node:path";
47
48
  import { homedir } from "node:os";
@@ -31,6 +31,7 @@
31
31
  * --reply-text "zz-master is away — left a message" \
32
32
  * --forward-to uuaid:foundation:agent:… --forward-pubkey <hex>
33
33
  */
34
+ import "../src/node-check.mjs"; // must stay the first import: refuses Node < 22 before any dependency loads
34
35
  import { existsSync, readFileSync, appendFileSync } from "node:fs";
35
36
  import { join } from "node:path";
36
37
  import { homedir } from "node:os";
@@ -39,6 +39,7 @@
39
39
  * TLS-terminating proxy (nginx/Caddy) and pass the PUBLIC https:// URL as
40
40
  * --public-url — never the loopback one.
41
41
  */
42
+ import "../src/node-check.mjs"; // must stay the first import: refuses Node < 22 before any dependency loads
42
43
  import { mkdirSync } from "node:fs";
43
44
  import { homedir } from "node:os";
44
45
  import { join } from "node:path";
package/bin/pillar.mjs CHANGED
@@ -16,6 +16,7 @@
16
16
  * All commands respect --home to point at an alternate pillar directory,
17
17
  * useful for running multiple pillars on one machine (Zestro dogfood etc.).
18
18
  */
19
+ import "../src/node-check.mjs"; // must stay the first import: refuses Node < 22 before any dependency loads
19
20
  import { mkdirSync, existsSync, readFileSync, writeFileSync } from "node:fs";
20
21
  import { join, dirname } from "node:path";
21
22
  import { homedir } from "node:os";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uuaid/pillar",
3
- "version": "0.2.0-alpha.16",
3
+ "version": "0.2.0-alpha.17",
4
4
  "description": "Pillar (Protocol for Inter-agent Linked Ledger And Relay) \u2014 the secure delivery layer of UACP, the Universal Agent Communication Protocol. UACP = UUAID (identity) + Envelope (signed, encrypted container) + Pillar (relay, mailbox, routing, store-and-forward). Reference implementation of the UACP delivery layer; includes VDA-1 (IAASO-3901, in ballot) delivery attestation and a blind escrow for the Zilligon ZGN / EVM rails.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -43,10 +43,13 @@
43
43
  "test": "node --test --test-reporter spec test/unit/*.test.mjs",
44
44
  "test:int": "node --test --test-reporter spec test/integration/*.test.mjs",
45
45
  "test:chaos": "node --test --test-reporter spec test/chaos/*.test.mjs",
46
- "test:all": "node --test --test-reporter spec test/unit/*.test.mjs test/integration/*.test.mjs test/chaos/*.test.mjs"
46
+ "test:all": "node --test --test-reporter spec test/unit/*.test.mjs test/integration/*.test.mjs test/chaos/*.test.mjs",
47
+ "preflight": "node scripts/preflight-publish.mjs",
48
+ "prepublishOnly": "node scripts/preflight-publish.mjs",
49
+ "postpublish": "node scripts/verify-publish.mjs"
47
50
  },
48
51
  "engines": {
49
- "node": ">=20"
52
+ "node": ">=22"
50
53
  },
51
54
  "dependencies": {
52
55
  "@chainsafe/libp2p-noise": "^17.0.0",
@@ -66,7 +69,7 @@
66
69
  "@libp2p/websockets": "^10.1.19",
67
70
  "@multiformats/multiaddr": "^13.0.3",
68
71
  "@noble/curves": "^2.3.0",
69
- "better-sqlite3": "^11.10.0",
72
+ "better-sqlite3": "^12.11.1",
70
73
  "it-pipe": "^3.0.1",
71
74
  "it-pushable": "^3.2.4",
72
75
  "libp2p": "^3.3.8",
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Node.js version gate for the pillar command-line tools.
3
+ *
4
+ * Every bin imports this module FIRST, so it runs before any dependency does.
5
+ * Measured 2026-09-24 with the published alpha.16: on Node 20 and 21 the
6
+ * libp2p stack calls Promise.withResolvers (first shipped unflagged in Node
7
+ * 22.0.0) deep inside its peer store, so `pillar id` died with "TypeError:
8
+ * Promise.withResolvers is not a function" instead of saying what was wrong.
9
+ * package.json `engines` states the same floor, but npm only warns about
10
+ * engines; this turns the warning into a clear refusal.
11
+ */
12
+ import { basename } from "node:path";
13
+
14
+ export const MIN_NODE_MAJOR = 22;
15
+
16
+ /**
17
+ * Returns a human-readable reason this Node.js version cannot run pillar, or
18
+ * null when it can. An unparseable version passes: this gate exists to explain
19
+ * a known failure, not to guess about builds it cannot read.
20
+ */
21
+ export function nodeVersionProblem(version = process.versions.node, tool = "pillar") {
22
+ const major = Number.parseInt(String(version).split(".")[0], 10);
23
+ if (!Number.isFinite(major) || major >= MIN_NODE_MAJOR) return null;
24
+ return `${tool} needs Node.js ${MIN_NODE_MAJOR} or newer (found v${version}). ` +
25
+ `Install the current LTS from https://nodejs.org and run it again.`;
26
+ }
27
+
28
+ const problem = nodeVersionProblem(process.versions.node, basename(process.argv[1] ?? "pillar").replace(/\.mjs$/, ""));
29
+ if (problem) {
30
+ process.stderr.write(`${problem}\n`);
31
+ process.exit(1);
32
+ }