Skip to main content

Module server_capabilities

Module server_capabilities 

Source
Expand description

GET /v1/capabilities — runtime discovery of what this lean-ctx instance supports, so any client (any language) can branch on real features instead of trial calls. The HTTP route lives in http_server; the payload builder lives here so it stays compiled (and drift-tested) without the http-server feature.

Contract: docs/contracts/capabilities-contract-v1.md. The set of TOP_LEVEL_KEYS is the stable contract surface and is bound to that doc by tests/capabilities_contract_up_to_date.rs.

Not to be confused with crate::core::capabilities, which models RBAC permissions (fs:read, …). This module describes server capabilities.

Constants§

LOCAL_ALWAYS_ON_FEATURES
Always-on local capabilities — free, ungated, unconditionally available in every build. The heart of the Local-Free Invariant (RFC §6): these must never depend on an account, license, or plan.
LOCAL_OPTIONAL_FEATURES
Local capabilities that are free but gated by compilation only (Cargo features) — never by account/license/plan.
TOP_LEVEL_KEYS
Stable, documented top-level keys of the capabilities document.

Functions§

capabilities_value
Build the capabilities document for this running instance.