@fairfox/polly 0.27.1 → 0.27.2

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.
@@ -1,170 +1,6 @@
1
- var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
- var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
- target = mod != null ? __create(__getProtoOf(mod)) : {};
21
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
28
- if (canCache)
29
- cache.set(mod, to);
30
- return to;
31
- };
32
- var __toCommonJS = (from) => {
33
- var entry = (__moduleCache ??= new WeakMap).get(from), desc;
34
- if (entry)
35
- return entry;
36
- entry = __defProp({}, "__esModule", { value: true });
37
- if (from && typeof from === "object" || typeof from === "function") {
38
- for (var key of __getOwnPropNames(from))
39
- if (!__hasOwnProp.call(entry, key))
40
- __defProp(entry, key, {
41
- get: __accessProp.bind(from, key),
42
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
43
- });
44
- }
45
- __moduleCache.set(from, entry);
46
- return entry;
47
- };
48
- var __moduleCache;
49
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
50
- var __returnValue = (v) => v;
51
- function __exportSetter(name, newValue) {
52
- this[name] = __returnValue.bind(null, newValue);
53
- }
54
- var __export = (target, all) => {
55
- for (var name in all)
56
- __defProp(target, name, {
57
- get: all[name],
58
- enumerable: true,
59
- configurable: true,
60
- set: __exportSetter.bind(all, name)
61
- });
62
- };
63
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
64
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
65
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
66
- }) : x)(function(x) {
67
- if (typeof require !== "undefined")
68
- return require.apply(this, arguments);
69
- throw Error('Dynamic require of "' + x + '" is not supported');
70
- });
71
-
72
- // src/shared/lib/encryption.ts
73
- var exports_encryption = {};
74
- __export(exports_encryption, {
75
- sealEnvelope: () => sealEnvelope,
76
- openEnvelope: () => openEnvelope,
77
- generateDocumentKey: () => generateDocumentKey,
78
- encrypt: () => encrypt,
79
- encodeEncryptedEnvelope: () => encodeEncryptedEnvelope,
80
- decryptOrThrow: () => decryptOrThrow,
81
- decrypt: () => decrypt,
82
- decodeEncryptedEnvelope: () => decodeEncryptedEnvelope,
83
- TAG_BYTES: () => TAG_BYTES,
84
- NONCE_BYTES: () => NONCE_BYTES,
85
- KEY_BYTES: () => KEY_BYTES,
86
- EncryptionError: () => EncryptionError
87
- });
88
- import nacl from "tweetnacl";
89
- function generateDocumentKey() {
90
- return nacl.randomBytes(KEY_BYTES);
91
- }
92
- function encrypt(payload, key) {
93
- if (key.length !== KEY_BYTES) {
94
- throw new EncryptionError(`secretbox key must be ${KEY_BYTES} bytes, got ${key.length}.`, "invalid-key-length");
95
- }
96
- const nonce = nacl.randomBytes(NONCE_BYTES);
97
- const ciphertext = nacl.secretbox(payload, nonce, key);
98
- const out = new Uint8Array(NONCE_BYTES + ciphertext.length);
99
- out.set(nonce, 0);
100
- out.set(ciphertext, NONCE_BYTES);
101
- return out;
102
- }
103
- function decrypt(sealed, key) {
104
- if (key.length !== KEY_BYTES) {
105
- throw new EncryptionError(`secretbox key must be ${KEY_BYTES} bytes, got ${key.length}.`, "invalid-key-length");
106
- }
107
- if (sealed.length < NONCE_BYTES + TAG_BYTES) {
108
- return;
109
- }
110
- const nonce = sealed.subarray(0, NONCE_BYTES);
111
- const ciphertext = sealed.subarray(NONCE_BYTES);
112
- const opened = nacl.secretbox.open(ciphertext, nonce, key);
113
- return opened ?? undefined;
114
- }
115
- function decryptOrThrow(sealed, key) {
116
- const opened = decrypt(sealed, key);
117
- if (!opened) {
118
- throw new EncryptionError(`Failed to decrypt sealed blob: wrong key, malformed input, or tampered ciphertext.`, "decrypt-failed");
119
- }
120
- return opened;
121
- }
122
- function sealEnvelope(payload, documentId, key) {
123
- return {
124
- documentId,
125
- sealed: encrypt(payload, key)
126
- };
127
- }
128
- function openEnvelope(envelope, key) {
129
- return decryptOrThrow(envelope.sealed, key);
130
- }
131
- function encodeEncryptedEnvelope(envelope) {
132
- const idBytes = new TextEncoder().encode(envelope.documentId);
133
- const out = new Uint8Array(4 + idBytes.length + envelope.sealed.length);
134
- const view = new DataView(out.buffer);
135
- view.setUint32(0, idBytes.length, false);
136
- out.set(idBytes, 4);
137
- out.set(envelope.sealed, 4 + idBytes.length);
138
- return out;
139
- }
140
- function decodeEncryptedEnvelope(bytes) {
141
- if (bytes.length < 4) {
142
- throw new EncryptionError(`Encrypted envelope too short: ${bytes.length} bytes.`, "envelope-malformed");
143
- }
144
- const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
145
- const idLen = view.getUint32(0, false);
146
- if (bytes.length < 4 + idLen) {
147
- throw new EncryptionError(`Encrypted envelope truncated: declared id length ${idLen}, total ${bytes.length}.`, "envelope-malformed");
148
- }
149
- const documentId = new TextDecoder().decode(bytes.subarray(4, 4 + idLen));
150
- const sealed = bytes.slice(4 + idLen);
151
- return { documentId, sealed };
152
- }
153
- var KEY_BYTES = 32, NONCE_BYTES = 24, TAG_BYTES = 16, EncryptionError;
154
- var init_encryption = __esm(() => {
155
- EncryptionError = class EncryptionError extends Error {
156
- code;
157
- constructor(message, code) {
158
- super(message);
159
- this.name = "EncryptionError";
160
- this.code = code;
161
- }
162
- };
163
- });
164
-
165
1
  // src/mesh-node.ts
166
- var {readFile, rename, writeFile} = (() => ({}));
167
- var {createInterface} = (() => ({}));
2
+ import { readFile, rename, writeFile } from "node:fs/promises";
3
+ import { createInterface } from "node:readline/promises";
168
4
 
169
5
  // src/shared/lib/keyring-storage.ts
