sigelo-contact 0.1.14 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +13 -10
  2. package/call.mjs +831 -0
  3. package/carrier.mjs +1013 -112
  4. package/control.mjs +81 -22
  5. package/device.mjs +1 -1
  6. package/enrol.mjs +214 -35
  7. package/gen-carrier.mjs +4 -4
  8. package/gen-device.mjs +2 -2
  9. package/gen-envelope.mjs +3 -3
  10. package/gen-invite.mjs +3 -3
  11. package/gen-short.mjs +3 -3
  12. package/group.mjs +28 -9
  13. package/invite.mjs +63 -13
  14. package/kdf.mjs +1 -1
  15. package/link.mjs +1 -1
  16. package/package.json +34 -7
  17. package/page.mjs +1018 -81
  18. package/photo.mjs +37 -0
  19. package/platform-node.mjs +110 -13
  20. package/prekeys.mjs +10 -2
  21. package/public.mjs +93 -0
  22. package/relays.mjs +1 -1
  23. package/restore.mjs +3 -3
  24. package/rtc-web.mjs +109 -0
  25. package/short.mjs +19 -3
  26. package/store.mjs +126 -10
  27. package/test-carrier.mjs +121 -18
  28. package/test-device.mjs +1 -1
  29. package/test-enrol.mjs +123 -8
  30. package/test-envelope.mjs +16 -3
  31. package/test-file.mjs +5 -5
  32. package/test-group.mjs +48 -7
  33. package/test-invite.mjs +15 -2
  34. package/test-link.mjs +6 -6
  35. package/test-platform.mjs +5 -5
  36. package/test-presence.mjs +5 -5
  37. package/test-push.mjs +136 -0
  38. package/test-relay-lane.mjs +323 -0
  39. package/test-short.mjs +35 -12
  40. package/test-tier.mjs +6 -6
  41. package/test-transfer-web.mjs +313 -0
  42. package/test-transfer.mjs +51 -11
  43. package/test-voice.mjs +161 -0
  44. package/test-ws.mjs +5 -5
  45. package/transfer-engine.mjs +858 -0
  46. package/transfer-node.mjs +254 -641
  47. package/transfer-web.mjs +80 -0
  48. package/transfer.mjs +25 -6
  49. package/voice-web.mjs +113 -0
  50. package/voice.mjs +70 -0
  51. package/words-lock.mjs +25 -10
package/README.md CHANGED
@@ -7,7 +7,7 @@ the other's sigelo chain offline; a key rotation keeps the contact. MIT; the rel
7
7
  [sigelo-relay](https://github.com/csigelo/sigelo-relay), is AGPL-3.0.
8
8
 
9
9
  ```sh
10
- sigelo-agent invite --name bob # alice: K7F3-Q9ZP, once, 10 minutes
10
+ sigelo-agent invite --name bob # alice: K7F3-Q9ZP, once, 10 minutes (--ttl: up to 1h)
11
11
  sigelo-agent accept <code> --name alice # bob: checks alice offline, pairs
12
12
  sigelo-agent send bob "hello" # sent, or queued for bob
13
13
  seq 3 | sigelo-agent send bob - --lines # one message a line, one login
@@ -16,14 +16,15 @@ sigelo-agent history --since 3600 # again, no relay
16
16
  ```
17
17
 
18
18
  Also `contacts`, `forget <did>`; all as MCP tools
19
- ([`integrations/mcp/contact.mjs`](../integrations/mcp/contact.mjs)).
19
+ ([`apps/integrations/mcp/contact.mjs`](../integrations/mcp/contact.mjs)).
20
20
  Each verb logs in once, never beside `watch` or `ui`
21
- ([one owner](../adapters/moadim/WATCH.md)).
22
- The first login proves work (5–60 s on phones). `SIGELO_RELAY` names the relay for new codes;
21
+ ([one owner](../agent/WATCH.md)).
22
+ The first login proves work (Argon2id, ~30 s on phones). `SIGELO_RELAY` names the relay for new codes;
23
23
  a Pro reader sets `SIGELO_RELAY_RETENTION_DAYS=90`. State sits
24
24
  beside the identity file (0600), plaintext: messages until `inbox` takes them, then the last 500
25
25
  in `<identity>.inbox.log`.
26
- `carrier.mjs`'s header is its API.
26
+ `carrier.mjs`'s header is its API: `invite({ ttl })` (a short code 60 s to 1 h), each message's `id`,
27
+ `reply(id, …)` and `replyStatus(id)`.
27
28
 
28
29
  **Short codes.** `K7F3-Q9ZP` lives at `relay.sigelo.ai`; another relay's adds its tag:
29
30
  `K7F3-Q9ZP-FNK5`, 20 bits of SHA-256(`sigelo-relay-tag/0` ‖ host). `accept` finds it among known
@@ -39,8 +40,8 @@ Allow it on 443.
39
40
 
40
41
  ```sh
41
42
  node test-invite.mjs && node test-envelope.mjs
42
- node test-carrier.mjs && node test-ws.mjs # ../relay, loopback
43
- sh ../demo/two-machines.sh
43
+ node test-carrier.mjs && node test-ws.mjs # ../../relay, loopback
44
+ sh ../../tools/demo/two-machines.sh
44
45
  ```
45
46
 
46
47
  ## Contracts
@@ -65,7 +66,9 @@ Each regenerates byte for byte from seeds (`gen-*.mjs`).
65
66
  4. **Envelope**: signed by the identity key, encrypted (XChaCha20-Poly1305) under a chain from
66
67
  a single-use prekey, padded to 256-byte blocks. Until the sender
67
68
  reads a reply, each envelope repeats the encapsulation: a reader offline past retention loses
68
- those messages, not the epoch. Prekeys travel under `K`, replaced weekly.
69
+ those messages, not the epoch. Prekeys travel under `K`, replaced weekly or every
70
+ `SIGELO_PREKEY_DAYS` days (1 to 7, local, not on the wire): a stolen state file reads incoming
71
+ messages only until the next replacement reaches the contact.
69
72
  5. **Rotation**: the rotated agent sends each contact its chain under `K`, proven by its new key,
70
73
  until the contact confirms it, so recovery beats a thief (SPEC §7.1). After a recovery both
71
74
  mark the pairing `re_pair`: only that notice goes under `K` until a new code replaces it.
@@ -76,8 +79,8 @@ Key agreement: hybrid post-quantum (X25519 + ML-KEM-768).
76
79
 
77
80
  - Find anyone (codes travel out of band), hide who talks to whom, or deny.
78
81
  - Heal inside an epoch after a key theft (no double ratchet): a stolen state file reads what
79
- contacts write until the weekly prekey replacement.
80
- - Confirm delivery (the relay acknowledges, not the contact): a relay withholding an epoch's key
82
+ contacts write until the next prekey replacement.
83
+ - Confirm delivery (the relay acknowledges; seen receipts: `seen()`): a relay withholding an epoch's key
81
84
  agreement loses what follows until prekeys restart it.
82
85
  - Check where a stranger's relay resolves.
83
86
  - Push, groups, direct delivery, unsend.