Documentation
¶
Overview ¶
Package plugin serves the HTTP loopback plugin protocol (spec §19.4) and the stdio MCP companion (spec §19.3, mode 5). Both sit on internal/session and internal/store. Writes go through session and store only; search and session discovery use a read-only handle on the same database file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteTokenFile ¶
WriteTokenFile writes token to path readable only by the owner (0600).
Types ¶
type Config ¶
type Config struct {
Store *store.Store // required; the caller owns it and closes it
Project project.Resolved // required; every session of this instance belongs to it
// Token is the bearer token for every /__acd-ctx/plugin/ endpoint. Required,
// at least 32 characters. Generate it with NewToken.
Token string
ListenHost string // host of the listen address, accepted in the Host header
// AllowedHosts, when non-empty, is the exact Host name set (already normalized
// by the caller, see proxy.NormalizeHosts); it replaces the defaults.
AllowedHosts []string
Version string
// ContextLimit is used when runtime-info names no window. Default 200000.
ContextLimit int
// ExportDir receives the files of decompress mode file. Default: the
// project's exports directory (see exportsDir).
ExportDir string
Logger *slog.Logger // default: discard
}
Config wires the plugin handler. Store and DBPath name the same database.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is the http.Handler of the plugin protocol. It is safe for concurrent use.
type MCP ¶
type MCP struct {
// contains filtered or unexported fields
}
MCP is a stdio MCP server bound to the project of its working directory.
type MCPConfig ¶
type MCPConfig struct {
Store *store.Store // required; the caller owns it
DBPath string // required; the same database, opened read-only to find the latest session
Cwd string // project directory; default: the working directory
Markers []string // project root markers; default: go.mod, package.json, ...
Version string
Logger *slog.Logger // default: discard. Never stdout: stdout carries the protocol.
}
MCPConfig wires the stdio MCP companion.