moo.agent.iac

Client-side IAC (telnet subnegotiation) parser, encoder, and negotiator. Mirrors the server’s moo/shell/iac.py from the client role. See docs/source/explanation/agent-internals.md (IAC) for the design narrative.

Functions

encode_charset_request(charsets[, sep])

encode_cmd(cmd, opt)

encode_gmcp(module, data)

Encode a GMCP frame: IAC SB GMCP "<module> <json>" IAC SE.

encode_naws(width, height)

encode_sb(opt, payload)

Encode IAC SB <opt> <payload> IAC SE, doubling 0xFF in payload.

encode_ttype_is(value)

parse_gmcp(payload)

Inverse of encode_gmcp() — returns (module, data_or_None).

parse_mssp(payload)

Parse an MSSP payload into {name: [values...]}.

parse_ttype_subneg(payload)

Parse a TTYPE subnegotiation payload.

Classes

AgentIacNegotiator([client_name, ...])

Client-side IAC negotiator.

IacParser()

Byte-feed state machine for IAC sequences.