Skip to main content

Crate server

Crate server 

Source

Constants§

ASSOCIATION_TOOLS
The fifteen a memory store advertises, in the order it lists them.
CODE_GRAPH_TOOLS
The three a code-graph store advertises: one tool to find, one to ask an arbitrary question, one to size the store.

Functions§

router
Build the HTTP router over db. Read endpoints take the read lock; /ingest takes the write lock. Guards are dropped before any .await. GET /watch upgrades to a WebSocket fed by the post-commit sink.
router_with_auth
router with an optional bearer/?token= requirement on every route except unauthenticated GET /health.
router_with_role_tokens
router with a full-access token and a map of role-bound tokens.
router_with_ui
Same as router_with_auth, then ServeDir as the fallback so API routes win.
router_with_ui_tls
Like router_with_ui but marks the connection as TLS-active so the auth cookie carries the Secure attribute. Use when the binary is serving directly over HTTPS (i.e. via serve_tls) rather than behind a proxy.
run_mcp_stdio
Run the MCP loop until reader hits EOF.
run_mcp_stdio_with
run_mcp_stdio, with the tool list chosen by the caller.
serve_with_role_tokens
[serve] with role-bound tokens in addition to the optional full-access token.
serve_with_ui_and_role_tokens
[serve_with_ui] with role-bound tokens.