httpapi

package
v1.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package httpapi provides the HTTP surface of vellum: health endpoint, the /mcp mount, and later the JSON REST API for the SPA (/api/*).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(version string, opts Options) http.Handler

NewRouter returns the root HTTP handler.

Types

type API added in v0.2.0

type API struct {
	Vault     *vault.Vault
	Index     *vault.Index
	Searcher  vault.Searcher
	Structure vault.Structure

	// Activity records sessions and events for the Connections/Activity
	// panels. Endpoint is the public MCP URL shown in those panels; Curator
	// reflects whether the curator tools are enabled. All optional.
	Activity *activity.Recorder
	Endpoint string
	Curator  bool
}

API is the JSON REST surface for the SPA, mirroring vault operations.

type Options added in v0.1.0

type Options struct {
	// MCPHandler, when set, is mounted at /mcp behind the origin check.
	MCPHandler http.Handler
	// API, when set, mounts the JSON REST surface under /api/*.
	API *API
	// SPA, when set, serves static files with an index.html fallback for
	// anything that is not /api/*, /mcp or an OAuth route (PHY-116 supplies
	// the embedded dist).
	SPA fs.FS
	// AllowedOrigins are the browser origins allowed to call /mcp and
	// /api. Same-origin requests and requests without an Origin header
	// (CLI clients) always pass.
	AllowedOrigins []string
	// Auth, when set, mounts the OAuth endpoints and guards /mcp + /api
	// with bearer verification. Nil = auth disabled, everything open.
	Auth *auth.Provider
	// CORSOrigins get CORS response headers (browser clients).
	CORSOrigins []string
	// Activity, when set, records MCP sessions and tool calls hitting /mcp.
	Activity *activity.Recorder
}

Options configure the router.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL