Port lease protocol
Source candidate for advisory TCP port leases (maia.port-lease/v1). Maia
supplies the tool; agents and Skills decide how to use the ports.
Operations
| Method | Kind | Exposure | Receipt | MCP tool |
|---|---|---|---|---|
port.lease.acquire | mutation | unsupported | yes | port_lease_acquire |
port.lease.renew | mutation | unsupported | yes | port_lease_renew |
port.lease.release | mutation | unsupported | yes | port_lease_release |
port.lease.list | read | unsupported | no | port_lease_list |
Exposure is Agent-definition eligibility, not a grant; worker eligibility
belongs to S18. Mutations need a commandId, and a retry with the same
command and input replays the first receipt.
Record
owneris{ kind: "session", sessionId }or, withoutsessionIdin the request, the calling principal{ kind: "principal", principalId }.portsholds 1 to 8 unique ports from 1024 to 65535, granted together.stateisactive,releasedorexpired. An ended lease names itsendReason:owner_released,session_ended,owner_missing(Node start found no such owner) orttl_expired.revisionstarts at1and advances by one for every recorded change: renew, release, and each automatic ending.grantedAt,expiresAtandupdatedAtare UTC timestamps; renew movesexpiresAtforward by the Node's time to live.
Requests
port.lease.acquire:commandId,purpose(^[a-z0-9][a-z0-9._-]{0,63}$), optionalsessionId,count(1 to 8, default 1) andpreferredport.port.lease.renew:commandId,leaseId,expectedRevision.port.lease.release:commandId,leaseId. Releasing an ended lease succeeds with a new receipt and leaves its state unchanged.port.lease.list:limit(1 to 100), optionalafterCursorandsessionId. Items are active leases, each with one bindprobesentry per port (inUseis true when something listens on it now), plus the Node'srange.
Errors
port_pool_exhausted, port_lease_not_found, port_lease_expired and
port_lease_conflict (PORT_LEASE_ERROR_CODES). Every object rejects excess
properties, and results bind the receipt to the exact lease, command, method
and revision.
Imported from Maia OS docs at a2175bb