agent-mailbox — Mailbox and Wake System for AI Agent Teams

v0.7.6
io.github.polaris-smart/agent-mailbox Checked 3 days ago Published 2 months ago

Mailbox + wake system for AI agent teams: letters always land, right agent wakes, quiet otherwise.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

mailbox_register

Register this member and claim its mailbox. Idempotent — safe to call again. ``kind`` (v0.7.5): ``owner`` (the human), ``agent`` (a local agent) or ``guest`` (an external source). Empty keeps the existing/default kind; an explicit kind is a visibility decision and is written to audit.log.

ParameterTypeDescription
agent_id *string
descriptionstring
kindstring
ownerstring

mailbox_send

Send a message to one agent, a list of agents, or "all" for broadcast. dedupe=True (default) suppresses a re-send of semantically identical mail to a recipient whose inbox still holds it non-terminal (pending / acked) within the 24h dedup window: that recipient's entry comes back as {"to", "deduped": true, "existing_id"} with zero side effects — no letter, no sent.log line, no webhook. Pass dedupe=False to exempt periodic jobs. "count" counts only letters that actually landed. v0.7.5: ``sealed=True`` marks a 密封信 — the body stays readable only through…

ParameterTypeDescription
body *string
subject *string
to *
attentionstring
dedupeboolean
from_idstring
links
originstring
pairing_tokenstring
prioritystring
reply_to
sealedboolean

mailbox_check

Fetch your pending letters and your true backlog. Call at session start. v0.7.6 (F 状态可信): by default this is a **read-only probe** — letters stay ``pending``; counting mail never consumes it (禁自动 ack). The numbers report the mailbox as it is *right now*, straight from the store: - ``unread`` — 真·待办: letters currently ``pending``. Acked letters are never counted, so a mailbox full of acked-but-unhandled mail reports ``unread: 0`` honestly (the pre-0.7.6 bug: it counted the letters the call itself had just acked). - ``total`` — a…

ParameterTypeDescription
agent_idstring
markboolean

mailbox_reply

Reply to a message thread. Routes to the original sender automatically.

ParameterTypeDescription
body *string
msg_id *string
agent_idstring

mailbox_list

List messages in your mailbox, optionally filtered by status and/or thread. Spans inbox **and** archive: ``check()`` moves handled letters into the archive, so an inbox-only view reports zero for any agent that drains regularly (HS 09-24: five status queries all returned 0 against 877 on-disk letters). ``thread`` takes a thread_id, or any subject on the thread (legacy letters without a thread_id are matched by the subject key heuristic).

ParameterTypeDescription
agent_idstring
status
thread

mailbox_thread

Pull one thread in time order across every agent (inbox + archive). ``thread`` may be a thread_id, any message id on the thread, or a subject on the thread. Legacy letters without an id/thread_id are included via the subject-key heuristic (Re:/Fwd: prefixes stripped), so a 12-deep "Re: Re: ..." chain resolves to one thread. Letters come back oldest first with their status, so the full cross-agent conversation is visible in one call. v0.7.5 scope: an ``agent``/``guest`` caller sees only the letters it took part in (from/to includes them) — if the thread exist…

ParameterTypeDescription
thread *string

mailbox_done

Mark a message as handled. Done messages can be archived.

ParameterTypeDescription
msg_id *string
agent_idstring

mailbox_confirm_external

Human confirmation gate for an external-origin letter (§3.3). Flips ``origin`` external→local so the wake/webhook paths may act on it. Only an owner-kind member (``boss`` or a registered ``owner``) may confirm; the operation appends to audit.log and the letter's handled_log (greppable by name). Anything else is a structured rejection.

ParameterTypeDescription
msg_id *string
actor_idstring

mailbox_broadcast

Broadcast to every registered agent (including boss). dedupe=True (default) suppresses semantically identical re-broadcasts per recipient within the dedup window — see mailbox_send.

ParameterTypeDescription
body *string
subject *string
dedupeboolean
from_idstring

mailbox_whoami

List all registered agents and the mail root location.

mailbox_wait

Block until a new message arrives (long-poll, up to timeout). Returns immediately if pending messages exist. Import 'time' is at module top.

ParameterTypeDescription
agent_idstring
timeout_secondsnumber

task_create

Create a task card (starts at todo). The assignee is auto-messaged — skip with notify=False.

ParameterTypeDescription
assignee *string
title *string
duestring
from_idstring
notifyboolean

task_move

Move a task along todo→doing→review→done. Skips need force=True; done is terminal. Pass assignee to reassign. The (new) assignee is auto-messaged — moving a card wakes its owner.

ParameterTypeDescription
status *string
task_id *string
assignee
forceboolean
from_idstring
notestring
notifyboolean

task_list

List task cards, optionally filtered by assignee and/or status.

ParameterTypeDescription
assignee
status