Skip to main content

Crate khive_request

Crate khive_request 

Source
Expand description

khive-request — transport-agnostic DSL parser for verb-dispatch requests.

Re-exports§

pub use atomic::check_atomic_admissible;
pub use atomic::AtomicRejection;

Modules§

atomic
ADR-099 migration step 2 — parse-time rejection of atomic-inadmissible verbs.

Structs§

ParsedOp
A single parsed operation: tool name plus named argument bag.
ParsedRequest
Result of parsing a request input: a list of ops and their execution mode.

Enums§

ArgValue
An argument value in a ParsedOp: concrete JSON, a $prev path ref, or a nested container.
DslError
Parser error — surfaced as invalid_params at the MCP boundary.
ExecutionMode
Execution mode: Single (one op), Parallel ([...]), or Chain (op | op).

Constants§

MAX_OPS
Hard cap on operations per request.
MAX_OPS_INPUT_LEN
Hard cap on the byte length of a raw ops input string, checked before any parsing begins. A cheap O(1) first line of defense against pathological input; does not by itself bound container-nesting depth (see NESTING_DEPTH_LIMIT), since a compact payload can still pack tens of thousands of nesting levels into a few KiB.
NESTING_DEPTH_LIMIT
Hard cap on container-nesting depth ([/{) tracked through the DSL parser, the JSON-form pre-pass scan, and (by construction, since ArgValue::Array and ArgValue::Object are only ever built inside the depth-guarded parser functions) any $prev reference nested inside array/object literals.
RESERVED_ENVELOPE_ARGS
Names reserved at the request-envelope level; rejected if they appear inside verb args.

Functions§

parse_request
Parse a request input string into a single op or a batch.
value_nesting_within_limit
Iteratively check container-nesting depth of a runtime Value, returning false once nesting exceeds max_depth.
write_keys_for_op_pub
Extract substrate-prefixed write-conflict keys from one op for parallel-batch preflight.