# kcode-jsonrpc-wire
Pure, header-omitted JSON-RPC 2.0 value construction and validation for the
Codex app-server boundary. The crate has no transport, process, timeout,
retry, queue, or policy behavior.
`parse` accepts JSON object values and returns a typed request, notification,
or response. It rejects a `jsonrpc` header, mixed method/response shapes, and
any top-level member not allowed for the detected shape. Requests allow only
`id`, `method`, and optional `params`; notifications allow `method` and
optional `params`; responses allow `id` with exactly one of `result` or
`error`. Error objects allow `code`, `message`, and optional `data` only.
Missing `params` is `Value::Null`; supplied params must be null, an object, or
an array.
`PeerId` is exactly `Signed(i64)`, `Unsigned(u64)`, or `String(String)`. It
therefore cannot represent fractional JSON numbers. Parsing represents every
nonnegative integer fitting `i64` as `Signed`, larger nonnegative integers
fitting `u64` as `Unsigned`, and negative integers as `Signed`. Use
`PeerId::signed`, `PeerId::unsigned`, `as_i64`, `as_u64`, and `to_value` for
correlation and JSON conversion. `LocalRequestId` is the local `u64` request
namespace.
`request` and `notification` return `Result` and reject empty methods or
invalid params, so their successful values always parse. Response constructors
produce the corresponding strict response shapes.