Expand description
The node’s letter pipeline: letter in -> policy -> g4a deliver (or refuse; the letter stays in the inbox).
m4a only hands letters over (its M4A_LETTER_HOOK, the door session.wake); this node’s own
mailbox is a second letter source (the node-mail host action below). The node decides what a
letter may do, from an operator file (--wake-policy <file>, JSON):
{
"terminal_typing": ["<nick>"],
"routines": { "<nick>": { "credential_command": ["<program>", "<arg>"] } },
"spawn_profiles": { "<nick>": { "provider": "kimi", "command": ["<program>"] } },
"node_mail_to": "<nick>"
}- A live session with a structured prompt channel gets the letter as a turn (deliver).
- A raw-terminal session (typing into its PTY) is the terminal capability: refused unless the
policy names that nick in
terminal_typing. - A nick bound to a routine (a vendor-hosted web session) gets one routine POST through g4a’s
deliver API (
gate4agent_wake::routine). The routine URL and key come from the operator’scredential_command(stdout:{"url": "...", "key": "..."}), are kept in memory for the one call and are never logged. - Offline wake: a nick with a
spawn_profilesentry launches that preconfigured command (fixed argv; the letter never becomes an argument).
Nothing here embeds a host, key or name; all of it comes from the policy file.
Structs§
- Mail
Outcome - What one node-mail tick did with one message.
- Mail
Seen - The node-mail host action’s memory: message ids already handled.
Noneuntil the first inbox read (which is not replayed). - Routine
Letter - One letter for a routine.
- Routine
Target - One routine target: how to get its URL and key at delivery time.
- Session
Letter - A core wake letter for one of this node’s live sessions (not a routine/spawn nick).
- Spawn
Profile - Preconfigured launch for an offline nick. The letter never becomes an argv entry.
- Wake
Policy - The operator’s letter policy for this node. The default delivers to live sessions only.
Enums§
- Route
- The pipeline’s decision for one letter.
- Session
Shape - What the session that owns a nick looks like right now.
Functions§
- deliver_
routine - Delivers
letterthrough g4a’s routine POST.Ok(status)on 2xx. - launch_
spawn_ profile - Runs a spawn profile’s fixed command. The letter is not passed on argv (or at all).
Ok(())when the process started; the caller does not wait for the provider turn. - letter_
room (room label for the letter, address a reply goes to)for a message addressed totofromfrom:room:NAMEstaysNAMEand is answered in the room; anything else isdm:<from>.- node_
mail_ tick - route
- Decides the route for a letter to
nick. - routine_
credential - Runs the target’s credential command;
(url, key). Errors never carry its output. - session_
letters - Unseen wake letters that name a nick without a routine or spawn profile: these go to the
node’s live session with that nick (letter wake), not to
node_mail_to. - wake_
line - The wake line a live session gets instead of the letter text.
- wake_
nick - One node-mail tick over a
mail.inboxreply: every new message goes topolicy.node_mail_tothrough the pipeline. The first tick only records what is already there. Session nick named by a core wake letter (subject = "wake <nick>").