Expand description
Request routing for the agent API.
Each handler is a synchronous function that returns
Result<serde_json::Value, ApiError>. The dispatcher wraps the result
in an HTTP response — successes as 200 with the JSON body, structured
errors as 4xx/5xx with a JSON envelope.
Structs§
- ApiMerge
Session - Server-side wrapper around
MergeSessioncarrying the branch names that started the merge. The lex-vcs session itself only tracksOpIdheads; commit needs the dst branch name to advance the right head, and the src branch name is kept for round-trip auditability (“which branch did we merge from?”). - State
Enums§
- Visibility
- Whether a package is reachable without authentication.
Functions§
- handle
- handle_
with_ auth - Auth-gated entry point. Calls
auth(path, headers)before routing; returns 401 JSON when it returns false. Keeps auth logic out of the product-agnostic core. - route_
public - Unauthenticated, read-only access to public packages in
state’s store.pathis the portion of the URL after/v1/public/<tenant>(with a leading/); lex-hub resolves<tenant>→ store and calls this. Visibility gating, GET-only enforcement, and segment validation all live here so the whole public surface is auditable in one place.