server

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

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   `` /* 183-byte string literal not displayed */
	Category string   `` /* 129-byte string literal not displayed */
	TopK     int      `json:"top_k,omitempty"    jsonschema:"maximum number of entries to return (default: 5)"`
	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 teh 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