stationserver

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeStation       = "station"
	ScopeStationLocker = "station-locker"
)

ScopeStation is required by every tool here. ScopeStationLocker is RESERVED and gates the locker tools, on the reasoning that reserved `comm-file` beside `comm`: splitting a shipped scope is a MAJOR, merging two is free.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	// Store is the knowledge base: it holds stations, their assets, and the keys this
	// endpoint authenticates. Unlike COMM's Deps.Store, this one is read AND written —
	// but only station tables. Nothing here writes a curated row.
	Store *store.Store
	// TokenLimiter is this endpoint's own rate bucket. Optional.
	TokenLimiter ratelimit.Limiter
	// Metrics is optional.
	Metrics *metrics.Registry
	// Hearsay reports whether an actor recently RECEIVED inter-session traffic, so a
	// note or task written mid-conversation is marked (§7). Optional: with COMM off it
	// is nil and the marking is simply absent — "no signal", never "known clean".
	Hearsay func(ctx context.Context, actorID int64) bool
	// Staffing reports, per station id, how many live COMM endpoints are reading for
	// it and when the freshest was last seen. Optional, and shaped as a hook for the
	// same reason Hearsay is: this package must not depend on COMM. With COMM off it
	// is nil and the directory OMITS reachability entirely rather than reporting
	// every station as unstaffed — "unknown" and "nobody is there" are different
	// facts, and a directory that conflates them is worse than one that says less.
	Staffing func(ctx context.Context) (map[string]StationStaffing, error)

	// Limits bound the assets. Every one is a BACKUP decision (S12). These are the
	// STARTING values; SetLimits replaces them live.
	TaskLimits   store.StationTaskLimits
	NoteLimits   store.StationNoteLimits
	LockerLimits store.StationLockerLimits
	// contains filtered or unexported fields
}

Deps are the collaborators for the station endpoint.

type Handler

type Handler struct {
	http.Handler
	// contains filtered or unexported fields
}

Handler is the station MCP endpoint.

func NewHTTPHandler

func NewHTTPHandler(d Deps) *Handler

NewHTTPHandler builds the endpoint: a streamable-HTTP MCP server wrapped in station-only bearer auth.

func (*Handler) SetLimits added in v1.5.0

SetLimits applies new bounds live. Zero-valued members keep their defaults, so a partially-filled struct cannot silently set a cap to zero — which for a retention bound would mean "prune everything".

type StationStaffing added in v1.6.0

type StationStaffing struct {
	Endpoints  int
	LastSeenAt string
}

StationStaffing is what COMM knows about who is actually at a station. Declared here rather than imported so the dependency runs one way: the wiring in cmd/ken adapts comm's own type into this one.

Jump to

Keyboard shortcuts

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