AWP

The driver

python -m awp runs a peer driven over stdin and stdout, for tests and other languages.

python -m awp --state DIR [--name NAME] listen tcp:127.0.0.1:7000
python -m awp --state DIR [--name NAME] connect tc...

The driver is a Peer whose commands come from stdin and whose events go to stdout, one JSON object per line each way. It is what the reference implementation’s interop tests drive, and the TypeScript SDK’s awp-peer speaks the same contract, so a test written once runs against both.

ADDR is tcp:HOST:PORT, unix:/path, tailcat (to listen) or a tailcat address (to connect). Other flags: --ping-interval SECS (default 30, 0 disables), --max-blob BYTES (default 50 MiB), --trust KEY (repeatable), --about TEXT, -v for debug logging on stderr. Closing stdin does not stop the peer.

Commands (stdin)

CommandFieldsDoes
sendth, text, optional subject, re, partsSends a msg in thread th; parts appends raw code or data parts after the text part.
stateth, state, optional noteSends a state for the thread.
blobth, path, optional textSends the file as chunks, then a msg with a blob part.
grantsub, caps, ttlMints a grant to sub for caps, valid ttl seconds, and sends it.
byeoptional reasonCloses gracefully.
quitExits at once, without a bye.

Any command may add "peer":"ed25519:..." to pick the target; the default is the last peer that connected. Commands given before any peer connected are queued and delivered to the first one.

{"cmd":"send","th":"t1","subject":"Run the suite","text":"Please run make integration."}
{"cmd":"state","th":"t1","state":"waiting","note":"need the branch name"}
{"cmd":"blob","th":"t1","path":"/tmp/test-output.log","text":"log attached"}
{"cmd":"grant","sub":"ed25519:6EPXkq2TFR8tWi49c2x809PIBLePjuGFm-CQqb859bw","caps":["fs:read"],"ttl":3600}
{"cmd":"bye","reason":"done"}

Events (stdout)

EventFieldsWhen
identitykey, nameAt start.
listeningaddr, keyThe listener is up.
connectedkey, name, caps, aboutA handshake completed.
recvmsgA line arrived: the object as sent, t says which. Chunks come without their data.
sentid, tA command’s message went out.
ackedidThe peer acked a message of ours.
blobref, path, size, sha256A blob was received in full and written to path.
disconnectedreason, keyThe connection ended.
errordetailA command was refused, or something went wrong.
{"event":"recv","msg":{"t":"msg","id":"01M3NA0JGVBC89EAGW9YVS3SXP","ts":"2026-09-29T00:46:08.411Z","th":"t1","subject":"Run the suite","parts":[{"k":"text","text":"Please run make integration."}]}}
{"event":"acked","id":"01M3NA0K28VDXVSW0EZRFPG531"}
{"event":"blob","ref":"blob_44","path":"/home/me/.awp-py/blobs/df26.../blob_44","size":183422,"sha256":"73cf..."}