sigelo-contact 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,28 +9,32 @@ the other's sigelo chain offline; a key rotation keeps the contact. MIT; the rel
9
9
  ```sh
10
10
  sigelo-agent invite --name bob # alice: K7F3-Q9ZP, once, 10 minutes
11
11
  sigelo-agent accept <code> --name alice # bob: checks alice offline, pairs
12
- sigelo-agent send bob "hello" # sent, or queued until bob's agent connects
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
14
14
  sigelo-agent inbox # what came since last time
15
+ sigelo-agent history --since 3600 # again, no relay
15
16
  ```
16
17
 
17
18
  Also `contacts`, `forget <did>`, and all as MCP tools
18
19
  ([`integrations/mcp/contact.mjs`](../integrations/mcp/contact.mjs)).
19
- Each verb logs in once (30 a minute per network), never beside its `sigelo-agent watch` or `ui`
20
+ Each verb logs in once (30/minute per network), never beside `watch` or `ui`
20
21
  ([one owner](../adapters/moadim/WATCH.md)).
21
- The first login proves work (5–60 s on a phone). `SIGELO_RELAY` names the relay for new codes
22
- (default `relay.sigelo.ai`); a Pro reader sets `SIGELO_RELAY_RETENTION_DAYS=90`. State sits
23
- beside the identity file (0600); messages wait there in plaintext until `inbox` takes them.
22
+ The first login proves work (5–60 s on phones). `SIGELO_RELAY` names the relay for new codes;
23
+ a Pro reader sets `SIGELO_RELAY_RETENTION_DAYS=90`. State sits
24
+ beside the identity file (0600), plaintext: messages until `inbox` takes them, then the last 500
25
+ in `<identity>.inbox.log`.
24
26
  `carrier.mjs`'s header is its API; with `onEvent`, nothing is kept.
25
27
 
26
- ## Tests
28
+ **Sandboxes and firewalls.** Messaging dials only the relay, `relay.sigelo.ai` by default: 8883, else
29
+ 443 (automatic; `SIGELO_RELAY_TRANSPORT=wss` skips the 5 s probe). `HTTPS_PROXY`, `NO_PROXY` apply.
30
+ Allow that hostname on 443; install needs the npm registry.
27
31
 
28
- Node 22.18 or newer.
32
+ ## Tests
29
33
 
30
34
  ```sh
31
35
  node test-invite.mjs && node test-envelope.mjs
32
- node test-carrier.mjs # with ../relay, on loopback
33
- sh ../demo/two-machines.sh # two agents end to end
36
+ node test-carrier.mjs && node test-ws.mjs # with ../relay, on loopback
37
+ sh ../demo/two-machines.sh
34
38
  ```
35
39
 
36
40
  ## Contracts
@@ -41,36 +45,35 @@ sh ../demo/two-machines.sh # two agents end to end
41
45
  | `sigelo-msg/0` | `fixtures/envelope-v0.json` | envelope bytes, prekeys, key schedule, epoch recovery |
42
46
  | `sigelo-carrier/0` | `fixtures/carrier-v0.json` | frames of kinds 1, 2, 4 and 5, their keys, refusals |
43
47
 
44
- Each regenerates byte for byte from seeds (`gen-*.mjs`); refusals name their check
45
- (`MsgError.check`).
48
+ Each regenerates byte for byte from seeds (`gen-*.mjs`).
46
49
 
47
50
  ## How it works
48
51
 
49
- 1. **Code**: the inviter's current DID digest, a one-time secret, expiry, relay, checksum. The
50
- secret yields both invite topics and their key.
52
+ 1. **Code**: the inviter's current DID digest, a one-time secret (yielding both invite topics and
53
+ their key), expiry, relay, checksum.
51
54
  2. **Handshake**: bob answers with his chain, a proof for this code and a one-time X-Wing key;
52
55
  alice checks it and replies with her chain, prekeys and the encapsulation, all signed.
53
56
  `K = HKDF(secret ‖ X-Wing secret)`; each keeps the other under its original DID.
54
- 3. **Mailboxes**: one topic per direction per ISO week, from `K`, held from retention back to a
55
- week ahead.
57
+ 3. **Mailboxes**: one topic per direction per ISO week, from `K`, held from retention to a week
58
+ ahead.
56
59
  4. **Envelope**: signed by the identity key, encrypted (XChaCha20-Poly1305) under a chain begun
57
- on a single-use prekey of the recipient's, padded to whole 256-byte blocks. Until the sender
60
+ on a recipient's single-use prekey, padded to whole 256-byte blocks. Until the sender
58
61
  reads a reply, each envelope repeats the encapsulation: a reader offline past retention loses
59
62
  those messages, not the epoch. Prekeys travel under `K`, replaced weekly.
60
63
  5. **Rotation**: the rotated agent sends each contact its chain under `K`, proven by its new key,
61
64
  until the contact confirms it, so recovery beats a thief (SPEC §7.1). After a recovery both
62
65
  mark the pairing `re_pair`: only that notice goes under `K` until a new code replaces it.
63
- 6. **Relay login**: a signed `{v:"sigelo-relay/0", typ:"relay-login", did, relay, nonce}`, a
64
- type no challenge signer produces.
66
+ 6. **Relay login**: a signed `{v:"sigelo-relay/0", typ:"relay-login", did, relay, nonce}`, which
67
+ no challenge signer produces.
65
68
 
66
- Key agreement is hybrid post-quantum (X25519 + ML-KEM-768), as in Signal and SimpleX.
69
+ Key agreement is hybrid post-quantum (X25519 + ML-KEM-768).
67
70
 
68
71
  ## What it does not do
69
72
 
70
- - Find anyone (codes travel out of band), hide who talks to whom from the relay, or deny.
73
+ - Find anyone (codes travel out of band), hide who talks to whom, or deny.
71
74
  - Heal inside an epoch after a key theft (no double ratchet): a stolen state file reads what
72
75
  contacts write until the next weekly prekey replacement.
73
76
  - Confirm delivery (the relay acknowledges, not the contact): a relay withholding an epoch's key
74
77
  agreement loses what follows until fresh prekeys restart it.
75
- - Check where a stranger's relay resolves: only its name is checked.
76
- - Push, groups, direct delivery, a second carrier (version 2), unsend.
78
+ - Check where a stranger's relay resolves.
79
+ - Push, groups, direct delivery, unsend.