170
6
  function memoryKeyringStorage() {
@@ -254,23 +90,13 @@ function base64ToBytes(b64) {
254
90
  return bytes;
255
91
  }
256
92
 
257
- // src/shared/lib/pairing.ts
258
- init_encryption();
93
+ // src/shared/lib/encryption.ts
94
+ import nacl from "tweetnacl";
95
+ var KEY_BYTES = 32;
259
96
 
260
97
  // src/shared/lib/signing.ts
261
98
  import nacl2 from "tweetnacl";
262
99
  var PUBLIC_KEY_BYTES = 32;
263
- var SECRET_KEY_BYTES = 64;
264
- var SIGNATURE_BYTES = 64;
265
-
266
- class SigningError extends Error {
267
- code;
268
- constructor(message, code) {
269
- super(message);
270
- this.name = "SigningError";
271
- this.code = code;
272
- }
273
- }
274
100
  function generateSigningKeyPair() {
275
101
  const pair = nacl2.sign.keyPair();
276
102
  return {
@@ -278,67 +104,6 @@ function generateSigningKeyPair() {
278
104
  secretKey: pair.secretKey
279
105
  };
280
106
  }
281
- function signingKeyPairFromSecret(secretKey) {
282
- if (secretKey.length !== SECRET_KEY_BYTES) {
283
- throw new SigningError(`Ed25519 secret key must be ${SECRET_KEY_BYTES} bytes, got ${secretKey.length}.`, "invalid-secret-key");
284
- }
285
- const pair = nacl2.sign.keyPair.fromSecretKey(secretKey);
286
- return {
287
- publicKey: pair.publicKey,
288
- secretKey: pair.secretKey
289
- };
290
- }
291
- function sign(payload, secretKey) {
292
- if (secretKey.length !== SECRET_KEY_BYTES) {
293
- throw new SigningError(`Ed25519 secret key must be ${SECRET_KEY_BYTES} bytes, got ${secretKey.length}.`, "invalid-secret-key");
294
- }
295
- return nacl2.sign.detached(payload, secretKey);
296
- }
297
- function verify(payload, signature, publicKey) {
298
- if (publicKey.length !== PUBLIC_KEY_BYTES) {
299
- throw new SigningError(`Ed25519 public key must be ${PUBLIC_KEY_BYTES} bytes, got ${publicKey.length}.`, "invalid-public-key");
300
- }
301
- if (signature.length !== SIGNATURE_BYTES) {
302
- throw new SigningError(`Ed25519 signature must be ${SIGNATURE_BYTES} bytes, got ${signature.length}.`, "invalid-signature-length");
303
- }
304
- return nacl2.sign.detached.verify(payload, signature, publicKey);
305
- }
306
- function signEnvelope(payload, senderId, secretKey) {
307
- const signature = sign(payload, secretKey);
308
- return { senderId, payload, signature };
309
- }
310
- function openEnvelope2(envelope, publicKey) {
311
- const ok = verify(envelope.payload, envelope.signature, publicKey);
312
- if (!ok) {
313
- throw new SigningError(`Signature verification failed for envelope from ${envelope.senderId}.`, "envelope-malformed");
314
- }
315
- return envelope.payload;
316
- }
317
- function encodeSignedEnvelope(envelope) {
318
- const senderBytes = new TextEncoder().encode(envelope.senderId);
319
- const total = 4 + senderBytes.length + SIGNATURE_BYTES + envelope.payload.length;
320
- const out = new Uint8Array(total);
321
- const view = new DataView(out.buffer);
322
- view.setUint32(0, senderBytes.length, false);
323
- out.set(senderBytes, 4);
324
- out.set(envelope.signature, 4 + senderBytes.length);
325
- out.set(envelope.payload, 4 + senderBytes.length + SIGNATURE_BYTES);
326
- return out;
327
- }
328
- function decodeSignedEnvelope(bytes) {
329
- if (bytes.length < 4 + SIGNATURE_BYTES) {
330
- throw new SigningError(`Envelope too short: ${bytes.length} bytes, need at least ${4 + SIGNATURE_BYTES}.`, "envelope-malformed");
331
- }
332
- const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
333
- const senderLen = view.getUint32(0, false);
334
- if (bytes.length < 4 + senderLen + SIGNATURE_BYTES) {
335
- throw new SigningError(`Envelope truncated: declared sender length ${senderLen}, total ${bytes.length}.`, "envelope-malformed");
336
- }
337
- const senderId = new TextDecoder().decode(bytes.subarray(4, 4 + senderLen));
338
- const signature = bytes.slice(4 + senderLen, 4 + senderLen + SIGNATURE_BYTES);
339
- const payload = bytes.slice(4 + senderLen + SIGNATURE_BYTES);
340
- return { senderId, payload, signature };
341
- }
342
107
 
343
108
  // src/shared/lib/pairing.ts
344
109
  var PAIRING_TOKEN_VERSION = 1;
@@ -354,32 +119,6 @@ class PairingError extends Error {
354
119
  this.code = code;
355
120
  }
356
121
  }
357
- function createPairingToken(options) {
358
- const now = options.now ? options.now() : Date.now();
359
- const ttlMs = options.ttlMs ?? DEFAULT_PAIRING_TTL_MS;
360
- const documentKey = options.documentKey ?? generateDocumentKey();
361
- const nonce = randomBytes(PAIRING_NONCE_BYTES);
362
- return {
363
- version: PAIRING_TOKEN_VERSION,
364
- issuerPeerId: options.issuerPeerId,
365
- issuerPublicKey: options.identity.publicKey,
366
- documentKey,
367
- documentKeyId: options.documentKeyId,
368
- expiresAt: now + ttlMs,
369
- nonce
370
- };
371
- }
372
- function createPairingTokenWithFreshIdentity(args) {
373
- const identity = generateSigningKeyPair();
374
- const token = createPairingToken({
375
- identity,
376
- issuerPeerId: args.issuerPeerId,
377
- documentKeyId: args.documentKeyId,
378
- ttlMs: args.ttlMs,
379
- now: args.now
380
- });
381
- return { identity, token };
382
- }
383
122
  function isPairingTokenExpired(token, now) {
384
123
  const t = now ? now() : Date.now();
385
124
  return t >= token.expiresAt;
@@ -391,36 +130,6 @@ function applyPairingToken(token, keyring, options = {}) {
391
130
  keyring.knownPeers.set(token.issuerPeerId, token.issuerPublicKey);
392
131
  keyring.documentKeys.set(token.documentKeyId, token.documentKey);
393
132
  }
394
- function serialisePairingToken(token) {
395
- validateForSerialisation(token);
396
- const issuerBytes = new TextEncoder().encode(token.issuerPeerId);
397
- const keyIdBytes = new TextEncoder().encode(token.documentKeyId);
398
- const total = PAIRING_TOKEN_MAGIC.length + 1 + 4 + issuerBytes.length + PUBLIC_KEY_BYTES + KEY_BYTES + 4 + keyIdBytes.length + 8 + PAIRING_NONCE_BYTES;
399
- const out = new Uint8Array(total);
400
- let offset = 0;
401
- out.set(PAIRING_TOKEN_MAGIC, offset);
402
- offset += PAIRING_TOKEN_MAGIC.length;
403
- out[offset] = token.version;
404
- offset += 1;
405
- const view = new DataView(out.buffer);
406
- view.setUint32(offset, issuerBytes.length, false);
407
- offset += 4;
408
- out.set(issuerBytes, offset);
409
- offset += issuerBytes.length;
410
- out.set(token.issuerPublicKey, offset);
411
- offset += PUBLIC_KEY_BYTES;
412
- out.set(token.documentKey, offset);
413
- offset += KEY_BYTES;
414
- view.setUint32(offset, keyIdBytes.length, false);
415
- offset += 4;
416
- out.set(keyIdBytes, offset);
417
- offset += keyIdBytes.length;
418
- view.setBigUint64(offset, BigInt(token.expiresAt), false);
419
- offset += 8;
420
- out.set(token.nonce, offset);
421
- offset += PAIRING_NONCE_BYTES;
422
- return out;
423
- }
424
133
  function parsePairingToken(bytes) {
425
134
  let offset = 0;
426
135
  if (bytes.length < PAIRING_TOKEN_MAGIC.length) {
@@ -492,14 +201,6 @@ function parsePairingToken(bytes) {
492
201
  nonce
493
202
  };
494
203
  }
495
- function encodePairingToken(token) {
496
- const bytes = serialisePairingToken(token);
497
- let binary = "";
498
- for (const byte of bytes) {
499
- binary += String.fromCharCode(byte);
500
- }
501
- return btoa(binary);
502
- }
503
204
  function decodePairingToken(encoded) {
504
205
  let binary;
505
206
  try {
@@ -513,22 +214,6 @@ function decodePairingToken(encoded) {
513
214
  }
514
215
  return parsePairingToken(bytes);
515
216
  }
516
- function validateForSerialisation(token) {
517
- if (token.issuerPublicKey.length !== PUBLIC_KEY_BYTES) {
518
- throw new PairingError(`Issuer public key must be ${PUBLIC_KEY_BYTES} bytes, got ${token.issuerPublicKey.length}.`, "invalid-public-key");
519
- }
520
- if (token.documentKey.length !== KEY_BYTES) {
521
- throw new PairingError(`Document key must be ${KEY_BYTES} bytes, got ${token.documentKey.length}.`, "invalid-document-key");
522
- }
523
- if (token.nonce.length !== PAIRING_NONCE_BYTES) {
524
- throw new PairingError(`Nonce must be ${PAIRING_NONCE_BYTES} bytes, got ${token.nonce.length}.`, "invalid-nonce");
525
- }
526
- }
527
- function randomBytes(n) {
528
- const out = new Uint8Array(n);
529
- crypto.getRandomValues(out);
530
- return out;
531
- }
532
217
 
533
218
  // src/mesh-node.ts
534
219
  function fileKeyringStorage(path) {
@@ -616,4 +301,4 @@ export {
616
301
  bootstrapCliKeyring
617
302
  };
618
303
 
619
- //# debugId=79E90F8B0F70449064756E2164756E21
304
+ //# debugId=0A5AD0E0D639B22564756E2164756E21
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/shared/lib/encryption.ts", "../src/mesh-node.ts", "../src/shared/lib/keyring-storage.ts", "../src/shared/lib/pairing.ts", "../src/shared/lib/signing.ts"],
3
+ "sources": ["../../src/mesh-node.ts", "../../src/shared/lib/keyring-storage.ts", "../../src/shared/lib/encryption.ts", "../../src/shared/lib/signing.ts", "../../src/shared/lib/pairing.ts"],
4
4
  "sourcesContent": [
5
- "/**\n * encryption — symmetric authenticated encryption for Polly's $meshState\n * primitive (Phase 2). Wraps tweetnacl's secretbox (XSalsa20-Poly1305) with\n * a small Polly-flavoured API so the rest of the codebase never imports\n * tweetnacl directly.\n *\n * Every $meshState document has a per-document symmetric key that is\n * provisioned to authorised peers at pairing time and never held by any\n * server. Outgoing operations are encrypted under this key before they\n * touch the network adapter; incoming operations are decrypted on receipt.\n * The signing layer in {@link signing.ts} provides authenticity (proof of\n * who sent the message); this layer provides confidentiality (the bytes\n * are unreadable to anything that does not hold the document key).\n *\n * tweetnacl's secretbox uses a 32-byte symmetric key and a 24-byte nonce.\n * The output of `nacl.secretbox` is the ciphertext concatenated with a\n * 16-byte Poly1305 authentication tag. We package the nonce + ciphertext\n * into a single binary blob using a small length-prefixed envelope so the\n * receiver can recover the nonce without out-of-band coordination.\n *\n * - {@link generateDocumentKey} returns a fresh 32-byte symmetric key.\n *\n * - {@link encrypt} produces a sealed blob from a payload and a key.\n *\n * - {@link decrypt} recovers the payload from a sealed blob and a key.\n * Returns undefined if the blob is malformed or the authentication\n * tag does not match (i.e. wrong key or tampered ciphertext) — the\n * undefined signal lets call sites distinguish \"wrong key\" from\n * \"structurally invalid\" without throwing.\n *\n * - {@link sealEnvelope} and {@link openEnvelope} are convenience helpers\n * that wrap encrypt/decrypt in a structured EncryptedEnvelope shape so\n * the mesh transport layer can handle the binary plumbing uniformly.\n */\n\nimport nacl from \"tweetnacl\";\n\n/** Length in bytes of a secretbox symmetric key. */\nexport const KEY_BYTES = 32;\n/** Length in bytes of a secretbox nonce. */\nexport const NONCE_BYTES = 24;\n/** Length in bytes of the Poly1305 authentication tag. */\nexport const TAG_BYTES = 16;\n\n/**\n * A sealed blob suitable for storage or network transmission. The wire\n * layout is the concatenation of the nonce and the ciphertext+tag from\n * tweetnacl. Callers should not depend on the exact bytes — round-trip\n * through {@link encrypt} / {@link decrypt} or the envelope helpers.\n */\nexport type SealedBytes = Uint8Array;\n\n/** Errors thrown by the encryption subsystem. */\nexport class EncryptionError extends Error {\n readonly code: \"invalid-key-length\" | \"decrypt-failed\" | \"envelope-malformed\";\n constructor(message: string, code: EncryptionError[\"code\"]) {\n super(message);\n this.name = \"EncryptionError\";\n this.code = code;\n }\n}\n\n/**\n * Generate a fresh 32-byte symmetric document key. Calls into tweetnacl's\n * CSPRNG.\n */\nexport function generateDocumentKey(): Uint8Array {\n return nacl.randomBytes(KEY_BYTES);\n}\n\n/**\n * Encrypt a payload under a symmetric key. The returned blob includes a\n * fresh nonce so the receiver does not need any out-of-band coordination\n * to decrypt.\n */\nexport function encrypt(payload: Uint8Array, key: Uint8Array): SealedBytes {\n if (key.length !== KEY_BYTES) {\n throw new EncryptionError(\n `secretbox key must be ${KEY_BYTES} bytes, got ${key.length}.`,\n \"invalid-key-length\"\n );\n }\n const nonce = nacl.randomBytes(NONCE_BYTES);\n const ciphertext = nacl.secretbox(payload, nonce, key);\n const out = new Uint8Array(NONCE_BYTES + ciphertext.length);\n out.set(nonce, 0);\n out.set(ciphertext, NONCE_BYTES);\n return out;\n}\n\n/**\n * Decrypt a sealed blob under a symmetric key. Returns the original\n * payload on success. Returns undefined if the blob is too short to\n * contain a nonce and tag, or if the authentication tag does not match\n * (which indicates either a wrong key or a tampered ciphertext).\n *\n * The undefined return is deliberate: call sites typically want to fall\n * back to a different key or surface a \"could not decrypt\" message rather\n * than catching an exception. Use {@link decryptOrThrow} when an exception\n * is preferred.\n */\nexport function decrypt(sealed: SealedBytes, key: Uint8Array): Uint8Array | undefined {\n if (key.length !== KEY_BYTES) {\n throw new EncryptionError(\n `secretbox key must be ${KEY_BYTES} bytes, got ${key.length}.`,\n \"invalid-key-length\"\n );\n }\n if (sealed.length < NONCE_BYTES + TAG_BYTES) {\n return undefined;\n }\n const nonce = sealed.subarray(0, NONCE_BYTES);\n const ciphertext = sealed.subarray(NONCE_BYTES);\n const opened = nacl.secretbox.open(ciphertext, nonce, key);\n return opened ?? undefined;\n}\n\n/**\n * Decrypt a sealed blob, throwing {@link EncryptionError} on failure\n * instead of returning undefined.\n */\nexport function decryptOrThrow(sealed: SealedBytes, key: Uint8Array): Uint8Array {\n const opened = decrypt(sealed, key);\n if (!opened) {\n throw new EncryptionError(\n `Failed to decrypt sealed blob: wrong key, malformed input, or tampered ciphertext.`,\n \"decrypt-failed\"\n );\n }\n return opened;\n}\n\n/**\n * A high-level structured envelope combining encryption with a small\n * amount of metadata the receiver needs to find the right key. The mesh\n * network adapter uses this shape on the wire.\n */\nexport interface EncryptedEnvelope {\n /** Stable identifier for the document this payload belongs to. The\n * receiver looks this up in its local key store to find the right key. */\n documentId: string;\n /** Sealed blob containing the encrypted payload plus its nonce. */\n sealed: SealedBytes;\n}\n\n/**\n * Encrypt a payload and pack it into an {@link EncryptedEnvelope} along\n * with the document id.\n */\nexport function sealEnvelope(\n payload: Uint8Array,\n documentId: string,\n key: Uint8Array\n): EncryptedEnvelope {\n return {\n documentId,\n sealed: encrypt(payload, key),\n };\n}\n\n/**\n * Decrypt an {@link EncryptedEnvelope} using the given key. Throws on\n * failure for symmetry with {@link sealEnvelope}.\n */\nexport function openEnvelope(envelope: EncryptedEnvelope, key: Uint8Array): Uint8Array {\n return decryptOrThrow(envelope.sealed, key);\n}\n\n/**\n * Serialise an {@link EncryptedEnvelope} to a single binary blob.\n *\n * Wire format:\n *\n * [4 bytes BE: documentId byte length]\n * [N bytes: documentId UTF-8]\n * [remaining: sealed blob (nonce + ciphertext + tag)]\n */\nexport function encodeEncryptedEnvelope(envelope: EncryptedEnvelope): Uint8Array {\n const idBytes = new TextEncoder().encode(envelope.documentId);\n const out = new Uint8Array(4 + idBytes.length + envelope.sealed.length);\n const view = new DataView(out.buffer);\n view.setUint32(0, idBytes.length, false);\n out.set(idBytes, 4);\n out.set(envelope.sealed, 4 + idBytes.length);\n return out;\n}\n\n/**\n * Deserialise a binary envelope produced by {@link encodeEncryptedEnvelope}.\n * Throws on malformed input.\n */\nexport function decodeEncryptedEnvelope(bytes: Uint8Array): EncryptedEnvelope {\n if (bytes.length < 4) {\n throw new EncryptionError(\n `Encrypted envelope too short: ${bytes.length} bytes.`,\n \"envelope-malformed\"\n );\n }\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n const idLen = view.getUint32(0, false);\n if (bytes.length < 4 + idLen) {\n throw new EncryptionError(\n `Encrypted envelope truncated: declared id length ${idLen}, total ${bytes.length}.`,\n \"envelope-malformed\"\n );\n }\n const documentId = new TextDecoder().decode(bytes.subarray(4, 4 + idLen));\n const sealed = bytes.slice(4 + idLen);\n return { documentId, sealed };\n}\n",
6
5
  "/**\n * @fairfox/polly/mesh/node — Node/Bun conveniences for mesh state.\n *\n * The core mesh API (`createMeshClient`, `$meshState`, the keyring storage\n * interface) is runtime-agnostic and ships from `@fairfox/polly/mesh`. This\n * module adds the Node-specific wiring that makes CLIs, cron jobs, and\n * always-on bridges first-class peers on the mesh:\n *\n * - {@link fileKeyringStorage} — durable, human-inspectable keyring store\n * backed by `node:fs`. Atomic writes, missing-file returns `null`.\n * - {@link bootstrapCliKeyring} — wraps {@link fileKeyringStorage} with the\n * first-run pairing UX described in the RFC: generate an identity if\n * no keyring exists, print the public-key fingerprint, read a pairing\n * token from stdin, apply it, and save.\n * - {@link readPairingTokenFromStdin} — low-level prompt helper for\n * consumers that want to compose their own bootstrap.\n *\n * What this module deliberately does **not** do: pick a Node WebRTC\n * implementation. `werift` (pure TypeScript, installs everywhere) and\n * `@roamhq/wrtc` (C++ binding, faster DataChannel, platform-dependent\n * binaries) are both valid choices; the consumer `bun add`s whichever fits\n * their deployment and passes the class into `createMeshClient({ rtc })`.\n *\n * @example\n * ```ts\n * import { createMeshClient } from \"@fairfox/polly/mesh\";\n * import { bootstrapCliKeyring, fileKeyringStorage } from \"@fairfox/polly/mesh/node\";\n * import { RTCPeerConnection } from \"werift\";\n *\n * const storage = fileKeyringStorage(\"./keyring.json\");\n * const keyring = await bootstrapCliKeyring({ storage });\n *\n * const client = await createMeshClient({\n * signaling: { url: \"wss://example.com/polly/signaling\", peerId: \"cli-a1b2\" },\n * rtc: { RTCPeerConnection },\n * keyring,\n * });\n * ```\n */\n\nimport { readFile, rename, writeFile } from \"node:fs/promises\";\nimport { createInterface } from \"node:readline/promises\";\nimport {\n deserialiseKeyring,\n type KeyringStorage,\n serialiseKeyring,\n} from \"./shared/lib/keyring-storage\";\nimport type { MeshKeyring } from \"./shared/lib/mesh-network-adapter\";\nimport { applyPairingToken, decodePairingToken } from \"./shared/lib/pairing\";\nimport { generateSigningKeyPair } from \"./shared/lib/signing\";\n\n// Re-export runtime-agnostic pieces so a Node consumer only needs one\n// import site.\nexport type { KeyringStorage } from \"./shared/lib/keyring-storage\";\nexport {\n deserialiseKeyring,\n memoryKeyringStorage,\n serialiseKeyring,\n} from \"./shared/lib/keyring-storage\";\n\n/**\n * Filesystem-backed keyring storage. Reads and writes the serialised\n * keyring at {@link path} using the canonical JSON+base64 format. The save\n * path uses a write-to-tmp-then-rename dance so concurrent readers never\n * observe a half-written file; a crash mid-write leaves the previous\n * keyring intact.\n */\nexport function fileKeyringStorage(path: string): KeyringStorage {\n return {\n load: async () => {\n try {\n const text = await readFile(path, \"utf-8\");\n return deserialiseKeyring(text);\n } catch (err) {\n if (isFileNotFound(err)) return null;\n throw err;\n }\n },\n save: async (keyring) => {\n const text = serialiseKeyring(keyring);\n const tmp = `${path}.tmp-${process.pid}-${Date.now()}`;\n await writeFile(tmp, text, { mode: 0o600 });\n await rename(tmp, path);\n },\n };\n}\n\n/** Options for {@link bootstrapCliKeyring}. */\nexport interface BootstrapCliKeyringOptions {\n /** Where to persist the keyring. On subsequent runs this file is loaded\n * and returned without prompting. */\n storage: KeyringStorage;\n /** Stream to print pairing prompts to. Defaults to `process.stderr` so\n * pipelines that consume stdout are not polluted. */\n promptStream?: NodeJS.WritableStream;\n /** Stream to read the pairing token from. Defaults to `process.stdin`. */\n inputStream?: NodeJS.ReadableStream;\n /** Override the clock (for tests). Forwarded to {@link applyPairingToken}. */\n now?: () => number;\n}\n\n/**\n * First-run-or-return flow for Node CLIs.\n *\n * - If the storage has a keyring saved, load and return it.\n * - Otherwise: generate a fresh Ed25519 identity, print the public-key\n * fingerprint to `promptStream`, read one line from `inputStream`\n * (expected to be a base64 pairing token), apply it, save, return.\n *\n * Token *issuance* is deliberately out of scope for this helper — the\n * expected UX is that a trusted device (a browser on the authorising\n * user's laptop) mints the token and the user pastes it into the CLI's\n * stdin. Node processes that need to issue tokens can use\n * {@link createPairingToken} from the main mesh export.\n */\nexport async function bootstrapCliKeyring(\n options: BootstrapCliKeyringOptions\n): Promise<MeshKeyring> {\n const existing = await options.storage.load();\n if (existing !== null) return existing;\n\n const identity = generateSigningKeyPair();\n const keyring: MeshKeyring = {\n identity,\n knownPeers: new Map(),\n documentKeys: new Map(),\n revokedPeers: new Set(),\n };\n\n const promptStream = options.promptStream ?? process.stderr;\n const fingerprint = fingerprintPublicKey(identity.publicKey);\n promptStream.write(\n [\n \"\",\n \"Polly mesh-state CLI bootstrap\",\n \"──────────────────────────────\",\n `Fingerprint: ${fingerprint}`,\n \"\",\n \"Authorise this peer on a trusted device (open the pairing UI, enter\",\n \"the fingerprint above, copy the generated token). Then paste the\",\n \"pairing token below and press enter.\",\n \"\",\n ].join(\"\\n\")\n );\n\n const token = await readPairingTokenFromStdin({\n promptStream,\n inputStream: options.inputStream ?? process.stdin,\n });\n\n const applyOptions = options.now ? { now: options.now } : {};\n applyPairingToken(token, keyring, applyOptions);\n\n await options.storage.save(keyring);\n promptStream.write(`Pairing applied. Keyring saved.\\n`);\n return keyring;\n}\n\n/**\n * Prompt for and read a pairing token from a readable stream (stdin by\n * default). Returns the decoded, validated token. Throws\n * {@link PairingError} on malformed input — callers should surface that\n * message to the user and retry.\n */\nexport async function readPairingTokenFromStdin(\n options: { promptStream?: NodeJS.WritableStream; inputStream?: NodeJS.ReadableStream } = {}\n) {\n const rl = createInterface({\n input: options.inputStream ?? process.stdin,\n output: options.promptStream ?? process.stderr,\n });\n try {\n const line = await rl.question(\"pairing-token> \");\n return decodePairingToken(line.trim());\n } finally {\n rl.close();\n }\n}\n\n/** Short, human-readable fingerprint of a public key. */\nfunction fingerprintPublicKey(publicKey: Uint8Array): string {\n // First 8 bytes, hex-encoded, colon-grouped — familiar from SSH.\n const slice = publicKey.slice(0, 8);\n const hex = Array.from(slice)\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n return hex.match(/.{2}/g)?.join(\":\") ?? hex;\n}\n\nfunction isFileNotFound(err: unknown): boolean {\n return typeof err === \"object\" && err !== null && \"code\" in err && err.code === \"ENOENT\";\n}\n",
7
6
  "/**\n * keyring-storage — persistence abstraction for {@link MeshKeyring}.\n *\n * The keyring itself is a plain structural object of `Map`s, `Set`s, and a\n * signing keypair; it is deliberately not coupled to any persistence layer.\n * This module defines a storage interface that applications implement once\n * for their runtime (IndexedDB, the filesystem, a keychain, a secret\n * manager, whatever) and wire into {@link createMeshClient} via its\n * `keyring.storage` option.\n *\n * A canonical JSON-with-base64 serialisation is provided by\n * {@link serialiseKeyring} and {@link deserialiseKeyring}. It is inspectable\n * by humans, survives manual edits, and round-trips every field of the\n * keyring. Storage implementations that write plain strings (files,\n * localStorage, `kv` stores) can lean on these helpers; storage\n * implementations that persist structured data (IndexedDB, a keychain API)\n * can serialise differently if they prefer.\n */\n\nimport type { MeshKeyring } from \"./mesh-network-adapter\";\nimport type { SigningKeyPair } from \"./signing\";\n\n/**\n * A load/save pair for a single {@link MeshKeyring}. Implementations are\n * free to choose where and how the keyring is stored; the factory only\n * cares that `load()` returns the previously-saved keyring or `null`, and\n * that `save(keyring)` durably persists it.\n */\nexport interface KeyringStorage {\n /** Load the previously-saved keyring, or return `null` if none exists.\n * Implementations may throw for truly exceptional conditions (disk\n * errors, permission failures); a missing keyring is not exceptional. */\n load(): Promise<MeshKeyring | null>;\n /** Durably persist the keyring. Implementations should atomically replace\n * any existing stored value; partial writes must not leave the store in\n * an inconsistent state. */\n save(keyring: MeshKeyring): Promise<void>;\n}\n\n/**\n * In-memory storage. Useful for tests, ephemeral tools, and the first-run\n * bootstrap path where the keyring only lives for the duration of the\n * process. Calling `save` holds the keyring in a closed-over variable;\n * `load` returns it on subsequent calls within the same process.\n */\nexport function memoryKeyringStorage(): KeyringStorage {\n let stored: MeshKeyring | null = null;\n return {\n load: async () => stored,\n save: async (keyring) => {\n stored = keyring;\n },\n };\n}\n\n// ─── Canonical JSON+base64 serialisation ───────────────────────────────────\n\ninterface SerialisedKeyring {\n version: 1;\n identity: { publicKey: string; secretKey: string };\n knownPeers: Record<string, string>;\n documentKeys: Record<string, string>;\n revokedPeers: string[];\n revocationAuthority?: string[];\n}\n\n/**\n * Encode a {@link MeshKeyring} to a canonical JSON string. Every\n * `Uint8Array` field (identity keys, public keys, document keys) is\n * base64-encoded; `Map`s and `Set`s become plain objects and arrays. The\n * output is pretty-printed so a human operator can eyeball or hand-edit\n * the file on disk.\n */\nexport function serialiseKeyring(keyring: MeshKeyring): string {\n const payload: SerialisedKeyring = {\n version: 1,\n identity: {\n publicKey: bytesToBase64(keyring.identity.publicKey),\n secretKey: bytesToBase64(keyring.identity.secretKey),\n },\n knownPeers: mapToBase64Record(keyring.knownPeers),\n documentKeys: mapToBase64Record(keyring.documentKeys),\n revokedPeers: [...keyring.revokedPeers],\n };\n if (keyring.revocationAuthority && keyring.revocationAuthority.size > 0) {\n payload.revocationAuthority = [...keyring.revocationAuthority];\n }\n return JSON.stringify(payload, null, 2);\n}\n\n/**\n * Decode a keyring from the format produced by {@link serialiseKeyring}.\n * Throws with a descriptive message when the input is malformed, so\n * corrupt storage surfaces as an actionable error rather than a silent\n * downgrade.\n */\nexport function deserialiseKeyring(text: string): MeshKeyring {\n let raw: unknown;\n try {\n raw = JSON.parse(text);\n } catch (err) {\n throw new Error(`KeyringStorage: keyring payload is not valid JSON: ${(err as Error).message}`);\n }\n if (!raw || typeof raw !== \"object\") {\n throw new Error(\"KeyringStorage: keyring payload is not an object\");\n }\n const r = raw as Partial<SerialisedKeyring>;\n if (r.version !== 1) {\n throw new Error(`KeyringStorage: unsupported keyring version: ${String(r.version)}`);\n }\n if (!r.identity || typeof r.identity !== \"object\") {\n throw new Error(\"KeyringStorage: keyring payload is missing identity\");\n }\n const identity: SigningKeyPair = {\n publicKey: base64ToBytes(r.identity.publicKey),\n secretKey: base64ToBytes(r.identity.secretKey),\n };\n const keyring: MeshKeyring = {\n identity,\n knownPeers: base64RecordToMap(r.knownPeers ?? {}),\n documentKeys: base64RecordToMap(r.documentKeys ?? {}),\n revokedPeers: new Set(r.revokedPeers ?? []),\n };\n if (r.revocationAuthority && r.revocationAuthority.length > 0) {\n keyring.revocationAuthority = new Set(r.revocationAuthority);\n }\n return keyring;\n}\n\nfunction mapToBase64Record(map: Map<string, Uint8Array>): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [key, value] of map) {\n out[key] = bytesToBase64(value);\n }\n return out;\n}\n\nfunction base64RecordToMap(record: Record<string, string>): Map<string, Uint8Array> {\n const out = new Map<string, Uint8Array>();\n for (const [key, value] of Object.entries(record)) {\n out.set(key, base64ToBytes(value));\n }\n return out;\n}\n\nfunction bytesToBase64(bytes: Uint8Array): string {\n // btoa is available in browsers, Node 16+, and Bun.\n let binary = \"\";\n for (const byte of bytes) {\n binary += String.fromCharCode(byte);\n }\n return btoa(binary);\n}\n\nfunction base64ToBytes(b64: string): Uint8Array {\n const binary = atob(b64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n",
8
- "/**\n * pairing — Phase 2 first-cut pairing flow for $meshState.\n *\n * Two devices that want to share a $meshState document must exchange three\n * things before sync can begin: the issuer's Ed25519 signing public key\n * (so the receiver can verify ops authored by the issuer), the symmetric\n * document encryption key (so both sides can encrypt and decrypt the\n * shared document), and the issuer's stable peer id (so the receiver\n * knows which entry in its keyring the public key belongs to). This\n * module packs all three into a {@link PairingToken}, serialises it to a\n * compact binary format suitable for QR codes or copy-paste, and provides\n * the matching parse-and-apply flow on the receiving side.\n *\n * Threat model: pairing tokens are transmitted over an out-of-band channel\n * that the user can authenticate visually — typically a QR code on the\n * issuer's device, scanned by the receiver. Because anyone with the token\n * can decrypt and impersonate, the OOB channel is the only authentication.\n * The token includes a TTL (default 10 minutes) so that a token displayed\n * briefly and then dismissed cannot be replayed by an attacker who later\n * gains access to a screenshot. A production deployment would layer a\n * Short Authentication String (SAS) on top — both devices display a code\n * derived from the shared state, and the user verifies they match — but\n * that is a follow-up.\n *\n * The pairing flow is one-way in the Phase 2 first cut. The issuer\n * generates a token and displays it; the receiver applies it and picks\n * up the issuer's keys. The receiver's own keys reach the issuer through\n * the access set: when the receiver sends its first signed op, the issuer\n * records the receiver's public key alongside its peer id and adds it to\n * the keyring. A bidirectional pairing flow that exchanges both sides'\n * keys in a single QR exchange is straightforward to add later but adds\n * UX surface area that is not needed for the mesh transport to work.\n */\n\nimport { KEY_BYTES as ENCRYPTION_KEY_BYTES, generateDocumentKey } from \"./encryption\";\nimport type { MeshKeyring } from \"./mesh-network-adapter\";\nimport {\n generateSigningKeyPair,\n PUBLIC_KEY_BYTES as SIGNING_PUBLIC_KEY_BYTES,\n type SigningKeyPair,\n} from \"./signing\";\n\n/** Current pairing-token format version. Bumped if the wire format changes. */\nexport const PAIRING_TOKEN_VERSION = 1;\n\n/** Magic header bytes for sanity-checking parsed tokens. ASCII \"PPT1\". */\nexport const PAIRING_TOKEN_MAGIC = new Uint8Array([0x50, 0x50, 0x54, 0x31]);\n\n/** Length of the random nonce embedded in every token. */\nexport const PAIRING_NONCE_BYTES = 16;\n\n/** Default TTL applied when {@link createPairingToken} is called without an\n * explicit `ttlMs` option. */\nexport const DEFAULT_PAIRING_TTL_MS = 10 * 60 * 1000; // 10 minutes\n\n/**\n * The contents of a pairing token. Both sides operate on this shape; the\n * binary serialisation is purely for transport.\n */\nexport interface PairingToken {\n /** Format version. {@link PAIRING_TOKEN_VERSION} at the time of writing. */\n version: number;\n /** Stable peer id of the issuing device. The receiver records this as\n * the lookup key for the issuer's public key in its keyring. */\n issuerPeerId: string;\n /** Issuer's Ed25519 signing public key (32 bytes). */\n issuerPublicKey: Uint8Array;\n /** Shared document encryption key (32 bytes). The receiver stores this\n * under {@link documentKeyId} in its keyring. */\n documentKey: Uint8Array;\n /** Identifier under which the receiver stores the document key. For the\n * Phase 2 first cut this is typically the well-known DEFAULT_MESH_KEY_ID\n * from mesh-network-adapter; per-document keys (one entry per Automerge\n * document) are a follow-up. */\n documentKeyId: string;\n /** Unix timestamp (milliseconds) after which the token is considered\n * expired and {@link applyPairingToken} refuses to use it. */\n expiresAt: number;\n /** 16-byte random nonce. Carried through serialisation so two tokens\n * with otherwise-identical contents are still distinguishable. */\n nonce: Uint8Array;\n}\n\n/** Errors thrown by the pairing subsystem. */\nexport class PairingError extends Error {\n readonly code:\n | \"expired\"\n | \"wrong-magic\"\n | \"unknown-version\"\n | \"truncated\"\n | \"invalid-public-key\"\n | \"invalid-document-key\"\n | \"invalid-nonce\";\n\n constructor(message: string, code: PairingError[\"code\"]) {\n super(message);\n this.name = \"PairingError\";\n this.code = code;\n }\n}\n\n/**\n * Options for {@link createPairingToken}. The signing identity and the\n * document key are required; everything else is optional with sensible\n * defaults.\n */\nexport interface CreatePairingTokenOptions {\n /** The issuing device's signing keypair. Only the public key ends up in\n * the token; the secret never leaves the issuer. */\n identity: SigningKeyPair;\n /** Stable peer id for the issuing device. */\n issuerPeerId: string;\n /** The symmetric document key the receiver should adopt. If omitted, a\n * fresh key is generated and the caller is responsible for using the\n * same key on the issuing side too. */\n documentKey?: Uint8Array;\n /** Identifier under which the receiver stores the document key. */\n documentKeyId: string;\n /** Time-to-live in milliseconds. Defaults to {@link DEFAULT_PAIRING_TTL_MS}. */\n ttlMs?: number;\n /** Override the current time. Intended for tests; production code should\n * not pass this. */\n now?: () => number;\n}\n\n/**\n * Generate a fresh {@link PairingToken}. The token is ready to be\n * serialised and displayed to the receiver via an OOB channel.\n */\nexport function createPairingToken(options: CreatePairingTokenOptions): PairingToken {\n const now = options.now ? options.now() : Date.now();\n const ttlMs = options.ttlMs ?? DEFAULT_PAIRING_TTL_MS;\n const documentKey = options.documentKey ?? generateDocumentKey();\n const nonce = randomBytes(PAIRING_NONCE_BYTES);\n\n return {\n version: PAIRING_TOKEN_VERSION,\n issuerPeerId: options.issuerPeerId,\n issuerPublicKey: options.identity.publicKey,\n documentKey,\n documentKeyId: options.documentKeyId,\n expiresAt: now + ttlMs,\n nonce,\n };\n}\n\n/**\n * Generate a fresh pairing token *and* a fresh signing keypair in one call.\n * Convenience for first-time setup where the device has no existing\n * identity yet. Returns both so the caller can persist the keypair and\n * then display the token.\n */\nexport function createPairingTokenWithFreshIdentity(args: {\n issuerPeerId: string;\n documentKeyId: string;\n ttlMs?: number;\n now?: () => number;\n}): { identity: SigningKeyPair; token: PairingToken } {\n const identity = generateSigningKeyPair();\n const token = createPairingToken({\n identity,\n issuerPeerId: args.issuerPeerId,\n documentKeyId: args.documentKeyId,\n ttlMs: args.ttlMs,\n now: args.now,\n });\n return { identity, token };\n}\n\n/**\n * Check whether a token has expired against the current wall-clock time\n * (or an injected `now`).\n */\nexport function isPairingTokenExpired(token: PairingToken, now?: () => number): boolean {\n const t = now ? now() : Date.now();\n return t >= token.expiresAt;\n}\n\n/**\n * Apply a parsed and validated token to a {@link MeshKeyring}. Mutates the\n * keyring in place: adds the issuer's public key to {@link MeshKeyring.knownPeers}\n * and the document key to {@link MeshKeyring.documentKeys}.\n *\n * Throws {@link PairingError} with code \"expired\" if the token's TTL has\n * elapsed. The receiver is expected to apply the token promptly after\n * scanning; rejecting expired tokens prevents replay of long-lived\n * captures.\n */\nexport function applyPairingToken(\n token: PairingToken,\n keyring: MeshKeyring,\n options: { now?: () => number } = {}\n): void {\n if (isPairingTokenExpired(token, options.now)) {\n throw new PairingError(\n `Pairing token from ${token.issuerPeerId} expired at ${new Date(token.expiresAt).toISOString()}.`,\n \"expired\"\n );\n }\n keyring.knownPeers.set(token.issuerPeerId, token.issuerPublicKey);\n keyring.documentKeys.set(token.documentKeyId, token.documentKey);\n}\n\n// ─── binary serialisation ──────────────────────────────────────────────────\n\n/**\n * Serialise a token to a binary blob. The wire format is:\n *\n * [4 bytes: magic \"PPT1\"]\n * [1 byte: version]\n * [4 bytes BE: issuer id byte length]\n * [N bytes: issuer id UTF-8]\n * [32 bytes: issuer public key]\n * [32 bytes: document key]\n * [4 bytes BE: document key id byte length]\n * [M bytes: document key id UTF-8]\n * [8 bytes BE: expiresAt (uint64 milliseconds)]\n * [16 bytes: nonce]\n *\n * Use {@link encodePairingToken} to round-trip through a base64 string.\n */\nexport function serialisePairingToken(token: PairingToken): Uint8Array {\n validateForSerialisation(token);\n const issuerBytes = new TextEncoder().encode(token.issuerPeerId);\n const keyIdBytes = new TextEncoder().encode(token.documentKeyId);\n\n const total =\n PAIRING_TOKEN_MAGIC.length +\n 1 + // version\n 4 + // issuer id length\n issuerBytes.length +\n SIGNING_PUBLIC_KEY_BYTES +\n ENCRYPTION_KEY_BYTES +\n 4 + // doc key id length\n keyIdBytes.length +\n 8 + // expiresAt\n PAIRING_NONCE_BYTES;\n\n const out = new Uint8Array(total);\n let offset = 0;\n\n out.set(PAIRING_TOKEN_MAGIC, offset);\n offset += PAIRING_TOKEN_MAGIC.length;\n\n out[offset] = token.version;\n offset += 1;\n\n const view = new DataView(out.buffer);\n view.setUint32(offset, issuerBytes.length, false);\n offset += 4;\n out.set(issuerBytes, offset);\n offset += issuerBytes.length;\n\n out.set(token.issuerPublicKey, offset);\n offset += SIGNING_PUBLIC_KEY_BYTES;\n\n out.set(token.documentKey, offset);\n offset += ENCRYPTION_KEY_BYTES;\n\n view.setUint32(offset, keyIdBytes.length, false);\n offset += 4;\n out.set(keyIdBytes, offset);\n offset += keyIdBytes.length;\n\n // Write expiresAt as uint64 BE. JavaScript numbers are float64 but the\n // value is an integer count of milliseconds, well within 53-bit safe\n // range for any practical timestamp.\n view.setBigUint64(offset, BigInt(token.expiresAt), false);\n offset += 8;\n\n out.set(token.nonce, offset);\n offset += PAIRING_NONCE_BYTES;\n\n return out;\n}\n\n/**\n * Inverse of {@link serialisePairingToken}. Throws {@link PairingError} on\n * malformed input.\n */\nexport function parsePairingToken(bytes: Uint8Array): PairingToken {\n let offset = 0;\n\n // Magic\n if (bytes.length < PAIRING_TOKEN_MAGIC.length) {\n throw new PairingError(`Pairing token too short: ${bytes.length} bytes.`, \"truncated\");\n }\n for (let i = 0; i < PAIRING_TOKEN_MAGIC.length; i++) {\n if (bytes[offset + i] !== PAIRING_TOKEN_MAGIC[i]) {\n throw new PairingError(\n `Pairing token magic mismatch: not a Polly pairing token.`,\n \"wrong-magic\"\n );\n }\n }\n offset += PAIRING_TOKEN_MAGIC.length;\n\n // Version\n if (bytes.length < offset + 1) {\n throw new PairingError(\"Pairing token truncated at version.\", \"truncated\");\n }\n const version = bytes[offset] as unknown as number;\n offset += 1;\n if (version !== PAIRING_TOKEN_VERSION) {\n throw new PairingError(\n `Unknown pairing token version: ${version}. This Polly build supports version ${PAIRING_TOKEN_VERSION}.`,\n \"unknown-version\"\n );\n }\n\n // Issuer id\n if (bytes.length < offset + 4) {\n throw new PairingError(\"Pairing token truncated at issuer id length.\", \"truncated\");\n }\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n const issuerLen = view.getUint32(offset, false);\n offset += 4;\n if (bytes.length < offset + issuerLen) {\n throw new PairingError(\"Pairing token truncated at issuer id.\", \"truncated\");\n }\n const issuerPeerId = new TextDecoder().decode(bytes.subarray(offset, offset + issuerLen));\n offset += issuerLen;\n\n // Issuer public key\n if (bytes.length < offset + SIGNING_PUBLIC_KEY_BYTES) {\n throw new PairingError(\"Pairing token truncated at public key.\", \"truncated\");\n }\n const issuerPublicKey = bytes.slice(offset, offset + SIGNING_PUBLIC_KEY_BYTES);\n offset += SIGNING_PUBLIC_KEY_BYTES;\n\n // Document key\n if (bytes.length < offset + ENCRYPTION_KEY_BYTES) {\n throw new PairingError(\"Pairing token truncated at document key.\", \"truncated\");\n }\n const documentKey = bytes.slice(offset, offset + ENCRYPTION_KEY_BYTES);\n offset += ENCRYPTION_KEY_BYTES;\n\n // Document key id\n if (bytes.length < offset + 4) {\n throw new PairingError(\"Pairing token truncated at document key id length.\", \"truncated\");\n }\n const keyIdLen = view.getUint32(offset, false);\n offset += 4;\n if (bytes.length < offset + keyIdLen) {\n throw new PairingError(\"Pairing token truncated at document key id.\", \"truncated\");\n }\n const documentKeyId = new TextDecoder().decode(bytes.subarray(offset, offset + keyIdLen));\n offset += keyIdLen;\n\n // Expires at\n if (bytes.length < offset + 8) {\n throw new PairingError(\"Pairing token truncated at expiry.\", \"truncated\");\n }\n const expiresAtBig = view.getBigUint64(offset, false);\n offset += 8;\n const expiresAt = Number(expiresAtBig);\n\n // Nonce\n if (bytes.length < offset + PAIRING_NONCE_BYTES) {\n throw new PairingError(\"Pairing token truncated at nonce.\", \"truncated\");\n }\n const nonce = bytes.slice(offset, offset + PAIRING_NONCE_BYTES);\n offset += PAIRING_NONCE_BYTES;\n\n return {\n version,\n issuerPeerId,\n issuerPublicKey,\n documentKey,\n documentKeyId,\n expiresAt,\n nonce,\n };\n}\n\n/**\n * Serialise a token and base64-encode it for QR-code or copy-paste display.\n * The encoding uses the standard base64 alphabet (not URL-safe) because\n * QR codes encode bytes directly and do not care about URL safety.\n */\nexport function encodePairingToken(token: PairingToken): string {\n const bytes = serialisePairingToken(token);\n // btoa expects a binary string. Convert via String.fromCharCode per byte;\n // safe for the ~150-byte token size and avoids the spread-into-fromCharCode\n // pattern that runs into argument-count limits on large arrays.\n let binary = \"\";\n for (const byte of bytes) {\n binary += String.fromCharCode(byte);\n }\n return btoa(binary);\n}\n\n/**\n * Decode a base64-encoded pairing token produced by {@link encodePairingToken}.\n * Throws {@link PairingError} on malformed input.\n */\nexport function decodePairingToken(encoded: string): PairingToken {\n let binary: string;\n try {\n binary = atob(encoded);\n } catch {\n throw new PairingError(\"Pairing token is not valid base64.\", \"wrong-magic\");\n }\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return parsePairingToken(bytes);\n}\n\n// ─── helpers ───────────────────────────────────────────────────────────────\n\nfunction validateForSerialisation(token: PairingToken): void {\n if (token.issuerPublicKey.length !== SIGNING_PUBLIC_KEY_BYTES) {\n throw new PairingError(\n `Issuer public key must be ${SIGNING_PUBLIC_KEY_BYTES} bytes, got ${token.issuerPublicKey.length}.`,\n \"invalid-public-key\"\n );\n }\n if (token.documentKey.length !== ENCRYPTION_KEY_BYTES) {\n throw new PairingError(\n `Document key must be ${ENCRYPTION_KEY_BYTES} bytes, got ${token.documentKey.length}.`,\n \"invalid-document-key\"\n );\n }\n if (token.nonce.length !== PAIRING_NONCE_BYTES) {\n throw new PairingError(\n `Nonce must be ${PAIRING_NONCE_BYTES} bytes, got ${token.nonce.length}.`,\n \"invalid-nonce\"\n );\n }\n}\n\nfunction randomBytes(n: number): Uint8Array {\n const out = new Uint8Array(n);\n crypto.getRandomValues(out);\n return out;\n}\n",
9
- "/**\n * signing — Ed25519 signing and verification for Polly's $meshState\n * primitive (Phase 2). Wraps tweetnacl with a small Polly-flavoured API\n * so the rest of the codebase never imports tweetnacl directly.\n *\n * Every operation that flows through a $meshState transport is signed by\n * the originating peer's private key before transmission and verified by\n * every receiving peer against a known public-key set before being applied.\n * This is the Byzantine-tolerance mechanism: a peer whose private key is\n * compromised can be revoked through a further signed operation, after\n * which honest peers reject anything signed by the revoked key.\n *\n * tweetnacl uses the Ed25519 curve. Public keys and signatures are 32 and\n * 64 bytes respectively, which keeps the per-op overhead small enough that\n * signing every Automerge sync message is feasible even on mobile.\n *\n * The shape of the wrapper:\n *\n * - {@link generateSigningKeyPair} produces a new Ed25519 keypair. The\n * private key never leaves the device that generated it; the public\n * key is gossiped through the access set.\n *\n * - {@link sign} produces a 64-byte detached signature over a payload.\n *\n * - {@link verify} checks a payload against a signature and a public\n * key. Returns boolean rather than throwing so call sites can handle\n * verification failure as a normal control-flow case.\n *\n * - {@link signEnvelope} and {@link openEnvelope} package payload + sender\n * id + signature into a single binary envelope, which is what the mesh\n * network adapter actually puts on the wire.\n */\n\nimport nacl from \"tweetnacl\";\n\n/** Length in bytes of an Ed25519 public key. */\nexport const PUBLIC_KEY_BYTES = 32;\n/** Length in bytes of an Ed25519 secret (private) key. */\nexport const SECRET_KEY_BYTES = 64;\n/** Length in bytes of an Ed25519 detached signature. */\nexport const SIGNATURE_BYTES = 64;\n\n/**\n * An Ed25519 keypair. The {@link publicKey} is safe to share with peers;\n * the {@link secretKey} must never leave the device.\n */\nexport interface SigningKeyPair {\n publicKey: Uint8Array;\n secretKey: Uint8Array;\n}\n\n/**\n * A signed envelope. The wire format is the concatenation of the sender id\n * length, the sender id bytes, the signature, and the payload. Callers\n * shouldn't rely on the exact layout — use {@link signEnvelope} and\n * {@link openEnvelope} to round-trip.\n */\nexport interface SignedEnvelope {\n /** Stable sender peer identifier (UTF-8 string). The receiving side uses\n * this to look up the sender's public key in the document's access set. */\n senderId: string;\n /** The original payload bytes, untouched. */\n payload: Uint8Array;\n /** 64-byte Ed25519 signature over the payload. */\n signature: Uint8Array;\n}\n\n/** Errors thrown by the signing subsystem. */\nexport class SigningError extends Error {\n readonly code:\n | \"invalid-secret-key\"\n | \"invalid-public-key\"\n | \"invalid-signature-length\"\n | \"envelope-malformed\";\n\n constructor(message: string, code: SigningError[\"code\"]) {\n super(message);\n this.name = \"SigningError\";\n this.code = code;\n }\n}\n\n/**\n * Generate a fresh Ed25519 keypair. Calls into tweetnacl's CSPRNG.\n */\nexport function generateSigningKeyPair(): SigningKeyPair {\n const pair = nacl.sign.keyPair();\n return {\n publicKey: pair.publicKey,\n secretKey: pair.secretKey,\n };\n}\n\n/**\n * Reconstruct a keypair from an existing 64-byte secret key. Useful for\n * loading keys from persistent storage. Throws if the key is the wrong size.\n */\nexport function signingKeyPairFromSecret(secretKey: Uint8Array): SigningKeyPair {\n if (secretKey.length !== SECRET_KEY_BYTES) {\n throw new SigningError(\n `Ed25519 secret key must be ${SECRET_KEY_BYTES} bytes, got ${secretKey.length}.`,\n \"invalid-secret-key\"\n );\n }\n const pair = nacl.sign.keyPair.fromSecretKey(secretKey);\n return {\n publicKey: pair.publicKey,\n secretKey: pair.secretKey,\n };\n}\n\n/**\n * Produce a 64-byte detached signature over the given payload using the\n * supplied secret key.\n */\nexport function sign(payload: Uint8Array, secretKey: Uint8Array): Uint8Array {\n if (secretKey.length !== SECRET_KEY_BYTES) {\n throw new SigningError(\n `Ed25519 secret key must be ${SECRET_KEY_BYTES} bytes, got ${secretKey.length}.`,\n \"invalid-secret-key\"\n );\n }\n return nacl.sign.detached(payload, secretKey);\n}\n\n/**\n * Verify a detached signature against a payload and a public key. Returns\n * true if the signature is valid, false otherwise. Wrong-length keys or\n * signatures throw {@link SigningError} so callers can distinguish a bad\n * signature from a misshapen input.\n */\nexport function verify(payload: Uint8Array, signature: Uint8Array, publicKey: Uint8Array): boolean {\n if (publicKey.length !== PUBLIC_KEY_BYTES) {\n throw new SigningError(\n `Ed25519 public key must be ${PUBLIC_KEY_BYTES} bytes, got ${publicKey.length}.`,\n \"invalid-public-key\"\n );\n }\n if (signature.length !== SIGNATURE_BYTES) {\n throw new SigningError(\n `Ed25519 signature must be ${SIGNATURE_BYTES} bytes, got ${signature.length}.`,\n \"invalid-signature-length\"\n );\n }\n return nacl.sign.detached.verify(payload, signature, publicKey);\n}\n\n/**\n * Sign a payload and pack it into a {@link SignedEnvelope} along with the\n * sender id. The mesh network adapter calls this on every outgoing message\n * before handing it to the transport.\n */\nexport function signEnvelope(\n payload: Uint8Array,\n senderId: string,\n secretKey: Uint8Array\n): SignedEnvelope {\n const signature = sign(payload, secretKey);\n return { senderId, payload, signature };\n}\n\n/**\n * Verify a {@link SignedEnvelope} against the sender's known public key.\n * Returns the inner payload on success, throws on failure. The mesh\n * network adapter calls this on every incoming message before forwarding\n * the payload to the underlying Automerge sync subsystem.\n */\nexport function openEnvelope(envelope: SignedEnvelope, publicKey: Uint8Array): Uint8Array {\n const ok = verify(envelope.payload, envelope.signature, publicKey);\n if (!ok) {\n throw new SigningError(\n `Signature verification failed for envelope from ${envelope.senderId}.`,\n \"envelope-malformed\"\n );\n }\n return envelope.payload;\n}\n\n/**\n * Serialise a {@link SignedEnvelope} to a single binary blob suitable for\n * transmission over a network adapter. Wire format:\n *\n * [4 bytes BE: senderId byte length]\n * [N bytes: senderId UTF-8]\n * [64 bytes: signature]\n * [remaining: payload]\n *\n * Callers should not depend on the exact bytes — they should round-trip\n * through {@link encodeSignedEnvelope} / {@link decodeSignedEnvelope}.\n */\nexport function encodeSignedEnvelope(envelope: SignedEnvelope): Uint8Array {\n const senderBytes = new TextEncoder().encode(envelope.senderId);\n const total = 4 + senderBytes.length + SIGNATURE_BYTES + envelope.payload.length;\n const out = new Uint8Array(total);\n const view = new DataView(out.buffer);\n view.setUint32(0, senderBytes.length, false);\n out.set(senderBytes, 4);\n out.set(envelope.signature, 4 + senderBytes.length);\n out.set(envelope.payload, 4 + senderBytes.length + SIGNATURE_BYTES);\n return out;\n}\n\n/**\n * Deserialise a binary envelope produced by {@link encodeSignedEnvelope}.\n * Throws on malformed input.\n */\nexport function decodeSignedEnvelope(bytes: Uint8Array): SignedEnvelope {\n if (bytes.length < 4 + SIGNATURE_BYTES) {\n throw new SigningError(\n `Envelope too short: ${bytes.length} bytes, need at least ${4 + SIGNATURE_BYTES}.`,\n \"envelope-malformed\"\n );\n }\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n const senderLen = view.getUint32(0, false);\n if (bytes.length < 4 + senderLen + SIGNATURE_BYTES) {\n throw new SigningError(\n `Envelope truncated: declared sender length ${senderLen}, total ${bytes.length}.`,\n \"envelope-malformed\"\n );\n }\n const senderId = new TextDecoder().decode(bytes.subarray(4, 4 + senderLen));\n const signature = bytes.slice(4 + senderLen, 4 + senderLen + SIGNATURE_BYTES);\n const payload = bytes.slice(4 + senderLen + SIGNATURE_BYTES);\n return { senderId, payload, signature };\n}\n"
7
+ "/**\n * encryption — symmetric authenticated encryption for Polly's $meshState\n * primitive (Phase 2). Wraps tweetnacl's secretbox (XSalsa20-Poly1305) with\n * a small Polly-flavoured API so the rest of the codebase never imports\n * tweetnacl directly.\n *\n * Every $meshState document has a per-document symmetric key that is\n * provisioned to authorised peers at pairing time and never held by any\n * server. Outgoing operations are encrypted under this key before they\n * touch the network adapter; incoming operations are decrypted on receipt.\n * The signing layer in {@link signing.ts} provides authenticity (proof of\n * who sent the message); this layer provides confidentiality (the bytes\n * are unreadable to anything that does not hold the document key).\n *\n * tweetnacl's secretbox uses a 32-byte symmetric key and a 24-byte nonce.\n * The output of `nacl.secretbox` is the ciphertext concatenated with a\n * 16-byte Poly1305 authentication tag. We package the nonce + ciphertext\n * into a single binary blob using a small length-prefixed envelope so the\n * receiver can recover the nonce without out-of-band coordination.\n *\n * - {@link generateDocumentKey} returns a fresh 32-byte symmetric key.\n *\n * - {@link encrypt} produces a sealed blob from a payload and a key.\n *\n * - {@link decrypt} recovers the payload from a sealed blob and a key.\n * Returns undefined if the blob is malformed or the authentication\n * tag does not match (i.e. wrong key or tampered ciphertext) — the\n * undefined signal lets call sites distinguish \"wrong key\" from\n * \"structurally invalid\" without throwing.\n *\n * - {@link sealEnvelope} and {@link openEnvelope} are convenience helpers\n * that wrap encrypt/decrypt in a structured EncryptedEnvelope shape so\n * the mesh transport layer can handle the binary plumbing uniformly.\n */\n\nimport nacl from \"tweetnacl\";\n\n/** Length in bytes of a secretbox symmetric key. */\nexport const KEY_BYTES = 32;\n/** Length in bytes of a secretbox nonce. */\nexport const NONCE_BYTES = 24;\n/** Length in bytes of the Poly1305 authentication tag. */\nexport const TAG_BYTES = 16;\n\n/**\n * A sealed blob suitable for storage or network transmission. The wire\n * layout is the concatenation of the nonce and the ciphertext+tag from\n * tweetnacl. Callers should not depend on the exact bytes — round-trip\n * through {@link encrypt} / {@link decrypt} or the envelope helpers.\n */\nexport type SealedBytes = Uint8Array;\n\n/** Errors thrown by the encryption subsystem. */\nexport class EncryptionError extends Error {\n readonly code: \"invalid-key-length\" | \"decrypt-failed\" | \"envelope-malformed\";\n constructor(message: string, code: EncryptionError[\"code\"]) {\n super(message);\n this.name = \"EncryptionError\";\n this.code = code;\n }\n}\n\n/**\n * Generate a fresh 32-byte symmetric document key. Calls into tweetnacl's\n * CSPRNG.\n */\nexport function generateDocumentKey(): Uint8Array {\n return nacl.randomBytes(KEY_BYTES);\n}\n\n/**\n * Encrypt a payload under a symmetric key. The returned blob includes a\n * fresh nonce so the receiver does not need any out-of-band coordination\n * to decrypt.\n */\nexport function encrypt(payload: Uint8Array, key: Uint8Array): SealedBytes {\n if (key.length !== KEY_BYTES) {\n throw new EncryptionError(\n `secretbox key must be ${KEY_BYTES} bytes, got ${key.length}.`,\n \"invalid-key-length\"\n );\n }\n const nonce = nacl.randomBytes(NONCE_BYTES);\n const ciphertext = nacl.secretbox(payload, nonce, key);\n const out = new Uint8Array(NONCE_BYTES + ciphertext.length);\n out.set(nonce, 0);\n out.set(ciphertext, NONCE_BYTES);\n return out;\n}\n\n/**\n * Decrypt a sealed blob under a symmetric key. Returns the original\n * payload on success. Returns undefined if the blob is too short to\n * contain a nonce and tag, or if the authentication tag does not match\n * (which indicates either a wrong key or a tampered ciphertext).\n *\n * The undefined return is deliberate: call sites typically want to fall\n * back to a different key or surface a \"could not decrypt\" message rather\n * than catching an exception. Use {@link decryptOrThrow} when an exception\n * is preferred.\n */\nexport function decrypt(sealed: SealedBytes, key: Uint8Array): Uint8Array | undefined {\n if (key.length !== KEY_BYTES) {\n throw new EncryptionError(\n `secretbox key must be ${KEY_BYTES} bytes, got ${key.length}.`,\n \"invalid-key-length\"\n );\n }\n if (sealed.length < NONCE_BYTES + TAG_BYTES) {\n return undefined;\n }\n const nonce = sealed.subarray(0, NONCE_BYTES);\n const ciphertext = sealed.subarray(NONCE_BYTES);\n const opened = nacl.secretbox.open(ciphertext, nonce, key);\n return opened ?? undefined;\n}\n\n/**\n * Decrypt a sealed blob, throwing {@link EncryptionError} on failure\n * instead of returning undefined.\n */\nexport function decryptOrThrow(sealed: SealedBytes, key: Uint8Array): Uint8Array {\n const opened = decrypt(sealed, key);\n if (!opened) {\n throw new EncryptionError(\n `Failed to decrypt sealed blob: wrong key, malformed input, or tampered ciphertext.`,\n \"decrypt-failed\"\n );\n }\n return opened;\n}\n\n/**\n * A high-level structured envelope combining encryption with a small\n * amount of metadata the receiver needs to find the right key. The mesh\n * network adapter uses this shape on the wire.\n */\nexport interface EncryptedEnvelope {\n /** Stable identifier for the document this payload belongs to. The\n * receiver looks this up in its local key store to find the right key. */\n documentId: string;\n /** Sealed blob containing the encrypted payload plus its nonce. */\n sealed: SealedBytes;\n}\n\n/**\n * Encrypt a payload and pack it into an {@link EncryptedEnvelope} along\n * with the document id.\n */\nexport function sealEnvelope(\n payload: Uint8Array,\n documentId: string,\n key: Uint8Array\n): EncryptedEnvelope {\n return {\n documentId,\n sealed: encrypt(payload, key),\n };\n}\n\n/**\n * Decrypt an {@link EncryptedEnvelope} using the given key. Throws on\n * failure for symmetry with {@link sealEnvelope}.\n */\nexport function openEnvelope(envelope: EncryptedEnvelope, key: Uint8Array): Uint8Array {\n return decryptOrThrow(envelope.sealed, key);\n}\n\n/**\n * Serialise an {@link EncryptedEnvelope} to a single binary blob.\n *\n * Wire format:\n *\n * [4 bytes BE: documentId byte length]\n * [N bytes: documentId UTF-8]\n * [remaining: sealed blob (nonce + ciphertext + tag)]\n */\nexport function encodeEncryptedEnvelope(envelope: EncryptedEnvelope): Uint8Array {\n const idBytes = new TextEncoder().encode(envelope.documentId);\n const out = new Uint8Array(4 + idBytes.length + envelope.sealed.length);\n const view = new DataView(out.buffer);\n view.setUint32(0, idBytes.length, false);\n out.set(idBytes, 4);\n out.set(envelope.sealed, 4 + idBytes.length);\n return out;\n}\n\n/**\n * Deserialise a binary envelope produced by {@link encodeEncryptedEnvelope}.\n * Throws on malformed input.\n */\nexport function decodeEncryptedEnvelope(bytes: Uint8Array): EncryptedEnvelope {\n if (bytes.length < 4) {\n throw new EncryptionError(\n `Encrypted envelope too short: ${bytes.length} bytes.`,\n \"envelope-malformed\"\n );\n }\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n const idLen = view.getUint32(0, false);\n if (bytes.length < 4 + idLen) {\n throw new EncryptionError(\n `Encrypted envelope truncated: declared id length ${idLen}, total ${bytes.length}.`,\n \"envelope-malformed\"\n );\n }\n const documentId = new TextDecoder().decode(bytes.subarray(4, 4 + idLen));\n const sealed = bytes.slice(4 + idLen);\n return { documentId, sealed };\n}\n",
8
+ "/**\n * signing — Ed25519 signing and verification for Polly's $meshState\n * primitive (Phase 2). Wraps tweetnacl with a small Polly-flavoured API\n * so the rest of the codebase never imports tweetnacl directly.\n *\n * Every operation that flows through a $meshState transport is signed by\n * the originating peer's private key before transmission and verified by\n * every receiving peer against a known public-key set before being applied.\n * This is the Byzantine-tolerance mechanism: a peer whose private key is\n * compromised can be revoked through a further signed operation, after\n * which honest peers reject anything signed by the revoked key.\n *\n * tweetnacl uses the Ed25519 curve. Public keys and signatures are 32 and\n * 64 bytes respectively, which keeps the per-op overhead small enough that\n * signing every Automerge sync message is feasible even on mobile.\n *\n * The shape of the wrapper:\n *\n * - {@link generateSigningKeyPair} produces a new Ed25519 keypair. The\n * private key never leaves the device that generated it; the public\n * key is gossiped through the access set.\n *\n * - {@link sign} produces a 64-byte detached signature over a payload.\n *\n * - {@link verify} checks a payload against a signature and a public\n * key. Returns boolean rather than throwing so call sites can handle\n * verification failure as a normal control-flow case.\n *\n * - {@link signEnvelope} and {@link openEnvelope} package payload + sender\n * id + signature into a single binary envelope, which is what the mesh\n * network adapter actually puts on the wire.\n */\n\nimport nacl from \"tweetnacl\";\n\n/** Length in bytes of an Ed25519 public key. */\nexport const PUBLIC_KEY_BYTES = 32;\n/** Length in bytes of an Ed25519 secret (private) key. */\nexport const SECRET_KEY_BYTES = 64;\n/** Length in bytes of an Ed25519 detached signature. */\nexport const SIGNATURE_BYTES = 64;\n\n/**\n * An Ed25519 keypair. The {@link publicKey} is safe to share with peers;\n * the {@link secretKey} must never leave the device.\n */\nexport interface SigningKeyPair {\n publicKey: Uint8Array;\n secretKey: Uint8Array;\n}\n\n/**\n * A signed envelope. The wire format is the concatenation of the sender id\n * length, the sender id bytes, the signature, and the payload. Callers\n * shouldn't rely on the exact layout — use {@link signEnvelope} and\n * {@link openEnvelope} to round-trip.\n */\nexport interface SignedEnvelope {\n /** Stable sender peer identifier (UTF-8 string). The receiving side uses\n * this to look up the sender's public key in the document's access set. */\n senderId: string;\n /** The original payload bytes, untouched. */\n payload: Uint8Array;\n /** 64-byte Ed25519 signature over the payload. */\n signature: Uint8Array;\n}\n\n/** Errors thrown by the signing subsystem. */\nexport class SigningError extends Error {\n readonly code:\n | \"invalid-secret-key\"\n | \"invalid-public-key\"\n | \"invalid-signature-length\"\n | \"envelope-malformed\";\n\n constructor(message: string, code: SigningError[\"code\"]) {\n super(message);\n this.name = \"SigningError\";\n this.code = code;\n }\n}\n\n/**\n * Generate a fresh Ed25519 keypair. Calls into tweetnacl's CSPRNG.\n */\nexport function generateSigningKeyPair(): SigningKeyPair {\n const pair = nacl.sign.keyPair();\n return {\n publicKey: pair.publicKey,\n secretKey: pair.secretKey,\n };\n}\n\n/**\n * Reconstruct a keypair from an existing 64-byte secret key. Useful for\n * loading keys from persistent storage. Throws if the key is the wrong size.\n */\nexport function signingKeyPairFromSecret(secretKey: Uint8Array): SigningKeyPair {\n if (secretKey.length !== SECRET_KEY_BYTES) {\n throw new SigningError(\n `Ed25519 secret key must be ${SECRET_KEY_BYTES} bytes, got ${secretKey.length}.`,\n \"invalid-secret-key\"\n );\n }\n const pair = nacl.sign.keyPair.fromSecretKey(secretKey);\n return {\n publicKey: pair.publicKey,\n secretKey: pair.secretKey,\n };\n}\n\n/**\n * Produce a 64-byte detached signature over the given payload using the\n * supplied secret key.\n */\nexport function sign(payload: Uint8Array, secretKey: Uint8Array): Uint8Array {\n if (secretKey.length !== SECRET_KEY_BYTES) {\n throw new SigningError(\n `Ed25519 secret key must be ${SECRET_KEY_BYTES} bytes, got ${secretKey.length}.`,\n \"invalid-secret-key\"\n );\n }\n return nacl.sign.detached(payload, secretKey);\n}\n\n/**\n * Verify a detached signature against a payload and a public key. Returns\n * true if the signature is valid, false otherwise. Wrong-length keys or\n * signatures throw {@link SigningError} so callers can distinguish a bad\n * signature from a misshapen input.\n */\nexport function verify(payload: Uint8Array, signature: Uint8Array, publicKey: Uint8Array): boolean {\n if (publicKey.length !== PUBLIC_KEY_BYTES) {\n throw new SigningError(\n `Ed25519 public key must be ${PUBLIC_KEY_BYTES} bytes, got ${publicKey.length}.`,\n \"invalid-public-key\"\n );\n }\n if (signature.length !== SIGNATURE_BYTES) {\n throw new SigningError(\n `Ed25519 signature must be ${SIGNATURE_BYTES} bytes, got ${signature.length}.`,\n \"invalid-signature-length\"\n );\n }\n return nacl.sign.detached.verify(payload, signature, publicKey);\n}\n\n/**\n * Sign a payload and pack it into a {@link SignedEnvelope} along with the\n * sender id. The mesh network adapter calls this on every outgoing message\n * before handing it to the transport.\n */\nexport function signEnvelope(\n payload: Uint8Array,\n senderId: string,\n secretKey: Uint8Array\n): SignedEnvelope {\n const signature = sign(payload, secretKey);\n return { senderId, payload, signature };\n}\n\n/**\n * Verify a {@link SignedEnvelope} against the sender's known public key.\n * Returns the inner payload on success, throws on failure. The mesh\n * network adapter calls this on every incoming message before forwarding\n * the payload to the underlying Automerge sync subsystem.\n */\nexport function openEnvelope(envelope: SignedEnvelope, publicKey: Uint8Array): Uint8Array {\n const ok = verify(envelope.payload, envelope.signature, publicKey);\n if (!ok) {\n throw new SigningError(\n `Signature verification failed for envelope from ${envelope.senderId}.`,\n \"envelope-malformed\"\n );\n }\n return envelope.payload;\n}\n\n/**\n * Serialise a {@link SignedEnvelope} to a single binary blob suitable for\n * transmission over a network adapter. Wire format:\n *\n * [4 bytes BE: senderId byte length]\n * [N bytes: senderId UTF-8]\n * [64 bytes: signature]\n * [remaining: payload]\n *\n * Callers should not depend on the exact bytes — they should round-trip\n * through {@link encodeSignedEnvelope} / {@link decodeSignedEnvelope}.\n */\nexport function encodeSignedEnvelope(envelope: SignedEnvelope): Uint8Array {\n const senderBytes = new TextEncoder().encode(envelope.senderId);\n const total = 4 + senderBytes.length + SIGNATURE_BYTES + envelope.payload.length;\n const out = new Uint8Array(total);\n const view = new DataView(out.buffer);\n view.setUint32(0, senderBytes.length, false);\n out.set(senderBytes, 4);\n out.set(envelope.signature, 4 + senderBytes.length);\n out.set(envelope.payload, 4 + senderBytes.length + SIGNATURE_BYTES);\n return out;\n}\n\n/**\n * Deserialise a binary envelope produced by {@link encodeSignedEnvelope}.\n * Throws on malformed input.\n */\nexport function decodeSignedEnvelope(bytes: Uint8Array): SignedEnvelope {\n if (bytes.length < 4 + SIGNATURE_BYTES) {\n throw new SigningError(\n `Envelope too short: ${bytes.length} bytes, need at least ${4 + SIGNATURE_BYTES}.`,\n \"envelope-malformed\"\n );\n }\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n const senderLen = view.getUint32(0, false);\n if (bytes.length < 4 + senderLen + SIGNATURE_BYTES) {\n throw new SigningError(\n `Envelope truncated: declared sender length ${senderLen}, total ${bytes.length}.`,\n \"envelope-malformed\"\n );\n }\n const senderId = new TextDecoder().decode(bytes.subarray(4, 4 + senderLen));\n const signature = bytes.slice(4 + senderLen, 4 + senderLen + SIGNATURE_BYTES);\n const payload = bytes.slice(4 + senderLen + SIGNATURE_BYTES);\n return { senderId, payload, signature };\n}\n",
9
+ "/**\n * pairing — Phase 2 first-cut pairing flow for $meshState.\n *\n * Two devices that want to share a $meshState document must exchange three\n * things before sync can begin: the issuer's Ed25519 signing public key\n * (so the receiver can verify ops authored by the issuer), the symmetric\n * document encryption key (so both sides can encrypt and decrypt the\n * shared document), and the issuer's stable peer id (so the receiver\n * knows which entry in its keyring the public key belongs to). This\n * module packs all three into a {@link PairingToken}, serialises it to a\n * compact binary format suitable for QR codes or copy-paste, and provides\n * the matching parse-and-apply flow on the receiving side.\n *\n * Threat model: pairing tokens are transmitted over an out-of-band channel\n * that the user can authenticate visually — typically a QR code on the\n * issuer's device, scanned by the receiver. Because anyone with the token\n * can decrypt and impersonate, the OOB channel is the only authentication.\n * The token includes a TTL (default 10 minutes) so that a token displayed\n * briefly and then dismissed cannot be replayed by an attacker who later\n * gains access to a screenshot. A production deployment would layer a\n * Short Authentication String (SAS) on top — both devices display a code\n * derived from the shared state, and the user verifies they match — but\n * that is a follow-up.\n *\n * The pairing flow is one-way in the Phase 2 first cut. The issuer\n * generates a token and displays it; the receiver applies it and picks\n * up the issuer's keys. The receiver's own keys reach the issuer through\n * the access set: when the receiver sends its first signed op, the issuer\n * records the receiver's public key alongside its peer id and adds it to\n * the keyring. A bidirectional pairing flow that exchanges both sides'\n * keys in a single QR exchange is straightforward to add later but adds\n * UX surface area that is not needed for the mesh transport to work.\n */\n\nimport { KEY_BYTES as ENCRYPTION_KEY_BYTES, generateDocumentKey } from \"./encryption\";\nimport type { MeshKeyring } from \"./mesh-network-adapter\";\nimport {\n generateSigningKeyPair,\n PUBLIC_KEY_BYTES as SIGNING_PUBLIC_KEY_BYTES,\n type SigningKeyPair,\n} from \"./signing\";\n\n/** Current pairing-token format version. Bumped if the wire format changes. */\nexport const PAIRING_TOKEN_VERSION = 1;\n\n/** Magic header bytes for sanity-checking parsed tokens. ASCII \"PPT1\". */\nexport const PAIRING_TOKEN_MAGIC = new Uint8Array([0x50, 0x50, 0x54, 0x31]);\n\n/** Length of the random nonce embedded in every token. */\nexport const PAIRING_NONCE_BYTES = 16;\n\n/** Default TTL applied when {@link createPairingToken} is called without an\n * explicit `ttlMs` option. */\nexport const DEFAULT_PAIRING_TTL_MS = 10 * 60 * 1000; // 10 minutes\n\n/**\n * The contents of a pairing token. Both sides operate on this shape; the\n * binary serialisation is purely for transport.\n */\nexport interface PairingToken {\n /** Format version. {@link PAIRING_TOKEN_VERSION} at the time of writing. */\n version: number;\n /** Stable peer id of the issuing device. The receiver records this as\n * the lookup key for the issuer's public key in its keyring. */\n issuerPeerId: string;\n /** Issuer's Ed25519 signing public key (32 bytes). */\n issuerPublicKey: Uint8Array;\n /** Shared document encryption key (32 bytes). The receiver stores this\n * under {@link documentKeyId} in its keyring. */\n documentKey: Uint8Array;\n /** Identifier under which the receiver stores the document key. For the\n * Phase 2 first cut this is typically the well-known DEFAULT_MESH_KEY_ID\n * from mesh-network-adapter; per-document keys (one entry per Automerge\n * document) are a follow-up. */\n documentKeyId: string;\n /** Unix timestamp (milliseconds) after which the token is considered\n * expired and {@link applyPairingToken} refuses to use it. */\n expiresAt: number;\n /** 16-byte random nonce. Carried through serialisation so two tokens\n * with otherwise-identical contents are still distinguishable. */\n nonce: Uint8Array;\n}\n\n/** Errors thrown by the pairing subsystem. */\nexport class PairingError extends Error {\n readonly code:\n | \"expired\"\n | \"wrong-magic\"\n | \"unknown-version\"\n | \"truncated\"\n | \"invalid-public-key\"\n | \"invalid-document-key\"\n | \"invalid-nonce\";\n\n constructor(message: string, code: PairingError[\"code\"]) {\n super(message);\n this.name = \"PairingError\";\n this.code = code;\n }\n}\n\n/**\n * Options for {@link createPairingToken}. The signing identity and the\n * document key are required; everything else is optional with sensible\n * defaults.\n */\nexport interface CreatePairingTokenOptions {\n /** The issuing device's signing keypair. Only the public key ends up in\n * the token; the secret never leaves the issuer. */\n identity: SigningKeyPair;\n /** Stable peer id for the issuing device. */\n issuerPeerId: string;\n /** The symmetric document key the receiver should adopt. If omitted, a\n * fresh key is generated and the caller is responsible for using the\n * same key on the issuing side too. */\n documentKey?: Uint8Array;\n /** Identifier under which the receiver stores the document key. */\n documentKeyId: string;\n /** Time-to-live in milliseconds. Defaults to {@link DEFAULT_PAIRING_TTL_MS}. */\n ttlMs?: number;\n /** Override the current time. Intended for tests; production code should\n * not pass this. */\n now?: () => number;\n}\n\n/**\n * Generate a fresh {@link PairingToken}. The token is ready to be\n * serialised and displayed to the receiver via an OOB channel.\n */\nexport function createPairingToken(options: CreatePairingTokenOptions): PairingToken {\n const now = options.now ? options.now() : Date.now();\n const ttlMs = options.ttlMs ?? DEFAULT_PAIRING_TTL_MS;\n const documentKey = options.documentKey ?? generateDocumentKey();\n const nonce = randomBytes(PAIRING_NONCE_BYTES);\n\n return {\n version: PAIRING_TOKEN_VERSION,\n issuerPeerId: options.issuerPeerId,\n issuerPublicKey: options.identity.publicKey,\n documentKey,\n documentKeyId: options.documentKeyId,\n expiresAt: now + ttlMs,\n nonce,\n };\n}\n\n/**\n * Generate a fresh pairing token *and* a fresh signing keypair in one call.\n * Convenience for first-time setup where the device has no existing\n * identity yet. Returns both so the caller can persist the keypair and\n * then display the token.\n */\nexport function createPairingTokenWithFreshIdentity(args: {\n issuerPeerId: string;\n documentKeyId: string;\n ttlMs?: number;\n now?: () => number;\n}): { identity: SigningKeyPair; token: PairingToken } {\n const identity = generateSigningKeyPair();\n const token = createPairingToken({\n identity,\n issuerPeerId: args.issuerPeerId,\n documentKeyId: args.documentKeyId,\n ttlMs: args.ttlMs,\n now: args.now,\n });\n return { identity, token };\n}\n\n/**\n * Check whether a token has expired against the current wall-clock time\n * (or an injected `now`).\n */\nexport function isPairingTokenExpired(token: PairingToken, now?: () => number): boolean {\n const t = now ? now() : Date.now();\n return t >= token.expiresAt;\n}\n\n/**\n * Apply a parsed and validated token to a {@link MeshKeyring}. Mutates the\n * keyring in place: adds the issuer's public key to {@link MeshKeyring.knownPeers}\n * and the document key to {@link MeshKeyring.documentKeys}.\n *\n * Throws {@link PairingError} with code \"expired\" if the token's TTL has\n * elapsed. The receiver is expected to apply the token promptly after\n * scanning; rejecting expired tokens prevents replay of long-lived\n * captures.\n */\nexport function applyPairingToken(\n token: PairingToken,\n keyring: MeshKeyring,\n options: { now?: () => number } = {}\n): void {\n if (isPairingTokenExpired(token, options.now)) {\n throw new PairingError(\n `Pairing token from ${token.issuerPeerId} expired at ${new Date(token.expiresAt).toISOString()}.`,\n \"expired\"\n );\n }\n keyring.knownPeers.set(token.issuerPeerId, token.issuerPublicKey);\n keyring.documentKeys.set(token.documentKeyId, token.documentKey);\n}\n\n// ─── binary serialisation ──────────────────────────────────────────────────\n\n/**\n * Serialise a token to a binary blob. The wire format is:\n *\n * [4 bytes: magic \"PPT1\"]\n * [1 byte: version]\n * [4 bytes BE: issuer id byte length]\n * [N bytes: issuer id UTF-8]\n * [32 bytes: issuer public key]\n * [32 bytes: document key]\n * [4 bytes BE: document key id byte length]\n * [M bytes: document key id UTF-8]\n * [8 bytes BE: expiresAt (uint64 milliseconds)]\n * [16 bytes: nonce]\n *\n * Use {@link encodePairingToken} to round-trip through a base64 string.\n */\nexport function serialisePairingToken(token: PairingToken): Uint8Array {\n validateForSerialisation(token);\n const issuerBytes = new TextEncoder().encode(token.issuerPeerId);\n const keyIdBytes = new TextEncoder().encode(token.documentKeyId);\n\n const total =\n PAIRING_TOKEN_MAGIC.length +\n 1 + // version\n 4 + // issuer id length\n issuerBytes.length +\n SIGNING_PUBLIC_KEY_BYTES +\n ENCRYPTION_KEY_BYTES +\n 4 + // doc key id length\n keyIdBytes.length +\n 8 + // expiresAt\n PAIRING_NONCE_BYTES;\n\n const out = new Uint8Array(total);\n let offset = 0;\n\n out.set(PAIRING_TOKEN_MAGIC, offset);\n offset += PAIRING_TOKEN_MAGIC.length;\n\n out[offset] = token.version;\n offset += 1;\n\n const view = new DataView(out.buffer);\n view.setUint32(offset, issuerBytes.length, false);\n offset += 4;\n out.set(issuerBytes, offset);\n offset += issuerBytes.length;\n\n out.set(token.issuerPublicKey, offset);\n offset += SIGNING_PUBLIC_KEY_BYTES;\n\n out.set(token.documentKey, offset);\n offset += ENCRYPTION_KEY_BYTES;\n\n view.setUint32(offset, keyIdBytes.length, false);\n offset += 4;\n out.set(keyIdBytes, offset);\n offset += keyIdBytes.length;\n\n // Write expiresAt as uint64 BE. JavaScript numbers are float64 but the\n // value is an integer count of milliseconds, well within 53-bit safe\n // range for any practical timestamp.\n view.setBigUint64(offset, BigInt(token.expiresAt), false);\n offset += 8;\n\n out.set(token.nonce, offset);\n offset += PAIRING_NONCE_BYTES;\n\n return out;\n}\n\n/**\n * Inverse of {@link serialisePairingToken}. Throws {@link PairingError} on\n * malformed input.\n */\nexport function parsePairingToken(bytes: Uint8Array): PairingToken {\n let offset = 0;\n\n // Magic\n if (bytes.length < PAIRING_TOKEN_MAGIC.length) {\n throw new PairingError(`Pairing token too short: ${bytes.length} bytes.`, \"truncated\");\n }\n for (let i = 0; i < PAIRING_TOKEN_MAGIC.length; i++) {\n if (bytes[offset + i] !== PAIRING_TOKEN_MAGIC[i]) {\n throw new PairingError(\n `Pairing token magic mismatch: not a Polly pairing token.`,\n \"wrong-magic\"\n );\n }\n }\n offset += PAIRING_TOKEN_MAGIC.length;\n\n // Version\n if (bytes.length < offset + 1) {\n throw new PairingError(\"Pairing token truncated at version.\", \"truncated\");\n }\n const version = bytes[offset] as unknown as number;\n offset += 1;\n if (version !== PAIRING_TOKEN_VERSION) {\n throw new PairingError(\n `Unknown pairing token version: ${version}. This Polly build supports version ${PAIRING_TOKEN_VERSION}.`,\n \"unknown-version\"\n );\n }\n\n // Issuer id\n if (bytes.length < offset + 4) {\n throw new PairingError(\"Pairing token truncated at issuer id length.\", \"truncated\");\n }\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n const issuerLen = view.getUint32(offset, false);\n offset += 4;\n if (bytes.length < offset + issuerLen) {\n throw new PairingError(\"Pairing token truncated at issuer id.\", \"truncated\");\n }\n const issuerPeerId = new TextDecoder().decode(bytes.subarray(offset, offset + issuerLen));\n offset += issuerLen;\n\n // Issuer public key\n if (bytes.length < offset + SIGNING_PUBLIC_KEY_BYTES) {\n throw new PairingError(\"Pairing token truncated at public key.\", \"truncated\");\n }\n const issuerPublicKey = bytes.slice(offset, offset + SIGNING_PUBLIC_KEY_BYTES);\n offset += SIGNING_PUBLIC_KEY_BYTES;\n\n // Document key\n if (bytes.length < offset + ENCRYPTION_KEY_BYTES) {\n throw new PairingError(\"Pairing token truncated at document key.\", \"truncated\");\n }\n const documentKey = bytes.slice(offset, offset + ENCRYPTION_KEY_BYTES);\n offset += ENCRYPTION_KEY_BYTES;\n\n // Document key id\n if (bytes.length < offset + 4) {\n throw new PairingError(\"Pairing token truncated at document key id length.\", \"truncated\");\n }\n const keyIdLen = view.getUint32(offset, false);\n offset += 4;\n if (bytes.length < offset + keyIdLen) {\n throw new PairingError(\"Pairing token truncated at document key id.\", \"truncated\");\n }\n const documentKeyId = new TextDecoder().decode(bytes.subarray(offset, offset + keyIdLen));\n offset += keyIdLen;\n\n // Expires at\n if (bytes.length < offset + 8) {\n throw new PairingError(\"Pairing token truncated at expiry.\", \"truncated\");\n }\n const expiresAtBig = view.getBigUint64(offset, false);\n offset += 8;\n const expiresAt = Number(expiresAtBig);\n\n // Nonce\n if (bytes.length < offset + PAIRING_NONCE_BYTES) {\n throw new PairingError(\"Pairing token truncated at nonce.\", \"truncated\");\n }\n const nonce = bytes.slice(offset, offset + PAIRING_NONCE_BYTES);\n offset += PAIRING_NONCE_BYTES;\n\n return {\n version,\n issuerPeerId,\n issuerPublicKey,\n documentKey,\n documentKeyId,\n expiresAt,\n nonce,\n };\n}\n\n/**\n * Serialise a token and base64-encode it for QR-code or copy-paste display.\n * The encoding uses the standard base64 alphabet (not URL-safe) because\n * QR codes encode bytes directly and do not care about URL safety.\n */\nexport function encodePairingToken(token: PairingToken): string {\n const bytes = serialisePairingToken(token);\n // btoa expects a binary string. Convert via String.fromCharCode per byte;\n // safe for the ~150-byte token size and avoids the spread-into-fromCharCode\n // pattern that runs into argument-count limits on large arrays.\n let binary = \"\";\n for (const byte of bytes) {\n binary += String.fromCharCode(byte);\n }\n return btoa(binary);\n}\n\n/**\n * Decode a base64-encoded pairing token produced by {@link encodePairingToken}.\n * Throws {@link PairingError} on malformed input.\n */\nexport function decodePairingToken(encoded: string): PairingToken {\n let binary: string;\n try {\n binary = atob(encoded);\n } catch {\n throw new PairingError(\"Pairing token is not valid base64.\", \"wrong-magic\");\n }\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return parsePairingToken(bytes);\n}\n\n// ─── helpers ───────────────────────────────────────────────────────────────\n\nfunction validateForSerialisation(token: PairingToken): void {\n if (token.issuerPublicKey.length !== SIGNING_PUBLIC_KEY_BYTES) {\n throw new PairingError(\n `Issuer public key must be ${SIGNING_PUBLIC_KEY_BYTES} bytes, got ${token.issuerPublicKey.length}.`,\n \"invalid-public-key\"\n );\n }\n if (token.documentKey.length !== ENCRYPTION_KEY_BYTES) {\n throw new PairingError(\n `Document key must be ${ENCRYPTION_KEY_BYTES} bytes, got ${token.documentKey.length}.`,\n \"invalid-document-key\"\n );\n }\n if (token.nonce.length !== PAIRING_NONCE_BYTES) {\n throw new PairingError(\n `Nonce must be ${PAIRING_NONCE_BYTES} bytes, got ${token.nonce.length}.`,\n \"invalid-nonce\"\n );\n }\n}\n\nfunction randomBytes(n: number): Uint8Array {\n const out = new Uint8Array(n);\n crypto.getRandomValues(out);\n return out;\n}\n"
10
10
  ],
11
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;AA+BO,SAAS,mBAAmB,GAAe;AAAA,EAChD,OAAO,KAAK,YAAY,SAAS;AAAA;AAQ5B,SAAS,OAAO,CAAC,SAAqB,KAA8B;AAAA,EACzE,IAAI,IAAI,WAAW,WAAW;AAAA,IAC5B,MAAM,IAAI,gBACR,yBAAyB,wBAAwB,IAAI,WACrD,oBACF;AAAA,EACF;AAAA,EACA,MAAM,QAAQ,KAAK,YAAY,WAAW;AAAA,EAC1C,MAAM,aAAa,KAAK,UAAU,SAAS,OAAO,GAAG;AAAA,EACrD,MAAM,MAAM,IAAI,WAAW,cAAc,WAAW,MAAM;AAAA,EAC1D,IAAI,IAAI,OAAO,CAAC;AAAA,EAChB,IAAI,IAAI,YAAY,WAAW;AAAA,EAC/B,OAAO;AAAA;AAcF,SAAS,OAAO,CAAC,QAAqB,KAAyC;AAAA,EACpF,IAAI,IAAI,WAAW,WAAW;AAAA,IAC5B,MAAM,IAAI,gBACR,yBAAyB,wBAAwB,IAAI,WACrD,oBACF;AAAA,EACF;AAAA,EACA,IAAI,OAAO,SAAS,cAAc,WAAW;AAAA,IAC3C;AAAA,EACF;AAAA,EACA,MAAM,QAAQ,OAAO,SAAS,GAAG,WAAW;AAAA,EAC5C,MAAM,aAAa,OAAO,SAAS,WAAW;AAAA,EAC9C,MAAM,SAAS,KAAK,UAAU,KAAK,YAAY,OAAO,GAAG;AAAA,EACzD,OAAO,UAAU;AAAA;AAOZ,SAAS,cAAc,CAAC,QAAqB,KAA6B;AAAA,EAC/E,MAAM,SAAS,QAAQ,QAAQ,GAAG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AAe,QAAQ;AAAA,EAC9C,CAAC;AAAA,EAED,MAAM,eAAe,QAAQ,MAAM,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC;AAAA,EAC3D,kBAAkB,OAAO,SAAS,YAAY;AAAA,EAE9C,MAAM,QAAQ,QAAQ,KAAK,OAAO;AAAA,EAClC,aAAa,MAAM;AAAA,CAAmC;AAAA,EACtD,OAAO;AAAA;AAST,eAAsB,yBAAyB,CAC7C,UAAyF,CAAC,GAC1F;AAAA,EACA,MAAM,KAAK,gBAAgB;AAAA,IACzB,OAAO,QAAQ,eAAe,QAAQ;AAAA,IACtC,QAAQ,QAAQ,gBAAgB,QAAQ;AAAA,EAC1C,CAAC;AAAA,EACD,IAAI;AAAA,IACF,MAAM,OAAO,MAAM,GAAG,SAAS,iBAAiB;AAAA,IAChD,OAAO,mBAAmB,KAAK,KAAK,CAAC;AAAA,YACrC;AAAA,IACA,GAAG,MAAM;AAAA;AAAA;AAKb,SAAS,oBAAoB,CAAC,WAA+B;AAAA,EAE3D,MAAM,QAAQ,UAAU,MAAM,GAAG,CAAC;AAAA,EAClC,MAAM,MAAM,MAAM,KAAK,KAAK,EACzB,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,EAC1C,KAAK,EAAE;AAAA,EACV,OAAO,IAAI,MAAM,OAAO,GAAG,KAAK,GAAG,KAAK;AAAA;AAG1C,SAAS,cAAc,CAAC,KAAuB;AAAA,EAC7C,OAAO,OAAO,QAAQ,YAAY,QAAQ,QAAQ,UAAU,OAAO,IAAI,SAAS;AAAA;",
12
+ "debugId": "0A5AD0E0D639B22564756E2164756E21",
13
13
  "names": []
14
14
  }
@@ -29,6 +29,12 @@ type BaseButtonProps = {
29
29
  label: ComponentChildren;
30
30
  "data-action"?: string;
31
31
  "aria-label"?: string;
32
+ /** Additional action-payload attributes the event delegator parses
33
+ * into `ctx.data`. `data-action-tid="t-17"` becomes `{ tid: "t-17" }`,
34
+ * `data-action-item-id="…"` becomes `{ itemId: "…" }`, and so on.
35
+ * Typed as an index signature so every `data-action-*` key the
36
+ * consumer cares about type-checks without a Button-side enumeration. */
37
+ [actionDataAttr: `data-action-${string}`]: string | undefined;
32
38
  };
33
39
  type ButtonAsButton = BaseButtonProps & {
34
40
  href?: never;
@@ -473,6 +473,15 @@ function Button(props) {
473
473
  }, undefined, true, undefined, this) : label;
474
474
  const dataAction = props["data-action"];
475
475
  const ariaLabel = props["aria-label"];
476
+ const actionDataAttrs = {};
477
+ for (const key of Object.keys(props)) {
478
+ if (key.startsWith("data-action-")) {
479
+ const value = props[key];
480
+ if (typeof value === "string") {
481
+ actionDataAttrs[key] = value;
482
+ }
483
+ }
484
+ }
476
485
  if ("href" in props && props.href) {
477
486
  return /* @__PURE__ */ jsxDEV4("a", {
478
487
  id,
@@ -486,6 +495,7 @@ function Button(props) {
486
495
  "data-polly-ui": true,
487
496
  "data-polly-button": tier,
488
497
  "data-action": dataAction,
498
+ ...actionDataAttrs,
489
499
  children: content
490
500
  }, undefined, false, undefined, this);
491
501
  }
@@ -500,6 +510,7 @@ function Button(props) {
500
510
  "data-polly-ui": true,
501
511
  "data-polly-button": tier,
502
512
  "data-action": dataAction,
513
+ ...actionDataAttrs,
503
514
  children: content
504
515
  }, undefined, false, undefined, this);
505
516
  }
@@ -1578,4 +1589,4 @@ export {
1578
1589
  ActionForm
1579
1590
  };
1580
1591
 
1581
- //# debugId=E8BC12017CFEA66464756E2164756E21
1592
+ //# debugId=E72D085699D0FDDF64756E2164756E21
@@ -6,7 +6,7 @@
6
6
  "/**\n * ActionInput — dual-mode view/edit input with action dispatch on commit.\n *\n * View mode renders the current value as text (optionally through a\n * caller-supplied `renderView` for markdown, rich formatting, etc.).\n * Click, Enter, or Space enters edit mode. Edit mode is a native input\n * or textarea; commit fires the configured action with `data-action-value`\n * and `data-action-field` set from FormData-shape semantics, so the\n * existing event delegation handles it with no extra wiring.\n *\n * `saveOn` picks the commit trigger:\n * \"blur\" commit when the field loses focus\n * \"enter\" commit on Enter (single-line) or Cmd/Ctrl+Enter (multi-line)\n * \"cmd-enter\" commit only on Cmd/Ctrl+Enter\n * \"explicit\" never auto-commit — caller wires a save button with data-action\n *\n * Layout-shift-free: view and edit modes share padding, border width,\n * font, and line-height so the toggle causes no reflow.\n */\n\nimport type { JSX } from \"preact\";\nimport { useCallback, useEffect, useRef, useState } from \"preact/hooks\";\nimport classes from \"./ActionInput.module.css\";\n\nexport type ActionInputSaveOn = \"blur\" | \"enter\" | \"cmd-enter\" | \"explicit\";\nexport type ActionInputVariant = \"single\" | \"multi\";\n\nexport type ActionInputProps = {\n /** Current value to render in view mode and seed the edit buffer. */\n value: string;\n /** Action name to dispatch on commit. Receives data-action-value=<new value>. */\n action: string;\n /** Commit trigger. Default: \"blur\". */\n saveOn?: ActionInputSaveOn;\n variant?: ActionInputVariant;\n placeholder?: string;\n disabled?: boolean;\n /** Extra data-action-* attributes to include at commit (e.g. entity id). */\n actionData?: Record<string, string>;\n /** Custom view renderer — receives value, returns VNode. */\n renderView?: (value: string) => JSX.Element | string;\n /** Label announced by screen readers for the edit affordance. */\n ariaLabel?: string;\n className?: string;\n};\n\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: two render branches times two variants times four saveOn triggers; branching is inherent to the primitive.\nexport function ActionInput(props: ActionInputProps): JSX.Element {\n const variant = props.variant ?? \"single\";\n const saveOn = props.saveOn ?? \"blur\";\n const [mode, setMode] = useState<\"view\" | \"edit\">(\"view\");\n const [draft, setDraft] = useState(props.value);\n const inputRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);\n\n useEffect(() => {\n if (mode === \"view\") setDraft(props.value);\n }, [props.value, mode]);\n\n useEffect(() => {\n if (mode === \"edit\" && inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select?.();\n }\n }, [mode]);\n\n const enterEdit = useCallback(() => {\n if (props.disabled) return;\n setDraft(props.value);\n setMode(\"edit\");\n }, [props.disabled, props.value]);\n\n const commit = useCallback(\n (next: string) => {\n if (next === props.value) {\n setMode(\"view\");\n return;\n }\n const dataAttrs: Record<string, string> = {\n ...(props.actionData ?? {}),\n value: next,\n };\n const hidden = document.createElement(\"button\");\n hidden.setAttribute(\"data-action\", props.action);\n for (const [key, value] of Object.entries(dataAttrs)) {\n const dashKey = key.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);\n hidden.setAttribute(`data-action-${dashKey}`, value);\n }\n hidden.style.position = \"fixed\";\n hidden.style.opacity = \"0\";\n hidden.style.pointerEvents = \"none\";\n hidden.tabIndex = -1;\n document.body.appendChild(hidden);\n try {\n hidden.click();\n } finally {\n hidden.remove();\n }\n setMode(\"view\");\n },\n [props.action, props.actionData, props.value]\n );\n\n const cancel = useCallback(() => {\n setDraft(props.value);\n setMode(\"view\");\n }, [props.value]);\n\n // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: keyboard handler encodes the saveOn × variant matrix.\n const onKeyDown = (event: JSX.TargetedKeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n cancel();\n return;\n }\n if (event.key === \"Enter\") {\n const cmd = event.metaKey || event.ctrlKey;\n if (saveOn === \"enter\" && variant === \"single\") {\n event.preventDefault();\n commit(draft);\n } else if ((saveOn === \"enter\" && variant === \"multi\" && cmd) || saveOn === \"cmd-enter\") {\n if (cmd) {\n event.preventDefault();\n commit(draft);\n }\n }\n }\n };\n\n const className = props.className ? `${classes[\"root\"]} ${props.className}` : classes[\"root\"];\n\n if (mode === \"view\") {\n const rendered = props.renderView ? props.renderView(props.value) : props.value;\n const isEmpty = props.value.length === 0;\n return (\n // biome-ignore lint/a11y/useSemanticElements: <button> would swallow text selection and add default styling; div with role=button is the inline-edit idiom.\n <div\n class={`${className} ${classes[\"view\"]}`}\n data-polly-ui\n data-polly-action-input\n data-polly-interactive\n data-state={isEmpty ? \"empty\" : \"filled\"}\n data-variant={variant}\n tabIndex={props.disabled ? -1 : 0}\n role=\"button\"\n aria-label={props.ariaLabel ?? \"Edit\"}\n aria-disabled={props.disabled ? \"true\" : undefined}\n onClick={enterEdit}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n enterEdit();\n }\n }}\n >\n {isEmpty && props.placeholder ? (\n <span class={classes[\"placeholder\"]}>{props.placeholder}</span>\n ) : (\n rendered\n )}\n </div>\n );\n }\n\n const common = {\n class: `${classes[\"edit\"]} ${classes[\"root\"]}`,\n \"data-polly-ui\": true,\n \"data-polly-action-input\": true,\n \"data-state\": \"editing\",\n \"data-variant\": variant,\n placeholder: props.placeholder,\n value: draft,\n onInput: (e: JSX.TargetedEvent<HTMLInputElement | HTMLTextAreaElement>) =>\n setDraft(e.currentTarget.value),\n onBlur: () => {\n if (saveOn === \"blur\") commit(draft);\n else cancel();\n },\n onKeyDown,\n \"aria-label\": props.ariaLabel ?? \"Edit\",\n disabled: props.disabled,\n };\n\n if (variant === \"multi\") {\n return (\n <textarea\n ref={(el) => {\n inputRef.current = el;\n }}\n {...(common as unknown as JSX.HTMLAttributes<HTMLTextAreaElement>)}\n />\n );\n }\n return (\n <input\n ref={(el) => {\n inputRef.current = el;\n }}\n type=\"text\"\n {...(common as unknown as JSX.HTMLAttributes<HTMLInputElement>)}\n />\n );\n}\n",
7
7
  "/**\n * Badge — small inline status chip.\n *\n * Renders as a passive <span> with tinted background and on-tint text\n * from the `--polly-status-*` token family. The default variant uses\n * surface-sunken + muted text for a neutral pill. Consumers style\n * placement via className; the primitive owns size, shape, and colour.\n */\n\nimport type { ComponentChildren, JSX } from \"preact\";\nimport classes from \"./Badge.module.css\";\n\nexport type BadgeVariant = \"default\" | \"info\" | \"success\" | \"warning\" | \"danger\";\n\nexport type BadgeProps = {\n children: ComponentChildren;\n variant?: BadgeVariant;\n className?: string;\n id?: string;\n};\n\nfunction variantClass(variant: BadgeVariant): string | undefined {\n if (variant === \"info\") return classes[\"info\"];\n if (variant === \"success\") return classes[\"success\"];\n if (variant === \"warning\") return classes[\"warning\"];\n if (variant === \"danger\") return classes[\"danger\"];\n return undefined;\n}\n\nexport function Badge(props: BadgeProps): JSX.Element {\n const { children, variant = \"default\", className, id } = props;\n const parts = [classes[\"badge\"]];\n const v = variantClass(variant);\n if (v) parts.push(v);\n if (className) parts.push(className);\n return (\n <span id={id} class={parts.join(\" \")} data-polly-ui data-polly-badge={variant}>\n {children}\n </span>\n );\n}\n",
8
8
  "/**\n * Layout — the one primitive that owns layouting concerns.\n *\n * Every other component in @fairfox/polly/ui (and every consumer app\n * that runs `polly quality css-layout`) routes flex/grid decisions\n * through this component. Props map to CSS custom properties so the\n * stylesheet can read them uniformly and so consumers can override\n * any of them in media queries without touching specificity.\n */\n\nimport { type ComponentChildren, createElement, type JSX } from \"preact\";\nimport classes from \"./Layout.module.css\";\n\nexport type LayoutProps = {\n children: ComponentChildren;\n\n /** Polymorphic element (div, section, header, nav, …). Defaults to 'div'. */\n as?: keyof JSX.IntrinsicElements;\n\n /** CSS grid structure. */\n rows?: string;\n columns?: string;\n autoFlow?: string;\n autoRows?: string;\n autoColumns?: string;\n\n /** display: contents — lets children participate in an ancestor grid. */\n contents?: boolean;\n /** Inherit parent grid tracks via CSS subgrid. */\n subgrid?: boolean;\n\n /** Spacing. */\n gap?: string;\n padding?: string;\n\n /** Sizing. */\n height?: string;\n minHeight?: string;\n\n /** Container alignment. */\n justifyItems?: string;\n alignItems?: string;\n justifyContent?: string;\n alignContent?: string;\n\n /** Self alignment (when this Layout is an item in a parent grid). */\n justifySelf?: string;\n alignSelf?: string;\n\n /** Collapse to a single column at ≤640px. */\n stackOnMobile?: boolean;\n\n /** Render as display: inline-grid so the Layout flows inline with surrounding text/controls. */\n inline?: boolean;\n\n className?: string;\n onClick?: JSX.MouseEventHandler<HTMLElement>;\n onKeyDown?: JSX.KeyboardEventHandler<HTMLElement>;\n\n role?: JSX.AriaRole;\n tabIndex?: number;\n id?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n};\n\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: sixteen optional prop-to-custom-property mappings; flat and linear.\nexport function Layout(props: LayoutProps): JSX.Element {\n const {\n children,\n as = \"div\",\n rows,\n columns,\n contents,\n subgrid,\n gap,\n padding,\n height,\n minHeight,\n justifyItems,\n alignItems,\n justifyContent,\n alignContent,\n justifySelf,\n alignSelf,\n autoFlow,\n autoRows,\n autoColumns,\n stackOnMobile,\n inline,\n className,\n onClick,\n onKeyDown,\n role,\n tabIndex,\n id,\n } = props;\n\n const style: Record<string, string> = {};\n\n if (contents) {\n style[\"display\"] = \"contents\";\n } else if (subgrid) {\n style[\"--l-col\"] = \"1 / -1\";\n style[\"--l-cols\"] = \"subgrid\";\n if (padding) style[\"--l-p\"] = padding;\n if (alignItems) style[\"--l-ai\"] = alignItems;\n if (gap) style[\"--l-gap\"] = gap;\n } else {\n if (padding) style[\"--l-p\"] = padding;\n if (height) style[\"--l-h\"] = height;\n if (minHeight) style[\"--l-mh\"] = minHeight;\n if (rows) style[\"--l-rows\"] = rows;\n if (columns) style[\"--l-cols\"] = columns;\n if (gap) style[\"--l-gap\"] = gap;\n if (justifyItems) style[\"--l-ji\"] = justifyItems;\n if (alignItems) style[\"--l-ai\"] = alignItems;\n if (justifyContent) style[\"--l-jc\"] = justifyContent;\n if (alignContent) style[\"--l-ac\"] = alignContent;\n if (autoFlow) style[\"--l-flow\"] = autoFlow;\n if (autoRows) style[\"--l-arows\"] = autoRows;\n if (autoColumns) style[\"--l-acols\"] = autoColumns;\n }\n if (justifySelf) style[\"--l-js\"] = justifySelf;\n if (alignSelf) style[\"--l-as\"] = alignSelf;\n\n const baseParts = [classes[\"layout\"]];\n if (inline) baseParts.push(classes[\"inline\"]);\n if (stackOnMobile) baseParts.push(classes[\"stackOnMobile\"]);\n const baseClass = baseParts.filter(Boolean).join(\" \");\n const combined = contents ? className : className ? `${baseClass} ${className}` : baseClass;\n\n return createElement(\n as,\n {\n id,\n className: combined,\n style,\n onClick,\n onKeyDown,\n role,\n tabIndex,\n \"aria-label\": props[\"aria-label\"],\n \"aria-labelledby\": props[\"aria-labelledby\"],\n \"aria-describedby\": props[\"aria-describedby\"],\n \"data-polly-layout\": true,\n },\n children\n );\n}\n",
9
- "/**\n * Button — interactive control with tier, semantic colour, and size.\n *\n * Renders as a <button> by default; switches to an <a> when given an\n * `href`. Tier sets visual importance (primary/secondary/tertiary),\n * color overlays semantic meaning (info/success/warning/danger),\n * size picks the padding + font scale (small/normal/large). Icon +\n * label are arranged with a nested inline <Layout>.\n *\n * Action wiring is declared via data-* attributes consumed by the\n * global event delegator in @fairfox/polly/actions — Button does not\n * accept an onClick prop.\n */\n\nimport type { ComponentChildren, JSX, VNode } from \"preact\";\nimport classes from \"./Button.module.css\";\nimport { Layout } from \"./Layout.tsx\";\n\nexport type ButtonTier = \"primary\" | \"secondary\" | \"tertiary\";\nexport type ButtonColor = \"default\" | \"info\" | \"success\" | \"warning\" | \"danger\";\nexport type ButtonSize = \"small\" | \"normal\" | \"large\";\n\ntype BaseButtonProps = {\n id?: string;\n tier?: ButtonTier;\n color?: ButtonColor;\n size?: ButtonSize;\n disabled?: boolean;\n fullWidth?: boolean;\n circle?: boolean;\n className?: string;\n title?: string;\n icon?: VNode;\n label: ComponentChildren;\n \"data-action\"?: string;\n \"aria-label\"?: string;\n};\n\ntype ButtonAsButton = BaseButtonProps & {\n href?: never;\n target?: never;\n rel?: never;\n type?: \"button\" | \"submit\" | \"reset\";\n};\n\ntype ButtonAsLink = BaseButtonProps & {\n href: string;\n target?: string;\n rel?: string;\n type?: never;\n};\n\nexport type ButtonProps = ButtonAsButton | ButtonAsLink;\n\nfunction tierClass(tier: ButtonTier): string | undefined {\n if (tier === \"primary\") return classes[\"tierPrimary\"];\n if (tier === \"tertiary\") return classes[\"tierTertiary\"];\n return classes[\"tierSecondary\"];\n}\n\nfunction colorClass(color: ButtonColor): string | undefined {\n if (color === \"info\") return classes[\"colorInfo\"];\n if (color === \"success\") return classes[\"colorSuccess\"];\n if (color === \"warning\") return classes[\"colorWarning\"];\n if (color === \"danger\") return classes[\"colorDanger\"];\n return undefined;\n}\n\nfunction sizeClass(size: ButtonSize): string | undefined {\n if (size === \"small\") return classes[\"btnSmall\"];\n if (size === \"large\") return classes[\"btnLarge\"];\n return undefined;\n}\n\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: flat prop-to-class composition plus one anchor/button branch; splitting would just hide the mapping.\nexport function Button(props: ButtonProps): JSX.Element {\n const {\n id,\n tier = \"secondary\",\n color = \"default\",\n size = \"normal\",\n disabled = false,\n fullWidth = false,\n circle = false,\n className,\n title,\n icon,\n label,\n } = props;\n\n const parts = [classes[\"btn\"] ?? \"\"];\n const tc = tierClass(tier);\n if (tc) parts.push(tc);\n const cc = colorClass(color);\n if (cc) parts.push(cc);\n const sc = sizeClass(size);\n if (sc) parts.push(sc);\n if (circle) parts.push(classes[\"btnCircle\"] ?? \"\");\n if (fullWidth) parts.push(classes[\"btnFullWidth\"] ?? \"\");\n if (className) parts.push(className);\n const buttonClass = parts.filter(Boolean).join(\" \");\n\n const content = icon ? (\n <Layout inline columns=\"auto auto\" gap=\"0.5em\" alignItems=\"center\">\n {icon}\n <span>{label}</span>\n </Layout>\n ) : (\n label\n );\n\n const dataAction = props[\"data-action\"];\n const ariaLabel = props[\"aria-label\"];\n\n if (\"href\" in props && props.href) {\n return (\n <a\n id={id}\n class={buttonClass}\n title={title}\n href={disabled ? undefined : props.href}\n target={\"target\" in props ? props.target : undefined}\n rel={\"rel\" in props ? props.rel : undefined}\n aria-disabled={disabled}\n aria-label={ariaLabel}\n data-polly-ui\n data-polly-button={tier}\n data-action={dataAction}\n >\n {content}\n </a>\n );\n }\n\n const resolvedType: \"button\" | \"submit\" | \"reset\" =\n \"type\" in props && props.type ? props.type : \"button\";\n\n return (\n <button\n id={id}\n class={buttonClass}\n title={title}\n type={resolvedType}\n disabled={disabled}\n aria-label={ariaLabel}\n data-polly-ui\n data-polly-button={tier}\n data-action={dataAction}\n >\n {content}\n </button>\n );\n}\n",
9
+ "/**\n * Button — interactive control with tier, semantic colour, and size.\n *\n * Renders as a <button> by default; switches to an <a> when given an\n * `href`. Tier sets visual importance (primary/secondary/tertiary),\n * color overlays semantic meaning (info/success/warning/danger),\n * size picks the padding + font scale (small/normal/large). Icon +\n * label are arranged with a nested inline <Layout>.\n *\n * Action wiring is declared via data-* attributes consumed by the\n * global event delegator in @fairfox/polly/actions — Button does not\n * accept an onClick prop.\n */\n\nimport type { ComponentChildren, JSX, VNode } from \"preact\";\nimport classes from \"./Button.module.css\";\nimport { Layout } from \"./Layout.tsx\";\n\nexport type ButtonTier = \"primary\" | \"secondary\" | \"tertiary\";\nexport type ButtonColor = \"default\" | \"info\" | \"success\" | \"warning\" | \"danger\";\nexport type ButtonSize = \"small\" | \"normal\" | \"large\";\n\ntype BaseButtonProps = {\n id?: string;\n tier?: ButtonTier;\n color?: ButtonColor;\n size?: ButtonSize;\n disabled?: boolean;\n fullWidth?: boolean;\n circle?: boolean;\n className?: string;\n title?: string;\n icon?: VNode;\n label: ComponentChildren;\n \"data-action\"?: string;\n \"aria-label\"?: string;\n /** Additional action-payload attributes the event delegator parses\n * into `ctx.data`. `data-action-tid=\"t-17\"` becomes `{ tid: \"t-17\" }`,\n * `data-action-item-id=\"…\"` becomes `{ itemId: \"…\" }`, and so on.\n * Typed as an index signature so every `data-action-*` key the\n * consumer cares about type-checks without a Button-side enumeration. */\n [actionDataAttr: `data-action-${string}`]: string | undefined;\n};\n\ntype ButtonAsButton = BaseButtonProps & {\n href?: never;\n target?: never;\n rel?: never;\n type?: \"button\" | \"submit\" | \"reset\";\n};\n\ntype ButtonAsLink = BaseButtonProps & {\n href: string;\n target?: string;\n rel?: string;\n type?: never;\n};\n\nexport type ButtonProps = ButtonAsButton | ButtonAsLink;\n\nfunction tierClass(tier: ButtonTier): string | undefined {\n if (tier === \"primary\") return classes[\"tierPrimary\"];\n if (tier === \"tertiary\") return classes[\"tierTertiary\"];\n return classes[\"tierSecondary\"];\n}\n\nfunction colorClass(color: ButtonColor): string | undefined {\n if (color === \"info\") return classes[\"colorInfo\"];\n if (color === \"success\") return classes[\"colorSuccess\"];\n if (color === \"warning\") return classes[\"colorWarning\"];\n if (color === \"danger\") return classes[\"colorDanger\"];\n return undefined;\n}\n\nfunction sizeClass(size: ButtonSize): string | undefined {\n if (size === \"small\") return classes[\"btnSmall\"];\n if (size === \"large\") return classes[\"btnLarge\"];\n return undefined;\n}\n\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: flat prop-to-class composition plus one anchor/button branch; splitting would just hide the mapping.\nexport function Button(props: ButtonProps): JSX.Element {\n const {\n id,\n tier = \"secondary\",\n color = \"default\",\n size = \"normal\",\n disabled = false,\n fullWidth = false,\n circle = false,\n className,\n title,\n icon,\n label,\n } = props;\n\n const parts = [classes[\"btn\"] ?? \"\"];\n const tc = tierClass(tier);\n if (tc) parts.push(tc);\n const cc = colorClass(color);\n if (cc) parts.push(cc);\n const sc = sizeClass(size);\n if (sc) parts.push(sc);\n if (circle) parts.push(classes[\"btnCircle\"] ?? \"\");\n if (fullWidth) parts.push(classes[\"btnFullWidth\"] ?? \"\");\n if (className) parts.push(className);\n const buttonClass = parts.filter(Boolean).join(\" \");\n\n const content = icon ? (\n <Layout inline columns=\"auto auto\" gap=\"0.5em\" alignItems=\"center\">\n {icon}\n <span>{label}</span>\n </Layout>\n ) : (\n label\n );\n\n const dataAction = props[\"data-action\"];\n const ariaLabel = props[\"aria-label\"];\n // Collect every `data-action-*` extra the consumer passed so the\n // event delegator can read them off the rendered element. Without\n // this, anything beyond `data-action` is silently dropped and\n // handlers fire with an empty `ctx.data`.\n const actionDataAttrs: Record<string, string> = {};\n for (const key of Object.keys(props)) {\n if (key.startsWith(\"data-action-\")) {\n const value = (props as unknown as Record<string, unknown>)[key];\n if (typeof value === \"string\") {\n actionDataAttrs[key] = value;\n }\n }\n }\n\n if (\"href\" in props && props.href) {\n return (\n <a\n id={id}\n class={buttonClass}\n title={title}\n href={disabled ? undefined : props.href}\n target={\"target\" in props ? props.target : undefined}\n rel={\"rel\" in props ? props.rel : undefined}\n aria-disabled={disabled}\n aria-label={ariaLabel}\n data-polly-ui\n data-polly-button={tier}\n data-action={dataAction}\n {...actionDataAttrs}\n >\n {content}\n </a>\n );\n }\n\n const resolvedType: \"button\" | \"submit\" | \"reset\" =\n \"type\" in props && props.type ? props.type : \"button\";\n\n return (\n <button\n id={id}\n class={buttonClass}\n title={title}\n type={resolvedType}\n disabled={disabled}\n aria-label={ariaLabel}\n data-polly-ui\n data-polly-button={tier}\n data-action={dataAction}\n {...actionDataAttrs}\n >\n {content}\n </button>\n );\n}\n",
10
10
  "/**\n * Checkbox — native checkbox wrapped in a label.\n *\n * Pass a plain boolean for controlled use (caller listens elsewhere),\n * or a Signal<boolean> to have the primitive bind its own change\n * listener and mutate the signal directly. The label wraps the input\n * so clicks anywhere in the target area toggle it.\n */\n\nimport type { Signal } from \"@preact/signals\";\nimport type { JSX } from \"preact\";\nimport classes from \"./Checkbox.module.css\";\n\nexport type CheckboxProps = {\n checked?: boolean | Signal<boolean>;\n defaultChecked?: boolean;\n name?: string;\n disabled?: boolean;\n label?: string;\n className?: string;\n id?: string;\n};\n\nfunction isSignal(value: unknown): value is Signal<boolean> {\n return typeof value === \"object\" && value !== null && \"value\" in value && \"peek\" in value;\n}\n\nexport function Checkbox(props: CheckboxProps): JSX.Element {\n const { checked, defaultChecked, name, disabled = false, label, className, id } = props;\n\n const handleChange = (e: JSX.TargetedEvent<HTMLInputElement>): void => {\n if (isSignal(checked)) {\n checked.value = e.currentTarget.checked;\n }\n };\n\n const checkedValue = isSignal(checked) ? checked.value : checked;\n\n const parts = [classes[\"checkbox\"]];\n if (disabled) parts.push(classes[\"disabled\"] ?? \"\");\n if (className) parts.push(className);\n\n return (\n <label class={parts.filter(Boolean).join(\" \")} data-polly-ui data-polly-checkbox>\n <input\n id={id}\n type=\"checkbox\"\n class={classes[\"input\"]}\n checked={checkedValue}\n defaultChecked={defaultChecked}\n name={name}\n disabled={disabled}\n onChange={handleChange}\n />\n {label !== undefined && <span class={classes[\"label\"]}>{label}</span>}\n </label>\n );\n}\n",
11
11
  "/**\n * Collapsible — native <details>/<summary> wrapper.\n *\n * Uses the browser's built-in disclosure semantics so keyboard and\n * screen-reader behaviour come free. A ::before arrow rotates on open.\n * Colors, spacing, and motion come from tokens; `prefers-reduced-motion`\n * zeroes the rotation via the motion token.\n */\n\nimport type { ComponentChildren, JSX } from \"preact\";\nimport classes from \"./Collapsible.module.css\";\n\nexport type CollapsibleProps = {\n summary: string;\n children: ComponentChildren;\n defaultOpen?: boolean;\n className?: string;\n id?: string;\n};\n\nexport function Collapsible(props: CollapsibleProps): JSX.Element {\n const { summary, children, defaultOpen = false, className, id } = props;\n const parts = [classes[\"collapsible\"]];\n if (className) parts.push(className);\n return (\n <details\n id={id}\n class={parts.join(\" \")}\n open={defaultOpen}\n data-polly-ui\n data-polly-collapsible\n >\n <summary class={classes[\"summary\"]}>{summary}</summary>\n <div class={classes[\"content\"]}>{children}</div>\n </details>\n );\n}\n",
12
12
  "/**\n * ConfirmDialog — Promise-returning confirmation primitive.\n *\n * `confirm({ title, body, danger })` returns Promise<boolean>. Opens the\n * rendered `<ConfirmDialog.Host />` modal (which must be mounted once at\n * the app root). User picking confirm or cancel resolves the promise.\n * Escape, backdrop click, and explicit `.dismiss()` resolve false.\n */\n\nimport { signal } from \"@preact/signals\";\nimport type { JSX } from \"preact\";\nimport classes from \"./ConfirmDialog.module.css\";\nimport { Modal } from \"./Modal.tsx\";\n\ntype ConfirmRequest = {\n id: number;\n title: string;\n body?: string;\n danger?: boolean;\n confirmLabel?: string;\n cancelLabel?: string;\n resolve: (value: boolean) => void;\n};\n\nconst pending = signal<ConfirmRequest | null>(null);\nconst isOpen = signal(false);\nlet nextId = 0;\n\nexport type ConfirmOptions = {\n title: string;\n body?: string;\n danger?: boolean;\n confirmLabel?: string;\n cancelLabel?: string;\n};\n\nexport function confirm(options: ConfirmOptions): Promise<boolean> {\n return new Promise<boolean>((resolve) => {\n nextId += 1;\n pending.value = {\n id: nextId,\n title: options.title,\n body: options.body,\n danger: options.danger,\n confirmLabel: options.confirmLabel,\n cancelLabel: options.cancelLabel,\n resolve,\n };\n isOpen.value = true;\n });\n}\n\nfunction close(result: boolean): void {\n const current = pending.value;\n if (!current) return;\n isOpen.value = false;\n pending.value = null;\n current.resolve(result);\n}\n\n/** Renders the active confirm dialog. Mount once near the app root. */\nfunction Host(): JSX.Element | null {\n const current = pending.value;\n if (!current) return null;\n return (\n <Modal.Root when={isOpen} onClose={() => close(false)}>\n <Modal.Backdrop />\n <Modal.Content>\n <Modal.Header>\n <Modal.Title>{current.title}</Modal.Title>\n </Modal.Header>\n {current.body ? <Modal.Body>{current.body}</Modal.Body> : null}\n <Modal.Footer>\n <div class={classes[\"actions\"]} data-polly-confirm-actions>\n <button\n type=\"button\"\n class={classes[\"cancel\"]}\n data-polly-ui\n data-polly-interactive\n data-polly-confirm-cancel\n onClick={() => close(false)}\n >\n {current.cancelLabel ?? \"Cancel\"}\n </button>\n <button\n type=\"button\"\n class={current.danger ? classes[\"confirmDanger\"] : classes[\"confirm\"]}\n data-polly-ui\n data-polly-interactive\n data-polly-confirm-ok\n onClick={() => close(true)}\n >\n {current.confirmLabel ?? \"OK\"}\n </button>\n </div>\n </Modal.Footer>\n </Modal.Content>\n </Modal.Root>\n );\n}\n\nexport const ConfirmDialog = { Host, confirm };\n",
@@ -25,7 +25,7 @@
25
25
  "/**\n * Global error surface for action handlers.\n *\n * Actions that fail set the errorState signal via `submitError`; a `<Toast>`\n * component consumes that signal and renders a dismissable message. Handlers\n * that catch expected failures (validation, quota) may call `setError` directly.\n */\n\nimport { signal } from \"@preact/signals\";\n\nexport type ErrorSeverity = \"error\" | \"warning\" | \"info\";\n\nexport type ErrorEntry = {\n id: string;\n message: string;\n severity: ErrorSeverity;\n action?: string;\n createdAt: number;\n};\n\nexport const errorState = signal<ErrorEntry[]>([]);\n\nlet nextId = 0;\nfunction allocId(): string {\n nextId += 1;\n return `polly-err-${nextId}`;\n}\n\nexport function setError(\n message: string,\n opts: { severity?: ErrorSeverity; action?: string } = {}\n): string {\n const entry: ErrorEntry = {\n id: allocId(),\n message,\n severity: opts.severity ?? \"error\",\n action: opts.action,\n createdAt: Date.now(),\n };\n errorState.value = [...errorState.value, entry];\n return entry.id;\n}\n\nexport function clearError(id?: string): void {\n if (id === undefined) {\n errorState.value = [];\n return;\n }\n errorState.value = errorState.value.filter((e) => e.id !== id);\n}\n\n/**\n * Convenience wrapper for an action's catch block.\n * Logs the action name + error and surfaces a user-visible message.\n */\nexport function submitError(action: string, err: unknown): string {\n const message = err instanceof Error ? err.message : String(err);\n return setError(message, { action, severity: \"error\" });\n}\n",
26
26
  "/**\n * Toggle — switch-role checkbox.\n *\n * A visually-hidden <input role=\"switch\"> paired with a styled track\n * and thumb inside a <label>. Passive: the caller drives `checked` and\n * handles state changes via the action registry (wrap the Toggle in a\n * <label data-action=\"...\"> or bind a parent form's submit). a11y\n * attributes come from the native input; the label wraps so clicks\n * anywhere in the control toggle the input.\n */\n\nimport type { JSX } from \"preact\";\nimport classes from \"./Toggle.module.css\";\n\nexport type ToggleProps = {\n checked?: boolean;\n disabled?: boolean;\n label?: string;\n name?: string;\n className?: string;\n id?: string;\n};\n\nexport function Toggle(props: ToggleProps): JSX.Element {\n const { checked = false, disabled = false, label, name, className, id } = props;\n const parts = [classes[\"toggle\"]];\n if (disabled) parts.push(classes[\"disabled\"]);\n if (className) parts.push(className);\n return (\n <label class={parts.join(\" \")} data-polly-ui data-polly-toggle>\n <input\n id={id}\n type=\"checkbox\"\n role=\"switch\"\n name={name}\n aria-checked={checked}\n class={classes[\"input\"]}\n checked={checked}\n disabled={disabled}\n />\n <span class={checked ? `${classes[\"track\"]} ${classes[\"trackChecked\"]}` : classes[\"track\"]}>\n <span\n class={checked ? `${classes[\"thumb\"]} ${classes[\"thumbChecked\"]}` : classes[\"thum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AAAA,MACD,UAAU,6BAAa,SAAwC,QAAxC;AAAA,QAAM,OAAO,sBAAQ;AAAA,QAArB,UAAgC;AAAA,SAAhC,iCAAwC;AAAA;AAAA,KAhBlE,gCAiBE;AAAA;",
29
+ "debugId": "E72D085699D0FDDF64756E2164756E21",
30
30
  "names": []
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fairfox/polly",
3
- "version": "0.27.1",
3
+ "version": "0.27.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Multi-execution-context framework with reactive state and cross-context messaging for Chrome extensions, PWAs, and worker-based applications",