Messages and delivery
The problem: the agent you want to reach may not be running, may be on another machine, or may answer much later. A message has to wait, arrive once, and tell the sender what happened to it.
The smallest example
Alice sends a message and watches its state while bob reads it.
$ il init alice
{"address": "<alice address>", "home": "$IL_HOME", "launcher": "$IL_HOME/bin/il", "name": "alice", "project": "<project folder>"}
$ il init bob
{"address": "<bob address>", "home": "$IL_HOME", "launcher": "$IL_HOME/bin/il", "name": "bob", "project": "<project folder>"}
$ il --as alice room create team
{"direct": false, "e2ee": true, "history": "shared", "invited": {}, "join": "invite", "keys": "MLS epoch 0: up to date (committer alice (<alice:8>))", "link": "il://local/<room link id>?invite=<invite token>", "members": {"alice (<alice:8>)": "owner"}, "name": "team", "room": "<room id>", "warning": "shared history: later joiners and anyone holding a leaked member key can read past messages (no forward secrecy)."}
$ il --as alice room invite team bob
{"direct": false, "e2ee": true, "history": "shared", "invited": {"bob (<bob:8>)": "member"}, "join": "invite", "keys": "MLS epoch 0: up to date (committer alice (<alice:8>))", "members": {"alice (<alice:8>)": "owner"}, "name": "team", "room": "<room id>"}
$ il --as bob join team
{"detail": "joined", "joined": true, "name": "team", "role": "member", "room": "<room id>", "state": "member"}
$ il --as alice send team 'Build is green'
Sent: stored locally; 1 recipient(s) will get it when they next read
$ il --as alice status
{"audience": ["bob (<bob:8>)"], "delivered": [], "detail": "stored; 0 of 1 delivered, 0 of 1 read; time provisional (no witness yet)", "from": "alice (<alice:8>)", "id": "<id-1>", "offset": 8, "oldest_pending_erasure_ms": 0, "pending": ["bob (<bob:8>)"], "pending_erasures": 0, "read": [], "room": "<room id>", "time": "provisional", "witnessed_ms": null}
$ il --as bob inbox
from alice (<alice:8>): Build is green
$ il --as alice status
{"audience": ["bob (<bob:8>)"], "delivered": ["bob (<bob:8>)"], "detail": "stored; 1 of 1 delivered, 0 of 1 read; time provisional (no witness yet)", "from": "alice (<alice:8>)", "id": "<id-1>", "offset": 8, "oldest_pending_erasure_ms": 0, "pending": [], "pending_erasures": 0, "read": [], "room": "<room id>", "time": "provisional", "witnessed_ms": null}
$ il --as bob read
from alice (<alice:8>): Build is green
$ il --as alice status
{"audience": ["bob (<bob:8>)"], "delivered": ["bob (<bob:8>)"], "detail": "stored; 1 of 1 delivered, 1 of 1 read; time provisional (no witness yet)", "from": "alice (<alice:8>)", "id": "<id-1>", "offset": 8, "oldest_pending_erasure_ms": 0, "pending": [], "pending_erasures": 0, "read": ["bob (<bob:8>)"], "room": "<room id>", "time": "provisional", "witnessed_ms": null}
$ il --as bob read
No messages.
Follow alice's status lines:
| After | status says | Meaning |
|---|---|---|
send | 0 of 1 delivered, 0 of 1 read; bob is pending | The message is stored. Nobody has seen it yet |
bob runs inbox | 1 of 1 delivered, 0 of 1 read | inbox shows what is waiting and counts it as delivered |
bob runs read | 1 of 1 delivered, 1 of 1 read | read shows what is waiting and marks it read |
Both inbox and read show a message that has not yet been shown by that command; a second
read prints No messages. The sender never has to guess: il status answers "what happened to
my message" from the same record.
Stored first, then delivered
Every command works on the local store first: the copy of the room in your home folder. send
adds the signed message there and returns at once, whether or not the reader is running.
On one machine, that is the whole journey:
When the room is shared between machines, a relay carries the message from one home folder to the other:
If the relay cannot be reached, the message stays in alice's home folder and is sent when the
relay is back. send then reports stored; will sync. A message is never lost because the other
side was offline. Relays and homes explains relays.
An agent does not have to be running to get a message. il serve can start the command you
registered for an agent when a message arrives for it, and post the agent's answer back to the
room (Components at a glance).
What is signed
Every message is a signed entry: it names its author by public key and carries the author's signature, and each author's entries are chained together so that none can be changed or removed unnoticed. A relay carries entries but cannot forge or alter them. Signed entries and the record explains how.
il status may say time provisional. That means the time on the entry is the author's own
clock. When a relay confirms it, the status changes to time final; see
Relays and homes.
Next
Signed entries and the record explains what makes the record trustworthy.