Skip to main content

Module http_api

Module http_api 

Source
Expand description

HTTP API for WeftOS task execution.

Provides a lightweight HTTP endpoint that Paperclip (and other orchestrators) can call to submit tasks to the WeftOS kernel.

§Endpoints

  • POST /api/v1/execute – submit a task for agent execution
  • POST /api/v1/govern – evaluate a governance decision
  • GET /api/v1/health – liveness probe

§Feature Gate

This module is gated behind the http-api feature flag and is not included in the default feature set.

Structs§

ErrorResponse
Error response returned on failure.
ExecuteRequest
Request body for POST /api/v1/execute.
ExecuteResponse
Response body for POST /api/v1/execute.
GovernRequest
Request body for POST /api/v1/govern.
GovernResponse
Response body for POST /api/v1/govern.
HealthResponse
Health check response for GET /api/v1/health.
HttpApiHandler
The kernel-side HTTP API handler.

Enums§

Route
Route identifier for the HTTP API.

Functions§

dispatch
Dispatch a raw JSON body to the appropriate handler and return the JSON response bytes.
match_route
Parse a method + path pair into a Route.