server

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 18 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BearerAuth added in v0.0.3

func BearerAuth(token string, exemptPaths ...string) func(http.Handler) http.Handler

BearerAuth creates middleware requiring a static bearer token on all requests. When token is empty or path is in exemptPaths, check is skipped (e.g. for /api/status).

func CORS added in v0.0.3

func CORS(allowedOrigins []string) func(http.Handler) http.Handler

CORS creates middleware that require CORS on all requests and handles preflight requests. When allowedOrigins is empty, the check is skipped. Pass "*" in allowedOrigins to permit any origin (Access-Control-Allow-Origin: *).

func TCPHandlerFromConfig added in v0.0.3

func TCPHandlerFromConfig(base http.Handler, authToken string, allowedOrigins []string, unauthenticatedStatus bool) http.Handler

TCPHandlerFromConfig builds the TCP middleware chain from config values.

Types

type AddInput

type AddInput struct {
	Content  string   `json:"content"  jsonschema:"the knowledge to store"`
	Category string   `json:"category" jsonschema:"memory category: avoidance, security, syntax, architecture, or domain"`
	Tags     []string `` /* 159-byte string literal not displayed */
	Scope    string   `json:"scope,omitempty"  jsonschema:"global, team, or project (default: project)"`
	Source   string   `json:"source,omitempty" jsonschema:"audit label, e.g. agent:2025-04-12 or manual"`
}

type AddOutput

type AddOutput struct {
	Status   string `json:"status"`
	ID       string `json:"id"`
	Scope    string `json:"scope"`
	Category string `json:"category"`
}

type ListHeadsInput

type ListHeadsInput struct{}

type ListHeadsOutput

type ListHeadsOutput struct {
	Heads []store.HeadInfo `json:"heads"`
}

type QueryInput

type QueryInput struct {
	Query      string   `` /* 186-byte string literal not displayed */
	Category   string   `` /* 134-byte string literal not displayed */
	Categories []string `` /* 138-byte string literal not displayed */
	TopK       int      `` /* 130-byte string literal not displayed */
	Scopes     []string `json:"scopes,omitempty"      jsonschema:"limit to specific scopes: global, team, or project — empty returns all scopes"`
}

type QueryOutput

type QueryOutput struct {
	Entries []QueryResult `json:"entries"`
}

type QueryResult

type QueryResult struct {
	ID       string   `json:"id,omitempty"`
	Content  string   `json:"content"`
	Category string   `json:"category"`
	Tags     []string `json:"tags,omitempty"`
	Scope    string   `json:"scope,omitempty"`
	Source   string   `json:"source,omitempty"`
}

type ReinforceInput

type ReinforceInput struct {
	ID    string  `` /* 231-byte string literal not displayed */
	Delta float64 `` /* 182-byte string literal not displayed */
}

type ReinforceOutput

type ReinforceOutput struct {
	Status string  `json:"status"`
	ID     string  `json:"id"`
	Delta  float64 `json:"delta"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(store store.Store, conf config.Config, logger *slog.Logger) *Server

NewServer injects dependencies and registers the tools.

func (*Server) McpServer

func (s *Server) McpServer() *mcp.Server

McpServer returns the underlying MCP server, e.g. for embedding in the daemon.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context) error

func (*Server) ServeStdio

func (s *Server) ServeStdio(ctx context.Context) error

ServeStdio runs the MCP server over stdin/stdout.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown shuts down the server.

Jump to

Keyboard shortcuts

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