Skip to main content

Module handlers

Module handlers 

Source
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§

ApiMergeSession
Server-side wrapper around MergeSession carrying the branch names that started the merge. The lex-vcs session itself only tracks OpId heads; 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

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.